Skip to content

Commit

Permalink
feat: S2 treeview (#7343)
Browse files Browse the repository at this point in the history
* Render a TreeView

* Correct styles

* update styles to better fix s2

* fix install

* fix lint, add preliminary test

* fix lint

* Add tests and test util

* save point

* Add emptyState

* fix lint

* detached styles

* detached styling with actions

* fix disabled, icon placement, and add examples

* fix lint

* update snapshots

* fix lint and tests

* fix imports

* Match row selection to table

* fix lint, again

* feat: S2 treeview virtualized (#7465)

* feature: s2 treeview virtualization

* support both detached and non in the layout

* fix lint

* fix height for docs

* default tree disabled behavior to all to match our other components

* fix tests

* update snapshots

* fix lint

* fix alignment and remove minwidth

* increase gap between detached items

* remove restriction for isDetached and isEmphasized

* fix border radius

* review comments

* fix lint
  • Loading branch information
snowystinger authored Jan 29, 2025
1 parent beb8bd5 commit e3ed3c7
Show file tree
Hide file tree
Showing 14 changed files with 1,030 additions and 56 deletions.
1 change: 1 addition & 0 deletions packages/@react-spectrum/s2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"@react-aria/i18n": "^3.12.5",
"@react-aria/interactions": "^3.23.0",
"@react-aria/live-announcer": "^3.4.1",
"@react-aria/tree": "3.0.0-beta.3",
"@react-aria/utils": "^3.27.0",
"@react-spectrum/utils": "^3.12.1",
"@react-stately/layout": "^4.1.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/@react-spectrum/s2/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
SubmenuTrigger as AriaSubmenuTrigger,
SubmenuTriggerProps as AriaSubmenuTriggerProps,
ContextValue,
DEFAULT_SLOT,
Provider,
Separator,
SeparatorProps
Expand Down Expand Up @@ -490,6 +491,7 @@ export function MenuItem(props: MenuItemProps) {
}],
[TextContext, {
slots: {
[DEFAULT_SLOT]: {styles: label({size})},
label: {styles: label({size})},
description: {styles: description({...renderProps, size})},
value: {styles: value}
Expand Down
Loading

1 comment on commit e3ed3c7

@rspbot
Copy link

@rspbot rspbot commented on e3ed3c7 Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.