@astryxdesign/core 0.7.7-canary.f4edef8 → 0.7.7-canary.f88f5dc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +79 -9
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +23 -4
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +5 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +7 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +47 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +13 -2
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +7 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +10 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +13 -27
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +22 -41
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +11 -34
- package/dist/Drawer/Drawer.js +0 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +5 -1
- package/dist/Field/Field.js +2 -2
- package/dist/Field/PanelSearchInput.d.ts +9 -1
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +3 -1
- package/dist/HoverCard/HoverCard.d.ts +4 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +17 -31
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/InfoTip/InfoTip.d.ts +2 -2
- package/dist/InfoTip/InfoTip.js +4 -4
- package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +25 -20
- package/dist/Layer/usePressPin.d.ts +20 -10
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +66 -18
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +18 -0
- package/dist/MobileNav/MobileNav.js +0 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +2 -4
- package/dist/Outline/Outline.d.ts +2 -4
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -52
- package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromMarkdown.js +1 -0
- package/dist/Outline/useScrollSpy.js +3 -3
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +539 -278
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +8 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +118 -260
- package/dist/Resizable/resizeGesture.d.ts +91 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -0
- package/dist/Resizable/resizeGesture.js +251 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -9
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +60 -58
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +94 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +12 -4
- package/dist/Token/TokenNamingContext.d.ts +14 -0
- package/dist/Token/TokenNamingContext.d.ts.map +1 -0
- package/dist/Token/TokenNamingContext.js +23 -0
- package/dist/Tokenizer/Tokenizer.d.ts +46 -59
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +35 -58
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +5 -3
- package/dist/Tooltip/Tooltip.d.ts +25 -30
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +24 -5
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +45 -28
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +52 -59
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +4 -7
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -7
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +22 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +143 -13
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- 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/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts +11 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
- package/dist/hooks/useHighlightedOptionScroll.js +103 -5
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useLongPress.d.ts +6 -2
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +95 -15
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -2
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +31 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +31 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/SheetConfirmation.d.ts +11 -0
- package/dist/internal/SheetConfirmation.d.ts.map +1 -0
- package/dist/internal/SheetConfirmation.js +92 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/internal/sheetDraft.d.ts +35 -0
- package/dist/internal/sheetDraft.d.ts.map +1 -0
- package/dist/internal/sheetDraft.js +65 -0
- package/dist/internal/touch-sheet.d.ts +21 -0
- package/dist/internal/touch-sheet.d.ts.map +1 -0
- package/dist/internal/touch-sheet.js +19 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
- package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/reducedMotion.d.ts +24 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +78 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/utils/clickGuard.d.ts +8 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +24 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/focusReturn.d.ts +15 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +28 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +19 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +124 -0
- package/locales/pseudo.json +93 -0
- package/package.json +13 -8
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
- package/src/BottomSheet/BottomSheet.tsx +95 -10
- package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
- package/src/BottomSheet/bottomSheetStack.ts +8 -4
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Breadcrumbs/BreadcrumbItem.tsx +13 -3
- package/src/Button/Button.tsx +63 -5
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +36 -9
- package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
- package/src/CheckboxList/CheckboxList.tsx +6 -0
- package/src/CheckboxList/CheckboxListContext.tsx +6 -0
- package/src/CheckboxList/CheckboxListItem.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +30 -32
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +29 -35
- package/src/Drawer/Drawer.tsx +1 -1
- package/src/Drawer/useDrawerDialogPresence.ts +5 -1
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.doc.mjs +4 -2
- package/src/HoverCard/HoverCard.tsx +35 -4
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +46 -52
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/InfoTip/InfoTip.doc.mjs +3 -3
- package/src/InfoTip/InfoTip.tsx +5 -5
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/usePressPin.ts +86 -26
- package/src/Lightbox/Lightbox.tsx +18 -0
- package/src/MobileNav/MobileNav.tsx +1 -1
- package/src/MultiSelector/hooks.ts +2 -4
- package/src/Outline/Outline.doc.mjs +177 -51
- package/src/Outline/Outline.tsx +5 -57
- package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
- package/src/Outline/useOutlineFromMarkdown.ts +1 -0
- package/src/Outline/useScrollSpy.ts +3 -3
- package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
- package/src/PowerSearch/PowerSearch.tsx +766 -299
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioList.tsx +7 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/ResizeHandle.tsx +133 -328
- package/src/Resizable/resizeGesture.ts +368 -0
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/SideNav/SideNavItem.tsx +3 -7
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- package/src/Token/Token.tsx +13 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
- package/src/Tokenizer/Tokenizer.tsx +81 -86
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +5 -3
- package/src/Tooltip/Tooltip.doc.mjs +123 -54
- package/src/Tooltip/Tooltip.tsx +36 -39
- package/src/Tooltip/index.ts +0 -1
- package/src/Tooltip/useTooltip.doc.mjs +171 -33
- package/src/Tooltip/useTooltip.tsx +98 -86
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +178 -14
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useHighlightedOptionScroll.ts +113 -9
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +136 -15
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
- package/src/i18n/generated-locales/en.generated.ts +42 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +43 -0
- package/src/index.ts +13 -0
- package/src/internal/SheetConfirmation.tsx +101 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/sheetDraft.ts +80 -0
- package/src/internal/touch-sheet.ts +21 -0
- package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
- package/src/motion/README.md +8 -5
- package/src/motion/animator.ts +61 -29
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/utils/clickGuard.ts +37 -1
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +19 -6
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/internal/tokenizer-presentation.d.ts +0 -21
- package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
- package/dist/internal/tokenizer-presentation.js +0 -21
- package/src/internal/tokenizer-presentation.ts +0 -25
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file AlertDialog.tsx
|
|
3
|
-
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
|
|
3
|
+
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
4
|
+
* action-group tracking (hooks/useActionGroupTracking) and the press-group
|
|
5
|
+
* marker (privateAttributes/pressGroupItem.stylex)
|
|
4
6
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
5
7
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
6
8
|
*
|
|
@@ -8,6 +10,7 @@
|
|
|
8
10
|
* - /packages/core/src/AlertDialog/AlertDialog.doc.mjs (props table, features, examples)
|
|
9
11
|
* - /packages/core/src/AlertDialog/AlertDialog.test.tsx (tests for new/changed behavior)
|
|
10
12
|
* - /packages/core/src/AlertDialog/index.ts (exports if types change)
|
|
13
|
+
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.interaction.browser.spec.ts (touch tracking)
|
|
11
14
|
* - /apps/storybook/stories/AlertDialog.stories.tsx (storybook stories)
|
|
12
15
|
* - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
|
|
13
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAmC,MAAM,OAAO,CAAC;AAUxD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAkC5C,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACpE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;IAExB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,WAAW,EACX,WAAW,EAAE,oBAAoB,EACjC,WAAW,EACX,aAA6B,EAC7B,eAAe,EACf,QAAQ,EACR,KAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBAiHlB;yBAnIe,WAAW"}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file AlertDialog.tsx
|
|
7
|
-
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
|
|
7
|
+
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
8
|
+
* action-group tracking (hooks/useActionGroupTracking) and the press-group
|
|
9
|
+
* marker (privateAttributes/pressGroupItem.stylex)
|
|
8
10
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
9
11
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
10
12
|
*
|
|
@@ -12,10 +14,11 @@
|
|
|
12
14
|
* - /packages/core/src/AlertDialog/AlertDialog.doc.mjs (props table, features, examples)
|
|
13
15
|
* - /packages/core/src/AlertDialog/AlertDialog.test.tsx (tests for new/changed behavior)
|
|
14
16
|
* - /packages/core/src/AlertDialog/index.ts (exports if types change)
|
|
17
|
+
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.interaction.browser.spec.ts (touch tracking)
|
|
15
18
|
* - /apps/storybook/stories/AlertDialog.stories.tsx (storybook stories)
|
|
16
19
|
* - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
|
|
17
20
|
*/
|
|
18
|
-
import React, { useId, useCallback } from 'react';
|
|
21
|
+
import React, { useId, useCallback, useRef } from 'react';
|
|
19
22
|
import * as stylex from '@stylexjs/stylex';
|
|
20
23
|
import { Dialog } from "../Dialog/Dialog.js";
|
|
21
24
|
import { Layout } from "../Layout/Layout.js";
|
|
@@ -30,10 +33,18 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
30
33
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
31
34
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
32
35
|
import english from "../i18n/generated-english/AlertDialog/AlertDialog.generated.js";
|
|
36
|
+
import { useActionGroupTracking } from "../hooks/useActionGroupTracking.js";
|
|
37
|
+
import { PressGroupContext } from "../hooks/pressGroupContext.js";
|
|
38
|
+
import { alertController } from "../motion/uikit/alert.js";
|
|
39
|
+
import { pressGroupItemProps } from "../privateAttributes/pressGroupItem.stylex.js";
|
|
33
40
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
41
|
registerEnglishFallback(english);
|
|
35
42
|
const SMALL_SCREEN_QUERY = '(max-width: 640px)';
|
|
36
43
|
const styles = {
|
|
44
|
+
trackingRow: {
|
|
45
|
+
kFalU9: "x1j4r261",
|
|
46
|
+
$$css: true
|
|
47
|
+
},
|
|
37
48
|
action: {
|
|
38
49
|
ks0D6T: "x193iq5w",
|
|
39
50
|
k7Eaqz: "xeuugli",
|
|
@@ -100,17 +111,30 @@ export function AlertDialog({
|
|
|
100
111
|
const handleCancel = useCallback(() => {
|
|
101
112
|
onOpenChange(false);
|
|
102
113
|
}, [onOpenChange]);
|
|
114
|
+
|
|
115
|
+
// Each action carries the press-group marker from its first render, so the
|
|
116
|
+
// tracker is its only painter.
|
|
117
|
+
const actionsRef = useRef(null);
|
|
118
|
+
const isTracking = isOpen && isInline !== true;
|
|
119
|
+
useActionGroupTracking(actionsRef, {
|
|
120
|
+
// The actions row holds only the two buttons.
|
|
121
|
+
itemSelector: 'button',
|
|
122
|
+
highlightOnsetMs: alertController.actions.highlightOnsetMs,
|
|
123
|
+
highlightExpansion: alertController.actions.highlightExpansion,
|
|
124
|
+
isEnabled: isTracking
|
|
125
|
+
});
|
|
126
|
+
const actionTrackingProps = isTracking ? pressGroupItemProps : undefined;
|
|
103
127
|
const buttonActionStyle = [styles.action, isSmallScreen && styles.stackedAction];
|
|
104
128
|
const cancelButton = /*#__PURE__*/_jsx(Button, {
|
|
105
129
|
variant: "ghost",
|
|
106
130
|
label: cancelLabel,
|
|
107
131
|
onClick: handleCancel,
|
|
108
|
-
xstyle: buttonActionStyle
|
|
132
|
+
xstyle: buttonActionStyle,
|
|
133
|
+
...actionTrackingProps,
|
|
109
134
|
// Dialog focuses [data-autofocus] itself after showModal(), because
|
|
110
135
|
// React's autoFocus runs during commit while the dialog is invisible.
|
|
111
136
|
// Cancel is least destructive, so it remains the autofocus target even
|
|
112
137
|
// when small-screen visual order places the destructive action above it.
|
|
113
|
-
,
|
|
114
138
|
"data-autofocus": true
|
|
115
139
|
}, "cancel");
|
|
116
140
|
const actionButton = /*#__PURE__*/_jsx(Button, {
|
|
@@ -118,7 +142,8 @@ export function AlertDialog({
|
|
|
118
142
|
label: actionLabel,
|
|
119
143
|
onClick: onAction,
|
|
120
144
|
isLoading: isActionLoading,
|
|
121
|
-
xstyle: buttonActionStyle
|
|
145
|
+
xstyle: buttonActionStyle,
|
|
146
|
+
...actionTrackingProps
|
|
122
147
|
}, "action");
|
|
123
148
|
return /*#__PURE__*/_jsx(Dialog, {
|
|
124
149
|
...rest,
|
|
@@ -158,11 +183,16 @@ export function AlertDialog({
|
|
|
158
183
|
}),
|
|
159
184
|
footer: /*#__PURE__*/_jsx(LayoutFooter, {
|
|
160
185
|
children: /*#__PURE__*/_jsx(Stack, {
|
|
186
|
+
ref: actionsRef,
|
|
187
|
+
xstyle: isTracking && styles.trackingRow,
|
|
161
188
|
direction: isSmallScreen ? 'vertical' : 'horizontal',
|
|
162
189
|
gap: 2,
|
|
163
190
|
hAlign: isSmallScreen ? 'stretch' : 'end',
|
|
164
191
|
wrap: isSmallScreen ? 'nowrap' : 'wrap',
|
|
165
|
-
children:
|
|
192
|
+
children: /*#__PURE__*/_jsx(PressGroupContext, {
|
|
193
|
+
value: isTracking,
|
|
194
|
+
children: isSmallScreen ? [actionButton, cancelButton] : [cancelButton, actionButton]
|
|
195
|
+
})
|
|
166
196
|
})
|
|
167
197
|
})
|
|
168
198
|
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a function that wraps a row's click handler. While
|
|
3
|
+
* `isInMobileDrawer` is true, the wrapped handler calls the row's handler and
|
|
4
|
+
* then closes the AppShell mobile drawer. Otherwise the row's handler comes
|
|
5
|
+
* back unchanged. Every drawer row closes the drawer through this one rule.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCloseMobileDrawerOnActivate(isInMobileDrawer: boolean): <Args extends unknown[]>(onClick: ((...args: Args) => void) | undefined) => ((...args: Args) => void) | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the caller renders inside the AppShell mobile drawer: in TopNav
|
|
10
|
+
* content or SideNav content shown there.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useIsInAppShellMobileDrawer(): boolean;
|
|
13
|
+
//# sourceMappingURL=useCloseMobileDrawerOnActivate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseMobileDrawerOnActivate.d.ts","sourceRoot":"","sources":["../../src/AppShell/useCloseMobileDrawerOnActivate.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,OAAO,GACxB,CAAC,IAAI,SAAS,OAAO,EAAE,EACxB,OAAO,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,KAC3C,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAWzC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAQrD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useCloseMobileDrawerOnActivate.ts
|
|
7
|
+
* @input AppShellMobileContext, TopNav and SideNav render modes
|
|
8
|
+
* @output useCloseMobileDrawerOnActivate, useIsInAppShellMobileDrawer
|
|
9
|
+
* @position Internal AppShell helper for rows in the mobile drawer. Not
|
|
10
|
+
* exported from the package.
|
|
11
|
+
*/
|
|
12
|
+
import { useAppShellMobile } from "./AppShellMobileContext.js";
|
|
13
|
+
import { useSideNavRenderMode } from "../SideNav/SideNavRenderContext.js";
|
|
14
|
+
import { useTopNavRenderMode } from "../TopNav/TopNavRenderContext.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns a function that wraps a row's click handler. While
|
|
18
|
+
* `isInMobileDrawer` is true, the wrapped handler calls the row's handler and
|
|
19
|
+
* then closes the AppShell mobile drawer. Otherwise the row's handler comes
|
|
20
|
+
* back unchanged. Every drawer row closes the drawer through this one rule.
|
|
21
|
+
*/
|
|
22
|
+
export function useCloseMobileDrawerOnActivate(isInMobileDrawer) {
|
|
23
|
+
const {
|
|
24
|
+
closeMobileNav
|
|
25
|
+
} = useAppShellMobile();
|
|
26
|
+
return onClick => {
|
|
27
|
+
if (!isInMobileDrawer) {
|
|
28
|
+
return onClick;
|
|
29
|
+
}
|
|
30
|
+
return (...args) => {
|
|
31
|
+
onClick?.(...args);
|
|
32
|
+
closeMobileNav();
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Whether the caller renders inside the AppShell mobile drawer: in TopNav
|
|
39
|
+
* content or SideNav content shown there.
|
|
40
|
+
*/
|
|
41
|
+
export function useIsInAppShellMobileDrawer() {
|
|
42
|
+
const topNavRenderMode = useTopNavRenderMode();
|
|
43
|
+
const sideNavRenderMode = useSideNavRenderMode();
|
|
44
|
+
return topNavRenderMode === 'drawer' || sideNavRenderMode === 'drawer' || sideNavRenderMode === 'drawer-content';
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAuBH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAuBH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAwDhD,YAAY,EAAC,iBAAiB,EAAE,oBAAoB,EAA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|
@@ -58,6 +58,7 @@ import { colorVars, durationVars, easeVars, spacingVars } from "../theme/tokens.
|
|
|
58
58
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
59
59
|
import { useScrollLock } from "../hooks/useScrollLock.js";
|
|
60
60
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
61
|
+
import { observeMutations } from "../utils/sharedMutationObserver.js";
|
|
61
62
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
62
63
|
import { LayerDepthProvider } from "../Layer/LayerDepthContext.js";
|
|
63
64
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
@@ -96,9 +97,9 @@ const styles = {
|
|
|
96
97
|
$$css: true
|
|
97
98
|
},
|
|
98
99
|
dialogPanelHost: {
|
|
99
|
-
k1xSpc: "
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
k1xSpc: "x78zum5",
|
|
101
|
+
kjj79g: "xl56j7k",
|
|
102
|
+
kGNEyG: "xuk3077",
|
|
102
103
|
$$css: true
|
|
103
104
|
},
|
|
104
105
|
dialogNonModal: {
|
|
@@ -135,6 +136,10 @@ const styles = {
|
|
|
135
136
|
kb4ib: "x1cz9k3x",
|
|
136
137
|
$$css: true
|
|
137
138
|
},
|
|
139
|
+
exitHoldingFocus: {
|
|
140
|
+
kfzvcC: "x47corl",
|
|
141
|
+
$$css: true
|
|
142
|
+
},
|
|
138
143
|
positioner: {
|
|
139
144
|
kVAEAm: "x10l6tqk",
|
|
140
145
|
kkqhue: "x17y0mx6",
|
|
@@ -176,6 +181,23 @@ function stackPositionerStyles(view) {
|
|
|
176
181
|
}
|
|
177
182
|
|
|
178
183
|
/** The `data-sheet-stack` value for a host: only set while sheets stack. */
|
|
184
|
+
/** Stops a click, from any input, before it reaches its target. */
|
|
185
|
+
function ignoreActivation(event) {
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
event.stopPropagation();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Stops every key except Tab before it reaches the focused control, so no
|
|
192
|
+
* key handler runs and no text changes (a search field's Enter, a typed
|
|
193
|
+
* letter, Backspace, an arrow that reopens a list). Tab still moves focus.
|
|
194
|
+
*/
|
|
195
|
+
function ignoreKeyDuringExit(event) {
|
|
196
|
+
if (event.key !== 'Tab') {
|
|
197
|
+
event.preventDefault();
|
|
198
|
+
event.stopPropagation();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
179
201
|
function stackStateAttribute(view, isOpen) {
|
|
180
202
|
if (!view.isStacked) {
|
|
181
203
|
return undefined;
|
|
@@ -291,10 +313,14 @@ function StandaloneBottomSheet({
|
|
|
291
313
|
// `isOpen` restarts the flag during render, and the layout effect below
|
|
292
314
|
// settles a close.
|
|
293
315
|
const [isCloseSettled, setIsCloseSettled] = useState(false);
|
|
316
|
+
// Whether focus was inside the sheet when it closed. Such a sheet stays out
|
|
317
|
+
// of `inert` and `aria-hidden` until its exit ends and focus has left.
|
|
318
|
+
const [isExitFocusHeld, setIsExitFocusHeld] = useState(false);
|
|
294
319
|
const [settledIsOpen, setSettledIsOpen] = useState(isOpen);
|
|
295
320
|
if (settledIsOpen !== isOpen) {
|
|
296
321
|
setSettledIsOpen(isOpen);
|
|
297
322
|
setIsCloseSettled(false);
|
|
323
|
+
setIsExitFocusHeld(false);
|
|
298
324
|
}
|
|
299
325
|
const panelState = isOpen ? {
|
|
300
326
|
kind: 'open',
|
|
@@ -408,9 +434,8 @@ function StandaloneBottomSheet({
|
|
|
408
434
|
}, [hasScrim, shouldPresent, writeScrim]);
|
|
409
435
|
useLayoutEffect(() => {
|
|
410
436
|
if (!isOpen) {
|
|
411
|
-
//
|
|
412
|
-
//
|
|
413
|
-
// focus was when the person closed the sheet.
|
|
437
|
+
// Where focus was when the person closed the sheet. The closing sheet
|
|
438
|
+
// is not inert yet, so focus has not moved.
|
|
414
439
|
const dialog = dialogRef.current;
|
|
415
440
|
hadFocusAtCloseRef.current = dialog != null && dialog.contains(dialog.ownerDocument.activeElement);
|
|
416
441
|
}
|
|
@@ -422,6 +447,8 @@ function StandaloneBottomSheet({
|
|
|
422
447
|
// that was not paired as a replace is an exit from here on.
|
|
423
448
|
// eslint-disable-next-line @eslint-react/set-state-in-effect -- settles the close once the registry has answered
|
|
424
449
|
setIsCloseSettled(true);
|
|
450
|
+
// Read with the close, before the sheet can go inert.
|
|
451
|
+
setIsExitFocusHeld(hadFocusAtCloseRef.current);
|
|
425
452
|
}
|
|
426
453
|
}, [hasScrim, isOpen, shouldPresent]);
|
|
427
454
|
|
|
@@ -507,7 +534,36 @@ function StandaloneBottomSheet({
|
|
|
507
534
|
const {
|
|
508
535
|
ref: modalityRef
|
|
509
536
|
} = useInteractionModalityTracking();
|
|
510
|
-
|
|
537
|
+
// Ends the exit hold once focus has left the sheet: moved elsewhere, or
|
|
538
|
+
// dropped to the page because the focused control was removed or disabled.
|
|
539
|
+
// Native listeners, because React drops the `focusout` a browser sends while
|
|
540
|
+
// React removes the focused element, and Firefox and WebKit send no
|
|
541
|
+
// `focusout` for a removed element at all, so a subtree change is read too.
|
|
542
|
+
// Each reads the focus after the event. They attach only while a closing
|
|
543
|
+
// sheet holds focus, so a closed or open sheet observes nothing.
|
|
544
|
+
const isWatchingExitFocus = !isOpen && isPresented && !isReplaced && isExitFocusHeld;
|
|
545
|
+
const exitFocusRef = useCallback(dialog => {
|
|
546
|
+
if (dialog == null || !isWatchingExitFocus) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
const releaseIfFocusLeft = () => {
|
|
550
|
+
if (!dialog.contains(dialog.ownerDocument.activeElement)) {
|
|
551
|
+
setIsExitFocusHeld(false);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
const onFocusOut = () => queueMicrotask(releaseIfFocusLeft);
|
|
555
|
+
dialog.addEventListener('focusout', onFocusOut);
|
|
556
|
+
const unobserve = observeMutations(dialog, {
|
|
557
|
+
childList: true,
|
|
558
|
+
subtree: true,
|
|
559
|
+
attributeFilter: ['disabled', 'hidden', 'inert']
|
|
560
|
+
}, releaseIfFocusLeft);
|
|
561
|
+
return () => {
|
|
562
|
+
dialog.removeEventListener('focusout', onFocusOut);
|
|
563
|
+
unobserve();
|
|
564
|
+
};
|
|
565
|
+
}, [isWatchingExitFocus]);
|
|
566
|
+
const dialogComposedRef = useMergedRefs(dialogRef, modalityRef, exitFocusRef);
|
|
511
567
|
useScrollLock(shouldPresent && hasScrim);
|
|
512
568
|
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);
|
|
513
569
|
|
|
@@ -563,13 +619,21 @@ function StandaloneBottomSheet({
|
|
|
563
619
|
// that contains no presented sheet is marked inert and hidden as well, so
|
|
564
620
|
// the state is explicit; one that does contain the top sheet is left alone,
|
|
565
621
|
// because inert on it would reach the top sheet too.
|
|
566
|
-
|
|
622
|
+
// A sheet that closes with focus inside it is neither inert nor hidden
|
|
623
|
+
// while that focus stays: `inert` would drop the focus to the page, and
|
|
624
|
+
// `aria-hidden` would hide the focused control. When the exit ends, the
|
|
625
|
+
// dialog closes and focus returns in the same task. When focus leaves the
|
|
626
|
+
// sheet first (into a sheet opened above it, for example), the sheet goes
|
|
627
|
+
// inert at once. Until the close settles, no closing sheet is inert, so the
|
|
628
|
+
// first commit of a close never hides focus.
|
|
629
|
+
const isExitHoldingFocus = isExiting && !isReplaced && (!isCloseSettled || isExitFocusHeld);
|
|
630
|
+
const isInert = isExiting && !isExitHoldingFocus || stackView.isBlocked;
|
|
567
631
|
return /*#__PURE__*/_jsxs("dialog", {
|
|
568
632
|
...stylex.props(styles.dialog, shouldPresent && styles.dialogOpen, shouldPresent && styles.dialogPanelHost,
|
|
569
633
|
// The dialog is the panel's positioner, so the stack's recede
|
|
570
634
|
// transforms the dialog: panel, grabber and all shrink and lift as
|
|
571
635
|
// one. The backdrop is not a descendant and stays put.
|
|
572
|
-
...stackPositionerStyles(stackView), hasScrim && styles.scrim, hasScrim && isEntrySettled && styles.scrimSettled, hasScrim && isExiting && styles.scrimClosing, !hasScrim && styles.dialogNonModal),
|
|
636
|
+
...stackPositionerStyles(stackView), hasScrim && styles.scrim, hasScrim && isEntrySettled && styles.scrimSettled, hasScrim && isExiting && styles.scrimClosing, isExitHoldingFocus && styles.exitHoldingFocus, !hasScrim && styles.dialogNonModal),
|
|
573
637
|
ref: dialogComposedRef
|
|
574
638
|
// A non-modal sheet is hosted in the top layer as a manual popover
|
|
575
639
|
// (no light dismiss, no backdrop), so sheets order by presentation
|
|
@@ -586,6 +650,12 @@ function StandaloneBottomSheet({
|
|
|
586
650
|
"data-sheet-stack": hasScrim ? stackStateAttribute(stackView, isOpen) : undefined,
|
|
587
651
|
"data-sheet-stack-depth": hasScrim && stackView.depth > 0 ? stackView.depth : undefined,
|
|
588
652
|
onCancel: handleCancel
|
|
653
|
+
// A closing sheet that keeps focus takes no activation during its
|
|
654
|
+
// exit: no click and no key but Tab reaches the control that has focus.
|
|
655
|
+
,
|
|
656
|
+
onClickCapture: isExitHoldingFocus ? ignoreActivation : undefined,
|
|
657
|
+
onKeyDownCapture: isExitHoldingFocus ? ignoreKeyDuringExit : undefined,
|
|
658
|
+
onKeyUpCapture: isExitHoldingFocus ? ignoreKeyDuringExit : undefined
|
|
589
659
|
// Presses inside the sheet do not reach handlers around where it is
|
|
590
660
|
// written. The dialog, not the panel, is the root, as in a switcher.
|
|
591
661
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA+B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,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yZvB;yBAjbe,gBAAgB"}
|
|
@@ -156,7 +156,7 @@ const styles = {
|
|
|
156
156
|
k1xSpc: "xufnvkl",
|
|
157
157
|
kB7OPa: "x9f619",
|
|
158
158
|
kZKoxP: "x5yr21d",
|
|
159
|
-
kAzted: "
|
|
159
|
+
kAzted: "x1lh6h5t",
|
|
160
160
|
$$css: true
|
|
161
161
|
},
|
|
162
162
|
tallKeyboardBody: {
|
|
@@ -204,6 +204,7 @@ function waitForTransition(element, propertyName, complete) {
|
|
|
204
204
|
}
|
|
205
205
|
let done = false;
|
|
206
206
|
let timer = null;
|
|
207
|
+
let backstopMs = 0;
|
|
207
208
|
const finish = () => {
|
|
208
209
|
if (done) {
|
|
209
210
|
return;
|
|
@@ -217,9 +218,21 @@ function waitForTransition(element, propertyName, complete) {
|
|
|
217
218
|
complete();
|
|
218
219
|
};
|
|
219
220
|
const handleTransitionEnd = event => {
|
|
220
|
-
if (event.target
|
|
221
|
-
|
|
221
|
+
if (event.target !== element || event.propertyName !== propertyName) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
// The engine cancels a transition whose end value changes mid-flight. A
|
|
225
|
+
// percentage transform does when the closing frame moves the height by a
|
|
226
|
+
// fraction of a pixel. A replacement runs on from where it was. That one
|
|
227
|
+
// ends the motion, not the cancel.
|
|
228
|
+
if (event.type === 'transitioncancel' && hasRunningTransition(element, propertyName)) {
|
|
229
|
+
if (timer != null) {
|
|
230
|
+
clearTimeout(timer);
|
|
231
|
+
timer = setTimeout(finish, backstopMs);
|
|
232
|
+
}
|
|
233
|
+
return;
|
|
222
234
|
}
|
|
235
|
+
finish();
|
|
223
236
|
};
|
|
224
237
|
element.addEventListener('transitionend', handleTransitionEnd);
|
|
225
238
|
element.addEventListener('transitioncancel', handleTransitionEnd);
|
|
@@ -257,7 +270,8 @@ function waitForTransition(element, propertyName, complete) {
|
|
|
257
270
|
finish();
|
|
258
271
|
return () => {};
|
|
259
272
|
}
|
|
260
|
-
|
|
273
|
+
backstopMs = transitionMs + TRANSITION_BACKSTOP_BUFFER_MS;
|
|
274
|
+
timer = setTimeout(finish, backstopMs);
|
|
261
275
|
return () => {
|
|
262
276
|
if (timer != null) {
|
|
263
277
|
clearTimeout(timer);
|
|
@@ -266,6 +280,11 @@ function waitForTransition(element, propertyName, complete) {
|
|
|
266
280
|
element.removeEventListener('transitioncancel', handleTransitionEnd);
|
|
267
281
|
};
|
|
268
282
|
}
|
|
283
|
+
|
|
284
|
+
// Whether a CSS transition of `propertyName` still runs on `element`.
|
|
285
|
+
function hasRunningTransition(element, propertyName) {
|
|
286
|
+
return (element.getAnimations?.() ?? []).some(animation => animation.transitionProperty === propertyName && (animation.playState === 'running' || animation.playState === 'paused'));
|
|
287
|
+
}
|
|
269
288
|
function parseTransitionTime(value) {
|
|
270
289
|
const normalizedValue = value.trim();
|
|
271
290
|
if (!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(normalizedValue)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomSheetStack.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/bottomSheetStack.ts"],"names":[],"mappings":"AAsDA,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,QAAQ,C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I,CAcxD;AAMD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,GAAG,IAAI,EACzB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,OAAO,GACf,IAAI,CA2CN;AAED,iFAAiF;AACjF,wBAAgB,2BAA2B,CACzC,GAAG,GAAE,QAAmB,EACxB,OAAO,GAAE,OAAc,GACtB,aAAa,CAAC;IACf,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC,CAMD;AAED,sEAAsE;AACtE,wBAAgB,6BAA6B,IAAI,IAAI,CA+BpD;AAED,+FAA+F;AAC/F,eAAO,MAAM,kCAAkC;;;;sBAI3B,MAAM;IAExB,8DAA8D;iCACjC,QAAQ;CACtC,CAAC"}
|
|
@@ -593,10 +593,11 @@ function openModalsOutside(element) {
|
|
|
593
593
|
if (dialog === element || dialog.contains(element)) {
|
|
594
594
|
continue;
|
|
595
595
|
}
|
|
596
|
-
// A modal on its way out
|
|
597
|
-
//
|
|
598
|
-
//
|
|
599
|
-
|
|
596
|
+
// A modal on its way out blocks nothing any more: it is gone for this
|
|
597
|
+
// decision. A closing sheet keeps its dialog modal through the exit
|
|
598
|
+
// animation; it is inert and hidden then, unless focus was inside it at
|
|
599
|
+
// the close, so the registry's own record of the close counts too.
|
|
600
|
+
if (dialog.hasAttribute('inert') || dialog.getAttribute('aria-hidden') === 'true' || state.entries.some(entry => !entry.isOpen && entry.getElement() === dialog)) {
|
|
600
601
|
continue;
|
|
601
602
|
}
|
|
602
603
|
if (isModalDialog(dialog)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IA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AI,CAAC;IAC7C,8HAA8H;IAC9H,YAAY,EAAE,iBAAiB,CAAC;IAChC,gEAAgE;IAChE,WAAW,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,cAAc,EACd,cAAsB,GACvB,EAAE,uBAAuB,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,K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EAAgE;IAChE,WAAW,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,cAAc,EACd,cAAsB,GACvB,EAAE,uBAAuB,GAAG,sBAAsB,CA80ClD"}
|
|
@@ -462,7 +462,9 @@ export function useSheetGestures({
|
|
|
462
462
|
}
|
|
463
463
|
return;
|
|
464
464
|
}
|
|
465
|
-
|
|
465
|
+
// No measure here: reading the height while the sheet mounts forces a
|
|
466
|
+
// layout in the middle of the open. The observer's first report comes
|
|
467
|
+
// after the browser's own layout, before the first paint.
|
|
466
468
|
const ro = new ResizeObserver(entries => {
|
|
467
469
|
const entry = entries[0];
|
|
468
470
|
if (entry) {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @input Uses React use/useRef/useEffect, stylex, theme tokens, BreadcrumbContext,
|
|
4
4
|
* rtlStyles for the contextual default slash, and (for the menu trigger)
|
|
5
5
|
* usePopover + the shared DropdownMenu item API (renderDropdownItems,
|
|
6
|
-
* DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus)
|
|
6
|
+
* DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus), and
|
|
7
|
+
* the AppShell mobile drawer helpers
|
|
7
8
|
* @output Exports BreadcrumbItem component and BreadcrumbItemProps
|
|
8
9
|
* @position Individual breadcrumb item; used inside Breadcrumbs
|
|
9
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAa5C,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAarE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,SAAS,CAAC,aAAa,CAAC,EACxB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC/C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAsID;;;;;;;;;;;;;GAaG;AACH,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,qBAuMrB;yBAtNe,cAAc"}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* @input Uses React use/useRef/useEffect, stylex, theme tokens, BreadcrumbContext,
|
|
8
8
|
* rtlStyles for the contextual default slash, and (for the menu trigger)
|
|
9
9
|
* usePopover + the shared DropdownMenu item API (renderDropdownItems,
|
|
10
|
-
* DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus)
|
|
10
|
+
* DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus), and
|
|
11
|
+
* the AppShell mobile drawer helpers
|
|
11
12
|
* @output Exports BreadcrumbItem component and BreadcrumbItemProps
|
|
12
13
|
* @position Individual breadcrumb item; used inside Breadcrumbs
|
|
13
14
|
*
|
|
@@ -44,6 +45,7 @@ import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
|
44
45
|
import { DropdownMenuContext, DropdownMenuRootOpenContext } from "../DropdownMenu/DropdownMenuContext.js";
|
|
45
46
|
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR, MENU_BOUNDARY_SELECTOR } from "../DropdownMenu/menuItemRoles.js";
|
|
46
47
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
48
|
+
import { useCloseMobileDrawerOnActivate, useIsInAppShellMobileDrawer } from "../AppShell/useCloseMobileDrawerOnActivate.js";
|
|
47
49
|
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
48
50
|
import { isRenderable } from "../utils/isRenderable.js";
|
|
49
51
|
// =============================================================================
|
|
@@ -187,6 +189,8 @@ export function BreadcrumbItem({
|
|
|
187
189
|
// link/button/span in the auto-candidate path). Auto-current detection sets
|
|
188
190
|
// aria-current on this instead of guessing the <li>'s last child.
|
|
189
191
|
const contentRef = useRef(null);
|
|
192
|
+
const closeDrawerAfter = useCloseMobileDrawerOnActivate(useIsInAppShellMobileDrawer());
|
|
193
|
+
const handleActivate = closeDrawerAfter(onClick);
|
|
190
194
|
const isCurrent = isCurrentProp === true;
|
|
191
195
|
const isAutoCandidate = isCurrentProp == null;
|
|
192
196
|
const hasMenu = menu != null;
|
|
@@ -306,13 +310,13 @@ export function BreadcrumbItem({
|
|
|
306
310
|
}) : href != null ? /*#__PURE__*/_jsx(LinkComponent, {
|
|
307
311
|
ref: contentRef,
|
|
308
312
|
href: href,
|
|
309
|
-
onClick:
|
|
313
|
+
onClick: handleActivate,
|
|
310
314
|
...focusOutlineProps.focusVisible(itemStyles.link, isSupporting ? itemStyles.supportingLink : itemStyles.defaultLink),
|
|
311
315
|
children: content
|
|
312
316
|
}) : onClick != null ? /*#__PURE__*/_jsx("button", {
|
|
313
317
|
ref: contentRef,
|
|
314
318
|
type: "button",
|
|
315
|
-
onClick:
|
|
319
|
+
onClick: handleActivate,
|
|
316
320
|
...focusOutlineProps.focusVisible(itemStyles.link, itemStyles.buttonReset, isSupporting ? itemStyles.supportingLink : itemStyles.defaultLink),
|
|
317
321
|
children: content
|
|
318
322
|
}) : /*#__PURE__*/_jsx("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAkC3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAKrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AA0J9C,QAAA,MAAM,UAAU;;;;;;;;;;EAUd,CAAC;AAuDH;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC;AAQjD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;O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