@astryxdesign/core 0.7.7 → 0.7.8-canary.0d54fd3
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.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +25 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
- package/dist/BottomSheet/useMobileKeyboard.js +6 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +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 +8 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +2 -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 +625 -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 +84 -113
- package/dist/DateInput/useOwnScrollGesture.d.ts +10 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -1
- package/dist/DateInput/useOwnScrollGesture.js +16 -3
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +2 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -1
- package/dist/DateInput/useScrollSettle.js +3 -0
- package/dist/DateInput/useWheelListbox.d.ts +59 -0
- package/dist/DateInput/useWheelListbox.d.ts.map +1 -0
- package/dist/DateInput/useWheelListbox.js +88 -0
- package/dist/DateInput/wheelOptions.d.ts +74 -0
- package/dist/DateInput/wheelOptions.d.ts.map +1 -0
- package/dist/DateInput/wheelOptions.js +98 -0
- package/dist/DateInput/wheelPhysics.d.ts +127 -0
- package/dist/DateInput/wheelPhysics.d.ts.map +1 -0
- package/dist/DateInput/wheelPhysics.js +341 -0
- package/dist/DateInput/wheelStrip.d.ts +92 -0
- package/dist/DateInput/wheelStrip.d.ts.map +1 -0
- package/dist/DateInput/wheelStrip.js +258 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +10 -10
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +9 -32
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +3 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +5 -0
- package/dist/Field/Field.js +2 -2
- package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts.map +1 -1
- package/dist/FieldStatus/useFieldStatusAnnouncement.js +1 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -1
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts +6 -4
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +48 -3
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +20 -33
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/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/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 +39 -4
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +441 -134
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +102 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1919 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +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 +101 -77
- package/dist/Resizable/createResizable.d.ts +145 -0
- package/dist/Resizable/createResizable.d.ts.map +1 -0
- package/dist/Resizable/createResizable.js +575 -0
- package/dist/Resizable/useResizable.d.ts +3 -3
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +252 -459
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +2 -0
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +36 -11
- package/dist/SelectableCard/selectableCardInput.d.ts +12 -0
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -0
- package/dist/SelectableCard/selectableCardInput.js +20 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +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.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +4 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
- package/dist/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/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +2 -0
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +2 -0
- package/dist/Timestamp/Timestamp.js +1 -1
- package/dist/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 +4 -6
- 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 +194 -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 +41 -7
- package/dist/gestures/GestureHost.d.ts +16 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +1 -1
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
- package/dist/hooks/ModalAnnounceProvider.js +1 -0
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/longPressDetector.d.ts +66 -0
- package/dist/hooks/longPressDetector.d.ts.map +1 -0
- package/dist/hooks/longPressDetector.js +200 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/rootScrollStyles.d.ts +48 -0
- package/dist/hooks/rootScrollStyles.d.ts.map +1 -0
- package/dist/hooks/rootScrollStyles.js +207 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts +13 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts.map +1 -0
- package/dist/hooks/scrollLockTouchGuard.js +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 +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/internal/selectable-card.d.ts +21 -0
- package/dist/internal/selectable-card.d.ts.map +1 -0
- package/dist/internal/selectable-card.js +20 -0
- package/dist/internal/sheetDraft.d.ts +2 -2
- package/dist/internal/sheetDraft.js +2 -2
- package/dist/motion/animatedLayout.d.ts +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/index.d.ts +4 -3
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +4 -3
- package/dist/motion/uikit/picker.d.ts +96 -0
- package/dist/motion/uikit/picker.d.ts.map +1 -0
- package/dist/motion/uikit/picker.js +117 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +22 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +36 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts +23 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/reducedMotion.stylex.js +40 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +29 -4
- package/dist/theme/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 +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- 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/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.map +1 -1
- package/dist/utils/pressFeedback.js +20 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +14 -9
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +46 -5
- package/src/AppShell/AppShell.tsx +13 -4
- package/src/BottomSheet/BottomSheet.tsx +1 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +39 -3
- package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
- package/src/BottomSheet/useMobileKeyboard.ts +4 -0
- package/src/BottomSheet/useSheetGestures.ts +10 -1
- package/src/Button/Button.tsx +26 -4
- package/src/Calendar/Calendar.tsx +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 +7 -0
- package/src/CheckboxList/CheckboxList.tsx +9 -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 +765 -0
- package/src/DateInput/TouchDateField.tsx +6 -32
- package/src/DateInput/Wheel.tsx +94 -150
- package/src/DateInput/useOwnScrollGesture.ts +25 -3
- package/src/DateInput/usePointerDragScroll.ts +1 -0
- package/src/DateInput/useScrollSettle.ts +2 -0
- package/src/DateInput/useWheelListbox.ts +112 -0
- package/src/DateInput/wheelOptions.ts +155 -0
- package/src/DateInput/wheelPhysics.ts +406 -0
- package/src/DateInput/wheelStrip.ts +341 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +8 -13
- package/src/Dialog/Dialog.tsx +12 -32
- package/src/Drawer/useDrawerDialogPresence.ts +2 -0
- package/src/DropdownMenu/useMenuOverflow.ts +3 -0
- package/src/Field/Field.tsx +2 -2
- package/src/FieldStatus/useFieldStatusAnnouncement.ts +1 -0
- package/src/FormLayout/FormLayout.doc.mjs +181 -46
- package/src/FormLayout/FormLayout.tsx +5 -1
- package/src/HoverCard/HoverCard.doc.mjs +10 -8
- package/src/HoverCard/HoverCard.tsx +58 -6
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +49 -54
- package/src/Icon/Icon.doc.mjs +51 -10
- package/src/Icon/Icon.tsx +15 -7
- 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/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 +620 -157
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2525 -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 +169 -109
- package/src/Resizable/createResizable.ts +831 -0
- package/src/Resizable/useResizable.ts +292 -623
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/SelectableCard/SelectableCard.tsx +39 -10
- package/src/SelectableCard/selectableCardInput.ts +30 -0
- package/src/Selector/Selector.tsx +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 +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
- package/src/TextArea/TextArea.tsx +2 -7
- package/src/TextInput/TextInput.tsx +13 -17
- package/src/TimeInput/TimeInput.tsx +2 -0
- package/src/TimeInput/TouchTimeField.tsx +2 -0
- package/src/Timer/Timer.tsx +1 -0
- package/src/Timestamp/Timestamp.tsx +1 -1
- package/src/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 +9 -11
- 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 +237 -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 +1 -1
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +10 -4
- package/src/hooks/ModalAnnounceProvider.tsx +1 -0
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/longPressDetector.ts +273 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/rootScrollStyles.ts +247 -0
- package/src/hooks/scrollLockTouchGuard.ts +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 +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/selectable-card.ts +21 -0
- package/src/internal/sheetDraft.ts +2 -2
- package/src/motion/MEASUREMENTS.md +18 -0
- package/src/motion/README.md +10 -5
- package/src/motion/animatedLayout.ts +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/index.ts +4 -3
- package/src/motion/uikit/picker.ts +116 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +44 -0
- package/src/privateAttributes/reducedMotion.stylex.ts +45 -0
- package/src/theme/Theme.tsx +37 -3
- package/src/theme/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 +3 -2
- package/src/utils/isFocusDetached.ts +34 -0
- package/src/utils/plainDate.ts +80 -4
- package/src/utils/pressFeedback.ts +24 -6
- package/src/utils/triggerFocus.ts +80 -0
- 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/Calendar/getStandaloneShortWeekdayNames.ts +0 -38
- package/src/Layer/usePressPin.ts +0 -510
- package/src/internal/touch-sheet.ts +0 -21
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
import {useCallback, useEffect, useState} from 'react';
|
|
16
16
|
import type {ReactNode} from 'react';
|
|
17
17
|
import * as stylex from '@stylexjs/stylex';
|
|
18
|
-
import {Icon, type
|
|
18
|
+
import {Icon, type IconSize} from '../Icon/Icon';
|
|
19
|
+
import type {IconName} from '../Icon/globalIconRegistry';
|
|
19
20
|
import type {InputStatus, InputStatusType} from '../Field/types';
|
|
20
|
-
import {useTooltip} from '../Tooltip';
|
|
21
|
+
import {useTooltip} from '../Tooltip/useTooltip';
|
|
21
22
|
import {radiusVars} from '../theme/tokens.stylex';
|
|
22
23
|
import {themeProps} from '../utils/themeProps';
|
|
23
24
|
import {focusOutlineStyles} from '../utils/focusOutline.stylex';
|
|
@@ -244,7 +244,7 @@ export function useKeyboardHint(
|
|
|
244
244
|
[clearDismissTimeout, dismiss, dismissAfterMs, isEnabled, layer],
|
|
245
245
|
);
|
|
246
246
|
|
|
247
|
-
//
|
|
247
|
+
// Releases the dismiss timer and the layer anchor on unmount.
|
|
248
248
|
useEffect(
|
|
249
249
|
() => () => {
|
|
250
250
|
clearDismissTimeout();
|
|
@@ -59,7 +59,7 @@ export const docs = {
|
|
|
59
59
|
],
|
|
60
60
|
usage: {
|
|
61
61
|
description:
|
|
62
|
-
'Detects a single-finger press-and-hold and reports where it happened, so touch users can reach affordances that a pointer gets from right-click. iOS Safari never synthesizes a contextmenu event on long-press, which makes this the only touch route into a cursor-positioned surface such as ContextMenu. The press cancels on movement, lift, multi-touch or unmount.',
|
|
62
|
+
'Detects a single-finger press-and-hold and reports where it happened, so touch users can reach affordances that a pointer gets from right-click. iOS Safari never synthesizes a contextmenu event on long-press, which makes this the only touch route into a cursor-positioned surface such as ContextMenu. The press cancels on movement, lift, multi-touch or unmount. The hold is timed on the touch events\u2019 own timestamps: when a busy page handles the lift late, a finger held for the full delay still reports its long press, before the lift acts.',
|
|
63
63
|
bestPractices: [
|
|
64
64
|
{
|
|
65
65
|
guidance: true,
|
|
@@ -102,7 +102,7 @@ export const docsDense = {
|
|
|
102
102
|
},
|
|
103
103
|
usage: {
|
|
104
104
|
description:
|
|
105
|
-
|
|
105
|
+
"Touch press-and-hold for affordances a pointer reaches by right-click (e.g. ContextMenu). Reports the point so the surface opens under the finger. Timed on the touch events' timestamps: a busy page delays the report, never drops it.",
|
|
106
106
|
bestPractices: [
|
|
107
107
|
{
|
|
108
108
|
guidance: true,
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* `useMenuPress` for the held-finger menu open
|
|
12
12
|
*
|
|
13
13
|
* SYNC: When modified, update the hooks barrel /packages/core/src/hooks/index.ts
|
|
14
|
+
* and the detector it wraps, /packages/core/src/hooks/longPressDetector.ts
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
// iOS Safari sends no `contextmenu` event on a long press. So a long press is
|
|
@@ -18,24 +19,24 @@
|
|
|
18
19
|
//
|
|
19
20
|
// A caller can spread the touch handlers, or call `start`, `moveTo` and
|
|
20
21
|
// `cancel` from its own pointer events, as `useMenuPress` does. Both ways use
|
|
21
|
-
//
|
|
22
|
-
// the same thing on a context menu and on a menu trigger.
|
|
22
|
+
// the hold time, movement tolerance and timer of createLongPressDetector. So a
|
|
23
|
+
// long press means the same thing on a context menu and on a menu trigger.
|
|
23
24
|
//
|
|
24
25
|
// The defaults come from the long-press recognizer. The recognizer measures
|
|
25
26
|
// its tolerance as a distance, as UIKit does. This hook measures it on each
|
|
26
27
|
// axis. The context menu's own movement allowance is a guess and is not
|
|
27
28
|
// measured yet (AST-094).
|
|
29
|
+
//
|
|
30
|
+
// The hold is a deadline on the touch events' own clock (longPressDetector.ts).
|
|
28
31
|
|
|
29
|
-
import {useCallback, useEffect,
|
|
32
|
+
import {useCallback, useEffect, useState} from 'react';
|
|
30
33
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from '
|
|
34
|
+
createLongPressDetector,
|
|
35
|
+
type LongPressTolerance,
|
|
36
|
+
} from './longPressDetector';
|
|
37
|
+
import {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
// recognizers (motion/uikit/longPress.ts).
|
|
37
|
-
const DEFAULT_DELAY_MS = LONG_PRESS_DURATION_MS;
|
|
38
|
-
const DEFAULT_MOVE_CANCEL_PX = LONG_PRESS_ALLOWABLE_MOVEMENT_PX;
|
|
39
|
+
export type {LongPressTolerance};
|
|
39
40
|
|
|
40
41
|
export interface UseLongPressOptions {
|
|
41
42
|
/** Fired with the touch start point once the press is held for `delayMs`. */
|
|
@@ -48,19 +49,15 @@ export interface UseLongPressOptions {
|
|
|
48
49
|
moveCancelPx?: number;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
/**
|
|
52
|
-
* @internal A press's own movement tolerance, for a core caller that decides
|
|
53
|
-
* it as the press starts (useMenuPress's trigger). Not in the hooks entry.
|
|
54
|
-
*/
|
|
55
|
-
export interface LongPressTolerance {
|
|
56
|
-
moveCancelPx?: number;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
52
|
export interface UseLongPressHandlers {
|
|
60
53
|
onTouchStart: (e: React.TouchEvent) => void;
|
|
61
54
|
onTouchMove: (e: React.TouchEvent) => void;
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The lift. Pass the event, so a press it is stamped past (its timer held
|
|
57
|
+
* back by a busy page) still reports first. Spreading the handlers does.
|
|
58
|
+
*/
|
|
59
|
+
onTouchEnd: (e?: React.TouchEvent) => void;
|
|
60
|
+
onTouchCancel: (e?: React.TouchEvent) => void;
|
|
64
61
|
/**
|
|
65
62
|
* Begin detection at a point, for a caller driving this from its own
|
|
66
63
|
* pointer events rather than the touch handlers above.
|
|
@@ -109,109 +106,22 @@ export function useLongPress(
|
|
|
109
106
|
export function useLongPressDetector(
|
|
110
107
|
options: UseLongPressOptions,
|
|
111
108
|
): LongPressDetectorHandlers {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const startRef = useRef<{x: number; y: number} | null>(null);
|
|
121
|
-
// The press in progress's tolerance, when its caller chose one at start.
|
|
122
|
-
const pressToleranceRef = useRef<LongPressTolerance | null>(null);
|
|
123
|
-
// Keep the latest callback without re-creating handlers on every render.
|
|
124
|
-
const onLongPressRef = useRef(onLongPress);
|
|
125
|
-
onLongPressRef.current = onLongPress;
|
|
126
|
-
|
|
127
|
-
const clear = useCallback(() => {
|
|
128
|
-
if (timerRef.current != null) {
|
|
129
|
-
clearTimeout(timerRef.current);
|
|
130
|
-
timerRef.current = null;
|
|
131
|
-
}
|
|
132
|
-
startRef.current = null;
|
|
133
|
-
}, []);
|
|
134
|
-
|
|
135
|
-
const start = useCallback(
|
|
136
|
-
(point: {x: number; y: number}, tolerance?: LongPressTolerance) => {
|
|
137
|
-
if (disabled) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
// Clear a stale timer first, then record the start point. The clear
|
|
141
|
-
// also sets startRef to null.
|
|
142
|
-
clear();
|
|
143
|
-
startRef.current = {x: point.x, y: point.y};
|
|
144
|
-
pressToleranceRef.current = tolerance ?? null;
|
|
145
|
-
timerRef.current = setTimeout(() => {
|
|
146
|
-
const from = startRef.current;
|
|
147
|
-
if (from == null) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
onLongPressRef.current({x: from.x, y: from.y});
|
|
151
|
-
}, delayMs);
|
|
152
|
-
},
|
|
153
|
-
[disabled, delayMs, clear],
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
const moveTo = useCallback(
|
|
157
|
-
(point: {x: number; y: number}): boolean => {
|
|
158
|
-
const from = startRef.current;
|
|
159
|
-
if (from == null) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
// This press's own tolerance when its caller chose one, on either axis.
|
|
163
|
-
const limit = pressToleranceRef.current?.moveCancelPx ?? moveCancelPx;
|
|
164
|
-
if (
|
|
165
|
-
Math.abs(point.x - from.x) > limit ||
|
|
166
|
-
Math.abs(point.y - from.y) > limit
|
|
167
|
-
) {
|
|
168
|
-
clear();
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
return true;
|
|
172
|
-
},
|
|
173
|
-
[moveCancelPx, clear],
|
|
174
|
-
);
|
|
175
|
-
|
|
176
|
-
const onTouchStart = useCallback(
|
|
177
|
-
(e: React.TouchEvent) => {
|
|
178
|
-
if (disabled) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (e.touches.length !== 1) {
|
|
182
|
-
clear();
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
const touch = e.touches[0];
|
|
186
|
-
start({x: touch.clientX, y: touch.clientY});
|
|
187
|
-
},
|
|
188
|
-
[disabled, clear, start],
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
const onTouchMove = useCallback(
|
|
192
|
-
(e: React.TouchEvent) => {
|
|
193
|
-
if (startRef.current == null) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
if (e.touches.length !== 1) {
|
|
197
|
-
clear();
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const touch = e.touches[0];
|
|
201
|
-
moveTo({x: touch.clientX, y: touch.clientY});
|
|
202
|
-
},
|
|
203
|
-
[clear, moveTo],
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
useEffect(() => clear, [clear]);
|
|
109
|
+
const [detector] = useState(() => createLongPressDetector(options));
|
|
110
|
+
// The detector reads only committed options. A render that React discards
|
|
111
|
+
// never reaches it.
|
|
112
|
+
useIsomorphicLayoutEffect(() => {
|
|
113
|
+
detector.setOptions(options);
|
|
114
|
+
});
|
|
115
|
+
// The detector's pending timer ends with the component.
|
|
116
|
+
useEffect(() => detector.cancel, [detector]);
|
|
207
117
|
|
|
208
118
|
return {
|
|
209
|
-
onTouchStart,
|
|
210
|
-
onTouchMove,
|
|
211
|
-
onTouchEnd:
|
|
212
|
-
onTouchCancel:
|
|
213
|
-
start,
|
|
214
|
-
moveTo,
|
|
215
|
-
cancel:
|
|
119
|
+
onTouchStart: detector.touchStart,
|
|
120
|
+
onTouchMove: detector.touchMove,
|
|
121
|
+
onTouchEnd: detector.touchEnd,
|
|
122
|
+
onTouchCancel: detector.touchEnd,
|
|
123
|
+
start: detector.start,
|
|
124
|
+
moveTo: detector.moveTo,
|
|
125
|
+
cancel: detector.cancel,
|
|
216
126
|
};
|
|
217
127
|
}
|
|
@@ -831,6 +831,8 @@ export function useMenuPress(options: UseMenuPressOptions): UseMenuPressReturn {
|
|
|
831
831
|
endGesture();
|
|
832
832
|
}, [endGesture, step]);
|
|
833
833
|
|
|
834
|
+
// Syncs the document listeners of the menu gesture counter with this mount.
|
|
835
|
+
// Unmount ends the gesture.
|
|
834
836
|
useEffect(() => {
|
|
835
837
|
// Install the gesture counter's listeners before the first press.
|
|
836
838
|
currentGesture();
|
package/src/hooks/useOverflow.ts
CHANGED
|
@@ -251,7 +251,8 @@ export function useOverflow(
|
|
|
251
251
|
[calculate],
|
|
252
252
|
);
|
|
253
253
|
|
|
254
|
-
//
|
|
254
|
+
// Syncs the visible count with the rendered layout. It measures again after
|
|
255
|
+
// the items change.
|
|
255
256
|
useIsomorphicLayoutEffect(() => {
|
|
256
257
|
calculate();
|
|
257
258
|
}, [calculate]);
|
|
@@ -50,6 +50,7 @@ import {installPressFeedback, pressableProps} from '../utils/pressFeedback';
|
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
52
|
export function usePressFeedback(): typeof pressableProps {
|
|
53
|
+
// Syncs the shared document listener for press feedback with this mount.
|
|
53
54
|
useEffect(() => installPressFeedback(), []);
|
|
54
55
|
return pressableProps;
|
|
55
56
|
}
|
|
@@ -29,6 +29,9 @@ import {FormLayoutContext} from '../FormLayout/FormLayoutContext';
|
|
|
29
29
|
* Semantics only: this drives `aria-required`, never the native `required`
|
|
30
30
|
* attribute, so a layout-level default can't silently switch on browser
|
|
31
31
|
* validation bubbles. `isOptional` takes precedence, matching `FieldLabel`.
|
|
32
|
+
*
|
|
33
|
+
* CheckboxInput and Switch do not use this hook: an unchecked box or an off
|
|
34
|
+
* switch is an answer, so a form default gives them no required state.
|
|
32
35
|
*/
|
|
33
36
|
export function useResolvedRequired({
|
|
34
37
|
isRequired = false,
|
|
@@ -4,23 +4,50 @@
|
|
|
4
4
|
export const docs = {
|
|
5
5
|
name: 'useScrollLock',
|
|
6
6
|
displayName: 'useScrollLock',
|
|
7
|
-
keywords: [
|
|
7
|
+
keywords: [
|
|
8
|
+
'scroll',
|
|
9
|
+
'lock',
|
|
10
|
+
'modal',
|
|
11
|
+
'dialog',
|
|
12
|
+
'page',
|
|
13
|
+
'prevent',
|
|
14
|
+
'background',
|
|
15
|
+
'ios',
|
|
16
|
+
'safari',
|
|
17
|
+
'touch',
|
|
18
|
+
'scrollbar',
|
|
19
|
+
'gutter',
|
|
20
|
+
'layout shift',
|
|
21
|
+
'reflow',
|
|
22
|
+
],
|
|
8
23
|
params: [
|
|
9
24
|
{
|
|
10
25
|
name: 'isLocked',
|
|
11
26
|
type: 'boolean',
|
|
12
|
-
description: 'whether
|
|
27
|
+
description: 'whether page scroll should be locked.',
|
|
13
28
|
required: true,
|
|
14
29
|
},
|
|
15
30
|
],
|
|
16
31
|
returns: [],
|
|
17
32
|
usage: {
|
|
18
33
|
description:
|
|
19
|
-
'Locks
|
|
34
|
+
'Locks page scroll while active and keeps the page where it is. The page gets overflow: hidden (on the root, or on body when its own overflow is the one the viewport uses), which stops wheel, keyboard and scrollbar scrolling, and overscroll-behavior-y: none on the root and body, which stops the overscroll bounce while the lock holds. Where the primary pointer is coarse (phones and tablets), a one-finger pan that would scroll the page is cancelled, because iOS Safari scrolls an overflow: hidden page under a finger; pans that a scroller inside the overlay can take, drags on a native range input, pinch-zoom, and one-finger drags on a pinch-zoomed page (which pan the zoomed view) still work. The scroll offset never changes, so nothing jumps when the lock starts or ends, and iOS Safari keeps its toolbar as it was. Where the hidden scrollbar takes layout space (desktop), the hook holds its gutter open with scrollbar-gutter: stable, so the page, including any position: fixed chrome, does not shift sideways.',
|
|
20
35
|
bestPractices: [
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
{
|
|
37
|
+
guidance: true,
|
|
38
|
+
description:
|
|
39
|
+
'Use when opening full-screen modals or dialogs to prevent background content from scrolling.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
guidance: true,
|
|
43
|
+
description:
|
|
44
|
+
'Pass the same boolean that controls dialog visibility (e.g., isOpen) as the isLocked parameter.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
guidance: false,
|
|
48
|
+
description:
|
|
49
|
+
'Use for non-modal overlays like popovers or tooltips; users should be able to scroll away from those.',
|
|
50
|
+
},
|
|
24
51
|
],
|
|
25
52
|
},
|
|
26
53
|
relatedComponents: ['Dialog'],
|
|
@@ -32,17 +59,29 @@ export const docs = {
|
|
|
32
59
|
/** @type {import('@astryxdesign/cli/authoring').HookTranslationDoc} */
|
|
33
60
|
export const docsDense = {
|
|
34
61
|
description:
|
|
35
|
-
|
|
62
|
+
"Locks page scroll while active, page stays where it is: overflow: hidden on the root, or on body when its own overflow propagates (wheel, keyboard, scrollbar) + overscroll-behavior-y: none on root and body (no overscroll bounce while locked) + cancels 1-finger pans that would scroll the page (iOS Safari scrolls overflow: hidden pages under a finger); overlay scrollers, range inputs, pinch-zoom + drags on a zoomed page still work. Offset never changes: no jump, iOS toolbar unchanged. Holds the hidden scrollbar's gutter open (scrollbar-gutter: stable) so the page (incl. position: fixed chrome) does not shift sideways.",
|
|
36
63
|
paramDescriptions: {
|
|
37
|
-
isLocked: 'whether
|
|
64
|
+
isLocked: 'whether page scroll should be locked.',
|
|
38
65
|
},
|
|
39
66
|
usage: {
|
|
40
67
|
description:
|
|
41
|
-
|
|
68
|
+
"Locks page scroll while active, page stays where it is: overflow: hidden on the root, or on body when its own overflow propagates (wheel, keyboard, scrollbar) + overscroll-behavior-y: none on root and body (no overscroll bounce while locked) + cancels 1-finger pans that would scroll the page (iOS Safari scrolls overflow: hidden pages under a finger); overlay scrollers, range inputs, pinch-zoom + drags on a zoomed page still work. Offset never changes: no jump, iOS toolbar unchanged. Holds the hidden scrollbar's gutter open (scrollbar-gutter: stable) so the page (incl. position: fixed chrome) does not shift sideways.",
|
|
42
69
|
bestPractices: [
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
70
|
+
{
|
|
71
|
+
guidance: true,
|
|
72
|
+
description:
|
|
73
|
+
'Use when opening full-screen modals / dialogs to prevent background content from scrolling.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
guidance: true,
|
|
77
|
+
description:
|
|
78
|
+
'Pass same boolean that controls dialog visibility (e.g. isOpen) as isLocked parameter.',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
guidance: false,
|
|
82
|
+
description:
|
|
83
|
+
'Use for non-modal overlays like popovers / tooltips; users should be able to scroll away from those.',
|
|
84
|
+
},
|
|
46
85
|
],
|
|
47
86
|
},
|
|
48
87
|
};
|
|
@@ -4,46 +4,45 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useScrollLock.ts
|
|
7
|
-
* @input
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* This is needed because overscroll-behavior:contain doesn't work on iOS Safari.
|
|
7
|
+
* @input React useEffect, rootScrollStyles, gestures/pageHold with the pan
|
|
8
|
+
* decision, and the scrollbar gutter hold
|
|
9
|
+
* @output useScrollLock, which locks page scroll behind a modal
|
|
10
|
+
* @position Core hook; used by Dialog, BottomSheet, Drawer, Lightbox and
|
|
11
|
+
* MobileNav
|
|
13
12
|
*
|
|
14
13
|
* SYNC: When modified, update:
|
|
15
14
|
* - /packages/core/src/hooks/index.ts
|
|
16
15
|
* - /packages/core/src/hooks/scrollbarGutter.ts
|
|
16
|
+
* - /packages/core/src/hooks/rootScrollStyles.ts
|
|
17
|
+
* - /packages/core/src/gestures/pageHold.ts (holdPageScroll)
|
|
18
|
+
* - /packages/core/src/hooks/useScrollLockImports.test.ts
|
|
17
19
|
*/
|
|
18
20
|
|
|
19
21
|
import {useEffect} from 'react';
|
|
22
|
+
import {claimRootScrollStyle, reportScrollLock} from './rootScrollStyles';
|
|
23
|
+
import {holdPageScroll} from '../gestures/pageHold';
|
|
24
|
+
import {isPageZoomedIn, isPanAbsorbedBeforePage} from './scrollLockTouchGuard';
|
|
20
25
|
import {holdScrollbarGutter, type ScrollbarGutterHold} from './scrollbarGutter';
|
|
21
26
|
|
|
22
|
-
interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
overflow: string;
|
|
26
|
-
position: string;
|
|
27
|
-
top: string;
|
|
28
|
-
left: string;
|
|
29
|
-
right: string;
|
|
27
|
+
interface ActiveLock {
|
|
28
|
+
releaseRootStyle: () => void;
|
|
29
|
+
releasePageHold: () => void;
|
|
30
30
|
gutter: ScrollbarGutterHold;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
let lockCount = 0;
|
|
34
|
-
let
|
|
34
|
+
let activeLock: ActiveLock | null = null;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Locks
|
|
38
|
-
*
|
|
39
|
-
* Pins the body with `position: fixed` to prevent background scrolling,
|
|
40
|
-
* which is necessary for iOS Safari where `overscroll-behavior: contain`
|
|
41
|
-
* does not prevent body scroll behind modals. Restores scroll position
|
|
42
|
-
* on unlock.
|
|
37
|
+
* Locks page scroll while `isLocked` is true.
|
|
43
38
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
39
|
+
* The page keeps its scroll offset, so nothing jumps on lock or unlock. iOS
|
|
40
|
+
* Safari scrolls an `overflow: hidden` page under a finger. So where the
|
|
41
|
+
* primary pointer is coarse (phones and tablets), the lock cancels a
|
|
42
|
+
* one-finger pan that would reach the page.
|
|
43
|
+
* Pans that a scroller in the overlay takes, and two-finger zoom, go through.
|
|
44
|
+
* The gutter of a classic scrollbar stays open, so the page does not shift
|
|
45
|
+
* sideways.
|
|
47
46
|
*
|
|
48
47
|
* @example
|
|
49
48
|
* ```
|
|
@@ -51,59 +50,53 @@ let originalBodyState: ScrollLockSnapshot | null = null;
|
|
|
51
50
|
* ```
|
|
52
51
|
*/
|
|
53
52
|
export function useScrollLock(isLocked: boolean): void {
|
|
53
|
+
// Syncs the document's scroll lock with `isLocked`. A count of holders keeps
|
|
54
|
+
// the page locked until the last one releases.
|
|
54
55
|
useEffect(() => {
|
|
55
56
|
if (!isLocked) {
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
const {body} = document;
|
|
60
|
-
|
|
61
60
|
if (lockCount === 0) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
body.style.top = `-${scrollY}px`;
|
|
82
|
-
body.style.left = '0';
|
|
83
|
-
body.style.right = '0';
|
|
84
|
-
|
|
61
|
+
// The hold measures before the lock writes a style, so the lock forces no
|
|
62
|
+
// layout of its own. `settle` writes the gutter with the styles below.
|
|
63
|
+
const gutter = holdScrollbarGutter(document.documentElement);
|
|
64
|
+
// `overscroll-behavior-y: none` also keeps the browser's own
|
|
65
|
+
// pull-to-refresh (Chrome on Android) from reloading the page behind
|
|
66
|
+
// the overlay.
|
|
67
|
+
const releaseRootStyle = claimRootScrollStyle({
|
|
68
|
+
overflow: 'hidden',
|
|
69
|
+
overscrollBehaviorY: 'none',
|
|
70
|
+
});
|
|
71
|
+
// The hold asks the gesture host only if one exists, so the lock does
|
|
72
|
+
// not bring the host into every overlay's import.
|
|
73
|
+
const releasePageHold = holdPageScroll(
|
|
74
|
+
document,
|
|
75
|
+
// A drag on a pinch-zoomed page pans the zoomed view: it goes
|
|
76
|
+
// through, so a zoomed-in reader can move around the overlay.
|
|
77
|
+
(origin, dx, dy) =>
|
|
78
|
+
!isPageZoomedIn(document) && !isPanAbsorbedBeforePage(origin, dx, dy),
|
|
79
|
+
);
|
|
85
80
|
gutter.settle();
|
|
81
|
+
activeLock = {releaseRootStyle, releasePageHold, gutter};
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
lockCount += 1;
|
|
85
|
+
reportScrollLock(1);
|
|
89
86
|
|
|
90
87
|
return () => {
|
|
91
88
|
lockCount -= 1;
|
|
89
|
+
reportScrollLock(-1);
|
|
92
90
|
|
|
93
|
-
if (lockCount !== 0 ||
|
|
91
|
+
if (lockCount !== 0 || activeLock == null) {
|
|
94
92
|
return;
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
body.style.top = state.top;
|
|
103
|
-
body.style.left = state.left;
|
|
104
|
-
body.style.right = state.right;
|
|
105
|
-
state.gutter.release();
|
|
106
|
-
window.scrollTo(state.scrollX, state.scrollY);
|
|
95
|
+
const lock = activeLock;
|
|
96
|
+
activeLock = null;
|
|
97
|
+
lock.releasePageHold();
|
|
98
|
+
lock.releaseRootStyle();
|
|
99
|
+
lock.gutter.release();
|
|
107
100
|
};
|
|
108
101
|
}, [isLocked]);
|
|
109
102
|
}
|
|
@@ -216,6 +216,8 @@ export function useScrollableArea({
|
|
|
216
216
|
const getComposedViewportRef = useStableComposedRef(viewportRef);
|
|
217
217
|
const getComposedContentRef = useStableComposedRef(contentRef);
|
|
218
218
|
|
|
219
|
+
// Syncs the scroll geometry with the viewport and content nodes. It measures
|
|
220
|
+
// them, then follows resize, scroll, transition and font events.
|
|
219
221
|
useIsomorphicLayoutEffect(() => {
|
|
220
222
|
if (viewport == null || content == null) {
|
|
221
223
|
return;
|
|
@@ -430,6 +432,8 @@ export function useScrollableArea({
|
|
|
430
432
|
// commit. A loss waits for the next frame.
|
|
431
433
|
const previousOverflowRef = useRef<LogicalOverflowGeometry>(INITIAL_OVERFLOW);
|
|
432
434
|
const previousMappingRef = useRef<LogicalAxisMapping>(INITIAL_MAPPING);
|
|
435
|
+
// Measures the layout again when overflow starts or the writing-mode mapping
|
|
436
|
+
// changes. A new scrollbar gutter changes the geometry.
|
|
433
437
|
useIsomorphicLayoutEffect(() => {
|
|
434
438
|
const previous = previousOverflowRef.current;
|
|
435
439
|
const hasGainedOverflow =
|
|
@@ -178,6 +178,8 @@ export function useStreamingText(
|
|
|
178
178
|
'(prefers-reduced-motion: reduce)',
|
|
179
179
|
);
|
|
180
180
|
|
|
181
|
+
// Syncs the revealed text with an animation-frame clock while the text
|
|
182
|
+
// streams.
|
|
181
183
|
useEffect(() => {
|
|
182
184
|
if (!isStreaming || speed === 'instant' || prefersReducedMotion) {
|
|
183
185
|
return;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @generated by scripts/generate-i18n-runtime.mjs from packages/core/locales/en.json,
|
|
5
|
+
* holding the English for the catalog keys named in packages/core/src/PowerSearch/PowerSearchBottomSheet.tsx.
|
|
6
|
+
* Do not edit by hand. Run `pnpm generate:i18n-runtime` instead.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const english: Readonly<Record<string, string>> = {
|
|
10
|
+
"@astryx.powersearch.allFiltersRemoved": "All filters removed",
|
|
11
|
+
"@astryx.powersearch.editableFiltersRemoved": "Editable filters removed",
|
|
12
|
+
"@astryx.powersearch.editor.apply": "Apply",
|
|
13
|
+
"@astryx.powersearch.editor.cancel": "Cancel",
|
|
14
|
+
"@astryx.powersearch.editor.operator": "Operator",
|
|
15
|
+
"@astryx.powersearch.sheet.addFilter": "Add filter",
|
|
16
|
+
"@astryx.powersearch.sheet.clearAll": "Clear all",
|
|
17
|
+
"@astryx.powersearch.sheet.clearAllCancel": "Keep filters",
|
|
18
|
+
"@astryx.powersearch.sheet.clearAllConfirm": "Clear filters",
|
|
19
|
+
"@astryx.powersearch.sheet.clearAllDescription": "This removes all editable filters from this search.",
|
|
20
|
+
"@astryx.powersearch.sheet.clearAllTitle": "Clear all filters?",
|
|
21
|
+
"@astryx.powersearch.sheet.done": "Done",
|
|
22
|
+
"@astryx.powersearch.sheet.editableFiltersClearedWithCount": "Editable filters removed. {resultCount}",
|
|
23
|
+
"@astryx.powersearch.sheet.fieldOperator": "{field} {operator}",
|
|
24
|
+
"@astryx.powersearch.sheet.filterUnavailable": "This filter is no longer available",
|
|
25
|
+
"@astryx.powersearch.sheet.filtersClearedWithCount": "All filters removed. {resultCount}",
|
|
26
|
+
"@astryx.powersearch.sheet.filtersTitle": "Filters",
|
|
27
|
+
"@astryx.powersearch.sheet.labelValue": "{label} {value}",
|
|
28
|
+
"@astryx.powersearch.sheet.noFilters": "No filters applied",
|
|
29
|
+
"@astryx.powersearch.sheet.noFiltersDescription": "Add a filter to narrow your results and find what you need faster.",
|
|
30
|
+
"@astryx.powersearch.sheet.noMatchingFields": "No filters match your search",
|
|
31
|
+
"@astryx.powersearch.sheet.noResults": "No results found",
|
|
32
|
+
"@astryx.powersearch.sheet.removeFilter": "Remove {field} filter",
|
|
33
|
+
"@astryx.powersearch.sheet.search": "Search",
|
|
34
|
+
"@astryx.powersearch.sheet.searchFields": "Search filters",
|
|
35
|
+
"@astryx.powersearch.sheet.searchFieldsPlaceholder": "Search filters…",
|
|
36
|
+
"@astryx.powersearch.sheet.searchResults": "Search results",
|
|
37
|
+
"@astryx.powersearch.sheet.tryDifferentSearch": "Try a different search.",
|
|
38
|
+
"@astryx.powersearch.sheet.ungroupedFields": "General",
|
|
39
|
+
"@astryx.tokenizer.tokenAdded": "Added {label}",
|
|
40
|
+
"@astryx.tokenizer.tokenRemoved": "Removed {label}"
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default english;
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const english: Readonly<Record<string, string>> = {
|
|
10
|
+
"@astryx.powersearch.sheet.relativeDaysAgo": "{count, number} {count, plural, one {day} other {days}} ago",
|
|
11
|
+
"@astryx.powersearch.sheet.relativeDaysFromNow": "{count, number} {count, plural, one {day} other {days}} from now",
|
|
12
|
+
"@astryx.powersearch.sheet.relativeMonthsAgo": "{count, number} {count, plural, one {month} other {months}} ago",
|
|
13
|
+
"@astryx.powersearch.sheet.relativeMonthsFromNow": "{count, number} {count, plural, one {month} other {months}} from now",
|
|
14
|
+
"@astryx.powersearch.sheet.relativeWeeksAgo": "{count, number} {count, plural, one {week} other {weeks}} ago",
|
|
15
|
+
"@astryx.powersearch.sheet.relativeWeeksFromNow": "{count, number} {count, plural, one {week} other {weeks}} from now",
|
|
10
16
|
"@astryx.powersearch.valueEditor.addValuesPlaceholder": "Add values…",
|
|
11
17
|
"@astryx.powersearch.valueEditor.date": "Date",
|
|
12
18
|
"@astryx.powersearch.valueEditor.dateRange": "date range",
|