@astryxdesign/core 0.5.2-canary.2da7a39 → 0.5.2-canary.2e51213
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/dist/AppShell/AppShell.d.ts +2 -2
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +10 -7
- package/dist/Banner/Banner.d.ts +5 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +7 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +3 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +22 -15
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -2
- package/dist/Chat/ChatComposer.d.ts +2 -2
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +21 -2
- package/dist/Chat/ChatToolCalls.d.ts +1 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +12 -34
- package/dist/Chat/useChatNewMessages.js +3 -3
- package/dist/CheckboxList/CheckboxListItem.d.ts +5 -3
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts +47 -13
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +269 -162
- package/dist/DateTimeInput/NativeDateSegment.d.ts +24 -0
- package/dist/DateTimeInput/NativeDateSegment.d.ts.map +1 -0
- package/dist/DateTimeInput/NativeDateSegment.js +235 -0
- package/dist/DateTimeInput/NativeTimeSegment.d.ts +30 -0
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -0
- package/dist/DateTimeInput/NativeTimeSegment.js +248 -0
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/DateTimeInput/nativePickerSegmentStyles.d.ts +95 -0
- package/dist/DateTimeInput/nativePickerSegmentStyles.d.ts.map +1 -0
- package/dist/DateTimeInput/nativePickerSegmentStyles.js +103 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +2 -4
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +10 -4
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +3 -5
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +4 -2
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +2 -4
- package/dist/Layout/Layout.d.ts +7 -8
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +7 -8
- package/dist/MultiSelector/MultiSelector.d.ts +11 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +89 -45
- package/dist/RadioList/RadioListItem.d.ts +30 -5
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +17 -4
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +102 -44
- package/dist/Resizable/index.d.ts +2 -0
- package/dist/Resizable/index.d.ts.map +1 -1
- package/dist/Resizable/index.js +1 -0
- package/dist/Resizable/useResizable.d.ts +89 -8
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +521 -38
- package/dist/Resizable/utils.d.ts +35 -0
- package/dist/Resizable/utils.d.ts.map +1 -0
- package/dist/Resizable/utils.js +27 -0
- package/dist/Selector/Selector.d.ts +10 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +105 -57
- package/dist/Selector/useSelectorPresentation.d.ts +1 -0
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +17 -2
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +3 -5
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +9 -10
- package/dist/Stepper/Step.d.ts +2 -1
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +75 -11
- package/dist/Stepper/Stepper.d.ts.map +1 -1
- package/dist/Stepper/Stepper.js +1 -0
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +2 -3
- package/dist/Table/index.d.ts +16 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +4 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +8 -9
- package/dist/Table/plugins/rowStatus/index.d.ts +1 -1
- package/dist/Table/plugins/rowStatus/index.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts +11 -30
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +108 -62
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +9 -1
- package/dist/Text/useTruncation.d.ts +1 -1
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +8 -7
- package/dist/TimeInput/TimeInput.d.ts +16 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +98 -60
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.d.ts +2 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +4 -145
- package/dist/Timestamp/formatRelativeTime.d.ts +20 -0
- package/dist/Timestamp/formatRelativeTime.d.ts.map +1 -0
- package/dist/Timestamp/formatRelativeTime.js +81 -0
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +125 -77
- package/dist/Tokenizer/Tokenizer.d.ts +0 -38
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +94 -26
- package/dist/Tokenizer/useEndLaneReserve.d.ts +31 -0
- package/dist/Tokenizer/useEndLaneReserve.d.ts.map +1 -0
- package/dist/Tokenizer/useEndLaneReserve.js +136 -0
- package/dist/Tooltip/useTooltip.d.ts +1 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +53 -42
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +85 -30
- package/dist/Typeahead/Typeahead.d.ts +0 -21
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +108 -67
- package/dist/Typeahead/busyIndicatorLane.d.ts +62 -0
- package/dist/Typeahead/busyIndicatorLane.d.ts.map +1 -0
- package/dist/Typeahead/busyIndicatorLane.js +98 -0
- package/dist/astryx.css +25 -7
- package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -1
- package/dist/hooks/useFocusReturnVisibility.js +3 -5
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +11 -11
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +7 -4
- package/dist/theme/defineTheme.d.ts +13 -0
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +7 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +1 -1
- package/dist/theme/localTokens.d.ts +18 -0
- package/dist/theme/localTokens.d.ts.map +1 -0
- package/dist/theme/localTokens.js +162 -0
- package/dist/utils/interactionModality.d.ts +6 -28
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +72 -37
- package/dist/utils/sharedResizeObserver.d.ts +17 -9
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +54 -12
- package/locales/en.json +8 -0
- package/locales/pseudo.json +6 -0
- package/package.json +7 -2
- package/src/AlertDialog/useImperativeAlertDialog.test.tsx +163 -0
- package/src/AppShell/AppShell.doc.mjs +4 -3
- package/src/AppShell/AppShell.test.tsx +21 -0
- package/src/AppShell/AppShell.tsx +12 -7
- package/src/Banner/Banner.doc.mjs +5 -1
- package/src/Banner/Banner.tsx +12 -1
- package/src/BottomSheet/BottomSheet.doc.mjs +31 -0
- package/src/BottomSheet/BottomSheet.spec.md +178 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +18 -9
- package/src/Breadcrumbs/Breadcrumbs.doc.mjs +4 -1
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +12 -0
- package/src/Button/Button.doc.mjs +56 -0
- package/src/ButtonGroup/ButtonGroup.doc.mjs +47 -0
- package/src/Calendar/hooks/useCalendarConstraints.test.ts +153 -0
- package/src/Calendar/hooks/useCalendarDays.test.ts +265 -0
- package/src/Calendar/hooks/useCalendarNavigation.test.ts +252 -0
- package/src/Carousel/Carousel.test.tsx +83 -0
- package/src/Carousel/Carousel.tsx +8 -2
- package/src/Chat/ChatComposer.doc.mjs +7 -4
- package/src/Chat/ChatComposer.test.tsx +84 -2
- package/src/Chat/ChatComposer.tsx +45 -3
- package/src/Chat/ChatSendButton.test.tsx +189 -0
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/Chat/ChatToolCalls.test.tsx +33 -1
- package/src/Chat/ChatToolCalls.tsx +13 -34
- package/src/Chat/useChatNewMessages.ts +3 -3
- package/src/Chat/useChatPasteAsToken.test.ts +191 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +172 -31
- package/src/CheckboxList/CheckboxList.spec.md +215 -0
- package/src/CheckboxList/CheckboxList.test.tsx +45 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +11 -9
- package/src/CheckboxList/CheckboxListItem.tsx +5 -3
- package/src/Collapsible/useCollapsible.test.tsx +236 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +72 -0
- package/src/CommandPalette/CommandPalette.spec.md +224 -0
- package/src/CommandPalette/CommandPaletteEmpty.test.tsx +101 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
- package/src/ComplexSelector/ComplexSelector.spec.md +190 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +48 -0
- package/src/ContextMenu/ContextMenu.spec.md +207 -0
- package/src/DateTimeInput/DateTimeInput.doc.mjs +43 -23
- package/src/DateTimeInput/DateTimeInput.tsx +388 -181
- package/src/DateTimeInput/DateTimeInputTouch.test.tsx +10 -2
- package/src/DateTimeInput/NativeDateSegment.tsx +308 -0
- package/src/DateTimeInput/NativePickerSegments.test.tsx +626 -0
- package/src/DateTimeInput/NativeTimeSegment.tsx +331 -0
- package/src/DateTimeInput/index.ts +1 -0
- package/src/DateTimeInput/nativePickerSegmentStyles.ts +120 -0
- package/src/Divider/Divider.doc.mjs +24 -0
- package/src/Divider/Divider.spec.md +157 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +104 -0
- package/src/DropdownMenu/DropdownMenu.spec.md +246 -0
- package/src/DropdownMenu/DropdownMenu.tsx +2 -4
- package/src/Field/Field.doc.mjs +1 -0
- package/src/Field/Field.test.tsx +39 -0
- package/src/Field/Field.tsx +18 -1
- package/src/Field/InputClearButton.test.tsx +68 -6
- package/src/Field/PanelSearchInput.tsx +3 -5
- package/src/FieldStatus/FieldStatus.doc.mjs +21 -0
- package/src/FieldStatus/FieldStatus.spec.md +213 -0
- package/src/FieldStatus/FieldStatus.test.tsx +17 -0
- package/src/FieldStatus/FieldStatus.tsx +7 -2
- package/src/Grid/Grid.doc.mjs +19 -0
- package/src/Grid/Grid.spec.md +162 -0
- package/src/Icon/Icon.doc.mjs +196 -48
- package/src/Icon/Icon.spec.md +192 -0
- package/src/IconButton/IconButton.doc.mjs +38 -0
- package/src/Kbd/Kbd.doc.mjs +18 -0
- package/src/Kbd/Kbd.spec.md +142 -0
- package/src/Layer/useTouchTrigger.ts +2 -4
- package/src/Layout/Layout.doc.mjs +57 -17
- package/src/Layout/Layout.spec.md +235 -0
- package/src/Layout/Layout.test.tsx +1 -1
- package/src/Layout/Layout.tsx +7 -8
- package/src/Layout/LayoutHeader.doc.mjs +9 -0
- package/src/Layout/LayoutPanel.doc.mjs +4 -3
- package/src/Lightbox/Lightbox.doc.mjs +149 -33
- package/src/Lightbox/Lightbox.spec.md +198 -0
- package/src/Lightbox/useLightbox.test.tsx +263 -0
- package/src/Markdown/Markdown.doc.mjs +60 -0
- package/src/Markdown/Markdown.spec.md +207 -0
- package/src/MobileNav/MobileNav.doc.mjs +140 -32
- package/src/MobileNav/MobileNav.spec.md +209 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +42 -0
- package/src/MoreMenu/MoreMenu.spec.md +222 -0
- package/src/MultiSelector/MultiSelector.doc.mjs +124 -1
- package/src/MultiSelector/MultiSelector.spec.md +293 -0
- package/src/MultiSelector/MultiSelector.test.tsx +305 -2
- package/src/MultiSelector/MultiSelector.tsx +124 -55
- package/src/NavIcon/NavIcon.doc.mjs +17 -0
- package/src/NavIcon/NavIcon.spec.md +134 -0
- package/src/NavMenu/NavHeadingMenu.spec.md +210 -0
- package/src/NavMenu/NavMenu.doc.mjs +37 -0
- package/src/Outline/Outline.doc.mjs +35 -0
- package/src/Outline/Outline.spec.md +162 -0
- package/src/OverflowList/OverflowList.doc.mjs +24 -0
- package/src/OverflowList/OverflowList.spec.md +157 -0
- package/src/Pagination/Pagination.doc.mjs +74 -0
- package/src/Pagination/Pagination.spec.md +226 -0
- package/src/Popover/Popover.doc.mjs +264 -65
- package/src/Popover/Popover.spec.md +421 -0
- package/src/Popover/usePopover.doc.mjs +208 -33
- package/src/PowerSearch/PowerSearch.spec.md +291 -0
- package/src/PowerSearch/PowerSearchFilterEditor.test.tsx +253 -0
- package/src/PowerSearch/PowerSearchToken.test.tsx +228 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
- package/src/ProgressBar/ProgressBar.spec.md +261 -0
- package/src/RadioList/RadioList.test.tsx +136 -2
- package/src/RadioList/RadioListItem.doc.mjs +30 -11
- package/src/RadioList/RadioListItem.tsx +44 -8
- package/src/Resizable/Resizable.doc.mjs +130 -24
- package/src/Resizable/Resizable.spec.md +246 -0
- package/src/Resizable/ResizeHandle.test.tsx +177 -56
- package/src/Resizable/ResizeHandle.tsx +128 -45
- package/src/Resizable/index.ts +2 -0
- package/src/Resizable/shippedDirections.test.ts +462 -0
- package/src/Resizable/useResizable.doc.mjs +124 -29
- package/src/Resizable/useResizable.test.ts +1277 -3
- package/src/Resizable/useResizable.ts +760 -48
- package/src/Resizable/utils.test.ts +74 -0
- package/src/Resizable/utils.ts +35 -0
- package/src/Section/Section.doc.mjs +17 -0
- package/src/Section/Section.spec.md +139 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +83 -0
- package/src/SegmentedControl/SegmentedControl.spec.md +152 -0
- package/src/Selector/Selector.doc.mjs +133 -97
- package/src/Selector/Selector.spec.md +300 -0
- package/src/Selector/Selector.test.tsx +318 -1
- package/src/Selector/Selector.tsx +127 -60
- package/src/Selector/useSelectorPresentation.ts +24 -4
- package/src/SideNav/SideNav.test.tsx +3 -3
- package/src/SideNav/SideNavCollapseButton.doc.mjs +8 -0
- package/src/SideNav/SideNavItem.doc.mjs +1 -1
- package/src/Skeleton/Skeleton.doc.mjs +12 -0
- package/src/Skeleton/Skeleton.spec.md +127 -0
- package/src/Slider/Slider.doc.mjs +184 -30
- package/src/Slider/Slider.spec.md +224 -0
- package/src/Slider/Slider.tsx +2 -5
- package/src/Spinner/Spinner.doc.mjs +5 -5
- package/src/Spinner/Spinner.test.tsx +32 -7
- package/src/Spinner/Spinner.tsx +46 -14
- package/src/Stack/Stack.doc.mjs +22 -0
- package/src/Stack/Stack.spec.md +155 -0
- package/src/StatusDot/StatusDot.doc.mjs +17 -0
- package/src/StatusDot/StatusDot.spec.md +138 -0
- package/src/Stepper/Step.doc.mjs +1 -1
- package/src/Stepper/Step.tsx +118 -5
- package/src/Stepper/Stepper.doc.mjs +51 -1
- package/src/Stepper/Stepper.spec.md +245 -0
- package/src/Stepper/Stepper.test.tsx +315 -0
- package/src/Stepper/Stepper.tsx +8 -0
- package/src/Switch/Switch.doc.mjs +40 -0
- package/src/Switch/Switch.spec.md +175 -0
- package/src/TabList/TabList.tsx +2 -3
- package/src/Table/Table.doc.mjs +102 -24
- package/src/Table/Table.perf.test.tsx +51 -1
- package/src/Table/Table.spec.md +325 -0
- package/src/Table/TableHeaderCell.test.tsx +291 -0
- package/src/Table/index.ts +19 -4
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +8 -12
- package/src/Table/plugins/filtering/useTableFilterState.test.tsx +143 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +2 -1
- package/src/Table/plugins/rowStatus/index.ts +1 -4
- package/src/Table/plugins/rowStatus/useTableRowStatus.public.test.ts +92 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.spec.md +354 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +431 -56
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +155 -84
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +72 -0
- package/src/Table/plugins/sortable/useTableSortable.tsx +18 -1
- package/src/Table/useTableGroupedRows.doc.mjs +2 -2
- package/src/Table/useTableRowStatus.doc.mjs +5 -5
- package/src/Text/Text.doc.mjs +190 -43
- package/src/Text/Text.spec.md +206 -0
- package/src/Text/useTruncation.ts +8 -7
- package/src/TextArea/TextArea.doc.mjs +255 -45
- package/src/TextArea/TextArea.spec.md +205 -0
- package/src/TimeInput/NativeTimeInput.test.tsx +269 -0
- package/src/TimeInput/TimeInput.doc.mjs +47 -23
- package/src/TimeInput/TimeInput.tsx +109 -50
- package/src/TimeInput/index.ts +1 -0
- package/src/Timestamp/Timestamp.doc.mjs +2 -2
- package/src/Timestamp/Timestamp.test.tsx +75 -3
- package/src/Timestamp/Timestamp.tsx +7 -153
- package/src/Timestamp/formatRelativeTime.ts +96 -0
- package/src/Toast/ToastViewport.test.tsx +194 -0
- package/src/Toast/ToastViewport.tsx +136 -58
- package/src/ToggleButton/ToggleButton.doc.mjs +56 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -0
- package/src/Tokenizer/Tokenizer.spec.md +293 -0
- package/src/Tokenizer/Tokenizer.test.tsx +335 -1
- package/src/Tokenizer/Tokenizer.tsx +129 -46
- package/src/Tokenizer/useEndLaneReserve.ts +146 -0
- package/src/Toolbar/Toolbar.doc.mjs +19 -0
- package/src/Toolbar/Toolbar.spec.md +174 -0
- package/src/Tooltip/Tooltip.doc.mjs +17 -0
- package/src/Tooltip/Tooltip.spec.md +142 -0
- package/src/Tooltip/Tooltip.test.tsx +21 -1
- package/src/Tooltip/useTooltip.test.tsx +318 -0
- package/src/Tooltip/useTooltip.tsx +60 -39
- package/src/TreeList/TreeList.doc.mjs +58 -0
- package/src/TreeList/TreeList.spec.md +224 -0
- package/src/Typeahead/BaseTypeahead.tsx +96 -25
- package/src/Typeahead/Typeahead.doc.mjs +89 -1
- package/src/Typeahead/Typeahead.spec.md +257 -0
- package/src/Typeahead/Typeahead.test.tsx +502 -1
- package/src/Typeahead/Typeahead.tsx +187 -69
- package/src/Typeahead/TypeaheadItem.test.tsx +93 -2
- package/src/Typeahead/busyIndicatorLane.tsx +109 -0
- package/src/__tests__/stylexDeclarations.ts +51 -0
- package/src/hooks/useFocusReturnVisibility.ts +3 -5
- package/src/hooks/useOverflow.ts +11 -11
- package/src/hooks/useScrollLock.test.ts +103 -0
- package/src/hooks/useScrollOverflow.ts +7 -4
- package/src/i18n/useTranslator.test.tsx +197 -0
- package/src/theme/defineTheme.test.ts +227 -0
- package/src/theme/defineTheme.ts +30 -0
- package/src/theme/derivedVarRegistry.test.ts +6 -0
- package/src/theme/generateThemeRules.ts +4 -1
- package/src/theme/localTokens.ts +272 -0
- package/src/theme/themingTargets.test.ts +126 -28
- package/src/utils/interactionModality.test.ts +83 -0
- package/src/utils/interactionModality.ts +88 -36
- package/src/utils/sharedResizeObserver.test.ts +124 -5
- package/src/utils/sharedResizeObserver.ts +60 -14
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file utils.ts
|
|
3
|
+
* @output Server-safe Resizable sizing helpers and public types
|
|
4
|
+
* @position Subpath entry point: `@astryxdesign/core/Resizable/utils`
|
|
5
|
+
*/
|
|
6
|
+
import type { PixelWidth } from '../Table/utils';
|
|
7
|
+
export { pixel } from '../Table/utils';
|
|
8
|
+
export type { PixelWidth } from '../Table/utils';
|
|
9
|
+
/** A percentage with exactly one pixel floor or ceiling. */
|
|
10
|
+
export type ResizablePercentSize = {
|
|
11
|
+
type: 'percent';
|
|
12
|
+
value: number;
|
|
13
|
+
} & ({
|
|
14
|
+
min: PixelWidth;
|
|
15
|
+
max?: never;
|
|
16
|
+
} | {
|
|
17
|
+
min?: never;
|
|
18
|
+
max: PixelWidth;
|
|
19
|
+
});
|
|
20
|
+
/** A Resizable size: compatible atomic values or a structured size. */
|
|
21
|
+
export type ResizableSize = number | `${number}px` | `${number}%` | PixelWidth | ResizablePercentSize;
|
|
22
|
+
/**
|
|
23
|
+
* Create a literal percentage with one pixel floor or ceiling.
|
|
24
|
+
*
|
|
25
|
+
* The options argument is required because an unbounded percentage already has
|
|
26
|
+
* the canonical `'N%'` spelling. Use Table's `pixel()` helper for the bound.
|
|
27
|
+
*/
|
|
28
|
+
export declare function percent(value: number, options: {
|
|
29
|
+
min: PixelWidth;
|
|
30
|
+
max?: never;
|
|
31
|
+
} | {
|
|
32
|
+
min?: never;
|
|
33
|
+
max: PixelWidth;
|
|
34
|
+
}): ResizablePercentSize;
|
|
35
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/Resizable/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,YAAY,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE/C,4DAA4D;AAC5D,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,CAAC;IAAC,GAAG,EAAE,UAAU,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAC,CAAC,CAAC;AAEtE,uEAAuE;AACvE,MAAM,MAAM,aAAa,GACvB,MAAM,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,GAAG,GAAG,UAAU,GAAG,oBAAoB,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IAAC,GAAG,EAAE,UAAU,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAC,GACvE,oBAAoB,CAEtB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file utils.ts
|
|
5
|
+
* @output Server-safe Resizable sizing helpers and public types
|
|
6
|
+
* @position Subpath entry point: `@astryxdesign/core/Resizable/utils`
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { pixel } from "../Table/utils.js";
|
|
10
|
+
|
|
11
|
+
/** A percentage with exactly one pixel floor or ceiling. */
|
|
12
|
+
|
|
13
|
+
/** A Resizable size: compatible atomic values or a structured size. */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create a literal percentage with one pixel floor or ceiling.
|
|
17
|
+
*
|
|
18
|
+
* The options argument is required because an unbounded percentage already has
|
|
19
|
+
* the canonical `'N%'` spelling. Use Table's `pixel()` helper for the bound.
|
|
20
|
+
*/
|
|
21
|
+
export function percent(value, options) {
|
|
22
|
+
return {
|
|
23
|
+
type: 'percent',
|
|
24
|
+
value,
|
|
25
|
+
...options
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -64,6 +64,16 @@ interface SelectorPropsBase<T extends SelectorOptionType = SelectorOptionType> e
|
|
|
64
64
|
* @default false
|
|
65
65
|
*/
|
|
66
66
|
isDisabled?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the selector is read-only.
|
|
69
|
+
* The selected value stays visible, focusable, and included in form
|
|
70
|
+
* submission, and retains its combobox identity with `aria-readonly`. The
|
|
71
|
+
* selection surface and editing affordances are removed.
|
|
72
|
+
* Unlike `isDisabled`, a read-only selector is not dimmed and stays in the
|
|
73
|
+
* tab order. `isDisabled` takes precedence when both are set.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
isReadOnly?: boolean;
|
|
67
77
|
/**
|
|
68
78
|
* Explains why the selector is disabled. When set together with
|
|
69
79
|
* `isDisabled`, the selector shows a tooltip with this text on hover and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["../../src/Selector/Selector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;A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B;;;;;OAKG;IACH,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D,CAAC;AAEJ,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IACzE,yBAAyB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AA4C3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,kBAAkB,EACnD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,qBAylCxB;yBA1lCe,QAAQ"}
|
|
@@ -107,6 +107,15 @@ const styles = {
|
|
|
107
107
|
k3aq6I: "x1c071of x1pdlv7q",
|
|
108
108
|
$$css: true
|
|
109
109
|
},
|
|
110
|
+
triggerReadOnly: {
|
|
111
|
+
kkrTdU: "xt0e3qv",
|
|
112
|
+
$$css: true
|
|
113
|
+
},
|
|
114
|
+
triggerGhostReadOnly: {
|
|
115
|
+
kKwaWg: "x18o3ruo",
|
|
116
|
+
k3aq6I: "x1c071of x1pdlv7q",
|
|
117
|
+
$$css: true
|
|
118
|
+
},
|
|
110
119
|
statusButton: {
|
|
111
120
|
k1xSpc: "x78zum5",
|
|
112
121
|
kGNEyG: "x6s0dn4",
|
|
@@ -296,6 +305,7 @@ export function Selector(props) {
|
|
|
296
305
|
isOptional = false,
|
|
297
306
|
isRequired = false,
|
|
298
307
|
isDisabled = false,
|
|
308
|
+
isReadOnly = false,
|
|
299
309
|
disabledMessage,
|
|
300
310
|
options,
|
|
301
311
|
value,
|
|
@@ -341,6 +351,7 @@ export function Selector(props) {
|
|
|
341
351
|
const hasClear = hasClearProp === true;
|
|
342
352
|
const size = useSize(sizeProp, 'md');
|
|
343
353
|
const effectiveStatusVariant = variant === 'ghost' && statusVariant === 'attached' ? 'detached' : statusVariant;
|
|
354
|
+
const isEffectivelyReadOnly = isReadOnly && !isDisabled;
|
|
344
355
|
|
|
345
356
|
// Normalize null to undefined for internal use (null is the clear sentinel)
|
|
346
357
|
const normalizedValue = value === null ? undefined : value;
|
|
@@ -352,6 +363,7 @@ export function Selector(props) {
|
|
|
352
363
|
const descriptionId = useId();
|
|
353
364
|
const statusMessageId = useId();
|
|
354
365
|
const inputLabelId = useId();
|
|
366
|
+
const readOnlyDescriptionId = useId();
|
|
355
367
|
const searchId = useId();
|
|
356
368
|
// Measure from the same outer control that usePopover anchors to; using the
|
|
357
369
|
// shorter inner button makes every size's selected row land too low.
|
|
@@ -398,7 +410,7 @@ export function Selector(props) {
|
|
|
398
410
|
const {
|
|
399
411
|
ariaLabelledBy,
|
|
400
412
|
ariaDescribedBy
|
|
401
|
-
} = getInputARIA(inputLabelId, [description ? descriptionId : null, !inputGroup && effectiveStatusVariant !== 'tooltip' && status?.message ? statusMessageId : null, effectiveStatusVariant === 'tooltip' && status?.message ? statusTooltip.describedBy : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null], inputGroup);
|
|
413
|
+
} = getInputARIA(inputLabelId, [description ? descriptionId : null, !inputGroup && effectiveStatusVariant !== 'tooltip' && status?.message ? statusMessageId : null, effectiveStatusVariant === 'tooltip' && status?.message ? statusTooltip.describedBy : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null, isEffectivelyReadOnly ? readOnlyDescriptionId : null], inputGroup);
|
|
402
414
|
|
|
403
415
|
// Flatten options for keyboard navigation
|
|
404
416
|
const selectableItems = useMemo(() => getSelectableOptions(options), [options]);
|
|
@@ -450,16 +462,27 @@ export function Selector(props) {
|
|
|
450
462
|
const {
|
|
451
463
|
popover
|
|
452
464
|
} = surface;
|
|
465
|
+
const hideSurface = surface.hide;
|
|
466
|
+
const isSurfaceOpen = surface.isOpen;
|
|
453
467
|
const keepOpenProps = useKeepLayerOpenProps(popover.id, popover.isOpen);
|
|
454
468
|
|
|
455
|
-
// Open dropdown on mount when isDefaultOpen is true
|
|
469
|
+
// Open dropdown on mount when isDefaultOpen is true and interaction is allowed.
|
|
456
470
|
useEffect(() => {
|
|
457
|
-
if (isDefaultOpen) {
|
|
471
|
+
if (isDefaultOpen && !isEffectivelyReadOnly) {
|
|
458
472
|
surface.show();
|
|
459
473
|
}
|
|
460
474
|
// eslint-disable-next-line @eslint-react/exhaustive-deps -- mount-only: isDefaultOpen is not reactive
|
|
461
475
|
}, []);
|
|
462
476
|
|
|
477
|
+
// Read-only is controlled by caller policy, so an already-open surface must
|
|
478
|
+
// close when that policy changes. The presentation controller keeps a sheet
|
|
479
|
+
// mounted through its exit and lets BottomSheet return final focus.
|
|
480
|
+
useEffect(() => {
|
|
481
|
+
if (isEffectivelyReadOnly && isSurfaceOpen) {
|
|
482
|
+
hideSurface();
|
|
483
|
+
}
|
|
484
|
+
}, [isEffectivelyReadOnly, isSurfaceOpen, hideSurface]);
|
|
485
|
+
|
|
463
486
|
// Announce the filtered result count from the query-change handlers (matching
|
|
464
487
|
// BaseTypeahead) rather than a reactive effect: computing the count for the
|
|
465
488
|
// next query here fires the announcement exactly once per keystroke and does
|
|
@@ -583,7 +606,7 @@ export function Selector(props) {
|
|
|
583
606
|
// highlight on it and Delete/Backspace could clear a value the action has
|
|
584
607
|
// already replaced.
|
|
585
608
|
value: optimisticValue,
|
|
586
|
-
isDisabled,
|
|
609
|
+
isDisabled: isDisabled || isEffectivelyReadOnly,
|
|
587
610
|
isOpen: surface.isOpen,
|
|
588
611
|
hasSearch,
|
|
589
612
|
onOpen: useCallback(() => {
|
|
@@ -632,13 +655,16 @@ export function Selector(props) {
|
|
|
632
655
|
});
|
|
633
656
|
resetTypeaheadRef.current = typeahead.reset;
|
|
634
657
|
const handleTriggerKeyDown = useCallback(e => {
|
|
658
|
+
if (isDisabled || isEffectivelyReadOnly) {
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
635
661
|
// With hasSearch the query input owns typing, so type-to-select is off.
|
|
636
|
-
if (!
|
|
662
|
+
if (!hasSearch && typeahead.onKeyDown(e)) {
|
|
637
663
|
e.preventDefault();
|
|
638
664
|
return;
|
|
639
665
|
}
|
|
640
666
|
onKeyDown(e);
|
|
641
|
-
}, [isDisabled, hasSearch, typeahead, onKeyDown]);
|
|
667
|
+
}, [isDisabled, isEffectivelyReadOnly, hasSearch, typeahead, onKeyDown]);
|
|
642
668
|
|
|
643
669
|
// Keep the highlighted option visible during keyboard navigation. The
|
|
644
670
|
// listbox is a fixed-height scroll container, so without this the virtual
|
|
@@ -967,23 +993,59 @@ export function Selector(props) {
|
|
|
967
993
|
}[!!(surface.activePresentation === 'popover' && variant !== 'ghost') << 1 | !!(surface.activePresentation === 'popover' && !isPositioned) << 0],
|
|
968
994
|
children: renderOptions()
|
|
969
995
|
});
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
996
|
+
let selectionSurface = null;
|
|
997
|
+
if (surface.activePresentation === 'bottom-sheet') {
|
|
998
|
+
if (!isEffectivelyReadOnly || surface.isSheetPresented) {
|
|
999
|
+
selectionSurface = /*#__PURE__*/_jsx(SelectorBottomSheet, {
|
|
1000
|
+
isOpen: surface.isSheetOpen,
|
|
1001
|
+
onOpenChange: surface.onSheetOpenChange,
|
|
1002
|
+
finalFocusRef: triggerRef,
|
|
1003
|
+
initialFocusRef: hasSearch ? searchRef : listboxRef,
|
|
1004
|
+
label: label,
|
|
1005
|
+
children: panelContent
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
} else if (!isEffectivelyReadOnly) {
|
|
1009
|
+
selectionSurface = popover.render(panelContent, {
|
|
1010
|
+
placement: popoverPlacement,
|
|
1011
|
+
alignment: 'start',
|
|
1012
|
+
// The system's standard menu clearance, except in overlay mode:
|
|
1013
|
+
// there the measured negative margin owns the block geometry and
|
|
1014
|
+
// the menu is meant to sit on the trigger, not clear it.
|
|
1015
|
+
offset: shouldOverlaySelectedItem ? undefined : spacingVars['--spacing-1'],
|
|
1016
|
+
xstyle: [styles.popover, layerAnimations[popoverPlacement]],
|
|
1017
|
+
style: popoverOffsetStyle
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
const triggerSharedProps = {
|
|
1021
|
+
...rest,
|
|
1022
|
+
id: triggerId,
|
|
1023
|
+
'aria-describedby': ariaDescribedBy,
|
|
1024
|
+
'aria-labelledby': ariaLabelledBy,
|
|
1025
|
+
'aria-required': isEffectivelyRequired ? 'true' : undefined,
|
|
1026
|
+
'aria-invalid': status?.type === 'error' ? 'true' : undefined,
|
|
1027
|
+
'aria-busy': isBusy || undefined,
|
|
1028
|
+
onKeyDown: handleTriggerKeyDown,
|
|
1029
|
+
onFocus: event => {
|
|
1030
|
+
onFocus?.(event);
|
|
1031
|
+
surface.onTriggerFocus(event);
|
|
1032
|
+
},
|
|
1033
|
+
tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
|
|
1034
|
+
...{
|
|
1035
|
+
0: {
|
|
1036
|
+
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz"
|
|
1037
|
+
},
|
|
1038
|
+
2: {
|
|
1039
|
+
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1a2a7pz xt0e3qv"
|
|
1040
|
+
},
|
|
1041
|
+
1: {
|
|
1042
|
+
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz xkh2ocl"
|
|
1043
|
+
},
|
|
1044
|
+
3: {
|
|
1045
|
+
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1a2a7pz xt0e3qv xkh2ocl"
|
|
1046
|
+
}
|
|
1047
|
+
}[!!isEffectivelyReadOnly << 1 | !!inputGroup << 0]
|
|
1048
|
+
};
|
|
987
1049
|
const selectorContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
988
1050
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
989
1051
|
ref: el => {
|
|
@@ -1000,53 +1062,39 @@ export function Selector(props) {
|
|
|
1000
1062
|
variant,
|
|
1001
1063
|
size,
|
|
1002
1064
|
status: status?.type ?? null,
|
|
1003
|
-
disabled: isDisabled ? 'disabled' : null
|
|
1004
|
-
|
|
1065
|
+
disabled: isDisabled ? 'disabled' : null,
|
|
1066
|
+
readonly: isEffectivelyReadOnly ? 'readonly' : null
|
|
1067
|
+
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, variant === 'ghost' && interactionOverlayStyles.backgroundImage, variant === 'ghost' && focusOutlineStyles.focusWithin, surface.isTriggerFocusRingSuppressed && selectorPresentationStyles.pointerRestoredFocus, isDisabled && inputWrapperStyles.disabled, isEffectivelyReadOnly && styles.triggerReadOnly, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, variant === 'ghost' && isEffectivelyReadOnly && styles.triggerGhostReadOnly, !selectedItem && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, inputGroup && styles.triggerInGroup, xstyle), className, style),
|
|
1005
1068
|
children: [startIcon && renderIconSlot(startIcon, {
|
|
1006
1069
|
size: 'sm',
|
|
1007
1070
|
color: 'secondary'
|
|
1008
1071
|
}), inputGroup && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
1009
1072
|
id: inputLabelId,
|
|
1010
1073
|
children: label
|
|
1074
|
+
}), isEffectivelyReadOnly && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
1075
|
+
id: readOnlyDescriptionId,
|
|
1076
|
+
children: t('@astryx.input.readOnly')
|
|
1011
1077
|
}), /*#__PURE__*/_jsx("button", {
|
|
1078
|
+
...triggerSharedProps,
|
|
1012
1079
|
ref: triggerRef,
|
|
1013
|
-
id: triggerId,
|
|
1014
1080
|
type: "button"
|
|
1015
|
-
//
|
|
1016
|
-
//
|
|
1017
|
-
//
|
|
1081
|
+
// The read-only trigger stays a combobox even when hasSearch is set:
|
|
1082
|
+
// no search input is rendered in that state, and preserving the role
|
|
1083
|
+
// keeps the control's programmatic identity stable. Editable search
|
|
1084
|
+
// mode still moves combobox semantics to the popup input.
|
|
1018
1085
|
,
|
|
1019
|
-
role: hasSearch ?
|
|
1020
|
-
|
|
1021
|
-
"aria-
|
|
1022
|
-
"aria-
|
|
1023
|
-
"aria-
|
|
1024
|
-
"aria-activedescendant": !hasSearch && surface.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined
|
|
1025
|
-
"aria-describedby": ariaDescribedBy,
|
|
1026
|
-
"aria-labelledby": ariaLabelledBy,
|
|
1027
|
-
"aria-required": isEffectivelyRequired ? 'true' : undefined,
|
|
1028
|
-
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
1029
|
-
"aria-busy": isBusy || undefined
|
|
1086
|
+
role: isEffectivelyReadOnly || !hasSearch ? 'combobox' : undefined,
|
|
1087
|
+
"aria-haspopup": isEffectivelyReadOnly ? undefined : surface.activePresentation === 'bottom-sheet' ? 'dialog' : 'listbox',
|
|
1088
|
+
"aria-expanded": isEffectivelyReadOnly ? false : surface.isOpen,
|
|
1089
|
+
"aria-controls": isEffectivelyReadOnly ? undefined : listboxId,
|
|
1090
|
+
"aria-readonly": isEffectivelyReadOnly || undefined,
|
|
1091
|
+
"aria-activedescendant": !isEffectivelyReadOnly && !hasSearch && surface.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined
|
|
1030
1092
|
// With a disabledMessage the trigger keeps focusability via
|
|
1031
1093
|
// aria-disabled so the reason is focus-discoverable; activation is
|
|
1032
1094
|
// still blocked by the isDisabled guards in useCombobox.
|
|
1033
1095
|
,
|
|
1034
1096
|
disabled: isDisabled && !showsDisabledMessage,
|
|
1035
1097
|
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
1036
|
-
onKeyDown: handleTriggerKeyDown,
|
|
1037
|
-
onFocus: event => {
|
|
1038
|
-
onFocus?.(event);
|
|
1039
|
-
surface.onTriggerFocus(event);
|
|
1040
|
-
},
|
|
1041
|
-
tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
|
|
1042
|
-
...{
|
|
1043
|
-
0: {
|
|
1044
|
-
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz"
|
|
1045
|
-
},
|
|
1046
|
-
1: {
|
|
1047
|
-
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz xkh2ocl"
|
|
1048
|
-
}
|
|
1049
|
-
}[!!inputGroup << 0],
|
|
1050
1098
|
children: valueContent
|
|
1051
1099
|
}), htmlName != null && /*#__PURE__*/_jsx("input", {
|
|
1052
1100
|
type: "hidden",
|
|
@@ -1058,7 +1106,7 @@ export function Selector(props) {
|
|
|
1058
1106
|
disabled: isDisabled
|
|
1059
1107
|
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
1060
1108
|
size: "sm"
|
|
1061
|
-
}), hasClear && value != null && !isDisabled && /*#__PURE__*/_jsx(InternalInputClearButton, {
|
|
1109
|
+
}), hasClear && value != null && !isDisabled && !isEffectivelyReadOnly && /*#__PURE__*/_jsx(InternalInputClearButton, {
|
|
1062
1110
|
...keepOpenProps,
|
|
1063
1111
|
label: t('@astryx.selector.clearLabel', {
|
|
1064
1112
|
label
|
|
@@ -1084,7 +1132,7 @@ export function Selector(props) {
|
|
|
1084
1132
|
size: "sm",
|
|
1085
1133
|
color: STATUS_ICON_COLOR_MAP[status.type],
|
|
1086
1134
|
xstyle: styles.triggerIcon
|
|
1087
|
-
}) : /*#__PURE__*/_jsx(Icon, {
|
|
1135
|
+
}) : !isEffectivelyReadOnly ? /*#__PURE__*/_jsx(Icon, {
|
|
1088
1136
|
icon: "chevronDown",
|
|
1089
1137
|
size: "sm",
|
|
1090
1138
|
color: "secondary"
|
|
@@ -1102,7 +1150,7 @@ export function Selector(props) {
|
|
|
1102
1150
|
...themeProps('selector-indicator-icon', {
|
|
1103
1151
|
state: surface.isOpen ? 'expanded' : 'collapsed'
|
|
1104
1152
|
})
|
|
1105
|
-
})]
|
|
1153
|
+
}) : null]
|
|
1106
1154
|
}), selectionSurface, showStatusTooltip && statusTooltip.renderTooltip(status?.message ?? ''), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
1107
1155
|
});
|
|
1108
1156
|
if (inputGroup) {
|
|
@@ -18,6 +18,7 @@ interface SelectorPresentationController {
|
|
|
18
18
|
hide: () => void;
|
|
19
19
|
isOpen: boolean;
|
|
20
20
|
isSheetOpen: boolean;
|
|
21
|
+
isSheetPresented: boolean;
|
|
21
22
|
isTriggerFocusRingSuppressed: boolean;
|
|
22
23
|
onSheetOpenChange: (isOpen: boolean) => void;
|
|
23
24
|
onTriggerFocus: (event: FocusEvent<HTMLElement>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectorPresentation.d.ts","sourceRoot":"","sources":["../../src/Selector/useSelectorPresentation.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,kCAAkC,CAAC;AAG1C,UAAU,8BAA8B;IACtC,YAAY,EAAE,oBAAoB,CAAC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAClD,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,UAAU,8BAA8B;IACtC,kBAAkB,EAAE,4BAA4B,CAAC;IACjD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B,EAAE,OAAO,CAAC;IACtC,iBAAiB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,gBAAgB,GAAG;QAAC,gBAAgB,EAAE,MAAM,OAAO,CAAA;KAAC,CAAC;IAC9D,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,gBAAgB,EAAE,MAAM,OAAO,CAAC;CACjC;AAED,wBAAgB,uBAAuB,CAAC,EACtC,YAAY,EACZ,MAAM,EACN,cAAc,EACd,UAAU,GACX,EAAE,8BAA8B,GAAG,8BAA8B,
|
|
1
|
+
{"version":3,"file":"useSelectorPresentation.d.ts","sourceRoot":"","sources":["../../src/Selector/useSelectorPresentation.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,kCAAkC,CAAC;AAG1C,UAAU,8BAA8B;IACtC,YAAY,EAAE,oBAAoB,CAAC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAClD,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,UAAU,8BAA8B;IACtC,kBAAkB,EAAE,4BAA4B,CAAC;IACjD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4BAA4B,EAAE,OAAO,CAAC;IACtC,iBAAiB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,gBAAgB,GAAG;QAAC,gBAAgB,EAAE,MAAM,OAAO,CAAA;KAAC,CAAC;IAC9D,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,gBAAgB,EAAE,MAAM,OAAO,CAAC;CACjC;AAED,wBAAgB,uBAAuB,CAAC,EACtC,YAAY,EACZ,MAAM,EACN,cAAc,EACd,UAAU,GACX,EAAE,8BAA8B,GAAG,8BAA8B,CA8GjE"}
|
|
@@ -22,6 +22,10 @@ export function useSelectorPresentation({
|
|
|
22
22
|
const activePresentationRef = useRef(resolvedPresentation);
|
|
23
23
|
const [isSheetOpen, setIsSheetOpen] = useState(false);
|
|
24
24
|
const isSheetOpenRef = useRef(false);
|
|
25
|
+
// BottomSheet owns its exit animation and final-focus handoff. Keep it mounted
|
|
26
|
+
// after the controlled open state turns false until that handoff reaches the
|
|
27
|
+
// trigger, then consumers may remove the hidden surface tree.
|
|
28
|
+
const [isSheetPresented, setIsSheetPresented] = useState(false);
|
|
25
29
|
const onHideRef = useRef(onHide);
|
|
26
30
|
const {
|
|
27
31
|
isFocusRingSuppressed,
|
|
@@ -49,8 +53,10 @@ export function useSelectorPresentation({
|
|
|
49
53
|
activePresentationRef.current = resolvedPresentation;
|
|
50
54
|
if (resolvedPresentation === 'bottom-sheet') {
|
|
51
55
|
isSheetOpenRef.current = true;
|
|
56
|
+
setIsSheetPresented(true);
|
|
52
57
|
setIsSheetOpen(true);
|
|
53
58
|
} else {
|
|
59
|
+
setIsSheetPresented(false);
|
|
54
60
|
showPopover();
|
|
55
61
|
}
|
|
56
62
|
}, [resetFocusReturn, resolvedPresentation, showPopover]);
|
|
@@ -64,7 +70,15 @@ export function useSelectorPresentation({
|
|
|
64
70
|
hidePopover();
|
|
65
71
|
}
|
|
66
72
|
}, [hidePopover, prepareFocusReturn]);
|
|
67
|
-
const handleTriggerFocus = useCallback(_event =>
|
|
73
|
+
const handleTriggerFocus = useCallback(_event => {
|
|
74
|
+
onFocusReturnTargetFocus();
|
|
75
|
+
if (!isSheetOpenRef.current && activePresentationRef.current === 'bottom-sheet') {
|
|
76
|
+
// BottomSheet focuses finalFocusRef only after its exit completes. That
|
|
77
|
+
// focus event is the lifecycle signal that the retained sheet can now
|
|
78
|
+
// leave the tree without dropping focus to the document body.
|
|
79
|
+
setIsSheetPresented(false);
|
|
80
|
+
}
|
|
81
|
+
}, [onFocusReturnTargetFocus]);
|
|
68
82
|
const handleSheetOpenChange = useCallback(nextIsOpen => {
|
|
69
83
|
if (nextIsOpen) {
|
|
70
84
|
show();
|
|
@@ -73,13 +87,14 @@ export function useSelectorPresentation({
|
|
|
73
87
|
}
|
|
74
88
|
}, [hide, show]);
|
|
75
89
|
const isOpen = popover.isOpen || isSheetOpen;
|
|
76
|
-
const activePresentation = isOpen ? activePresentationRef.current : resolvedPresentation;
|
|
90
|
+
const activePresentation = isOpen || isSheetPresented ? activePresentationRef.current : resolvedPresentation;
|
|
77
91
|
const wasJustDismissed = useCallback(() => activePresentationRef.current === 'popover' && wasPopoverJustDismissed(), [wasPopoverJustDismissed]);
|
|
78
92
|
return {
|
|
79
93
|
activePresentation,
|
|
80
94
|
hide,
|
|
81
95
|
isOpen,
|
|
82
96
|
isSheetOpen,
|
|
97
|
+
isSheetPresented,
|
|
83
98
|
isTriggerFocusRingSuppressed: isFocusRingSuppressed,
|
|
84
99
|
onSheetOpenChange: handleSheetOpenChange,
|
|
85
100
|
onTriggerFocus: handleTriggerFocus,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAQhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC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AAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,8CAA8C;IAC9C,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC7C,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAChD,8CAA8C;IAC9C,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAoS/D;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,EAAC,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,WAAW,+BA8pBlD;yBA9pBe,MAAM"}
|
package/dist/Slider/Slider.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - /apps/storybook/stories/Slider.stories.tsx
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/Slider/ (showcase blocks)
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { useId, useMemo, useRef, useState, useCallback } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import "../theme/tokens.stylex.js";
|
|
21
21
|
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
@@ -25,7 +25,7 @@ import { useTooltip } from "../Tooltip/index.js";
|
|
|
25
25
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
26
26
|
import { mergeProps, rtlStyles } from "../utils/index.js";
|
|
27
27
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
28
|
-
import { getInteractionModality,
|
|
28
|
+
import { getInteractionModality, useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
29
29
|
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
30
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
31
31
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
@@ -256,9 +256,7 @@ export function Slider({
|
|
|
256
256
|
// true on pointerdown). Gate the ring on how the user last interacted; the
|
|
257
257
|
// CSS condition stays `:focus-visible`, this only narrows it.
|
|
258
258
|
const [keyboardFocusThumb, setKeyboardFocusThumb] = useState(null);
|
|
259
|
-
|
|
260
|
-
trackInteractionModality();
|
|
261
|
-
}, []);
|
|
259
|
+
useInteractionModalityTracking();
|
|
262
260
|
const handleThumbFocus = useCallback((thumbIndex, _e) => {
|
|
263
261
|
// A disabled thumb draws no ring even when it stays focusable for its
|
|
264
262
|
// reason tooltip, so there is nothing to track for one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKV,CAAC;
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKV,CAAC;AA+VF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,KAAK,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAW,EACX,KAAiB,EACjB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,SAAS,EACb,EAAE,YAAY,+BAoHd;yBA/He,OAAO"}
|
package/dist/Spinner/Spinner.js
CHANGED
|
@@ -229,15 +229,17 @@ const styles = {
|
|
|
229
229
|
spinner: {
|
|
230
230
|
k1xSpc: "xwz0xwf",
|
|
231
231
|
kgQiWS: "x1ku5rj1",
|
|
232
|
-
kVQacm: "xb3r6kr",
|
|
233
232
|
kXLuUW: "xxymvpz",
|
|
234
233
|
"--_spinner-ring-diameter": "x2lq4xu",
|
|
235
234
|
"--_spinner-ring-stroke": "x10qssua",
|
|
236
235
|
"--_spinner-box-size": "x69vvuq",
|
|
236
|
+
kmuXW: "x2lah0s",
|
|
237
237
|
$$css: true
|
|
238
238
|
},
|
|
239
239
|
circle: {
|
|
240
240
|
kDwRjp: "xbh8q5q",
|
|
241
|
+
kR8GR0: "x1764fhq",
|
|
242
|
+
k3nNDw: "x1g0ag68",
|
|
241
243
|
kU5bRw: "x1owpc8m",
|
|
242
244
|
kPFa82: "xio8zfp",
|
|
243
245
|
kfJifR: "xgw3ha0",
|
|
@@ -371,7 +373,6 @@ export function Spinner({
|
|
|
371
373
|
diameter
|
|
372
374
|
} = SIZES[size];
|
|
373
375
|
const frameSize = diameter + border * 2;
|
|
374
|
-
const center = frameSize / 2;
|
|
375
376
|
const circumference = Math.PI * diameter;
|
|
376
377
|
const arcLength = circumference * ARC_FRACTION;
|
|
377
378
|
const hasLabel = label != null;
|
|
@@ -418,20 +419,19 @@ export function Spinner({
|
|
|
418
419
|
ref: syncRotationPhase,
|
|
419
420
|
width: frameSize,
|
|
420
421
|
height: frameSize,
|
|
421
|
-
viewBox: `0 0 ${frameSize} ${frameSize}`,
|
|
422
422
|
"aria-hidden": "true",
|
|
423
423
|
...{
|
|
424
|
-
className: "xlp1x4z x1lliihq x1so62im x1rea2x4 x14qxm4i xnh0sag xa4qsjk x1ka1v4i x1esw782"
|
|
424
|
+
className: "xlp1x4z x1lliihq x6v0vjy x7yyq19 x1so62im x1rea2x4 x14qxm4i xnh0sag xa4qsjk x1ka1v4i x1esw782"
|
|
425
425
|
},
|
|
426
426
|
children: [/*#__PURE__*/_jsx("circle", {
|
|
427
|
-
cx:
|
|
428
|
-
cy:
|
|
427
|
+
cx: "50%",
|
|
428
|
+
cy: "50%",
|
|
429
429
|
r: diameter / 2,
|
|
430
430
|
strokeWidth: border,
|
|
431
431
|
...stylex.props(styles.circle, styles.track, trackOpacityStyles[shade])
|
|
432
432
|
}), /*#__PURE__*/_jsx("circle", {
|
|
433
|
-
cx:
|
|
434
|
-
cy:
|
|
433
|
+
cx: "50%",
|
|
434
|
+
cy: "50%",
|
|
435
435
|
r: diameter / 2,
|
|
436
436
|
strokeWidth: border
|
|
437
437
|
// The size's own dash, for the render with no stylesheet. The rule
|
|
@@ -439,9 +439,8 @@ export function Spinner({
|
|
|
439
439
|
// themed ring keeps this fraction of arc rather than this length.
|
|
440
440
|
,
|
|
441
441
|
strokeDasharray: `${arcLength} ${circumference - arcLength}`,
|
|
442
|
-
transform: `rotate(-90 ${center} ${center})`,
|
|
443
442
|
...{
|
|
444
|
-
className: "xbh8q5q x1owpc8m xio8zfp xgw3ha0 xtve3lm x1vy8frr"
|
|
443
|
+
className: "xbh8q5q x1764fhq x1g0ag68 x1owpc8m xio8zfp xgw3ha0 xtve3lm x9tu13d x1vy8frr"
|
|
445
444
|
}
|
|
446
445
|
})]
|
|
447
446
|
})
|
package/dist/Stepper/Step.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Step.tsx
|
|
3
3
|
* @input Uses React, stylex, theme tokens (including the motion duration token
|
|
4
|
-
* the connector fill animates on), StepperContext
|
|
4
|
+
* the connector fill animates on), StepperContext, and per-step theme selector
|
|
5
|
+
* state
|
|
5
6
|
* @output Exports Step component and StepProps
|
|
6
7
|
* @position Individual step item; used inside Stepper
|
|
7
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../src/Stepper/Step.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../src/Stepper/Step.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAoBhD,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,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