@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
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file useSegmentedSelectionMotion.ts
|
|
3
|
+
* @input The radiogroup, the selected value, the presentation and tracking
|
|
4
|
+
* flags; the animator, the UIKit table and the touch tracking
|
|
5
|
+
* @output Exports `useSegmentedSelectionMotion`, `SegmentedSelectionMotion`,
|
|
6
|
+
* the layer custom properties and the segment and title selectors
|
|
7
|
+
* @position SegmentedControl's touch layer
|
|
8
|
+
*
|
|
9
|
+
* SYNC: When modified, update:
|
|
10
|
+
* - /packages/core/src/SegmentedControl/SegmentedControl.tsx (the pseudo-elements)
|
|
11
|
+
* - /packages/core/src/SegmentedControl/SegmentedControlItem.tsx (the title marker)
|
|
12
|
+
* - /packages/core/src/SegmentedControl/useSegmentedTouchTracking.ts
|
|
13
|
+
*/
|
|
14
|
+
import { type RefCallback, type RefObject } from 'react';
|
|
15
|
+
import { type Animator } from '../motion/animator.js';
|
|
16
|
+
/** The segments, in DOM order. */
|
|
17
|
+
export declare const SEGMENT_SELECTOR = "[role=\"radio\"][data-value]";
|
|
18
|
+
/** The selected surface's paint, copied into a layer's custom properties. */
|
|
19
|
+
export declare const SURFACE_PROPERTIES: ReadonlyArray<string>;
|
|
20
|
+
/**
|
|
21
|
+
* The radiogroup's two pseudo-element layers: the lens (::before) and the
|
|
22
|
+
* ::after, which under Reduced Motion shows the surface that fades out where
|
|
23
|
+
* it is.
|
|
24
|
+
*/
|
|
25
|
+
export type Layer = 'lens' | 'after';
|
|
26
|
+
/** Box and visibility of a layer, besides its paint. */
|
|
27
|
+
export declare const LAYER_GEOMETRY: ReadonlyArray<string>;
|
|
28
|
+
/** The custom property on the radiogroup that sets `property` of `layer`. */
|
|
29
|
+
export declare function layerVariable(layer: Layer, property: string): string;
|
|
30
|
+
/** What the control reads of its selection motion. */
|
|
31
|
+
export interface SegmentedSelection {
|
|
32
|
+
/**
|
|
33
|
+
* A press is down on the control (any pointer's), or its tap's click has
|
|
34
|
+
* not run yet. The press commits through that click, so a focus move it
|
|
35
|
+
* causes selects nothing.
|
|
36
|
+
*/
|
|
37
|
+
readonly isPressing: () => boolean;
|
|
38
|
+
/** A key went down: a focus move it causes is the keyboard's, and selects. */
|
|
39
|
+
readonly keyPressed: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface SegmentedSelectionMotionOptions {
|
|
42
|
+
/** The animator's clock (ms, document timeline); `performance.now()` by default. */
|
|
43
|
+
readonly now?: () => number;
|
|
44
|
+
/**
|
|
45
|
+
* The animator for the radiogroup's ::after (the surface that fades out
|
|
46
|
+
* under Reduced Motion); one of its own by default.
|
|
47
|
+
*/
|
|
48
|
+
readonly afterAnimator?: Animator;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The selection motion of one SegmentedControl, as UIKit's segmented control
|
|
52
|
+
* moves it. It lives outside React's render cycle. Nothing here sets state,
|
|
53
|
+
* so a slide never re-renders anything.
|
|
54
|
+
*
|
|
55
|
+
* At rest, the selected segment paints its own surface, so themes style it
|
|
56
|
+
* as before. For a slide, the lens takes over. The lens is the radiogroup's
|
|
57
|
+
* ::before, painted from custom properties copied from the segment's
|
|
58
|
+
* computed surface. The segment hides its own surface inline, so a theme
|
|
59
|
+
* rule cannot keep it painted. The lens moves with `translate` and `scale`
|
|
60
|
+
* on the compositor animator. Nothing lays out or paints per frame, and the
|
|
61
|
+
* slide keeps moving while JavaScript is busy. The lens lays out on the
|
|
62
|
+
* destination's box. It lands at translate 0 and scale 1 and hands the
|
|
63
|
+
* surface back pixel for pixel. Its position and its size run on separate
|
|
64
|
+
* springs, as UIKit's do. A change mid-flight starts from the presented
|
|
65
|
+
* geometry and its velocities. The titles change with the selection, at
|
|
66
|
+
* once.
|
|
67
|
+
*
|
|
68
|
+
* Under a finger:
|
|
69
|
+
* - A theme role owns a pressed thumb's lift, so a press on the selected
|
|
70
|
+
* segment lifts nothing here.
|
|
71
|
+
* - A drag from the selected segment carries the lens at its resting size.
|
|
72
|
+
* Its center chases the finger, at most `dragOvershoot` past the end
|
|
73
|
+
* segments.
|
|
74
|
+
* - The selected title's color follows the lens's center. It moves to a
|
|
75
|
+
* neighbor only once the center is a quarter of that segment past the
|
|
76
|
+
* boundary. Every title keeps its weight until the lift.
|
|
77
|
+
* - The lift commits the segment nearest the finger, through that segment's
|
|
78
|
+
* click. A lift outside the control commits nothing, and the lens settles
|
|
79
|
+
* back.
|
|
80
|
+
* - A press on another segment leaves the lens in place until the lift.
|
|
81
|
+
* Meanwhile that segment shows the shared pressed overlay.
|
|
82
|
+
* - A click that the item cancels sends the lens back at once. Otherwise the
|
|
83
|
+
* lens waits for the new value, which a parent can adopt later. It goes
|
|
84
|
+
* back only if the slide settles without the new value.
|
|
85
|
+
* - A cancelled touch puts the lens back.
|
|
86
|
+
*
|
|
87
|
+
* Under a mouse or a pen, the same press commits the same segment, but the
|
|
88
|
+
* theme owns the timing. A click, a key or a new value slides the lens on the
|
|
89
|
+
* theme's duration and easing, as the segments' own transition does. A drag
|
|
90
|
+
* from the selected segment carries the lens on the pointer itself.
|
|
91
|
+
*
|
|
92
|
+
* Under Reduced Motion, a held lens still follows the pointer: that is direct
|
|
93
|
+
* movement, not a transition. Nothing else chases, travels or scales. The lens
|
|
94
|
+
* fades in at the new segment while ::after, painted with the old surface,
|
|
95
|
+
* fades out in place. With a fine pointer under Reduce Motion, a change shows
|
|
96
|
+
* through the theme's transition.
|
|
97
|
+
*/
|
|
98
|
+
export declare class SegmentedSelectionMotion {
|
|
99
|
+
private readonly animator;
|
|
100
|
+
private track;
|
|
101
|
+
private carried;
|
|
102
|
+
/**
|
|
103
|
+
* Segments whose surface the lens carried until a change turned it
|
|
104
|
+
* elsewhere. They keep their surface hidden until the lens lands. A tap's
|
|
105
|
+
* press paint can still fade on such a segment. That paint would cover the
|
|
106
|
+
* lens, which sits under the segments' backgrounds, while the lens crosses
|
|
107
|
+
* it.
|
|
108
|
+
*/
|
|
109
|
+
private readonly abandoned;
|
|
110
|
+
/** The segment showing the selected face under a dragging finger. */
|
|
111
|
+
private facedSegment;
|
|
112
|
+
/** The frame request that keeps the face on the lens while it is carried. */
|
|
113
|
+
private lensFrame;
|
|
114
|
+
/** Titles wearing the other face's color during a drag. */
|
|
115
|
+
private readonly faceOverrides;
|
|
116
|
+
/** The motions the hand-back waits for. */
|
|
117
|
+
private readonly running;
|
|
118
|
+
/** A finger holds the lens: a drag from the selected segment carries it. */
|
|
119
|
+
private isHeld;
|
|
120
|
+
/**
|
|
121
|
+
* The touch presentation applies (a coarse primary pointer), so every
|
|
122
|
+
* change slides on UIKit's springs. When it is off, a change slides on the
|
|
123
|
+
* theme's duration and easing, as the segments' transition does. A drag from
|
|
124
|
+
* the selected segment carries the lens on the pointer itself.
|
|
125
|
+
*/
|
|
126
|
+
private isPresenting;
|
|
127
|
+
/**
|
|
128
|
+
* Segments whose own transitions are off while a fine pointer's carry is
|
|
129
|
+
* on screen, with their own inline values to give back.
|
|
130
|
+
*/
|
|
131
|
+
private readonly stilled;
|
|
132
|
+
/** The frame request that gives the stilled segments their transitions back. */
|
|
133
|
+
private thawFrame;
|
|
134
|
+
private touch;
|
|
135
|
+
/**
|
|
136
|
+
* The value a touch already moved the lens to: the selection change that
|
|
137
|
+
* follows (the controlled value coming back) re-aims the lens.
|
|
138
|
+
*/
|
|
139
|
+
private committed;
|
|
140
|
+
/**
|
|
141
|
+
* The commit's click ran without a veto: the lens waits for the value
|
|
142
|
+
* until the slide settles.
|
|
143
|
+
*/
|
|
144
|
+
private isAwaitingValue;
|
|
145
|
+
/** The motion a release starts once its commit's click has run. */
|
|
146
|
+
private pending;
|
|
147
|
+
/** The last release was a finger's (decline and re-aim follow it). */
|
|
148
|
+
private releasedByFinger;
|
|
149
|
+
/** The ::after shows the leaving surface (Reduced Motion). */
|
|
150
|
+
private isLeavingShown;
|
|
151
|
+
/** Bumped by every leaving fade; a finished fade clears only its own. */
|
|
152
|
+
private leaving;
|
|
153
|
+
private readonly now;
|
|
154
|
+
/** The ::after: the surface fading out under Reduced Motion. */
|
|
155
|
+
private readonly after;
|
|
156
|
+
constructor(animator?: Animator, options?: SegmentedSelectionMotionOptions);
|
|
157
|
+
/** Attaches the radiogroup whose pseudo-elements are the lens (null detaches). */
|
|
158
|
+
attachTrack(element: HTMLElement | null): void;
|
|
159
|
+
/** True while the lens carries the selected surface. */
|
|
160
|
+
get isSliding(): boolean;
|
|
161
|
+
/** A press (any pointer's) is down on the control, from landing to letting go. */
|
|
162
|
+
get isPressed(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Whether the touch presentation applies. Off, under a fine primary
|
|
165
|
+
* pointer, a change slides on the theme's timing, and a drag from the
|
|
166
|
+
* selected segment still carries the lens. A change of presentation hands
|
|
167
|
+
* anything in flight back.
|
|
168
|
+
*/
|
|
169
|
+
present(isPresenting: boolean): void;
|
|
170
|
+
/** The segment that commits `value`, if the track has one. */
|
|
171
|
+
segmentFor(track: HTMLElement, value: string): HTMLElement | null;
|
|
172
|
+
/** The selection moved from `from` to `to`; the DOM already shows `to`. */
|
|
173
|
+
select(track: HTMLElement, from: string, to: string): void;
|
|
174
|
+
/**
|
|
175
|
+
* Whether a change of value slides the lens. A fine pointer under Reduce
|
|
176
|
+
* Motion leaves the change to the theme's transition.
|
|
177
|
+
*/
|
|
178
|
+
private slidesChanges;
|
|
179
|
+
/**
|
|
180
|
+
* A press landed on `origin`, the segment the action-group tracker resolved
|
|
181
|
+
* for it (null: none). It reads the track's geometry and title faces once.
|
|
182
|
+
* Under Reduced Motion a finger's release cross-fades.
|
|
183
|
+
*/
|
|
184
|
+
begin(track: HTMLElement, origin: HTMLElement | null, isFinger?: boolean): void;
|
|
185
|
+
/**
|
|
186
|
+
* The finger moved to `clientX`. A drag from the selected segment carries
|
|
187
|
+
* the lens at its resting size. A touch elsewhere leaves the lens alone,
|
|
188
|
+
* and that segment shows the shared pressed overlay.
|
|
189
|
+
*/
|
|
190
|
+
drag(clientX: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* The first move of a drag from the selected segment binds the lens there,
|
|
193
|
+
* at its resting size. Under Reduced Motion too: the lens follows the hand,
|
|
194
|
+
* and only the release cross-fades.
|
|
195
|
+
*/
|
|
196
|
+
private hold;
|
|
197
|
+
/**
|
|
198
|
+
* The selected face follows the held lens: it goes to the segment under the
|
|
199
|
+
* lens's presented center. Hysteresis around each boundary keeps a finger
|
|
200
|
+
* that rests on a boundary from flipping it. This runs every frame while
|
|
201
|
+
* the lens is held, so the face keeps up as the lens settles under a still
|
|
202
|
+
* finger.
|
|
203
|
+
*/
|
|
204
|
+
private followLens;
|
|
205
|
+
/** The held lens's center chases the finger at `clientX`. */
|
|
206
|
+
private chase;
|
|
207
|
+
/**
|
|
208
|
+
* The finger let go on `target`, the segment the tracker resolved for it
|
|
209
|
+
* (null: none, or a disabled one). Moves the lens there and returns its
|
|
210
|
+
* value when it is not the selected one (the tracker's lift commits it
|
|
211
|
+
* through its click), else null.
|
|
212
|
+
*/
|
|
213
|
+
release(target: HTMLElement | null): string | null;
|
|
214
|
+
/**
|
|
215
|
+
* The commit's click for `value` has run. A click that the item's
|
|
216
|
+
* `onClick` cancels sends the lens back at once. Otherwise the lens waits
|
|
217
|
+
* for the value, which a parent can adopt later.
|
|
218
|
+
*/
|
|
219
|
+
clicked(track: HTMLElement, value: string, isCancelled: boolean): void;
|
|
220
|
+
/**
|
|
221
|
+
* The value the finger let go on was not adopted. The item's `onClick`
|
|
222
|
+
* cancelled it, or a controlled parent kept its value. The lens goes back
|
|
223
|
+
* to the selected segment. The next change to that value slides as any
|
|
224
|
+
* change does.
|
|
225
|
+
*/
|
|
226
|
+
decline(track: HTMLElement, value: string): void;
|
|
227
|
+
/** The touch was taken away (the page scrolled): the lens goes back. */
|
|
228
|
+
cancel(): void;
|
|
229
|
+
/** Hands the surface back to its segment now and hides the lens. */
|
|
230
|
+
settle(): void;
|
|
231
|
+
/**
|
|
232
|
+
* The control resized. The lens aims at boxes measured when its motion
|
|
233
|
+
* began, so it hands the surface back rather than land somewhere stale.
|
|
234
|
+
* Two cases keep the motion. In the first, the track keeps its measured
|
|
235
|
+
* size: a new title weight resized a content-sized control before the box
|
|
236
|
+
* was measured. In the second, a finger holds the lens.
|
|
237
|
+
*/
|
|
238
|
+
resized(track: HTMLElement): void;
|
|
239
|
+
/**
|
|
240
|
+
* Ends everything in flight (unmount). The controller stays usable, so an
|
|
241
|
+
* effect cleanup followed by a setup (StrictMode's extra mount) loses
|
|
242
|
+
* nothing.
|
|
243
|
+
*/
|
|
244
|
+
stop(): void;
|
|
245
|
+
/**
|
|
246
|
+
* A fine pointer's carry. The segments' own transitions go off while the
|
|
247
|
+
* lens is on screen, so the borrowed surface does not fade out and back in.
|
|
248
|
+
* Under a finger, the touch presentation already turns them off.
|
|
249
|
+
*/
|
|
250
|
+
private stillTransitions;
|
|
251
|
+
/**
|
|
252
|
+
* Gives the stilled segments their transitions back two frames after the
|
|
253
|
+
* hand-back, once the surfaces it gave back have been on screen.
|
|
254
|
+
*/
|
|
255
|
+
private thawTransitions;
|
|
256
|
+
private cancelThaw;
|
|
257
|
+
private restoreTransitions;
|
|
258
|
+
/** The selected segment, as the DOM shows it now. */
|
|
259
|
+
private selectedIn;
|
|
260
|
+
/**
|
|
261
|
+
* Starts the motion the release left pending: on `box` (the destination's
|
|
262
|
+
* box now) or the box measured at landing, showing `paint`'s surface (the
|
|
263
|
+
* selected segment's).
|
|
264
|
+
*/
|
|
265
|
+
private startPending;
|
|
266
|
+
/**
|
|
267
|
+
* Aims the lens at `destination`'s box as it is now: a value adopted
|
|
268
|
+
* after its click (mid-flight) moves the segments with its titles' new
|
|
269
|
+
* weights.
|
|
270
|
+
*/
|
|
271
|
+
private reaim;
|
|
272
|
+
/**
|
|
273
|
+
* Binds the lens for `segment`, with `box` as its layout box and `paint`'s
|
|
274
|
+
* surface, the selected segment's. It keeps what is on screen. With nothing
|
|
275
|
+
* carried, it starts from `from`, a segment's resting box. Otherwise it
|
|
276
|
+
* starts from the presented geometry, re-based onto the new box with its
|
|
277
|
+
* velocities.
|
|
278
|
+
*/
|
|
279
|
+
private carry;
|
|
280
|
+
/** Velocities captured by the last `carry`, in the new box's units. */
|
|
281
|
+
private velocity;
|
|
282
|
+
/** A spring transition that keeps the captured velocities of `values`. */
|
|
283
|
+
private springFrom;
|
|
284
|
+
/**
|
|
285
|
+
* The lens settles at its resting place on `segment`. Under a finger it
|
|
286
|
+
* springs on the slide spring. Under a fine pointer it takes the theme's
|
|
287
|
+
* duration and easing, as the segments' own transition does.
|
|
288
|
+
*/
|
|
289
|
+
private settleLens;
|
|
290
|
+
/** Springs the lens toward `values`. */
|
|
291
|
+
private springLens;
|
|
292
|
+
/** The lens's presented center and size, from the animator. */
|
|
293
|
+
private presented;
|
|
294
|
+
/**
|
|
295
|
+
* The lens settles on `segment`, at its resting size. Under Reduced Motion
|
|
296
|
+
* a finger's release (`touchRelease`) cross-fades on any primary pointer. A
|
|
297
|
+
* mouse's or a pen's lands at once under a fine one.
|
|
298
|
+
*/
|
|
299
|
+
private moveLensTo;
|
|
300
|
+
/**
|
|
301
|
+
* A tap's slide: from `from` to `segment` on the slide spring. Under Reduced
|
|
302
|
+
* Motion there is no travel, and a finger's tap (`touchRelease`) fades.
|
|
303
|
+
*/
|
|
304
|
+
private slideTo;
|
|
305
|
+
/**
|
|
306
|
+
* Under Reduced Motion, the lens lands on `segment` and fades in there, as
|
|
307
|
+
* an animator entrance. The surface on screen fades out in place on the
|
|
308
|
+
* same clock. That surface is the lens when it was carried, else `from`'s
|
|
309
|
+
* resting surface. The animator decides whether anything fades. On a fine
|
|
310
|
+
* pointer, both change at once unless a touch released the change
|
|
311
|
+
* (`touchRelease`).
|
|
312
|
+
*/
|
|
313
|
+
private crossFadeTo;
|
|
314
|
+
/**
|
|
315
|
+
* Paints the ::after with the surface on screen (the lens's paint, or
|
|
316
|
+
* `paint`'s resting surface) where it is (`from`, at `opacity`).
|
|
317
|
+
*/
|
|
318
|
+
private leave;
|
|
319
|
+
/**
|
|
320
|
+
* The ::after fades out in place while the lens fades in on `box`. As a
|
|
321
|
+
* leaving travel, it fades on the animator's Reduce Motion clock. It lands
|
|
322
|
+
* only once it is invisible.
|
|
323
|
+
*/
|
|
324
|
+
private fadeLeaving;
|
|
325
|
+
private endLeaving;
|
|
326
|
+
/**
|
|
327
|
+
* Waits for `handle`; the surface goes back when nothing is left. A
|
|
328
|
+
* touch's value still waiting to come back when the motion settles goes
|
|
329
|
+
* back instead: the settled slide bounds the wait.
|
|
330
|
+
*/
|
|
331
|
+
private trackHandle;
|
|
332
|
+
/**
|
|
333
|
+
* Gives `segment`'s title the selected face and the selected segment's
|
|
334
|
+
* title an unselected one (none for null or the selected segment), at once.
|
|
335
|
+
*/
|
|
336
|
+
private showFaceAt;
|
|
337
|
+
/**
|
|
338
|
+
* Mid-drag, the face is the color alone. A weight swap changes the titles'
|
|
339
|
+
* widths, which moves the segments under the finger and shakes the
|
|
340
|
+
* boundary. The commit's own styles give the new weight at the lift.
|
|
341
|
+
*/
|
|
342
|
+
private wearFace;
|
|
343
|
+
/** Every title back to its own face. */
|
|
344
|
+
private clearFaces;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Wires `SegmentedSelectionMotion` to a SegmentedControl. While enabled,
|
|
348
|
+
* every change of `value` slides the selection in the commit that shows the
|
|
349
|
+
* new value, so no frame shows it unanimated. A press drives the lens while
|
|
350
|
+
* `isTracking`.
|
|
351
|
+
*/
|
|
352
|
+
export declare function useSegmentedSelectionMotion(trackRef: RefObject<HTMLElement | null>, value: string, isPresenting: boolean, isTracking: boolean): {
|
|
353
|
+
readonly selection: SegmentedSelection;
|
|
354
|
+
/** The radiogroup's callback ref: it attaches the animators to the node. */
|
|
355
|
+
readonly attachTrack: RefCallback<HTMLElement>;
|
|
356
|
+
};
|
|
357
|
+
//# sourceMappingURL=useSegmentedSelectionMotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSegmentedSelectionMotion.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/useSegmentedSelectionMotion.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,QAAQ,EAKd,MAAM,oBAAoB,CAAC;AAa5B,kCAAkC;AAClC,eAAO,MAAM,gBAAgB,iCAA+B,CAAC;AAS7D,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,MAAM,CA2BpD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAErC,wDAAwD;AACxD,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,MAAM,CAMhD,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpE;AA6SD,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,+BAA+B;IAC9C,oFAAoF;IACpF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;CACnC;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,wBAAwB;IA4DjC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IA3D3B,OAAO,CA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