Build a semi-accessible file explorer in React that displays files and directories in a hierarchical tree format with appropriate ARIA roles and properties.
Requirements:
- Display names of files and directories in a tree view.
- Directories:
- Can contain other directories and files.
- Should be expandable/collapsible by clicking.
- Should be displayed before files and sorted alphabetically.
- Can be empty.
- Files:
- Are leaf nodes and cannot be expanded.
- Indent contents to represent hierarchy visually.
- Accessibility:
- Use
role="tree" for the container.
- Use
role="treeitem" for each node.
- Directories should use
aria-expanded to indicate state.
- Nested content should have
role="group".
- Focus on correct roles/states, not keyboard navigation (semi-accessible).