@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
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useMobileKeyboard.ts
|
|
7
|
+
* @input A target element and its scroll area, the keyboard module's reports
|
|
8
|
+
* and focus claim, and the layout guide
|
|
9
|
+
* @output useMobileKeyboard, which keeps a focused field in the target above
|
|
10
|
+
* the on-screen keyboard and returns the inset and a dismiss
|
|
11
|
+
* @position Keyboard module, internal to core. BottomSheet passes its panel.
|
|
12
|
+
*
|
|
13
|
+
* SYNC: When modified, update /packages/core/src/keyboard/README.md
|
|
14
|
+
*/
|
|
15
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
16
|
+
import { flushSync } from 'react-dom';
|
|
17
|
+
import { useAttachment } from "../hooks/useAttachment.js";
|
|
18
|
+
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
19
|
+
import { animatorFor } from "../motion/animator.js";
|
|
20
|
+
import { subscribeInput } from "../utils/inputStream.js";
|
|
21
|
+
import { layoutViewportHeight } from "../utils/layoutViewport.js";
|
|
22
|
+
import { observeResize } from "../utils/sharedResizeObserver.js";
|
|
23
|
+
import { TOUCH_QUERY } from "../utils/touchPresentation.js";
|
|
24
|
+
import { KEYBOARD_EPSILON, findTextEntryControl, getKeyboardHeight, isKeyboardMeasurable, isNodeTarget, isTextEntryControl, refuseFocusReveal, subscribeKeyboardHeight, watchRevealPan } from "./keyboardHeight.js";
|
|
25
|
+
import { getKeyboardLayoutGuide, keyboardProfileOf } from "./keyboardLayoutGuide.js";
|
|
26
|
+
import { rideKeyboard } from "./rideKeyboard.js";
|
|
27
|
+
|
|
28
|
+
// Chrome on Android pans the page itself if the keyboard still covers the
|
|
29
|
+
// focused field about 100 to 170 ms after the report. A field a fraction of a
|
|
30
|
+
// pixel under the keyboard's top still counts as covered. So the reveal sets
|
|
31
|
+
// the field 4 px above that top in the report's own commit, and only the rest
|
|
32
|
+
// rides.
|
|
33
|
+
const FIELD_CLEARANCE_AT_REPORT = 4;
|
|
34
|
+
|
|
35
|
+
/** How a target keeps a focused field above the on-screen keyboard. */
|
|
36
|
+
|
|
37
|
+
/** What useMobileKeyboard returns. */
|
|
38
|
+
|
|
39
|
+
function getObstructionTop() {
|
|
40
|
+
return layoutViewportHeight(window) - getKeyboardHeight(window);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Windows whose browser revealed a focused field itself right after the
|
|
44
|
+
// keyboard's report, by panning the visual viewport to it. Firefox for
|
|
45
|
+
// Android does so 54 to 143 ms after the report while the field is under the
|
|
46
|
+
// keyboard. The module learns this from the behavior, never from the user
|
|
47
|
+
// agent.
|
|
48
|
+
// From then on, a sheet there reveals its field at once, in the report's own
|
|
49
|
+
// frame.
|
|
50
|
+
let revealsAtReport = new WeakSet();
|
|
51
|
+
|
|
52
|
+
/** Forgets every window's recorded reveal, for tests. */
|
|
53
|
+
export function __resetRevealsAtReportForTest() {
|
|
54
|
+
revealsAtReport = new WeakSet();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// How far the body runs under the keyboard's top, CSS px. The keyboard's top
|
|
58
|
+
// comes from `innerHeight`, a whole number of CSS px, but the visual viewport
|
|
59
|
+
// and element rects are fractional. On the Android emulator, Chrome's visual
|
|
60
|
+
// viewport is 754.3 px over a 754 px layout viewport. A sheet sized to it
|
|
61
|
+
// then ends 0.3 px below `innerHeight` with no keyboard up. So an overlap
|
|
62
|
+
// under one CSS px is `innerHeight`'s precision, not an obstruction.
|
|
63
|
+
function overlapOf(bodyBottom, obstructionTop) {
|
|
64
|
+
const overlap = bodyBottom - obstructionTop;
|
|
65
|
+
return overlap > KEYBOARD_EPSILON ? overlap : 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Under half a pixel is rounding, not a keyboard.
|
|
69
|
+
function isVisualViewportRecovered() {
|
|
70
|
+
return getKeyboardHeight(window) <= 0.5;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Keeps a focused field in `targetRef`'s element above the on-screen
|
|
75
|
+
* keyboard (see README.md). A sheet passes its panel, and the hook reserves
|
|
76
|
+
* the inset in the panel's scroll area. Returns the inset the keyboard takes
|
|
77
|
+
* at the end of that area's content, CSS px, or 0 without a keyboard, and a
|
|
78
|
+
* dismiss.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```
|
|
82
|
+
* const keyboard = useMobileKeyboard(panelRef, {move: 'ride', inset: true, offset: 48, isEnabled, isExpanded, isOpen, isPageScrollLocked});
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export function useMobileKeyboard(targetRef, {
|
|
86
|
+
inset: reservesInset = false,
|
|
87
|
+
offset,
|
|
88
|
+
isEnabled,
|
|
89
|
+
isExpanded,
|
|
90
|
+
isOpen,
|
|
91
|
+
isPageScrollLocked
|
|
92
|
+
}) {
|
|
93
|
+
// The inset the keyboard takes at the end of the body's content, CSS px.
|
|
94
|
+
// The target lays it out after its content box's children, through a
|
|
95
|
+
// functional style.
|
|
96
|
+
const [keyboardInset, setKeyboardInset] = useState(0);
|
|
97
|
+
const hasKeyboardLayoutRef = useRef(false);
|
|
98
|
+
const retainKeyboardLayoutRef = useRef(false);
|
|
99
|
+
const isEnabledRef = useRef(isEnabled);
|
|
100
|
+
const isExpandedRef = useRef(isExpanded);
|
|
101
|
+
const isOpenRef = useRef(isOpen);
|
|
102
|
+
isEnabledRef.current = isEnabled;
|
|
103
|
+
isExpandedRef.current = isExpanded;
|
|
104
|
+
isOpenRef.current = isOpen;
|
|
105
|
+
// Touch-only work, the ride and the reveal-pan watch, attaches only under a
|
|
106
|
+
// coarse primary pointer (the touch query). Under a fine one, the hook
|
|
107
|
+
// registers no touch listener.
|
|
108
|
+
const isTouch = useMediaQuery(TOUCH_QUERY, false);
|
|
109
|
+
const dismiss = useCallback(focusTarget => {
|
|
110
|
+
const target = targetRef.current;
|
|
111
|
+
const activeElement = document.activeElement;
|
|
112
|
+
if (!isEnabledRef.current || target == null || !(activeElement instanceof HTMLElement) || activeElement === target || !target.contains(activeElement)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
// Keep the current keyboard scroll range while the keyboard goes.
|
|
116
|
+
// Viewport resize events unwind that layout as the visual viewport
|
|
117
|
+
// recovers, avoiding a content jump on the first drag frame.
|
|
118
|
+
retainKeyboardLayoutRef.current = hasKeyboardLayoutRef.current;
|
|
119
|
+
if (focusTarget == null) {
|
|
120
|
+
activeElement.blur();
|
|
121
|
+
} else {
|
|
122
|
+
focusTarget.focus({
|
|
123
|
+
preventScroll: true
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}, [targetRef]);
|
|
127
|
+
|
|
128
|
+
// Syncs the on-screen keyboard with closing: a target that closes blurs its
|
|
129
|
+
// focused field, which dismisses the keyboard.
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (isEnabled && !isOpen) {
|
|
132
|
+
dismiss();
|
|
133
|
+
}
|
|
134
|
+
}, [dismiss, isEnabled, isOpen]);
|
|
135
|
+
useAttachment(targetRef, sheet => {
|
|
136
|
+
const body = sheet.querySelector('[data-scroll-axis]');
|
|
137
|
+
if (!isEnabled || !reservesInset || body == null) {
|
|
138
|
+
return () => {};
|
|
139
|
+
}
|
|
140
|
+
let keyboardGeometry = null;
|
|
141
|
+
// Where a smooth reveal under way is taking the body's scrollTop.
|
|
142
|
+
let smoothTarget = null;
|
|
143
|
+
// The inset laid out at the end of the body's content, CSS px, and the
|
|
144
|
+
// scroll range it adds there. The inset's drop takes that range back. The
|
|
145
|
+
// two can differ: Chrome 124 added 344 px of range for a 360 px inset.
|
|
146
|
+
let laidOutInset = 0;
|
|
147
|
+
let insetRange = 0;
|
|
148
|
+
// Where the keyboard layout guide publishes the keyboard's own slide, as
|
|
149
|
+
// Gboard's in Chrome on Android, the sheet's content rides it. This needs
|
|
150
|
+
// a coarse primary pointer and Chrome's schedule. Under a fine pointer
|
|
151
|
+
// nothing of the ride attaches. In a browser without the VirtualKeyboard
|
|
152
|
+
// API, such as iOS Safari or Firefox for Android, the guide never starts.
|
|
153
|
+
// There the inset follows the reports. The hook subscribes to the guide
|
|
154
|
+
// before the keyboard module below, so the guide publishes a report's
|
|
155
|
+
// transition before the reveal reads it.
|
|
156
|
+
const guide = isTouch && keyboardProfileOf(window) === 'chromium' ? getKeyboardLayoutGuide(window) : null;
|
|
157
|
+
const contentAnimator = () => {
|
|
158
|
+
const content = body.firstElementChild;
|
|
159
|
+
return guide != null && content instanceof HTMLElement ? animatorFor(content) : null;
|
|
160
|
+
};
|
|
161
|
+
// How far a ride has moved the content from where its layout puts it, as
|
|
162
|
+
// the page draws it now. The reveal reads a control's rect in the same
|
|
163
|
+
// frame.
|
|
164
|
+
const rideOffset = () => {
|
|
165
|
+
const content = body.firstElementChild;
|
|
166
|
+
if (!(content instanceof HTMLElement)) {
|
|
167
|
+
return 0;
|
|
168
|
+
}
|
|
169
|
+
const translate = getComputedStyle(content).translate;
|
|
170
|
+
return parseFloat(translate.split(' ')[1] ?? '') || 0;
|
|
171
|
+
};
|
|
172
|
+
// The keyboard's show the guide plays on its slide right now, if any. At
|
|
173
|
+
// a report, a show whose slide has ended counts too. A busy page can read
|
|
174
|
+
// the report that late, and the ride then lands at once.
|
|
175
|
+
const showOnSlide = atReport => {
|
|
176
|
+
const transition = guide?.transition;
|
|
177
|
+
return transition != null && transition.kind === 'show' && transition.animated && transition.curve != null && (atReport || performance.now() < transition.start + transition.curve.durationMs) ? transition : null;
|
|
178
|
+
};
|
|
179
|
+
// A hide the hook holds the inset through (see holdInsetThrough).
|
|
180
|
+
let heldHide = null;
|
|
181
|
+
let documentScrollAtKeyboard = null;
|
|
182
|
+
// The keyboard's top and the body's scroll when the keyboard came up. A
|
|
183
|
+
// keyboard that closes puts the body back at that scroll.
|
|
184
|
+
let keyboardObstructionTop = null;
|
|
185
|
+
let bodyScrollTopAtKeyboard = null;
|
|
186
|
+
// The hook takes focus moves over where this window measures the
|
|
187
|
+
// keyboard, never by user agent, and only under a coarse primary pointer.
|
|
188
|
+
// Under a fine one, it registers no touch-only listener.
|
|
189
|
+
// Desktop Safari and Firefox measure too, but show no on-screen keyboard
|
|
190
|
+
// and keep the browser's own focus. The effect runs again when the
|
|
191
|
+
// pointer changes, so a tablet that docks a mouse drops the claim.
|
|
192
|
+
const ownsFocusTransitions = isTouch && isKeyboardMeasurable(window);
|
|
193
|
+
|
|
194
|
+
// Lays the inset out before anything measures or scrolls the body: the
|
|
195
|
+
// reveal scrolls into the inset it adds in the same frame.
|
|
196
|
+
const writeInset = inset => {
|
|
197
|
+
const changes = inset !== laidOutInset;
|
|
198
|
+
const rangeBefore = changes ? body.scrollHeight : 0;
|
|
199
|
+
laidOutInset = inset;
|
|
200
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the reveal scrolls into this inset in the same frame, so it must be laid out before the reveal measures
|
|
201
|
+
flushSync(() => setKeyboardInset(inset));
|
|
202
|
+
if (changes) {
|
|
203
|
+
insetRange = inset === 0 ? 0 : Math.max(0, insetRange + body.scrollHeight - rangeBefore);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const clearKeyboardLayout = () => {
|
|
207
|
+
writeInset(0);
|
|
208
|
+
if (bodyScrollTopAtKeyboard != null) {
|
|
209
|
+
smoothTarget = null;
|
|
210
|
+
body.scrollTop = bodyScrollTopAtKeyboard;
|
|
211
|
+
}
|
|
212
|
+
keyboardGeometry = null;
|
|
213
|
+
keyboardObstructionTop = null;
|
|
214
|
+
bodyScrollTopAtKeyboard = null;
|
|
215
|
+
documentScrollAtKeyboard = null;
|
|
216
|
+
hasKeyboardLayoutRef.current = false;
|
|
217
|
+
retainKeyboardLayoutRef.current = false;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// `within` is how far below its resting place the control can sit and
|
|
221
|
+
// still clear the keyboard.
|
|
222
|
+
const scrollBodyBy = (distance, smoothly, ride = null, within = null) => {
|
|
223
|
+
smoothTarget = null;
|
|
224
|
+
const animator = ride == null ? null : contentAnimator();
|
|
225
|
+
if (ride != null && animator != null) {
|
|
226
|
+
// The body lands at once, and its content rides the keyboard's slide
|
|
227
|
+
// up from the slide's start. The content starts no lower than
|
|
228
|
+
// `within`, so the control clears the keyboard in this commit. Content
|
|
229
|
+
// that joins the slide late is where the keyboard is (rideKeyboard). A
|
|
230
|
+
// further scroll during the slide adds to the same ride.
|
|
231
|
+
const before = body.scrollTop;
|
|
232
|
+
body.scrollTop = before + distance;
|
|
233
|
+
const moved = body.scrollTop - before;
|
|
234
|
+
// Only what the body actually scrolled rides. A remainder under the
|
|
235
|
+
// scroll position's precision moves nothing, so the ride under way
|
|
236
|
+
// stays on its curve.
|
|
237
|
+
if (moved !== 0) {
|
|
238
|
+
const from = animator.get('y', ride.start) + moved;
|
|
239
|
+
animator.set({
|
|
240
|
+
y: within == null ? from : Math.min(from, within)
|
|
241
|
+
});
|
|
242
|
+
rideKeyboard(animator, {
|
|
243
|
+
y: 0
|
|
244
|
+
}, ride, {
|
|
245
|
+
entrance: within != null
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (typeof body.scrollBy !== 'function') {
|
|
251
|
+
body.scrollTop += distance;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
// Reduce Motion applies on any pointer.
|
|
255
|
+
const reduceMotion = typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
256
|
+
const behavior = smoothly && !reduceMotion ? 'smooth' : 'instant';
|
|
257
|
+
if (behavior === 'smooth') {
|
|
258
|
+
smoothTarget = body.scrollTop + distance;
|
|
259
|
+
}
|
|
260
|
+
body.scrollBy({
|
|
261
|
+
top: distance,
|
|
262
|
+
// Not 'auto', which defers to the element's computed
|
|
263
|
+
// `scroll-behavior`. A consumer's `scroll-behavior: smooth` would then
|
|
264
|
+
// animate a scroll this hook needs to land in the same frame.
|
|
265
|
+
behavior
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
// The distance a smooth reveal under way has still to scroll, as far as
|
|
270
|
+
// the body can scroll. It is 0 once it has landed, or with none under way.
|
|
271
|
+
const smoothDistanceLeft = () => {
|
|
272
|
+
if (smoothTarget == null) {
|
|
273
|
+
return 0;
|
|
274
|
+
}
|
|
275
|
+
const maxScroll = Math.max(body.scrollTop, body.scrollHeight - body.clientHeight);
|
|
276
|
+
const target = Math.min(smoothTarget, maxScroll);
|
|
277
|
+
const left = target - body.scrollTop;
|
|
278
|
+
return Math.abs(left) < 1 ? 0 : left;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// Scroll `control` into the part of the body the keyboard leaves visible,
|
|
282
|
+
// reading live geometry each time.
|
|
283
|
+
const scrollControlIntoSafeArea = (control, smoothly, ride = null) => {
|
|
284
|
+
const measuredBodyRect = body.getBoundingClientRect();
|
|
285
|
+
const measuredControlRect = control.getBoundingClientRect();
|
|
286
|
+
const obstructionTop = getObstructionTop();
|
|
287
|
+
// Under a pixel of overhang is `innerHeight`'s precision, not a
|
|
288
|
+
// keyboard: no suggestion clearance then (overlapOf).
|
|
289
|
+
const overlap = overlapOf(measuredBodyRect.bottom, obstructionTop);
|
|
290
|
+
const clearance = overlap > 0 ? offset : 0;
|
|
291
|
+
const safeTop = measuredBodyRect.top;
|
|
292
|
+
const safeBottom = Math.min(measuredBodyRect.bottom, obstructionTop - clearance);
|
|
293
|
+
if (safeBottom <= safeTop) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Where the control will be once a smooth reveal under way lands. If
|
|
298
|
+
// that lands the control, a second scroll would overshoot in Firefox.
|
|
299
|
+
// Firefox keeps adding a smooth scrollBy's distance after another
|
|
300
|
+
// scroll. A ride's translate is not where the layout puts the control
|
|
301
|
+
// either.
|
|
302
|
+
const pending = smoothDistanceLeft() + rideOffset();
|
|
303
|
+
const controlBottom = measuredControlRect.bottom - pending;
|
|
304
|
+
const controlTop = measuredControlRect.top - pending;
|
|
305
|
+
if (controlBottom > safeBottom) {
|
|
306
|
+
scrollBodyBy(controlBottom - safeBottom, smoothly, ride, Math.max(0, obstructionTop - safeBottom - FIELD_CLEARANCE_AT_REPORT));
|
|
307
|
+
} else if (controlTop < safeTop) {
|
|
308
|
+
scrollBodyBy(controlTop - safeTop, smoothly, ride);
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const applyKeyboardGeometry = geometry => {
|
|
312
|
+
const obstructionTop = getObstructionTop();
|
|
313
|
+
// A collapsed detent can extend the body below the layout viewport even
|
|
314
|
+
// after the keyboard closes, so body overlap alone cannot identify
|
|
315
|
+
// recovery. Once the visual viewport is full height again, release the
|
|
316
|
+
// retained keyboard layout unconditionally.
|
|
317
|
+
if (isVisualViewportRecovered()) {
|
|
318
|
+
clearKeyboardLayout();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const overlap = overlapOf(geometry.bodyBottom, obstructionTop);
|
|
322
|
+
if (overlap === 0) {
|
|
323
|
+
clearKeyboardLayout();
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const inset = Math.max(0, geometry.bodyBottom - (obstructionTop - offset));
|
|
327
|
+
writeInset(inset);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
// Take every focus move into a field over before the browser performs it
|
|
331
|
+
// (refuseFocusReveal). That handler does not reveal the field. Focusing
|
|
332
|
+
// it raises focusin, and the viewport report that follows the keyboard
|
|
333
|
+
// raises another. Both schedule the reveal below, which knows the safe
|
|
334
|
+
// area and scrolls only the sheet's own body.
|
|
335
|
+
//
|
|
336
|
+
// The keyboard's Done button parks focus on the body. The handler parks
|
|
337
|
+
// focus that leaves for nothing on the sheet instead. Then a second tap on
|
|
338
|
+
// the same field is still a move the handler sees. Left on the body, the field
|
|
339
|
+
// is already `document.activeElement` on the next tap. Then no blur fires,
|
|
340
|
+
// and the browser reveals the field its own way. This applies only while
|
|
341
|
+
// the sheet is open. Closing blurs the field too, and no next tap needs a
|
|
342
|
+
// claim. The host restores focus to whatever opened the sheet.
|
|
343
|
+
const claimFocusTransitions = () => refuseFocusReveal(document, {
|
|
344
|
+
isActive: () => isExpandedRef.current,
|
|
345
|
+
claim: destination => findTextEntryControl(destination, body),
|
|
346
|
+
park: origin => {
|
|
347
|
+
if (isOpenRef.current && findTextEntryControl(origin, body)) {
|
|
348
|
+
sheet.focus({
|
|
349
|
+
preventScroll: true
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
const revealFocusedControl = (atReport = false) => {
|
|
355
|
+
// Through a hide the sheet rides, its layout holds until the end.
|
|
356
|
+
if (heldHide != null) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const obstructionTop = getObstructionTop();
|
|
360
|
+
const activeElement = document.activeElement;
|
|
361
|
+
const focusedControl = activeElement instanceof HTMLElement && body.contains(activeElement) && isTextEntryControl(activeElement) ? activeElement : null;
|
|
362
|
+
// The keyboard can close while its field keeps focus, as a downward
|
|
363
|
+
// dismissal does on iOS. The full clear puts back the inset and the
|
|
364
|
+
// body's scroll. The hook then reveals the field still focused in the
|
|
365
|
+
// restored body, because it may not be the field that opened the
|
|
366
|
+
// keyboard.
|
|
367
|
+
if (hasKeyboardLayoutRef.current && isVisualViewportRecovered()) {
|
|
368
|
+
clearKeyboardLayout();
|
|
369
|
+
if (isExpandedRef.current && focusedControl != null) {
|
|
370
|
+
scrollControlIntoSafeArea(focusedControl, false);
|
|
371
|
+
}
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
if (!isExpandedRef.current || focusedControl == null) {
|
|
375
|
+
if (retainKeyboardLayoutRef.current && keyboardGeometry) {
|
|
376
|
+
applyKeyboardGeometry(keyboardGeometry);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
clearKeyboardLayout();
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// An iOS keyboard dismissed by a drag can leave its accessory bar, so
|
|
384
|
+
// the visual viewport grows short of full height. The body goes back
|
|
385
|
+
// to its scroll from before the keyboard as soon as that starts. The
|
|
386
|
+
// reveal below still clears what covers a low field. The new top is
|
|
387
|
+
// kept, so a later content change does not repeat this.
|
|
388
|
+
if (hasKeyboardLayoutRef.current && keyboardObstructionTop != null && obstructionTop > keyboardObstructionTop + 0.5 && bodyScrollTopAtKeyboard != null) {
|
|
389
|
+
smoothTarget = null;
|
|
390
|
+
body.scrollTop = bodyScrollTopAtKeyboard;
|
|
391
|
+
keyboardObstructionTop = obstructionTop;
|
|
392
|
+
}
|
|
393
|
+
retainKeyboardLayoutRef.current = false;
|
|
394
|
+
const measuredBodyRect = body.getBoundingClientRect();
|
|
395
|
+
const overlap = overlapOf(measuredBodyRect.bottom, obstructionTop);
|
|
396
|
+
// The extra clearance leaves space for mobile suggestion UI, but only
|
|
397
|
+
// while the visual viewport actually overlaps the sheet. With no
|
|
398
|
+
// obstruction, ordinary desktop and hardware-keyboard focus must not
|
|
399
|
+
// shift an already visible control.
|
|
400
|
+
const clearance = overlap > 0 ? offset : 0;
|
|
401
|
+
keyboardGeometry = overlap > 0 ? {
|
|
402
|
+
bodyBottom: measuredBodyRect.bottom
|
|
403
|
+
} : null;
|
|
404
|
+
// Where the document sits with the keyboard up and nothing yet shifted:
|
|
405
|
+
// the position handleDocumentScroll returns to. Captured on the
|
|
406
|
+
// transition only — a reveal that runs after the browser has already
|
|
407
|
+
// scrolled would otherwise record the shifted position as correct.
|
|
408
|
+
if (overlap > 0 && !hasKeyboardLayoutRef.current) {
|
|
409
|
+
keyboardObstructionTop = obstructionTop;
|
|
410
|
+
bodyScrollTopAtKeyboard = body.scrollTop;
|
|
411
|
+
if (isPageScrollLocked) {
|
|
412
|
+
documentScrollAtKeyboard = {
|
|
413
|
+
x: window.scrollX,
|
|
414
|
+
y: window.scrollY
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
hasKeyboardLayoutRef.current = overlap > 0;
|
|
419
|
+
const inset = overlap > 0 ? Math.max(0, measuredBodyRect.bottom - (obstructionTop - clearance)) : 0;
|
|
420
|
+
writeInset(inset);
|
|
421
|
+
scrollControlIntoSafeArea(focusedControl, overlap > 0 && !revealsAtReport.has(window), overlap > 0 ? showOnSlide(atReport) : null);
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
// Where the body's scroll rests once the keyboard is gone, as
|
|
425
|
+
// revealFocusedControl leaves it. The clear puts back the scroll from
|
|
426
|
+
// before the keyboard, within the range left once the inset drops. The
|
|
427
|
+
// reveal then brings a field that keeps focus into the body's view.
|
|
428
|
+
const restingScrollTop = () => {
|
|
429
|
+
const scrollTop = body.scrollTop;
|
|
430
|
+
const maxAtRest = Math.max(0, body.scrollHeight - insetRange - body.clientHeight);
|
|
431
|
+
let resting = Math.min(maxAtRest, bodyScrollTopAtKeyboard ?? scrollTop);
|
|
432
|
+
const active = document.activeElement;
|
|
433
|
+
if (isExpandedRef.current && active instanceof HTMLElement && body.contains(active) && isTextEntryControl(active)) {
|
|
434
|
+
const bodyRect = body.getBoundingClientRect();
|
|
435
|
+
const rect = active.getBoundingClientRect();
|
|
436
|
+
// Where the layout puts the control at the resting scroll.
|
|
437
|
+
const shift = scrollTop - resting - rideOffset();
|
|
438
|
+
if (rect.bottom + shift > bodyRect.bottom) {
|
|
439
|
+
resting += rect.bottom + shift - bodyRect.bottom;
|
|
440
|
+
} else if (rect.top + shift < bodyRect.top) {
|
|
441
|
+
resting += rect.top + shift - bodyRect.top;
|
|
442
|
+
}
|
|
443
|
+
resting = Math.min(maxAtRest, Math.max(0, resting));
|
|
444
|
+
}
|
|
445
|
+
return resting;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
// Through a hide on the keyboard's slide, the inset stays, so nothing
|
|
449
|
+
// drops while the keyboard still covers the sheet's bottom. The content
|
|
450
|
+
// rides down on the hide's curve by the scroll the body drops at rest. At
|
|
451
|
+
// rest, the inset drops, the scroll goes back, and the translate clears in
|
|
452
|
+
// one commit.
|
|
453
|
+
const holdInsetThrough = transition => {
|
|
454
|
+
heldHide?.release();
|
|
455
|
+
const animator = contentAnimator();
|
|
456
|
+
const drop = body.scrollTop - restingScrollTop();
|
|
457
|
+
const handle = animator != null && drop !== 0 ? rideKeyboard(animator, {
|
|
458
|
+
y: drop
|
|
459
|
+
}, transition) : null;
|
|
460
|
+
let timer;
|
|
461
|
+
const hold = {
|
|
462
|
+
release: () => {
|
|
463
|
+
clearTimeout(timer);
|
|
464
|
+
if (heldHide === hold) {
|
|
465
|
+
heldHide = null;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
heldHide = hold;
|
|
470
|
+
const commit = () => {
|
|
471
|
+
if (heldHide !== hold) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
heldHide = null;
|
|
475
|
+
revealFocusedControl();
|
|
476
|
+
animator?.set({
|
|
477
|
+
y: 0
|
|
478
|
+
});
|
|
479
|
+
};
|
|
480
|
+
if (handle == null) {
|
|
481
|
+
const end = transition.start + (transition.curve?.durationMs ?? 0);
|
|
482
|
+
timer = setTimeout(commit, Math.max(0, end - performance.now()));
|
|
483
|
+
} else {
|
|
484
|
+
void handle.finished.then(commit);
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
const unsubscribeGuide = guide?.subscribe(transition => {
|
|
488
|
+
// A jump lands with the reports: only a slide rides.
|
|
489
|
+
if (transition.curve == null) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
if (transition.kind === 'hide') {
|
|
493
|
+
if (hasKeyboardLayoutRef.current && transition.animated) {
|
|
494
|
+
holdInsetThrough(transition);
|
|
495
|
+
}
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
if (heldHide != null) {
|
|
499
|
+
// The keyboard comes back before it is down (focus returns): the
|
|
500
|
+
// inset never left, so the content rides back to its place with it.
|
|
501
|
+
heldHide.release();
|
|
502
|
+
const animator = contentAnimator();
|
|
503
|
+
if (animator != null) {
|
|
504
|
+
rideKeyboard(animator, {
|
|
505
|
+
y: 0
|
|
506
|
+
}, transition);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
let animationFrame = 0;
|
|
511
|
+
const scheduleReveal = () => {
|
|
512
|
+
cancelAnimationFrame(animationFrame);
|
|
513
|
+
animationFrame = requestAnimationFrame(() => revealFocusedControl());
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
// Resuming the app re-reveals the focused field with no focus event to
|
|
517
|
+
// claim. The reveal above never runs, and the document scrolls with the
|
|
518
|
+
// fixed sheet. Put that scroll back on the event that reports it, and
|
|
519
|
+
// reveal again inside the sheet.
|
|
520
|
+
//
|
|
521
|
+
// This applies only while the page is locked. Only then can a document
|
|
522
|
+
// scroll not be the user's own. Behind a non-modal sheet the page stays
|
|
523
|
+
// scrollable, and a revert there would fight the user.
|
|
524
|
+
const handleDocumentScroll = () => {
|
|
525
|
+
const expected = documentScrollAtKeyboard;
|
|
526
|
+
if (expected == null || window.scrollX === expected.x && window.scrollY === expected.y) {
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
window.scrollTo(expected.x, expected.y);
|
|
530
|
+
const activeElement = document.activeElement;
|
|
531
|
+
if (activeElement instanceof HTMLElement && body.contains(activeElement) && isTextEntryControl(activeElement)) {
|
|
532
|
+
scrollControlIntoSafeArea(activeElement, false);
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
let stopObserving = [];
|
|
536
|
+
const refreshObservedLayout = () => {
|
|
537
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
for (const stop of stopObserving) {
|
|
541
|
+
stop();
|
|
542
|
+
}
|
|
543
|
+
stopObserving = [];
|
|
544
|
+
|
|
545
|
+
// Body and sheet box changes include public height and xstyle updates.
|
|
546
|
+
// The inset pseudo-element is the content box's last box. Where the
|
|
547
|
+
// content grows with it, the observation runs the reveal again. The
|
|
548
|
+
// reveal computes the same inset from the body's unchanged box, so
|
|
549
|
+
// nothing feeds back into the sheet's geometry.
|
|
550
|
+
const targets = new Set([body, sheet]);
|
|
551
|
+
for (const child of body.children) {
|
|
552
|
+
targets.add(child);
|
|
553
|
+
}
|
|
554
|
+
const activeElement = document.activeElement;
|
|
555
|
+
if (activeElement instanceof HTMLElement && body.contains(activeElement)) {
|
|
556
|
+
for (let element = activeElement; element && element !== body; element = element.parentElement) {
|
|
557
|
+
targets.add(element);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
for (const target of targets) {
|
|
561
|
+
stopObserving.push(observeResize(target, scheduleReveal));
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
const mutationObserver = typeof MutationObserver === 'undefined' ? null : new MutationObserver(records => {
|
|
565
|
+
// Skip the sheet's own attribute writes on the body. Consumer
|
|
566
|
+
// DOM, text, class, style, or visibility changes can all move the
|
|
567
|
+
// focused control without a viewport event. The inset's write on
|
|
568
|
+
// the content box schedules one more reveal, which finds the same
|
|
569
|
+
// inset and settles.
|
|
570
|
+
if (records.every(record => record.type === 'attributes' && record.target === body)) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
refreshObservedLayout();
|
|
574
|
+
scheduleReveal();
|
|
575
|
+
});
|
|
576
|
+
const handleFocusIn = () => {
|
|
577
|
+
refreshObservedLayout();
|
|
578
|
+
scheduleReveal();
|
|
579
|
+
};
|
|
580
|
+
const handleFocusOut = () => {
|
|
581
|
+
// Keep the added scroll range while the keyboard animates away. A focus
|
|
582
|
+
// transition to another text-entry control cancels this in focusin.
|
|
583
|
+
retainKeyboardLayoutRef.current = hasKeyboardLayoutRef.current;
|
|
584
|
+
scheduleReveal();
|
|
585
|
+
};
|
|
586
|
+
const handleSheetTransitionEnd = event => {
|
|
587
|
+
if (event.target === sheet && event.propertyName === 'transform') {
|
|
588
|
+
scheduleReveal();
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
const stopClaiming = ownsFocusTransitions ? claimFocusTransitions() : null;
|
|
592
|
+
// The hook reveals a keyboard report in its own frame, not the next. A browser
|
|
593
|
+
// that reveals a focused field itself pans the visual viewport to it a few
|
|
594
|
+
// frames after the report. It does so if the keyboard still covers the
|
|
595
|
+
// field. Such a pan moves the visual viewport down within the layout
|
|
596
|
+
// viewport, with no touch, document scroll or zoom since the report. Once
|
|
597
|
+
// the sheet lands the field itself, the hook puts the pan back: it scrolls
|
|
598
|
+
// the full-viewport dialog's top into view. On every later report, the field
|
|
599
|
+
// lands at once.
|
|
600
|
+
let lastHeight = getKeyboardHeight(window);
|
|
601
|
+
// Under a coarse primary pointer only: the watch reads touches, and an
|
|
602
|
+
// on-screen keyboard's pan comes with a touch screen.
|
|
603
|
+
const revealPan = isTouch ? watchRevealPan(window, {
|
|
604
|
+
owns: focused => hasKeyboardLayoutRef.current && body.contains(focused),
|
|
605
|
+
// The reader's own scroll may stop a smooth reveal short: forget
|
|
606
|
+
// where it was going.
|
|
607
|
+
onTouch: () => {
|
|
608
|
+
smoothTarget = null;
|
|
609
|
+
}
|
|
610
|
+
}) : null;
|
|
611
|
+
// Every keyboard report reaches the reveal through the keyboard module's
|
|
612
|
+
// one set of listeners.
|
|
613
|
+
const unsubscribe = subscribeKeyboardHeight(window, event => {
|
|
614
|
+
if (event.type !== 'viewport') {
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (event.height !== lastHeight) {
|
|
618
|
+
lastHeight = event.height;
|
|
619
|
+
revealPan?.report();
|
|
620
|
+
cancelAnimationFrame(animationFrame);
|
|
621
|
+
revealFocusedControl(true);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
if (revealPan?.isRevealPan(event.height) === true) {
|
|
625
|
+
revealsAtReport.add(window);
|
|
626
|
+
cancelAnimationFrame(animationFrame);
|
|
627
|
+
// A smooth reveal still under way lands the field where it is going.
|
|
628
|
+
// Another scroll on top of it would overshoot in Firefox, which keeps
|
|
629
|
+
// adding a smooth scrollBy's distance after an instant scroll. The
|
|
630
|
+
// field ended 244 px too high there. With none under way, the field
|
|
631
|
+
// lands at once.
|
|
632
|
+
const distanceLeft = smoothDistanceLeft();
|
|
633
|
+
if (distanceLeft === 0) {
|
|
634
|
+
revealFocusedControl();
|
|
635
|
+
}
|
|
636
|
+
// The hook puts the pan back only if the sheet holds the field above
|
|
637
|
+
// the keyboard with its own scroller. Rects are in layout-viewport
|
|
638
|
+
// coordinates, which the pan does not move. A ride still draws the
|
|
639
|
+
// field lower than its layout, so its offset does not count. A field
|
|
640
|
+
// the sheet cannot bring up keeps the browser's reveal.
|
|
641
|
+
const activeElement = document.activeElement;
|
|
642
|
+
const dialog = sheet.closest('dialog');
|
|
643
|
+
if (dialog != null && activeElement instanceof HTMLElement && activeElement.getBoundingClientRect().bottom - rideOffset() - distanceLeft <= getObstructionTop()) {
|
|
644
|
+
// The full-viewport dialog is fixed at the layout viewport's top.
|
|
645
|
+
revealPan?.putBack(dialog);
|
|
646
|
+
}
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
scheduleReveal();
|
|
650
|
+
});
|
|
651
|
+
body.addEventListener('focusin', handleFocusIn);
|
|
652
|
+
body.addEventListener('focusout', handleFocusOut);
|
|
653
|
+
sheet.addEventListener('transitionend', handleSheetTransitionEnd);
|
|
654
|
+
// The window's capture phase hears every element's scroll too, and only
|
|
655
|
+
// the page's own scroll moves the document.
|
|
656
|
+
const stopDocumentScroll = subscribeInput(window, 'scroll', event => {
|
|
657
|
+
const target = event.target;
|
|
658
|
+
if (!isNodeTarget(target) || target.nodeType === 9) {
|
|
659
|
+
handleDocumentScroll();
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
mutationObserver?.observe(body, {
|
|
663
|
+
attributes: true,
|
|
664
|
+
characterData: true,
|
|
665
|
+
childList: true,
|
|
666
|
+
subtree: true
|
|
667
|
+
});
|
|
668
|
+
refreshObservedLayout();
|
|
669
|
+
// The dialog enters the top layer in a later effect. Wait until the next
|
|
670
|
+
// frame so flex geometry is final before measuring the body.
|
|
671
|
+
scheduleReveal();
|
|
672
|
+
return () => {
|
|
673
|
+
cancelAnimationFrame(animationFrame);
|
|
674
|
+
stopClaiming?.();
|
|
675
|
+
unsubscribe();
|
|
676
|
+
unsubscribeGuide?.();
|
|
677
|
+
heldHide?.release();
|
|
678
|
+
contentAnimator()?.set({
|
|
679
|
+
y: 0
|
|
680
|
+
});
|
|
681
|
+
revealPan?.stop();
|
|
682
|
+
body.removeEventListener('focusin', handleFocusIn);
|
|
683
|
+
body.removeEventListener('focusout', handleFocusOut);
|
|
684
|
+
sheet.removeEventListener('transitionend', handleSheetTransitionEnd);
|
|
685
|
+
stopDocumentScroll();
|
|
686
|
+
for (const stop of stopObserving) {
|
|
687
|
+
stop();
|
|
688
|
+
}
|
|
689
|
+
mutationObserver?.disconnect();
|
|
690
|
+
setKeyboardInset(0);
|
|
691
|
+
hasKeyboardLayoutRef.current = false;
|
|
692
|
+
retainKeyboardLayoutRef.current = false;
|
|
693
|
+
};
|
|
694
|
+
}, `${isEnabled}|${reservesInset}|${isPageScrollLocked}|${isTouch}|${offset}`);
|
|
695
|
+
return {
|
|
696
|
+
inset: keyboardInset,
|
|
697
|
+
dismiss
|
|
698
|
+
};
|
|
699
|
+
}
|