@astryxdesign/core 0.7.7 → 0.7.8-canary.0b39b51
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 +46 -6
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +5 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +1 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +25 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
- package/dist/BottomSheet/useMobileKeyboard.js +6 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +15 -16
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +4 -0
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +2 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useChatDictation.js +2 -0
- package/dist/Chat/useChatNewMessages.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +2 -0
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +3 -0
- package/dist/Chat/useTriggerMenu.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +17 -12
- package/dist/CodeBlock/CodeBlock.d.ts +10 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +28 -11
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +2 -0
- 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/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +5 -2
- package/dist/DateInput/PickerWheel.d.ts +19 -0
- package/dist/DateInput/PickerWheel.d.ts.map +1 -0
- package/dist/DateInput/PickerWheel.js +625 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +1 -0
- package/dist/DateInput/Wheel.d.ts +18 -37
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +84 -113
- package/dist/DateInput/useOwnScrollGesture.d.ts +10 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -1
- package/dist/DateInput/useOwnScrollGesture.js +16 -3
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +2 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -1
- package/dist/DateInput/useScrollSettle.js +3 -0
- package/dist/DateInput/useWheelListbox.d.ts +59 -0
- package/dist/DateInput/useWheelListbox.d.ts.map +1 -0
- package/dist/DateInput/useWheelListbox.js +88 -0
- package/dist/DateInput/wheelOptions.d.ts +74 -0
- package/dist/DateInput/wheelOptions.d.ts.map +1 -0
- package/dist/DateInput/wheelOptions.js +98 -0
- package/dist/DateInput/wheelPhysics.d.ts +127 -0
- package/dist/DateInput/wheelPhysics.d.ts.map +1 -0
- package/dist/DateInput/wheelPhysics.js +341 -0
- package/dist/DateInput/wheelStrip.d.ts +92 -0
- package/dist/DateInput/wheelStrip.d.ts.map +1 -0
- package/dist/DateInput/wheelStrip.js +258 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +2 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +9 -32
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +3 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +5 -0
- package/dist/Field/Field.js +2 -2
- package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts.map +1 -1
- package/dist/FieldStatus/useFieldStatusAnnouncement.js +1 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -1
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts +6 -4
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +48 -3
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +20 -33
- 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/Item/useSwipeAction.d.ts.map +1 -1
- package/dist/Item/useSwipeAction.js +3 -0
- package/dist/Layer/modalOutlet.d.ts.map +1 -1
- package/dist/Layer/modalOutlet.js +2 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +1 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +3 -0
- package/dist/Layer/usePressPin.d.ts +17 -5
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +62 -12
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +3 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +19 -0
- package/dist/MobileNav/MobileNav.d.ts +3 -2
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +9 -25
- package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromDOM.js +3 -0
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +3 -0
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -0
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -0
- package/dist/PowerSearch/PowerSearch.d.ts +43 -4
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +445 -134
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +102 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1919 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +25 -6
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -2
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +193 -83
- package/dist/PowerSearch/formatFilterValue.d.ts +18 -6
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +33 -12
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +162 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts +21 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchDateZone.js +37 -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/PowerSearch/types.d.ts +2 -0
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.js +2 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -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 +2 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +101 -77
- package/dist/Resizable/createResizable.d.ts +145 -0
- package/dist/Resizable/createResizable.d.ts.map +1 -0
- package/dist/Resizable/createResizable.js +575 -0
- package/dist/Resizable/useResizable.d.ts +3 -3
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +252 -459
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +2 -0
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +36 -11
- package/dist/SelectableCard/selectableCardInput.d.ts +12 -0
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -0
- package/dist/SelectableCard/selectableCardInput.js +20 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -8
- 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/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +3 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +4 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
- 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/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +2 -0
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +2 -0
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +2 -0
- package/dist/Timestamp/Timestamp.js +1 -1
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +97 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +1 -0
- package/dist/Tokenizer/Tokenizer.d.ts +49 -37
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +22 -19
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +19 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +34 -53
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +27 -18
- 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 +39 -6
- package/dist/gestures/GestureHost.d.ts +16 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +1 -1
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
- package/dist/hooks/ModalAnnounceProvider.js +1 -0
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- 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/longPressDetector.d.ts +66 -0
- package/dist/hooks/longPressDetector.d.ts.map +1 -0
- package/dist/hooks/longPressDetector.js +200 -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/rootScrollStyles.d.ts +48 -0
- package/dist/hooks/rootScrollStyles.d.ts.map +1 -0
- package/dist/hooks/rootScrollStyles.js +207 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts +13 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts.map +1 -0
- package/dist/hooks/scrollLockTouchGuard.js +134 -0
- package/dist/hooks/scrollbarGutter.d.ts +4 -4
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -1
- package/dist/hooks/scrollbarGutter.js +36 -23
- 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/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +1 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -1
- package/dist/hooks/useAutoMediaMode.js +1 -0
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +2 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -1
- package/dist/hooks/useDevWarning.js +2 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -0
- package/dist/hooks/useGridFocus.d.ts +8 -5
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +4 -3
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -0
- package/dist/hooks/useImageMode.d.ts.map +1 -1
- package/dist/hooks/useImageMode.js +3 -0
- 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/useKeyboardHint.js +1 -1
- package/dist/hooks/useLongPress.d.ts +8 -9
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +23 -106
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +2 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +3 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +2 -1
- package/dist/hooks/usePressFeedback.d.ts.map +1 -1
- package/dist/hooks/usePressFeedback.js +1 -0
- package/dist/hooks/useResolvedRequired.d.ts +3 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +3 -0
- package/dist/hooks/useScrollLock.d.ts +7 -9
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +55 -48
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +5 -0
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +3 -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-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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/selectable-card.d.ts +21 -0
- package/dist/internal/selectable-card.d.ts.map +1 -0
- package/dist/internal/selectable-card.js +20 -0
- package/dist/internal/sheetDraft.d.ts +2 -2
- package/dist/internal/sheetDraft.js +2 -2
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +7 -7
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +45 -20
- package/dist/motion/progress.d.ts +88 -0
- package/dist/motion/progress.d.ts.map +1 -0
- package/dist/motion/progress.js +128 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +3 -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 +4 -3
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +4 -3
- package/dist/motion/uikit/picker.d.ts +96 -0
- package/dist/motion/uikit/picker.d.ts.map +1 -0
- package/dist/motion/uikit/picker.js +117 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +22 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +36 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts +23 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/reducedMotion.stylex.js +40 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +29 -4
- package/dist/theme/motionKnobs.d.ts +4 -3
- package/dist/theme/motionKnobs.d.ts.map +1 -1
- package/dist/theme/motionKnobs.js +3 -2
- package/dist/theme/themeMotion.d.ts +6 -0
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +7 -0
- 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/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +4 -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/plainDate.d.ts +8 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +19 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -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 +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +14 -9
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +46 -5
- package/src/AppShell/AppShell.tsx +4 -0
- package/src/BottomSheet/BottomSheet.tsx +1 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +39 -3
- package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
- package/src/BottomSheet/useMobileKeyboard.ts +4 -0
- package/src/BottomSheet/useSheetGestures.ts +10 -1
- package/src/Button/Button.tsx +26 -4
- package/src/Calendar/Calendar.tsx +36 -25
- package/src/Carousel/Carousel.tsx +1 -0
- package/src/Chat/ChatComposerInput.tsx +2 -0
- package/src/Chat/ChatMessageList.tsx +2 -1
- package/src/Chat/useChatDictation.ts +1 -0
- package/src/Chat/useChatNewMessages.ts +1 -1
- package/src/Chat/useChatStreamScroll.ts +2 -0
- package/src/Chat/useSpeechRecognition.ts +2 -0
- package/src/Chat/useTriggerMenu.tsx +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +38 -15
- package/src/CodeBlock/CodeBlock.doc.mjs +9 -1
- package/src/CodeBlock/CodeBlock.tsx +41 -4
- package/src/CommandPalette/CommandPalette.tsx +1 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/MonthScroller.tsx +8 -2
- package/src/DateInput/PickerWheel.tsx +765 -0
- package/src/DateInput/TouchDateField.tsx +1 -0
- package/src/DateInput/Wheel.tsx +94 -150
- package/src/DateInput/useOwnScrollGesture.ts +25 -3
- package/src/DateInput/usePointerDragScroll.ts +1 -0
- package/src/DateInput/useScrollSettle.ts +2 -0
- package/src/DateInput/useWheelListbox.ts +112 -0
- package/src/DateInput/wheelOptions.ts +155 -0
- package/src/DateInput/wheelPhysics.ts +406 -0
- package/src/DateInput/wheelStrip.ts +341 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +2 -0
- package/src/Dialog/Dialog.tsx +12 -32
- package/src/Drawer/useDrawerDialogPresence.ts +2 -0
- package/src/DropdownMenu/useMenuOverflow.ts +3 -0
- package/src/Field/Field.tsx +2 -2
- package/src/FieldStatus/useFieldStatusAnnouncement.ts +1 -0
- package/src/FormLayout/FormLayout.doc.mjs +181 -46
- package/src/FormLayout/FormLayout.tsx +5 -1
- package/src/HoverCard/HoverCard.doc.mjs +10 -8
- package/src/HoverCard/HoverCard.tsx +58 -6
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +49 -54
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/IconButton/IconButton.doc.mjs +141 -21
- package/src/Item/useSwipeAction.ts +2 -0
- package/src/Layer/modalOutlet.ts +2 -0
- package/src/Layer/outsidePress.ts +1 -0
- package/src/Layer/useLayer.tsx +2 -0
- package/src/Layer/useLayerDismissal.ts +2 -0
- package/src/Layer/usePressPin.ts +81 -15
- package/src/Layer/useTouchTrigger.ts +2 -0
- package/src/Lightbox/Lightbox.tsx +19 -0
- package/src/MobileNav/MobileNav.tsx +9 -30
- package/src/Outline/useOutlineFromDOM.ts +2 -0
- package/src/Outline/useScrollSpy.ts +2 -0
- package/src/OverflowList/OverflowList.tsx +2 -0
- package/src/Popover/Popover.tsx +4 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +60 -8
- package/src/PowerSearch/PowerSearch.tsx +627 -157
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2525 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +39 -6
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +2 -0
- package/src/PowerSearch/PowerSearchToken.tsx +7 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +244 -58
- package/src/PowerSearch/formatFilterValue.ts +55 -17
- package/src/PowerSearch/formatTokenValue.ts +222 -0
- package/src/PowerSearch/powerSearchDateZone.ts +64 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/PowerSearch/types.ts +2 -0
- package/src/ProgressBar/ProgressBarTouch.ts +2 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/Resizable.doc.mjs +5 -4
- package/src/Resizable/ResizeHandle.tsx +169 -109
- package/src/Resizable/createResizable.ts +831 -0
- package/src/Resizable/useResizable.ts +292 -623
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/SelectableCard/SelectableCard.tsx +39 -10
- package/src/SelectableCard/selectableCardInput.ts +30 -0
- package/src/Selector/Selector.tsx +5 -12
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/Switch.tsx +2 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +1 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/TimeInput/TimeInput.tsx +2 -0
- package/src/TimeInput/TouchTimeField.tsx +2 -0
- package/src/Timer/Timer.tsx +1 -0
- package/src/Timestamp/Timestamp.tsx +1 -1
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +123 -35
- package/src/Toast/types.ts +9 -3
- package/src/Toast/useToast.tsx +1 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +19 -3
- package/src/Tokenizer/Tokenizer.tsx +73 -51
- package/src/Tokenizer/TokenizerBottomSheet.tsx +1 -1
- package/src/Tokenizer/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +61 -56
- package/src/Typeahead/BaseTypeahead.tsx +27 -17
- 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 +1 -1
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +10 -4
- package/src/hooks/ModalAnnounceProvider.tsx +1 -0
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/longPressDetector.ts +273 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/rootScrollStyles.ts +247 -0
- package/src/hooks/scrollLockTouchGuard.ts +182 -0
- package/src/hooks/scrollbarGutter.ts +41 -26
- 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/useAnnounceRenderedText.ts +1 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useAutoMediaMode.ts +1 -0
- package/src/hooks/useBusyAnnouncement.ts +2 -0
- package/src/hooks/useDevWarning.ts +2 -0
- package/src/hooks/useFocusTrap.ts +2 -0
- package/src/hooks/useGridFocus.doc.mjs +6 -6
- package/src/hooks/useGridFocus.ts +10 -7
- package/src/hooks/useHotkeys.ts +2 -0
- package/src/hooks/useImageMode.ts +2 -0
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useKeyboardHint.tsx +1 -1
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +32 -122
- package/src/hooks/useMenuHover.ts +1 -0
- package/src/hooks/useMenuPress.ts +2 -0
- package/src/hooks/useOverflow.ts +2 -1
- package/src/hooks/usePressFeedback.ts +1 -0
- package/src/hooks/useResolvedRequired.ts +3 -0
- package/src/hooks/useScrollLock.doc.mjs +51 -12
- package/src/hooks/useScrollLock.ts +57 -60
- package/src/hooks/useScrollableArea.ts +4 -0
- package/src/hooks/useStreamingText.ts +2 -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-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/selectable-card.ts +21 -0
- package/src/internal/sheetDraft.ts +2 -2
- package/src/motion/MEASUREMENTS.md +18 -0
- package/src/motion/README.md +10 -5
- package/src/motion/animatedLayout.ts +10 -5
- package/src/motion/animator.ts +66 -31
- package/src/motion/progress.ts +155 -0
- package/src/motion/reducedMotion.ts +3 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +4 -3
- package/src/motion/uikit/picker.ts +116 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +44 -0
- package/src/privateAttributes/reducedMotion.stylex.ts +45 -0
- package/src/theme/Theme.tsx +37 -3
- package/src/theme/motionKnobs.ts +4 -3
- package/src/theme/themeMotion.ts +7 -0
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionModality.ts +4 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/plainDate.ts +21 -0
- package/src/utils/pressFeedback.ts +24 -6
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/internal/touch-sheet.d.ts +0 -21
- package/dist/internal/touch-sheet.d.ts.map +0 -1
- package/dist/internal/touch-sheet.js +0 -19
- package/src/internal/touch-sheet.ts +0 -21
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file wheelStrip.ts
|
|
5
|
+
* @input The touch wheel's strip (its flat rows in one element), its layout,
|
|
6
|
+
* and curves from wheelPhysics.ts
|
|
7
|
+
* @output createWheelStrip: the one owner of a wheel's offset. It writes a
|
|
8
|
+
* drag's frames, plays and stops curves, ticks, and reports the nearest row
|
|
9
|
+
* @position Glue of the touch picker wheel (PickerWheel.tsx) over the shared
|
|
10
|
+
* animator (motion/animator.ts)
|
|
11
|
+
*
|
|
12
|
+
* The strip is the one element that moves, on `translate`, so a motion plays
|
|
13
|
+
* on the compositor with no layout or paint per frame.
|
|
14
|
+
*
|
|
15
|
+
* SYNC: When modified, update wheelStrip.test.ts and PickerWheel.tsx.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {canVibrate, playHaptic} from '../gestures/haptics';
|
|
19
|
+
import {createMotionAnimator, type MotionCurve} from '../motion/animator';
|
|
20
|
+
import {reducedMotionFade} from '../motion/reducedMotion';
|
|
21
|
+
import {picker} from '../motion/uikit/picker';
|
|
22
|
+
import {
|
|
23
|
+
nearestIndex,
|
|
24
|
+
reachesRow,
|
|
25
|
+
tickTimes,
|
|
26
|
+
type WheelCurve,
|
|
27
|
+
type WheelLayout,
|
|
28
|
+
} from './wheelPhysics';
|
|
29
|
+
|
|
30
|
+
/** How a motion ended: arrived on its row, or stopped before. */
|
|
31
|
+
export type WheelMotionOutcome = 'arrived' | 'stopped';
|
|
32
|
+
|
|
33
|
+
/** Options for one motion. */
|
|
34
|
+
export interface PlayOptions {
|
|
35
|
+
/** Tick as rows reach the band (a drag's release); a tap's spin does not. */
|
|
36
|
+
ticks?: boolean;
|
|
37
|
+
/** Called once when the motion ends, either way. */
|
|
38
|
+
onEnd?: (outcome: WheelMotionOutcome, offset: number) => void;
|
|
39
|
+
/** Started by a touch drag's release, which cross-fades under Reduce Motion. */
|
|
40
|
+
touchRelease?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The momentum that continues a throw: a coast, and its bounce at an end.
|
|
43
|
+
* It is direct movement, so it plays under Reduce Motion too, as scrolling
|
|
44
|
+
* keeps decelerating under iOS Reduce Motion.
|
|
45
|
+
*/
|
|
46
|
+
momentum?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** One picker column's offset and everything that moves it. */
|
|
50
|
+
export interface WheelStrip {
|
|
51
|
+
/** The strip the offset moves (null detaches it). */
|
|
52
|
+
attach(strip: HTMLElement | null): void;
|
|
53
|
+
/** Update the rows (a new option list); keeps the offset. */
|
|
54
|
+
setLayout(layout: WheelLayout): void;
|
|
55
|
+
/**
|
|
56
|
+
* Tell `listener` the position of the row nearest the band whenever it
|
|
57
|
+
* changes. That is on a drag frame, where a motion stops or ends, and at
|
|
58
|
+
* rest. A cross-fade's landing counts as an end. A motion itself reports
|
|
59
|
+
* nothing until it ends, so the compositor plays it without the main thread
|
|
60
|
+
* painting a mark per row.
|
|
61
|
+
*/
|
|
62
|
+
onNearestChange(listener: ((position: number) => void) | null): void;
|
|
63
|
+
/** Whether a motion is playing. */
|
|
64
|
+
isMoving(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The offset on screen at `time` (ms, the document timeline's clock; default
|
|
67
|
+
* now). It is the animator's presentation value. So a motion that has not
|
|
68
|
+
* started on screen yet shows its start.
|
|
69
|
+
*/
|
|
70
|
+
offset(time?: number): number;
|
|
71
|
+
/** Where the wheel will be at rest: the motion's end, or the offset now. */
|
|
72
|
+
target(): number;
|
|
73
|
+
/**
|
|
74
|
+
* Show `offset` at once, stopping any motion: a drag frame or a park. A drag
|
|
75
|
+
* frame passes `ticks`, which also keeps the strip on its own compositing
|
|
76
|
+
* layer for the frames that follow.
|
|
77
|
+
*/
|
|
78
|
+
setOffset(offset: number, options?: {ticks?: boolean}): void;
|
|
79
|
+
/** Forget the previous drag frame (a new gesture starts). */
|
|
80
|
+
resetDrag(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Stop the motion where it was on screen at `time` (a finger landing on a
|
|
83
|
+
* spinning wheel: its touch-down time). Returns that offset.
|
|
84
|
+
*/
|
|
85
|
+
stop(time?: number): number;
|
|
86
|
+
/** Play `curve` from the current offset; the strip ends at `curve.to`. */
|
|
87
|
+
play(curve: WheelCurve, options?: PlayOptions): void;
|
|
88
|
+
/**
|
|
89
|
+
* Forget the row last reported nearest the band, so the next report names it
|
|
90
|
+
* again even unchanged. A caller that clears its mark as a motion starts then
|
|
91
|
+
* gets it back. That happens when the motion ends on the row it began on.
|
|
92
|
+
*/
|
|
93
|
+
forgetNearest(): void;
|
|
94
|
+
/** Stop everything; a motion still running ends as stopped. */
|
|
95
|
+
dispose(): void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface Running {
|
|
99
|
+
readonly curve: WheelCurve;
|
|
100
|
+
readonly onEnd?: (outcome: WheelMotionOutcome, offset: number) => void;
|
|
101
|
+
readonly timers: ReturnType<typeof setTimeout>[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function now(): number {
|
|
105
|
+
const time =
|
|
106
|
+
typeof document !== 'undefined'
|
|
107
|
+
? (document.timeline?.currentTime as number | null | undefined)
|
|
108
|
+
: null;
|
|
109
|
+
return typeof time === 'number' ? time : performance.now();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Creates a wheel's strip on a fresh animator. It uses the internal animator
|
|
114
|
+
* for three jobs the public handle lacks:
|
|
115
|
+
*
|
|
116
|
+
* - It plays a closed-form curve on the compositor: a coast onto a row, a
|
|
117
|
+
* snap, a spin.
|
|
118
|
+
* - It times haptic ticks on that curve's clock.
|
|
119
|
+
* - It substitutes Reduce Motion's cross-fade for a move.
|
|
120
|
+
*
|
|
121
|
+
* A release's coast and its bounce at an end are momentum (`decay`), so they
|
|
122
|
+
* keep their motion under Reduce Motion. Every other curve is a transition
|
|
123
|
+
* (`play`). Under Reduce Motion the animator cross-fades it after a touch or
|
|
124
|
+
* on a coarse pointer. Otherwise it lands at once.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```
|
|
128
|
+
* const strip = createWheelStrip({rowHeight: 28, rowCount: 60});
|
|
129
|
+
* strip.attach(element);
|
|
130
|
+
* strip.setOffset(30 * 28);
|
|
131
|
+
* strip.play(planRelease(strip.offset(), 900, layout).curve, {ticks: true, momentum: true});
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export function createWheelStrip(initialLayout: WheelLayout): WheelStrip {
|
|
135
|
+
const animator = createMotionAnimator(null);
|
|
136
|
+
let layout = initialLayout;
|
|
137
|
+
let running: Running | null = null;
|
|
138
|
+
let nearestListener: ((position: number) => void) | null = null;
|
|
139
|
+
let lastNearest: number | null = null;
|
|
140
|
+
let lastTick = -Infinity;
|
|
141
|
+
/** Last offset a drag frame showed, for its ticks. */
|
|
142
|
+
let dragPrevious: number | null = null;
|
|
143
|
+
|
|
144
|
+
const shown = (time?: number): number =>
|
|
145
|
+
// The strip's top sits on the band's row: offset `o` is `translate` −o.
|
|
146
|
+
-animator.get('y', time);
|
|
147
|
+
|
|
148
|
+
const reportNearest = (offset: number): void => {
|
|
149
|
+
const position = nearestIndex(offset, layout);
|
|
150
|
+
if (position === lastNearest) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
lastNearest = position;
|
|
154
|
+
nearestListener?.(position);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const tick = (time: number): void => {
|
|
158
|
+
if (time - lastTick < picker.selectionTick.minimumIntervalMs) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
lastTick = time;
|
|
162
|
+
playHaptic('selection');
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const clear = (motion: Running): void => {
|
|
166
|
+
for (const timer of motion.timers) {
|
|
167
|
+
clearTimeout(timer);
|
|
168
|
+
}
|
|
169
|
+
motion.timers.length = 0;
|
|
170
|
+
if (running === motion) {
|
|
171
|
+
running = null;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The motion's timers, from `origin` (when it started on screen): its
|
|
177
|
+
* ticks, a cross-fade's landing, and its end.
|
|
178
|
+
*/
|
|
179
|
+
const schedule = (
|
|
180
|
+
motion: Running,
|
|
181
|
+
origin: number,
|
|
182
|
+
{
|
|
183
|
+
endMs,
|
|
184
|
+
ticks,
|
|
185
|
+
landingMs,
|
|
186
|
+
}: {endMs: number; ticks: boolean; landingMs: number | null},
|
|
187
|
+
): void => {
|
|
188
|
+
for (const timer of motion.timers) {
|
|
189
|
+
clearTimeout(timer);
|
|
190
|
+
}
|
|
191
|
+
motion.timers.length = 0;
|
|
192
|
+
const elapsed = now() - origin;
|
|
193
|
+
if (ticks) {
|
|
194
|
+
for (const t of tickTimes(motion.curve, layout.rowHeight)) {
|
|
195
|
+
motion.timers.push(
|
|
196
|
+
setTimeout(
|
|
197
|
+
() => {
|
|
198
|
+
if (running === motion) {
|
|
199
|
+
tick(now());
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
Math.max(0, t * 1000 - elapsed),
|
|
203
|
+
),
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (landingMs != null) {
|
|
208
|
+
motion.timers.push(
|
|
209
|
+
setTimeout(
|
|
210
|
+
() => {
|
|
211
|
+
if (running === motion) {
|
|
212
|
+
reportNearest(motion.curve.to);
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
Math.max(0, landingMs - elapsed),
|
|
216
|
+
),
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
motion.timers.push(
|
|
220
|
+
setTimeout(
|
|
221
|
+
() => {
|
|
222
|
+
if (running !== motion) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
clear(motion);
|
|
226
|
+
reportNearest(motion.curve.to);
|
|
227
|
+
motion.onEnd?.('arrived', motion.curve.to);
|
|
228
|
+
},
|
|
229
|
+
Math.max(0, endMs - elapsed),
|
|
230
|
+
),
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const stop = (time?: number): number => {
|
|
235
|
+
const motion = running;
|
|
236
|
+
if (motion == null) {
|
|
237
|
+
return shown();
|
|
238
|
+
}
|
|
239
|
+
const offset = shown(time);
|
|
240
|
+
clear(motion);
|
|
241
|
+
// `set` ends the strip's animation and puts it where it was shown.
|
|
242
|
+
animator.set({y: -offset});
|
|
243
|
+
reportNearest(offset);
|
|
244
|
+
motion.onEnd?.('stopped', offset);
|
|
245
|
+
return offset;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
attach(strip) {
|
|
250
|
+
animator.attach(strip);
|
|
251
|
+
},
|
|
252
|
+
setLayout(next) {
|
|
253
|
+
layout = next;
|
|
254
|
+
},
|
|
255
|
+
onNearestChange(listener) {
|
|
256
|
+
nearestListener = listener;
|
|
257
|
+
lastNearest = null;
|
|
258
|
+
},
|
|
259
|
+
isMoving() {
|
|
260
|
+
return running != null;
|
|
261
|
+
},
|
|
262
|
+
offset(time) {
|
|
263
|
+
return shown(time);
|
|
264
|
+
},
|
|
265
|
+
target() {
|
|
266
|
+
return running?.curve.to ?? shown();
|
|
267
|
+
},
|
|
268
|
+
setOffset(offset, {ticks = false} = {}) {
|
|
269
|
+
if (running != null) {
|
|
270
|
+
stop();
|
|
271
|
+
}
|
|
272
|
+
if (
|
|
273
|
+
ticks &&
|
|
274
|
+
dragPrevious != null &&
|
|
275
|
+
canVibrate() &&
|
|
276
|
+
reachesRow(dragPrevious, offset, layout.rowHeight)
|
|
277
|
+
) {
|
|
278
|
+
tick(now());
|
|
279
|
+
}
|
|
280
|
+
dragPrevious = offset;
|
|
281
|
+
// A park is a one-off write: no layer for a strip at rest.
|
|
282
|
+
animator.set({y: -offset}, {promote: ticks});
|
|
283
|
+
reportNearest(offset);
|
|
284
|
+
},
|
|
285
|
+
resetDrag() {
|
|
286
|
+
dragPrevious = null;
|
|
287
|
+
},
|
|
288
|
+
stop,
|
|
289
|
+
play(
|
|
290
|
+
curve,
|
|
291
|
+
{ticks = false, onEnd, touchRelease = false, momentum = false} = {},
|
|
292
|
+
) {
|
|
293
|
+
stop();
|
|
294
|
+
dragPrevious = null;
|
|
295
|
+
const element = animator.element;
|
|
296
|
+
// What Reduce Motion makes of a transition: null while motion plays.
|
|
297
|
+
// Momentum is never substituted.
|
|
298
|
+
const fade = momentum ? null : reducedMotionFade(element, {touchRelease});
|
|
299
|
+
const endMs = fade == null ? curve.duration * 1000 : fade.duration;
|
|
300
|
+
if (!(endMs > 0)) {
|
|
301
|
+
animator.set({y: -curve.to});
|
|
302
|
+
reportNearest(curve.to);
|
|
303
|
+
onEnd?.('arrived', curve.to);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const motionCurve: MotionCurve = {
|
|
307
|
+
duration: curve.duration,
|
|
308
|
+
at: t => -curve.value(t),
|
|
309
|
+
velocity: t => -curve.velocity(t),
|
|
310
|
+
};
|
|
311
|
+
const handle = momentum
|
|
312
|
+
? animator.decay({y: motionCurve}, {touchRelease})
|
|
313
|
+
: animator.play({y: motionCurve}, {touchRelease});
|
|
314
|
+
const motion: Running = {curve, onEnd, timers: []};
|
|
315
|
+
running = motion;
|
|
316
|
+
const plan = {
|
|
317
|
+
endMs,
|
|
318
|
+
// A cross-fade has no travel to tick through.
|
|
319
|
+
ticks: ticks && fade == null && canVibrate(),
|
|
320
|
+
// A cross-fade lands its rows at its midpoint, faded out.
|
|
321
|
+
landingMs: fade == null ? null : endMs / 2,
|
|
322
|
+
};
|
|
323
|
+
schedule(motion, now(), plan);
|
|
324
|
+
// A busy main thread can hold a motion's first frame: its timers then
|
|
325
|
+
// follow the start the browser gives it. The animator's start promise
|
|
326
|
+
// only resolves, so nothing here waits on a rejection.
|
|
327
|
+
void handle.started.then(start => {
|
|
328
|
+
if (running === motion) {
|
|
329
|
+
schedule(motion, start, plan);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
forgetNearest() {
|
|
334
|
+
lastNearest = null;
|
|
335
|
+
},
|
|
336
|
+
dispose() {
|
|
337
|
+
stop();
|
|
338
|
+
animator.dispose();
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
}
|
package/src/Dialog/Dialog.tsx
CHANGED
|
@@ -81,7 +81,10 @@ import {themeProps} from '../utils/themeProps';
|
|
|
81
81
|
import type {DialogVariantMap} from './index';
|
|
82
82
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
83
83
|
import {useInteractionModalityTracking} from '../utils/interactionModality';
|
|
84
|
-
import {
|
|
84
|
+
import {
|
|
85
|
+
focusForLastInput,
|
|
86
|
+
prepareFocusReturnOnRemoval,
|
|
87
|
+
} from '../utils/focusReturn';
|
|
85
88
|
import {ModalAnnounceProvider} from '../hooks/ModalAnnounceProvider';
|
|
86
89
|
|
|
87
90
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
@@ -603,7 +606,8 @@ export function Dialog({
|
|
|
603
606
|
const allowEscape = purpose !== 'required';
|
|
604
607
|
const allowBackdropClick = purpose === 'info';
|
|
605
608
|
|
|
606
|
-
//
|
|
609
|
+
// Syncs the native dialog with `isOpen` through `showModal()` and `close()`.
|
|
610
|
+
// An inline dialog is not in the top layer, so it skips this.
|
|
607
611
|
useEffect(() => {
|
|
608
612
|
if (isInline) {
|
|
609
613
|
return;
|
|
@@ -653,39 +657,15 @@ export function Dialog({
|
|
|
653
657
|
}, [isOpen, isInline]);
|
|
654
658
|
|
|
655
659
|
// A dialog that unmounts while open (rendered only while open, or removed
|
|
656
|
-
// with the rest of a view) never runs the close branch above
|
|
657
|
-
//
|
|
658
|
-
// it, or dropped to the body by the removal, goes back to the opener.
|
|
660
|
+
// with the rest of a view) never runs the close branch above. Focus the
|
|
661
|
+
// removal lost goes back to the opener.
|
|
659
662
|
useEffect(() => {
|
|
660
|
-
|
|
663
|
+
const dialog = dialogRef.current;
|
|
664
|
+
if (isInline || dialog == null) {
|
|
661
665
|
return;
|
|
662
666
|
}
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
// element can no longer be found once the dialog is gone.
|
|
666
|
-
const host = dialog?.ownerDocument.defaultView?.frameElement ?? null;
|
|
667
|
-
return () => {
|
|
668
|
-
const trigger = triggerElementRef.current;
|
|
669
|
-
if (dialog == null || trigger == null) {
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
// Checked once the commit has finished: StrictMode's simulated unmount
|
|
673
|
-
// leaves the dialog in the document, and only a real removal returns
|
|
674
|
-
// focus.
|
|
675
|
-
queueMicrotask(() => {
|
|
676
|
-
if (dialog.isConnected || !trigger.isConnected) {
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
// isFocusLost reads the dialog's own document. For a dialog in an
|
|
680
|
-
// iframe, the document that hosts the frame must also have lost focus
|
|
681
|
-
// or keep it on that frame, wherever the opener is: a control the
|
|
682
|
-
// user pressed outside the frame to remove the dialog, or the frame
|
|
683
|
-
// itself, keeps its focus.
|
|
684
|
-
if (isFocusLost(dialog) && (host == null || isFocusLost(host))) {
|
|
685
|
-
focusForLastInput(trigger);
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
};
|
|
667
|
+
const returnFocusOnRemoval = prepareFocusReturnOnRemoval(dialog);
|
|
668
|
+
return () => returnFocusOnRemoval(triggerElementRef.current);
|
|
689
669
|
}, [isInline]);
|
|
690
670
|
|
|
691
671
|
// Host app-global surfaces (toasts) inside this modal while it is open, so
|
|
@@ -131,6 +131,8 @@ export function useDrawerDialogPresence({
|
|
|
131
131
|
// Element focused when the drawer opened — restored on close.
|
|
132
132
|
const triggerElementRef = useRef<HTMLElement | null>(null);
|
|
133
133
|
|
|
134
|
+
// Syncs the drawer's native host with `isOpen`. It shows or hides the
|
|
135
|
+
// top-layer host, keeps the opener, waits for the exit, and returns focus.
|
|
134
136
|
useEffect(() => {
|
|
135
137
|
const dialog = dialogRef.current;
|
|
136
138
|
if (!dialog) {
|
|
@@ -63,6 +63,8 @@ export function useMenuOverflow(
|
|
|
63
63
|
);
|
|
64
64
|
}, [menuRef]);
|
|
65
65
|
|
|
66
|
+
// Syncs the overflow measurement with the open menu. It measures, then
|
|
67
|
+
// observes resize, DOM changes and window resize.
|
|
66
68
|
useIsomorphicLayoutEffect(() => {
|
|
67
69
|
if (!isOpen) {
|
|
68
70
|
return;
|
|
@@ -98,6 +100,7 @@ export function useMenuOverflow(
|
|
|
98
100
|
};
|
|
99
101
|
}, [isOpen, measureOverflow, menuRef]);
|
|
100
102
|
|
|
103
|
+
// Measures overflow again after the content changes while the menu is open.
|
|
101
104
|
useIsomorphicLayoutEffect(() => {
|
|
102
105
|
if (isOpen) {
|
|
103
106
|
measureOverflow();
|
package/src/Field/Field.tsx
CHANGED
|
@@ -25,11 +25,11 @@ import {FieldStatus} from '../FieldStatus/FieldStatus';
|
|
|
25
25
|
import {useFieldStatusAnnouncement} from '../FieldStatus/useFieldStatusAnnouncement';
|
|
26
26
|
import {spacingVars, borderVars, sizeVars} from '../theme/tokens.stylex';
|
|
27
27
|
import type {IconType} from '../Icon';
|
|
28
|
-
import {mergeProps} from '../utils';
|
|
28
|
+
import {mergeProps} from '../utils/mergeProps';
|
|
29
29
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
30
30
|
import {FormLayoutContext} from '../FormLayout/FormLayoutContext';
|
|
31
31
|
import {Text} from '../Text/Text';
|
|
32
|
-
import {VisuallyHidden} from '../VisuallyHidden';
|
|
32
|
+
import {VisuallyHidden} from '../VisuallyHidden/VisuallyHidden';
|
|
33
33
|
import {themeProps} from '../utils/themeProps';
|
|
34
34
|
import type {FieldStatusPlacement} from './fieldStatusPlacement';
|
|
35
35
|
|
|
@@ -36,6 +36,7 @@ export function useFieldStatusAnnouncement(
|
|
|
36
36
|
type: InputStatusType | undefined,
|
|
37
37
|
): void {
|
|
38
38
|
const announce = useAnnounce();
|
|
39
|
+
// Syncs the live region with the status message.
|
|
39
40
|
useEffect(() => {
|
|
40
41
|
if (message) {
|
|
41
42
|
announce(message, type === 'error' ? 'assertive' : 'polite');
|