@astryxdesign/core 0.4.6 → 0.4.7-canary.019ae5a
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 +37 -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 +1 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +54 -15
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +6 -0
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetEdgeTint.js +62 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +13 -6
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +23 -5
- 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 +10 -3
- 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 -3
- 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 +72 -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 +10 -3
- package/dist/hooks/useListFocus.d.ts +5 -2
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +12 -6
- 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/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 +36 -4
- package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +225 -0
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +82 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +66 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +19 -0
- package/src/BottomSheet/BottomSheetSwitcher.tsx +16 -2
- package/src/BottomSheet/useSheetGestures.test.ts +27 -0
- package/src/BottomSheet/useSheetGestures.ts +25 -5
- 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.test.tsx +17 -0
- package/src/Kbd/Kbd.tsx +10 -3
- 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/Popover.test.tsx +27 -1
- 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 -3
- package/src/TabList/TabList.doc.mjs +22 -6
- package/src/TabList/TabList.test.tsx +580 -4
- 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.test.ts +18 -0
- package/src/hooks/useHotkeys.ts +10 -3
- package/src/hooks/useListFocus.doc.mjs +2 -2
- package/src/hooks/useListFocus.test.tsx +65 -3
- package/src/hooks/useListFocus.ts +15 -7
- 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/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
package/dist/Spinner/Spinner.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Spinner.tsx
|
|
7
|
-
* @input Uses React, StyleX,
|
|
7
|
+
* @input Uses React, StyleX, SVG rendering
|
|
8
8
|
* @output Exports Spinner component, SpinnerProps, SpinnerSize, SpinnerShade types
|
|
9
9
|
* @position Core implementation of spinner loading indicator
|
|
10
10
|
*
|
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
* - /apps/storybook/stories/Spinner.stories.tsx
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/Spinner/ (showcase blocks)
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { useId } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import "../theme/tokens.stylex.js";
|
|
21
|
-
import { durationVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
22
|
-
import { useTheme } from "../theme/useTheme.js";
|
|
21
|
+
import { colorVars, durationVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
23
22
|
import { Text } from "../Text/Text.js";
|
|
24
23
|
import { mergeProps } from "../utils/index.js";
|
|
25
24
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -28,11 +27,12 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
28
27
|
// Constants
|
|
29
28
|
// =============================================================================
|
|
30
29
|
|
|
31
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Fraction of the ring the moving arc covers. The canvas ring this replaces
|
|
32
|
+
* swept 135deg, not the 270deg its constant's comment claimed.
|
|
33
|
+
*/
|
|
32
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
-
const
|
|
34
|
-
/** Where the active arc starts (as a fraction of 2π) */
|
|
35
|
-
const START_POINT = 1.5;
|
|
35
|
+
const ARC_FRACTION = 0.375;
|
|
36
36
|
const SIZES = {
|
|
37
37
|
sm: {
|
|
38
38
|
diameter: 10,
|
|
@@ -52,6 +52,57 @@ const SIZES = {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
+
/** `onMedia` keeps the 77/255 its token's `4D` hex suffix used to encode. */
|
|
56
|
+
const TRACK_OPACITY = {
|
|
57
|
+
default: 1,
|
|
58
|
+
subtle: 1,
|
|
59
|
+
onMedia: 77 / 255,
|
|
60
|
+
inherit: 0.3
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Pin every ring's rotation to the document timeline's origin instead of its
|
|
65
|
+
* own start time, so spinners mounted seconds apart turn in phase.
|
|
66
|
+
*
|
|
67
|
+
* Setting `startTime` is exact where arithmetic on a clock read is not: a
|
|
68
|
+
* negative `animation-delay` computed at mount is only as good as the gap
|
|
69
|
+
* between reading the clock and the frame the animation starts in, which at
|
|
70
|
+
* 10x CPU throttling measured 116deg of drift.
|
|
71
|
+
*
|
|
72
|
+
* Rings are collected and pinned in one frame because `getAnimations()`
|
|
73
|
+
* resolves style and `startTime` dirties it again, so pinning them one at a
|
|
74
|
+
* time makes each mount re-force what the previous one invalidated — 53 style
|
|
75
|
+
* recalcs for 38 spinners against 19 batched.
|
|
76
|
+
*/
|
|
77
|
+
const pendingRings = new Set();
|
|
78
|
+
let flushScheduled = false;
|
|
79
|
+
function pinRingsToTimelineOrigin() {
|
|
80
|
+
flushScheduled = false;
|
|
81
|
+
const animations = [];
|
|
82
|
+
for (const svg of pendingRings) {
|
|
83
|
+
animations.push(...svg.getAnimations());
|
|
84
|
+
}
|
|
85
|
+
pendingRings.clear();
|
|
86
|
+
for (const animation of animations) {
|
|
87
|
+
animation.startTime = 0;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function syncRotationPhase(svg) {
|
|
91
|
+
// jsdom implements no Web Animations, and this runs in every consumer's
|
|
92
|
+
// component tests.
|
|
93
|
+
if (svg == null || typeof svg.getAnimations !== 'function') {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
pendingRings.add(svg);
|
|
97
|
+
if (!flushScheduled) {
|
|
98
|
+
flushScheduled = true;
|
|
99
|
+
requestAnimationFrame(pinRingsToTimelineOrigin);
|
|
100
|
+
}
|
|
101
|
+
return () => {
|
|
102
|
+
pendingRings.delete(svg);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
55
106
|
// =============================================================================
|
|
56
107
|
// Animation
|
|
57
108
|
// =============================================================================
|
|
@@ -76,6 +127,51 @@ const styles = {
|
|
|
76
127
|
kVQacm: "xb3r6kr",
|
|
77
128
|
kXLuUW: "xxymvpz",
|
|
78
129
|
$$css: true
|
|
130
|
+
},
|
|
131
|
+
circle: {
|
|
132
|
+
kDwRjp: "xbh8q5q",
|
|
133
|
+
kU5bRw: "x1owpc8m",
|
|
134
|
+
$$css: true
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const arcStyles = {
|
|
138
|
+
default: {
|
|
139
|
+
kjVXCG: "xjsr54c",
|
|
140
|
+
$$css: true
|
|
141
|
+
},
|
|
142
|
+
subtle: {
|
|
143
|
+
kjVXCG: "xxvau67",
|
|
144
|
+
$$css: true
|
|
145
|
+
},
|
|
146
|
+
onMedia: {
|
|
147
|
+
kjVXCG: "x16lqycg",
|
|
148
|
+
$$css: true
|
|
149
|
+
},
|
|
150
|
+
inherit: {
|
|
151
|
+
kjVXCG: "x73je2i",
|
|
152
|
+
$$css: true
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const trackStyles = {
|
|
156
|
+
default: {
|
|
157
|
+
kjVXCG: "xpi25hw",
|
|
158
|
+
kDd8S0: "x1g350g8",
|
|
159
|
+
$$css: true
|
|
160
|
+
},
|
|
161
|
+
subtle: {
|
|
162
|
+
kjVXCG: "xpi25hw",
|
|
163
|
+
kDd8S0: "x1g350g8",
|
|
164
|
+
$$css: true
|
|
165
|
+
},
|
|
166
|
+
onMedia: {
|
|
167
|
+
kjVXCG: "x16lqycg",
|
|
168
|
+
kDd8S0: "x1smxkh6",
|
|
169
|
+
$$css: true
|
|
170
|
+
},
|
|
171
|
+
inherit: {
|
|
172
|
+
kjVXCG: "x73je2i",
|
|
173
|
+
kDd8S0: "x7bo2k",
|
|
174
|
+
$$css: true
|
|
79
175
|
}
|
|
80
176
|
};
|
|
81
177
|
|
|
@@ -88,7 +184,7 @@ const styles = {
|
|
|
88
184
|
// =============================================================================
|
|
89
185
|
|
|
90
186
|
/**
|
|
91
|
-
* An animated loading indicator. Available in
|
|
187
|
+
* An animated loading indicator. Available in four sizes and four color shades.
|
|
92
188
|
*
|
|
93
189
|
* @example
|
|
94
190
|
* ```
|
|
@@ -111,77 +207,14 @@ export function Spinner({
|
|
|
111
207
|
ref,
|
|
112
208
|
...restProps
|
|
113
209
|
}) {
|
|
114
|
-
const canvasRef = useRef(null);
|
|
115
|
-
const {
|
|
116
|
-
tokens: themeTokens
|
|
117
|
-
} = useTheme();
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
const canvas = canvasRef.current;
|
|
120
|
-
if (canvas == null) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
const context = canvas.getContext('2d');
|
|
124
|
-
if (!context) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
const {
|
|
128
|
-
border,
|
|
129
|
-
diameter
|
|
130
|
-
} = SIZES[size];
|
|
131
|
-
const pixelRatio = window.devicePixelRatio || 1;
|
|
132
|
-
|
|
133
|
-
// Resolve colors from theme tokens (useTheme handles light/dark resolution).
|
|
134
|
-
// - default → accent ring on a track tuned to body luminance
|
|
135
|
-
// - subtle → secondary text color, less prominent
|
|
136
|
-
// - onMedia → on-dark color, with a translucent track for photos/video
|
|
137
|
-
// - inherit → the inherited currentColor, so the ring matches the parent's
|
|
138
|
-
// resolved foreground (e.g. a button's variant text color)
|
|
139
|
-
const inheritedColor = shade === 'inherit' ? getComputedStyle(canvas).color : null;
|
|
140
|
-
const activeColor = shade === 'inherit' ? inheritedColor : shade === 'onMedia' ? themeTokens['--color-on-dark'] : shade === 'subtle' ? themeTokens['--color-text-secondary'] : themeTokens['--color-accent'];
|
|
141
|
-
// Track derives from --color-on-dark for onMedia (with a 30% alpha so the
|
|
142
|
-
// ring reads against arbitrary backgrounds) and from --color-track for the
|
|
143
|
-
// body-luminance shades. For inherit, the track is the same currentColor
|
|
144
|
-
// drawn at reduced alpha via globalAlpha (see below). All branches are
|
|
145
|
-
// fully theme-driven.
|
|
146
|
-
const backgroundColor = shade === 'inherit' ? inheritedColor : shade === 'onMedia' ? `${themeTokens['--color-on-dark']}4D` : themeTokens['--color-track'];
|
|
147
|
-
const cssSize = diameter + border * 2;
|
|
148
|
-
|
|
149
|
-
// Round to an even number of device pixels so the center stays on a whole
|
|
150
|
-
// pixel (avoids rotation jitter); keep CSS size pinned to cssSize (#2732).
|
|
151
|
-
const rawFrameSize = Math.round(cssSize * pixelRatio);
|
|
152
|
-
const frameSize = rawFrameSize + rawFrameSize % 2;
|
|
153
|
-
const scale = frameSize / cssSize;
|
|
154
|
-
const radius = diameter / 2 * scale;
|
|
155
|
-
const lineWidth = border * scale;
|
|
156
|
-
canvas.height = canvas.width = frameSize;
|
|
157
|
-
canvas.style.width = canvas.style.height = cssSize + 'px';
|
|
158
|
-
context.lineCap = 'round';
|
|
159
|
-
context.lineWidth = lineWidth;
|
|
160
|
-
const center = frameSize / 2;
|
|
161
|
-
|
|
162
|
-
// Background circle (full ring, faded). For the inherit shade the track is
|
|
163
|
-
// the same currentColor as the arc, so fade it via globalAlpha (the
|
|
164
|
-
// computed color is an opaque rgb() string with no alpha channel to tweak).
|
|
165
|
-
context.beginPath();
|
|
166
|
-
context.arc(center, center, radius, 0, 2 * Math.PI);
|
|
167
|
-
context.strokeStyle = backgroundColor;
|
|
168
|
-
if (shade === 'inherit') {
|
|
169
|
-
context.globalAlpha = 0.3;
|
|
170
|
-
}
|
|
171
|
-
context.stroke();
|
|
172
|
-
context.globalAlpha = 1;
|
|
173
|
-
|
|
174
|
-
// Active arc (partial ring, colored)
|
|
175
|
-
context.beginPath();
|
|
176
|
-
context.arc(center, center, radius, START_POINT * Math.PI, (START_POINT + SPREAD) % 2 * Math.PI);
|
|
177
|
-
context.strokeStyle = activeColor;
|
|
178
|
-
context.stroke();
|
|
179
|
-
}, [shade, size, themeTokens]);
|
|
180
210
|
const {
|
|
181
211
|
border,
|
|
182
212
|
diameter
|
|
183
213
|
} = SIZES[size];
|
|
184
214
|
const frameSize = diameter + border * 2;
|
|
215
|
+
const center = frameSize / 2;
|
|
216
|
+
const circumference = Math.PI * diameter;
|
|
217
|
+
const arcLength = circumference * ARC_FRACTION;
|
|
185
218
|
const hasLabel = label != null;
|
|
186
219
|
const labelId = useId();
|
|
187
220
|
|
|
@@ -208,11 +241,30 @@ export function Spinner({
|
|
|
208
241
|
width: frameSize,
|
|
209
242
|
height: frameSize
|
|
210
243
|
}),
|
|
211
|
-
children: /*#__PURE__*/
|
|
212
|
-
ref:
|
|
244
|
+
children: /*#__PURE__*/_jsxs("svg", {
|
|
245
|
+
ref: syncRotationPhase,
|
|
246
|
+
width: frameSize,
|
|
247
|
+
height: frameSize,
|
|
248
|
+
viewBox: `0 0 ${frameSize} ${frameSize}`,
|
|
249
|
+
"aria-hidden": "true",
|
|
213
250
|
...{
|
|
214
251
|
className: "xlp1x4z x1lliihq x1so62im x14qxm4i xnh0sag xa4qsjk x1ka1v4i x1esw782"
|
|
215
|
-
}
|
|
252
|
+
},
|
|
253
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
254
|
+
cx: center,
|
|
255
|
+
cy: center,
|
|
256
|
+
r: diameter / 2,
|
|
257
|
+
strokeWidth: border,
|
|
258
|
+
...stylex.props(styles.circle, trackStyles[shade])
|
|
259
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
260
|
+
cx: center,
|
|
261
|
+
cy: center,
|
|
262
|
+
r: diameter / 2,
|
|
263
|
+
strokeWidth: border,
|
|
264
|
+
strokeDasharray: `${arcLength} ${circumference - arcLength}`,
|
|
265
|
+
transform: `rotate(-90 ${center} ${center})`,
|
|
266
|
+
...stylex.props(styles.circle, arcStyles[shade])
|
|
267
|
+
})]
|
|
216
268
|
})
|
|
217
269
|
});
|
|
218
270
|
if (!hasLabel) {
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Step.tsx
|
|
3
|
+
* @input Uses React, stylex, theme tokens (including the motion duration token
|
|
4
|
+
* the connector fill animates on), StepperContext
|
|
5
|
+
* @output Exports Step component and StepProps
|
|
6
|
+
* @position Individual step item; used inside Stepper
|
|
7
|
+
*
|
|
8
|
+
* Every connector this file draws — the separated progress bars and the
|
|
9
|
+
* on-track segments alike — paints its accent fill as a scaled ::before rather
|
|
10
|
+
* than by swapping a background color, so a step the flow advances into grows
|
|
11
|
+
* its line along the track. See the CONNECTOR FILL block in the styles below
|
|
12
|
+
* for the axis/RTL/reduced-motion rules that go with it.
|
|
13
|
+
*
|
|
14
|
+
* Exactly one change animates: advancing a single step. Going back, jumping
|
|
15
|
+
* forward by more than one, and mounting mid-flow all land at once. The rule
|
|
16
|
+
* and the reasoning behind it sit above the styles; the arithmetic that keeps
|
|
17
|
+
* the one animated span reading as a single front — an on-track span is drawn
|
|
18
|
+
* by two steps, three where a content slot splits it — is in the component.
|
|
19
|
+
* Nothing about it is public API: Stepper hands each Step the step it came
|
|
20
|
+
* from through context, and the rest is derived.
|
|
21
|
+
*
|
|
22
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
23
|
+
* - /packages/core/src/Stepper/Stepper.doc.mjs
|
|
24
|
+
* - /packages/core/src/Stepper/Stepper.test.tsx
|
|
25
|
+
* - /packages/core/src/Stepper/index.ts
|
|
26
|
+
* - /apps/storybook/stories/Stepper.stories.tsx
|
|
27
|
+
* - /packages/cli/assets/templates/blocks/components/Stepper/ (showcase blocks)
|
|
28
|
+
* - /packages/cli/assets/templates/blocks/components/Step/ (showcase blocks)
|
|
29
|
+
*/
|
|
30
|
+
import { type ReactNode } from 'react';
|
|
31
|
+
import type { BaseProps } from '../BaseProps';
|
|
32
|
+
import type { StepStatus } from './StepStatus';
|
|
33
|
+
/**
|
|
34
|
+
* Built-in indicator presets. Anything other than these strings passed to
|
|
35
|
+
* `indicator` is treated as a custom ReactNode (e.g. an `<Icon />`).
|
|
36
|
+
* - 'auto': numbered badge for not-yet-reached steps, a check once completed
|
|
37
|
+
* (default)
|
|
38
|
+
* - 'number': always a numbered badge
|
|
39
|
+
* - 'none': no indicator — just the progress bar and label
|
|
40
|
+
*/
|
|
41
|
+
export type StepIndicatorPreset = 'auto' | 'number' | 'none';
|
|
42
|
+
export type StepDensity = 'compact' | 'balanced' | 'spacious';
|
|
43
|
+
export interface StepProps extends BaseProps<HTMLLIElement> {
|
|
44
|
+
/** Ref forwarded to the root element */
|
|
45
|
+
ref?: React.Ref<HTMLLIElement>;
|
|
46
|
+
/**
|
|
47
|
+
* Zero-based index of this step. Used to derive progress (completed /
|
|
48
|
+
* active / not-started) relative to the parent's `activeStep`.
|
|
49
|
+
*/
|
|
50
|
+
step: number;
|
|
51
|
+
/**
|
|
52
|
+
* Step label text.
|
|
53
|
+
*/
|
|
54
|
+
label: string;
|
|
55
|
+
/**
|
|
56
|
+
* Optional description shown below the label.
|
|
57
|
+
*/
|
|
58
|
+
description?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Content rendered below the label and description. Useful in vertical
|
|
61
|
+
* steppers to show form fields or detailed content for each step.
|
|
62
|
+
*/
|
|
63
|
+
children?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Semantic status for the step, mapped to the global Astryx semantic tokens
|
|
66
|
+
* (`accent`, `success`, `warning`, `error`). In the default `auto` indicator
|
|
67
|
+
* mode it sets both the indicator color and a matching glyph: `success` shows
|
|
68
|
+
* a green check-circle, `warning`/`error` show the shared Input status icons.
|
|
69
|
+
* `accent` is color-only. The current (in-progress) step always keeps its
|
|
70
|
+
* current-step indicator regardless of `status`. Never recolors the
|
|
71
|
+
* connector/track.
|
|
72
|
+
*
|
|
73
|
+
* Because the indicator glyphs are decorative (aria-hidden), the status also
|
|
74
|
+
* reaches assistive technology as text: visually hidden "completed" /
|
|
75
|
+
* "warning" / "error" next to the label, and composed into the accessible
|
|
76
|
+
* name of clickable steps.
|
|
77
|
+
*/
|
|
78
|
+
status?: StepStatus;
|
|
79
|
+
/**
|
|
80
|
+
* Disable interaction for this step.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
isDisabled?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Marks the step as optional, appending an "Optional" affordance after the
|
|
86
|
+
* label.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
isOptional?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Trailing content rendered at the end of the label row (e.g. a timestamp
|
|
92
|
+
* or status chip).
|
|
93
|
+
*/
|
|
94
|
+
endContent?: ReactNode;
|
|
95
|
+
/**
|
|
96
|
+
* What to show as the step indicator. Accepts a preset string or any
|
|
97
|
+
* ReactNode:
|
|
98
|
+
* - 'auto': numbered badge until completed, then a check (default)
|
|
99
|
+
* - 'number': always a numbered badge
|
|
100
|
+
* - 'none': no indicator, just the bar + label
|
|
101
|
+
* - ReactNode: any custom icon or element to render as the indicator
|
|
102
|
+
* @default 'auto'
|
|
103
|
+
*/
|
|
104
|
+
indicator?: StepIndicatorPreset | ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Controls vertical padding of the step. Falls back to the stepper-level
|
|
107
|
+
* density when unset.
|
|
108
|
+
* - 'compact': minimal padding (4px block)
|
|
109
|
+
* - 'balanced': default (8px block)
|
|
110
|
+
* - 'spacious': generous (12px block, 12px inline)
|
|
111
|
+
*/
|
|
112
|
+
density?: StepDensity;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* An individual step within an Stepper. Renders a 4px progress-bar segment,
|
|
116
|
+
* an indicator (numbered badge, check, or any custom icon), a label with
|
|
117
|
+
* optional description, and an optional content slot.
|
|
118
|
+
*
|
|
119
|
+
* Progress (completed / active / not-started) is derived from the parent's
|
|
120
|
+
* `activeStep` and this step's `step` prop. The optional `status` prop layers a
|
|
121
|
+
* semantic meaning on top: in the default `auto` indicator mode it recolors the
|
|
122
|
+
* indicator and swaps in a matching glyph (`success` → green check-circle,
|
|
123
|
+
* `warning`/`error` → the shared Input status icons). The current step always
|
|
124
|
+
* keeps its current-step ring. `status` never recolors the connector/track.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```
|
|
128
|
+
* <Step step={0} label="Account details" description="Enter your email" />
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```
|
|
133
|
+
* <Step step={1} label="Payment" status="error" />
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare function Step({ step, label, description, children, status, isDisabled, isOptional, endContent, indicator: indicatorProp, density: densityProp, xstyle, className, style, ref, 'data-testid': dataTestId, ...rest }: StepProps): import("react").JSX.Element;
|
|
137
|
+
export declare namespace Step {
|
|
138
|
+
var displayName: string;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=Step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../src/Stepper/Step.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAmBhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAM5C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzD,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AA4tBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,UAAkB,EAClB,UAAkB,EAClB,UAAU,EACV,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACR,EAAE,SAAS,+BAitBX;yBAluBe,IAAI"}
|