@astryxdesign/core 0.7.7-canary.550ff21 → 0.7.7-canary.58c5b8a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +1 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +79 -9
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +23 -4
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +5 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +9 -4
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +50 -5
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +7 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +10 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +13 -27
- package/dist/DateInput/Wheel.d.ts +17 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +161 -20
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +63 -49
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +53 -15
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +15 -11
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +20 -4
- package/dist/Field/Field.js +2 -2
- package/dist/Field/PanelSearchInput.d.ts +9 -1
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +3 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/InfoTip/InfoTip.d.ts +63 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -0
- package/dist/InfoTip/InfoTip.js +126 -0
- package/dist/InfoTip/index.d.ts +10 -0
- package/dist/InfoTip/index.d.ts.map +1 -0
- package/dist/InfoTip/index.js +12 -0
- package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +25 -20
- package/dist/Layer/layerClickBoundary.d.ts +7 -1
- package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
- package/dist/Layer/layerClickBoundary.js +2 -2
- package/dist/Layer/useBackdropPress.d.ts +27 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -0
- package/dist/Layer/useBackdropPress.js +53 -0
- package/dist/Layer/usePressPin.d.ts +105 -0
- package/dist/Layer/usePressPin.d.ts.map +1 -0
- package/dist/Layer/usePressPin.js +413 -0
- package/dist/Layer/useTouchTrigger.d.ts +23 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +45 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -1
- package/dist/MobileNav/MobileNav.js +0 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +2 -4
- package/dist/Outline/Outline.d.ts +2 -4
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -52
- package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromMarkdown.js +1 -0
- package/dist/Outline/useScrollSpy.js +3 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +56 -7
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +571 -302
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +33 -6
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +8 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +118 -260
- package/dist/Resizable/resizeGesture.d.ts +91 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -0
- package/dist/Resizable/resizeGesture.js +251 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +115 -8
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +10 -2
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +96 -67
- package/dist/Selector/optionShape.d.ts +24 -0
- package/dist/Selector/optionShape.d.ts.map +1 -0
- package/dist/Selector/optionShape.js +48 -0
- package/dist/Selector/selectableOptionEntries.d.ts +20 -0
- package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
- package/dist/Selector/selectableOptionEntries.js +38 -0
- package/dist/Selector/utils.d.ts +2 -17
- package/dist/Selector/utils.d.ts.map +1 -1
- package/dist/Selector/utils.js +3 -51
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -9
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +200 -46
- package/dist/Switch/switchFill.d.ts +31 -0
- package/dist/Switch/switchFill.d.ts.map +1 -0
- package/dist/Switch/switchFill.js +88 -0
- package/dist/Switch/switchTouch.d.ts +74 -0
- package/dist/Switch/switchTouch.d.ts.map +1 -0
- package/dist/Switch/switchTouch.js +125 -0
- package/dist/Switch/useSwitchTouch.d.ts +276 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
- package/dist/Switch/useSwitchTouch.js +939 -0
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +4 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +5 -0
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +13 -4
- package/dist/Token/TokenNamingContext.d.ts +14 -0
- package/dist/Token/TokenNamingContext.d.ts.map +1 -0
- package/dist/Token/TokenNamingContext.js +23 -0
- package/dist/Tokenizer/Tokenizer.d.ts +46 -59
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +44 -60
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
- package/dist/Tooltip/Tooltip.d.ts +24 -5
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +29 -5
- package/dist/Tooltip/useTooltip.d.ts +48 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +90 -20
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +4 -7
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -7
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +26 -15
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +142 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +161 -22
- package/dist/gestures/PressTracker.d.ts +6 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +3 -0
- package/dist/gestures/types.d.ts +6 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.js +1 -0
- package/dist/gestures/wheelSegmenter.d.ts +14 -3
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +32 -8
- package/dist/hooks/actionGroupTracker.d.ts +7 -4
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +19 -56
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAttachment.d.ts +16 -8
- package/dist/hooks/useAttachment.d.ts.map +1 -1
- package/dist/hooks/useAttachment.js +35 -15
- package/dist/hooks/useFocusTrap.d.ts +15 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +13 -2
- package/dist/hooks/useHighlightedOptionScroll.d.ts +11 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
- package/dist/hooks/useHighlightedOptionScroll.js +112 -11
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +7 -4
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -2
- package/dist/hooks/usePager.d.ts +261 -0
- package/dist/hooks/usePager.d.ts.map +1 -0
- package/dist/hooks/usePager.js +1169 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +33 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/internal/SheetConfirmation.d.ts +11 -0
- package/dist/internal/SheetConfirmation.d.ts.map +1 -0
- package/dist/internal/SheetConfirmation.js +92 -0
- package/dist/internal/sheetDraft.d.ts +35 -0
- package/dist/internal/sheetDraft.d.ts.map +1 -0
- package/dist/internal/sheetDraft.js +65 -0
- package/dist/internal/touch-sheet.d.ts +21 -0
- package/dist/internal/touch-sheet.d.ts.map +1 -0
- package/dist/internal/touch-sheet.js +19 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
- package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/paging.d.ts +16 -5
- package/dist/motion/paging.d.ts.map +1 -1
- package/dist/motion/paging.js +34 -14
- package/dist/motion/reducedMotion.d.ts +24 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +78 -1
- package/dist/motion/roles.d.ts +7 -1
- package/dist/motion/roles.d.ts.map +1 -1
- package/dist/motion/roles.js +20 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/motion/uikit/index.d.ts +7 -4
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +7 -4
- package/dist/motion/uikit/paging.d.ts +31 -20
- package/dist/motion/uikit/paging.d.ts.map +1 -1
- package/dist/motion/uikit/paging.js +41 -11
- package/dist/motion/uikit/progressBar.d.ts +27 -7
- package/dist/motion/uikit/progressBar.d.ts.map +1 -1
- package/dist/motion/uikit/progressBar.js +31 -11
- package/dist/motion/uikit/segmented.d.ts +55 -0
- package/dist/motion/uikit/segmented.d.ts.map +1 -0
- package/dist/motion/uikit/segmented.js +77 -0
- package/dist/motion/uikit/springs.d.ts +8 -42
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +12 -42
- package/dist/motion/uikit/switch.d.ts +166 -0
- package/dist/motion/uikit/switch.d.ts.map +1 -0
- package/dist/motion/uikit/switch.js +186 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts +18 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.js +28 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts +5 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
- package/dist/utils/browserClickWait.d.ts +35 -0
- package/dist/utils/browserClickWait.d.ts.map +1 -0
- package/dist/utils/browserClickWait.js +123 -0
- package/dist/utils/clickGuard.d.ts +14 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +46 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +24 -6
- package/locales/en.json +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +13 -8
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
- package/src/Avatar/Avatar.tsx +3 -1
- package/src/BottomSheet/BottomSheet.tsx +95 -10
- package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
- package/src/BottomSheet/bottomSheetStack.ts +8 -4
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Breadcrumbs/BreadcrumbItem.tsx +17 -4
- package/src/Button/Button.tsx +66 -7
- package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
- package/src/CheckboxList/CheckboxList.tsx +6 -0
- package/src/CheckboxList/CheckboxListContext.tsx +6 -0
- package/src/CheckboxList/CheckboxListItem.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +172 -14
- package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
- package/src/DateRangeInput/DateRangeInput.tsx +117 -71
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +81 -15
- package/src/Drawer/Drawer.tsx +28 -11
- package/src/Drawer/useDrawerDialogPresence.ts +9 -1
- package/src/DropdownMenu/DropdownMenu.tsx +28 -6
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.tsx +31 -1
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/InfoTip/InfoTip.doc.mjs +192 -0
- package/src/InfoTip/InfoTip.tsx +186 -0
- package/src/InfoTip/index.ts +14 -0
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/layerClickBoundary.ts +2 -2
- package/src/Layer/useBackdropPress.ts +81 -0
- package/src/Layer/usePressPin.ts +576 -0
- package/src/Layer/useTouchTrigger.ts +56 -6
- package/src/Lightbox/Lightbox.tsx +2 -1
- package/src/MobileNav/MobileNav.tsx +1 -1
- package/src/MultiSelector/hooks.ts +2 -4
- package/src/Outline/Outline.doc.mjs +177 -51
- package/src/Outline/Outline.tsx +5 -57
- package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
- package/src/Outline/useOutlineFromMarkdown.ts +1 -0
- package/src/Outline/useScrollSpy.ts +3 -3
- package/src/Popover/usePopover.tsx +71 -9
- package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
- package/src/PowerSearch/PowerSearch.tsx +798 -324
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +4 -2
- package/src/ProgressBar/ProgressBar.tsx +67 -7
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioList.tsx +7 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/ResizeHandle.tsx +133 -328
- package/src/Resizable/resizeGesture.ts +368 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/SegmentedControl.tsx +179 -5
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +14 -2
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
- package/src/Selector/Selector.tsx +136 -89
- package/src/Selector/optionShape.ts +64 -0
- package/src/Selector/selectableOptionEntries.ts +39 -0
- package/src/Selector/utils.ts +9 -68
- package/src/SideNav/SideNavItem.tsx +3 -7
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Switch/Switch.doc.mjs +3 -3
- package/src/Switch/Switch.tsx +412 -86
- package/src/Switch/switchFill.ts +106 -0
- package/src/Switch/switchTouch.ts +186 -0
- package/src/Switch/useSwitchTouch.ts +1051 -0
- package/src/TabList/Tab.tsx +5 -3
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.tsx +5 -0
- package/src/Token/Token.tsx +15 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
- package/src/Tokenizer/Tokenizer.tsx +93 -88
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- package/src/Tooltip/Tooltip.doc.mjs +123 -39
- package/src/Tooltip/Tooltip.tsx +43 -9
- package/src/Tooltip/useTooltip.doc.mjs +171 -31
- package/src/Tooltip/useTooltip.tsx +137 -22
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- package/src/Typeahead/Typeahead.tsx +29 -15
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +205 -21
- package/src/gestures/PressTracker.ts +10 -0
- package/src/gestures/types.ts +6 -0
- package/src/gestures/usePressTracker.ts +2 -0
- package/src/gestures/wheelSegmenter.ts +36 -7
- package/src/hooks/actionGroupTracker.ts +32 -61
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +56 -14
- package/src/hooks/useFocusTrap.ts +26 -2
- package/src/hooks/useHighlightedOptionScroll.ts +123 -15
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/hooks/usePager.ts +1446 -0
- package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
- package/src/i18n/generated-locales/en.generated.ts +43 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
- package/src/index.ts +14 -0
- package/src/internal/SheetConfirmation.tsx +101 -0
- package/src/internal/sheetDraft.ts +80 -0
- package/src/internal/touch-sheet.ts +21 -0
- package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
- package/src/motion/MEASUREMENTS.md +36 -27
- package/src/motion/README.md +11 -6
- package/src/motion/animator.ts +61 -29
- package/src/motion/paging.ts +37 -14
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/roles.ts +20 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +6 -5
- package/src/motion/uikit/paging.ts +41 -10
- package/src/motion/uikit/progressBar.ts +31 -11
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +12 -42
- package/src/motion/uikit/switch.ts +174 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -0
- package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
- package/src/utils/browserClickWait.ts +133 -0
- package/src/utils/clickGuard.ts +64 -1
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +24 -6
- package/dist/internal/tokenizer-presentation.d.ts +0 -21
- package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
- package/dist/internal/tokenizer-presentation.js +0 -21
- package/src/internal/tokenizer-presentation.ts +0 -25
package/src/DateInput/Wheel.tsx
CHANGED
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* browser that does not understand `animation-timeline` would otherwise run
|
|
22
22
|
* the same keyframes on the document timeline and simply play them once.
|
|
23
23
|
*
|
|
24
|
+
* Under Reduce Motion, the wheel's own scrolls (a step from a key or a click,
|
|
25
|
+
* the travel to the nearest enabled row) land without travel. They cross-fade
|
|
26
|
+
* on a touch screen and land at once otherwise. A finger's scroll and its
|
|
27
|
+
* momentum stay the platform's.
|
|
28
|
+
*
|
|
24
29
|
* Accessibility: this is a listbox, not a novel widget. It is one tab stop
|
|
25
30
|
* with arrow/Home/End/PageUp/PageDown keys, `aria-activedescendant` tracking
|
|
26
31
|
* the active row, and every row reachable by tap — none of which depends on
|
|
@@ -44,6 +49,11 @@ import {
|
|
|
44
49
|
durationVars,
|
|
45
50
|
} from '../theme/tokens.stylex';
|
|
46
51
|
import {focusOutlineStyles} from '../utils';
|
|
52
|
+
import {
|
|
53
|
+
playReducedMotionDip,
|
|
54
|
+
reducedMotionFade,
|
|
55
|
+
type ReducedMotionDip,
|
|
56
|
+
} from '../motion/reducedMotion';
|
|
47
57
|
import {dateInputTouchSizes, dateInputTouchGeometry} from './tokens.stylex';
|
|
48
58
|
import {useOwnScrollGesture} from './useOwnScrollGesture';
|
|
49
59
|
import {usePointerDragScroll} from './usePointerDragScroll';
|
|
@@ -209,7 +219,10 @@ export interface WheelOption {
|
|
|
209
219
|
value: number;
|
|
210
220
|
/** Row text. */
|
|
211
221
|
label: string;
|
|
212
|
-
/**
|
|
222
|
+
/**
|
|
223
|
+
* Rows outside min/max stay visible but cannot be committed: a wheel that
|
|
224
|
+
* stops on one travels on to the nearest enabled row.
|
|
225
|
+
*/
|
|
213
226
|
isDisabled?: boolean;
|
|
214
227
|
}
|
|
215
228
|
|
|
@@ -229,6 +242,46 @@ export interface WheelProps {
|
|
|
229
242
|
isActive?: boolean;
|
|
230
243
|
}
|
|
231
244
|
|
|
245
|
+
/**
|
|
246
|
+
* The enabled row nearest `index`: `index` itself when it is enabled,
|
|
247
|
+
* otherwise the closest enabled row on either side. A tie goes to the side of
|
|
248
|
+
* `towardIndex` (the committed row), and a wheel with no enabled row stays on
|
|
249
|
+
* `towardIndex`.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```
|
|
253
|
+
* // Hours 0-23 with 09:00-17:00 bounds: stopping on 7 rests on 9.
|
|
254
|
+
* nearestEnabledIndex(hourOptions, 7, 10); // 9
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
export function nearestEnabledIndex(
|
|
258
|
+
options: ReadonlyArray<WheelOption>,
|
|
259
|
+
index: number,
|
|
260
|
+
towardIndex: number,
|
|
261
|
+
): number {
|
|
262
|
+
const isEnabled = (i: number) =>
|
|
263
|
+
i >= 0 && i < options.length && !options[i].isDisabled;
|
|
264
|
+
if (isEnabled(index)) {
|
|
265
|
+
return index;
|
|
266
|
+
}
|
|
267
|
+
for (let distance = 1; distance < options.length; distance++) {
|
|
268
|
+
const below = index - distance;
|
|
269
|
+
const above = index + distance;
|
|
270
|
+
const isBelowEnabled = isEnabled(below);
|
|
271
|
+
const isAboveEnabled = isEnabled(above);
|
|
272
|
+
if (isBelowEnabled && isAboveEnabled) {
|
|
273
|
+
return towardIndex < index ? below : above;
|
|
274
|
+
}
|
|
275
|
+
if (isBelowEnabled) {
|
|
276
|
+
return below;
|
|
277
|
+
}
|
|
278
|
+
if (isAboveEnabled) {
|
|
279
|
+
return above;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return towardIndex;
|
|
283
|
+
}
|
|
284
|
+
|
|
232
285
|
/**
|
|
233
286
|
* One snap-scrolling picker column.
|
|
234
287
|
*
|
|
@@ -275,20 +328,94 @@ export function Wheel({
|
|
|
275
328
|
: 0;
|
|
276
329
|
}, []);
|
|
277
330
|
|
|
331
|
+
// What last started a scroll of the wheel: a pointer's type, or 'wheel'
|
|
332
|
+
// for a mouse wheel or trackpad. Under Reduce Motion the release of a touch
|
|
333
|
+
// drag cross-fades on any primary pointer. A key step, a row tap or a
|
|
334
|
+
// trackpad's scroll cross-fades on a coarse primary pointer and lands at
|
|
335
|
+
// once on a fine one.
|
|
336
|
+
const lastPointerRef = useRef<string | null>(null);
|
|
337
|
+
|
|
338
|
+
// A reduced-motion dip whose rows have not landed yet: the row they land
|
|
339
|
+
// on. While one is pending the rows stay put for it, so they never move at
|
|
340
|
+
// full opacity, and a further step retargets it.
|
|
341
|
+
const pendingFadeRef = useRef<{top: number} | null>(null);
|
|
342
|
+
// The running dip, so a step during its fade-in starts the next one where
|
|
343
|
+
// the column is.
|
|
344
|
+
const dipRef = useRef<ReducedMotionDip | null>(null);
|
|
345
|
+
// Synchronizes with the dip's animations: an unmounted wheel lands nothing.
|
|
346
|
+
useEffect(
|
|
347
|
+
() => () => {
|
|
348
|
+
pendingFadeRef.current = null;
|
|
349
|
+
dipRef.current?.cancel();
|
|
350
|
+
dipRef.current = null;
|
|
351
|
+
},
|
|
352
|
+
[],
|
|
353
|
+
);
|
|
354
|
+
|
|
278
355
|
const scrollToIndex = useCallback(
|
|
279
|
-
(
|
|
356
|
+
(
|
|
357
|
+
index: number,
|
|
358
|
+
behavior: ScrollBehavior,
|
|
359
|
+
{touchRelease = false}: {touchRelease?: boolean} = {},
|
|
360
|
+
) => {
|
|
280
361
|
const scroller = scrollerRef.current;
|
|
281
362
|
const size = itemBlockSize();
|
|
282
363
|
if (scroller == null || size === 0) {
|
|
283
364
|
return;
|
|
284
365
|
}
|
|
285
|
-
|
|
366
|
+
const top = index * size;
|
|
367
|
+
// Under Reduce Motion the wheel's own scroll lands without travel. It
|
|
368
|
+
// dips on a touch screen or for a touch drag's release. Otherwise it
|
|
369
|
+
// lands at once.
|
|
370
|
+
const fadeTiming =
|
|
371
|
+
behavior === 'smooth'
|
|
372
|
+
? reducedMotionFade(scroller, {touchRelease})
|
|
373
|
+
: null;
|
|
374
|
+
const pending = pendingFadeRef.current;
|
|
375
|
+
// A change that lands now replaces a pending landing. Its dip goes on
|
|
376
|
+
// and fades back in.
|
|
377
|
+
if (fadeTiming == null) {
|
|
378
|
+
pendingFadeRef.current = null;
|
|
379
|
+
scroller.scrollTo({top, behavior});
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (fadeTiming.duration === 0 || typeof scroller.animate !== 'function') {
|
|
383
|
+
pendingFadeRef.current = null;
|
|
384
|
+
scroller.scrollTo({top, behavior: 'auto'});
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (pending != null) {
|
|
388
|
+
// The dip is still fading out: its rows land here instead.
|
|
389
|
+
pending.top = top;
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
// A step during the last dip's fade-in starts the new dip at the
|
|
393
|
+
// column's current opacity, not at full opacity. A leaving element fades
|
|
394
|
+
// out from where it is.
|
|
395
|
+
const shown = Number.parseFloat(getComputedStyle(scroller).opacity);
|
|
396
|
+
dipRef.current?.cancel();
|
|
397
|
+
const landing = {top};
|
|
398
|
+
pendingFadeRef.current = landing;
|
|
399
|
+
dipRef.current = playReducedMotionDip(
|
|
400
|
+
scroller,
|
|
401
|
+
fadeTiming,
|
|
402
|
+
() => {
|
|
403
|
+
if (pendingFadeRef.current === landing) {
|
|
404
|
+
pendingFadeRef.current = null;
|
|
405
|
+
scroller.scrollTo({top: landing.top, behavior: 'auto'});
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
Number.isFinite(shown) ? shown : 1,
|
|
409
|
+
);
|
|
286
410
|
},
|
|
287
411
|
[itemBlockSize],
|
|
288
412
|
);
|
|
289
413
|
|
|
290
|
-
// Commit on rest. A disabled row
|
|
291
|
-
//
|
|
414
|
+
// Commit on rest. A wheel that stops on a disabled row travels on to the
|
|
415
|
+
// nearest enabled row, as UIDatePicker does. That second rest commits it.
|
|
416
|
+
// A rest on the committed row is not a stop to correct. The park after the
|
|
417
|
+
// sheet opens rests there with no touch. A committed value outside the
|
|
418
|
+
// bounds stays until a person moves the wheel.
|
|
292
419
|
//
|
|
293
420
|
// Declared here, above the park effect, because that effect consults the
|
|
294
421
|
// `isAtRestRef` this returns before it repositions anything.
|
|
@@ -303,12 +430,18 @@ export function Wheel({
|
|
|
303
430
|
options.length - 1,
|
|
304
431
|
Math.max(0, Math.round(scroller.scrollTop / size)),
|
|
305
432
|
);
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
433
|
+
const restIndex =
|
|
434
|
+
index === selectedIndex
|
|
435
|
+
? index
|
|
436
|
+
: nearestEnabledIndex(options, index, selectedIndex);
|
|
437
|
+
if (restIndex !== index) {
|
|
438
|
+
scrollToIndex(restIndex, 'smooth', {
|
|
439
|
+
touchRelease: lastPointerRef.current === 'touch',
|
|
440
|
+
});
|
|
309
441
|
return;
|
|
310
442
|
}
|
|
311
|
-
|
|
443
|
+
const option = options[index];
|
|
444
|
+
if (option != null && !option.isDisabled && option.value !== value) {
|
|
312
445
|
onChange(option.value);
|
|
313
446
|
}
|
|
314
447
|
},
|
|
@@ -316,8 +449,11 @@ export function Wheel({
|
|
|
316
449
|
isDraggingRef,
|
|
317
450
|
);
|
|
318
451
|
|
|
319
|
-
// Park the committed row under the band whenever the wheel is
|
|
320
|
-
// value
|
|
452
|
+
// Park the committed row under the band at once whenever the wheel is
|
|
453
|
+
// shown. A value that changes from outside while the wheel is shown turns
|
|
454
|
+
// the wheel onto its row instead. UIDatePicker turns onto its maximum the
|
|
455
|
+
// same way, and never jumps there. For example, a bound clamps the time
|
|
456
|
+
// after another wheel turned, or the calendar moved to another month.
|
|
321
457
|
//
|
|
322
458
|
// NEVER while the wheel is still moving. A scroller that is mid-gesture or
|
|
323
459
|
// still carrying momentum is the user's, and repositioning it does not stop
|
|
@@ -325,8 +461,15 @@ export function Wheel({
|
|
|
325
461
|
// as a new settle, commits the next row along, and parks again. See
|
|
326
462
|
// useScrollSettle. The settle handler re-checks the position afterwards, so
|
|
327
463
|
// a correction that is genuinely needed still happens, just at rest.
|
|
464
|
+
const parkedRef = useRef(false);
|
|
328
465
|
useEffect(() => {
|
|
329
|
-
if (!isActive
|
|
466
|
+
if (!isActive) {
|
|
467
|
+
parkedRef.current = false;
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
// Nor while a reduced-motion dip is still to land its rows: they land
|
|
471
|
+
// under it, on this row.
|
|
472
|
+
if (!isAtRestRef.current || pendingFadeRef.current != null) {
|
|
330
473
|
return;
|
|
331
474
|
}
|
|
332
475
|
const size = itemBlockSize();
|
|
@@ -335,11 +478,16 @@ export function Wheel({
|
|
|
335
478
|
return;
|
|
336
479
|
}
|
|
337
480
|
if (Math.round(scroller.scrollTop / size) !== selectedIndex) {
|
|
338
|
-
|
|
481
|
+
if (parkedRef.current) {
|
|
482
|
+
scrollToIndex(selectedIndex, 'smooth');
|
|
483
|
+
} else {
|
|
484
|
+
scroller.scrollTo({top: selectedIndex * size, behavior: 'auto'});
|
|
485
|
+
}
|
|
339
486
|
}
|
|
487
|
+
parkedRef.current = true;
|
|
340
488
|
// eslint-disable-next-line @eslint-react/set-state-in-effect -- the highlight follows a scroll position, which only exists after layout
|
|
341
489
|
setActiveIndex(selectedIndex);
|
|
342
|
-
}, [isActive, selectedIndex, itemBlockSize, isAtRestRef]);
|
|
490
|
+
}, [isActive, selectedIndex, itemBlockSize, isAtRestRef, scrollToIndex]);
|
|
343
491
|
|
|
344
492
|
// Highlight follows the finger. rAF-throttled: a scroll can fire far more
|
|
345
493
|
// often than the display refreshes, and this only feeds a repaint.
|
|
@@ -446,6 +594,16 @@ export function Wheel({
|
|
|
446
594
|
aria-activedescendant={`${id}-${options[activeIndex]?.value}`}
|
|
447
595
|
tabIndex={0}
|
|
448
596
|
onKeyDown={handleKeyDown}
|
|
597
|
+
// Read in the capture phase. usePointerDragScroll stops a primary
|
|
598
|
+
// mouse press from bubbling, so that it does not reach BottomSheet's
|
|
599
|
+
// drag. A bubbling handler would never see a mouse, and would keep the
|
|
600
|
+
// last touch.
|
|
601
|
+
onPointerDownCapture={event => {
|
|
602
|
+
lastPointerRef.current = event.pointerType;
|
|
603
|
+
}}
|
|
604
|
+
onWheel={() => {
|
|
605
|
+
lastPointerRef.current = 'wheel';
|
|
606
|
+
}}
|
|
449
607
|
{...stylex.props(styles.scroller, focusOutlineStyles.focusVisible)}>
|
|
450
608
|
{options.map((option, index) => (
|
|
451
609
|
<div
|
|
@@ -115,7 +115,7 @@ export const docs = {
|
|
|
115
115
|
name: 'presets',
|
|
116
116
|
type: 'Array<DateRangePreset>',
|
|
117
117
|
description:
|
|
118
|
-
'Preset ranges shown as quick-select options beside the calendar. A preset is disabled when either endpoint violates min, max, or dateConstraints, or when its span violates minRangeSpan or maxRangeSpan.',
|
|
118
|
+
'Preset ranges shown as quick-select options beside the calendar, or above it when the two do not fit side by side. A preset is disabled when either endpoint violates min, max, or dateConstraints, or when its span violates minRangeSpan or maxRangeSpan.',
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
name: 'hasClear',
|
|
@@ -277,7 +277,8 @@ export const docs = {
|
|
|
277
277
|
{
|
|
278
278
|
name: 'Preset sidebar',
|
|
279
279
|
required: false,
|
|
280
|
-
description:
|
|
280
|
+
description:
|
|
281
|
+
'A list of preset range options beside the calendar, or above it when the two do not fit side by side.',
|
|
281
282
|
},
|
|
282
283
|
{
|
|
283
284
|
name: 'Preset button',
|
|
@@ -88,6 +88,7 @@ import {
|
|
|
88
88
|
useComponentTranslator,
|
|
89
89
|
} from '../i18n/useComponentTranslator';
|
|
90
90
|
import english from '../i18n/generated-english/DateRangeInput/DateRangeInput.generated';
|
|
91
|
+
import {layerViewportInset} from '../Layer/layerViewportInset.stylex';
|
|
91
92
|
|
|
92
93
|
registerEnglishFallback(english);
|
|
93
94
|
|
|
@@ -160,8 +161,28 @@ const styles = stylex.create({
|
|
|
160
161
|
iconButtonDisabled: {
|
|
161
162
|
cursor: 'default',
|
|
162
163
|
},
|
|
164
|
+
// The popover content scrolls inside the layer's block cap, so a stacked
|
|
165
|
+
// calendar stays reachable on a short screen.
|
|
166
|
+
popoverScroll: {
|
|
167
|
+
overflowY: 'auto',
|
|
168
|
+
overscrollBehavior: 'contain',
|
|
169
|
+
maxBlockSize: stylex.firstThatWorks(
|
|
170
|
+
`calc(${layerViewportInset.maxBlockSize})`,
|
|
171
|
+
`calc(${layerViewportInset.maxBlockSizeFallback})`,
|
|
172
|
+
),
|
|
173
|
+
},
|
|
174
|
+
// When the presets and a one-month calendar do not fit side by side, the
|
|
175
|
+
// row wraps and the presets stack above the calendar, in DOM order. The
|
|
176
|
+
// preset group draws a divider on its inline end and its block end. A
|
|
177
|
+
// negative margin moves each divider 1 border width past the group's margin
|
|
178
|
+
// box, and this row clips at its edges. Thus only the divider between the
|
|
179
|
+
// two parts shows: the inline-end one side by side, the block-end one when
|
|
180
|
+
// stacked. The row clips, not the scroller, so the overhang is never
|
|
181
|
+
// scrollable overflow.
|
|
163
182
|
popoverLayout: {
|
|
164
183
|
display: 'flex',
|
|
184
|
+
flexWrap: 'wrap',
|
|
185
|
+
overflow: 'clip',
|
|
165
186
|
},
|
|
166
187
|
presetSidebar: {
|
|
167
188
|
display: 'flex',
|
|
@@ -171,8 +192,26 @@ const styles = stylex.create({
|
|
|
171
192
|
borderInlineEndWidth: borderVars['--border-width'],
|
|
172
193
|
borderInlineEndStyle: 'solid',
|
|
173
194
|
borderInlineEndColor: colorVars['--color-border-emphasized'],
|
|
195
|
+
borderBlockEndWidth: borderVars['--border-width'],
|
|
196
|
+
borderBlockEndStyle: 'solid',
|
|
197
|
+
borderBlockEndColor: colorVars['--color-border-emphasized'],
|
|
198
|
+
marginInlineEnd: `calc(-1 * ${borderVars['--border-width']})`,
|
|
199
|
+
marginBlockEnd: `calc(-1 * ${borderVars['--border-width']})`,
|
|
200
|
+
// Alone on its line, the group fills the line, so its inline-end divider
|
|
201
|
+
// reaches the clipped edge.
|
|
202
|
+
flexGrow: 1,
|
|
174
203
|
minWidth: 140,
|
|
175
204
|
},
|
|
205
|
+
calendarPane: {
|
|
206
|
+
// Gives back the border width the preset group's margin takes, so the
|
|
207
|
+
// calendar keeps its side-by-side position.
|
|
208
|
+
marginInlineStart: borderVars['--border-width'],
|
|
209
|
+
// The row wraps on the calendar's one-month width, and the calendar then
|
|
210
|
+
// takes the free space, so its months sit in a row where they fit. The
|
|
211
|
+
// large factor keeps the preset group at its own width beside it.
|
|
212
|
+
flexBasis: 'min-content',
|
|
213
|
+
flexGrow: 1_000_000,
|
|
214
|
+
},
|
|
176
215
|
presetButton: {
|
|
177
216
|
display: 'block',
|
|
178
217
|
width: '100%',
|
|
@@ -805,79 +844,86 @@ export function DateRangeInput({
|
|
|
805
844
|
</VisuallyHidden>
|
|
806
845
|
)}
|
|
807
846
|
{popover.render(
|
|
808
|
-
<div {...stylex.props(styles.
|
|
809
|
-
{
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
847
|
+
<div {...stylex.props(styles.popoverScroll)}>
|
|
848
|
+
<div {...stylex.props(styles.popoverLayout)}>
|
|
849
|
+
{presets && presets.length > 0 && (
|
|
850
|
+
<div
|
|
851
|
+
role="group"
|
|
852
|
+
aria-label={t('@astryx.dateRangeInput.presetDateRanges')}
|
|
853
|
+
{...mergeProps(
|
|
854
|
+
themeProps('date-range-input-presets'),
|
|
855
|
+
stylex.props(styles.presetSidebar),
|
|
856
|
+
)}>
|
|
857
|
+
{presets.map(preset => {
|
|
858
|
+
const presetRange = preset.getRange();
|
|
859
|
+
const isActive = isRangeEqual(value, presetRange);
|
|
860
|
+
const isPresetDisabled =
|
|
861
|
+
isDisabled ||
|
|
862
|
+
!isRangeWithinSpan(
|
|
863
|
+
presetRange,
|
|
864
|
+
maxRangeSpan,
|
|
865
|
+
minRangeSpan,
|
|
866
|
+
) ||
|
|
867
|
+
isDateDisabled(plainDateFromISO(presetRange.start)) ||
|
|
868
|
+
isDateDisabled(plainDateFromISO(presetRange.end));
|
|
869
|
+
return (
|
|
870
|
+
<button
|
|
871
|
+
key={preset.label}
|
|
872
|
+
type="button"
|
|
873
|
+
// These presets are independent action buttons navigated by
|
|
874
|
+
// Tab, not a single-tab-stop listbox — so they are a labeled
|
|
875
|
+
// group of buttons, and the currently-applied preset is
|
|
876
|
+
// marked with aria-current (not aria-selected, a listbox
|
|
877
|
+
// concept that contradicted the Tab interaction) (forms-5).
|
|
878
|
+
aria-current={isActive ? 'true' : undefined}
|
|
879
|
+
// Focusable while disabled (AR3, spec:AST-085 FR1).
|
|
880
|
+
aria-disabled={isPresetDisabled || undefined}
|
|
881
|
+
aria-describedby={
|
|
882
|
+
showsDisabledMessage
|
|
883
|
+
? disabledMessageTooltip.describedBy
|
|
884
|
+
: undefined
|
|
845
885
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
886
|
+
onClick={() => {
|
|
887
|
+
if (!isPresetDisabled) {
|
|
888
|
+
handleRangeSelect(presetRange);
|
|
889
|
+
}
|
|
890
|
+
}}
|
|
891
|
+
{...mergeProps(
|
|
892
|
+
themeProps('date-range-input-preset', {
|
|
893
|
+
selected: isActive ? 'selected' : null,
|
|
894
|
+
disabled: isPresetDisabled ? 'disabled' : null,
|
|
895
|
+
}),
|
|
896
|
+
stylex.props(
|
|
897
|
+
focusOutlineStyles.focusVisible,
|
|
898
|
+
styles.presetButton,
|
|
899
|
+
isActive && styles.presetButtonActive,
|
|
900
|
+
isPresetDisabled && styles.presetButtonDisabled,
|
|
901
|
+
),
|
|
902
|
+
)}>
|
|
903
|
+
{preset.label}
|
|
904
|
+
</button>
|
|
905
|
+
);
|
|
906
|
+
})}
|
|
907
|
+
</div>
|
|
908
|
+
)}
|
|
909
|
+
{/* The layer renders its children open or closed, so mount the
|
|
866
910
|
calendar only while it is open. */}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
911
|
+
{popover.isOpen && (
|
|
912
|
+
<Calendar
|
|
913
|
+
mode="range"
|
|
914
|
+
value={optimisticValue}
|
|
915
|
+
onChange={handleRangeSelect}
|
|
916
|
+
min={min}
|
|
917
|
+
max={max}
|
|
918
|
+
dateConstraints={dateConstraints}
|
|
919
|
+
maxRangeSpan={maxRangeSpan}
|
|
920
|
+
minRangeSpan={minRangeSpan}
|
|
921
|
+
numberOfMonths={numberOfMonths}
|
|
922
|
+
weekStartsOn={weekStartsOn}
|
|
923
|
+
xstyle={presets && presets.length > 0 && styles.calendarPane}
|
|
924
|
+
/>
|
|
925
|
+
)}
|
|
926
|
+
</div>
|
|
881
927
|
</div>,
|
|
882
928
|
{placement: 'below', alignment: 'start'},
|
|
883
929
|
)}
|
|
@@ -1143,12 +1143,18 @@ function PointerDateTimeField({
|
|
|
1143
1143
|
if (!isEffectivelyDisabled) {
|
|
1144
1144
|
popover.show({skipAutoFocus: true});
|
|
1145
1145
|
}
|
|
1146
|
-
} else if (
|
|
1146
|
+
} else if (
|
|
1147
|
+
e.key === 'Enter' &&
|
|
1148
|
+
(datePendingInput !== null || isEffectivelyDisabled)
|
|
1149
|
+
) {
|
|
1150
|
+
// Typed text holds Enter back, or a form would submit the value from
|
|
1151
|
+
// before the commit. A disabled or busy field must not submit its
|
|
1152
|
+
// form either. Otherwise Enter keeps its default, as in any text field.
|
|
1147
1153
|
e.preventDefault();
|
|
1148
1154
|
commitDatePendingInput();
|
|
1149
1155
|
}
|
|
1150
1156
|
},
|
|
1151
|
-
[popover, commitDatePendingInput, isEffectivelyDisabled],
|
|
1157
|
+
[popover, commitDatePendingInput, isEffectivelyDisabled, datePendingInput],
|
|
1152
1158
|
);
|
|
1153
1159
|
|
|
1154
1160
|
// --- Time-option popover (#2727) ---
|