@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
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @file useTooltip.tsx
|
|
3
3
|
* @input Uses useLayer, usePressPin, React hooks
|
|
4
4
|
* @output Exports useTooltip hook with stable trigger refs for hover/focus/tap tooltips
|
|
5
|
+
* and imperative show() and hide() for an app-built toggle trigger,
|
|
6
|
+
* and the module-only useTooltipWithTriggerBehavior that InfoTip's press-to-pin uses
|
|
5
7
|
* @position Layer hook; builds on useLayer for tooltip behavior
|
|
6
8
|
*
|
|
7
9
|
* SYNC: When modified, update:
|
|
@@ -10,6 +12,7 @@
|
|
|
10
12
|
import { type ReactNode, type RefCallback } from 'react';
|
|
11
13
|
import { type ContextRenderProps, type LayerAlignment, type LayerPlacement } from '../Layer/useLayer.js';
|
|
12
14
|
import type { LayerTouchTrigger } from '../Layer/useTouchTrigger.js';
|
|
15
|
+
import { type LayerTriggerBehavior } from '../Layer/usePressPin.js';
|
|
13
16
|
/**
|
|
14
17
|
* Focus trigger behavior for tooltips
|
|
15
18
|
*/
|
|
@@ -18,13 +21,6 @@ export type TooltipFocusTrigger = 'auto' | 'always' | 'never';
|
|
|
18
21
|
* Touch trigger behavior for tooltips
|
|
19
22
|
*/
|
|
20
23
|
export type TooltipTouchTrigger = LayerTouchTrigger;
|
|
21
|
-
/**
|
|
22
|
-
* How the trigger opens the tooltip. `adaptive`, the default, previews it on
|
|
23
|
-
* hover and focus, and a tap opens it unless the trigger acts. `hover`
|
|
24
|
-
* previews it on hover and focus, and no touch or pen tap opens it. `toggle`
|
|
25
|
-
* pins it on a click, tap, Enter, or Space on a button trigger.
|
|
26
|
-
*/
|
|
27
|
-
export type TooltipTriggerBehavior = 'adaptive' | 'hover' | 'toggle';
|
|
28
24
|
export interface TooltipOptions {
|
|
29
25
|
/**
|
|
30
26
|
* Position placement relative to anchor
|
|
@@ -64,30 +60,9 @@ export interface TooltipOptions {
|
|
|
64
60
|
* - `tap`: tap always opens the tooltip, even on a trigger that acts
|
|
65
61
|
* - `none`: touch never opens the tooltip
|
|
66
62
|
*
|
|
67
|
-
* It decides only under `triggerBehavior="adaptive"`, the default.
|
|
68
|
-
*
|
|
69
63
|
* @default 'auto'
|
|
70
64
|
*/
|
|
71
65
|
touchTrigger?: TooltipTouchTrigger;
|
|
72
|
-
/**
|
|
73
|
-
* How the trigger opens the tooltip:
|
|
74
|
-
* - `adaptive` (the default): hover and focus preview it. A tap opens it
|
|
75
|
-
* unless the trigger performs an action of its own. While `touchTrigger`
|
|
76
|
-
* remains, it decides those taps.
|
|
77
|
-
* - `hover`: hover and focus preview it; no touch or pen tap opens it.
|
|
78
|
-
* - `toggle`: on a button trigger, a click, a tap, Enter, or Space pins the
|
|
79
|
-
* tooltip open, and the same press closes it. Hover and keyboard focus
|
|
80
|
-
* still preview it. A pinned tooltip stays until Escape, a second press,
|
|
81
|
-
* a press outside, or focus leaving. Astryx clickable rows and cards
|
|
82
|
-
* ignore the pinning press, except an Item row on a trigger that is not
|
|
83
|
-
* a native button. The `Tooltip` component also stops it at a child
|
|
84
|
-
* trigger. A hook caller stops a plain `onClick` ancestor itself. The
|
|
85
|
-
* trigger reports `aria-expanded` and `aria-controls`, and the tooltip's
|
|
86
|
-
* text is announced once when it pins. `touchTrigger` is ignored.
|
|
87
|
-
*
|
|
88
|
-
* @default 'adaptive'
|
|
89
|
-
*/
|
|
90
|
-
triggerBehavior?: TooltipTriggerBehavior;
|
|
91
66
|
/**
|
|
92
67
|
* Whether the tooltip is enabled.
|
|
93
68
|
* When false, hover/focus triggers are disabled.
|
|
@@ -159,6 +134,23 @@ export interface TooltipReturn {
|
|
|
159
134
|
* silent no-op.
|
|
160
135
|
*/
|
|
161
136
|
renderTooltip: (children: ReactNode, props?: Omit<ContextRenderProps, 'positioning'>) => ReactNode;
|
|
137
|
+
/**
|
|
138
|
+
* Opens the tooltip now and keeps it open until `hide()`, Escape, a press
|
|
139
|
+
* outside, or focus leaving its trigger, as a pinned tooltip does. Its text
|
|
140
|
+
* is announced once. Reports through `onShow`. Under a controlled `isOpen`,
|
|
141
|
+
* it calls `onShow` and does not change `isOpen`. Does nothing while
|
|
142
|
+
* `isEnabled` is false.
|
|
143
|
+
*
|
|
144
|
+
* Use `show()` and `hide()` to build a toggle-style trigger: your own button
|
|
145
|
+
* calls them, sets `aria-describedby` and `aria-controls` to `describedBy`
|
|
146
|
+
* and `aria-expanded` (true while shown), and keeps its own accessible name.
|
|
147
|
+
*/
|
|
148
|
+
show: () => void;
|
|
149
|
+
/**
|
|
150
|
+
* Closes the tooltip now. Reports through `onHide`. Under a controlled
|
|
151
|
+
* `isOpen`, it calls `onHide` and does not change `isOpen`.
|
|
152
|
+
*/
|
|
153
|
+
hide: () => void;
|
|
162
154
|
}
|
|
163
155
|
/**
|
|
164
156
|
* Hook for tooltip behavior with hover/focus triggers.
|
|
@@ -185,4 +177,29 @@ export interface TooltipReturn {
|
|
|
185
177
|
* ```
|
|
186
178
|
*/
|
|
187
179
|
export declare function useTooltip(options?: TooltipOptions): TooltipReturn;
|
|
180
|
+
/**
|
|
181
|
+
* Module-only options for `useTooltipWithTriggerBehavior`. Not exported from
|
|
182
|
+
* the package.
|
|
183
|
+
*/
|
|
184
|
+
export interface TooltipWithTriggerBehaviorOptions extends TooltipOptions {
|
|
185
|
+
/**
|
|
186
|
+
* How the trigger opens the tooltip:
|
|
187
|
+
* - `adaptive` (the default): hover and focus preview it. `touchTrigger`
|
|
188
|
+
* decides taps.
|
|
189
|
+
* - `toggle`: on a button trigger, a click, a tap, Enter, or Space pins the
|
|
190
|
+
* tooltip open, and the same press closes it. Hover and keyboard focus
|
|
191
|
+
* still preview it. A pinned tooltip stays until Escape, a second press,
|
|
192
|
+
* a press outside, or focus leaving. The trigger reports `aria-expanded`
|
|
193
|
+
* and `aria-controls`, and the tooltip's text is announced once when it
|
|
194
|
+
* pins. `touchTrigger` is ignored. InfoTip uses it.
|
|
195
|
+
*
|
|
196
|
+
* @default 'adaptive'
|
|
197
|
+
*/
|
|
198
|
+
triggerBehavior?: LayerTriggerBehavior;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* `useTooltip` with a trigger behavior. Module-only: InfoTip's press-to-pin
|
|
202
|
+
* goes through it, and the package does not export it.
|
|
203
|
+
*/
|
|
204
|
+
export declare function useTooltipWithTriggerBehavior(options?: TooltipWithTriggerBehaviorOptions): TooltipReturn;
|
|
188
205
|
//# sourceMappingURL=useTooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAKhE,OAAO,EAAc,KAAK,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AA0C5E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,E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oB,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,iCAAsC,GAC9C,aAAa,CA2df"}
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
* @file useTooltip.tsx
|
|
7
7
|
* @input Uses useLayer, usePressPin, React hooks
|
|
8
8
|
* @output Exports useTooltip hook with stable trigger refs for hover/focus/tap tooltips
|
|
9
|
+
* and imperative show() and hide() for an app-built toggle trigger,
|
|
10
|
+
* and the module-only useTooltipWithTriggerBehavior that InfoTip's press-to-pin uses
|
|
9
11
|
* @position Layer hook; builds on useLayer for tooltip behavior
|
|
10
12
|
*
|
|
11
13
|
* SYNC: When modified, update:
|
|
12
14
|
* - /packages/core/src/Tooltip/index.ts
|
|
13
15
|
*/
|
|
14
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
16
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
17
|
+
import { createTriggerFocusGate } from "../utils/triggerFocus.js";
|
|
15
18
|
import * as stylex from '@stylexjs/stylex';
|
|
16
19
|
import { useLayerInternal } from "../Layer/useLayer.js";
|
|
17
20
|
import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
@@ -51,35 +54,6 @@ const styles = {
|
|
|
51
54
|
* Touch trigger behavior for tooltips
|
|
52
55
|
*/
|
|
53
56
|
|
|
54
|
-
/**
|
|
55
|
-
* How the trigger opens the tooltip. `adaptive`, the default, previews it on
|
|
56
|
-
* hover and focus, and a tap opens it unless the trigger acts. `hover`
|
|
57
|
-
* previews it on hover and focus, and no touch or pen tap opens it. `toggle`
|
|
58
|
-
* pins it on a click, tap, Enter, or Space on a button trigger.
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Check if an element is naturally focusable
|
|
63
|
-
*/
|
|
64
|
-
function isFocusable(element) {
|
|
65
|
-
// Elements with explicit tabindex
|
|
66
|
-
if (element.hasAttribute('tabindex')) {
|
|
67
|
-
return element.tabIndex >= 0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Naturally focusable elements
|
|
71
|
-
const focusableTags = ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
|
|
72
|
-
if (focusableTags.includes(element.tagName)) {
|
|
73
|
-
return !element.disabled;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Elements with contenteditable
|
|
77
|
-
if (element.isContentEditable) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
57
|
/**
|
|
84
58
|
* Hook for tooltip behavior with hover/focus triggers.
|
|
85
59
|
*
|
|
@@ -106,6 +80,24 @@ function isFocusable(element) {
|
|
|
106
80
|
*/
|
|
107
81
|
|
|
108
82
|
export function useTooltip(options = {}) {
|
|
83
|
+
// The option is fixed to `adaptive`, so an options object that carries it at
|
|
84
|
+
// runtime cannot reach the press-to-pin path.
|
|
85
|
+
return useTooltipWithTriggerBehavior({
|
|
86
|
+
...options,
|
|
87
|
+
triggerBehavior: 'adaptive'
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Module-only options for `useTooltipWithTriggerBehavior`. Not exported from
|
|
93
|
+
* the package.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* `useTooltip` with a trigger behavior. Module-only: InfoTip's press-to-pin
|
|
98
|
+
* goes through it, and the package does not export it.
|
|
99
|
+
*/
|
|
100
|
+
export function useTooltipWithTriggerBehavior(options = {}) {
|
|
109
101
|
const {
|
|
110
102
|
placement = 'above',
|
|
111
103
|
alignment = 'center',
|
|
@@ -175,6 +167,9 @@ export function useTooltip(options = {}) {
|
|
|
175
167
|
isHeldOpen: isPressHeldOpen,
|
|
176
168
|
attach: attachPressPin,
|
|
177
169
|
unpin: unpinPress,
|
|
170
|
+
hold: holdPress,
|
|
171
|
+
release: releasePress,
|
|
172
|
+
isAppHeld,
|
|
178
173
|
isPinShown,
|
|
179
174
|
touch: {
|
|
180
175
|
isTouchPointerRef,
|
|
@@ -277,25 +272,11 @@ export function useTooltip(options = {}) {
|
|
|
277
272
|
scheduleHide();
|
|
278
273
|
}, [isTouchPointerRef, layerId, scheduleHide]);
|
|
279
274
|
|
|
280
|
-
// Under `auto`, whether focus counts is decided when it arrives,
|
|
281
|
-
//
|
|
282
|
-
|
|
283
|
-
// by definition; focus inside it counts only while the trigger is
|
|
284
|
-
// focusable too, so a plain wrapper still ignores its children's focus.
|
|
285
|
-
const isFocusForTrigger = useCallback(e => {
|
|
286
|
-
if (focusTrigger === 'always') {
|
|
287
|
-
return true;
|
|
288
|
-
}
|
|
289
|
-
const triggerEl = e.currentTarget;
|
|
290
|
-
return triggerEl != null && (e.target === triggerEl || isFocusable(triggerEl));
|
|
291
|
-
}, [focusTrigger]);
|
|
292
|
-
|
|
293
|
-
// Whether the trigger's current focus counted when it arrived, so its blur
|
|
294
|
-
// hides the tooltip even if the trigger has since left the tab order.
|
|
295
|
-
const focusCountedRef = useRef(false);
|
|
275
|
+
// Under `auto`, whether focus counts is decided when it arrives, and a
|
|
276
|
+
// focus that counted still hides on blur (utils/triggerFocus.ts).
|
|
277
|
+
const [focusGate] = useState(createTriggerFocusGate);
|
|
296
278
|
const handleFocusIn = useCallback(e => {
|
|
297
|
-
|
|
298
|
-
if (!isEnabled || !focusCountedRef.current) {
|
|
279
|
+
if (!focusGate.focusIn(e, focusTrigger) || !isEnabled) {
|
|
299
280
|
return;
|
|
300
281
|
}
|
|
301
282
|
// A tap focuses the trigger it activates, and `:focus-visible` does not
|
|
@@ -314,18 +295,17 @@ export function useTooltip(options = {}) {
|
|
|
314
295
|
}
|
|
315
296
|
clearTimeouts();
|
|
316
297
|
showLayer();
|
|
317
|
-
}, [
|
|
298
|
+
}, [focusGate, focusTrigger, isEnabled, isTouchInteraction, clearTimeouts, showLayer]);
|
|
318
299
|
|
|
319
300
|
// A pinned tooltip's focus-leave close is the pin's own: it listens on the
|
|
320
301
|
// trigger whatever `focusTrigger` is. This schedules the unpinned hide,
|
|
321
302
|
// which a held tooltip skips.
|
|
322
303
|
const handleFocusOut = useCallback(e => {
|
|
323
|
-
if (!
|
|
304
|
+
if (!focusGate.focusOut(e, focusTrigger)) {
|
|
324
305
|
return;
|
|
325
306
|
}
|
|
326
|
-
focusCountedRef.current = false;
|
|
327
307
|
scheduleHide();
|
|
328
|
-
}, [
|
|
308
|
+
}, [focusGate, focusTrigger, scheduleHide]);
|
|
329
309
|
|
|
330
310
|
// Pressing the trigger hides its own tooltip: once the control is activated
|
|
331
311
|
// the hint has served its purpose, and a tooltip lingering over a
|
|
@@ -335,9 +315,10 @@ export function useTooltip(options = {}) {
|
|
|
335
315
|
// A touch press is a different gesture (it may be the only way to open the
|
|
336
316
|
// tooltip at all), so the touch path answers it first.
|
|
337
317
|
const handlePointerDown = useCallback(event => {
|
|
338
|
-
// A
|
|
339
|
-
//
|
|
340
|
-
|
|
318
|
+
// A toggle trigger's press pins or closes through its click. The app's
|
|
319
|
+
// hide() closes a held tooltip. Neither path hides here or waits for a
|
|
320
|
+
// tap verdict.
|
|
321
|
+
if (isToggleTrigger(triggerRef.current) || isAppHeld()) {
|
|
341
322
|
return;
|
|
342
323
|
}
|
|
343
324
|
if (handleTouchPointerDown(event)) {
|
|
@@ -348,7 +329,7 @@ export function useTooltip(options = {}) {
|
|
|
348
329
|
}
|
|
349
330
|
clearTimeouts();
|
|
350
331
|
hideLayer();
|
|
351
|
-
}, [isToggleTrigger, handleTouchPointerDown, isOpen, clearTimeouts, hideLayer]);
|
|
332
|
+
}, [isToggleTrigger, isAppHeld, handleTouchPointerDown, isOpen, clearTimeouts, hideLayer]);
|
|
352
333
|
|
|
353
334
|
// Interaction ref that handles event listeners only
|
|
354
335
|
const interactionRef = useCallback(el => {
|
|
@@ -372,7 +353,7 @@ export function useTooltip(options = {}) {
|
|
|
372
353
|
el.addEventListener('pointerdown', handlePointerDown);
|
|
373
354
|
|
|
374
355
|
// Focus listeners unless focus never opens the tooltip; `auto` decides
|
|
375
|
-
// per event (
|
|
356
|
+
// per event (utils/triggerFocus.ts).
|
|
376
357
|
if (focusTrigger !== 'never') {
|
|
377
358
|
el.addEventListener('focusin', handleFocusIn);
|
|
378
359
|
el.addEventListener('focusout', handleFocusOut);
|
|
@@ -413,9 +394,11 @@ export function useTooltip(options = {}) {
|
|
|
413
394
|
showLayer();
|
|
414
395
|
} else {
|
|
415
396
|
clearTimeouts();
|
|
397
|
+
// A pin or app hold ends when the consumer closes the tooltip.
|
|
398
|
+
unpinPress();
|
|
416
399
|
hideLayer();
|
|
417
400
|
}
|
|
418
|
-
}, [isOpen, clearTimeouts, showLayer, hideLayer]);
|
|
401
|
+
}, [isOpen, clearTimeouts, showLayer, hideLayer, unpinPress]);
|
|
419
402
|
|
|
420
403
|
// Dismiss on Escape (WCAG 1.4.13 — dismissible) through the shared layer
|
|
421
404
|
// stack. A visible tip is the top-most layer, so it takes the press and
|
|
@@ -495,12 +478,22 @@ export function useTooltip(options = {}) {
|
|
|
495
478
|
children: children
|
|
496
479
|
}), renderProps);
|
|
497
480
|
}, [renderLayer, placement, alignment, popoverXstyle, cancelHide, scheduleHide, contentRefs]);
|
|
481
|
+
const show = useCallback(() => {
|
|
482
|
+
clearTimeouts();
|
|
483
|
+
holdPress();
|
|
484
|
+
}, [clearTimeouts, holdPress]);
|
|
485
|
+
const hide = useCallback(() => {
|
|
486
|
+
clearTimeouts();
|
|
487
|
+
releasePress();
|
|
488
|
+
}, [clearTimeouts, releasePress]);
|
|
498
489
|
return {
|
|
499
490
|
ref,
|
|
500
491
|
positionRef: layerRef,
|
|
501
492
|
interactionRef,
|
|
502
493
|
anchorId: layerAnchorId,
|
|
503
494
|
describedBy: layerId,
|
|
504
|
-
renderTooltip
|
|
495
|
+
renderTooltip,
|
|
496
|
+
show,
|
|
497
|
+
hide
|
|
505
498
|
};
|
|
506
499
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAWD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EACzB,EAAE,EACF,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,IAAI,EACJ,QAAQ,EACR,IAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BAmGjB;yBApHe,UAAU"}
|
|
@@ -22,7 +22,7 @@ import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
|
22
22
|
import { useTopNavRenderMode } from "./TopNavRenderContext.js";
|
|
23
23
|
import { navItemStyles } from "../NavItem/navItemStyles.stylex.js";
|
|
24
24
|
import { mergeProps } from "../utils/index.js";
|
|
25
|
-
import {
|
|
25
|
+
import { useCloseMobileDrawerOnActivate } from "../AppShell/useCloseMobileDrawerOnActivate.js";
|
|
26
26
|
import { themeProps } from "../utils/themeProps.js";
|
|
27
27
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
28
28
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
@@ -112,9 +112,7 @@ export function TopNavItem({
|
|
|
112
112
|
const pressable = usePressFeedback();
|
|
113
113
|
const LinkComponent = useLinkComponent(as);
|
|
114
114
|
const renderMode = useTopNavRenderMode();
|
|
115
|
-
const
|
|
116
|
-
closeMobileNav
|
|
117
|
-
} = useAppShellMobile();
|
|
115
|
+
const closeDrawerAfter = useCloseMobileDrawerOnActivate(renderMode === 'drawer');
|
|
118
116
|
|
|
119
117
|
// A disabled item renders as a plain <a> with no href: an href-less anchor
|
|
120
118
|
// is not focusable and exposes no link affordance, so programmatic focus +
|
|
@@ -129,14 +127,13 @@ export function TopNavItem({
|
|
|
129
127
|
// Drawer mode — render as a SideNavItem-style vertical list element
|
|
130
128
|
// =========================================================================
|
|
131
129
|
if (renderMode === 'drawer') {
|
|
130
|
+
const activate = closeDrawerAfter(onClick);
|
|
132
131
|
const handleDrawerClick = e => {
|
|
133
132
|
if (isDisabled) {
|
|
134
133
|
preventDefaultClick(e);
|
|
135
134
|
return;
|
|
136
135
|
}
|
|
137
|
-
|
|
138
|
-
onClick?.(e);
|
|
139
|
-
closeMobileNav();
|
|
136
|
+
activate?.(e);
|
|
140
137
|
};
|
|
141
138
|
return /*#__PURE__*/_jsxs(Root, {
|
|
142
139
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavMegaMenuItem.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMegaMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAGrD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsG5C,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CACnD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,w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 @@ import { navItemStyles } from "../NavItem/navItemStyles.stylex.js";
|
|
|
22
22
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
23
23
|
import { useTopNavRenderMode } from "./TopNavRenderContext.js";
|
|
24
24
|
import { mergeProps } from "../utils/index.js";
|
|
25
|
-
import {
|
|
25
|
+
import { useCloseMobileDrawerOnActivate } from "../AppShell/useCloseMobileDrawerOnActivate.js";
|
|
26
26
|
import { themeProps } from "../utils/themeProps.js";
|
|
27
27
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
28
28
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
@@ -112,9 +112,7 @@ export function TopNavMegaMenuItem({
|
|
|
112
112
|
const pressable = usePressFeedback();
|
|
113
113
|
const renderMode = useTopNavRenderMode();
|
|
114
114
|
const LinkComponent = useLinkComponent(as);
|
|
115
|
-
const
|
|
116
|
-
closeMobileNav
|
|
117
|
-
} = useAppShellMobile();
|
|
115
|
+
const closeDrawerAfter = useCloseMobileDrawerOnActivate(renderMode === 'drawer');
|
|
118
116
|
|
|
119
117
|
// =========================================================================
|
|
120
118
|
// Drawer mode — matches SideNavItem / TopNavMenu drawer appearance
|
|
@@ -124,10 +122,9 @@ export function TopNavMegaMenuItem({
|
|
|
124
122
|
const elementProps = Element === 'button' ? {
|
|
125
123
|
type: 'button'
|
|
126
124
|
} : {};
|
|
127
|
-
const handleDrawerClick = () => {
|
|
125
|
+
const handleDrawerClick = closeDrawerAfter(() => {
|
|
128
126
|
onClick?.();
|
|
129
|
-
|
|
130
|
-
};
|
|
127
|
+
});
|
|
131
128
|
return /*#__PURE__*/_jsxs(Element, {
|
|
132
129
|
...restProps,
|
|
133
130
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAA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AC;AAqN5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,wBAAgB,UAAU,CAAC,EACzB,GAAG,EACH,KAAK,EACL,KAAK,EACL,KAAW,EACX,SAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,IAAI,EACR,EAAE,eAAe,4BAuSjB;yBApTe,UAAU"}
|
|
@@ -31,7 +31,7 @@ import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
|
31
31
|
import { navItemStyles } from "../NavItem/navItemStyles.stylex.js";
|
|
32
32
|
import { useTopNavSlot } from "./TopNavContext.js";
|
|
33
33
|
import { useTopNavRenderMode } from "./TopNavRenderContext.js";
|
|
34
|
-
import {
|
|
34
|
+
import { useCloseMobileDrawerOnActivate } from "../AppShell/useCloseMobileDrawerOnActivate.js";
|
|
35
35
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
36
36
|
import { isSafeUrl } from "../utils/safeUrl.js";
|
|
37
37
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -212,9 +212,7 @@ export function TopNavMenu({
|
|
|
212
212
|
}) {
|
|
213
213
|
const pressable = usePressFeedback();
|
|
214
214
|
const renderMode = useTopNavRenderMode();
|
|
215
|
-
const
|
|
216
|
-
closeMobileNav
|
|
217
|
-
} = useAppShellMobile();
|
|
215
|
+
const closeDrawerAfter = useCloseMobileDrawerOnActivate(renderMode === 'drawer');
|
|
218
216
|
const LinkComponent = useLinkComponent();
|
|
219
217
|
const [drawerExpanded, setDrawerExpanded] = useState(false);
|
|
220
218
|
const menuId = useId();
|
|
@@ -351,10 +349,9 @@ export function TopNavMenu({
|
|
|
351
349
|
children: items.map(item => /*#__PURE__*/_jsxs(LinkComponent, {
|
|
352
350
|
href: item.href,
|
|
353
351
|
...pressable,
|
|
354
|
-
onClick: _e => {
|
|
352
|
+
onClick: closeDrawerAfter(_e => {
|
|
355
353
|
item.onClick?.();
|
|
356
|
-
|
|
357
|
-
},
|
|
354
|
+
}),
|
|
358
355
|
...focusOutlineProps.focusVisible(navItemStyles.item, interactionOverlayStyles.backgroundColor, drawerStyles.item),
|
|
359
356
|
children: [isRenderable(item.icon) && /*#__PURE__*/_jsx("span", {
|
|
360
357
|
...{
|
|
@@ -31,7 +31,8 @@ export interface TypeaheadItemProps<T extends SearchableItem = SearchableItem> e
|
|
|
31
31
|
*/
|
|
32
32
|
isDisabled?: boolean;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* This prop has no effect. Set `item.auxiliaryData.group` on search-source
|
|
35
|
+
* items to group results in Typeahead or BaseTypeahead.
|
|
35
36
|
*/
|
|
36
37
|
group?: string;
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeaheadItem.d.ts","sourceRoot":"","sources":["../../src/Typeahead/TypeaheadItem.tsx"],"names":[],"mappings":"A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KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6CD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,cAAc,EAAE,EACtD,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAkB,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAyBvB;yBApCe,aAAa"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A channel the animator drives. `x` and `y` translate the element (px).
|
|
3
|
+
* `scale` scales it about its transform origin (1 is its size). `rotate`
|
|
4
|
+
* turns it (degrees, clockwise), and `opacity` fades it (0 to 1).
|
|
5
|
+
*/
|
|
6
|
+
export type AnimatorChannel = 'x' | 'y' | 'scale' | 'rotate' | 'opacity';
|
|
7
|
+
/**
|
|
8
|
+
* Values by channel. A velocity uses the same keys, in units per second:
|
|
9
|
+
* px/s, scale per second, deg/s, opacity per second.
|
|
10
|
+
*/
|
|
11
|
+
export type AnimatorValues = Partial<Record<AnimatorChannel, number>>;
|
|
12
|
+
/** Every channel's value (or velocity), as `get` and `getVelocity` read it. */
|
|
13
|
+
export type AnimatorSnapshot = Readonly<Record<AnimatorChannel, number>>;
|
|
14
|
+
/** Options of `AnimatorHandle.animate`. */
|
|
15
|
+
export interface AnimatorAnimateOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Each channel's velocity at the start, such as a drag's release velocity.
|
|
18
|
+
* A channel without one keeps the
|
|
19
|
+
* velocity it has on screen, so an `animate` that interrupts another
|
|
20
|
+
* carries on smoothly.
|
|
21
|
+
*/
|
|
22
|
+
velocity?: AnimatorValues;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A release velocity for `AnimatorHandle.decay`, per channel, in its units
|
|
26
|
+
* per second. That is px/s for `x` and `y`, and degrees per second for
|
|
27
|
+
* `rotate`. `scale` and `opacity` take their units per second.
|
|
28
|
+
*/
|
|
29
|
+
export type AnimatorDecayVelocity = AnimatorValues;
|
|
30
|
+
/**
|
|
31
|
+
* Animates one element. Each method acts on the channels it is given and
|
|
32
|
+
* leaves the others where they are.
|
|
33
|
+
*/
|
|
34
|
+
export interface AnimatorHandle {
|
|
35
|
+
/**
|
|
36
|
+
* Springs the given channels to `target` on the `springs.stateChange`
|
|
37
|
+
* motion role, from wherever they are on screen. The promise resolves when
|
|
38
|
+
* they arrive, or as soon as a later `animate`, `decay`, `set` or `stop`
|
|
39
|
+
* takes any of them over.
|
|
40
|
+
*/
|
|
41
|
+
animate(target: AnimatorValues, options?: AnimatorAnimateOptions): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Coasts the given channels from a release velocity, slowing as a scroll
|
|
44
|
+
* view's momentum does. It resolves when they stop, or when another call
|
|
45
|
+
* takes them over. The distance follows from the velocity alone: there are
|
|
46
|
+
* no bounds, except that opacity stops at 0 or 1.
|
|
47
|
+
*/
|
|
48
|
+
decay(velocity: AnimatorDecayVelocity): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Puts the given channels at these values at once, ending their motion:
|
|
51
|
+
* the per-frame write of a drag.
|
|
52
|
+
*/
|
|
53
|
+
set(values: AnimatorValues): void;
|
|
54
|
+
/** Every channel's value on screen now. */
|
|
55
|
+
get(): AnimatorSnapshot;
|
|
56
|
+
/** Every channel's velocity on screen now, in units per second. */
|
|
57
|
+
getVelocity(): AnimatorSnapshot;
|
|
58
|
+
/** Halts every channel where it is on screen. */
|
|
59
|
+
stop(): void;
|
|
60
|
+
}
|
|
61
|
+
/** What `createAnimator` returns: the handle, and `destroy`. */
|
|
62
|
+
export interface Animator extends AnimatorHandle {
|
|
63
|
+
/**
|
|
64
|
+
* Stops every motion and lets go of the element; the element keeps the
|
|
65
|
+
* values it shows. The animator does nothing after this.
|
|
66
|
+
*/
|
|
67
|
+
destroy(): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* An animator whose element is attached later, through `attach`. It is the
|
|
71
|
+
* one construction `createAnimator` and `useAnimator` share, so the hook has
|
|
72
|
+
* no behavior of its own. Not exported from the package.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createAttachableAnimator(): {
|
|
75
|
+
readonly animator: Animator;
|
|
76
|
+
readonly attach: (element: HTMLElement | null) => void;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Animates `element` with the motion Core uses. `animate` springs channels to
|
|
80
|
+
* a target on the state-change motion, and `decay` coasts them from a release
|
|
81
|
+
* velocity. `set` jumps them, `get` and `getVelocity` read them, `stop` halts
|
|
82
|
+
* them, and `destroy` lets the element go. Under Reduce Motion every call is
|
|
83
|
+
* planned. A move becomes a short cross-fade on a touch screen, and it lands
|
|
84
|
+
* at once with a mouse.
|
|
85
|
+
*
|
|
86
|
+
* Use one animator per element: two on one element overwrite each other.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```
|
|
90
|
+
* const card = document.querySelector('.card');
|
|
91
|
+
* const animator = createAnimator(card);
|
|
92
|
+
* await animator.animate({x: 0, rotate: 0}, {velocity: {x: -900}});
|
|
93
|
+
* animator.decay({x: 2400});
|
|
94
|
+
* animator.destroy();
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare function createAnimator(element: HTMLElement): Animator;
|
|
98
|
+
//# sourceMappingURL=createAnimator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAnimator.d.ts","sourceRoot":"","sources":["../../src/animator/createAnimator.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtE,+E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