@astryxdesign/core 0.7.7-canary.550ff21 → 0.7.7-canary.58c5b8a
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/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +1 -1
- 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 +9 -4
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +50 -5
- 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/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 +17 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +161 -20
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +63 -49
- 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 +53 -15
- 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 +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +20 -4
- 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.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- 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/layerClickBoundary.d.ts +7 -1
- package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
- package/dist/Layer/layerClickBoundary.js +2 -2
- 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 +105 -0
- package/dist/Layer/usePressPin.d.ts.map +1 -0
- package/dist/Layer/usePressPin.js +413 -0
- package/dist/Layer/useTouchTrigger.d.ts +23 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +45 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -1
- 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/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +56 -7
- 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/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +33 -6
- 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 +10 -2
- 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/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +200 -46
- package/dist/Switch/switchFill.d.ts +31 -0
- package/dist/Switch/switchFill.d.ts.map +1 -0
- package/dist/Switch/switchFill.js +88 -0
- package/dist/Switch/switchTouch.d.ts +74 -0
- package/dist/Switch/switchTouch.d.ts.map +1 -0
- package/dist/Switch/switchTouch.js +125 -0
- package/dist/Switch/useSwitchTouch.d.ts +276 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
- package/dist/Switch/useSwitchTouch.js +939 -0
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +4 -3
- 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.map +1 -1
- package/dist/Toast/Toast.js +5 -0
- 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 +44 -60
- 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 +24 -5
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +29 -5
- package/dist/Tooltip/useTooltip.d.ts +48 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +90 -20
- 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/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +26 -15
- 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 +142 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +161 -22
- package/dist/gestures/PressTracker.d.ts +6 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +3 -0
- package/dist/gestures/types.d.ts +6 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.js +1 -0
- package/dist/gestures/wheelSegmenter.d.ts +14 -3
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +32 -8
- 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 +16 -8
- package/dist/hooks/useAttachment.d.ts.map +1 -1
- package/dist/hooks/useAttachment.js +35 -15
- package/dist/hooks/useFocusTrap.d.ts +15 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +13 -2
- 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/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/hooks/usePager.d.ts +261 -0
- package/dist/hooks/usePager.d.ts.map +1 -0
- package/dist/hooks/usePager.js +1169 -0
- 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/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/paging.d.ts +16 -5
- package/dist/motion/paging.d.ts.map +1 -1
- package/dist/motion/paging.js +34 -14
- 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 +7 -4
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +7 -4
- package/dist/motion/uikit/paging.d.ts +31 -20
- package/dist/motion/uikit/paging.d.ts.map +1 -1
- package/dist/motion/uikit/paging.js +41 -11
- package/dist/motion/uikit/progressBar.d.ts +27 -7
- package/dist/motion/uikit/progressBar.d.ts.map +1 -1
- package/dist/motion/uikit/progressBar.js +31 -11
- 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 +8 -42
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +12 -42
- package/dist/motion/uikit/switch.d.ts +166 -0
- package/dist/motion/uikit/switch.d.ts.map +1 -0
- package/dist/motion/uikit/switch.js +186 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts +18 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.js +28 -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/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 +24 -6
- package/locales/en.json +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +13 -8
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
- package/src/Avatar/Avatar.tsx +3 -1
- 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 +17 -4
- package/src/Button/Button.tsx +66 -7
- 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/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +172 -14
- package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
- package/src/DateRangeInput/DateRangeInput.tsx +117 -71
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +81 -15
- package/src/Drawer/Drawer.tsx +28 -11
- package/src/Drawer/useDrawerDialogPresence.ts +9 -1
- package/src/DropdownMenu/DropdownMenu.tsx +28 -6
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.tsx +31 -1
- 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/layerClickBoundary.ts +2 -2
- package/src/Layer/useBackdropPress.ts +81 -0
- package/src/Layer/usePressPin.ts +576 -0
- package/src/Layer/useTouchTrigger.ts +56 -6
- package/src/Lightbox/Lightbox.tsx +2 -1
- 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/Popover/usePopover.tsx +71 -9
- 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/ProgressBar/ProgressBar.doc.mjs +4 -2
- package/src/ProgressBar/ProgressBar.tsx +67 -7
- 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 +14 -2
- 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/Switch/Switch.doc.mjs +3 -3
- package/src/Switch/Switch.tsx +412 -86
- package/src/Switch/switchFill.ts +106 -0
- package/src/Switch/switchTouch.ts +186 -0
- package/src/Switch/useSwitchTouch.ts +1051 -0
- package/src/TabList/Tab.tsx +5 -3
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.tsx +5 -0
- 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 +93 -88
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- package/src/Tooltip/Tooltip.doc.mjs +123 -39
- package/src/Tooltip/Tooltip.tsx +43 -9
- package/src/Tooltip/useTooltip.doc.mjs +171 -31
- package/src/Tooltip/useTooltip.tsx +137 -22
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- package/src/Typeahead/Typeahead.tsx +29 -15
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +205 -21
- package/src/gestures/PressTracker.ts +10 -0
- package/src/gestures/types.ts +6 -0
- package/src/gestures/usePressTracker.ts +2 -0
- package/src/gestures/wheelSegmenter.ts +36 -7
- 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 +56 -14
- package/src/hooks/useFocusTrap.ts +26 -2
- package/src/hooks/useHighlightedOptionScroll.ts +123 -15
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/hooks/usePager.ts +1446 -0
- 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/sheetDraft.ts +80 -0
- package/src/internal/touch-sheet.ts +21 -0
- package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
- package/src/motion/MEASUREMENTS.md +36 -27
- package/src/motion/README.md +11 -6
- package/src/motion/animator.ts +61 -29
- package/src/motion/paging.ts +37 -14
- 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 +6 -5
- package/src/motion/uikit/paging.ts +41 -10
- package/src/motion/uikit/progressBar.ts +31 -11
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +12 -42
- package/src/motion/uikit/switch.ts +174 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -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/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +24 -6
- 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
|
@@ -24,16 +24,29 @@ export const docs = {
|
|
|
24
24
|
playground: {
|
|
25
25
|
defaults: {
|
|
26
26
|
content: 'Helpful tooltip text',
|
|
27
|
-
children: {
|
|
27
|
+
children: {
|
|
28
|
+
__element: 'Button',
|
|
29
|
+
props: {label: 'Hover me', variant: 'secondary'},
|
|
30
|
+
},
|
|
28
31
|
},
|
|
29
32
|
},
|
|
30
|
-
keywords: [
|
|
33
|
+
keywords: [
|
|
34
|
+
'tooltip',
|
|
35
|
+
'hint',
|
|
36
|
+
'infotip',
|
|
37
|
+
'title',
|
|
38
|
+
'hover',
|
|
39
|
+
'flyout',
|
|
40
|
+
'balloon',
|
|
41
|
+
'helpertext',
|
|
42
|
+
],
|
|
31
43
|
components: [
|
|
32
44
|
{
|
|
33
45
|
name: 'Tooltip',
|
|
34
46
|
displayName: 'Tooltip',
|
|
35
47
|
description:
|
|
36
|
-
'Component wrapper for tooltip display triggered on hover or focus.',
|
|
48
|
+
'Component wrapper for tooltip display triggered on hover or focus.',
|
|
49
|
+
props: [
|
|
37
50
|
{
|
|
38
51
|
name: 'children',
|
|
39
52
|
type: 'ReactNode',
|
|
@@ -48,18 +61,26 @@ export const docs = {
|
|
|
48
61
|
name: 'content',
|
|
49
62
|
type: 'ReactNode',
|
|
50
63
|
description: 'Tooltip content, typically short text.',
|
|
51
|
-
slotElements: [
|
|
64
|
+
slotElements: [
|
|
65
|
+
{
|
|
66
|
+
__element: 'Text',
|
|
67
|
+
props: {type: 'body'},
|
|
68
|
+
children: 'Content text',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
52
71
|
},
|
|
53
72
|
{
|
|
54
73
|
name: 'placement',
|
|
55
74
|
type: "'above' | 'below' | 'start' | 'end'",
|
|
56
|
-
description:
|
|
75
|
+
description:
|
|
76
|
+
"Position relative to the anchor element. Logical: start/end resolve against the popover\'s own inherited direction (RTL mirrors in pure CSS).",
|
|
57
77
|
default: "'above'",
|
|
58
78
|
},
|
|
59
79
|
{
|
|
60
80
|
name: 'alignment',
|
|
61
81
|
type: "'start' | 'center' | 'end'",
|
|
62
|
-
description:
|
|
82
|
+
description:
|
|
83
|
+
"Alignment along the placement axis. Logical: start/end resolve against the popover\'s own inherited direction (RTL mirrors in pure CSS).",
|
|
63
84
|
default: "'center'",
|
|
64
85
|
},
|
|
65
86
|
{
|
|
@@ -84,7 +105,7 @@ export const docs = {
|
|
|
84
105
|
name: 'touchTrigger',
|
|
85
106
|
type: "'auto' | 'tap' | 'none'",
|
|
86
107
|
description:
|
|
87
|
-
'What a tap does where there is no hover. auto opens on tap unless the trigger performs an action of its own (a button, link, or form control), whose tap belongs to the control; an aria-disabled control performs none, so a tap on it opens its reason. tap always opens
|
|
108
|
+
'What a tap does where there is no hover. auto opens on tap unless the trigger performs an action of its own (a button, link, or form control), whose tap belongs to the control; an aria-disabled control performs none, so a tap on it opens its reason. tap always opens, for a button whose only job is to reveal the tooltip; for an info icon, use InfoTip. none never opens on touch.',
|
|
88
109
|
default: "'auto'",
|
|
89
110
|
},
|
|
90
111
|
{
|
|
@@ -108,7 +129,8 @@ export const docs = {
|
|
|
108
129
|
{
|
|
109
130
|
name: 'isDefaultOpen',
|
|
110
131
|
type: 'boolean',
|
|
111
|
-
description:
|
|
132
|
+
description:
|
|
133
|
+
'Whether the tooltip should be shown on mount. Still dismissible.',
|
|
112
134
|
},
|
|
113
135
|
{
|
|
114
136
|
name: 'isOpen',
|
|
@@ -119,20 +141,38 @@ export const docs = {
|
|
|
119
141
|
},
|
|
120
142
|
],
|
|
121
143
|
theming: {
|
|
122
|
-
targets: [
|
|
123
|
-
{className: 'astryx-tooltip'},
|
|
124
|
-
],
|
|
144
|
+
targets: [{className: 'astryx-tooltip'}],
|
|
125
145
|
},
|
|
126
146
|
usage: {
|
|
127
147
|
anatomy,
|
|
128
148
|
description:
|
|
129
149
|
'A short text hint that appears on hover or focus, anchored to a trigger element. Use it to describe icon-only buttons, show the full text of truncated labels, or provide supplementary context without cluttering the UI.',
|
|
130
150
|
bestPractices: [
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
{
|
|
152
|
+
guidance: true,
|
|
153
|
+
description:
|
|
154
|
+
'Keep tooltip content concise: aim for under 140 characters of plain text.',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
guidance: true,
|
|
158
|
+
description:
|
|
159
|
+
'Add a tooltip to icon-only buttons and controls that lack a visible label.',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
guidance: true,
|
|
163
|
+
description:
|
|
164
|
+
'Set touchTrigger to tap when the trigger is a button whose only job is revealing the tooltip: touch has no hover, and auto keeps the tap for triggers that perform an action. For an info icon, use InfoTip, which also pins its help on a press.',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
guidance: false,
|
|
168
|
+
description:
|
|
169
|
+
'Place interactive elements like links or buttons inside a tooltip; use HoverCard or Popover instead.',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
guidance: false,
|
|
173
|
+
description:
|
|
174
|
+
'Use tooltips for essential information that users must see to complete a task.',
|
|
175
|
+
},
|
|
136
176
|
],
|
|
137
177
|
},
|
|
138
178
|
};
|
|
@@ -145,8 +185,7 @@ export const docsZh = {
|
|
|
145
185
|
{
|
|
146
186
|
name: 'Tooltip',
|
|
147
187
|
displayName: 'Tooltip',
|
|
148
|
-
description:
|
|
149
|
-
'工具提示显示的组件包装器,通过悬停或聚焦触发。',
|
|
188
|
+
description: '工具提示显示的组件包装器,通过悬停或聚焦触发。',
|
|
150
189
|
props: [
|
|
151
190
|
{
|
|
152
191
|
name: 'children',
|
|
@@ -166,13 +205,15 @@ export const docsZh = {
|
|
|
166
205
|
{
|
|
167
206
|
name: 'placement',
|
|
168
207
|
type: "'above' | 'below' | 'start' | 'end'",
|
|
169
|
-
description:
|
|
208
|
+
description:
|
|
209
|
+
'相对于锚点元素的位置。逻辑值:start/end 根据弹出层自身继承的方向解析(RTL 镜像)。',
|
|
170
210
|
default: "'above'",
|
|
171
211
|
},
|
|
172
212
|
{
|
|
173
213
|
name: 'alignment',
|
|
174
214
|
type: "'start' | 'center' | 'end'",
|
|
175
|
-
description:
|
|
215
|
+
description:
|
|
216
|
+
'沿放置轴的对齐方式。逻辑值:start/end 根据弹出层自身继承的方向解析(RTL 镜像)。',
|
|
176
217
|
default: "'center'",
|
|
177
218
|
},
|
|
178
219
|
{
|
|
@@ -197,7 +238,7 @@ export const docsZh = {
|
|
|
197
238
|
name: 'touchTrigger',
|
|
198
239
|
type: "'auto' | 'tap' | 'none'",
|
|
199
240
|
description:
|
|
200
|
-
'在没有悬停的触摸设备上,轻点的行为。auto:轻点即打开,除非触发元素本身会执行操作(按钮、链接、表单控件),此时轻点归该控件所有;设置了 aria-disabled 的控件不执行操作,因此轻点它会显示其原因。tap
|
|
241
|
+
'在没有悬停的触摸设备上,轻点的行为。auto:轻点即打开,除非触发元素本身会执行操作(按钮、链接、表单控件),此时轻点归该控件所有;设置了 aria-disabled 的控件不执行操作,因此轻点它会显示其原因。tap:始终轻点打开,适用于唯一作用是显示工具提示的按钮;信息图标请使用 InfoTip。none:触摸永不打开。',
|
|
201
242
|
default: "'auto'",
|
|
202
243
|
},
|
|
203
244
|
{
|
|
@@ -227,37 +268,76 @@ export const docsZh = {
|
|
|
227
268
|
},
|
|
228
269
|
],
|
|
229
270
|
theming: {
|
|
230
|
-
targets: [
|
|
231
|
-
{className: 'astryx-tooltip'},
|
|
232
|
-
],
|
|
271
|
+
targets: [{className: 'astryx-tooltip'}],
|
|
233
272
|
},
|
|
234
273
|
usage: {
|
|
235
274
|
anatomy,
|
|
236
275
|
description:
|
|
237
276
|
'A short text hint that appears on hover or focus, anchored to a trigger element. Use it to describe icon-only buttons, show the full text of truncated labels, or provide supplementary context without cluttering the UI.',
|
|
238
277
|
bestPractices: [
|
|
239
|
-
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
278
|
+
{
|
|
279
|
+
guidance: true,
|
|
280
|
+
description:
|
|
281
|
+
'Keep tooltip content concise: aim for under 140 characters of plain text.',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
guidance: true,
|
|
285
|
+
description:
|
|
286
|
+
'Add a tooltip to icon-only buttons and controls that lack a visible label.',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
guidance: true,
|
|
290
|
+
description:
|
|
291
|
+
'Set touchTrigger to tap when the trigger is a button whose only job is revealing the tooltip: touch has no hover, and auto keeps the tap for triggers that perform an action. For an info icon, use InfoTip, which also pins its help on a press.',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
guidance: false,
|
|
295
|
+
description:
|
|
296
|
+
'Place interactive elements like links or buttons inside a tooltip; use HoverCard or Popover instead.',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
guidance: false,
|
|
300
|
+
description:
|
|
301
|
+
'Use tooltips for essential information that users must see to complete a task.',
|
|
302
|
+
},
|
|
244
303
|
],
|
|
245
304
|
},
|
|
246
305
|
};
|
|
247
306
|
|
|
248
307
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
249
308
|
export const docsDense = {
|
|
250
|
-
description:
|
|
309
|
+
description:
|
|
310
|
+
'Hover/focus triggered tooltip for displaying short, non-interactive text anchored to trigger element.',
|
|
251
311
|
usage: {
|
|
252
312
|
anatomy,
|
|
253
313
|
description:
|
|
254
314
|
'A short text hint that appears on hover or focus, anchored to a trigger element. Use it to describe icon-only buttons, show the full text of truncated labels, or provide supplementary context without cluttering the UI.',
|
|
255
315
|
bestPractices: [
|
|
256
|
-
{
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
316
|
+
{
|
|
317
|
+
guidance: true,
|
|
318
|
+
description:
|
|
319
|
+
'Keep tooltip content concise: aim for under 140 characters of plain text.',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
guidance: true,
|
|
323
|
+
description:
|
|
324
|
+
'Add a tooltip to icon-only buttons and controls that lack a visible label.',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
guidance: true,
|
|
328
|
+
description:
|
|
329
|
+
'Set touchTrigger to tap when the trigger is a button whose only job is revealing the tooltip: touch has no hover, and auto keeps the tap for triggers that perform an action. For an info icon, use InfoTip, which also pins its help on a press.',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
guidance: false,
|
|
333
|
+
description:
|
|
334
|
+
'Place interactive elements like links or buttons inside a tooltip; use HoverCard or Popover instead.',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
guidance: false,
|
|
338
|
+
description:
|
|
339
|
+
'Use tooltips for essential information that users must see to complete a task.',
|
|
340
|
+
},
|
|
261
341
|
],
|
|
262
342
|
},
|
|
263
343
|
components: [
|
|
@@ -269,14 +349,18 @@ export const docsDense = {
|
|
|
269
349
|
children: 'Trigger element(s) that activate tooltip.',
|
|
270
350
|
anchorRef: 'External anchor ref for sibling mode.',
|
|
271
351
|
content: 'Tooltip content, typically short text.',
|
|
272
|
-
placement:
|
|
273
|
-
|
|
352
|
+
placement:
|
|
353
|
+
"Position relative to anchor. Logical: start/end follow the popover's inherited direction (RTL mirrors).",
|
|
354
|
+
alignment:
|
|
355
|
+
"Alignment along placement axis. Logical: start/end follow the popover's inherited direction (RTL mirrors).",
|
|
274
356
|
delay: 'Show delay in ms.',
|
|
275
357
|
hideDelay: 'Hide delay in ms.',
|
|
276
358
|
focusTrigger: 'Controls when focus events trigger tooltip.',
|
|
277
|
-
touchTrigger:
|
|
359
|
+
touchTrigger:
|
|
360
|
+
'Tap behavior where there is no hover. auto = tap opens unless the trigger acts (button/link/control; an aria-disabled control does not act); tap = always opens (a button whose only job is the tooltip; for an info icon use InfoTip); none = never on touch.',
|
|
278
361
|
isEnabled: 'Enables/disables tooltip triggers.',
|
|
279
|
-
onOpenChange:
|
|
362
|
+
onOpenChange:
|
|
363
|
+
'Callback when visibility changes; true=shown, false=hidden.',
|
|
280
364
|
hasHoverIndication: 'Dashed underline on trigger element.',
|
|
281
365
|
isDefaultOpen: 'Show tooltip on mount. Still dismissible.',
|
|
282
366
|
},
|
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Tooltip.tsx
|
|
7
7
|
* @input Uses React, useTooltip hook
|
|
8
|
-
* @output Exports Tooltip component for hover/focus triggered tooltips
|
|
8
|
+
* @output Exports Tooltip component for hover/focus triggered tooltips, and the
|
|
9
|
+
* module-only TooltipWithTriggerBehavior that InfoTip's press-to-pin uses
|
|
9
10
|
* @position Layer component; uses display:contents wrapper to avoid cloneElement
|
|
10
11
|
*
|
|
11
12
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -23,10 +24,14 @@ import React, {
|
|
|
23
24
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
24
25
|
import * as stylex from '@stylexjs/stylex';
|
|
25
26
|
import {
|
|
26
|
-
|
|
27
|
+
useTooltipWithTriggerBehavior,
|
|
27
28
|
type TooltipFocusTrigger,
|
|
28
29
|
type TooltipTouchTrigger,
|
|
29
30
|
} from './useTooltip';
|
|
31
|
+
import {
|
|
32
|
+
stopPressPinClick,
|
|
33
|
+
type LayerTriggerBehavior,
|
|
34
|
+
} from '../Layer/usePressPin';
|
|
30
35
|
import type {LayerAlignment, LayerPlacement} from '../Layer/useLayer';
|
|
31
36
|
import {colorVars} from '../theme/tokens.stylex';
|
|
32
37
|
|
|
@@ -109,9 +114,7 @@ export interface TooltipProps {
|
|
|
109
114
|
* - `auto`: tap opens the tooltip, unless the trigger performs an action of
|
|
110
115
|
* its own (a button, a link, a form control) — that tap belongs to the
|
|
111
116
|
* control, and a hint about a control the user just operated is noise
|
|
112
|
-
* - `tap`: tap always opens the tooltip
|
|
113
|
-
* as a button wants: it looks like an action to the DOM, but revealing the
|
|
114
|
-
* tooltip is the only thing it does
|
|
117
|
+
* - `tap`: tap always opens the tooltip, even on a trigger that acts
|
|
115
118
|
* - `none`: touch never opens the tooltip
|
|
116
119
|
*
|
|
117
120
|
* @default 'auto'
|
|
@@ -191,7 +194,32 @@ function mergeIds(...ids: (string | undefined | null)[]): string | undefined {
|
|
|
191
194
|
* </Tooltip>
|
|
192
195
|
* ```
|
|
193
196
|
*/
|
|
194
|
-
export function Tooltip({
|
|
197
|
+
export function Tooltip(props: TooltipProps): ReactElement {
|
|
198
|
+
// The option is fixed to `adaptive`, so a spread object that carries it at
|
|
199
|
+
// runtime cannot reach the press-to-pin path.
|
|
200
|
+
return <TooltipWithTriggerBehavior {...props} triggerBehavior="adaptive" />;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Module-only props for `TooltipWithTriggerBehavior`. Not exported from the
|
|
205
|
+
* package.
|
|
206
|
+
*/
|
|
207
|
+
export interface TooltipWithTriggerBehaviorProps extends TooltipProps {
|
|
208
|
+
/**
|
|
209
|
+
* How the trigger opens the tooltip. `toggle` pins it on a click, a tap,
|
|
210
|
+
* Enter, or Space on a button trigger, and stops that press at the trigger
|
|
211
|
+
* (see `useTooltipWithTriggerBehavior`). InfoTip uses it.
|
|
212
|
+
*
|
|
213
|
+
* @default 'adaptive'
|
|
214
|
+
*/
|
|
215
|
+
triggerBehavior?: LayerTriggerBehavior;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* `Tooltip` with a trigger behavior. Module-only: InfoTip's press-to-pin goes
|
|
220
|
+
* through it, and the package does not export it.
|
|
221
|
+
*/
|
|
222
|
+
export function TooltipWithTriggerBehavior({
|
|
195
223
|
children,
|
|
196
224
|
anchorRef,
|
|
197
225
|
content,
|
|
@@ -201,12 +229,13 @@ export function Tooltip({
|
|
|
201
229
|
hideDelay = 0,
|
|
202
230
|
focusTrigger = 'auto',
|
|
203
231
|
touchTrigger = 'auto',
|
|
232
|
+
triggerBehavior = 'adaptive',
|
|
204
233
|
isEnabled = true,
|
|
205
234
|
onOpenChange,
|
|
206
235
|
hasHoverIndication = 'auto',
|
|
207
236
|
isOpen,
|
|
208
237
|
isDefaultOpen,
|
|
209
|
-
}:
|
|
238
|
+
}: TooltipWithTriggerBehaviorProps): ReactElement {
|
|
210
239
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
211
240
|
const textOnly = children != null ? isTextOnly(children) : false;
|
|
212
241
|
|
|
@@ -223,13 +252,14 @@ export function Tooltip({
|
|
|
223
252
|
}, [onOpenChange]);
|
|
224
253
|
|
|
225
254
|
// Use the hook for all tooltip behavior
|
|
226
|
-
const tooltip =
|
|
255
|
+
const tooltip = useTooltipWithTriggerBehavior({
|
|
227
256
|
placement,
|
|
228
257
|
alignment,
|
|
229
258
|
delay,
|
|
230
259
|
hideDelay,
|
|
231
260
|
focusTrigger,
|
|
232
261
|
touchTrigger,
|
|
262
|
+
triggerBehavior,
|
|
233
263
|
isEnabled,
|
|
234
264
|
isOpen,
|
|
235
265
|
isDefaultOpen,
|
|
@@ -343,6 +373,7 @@ export function Tooltip({
|
|
|
343
373
|
ref={tooltip.ref}
|
|
344
374
|
tabIndex={0}
|
|
345
375
|
aria-describedby={tooltip.describedBy}
|
|
376
|
+
onClick={stopPressPinClick}
|
|
346
377
|
{...stylex.props(
|
|
347
378
|
styles.wrapperInline,
|
|
348
379
|
showHoverIndication && styles.hoverIndication,
|
|
@@ -357,7 +388,10 @@ export function Tooltip({
|
|
|
357
388
|
// For element children: use display:contents, ref on first child
|
|
358
389
|
return (
|
|
359
390
|
<>
|
|
360
|
-
<div
|
|
391
|
+
<div
|
|
392
|
+
ref={wrapperRef}
|
|
393
|
+
onClick={stopPressPinClick}
|
|
394
|
+
{...stylex.props(styles.wrapperContents)}>
|
|
361
395
|
{children}
|
|
362
396
|
</div>
|
|
363
397
|
{tooltip.renderTooltip(content)}
|
|
@@ -7,32 +7,146 @@ export const docs = {
|
|
|
7
7
|
group: 'Tooltip',
|
|
8
8
|
keywords: ['tooltip', 'hint', 'label', 'hover', 'info', 'title', 'floating'],
|
|
9
9
|
params: [
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
{
|
|
11
|
+
name: 'placement',
|
|
12
|
+
type: "'above' | 'below' | 'start' | 'end'",
|
|
13
|
+
description:
|
|
14
|
+
"Position relative to the trigger. Logical: start/end resolve against the popover\'s own inherited direction (RTL mirrors in pure CSS).",
|
|
15
|
+
default: "'above'",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'alignment',
|
|
19
|
+
type: "'start' | 'center' | 'end'",
|
|
20
|
+
description:
|
|
21
|
+
"Alignment along the placement axis. Logical: start/end resolve against the popover\'s own inherited direction (RTL mirrors in pure CSS).",
|
|
22
|
+
default: "'center'",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'delay',
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: 'Delay before showing on hover, in milliseconds.',
|
|
28
|
+
default: '200',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'hideDelay',
|
|
32
|
+
type: 'number',
|
|
33
|
+
description:
|
|
34
|
+
'Delay before hiding after mouse or focus leaves, in milliseconds.',
|
|
35
|
+
default: '0',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'focusTrigger',
|
|
39
|
+
type: "'auto' | 'always' | 'never'",
|
|
40
|
+
description:
|
|
41
|
+
'When focus should open the tooltip. auto opens when the trigger itself takes focus, or focus lands inside a trigger that is focusable at that moment, so a roving-tabindex member opens when the arrow keys reach it.',
|
|
42
|
+
default: "'auto'",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'touchTrigger',
|
|
46
|
+
type: "'auto' | 'tap' | 'none'",
|
|
47
|
+
description:
|
|
48
|
+
'What a tap does where there is no hover. auto opens on tap unless the trigger performs an action of its own (an aria-disabled control performs none); tap always opens (a button whose only job is revealing the tooltip); none never opens on touch.',
|
|
49
|
+
default: "'auto'",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'isEnabled',
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
description: 'Whether hover and focus triggers are enabled.',
|
|
55
|
+
default: 'true',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'isOpen',
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
description:
|
|
61
|
+
'Controlled open state. true force-shows, false force-hides, undefined lets hover/focus manage visibility.',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'isDefaultOpen',
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
description: 'Whether the tooltip should be shown on mount.',
|
|
67
|
+
default: 'false',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'onShow',
|
|
71
|
+
type: '() => void',
|
|
72
|
+
description: 'Callback fired when the tooltip becomes visible.',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'onHide',
|
|
76
|
+
type: '() => void',
|
|
77
|
+
description: 'Callback fired when the tooltip is hidden.',
|
|
78
|
+
},
|
|
21
79
|
],
|
|
22
80
|
returns: [
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
81
|
+
{
|
|
82
|
+
name: 'ref',
|
|
83
|
+
type: 'RefCallback<HTMLElement>',
|
|
84
|
+
description:
|
|
85
|
+
'Combined ref that sets both position and interaction on the same trigger element.',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'positionRef',
|
|
89
|
+
type: 'RefCallback<HTMLElement>',
|
|
90
|
+
description: 'Ref for the positioning anchor element.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'interactionRef',
|
|
94
|
+
type: 'RefCallback<HTMLElement>',
|
|
95
|
+
description: 'Ref for the hover/focus interaction element.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'anchorId',
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: 'CSS anchor name for advanced positioning cases.',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'describedBy',
|
|
104
|
+
type: 'string',
|
|
105
|
+
description: 'ID to compose into aria-describedby on the trigger.',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'renderTooltip',
|
|
109
|
+
type: "(children: ReactNode, props?: Omit<ContextRenderProps, 'positioning'>) => ReactNode",
|
|
110
|
+
description:
|
|
111
|
+
'Render function for the anchor-positioned tooltip content. The positioning opt-out is excluded: the tooltip always derives its position from placement/alignment.',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'show',
|
|
115
|
+
type: '() => void',
|
|
116
|
+
description:
|
|
117
|
+
'Opens the tooltip now and keeps it open until hide(), Escape, a press outside, or focus leaving its trigger. Its text is announced once, and onShow fires. Under a controlled isOpen it only calls onShow. Does nothing while isEnabled is false.',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'hide',
|
|
121
|
+
type: '() => void',
|
|
122
|
+
description:
|
|
123
|
+
'Closes the tooltip now, and onHide fires. Under a controlled isOpen it only calls onHide.',
|
|
124
|
+
},
|
|
29
125
|
],
|
|
30
126
|
usage: {
|
|
31
|
-
description:
|
|
127
|
+
description:
|
|
128
|
+
'Headless hook for hover/focus-triggered tooltips. Builds on useLayer with hover intent, keyboard focus handling, and accessible aria-describedby linking. Use for custom trigger elements that need tooltip behavior without the wrapper component.',
|
|
32
129
|
bestPractices: [
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
130
|
+
{
|
|
131
|
+
guidance: true,
|
|
132
|
+
description:
|
|
133
|
+
'Use for brief text labels that describe icon buttons, truncated text, abbreviations, or compact controls.',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
guidance: true,
|
|
137
|
+
description:
|
|
138
|
+
'Prefer the Tooltip component for standard wrapping; use the hook when the trigger is not a simple child.',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
guidance: true,
|
|
142
|
+
description:
|
|
143
|
+
'For a toggle-style trigger, have your own button call show() and hide() on each press. Give it aria-describedby and aria-controls set to describedBy, and aria-expanded (true while show() holds the tooltip, false after hide() or onHide), and keep its own accessible name. For an info icon, use InfoTip instead.',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
guidance: false,
|
|
147
|
+
description:
|
|
148
|
+
'Put interactive content inside tooltips: use Popover or HoverCard instead.',
|
|
149
|
+
},
|
|
36
150
|
],
|
|
37
151
|
},
|
|
38
152
|
relatedComponents: ['Tooltip', 'HoverCard', 'Popover'],
|
|
@@ -43,16 +157,22 @@ export const docs = {
|
|
|
43
157
|
|
|
44
158
|
/** @type {import('@astryxdesign/cli/authoring').HookTranslationDoc} */
|
|
45
159
|
export const docsDense = {
|
|
46
|
-
description:
|
|
160
|
+
description:
|
|
161
|
+
'Headless hover/focus tooltip hook. Builds on useLayer w/ hover intent, keyboard focus handling, aria-describedby. Use for custom triggers without wrapper component.',
|
|
47
162
|
paramDescriptions: {
|
|
48
|
-
placement:
|
|
49
|
-
|
|
163
|
+
placement:
|
|
164
|
+
"position relative to trigger. logical: start/end follow the popover's inherited direction (RTL mirrors).",
|
|
165
|
+
alignment:
|
|
166
|
+
"alignment along placement axis. logical: start/end follow the popover's inherited direction (RTL mirrors).",
|
|
50
167
|
delay: 'show delay in ms.',
|
|
51
168
|
hideDelay: 'hide delay after mouse/focus leave in ms.',
|
|
52
|
-
focusTrigger:
|
|
53
|
-
|
|
169
|
+
focusTrigger:
|
|
170
|
+
'when focus opens tooltip; auto = focus on the trigger, or inside a trigger focusable when focus arrives.',
|
|
171
|
+
touchTrigger:
|
|
172
|
+
'tap behavior with no hover; auto = tap unless trigger acts, tap = always, none = never.',
|
|
54
173
|
isEnabled: 'whether hover/focus triggers are enabled.',
|
|
55
|
-
isOpen:
|
|
174
|
+
isOpen:
|
|
175
|
+
'controlled open state: true force-show, false force-hide, undefined unmanaged.',
|
|
56
176
|
isDefaultOpen: 'show on mount.',
|
|
57
177
|
onShow: 'fires when tooltip becomes visible.',
|
|
58
178
|
onHide: 'fires when tooltip hides.',
|
|
@@ -64,13 +184,33 @@ export const docsDense = {
|
|
|
64
184
|
anchorId: 'CSS anchor name.',
|
|
65
185
|
describedBy: 'ID for aria-describedby.',
|
|
66
186
|
renderTooltip: 'renders anchor-positioned tooltip content.',
|
|
187
|
+
show: 'opens + holds until hide()/Escape/outside press/focus leave; announces once; onShow. Controlled: onShow only. No-op when disabled.',
|
|
188
|
+
hide: 'closes; onHide. Controlled: onHide only.',
|
|
67
189
|
},
|
|
68
190
|
usage: {
|
|
69
|
-
description:
|
|
191
|
+
description:
|
|
192
|
+
'Headless hover/focus tooltip hook. Builds on useLayer w/ hover intent, keyboard focus handling, aria-describedby. Use for custom triggers without wrapper component.',
|
|
70
193
|
bestPractices: [
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
194
|
+
{
|
|
195
|
+
guidance: true,
|
|
196
|
+
description:
|
|
197
|
+
'Use for brief text labels describing icon buttons, truncated text, abbreviations, compact controls.',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
guidance: true,
|
|
201
|
+
description:
|
|
202
|
+
'Prefer Tooltip for standard wrapping; use hook when trigger is not simple child.',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
guidance: true,
|
|
206
|
+
description:
|
|
207
|
+
'Toggle-style trigger: own button calls show()/hide() per press, sets aria-describedby + aria-controls={describedBy}, aria-expanded (true while held), keeps its own name. Info icon: use InfoTip.',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
guidance: false,
|
|
211
|
+
description:
|
|
212
|
+
'Put interactive content in tooltips: use Popover / HoverCard instead.',
|
|
213
|
+
},
|
|
74
214
|
],
|
|
75
215
|
},
|
|
76
216
|
};
|