@astryxdesign/core 0.7.7-canary.c0929c8 → 0.7.7-canary.c19ca12
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 +23 -45
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +15 -11
- 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 +63 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -0
- package/dist/InfoTip/InfoTip.js +126 -0
- package/dist/InfoTip/index.d.ts +10 -0
- package/dist/InfoTip/index.d.ts.map +1 -0
- package/dist/InfoTip/index.js +12 -0
- 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/useBackdropPress.d.ts +27 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -0
- package/dist/Layer/useBackdropPress.js +53 -0
- 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 +571 -302
- 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/SegmentedControl.d.ts +3 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +115 -8
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +8 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +96 -67
- package/dist/Selector/optionShape.d.ts +24 -0
- package/dist/Selector/optionShape.d.ts.map +1 -0
- package/dist/Selector/optionShape.js +48 -0
- package/dist/Selector/selectableOptionEntries.d.ts +20 -0
- package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
- package/dist/Selector/selectableOptionEntries.js +38 -0
- package/dist/Selector/utils.d.ts +2 -17
- package/dist/Selector/utils.d.ts.map +1 -1
- package/dist/Selector/utils.js +3 -51
- 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/switchTouch.d.ts +0 -7
- package/dist/Switch/switchTouch.d.ts.map +1 -1
- package/dist/Switch/switchTouch.js +2 -10
- package/dist/Switch/useSwitchTouch.d.ts +2 -11
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +35 -93
- 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 +30 -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 +13 -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 +40 -57
- 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 +3 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
- 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 +96 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +157 -21
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/actionGroupTracker.d.ts +7 -4
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +19 -56
- 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 +112 -11
- 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/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +7 -4
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -2
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
- 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 +33 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -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/roles.d.ts +7 -1
- package/dist/motion/roles.d.ts.map +1 -1
- package/dist/motion/roles.js +20 -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/motion/uikit/index.d.ts +6 -5
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +6 -5
- package/dist/motion/uikit/segmented.d.ts +55 -0
- package/dist/motion/uikit/segmented.d.ts.map +1 -0
- package/dist/motion/uikit/segmented.js +77 -0
- package/dist/motion/uikit/springs.d.ts +0 -18
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +5 -21
- 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/privateAttributes/segmentTitle.stylex.d.ts +5 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
- package/dist/utils/browserClickWait.d.ts +35 -0
- package/dist/utils/browserClickWait.d.ts.map +1 -0
- package/dist/utils/browserClickWait.js +123 -0
- package/dist/utils/clickGuard.d.ts +14 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +46 -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 +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +18 -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 +54 -45
- package/src/Drawer/Drawer.tsx +28 -11
- 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 +192 -0
- package/src/InfoTip/InfoTip.tsx +186 -0
- package/src/InfoTip/index.ts +14 -0
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/useBackdropPress.ts +81 -0
- 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 +798 -324
- 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/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/SegmentedControl.tsx +179 -5
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +12 -1
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
- package/src/Selector/Selector.tsx +136 -89
- package/src/Selector/optionShape.ts +64 -0
- package/src/Selector/selectableOptionEntries.ts +39 -0
- package/src/Selector/utils.ts +9 -68
- package/src/SideNav/SideNavItem.tsx +3 -7
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/switchTouch.ts +2 -10
- package/src/Switch/useSwitchTouch.ts +38 -104
- 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 +57 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- package/src/Token/Token.tsx +15 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
- package/src/Tokenizer/Tokenizer.tsx +89 -85
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- 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 +198 -20
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +7 -1
- package/src/hooks/actionGroupTracker.ts +32 -61
- 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 +123 -15
- 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/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
- 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 +43 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
- package/src/index.ts +14 -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/MEASUREMENTS.md +7 -0
- package/src/motion/README.md +9 -5
- package/src/motion/animator.ts +61 -29
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/roles.ts +20 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +5 -5
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +5 -21
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
- package/src/utils/browserClickWait.ts +133 -0
- package/src/utils/clickGuard.ts +64 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAkC9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,4EAA4E;AAC5E,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,yEAAyE;IACzE,GAAG,CAAC,EAAE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GED
|
@@ -42,6 +42,7 @@ import { LayerContentBoundary } from "../Layer/layerScopedContext.js";
|
|
|
42
42
|
import { layerClickBoundary } from "../Layer/layerClickBoundary.js";
|
|
43
43
|
import { LayerDepthProvider } from "../Layer/LayerDepthContext.js";
|
|
44
44
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
45
|
+
import { useBackdropPress } from "../Layer/useBackdropPress.js";
|
|
45
46
|
import { useModalOutlet } from "../Layer/modalOutlet.js";
|
|
46
47
|
import "../theme/tokens.stylex.js";
|
|
47
48
|
import { colorVars, radiusVars, durationVars, easeVars, shadowVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
@@ -54,15 +55,15 @@ import { DialogContext } from "./DialogContext.js";
|
|
|
54
55
|
import { themeProps } from "../utils/themeProps.js";
|
|
55
56
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
56
57
|
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
57
|
-
import { focusForLastInput,
|
|
58
|
+
import { focusForLastInput, prepareFocusReturnOnRemoval } from "../utils/focusReturn.js";
|
|
58
59
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
59
60
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
61
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
60
62
|
/**
|
|
61
63
|
* Calculate a directional translate offset for dialog entry animation.
|
|
62
64
|
* Returns a normalized vector from the trigger element toward the viewport
|
|
63
65
|
* center, scaled to the given distance.
|
|
64
66
|
*/
|
|
65
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
66
67
|
function getDialogDirection(triggerEl, distance = 16) {
|
|
67
68
|
const rect = triggerEl.getBoundingClientRect();
|
|
68
69
|
// The trigger's own window: its rect is measured in that window's viewport,
|
|
@@ -133,8 +134,9 @@ const styles = {
|
|
|
133
134
|
kVAEAm: "xixxii4",
|
|
134
135
|
kogj98: "x1bpp3o7",
|
|
135
136
|
kmVPX3: "x1717udv",
|
|
136
|
-
kMzoRj: "xc342km",
|
|
137
|
-
ksu8eU: "xng3xce",
|
|
137
|
+
kMzoRj: "xc342km x13rsnn2",
|
|
138
|
+
ksu8eU: "xng3xce xx61lck",
|
|
139
|
+
kVAM5u: "x1w1tqly",
|
|
138
140
|
kWkggS: "x10xzikg",
|
|
139
141
|
"--_dialog-radius": "xvuvksw",
|
|
140
142
|
kaIpWk: "xuacgfc",
|
|
@@ -161,7 +163,6 @@ const styles = {
|
|
|
161
163
|
},
|
|
162
164
|
backdrop: {
|
|
163
165
|
kGyWv1: "xnixb3f",
|
|
164
|
-
kba3nw: "x1abwkk1",
|
|
165
166
|
$$css: true
|
|
166
167
|
},
|
|
167
168
|
fullscreen: {
|
|
@@ -170,6 +171,7 @@ const styles = {
|
|
|
170
171
|
ks0D6T: "xlbgzzq",
|
|
171
172
|
kskxy: "x1wj9ous",
|
|
172
173
|
kaIpWk: "x2u8bby",
|
|
174
|
+
kMzoRj: "xc342km",
|
|
173
175
|
kogj98: "x1ghz6dp",
|
|
174
176
|
kpwlN0: "x10a8y8t",
|
|
175
177
|
$$css: true
|
|
@@ -459,39 +461,15 @@ export function Dialog({
|
|
|
459
461
|
}, [isOpen, isInline]);
|
|
460
462
|
|
|
461
463
|
// A dialog that unmounts while open (rendered only while open, or removed
|
|
462
|
-
// with the rest of a view) never runs the close branch above
|
|
463
|
-
//
|
|
464
|
-
// it, or dropped to the body by the removal, goes back to the opener.
|
|
464
|
+
// with the rest of a view) never runs the close branch above. Focus the
|
|
465
|
+
// removal lost goes back to the opener.
|
|
465
466
|
useEffect(() => {
|
|
466
|
-
|
|
467
|
+
const dialog = dialogRef.current;
|
|
468
|
+
if (isInline || dialog == null) {
|
|
467
469
|
return;
|
|
468
470
|
}
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
// element can no longer be found once the dialog is gone.
|
|
472
|
-
const host = dialog?.ownerDocument.defaultView?.frameElement ?? null;
|
|
473
|
-
return () => {
|
|
474
|
-
const trigger = triggerElementRef.current;
|
|
475
|
-
if (dialog == null || trigger == null) {
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
// Checked once the commit has finished: StrictMode's simulated unmount
|
|
479
|
-
// leaves the dialog in the document, and only a real removal returns
|
|
480
|
-
// focus.
|
|
481
|
-
queueMicrotask(() => {
|
|
482
|
-
if (dialog.isConnected || !trigger.isConnected) {
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
// isFocusLost reads the dialog's own document. For a dialog in an
|
|
486
|
-
// iframe, the document that hosts the frame must also have lost focus
|
|
487
|
-
// or keep it on that frame, wherever the opener is: a control the
|
|
488
|
-
// user pressed outside the frame to remove the dialog, or the frame
|
|
489
|
-
// itself, keeps its focus.
|
|
490
|
-
if (isFocusLost(dialog) && (host == null || isFocusLost(host))) {
|
|
491
|
-
focusForLastInput(trigger);
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
};
|
|
471
|
+
const returnFocusOnRemoval = prepareFocusReturnOnRemoval(dialog);
|
|
472
|
+
return () => returnFocusOnRemoval(triggerElementRef.current);
|
|
495
473
|
}, [isInline]);
|
|
496
474
|
|
|
497
475
|
// Host app-global surfaces (toasts) inside this modal while it is open, so
|
|
@@ -538,16 +516,13 @@ export function Dialog({
|
|
|
538
516
|
}
|
|
539
517
|
}, [isOpen, isInline, hasConsumerName, titleId]);
|
|
540
518
|
|
|
541
|
-
//
|
|
542
|
-
// the event target is the <dialog> element itself; clicks on child content
|
|
543
|
-
// always target the child. This avoids false positives from native browser
|
|
519
|
+
// A press on the ::backdrop targets the <dialog> itself, so native browser
|
|
544
520
|
// popups (date pickers, selects, color pickers) that render outside the
|
|
545
|
-
// dialog's
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
};
|
|
521
|
+
// dialog's rect never count. The press must start and end there.
|
|
522
|
+
const handleBackdropPress = useCallback(() => {
|
|
523
|
+
onOpenChange(false);
|
|
524
|
+
}, [onOpenChange]);
|
|
525
|
+
const backdropPress = useBackdropPress(handleBackdropPress, allowBackdropClick);
|
|
551
526
|
|
|
552
527
|
// The native `cancel` event is the browser's own close-watcher firing: an
|
|
553
528
|
// Android back gesture, or a close request the stack never saw a press for.
|
|
@@ -638,8 +613,11 @@ export function Dialog({
|
|
|
638
613
|
})(), isFullscreen && styles.fullscreen, isFullscreen && isOpen && styles.fullscreenOpen, opensSettled && styles.openSettled, xstyle), className, style),
|
|
639
614
|
...layerClickBoundary({
|
|
640
615
|
...safeProps,
|
|
641
|
-
onClick: chainEventHandlers(
|
|
616
|
+
onClick: chainEventHandlers(backdropPress.onClick, onClickProp)
|
|
642
617
|
}),
|
|
618
|
+
onPointerDownCapture: chainEventHandlers(backdropPress.onPointerDownCapture, safeProps.onPointerDownCapture),
|
|
619
|
+
onPointerUpCapture: chainEventHandlers(backdropPress.onPointerUpCapture, safeProps.onPointerUpCapture),
|
|
620
|
+
onPointerCancelCapture: chainEventHandlers(backdropPress.onPointerCancelCapture, safeProps.onPointerCancelCapture),
|
|
643
621
|
onCancel: handleCancel,
|
|
644
622
|
"aria-modal": isHydrating ? undefined : 'true'
|
|
645
623
|
// The default aria-labelledby (from a DialogHeader title) is set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,EAAgC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,KAAK,EACL,QAAe,EACf,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAsNb;yBAxOe,MAAM"}
|
package/dist/Drawer/Drawer.js
CHANGED
|
@@ -70,13 +70,15 @@ import { layerTextReset } from "../Layer/layerTextReset.stylex.js";
|
|
|
70
70
|
import { layerStructureReset } from "../Layer/layerStructureReset.stylex.js";
|
|
71
71
|
import { LayerContentBoundary } from "../Layer/layerScopedContext.js";
|
|
72
72
|
import { useModalOutlet } from "../Layer/modalOutlet.js";
|
|
73
|
+
import { useBackdropPress } from "../Layer/useBackdropPress.js";
|
|
73
74
|
import { layerClickBoundary } from "../Layer/layerClickBoundary.js";
|
|
74
75
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
75
76
|
import { composeEventHandlers, mergeProps, themeProps } from "../utils/index.js";
|
|
77
|
+
import { chainEventHandlers } from "../utils/chainEventHandlers.js";
|
|
76
78
|
import { container, overlayPaddingReset } from "../Layout/index.js";
|
|
77
79
|
import { containerPaddingBlockEndVarStyles, containerPaddingBlockStartVarStyles, containerPaddingInlineVarStyles, paddingStyles, spacingStepToToken } from "../Layout/padding.stylex.js";
|
|
78
80
|
import { useDrawerDialogPresence } from "./useDrawerDialogPresence.js";
|
|
79
|
-
|
|
81
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
80
82
|
// =============================================================================
|
|
81
83
|
// Styles
|
|
82
84
|
// =============================================================================
|
|
@@ -84,7 +86,6 @@ import { useDrawerDialogPresence } from "./useDrawerDialogPresence.js";
|
|
|
84
86
|
// Below this viewport width the drawer preserves a fixed reveal of the page
|
|
85
87
|
// behind instead of growing proportionally with the viewport. 640px is the
|
|
86
88
|
// repo's mobile breakpoint.
|
|
87
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
88
89
|
const MOBILE_BREAKPOINT = 640;
|
|
89
90
|
|
|
90
91
|
// Material's established mobile drawer pattern leaves a 56dp reveal. Using
|
|
@@ -155,7 +156,6 @@ const styles = {
|
|
|
155
156
|
},
|
|
156
157
|
scrim: {
|
|
157
158
|
kGyWv1: "xnixb3f",
|
|
158
|
-
kba3nw: "x1abwkk1",
|
|
159
159
|
k5sjJv: "xph5o2a",
|
|
160
160
|
kND0Po: "x167zut7",
|
|
161
161
|
k9an0g: "xft5bk6",
|
|
@@ -347,13 +347,12 @@ export function Drawer({
|
|
|
347
347
|
}
|
|
348
348
|
}, [allowEscape, handleDismiss, shouldDismissOnCloseRequest]);
|
|
349
349
|
|
|
350
|
-
//
|
|
351
|
-
//
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}, [allowScrimClick, hasScrim, onOpenChange]);
|
|
350
|
+
// A press on the ::backdrop targets the <dialog> itself (the content area
|
|
351
|
+
// fills the panel). The press must start and end there.
|
|
352
|
+
const handleScrimPress = useCallback(() => {
|
|
353
|
+
onOpenChange(false);
|
|
354
|
+
}, [onOpenChange]);
|
|
355
|
+
const scrimPress = useBackdropPress(handleScrimPress, hasScrim && allowScrimClick);
|
|
357
356
|
const widthValue = typeof width === 'number' ? `${width}px` : width;
|
|
358
357
|
const isFullWidthOnMobile = experimental?.isFullWidthOnMobile ?? false;
|
|
359
358
|
const mobileWidth = isFullWidthOnMobile ? MOBILE_WIDTH_FULL : `min(${widthValue}, calc(100dvw - ${MOBILE_PAGE_REVEAL}px))`;
|
|
@@ -391,8 +390,13 @@ export function Drawer({
|
|
|
391
390
|
} : undefined),
|
|
392
391
|
...layerClickBoundary({
|
|
393
392
|
...safeProps,
|
|
394
|
-
onClick: composeEventHandlers(onClickProp,
|
|
393
|
+
onClick: composeEventHandlers(onClickProp, scrimPress.onClick)
|
|
395
394
|
}),
|
|
395
|
+
// The hook records where the press started first. The caller's capture
|
|
396
|
+
// handler then runs, also when a child prevented default.
|
|
397
|
+
onPointerDownCapture: chainEventHandlers(scrimPress.onPointerDownCapture, safeProps.onPointerDownCapture),
|
|
398
|
+
onPointerUpCapture: chainEventHandlers(scrimPress.onPointerUpCapture, safeProps.onPointerUpCapture),
|
|
399
|
+
onPointerCancelCapture: chainEventHandlers(scrimPress.onPointerCancelCapture, safeProps.onPointerCancelCapture),
|
|
396
400
|
onKeyDown: onKeyDownProp,
|
|
397
401
|
onCancel: handleCancel,
|
|
398
402
|
children: /*#__PURE__*/_jsx(ModalAnnounceProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrawerDialogPresence.d.ts","sourceRoot":"","sources":["../../src/Drawer/useDrawerDialogPresence.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useDrawerDialogPresence.d.ts","sourceRoot":"","sources":["../../src/Drawer/useDrawerDialogPresence.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAef,KAAK,8BAA8B,GAAG;IACpC,SAAS,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;AA6DF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,OAAO,EACP,aAAa,GACd,EAAE,8BAA8B,GAAG,IAAI,CAoEvC"}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import { useEffect, useRef } from 'react';
|
|
27
27
|
import { flushSync } from 'react-dom';
|
|
28
28
|
import { notifyTopLayerEntry } from "../Layer/modalOutlet.js";
|
|
29
|
+
import { runPopoverOperation } from "../Layer/popoverOperations.js";
|
|
29
30
|
|
|
30
31
|
/** Slack past the computed transition before the backstop gives up waiting. */
|
|
31
32
|
const EXIT_BACKSTOP_BUFFER_MS = 50;
|
|
@@ -51,7 +52,10 @@ function showDrawerHost(dialog, isModal) {
|
|
|
51
52
|
if (isModal) {
|
|
52
53
|
dialog.showModal();
|
|
53
54
|
} else if (typeof dialog.showPopover === 'function') {
|
|
54
|
-
dialog.
|
|
55
|
+
// The dialog's show focuses its first control. A tooltip on that control
|
|
56
|
+
// then asks to show. The browser refuses a show inside another show.
|
|
57
|
+
// Counting this show makes the tooltip wait until it ends.
|
|
58
|
+
runPopoverOperation(dialog.ownerDocument, () => dialog.showPopover());
|
|
55
59
|
// The drawer is now the newest top-layer entry: global hosts shown before
|
|
56
60
|
// it (the toast viewport) re-enter above it, as they do above a modal.
|
|
57
61
|
notifyTopLayerEntry();
|
package/dist/Field/Field.js
CHANGED
|
@@ -22,11 +22,11 @@ import { FieldStatus } from "../FieldStatus/FieldStatus.js";
|
|
|
22
22
|
import { useFieldStatusAnnouncement } from "../FieldStatus/useFieldStatusAnnouncement.js";
|
|
23
23
|
import "../theme/tokens.stylex.js";
|
|
24
24
|
import { spacingVars, borderVars, sizeVars } from "../theme/tokens.stylex.js";
|
|
25
|
-
import { mergeProps } from "../utils/
|
|
25
|
+
import { mergeProps } from "../utils/mergeProps.js";
|
|
26
26
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
27
27
|
import { FormLayoutContext } from "../FormLayout/FormLayoutContext.js";
|
|
28
28
|
import { Text } from "../Text/Text.js";
|
|
29
|
-
import { VisuallyHidden } from "../VisuallyHidden/
|
|
29
|
+
import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
|
|
30
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
31
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
32
32
|
const styles = {
|
|
@@ -72,6 +72,14 @@ export interface PanelSearchInputProps extends Omit<BaseProps<HTMLInputElement>,
|
|
|
72
72
|
* the field to the same height as its rows.
|
|
73
73
|
*/
|
|
74
74
|
fieldXstyle?: StyleXStyles;
|
|
75
|
+
/**
|
|
76
|
+
* Draw the field as the shared input box — the input border, accent while
|
|
77
|
+
* focused, surface and radius — instead of the borderless panel row. A
|
|
78
|
+
* touch sheet is a full-width surface, not a bordered panel, so its field
|
|
79
|
+
* reads as a form input.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
hasInputBox?: boolean;
|
|
75
83
|
}
|
|
76
84
|
/**
|
|
77
85
|
* Search row for the top of a dropdown panel: magnifier, borderless input, and
|
|
@@ -82,7 +90,7 @@ export interface PanelSearchInputProps extends Omit<BaseProps<HTMLInputElement>,
|
|
|
82
90
|
* option list's inline padding); every other prop (`role`, `aria-*`, `id`, …)
|
|
83
91
|
* passes through to the `<input>`, so the caller owns the combobox wiring.
|
|
84
92
|
*/
|
|
85
|
-
export declare function PanelSearchInput({ ref, label, clearLabel, placeholder, value, onValueChange, onKeyDown, onFocus, onBlur, onContainerKeyDown, fieldXstyle, xstyle, className, style, ...props }: PanelSearchInputProps): import("react").JSX.Element;
|
|
93
|
+
export declare function PanelSearchInput({ ref, label, clearLabel, placeholder, value, onValueChange, onKeyDown, onFocus, onBlur, onContainerKeyDown, fieldXstyle, hasInputBox, xstyle, className, style, ...props }: PanelSearchInputProps): import("react").JSX.Element;
|
|
86
94
|
export declare namespace PanelSearchInput {
|
|
87
95
|
var displayName: string;
|
|
88
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelSearchInput.d.ts","sourceRoot":"","sources":["../../src/Field/PanelSearchInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,KAAK,EACL,UAAU,EACV,WAAW,EACX,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,WAAW,EACX,WAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,qBAAqB,+BAoFvB;yBArGe,gBAAgB"}
|
|
@@ -48,6 +48,7 @@ import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
|
48
48
|
import "../theme/tokens.stylex.js";
|
|
49
49
|
import { colorVars, durationVars, easeVars, radiusVars, spacingVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
50
50
|
import { textEntryTraitAttributes } from "./textEntryTraits.js";
|
|
51
|
+
import { inputWrapperStyles } from "./inputStyles.stylex.js";
|
|
51
52
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
52
53
|
const styles = {
|
|
53
54
|
wrapper: {
|
|
@@ -101,6 +102,7 @@ export function PanelSearchInput({
|
|
|
101
102
|
onBlur,
|
|
102
103
|
onContainerKeyDown,
|
|
103
104
|
fieldXstyle,
|
|
105
|
+
hasInputBox = false,
|
|
104
106
|
xstyle,
|
|
105
107
|
className,
|
|
106
108
|
style,
|
|
@@ -146,7 +148,7 @@ export function PanelSearchInput({
|
|
|
146
148
|
...mergeProps(stylex.props(styles.wrapper, xstyle), className, style),
|
|
147
149
|
children: /*#__PURE__*/_jsxs("div", {
|
|
148
150
|
"data-keyboard-focus": isKeyboardFocus ? 'true' : undefined,
|
|
149
|
-
...stylex.props(styles.field, isKeyboardFocus && styles.fieldKeyboardFocus, fieldXstyle),
|
|
151
|
+
...stylex.props(styles.field, isKeyboardFocus && styles.fieldKeyboardFocus, hasInputBox && inputWrapperStyles.base, fieldXstyle),
|
|
150
152
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
151
153
|
icon: "search",
|
|
152
154
|
size: "sm",
|
|
@@ -47,9 +47,10 @@ export interface HoverCardProps extends Pick<BaseProps, 'xstyle' | 'className' |
|
|
|
47
47
|
hideDelay?: number;
|
|
48
48
|
/**
|
|
49
49
|
* When to trigger on focus:
|
|
50
|
-
* - `auto`:
|
|
51
|
-
*
|
|
52
|
-
* - `
|
|
50
|
+
* - `auto`: focus on the trigger itself, or within a trigger that is
|
|
51
|
+
* focusable when focus arrives
|
|
52
|
+
* - `always`: focus on the trigger or anything inside it
|
|
53
|
+
* - `never`: never on focus (for composite widgets)
|
|
53
54
|
*
|
|
54
55
|
* @default 'auto'
|
|
55
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AA6ExB,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,OAAO,EACP,SAAmB,EACnB,SAAoB,EACpB,KAAW,EACX,SAAe,EACf,YAAqB,EACrB,YAAqB,EACrB,SAAgB,EAChB,KAAK,EACL,YAAY,EACZ,kBAA2B,EAC3B,MAAM,EACN,aAAa,EACb,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,cAAc,GAAG,YAAY,CA2M/B;yBA7Ne,SAAS"}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* - /apps/storybook/stories/HoverCard.stories.tsx
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/HoverCard/ (showcase blocks)
|
|
17
17
|
*/
|
|
18
|
-
import { useCallback, useRef } from 'react';
|
|
18
|
+
import { useCallback, useRef, useState } from 'react';
|
|
19
|
+
import { observeMutations } from "../utils/sharedMutationObserver.js";
|
|
19
20
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
20
21
|
import * as stylex from '@stylexjs/stylex';
|
|
21
22
|
import { useHoverCard } from "./useHoverCard.js";
|
|
@@ -138,6 +139,30 @@ export function HoverCard({
|
|
|
138
139
|
onHide: handleHide
|
|
139
140
|
});
|
|
140
141
|
|
|
142
|
+
// The wrapper's first element is the trigger, and it can be replaced after
|
|
143
|
+
// mount: by new children, or by a child component that swaps its own root
|
|
144
|
+
// without a render here. Syncs with the DOM: on a replacement the wiring
|
|
145
|
+
// below re-runs, so the old element is released before the new one is wired.
|
|
146
|
+
const [triggerReplacements, setTriggerReplacements] = useState(0);
|
|
147
|
+
const observedTriggerRef = useRef(null);
|
|
148
|
+
useIsomorphicLayoutEffect(() => {
|
|
149
|
+
const wrapper = wrapperRef.current;
|
|
150
|
+
if (textOnly || wrapper == null) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
observedTriggerRef.current = wrapper.firstElementChild;
|
|
154
|
+
return observeMutations(wrapper, {
|
|
155
|
+
childList: true
|
|
156
|
+
}, () => {
|
|
157
|
+
const trigger = wrapper.firstElementChild;
|
|
158
|
+
if (trigger === observedTriggerRef.current) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
observedTriggerRef.current = trigger;
|
|
162
|
+
setTriggerReplacements(count => count + 1);
|
|
163
|
+
});
|
|
164
|
+
}, [textOnly]);
|
|
165
|
+
|
|
141
166
|
// For element children with display:contents, attach ref to first child
|
|
142
167
|
useIsomorphicLayoutEffect(() => {
|
|
143
168
|
if (textOnly) {
|
|
@@ -224,7 +249,7 @@ export function HoverCard({
|
|
|
224
249
|
firstChild.removeAttribute('aria-describedby');
|
|
225
250
|
}
|
|
226
251
|
};
|
|
227
|
-
}, [textOnly, label, hoverCard.ref, hoverCard.id, hoverCard.isOpen, hoverCard.describedBy]);
|
|
252
|
+
}, [textOnly, label, hoverCard.ref, hoverCard.id, hoverCard.isOpen, hoverCard.describedBy, triggerReplacements]);
|
|
228
253
|
|
|
229
254
|
// While closed, useLayer leaves only an inert <template> marker at this JSX
|
|
230
255
|
// position. When the card needs to open, it uses that marker to keep the
|
|
@@ -11,7 +11,7 @@ import { type ReactNode, type RefCallback } from 'react';
|
|
|
11
11
|
import { type ContextRenderProps, type LayerAlignment, type LayerPlacement } from '../Layer/useLayer.js';
|
|
12
12
|
import { type LayerTouchTrigger } from '../Layer/useTouchTrigger.js';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* When focus on the trigger opens the hover card
|
|
15
15
|
*/
|
|
16
16
|
export type HoverCardFocusTrigger = 'auto' | 'always' | 'never';
|
|
17
17
|
/**
|
|
@@ -41,9 +41,10 @@ export interface HoverCardOptions {
|
|
|
41
41
|
hideDelay?: number;
|
|
42
42
|
/**
|
|
43
43
|
* When to trigger on focus:
|
|
44
|
-
* - `auto`:
|
|
45
|
-
*
|
|
46
|
-
* - `
|
|
44
|
+
* - `auto`: focus on the trigger itself, or within a trigger that is
|
|
45
|
+
* focusable when focus arrives
|
|
46
|
+
* - `always`: focus on the trigger or anything inside it
|
|
47
|
+
* - `never`: never on focus (for composite widgets)
|
|
47
48
|
*
|
|
48
49
|
* @default 'auto'
|
|
49
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACj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AAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CA4d5E"}
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* SYNC: When modified, update:
|
|
12
12
|
* - /packages/core/src/HoverCard/index.ts
|
|
13
13
|
*/
|
|
14
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
14
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
15
|
+
import { createTriggerFocusGate } from "../utils/triggerFocus.js";
|
|
15
16
|
import * as stylex from '@stylexjs/stylex';
|
|
16
17
|
import { useLayer } from "../Layer/useLayer.js";
|
|
17
18
|
import { useTouchTrigger } from "../Layer/useTouchTrigger.js";
|
|
@@ -33,35 +34,13 @@ const styles = {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
+
* When focus on the trigger opens the hover card
|
|
37
38
|
*/
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Touch trigger behavior for hover cards
|
|
41
42
|
*/
|
|
42
43
|
|
|
43
|
-
/**
|
|
44
|
-
* Check if an element is naturally focusable
|
|
45
|
-
*/
|
|
46
|
-
function isFocusable(element) {
|
|
47
|
-
// Elements with explicit tabindex
|
|
48
|
-
if (element.hasAttribute('tabindex')) {
|
|
49
|
-
return element.tabIndex >= 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Naturally focusable elements
|
|
53
|
-
const focusableTags = ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
|
|
54
|
-
if (focusableTags.includes(element.tagName)) {
|
|
55
|
-
return !element.disabled;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Elements with contenteditable
|
|
59
|
-
if (element.isContentEditable) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
44
|
/**
|
|
66
45
|
* Hook for hover card behavior with hover/focus triggers.
|
|
67
46
|
*
|
|
@@ -220,8 +199,12 @@ export function useHoverCard(options = {}) {
|
|
|
220
199
|
const handlePointerDown = useCallback(event => {
|
|
221
200
|
handleTouchPointerDown(event);
|
|
222
201
|
}, [handleTouchPointerDown]);
|
|
223
|
-
|
|
224
|
-
|
|
202
|
+
|
|
203
|
+
// Under `auto`, whether focus counts is decided when it arrives, and a
|
|
204
|
+
// focus that counted still hides on blur (utils/triggerFocus.ts).
|
|
205
|
+
const [focusGate] = useState(createTriggerFocusGate);
|
|
206
|
+
const handleFocusIn = useCallback(e => {
|
|
207
|
+
if (!focusGate.focusIn(e, focusTrigger) || !isEnabled) {
|
|
225
208
|
return;
|
|
226
209
|
}
|
|
227
210
|
// A tap focuses the trigger it activates. Opening on that focus would
|
|
@@ -237,8 +220,11 @@ export function useHoverCard(options = {}) {
|
|
|
237
220
|
}
|
|
238
221
|
clearTimeouts();
|
|
239
222
|
showLayer();
|
|
240
|
-
}, [isEnabled, isTouchInteraction, clearTimeouts, showLayer]);
|
|
223
|
+
}, [focusGate, focusTrigger, isEnabled, isTouchInteraction, clearTimeouts, showLayer]);
|
|
241
224
|
const handleFocusOut = useCallback(e => {
|
|
225
|
+
if (!focusGate.focusOut(e, focusTrigger)) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
242
228
|
// Check if focus is moving to the hover card content
|
|
243
229
|
const relatedTarget = e.relatedTarget;
|
|
244
230
|
const popoverElement = document.getElementById(layerId);
|
|
@@ -247,7 +233,7 @@ export function useHoverCard(options = {}) {
|
|
|
247
233
|
return;
|
|
248
234
|
}
|
|
249
235
|
scheduleHide();
|
|
250
|
-
}, [layerId, scheduleHide]);
|
|
236
|
+
}, [focusGate, focusTrigger, layerId, scheduleHide]);
|
|
251
237
|
|
|
252
238
|
// Escape dismissal (WCAG 1.4.13) goes through the shared layer stack: a
|
|
253
239
|
// visible card is the top-most layer, so it takes the press and consumes it.
|
|
@@ -329,9 +315,9 @@ export function useHoverCard(options = {}) {
|
|
|
329
315
|
el.addEventListener('mouseleave', handleMouseLeave);
|
|
330
316
|
el.addEventListener('pointerdown', handlePointerDown);
|
|
331
317
|
|
|
332
|
-
//
|
|
333
|
-
|
|
334
|
-
if (
|
|
318
|
+
// Focus listeners unless focus never opens the card; `auto` decides
|
|
319
|
+
// per event (utils/triggerFocus.ts).
|
|
320
|
+
if (focusTrigger !== 'never') {
|
|
335
321
|
el.addEventListener('focusin', handleFocusIn);
|
|
336
322
|
el.addEventListener('focusout', handleFocusOut);
|
|
337
323
|
}
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -105,7 +105,11 @@ export type IconType = ComponentType<SVGProps<SVGSVGElement>>;
|
|
|
105
105
|
* Extends SVGProps to allow passing additional SVG attributes (used when icon is a component).
|
|
106
106
|
*/
|
|
107
107
|
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'color'> {
|
|
108
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Ref to the rendered SVG element when `icon` is an icon component. A
|
|
110
|
+
* semantic or namespaced name renders inside an internal wrapper, and the
|
|
111
|
+
* ref is not attached.
|
|
112
|
+
*/
|
|
109
113
|
ref?: React.Ref<SVGSVGElement>;
|
|
110
114
|
/**
|
|
111
115
|
* Icon to render. Can be:
|
package/dist/Icon/Icon.d.ts.map
CHANGED
|
@@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ACP,KAAK,EACL,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,SAAS,qBAoDX;yBA/De,IAAI;;;AA2IpB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,QAAQ,EAChC,KAAK,CAAC,EAAE;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAC,GAC3C,KAAK,CAAC,SAAS,CAYjB"}
|
package/dist/Icon/Icon.js
CHANGED
|
@@ -193,7 +193,9 @@ const colorStyles = {
|
|
|
193
193
|
*
|
|
194
194
|
* - Non-empty `label` → meaningful image: `role="img"` + `aria-label`, and no
|
|
195
195
|
* `aria-hidden` (an `aria-hidden` element is removed from the accessibility
|
|
196
|
-
* tree, so its accessible name would be ignored).
|
|
196
|
+
* tree, so its accessible name would be ignored). Icon passes
|
|
197
|
+
* `aria-hidden: undefined`. Many icon components, such as Heroicons, write
|
|
198
|
+
* `aria-hidden="true"` unless a prop replaces it.
|
|
197
199
|
* - Omitted or empty `label` → decorative default: `aria-hidden="true"`.
|
|
198
200
|
*
|
|
199
201
|
* The result is spread BEFORE `{...props}` in both render modes so an explicit
|
|
@@ -202,7 +204,8 @@ const colorStyles = {
|
|
|
202
204
|
function getIconA11yProps(label) {
|
|
203
205
|
return label != null && label !== '' ? {
|
|
204
206
|
role: 'img',
|
|
205
|
-
'aria-label': label
|
|
207
|
+
'aria-label': label,
|
|
208
|
+
'aria-hidden': undefined
|
|
206
209
|
} : {
|
|
207
210
|
'aria-hidden': 'true'
|
|
208
211
|
};
|