@astryxdesign/core 0.4.6 → 0.4.7-canary.019ae5a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -2
- package/dist/AspectRatio/AspectRatio.d.ts +24 -0
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +23 -4
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +15 -10
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +3 -2
- package/dist/Banner/Banner.d.ts +40 -15
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +51 -18
- package/dist/BottomSheet/BottomSheet.d.ts +1 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +54 -15
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +6 -0
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetEdgeTint.js +62 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +1 -0
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +13 -6
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +23 -5
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -10
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +5 -4
- package/dist/ButtonGroup/ButtonGroup.d.ts +5 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +26 -7
- package/dist/Calendar/Calendar.d.ts +3 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +13 -14
- package/dist/Calendar/getInitialFocusDate.d.ts +46 -0
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -0
- package/dist/Calendar/getInitialFocusDate.js +62 -0
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +3 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -3
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +3 -3
- package/dist/Chat/ChatMessageList.d.ts +22 -3
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +6 -3
- package/dist/Chat/ChatTokenizedText.d.ts +2 -0
- package/dist/Chat/ChatTokenizedText.d.ts.map +1 -1
- package/dist/Chat/ChatTokenizedText.js +11 -6
- package/dist/Chat/useChatComposerTokens.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +3 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +3 -3
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +3 -2
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +3 -2
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +4 -3
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +3 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +38 -4
- package/dist/DateTimeInput/DateTimeInput.d.ts +21 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +406 -12
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts +7 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +89 -58
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +6 -5
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +3 -2
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +6 -2
- package/dist/HoverCard/HoverCard.d.ts +6 -0
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +5 -0
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +67 -25
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +10 -3
- package/dist/Layer/LayerDepthContext.d.ts +52 -0
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -0
- package/dist/Layer/LayerDepthContext.js +66 -0
- package/dist/Layer/index.d.ts +3 -0
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +4 -0
- package/dist/Layer/layerStack.d.ts +98 -0
- package/dist/Layer/layerStack.d.ts.map +1 -0
- package/dist/Layer/layerStack.js +306 -0
- package/dist/Layer/useLayerDismissal.d.ts +93 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -0
- package/dist/Layer/useLayerDismissal.js +91 -0
- package/dist/Lightbox/Lightbox.d.ts +1 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +103 -81
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/Markdown/parser.d.ts +38 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +177 -29
- package/dist/MobileNav/MobileNav.d.ts +6 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +61 -36
- package/dist/MultiSelector/MultiSelector.d.ts +15 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +17 -6
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +3 -2
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +3 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +3 -2
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +20 -17
- package/dist/PowerSearch/PowerSearch.d.ts +8 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +19 -6
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +3 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +28 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +3 -1
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +19 -9
- package/dist/PowerSearch/types.d.ts +2 -0
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts +6 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +14 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +3 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +3 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +3 -3
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -0
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +4 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +6 -5
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +4 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +3 -3
- package/dist/Spinner/Spinner.d.ts +3 -3
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +130 -78
- package/dist/Stepper/Step.d.ts +140 -0
- package/dist/Stepper/Step.d.ts.map +1 -0
- package/dist/Stepper/Step.js +1045 -0
- package/dist/Stepper/StepStatus.d.ts +24 -0
- package/dist/Stepper/StepStatus.d.ts.map +1 -0
- package/dist/Stepper/StepStatus.js +1 -0
- package/dist/Stepper/Stepper.d.ts +93 -0
- package/dist/Stepper/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Stepper.js +184 -0
- package/dist/Stepper/StepperContext.d.ts +41 -0
- package/dist/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/Stepper/StepperContext.js +34 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts.map +1 -0
- package/dist/Stepper/index.js +7 -0
- package/dist/Stepper/stepper.stylex.d.ts +15 -0
- package/dist/Stepper/stepper.stylex.d.ts.map +1 -0
- package/dist/Stepper/stepper.stylex.js +20 -0
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +3 -2
- package/dist/TabList/Tab.d.ts +15 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +32 -3
- package/dist/TabList/TabList.d.ts +46 -7
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +353 -23
- package/dist/TabList/TabListContext.d.ts +11 -1
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +11 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +3 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.d.ts.map +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +4 -1
- package/dist/Table/TableRow.d.ts +16 -5
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +16 -5
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +20 -8
- package/dist/Table/plugins/pagination/useTablePagination.d.ts +3 -0
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +21 -4
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +10 -3
- package/dist/Table/plugins/selection/useTableSelection.d.ts +16 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +19 -5
- package/dist/Table/types.d.ts +22 -4
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -0
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +6 -2
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +3 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +3 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +3 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +5 -3
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +2 -2
- package/dist/Tokenizer/Tokenizer.d.ts +3 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +2 -0
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +5 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +39 -24
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +3 -2
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +3 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -3
- package/dist/Typeahead/BaseTypeahead.d.ts +2 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +68 -29
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -2
- package/dist/astryx.css +72 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts +7 -4
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +60 -95
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +10 -3
- package/dist/hooks/useListFocus.d.ts +5 -2
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +12 -6
- package/dist/hooks/useMergedRefs.d.ts +18 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/groupItems.d.ts +5 -1
- package/dist/utils/groupItems.d.ts.map +1 -1
- package/dist/utils/groupItems.js +9 -9
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +10 -1
- package/dist/utils/timeParser.d.ts +1 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +26 -12
- package/locales/en.json +31 -7
- package/locales/pseudo.json +18 -0
- package/package.json +8 -3
- package/src/AppShell/AppShell.tsx +3 -2
- package/src/AspectRatio/AspectRatio.doc.mjs +6 -3
- package/src/AspectRatio/AspectRatio.test.tsx +57 -10
- package/src/AspectRatio/AspectRatio.tsx +40 -1
- package/src/Avatar/Avatar.doc.mjs +2 -1
- package/src/Avatar/Avatar.test.tsx +17 -0
- package/src/Avatar/Avatar.tsx +61 -38
- package/src/AvatarGroup/AvatarGroup.tsx +3 -2
- package/src/Banner/Banner.doc.mjs +13 -11
- package/src/Banner/Banner.test.tsx +102 -15
- package/src/Banner/Banner.tsx +72 -25
- package/src/BottomSheet/BottomSheet.test.tsx +123 -0
- package/src/BottomSheet/BottomSheet.tsx +36 -4
- package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +225 -0
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +82 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +66 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +19 -0
- package/src/BottomSheet/BottomSheetSwitcher.tsx +16 -2
- package/src/BottomSheet/useSheetGestures.test.ts +27 -0
- package/src/BottomSheet/useSheetGestures.ts +25 -5
- package/src/Breadcrumbs/BreadcrumbItem.tsx +9 -5
- package/src/Button/Button.doc.mjs +22 -0
- package/src/Button/Button.test.tsx +13 -0
- package/src/Button/Button.tsx +5 -4
- package/src/ButtonGroup/ButtonGroup.doc.mjs +10 -1
- package/src/ButtonGroup/ButtonGroup.test.tsx +391 -1
- package/src/ButtonGroup/ButtonGroup.tsx +23 -5
- package/src/Calendar/Calendar.doc.mjs +4 -3
- package/src/Calendar/Calendar.test.tsx +52 -0
- package/src/Calendar/Calendar.tsx +18 -15
- package/src/Calendar/getInitialFocusDate.test.ts +94 -0
- package/src/Calendar/getInitialFocusDate.ts +93 -0
- package/src/Carousel/Carousel.tsx +3 -2
- package/src/Chat/ChatComposerInput.tsx +5 -1
- package/src/Chat/ChatLayout.tsx +3 -2
- package/src/Chat/ChatMessageList.doc.mjs +9 -1
- package/src/Chat/ChatMessageList.test.tsx +46 -0
- package/src/Chat/ChatMessageList.tsx +28 -4
- package/src/Chat/ChatTokenizedText.tsx +17 -10
- package/src/Chat/useChatComposerTokens.ts +1 -1
- package/src/CheckboxInput/CheckboxInput.tsx +3 -2
- package/src/ClickableCard/ClickableCard.tsx +3 -2
- package/src/CodeBlock/CodeBlock.doc.mjs +6 -0
- package/src/CommandPalette/CommandPaletteInput.tsx +3 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +3 -2
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -0
- package/src/ContextMenu/ContextMenu.tsx +4 -3
- package/src/DateInput/DateInput.tsx +3 -2
- package/src/DateInput/DateInputTouch.test.tsx +36 -0
- package/src/DateInput/TouchDateField.tsx +38 -4
- package/src/DateTimeInput/DateTimeInput.doc.mjs +18 -0
- package/src/DateTimeInput/DateTimeInput.test.tsx +1088 -0
- package/src/DateTimeInput/DateTimeInput.tsx +556 -24
- package/src/DateTimeInput/index.ts +1 -0
- package/src/Dialog/Dialog.doc.mjs +8 -3
- package/src/Dialog/Dialog.test.tsx +261 -1
- package/src/Dialog/Dialog.tsx +109 -58
- package/src/DropdownMenu/DropdownMenu.doc.mjs +6 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +8 -5
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +8 -11
- package/src/Field/Field.doc.mjs +13 -2
- package/src/FileInput/FileInput.tsx +3 -2
- package/src/Heading/Heading.test.tsx +23 -1
- package/src/Heading/Heading.tsx +6 -2
- package/src/HoverCard/HoverCard.doc.mjs +5 -0
- package/src/HoverCard/HoverCard.tsx +6 -0
- package/src/HoverCard/useHoverCard.tsx +81 -30
- package/src/Item/Item.tsx +5 -4
- package/src/Kbd/Kbd.test.tsx +17 -0
- package/src/Kbd/Kbd.tsx +10 -3
- package/src/Layer/LayerDepthContext.tsx +62 -0
- package/src/Layer/index.ts +9 -0
- package/src/Layer/layerDismissalFamilies.test.tsx +359 -0
- package/src/Layer/layerDismissalInvariants.test.tsx +417 -0
- package/src/Layer/layerStack.ts +362 -0
- package/src/Layer/useLayerDismissal.test.tsx +469 -0
- package/src/Layer/useLayerDismissal.ts +173 -0
- package/src/Layout/Layout.doc.mjs +2 -2
- package/src/Lightbox/Lightbox.doc.mjs +12 -0
- package/src/Lightbox/Lightbox.tsx +124 -102
- package/src/Link/Link.doc.mjs +39 -0
- package/src/Markdown/Markdown.doc.mjs +5 -0
- package/src/Markdown/incremental.test.ts +16 -2
- package/src/Markdown/index.ts +1 -0
- package/src/Markdown/parser.perf.test.ts +96 -1
- package/src/Markdown/parser.test.ts +145 -2
- package/src/Markdown/parser.ts +244 -29
- package/src/MobileNav/MobileNav.tsx +62 -36
- package/src/MoreMenu/MoreMenu.doc.mjs +7 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +27 -0
- package/src/MultiSelector/MultiSelector.test.tsx +106 -0
- package/src/MultiSelector/MultiSelector.tsx +50 -6
- package/src/MultiSelector/index.ts +1 -0
- package/src/NavMenu/NavHeadingMenu.tsx +3 -2
- package/src/NumberInput/NumberInput.doc.mjs +5 -0
- package/src/Outline/Outline.tsx +3 -2
- package/src/OverflowList/OverflowList.tsx +3 -2
- package/src/Overlay/Overlay.tsx +3 -2
- package/src/Popover/Popover.test.tsx +27 -1
- package/src/Popover/usePopover.tsx +31 -28
- package/src/PowerSearch/PowerSearch.doc.mjs +160 -28
- package/src/PowerSearch/PowerSearch.test.tsx +240 -1
- package/src/PowerSearch/PowerSearch.tsx +34 -5
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +201 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +29 -2
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +47 -1
- package/src/PowerSearch/PowerSearchValueEditor.tsx +15 -0
- package/src/PowerSearch/types.ts +2 -0
- package/src/PowerSearch/usePowerSearchSource.test.ts +82 -2
- package/src/PowerSearch/usePowerSearchSource.ts +13 -3
- package/src/Resizable/ResizeHandle.tsx +3 -2
- package/src/SegmentedControl/SegmentedControl.tsx +3 -2
- package/src/SelectableCard/SelectableCard.tsx +3 -2
- package/src/Selector/Selector.doc.mjs +12 -1
- package/src/Selector/Selector.test.tsx +45 -1
- package/src/Selector/Selector.tsx +11 -1
- package/src/SideNav/SideNav.doc.mjs +6 -6
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavHeading.tsx +10 -10
- package/src/SideNav/SideNavItem.tsx +4 -2
- package/src/Slider/Slider.tsx +3 -2
- package/src/Spinner/Spinner.test.tsx +147 -1
- package/src/Spinner/Spinner.tsx +120 -101
- package/src/Stepper/Step.doc.mjs +98 -0
- package/src/Stepper/Step.tsx +1638 -0
- package/src/Stepper/StepStatus.ts +26 -0
- package/src/Stepper/Stepper.doc.mjs +370 -0
- package/src/Stepper/Stepper.test.tsx +1024 -0
- package/src/Stepper/Stepper.tsx +258 -0
- package/src/Stepper/StepperContext.ts +71 -0
- package/src/Stepper/index.ts +18 -0
- package/src/Stepper/stepper.stylex.ts +19 -0
- package/src/Switch/Switch.tsx +3 -2
- package/src/TabList/Tab.doc.mjs +13 -1
- package/src/TabList/Tab.tsx +67 -3
- package/src/TabList/TabList.doc.mjs +22 -6
- package/src/TabList/TabList.test.tsx +580 -4
- package/src/TabList/TabList.tsx +490 -22
- package/src/TabList/TabListContext.ts +13 -2
- package/src/TabList/TabMenu.tsx +3 -2
- package/src/TabList/index.ts +6 -2
- package/src/Table/BaseTable.tsx +6 -3
- package/src/Table/Table.doc.mjs +6 -1
- package/src/Table/Table.test.tsx +132 -14
- package/src/Table/TableBody.doc.mjs +40 -0
- package/src/Table/TableFooter.doc.mjs +40 -0
- package/src/Table/TableHeader.doc.mjs +40 -0
- package/src/Table/TableRow.tsx +16 -5
- package/src/Table/plugins/groupedRows/useTableGroupedRows-perf.test.tsx +112 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +100 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +17 -8
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +34 -4
- package/src/Table/plugins/pagination/useTablePagination.tsx +35 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -2
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +13 -7
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +12 -3
- package/src/Table/plugins/selection/useTableSelection.test.tsx +76 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +40 -7
- package/src/Table/types.ts +22 -4
- package/src/Table/useBaseTablePlugins.ts +5 -0
- package/src/Table/useTableGroupedRows.doc.mjs +5 -4
- package/src/Table/useTablePagination.doc.mjs +7 -0
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/Table/useTableSelection.doc.mjs +31 -0
- package/src/Text/Text.test.tsx +23 -1
- package/src/Text/Text.tsx +6 -2
- package/src/TextArea/TextArea.tsx +3 -2
- package/src/TextInput/TextInput.doc.mjs +10 -0
- package/src/TextInput/TextInput.tsx +3 -2
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
- package/src/TimeInput/TimeInput.tsx +2 -2
- package/src/Timestamp/Timestamp.tsx +4 -2
- package/src/Toast/Toast.doc.mjs +6 -0
- package/src/Token/TokenLink.tsx +2 -2
- package/src/Tokenizer/Tokenizer.doc.mjs +27 -0
- package/src/Tokenizer/Tokenizer.tsx +4 -0
- package/src/Toolbar/Toolbar.doc.mjs +5 -0
- package/src/Tooltip/Tooltip.doc.mjs +5 -0
- package/src/Tooltip/Tooltip.test.tsx +32 -0
- package/src/Tooltip/Tooltip.tsx +5 -0
- package/src/Tooltip/useTooltip.tsx +47 -24
- package/src/TopNav/TopNavHeading.tsx +3 -2
- package/src/TopNav/TopNavMegaMenu.tsx +3 -2
- package/src/TopNav/TopNavMenu.tsx +4 -3
- package/src/Typeahead/BaseTypeahead.doc.mjs +11 -0
- package/src/Typeahead/BaseTypeahead.tsx +85 -33
- package/src/Typeahead/Typeahead.doc.mjs +5 -0
- package/src/Typeahead/Typeahead.test.tsx +49 -0
- package/src/Typeahead/Typeahead.tsx +3 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useContainerReveal.doc.mjs +2 -2
- package/src/hooks/useFocusTrap.test.tsx +14 -0
- package/src/hooks/useFocusTrap.ts +62 -111
- package/src/hooks/useFocusTrapEscapeShim.test.tsx +165 -0
- package/src/hooks/useHotkeys.test.ts +18 -0
- package/src/hooks/useHotkeys.ts +10 -3
- package/src/hooks/useListFocus.doc.mjs +2 -2
- package/src/hooks/useListFocus.test.tsx +65 -3
- package/src/hooks/useListFocus.ts +15 -7
- package/src/hooks/useMergedRefs.doc.mjs +79 -0
- package/src/hooks/useMergedRefs.test.tsx +62 -0
- package/src/hooks/useMergedRefs.ts +36 -0
- package/src/index.ts +1 -0
- package/src/theme/MediaTheme.doc.mjs +5 -5
- package/src/utils/groupItems.ts +12 -6
- package/src/utils/index.ts +1 -1
- package/src/utils/sharedResizeObserver.ts +10 -2
- package/src/utils/timeParser.test.ts +6 -1
- package/src/utils/timeParser.ts +35 -13
- package/src/__tests__/inputWidthContract.test.tsx +0 -69
package/dist/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
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* SYNC: When modified, update these files to stay in sync:
|
|
14
14
|
* - /packages/core/src/BottomSheet/BottomSheetPanel.tsx
|
|
15
|
+
* - /packages/core/src/BottomSheet/BottomSheetEdgeTint.tsx
|
|
15
16
|
* - /packages/core/src/BottomSheet/BottomSheet.doc.mjs
|
|
16
17
|
* - /packages/core/src/BottomSheet/BottomSheet.test.tsx
|
|
17
18
|
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA
|
|
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,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAyEhF,UAAU,sBAAuB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IAEd,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAC;IAEpB,wGAAwG;IACxG,MAAM,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;IAE7C;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAEjD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAC1B,0BAA0B,GAAG,wBAAwB,CAAC;AA4XxD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA6BlD;yBA7Be,WAAW"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* SYNC: When modified, update these files to stay in sync:
|
|
18
18
|
* - /packages/core/src/BottomSheet/BottomSheetPanel.tsx
|
|
19
|
+
* - /packages/core/src/BottomSheet/BottomSheetEdgeTint.tsx
|
|
19
20
|
* - /packages/core/src/BottomSheet/BottomSheet.doc.mjs
|
|
20
21
|
* - /packages/core/src/BottomSheet/BottomSheet.test.tsx
|
|
21
22
|
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.tsx
|
|
@@ -27,10 +28,11 @@ import { use, useCallback, useEffect, useLayoutEffect, useRef, useState } from '
|
|
|
27
28
|
import * as stylex from '@stylexjs/stylex';
|
|
28
29
|
import "../theme/tokens.stylex.js";
|
|
29
30
|
import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
30
|
-
import { useDevWarning, useScrollLock } from "../hooks/index.js";
|
|
31
|
+
import { isImeKeyEvent, useDevWarning, useScrollLock } from "../hooks/index.js";
|
|
31
32
|
import { BottomSheetPanel } from "./BottomSheetPanel.js";
|
|
33
|
+
import { BottomSheetEdgeTint } from "./BottomSheetEdgeTint.js";
|
|
32
34
|
import { BottomSheetSwitcherContext } from "./BottomSheetSwitcherContext.js";
|
|
33
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
36
|
function panelStateForSwitcherPhase(phase, alignmentOffset) {
|
|
35
37
|
switch (phase) {
|
|
36
38
|
case 'active':
|
|
@@ -166,47 +168,84 @@ function StandaloneBottomSheet({
|
|
|
166
168
|
useScrollLock(shouldPresent && hasScrim);
|
|
167
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);
|
|
168
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.
|
|
169
174
|
event.preventDefault();
|
|
170
175
|
dismissOnEscape();
|
|
171
176
|
}, [dismissOnEscape]);
|
|
172
177
|
const handleKeyDown = useCallback(event => {
|
|
173
|
-
if (event.key
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
if (event.key !== 'Escape') {
|
|
179
|
+
return;
|
|
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;
|
|
176
190
|
}
|
|
191
|
+
dismissOnEscape();
|
|
177
192
|
}, [dismissOnEscape]);
|
|
178
193
|
const handleClick = useCallback(event => {
|
|
179
194
|
if (hasScrim && event.target === event.currentTarget) {
|
|
180
195
|
dismissOnLightInteraction();
|
|
181
196
|
}
|
|
182
197
|
}, [dismissOnLightInteraction, hasScrim]);
|
|
183
|
-
return /*#__PURE__*/
|
|
198
|
+
return /*#__PURE__*/_jsxs("dialog", {
|
|
184
199
|
...{
|
|
185
200
|
0: {
|
|
186
201
|
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz"
|
|
187
202
|
},
|
|
188
|
-
|
|
203
|
+
8: {
|
|
189
204
|
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq"
|
|
190
205
|
},
|
|
191
|
-
|
|
206
|
+
4: {
|
|
192
207
|
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w"
|
|
193
208
|
},
|
|
194
|
-
|
|
209
|
+
12: {
|
|
195
210
|
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w"
|
|
196
211
|
},
|
|
212
|
+
2: {
|
|
213
|
+
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x1cz9k3x"
|
|
214
|
+
},
|
|
215
|
+
10: {
|
|
216
|
+
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x1cz9k3x"
|
|
217
|
+
},
|
|
218
|
+
6: {
|
|
219
|
+
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x142juwg x1viac0w x1cz9k3x"
|
|
220
|
+
},
|
|
221
|
+
14: {
|
|
222
|
+
className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x142juwg x1viac0w x1cz9k3x"
|
|
223
|
+
},
|
|
197
224
|
1: {
|
|
198
225
|
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x47corl xfo81ep xh8yej3 x5yr21d"
|
|
199
226
|
},
|
|
200
|
-
|
|
227
|
+
9: {
|
|
201
228
|
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x47corl xfo81ep xh8yej3 x5yr21d"
|
|
202
229
|
},
|
|
203
|
-
|
|
230
|
+
5: {
|
|
204
231
|
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w x47corl xfo81ep xh8yej3 x5yr21d"
|
|
205
232
|
},
|
|
206
|
-
|
|
233
|
+
13: {
|
|
207
234
|
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w x47corl xfo81ep xh8yej3 x5yr21d"
|
|
235
|
+
},
|
|
236
|
+
3: {
|
|
237
|
+
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d"
|
|
238
|
+
},
|
|
239
|
+
11: {
|
|
240
|
+
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d"
|
|
241
|
+
},
|
|
242
|
+
7: {
|
|
243
|
+
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x142juwg x1viac0w x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d"
|
|
244
|
+
},
|
|
245
|
+
15: {
|
|
246
|
+
className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x142juwg x1viac0w x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d"
|
|
208
247
|
}
|
|
209
|
-
}[!!shouldPresent << 2 | !!hasScrim << 1 | !!!hasScrim << 0],
|
|
248
|
+
}[!!shouldPresent << 3 | !!hasScrim << 2 | !!(hasScrim && !isOpen && isPresented) << 1 | !!!hasScrim << 0],
|
|
210
249
|
ref: dialogRef,
|
|
211
250
|
"aria-label": label,
|
|
212
251
|
"aria-hidden": !isOpen && isPresented ? 'true' : undefined,
|
|
@@ -216,7 +255,7 @@ function StandaloneBottomSheet({
|
|
|
216
255
|
onCancel: handleCancel,
|
|
217
256
|
onClick: handleClick,
|
|
218
257
|
onKeyDown: handleKeyDown,
|
|
219
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
258
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
220
259
|
...{
|
|
221
260
|
className: "x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl"
|
|
222
261
|
},
|
|
@@ -235,7 +274,7 @@ function StandaloneBottomSheet({
|
|
|
235
274
|
onMotionComplete: handleMotionComplete,
|
|
236
275
|
children: children
|
|
237
276
|
})
|
|
238
|
-
})
|
|
277
|
+
}), hasScrim ? null : /*#__PURE__*/_jsx(BottomSheetEdgeTint, {})]
|
|
239
278
|
});
|
|
240
279
|
}
|
|
241
280
|
function SwitcherBottomSheetItem({
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colours the iOS Safari toolbar strip below a non-modal sheet. Renders
|
|
3
|
+
* nothing visible; see the file header for why it exists.
|
|
4
|
+
*/
|
|
5
|
+
export declare function BottomSheetEdgeTint(): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=BottomSheetEdgeTint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetEdgeTint.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetEdgeTint.tsx"],"names":[],"mappings":"AAqEA;;;GAGG;AACH,wBAAgB,mBAAmB,gCAQlC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file BottomSheetEdgeTint.tsx
|
|
7
|
+
* @input Uses StyleX and core color tokens
|
|
8
|
+
* @output Exports BottomSheetEdgeTint, an internal decorative element
|
|
9
|
+
* @position Private helper rendered inside a non-modal BottomSheet dialog
|
|
10
|
+
*
|
|
11
|
+
* iOS 26 Safari dropped `<meta name="theme-color">` and instead derives the
|
|
12
|
+
* colour it paints behind its translucent toolbars by sampling the page: it
|
|
13
|
+
* hit tests a point just inside each viewport edge, walks up to the nearest
|
|
14
|
+
* `fixed`/`sticky` ancestor, and extends that element's declared
|
|
15
|
+
* `background-color` into the browser chrome.
|
|
16
|
+
*
|
|
17
|
+
* A modal sheet is served by that heuristic already — WebKit has a dedicated
|
|
18
|
+
* branch for a dialog's `::backdrop`. A non-modal sheet is not: the nearest
|
|
19
|
+
* fixed ancestor of the panel is the sheet's own full-viewport `<dialog>`,
|
|
20
|
+
* which is transparent and viewport-sized, and WebKit answers a viewport-sized
|
|
21
|
+
* candidate by *keeping the colour it already had* — the host page's. The page
|
|
22
|
+
* then shows through behind the address bar while the sheet covers the screen
|
|
23
|
+
* above it.
|
|
24
|
+
*
|
|
25
|
+
* This element gives the heuristic something unambiguous to sample: fixed,
|
|
26
|
+
* full width, flush with the bottom edge, taller than WebKit's 10px minimum
|
|
27
|
+
* for reading a declared colour, and painted in the sheet's own surface
|
|
28
|
+
* colour. It is masked out so it never renders for the user; Safari reads the
|
|
29
|
+
* computed style, not the painted pixels.
|
|
30
|
+
*
|
|
31
|
+
* Everywhere else it is inert decoration.
|
|
32
|
+
*
|
|
33
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
34
|
+
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
35
|
+
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.tsx
|
|
36
|
+
* - /packages/core/src/BottomSheet/BottomSheetEdgeTint.test.tsx
|
|
37
|
+
*/
|
|
38
|
+
import * as stylex from '@stylexjs/stylex';
|
|
39
|
+
import "../theme/tokens.stylex.js";
|
|
40
|
+
import { colorVars } from "../theme/tokens.stylex.js";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* WebKit ignores the declared `background-color` of a sampled box thinner than
|
|
44
|
+
* 10px and falls back to sampling painted pixels, which a masked element has
|
|
45
|
+
* none of. 12px clears that floor with room to spare and is still far below
|
|
46
|
+
* the ~40px of chrome it colours.
|
|
47
|
+
*/
|
|
48
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
+
const SAMPLE_HEIGHT_PX = 12;
|
|
50
|
+
/**
|
|
51
|
+
* Colours the iOS Safari toolbar strip below a non-modal sheet. Renders
|
|
52
|
+
* nothing visible; see the file header for why it exists.
|
|
53
|
+
*/
|
|
54
|
+
export function BottomSheetEdgeTint() {
|
|
55
|
+
return /*#__PURE__*/_jsx("div", {
|
|
56
|
+
...{
|
|
57
|
+
className: "xixxii4 x17y0mx6 x1ey2m1c x1kpxq89 x10xzikg xhtitgo x47corl x1cb67k9 xt2iwb0"
|
|
58
|
+
},
|
|
59
|
+
"data-sheet-edge-tint": "",
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAc5C,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAIvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAC5D,YAAY,EAAC,oBAAoB,EAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;G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AAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC7D;AA+GD,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,qBAA4B,EAC5B,kBAA0B,EAC1B,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,qBAAqB,+BAyQvB;yBA3Re,gBAAgB"}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* SYNC: When modified, update these files to stay in sync:
|
|
20
20
|
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
21
|
+
* - /packages/core/src/BottomSheet/BottomSheetEdgeTint.tsx
|
|
21
22
|
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.doc.mjs
|
|
22
23
|
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx
|
|
23
24
|
* - /packages/core/src/BottomSheet/index.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetSwitcher.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetSwitcher.tsx"],"names":[],"mappings":"AAIA
|
|
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"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* SYNC: When modified, update these files to stay in sync:
|
|
24
24
|
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
25
|
+
* - /packages/core/src/BottomSheet/BottomSheetEdgeTint.tsx
|
|
25
26
|
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.doc.mjs
|
|
26
27
|
* - /packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx
|
|
27
28
|
* - /packages/core/src/BottomSheet/index.ts
|
|
@@ -33,9 +34,11 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
33
34
|
import "../theme/tokens.stylex.js";
|
|
34
35
|
import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
35
36
|
import { hasActiveFocusTrapEscape, isImeKeyEvent, useFocusTrap, useScrollLock } from "../hooks/index.js";
|
|
36
|
-
import { composeEventHandlers, mergeProps
|
|
37
|
+
import { composeEventHandlers, mergeProps } from "../utils/index.js";
|
|
38
|
+
import { BottomSheetEdgeTint } from "./BottomSheetEdgeTint.js";
|
|
37
39
|
import { BottomSheetSwitcherContext } from "./BottomSheetSwitcherContext.js";
|
|
38
|
-
import {
|
|
40
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
41
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
42
|
const styles = {
|
|
40
43
|
dialog: {
|
|
41
44
|
kVAEAm: "xixxii4",
|
|
@@ -72,6 +75,10 @@ const styles = {
|
|
|
72
75
|
kwHxkk: "x142juwg",
|
|
73
76
|
k4oj2o: "x1viac0w",
|
|
74
77
|
$$css: true
|
|
78
|
+
},
|
|
79
|
+
scrimClosing: {
|
|
80
|
+
kb4ib: "x1cz9k3x",
|
|
81
|
+
$$css: true
|
|
75
82
|
}
|
|
76
83
|
};
|
|
77
84
|
const IDLE_TRANSITION = {
|
|
@@ -386,15 +393,15 @@ export function BottomSheetSwitcher({
|
|
|
386
393
|
dismissOnLightInteraction();
|
|
387
394
|
}
|
|
388
395
|
}, [dismissOnLightInteraction, hasScrim]);
|
|
389
|
-
const dialogStyleProps = stylex.props(styles.dialog, isFlowVisible && styles.dialogOpen, hasScrim && styles.scrim, !hasScrim && styles.dialogNonModal, xstyle);
|
|
396
|
+
const dialogStyleProps = stylex.props(styles.dialog, isFlowVisible && styles.dialogOpen, hasScrim && styles.scrim, hasScrim && isFlowVisible && activeSheet == null && styles.scrimClosing, !hasScrim && styles.dialogNonModal, xstyle);
|
|
390
397
|
const dialogPresentationProps = mergeProps(dialogStyleProps, className, style);
|
|
391
398
|
const ariaLabel = props['aria-label'] ?? (props['aria-labelledby'] == null ? activeLabel : undefined);
|
|
392
399
|
return /*#__PURE__*/_jsx(BottomSheetSwitcherContext, {
|
|
393
400
|
value: contextValue,
|
|
394
|
-
children: /*#__PURE__*/
|
|
401
|
+
children: /*#__PURE__*/_jsxs("dialog", {
|
|
395
402
|
...props,
|
|
396
403
|
...dialogPresentationProps,
|
|
397
|
-
ref:
|
|
404
|
+
ref: useMergedRefs(ref, dialogRef, containerRef),
|
|
398
405
|
"aria-label": ariaLabel,
|
|
399
406
|
"aria-modal": isModal ? 'true' : undefined,
|
|
400
407
|
onCancel: composeEventHandlers(onCancel, handleCancel),
|
|
@@ -403,7 +410,7 @@ export function BottomSheetSwitcher({
|
|
|
403
410
|
...(activeSheetPurpose === 'required' ? {
|
|
404
411
|
role: 'alertdialog'
|
|
405
412
|
} : undefined),
|
|
406
|
-
children: children
|
|
413
|
+
children: [children, hasScrim ? null : /*#__PURE__*/_jsx(BottomSheetEdgeTint, {})]
|
|
407
414
|
})
|
|
408
415
|
});
|
|
409
416
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,OAAO,IAAI,YAAY,EAC7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}
|
|
@@ -95,6 +95,20 @@ const OVERSCROLL_MAX = 48;
|
|
|
95
95
|
// the scroll, large enough that a swipe merely coming to rest on the last pixel
|
|
96
96
|
// doesn't start a drag on jitter.
|
|
97
97
|
const CONTENT_END_HANDOFF_SLOP = 4;
|
|
98
|
+
// How far a finger resting on the body must travel before the pull becomes a
|
|
99
|
+
// sheet drag rather than a tap.
|
|
100
|
+
//
|
|
101
|
+
// This used to be zero: any downward movement promoted. A finger is never
|
|
102
|
+
// still, so tapping a control inside the sheet drifted a pixel or two and
|
|
103
|
+
// started a drag -- which suppresses the panel's transition, correctly, for as
|
|
104
|
+
// long as the sheet is tracking the finger. The close that the tap triggered
|
|
105
|
+
// then landed inside that window and cut instead of animating. A deliberate
|
|
106
|
+
// pull was unaffected; only a tap, and only a tap inside the sheet, since the
|
|
107
|
+
// scrim is outside the body and arms nothing.
|
|
108
|
+
//
|
|
109
|
+
// 8px is the conventional tap slop, a shade over iOS's own recognizer, and
|
|
110
|
+
// well under what a real pull covers in its first frames.
|
|
111
|
+
const DRAG_PROMOTION_SLOP = 8;
|
|
98
112
|
|
|
99
113
|
// Short haptic tick on detent settle where supported. iOS Safari doesn't
|
|
100
114
|
// expose navigator.vibrate, so this is a no-op there; skipped under
|
|
@@ -754,7 +768,7 @@ export function useSheetGestures({
|
|
|
754
768
|
return;
|
|
755
769
|
}
|
|
756
770
|
const delta = event.clientY - armed.startCoord;
|
|
757
|
-
if (delta >
|
|
771
|
+
if (delta > DRAG_PROMOTION_SLOP && armed.scroller.scrollTop <= 0) {
|
|
758
772
|
// Downward pull at the top: promote to a sheet drag, anchored at the
|
|
759
773
|
// original pointer-down position so the pull distance carries over.
|
|
760
774
|
armedBodyRef.current = null;
|
|
@@ -883,8 +897,8 @@ export function useSheetGestures({
|
|
|
883
897
|
// no longer scroll that way: at the top, a downward pull (delta > 0)
|
|
884
898
|
// collapses; at the bottom, an upward pull (delta < 0) expands. The
|
|
885
899
|
// opposite direction is a real scroll, so disarm and let it through.
|
|
886
|
-
const pullDownAtTop = armed.top && delta >
|
|
887
|
-
const pullUpAtBottom = armed.bottom && delta <
|
|
900
|
+
const pullDownAtTop = armed.top && delta > DRAG_PROMOTION_SLOP && atTop(scroller);
|
|
901
|
+
const pullUpAtBottom = armed.bottom && delta < -DRAG_PROMOTION_SLOP && atBottom(scroller);
|
|
888
902
|
if (pullDownAtTop || pullUpAtBottom) {
|
|
889
903
|
event.preventDefault();
|
|
890
904
|
touchDragRef.current = null;
|
|
@@ -993,11 +1007,15 @@ export function useSheetGestures({
|
|
|
993
1007
|
const contentProps = useMemo(() => ({
|
|
994
1008
|
style: {
|
|
995
1009
|
transform: activeOffset !== 0 ? `translateY(${activeOffset}px)` : undefined,
|
|
996
|
-
|
|
1010
|
+
// Gated on the sheet being up: suppression must not outlive the sheet
|
|
1011
|
+
// it was suppressing for. The host swaps the panel to its closing
|
|
1012
|
+
// state in whatever frame the dismissal lands, and a stale `none`
|
|
1013
|
+
// would apply to that transform too, cutting the exit.
|
|
1014
|
+
transition: isOpen && (isDragging || isScrollAreaReconciling || reducedMotion) ? 'none' : undefined,
|
|
997
1015
|
touchAction: 'none',
|
|
998
1016
|
overscrollBehavior: 'contain'
|
|
999
1017
|
}
|
|
1000
|
-
}), [activeOffset, isDragging, isScrollAreaReconciling, reducedMotion]);
|
|
1018
|
+
}), [activeOffset, isDragging, isOpen, isScrollAreaReconciling, reducedMotion]);
|
|
1001
1019
|
const handleProps = useMemo(() => ({
|
|
1002
1020
|
style: {
|
|
1003
1021
|
touchAction: 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcr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