@astryxdesign/core 0.4.7 → 0.5.0-canary.54bb922
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 +161 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -2
- package/dist/AspectRatio/AspectRatio.d.ts +24 -0
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +23 -4
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +15 -10
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +3 -2
- package/dist/Banner/Banner.d.ts +40 -15
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +51 -18
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +17 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +3 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -10
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +5 -4
- package/dist/ButtonGroup/ButtonGroup.d.ts +5 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +26 -7
- package/dist/Calendar/Calendar.d.ts +3 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +13 -14
- package/dist/Calendar/getInitialFocusDate.d.ts +46 -0
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -0
- package/dist/Calendar/getInitialFocusDate.js +62 -0
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +3 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -3
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +3 -3
- package/dist/Chat/ChatMessageList.d.ts +22 -3
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +6 -3
- package/dist/Chat/ChatTokenizedText.d.ts +2 -0
- package/dist/Chat/ChatTokenizedText.d.ts.map +1 -1
- package/dist/Chat/ChatTokenizedText.js +11 -6
- package/dist/Chat/useChatComposerTokens.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +3 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +3 -3
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +3 -2
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +3 -2
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +4 -3
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +3 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +38 -4
- package/dist/DateTimeInput/DateTimeInput.d.ts +21 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +406 -12
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts +7 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +89 -58
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +6 -5
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +3 -2
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +6 -2
- package/dist/HoverCard/HoverCard.d.ts +6 -0
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +5 -0
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +67 -25
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +2 -19
- package/dist/Layer/LayerDepthContext.d.ts +52 -0
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -0
- package/dist/Layer/LayerDepthContext.js +66 -0
- package/dist/Layer/index.d.ts +3 -0
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +4 -0
- package/dist/Layer/layerStack.d.ts +98 -0
- package/dist/Layer/layerStack.d.ts.map +1 -0
- package/dist/Layer/layerStack.js +306 -0
- package/dist/Layer/useLayerDismissal.d.ts +93 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -0
- package/dist/Layer/useLayerDismissal.js +91 -0
- package/dist/Lightbox/Lightbox.d.ts +1 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +103 -81
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/Markdown/parser.d.ts +38 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +177 -29
- package/dist/MobileNav/MobileNav.d.ts +6 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +61 -36
- package/dist/MultiSelector/MultiSelector.d.ts +15 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +17 -6
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +3 -2
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +3 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +3 -2
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +20 -17
- package/dist/PowerSearch/PowerSearch.d.ts +8 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +19 -6
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +3 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +28 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +3 -1
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +19 -9
- package/dist/PowerSearch/types.d.ts +2 -0
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts +6 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +14 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +3 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +3 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +3 -3
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -0
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +4 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +6 -5
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +4 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +3 -3
- package/dist/Spinner/Spinner.d.ts +3 -3
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +130 -78
- package/dist/Stepper/Step.d.ts +140 -0
- package/dist/Stepper/Step.d.ts.map +1 -0
- package/dist/Stepper/Step.js +1045 -0
- package/dist/Stepper/StepStatus.d.ts +24 -0
- package/dist/Stepper/StepStatus.d.ts.map +1 -0
- package/dist/Stepper/StepStatus.js +1 -0
- package/dist/Stepper/Stepper.d.ts +93 -0
- package/dist/Stepper/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Stepper.js +184 -0
- package/dist/Stepper/StepperContext.d.ts +41 -0
- package/dist/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/Stepper/StepperContext.js +34 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts.map +1 -0
- package/dist/Stepper/index.js +7 -0
- package/dist/Stepper/stepper.stylex.d.ts +15 -0
- package/dist/Stepper/stepper.stylex.d.ts.map +1 -0
- package/dist/Stepper/stepper.stylex.js +20 -0
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +3 -2
- package/dist/TabList/Tab.d.ts +15 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +32 -7
- package/dist/TabList/TabList.d.ts +46 -7
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +353 -23
- package/dist/TabList/TabListContext.d.ts +11 -1
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +11 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +3 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.d.ts.map +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +4 -1
- package/dist/Table/TableRow.d.ts +16 -5
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +16 -5
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +20 -8
- package/dist/Table/plugins/pagination/useTablePagination.d.ts +3 -0
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +21 -4
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +10 -3
- package/dist/Table/plugins/selection/useTableSelection.d.ts +16 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +19 -5
- package/dist/Table/types.d.ts +22 -4
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -0
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +6 -2
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +3 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +3 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +3 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +5 -3
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +2 -2
- package/dist/Tokenizer/Tokenizer.d.ts +3 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +2 -0
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +5 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +39 -24
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +3 -2
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +3 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -3
- package/dist/Typeahead/BaseTypeahead.d.ts +2 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +68 -29
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -2
- package/dist/astryx.css +68 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts +7 -4
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +60 -95
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -18
- package/dist/hooks/useMergedRefs.d.ts +18 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/groupItems.d.ts +5 -1
- package/dist/utils/groupItems.d.ts.map +1 -1
- package/dist/utils/groupItems.js +9 -9
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/isApplePlatform.d.ts +18 -0
- package/dist/utils/isApplePlatform.d.ts.map +1 -0
- package/dist/utils/isApplePlatform.js +37 -0
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +10 -1
- package/dist/utils/timeParser.d.ts +1 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +26 -12
- package/locales/en.json +31 -7
- package/locales/pseudo.json +18 -0
- package/package.json +8 -3
- package/src/AppShell/AppShell.tsx +3 -2
- package/src/AspectRatio/AspectRatio.doc.mjs +6 -3
- package/src/AspectRatio/AspectRatio.test.tsx +57 -10
- package/src/AspectRatio/AspectRatio.tsx +40 -1
- package/src/Avatar/Avatar.doc.mjs +2 -1
- package/src/Avatar/Avatar.test.tsx +17 -0
- package/src/Avatar/Avatar.tsx +61 -38
- package/src/AvatarGroup/AvatarGroup.tsx +3 -2
- package/src/Banner/Banner.doc.mjs +13 -11
- package/src/Banner/Banner.test.tsx +102 -15
- package/src/Banner/Banner.tsx +72 -25
- package/src/BottomSheet/BottomSheet.test.tsx +123 -0
- package/src/BottomSheet/BottomSheet.tsx +17 -4
- package/src/BottomSheet/BottomSheetSwitcher.tsx +3 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +9 -5
- package/src/Button/Button.doc.mjs +22 -0
- package/src/Button/Button.test.tsx +13 -0
- package/src/Button/Button.tsx +5 -4
- package/src/ButtonGroup/ButtonGroup.doc.mjs +10 -1
- package/src/ButtonGroup/ButtonGroup.test.tsx +391 -1
- package/src/ButtonGroup/ButtonGroup.tsx +23 -5
- package/src/Calendar/Calendar.doc.mjs +4 -3
- package/src/Calendar/Calendar.test.tsx +52 -0
- package/src/Calendar/Calendar.tsx +18 -15
- package/src/Calendar/getInitialFocusDate.test.ts +94 -0
- package/src/Calendar/getInitialFocusDate.ts +93 -0
- package/src/Carousel/Carousel.tsx +3 -2
- package/src/Chat/ChatComposerInput.tsx +5 -1
- package/src/Chat/ChatLayout.tsx +3 -2
- package/src/Chat/ChatMessageList.doc.mjs +9 -1
- package/src/Chat/ChatMessageList.test.tsx +46 -0
- package/src/Chat/ChatMessageList.tsx +28 -4
- package/src/Chat/ChatTokenizedText.tsx +17 -10
- package/src/Chat/useChatComposerTokens.ts +1 -1
- package/src/CheckboxInput/CheckboxInput.tsx +3 -2
- package/src/ClickableCard/ClickableCard.tsx +3 -2
- package/src/CodeBlock/CodeBlock.doc.mjs +6 -0
- package/src/CommandPalette/CommandPaletteInput.tsx +3 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +3 -2
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -0
- package/src/ContextMenu/ContextMenu.tsx +4 -3
- package/src/DateInput/DateInput.tsx +3 -2
- package/src/DateInput/DateInputTouch.test.tsx +36 -0
- package/src/DateInput/TouchDateField.tsx +38 -4
- package/src/DateTimeInput/DateTimeInput.doc.mjs +18 -0
- package/src/DateTimeInput/DateTimeInput.test.tsx +1088 -0
- package/src/DateTimeInput/DateTimeInput.tsx +556 -24
- package/src/DateTimeInput/index.ts +1 -0
- package/src/Dialog/Dialog.doc.mjs +8 -3
- package/src/Dialog/Dialog.test.tsx +261 -1
- package/src/Dialog/Dialog.tsx +109 -58
- package/src/DropdownMenu/DropdownMenu.doc.mjs +6 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +8 -5
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +8 -11
- package/src/Field/Field.doc.mjs +13 -2
- package/src/FileInput/FileInput.tsx +3 -2
- package/src/Heading/Heading.test.tsx +23 -1
- package/src/Heading/Heading.tsx +6 -2
- package/src/HoverCard/HoverCard.doc.mjs +5 -0
- package/src/HoverCard/HoverCard.tsx +6 -0
- package/src/HoverCard/useHoverCard.tsx +81 -30
- package/src/Item/Item.tsx +5 -4
- package/src/Kbd/Kbd.tsx +2 -19
- package/src/Layer/LayerDepthContext.tsx +62 -0
- package/src/Layer/index.ts +9 -0
- package/src/Layer/layerDismissalFamilies.test.tsx +359 -0
- package/src/Layer/layerDismissalInvariants.test.tsx +417 -0
- package/src/Layer/layerStack.ts +362 -0
- package/src/Layer/useLayerDismissal.test.tsx +469 -0
- package/src/Layer/useLayerDismissal.ts +173 -0
- package/src/Layout/Layout.doc.mjs +2 -2
- package/src/Lightbox/Lightbox.doc.mjs +12 -0
- package/src/Lightbox/Lightbox.tsx +124 -102
- package/src/Link/Link.doc.mjs +39 -0
- package/src/Markdown/Markdown.doc.mjs +5 -0
- package/src/Markdown/incremental.test.ts +16 -2
- package/src/Markdown/index.ts +1 -0
- package/src/Markdown/parser.perf.test.ts +96 -1
- package/src/Markdown/parser.test.ts +145 -2
- package/src/Markdown/parser.ts +244 -29
- package/src/MobileNav/MobileNav.tsx +62 -36
- package/src/MoreMenu/MoreMenu.doc.mjs +7 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +27 -0
- package/src/MultiSelector/MultiSelector.test.tsx +106 -0
- package/src/MultiSelector/MultiSelector.tsx +50 -6
- package/src/MultiSelector/index.ts +1 -0
- package/src/NavMenu/NavHeadingMenu.tsx +3 -2
- package/src/NumberInput/NumberInput.doc.mjs +5 -0
- package/src/Outline/Outline.tsx +3 -2
- package/src/OverflowList/OverflowList.tsx +3 -2
- package/src/Overlay/Overlay.tsx +3 -2
- package/src/Popover/usePopover.tsx +31 -28
- package/src/PowerSearch/PowerSearch.doc.mjs +160 -28
- package/src/PowerSearch/PowerSearch.test.tsx +240 -1
- package/src/PowerSearch/PowerSearch.tsx +34 -5
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +201 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +29 -2
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +47 -1
- package/src/PowerSearch/PowerSearchValueEditor.tsx +15 -0
- package/src/PowerSearch/types.ts +2 -0
- package/src/PowerSearch/usePowerSearchSource.test.ts +82 -2
- package/src/PowerSearch/usePowerSearchSource.ts +13 -3
- package/src/Resizable/ResizeHandle.tsx +3 -2
- package/src/SegmentedControl/SegmentedControl.tsx +3 -2
- package/src/SelectableCard/SelectableCard.tsx +3 -2
- package/src/Selector/Selector.doc.mjs +12 -1
- package/src/Selector/Selector.test.tsx +45 -1
- package/src/Selector/Selector.tsx +11 -1
- package/src/SideNav/SideNav.doc.mjs +6 -6
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavHeading.tsx +10 -10
- package/src/SideNav/SideNavItem.tsx +4 -2
- package/src/Slider/Slider.tsx +3 -2
- package/src/Spinner/Spinner.test.tsx +147 -1
- package/src/Spinner/Spinner.tsx +120 -101
- package/src/Stepper/Step.doc.mjs +98 -0
- package/src/Stepper/Step.tsx +1638 -0
- package/src/Stepper/StepStatus.ts +26 -0
- package/src/Stepper/Stepper.doc.mjs +370 -0
- package/src/Stepper/Stepper.test.tsx +1024 -0
- package/src/Stepper/Stepper.tsx +258 -0
- package/src/Stepper/StepperContext.ts +71 -0
- package/src/Stepper/index.ts +18 -0
- package/src/Stepper/stepper.stylex.ts +19 -0
- package/src/Switch/Switch.tsx +3 -2
- package/src/TabList/Tab.doc.mjs +13 -1
- package/src/TabList/Tab.tsx +67 -7
- package/src/TabList/TabList.doc.mjs +22 -6
- package/src/TabList/TabList.test.tsx +559 -0
- package/src/TabList/TabList.tsx +490 -22
- package/src/TabList/TabListContext.ts +13 -2
- package/src/TabList/TabMenu.tsx +3 -2
- package/src/TabList/index.ts +6 -2
- package/src/Table/BaseTable.tsx +6 -3
- package/src/Table/Table.doc.mjs +6 -1
- package/src/Table/Table.test.tsx +132 -14
- package/src/Table/TableBody.doc.mjs +40 -0
- package/src/Table/TableFooter.doc.mjs +40 -0
- package/src/Table/TableHeader.doc.mjs +40 -0
- package/src/Table/TableRow.tsx +16 -5
- package/src/Table/plugins/groupedRows/useTableGroupedRows-perf.test.tsx +112 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +100 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +17 -8
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +34 -4
- package/src/Table/plugins/pagination/useTablePagination.tsx +35 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -2
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +13 -7
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +12 -3
- package/src/Table/plugins/selection/useTableSelection.test.tsx +76 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +40 -7
- package/src/Table/types.ts +22 -4
- package/src/Table/useBaseTablePlugins.ts +5 -0
- package/src/Table/useTableGroupedRows.doc.mjs +5 -4
- package/src/Table/useTablePagination.doc.mjs +7 -0
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/Table/useTableSelection.doc.mjs +31 -0
- package/src/Text/Text.test.tsx +23 -1
- package/src/Text/Text.tsx +6 -2
- package/src/TextArea/TextArea.tsx +3 -2
- package/src/TextInput/TextInput.doc.mjs +10 -0
- package/src/TextInput/TextInput.tsx +3 -2
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
- package/src/TimeInput/TimeInput.tsx +2 -2
- package/src/Timestamp/Timestamp.tsx +4 -2
- package/src/Toast/Toast.doc.mjs +6 -0
- package/src/Token/TokenLink.tsx +2 -2
- package/src/Tokenizer/Tokenizer.doc.mjs +27 -0
- package/src/Tokenizer/Tokenizer.tsx +4 -0
- package/src/Toolbar/Toolbar.doc.mjs +5 -0
- package/src/Tooltip/Tooltip.doc.mjs +5 -0
- package/src/Tooltip/Tooltip.test.tsx +32 -0
- package/src/Tooltip/Tooltip.tsx +5 -0
- package/src/Tooltip/useTooltip.tsx +47 -24
- package/src/TopNav/TopNavHeading.tsx +3 -2
- package/src/TopNav/TopNavMegaMenu.tsx +3 -2
- package/src/TopNav/TopNavMenu.tsx +4 -3
- package/src/Typeahead/BaseTypeahead.doc.mjs +11 -0
- package/src/Typeahead/BaseTypeahead.tsx +85 -33
- package/src/Typeahead/Typeahead.doc.mjs +5 -0
- package/src/Typeahead/Typeahead.test.tsx +49 -0
- package/src/Typeahead/Typeahead.tsx +3 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useContainerReveal.doc.mjs +2 -2
- package/src/hooks/useFocusTrap.test.tsx +14 -0
- package/src/hooks/useFocusTrap.ts +62 -111
- package/src/hooks/useFocusTrapEscapeShim.test.tsx +165 -0
- package/src/hooks/useHotkeys.ts +3 -18
- package/src/hooks/useMergedRefs.doc.mjs +79 -0
- package/src/hooks/useMergedRefs.test.tsx +62 -0
- package/src/hooks/useMergedRefs.ts +36 -0
- package/src/index.ts +1 -0
- package/src/theme/MediaTheme.doc.mjs +5 -5
- package/src/utils/groupItems.ts +12 -6
- package/src/utils/index.ts +1 -1
- package/src/utils/isApplePlatform.test.ts +61 -0
- package/src/utils/isApplePlatform.ts +37 -0
- package/src/utils/sharedResizeObserver.ts +10 -2
- package/src/utils/timeParser.test.ts +6 -1
- package/src/utils/timeParser.ts +35 -13
- package/src/__tests__/inputWidthContract.test.tsx +0 -69
|
@@ -103,6 +103,12 @@ export const docs = {
|
|
|
103
103
|
description: 'How to display selected items in the trigger.',
|
|
104
104
|
default: "'count'",
|
|
105
105
|
},
|
|
106
|
+
{
|
|
107
|
+
name: 'formatValue',
|
|
108
|
+
type: '(items: {value: string; label: string}[]) => string',
|
|
109
|
+
description:
|
|
110
|
+
'Formats the trigger text when triggerDisplay="count" or "labels". Receives the selected items (value plus resolved label); the count is items.length. Not used by triggerDisplay="badges".',
|
|
111
|
+
},
|
|
106
112
|
{
|
|
107
113
|
name: 'maxBadges',
|
|
108
114
|
type: 'number',
|
|
@@ -207,6 +213,23 @@ export const docs = {
|
|
|
207
213
|
description:
|
|
208
214
|
'Width of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned.',
|
|
209
215
|
},
|
|
216
|
+
{
|
|
217
|
+
name: 'startIcon',
|
|
218
|
+
type: 'IconType | ReactNode',
|
|
219
|
+
description: 'Icon displayed at the start of the selector trigger.',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'hasClear',
|
|
223
|
+
type: 'boolean',
|
|
224
|
+
description: 'Shows a clear button when values are selected.',
|
|
225
|
+
default: 'false',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: 'isDefaultOpen',
|
|
229
|
+
type: 'boolean',
|
|
230
|
+
description: 'Whether the dropdown starts open on mount.',
|
|
231
|
+
default: 'false',
|
|
232
|
+
},
|
|
210
233
|
{
|
|
211
234
|
name: 'xstyle',
|
|
212
235
|
type: 'StyleXStyles',
|
|
@@ -284,6 +307,8 @@ export const docsZh = {
|
|
|
284
307
|
placeholder: '未选择值时显示的占位文本。',
|
|
285
308
|
size: '选择器的尺寸变体。',
|
|
286
309
|
triggerDisplay: '在触发器中显示选中项的方式。',
|
|
310
|
+
formatValue:
|
|
311
|
+
'格式化 triggerDisplay="count" 或 "labels" 时的触发器文本。接收选中项(value 及解析后的 label),数量为 items.length。triggerDisplay="badges" 不使用此属性。',
|
|
287
312
|
maxBadges:
|
|
288
313
|
'显示"+N"之前的最大徽章数。仅适用于 triggerDisplay="badges"。',
|
|
289
314
|
hasSelectAll: '是否显示全选复选框。',
|
|
@@ -420,6 +445,8 @@ export const docsDense = {
|
|
|
420
445
|
variant:
|
|
421
446
|
'visual trigger style: input bordered control or ghost toolbar control',
|
|
422
447
|
triggerDisplay: 'how to show selected in trigger',
|
|
448
|
+
formatValue:
|
|
449
|
+
'formats count/labels trigger text; receives selected items',
|
|
423
450
|
maxBadges: 'max badges before "+N"; badges mode only',
|
|
424
451
|
hasSelectAll: 'show select-all checkbox',
|
|
425
452
|
selectAllLabel: 'select-all label',
|
|
@@ -128,6 +128,90 @@ describe('MultiSelector', () => {
|
|
|
128
128
|
expect(screen.getByText('2 selected')).toBeInTheDocument();
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
+
it('formats the count display with formatValue', () => {
|
|
132
|
+
render(
|
|
133
|
+
<MultiSelector
|
|
134
|
+
label="Spaces"
|
|
135
|
+
options={defaultOptions}
|
|
136
|
+
value={['Apple', 'Banana']}
|
|
137
|
+
onChange={() => {}}
|
|
138
|
+
formatValue={items => `${items.length} spaces selected`}
|
|
139
|
+
/>,
|
|
140
|
+
);
|
|
141
|
+
expect(screen.getByText('2 spaces selected')).toBeInTheDocument();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('passes selected values and resolved labels to formatValue', () => {
|
|
145
|
+
const formatValue = vi.fn(
|
|
146
|
+
(items: {value: string; label: string}[]) =>
|
|
147
|
+
`${items[0].label} and ${items.length - 1} more`,
|
|
148
|
+
);
|
|
149
|
+
render(
|
|
150
|
+
<MultiSelector
|
|
151
|
+
label="Fruit"
|
|
152
|
+
options={[
|
|
153
|
+
{value: 'a', label: 'Apple'},
|
|
154
|
+
{value: 'b', label: 'Banana'},
|
|
155
|
+
]}
|
|
156
|
+
value={['a', 'b']}
|
|
157
|
+
onChange={() => {}}
|
|
158
|
+
formatValue={formatValue}
|
|
159
|
+
/>,
|
|
160
|
+
);
|
|
161
|
+
expect(formatValue).toHaveBeenCalledWith([
|
|
162
|
+
{value: 'a', label: 'Apple'},
|
|
163
|
+
{value: 'b', label: 'Banana'},
|
|
164
|
+
]);
|
|
165
|
+
expect(screen.getByText('Apple and 1 more')).toBeInTheDocument();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('formats the labels display with formatValue', () => {
|
|
169
|
+
render(
|
|
170
|
+
<MultiSelector
|
|
171
|
+
label="Fruit"
|
|
172
|
+
options={defaultOptions}
|
|
173
|
+
value={['Apple', 'Banana', 'Orange']}
|
|
174
|
+
onChange={() => {}}
|
|
175
|
+
triggerDisplay="labels"
|
|
176
|
+
formatValue={items => items.map(item => item.label).join(' & ')}
|
|
177
|
+
/>,
|
|
178
|
+
);
|
|
179
|
+
expect(screen.getByText('Apple & Banana & Orange')).toBeInTheDocument();
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('ignores formatValue in badges display', () => {
|
|
183
|
+
render(
|
|
184
|
+
<MultiSelector
|
|
185
|
+
label="Fruit"
|
|
186
|
+
options={defaultOptions}
|
|
187
|
+
value={['Apple', 'Banana']}
|
|
188
|
+
onChange={() => {}}
|
|
189
|
+
triggerDisplay="badges"
|
|
190
|
+
formatValue={() => 'formatted'}
|
|
191
|
+
/>,
|
|
192
|
+
);
|
|
193
|
+
expect(screen.queryByText('formatted')).not.toBeInTheDocument();
|
|
194
|
+
const trigger = within(screen.getByRole('combobox'));
|
|
195
|
+
expect(trigger.getByText('Apple')).toBeInTheDocument();
|
|
196
|
+
expect(trigger.getByText('Banana')).toBeInTheDocument();
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it('shows the placeholder rather than calling formatValue when empty', () => {
|
|
200
|
+
const formatValue = vi.fn(() => 'formatted');
|
|
201
|
+
render(
|
|
202
|
+
<MultiSelector
|
|
203
|
+
label="Fruit"
|
|
204
|
+
options={defaultOptions}
|
|
205
|
+
value={[]}
|
|
206
|
+
onChange={() => {}}
|
|
207
|
+
placeholder="Pick fruits..."
|
|
208
|
+
formatValue={formatValue}
|
|
209
|
+
/>,
|
|
210
|
+
);
|
|
211
|
+
expect(screen.getByText('Pick fruits...')).toBeInTheDocument();
|
|
212
|
+
expect(formatValue).not.toHaveBeenCalled();
|
|
213
|
+
});
|
|
214
|
+
|
|
131
215
|
it('shows labels display', () => {
|
|
132
216
|
render(
|
|
133
217
|
<MultiSelector
|
|
@@ -353,6 +437,7 @@ describe('MultiSelector', () => {
|
|
|
353
437
|
|
|
354
438
|
await user.keyboard('{Tab}');
|
|
355
439
|
expect(trigger).toHaveAttribute('aria-expanded', 'false');
|
|
440
|
+
expect(screen.getByRole('button', {name: 'Next'})).toHaveFocus();
|
|
356
441
|
});
|
|
357
442
|
|
|
358
443
|
it('supports keyboard navigation with ArrowDown/ArrowUp', async () => {
|
|
@@ -1981,6 +2066,27 @@ describe('MultiSelector list structure', () => {
|
|
|
1981
2066
|
Node.DOCUMENT_POSITION_FOLLOWING,
|
|
1982
2067
|
).toBeTruthy();
|
|
1983
2068
|
});
|
|
2069
|
+
|
|
2070
|
+
it('hides a standalone divider from the accessibility tree (#4994)', async () => {
|
|
2071
|
+
const user = userEvent.setup();
|
|
2072
|
+
render(
|
|
2073
|
+
<MultiSelector
|
|
2074
|
+
label="Fruit"
|
|
2075
|
+
options={['Apple', {type: 'divider'}, 'Banana']}
|
|
2076
|
+
value={[]}
|
|
2077
|
+
onChange={() => {}}
|
|
2078
|
+
/>,
|
|
2079
|
+
);
|
|
2080
|
+
await user.click(screen.getByRole('combobox'));
|
|
2081
|
+
|
|
2082
|
+
// role="listbox" only permits option/group children. The divider still
|
|
2083
|
+
// renders role="separator" (unchanged visual/DOM), but must be excluded
|
|
2084
|
+
// from the accessibility tree so it never reaches the listbox's exposed
|
|
2085
|
+
// children (axe aria-required-children).
|
|
2086
|
+
const divider = document.querySelector('[role="separator"]');
|
|
2087
|
+
expect(divider).toBeTruthy();
|
|
2088
|
+
expect(divider).toHaveAttribute('aria-hidden', 'true');
|
|
2089
|
+
});
|
|
1984
2090
|
});
|
|
1985
2091
|
|
|
1986
2092
|
describe('MultiSelector search affordances', () => {
|
|
@@ -424,6 +424,11 @@ export type MultiSelectorStatusType = 'warning' | 'error' | 'success';
|
|
|
424
424
|
|
|
425
425
|
export type {MultiSelectorStatus};
|
|
426
426
|
|
|
427
|
+
export interface MultiSelectorSelectedItem {
|
|
428
|
+
value: string;
|
|
429
|
+
label: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
427
432
|
export interface MultiSelectorProps<
|
|
428
433
|
T extends MultiSelectorOptionType = MultiSelectorOptionType,
|
|
429
434
|
> extends Omit<BaseProps, 'onChange' | 'defaultValue'> {
|
|
@@ -608,6 +613,17 @@ export interface MultiSelectorProps<
|
|
|
608
613
|
*/
|
|
609
614
|
triggerDisplay?: 'count' | 'labels' | 'badges';
|
|
610
615
|
|
|
616
|
+
/**
|
|
617
|
+
* Formats the trigger text when triggerDisplay is 'count' or 'labels'.
|
|
618
|
+
* Receives the selected items (value plus resolved label, in selection
|
|
619
|
+
* order) and returns the full trigger text; the count is `items.length`.
|
|
620
|
+
* Not called when nothing is selected — the placeholder shows instead — and
|
|
621
|
+
* not called for triggerDisplay 'badges', which renders Badge elements
|
|
622
|
+
* rather than text.
|
|
623
|
+
* @default items => `${items.length} selected` for 'count', "A, B, C, +N" for 'labels'
|
|
624
|
+
*/
|
|
625
|
+
formatValue?: (items: MultiSelectorSelectedItem[]) => string;
|
|
626
|
+
|
|
611
627
|
/**
|
|
612
628
|
* Maximum number of badges to show before showing "+N".
|
|
613
629
|
* Only used when triggerDisplay is 'badges'.
|
|
@@ -711,6 +727,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
711
727
|
hasSearch = false,
|
|
712
728
|
searchPlaceholder: searchPlaceholderFromProps,
|
|
713
729
|
triggerDisplay = 'count',
|
|
730
|
+
formatValue,
|
|
714
731
|
maxBadges = 3,
|
|
715
732
|
renderOption,
|
|
716
733
|
indicatorPosition = 'start',
|
|
@@ -1107,13 +1124,18 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1107
1124
|
}, [popover.isOpen, highlightedIndex, getItemId]);
|
|
1108
1125
|
|
|
1109
1126
|
// Build trigger display content
|
|
1110
|
-
const
|
|
1127
|
+
const selectedItems = useMemo(() => {
|
|
1111
1128
|
return optimisticValue.map(v => {
|
|
1112
1129
|
const item = selectableItems.find(i => i.value === v);
|
|
1113
|
-
return item?.label ?? v;
|
|
1130
|
+
return {value: v, label: item?.label ?? v};
|
|
1114
1131
|
});
|
|
1115
1132
|
}, [optimisticValue, selectableItems]);
|
|
1116
1133
|
|
|
1134
|
+
const selectedLabels = useMemo(
|
|
1135
|
+
() => selectedItems.map(item => item.label),
|
|
1136
|
+
[selectedItems],
|
|
1137
|
+
);
|
|
1138
|
+
|
|
1117
1139
|
const renderTriggerContent = useCallback(() => {
|
|
1118
1140
|
if (optimisticValue.length === 0) {
|
|
1119
1141
|
return <span {...stylex.props(styles.triggerText)}>{placeholder}</span>;
|
|
@@ -1123,7 +1145,8 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1123
1145
|
case 'count':
|
|
1124
1146
|
return (
|
|
1125
1147
|
<span {...stylex.props(styles.triggerText)}>
|
|
1126
|
-
{
|
|
1148
|
+
{formatValue?.(selectedItems) ??
|
|
1149
|
+
`${optimisticValue.length} selected`}
|
|
1127
1150
|
</span>
|
|
1128
1151
|
);
|
|
1129
1152
|
|
|
@@ -1134,7 +1157,11 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1134
1157
|
remaining > 0
|
|
1135
1158
|
? `${displayed.join(', ')}, +${remaining}`
|
|
1136
1159
|
: displayed.join(', ');
|
|
1137
|
-
return
|
|
1160
|
+
return (
|
|
1161
|
+
<span {...stylex.props(styles.triggerText)}>
|
|
1162
|
+
{formatValue?.(selectedItems) ?? text}
|
|
1163
|
+
</span>
|
|
1164
|
+
);
|
|
1138
1165
|
}
|
|
1139
1166
|
|
|
1140
1167
|
case 'badges': {
|
|
@@ -1154,7 +1181,15 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1154
1181
|
);
|
|
1155
1182
|
}
|
|
1156
1183
|
}
|
|
1157
|
-
}, [
|
|
1184
|
+
}, [
|
|
1185
|
+
optimisticValue,
|
|
1186
|
+
triggerDisplay,
|
|
1187
|
+
selectedItems,
|
|
1188
|
+
selectedLabels,
|
|
1189
|
+
placeholder,
|
|
1190
|
+
formatValue,
|
|
1191
|
+
maxBadges,
|
|
1192
|
+
]);
|
|
1158
1193
|
|
|
1159
1194
|
// Render search input
|
|
1160
1195
|
const renderSearch = useCallback(() => {
|
|
@@ -1420,8 +1455,17 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1420
1455
|
// A standalone divider between groups would orphan itself once its
|
|
1421
1456
|
// neighbors are filtered out, so skip it while searching.
|
|
1422
1457
|
if (!isSearching) {
|
|
1458
|
+
// role="listbox" only permits option/group children; the divider
|
|
1459
|
+
// carries no information the options don't, so it's hidden from
|
|
1460
|
+
// the accessibility tree entirely rather than exposing
|
|
1461
|
+
// role="separator" as a disallowed listbox child (axe
|
|
1462
|
+
// aria-required-children).
|
|
1423
1463
|
elements.push(
|
|
1424
|
-
<Divider
|
|
1464
|
+
<Divider
|
|
1465
|
+
key={`divider-${i}`}
|
|
1466
|
+
aria-hidden="true"
|
|
1467
|
+
xstyle={styles.divider}
|
|
1468
|
+
/>,
|
|
1425
1469
|
);
|
|
1426
1470
|
}
|
|
1427
1471
|
} else if (isSection(option)) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import React, {useCallback, useMemo, type ReactNode} from 'react';
|
|
16
16
|
import * as stylex from '@stylexjs/stylex';
|
|
17
17
|
import {spacingVars} from '../theme/tokens.stylex';
|
|
18
|
-
import {mergeProps
|
|
18
|
+
import {mergeProps} from '../utils';
|
|
19
19
|
import type {BaseProps} from '../BaseProps';
|
|
20
20
|
import {useListFocus} from '../hooks/useListFocus';
|
|
21
21
|
import {useTypeahead} from '../hooks/useTypeahead';
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
type NavHeadingMenuSize,
|
|
27
27
|
} from './NavMenuContext';
|
|
28
28
|
|
|
29
|
+
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
29
30
|
const styles = stylex.create({
|
|
30
31
|
root: {
|
|
31
32
|
display: 'flex',
|
|
@@ -162,7 +163,7 @@ export function NavHeadingMenu({
|
|
|
162
163
|
return (
|
|
163
164
|
<NavHeadingMenuContext value={ctx}>
|
|
164
165
|
<div
|
|
165
|
-
ref={
|
|
166
|
+
ref={useMergedRefs(ref, listRef)}
|
|
166
167
|
role="menu"
|
|
167
168
|
onKeyDown={listKeyDown}
|
|
168
169
|
data-testid={testId}
|
|
@@ -61,6 +61,11 @@ export const docs = {
|
|
|
61
61
|
description:
|
|
62
62
|
'Whether the field is optional (mutually exclusive with isRequired).',
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
name: 'onKeyDown',
|
|
66
|
+
type: '(e: KeyboardEvent<HTMLInputElement>) => void',
|
|
67
|
+
description: 'Callback fired on keydown events on the input.',
|
|
68
|
+
},
|
|
64
69
|
{
|
|
65
70
|
name: 'isRequired',
|
|
66
71
|
type: 'boolean',
|
package/src/Outline/Outline.tsx
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
38
38
|
import {useListFocus} from '../hooks/useListFocus';
|
|
39
39
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
40
|
-
import {mergeProps
|
|
40
|
+
import {mergeProps} from '../utils';
|
|
41
41
|
import type {BaseProps} from '../BaseProps';
|
|
42
42
|
import {useScrollSpy} from './useScrollSpy';
|
|
43
43
|
import type {OutlineItem} from './types';
|
|
@@ -45,6 +45,7 @@ import {themeProps} from '../utils/themeProps';
|
|
|
45
45
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
46
46
|
import {useTranslator} from '../i18n';
|
|
47
47
|
|
|
48
|
+
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
48
49
|
export type {OutlineItem} from './types';
|
|
49
50
|
|
|
50
51
|
export interface OutlineProps extends BaseProps<HTMLElement> {
|
|
@@ -443,7 +444,7 @@ export function Outline({
|
|
|
443
444
|
return (
|
|
444
445
|
<nav
|
|
445
446
|
{...props}
|
|
446
|
-
ref={
|
|
447
|
+
ref={useMergedRefs(rootRef, ref)}
|
|
447
448
|
aria-label={label}
|
|
448
449
|
data-testid={testId}
|
|
449
450
|
{...mergeProps(
|
|
@@ -22,11 +22,12 @@ import {type ReactNode, type ReactElement, Children} from 'react';
|
|
|
22
22
|
import type {BaseProps} from '../BaseProps';
|
|
23
23
|
import type {SpacingStep} from '../utils/types';
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
|
-
import {mergeProps
|
|
25
|
+
import {mergeProps} from '../utils';
|
|
26
26
|
import {useOverflow} from '../hooks/useOverflow';
|
|
27
27
|
import {spacingVars} from '../theme/tokens.stylex';
|
|
28
28
|
import {themeProps} from '../utils/themeProps';
|
|
29
29
|
|
|
30
|
+
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
30
31
|
const styles = stylex.create({
|
|
31
32
|
container: {
|
|
32
33
|
display: 'flex',
|
|
@@ -280,7 +281,7 @@ export function OverflowList({
|
|
|
280
281
|
|
|
281
282
|
{/* Visible container */}
|
|
282
283
|
<div
|
|
283
|
-
ref={
|
|
284
|
+
ref={useMergedRefs(ref, containerRef)}
|
|
284
285
|
{...mergeProps(
|
|
285
286
|
themeProps('overflow-list'),
|
|
286
287
|
stylex.props(
|
package/src/Overlay/Overlay.tsx
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import type {ReactNode, Ref} from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
|
-
import {mergeProps
|
|
20
|
+
import {mergeProps} from '../utils';
|
|
21
21
|
import {useOverlay} from './useOverlay';
|
|
22
22
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
23
23
|
import {overlayScope, overlayContainerStyles} from './overlay.markers.stylex';
|
|
@@ -30,6 +30,7 @@ import type {
|
|
|
30
30
|
OverlayShowOn,
|
|
31
31
|
} from './OverlayScrim';
|
|
32
32
|
|
|
33
|
+
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
33
34
|
export interface OverlayProps extends Pick<
|
|
34
35
|
BaseProps<HTMLDivElement>,
|
|
35
36
|
'xstyle' | 'className' | 'style'
|
|
@@ -113,7 +114,7 @@ export function Overlay({
|
|
|
113
114
|
|
|
114
115
|
return (
|
|
115
116
|
<div
|
|
116
|
-
ref={
|
|
117
|
+
ref={useMergedRefs(ref, overlay.containerRef)}
|
|
117
118
|
{...mergeProps(
|
|
118
119
|
themeProps('overlay'),
|
|
119
120
|
stylex.props(overlayScope, overlayContainerStyles.root, xstyle),
|
|
@@ -19,6 +19,7 @@ import React, {useCallback, useEffect, useRef, type ReactNode} from 'react';
|
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import {useLayer, type ContextRenderProps} from '../Layer/useLayer';
|
|
21
21
|
import {useFocusTrap} from '../hooks/useFocusTrap';
|
|
22
|
+
import {LayerDepthProvider} from '../Layer/LayerDepthContext';
|
|
22
23
|
import type {StyleXStyles} from '@stylexjs/stylex';
|
|
23
24
|
import {
|
|
24
25
|
colorVars,
|
|
@@ -436,34 +437,36 @@ export function usePopover(options: UsePopoverOptions = {}): UsePopoverReturn {
|
|
|
436
437
|
: surfaceProps.className;
|
|
437
438
|
|
|
438
439
|
return layer.render(
|
|
439
|
-
<
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
{...
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
440
|
+
<LayerDepthProvider>
|
|
441
|
+
<div
|
|
442
|
+
ref={contentRef}
|
|
443
|
+
role={role === 'dialog' ? 'dialog' : undefined}
|
|
444
|
+
aria-modal={role === 'dialog' && isModal ? true : undefined}
|
|
445
|
+
aria-label={role === 'dialog' ? dialogLabel : undefined}
|
|
446
|
+
{...mergeProps(
|
|
447
|
+
{...surfaceProps, className: surfaceClassName},
|
|
448
|
+
stylex.props(
|
|
449
|
+
styles.contentWrapper,
|
|
450
|
+
hasSurface && styles.surface,
|
|
451
|
+
xstyle,
|
|
452
|
+
),
|
|
453
|
+
)}>
|
|
454
|
+
{children}
|
|
455
|
+
{hasCloseButton && (
|
|
456
|
+
<div
|
|
457
|
+
{...stylex.props(
|
|
458
|
+
styles.closeButtonWrapper,
|
|
459
|
+
rtlStyles.centerInline('100%'),
|
|
460
|
+
)}>
|
|
461
|
+
<Button
|
|
462
|
+
variant="secondary"
|
|
463
|
+
label={closeButtonLabel}
|
|
464
|
+
onClick={layer.hide}
|
|
465
|
+
/>
|
|
466
|
+
</div>
|
|
467
|
+
)}
|
|
468
|
+
</div>
|
|
469
|
+
</LayerDepthProvider>,
|
|
467
470
|
{...props, xstyle: props?.xstyle},
|
|
468
471
|
);
|
|
469
472
|
},
|