@astryxdesign/core 0.1.9 → 0.2.0-canary.0f56f82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +107 -0
- package/dist/Avatar/Avatar.d.ts +42 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +190 -59
- package/dist/Avatar/AvatarStatusDot.d.ts +6 -4
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +7 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +58 -6
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +7 -2
- package/dist/Banner/Banner.js +2 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -4
- package/dist/Breadcrumbs/index.d.ts +1 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +2 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +6 -4
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +50 -9
- package/dist/Calendar/dayCellUtils.d.ts +4 -4
- package/dist/Calendar/dayCellUtils.js +2 -2
- package/dist/Calendar/styles.d.ts +30 -31
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +30 -31
- package/dist/Card/Card.js +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +22 -12
- package/dist/Chat/ChatComposerInput.js +1 -1
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +3 -1
- package/dist/Chat/ChatLayout.js +4 -4
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +8 -8
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +10 -3
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +6 -6
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +19 -4
- package/dist/Citation/Citation.d.ts +22 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -6
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +16 -10
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +3 -1
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +42 -3
- package/dist/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +23 -5
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +3 -1
- package/dist/DateInput/DateInput.d.ts +10 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +33 -19
- package/dist/DateRangeInput/DateRangeInput.d.ts +10 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +23 -20
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +23 -18
- package/dist/Divider/Divider.d.ts +2 -2
- package/dist/Divider/Divider.d.ts.map +1 -1
- package/dist/Divider/Divider.js +13 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +6 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +22 -5
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +5 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +8 -11
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +3 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +5 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +104 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +427 -0
- package/dist/DropdownMenu/index.d.ts +10 -0
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +13 -0
- package/dist/DropdownMenu/menuItemHover.d.ts +23 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemHover.js +33 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts +8 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemRoles.js +10 -1
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +21 -6
- package/dist/Field/Field.d.ts +3 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +4 -1
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +9 -5
- package/dist/Field/inputStyles.stylex.d.ts +1 -0
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +1 -0
- package/dist/FieldStatus/FieldStatus.d.ts +10 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +51 -5
- package/dist/FileInput/FileInput.d.ts +10 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +93 -65
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -4
- package/dist/Icon/Icon.d.ts +15 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +19 -3
- package/dist/Item/Item.d.ts +16 -3
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +31 -6
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +10 -2
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +19 -13
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +6 -3
- package/dist/List/ListItem.d.ts +11 -1
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +2 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -0
- package/dist/MetadataList/MetadataList.d.ts +1 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +4 -2
- package/dist/MultiSelector/MultiSelector.d.ts +9 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +80 -42
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts +10 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +22 -17
- package/dist/Outline/Outline.js +2 -2
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -3
- package/dist/PowerSearch/PowerSearch.d.ts +9 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +2 -0
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +6 -1
- package/dist/RadioList/RadioList.d.ts +2 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +49 -19
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +5 -3
- package/dist/Selector/Selector.d.ts +8 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +66 -17
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +5 -5
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +13 -10
- package/dist/SideNav/SideNavItem.d.ts +1 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +12 -10
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +2 -2
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +87 -34
- package/dist/Spinner/Spinner.d.ts +3 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +11 -2
- package/dist/Switch/Switch.d.ts +8 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +171 -91
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts +2 -11
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +5 -9
- package/dist/TabList/TabListContext.d.ts +0 -5
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +0 -5
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +30 -4
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +15 -11
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +37 -27
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +3 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +15 -7
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +29 -23
- package/dist/Table/types.d.ts +32 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/TextArea/TextArea.d.ts +10 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +18 -19
- package/dist/TextInput/TextInput.d.ts +10 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -17
- package/dist/Thumbnail/Thumbnail.js +2 -2
- package/dist/TimeInput/TimeInput.d.ts +10 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +17 -17
- package/dist/Timestamp/Timestamp.d.ts +31 -3
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +47 -76
- package/dist/Timestamp/formatInstant.d.ts +41 -0
- package/dist/Timestamp/formatInstant.d.ts.map +1 -0
- package/dist/Timestamp/formatInstant.js +177 -0
- package/dist/Timestamp/index.d.ts +1 -0
- package/dist/Timestamp/index.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.d.ts +56 -0
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -0
- package/dist/Timestamp/tooltipEntries.js +163 -0
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +61 -9
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +3 -1
- package/dist/Token/Token.d.ts +34 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +85 -45
- package/dist/Token/TokenLink.d.ts +62 -0
- package/dist/Token/TokenLink.d.ts.map +1 -0
- package/dist/Token/TokenLink.js +76 -0
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts +9 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +4 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +17 -1
- package/dist/TopNav/TopNavItem.d.ts +3 -1
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +30 -3
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +9 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +8 -6
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +32 -14
- package/dist/Typeahead/BaseTypeahead.d.ts +9 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +22 -11
- package/dist/Typeahead/Typeahead.d.ts +9 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +11 -2
- package/dist/Typeahead/TypeaheadItem.d.ts +1 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +20 -10
- package/dist/astryx.css +74 -33
- package/dist/astryx.umd.js +51 -51
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/isRtlElement.d.ts +18 -0
- package/dist/hooks/isRtlElement.d.ts.map +1 -0
- package/dist/hooks/isRtlElement.js +27 -0
- package/dist/hooks/useAnnounce.d.ts +3 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +39 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +52 -11
- package/dist/hooks/useGridFocus.d.ts +6 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +12 -9
- package/dist/hooks/useHotkeys.d.ts +9 -0
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +9 -0
- package/dist/hooks/useInputStatusIcon.d.ts +38 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -0
- package/dist/hooks/useInputStatusIcon.js +169 -0
- package/dist/hooks/useKeyboardHint.d.ts +1 -1
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +4 -2
- package/dist/hooks/useListFocus.d.ts +39 -1
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +54 -9
- package/dist/i18n/InternationalizationContext.d.ts +1 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -0
- package/dist/i18n/InternationalizationProvider.d.ts +8 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +5 -1
- package/dist/i18n/getLocaleDirection.d.ts +18 -0
- package/dist/i18n/getLocaleDirection.d.ts.map +1 -0
- package/dist/i18n/getLocaleDirection.js +29 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -1
- package/dist/i18n/useDirection.d.ts +2 -0
- package/dist/i18n/useDirection.d.ts.map +1 -0
- package/dist/i18n/useDirection.js +27 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/plainDate.d.ts +17 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +23 -4
- package/dist/utils/rtlStyles.d.ts +24 -0
- package/dist/utils/rtlStyles.d.ts.map +1 -0
- package/dist/utils/rtlStyles.js +27 -0
- package/locales/en.json +112 -0
- package/locales/pseudo.json +84 -0
- package/package.json +6 -1
- package/src/Avatar/Avatar.doc.mjs +50 -3
- package/src/Avatar/Avatar.test.tsx +218 -0
- package/src/Avatar/Avatar.tsx +285 -79
- package/src/Avatar/AvatarStatusDot.doc.mjs +4 -4
- package/src/Avatar/AvatarStatusDot.tsx +6 -4
- package/src/AvatarGroup/AvatarGroup.doc.mjs +2 -0
- package/src/AvatarGroup/AvatarGroup.test.tsx +162 -2
- package/src/AvatarGroup/AvatarGroup.tsx +58 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +5 -2
- package/src/Banner/Banner.tsx +6 -6
- package/src/Breadcrumbs/BreadcrumbItem.tsx +10 -10
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +52 -1
- package/src/Breadcrumbs/index.ts +4 -0
- package/src/Button/Button.doc.mjs +0 -4
- package/src/Button/Button.test.tsx +16 -0
- package/src/Button/Button.tsx +6 -4
- package/src/Calendar/Calendar.test.tsx +170 -20
- package/src/Calendar/Calendar.tsx +73 -16
- package/src/Calendar/dayCellUtils.test.ts +18 -18
- package/src/Calendar/dayCellUtils.ts +2 -2
- package/src/Calendar/styles.ts +33 -39
- package/src/Card/Card.tsx +1 -1
- package/src/Carousel/Carousel.tsx +25 -6
- package/src/Chat/ChatComposer.doc.mjs +2 -2
- package/src/Chat/ChatComposerInput.doc.mjs +1 -1
- package/src/Chat/ChatComposerInput.tsx +2 -2
- package/src/Chat/ChatDictationButton.tsx +7 -1
- package/src/Chat/ChatLayout.tsx +4 -4
- package/src/Chat/ChatMessageBubble.tsx +15 -10
- package/src/Chat/ChatSystemMessage.test.tsx +5 -0
- package/src/Chat/ChatToolCalls.tsx +9 -2
- package/src/Chat/useTriggerMenu.tsx +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +6 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +23 -0
- package/src/CheckboxInput/CheckboxInput.tsx +21 -6
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -0
- package/src/CheckboxList/CheckboxList.test.tsx +94 -3
- package/src/CheckboxList/CheckboxListItem.tsx +17 -10
- package/src/Citation/Citation.doc.mjs +4 -3
- package/src/Citation/Citation.test.tsx +97 -0
- package/src/Citation/Citation.tsx +43 -11
- package/src/CodeBlock/CodeBlock.test.tsx +17 -0
- package/src/CodeBlock/CodeBlock.tsx +38 -11
- package/src/Collapsible/Collapsible.doc.mjs +1 -0
- package/src/Collapsible/Collapsible.test.tsx +7 -0
- package/src/Collapsible/Collapsible.tsx +16 -6
- package/src/CommandPalette/CommandPalette.test.tsx +95 -1
- package/src/CommandPalette/CommandPalette.tsx +41 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +59 -2
- package/src/ContextMenu/ContextMenu.tsx +22 -11
- package/src/ContextMenu/index.ts +5 -0
- package/src/DateInput/DateInput.doc.mjs +25 -0
- package/src/DateInput/DateInput.test.tsx +230 -0
- package/src/DateInput/DateInput.tsx +51 -29
- package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +140 -0
- package/src/DateRangeInput/DateRangeInput.tsx +42 -30
- package/src/DateTimeInput/DateTimeInput.doc.mjs +22 -1
- package/src/DateTimeInput/DateTimeInput.test.tsx +112 -0
- package/src/DateTimeInput/DateTimeInput.tsx +44 -39
- package/src/Divider/Divider.test.tsx +32 -8
- package/src/Divider/Divider.tsx +14 -1
- package/src/DropdownMenu/DropdownMenu.test.tsx +60 -0
- package/src/DropdownMenu/DropdownMenu.tsx +31 -12
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuItem.tsx +9 -3
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +4 -12
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +9 -10
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +9 -3
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +20 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +88 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +635 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +553 -0
- package/src/DropdownMenu/index.ts +16 -0
- package/src/DropdownMenu/menuItemHover.ts +39 -0
- package/src/DropdownMenu/menuItemRoles.ts +9 -0
- package/src/DropdownMenu/renderDropdownItems.tsx +29 -15
- package/src/Field/Field.doc.mjs +4 -0
- package/src/Field/Field.tsx +14 -9
- package/src/Field/FieldLabel.test.tsx +25 -0
- package/src/Field/FieldLabel.tsx +12 -3
- package/src/Field/inputStyles.stylex.ts +2 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +1 -0
- package/src/FieldStatus/FieldStatus.test.tsx +133 -0
- package/src/FieldStatus/FieldStatus.tsx +61 -4
- package/src/FileInput/FileInput.doc.mjs +23 -2
- package/src/FileInput/FileInput.test.tsx +104 -13
- package/src/FileInput/FileInput.tsx +106 -79
- package/src/HoverCard/useHoverCard.tsx +15 -3
- package/src/Icon/Icon.doc.mjs +13 -0
- package/src/Icon/Icon.test.tsx +89 -0
- package/src/Icon/Icon.tsx +51 -3
- package/src/Item/Item.doc.mjs +5 -0
- package/src/Item/Item.test.tsx +88 -0
- package/src/Item/Item.tsx +57 -11
- package/src/Layer/layerAnimations.stylex.ts +23 -0
- package/src/Lightbox/Lightbox.tsx +15 -7
- package/src/List/List.test.tsx +17 -29
- package/src/List/List.tsx +6 -1
- package/src/List/ListItem.doc.mjs +12 -0
- package/src/List/ListItem.tsx +13 -0
- package/src/Markdown/Markdown.test.tsx +21 -0
- package/src/Markdown/Markdown.tsx +4 -0
- package/src/MetadataList/MetadataList.test.tsx +24 -0
- package/src/MetadataList/MetadataList.tsx +6 -2
- package/src/MultiSelector/MultiSelector.doc.mjs +20 -0
- package/src/MultiSelector/MultiSelector.test.tsx +402 -0
- package/src/MultiSelector/MultiSelector.tsx +120 -59
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +21 -0
- package/src/NumberInput/NumberInput.test.tsx +71 -0
- package/src/NumberInput/NumberInput.tsx +35 -26
- package/src/Outline/Outline.test.tsx +12 -12
- package/src/Outline/Outline.tsx +2 -2
- package/src/Pagination/Pagination.tsx +11 -3
- package/src/PowerSearch/PowerSearch.doc.mjs +15 -0
- package/src/PowerSearch/PowerSearch.test.tsx +23 -0
- package/src/PowerSearch/PowerSearch.tsx +10 -1
- package/src/ProgressBar/ProgressBar.test.tsx +34 -0
- package/src/ProgressBar/ProgressBar.tsx +16 -1
- package/src/RadioList/RadioList.doc.mjs +6 -0
- package/src/RadioList/RadioList.test.tsx +26 -4
- package/src/RadioList/RadioList.tsx +2 -2
- package/src/RadioList/RadioListItem.tsx +12 -5
- package/src/Resizable/ResizeHandle.test.tsx +94 -0
- package/src/Resizable/ResizeHandle.tsx +70 -20
- package/src/SegmentedControl/SegmentedControl.test.tsx +28 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +22 -2
- package/src/Selector/Selector.doc.mjs +15 -0
- package/src/Selector/Selector.test.tsx +370 -0
- package/src/Selector/Selector.tsx +88 -20
- package/src/SideNav/SideNav.tsx +1 -8
- package/src/SideNav/SideNavCollapseButton.tsx +9 -7
- package/src/SideNav/SideNavItem.tsx +5 -3
- package/src/Skeleton/Skeleton.test.tsx +16 -0
- package/src/Skeleton/Skeleton.tsx +13 -1
- package/src/Slider/Slider.doc.mjs +6 -0
- package/src/Slider/Slider.test.tsx +240 -12
- package/src/Slider/Slider.tsx +96 -23
- package/src/Spinner/Spinner.test.tsx +10 -8
- package/src/Spinner/Spinner.tsx +15 -5
- package/src/Switch/Switch.doc.mjs +142 -42
- package/src/Switch/Switch.test.tsx +111 -0
- package/src/Switch/Switch.tsx +149 -32
- package/src/TabList/Tab.tsx +2 -2
- package/src/TabList/TabList.doc.mjs +0 -6
- package/src/TabList/TabList.test.tsx +3 -15
- package/src/TabList/TabList.tsx +6 -17
- package/src/TabList/TabListContext.ts +0 -6
- package/src/TabList/TabMenu.tsx +2 -2
- package/src/Table/BaseTable.tsx +34 -2
- package/src/Table/Table.doc.mjs +11 -0
- package/src/Table/Table.test.tsx +85 -0
- package/src/Table/TableCell.tsx +3 -3
- package/src/Table/TableHeaderCell.tsx +3 -3
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +9 -6
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +19 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +27 -18
- package/src/Table/plugins/selection/useTableSelection.test.tsx +61 -3
- package/src/Table/plugins/selection/useTableSelection.tsx +3 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +38 -9
- package/src/Table/plugins/tree/useTableTreeData.tsx +17 -13
- package/src/Table/types.ts +33 -0
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/TextArea/TextArea.doc.mjs +21 -0
- package/src/TextArea/TextArea.test.tsx +23 -0
- package/src/TextArea/TextArea.tsx +27 -26
- package/src/TextInput/TextInput.doc.mjs +21 -0
- package/src/TextInput/TextInput.test.tsx +150 -0
- package/src/TextInput/TextInput.tsx +28 -25
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
- package/src/Thumbnail/Thumbnail.tsx +1 -1
- package/src/TimeInput/TimeInput.doc.mjs +21 -0
- package/src/TimeInput/TimeInput.test.tsx +23 -0
- package/src/TimeInput/TimeInput.tsx +24 -25
- package/src/Timestamp/Timestamp.doc.mjs +32 -6
- package/src/Timestamp/Timestamp.test.tsx +371 -0
- package/src/Timestamp/Timestamp.tsx +96 -93
- package/src/Timestamp/formatInstant.ts +218 -0
- package/src/Timestamp/index.ts +4 -0
- package/src/Timestamp/tooltipEntries.test.ts +552 -0
- package/src/Timestamp/tooltipEntries.ts +210 -0
- package/src/Toast/ToastViewport.test.tsx +218 -8
- package/src/Toast/ToastViewport.tsx +71 -12
- package/src/ToggleButton/ToggleButton.test.tsx +24 -0
- package/src/ToggleButton/ToggleButton.tsx +19 -1
- package/src/Token/Token.test.tsx +166 -15
- package/src/Token/Token.tsx +104 -47
- package/src/Token/TokenLink.tsx +107 -0
- package/src/Token/index.ts +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +23 -1
- package/src/Tokenizer/Tokenizer.test.tsx +23 -0
- package/src/Tokenizer/Tokenizer.tsx +14 -2
- package/src/Tooltip/Tooltip.test.tsx +46 -0
- package/src/Tooltip/useTooltip.tsx +20 -0
- package/src/TopNav/TopNav.test.tsx +93 -2
- package/src/TopNav/TopNavItem.doc.mjs +3 -3
- package/src/TopNav/TopNavItem.tsx +35 -6
- package/src/TopNav/TopNavMegaMenu.tsx +26 -2
- package/src/TopNav/TopNavMegaMenuFeaturedCard.doc.mjs +1 -1
- package/src/TreeList/TreeList.doc.mjs +6 -0
- package/src/TreeList/TreeList.test.tsx +50 -10
- package/src/TreeList/TreeList.tsx +5 -0
- package/src/TreeList/TreeListBranches.tsx +8 -6
- package/src/TreeList/TreeListItem.tsx +33 -11
- package/src/Typeahead/BaseTypeahead.tsx +42 -15
- package/src/Typeahead/Typeahead.doc.mjs +13 -0
- package/src/Typeahead/Typeahead.test.tsx +112 -0
- package/src/Typeahead/Typeahead.tsx +17 -1
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/__tests__/forcedColors.ts +60 -0
- package/src/__tests__/inputWidthContract.test.tsx +62 -0
- package/src/doc-mjs.d.ts +19 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/isRtlElement.ts +27 -0
- package/src/hooks/useAnnounce.test.tsx +75 -2
- package/src/hooks/useAnnounce.ts +47 -1
- package/src/hooks/useFocusTrap.test.tsx +104 -0
- package/src/hooks/useFocusTrap.ts +61 -12
- package/src/hooks/useGridFocus.doc.mjs +3 -3
- package/src/hooks/useGridFocus.test.tsx +41 -0
- package/src/hooks/useGridFocus.ts +21 -10
- package/src/hooks/useHotkeys.ts +9 -0
- package/src/hooks/useInputStatusIcon.test.tsx +221 -0
- package/src/hooks/useInputStatusIcon.tsx +235 -0
- package/src/hooks/useKeyboardHint.test.tsx +22 -0
- package/src/hooks/useKeyboardHint.tsx +6 -2
- package/src/hooks/useListFocus.doc.mjs +25 -3
- package/src/hooks/useListFocus.test.tsx +153 -1
- package/src/hooks/useListFocus.ts +102 -9
- package/src/i18n/InternationalizationContext.ts +4 -0
- package/src/i18n/InternationalizationProvider.tsx +12 -2
- package/src/i18n/__tests__/getLocaleDirection.test.ts +40 -0
- package/src/i18n/__tests__/useDirection.test.tsx +66 -0
- package/src/i18n/getLocaleDirection.ts +29 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/useDirection.ts +29 -0
- package/src/reset.css +0 -26
- package/src/reset.test.ts +60 -0
- package/src/theme/derivedVarRegistry.test.ts +1 -0
- package/src/theme/derivedVarRegistry.ts +6 -0
- package/src/theme/generateThemeRules.test.ts +42 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/plainDate.test.ts +24 -6
- package/src/utils/plainDate.ts +18 -4
- package/src/utils/rtlStyles.ts +27 -0
|
@@ -221,4 +221,50 @@ describe('Tooltip', () => {
|
|
|
221
221
|
expect(onOpenChange).not.toHaveBeenCalledWith(false);
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
|
+
|
|
225
|
+
describe('press-to-dismiss', () => {
|
|
226
|
+
it('hides the tooltip when the trigger is pressed', async () => {
|
|
227
|
+
const onOpenChange = vi.fn();
|
|
228
|
+
render(
|
|
229
|
+
<Tooltip content="Copy link" onOpenChange={onOpenChange} delay={0}>
|
|
230
|
+
<button type="button">Trigger</button>
|
|
231
|
+
</Tooltip>,
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
const trigger = screen.getByRole('button', {name: 'Trigger'});
|
|
235
|
+
fireEvent.mouseEnter(trigger);
|
|
236
|
+
await waitFor(() => {
|
|
237
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
fireEvent.pointerDown(trigger);
|
|
241
|
+
await waitFor(() => {
|
|
242
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('does not press-dismiss a controlled tooltip', async () => {
|
|
247
|
+
const onOpenChange = vi.fn();
|
|
248
|
+
render(
|
|
249
|
+
<Tooltip
|
|
250
|
+
content="Controlled"
|
|
251
|
+
isOpen
|
|
252
|
+
onOpenChange={onOpenChange}
|
|
253
|
+
delay={0}>
|
|
254
|
+
<button type="button">Trigger</button>
|
|
255
|
+
</Tooltip>,
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
const trigger = screen.getByRole('button', {name: 'Trigger'});
|
|
259
|
+
await waitFor(() => {
|
|
260
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
|
261
|
+
});
|
|
262
|
+
onOpenChange.mockClear();
|
|
263
|
+
|
|
264
|
+
fireEvent.pointerDown(trigger);
|
|
265
|
+
// Give any (incorrect) async hide a chance to run.
|
|
266
|
+
await new Promise(r => setTimeout(r, 20));
|
|
267
|
+
expect(onOpenChange).not.toHaveBeenCalledWith(false);
|
|
268
|
+
});
|
|
269
|
+
});
|
|
224
270
|
});
|
|
@@ -366,6 +366,19 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
366
366
|
scheduleHide();
|
|
367
367
|
}, [scheduleHide]);
|
|
368
368
|
|
|
369
|
+
// Pressing the trigger hides its own tooltip: once the control is activated
|
|
370
|
+
// the hint has served its purpose, and a tooltip lingering over a
|
|
371
|
+
// just-pressed control reads as stale. Fires on pointerdown so it feels
|
|
372
|
+
// immediate. Uncontrolled tooltips only — a controlled tooltip's visibility
|
|
373
|
+
// is owned by the consumer. `layer.hide()` self-guards when already closed.
|
|
374
|
+
const handlePointerDown = useCallback(() => {
|
|
375
|
+
if (isOpen !== undefined) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
clearTimeouts();
|
|
379
|
+
layer.hide();
|
|
380
|
+
}, [isOpen, clearTimeouts, layer]);
|
|
381
|
+
|
|
369
382
|
// Interaction ref that handles event listeners only
|
|
370
383
|
const interactionRef: RefCallback<HTMLElement> = useCallback(
|
|
371
384
|
(el: HTMLElement | null) => {
|
|
@@ -375,12 +388,18 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
375
388
|
triggerRef.current.removeEventListener('mouseleave', handleMouseLeave);
|
|
376
389
|
triggerRef.current.removeEventListener('focusin', handleFocusIn);
|
|
377
390
|
triggerRef.current.removeEventListener('focusout', handleFocusOut);
|
|
391
|
+
triggerRef.current.removeEventListener(
|
|
392
|
+
'pointerdown',
|
|
393
|
+
handlePointerDown,
|
|
394
|
+
);
|
|
378
395
|
}
|
|
379
396
|
|
|
380
397
|
if (el) {
|
|
381
398
|
// Attach hover listeners
|
|
382
399
|
el.addEventListener('mouseenter', handleMouseEnter);
|
|
383
400
|
el.addEventListener('mouseleave', handleMouseLeave);
|
|
401
|
+
// Press-to-dismiss: activating the trigger hides its own tooltip.
|
|
402
|
+
el.addEventListener('pointerdown', handlePointerDown);
|
|
384
403
|
|
|
385
404
|
// Attach focus listeners based on focusTrigger option
|
|
386
405
|
const shouldAttachFocus =
|
|
@@ -401,6 +420,7 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
401
420
|
handleMouseLeave,
|
|
402
421
|
handleFocusIn,
|
|
403
422
|
handleFocusOut,
|
|
423
|
+
handlePointerDown,
|
|
404
424
|
],
|
|
405
425
|
);
|
|
406
426
|
|
|
@@ -420,12 +420,103 @@ describe('TopNavItem', () => {
|
|
|
420
420
|
|
|
421
421
|
it('applies aria-disabled when isDisabled', () => {
|
|
422
422
|
render(<TopNavItem label="Home" href="#" isDisabled />);
|
|
423
|
-
expect(screen.
|
|
423
|
+
expect(screen.getByText('Home').closest('a')).toHaveAttribute(
|
|
424
|
+
'aria-disabled',
|
|
425
|
+
'true',
|
|
426
|
+
);
|
|
424
427
|
});
|
|
425
428
|
|
|
426
429
|
it('sets tabIndex to -1 when disabled', () => {
|
|
427
430
|
render(<TopNavItem label="Home" href="#" isDisabled />);
|
|
428
|
-
expect(screen.
|
|
431
|
+
expect(screen.getByText('Home').closest('a')).toHaveAttribute(
|
|
432
|
+
'tabIndex',
|
|
433
|
+
'-1',
|
|
434
|
+
);
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
describe('disabled items do not navigate', () => {
|
|
438
|
+
it('drops href/target and suppresses clicks when disabled (default mode)', () => {
|
|
439
|
+
const handleClick = vi.fn();
|
|
440
|
+
render(
|
|
441
|
+
<TopNavItem
|
|
442
|
+
label="Home"
|
|
443
|
+
href="/home"
|
|
444
|
+
target="_blank"
|
|
445
|
+
onClick={handleClick}
|
|
446
|
+
isDisabled
|
|
447
|
+
/>,
|
|
448
|
+
);
|
|
449
|
+
// An href-less anchor exposes no link role, so it is not announced
|
|
450
|
+
// with a live destination.
|
|
451
|
+
expect(screen.queryByRole('link')).not.toBeInTheDocument();
|
|
452
|
+
const item = screen.getByText('Home').closest('a') as HTMLAnchorElement;
|
|
453
|
+
expect(item).not.toHaveAttribute('href');
|
|
454
|
+
expect(item).not.toHaveAttribute('target');
|
|
455
|
+
expect(item).toHaveAttribute('aria-disabled', 'true');
|
|
456
|
+
expect(item).toHaveAttribute('tabIndex', '-1');
|
|
457
|
+
|
|
458
|
+
// fireEvent bypasses pointer-events: none, simulating programmatic/AT
|
|
459
|
+
// activation. It returns false when preventDefault was called, i.e.
|
|
460
|
+
// any default navigation behavior is cancelled.
|
|
461
|
+
const notCancelled = fireEvent.click(item);
|
|
462
|
+
expect(notCancelled).toBe(false);
|
|
463
|
+
expect(handleClick).not.toHaveBeenCalled();
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
it('drops href/target and suppresses clicks when disabled (drawer mode)', () => {
|
|
467
|
+
const handleClick = vi.fn();
|
|
468
|
+
render(
|
|
469
|
+
<TopNavRenderContext value="drawer">
|
|
470
|
+
<TopNavItem
|
|
471
|
+
label="Home"
|
|
472
|
+
href="/home"
|
|
473
|
+
target="_blank"
|
|
474
|
+
onClick={handleClick}
|
|
475
|
+
isDisabled
|
|
476
|
+
/>
|
|
477
|
+
</TopNavRenderContext>,
|
|
478
|
+
);
|
|
479
|
+
expect(screen.queryByRole('link')).not.toBeInTheDocument();
|
|
480
|
+
const item = screen.getByText('Home').closest('a') as HTMLAnchorElement;
|
|
481
|
+
expect(item).not.toHaveAttribute('href');
|
|
482
|
+
expect(item).not.toHaveAttribute('target');
|
|
483
|
+
expect(item).toHaveAttribute('aria-disabled', 'true');
|
|
484
|
+
expect(item).toHaveAttribute('tabIndex', '-1');
|
|
485
|
+
|
|
486
|
+
// fireEvent bypasses pointer-events: none, simulating programmatic/AT
|
|
487
|
+
// activation. It returns false when preventDefault was called.
|
|
488
|
+
const notCancelled = fireEvent.click(item);
|
|
489
|
+
expect(notCancelled).toBe(false);
|
|
490
|
+
expect(handleClick).not.toHaveBeenCalled();
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
it('keeps href and click behavior for enabled items (default mode)', async () => {
|
|
494
|
+
const user = userEvent.setup();
|
|
495
|
+
const handleClick = vi.fn();
|
|
496
|
+
render(<TopNavItem label="Home" href="#" onClick={handleClick} />);
|
|
497
|
+
const link = screen.getByRole('link', {name: 'Home'});
|
|
498
|
+
expect(link).toHaveAttribute('href', '#');
|
|
499
|
+
expect(link).not.toHaveAttribute('aria-disabled');
|
|
500
|
+
|
|
501
|
+
await user.click(link);
|
|
502
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it('keeps href and click behavior for enabled items (drawer mode)', async () => {
|
|
506
|
+
const user = userEvent.setup();
|
|
507
|
+
const handleClick = vi.fn();
|
|
508
|
+
render(
|
|
509
|
+
<TopNavRenderContext value="drawer">
|
|
510
|
+
<TopNavItem label="Home" href="#" onClick={handleClick} />
|
|
511
|
+
</TopNavRenderContext>,
|
|
512
|
+
);
|
|
513
|
+
const link = screen.getByRole('link', {name: 'Home'});
|
|
514
|
+
expect(link).toHaveAttribute('href', '#');
|
|
515
|
+
expect(link).not.toHaveAttribute('aria-disabled');
|
|
516
|
+
|
|
517
|
+
await user.click(link);
|
|
518
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
519
|
+
});
|
|
429
520
|
});
|
|
430
521
|
|
|
431
522
|
it('renders icon with label', () => {
|
|
@@ -29,7 +29,7 @@ export const docs = {
|
|
|
29
29
|
{
|
|
30
30
|
name: 'isDisabled',
|
|
31
31
|
type: 'boolean',
|
|
32
|
-
description: 'Whether the nav item is disabled. Sets aria-disabled and prevents interaction.',
|
|
32
|
+
description: 'Whether the nav item is disabled. Sets aria-disabled, drops href/target so the item cannot navigate, and prevents interaction.',
|
|
33
33
|
default: 'false',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
@@ -91,7 +91,7 @@ export const docsZh = {
|
|
|
91
91
|
{
|
|
92
92
|
name: 'isDisabled',
|
|
93
93
|
type: 'boolean',
|
|
94
|
-
description: '导航项是否被禁用。设置 aria-disabled
|
|
94
|
+
description: '导航项是否被禁用。设置 aria-disabled,移除 href/target 使其无法导航,并阻止交互。',
|
|
95
95
|
default: 'false',
|
|
96
96
|
},
|
|
97
97
|
{
|
|
@@ -121,7 +121,7 @@ export const docsDense = {
|
|
|
121
121
|
label: 'Visible text or aria-label when isIconOnly is true.',
|
|
122
122
|
href: 'Navigation URL.',
|
|
123
123
|
isSelected: 'Sets aria-current="page"+highlighted styles.',
|
|
124
|
-
isDisabled: 'Sets aria-disabled, prevents interaction.',
|
|
124
|
+
isDisabled: 'Sets aria-disabled, drops href/target (no navigation), prevents interaction.',
|
|
125
125
|
icon: 'Icon before label.',
|
|
126
126
|
children: 'Custom content instead of label text.',
|
|
127
127
|
as: 'Custom link component. Overrides LinkProvider default. Must accept href, className, style, children.',
|
|
@@ -131,6 +131,8 @@ export interface TopNavItemProps extends BaseProps<HTMLAnchorElement> {
|
|
|
131
131
|
isSelected?: boolean;
|
|
132
132
|
/**
|
|
133
133
|
* Whether the nav item is disabled.
|
|
134
|
+
* A disabled item renders as a plain anchor without an href (and without
|
|
135
|
+
* target), so it cannot navigate and is removed from the tab order.
|
|
134
136
|
* @default false
|
|
135
137
|
*/
|
|
136
138
|
isDisabled?: boolean;
|
|
@@ -157,6 +159,15 @@ export interface TopNavItemProps extends BaseProps<HTMLAnchorElement> {
|
|
|
157
159
|
size?: NavItemSize;
|
|
158
160
|
}
|
|
159
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Click handler for disabled items. The disabled anchor renders without an
|
|
164
|
+
* href, so there is no navigation to block in practice; preventDefault is a
|
|
165
|
+
* defensive guard against synthetic/programmatic clicks.
|
|
166
|
+
*/
|
|
167
|
+
function preventDefaultClick(event: React.MouseEvent<HTMLAnchorElement>): void {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
}
|
|
170
|
+
|
|
160
171
|
/**
|
|
161
172
|
* A navigation item for use within TopNav startContent.
|
|
162
173
|
*
|
|
@@ -178,6 +189,9 @@ export interface TopNavItemProps extends BaseProps<HTMLAnchorElement> {
|
|
|
178
189
|
*/
|
|
179
190
|
export function TopNavItem({
|
|
180
191
|
as,
|
|
192
|
+
href,
|
|
193
|
+
target,
|
|
194
|
+
onClick,
|
|
181
195
|
label,
|
|
182
196
|
isSelected = false,
|
|
183
197
|
isDisabled = false,
|
|
@@ -195,22 +209,34 @@ export function TopNavItem({
|
|
|
195
209
|
const renderMode = useTopNavRenderMode();
|
|
196
210
|
const {closeMobileNav} = useAppShellMobile();
|
|
197
211
|
|
|
212
|
+
// A disabled item renders as a plain <a> with no href: an href-less anchor
|
|
213
|
+
// is not focusable and exposes no link affordance, so programmatic focus +
|
|
214
|
+
// Enter, AT activation commands, and middle-click cannot navigate or fire
|
|
215
|
+
// the consumer onClick. The router LinkComponent is deliberately skipped —
|
|
216
|
+
// a disabled item performs no navigation, and custom router links may
|
|
217
|
+
// require a live href. target is omitted with the href. (Mirrors the
|
|
218
|
+
// disabled paths of Link and SideNavItem.)
|
|
219
|
+
const Root = isDisabled ? 'a' : LinkComponent;
|
|
220
|
+
|
|
198
221
|
// =========================================================================
|
|
199
222
|
// Drawer mode — render as a SideNavItem-style vertical list element
|
|
200
223
|
// =========================================================================
|
|
201
224
|
if (renderMode === 'drawer') {
|
|
202
|
-
const handleDrawerClick = (e: React.MouseEvent) => {
|
|
225
|
+
const handleDrawerClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
|
203
226
|
if (isDisabled) {
|
|
227
|
+
preventDefaultClick(e);
|
|
204
228
|
return;
|
|
205
229
|
}
|
|
206
230
|
// Forward the original onClick if present
|
|
207
|
-
|
|
231
|
+
onClick?.(e);
|
|
208
232
|
closeMobileNav();
|
|
209
233
|
};
|
|
210
234
|
|
|
211
235
|
return (
|
|
212
|
-
<
|
|
236
|
+
<Root
|
|
213
237
|
ref={ref}
|
|
238
|
+
href={isDisabled ? undefined : href}
|
|
239
|
+
target={isDisabled ? undefined : target}
|
|
214
240
|
aria-label={isIconOnly ? label : undefined}
|
|
215
241
|
aria-current={isSelected ? 'page' : undefined}
|
|
216
242
|
aria-disabled={isDisabled || undefined}
|
|
@@ -235,7 +261,7 @@ export function TopNavItem({
|
|
|
235
261
|
onClick={handleDrawerClick}>
|
|
236
262
|
{icon}
|
|
237
263
|
{!isIconOnly && (children ?? label)}
|
|
238
|
-
</
|
|
264
|
+
</Root>
|
|
239
265
|
);
|
|
240
266
|
}
|
|
241
267
|
|
|
@@ -244,8 +270,11 @@ export function TopNavItem({
|
|
|
244
270
|
// =========================================================================
|
|
245
271
|
|
|
246
272
|
return (
|
|
247
|
-
<
|
|
273
|
+
<Root
|
|
248
274
|
ref={ref}
|
|
275
|
+
href={isDisabled ? undefined : href}
|
|
276
|
+
target={isDisabled ? undefined : target}
|
|
277
|
+
onClick={isDisabled ? preventDefaultClick : onClick}
|
|
249
278
|
aria-label={isIconOnly ? label : undefined}
|
|
250
279
|
aria-current={isSelected ? 'page' : undefined}
|
|
251
280
|
aria-disabled={isDisabled || undefined}
|
|
@@ -267,7 +296,7 @@ export function TopNavItem({
|
|
|
267
296
|
{...props}>
|
|
268
297
|
{icon}
|
|
269
298
|
{!isIconOnly && (children ?? label)}
|
|
270
|
-
</
|
|
299
|
+
</Root>
|
|
271
300
|
);
|
|
272
301
|
}
|
|
273
302
|
|
|
@@ -123,6 +123,18 @@ const styles = stylex.create({
|
|
|
123
123
|
transform: 'translateY(-4px)',
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
|
+
// Clamp the anchored layer to the space available below the nav so a tall
|
|
127
|
+
// menu never runs off the bottom of the viewport. The layer is positioned
|
|
128
|
+
// with position-area: self-block-end, so its containing block spans from
|
|
129
|
+
// the nav's block-end to the viewport edge — 100% is exactly that space.
|
|
130
|
+
// The layer is a flex column so panelContainer can shrink and scroll its
|
|
131
|
+
// own content, keeping the surface radius/shadow static at the edges.
|
|
132
|
+
// Internal scroll is a stopgap until the mobile bottom-sheet lands.
|
|
133
|
+
panelViewportFit: {
|
|
134
|
+
display: 'flex',
|
|
135
|
+
flexDirection: 'column',
|
|
136
|
+
maxHeight: `calc(100% - ${spacingVars['--spacing-3']})`,
|
|
137
|
+
},
|
|
126
138
|
// Visual styles for the panel content container.
|
|
127
139
|
panelContainer: {
|
|
128
140
|
backgroundColor: colorVars['--color-background-popover'],
|
|
@@ -132,6 +144,11 @@ const styles = stylex.create({
|
|
|
132
144
|
borderRadius: radiusVars['--radius-container'],
|
|
133
145
|
boxShadow: shadowVars['--shadow-low'],
|
|
134
146
|
overflow: 'hidden',
|
|
147
|
+
// Allow the container to shrink inside the height-clamped layer so its
|
|
148
|
+
// content (panelContent) can scroll rather than overflow the viewport.
|
|
149
|
+
display: 'flex',
|
|
150
|
+
flexDirection: 'column',
|
|
151
|
+
minHeight: 0,
|
|
135
152
|
},
|
|
136
153
|
panelContent: {
|
|
137
154
|
display: 'flex',
|
|
@@ -139,7 +156,14 @@ const styles = stylex.create({
|
|
|
139
156
|
gap: spacingVars['--spacing-6'],
|
|
140
157
|
paddingBlock: spacingVars['--spacing-3'],
|
|
141
158
|
paddingInline: spacingVars['--spacing-3'],
|
|
142
|
-
|
|
159
|
+
// Clamp to the viewport (minus a gutter) so the anchored panel never
|
|
160
|
+
// overflows the screen edge on narrow viewports; caps at 960px otherwise.
|
|
161
|
+
maxWidth: `min(960px, calc(100dvw - ${spacingVars['--spacing-4']}))`,
|
|
162
|
+
boxSizing: 'border-box',
|
|
163
|
+
// Scroll internally when the menu is taller than the available space
|
|
164
|
+
// below the nav (paired with panelViewportFit on the layer).
|
|
165
|
+
overflowY: 'auto',
|
|
166
|
+
overscrollBehavior: 'contain',
|
|
143
167
|
},
|
|
144
168
|
menuWrapper: {
|
|
145
169
|
flexGrow: 2,
|
|
@@ -484,7 +508,7 @@ function DefaultMegaMenu({
|
|
|
484
508
|
{
|
|
485
509
|
placement: 'below',
|
|
486
510
|
alignment: slot,
|
|
487
|
-
xstyle: styles.panelAnimation,
|
|
511
|
+
xstyle: [styles.panelAnimation, styles.panelViewportFit],
|
|
488
512
|
},
|
|
489
513
|
)}
|
|
490
514
|
</>
|
|
@@ -27,7 +27,7 @@ export const docs = {
|
|
|
27
27
|
{
|
|
28
28
|
name: 'imageAlt',
|
|
29
29
|
type: 'string',
|
|
30
|
-
description: 'Alt text for the image. When omitted, the image is explicitly decorative (alt="", role="presentation", aria-hidden)
|
|
30
|
+
description: 'Alt text for the image. When omitted, the image is explicitly decorative (alt="", role="presentation", aria-hidden), usually correct since the card already has a visible title. Provide it only when the image conveys information beyond the title and description.',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: 'linkLabel',
|
|
@@ -30,6 +30,9 @@ export const docs = {
|
|
|
30
30
|
{className: 'astryx-tree-list-item-label', states: ['selected']},
|
|
31
31
|
{className: 'astryx-tree-list-guide'},
|
|
32
32
|
],
|
|
33
|
+
vars: [
|
|
34
|
+
{name: '--tree-list-indent', description: 'Per-level indentation step. Each nesting level indents its rows by this distance, and the guide lines follow it so they stay aligned. Set it on the `tree-list` target to retune the metric (e.g. `var(--spacing-5)` for a wider indent).', default: 'var(--spacing-4)'},
|
|
35
|
+
],
|
|
33
36
|
},
|
|
34
37
|
components: [
|
|
35
38
|
{
|
|
@@ -104,6 +107,9 @@ export const docsZh = {
|
|
|
104
107
|
{className: 'astryx-tree-list-item-label', states: ['selected']},
|
|
105
108
|
{className: 'astryx-tree-list-guide'},
|
|
106
109
|
],
|
|
110
|
+
vars: [
|
|
111
|
+
{name: '--tree-list-indent', description: '每级缩进步长。每个嵌套层级的行按此距离缩进,引导线随之对齐。在 `tree-list` 目标上设置以调整该度量(例如用 `var(--spacing-5)` 获得更宽的缩进)。', default: 'var(--spacing-4)'},
|
|
112
|
+
],
|
|
107
113
|
},
|
|
108
114
|
components: [
|
|
109
115
|
{
|
|
@@ -431,26 +431,29 @@ describe('TreeList', () => {
|
|
|
431
431
|
});
|
|
432
432
|
|
|
433
433
|
it("variant='noGuides' preserves per-level indentation on the rows", () => {
|
|
434
|
-
// Indentation lives on the row's
|
|
435
|
-
// it must survive when the connectors are suppressed.
|
|
436
|
-
//
|
|
434
|
+
// Indentation lives on the row's margin-inline-start (not the guide
|
|
435
|
+
// element), so it must survive when the connectors are suppressed. The
|
|
436
|
+
// per-row distance is published as the `--_tree-indent` custom property
|
|
437
|
+
// (not an inline longhand — see #4308), so the theme layer can override
|
|
438
|
+
// the `margin-inline-start` declaration. A deeper row is indented more
|
|
439
|
+
// than a shallower one.
|
|
437
440
|
const {container} = render(
|
|
438
441
|
<TreeList items={deepItems} variant="noGuides" />,
|
|
439
442
|
);
|
|
440
|
-
const
|
|
443
|
+
const indentOf = (text: string): string => {
|
|
441
444
|
const li = screen.getByText(text).closest('li')!;
|
|
442
|
-
const styled = li.querySelector('[style*="
|
|
445
|
+
const styled = li.querySelector('[style*="--_tree-indent"]');
|
|
443
446
|
return styled?.getAttribute('style') ?? '';
|
|
444
447
|
};
|
|
445
448
|
// Guides are gone…
|
|
446
449
|
expect(container.querySelector('.astryx-tree-list-guide')).toBeNull();
|
|
447
|
-
// …but each level still
|
|
450
|
+
// …but each level still publishes an indent distance, and the level
|
|
448
451
|
// multiplier grows with depth (0, 1, 2).
|
|
449
|
-
expect(
|
|
450
|
-
expect(
|
|
451
|
-
expect(
|
|
452
|
+
expect(indentOf('Root')).toContain('--_tree-indent');
|
|
453
|
+
expect(indentOf('Mid')).toContain('--_tree-indent');
|
|
454
|
+
expect(indentOf('Leaf')).toContain('--_tree-indent');
|
|
452
455
|
const level = (text: string): number => {
|
|
453
|
-
const m = /calc\((\d+)/.exec(
|
|
456
|
+
const m = /calc\((\d+)/.exec(indentOf(text));
|
|
454
457
|
return m ? Number(m[1]) : NaN;
|
|
455
458
|
};
|
|
456
459
|
expect(level('Mid')).toBeGreaterThan(level('Root'));
|
|
@@ -504,6 +507,43 @@ describe('TreeList', () => {
|
|
|
504
507
|
});
|
|
505
508
|
});
|
|
506
509
|
|
|
510
|
+
// ===========================================================================
|
|
511
|
+
// Indent lever (--tree-list-indent)
|
|
512
|
+
// ===========================================================================
|
|
513
|
+
|
|
514
|
+
describe('indent lever', () => {
|
|
515
|
+
it('lets a theme retune the indent step via the tree-list target', () => {
|
|
516
|
+
// The per-level step is a public, themeable var (default --spacing-4) set
|
|
517
|
+
// on the tree-list root, so a theme can retune the indent metric (e.g. to
|
|
518
|
+
// --spacing-5) via defineTheme. jsdom cannot resolve the @layer cascade,
|
|
519
|
+
// so the generated CSS is what proves the override reaches the lever.
|
|
520
|
+
const theme = defineTheme({
|
|
521
|
+
name: 'tree-list-indent-test',
|
|
522
|
+
components: {
|
|
523
|
+
'tree-list': {
|
|
524
|
+
base: {'--tree-list-indent': 'var(--spacing-5)'},
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
});
|
|
528
|
+
const css = generateThemeCSSFlat(theme);
|
|
529
|
+
expect(css).toContain('.astryx-tree-list {');
|
|
530
|
+
expect(css).toContain('--tree-list-indent: var(--spacing-5)');
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
it('rows consume the indent step in their published indent distance', () => {
|
|
534
|
+
// Each row's --_tree-indent is calc(level * var(--tree-list-indent)),
|
|
535
|
+
// so retuning the step scales every level uniformly.
|
|
536
|
+
render(<TreeList items={deepItems} variant="noGuides" />);
|
|
537
|
+
const indentOf = (text: string): string => {
|
|
538
|
+
const li = screen.getByText(text).closest('li')!;
|
|
539
|
+
const styled = li.querySelector('[style*="--_tree-indent"]');
|
|
540
|
+
return styled?.getAttribute('style') ?? '';
|
|
541
|
+
};
|
|
542
|
+
expect(indentOf('Mid')).toContain('var(--tree-list-indent)');
|
|
543
|
+
expect(indentOf('Leaf')).toContain('var(--tree-list-indent)');
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
|
|
507
547
|
// ===========================================================================
|
|
508
548
|
// xds class name
|
|
509
549
|
// ===========================================================================
|
|
@@ -83,6 +83,11 @@ export interface TreeListProps extends BaseProps<HTMLDivElement> {
|
|
|
83
83
|
const styles = stylex.create({
|
|
84
84
|
root: {
|
|
85
85
|
position: 'relative',
|
|
86
|
+
// Per-level indentation step. Public, themeable lever: a theme can retune
|
|
87
|
+
// the tree's indent metric (e.g. to `var(--spacing-5)`) via `defineTheme`
|
|
88
|
+
// on the `tree-list` target, and both the row margins (TreeListItem) and
|
|
89
|
+
// the guide-line offsets (TreeListBranches) read it so they stay aligned.
|
|
90
|
+
'--tree-list-indent': spacingVars['--spacing-4'],
|
|
86
91
|
},
|
|
87
92
|
list: {
|
|
88
93
|
margin: 0,
|
|
@@ -26,8 +26,10 @@ const LINE_WIDTH = 1;
|
|
|
26
26
|
*/
|
|
27
27
|
const BRANCH_MARGIN = `calc(${spacingVars['--spacing-2']} + ${spacingVars['--spacing-0-5']})`;
|
|
28
28
|
|
|
29
|
-
/** Per-level indent width,
|
|
30
|
-
|
|
29
|
+
/** Per-level indent width. Reads the public, themeable `--tree-list-indent`
|
|
30
|
+
* lever set on the tree-list root (default `--spacing-4`, 16px), so the guide
|
|
31
|
+
* lines stay aligned with the row indent when a theme retunes the step. */
|
|
32
|
+
const LEVEL_INDENT = 'var(--tree-list-indent)';
|
|
31
33
|
|
|
32
34
|
const styles = stylex.create({
|
|
33
35
|
container: {
|
|
@@ -37,10 +39,10 @@ const styles = stylex.create({
|
|
|
37
39
|
},
|
|
38
40
|
verticalLine: {
|
|
39
41
|
borderRadius: 1,
|
|
40
|
-
|
|
42
|
+
insetInlineStart: 0,
|
|
41
43
|
margin: 'auto',
|
|
42
44
|
position: 'absolute',
|
|
43
|
-
|
|
45
|
+
insetInlineEnd: 0,
|
|
44
46
|
width: LINE_WIDTH,
|
|
45
47
|
backgroundColor: colorVars['--color-border-emphasized'],
|
|
46
48
|
},
|
|
@@ -92,7 +94,7 @@ export function TreeListBranches({
|
|
|
92
94
|
key={level}
|
|
93
95
|
{...mergeProps(stylex.props(styles.container), {
|
|
94
96
|
style: {
|
|
95
|
-
|
|
97
|
+
insetInlineStart: branchOffset,
|
|
96
98
|
},
|
|
97
99
|
})}>
|
|
98
100
|
<div
|
|
@@ -109,7 +111,7 @@ export function TreeListBranches({
|
|
|
109
111
|
<div
|
|
110
112
|
{...mergeProps(stylex.props(styles.container), {
|
|
111
113
|
style: {
|
|
112
|
-
|
|
114
|
+
insetInlineStart: `calc(${BRANCH_MARGIN} + ${nestedLevel - 1} * ${LEVEL_INDENT})`,
|
|
113
115
|
},
|
|
114
116
|
})}>
|
|
115
117
|
<div
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
typeScaleVars,
|
|
26
26
|
} from '../theme/tokens.stylex';
|
|
27
27
|
import {getIcon} from '../Icon/globalIconRegistry';
|
|
28
|
-
import {mergeProps} from '../utils';
|
|
28
|
+
import {mergeProps, rtlStyles} from '../utils';
|
|
29
29
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
30
30
|
import {TreeListBranches} from './TreeListBranches';
|
|
31
31
|
import type {TreeListDensity, TreeListVariant} from './TreeListTypes';
|
|
@@ -82,6 +82,12 @@ const styles = stylex.create({
|
|
|
82
82
|
position: 'relative',
|
|
83
83
|
boxSizing: 'border-box',
|
|
84
84
|
textAlign: 'start',
|
|
85
|
+
// Per-level indent. Declared here (not inline) so it lives in
|
|
86
|
+
// `@layer astryx-base` and the theme layer can override it in normal
|
|
87
|
+
// cascade order — an inline longhand would outrank every layer. The row
|
|
88
|
+
// publishes only the computed distance as `--_tree-indent`; the per-level
|
|
89
|
+
// step is the public `--tree-list-indent` lever (see TreeList `root`).
|
|
90
|
+
marginInlineStart: 'var(--_tree-indent, 0px)',
|
|
85
91
|
},
|
|
86
92
|
interactive: {
|
|
87
93
|
cursor: 'pointer',
|
|
@@ -246,6 +252,11 @@ const descriptionSizeStyles = stylex.create({
|
|
|
246
252
|
},
|
|
247
253
|
});
|
|
248
254
|
|
|
255
|
+
// `CSSProperties` has no index signature for custom properties, so the row's
|
|
256
|
+
// inline style — which publishes the computed indent distance as the private
|
|
257
|
+
// `--_tree-indent` — needs this augmentation to typecheck.
|
|
258
|
+
type IndentStyle = React.CSSProperties & Record<'--_tree-indent', string>;
|
|
259
|
+
|
|
249
260
|
// =============================================================================
|
|
250
261
|
// Types
|
|
251
262
|
// =============================================================================
|
|
@@ -353,9 +364,18 @@ export function TreeListItem({
|
|
|
353
364
|
return undefined;
|
|
354
365
|
}, [onClick, hasChildren, onToggle, id, isDisabled]);
|
|
355
366
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
367
|
+
// Per-level indent distance. The per-level step is the public, themeable
|
|
368
|
+
// `--tree-list-indent` lever (default `--spacing-4`, set on the tree-list
|
|
369
|
+
// root). Leaves add a fixed chevron-column offset (chevron width + gap) so
|
|
370
|
+
// their labels line up with sibling parents' labels; that offset is tied to
|
|
371
|
+
// the chevron's own dimensions, not the indent step, so it does not scale
|
|
372
|
+
// with the lever. Published as the private `--_tree-indent` and consumed by
|
|
373
|
+
// `contentWrapper`'s stylesheet `margin-inline-start` (kept out of the inline
|
|
374
|
+
// style so the theme layer can override it — see #4308).
|
|
375
|
+
const indentDistance = hasChildren
|
|
376
|
+
? `calc(${nestedLevel} * var(--tree-list-indent))`
|
|
377
|
+
: `calc(${nestedLevel} * var(--tree-list-indent) + ${spacingVars['--spacing-4']} + ${spacingVars['--spacing-2']})`;
|
|
378
|
+
const indentStyle: IndentStyle = {'--_tree-indent': indentDistance};
|
|
359
379
|
|
|
360
380
|
const labelAndDescription = (
|
|
361
381
|
<>
|
|
@@ -386,12 +406,14 @@ export function TreeListItem({
|
|
|
386
406
|
);
|
|
387
407
|
|
|
388
408
|
const chevronIcon = (
|
|
389
|
-
<span
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
409
|
+
<span {...stylex.props(rtlStyles.mirror)}>
|
|
410
|
+
<span
|
|
411
|
+
{...stylex.props(
|
|
412
|
+
styles.chevronSvg,
|
|
413
|
+
isExpanded ? styles.chevronExpanded : styles.chevronCollapsed,
|
|
414
|
+
)}>
|
|
415
|
+
{getIcon('chevronRight')}
|
|
416
|
+
</span>
|
|
395
417
|
</span>
|
|
396
418
|
);
|
|
397
419
|
|
|
@@ -527,7 +549,7 @@ export function TreeListItem({
|
|
|
527
549
|
isSelected && styles.selected,
|
|
528
550
|
),
|
|
529
551
|
)}
|
|
530
|
-
style={
|
|
552
|
+
style={indentStyle}
|
|
531
553
|
onClick={handleClick}>
|
|
532
554
|
{innerContent}
|
|
533
555
|
</div>
|