Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TreeView): add experimental TreeView component (#6008)
* docs: import treeview styles * feat(TreeView): scaffold TreeView * feat(TreeNode): scaffold TreeNode * feat(treeview): init treeview styles * docs(TreeView): add TreeView story * fix(TreeNode): reposition node icons * refactor(TreeNode): rename event object * fix(treeview): modify spacing for nodes with icons * docs(TreeView): add value props and with icons story * refactor(TreeView): recursively calculate depth for offset * fix(treeview): reduce margin for nodes with icons * fix(treeview): set icon fill * feat(treeview): support disabled nodes * feat(TreeView): add tree node selection * feat(TreeView): add compact size support * refactor(TreeNode): consolidate shared props * fix(TreeNode): prevent selection handler on disabled nodes * docs(TreeView): add size prop * docs(TreeNode): define prop types * docs(TreeView): fix selected prop description * docs(TreeView): add prop types * refactor(TreeView): replace comma delimited selected string with array * feat(TreeView): allow deselection of selected nodes in multiselect mode * docs(TreeView): change selected proptype * fix(TreeNode): stop event propagation only on matched keys * feat(TreeView): support keyboard navigation * feat(TreeNode): enable keyboard selection of nodes * fix(TreeView): prevent page scroll on arrow keydown * chore(TreeView): add component index * fix(TreeView): replace document.activeElement reference * fix(TreeNode): remove tabindex from expandos * refactor(TreeView): target tree node class directly * fix(TreeView): prevent TreeWalker recreation on each render * refactor(TreeView): replace `onChange` with `onSelect` * fix(TreeView): set sequential-focusable node * docs(TreeView): set negative tabindex on interactive label element * fix(TreeNode): toggle aria-expanded based on expanded state * fix(TreeNode): set aria-selected on selected nodes * docs(TreeView): change tree node label demo from button to span * fix(TreeNode): set aria-selected on selected state * refactor(TreeNode): add currentNodeLabel ref * fix(TreeView): remove tabindex on disabled nodes * fix(treeview): remove toggle focus outline * feat(TreeView): support visible or hidden labels * fix(TreeNode): set tabindex for nested tree nodes * fix(TreeNode): add aria-disabled on disabled nodes * feat(TreeNode): add additional keyboard controls * chore: prettier * fix(TreeView): set preselected if array is not empty * feat(TreeView): separate tree and node selection handlers * fix(TreeNode): assign default expanded state when prop is nullish * test(TreeView): add test suite * feat(TreeNode): display checkmark icons for selected nodes * fix(TreeNode): use correct expanded state * chore: update snapshots * feat(TreeView): separate active and selected tree node styles * docs(TreeView): add active prop knob * docs(TreeView): recursively build tree examples * feat(TreeView): use IDs for active and selected nodes * fix(TreeNode): fire custom click handler when provided * fix(TreeNode): fire toggle handler with keyboard controls * feat(TreeNode): expand toggle handler function signature * test(TreeView): add IDs to sample markup * test(TreeView): consolidate test markup * chore: update snapshot * fix(TreeView): allow ctrl key multiselect for windows * feat(TreeNode): enable space key selection to match alternative patterns * docs(TreeNode): add onTreeSelect proptype * docs(TreeView): add JSX keys * chore: update snapshots * feat(TreeNode): include aria-selected attribute for any enabled node * chore: update snapshots * Revert "feat(TreeNode): display checkmark icons for selected nodes" This reverts commit 3642a9e. * feat(tree-view): disable pointer events on disabled nodes * feat(treeview): set selected node text color * chore: update snapshots * chore: use unstable prefix * docs(TreeView): relabel active knob * docs(TreeView): update example data * chore: prettier * fix(treeview): update caret rotation * refactor: function declarations * fix(TreeNode): set button type * Revert "chore: use unstable prefix" This reverts commit e5d29a1. * chore: use unstable prefix * chore: update snapshots * chore: rename export * chore: update snapshots * chore: update story format * refactor(TreeNode): replace toggle button with interactive span * docs(TreeView): create experimental warning in stories * chore: update snapshots * docs(TreeView): add unstable prefix to story name * feat(TreeNode): modify tabIndex on focus/blur to include mouse actions * chore: update snapshots * fix(TreeNode): show aria-expanded attribute when value is nullish * refactor(TreeNode): remove span type attribute * refactor(TreeNode): remove span tabIndex * chore: update snapshots * refactor(TreeView): extract tabIndex reset into helper function * feat(TreeView): create shared FocusEvent handler * chore: update snapshots * fix(TreeView): only act on tree node tabindices on focus * docs(TreeNode): add note on ESLint suppression Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information