@astryxdesign/core 0.7.7 → 0.7.8-canary.0588a13
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 +11 -3
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +1 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts +1 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +55 -18
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
- package/dist/BottomSheet/bottomSheetStack.js +1 -1
- package/dist/BottomSheet/useSheetGestures.d.ts +3 -1
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +16 -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 +18 -22
- package/dist/Calendar/getWeekdayHeaderNames.d.ts +16 -0
- package/dist/Calendar/getWeekdayHeaderNames.d.ts.map +1 -0
- package/dist/Calendar/getWeekdayHeaderNames.js +70 -0
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +2 -10
- package/dist/Calendar/{standaloneShortWeekdayNames.generated.d.ts → weekdayHeaderNames.generated.d.ts} +14 -14
- package/dist/Calendar/weekdayHeaderNames.generated.d.ts.map +1 -0
- package/dist/Calendar/{standaloneShortWeekdayNames.generated.js → weekdayHeaderNames.generated.js} +12 -12
- 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 +6 -1
- 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/CheckboxList/CheckboxList.d.ts +20 -2
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +12 -4
- package/dist/CheckboxList/CheckboxListContext.d.ts +7 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListContext.js +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +14 -2
- package/dist/CheckboxList/requiredGroup.d.ts +22 -0
- package/dist/CheckboxList/requiredGroup.d.ts.map +1 -0
- package/dist/CheckboxList/requiredGroup.js +52 -0
- 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 +646 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +9 -30
- package/dist/DateInput/Wheel.d.ts +18 -37
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +133 -120
- package/dist/DateInput/datePickerTouch.d.ts +13 -0
- package/dist/DateInput/datePickerTouch.d.ts.map +1 -0
- package/dist/DateInput/datePickerTouch.js +14 -0
- 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 +94 -0
- package/dist/DateInput/wheelOptions.d.ts.map +1 -0
- package/dist/DateInput/wheelOptions.js +110 -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 +70 -127
- 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 +26 -34
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +20 -3
- package/dist/InfoTip/InfoTip.d.ts +5 -5
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +58 -19
- 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 +4 -1
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +3 -0
- package/dist/Layer/useTouchTrigger.d.ts +13 -7
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +20 -6
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.d.ts.map +1 -1
- package/dist/Layout/index.js +1 -1
- package/dist/Layout/layoutReset.js +1 -1
- package/dist/Layout/overlayPaddingReset.stylex.d.ts +68 -0
- package/dist/Layout/overlayPaddingReset.stylex.d.ts.map +1 -0
- package/dist/Layout/overlayPaddingReset.stylex.js +72 -0
- package/dist/Layout/padding.stylex.d.ts +5 -129
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +9 -143
- package/dist/Layout/paddingStyles.stylex.d.ts +83 -0
- package/dist/Layout/paddingStyles.stylex.d.ts.map +1 -0
- package/dist/Layout/paddingStyles.stylex.js +99 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +20 -1
- package/dist/MobileNav/MobileNav.d.ts +3 -2
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +10 -26
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +2 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +2 -1
- 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/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +7 -2
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -0
- package/dist/Popover/usePopover.js +2 -2
- package/dist/PowerSearch/PowerSearch.d.ts +41 -4
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +441 -134
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +125 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +2041 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +43 -10
- 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 +3 -2
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +273 -86
- package/dist/PowerSearch/formatFilterValue.d.ts +14 -7
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +31 -23
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +161 -0
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/powerSearchDateZone.d.ts +25 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchDateZone.js +57 -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 +8 -1
- 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 +116 -92
- package/dist/Resizable/createResizable.d.ts +199 -0
- package/dist/Resizable/createResizable.d.ts.map +1 -0
- package/dist/Resizable/createResizable.js +733 -0
- package/dist/Resizable/separatorAttributes.d.ts +45 -0
- package/dist/Resizable/separatorAttributes.d.ts.map +1 -0
- package/dist/Resizable/separatorAttributes.js +35 -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 +7 -9
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +36 -5
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +16 -11
- 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/Stepper/Stepper.d.ts.map +1 -1
- package/dist/Stepper/Stepper.js +10 -15
- 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 +12 -0
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +17 -3
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +11 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +27 -14
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +2 -1
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +12 -8
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +2 -0
- package/dist/TimeInput/TimeWheels.d.ts +32 -0
- package/dist/TimeInput/TimeWheels.d.ts.map +1 -0
- package/dist/TimeInput/TimeWheels.js +144 -0
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +63 -116
- package/dist/TimeInput/timeWheelRules.d.ts +124 -0
- package/dist/TimeInput/timeWheelRules.d.ts.map +1 -0
- package/dist/TimeInput/timeWheelRules.js +277 -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/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +1 -23
- 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 +44 -46
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +20 -21
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +12 -18
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +2 -23
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +5 -29
- package/dist/Tooltip/useTooltip.d.ts +23 -30
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +200 -108
- 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 +53 -8
- package/dist/gestures/GestureHost.d.ts +16 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +4 -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 +18 -7
- 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 +117 -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/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
- 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 +8 -9
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +50 -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 +45 -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/Resizable/createResizable.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Resizable/createResizable.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Resizable/createResizable.generated.js +13 -0
- package/dist/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.js +3 -1
- package/dist/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.js +3 -1
- package/dist/i18n/generated-english/TimeInput/TimeWheels.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TimeInput/TimeWheels.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TimeInput/TimeWheels.generated.js +17 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +37 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +37 -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/keyboard/index.d.ts +17 -0
- package/dist/keyboard/index.d.ts.map +1 -0
- package/dist/keyboard/index.js +19 -0
- package/dist/keyboard/keyboardHeight.d.ts +149 -0
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -0
- package/dist/keyboard/keyboardHeight.js +432 -0
- package/dist/keyboard/keyboardLayoutGuide.d.ts +59 -0
- package/dist/keyboard/keyboardLayoutGuide.d.ts.map +1 -0
- package/dist/keyboard/keyboardLayoutGuide.js +207 -0
- package/dist/keyboard/keyboardModel.d.ts +93 -0
- package/dist/keyboard/keyboardModel.d.ts.map +1 -0
- package/dist/keyboard/keyboardModel.js +220 -0
- package/dist/keyboard/rideKeyboard.d.ts +42 -0
- package/dist/keyboard/rideKeyboard.d.ts.map +1 -0
- package/dist/keyboard/rideKeyboard.js +77 -0
- package/dist/keyboard/useMobileKeyboard.d.ts +61 -0
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -0
- package/dist/keyboard/useMobileKeyboard.js +699 -0
- package/dist/motion/android/index.d.ts +16 -0
- package/dist/motion/android/index.d.ts.map +1 -0
- package/dist/motion/android/index.js +18 -0
- package/dist/motion/android/keyboard.d.ts +83 -0
- package/dist/motion/android/keyboard.d.ts.map +1 -0
- package/dist/motion/android/keyboard.js +96 -0
- package/dist/motion/animatedLayout.d.ts +8 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +246 -53
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +45 -26
- package/dist/motion/frameBlock.d.ts +14 -0
- package/dist/motion/frameBlock.d.ts.map +1 -0
- package/dist/motion/frameBlock.js +16 -0
- 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/datePicker.d.ts +58 -0
- package/dist/motion/uikit/datePicker.d.ts.map +1 -0
- package/dist/motion/uikit/datePicker.js +60 -0
- package/dist/motion/uikit/index.d.ts +6 -4
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +6 -4
- 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/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +14 -13
- 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 +15 -2
- package/dist/theme/tokens.stylex.d.ts +3 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +4 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/disabledInteraction.d.ts +10 -2
- package/dist/utils/disabledInteraction.d.ts.map +1 -1
- package/dist/utils/disabledInteraction.js +16 -2
- package/dist/utils/focusReturn.d.ts +22 -25
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +36 -29
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +4 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +6 -4
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +6 -4
- package/dist/utils/isFocusDetached.d.ts +27 -0
- package/dist/utils/isFocusDetached.d.ts.map +1 -0
- package/dist/utils/isFocusDetached.js +32 -0
- package/dist/utils/layoutViewport.d.ts +25 -0
- package/dist/utils/layoutViewport.d.ts.map +1 -0
- package/dist/utils/layoutViewport.js +102 -0
- package/dist/utils/plainDate.d.ts +31 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +68 -4
- package/dist/utils/pressFeedback.d.ts +6 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +97 -18
- package/dist/utils/pressGesture.d.ts +4 -2
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +3 -1
- package/dist/utils/selectionLock.d.ts +10 -1
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +31 -5
- package/dist/utils/sharedMutationObserver.d.ts +2 -1
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -1
- package/dist/utils/sharedMutationObserver.js +2 -1
- package/dist/utils/timeParser.d.ts +2 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +29 -3
- 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 +148 -0
- package/locales/pseudo.json +111 -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 +13 -4
- package/src/BottomSheet/BottomSheet.doc.mjs +1 -1
- package/src/BottomSheet/BottomSheet.tsx +1 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +80 -16
- package/src/BottomSheet/BottomSheetSwitcher.doc.mjs +5 -0
- package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
- package/src/BottomSheet/bottomSheetStack.ts +1 -1
- package/src/BottomSheet/useSheetGestures.ts +16 -1
- package/src/Button/Button.tsx +26 -4
- package/src/Calendar/Calendar.tsx +40 -32
- package/src/Calendar/getWeekdayHeaderNames.ts +88 -0
- package/src/Calendar/hooks/useCalendarDays.ts +5 -10
- package/src/Calendar/{standaloneShortWeekdayNames.generated.ts → weekdayHeaderNames.generated.ts} +14 -14
- package/src/Carousel/Carousel.tsx +1 -0
- package/src/Chat/ChatComposerInput.tsx +4 -7
- 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/CheckboxList/CheckboxList.doc.mjs +14 -0
- package/src/CheckboxList/CheckboxList.tsx +43 -2
- package/src/CheckboxList/CheckboxListContext.tsx +9 -1
- package/src/CheckboxList/CheckboxListItem.tsx +23 -2
- package/src/CheckboxList/requiredGroup.ts +77 -0
- 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 +796 -0
- package/src/DateInput/TouchDateField.tsx +6 -32
- package/src/DateInput/Wheel.tsx +188 -171
- package/src/DateInput/datePickerTouch.ts +15 -0
- 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 +184 -0
- package/src/DateInput/wheelPhysics.ts +406 -0
- package/src/DateInput/wheelStrip.ts +341 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +100 -189
- 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 +55 -55
- package/src/Icon/Icon.doc.mjs +51 -10
- package/src/Icon/Icon.tsx +31 -8
- package/src/IconButton/IconButton.doc.mjs +141 -21
- package/src/InfoTip/InfoTip.tsx +72 -16
- 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 +3 -1
- package/src/Layer/useLayerDismissal.ts +2 -0
- package/src/Layer/useTouchTrigger.ts +19 -6
- package/src/Layout/index.ts +1 -1
- package/src/Layout/layoutReset.ts +1 -1
- package/src/Layout/overlayPaddingReset.stylex.ts +73 -0
- package/src/Layout/padding.stylex.ts +9 -133
- package/src/Layout/paddingStyles.stylex.ts +87 -0
- package/src/Lightbox/Lightbox.tsx +20 -1
- package/src/Lightbox/useLightbox.doc.mjs +167 -0
- package/src/MobileNav/MobileNav.tsx +10 -31
- package/src/MultiSelector/MultiSelector.tsx +2 -7
- package/src/NumberInput/NumberInput.tsx +2 -7
- package/src/Outline/useOutlineFromDOM.ts +2 -0
- package/src/Outline/useScrollSpy.ts +2 -0
- package/src/OverflowList/OverflowList.tsx +2 -0
- package/src/Overlay/Overlay.tsx +7 -2
- package/src/Popover/Popover.tsx +4 -0
- package/src/Popover/usePopover.tsx +2 -2
- package/src/PowerSearch/PowerSearch.doc.mjs +60 -8
- package/src/PowerSearch/PowerSearch.tsx +622 -157
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2700 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +65 -9
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +2 -0
- package/src/PowerSearch/PowerSearchToken.tsx +2 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +340 -59
- package/src/PowerSearch/formatFilterValue.ts +49 -27
- package/src/PowerSearch/formatTokenValue.ts +220 -0
- package/src/PowerSearch/index.ts +5 -1
- package/src/PowerSearch/powerSearchDateZone.ts +95 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/PowerSearch/types.ts +8 -1
- 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 +187 -135
- package/src/Resizable/createResizable.ts +1046 -0
- package/src/Resizable/separatorAttributes.ts +73 -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 +7 -19
- package/src/SideNav/SideNav.tsx +41 -5
- package/src/Slider/Slider.tsx +20 -11
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Stepper/Stepper.tsx +10 -27
- 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 +31 -7
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +43 -20
- package/src/Table/useTableRowExpansion.doc.mjs +9 -0
- package/src/Table/useTableTreeData.doc.mjs +15 -3
- package/src/TextArea/TextArea.tsx +2 -7
- package/src/TextInput/TextInput.tsx +13 -17
- package/src/TimeInput/TimeInput.tsx +2 -0
- package/src/TimeInput/TimeWheels.tsx +218 -0
- package/src/TimeInput/TouchTimeField.tsx +93 -155
- package/src/TimeInput/timeWheelRules.ts +352 -0
- package/src/Timer/Timer.tsx +1 -0
- package/src/Timestamp/Timestamp.tsx +1 -1
- package/src/Timestamp/formatInstant.ts +1 -33
- 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 +10 -10
- package/src/Tokenizer/Tokenizer.tsx +61 -62
- package/src/Tokenizer/TokenizerBottomSheet.tsx +17 -23
- package/src/Tokenizer/index.ts +1 -0
- package/src/Tooltip/Tooltip.tsx +6 -42
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +243 -134
- 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 +6 -5
- 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 +25 -9
- 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 +149 -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 +53 -60
- package/src/hooks/useScrollableArea.ts +4 -0
- package/src/hooks/useStreamingText.ts +2 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +46 -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/Resizable/createResizable.generated.ts +14 -0
- package/src/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.ts +3 -1
- package/src/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.ts +3 -1
- package/src/i18n/generated-english/TimeInput/TimeWheels.generated.ts +18 -0
- package/src/i18n/generated-locales/en.generated.ts +47 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +48 -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/keyboard/README.md +197 -0
- package/src/keyboard/index.ts +48 -0
- package/src/keyboard/keyboardHeight.ts +543 -0
- package/src/keyboard/keyboardLayoutGuide.ts +266 -0
- package/src/keyboard/keyboardModel.ts +301 -0
- package/src/keyboard/rideKeyboard.ts +100 -0
- package/src/keyboard/useMobileKeyboard.ts +866 -0
- package/src/motion/MEASUREMENTS.md +28 -0
- package/src/motion/README.md +12 -5
- package/src/motion/android/index.ts +18 -0
- package/src/motion/android/keyboard.ts +96 -0
- package/src/motion/animatedLayout.ts +323 -60
- package/src/motion/animator.ts +66 -37
- package/src/motion/frameBlock.ts +16 -0
- 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/datePicker.ts +60 -0
- package/src/motion/uikit/index.ts +6 -4
- 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/generateThemeRules.ts +14 -12
- package/src/theme/motionKnobs.ts +4 -3
- package/src/theme/themeMotion.ts +17 -2
- package/src/theme/tokens.stylex.ts +2 -0
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/disabledInteraction.ts +23 -2
- package/src/utils/focusReturn.ts +38 -31
- package/src/utils/index.ts +1 -1
- package/src/utils/interactionModality.ts +4 -0
- package/src/utils/interactionOverlay.stylex.ts +6 -4
- package/src/utils/isFocusDetached.ts +34 -0
- package/src/utils/layoutViewport.ts +104 -0
- package/src/utils/plainDate.ts +80 -4
- package/src/utils/pressFeedback.ts +126 -30
- package/src/utils/pressGesture.ts +4 -2
- package/src/utils/selectionLock.ts +40 -6
- package/src/utils/sharedMutationObserver.ts +2 -1
- package/src/utils/timeParser.ts +40 -3
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts +0 -21
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +0 -1
- package/dist/BottomSheet/useMobileKeyboard.js +0 -407
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +0 -14
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +0 -1
- package/dist/Calendar/getStandaloneShortWeekdayNames.js +0 -26
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +0 -1
- package/dist/Layer/usePressPin.d.ts +0 -93
- package/dist/Layer/usePressPin.d.ts.map +0 -1
- package/dist/Layer/usePressPin.js +0 -363
- 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/BottomSheet/useMobileKeyboard.ts +0 -538
- package/src/Calendar/getStandaloneShortWeekdayNames.ts +0 -38
- package/src/Layer/usePressPin.ts +0 -510
- package/src/internal/touch-sheet.ts +0 -21
|
@@ -4,22 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useTooltip.tsx
|
|
7
|
-
* @input Uses useLayer,
|
|
8
|
-
* @output Exports useTooltip hook with stable trigger refs for hover/focus/tap tooltips
|
|
9
|
-
* and
|
|
7
|
+
* @input Uses useLayer, useTouchTriggerInternal, React hooks
|
|
8
|
+
* @output Exports useTooltip hook with stable trigger refs for hover/focus/tap tooltips
|
|
9
|
+
* and imperative show() and hide() for an app-built toggle trigger
|
|
10
10
|
* @position Layer hook; builds on useLayer for tooltip behavior
|
|
11
11
|
*
|
|
12
12
|
* SYNC: When modified, update:
|
|
13
13
|
* - /packages/core/src/Tooltip/index.ts
|
|
14
14
|
*/
|
|
15
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
15
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
16
|
+
import { createTriggerFocusGate } from "../utils/triggerFocus.js";
|
|
16
17
|
import * as stylex from '@stylexjs/stylex';
|
|
17
18
|
import { useLayerInternal } from "../Layer/useLayer.js";
|
|
19
|
+
import { useTouchTriggerInternal } from "../Layer/useTouchTrigger.js";
|
|
18
20
|
import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
19
21
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
20
22
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
21
23
|
import { registerLayerSurface } from "../Layer/layerSurfacePress.js";
|
|
22
|
-
import { usePressPin } from "../Layer/usePressPin.js";
|
|
23
24
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
24
25
|
import { themeProps } from "../utils/themeProps.js";
|
|
25
26
|
import "../theme/tokens.stylex.js";
|
|
@@ -52,28 +53,6 @@ const styles = {
|
|
|
52
53
|
* Touch trigger behavior for tooltips
|
|
53
54
|
*/
|
|
54
55
|
|
|
55
|
-
/**
|
|
56
|
-
* Check if an element is naturally focusable
|
|
57
|
-
*/
|
|
58
|
-
function isFocusable(element) {
|
|
59
|
-
// Elements with explicit tabindex
|
|
60
|
-
if (element.hasAttribute('tabindex')) {
|
|
61
|
-
return element.tabIndex >= 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Naturally focusable elements
|
|
65
|
-
const focusableTags = ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
|
|
66
|
-
if (focusableTags.includes(element.tagName)) {
|
|
67
|
-
return !element.disabled;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Elements with contenteditable
|
|
71
|
-
if (element.isContentEditable) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
56
|
/**
|
|
78
57
|
* Hook for tooltip behavior with hover/focus triggers.
|
|
79
58
|
*
|
|
@@ -100,24 +79,6 @@ function isFocusable(element) {
|
|
|
100
79
|
*/
|
|
101
80
|
|
|
102
81
|
export function useTooltip(options = {}) {
|
|
103
|
-
// The option is fixed to `adaptive`, so an options object that carries it at
|
|
104
|
-
// runtime cannot reach the press-to-pin path.
|
|
105
|
-
return useTooltipWithTriggerBehavior({
|
|
106
|
-
...options,
|
|
107
|
-
triggerBehavior: 'adaptive'
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Module-only options for `useTooltipWithTriggerBehavior`. Not exported from
|
|
113
|
-
* the package.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* `useTooltip` with a trigger behavior. Module-only: InfoTip's press-to-pin
|
|
118
|
-
* goes through it, and the package does not export it.
|
|
119
|
-
*/
|
|
120
|
-
export function useTooltipWithTriggerBehavior(options = {}) {
|
|
121
82
|
const {
|
|
122
83
|
placement = 'above',
|
|
123
84
|
alignment = 'center',
|
|
@@ -125,7 +86,6 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
125
86
|
hideDelay = 0,
|
|
126
87
|
focusTrigger = 'auto',
|
|
127
88
|
touchTrigger = 'auto',
|
|
128
|
-
triggerBehavior = 'adaptive',
|
|
129
89
|
isEnabled = true,
|
|
130
90
|
isOpen,
|
|
131
91
|
isDefaultOpen = false,
|
|
@@ -180,39 +140,118 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
180
140
|
hideLayer();
|
|
181
141
|
}, [clearTimeouts, hideLayer]);
|
|
182
142
|
|
|
183
|
-
//
|
|
184
|
-
|
|
143
|
+
// DOM listeners read the latest controlled state through a ref.
|
|
144
|
+
const latestRef = useRef({
|
|
145
|
+
isOpen,
|
|
146
|
+
isLayerOpen,
|
|
147
|
+
onShow,
|
|
148
|
+
onHide
|
|
149
|
+
});
|
|
150
|
+
latestRef.current = {
|
|
151
|
+
isOpen,
|
|
152
|
+
isLayerOpen,
|
|
153
|
+
onShow,
|
|
154
|
+
onHide
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// The app's show() holds the tooltip open until hide(), Escape, a press or
|
|
158
|
+
// scroll outside, or focus leaving the trigger and the tooltip.
|
|
159
|
+
const isHeldRef = useRef(false);
|
|
160
|
+
const [isHeldState, setIsHeldState] = useState(false);
|
|
161
|
+
const setHeld = useCallback(next => {
|
|
162
|
+
isHeldRef.current = next;
|
|
163
|
+
setIsHeldState(next);
|
|
164
|
+
}, []);
|
|
165
|
+
|
|
166
|
+
// Whether the current hold began during a press on the trigger. Such a
|
|
167
|
+
// hold ends with the press when the press ends off the trigger, as no click
|
|
168
|
+
// pins it. The hover rules then decide. isHoldInThisTaskRef covers a show()
|
|
169
|
+
// that runs before the hook's own pointerdown listener.
|
|
170
|
+
const isHoldFromPressRef = useRef(false);
|
|
171
|
+
const isHoldInThisTaskRef = useRef(false);
|
|
172
|
+
const handleReleaseInLayer = useCallback(() => {
|
|
173
|
+
if (isHoldFromPressRef.current && isHeldRef.current) {
|
|
174
|
+
isHoldFromPressRef.current = false;
|
|
175
|
+
setHeld(false);
|
|
176
|
+
}
|
|
177
|
+
}, [setHeld]);
|
|
178
|
+
|
|
179
|
+
// The touch trigger's outside dismissal (a press or scroll outside) ends a
|
|
180
|
+
// hold with the tooltip.
|
|
181
|
+
const hideFromTouch = useCallback(() => {
|
|
182
|
+
if (isHeldRef.current) {
|
|
183
|
+
setHeld(false);
|
|
184
|
+
const latest = latestRef.current;
|
|
185
|
+
if (latest.isOpen !== undefined) {
|
|
186
|
+
latest.onHide?.();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
hideNow();
|
|
191
|
+
}, [setHeld, hideNow]);
|
|
185
192
|
const {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
isTouchInteraction,
|
|
194
|
-
handlePointerEnter,
|
|
195
|
-
handlePointerDown: handleTouchPointerDown,
|
|
196
|
-
clearTapOpen
|
|
197
|
-
}
|
|
198
|
-
} = usePressPin({
|
|
199
|
-
triggerBehavior,
|
|
193
|
+
isTouchPointerRef,
|
|
194
|
+
isTouchInteraction,
|
|
195
|
+
handlePointerEnter,
|
|
196
|
+
handlePointerDown: handleTouchPointerDown,
|
|
197
|
+
clearTapOpen,
|
|
198
|
+
armOutsideDismiss
|
|
199
|
+
} = useTouchTriggerInternal({
|
|
200
200
|
touchTrigger,
|
|
201
201
|
isEnabled,
|
|
202
|
-
isOpen,
|
|
203
|
-
isLayerOpen,
|
|
202
|
+
isControlled: isOpen !== undefined,
|
|
203
|
+
isOpen: isLayerOpen,
|
|
204
204
|
layerId,
|
|
205
205
|
triggerRef,
|
|
206
|
-
component: 'Tooltip',
|
|
207
206
|
show: showNow,
|
|
208
|
-
hide:
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
hide: hideFromTouch
|
|
208
|
+
}, handleReleaseInLayer);
|
|
209
|
+
const isHeldOpen = useCallback(() => {
|
|
210
|
+
const latest = latestRef.current;
|
|
211
|
+
return isHeldRef.current && latest.isLayerOpen && latest.isOpen !== false;
|
|
212
|
+
}, []);
|
|
213
|
+
const releaseHold = useCallback(() => {
|
|
214
|
+
clearTapOpen();
|
|
215
|
+
setHeld(false);
|
|
216
|
+
const latest = latestRef.current;
|
|
217
|
+
if (latest.isOpen !== undefined) {
|
|
218
|
+
latest.onHide?.();
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
hideNow();
|
|
222
|
+
}, [clearTapOpen, setHeld, hideNow]);
|
|
223
|
+
const dropHold = useCallback(() => {
|
|
224
|
+
if (isHeldRef.current) {
|
|
225
|
+
setHeld(false);
|
|
226
|
+
}
|
|
227
|
+
}, [setHeld]);
|
|
228
|
+
|
|
229
|
+
// Focus leaving the trigger and the tooltip ends a hold, whatever
|
|
230
|
+
// `focusTrigger` is. Focus that leaves for no element is a press's to
|
|
231
|
+
// decide. The trigger can sit in another document, so the check uses its
|
|
232
|
+
// own window.
|
|
233
|
+
const handleHeldFocusOut = useCallback(event => {
|
|
234
|
+
if (!isHeldOpen()) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const next = event.relatedTarget;
|
|
238
|
+
const trigger = triggerRef.current;
|
|
239
|
+
const view = trigger?.ownerDocument.defaultView;
|
|
240
|
+
if (view == null || !(next instanceof view.Node)) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const surface = trigger?.ownerDocument.getElementById(layerId) ?? null;
|
|
244
|
+
if (trigger?.contains(next) === true || surface?.contains(next) === true) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
releaseHold();
|
|
248
|
+
}, [isHeldOpen, layerId, releaseHold]);
|
|
249
|
+
const isHoldShown = isHeldState && isLayerOpen && isOpen !== false;
|
|
211
250
|
|
|
212
|
-
// Only a
|
|
251
|
+
// Only a hold announces the text: a preview is already the trigger's
|
|
213
252
|
// description.
|
|
214
253
|
const contentRef = useRef(null);
|
|
215
|
-
useAnnounceRenderedText(contentRef,
|
|
254
|
+
useAnnounceRenderedText(contentRef, isHoldShown, 'pinned');
|
|
216
255
|
const contentRefs = useMergedRefs(contentRef, registerLayerSurface);
|
|
217
256
|
|
|
218
257
|
// Schedule show with delay (suppressed when isOpen is false)
|
|
@@ -242,7 +281,7 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
242
281
|
// trigger onto the tooltip surface without the tooltip vanishing — required
|
|
243
282
|
// for WCAG 1.4.13 (Content on Hover or Focus: hoverable).
|
|
244
283
|
const scheduleHide = useCallback(() => {
|
|
245
|
-
if (isOpen === true ||
|
|
284
|
+
if (isOpen === true || isHeldOpen()) {
|
|
246
285
|
return;
|
|
247
286
|
}
|
|
248
287
|
clearTimeouts();
|
|
@@ -250,7 +289,7 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
250
289
|
hideTimeoutRef.current = setTimeout(() => {
|
|
251
290
|
hideLayer();
|
|
252
291
|
}, effectiveHideDelay);
|
|
253
|
-
}, [isOpen,
|
|
292
|
+
}, [isOpen, isHeldOpen, clearTimeouts, hideLayer, hideDelay]);
|
|
254
293
|
|
|
255
294
|
// Cancel a pending hide (e.g. the pointer entered the tooltip surface).
|
|
256
295
|
const cancelHide = useCallback(() => {
|
|
@@ -289,25 +328,11 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
289
328
|
scheduleHide();
|
|
290
329
|
}, [isTouchPointerRef, layerId, scheduleHide]);
|
|
291
330
|
|
|
292
|
-
// Under `auto`, whether focus counts is decided when it arrives,
|
|
293
|
-
//
|
|
294
|
-
|
|
295
|
-
// by definition; focus inside it counts only while the trigger is
|
|
296
|
-
// focusable too, so a plain wrapper still ignores its children's focus.
|
|
297
|
-
const isFocusForTrigger = useCallback(e => {
|
|
298
|
-
if (focusTrigger === 'always') {
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
301
|
-
const triggerEl = e.currentTarget;
|
|
302
|
-
return triggerEl != null && (e.target === triggerEl || isFocusable(triggerEl));
|
|
303
|
-
}, [focusTrigger]);
|
|
304
|
-
|
|
305
|
-
// Whether the trigger's current focus counted when it arrived, so its blur
|
|
306
|
-
// hides the tooltip even if the trigger has since left the tab order.
|
|
307
|
-
const focusCountedRef = useRef(false);
|
|
331
|
+
// Under `auto`, whether focus counts is decided when it arrives, and a
|
|
332
|
+
// focus that counted still hides on blur (utils/triggerFocus.ts).
|
|
333
|
+
const [focusGate] = useState(createTriggerFocusGate);
|
|
308
334
|
const handleFocusIn = useCallback(e => {
|
|
309
|
-
|
|
310
|
-
if (!isEnabled || !focusCountedRef.current) {
|
|
335
|
+
if (!focusGate.focusIn(e, focusTrigger) || !isEnabled) {
|
|
311
336
|
return;
|
|
312
337
|
}
|
|
313
338
|
// A tap focuses the trigger it activates, and `:focus-visible` does not
|
|
@@ -326,18 +351,17 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
326
351
|
}
|
|
327
352
|
clearTimeouts();
|
|
328
353
|
showLayer();
|
|
329
|
-
}, [
|
|
354
|
+
}, [focusGate, focusTrigger, isEnabled, isTouchInteraction, clearTimeouts, showLayer]);
|
|
330
355
|
|
|
331
|
-
// A
|
|
332
|
-
// trigger whatever `focusTrigger` is. This schedules the
|
|
333
|
-
//
|
|
356
|
+
// A held tooltip's focus-leave close is the hold's own: it listens on the
|
|
357
|
+
// trigger whatever `focusTrigger` is. This schedules the unheld hide, which
|
|
358
|
+
// a held tooltip skips.
|
|
334
359
|
const handleFocusOut = useCallback(e => {
|
|
335
|
-
if (!
|
|
360
|
+
if (!focusGate.focusOut(e, focusTrigger)) {
|
|
336
361
|
return;
|
|
337
362
|
}
|
|
338
|
-
focusCountedRef.current = false;
|
|
339
363
|
scheduleHide();
|
|
340
|
-
}, [
|
|
364
|
+
}, [focusGate, focusTrigger, scheduleHide]);
|
|
341
365
|
|
|
342
366
|
// Pressing the trigger hides its own tooltip: once the control is activated
|
|
343
367
|
// the hint has served its purpose, and a tooltip lingering over a
|
|
@@ -346,13 +370,50 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
346
370
|
// is owned by the consumer. `hideLayer()` self-guards when already closed.
|
|
347
371
|
// A touch press is a different gesture (it may be the only way to open the
|
|
348
372
|
// tooltip at all), so the touch path answers it first.
|
|
373
|
+
// Whether a press on the trigger is down, from the hook's pointerdown to
|
|
374
|
+
// the press's end.
|
|
375
|
+
const isTriggerPressedRef = useRef(false);
|
|
376
|
+
const stopPressTrackingRef = useRef(null);
|
|
377
|
+
const trackTriggerPress = useCallback(() => {
|
|
378
|
+
stopPressTrackingRef.current?.();
|
|
379
|
+
const view = triggerRef.current?.ownerDocument.defaultView;
|
|
380
|
+
if (view == null) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
isTriggerPressedRef.current = true;
|
|
384
|
+
const trigger = triggerRef.current;
|
|
385
|
+
const stop = event => {
|
|
386
|
+
// A press that ends on the trigger keeps its hold, as a click does.
|
|
387
|
+
if (event?.type === 'pointerup' && event.target instanceof view.Node && trigger?.contains(event.target) === true) {
|
|
388
|
+
isHoldFromPressRef.current = false;
|
|
389
|
+
}
|
|
390
|
+
view.removeEventListener('pointerup', stop, true);
|
|
391
|
+
view.removeEventListener('pointercancel', stop, true);
|
|
392
|
+
isTriggerPressedRef.current = false;
|
|
393
|
+
stopPressTrackingRef.current = null;
|
|
394
|
+
};
|
|
395
|
+
view.addEventListener('pointerup', stop, true);
|
|
396
|
+
view.addEventListener('pointercancel', stop, true);
|
|
397
|
+
stopPressTrackingRef.current = stop;
|
|
398
|
+
}, []);
|
|
349
399
|
const handlePointerDown = useCallback(event => {
|
|
350
|
-
|
|
351
|
-
//
|
|
352
|
-
|
|
400
|
+
trackTriggerPress();
|
|
401
|
+
// The app's hide() closes a held tooltip. A press neither hides it here
|
|
402
|
+
// nor waits for a tap verdict. A show() in a capture handler of this
|
|
403
|
+
// press runs before this listener. Tie that hold to the press.
|
|
404
|
+
if (isHeldRef.current) {
|
|
405
|
+
if (isHoldInThisTaskRef.current) {
|
|
406
|
+
isHoldFromPressRef.current = true;
|
|
407
|
+
}
|
|
353
408
|
return;
|
|
354
409
|
}
|
|
355
410
|
if (handleTouchPointerDown(event)) {
|
|
411
|
+
// A pen in range starts the hover show before it lands. Left pending,
|
|
412
|
+
// that show opens the layer during the press. The tap then closes it.
|
|
413
|
+
if (showTimeoutRef.current) {
|
|
414
|
+
clearTimeout(showTimeoutRef.current);
|
|
415
|
+
showTimeoutRef.current = null;
|
|
416
|
+
}
|
|
356
417
|
return;
|
|
357
418
|
}
|
|
358
419
|
if (isOpen !== undefined) {
|
|
@@ -360,7 +421,7 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
360
421
|
}
|
|
361
422
|
clearTimeouts();
|
|
362
423
|
hideLayer();
|
|
363
|
-
}, [
|
|
424
|
+
}, [handleTouchPointerDown, trackTriggerPress, isOpen, clearTimeouts, hideLayer]);
|
|
364
425
|
|
|
365
426
|
// Interaction ref that handles event listeners only
|
|
366
427
|
const interactionRef = useCallback(el => {
|
|
@@ -370,6 +431,8 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
370
431
|
triggerRef.current.removeEventListener('mouseleave', handleMouseLeave);
|
|
371
432
|
triggerRef.current.removeEventListener('focusin', handleFocusIn);
|
|
372
433
|
triggerRef.current.removeEventListener('focusout', handleFocusOut);
|
|
434
|
+
triggerRef.current.removeEventListener('focusout', handleHeldFocusOut);
|
|
435
|
+
stopPressTrackingRef.current?.();
|
|
373
436
|
triggerRef.current.removeEventListener('pointerenter', handlePointerEnter);
|
|
374
437
|
triggerRef.current.removeEventListener('pointerdown', handlePointerDown);
|
|
375
438
|
}
|
|
@@ -384,15 +447,17 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
384
447
|
el.addEventListener('pointerdown', handlePointerDown);
|
|
385
448
|
|
|
386
449
|
// Focus listeners unless focus never opens the tooltip; `auto` decides
|
|
387
|
-
// per event (
|
|
450
|
+
// per event (utils/triggerFocus.ts).
|
|
388
451
|
if (focusTrigger !== 'never') {
|
|
389
452
|
el.addEventListener('focusin', handleFocusIn);
|
|
390
453
|
el.addEventListener('focusout', handleFocusOut);
|
|
391
454
|
}
|
|
392
455
|
}
|
|
456
|
+
|
|
457
|
+
// Its own focus-leave listener: `focusTrigger="never"` attaches none.
|
|
458
|
+
el?.addEventListener('focusout', handleHeldFocusOut);
|
|
393
459
|
triggerRef.current = el;
|
|
394
|
-
|
|
395
|
-
}, [attachPressPin, focusTrigger, handleMouseEnter, handleMouseLeave, handleFocusIn, handleFocusOut, handlePointerEnter, handlePointerDown]);
|
|
460
|
+
}, [handleHeldFocusOut, focusTrigger, handleMouseEnter, handleMouseLeave, handleFocusIn, handleFocusOut, handlePointerEnter, handlePointerDown]);
|
|
396
461
|
|
|
397
462
|
// Combined ref - shorthand for calling both positionRef and interactionRef
|
|
398
463
|
const ref = useCallback(el => {
|
|
@@ -425,9 +490,11 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
425
490
|
showLayer();
|
|
426
491
|
} else {
|
|
427
492
|
clearTimeouts();
|
|
493
|
+
// A hold ends when the consumer closes the tooltip.
|
|
494
|
+
dropHold();
|
|
428
495
|
hideLayer();
|
|
429
496
|
}
|
|
430
|
-
}, [isOpen, clearTimeouts, showLayer, hideLayer]);
|
|
497
|
+
}, [isOpen, clearTimeouts, showLayer, hideLayer, dropHold]);
|
|
431
498
|
|
|
432
499
|
// Dismiss on Escape (WCAG 1.4.13 — dismissible) through the shared layer
|
|
433
500
|
// stack. A visible tip is the top-most layer, so it takes the press and
|
|
@@ -465,7 +532,7 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
465
532
|
onDismiss: () => {
|
|
466
533
|
clearTimeouts();
|
|
467
534
|
clearTapOpen();
|
|
468
|
-
|
|
535
|
+
dropHold();
|
|
469
536
|
if (isOpen !== undefined) {
|
|
470
537
|
onHide?.();
|
|
471
538
|
return;
|
|
@@ -498,7 +565,7 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
498
565
|
// something else in the shared interactive-ancestor walk, so a
|
|
499
566
|
// clickable container around the trigger leaves the press alone while
|
|
500
567
|
// document listeners still see it.
|
|
501
|
-
// The
|
|
568
|
+
// The hold's announcement reads this element's text.
|
|
502
569
|
_jsx("div", {
|
|
503
570
|
ref: contentRefs,
|
|
504
571
|
...{
|
|
@@ -507,12 +574,37 @@ export function useTooltipWithTriggerBehavior(options = {}) {
|
|
|
507
574
|
children: children
|
|
508
575
|
}), renderProps);
|
|
509
576
|
}, [renderLayer, placement, alignment, popoverXstyle, cancelHide, scheduleHide, contentRefs]);
|
|
577
|
+
const show = useCallback(() => {
|
|
578
|
+
clearTimeouts();
|
|
579
|
+
if (!isEnabled) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
setHeld(true);
|
|
583
|
+
armOutsideDismiss();
|
|
584
|
+
isHoldFromPressRef.current = isTriggerPressedRef.current;
|
|
585
|
+
isHoldInThisTaskRef.current = true;
|
|
586
|
+
triggerRef.current?.ownerDocument.defaultView?.setTimeout(() => {
|
|
587
|
+
isHoldInThisTaskRef.current = false;
|
|
588
|
+
}, 0);
|
|
589
|
+
const latest = latestRef.current;
|
|
590
|
+
if (latest.isOpen !== undefined) {
|
|
591
|
+
latest.onShow?.();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
showLayer();
|
|
595
|
+
}, [clearTimeouts, isEnabled, setHeld, armOutsideDismiss, showLayer]);
|
|
596
|
+
const hide = useCallback(() => {
|
|
597
|
+
clearTimeouts();
|
|
598
|
+
releaseHold();
|
|
599
|
+
}, [clearTimeouts, releaseHold]);
|
|
510
600
|
return {
|
|
511
601
|
ref,
|
|
512
602
|
positionRef: layerRef,
|
|
513
603
|
interactionRef,
|
|
514
604
|
anchorId: layerAnchorId,
|
|
515
605
|
describedBy: layerId,
|
|
516
|
-
renderTooltip
|
|
606
|
+
renderTooltip,
|
|
607
|
+
show,
|
|
608
|
+
hide
|
|
517
609
|
};
|
|
518
610
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTypeahead.d.ts","sourceRoot":"","sources":["../../src/Typeahead/BaseTypeahead.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BaseTypeahead.d.ts","sourceRoot":"","sources":["../../src/Typeahead/BaseTypeahead.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAgCnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAgB,cAAc,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAmBzE,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,IAAI,CACxE,SAAS,CAAC,WAAW,CAAC,EACtB,UAAU,CACX;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;IAEpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;IAEtD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAE3B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE/D;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AA8MD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,EA81CrB,CAAC,CAAC,SAAS,cAAc,EAC5B,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KACzB,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* - /packages/core/src/Typeahead/index.ts
|
|
20
20
|
* - /packages/cli/assets/templates/blocks/components/Typeahead/ (showcase blocks)
|
|
21
21
|
*/
|
|
22
|
-
import React, { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import React, { useCallback, useEffect, useId, useInsertionEffect, useMemo, useRef, useState } from 'react';
|
|
23
23
|
import * as stylex from '@stylexjs/stylex';
|
|
24
24
|
import { useBusyIndicatorLane } from "./busyIndicatorLane.js";
|
|
25
25
|
import { useTrailingKeyDown } from "./trailingKeyDown.js";
|
|
@@ -455,15 +455,6 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
455
455
|
// source: they can never be re-shown, so focus bootstraps the new source.
|
|
456
456
|
const sourceGenRef = useRef(0);
|
|
457
457
|
|
|
458
|
-
// Results still arriving from a replaced source must not land in the new
|
|
459
|
-
// one's menu.
|
|
460
|
-
const prevSearchSourceRef = useRef(searchSource);
|
|
461
|
-
if (prevSearchSourceRef.current !== searchSource) {
|
|
462
|
-
prevSearchSourceRef.current.cancel?.();
|
|
463
|
-
prevSearchSourceRef.current = searchSource;
|
|
464
|
-
sourceGenRef.current = ++searchGenRef.current;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
458
|
// The previous source is remembered in state, not a ref, so a render React
|
|
468
459
|
// discards cannot consume the comparison without its state updates.
|
|
469
460
|
const [sourceOfState, setSourceOfState] = useState(searchSource);
|
|
@@ -473,7 +464,6 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
473
464
|
setIsLoading(false);
|
|
474
465
|
setHasSearched(false);
|
|
475
466
|
}
|
|
476
|
-
loadingRef.current = false;
|
|
477
467
|
}
|
|
478
468
|
// A field that becomes disabled stops showing a search as busy in the same
|
|
479
469
|
// render, and the dropped query shows no outcome, so no empty state; the
|
|
@@ -487,15 +477,34 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
487
477
|
}
|
|
488
478
|
}
|
|
489
479
|
|
|
490
|
-
//
|
|
491
|
-
// source
|
|
492
|
-
//
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
480
|
+
// Results that arrive from a replaced source must not land in the new
|
|
481
|
+
// source's menu, so the replacement starts a new generation. That happens
|
|
482
|
+
// when the replacement commits, not in render. React can render a
|
|
483
|
+
// replacement and then discard it, for example when a transition suspends
|
|
484
|
+
// and a newer update replaces it. The source that stays then keeps its read.
|
|
485
|
+
// An insertion effect runs before every layout effect and ref callback of
|
|
486
|
+
// its commit. A read that one of them starts against the replacement gets a
|
|
487
|
+
// later generation, after the replaced source stopped its requests.
|
|
488
|
+
const prevSearchSourceRef = useRef(searchSource);
|
|
489
|
+
const isSourceReplacedRef = useRef(false);
|
|
490
|
+
useInsertionEffect(() => {
|
|
491
|
+
if (prevSearchSourceRef.current === searchSource) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
prevSearchSourceRef.current.cancel?.();
|
|
495
|
+
prevSearchSourceRef.current = searchSource;
|
|
496
|
+
sourceGenRef.current = ++searchGenRef.current;
|
|
497
|
+
// The replacing render cleared the busy state.
|
|
498
|
+
loadingRef.current = false;
|
|
499
|
+
isSourceReplacedRef.current = true;
|
|
500
|
+
}, [searchSource]);
|
|
501
|
+
// Syncs the wrapper's busy lane. A read of the replacement that already
|
|
502
|
+
// started keeps the lane busy.
|
|
503
|
+
useIsomorphicLayoutEffect(() => {
|
|
504
|
+
if (!isSourceReplacedRef.current) {
|
|
497
505
|
return;
|
|
498
506
|
}
|
|
507
|
+
isSourceReplacedRef.current = false;
|
|
499
508
|
if (!loadingRef.current) {
|
|
500
509
|
onLoadingChangeRef.current?.(false);
|
|
501
510
|
}
|
|
@@ -31,7 +31,8 @@ export interface TypeaheadItemProps<T extends SearchableItem = SearchableItem> e
|
|
|
31
31
|
*/
|
|
32
32
|
isDisabled?: boolean;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* This prop has no effect. Set `item.auxiliaryData.group` on search-source
|
|
35
|
+
* items to group results in Typeahead or BaseTypeahead.
|
|
35
36
|
*/
|
|
36
37
|
group?: string;
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeaheadItem.d.ts","sourceRoot":"","sources":["../../src/Typeahead/TypeaheadItem.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IAER;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB
|
|
1
|
+
{"version":3,"file":"TypeaheadItem.d.ts","sourceRoot":"","sources":["../../src/Typeahead/TypeaheadItem.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IAER;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6CD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,cAAc,EAAE,EACtD,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAkB,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAyBvB;yBApCe,aAAa"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A channel the animator drives. `x` and `y` translate the element (px).
|
|
3
|
+
* `scale` scales it about its transform origin (1 is its size). `rotate`
|
|
4
|
+
* turns it (degrees, clockwise), and `opacity` fades it (0 to 1).
|
|
5
|
+
*/
|
|
6
|
+
export type AnimatorChannel = 'x' | 'y' | 'scale' | 'rotate' | 'opacity';
|
|
7
|
+
/**
|
|
8
|
+
* Values by channel. A velocity uses the same keys, in units per second:
|
|
9
|
+
* px/s, scale per second, deg/s, opacity per second.
|
|
10
|
+
*/
|
|
11
|
+
export type AnimatorValues = Partial<Record<AnimatorChannel, number>>;
|
|
12
|
+
/** Every channel's value (or velocity), as `get` and `getVelocity` read it. */
|
|
13
|
+
export type AnimatorSnapshot = Readonly<Record<AnimatorChannel, number>>;
|
|
14
|
+
/** Options of `AnimatorHandle.animate`. */
|
|
15
|
+
export interface AnimatorAnimateOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Each channel's velocity at the start, such as a drag's release velocity.
|
|
18
|
+
* A channel without one keeps the
|
|
19
|
+
* velocity it has on screen, so an `animate` that interrupts another
|
|
20
|
+
* carries on smoothly.
|
|
21
|
+
*/
|
|
22
|
+
velocity?: AnimatorValues;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A release velocity for `AnimatorHandle.decay`, per channel, in its units
|
|
26
|
+
* per second. That is px/s for `x` and `y`, and degrees per second for
|
|
27
|
+
* `rotate`. `scale` and `opacity` take their units per second.
|
|
28
|
+
*/
|
|
29
|
+
export type AnimatorDecayVelocity = AnimatorValues;
|
|
30
|
+
/**
|
|
31
|
+
* Animates one element. Each method acts on the channels it is given and
|
|
32
|
+
* leaves the others where they are.
|
|
33
|
+
*/
|
|
34
|
+
export interface AnimatorHandle {
|
|
35
|
+
/**
|
|
36
|
+
* Springs the given channels to `target` on the `springs.stateChange`
|
|
37
|
+
* motion role, from wherever they are on screen. The promise resolves when
|
|
38
|
+
* they arrive, or as soon as a later `animate`, `decay`, `set` or `stop`
|
|
39
|
+
* takes any of them over.
|
|
40
|
+
*/
|
|
41
|
+
animate(target: AnimatorValues, options?: AnimatorAnimateOptions): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Coasts the given channels from a release velocity, slowing as a scroll
|
|
44
|
+
* view's momentum does. It resolves when they stop, or when another call
|
|
45
|
+
* takes them over. The distance follows from the velocity alone: there are
|
|
46
|
+
* no bounds, except that opacity stops at 0 or 1.
|
|
47
|
+
*/
|
|
48
|
+
decay(velocity: AnimatorDecayVelocity): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Puts the given channels at these values at once, ending their motion:
|
|
51
|
+
* the per-frame write of a drag.
|
|
52
|
+
*/
|
|
53
|
+
set(values: AnimatorValues): void;
|
|
54
|
+
/** Every channel's value on screen now. */
|
|
55
|
+
get(): AnimatorSnapshot;
|
|
56
|
+
/** Every channel's velocity on screen now, in units per second. */
|
|
57
|
+
getVelocity(): AnimatorSnapshot;
|
|
58
|
+
/** Halts every channel where it is on screen. */
|
|
59
|
+
stop(): void;
|
|
60
|
+
}
|
|
61
|
+
/** What `createAnimator` returns: the handle, and `destroy`. */
|
|
62
|
+
export interface Animator extends AnimatorHandle {
|
|
63
|
+
/**
|
|
64
|
+
* Stops every motion and lets go of the element; the element keeps the
|
|
65
|
+
* values it shows. The animator does nothing after this.
|
|
66
|
+
*/
|
|
67
|
+
destroy(): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* An animator whose element is attached later, through `attach`. It is the
|
|
71
|
+
* one construction `createAnimator` and `useAnimator` share, so the hook has
|
|
72
|
+
* no behavior of its own. Not exported from the package.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createAttachableAnimator(): {
|
|
75
|
+
readonly animator: Animator;
|
|
76
|
+
readonly attach: (element: HTMLElement | null) => void;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Animates `element` with the motion Core uses. `animate` springs channels to
|
|
80
|
+
* a target on the state-change motion, and `decay` coasts them from a release
|
|
81
|
+
* velocity. `set` jumps them, `get` and `getVelocity` read them, `stop` halts
|
|
82
|
+
* them, and `destroy` lets the element go. Under Reduce Motion every call is
|
|
83
|
+
* planned. A move becomes a short cross-fade on a touch screen, and it lands
|
|
84
|
+
* at once with a mouse.
|
|
85
|
+
*
|
|
86
|
+
* Use one animator per element: two on one element overwrite each other.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```
|
|
90
|
+
* const card = document.querySelector('.card');
|
|
91
|
+
* const animator = createAnimator(card);
|
|
92
|
+
* await animator.animate({x: 0, rotate: 0}, {velocity: {x: -900}});
|
|
93
|
+
* animator.decay({x: 2400});
|
|
94
|
+
* animator.destroy();
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare function createAnimator(element: HTMLElement): Animator;
|
|
98
|
+
//# sourceMappingURL=createAnimator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAnimator.d.ts","sourceRoot":"","sources":["../../src/animator/createAnimator.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtE,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzE,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,OAAO,CACL,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;OAGG;IACH,GAAG,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAClC,2CAA2C;IAC3C,GAAG,IAAI,gBAAgB,CAAC;IACxB,mEAAmE;IACnE,WAAW,IAAI,gBAAgB,CAAC;IAChC,iDAAiD;IACjD,IAAI,IAAI,IAAI,CAAC;CACd;AAED,gEAAgE;AAChE,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC9C;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAqFD;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD,CA+FA;AAKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,QAAQ,CAI7D"}
|