@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
|
@@ -22,21 +22,17 @@
|
|
|
22
22
|
* (a value below the minimum is invalid per WCAG 4.1.2) and a localized
|
|
23
23
|
* "Collapsed" aria-valuetext announces the real state.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* hears them again. Captured events are delivered to the capturing element,
|
|
31
|
-
* so the move/up/cancel handlers live on the grab zone (as in Slider), not on
|
|
32
|
-
* window.
|
|
25
|
+
* The handle's input (the pointer drag, the keys, the double-click) is
|
|
26
|
+
* resizeGesture.ts. ResizeHandle forwards its React events to it, over the
|
|
27
|
+
* region its `resizable` prop describes. A drag takes pointer capture on the grab zone.
|
|
28
|
+
* The gesture's move, up and cancel events then go there, as in Slider, even
|
|
29
|
+
* over an embedded frame.
|
|
33
30
|
*/
|
|
34
31
|
|
|
35
|
-
import {
|
|
32
|
+
import {useEffect, useRef, useState} from 'react';
|
|
36
33
|
import type {ReactNode} from 'react';
|
|
37
34
|
import * as stylex from '@stylexjs/stylex';
|
|
38
35
|
import type {BaseProps} from '../BaseProps';
|
|
39
|
-
import {devWarn} from '../utils/devWarning';
|
|
40
36
|
import {
|
|
41
37
|
colorVars,
|
|
42
38
|
durationVars,
|
|
@@ -51,8 +47,14 @@ import {
|
|
|
51
47
|
getEffectiveMaxPx,
|
|
52
48
|
type ResizableProps,
|
|
53
49
|
} from './useResizable';
|
|
50
|
+
import {
|
|
51
|
+
createResizeGesture,
|
|
52
|
+
type ResizeGesture,
|
|
53
|
+
type ResizeGestureModel,
|
|
54
|
+
} from './resizeGesture';
|
|
54
55
|
import {themeProps} from '../utils/themeProps';
|
|
55
56
|
|
|
57
|
+
import {useDevWarning} from '../hooks/useDevWarning';
|
|
56
58
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
57
59
|
import {
|
|
58
60
|
registerEnglishFallback,
|
|
@@ -61,8 +63,6 @@ import {
|
|
|
61
63
|
import english from '../i18n/generated-english/Resizable/ResizeHandle.generated';
|
|
62
64
|
|
|
63
65
|
registerEnglishFallback(english);
|
|
64
|
-
const KEYBOARD_STEP = 10;
|
|
65
|
-
const KEYBOARD_LARGE_STEP = 50;
|
|
66
66
|
|
|
67
67
|
type PillPlacement = 'start' | 'end' | 'center' | 'auto';
|
|
68
68
|
|
|
@@ -105,21 +105,6 @@ function hitAreaBiasDir(
|
|
|
105
105
|
return effectiveSide === 'start' ? -1 : 1;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/**
|
|
109
|
-
* Drag feedback lives on `<body>`, not on the handle: the pointer spends the
|
|
110
|
-
* drag off the handle, over whatever the panels contain, and the resize cursor
|
|
111
|
-
* has to hold there. Module scope so the writes stay outside the component.
|
|
112
|
-
*/
|
|
113
|
-
function applyBodyDragStyles(isHorizontal: boolean): void {
|
|
114
|
-
document.body.style.cursor = isHorizontal ? 'col-resize' : 'row-resize';
|
|
115
|
-
document.body.style.userSelect = 'none';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function clearBodyDragStyles(): void {
|
|
119
|
-
document.body.style.cursor = '';
|
|
120
|
-
document.body.style.userSelect = '';
|
|
121
|
-
}
|
|
122
|
-
|
|
123
108
|
const styles = stylex.create({
|
|
124
109
|
handle: {
|
|
125
110
|
position: 'relative',
|
|
@@ -370,60 +355,6 @@ export interface ResizeHandleProps extends Omit<
|
|
|
370
355
|
children?: ReactNode;
|
|
371
356
|
}
|
|
372
357
|
|
|
373
|
-
/**
|
|
374
|
-
* The snap point `count` points away from the region's current size in
|
|
375
|
-
* `direction` (+1 grows, -1 shrinks). A point beyond `minSize` or `maxSize`
|
|
376
|
-
* counts as that bound; the nearest end point serves when fewer remain, and
|
|
377
|
-
* the current size when it is already there.
|
|
378
|
-
*/
|
|
379
|
-
function adjacentSnapPoint(
|
|
380
|
-
resizable: ResizableProps,
|
|
381
|
-
direction: 1 | -1,
|
|
382
|
-
count: number,
|
|
383
|
-
): number {
|
|
384
|
-
const points = [
|
|
385
|
-
...new Set(
|
|
386
|
-
resizable._snaps.map(p =>
|
|
387
|
-
Math.min(resizable._maxSizePx, Math.max(resizable._minSizePx, p)),
|
|
388
|
-
),
|
|
389
|
-
),
|
|
390
|
-
].sort((a, b) => a - b);
|
|
391
|
-
const size = resizable._size;
|
|
392
|
-
const ahead =
|
|
393
|
-
direction > 0
|
|
394
|
-
? points.filter(p => p > size)
|
|
395
|
-
: points.filter(p => p < size).reverse();
|
|
396
|
-
if (ahead.length === 0) {
|
|
397
|
-
return size;
|
|
398
|
-
}
|
|
399
|
-
return ahead[Math.min(count, ahead.length) - 1];
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Collapse an open pane, or restore a collapsed one to the size it had before
|
|
404
|
-
* it collapsed (APG window splitter: Enter "restores the splitter to its
|
|
405
|
-
* previous position"). The hook's own collapse/expand do exactly that; a
|
|
406
|
-
* hand-built `ResizableProps` (no registered controls) falls back to a resize
|
|
407
|
-
* gesture to the minimum, which also cannot reopen a pane whose minimum sits below its
|
|
408
|
-
* collapse threshold.
|
|
409
|
-
*/
|
|
410
|
-
function toggleCollapse(resizable: ResizableProps): void {
|
|
411
|
-
const controls = getCollapseControls(resizable);
|
|
412
|
-
if (controls) {
|
|
413
|
-
if (resizable._isCollapsed) {
|
|
414
|
-
controls.expand();
|
|
415
|
-
} else {
|
|
416
|
-
controls.collapse();
|
|
417
|
-
}
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
resizable._onResizeStart();
|
|
421
|
-
resizable._onResizeMove(
|
|
422
|
-
resizable._isCollapsed ? resizable._minSizePx : -resizable._size,
|
|
423
|
-
);
|
|
424
|
-
resizable._onResizeEnd();
|
|
425
|
-
}
|
|
426
|
-
|
|
427
358
|
/**
|
|
428
359
|
* Draggable resize handle placed between resizable panels. Renders as a thin
|
|
429
360
|
* divider line with a wider invisible hit area and optional pill grip indicator.
|
|
@@ -459,271 +390,133 @@ export function ResizeHandle({
|
|
|
459
390
|
const t = useComponentTranslator();
|
|
460
391
|
const label = labelFromProps ?? t('@astryx.resizable.handle.label');
|
|
461
392
|
const handleRef = useRef<HTMLDivElement>(null);
|
|
462
|
-
// The pointer that owns the in-flight drag, plus the values its deltas are
|
|
463
|
-
// measured against. A ref so moves don't re-render, and so unmount can tell
|
|
464
|
-
// a live drag from a finished one.
|
|
465
|
-
const dragRef = useRef<{
|
|
466
|
-
pointerId: number;
|
|
467
|
-
startPos: number;
|
|
468
|
-
rtl: number;
|
|
469
|
-
} | null>(null);
|
|
470
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
471
393
|
const [isHovered, setIsHovered] = useState(false);
|
|
472
394
|
const [isFocused, setIsFocused] = useState(false);
|
|
473
395
|
const isHorizontal = direction === 'horizontal';
|
|
474
396
|
const isOverlay = positionMode === 'overlay';
|
|
475
|
-
|
|
397
|
+
|
|
398
|
+
// --- The region a `resizable` prop describes ---
|
|
399
|
+
|
|
400
|
+
// The gesture reads the latest props at each input. A drag sees the region
|
|
401
|
+
// as it is now, not as it was at the press.
|
|
402
|
+
const resizableRef = useRef(resizable);
|
|
403
|
+
resizableRef.current = resizable;
|
|
404
|
+
// The region a drag in flight started on: told the gesture is over even
|
|
405
|
+
// after the prop has gone.
|
|
406
|
+
const dragRegionRef = useRef<ResizableProps | undefined>(undefined);
|
|
407
|
+
const configRef = useRef({direction, isReversed, isDisabled});
|
|
408
|
+
configRef.current = {direction, isReversed, isDisabled};
|
|
409
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
410
|
+
const [regionGesture] = useState<ResizeGesture>(() => {
|
|
411
|
+
const model: ResizeGestureModel = {
|
|
412
|
+
state() {
|
|
413
|
+
const region = resizableRef.current;
|
|
414
|
+
return {
|
|
415
|
+
size: region?._size ?? 0,
|
|
416
|
+
isCollapsed: region?._isCollapsed ?? false,
|
|
417
|
+
minPx: region?._minSizePx ?? 0,
|
|
418
|
+
maxPx: region?._maxSizePx ?? Infinity,
|
|
419
|
+
snaps: region?._snaps ?? [],
|
|
420
|
+
collapsedSize: region?._collapsedSize ?? 0,
|
|
421
|
+
collapsible: region?._collapsible ?? false,
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
start: () => {
|
|
425
|
+
dragRegionRef.current = resizableRef.current;
|
|
426
|
+
resizableRef.current?._onResizeStart();
|
|
427
|
+
},
|
|
428
|
+
move: delta => resizableRef.current?._onResizeMove(delta),
|
|
429
|
+
end: () => {
|
|
430
|
+
const region = resizableRef.current ?? dragRegionRef.current;
|
|
431
|
+
dragRegionRef.current = undefined;
|
|
432
|
+
region?._onResizeEnd();
|
|
433
|
+
},
|
|
434
|
+
// Not a resize end, but the gesture is over. The region froze its state
|
|
435
|
+
// for the drag, so it must hear that the drag ended.
|
|
436
|
+
cancel: () => {
|
|
437
|
+
const region = resizableRef.current ?? dragRegionRef.current;
|
|
438
|
+
dragRegionRef.current = undefined;
|
|
439
|
+
region?._onResizeCancel?.();
|
|
440
|
+
},
|
|
441
|
+
// The hook's own collapse and expand restore the size before the
|
|
442
|
+
// collapse; a hand-built `ResizableProps` has none.
|
|
443
|
+
get collapse() {
|
|
444
|
+
const region = resizableRef.current;
|
|
445
|
+
return region ? getCollapseControls(region)?.collapse : undefined;
|
|
446
|
+
},
|
|
447
|
+
get expand() {
|
|
448
|
+
const region = resizableRef.current;
|
|
449
|
+
return region ? getCollapseControls(region)?.expand : undefined;
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
return createResizeGesture(
|
|
453
|
+
() => handleRef.current,
|
|
454
|
+
model,
|
|
455
|
+
() => ({
|
|
456
|
+
...configRef.current,
|
|
457
|
+
isDisabled:
|
|
458
|
+
configRef.current.isDisabled || resizableRef.current == null,
|
|
459
|
+
}),
|
|
460
|
+
setIsDragging,
|
|
461
|
+
);
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
const gesture = resizable != null ? regionGesture : null;
|
|
465
|
+
const isCollapsed = resizable?._isCollapsed ?? false;
|
|
476
466
|
const effectiveSide = resolveEffectiveSide(
|
|
477
467
|
pillPlacement,
|
|
478
468
|
isReversed,
|
|
479
|
-
|
|
469
|
+
isCollapsed,
|
|
480
470
|
);
|
|
481
471
|
// Physical offset direction shared by the pill and the grab zone (null =
|
|
482
472
|
// centered / no bias). Keeps the two positioned identically in LTR and RTL.
|
|
483
473
|
const hitBiasDir = hitAreaBiasDir(effectiveSide);
|
|
484
|
-
|
|
485
|
-
const getRTLMultiplier = useCallback((): number => {
|
|
486
|
-
const el = handleRef.current;
|
|
487
|
-
if (!el) {
|
|
488
|
-
return 1;
|
|
489
|
-
}
|
|
490
|
-
return getComputedStyle(el).direction === 'rtl' ? -1 : 1;
|
|
491
|
-
}, []);
|
|
492
|
-
|
|
493
474
|
const isInteracting = isHovered || isFocused;
|
|
494
475
|
|
|
495
|
-
// A handle whose axis disagrees with its
|
|
496
|
-
//
|
|
497
|
-
// so `_direction` is optional for old hand-built objects
|
|
498
|
-
// is no
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
) {
|
|
507
|
-
didWarnAxisRef.current = true;
|
|
508
|
-
devWarn(
|
|
509
|
-
'ResizeHandle',
|
|
510
|
-
`direction="${direction}" but its useResizable region is ` +
|
|
511
|
-
`"${hookDirection}". They must match: the hook measures one axis ` +
|
|
512
|
-
'and the handle drags the other.',
|
|
513
|
-
);
|
|
514
|
-
}
|
|
515
|
-
}, [direction, resizable]);
|
|
516
|
-
|
|
517
|
-
// --- Pointer drag ---
|
|
518
|
-
const clearDrag = useCallback(() => {
|
|
519
|
-
dragRef.current = null;
|
|
520
|
-
setIsDragging(false);
|
|
521
|
-
clearBodyDragStyles();
|
|
522
|
-
}, []);
|
|
523
|
-
|
|
524
|
-
const handlePointerDown = useCallback(
|
|
525
|
-
(e: React.PointerEvent<HTMLDivElement>) => {
|
|
526
|
-
if (isDisabled || !resizable || dragRef.current) {
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
e.preventDefault();
|
|
530
|
-
e.stopPropagation();
|
|
531
|
-
// Take the pointer for the whole gesture. Without capture the browser
|
|
532
|
-
// re-hit-tests every move, so a frame anywhere under the drag path
|
|
533
|
-
// swallows the rest of it into the guest document.
|
|
534
|
-
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
535
|
-
dragRef.current = {
|
|
536
|
-
pointerId: e.pointerId,
|
|
537
|
-
startPos: isHorizontal ? e.clientX : e.clientY,
|
|
538
|
-
rtl: isHorizontal ? getRTLMultiplier() : 1,
|
|
539
|
-
};
|
|
540
|
-
setIsDragging(true);
|
|
541
|
-
resizable._onResizeStart();
|
|
542
|
-
applyBodyDragStyles(isHorizontal);
|
|
543
|
-
},
|
|
544
|
-
[isDisabled, resizable, isHorizontal, getRTLMultiplier],
|
|
545
|
-
);
|
|
546
|
-
|
|
547
|
-
const handlePointerMove = useCallback(
|
|
548
|
-
(e: React.PointerEvent<HTMLDivElement>) => {
|
|
549
|
-
const drag = dragRef.current;
|
|
550
|
-
if (!drag || drag.pointerId !== e.pointerId || !resizable) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
const currentPos = isHorizontal ? e.clientX : e.clientY;
|
|
554
|
-
resizable._onResizeMove((currentPos - drag.startPos) * drag.rtl * sign);
|
|
555
|
-
},
|
|
556
|
-
[resizable, isHorizontal, sign],
|
|
557
|
-
);
|
|
558
|
-
|
|
559
|
-
const handlePointerUp = useCallback(
|
|
560
|
-
(e: React.PointerEvent<HTMLDivElement>) => {
|
|
561
|
-
if (dragRef.current?.pointerId !== e.pointerId) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
clearDrag();
|
|
565
|
-
resizable?._onResizeEnd();
|
|
566
|
-
},
|
|
567
|
-
[clearDrag, resizable],
|
|
476
|
+
// A handle whose axis disagrees with its region drags along one axis while
|
|
477
|
+
// the region measures percentage bounds on the other. `ResizableProps` is
|
|
478
|
+
// exported, so `_direction` is optional for old hand-built objects. Without
|
|
479
|
+
// it there is no axis to compare.
|
|
480
|
+
const regionDirection = resizable?._direction;
|
|
481
|
+
useDevWarning(
|
|
482
|
+
'ResizeHandle',
|
|
483
|
+
`direction="${direction}" but its useResizable region is ` +
|
|
484
|
+
`"${regionDirection}". They must match: the hook measures one axis ` +
|
|
485
|
+
'and the handle drags the other.',
|
|
486
|
+
regionDirection != null && regionDirection !== direction,
|
|
568
487
|
);
|
|
569
488
|
|
|
570
|
-
//
|
|
571
|
-
// ends without signalling a resize end. lostpointercapture also fires on the
|
|
572
|
-
// implicit release after every pointerup/pointercancel, by which point the
|
|
573
|
-
// drag is already cleared and this is a no-op.
|
|
574
|
-
const cancelDrag = useCallback(
|
|
575
|
-
(e: React.PointerEvent<HTMLDivElement>) => {
|
|
576
|
-
if (dragRef.current?.pointerId !== e.pointerId) {
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
clearDrag();
|
|
580
|
-
// Not a resize end, but still the end of the gesture: the region froze
|
|
581
|
-
// state for the duration of the drag and has to be told it is over.
|
|
582
|
-
resizable?._onResizeCancel?.();
|
|
583
|
-
},
|
|
584
|
-
[clearDrag, resizable],
|
|
585
|
-
);
|
|
586
|
-
|
|
587
|
-
// --- Keyboard ---
|
|
588
|
-
const handleKeyDown = useCallback(
|
|
589
|
-
(e: React.KeyboardEvent) => {
|
|
590
|
-
if (isDisabled || !resizable) {
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
const step = e.shiftKey ? KEYBOARD_LARGE_STEP : KEYBOARD_STEP;
|
|
594
|
-
const rtl = isHorizontal ? getRTLMultiplier() : 1;
|
|
595
|
-
|
|
596
|
-
// The pane's grow direction on this key: ArrowRight/Down grow unless the
|
|
597
|
-
// layout is reversed or, on the inline axis, right-to-left.
|
|
598
|
-
const grows = (key: string) =>
|
|
599
|
-
(key === 'ArrowRight' || key === 'ArrowDown'
|
|
600
|
-
? 1
|
|
601
|
-
: key === 'ArrowLeft' || key === 'ArrowUp'
|
|
602
|
-
? -1
|
|
603
|
-
: 0) *
|
|
604
|
-
(isHorizontal ? rtl : 1) *
|
|
605
|
-
sign >
|
|
606
|
-
0;
|
|
607
|
-
|
|
608
|
-
switch (e.key) {
|
|
609
|
-
case 'ArrowRight':
|
|
610
|
-
case 'ArrowDown':
|
|
611
|
-
case 'ArrowLeft':
|
|
612
|
-
case 'ArrowUp': {
|
|
613
|
-
e.preventDefault();
|
|
614
|
-
if (resizable._isCollapsed) {
|
|
615
|
-
// A collapsed pane answers only the grow arrow: it opens one step
|
|
616
|
-
// above its minimum, the value the separator announces while
|
|
617
|
-
// collapsed, or at the collapse threshold when that is larger (APG
|
|
618
|
-
// window splitter: the arrow moves the separator from where it is;
|
|
619
|
-
// a bare step would stay below the threshold and leave it in
|
|
620
|
-
// place). The shrink arrow is a no-op.
|
|
621
|
-
if (grows(e.key)) {
|
|
622
|
-
resizable._onResizeStart();
|
|
623
|
-
// At least the collapse threshold, or the move would stay
|
|
624
|
-
// collapsed when the minimum sits below it.
|
|
625
|
-
resizable._onResizeMove(
|
|
626
|
-
Math.max(resizable._minSizePx + step, resizable._collapsedSize),
|
|
627
|
-
);
|
|
628
|
-
resizable._onResizeEnd();
|
|
629
|
-
}
|
|
630
|
-
break;
|
|
631
|
-
}
|
|
632
|
-
if (resizable._snaps.length > 0) {
|
|
633
|
-
// With snap points the region can rest only on a point, so a
|
|
634
|
-
// pixel step would snap straight back; the arrow moves to the
|
|
635
|
-
// adjacent point in its direction instead (Shift, two points),
|
|
636
|
-
// staying within the bounds.
|
|
637
|
-
resizable._onResizeStart();
|
|
638
|
-
resizable._onResizeMove(
|
|
639
|
-
adjacentSnapPoint(
|
|
640
|
-
resizable,
|
|
641
|
-
grows(e.key) ? 1 : -1,
|
|
642
|
-
e.shiftKey ? 2 : 1,
|
|
643
|
-
) - resizable._size,
|
|
644
|
-
);
|
|
645
|
-
resizable._onResizeEnd();
|
|
646
|
-
break;
|
|
647
|
-
}
|
|
648
|
-
const direction =
|
|
649
|
-
e.key === 'ArrowRight' || e.key === 'ArrowDown' ? 1 : -1;
|
|
650
|
-
resizable._onResizeStart();
|
|
651
|
-
resizable._onResizeMove(
|
|
652
|
-
direction * step * (isHorizontal ? rtl : 1) * sign,
|
|
653
|
-
);
|
|
654
|
-
resizable._onResizeEnd();
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
case 'Home': {
|
|
658
|
-
e.preventDefault();
|
|
659
|
-
resizable._onResizeStart();
|
|
660
|
-
resizable._onResizeMove(resizable._minSizePx - resizable._size);
|
|
661
|
-
resizable._onResizeEnd();
|
|
662
|
-
break;
|
|
663
|
-
}
|
|
664
|
-
case 'End': {
|
|
665
|
-
e.preventDefault();
|
|
666
|
-
// Only a configured maximum is the region's own limit; the reported
|
|
667
|
-
// stand-in for an unbounded region is where the pane *could* reach,
|
|
668
|
-
// not where End may safely move it (a recorded gap).
|
|
669
|
-
if (resizable._maxSizePx !== Infinity) {
|
|
670
|
-
resizable._onResizeStart();
|
|
671
|
-
resizable._onResizeMove(resizable._maxSizePx - resizable._size);
|
|
672
|
-
resizable._onResizeEnd();
|
|
673
|
-
}
|
|
674
|
-
break;
|
|
675
|
-
}
|
|
676
|
-
case 'Enter': {
|
|
677
|
-
e.preventDefault();
|
|
678
|
-
if (resizable._collapsible) {
|
|
679
|
-
toggleCollapse(resizable);
|
|
680
|
-
}
|
|
681
|
-
break;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
[isDisabled, resizable, isHorizontal, getRTLMultiplier, sign],
|
|
686
|
-
);
|
|
489
|
+
// --- Cleanup on unmount, or when the `resizable` prop goes ---
|
|
687
490
|
|
|
688
|
-
//
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
toggleCollapse(resizable);
|
|
694
|
-
}, [isDisabled, resizable]);
|
|
695
|
-
|
|
696
|
-
// --- Cleanup on unmount ---
|
|
697
|
-
// Removing the grab zone implicitly releases its captured pointer and takes
|
|
698
|
-
// its listeners with it, so an in-flight drag stops driving the region on
|
|
699
|
-
// its own. The body cursor/user-select overrides are not on the element,
|
|
700
|
-
// though, so they have to be released here or they stick after the handle
|
|
701
|
-
// is gone — and the region, which outlives this handle, still has to hear
|
|
491
|
+
// Removing the grab zone releases its captured pointer and its listeners.
|
|
492
|
+
// A `resizable` prop that goes away takes the grab zone's handlers too. The
|
|
493
|
+
// body's cursor and user-select overrides are not on the element, so they
|
|
494
|
+
// are released here. The region outlives this handle and still has to hear
|
|
702
495
|
// that its gesture is over.
|
|
703
|
-
const
|
|
704
|
-
cancelOnUnmountRef.current = resizable?._onResizeCancel;
|
|
496
|
+
const hasRegion = resizable != null;
|
|
705
497
|
useEffect(() => {
|
|
498
|
+
if (!hasRegion) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
706
501
|
return () => {
|
|
707
|
-
|
|
708
|
-
dragRef.current = null;
|
|
709
|
-
clearBodyDragStyles();
|
|
710
|
-
cancelOnUnmountRef.current?.();
|
|
711
|
-
}
|
|
502
|
+
regionGesture.interrupt();
|
|
712
503
|
};
|
|
713
|
-
}, []);
|
|
504
|
+
}, [hasRegion, regionGesture]);
|
|
714
505
|
|
|
715
506
|
// --- ARIA ---
|
|
716
507
|
// When collapsed the panel's real size (0) sits below aria-valuemin, which
|
|
717
508
|
// is invalid per WCAG 4.1.2. Clamp aria-valuenow to the minimum and announce
|
|
718
509
|
// the true state via aria-valuetext instead; the valuetext is removed as
|
|
719
510
|
// soon as the panel expands so the numeric value reads again.
|
|
720
|
-
const
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
511
|
+
const sizeNow = resizable?._size;
|
|
512
|
+
const minNow = resizable?._minSizePx;
|
|
513
|
+
const ariaValueNow =
|
|
514
|
+
sizeNow == null || minNow == null
|
|
515
|
+
? undefined
|
|
516
|
+
: isCollapsed
|
|
517
|
+
? Math.max(sizeNow, minNow)
|
|
518
|
+
: sizeNow;
|
|
519
|
+
const ariaValueMin = minNow;
|
|
727
520
|
// A separator with a value needs a maximum (WAI-ARIA, APG window splitter).
|
|
728
521
|
// Unbounded regions report the basis they can fill; a hand-built props
|
|
729
522
|
// object without it reports only a configured maximum.
|
|
@@ -736,7 +529,9 @@ export function ResizeHandle({
|
|
|
736
529
|
? effectiveMax
|
|
737
530
|
: undefined;
|
|
738
531
|
const ariaValueText =
|
|
739
|
-
resizable && isCollapsed
|
|
532
|
+
resizable != null && isCollapsed
|
|
533
|
+
? t('@astryx.resizable.collapsed')
|
|
534
|
+
: undefined;
|
|
740
535
|
|
|
741
536
|
return (
|
|
742
537
|
<div
|
|
@@ -750,7 +545,11 @@ export function ResizeHandle({
|
|
|
750
545
|
aria-label={label}
|
|
751
546
|
aria-disabled={isDisabled || undefined}
|
|
752
547
|
tabIndex={isDisabled ? -1 : 0}
|
|
753
|
-
onDoubleClick={
|
|
548
|
+
onDoubleClick={() => {
|
|
549
|
+
if (!isDisabled) {
|
|
550
|
+
gesture?.doubleClick();
|
|
551
|
+
}
|
|
552
|
+
}}
|
|
754
553
|
onFocus={() => setIsFocused(true)}
|
|
755
554
|
onBlur={() => setIsFocused(false)}
|
|
756
555
|
data-resizing={isDragging || undefined}
|
|
@@ -786,7 +585,9 @@ export function ResizeHandle({
|
|
|
786
585
|
// this accessibility-critical handler can't be clobbered by a passed prop.
|
|
787
586
|
onKeyDown={e => {
|
|
788
587
|
props.onKeyDown?.(e);
|
|
789
|
-
|
|
588
|
+
if (!isDisabled) {
|
|
589
|
+
gesture?.keyDown(e);
|
|
590
|
+
}
|
|
790
591
|
}}>
|
|
791
592
|
{/* Wider invisible hit area for pointer interaction */}
|
|
792
593
|
<div
|
|
@@ -806,11 +607,15 @@ export function ResizeHandle({
|
|
|
806
607
|
: dynamicStyles.hitAreaOffsetY(hitBiasDir),
|
|
807
608
|
isDisabled && styles.disabled,
|
|
808
609
|
)}
|
|
809
|
-
onPointerDown={
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
610
|
+
onPointerDown={e => {
|
|
611
|
+
if (!isDisabled) {
|
|
612
|
+
gesture?.pointerDown(e);
|
|
613
|
+
}
|
|
614
|
+
}}
|
|
615
|
+
onPointerMove={e => gesture?.pointerMove(e)}
|
|
616
|
+
onPointerUp={e => gesture?.pointerUp(e)}
|
|
617
|
+
onPointerCancel={e => gesture?.pointerCancel(e)}
|
|
618
|
+
onLostPointerCapture={e => gesture?.pointerCancel(e)}
|
|
814
619
|
onPointerEnter={() => setIsHovered(true)}
|
|
815
620
|
onPointerLeave={() => {
|
|
816
621
|
if (!isDragging) {
|