@astryxdesign/core 0.4.7 → 0.5.0-canary.32a62fd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +161 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -2
- package/dist/AspectRatio/AspectRatio.d.ts +24 -0
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +23 -4
- package/dist/Avatar/Avatar.d.ts +25 -1
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +58 -19
- package/dist/Avatar/index.d.ts +2 -2
- package/dist/Avatar/index.d.ts.map +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +9 -2
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +8 -4
- package/dist/AvatarGroup/AvatarGroupContext.d.ts +2 -1
- package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +10 -6
- package/dist/Banner/Banner.d.ts +40 -15
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +51 -18
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +17 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +3 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -10
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +5 -4
- package/dist/ButtonGroup/ButtonGroup.d.ts +5 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +26 -7
- package/dist/Calendar/Calendar.d.ts +3 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +13 -14
- package/dist/Calendar/getInitialFocusDate.d.ts +46 -0
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -0
- package/dist/Calendar/getInitialFocusDate.js +62 -0
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +3 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -3
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +3 -3
- package/dist/Chat/ChatMessageList.d.ts +22 -3
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +6 -3
- package/dist/Chat/ChatTokenizedText.d.ts +2 -0
- package/dist/Chat/ChatTokenizedText.d.ts.map +1 -1
- package/dist/Chat/ChatTokenizedText.js +11 -6
- package/dist/Chat/useChatComposerTokens.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +10 -3
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +15 -4
- package/dist/CodeBlock/highlightRanges.js +1 -1
- package/dist/CodeBlock/highlightStyles.js +13 -13
- 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 +43 -0
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +22 -2
- package/dist/DateInput/NativeDateField.d.ts +10 -0
- package/dist/DateInput/NativeDateField.d.ts.map +1 -0
- package/dist/DateInput/NativeDateField.js +477 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +38 -4
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- 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/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +9 -1
- 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/HoverCard.js +52 -3
- package/dist/HoverCard/useHoverCard.d.ts +16 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +74 -26
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +2 -19
- package/dist/Layer/LayerDepthContext.d.ts +52 -0
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -0
- package/dist/Layer/LayerDepthContext.js +66 -0
- package/dist/Layer/index.d.ts +3 -0
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +4 -0
- package/dist/Layer/layerStack.d.ts +98 -0
- package/dist/Layer/layerStack.d.ts.map +1 -0
- package/dist/Layer/layerStack.js +306 -0
- package/dist/Layer/useLayerDismissal.d.ts +93 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -0
- package/dist/Layer/useLayerDismissal.js +91 -0
- package/dist/Lightbox/Lightbox.d.ts +1 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +103 -81
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/Markdown/parser.d.ts +38 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +177 -29
- package/dist/MobileNav/MobileNav.d.ts +6 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +61 -36
- package/dist/MultiSelector/MultiSelector.d.ts +15 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +17 -6
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/NavIcon/NavIcon.d.ts.map +1 -1
- package/dist/NavIcon/NavIcon.js +5 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +3 -2
- package/dist/NumberInput/NumberInput.d.ts +1 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +27 -37
- package/dist/NumberInput/numberParser.d.ts +43 -0
- package/dist/NumberInput/numberParser.d.ts.map +1 -0
- package/dist/NumberInput/numberParser.js +293 -0
- 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/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +18 -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 +8 -7
- 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/StatusDot/StatusDot.d.ts.map +1 -1
- package/dist/StatusDot/StatusDot.js +6 -1
- 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 +8 -3
- package/dist/TabList/Tab.d.ts +15 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +32 -7
- package/dist/TabList/TabList.d.ts +46 -7
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +353 -23
- package/dist/TabList/TabListContext.d.ts +11 -1
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +11 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +3 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.d.ts.map +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +10 -2
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -6
- 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/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +3 -4
- 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 +9 -3
- 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 +5 -4
- 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 +94 -7
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts +7 -4
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +60 -95
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -18
- package/dist/hooks/useMergedRefs.d.ts +18 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +24 -4
- package/dist/theme/syntax/tokens.d.ts +1 -1
- package/dist/theme/syntax/tokens.d.ts.map +1 -1
- package/dist/theme/syntax/tokens.js +5 -2
- package/dist/utils/groupItems.d.ts +5 -1
- package/dist/utils/groupItems.d.ts.map +1 -1
- package/dist/utils/groupItems.js +9 -9
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/isApplePlatform.d.ts +18 -0
- package/dist/utils/isApplePlatform.d.ts.map +1 -0
- package/dist/utils/isApplePlatform.js +37 -0
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +10 -1
- package/dist/utils/timeParser.d.ts +1 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +26 -12
- package/locales/en.json +31 -7
- package/locales/pseudo.json +18 -0
- package/package.json +8 -3
- package/src/AppShell/AppShell.tsx +3 -2
- package/src/AspectRatio/AspectRatio.doc.mjs +6 -3
- package/src/AspectRatio/AspectRatio.test.tsx +57 -10
- package/src/AspectRatio/AspectRatio.tsx +40 -1
- package/src/Avatar/Avatar.doc.mjs +14 -3
- package/src/Avatar/Avatar.test.tsx +97 -0
- package/src/Avatar/Avatar.tsx +125 -52
- package/src/Avatar/index.ts +2 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +8 -2
- package/src/AvatarGroup/AvatarGroup.test.tsx +24 -0
- package/src/AvatarGroup/AvatarGroup.tsx +15 -6
- package/src/AvatarGroup/AvatarGroupContext.ts +5 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +10 -4
- package/src/Banner/Banner.doc.mjs +13 -11
- package/src/Banner/Banner.test.tsx +102 -15
- package/src/Banner/Banner.tsx +72 -25
- package/src/BottomSheet/BottomSheet.test.tsx +123 -0
- package/src/BottomSheet/BottomSheet.tsx +17 -4
- package/src/BottomSheet/BottomSheetSwitcher.tsx +3 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +9 -5
- package/src/Button/Button.doc.mjs +22 -0
- package/src/Button/Button.test.tsx +13 -0
- package/src/Button/Button.tsx +5 -4
- package/src/ButtonGroup/ButtonGroup.doc.mjs +10 -1
- package/src/ButtonGroup/ButtonGroup.test.tsx +391 -1
- package/src/ButtonGroup/ButtonGroup.tsx +23 -5
- package/src/Calendar/Calendar.doc.mjs +4 -3
- package/src/Calendar/Calendar.test.tsx +52 -0
- package/src/Calendar/Calendar.tsx +18 -15
- package/src/Calendar/getInitialFocusDate.test.ts +94 -0
- package/src/Calendar/getInitialFocusDate.ts +93 -0
- package/src/Carousel/Carousel.tsx +3 -2
- package/src/Chat/ChatComposerInput.tsx +5 -1
- package/src/Chat/ChatLayout.tsx +3 -2
- package/src/Chat/ChatMessageList.doc.mjs +9 -1
- package/src/Chat/ChatMessageList.test.tsx +46 -0
- package/src/Chat/ChatMessageList.tsx +28 -4
- package/src/Chat/ChatTokenizedText.tsx +17 -10
- package/src/Chat/useChatComposerTokens.ts +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +2 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +15 -0
- package/src/CheckboxInput/CheckboxInput.tsx +8 -2
- package/src/ClickableCard/ClickableCard.tsx +3 -2
- package/src/CodeBlock/CodeBlock.doc.mjs +16 -4
- package/src/CodeBlock/CodeBlock.test.tsx +37 -0
- package/src/CodeBlock/CodeBlock.tsx +20 -4
- package/src/CodeBlock/highlightRanges.ts +1 -1
- package/src/CodeBlock/highlightStyles.ts +13 -13
- 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.doc.mjs +16 -0
- package/src/DateInput/DateInput.tsx +55 -2
- package/src/DateInput/DateInputTouch.test.tsx +68 -9
- package/src/DateInput/NativeDateField.test.tsx +565 -0
- package/src/DateInput/NativeDateField.tsx +623 -0
- package/src/DateInput/TouchDateField.tsx +38 -4
- package/src/DateInput/index.ts +1 -0
- 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/Field/FieldLabel.test.tsx +29 -0
- package/src/Field/FieldLabel.tsx +7 -0
- 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 +13 -2
- package/src/HoverCard/HoverCard.test.tsx +101 -4
- package/src/HoverCard/HoverCard.tsx +71 -3
- package/src/HoverCard/useHoverCard.tsx +101 -33
- package/src/Indicator/CheckboxIndicator.tsx +14 -8
- package/src/Indicator/Indicator.doc.mjs +2 -0
- package/src/Item/Item.tsx +5 -4
- package/src/Kbd/Kbd.tsx +2 -19
- package/src/Layer/LayerDepthContext.tsx +62 -0
- package/src/Layer/index.ts +9 -0
- package/src/Layer/layerDismissalFamilies.test.tsx +359 -0
- package/src/Layer/layerDismissalInvariants.test.tsx +417 -0
- package/src/Layer/layerStack.ts +362 -0
- package/src/Layer/useLayerDismissal.test.tsx +469 -0
- package/src/Layer/useLayerDismissal.ts +173 -0
- package/src/Layout/Layout.doc.mjs +2 -2
- package/src/Lightbox/Lightbox.doc.mjs +12 -0
- package/src/Lightbox/Lightbox.tsx +124 -102
- package/src/Link/Link.doc.mjs +39 -0
- package/src/Markdown/Markdown.doc.mjs +5 -0
- package/src/Markdown/incremental.test.ts +16 -2
- package/src/Markdown/index.ts +1 -0
- package/src/Markdown/parser.perf.test.ts +96 -1
- package/src/Markdown/parser.test.ts +145 -2
- package/src/Markdown/parser.ts +244 -29
- package/src/MobileNav/MobileNav.tsx +62 -36
- package/src/MoreMenu/MoreMenu.doc.mjs +7 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +27 -0
- package/src/MultiSelector/MultiSelector.test.tsx +106 -0
- package/src/MultiSelector/MultiSelector.tsx +50 -6
- package/src/MultiSelector/index.ts +1 -0
- package/src/NavIcon/NavIcon.doc.mjs +8 -2
- package/src/NavIcon/NavIcon.test.tsx +9 -0
- package/src/NavIcon/NavIcon.tsx +5 -1
- package/src/NavMenu/NavHeadingMenu.tsx +3 -2
- package/src/NumberInput/NumberInput.doc.mjs +20 -0
- package/src/NumberInput/NumberInput.tsx +28 -29
- package/src/NumberInput/numberParser.test.ts +137 -0
- package/src/NumberInput/numberParser.ts +346 -0
- package/src/Outline/Outline.tsx +3 -2
- package/src/OverflowList/OverflowList.tsx +3 -2
- package/src/Overlay/Overlay.tsx +3 -2
- package/src/Popover/usePopover.tsx +31 -28
- package/src/PowerSearch/PowerSearch.doc.mjs +160 -28
- package/src/PowerSearch/PowerSearch.test.tsx +240 -1
- package/src/PowerSearch/PowerSearch.tsx +34 -5
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +201 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +29 -2
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +47 -1
- package/src/PowerSearch/PowerSearchValueEditor.tsx +15 -0
- package/src/PowerSearch/types.ts +2 -0
- package/src/PowerSearch/usePowerSearchSource.test.ts +82 -2
- package/src/PowerSearch/usePowerSearchSource.ts +13 -3
- package/src/ProgressBar/ProgressBar.doc.mjs +42 -6
- package/src/ProgressBar/ProgressBar.test.tsx +24 -0
- package/src/ProgressBar/ProgressBar.tsx +28 -8
- 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 +12 -12
- 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/StatusDot/StatusDot.doc.mjs +8 -2
- package/src/StatusDot/StatusDot.test.tsx +9 -0
- package/src/StatusDot/StatusDot.tsx +7 -1
- 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.doc.mjs +2 -0
- package/src/Switch/Switch.test.tsx +10 -0
- package/src/Switch/Switch.tsx +6 -2
- package/src/TabList/Tab.doc.mjs +13 -1
- package/src/TabList/Tab.tsx +67 -7
- package/src/TabList/TabList.doc.mjs +22 -6
- package/src/TabList/TabList.test.tsx +559 -0
- package/src/TabList/TabList.tsx +490 -22
- package/src/TabList/TabListContext.ts +13 -2
- package/src/TabList/TabMenu.tsx +3 -2
- package/src/TabList/index.ts +6 -2
- package/src/Table/BaseTable.tsx +12 -4
- package/src/Table/Table.doc.mjs +9 -2
- package/src/Table/Table.test.tsx +132 -14
- package/src/Table/Table.tsx +3 -8
- 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/plugins/stickyColumns/useTableStickyColumns.tsx +1 -2
- 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.doc.mjs +8 -2
- package/src/TextArea/TextArea.test.tsx +11 -0
- package/src/TextArea/TextArea.tsx +15 -8
- 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 +5 -4
- package/src/TopNav/TopNavMegaMenu.tsx +3 -2
- package/src/TopNav/TopNavMenu.tsx +4 -3
- package/src/Typeahead/BaseTypeahead.doc.mjs +11 -0
- package/src/Typeahead/BaseTypeahead.tsx +85 -33
- package/src/Typeahead/Typeahead.doc.mjs +5 -0
- package/src/Typeahead/Typeahead.test.tsx +49 -0
- package/src/Typeahead/Typeahead.tsx +3 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useContainerReveal.doc.mjs +2 -2
- package/src/hooks/useFocusTrap.test.tsx +14 -0
- package/src/hooks/useFocusTrap.ts +62 -111
- package/src/hooks/useFocusTrapEscapeShim.test.tsx +165 -0
- package/src/hooks/useHotkeys.ts +3 -18
- package/src/hooks/useMergedRefs.doc.mjs +79 -0
- package/src/hooks/useMergedRefs.test.tsx +62 -0
- package/src/hooks/useMergedRefs.ts +36 -0
- package/src/index.ts +1 -0
- package/src/theme/MediaTheme.doc.mjs +5 -5
- package/src/theme/derivedVarRegistry.test.ts +19 -3
- package/src/theme/derivedVarRegistry.ts +23 -4
- package/src/theme/generateThemeRules.test.ts +37 -0
- package/src/theme/syntax/tokens.ts +5 -2
- package/src/utils/groupItems.ts +12 -6
- package/src/utils/index.ts +1 -1
- package/src/utils/isApplePlatform.test.ts +61 -0
- package/src/utils/isApplePlatform.ts +37 -0
- package/src/utils/sharedResizeObserver.ts +10 -2
- package/src/utils/timeParser.test.ts +6 -1
- package/src/utils/timeParser.ts +35 -13
- package/src/__tests__/inputWidthContract.test.tsx +0 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Avatar/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;CACb;AAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Avatar/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;CACb;AAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AACnE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC"}
|
package/dist/Avatar/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file index.ts
|
|
7
7
|
* @input Imports Avatar component and types from Avatar.tsx, AvatarStatusDot from AvatarStatusDot.tsx
|
|
8
|
-
* @output Exports Avatar, AvatarProps, AvatarSize, AvatarStatusDot, AvatarStatusDotProps, AvatarStatusDotVariant
|
|
8
|
+
* @output Exports Avatar, AvatarProps, AvatarSize, AvatarShape, resolveSize, AvatarStatusDot, AvatarStatusDotProps, AvatarStatusDotVariant
|
|
9
9
|
* @position Component entry point; re-exported by /packages/core/src/index.ts
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update this header and /packages/core/src/Avatar/Avatar.doc.mjs
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { type ReactNode } from 'react';
|
|
24
24
|
import type { BaseProps } from '../BaseProps';
|
|
25
|
-
import { type AvatarSize } from '../Avatar';
|
|
25
|
+
import { type AvatarShape, type AvatarSize } from '../Avatar';
|
|
26
26
|
export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
|
|
27
27
|
/** Ref forwarded to the root element. */
|
|
28
28
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -38,6 +38,13 @@ export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
38
38
|
* @default 'md'
|
|
39
39
|
*/
|
|
40
40
|
size?: AvatarSize;
|
|
41
|
+
/**
|
|
42
|
+
* Shape applied to all avatars via context, overriding each avatar's own
|
|
43
|
+
* `shape` prop so a group stays visually uniform. Also applied to the
|
|
44
|
+
* `AvatarGroupOverflow` "+N" indicator, so it matches the group.
|
|
45
|
+
* @default 'circle'
|
|
46
|
+
*/
|
|
47
|
+
shape?: AvatarShape;
|
|
41
48
|
/**
|
|
42
49
|
* Test ID for integration testing.
|
|
43
50
|
*/
|
|
@@ -61,7 +68,7 @@ export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
61
68
|
* </AvatarGroup>
|
|
62
69
|
* ```
|
|
63
70
|
*/
|
|
64
|
-
export declare function AvatarGroup({ children, size, 'data-testid': testId, 'aria-label': ariaLabelFromProps, 'aria-describedby': ariaDescribedByFromProps, onKeyDown, onFocus, xstyle, className, style, ref, ...props }: AvatarGroupProps): ReactNode;
|
|
71
|
+
export declare function AvatarGroup({ children, size, shape, 'data-testid': testId, 'aria-label': ariaLabelFromProps, 'aria-describedby': ariaDescribedByFromProps, onKeyDown, onFocus, xstyle, className, style, ref, ...props }: AvatarGroupProps): ReactNode;
|
|
65
72
|
export declare namespace AvatarGroup {
|
|
66
73
|
var displayName: string;
|
|
67
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAc,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAczE,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,IAAW,EACX,KAAgB,EAChB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,EAAE,wBAAwB,EAC5C,SAAS,EACT,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,SAAS,CAmE9B;yBAjFe,WAAW"}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import { useId, useMemo, useState } from 'react';
|
|
27
27
|
import { resolveSize } from "../Avatar/index.js";
|
|
28
28
|
import * as stylex from '@stylexjs/stylex';
|
|
29
|
-
import { mergeProps
|
|
29
|
+
import { mergeProps } from "../utils/index.js";
|
|
30
30
|
import { composeEventHandlers } from "../utils/composeEventHandlers.js";
|
|
31
31
|
import { AvatarGroupContext } from "./AvatarGroupContext.js";
|
|
32
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -34,6 +34,7 @@ import { useTranslator } from "../i18n/index.js";
|
|
|
34
34
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
35
35
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
36
36
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
37
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
37
38
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
39
|
const OVERLAP_RATIO = 0.25;
|
|
39
40
|
const styles = {
|
|
@@ -65,6 +66,7 @@ const styles = {
|
|
|
65
66
|
export function AvatarGroup({
|
|
66
67
|
children,
|
|
67
68
|
size = 'md',
|
|
69
|
+
shape = 'circle',
|
|
68
70
|
'data-testid': testId,
|
|
69
71
|
'aria-label': ariaLabelFromProps,
|
|
70
72
|
'aria-describedby': ariaDescribedByFromProps,
|
|
@@ -82,9 +84,10 @@ export function AvatarGroup({
|
|
|
82
84
|
const overlap = Math.round(numericSize * OVERLAP_RATIO);
|
|
83
85
|
const contextValue = useMemo(() => ({
|
|
84
86
|
size,
|
|
87
|
+
shape,
|
|
85
88
|
overlap,
|
|
86
89
|
numericSize
|
|
87
|
-
}), [size, overlap, numericSize]);
|
|
90
|
+
}), [size, shape, overlap, numericSize]);
|
|
88
91
|
|
|
89
92
|
// The keyboard hint and roving tab stop only make sense once the group has
|
|
90
93
|
// interactive children. Detect their presence from the rendered DOM after
|
|
@@ -118,7 +121,7 @@ export function AvatarGroup({
|
|
|
118
121
|
value: contextValue,
|
|
119
122
|
children: /*#__PURE__*/_jsxs("div", {
|
|
120
123
|
...props,
|
|
121
|
-
ref:
|
|
124
|
+
ref: useMergedRefs(ref, listRef),
|
|
122
125
|
role: "group",
|
|
123
126
|
"aria-label": ariaLabel,
|
|
124
127
|
"aria-describedby": describedBy,
|
|
@@ -126,7 +129,8 @@ export function AvatarGroup({
|
|
|
126
129
|
onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),
|
|
127
130
|
onFocus: composeEventHandlers(onFocus, handleFocus),
|
|
128
131
|
...mergeProps(themeProps('avatar-group', {
|
|
129
|
-
size
|
|
132
|
+
size,
|
|
133
|
+
shape
|
|
130
134
|
}), stylex.props(styles.root, xstyle), className, style),
|
|
131
135
|
children: [children, hasInteractiveItems && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
132
136
|
id: hintId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupContext.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupContext.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AvatarGroupContext.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupContext.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAEvD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,yDAE9B,CAAC;AAGF,wBAAgB,cAAc,IAAI,uBAAuB,GAAG,IAAI,CAE/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names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"}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import * as stylex from '@stylexjs/stylex';
|
|
17
17
|
import "../theme/tokens.stylex.js";
|
|
18
|
-
import { colorVars, typographyVars, typeScaleVars, fontWeightVars,
|
|
18
|
+
import { colorVars, typographyVars, typeScaleVars, fontWeightVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
19
|
+
import { shapeStyles } from "../Avatar/Avatar.js";
|
|
19
20
|
import { mergeProps } from "../utils/index.js";
|
|
20
21
|
import { resolveSize } from "../Avatar/index.js";
|
|
21
22
|
import { useAvatarGroup } from "./AvatarGroupContext.js";
|
|
@@ -31,7 +32,7 @@ const styles = {
|
|
|
31
32
|
k1xSpc: "x3nfvp2",
|
|
32
33
|
kGNEyG: "x6s0dn4",
|
|
33
34
|
kjj79g: "xl56j7k",
|
|
34
|
-
kaIpWk: "
|
|
35
|
+
kaIpWk: "xbc78cj",
|
|
35
36
|
kWkggS: "x10xzikg",
|
|
36
37
|
kMwMTN: "xv1l7n4",
|
|
37
38
|
kMv6JI: "x9ynric",
|
|
@@ -109,6 +110,7 @@ export function AvatarGroupOverflow({
|
|
|
109
110
|
const t = useTranslator();
|
|
110
111
|
const group = useAvatarGroup();
|
|
111
112
|
const size = group?.size ?? 'md';
|
|
113
|
+
const shape = group?.shape ?? 'circle';
|
|
112
114
|
const numericSize = group?.numericSize ?? resolveSize('md');
|
|
113
115
|
const overlap = group?.overlap ?? 0;
|
|
114
116
|
|
|
@@ -129,8 +131,9 @@ export function AvatarGroupOverflow({
|
|
|
129
131
|
"aria-label": label,
|
|
130
132
|
"data-avatar-item": "",
|
|
131
133
|
...mergeProps(themeProps('avatar-group-overflow', {
|
|
132
|
-
size
|
|
133
|
-
|
|
134
|
+
size,
|
|
135
|
+
shape
|
|
136
|
+
}), focusOutlineProps.focusVisible(styles.base, styles.button, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), shapeStyles[shape], xstyle), className, style),
|
|
134
137
|
children: content
|
|
135
138
|
});
|
|
136
139
|
}
|
|
@@ -139,8 +142,9 @@ export function AvatarGroupOverflow({
|
|
|
139
142
|
...rest,
|
|
140
143
|
"aria-label": label,
|
|
141
144
|
...mergeProps(themeProps('avatar-group-overflow', {
|
|
142
|
-
size
|
|
143
|
-
|
|
145
|
+
size,
|
|
146
|
+
shape
|
|
147
|
+
}), stylex.props(styles.base, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), shapeStyles[shape], xstyle), className, style),
|
|
144
148
|
children: content
|
|
145
149
|
});
|
|
146
150
|
}
|
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Banner.tsx
|
|
3
|
-
* @input Uses React useState/useRef/useId, Button, Icon (with registry string names), StyleX
|
|
3
|
+
* @input Uses React useState/useRef/useId, useCollapsible, Button, Icon (with registry string names), StyleX
|
|
4
4
|
* @output Exports Banner component, BannerProps, BannerStatus, BannerContainer types
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by Banner.test.tsx
|
|
6
6
|
*
|
|
7
7
|
* Visual structure:
|
|
8
8
|
* - Root container: layout-only wrapper (flex column), no visual styling, no theme target
|
|
9
9
|
* - Header area (themeProps 'banner'): colored status background with icon, title, description, actions, dismiss
|
|
10
|
-
* - Content area (themeProps 'banner-content'):
|
|
10
|
+
* - Content area (themeProps 'banner-content'): card background for additional content (children)
|
|
11
11
|
* - Status icon (themeProps 'banner-icon'): the target rides on the default
|
|
12
12
|
* <Icon> itself — the element that paints — so 'status:X' overrides reach
|
|
13
13
|
* the glyph (#4166); for a custom `icon` node it stays on the layout wrapper
|
|
14
14
|
* - No left border accent — color is expressed through the full header background
|
|
15
15
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
16
|
-
* -
|
|
16
|
+
* - Children are collapsible by default: a toggle appears in the header end
|
|
17
|
+
* area and the content starts closed. `collapsible={false}` opts out and
|
|
18
|
+
* pins the content open with no toggle. The whole collapse axis (enabled /
|
|
19
|
+
* default / controlled) lives on that one prop and is driven by the shared
|
|
20
|
+
* `useCollapsible` hook rather than local state.
|
|
17
21
|
*
|
|
18
22
|
* A status added through `BannerStatusMap` augmentation has no entry in the
|
|
19
23
|
* status lookups, so it renders with no status fill, no default glyph and the
|
|
@@ -35,6 +39,7 @@
|
|
|
35
39
|
*/
|
|
36
40
|
import { type ReactNode } from 'react';
|
|
37
41
|
import type { BaseProps } from '../BaseProps';
|
|
42
|
+
import type { CollapsibleConfig } from '../Collapsible/useCollapsible';
|
|
38
43
|
import type { Elevation } from '../utils/types';
|
|
39
44
|
import type { BannerStatusMap, BannerContainerMap } from './index';
|
|
40
45
|
/**
|
|
@@ -109,15 +114,29 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
109
114
|
*/
|
|
110
115
|
elevation?: Elevation;
|
|
111
116
|
/**
|
|
112
|
-
* Whether the content area (children)
|
|
113
|
-
*
|
|
114
|
-
*
|
|
117
|
+
* Whether the content area (children) sits behind an expand/collapse toggle
|
|
118
|
+
* in the header. On by default, so a banner with children behaves as it
|
|
119
|
+
* always has.
|
|
120
|
+
*
|
|
121
|
+
* - omitted / `true` — collapsible, starts collapsed
|
|
122
|
+
* - `{defaultIsOpen: true}` — collapsible, starts open
|
|
123
|
+
* - `{isOpen, onOpenChange}` — controlled by the consumer
|
|
124
|
+
* - `false` — not collapsible: children are always visible, with no toggle,
|
|
125
|
+
* no `aria-expanded`, and a content region that stays mounted
|
|
126
|
+
*
|
|
127
|
+
* Takes the shared `CollapsibleConfig` so a banner's disclosure is
|
|
128
|
+
* configured exactly like `Collapsible`'s, rather than through a
|
|
129
|
+
* Banner-only vocabulary. Banner's default differs from the hook's on one
|
|
130
|
+
* point — it starts closed, not open — because a banner's message lives in
|
|
131
|
+
* its header and the content is supplementary.
|
|
132
|
+
*
|
|
133
|
+
* @default true
|
|
115
134
|
*/
|
|
116
|
-
|
|
135
|
+
collapsible?: boolean | CollapsibleConfig;
|
|
117
136
|
/**
|
|
118
|
-
* Extra content rendered below the header in a
|
|
137
|
+
* Extra content rendered below the header in a card-background area.
|
|
119
138
|
* Use for rich content like lists, links, or detailed information.
|
|
120
|
-
*
|
|
139
|
+
* Collapsed behind a toggle unless `collapsible={false}`.
|
|
121
140
|
*/
|
|
122
141
|
children?: ReactNode;
|
|
123
142
|
}
|
|
@@ -126,11 +145,12 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
126
145
|
*
|
|
127
146
|
* Two-part visual structure:
|
|
128
147
|
* - Header: colored status background with icon, title, description, and actions
|
|
129
|
-
* - Content (optional):
|
|
148
|
+
* - Content (optional): card background area for additional rich content
|
|
130
149
|
*
|
|
131
|
-
* When children are provided, a
|
|
132
|
-
*
|
|
133
|
-
*
|
|
150
|
+
* When children are provided, a chevron toggle appears in the header end area
|
|
151
|
+
* (to the left of the dismiss button if present) and the content starts
|
|
152
|
+
* collapsed. Pass `collapsible={false}` for content that is always visible,
|
|
153
|
+
* or a config object to change the initial state or control it.
|
|
134
154
|
*
|
|
135
155
|
* Manages its own dismissed state internally — the banner hides on dismiss
|
|
136
156
|
* even if `onDismiss` is not provided, so product teams don't need to wire
|
|
@@ -161,12 +181,17 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
161
181
|
* <Banner
|
|
162
182
|
* status="warning"
|
|
163
183
|
* title="Configuration changes"
|
|
164
|
-
*
|
|
184
|
+
* collapsible={{defaultIsOpen: true}}>
|
|
165
185
|
* <p>Details here...</p>
|
|
166
186
|
* </Banner>
|
|
187
|
+
* <Banner status="error" title="3 fields need attention" collapsible={false}>
|
|
188
|
+
* <ul>
|
|
189
|
+
* <li>Email address is invalid</li>
|
|
190
|
+
* </ul>
|
|
191
|
+
* </Banner>
|
|
167
192
|
* ```
|
|
168
193
|
*/
|
|
169
|
-
export declare function Banner({ status, title, description, icon, isDismissable, onDismiss, endContent, container, elevation,
|
|
194
|
+
export declare function Banner({ status, title, description, icon, isDismissable, onDismiss, endContent, container, elevation, collapsible, children, xstyle, className, style, ref, onFocusCapture, onPointerDownCapture, ...rest }: BannerProps): import("react").JSX.Element | null;
|
|
170
195
|
export declare namespace Banner {
|
|
171
196
|
var displayName: string;
|
|
172
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner/Banner.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner/Banner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAA0B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAMjE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAmND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAI,EACJ,aAAqB,EACrB,SAAS,EACT,UAAU,EACV,SAAkB,EAClB,SAAkB,EAClB,WAAkB,EAClB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,cAAc,EACd,oBAAoB,EACpB,GAAG,IAAI,EACR,EAAE,WAAW,sCAoOb;yBAvPe,MAAM"}
|
package/dist/Banner/Banner.js
CHANGED
|
@@ -4,20 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Banner.tsx
|
|
7
|
-
* @input Uses React useState/useRef/useId, Button, Icon (with registry string names), StyleX
|
|
7
|
+
* @input Uses React useState/useRef/useId, useCollapsible, Button, Icon (with registry string names), StyleX
|
|
8
8
|
* @output Exports Banner component, BannerProps, BannerStatus, BannerContainer types
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by Banner.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* Visual structure:
|
|
12
12
|
* - Root container: layout-only wrapper (flex column), no visual styling, no theme target
|
|
13
13
|
* - Header area (themeProps 'banner'): colored status background with icon, title, description, actions, dismiss
|
|
14
|
-
* - Content area (themeProps 'banner-content'):
|
|
14
|
+
* - Content area (themeProps 'banner-content'): card background for additional content (children)
|
|
15
15
|
* - Status icon (themeProps 'banner-icon'): the target rides on the default
|
|
16
16
|
* <Icon> itself — the element that paints — so 'status:X' overrides reach
|
|
17
17
|
* the glyph (#4166); for a custom `icon` node it stays on the layout wrapper
|
|
18
18
|
* - No left border accent — color is expressed through the full header background
|
|
19
19
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
20
|
-
* -
|
|
20
|
+
* - Children are collapsible by default: a toggle appears in the header end
|
|
21
|
+
* area and the content starts closed. `collapsible={false}` opts out and
|
|
22
|
+
* pins the content open with no toggle. The whole collapse axis (enabled /
|
|
23
|
+
* default / controlled) lives on that one prop and is driven by the shared
|
|
24
|
+
* `useCollapsible` hook rather than local state.
|
|
21
25
|
*
|
|
22
26
|
* A status added through `BannerStatusMap` augmentation has no entry in the
|
|
23
27
|
* status lookups, so it renders with no status fill, no default glyph and the
|
|
@@ -43,6 +47,7 @@ import { Button } from "../Button/index.js";
|
|
|
43
47
|
import { Icon } from "../Icon/index.js";
|
|
44
48
|
import "../theme/tokens.stylex.js";
|
|
45
49
|
import { colorVars, spacingVars, radiusVars, fontWeightVars, typeScaleVars, borderVars, durationVars, easeVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
50
|
+
import { useCollapsible } from "../Collapsible/useCollapsible.js";
|
|
46
51
|
import { composeEventHandlers, isRenderable, mergeProps } from "../utils/index.js";
|
|
47
52
|
import { edgeCompSlot } from "../Layout/edgeCompensation.stylex.js";
|
|
48
53
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -221,11 +226,12 @@ const elevationStyles = {
|
|
|
221
226
|
*
|
|
222
227
|
* Two-part visual structure:
|
|
223
228
|
* - Header: colored status background with icon, title, description, and actions
|
|
224
|
-
* - Content (optional):
|
|
229
|
+
* - Content (optional): card background area for additional rich content
|
|
225
230
|
*
|
|
226
|
-
* When children are provided, a
|
|
227
|
-
*
|
|
228
|
-
*
|
|
231
|
+
* When children are provided, a chevron toggle appears in the header end area
|
|
232
|
+
* (to the left of the dismiss button if present) and the content starts
|
|
233
|
+
* collapsed. Pass `collapsible={false}` for content that is always visible,
|
|
234
|
+
* or a config object to change the initial state or control it.
|
|
229
235
|
*
|
|
230
236
|
* Manages its own dismissed state internally — the banner hides on dismiss
|
|
231
237
|
* even if `onDismiss` is not provided, so product teams don't need to wire
|
|
@@ -256,9 +262,14 @@ const elevationStyles = {
|
|
|
256
262
|
* <Banner
|
|
257
263
|
* status="warning"
|
|
258
264
|
* title="Configuration changes"
|
|
259
|
-
*
|
|
265
|
+
* collapsible={{defaultIsOpen: true}}>
|
|
260
266
|
* <p>Details here...</p>
|
|
261
267
|
* </Banner>
|
|
268
|
+
* <Banner status="error" title="3 fields need attention" collapsible={false}>
|
|
269
|
+
* <ul>
|
|
270
|
+
* <li>Email address is invalid</li>
|
|
271
|
+
* </ul>
|
|
272
|
+
* </Banner>
|
|
262
273
|
* ```
|
|
263
274
|
*/
|
|
264
275
|
export function Banner({
|
|
@@ -271,7 +282,7 @@ export function Banner({
|
|
|
271
282
|
endContent,
|
|
272
283
|
container = 'card',
|
|
273
284
|
elevation = 'none',
|
|
274
|
-
|
|
285
|
+
collapsible = true,
|
|
275
286
|
children,
|
|
276
287
|
xstyle,
|
|
277
288
|
className,
|
|
@@ -283,7 +294,25 @@ export function Banner({
|
|
|
283
294
|
}) {
|
|
284
295
|
const t = useTranslator();
|
|
285
296
|
const [isDismissed, setIsDismissed] = useState(false);
|
|
286
|
-
|
|
297
|
+
// The disclosure state machine is the shared one — Banner owns no collapse
|
|
298
|
+
// state of its own. `collapsible={false}` disables it, and that is what
|
|
299
|
+
// makes the content permanently visible.
|
|
300
|
+
//
|
|
301
|
+
// The one place Banner departs from the hook's defaults: `useCollapsible`
|
|
302
|
+
// opens by default, a banner starts closed. Its header already carries the
|
|
303
|
+
// message, so the content is supplementary — and this is the behaviour
|
|
304
|
+
// Banner has always had.
|
|
305
|
+
const collapsibleConfig = collapsible != null && typeof collapsible === 'object' ? collapsible : {};
|
|
306
|
+
const {
|
|
307
|
+
isEnabled: isCollapsible,
|
|
308
|
+
isOpen: isExpanded,
|
|
309
|
+
toggle: handleToggleExpand
|
|
310
|
+
} = useCollapsible({
|
|
311
|
+
isCollapsible: collapsible !== false && {
|
|
312
|
+
...collapsibleConfig,
|
|
313
|
+
defaultIsOpen: collapsibleConfig.defaultIsOpen ?? false
|
|
314
|
+
}
|
|
315
|
+
});
|
|
287
316
|
// The element focus came from before it entered the banner. Dismissing
|
|
288
317
|
// unmounts the whole banner, dismiss button included, so without a handoff
|
|
289
318
|
// the browser drops focus to <body> and a keyboard user loses their place.
|
|
@@ -292,7 +321,8 @@ export function Banner({
|
|
|
292
321
|
// Links the expand/collapse toggle to the content region it shows/hides so
|
|
293
322
|
// assistive tech can move from the button to its controlled content
|
|
294
323
|
// (disclosure pattern). The region is conditionally rendered, so aria-controls
|
|
295
|
-
// below is set only while it's mounted to avoid a dangling reference.
|
|
324
|
+
// below is set only while it's mounted to avoid a dangling reference. A
|
|
325
|
+
// non-collapsible banner has no toggle, so neither end of the link is used.
|
|
296
326
|
const contentId = useId();
|
|
297
327
|
const defaultIconName = defaultIconNames[status];
|
|
298
328
|
const role = statusRole[status] ?? FALLBACK_ROLE;
|
|
@@ -325,17 +355,20 @@ export function Banner({
|
|
|
325
355
|
origin.focus();
|
|
326
356
|
}
|
|
327
357
|
};
|
|
328
|
-
const handleToggleExpand = () => {
|
|
329
|
-
setIsExpanded(prev => !prev);
|
|
330
|
-
};
|
|
331
358
|
|
|
359
|
+
// The toggle exists only for a collapsible banner that actually has content
|
|
360
|
+
// to disclose.
|
|
361
|
+
const hasToggle = isCollapsible && hasChildren;
|
|
332
362
|
// Show the end area if there are actions, dismiss, or a collapsible toggle
|
|
333
|
-
const showEndArea = isRenderable(endContent) || isDismissable ||
|
|
363
|
+
const showEndArea = isRenderable(endContent) || isDismissable || hasToggle;
|
|
334
364
|
// Center items vertically when there's only a title (no description)
|
|
335
365
|
// and the banner has action buttons
|
|
336
366
|
const hasActions = isRenderable(endContent) || isDismissable;
|
|
337
367
|
const isSingleLine = !isRenderable(description) && hasActions;
|
|
338
|
-
|
|
368
|
+
|
|
369
|
+
// Non-collapsible children are always shown; collapsible ones follow the
|
|
370
|
+
// hook's open state.
|
|
371
|
+
const showContent = hasChildren && (!isCollapsible || isExpanded);
|
|
339
372
|
const isCard = container === 'card';
|
|
340
373
|
return /*#__PURE__*/_jsxs("div", {
|
|
341
374
|
ref: ref,
|
|
@@ -394,7 +427,7 @@ export function Banner({
|
|
|
394
427
|
})]
|
|
395
428
|
}), showEndArea && /*#__PURE__*/_jsxs("div", {
|
|
396
429
|
...stylex.props(styles.endArea, edgeCompSlot.inset(spacingVars['--spacing-2'])),
|
|
397
|
-
children: [endContent,
|
|
430
|
+
children: [endContent, hasToggle && /*#__PURE__*/_jsx(Button, {
|
|
398
431
|
variant: "ghost",
|
|
399
432
|
size: "sm",
|
|
400
433
|
label: isExpanded ? t('@astryx.banner.collapse') : t('@astryx.banner.expand'),
|
|
@@ -424,7 +457,7 @@ export function Banner({
|
|
|
424
457
|
})]
|
|
425
458
|
})]
|
|
426
459
|
}), showContent && /*#__PURE__*/_jsx("div", {
|
|
427
|
-
id: contentId,
|
|
460
|
+
id: hasToggle ? contentId : undefined,
|
|
428
461
|
...mergeProps(themeProps('banner-content', {
|
|
429
462
|
container,
|
|
430
463
|
status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAe7C,YAAY,E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, useEffect, useLayoutEffect, useRef, useState } from '
|
|
|
28
28
|
import * as stylex from '@stylexjs/stylex';
|
|
29
29
|
import "../theme/tokens.stylex.js";
|
|
30
30
|
import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
31
|
-
import { useDevWarning, useScrollLock } from "../hooks/index.js";
|
|
31
|
+
import { isImeKeyEvent, useDevWarning, useScrollLock } from "../hooks/index.js";
|
|
32
32
|
import { BottomSheetPanel } from "./BottomSheetPanel.js";
|
|
33
33
|
import { BottomSheetEdgeTint } from "./BottomSheetEdgeTint.js";
|
|
34
34
|
import { BottomSheetSwitcherContext } from "./BottomSheetSwitcherContext.js";
|
|
@@ -168,14 +168,27 @@ function StandaloneBottomSheet({
|
|
|
168
168
|
useScrollLock(shouldPresent && hasScrim);
|
|
169
169
|
useDevWarning('BottomSheet', 'requires a non-empty `label` for an accessible name; the open sheet ' + 'has no built-in heading to derive one from.', isOpen && !label);
|
|
170
170
|
const handleCancel = useCallback(event => {
|
|
171
|
+
// No IME guard here: `cancel` is a plain Event carrying no composition
|
|
172
|
+
// state, and handleKeyDown claims a composing Escape before the browser
|
|
173
|
+
// can raise the close request that would arrive here.
|
|
171
174
|
event.preventDefault();
|
|
172
175
|
dismissOnEscape();
|
|
173
176
|
}, [dismissOnEscape]);
|
|
174
177
|
const handleKeyDown = useCallback(event => {
|
|
175
|
-
if (event.key
|
|
176
|
-
|
|
177
|
-
dismissOnEscape();
|
|
178
|
+
if (event.key !== 'Escape') {
|
|
179
|
+
return;
|
|
178
180
|
}
|
|
181
|
+
// Claim the key before reading it: an unclaimed Escape lets the browser
|
|
182
|
+
// raise its own close request, which lands on handleCancel and dismisses
|
|
183
|
+
// on the same keypress.
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
// An IME fires this keydown to cancel an in-progress composition, ahead
|
|
186
|
+
// of compositionend. It is a composition cancel, not a dismissal command
|
|
187
|
+
// — see utils/ime; Dialog and BottomSheetSwitcher guard the same way.
|
|
188
|
+
if (isImeKeyEvent(event.nativeEvent)) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
dismissOnEscape();
|
|
179
192
|
}, [dismissOnEscape]);
|
|
180
193
|
const handleClick = useCallback(event => {
|
|
181
194
|
if (hasScrim && event.target === event.currentTarget) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetSwitcher.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetSwitcher.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheetSwitcher.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetSwitcher.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqI5C,MAAM,WAAW,wBAAyB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC5E,iDAAiD;IACjD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAEnC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;;;OAKG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,iEAAiE;IACjE,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAEtD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,mBAAmB,EACnB,QAAe,EACf,QAAQ,EACR,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,+BA+Z1B;yBA5ae,mBAAmB"}
|
|
@@ -34,9 +34,10 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
34
34
|
import "../theme/tokens.stylex.js";
|
|
35
35
|
import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
36
36
|
import { hasActiveFocusTrapEscape, isImeKeyEvent, useFocusTrap, useScrollLock } from "../hooks/index.js";
|
|
37
|
-
import { composeEventHandlers, mergeProps
|
|
37
|
+
import { composeEventHandlers, mergeProps } from "../utils/index.js";
|
|
38
38
|
import { BottomSheetEdgeTint } from "./BottomSheetEdgeTint.js";
|
|
39
39
|
import { BottomSheetSwitcherContext } from "./BottomSheetSwitcherContext.js";
|
|
40
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
40
41
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
41
42
|
const styles = {
|
|
42
43
|
dialog: {
|
|
@@ -400,7 +401,7 @@ export function BottomSheetSwitcher({
|
|
|
400
401
|
children: /*#__PURE__*/_jsxs("dialog", {
|
|
401
402
|
...props,
|
|
402
403
|
...dialogPresentationProps,
|
|
403
|
-
ref:
|
|
404
|
+
ref: useMergedRefs(ref, dialogRef, containerRef),
|
|
404
405
|
"aria-label": ariaLabel,
|
|
405
406
|
"aria-modal": isModal ? 'true' : undefined,
|
|
406
407
|
onCancel: composeEventHandlers(onCancel, handleCancel),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;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ACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EAAE,aAAa,EACxB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,mBAAmB,qBAsMrB;yBArNe,cAAc"}
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
import React, { use, useCallback, useId, useMemo, useRef, useEffect } from 'react';
|
|
25
25
|
import * as stylex from '@stylexjs/stylex';
|
|
26
26
|
import "../theme/tokens.stylex.js";
|
|
27
|
-
import { colorVars, spacingVars, typeScaleVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
27
|
+
import { colorVars, spacingVars, typeScaleVars, radiusVars, fontWeightVars } from "../theme/tokens.stylex.js";
|
|
28
28
|
import { BreadcrumbContext } from "./Breadcrumbs.js";
|
|
29
29
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
30
|
-
import { mergeProps
|
|
30
|
+
import { mergeProps } from "../utils/index.js";
|
|
31
31
|
import { themeProps } from "../utils/themeProps.js";
|
|
32
32
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
33
33
|
import { Icon } from "../Icon/index.js";
|
|
@@ -38,7 +38,7 @@ import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
|
38
38
|
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
39
39
|
import { DropdownMenuContext } from "../DropdownMenu/DropdownMenuContext.js";
|
|
40
40
|
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR, MENU_BOUNDARY_SELECTOR } from "../DropdownMenu/menuItemRoles.js";
|
|
41
|
-
|
|
41
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
42
42
|
// =============================================================================
|
|
43
43
|
// Props
|
|
44
44
|
// =============================================================================
|
|
@@ -203,6 +203,7 @@ export function BreadcrumbItem({
|
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
+
const mergedItemRef = useMergedRefs(ref, liRef);
|
|
206
207
|
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
207
208
|
children: [startIcon && /*#__PURE__*/_jsx("span", {
|
|
208
209
|
...{
|
|
@@ -213,7 +214,7 @@ export function BreadcrumbItem({
|
|
|
213
214
|
});
|
|
214
215
|
if (isCurrent) {
|
|
215
216
|
return /*#__PURE__*/_jsxs("li", {
|
|
216
|
-
ref:
|
|
217
|
+
ref: mergedItemRef,
|
|
217
218
|
...mergeProps(themeProps('breadcrumb-item', {
|
|
218
219
|
variant: ctx.variant
|
|
219
220
|
}), stylex.props(itemStyles.root, isSupporting ? itemStyles.supportingSize : itemStyles.defaultSize, xstyle), className, style),
|
|
@@ -240,10 +241,10 @@ export function BreadcrumbItem({
|
|
|
240
241
|
}) : /*#__PURE__*/_jsx("span", {
|
|
241
242
|
...{
|
|
242
243
|
0: {
|
|
243
|
-
className: "x78zum5 x6s0dn4 xzye2dw
|
|
244
|
+
className: "x78zum5 x6s0dn4 xzye2dw x2mo6ok x1tgivj0"
|
|
244
245
|
},
|
|
245
246
|
1: {
|
|
246
|
-
className: "x78zum5 x6s0dn4 xzye2dw
|
|
247
|
+
className: "x78zum5 x6s0dn4 xzye2dw x2mo6ok xv1l7n4"
|
|
247
248
|
}
|
|
248
249
|
}[!!isSupporting << 0],
|
|
249
250
|
"aria-current": "page",
|
|
@@ -255,7 +256,7 @@ export function BreadcrumbItem({
|
|
|
255
256
|
// Items without isCurrent set render as links (if href) or plain spans.
|
|
256
257
|
// The effect handles adding aria-current for auto-last detection.
|
|
257
258
|
return /*#__PURE__*/_jsxs("li", {
|
|
258
|
-
ref:
|
|
259
|
+
ref: mergedItemRef,
|
|
259
260
|
...mergeProps(themeProps('breadcrumb-item', {
|
|
260
261
|
variant: ctx.variant
|
|
261
262
|
}), stylex.props(itemStyles.root, isSupporting ? itemStyles.supportingSize : itemStyles.defaultSize, xstyle), className, style),
|
|
@@ -290,10 +291,10 @@ export function BreadcrumbItem({
|
|
|
290
291
|
ref: contentRef,
|
|
291
292
|
...{
|
|
292
293
|
0: {
|
|
293
|
-
className: "x78zum5 x6s0dn4 xzye2dw
|
|
294
|
+
className: "x78zum5 x6s0dn4 xzye2dw x2mo6ok x1tgivj0"
|
|
294
295
|
},
|
|
295
296
|
1: {
|
|
296
|
-
className: "x78zum5 x6s0dn4 xzye2dw
|
|
297
|
+
className: "x78zum5 x6s0dn4 xzye2dw x2mo6ok xv1l7n4"
|
|
297
298
|
}
|
|
298
299
|
}[!!isSupporting << 0],
|
|
299
300
|
children: content
|
|
@@ -408,7 +409,7 @@ function BreadcrumbMenuTrigger({
|
|
|
408
409
|
const menuContent = Array.isArray(menu) ? renderDropdownItems(menu) : menu;
|
|
409
410
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
410
411
|
children: [/*#__PURE__*/_jsxs("button", {
|
|
411
|
-
ref:
|
|
412
|
+
ref: useMergedRefs(ref, buttonRef, popover.triggerRef),
|
|
412
413
|
type: "button",
|
|
413
414
|
onClick: handleClick,
|
|
414
415
|
onKeyDown: handleKeyDown,
|