@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
|
@@ -16,6 +16,7 @@ import type {Locale, TranslatorFn} from '../i18n';
|
|
|
16
16
|
import {truncateCharacters} from '../utils/characters';
|
|
17
17
|
import {registerEnglishFallback} from '../i18n/englishFallback';
|
|
18
18
|
import english from '../i18n/generated-english/PowerSearch/formatFilterValue.generated';
|
|
19
|
+
import {resolveDateZone} from './powerSearchDateZone';
|
|
19
20
|
|
|
20
21
|
registerEnglishFallback(english);
|
|
21
22
|
|
|
@@ -32,44 +33,59 @@ function formatEnumLabel(
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
function formatNumber(value: number, locale: Locale, units?: string): string {
|
|
35
|
-
const formatted =
|
|
36
|
+
const formatted = formatSharedNumber(value, locale);
|
|
36
37
|
return units ? `${formatted} ${units}` : formatted;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* A number in the provider locale's digits, decimal mark, and — unless the
|
|
42
|
+
* options say otherwise — grouping. The shared number helper for
|
|
43
|
+
* PowerSearch's own readings of a value — this module owns the raw `Intl`
|
|
44
|
+
* access.
|
|
45
|
+
*/
|
|
46
|
+
export function formatSharedNumber(
|
|
47
|
+
value: number,
|
|
41
48
|
locale: Locale,
|
|
42
|
-
|
|
49
|
+
options?: Pick<
|
|
50
|
+
Intl.NumberFormatOptions,
|
|
51
|
+
'useGrouping' | 'maximumFractionDigits'
|
|
52
|
+
>,
|
|
43
53
|
): string {
|
|
44
|
-
|
|
45
|
-
year: 'numeric',
|
|
46
|
-
month: 'short',
|
|
47
|
-
day: 'numeric',
|
|
48
|
-
hour: 'numeric',
|
|
49
|
-
minute: '2-digit',
|
|
50
|
-
...(timezoneID ? {timeZone: timezoneID} : {}),
|
|
51
|
-
calendar: 'gregory',
|
|
52
|
-
};
|
|
53
|
-
return new Intl.DateTimeFormat(locale, options).format(unixSeconds * 1000);
|
|
54
|
+
return new Intl.NumberFormat(locale, options).format(value);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
58
|
+
* The one reading of a calendar-day `date_absolute` value: its day in the
|
|
59
|
+
* zone `resolveDateZone` names. The token text and the accessible label share
|
|
60
|
+
* it; the editors read the same zone through `resolveDateZone`, so a value
|
|
61
|
+
* never reads as two days in one field. A value whose operator sets
|
|
62
|
+
* `isDateOnly: false` is an instant: its date and time in `timezoneID`,
|
|
63
|
+
* else the viewer's zone, the time its editor reads and writes.
|
|
62
64
|
*/
|
|
63
|
-
export function
|
|
65
|
+
export function formatDateAbsolute(
|
|
64
66
|
unixSeconds: number,
|
|
65
67
|
locale: Locale,
|
|
68
|
+
timezoneID: string | undefined,
|
|
69
|
+
isDateOnly = true,
|
|
66
70
|
): string {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const options: Intl.DateTimeFormatOptions = isDateOnly
|
|
72
|
+
? {
|
|
73
|
+
year: 'numeric',
|
|
74
|
+
month: 'short',
|
|
75
|
+
day: 'numeric',
|
|
76
|
+
timeZone: resolveDateZone(timezoneID, true),
|
|
77
|
+
calendar: 'gregory',
|
|
78
|
+
}
|
|
79
|
+
: {
|
|
80
|
+
year: 'numeric',
|
|
81
|
+
month: 'short',
|
|
82
|
+
day: 'numeric',
|
|
83
|
+
hour: 'numeric',
|
|
84
|
+
minute: '2-digit',
|
|
85
|
+
timeZone: resolveDateZone(timezoneID, false),
|
|
86
|
+
calendar: 'gregory',
|
|
87
|
+
};
|
|
88
|
+
return new Intl.DateTimeFormat(locale, options).format(unixSeconds * 1000);
|
|
73
89
|
}
|
|
74
90
|
|
|
75
91
|
function formatRelativeDate(value: string): string {
|
|
@@ -188,7 +204,13 @@ export function formatFilterValue(
|
|
|
188
204
|
|
|
189
205
|
case 'date_absolute':
|
|
190
206
|
return truncate(
|
|
191
|
-
formatDateAbsolute(
|
|
207
|
+
formatDateAbsolute(
|
|
208
|
+
filterValue.unixSeconds,
|
|
209
|
+
locale,
|
|
210
|
+
timezoneID,
|
|
211
|
+
operatorValue.type !== 'date_absolute' ||
|
|
212
|
+
operatorValue.isDateOnly !== false,
|
|
213
|
+
),
|
|
192
214
|
maxLength,
|
|
193
215
|
);
|
|
194
216
|
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview The text a PowerSearch filter token shows for a value.
|
|
5
|
+
*
|
|
6
|
+
* @input `OperatorValue`, `FilterValue`, a width budget, and the locale.
|
|
7
|
+
* @output `formatTokenValueText` — one string, or null for an empty value.
|
|
8
|
+
* @position Shared by the token itself (`PowerSearch.tsx`) and the sheet
|
|
9
|
+
* presentation's Filters rows and removal announcement
|
|
10
|
+
* (`PowerSearchBottomSheet.tsx`), so every reading of a value on the field
|
|
11
|
+
* uses the same words and the same zone handling.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type {OperatorValue, FilterValue, EnumItem} from './types';
|
|
15
|
+
import type {Locale, TranslatorFn} from '../i18n';
|
|
16
|
+
import {truncateCharacters} from '../utils/characters';
|
|
17
|
+
import {formatDateAbsolute, formatSharedNumber} from './formatFilterValue';
|
|
18
|
+
import {registerEnglishFallback} from '../i18n/englishFallback';
|
|
19
|
+
import english from '../i18n/generated-english/PowerSearch/formatTokenValue.generated';
|
|
20
|
+
|
|
21
|
+
registerEnglishFallback(english);
|
|
22
|
+
|
|
23
|
+
type ListFormatFn = (items: ReadonlyArray<string>) => string;
|
|
24
|
+
|
|
25
|
+
function truncateString(value: string, limit: number): string {
|
|
26
|
+
// Same semantics as before — strings within limit + 3 pass through, longer
|
|
27
|
+
// ones cut to limit + '...' — but counted in characters, not code units.
|
|
28
|
+
return truncateCharacters(value, limit + 3, '...');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getEnumLabel(values: ReadonlyArray<EnumItem>, value: string): string {
|
|
32
|
+
return values.find(v => v.value === value)?.label ?? value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Intl's maximum fraction cap: no number the row formats is rounded.
|
|
36
|
+
const MAX_FRACTION_DIGITS = 100;
|
|
37
|
+
|
|
38
|
+
// Whether a locale writes a number with the token's own numerals: Latin
|
|
39
|
+
// digits and a `.` decimal mark, so `String(value)` is already the locale's
|
|
40
|
+
// reading. Probed once per locale through the shared number helper.
|
|
41
|
+
const tokenNumeralLocales = new Map<string, boolean>();
|
|
42
|
+
function usesTokenNumerals(locale: Locale): boolean {
|
|
43
|
+
let uses = tokenNumeralLocales.get(locale);
|
|
44
|
+
if (uses == null) {
|
|
45
|
+
uses =
|
|
46
|
+
formatSharedNumber(1234567.5, locale, {
|
|
47
|
+
useGrouping: false,
|
|
48
|
+
maximumFractionDigits: MAX_FRACTION_DIGITS,
|
|
49
|
+
}) === '1234567.5';
|
|
50
|
+
tokenNumeralLocales.set(locale, uses);
|
|
51
|
+
}
|
|
52
|
+
return uses;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// A number as the token reads it. Where the locale writes Latin digits and a
|
|
56
|
+
// `.` decimal mark, use the token's own text, `String(value)`. Elsewhere, use
|
|
57
|
+
// the locale's digits and decimal mark, with no grouping and no rounding: the
|
|
58
|
+
// fraction cap is Intl's maximum, so `1e-21` keeps its digits.
|
|
59
|
+
function formatNumberAsToken(value: number, locale: Locale): string {
|
|
60
|
+
return usesTokenNumerals(locale)
|
|
61
|
+
? String(value)
|
|
62
|
+
: formatSharedNumber(value, locale, {
|
|
63
|
+
useGrouping: false,
|
|
64
|
+
maximumFractionDigits: MAX_FRACTION_DIGITS,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// The summaries, lists, and numbers the token writes as English literals, and
|
|
69
|
+
// the locale-aware readings of the same: with a translator (the sheet
|
|
70
|
+
// presentation's rows and announcements) the summaries resolve through the
|
|
71
|
+
// catalog, lists through the provider locale's list format, and numbers
|
|
72
|
+
// through its number format; without one they stay the token's own literals,
|
|
73
|
+
// the released popover token's text. In English the two read identically.
|
|
74
|
+
function itemsSummary(count: number, t: TranslatorFn | undefined): string {
|
|
75
|
+
return t
|
|
76
|
+
? t('@astryx.powersearch.valueEditor.itemsCount', {count})
|
|
77
|
+
: // eslint-disable-next-line @astryx/no-hardcoded-i18n-string -- the popover token's released English text; translating it is a separate stable change
|
|
78
|
+
`${count} items`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function formatListText(
|
|
82
|
+
labels: ReadonlyArray<string>,
|
|
83
|
+
maxLength: number,
|
|
84
|
+
t: TranslatorFn | undefined,
|
|
85
|
+
formatList: ListFormatFn | undefined,
|
|
86
|
+
): string | null {
|
|
87
|
+
if (labels.length === 0) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
if (labels.length === 1) {
|
|
91
|
+
return truncateString(labels[0], maxLength);
|
|
92
|
+
}
|
|
93
|
+
const totalLength = labels.reduce((sum, s) => sum + s.length, 0);
|
|
94
|
+
if (totalLength > maxLength) {
|
|
95
|
+
return itemsSummary(labels.length, t);
|
|
96
|
+
}
|
|
97
|
+
return formatList ? formatList(labels) : labels.join(', ');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The text a filter token shows for a value: the one place that decides how
|
|
102
|
+
* a value reads on the field, so every other reading of the same value —
|
|
103
|
+
* the sheet presentation's Filters rows and its removal announcement — can
|
|
104
|
+
* use the same words and the same zone handling. `maxLength` is the token's
|
|
105
|
+
* width budget; pass `Number.MAX_SAFE_INTEGER` for the untruncated text.
|
|
106
|
+
* With `t`, the list, date-range and nested summaries resolve through the
|
|
107
|
+
* catalog (`@astryx.powersearch.valueEditor.*`); without it they are the
|
|
108
|
+
* token's own literals. With `formatList` (the provider's list formatter),
|
|
109
|
+
* several labels join as a list in the locale; without it they join with
|
|
110
|
+
* the token's literal ", ".
|
|
111
|
+
*/
|
|
112
|
+
export function formatTokenValueText(
|
|
113
|
+
operatorValue: OperatorValue,
|
|
114
|
+
filterValue: FilterValue,
|
|
115
|
+
maxLength: number,
|
|
116
|
+
locale: Locale,
|
|
117
|
+
t?: TranslatorFn,
|
|
118
|
+
formatList?: ListFormatFn,
|
|
119
|
+
timezoneID?: string,
|
|
120
|
+
): string | null {
|
|
121
|
+
switch (filterValue.type) {
|
|
122
|
+
case 'empty':
|
|
123
|
+
return null;
|
|
124
|
+
|
|
125
|
+
case 'string':
|
|
126
|
+
return truncateString(filterValue.value, maxLength);
|
|
127
|
+
|
|
128
|
+
case 'integer':
|
|
129
|
+
case 'float':
|
|
130
|
+
return t
|
|
131
|
+
? formatNumberAsToken(filterValue.value, locale)
|
|
132
|
+
: String(filterValue.value);
|
|
133
|
+
|
|
134
|
+
case 'enum':
|
|
135
|
+
if (operatorValue.type === 'enum') {
|
|
136
|
+
return truncateString(
|
|
137
|
+
getEnumLabel(operatorValue.values, filterValue.value),
|
|
138
|
+
maxLength,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return truncateString(filterValue.value, maxLength);
|
|
142
|
+
|
|
143
|
+
case 'string_list':
|
|
144
|
+
return formatListText(filterValue.value, maxLength, t, formatList);
|
|
145
|
+
|
|
146
|
+
case 'enum_list': {
|
|
147
|
+
const items = filterValue.value;
|
|
148
|
+
if (items.length === 0) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
if (operatorValue.type === 'enum_list') {
|
|
152
|
+
return formatListText(
|
|
153
|
+
items.map(v => getEnumLabel(operatorValue.values, v)),
|
|
154
|
+
maxLength,
|
|
155
|
+
t,
|
|
156
|
+
formatList,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
if (items.length === 1) {
|
|
160
|
+
return truncateString(items[0], maxLength);
|
|
161
|
+
}
|
|
162
|
+
return itemsSummary(items.length, t);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
case 'entity_list':
|
|
166
|
+
return formatListText(
|
|
167
|
+
filterValue.value.map(e => e.label),
|
|
168
|
+
maxLength,
|
|
169
|
+
t,
|
|
170
|
+
formatList,
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
case 'time':
|
|
174
|
+
return filterValue.value;
|
|
175
|
+
|
|
176
|
+
case 'date_absolute':
|
|
177
|
+
// The token reads a value in the zone its editor uses.
|
|
178
|
+
return truncateString(
|
|
179
|
+
formatDateAbsolute(
|
|
180
|
+
filterValue.unixSeconds,
|
|
181
|
+
locale,
|
|
182
|
+
timezoneID,
|
|
183
|
+
operatorValue.type !== 'date_absolute' ||
|
|
184
|
+
operatorValue.isDateOnly !== false,
|
|
185
|
+
),
|
|
186
|
+
maxLength,
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
case 'date_relative':
|
|
190
|
+
return truncateString(filterValue.value, maxLength);
|
|
191
|
+
|
|
192
|
+
case 'date_range':
|
|
193
|
+
if (t) {
|
|
194
|
+
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
195
|
+
}
|
|
196
|
+
// eslint-disable-next-line @astryx/no-hardcoded-i18n-string -- the popover token's released English text; translating it is a separate stable change
|
|
197
|
+
return 'date range';
|
|
198
|
+
|
|
199
|
+
case 'custom':
|
|
200
|
+
if (operatorValue.type === 'custom') {
|
|
201
|
+
return truncateString(
|
|
202
|
+
operatorValue.getString(filterValue.value),
|
|
203
|
+
maxLength,
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
return filterValue.value;
|
|
207
|
+
|
|
208
|
+
case 'nested': {
|
|
209
|
+
const count = filterValue.value.length;
|
|
210
|
+
if (t) {
|
|
211
|
+
return t('@astryx.powersearch.valueEditor.filtersCount', {count});
|
|
212
|
+
}
|
|
213
|
+
// eslint-disable-next-line @astryx/no-hardcoded-i18n-string -- the popover token's released English text; translating it is a separate stable change
|
|
214
|
+
return count === 1 ? '1 filter' : `${count} filters`;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
default:
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
}
|
package/src/PowerSearch/index.ts
CHANGED
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export {PowerSearch} from './PowerSearch';
|
|
15
|
-
export type {
|
|
15
|
+
export type {
|
|
16
|
+
PowerSearchPresentation,
|
|
17
|
+
PowerSearchProps,
|
|
18
|
+
PowerSearchSize,
|
|
19
|
+
} from './PowerSearch';
|
|
16
20
|
|
|
17
21
|
export {PowerSearchToken} from './PowerSearchToken';
|
|
18
22
|
export {PowerSearchFilterEditor} from './PowerSearchFilterEditor';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file powerSearchDateZone.ts
|
|
5
|
+
* @input A `date_absolute` or range part's `unixSeconds`, the operator's
|
|
6
|
+
* `isDateOnly`, and the PowerSearch `timezoneID`
|
|
7
|
+
* @output The one zone every reading of such a value uses, and the
|
|
8
|
+
* conversions between an instant and the calendar day or wall-clock time
|
|
9
|
+
* shown in that zone
|
|
10
|
+
* @position Shared by the token text, the accessible label, and the value
|
|
11
|
+
* editors, so a value reads as the same day everywhere in one field
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type {ISODateString} from '../utils/dateTypes';
|
|
15
|
+
import type {ISODateTimeString} from '../DateTimeInput/DateTimeInput';
|
|
16
|
+
import {
|
|
17
|
+
getWallClock,
|
|
18
|
+
plainDateFromDate,
|
|
19
|
+
plainDateFromInstant,
|
|
20
|
+
plainDateFromISO,
|
|
21
|
+
plainDateToDate,
|
|
22
|
+
plainDateToInstant,
|
|
23
|
+
plainDateToISO,
|
|
24
|
+
} from '../utils/plainDate';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The zone a date value is read and written in. A calendar day is stored as
|
|
28
|
+
* midnight in `timezoneID`. With no `timezoneID` the day is the UTC day, so
|
|
29
|
+
* a value written before a zone was given keeps its day. A value with a time
|
|
30
|
+
* of day shows in `timezoneID`, else in the viewer's zone. `undefined` names
|
|
31
|
+
* the viewer's zone, because `Intl` and `Date` default to it.
|
|
32
|
+
*/
|
|
33
|
+
export function resolveDateZone(
|
|
34
|
+
timezoneID: string | undefined,
|
|
35
|
+
isDateOnly: boolean,
|
|
36
|
+
): string | undefined {
|
|
37
|
+
// An empty string is no zone, as the formatter always read it.
|
|
38
|
+
if (timezoneID) {
|
|
39
|
+
return timezoneID;
|
|
40
|
+
}
|
|
41
|
+
return isDateOnly ? 'UTC' : undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const pad = (n: number, width = 2) => String(n).padStart(width, '0');
|
|
45
|
+
|
|
46
|
+
export function unixSecondsToISODate(
|
|
47
|
+
unixSeconds: number,
|
|
48
|
+
zone: string | undefined,
|
|
49
|
+
): ISODateString {
|
|
50
|
+
const instant = unixSeconds * 1000;
|
|
51
|
+
|
|
52
|
+
return plainDateToISO(
|
|
53
|
+
zone == null
|
|
54
|
+
? plainDateFromDate(new Date(instant))
|
|
55
|
+
: plainDateFromInstant(instant, zone),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function isoDateToUnixSeconds(
|
|
60
|
+
date: ISODateString,
|
|
61
|
+
zone: string | undefined,
|
|
62
|
+
): number {
|
|
63
|
+
const plain = plainDateFromISO(date);
|
|
64
|
+
const instant =
|
|
65
|
+
zone == null
|
|
66
|
+
? plainDateToDate(plain).getTime()
|
|
67
|
+
: plainDateToInstant(plain, zone);
|
|
68
|
+
return Math.floor(instant / 1000);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function unixSecondsToISODateTime(
|
|
72
|
+
unixSeconds: number,
|
|
73
|
+
zone: string | undefined,
|
|
74
|
+
): ISODateTimeString {
|
|
75
|
+
const w = getWallClock(new Date(unixSeconds * 1000), zone);
|
|
76
|
+
return `${pad(w.year, 4)}-${pad(w.month)}-${pad(w.day)}T${pad(w.hour)}:${pad(w.minute)}` as ISODateTimeString;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function isoDateTimeToUnixSeconds(
|
|
80
|
+
value: ISODateTimeString,
|
|
81
|
+
zone: string | undefined,
|
|
82
|
+
): number {
|
|
83
|
+
const [datePart, timePart = '00:00'] = value.split('T');
|
|
84
|
+
const [hour = 0, minute = 0] = timePart.split(':').map(Number);
|
|
85
|
+
const plain = plainDateFromISO(datePart as ISODateString);
|
|
86
|
+
let instant: number;
|
|
87
|
+
if (zone == null) {
|
|
88
|
+
const d = plainDateToDate(plain);
|
|
89
|
+
d.setHours(hour, minute, 0, 0);
|
|
90
|
+
instant = d.getTime();
|
|
91
|
+
} else {
|
|
92
|
+
instant = plainDateToInstant(plain, zone, hour, minute);
|
|
93
|
+
}
|
|
94
|
+
return Math.floor(instant / 1000);
|
|
95
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file powerSearchSheetUtils.ts
|
|
5
|
+
* @input PowerSearch config/filter types and the field typeahead source
|
|
6
|
+
* @output Pure helpers for the sheet presentation: which operators the
|
|
7
|
+
* sheet's own controls edit, field matching, filter identity tracking
|
|
8
|
+
* across controlled re-renders, the focus target after a removal, and the
|
|
9
|
+
* content search's suggestion source over the field typeahead
|
|
10
|
+
* @position Helper module; consumed by PowerSearchBottomSheet.tsx and its
|
|
11
|
+
* tests
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type {SearchSource} from '../Typeahead/types';
|
|
15
|
+
import type {InternalConfig} from './useInternalConfig';
|
|
16
|
+
import type {
|
|
17
|
+
PowerSearchField,
|
|
18
|
+
PowerSearchFilter,
|
|
19
|
+
PowerSearchItem,
|
|
20
|
+
PowerSearchOperator,
|
|
21
|
+
} from './types';
|
|
22
|
+
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Operators and fields
|
|
25
|
+
// =============================================================================
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether the value step edits an operator's value with a sheet-native
|
|
29
|
+
* control (choice rows, or the popover's editor in its sheet presentation).
|
|
30
|
+
* A `nested` value is the exception: it is edited by the popover's built-in
|
|
31
|
+
* NestedEditor, rendered in the step's body,
|
|
32
|
+
* so every operator opens an editable step and no field is left out.
|
|
33
|
+
*/
|
|
34
|
+
export function isSupportedOperator(operator: PowerSearchOperator): boolean {
|
|
35
|
+
return operator.value.type !== 'nested';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function fieldMatchesQuery(
|
|
39
|
+
field: PowerSearchField,
|
|
40
|
+
normalizedQuery: string,
|
|
41
|
+
): boolean {
|
|
42
|
+
if (normalizedQuery === '') {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (field.label.toLowerCase().includes(normalizedQuery)) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return (
|
|
49
|
+
field.typeaheadAliases?.some(alias =>
|
|
50
|
+
alias.toLowerCase().includes(normalizedQuery),
|
|
51
|
+
) ?? false
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Synchronous suggestion source; the sheet renders results inline. */
|
|
56
|
+
export interface SheetSuggestionSource {
|
|
57
|
+
search(query: string): PowerSearchItem[];
|
|
58
|
+
bootstrap(): PowerSearchItem[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The field typeahead source as the content search's rows: the popover
|
|
63
|
+
* presentation's own suggestions, minus any whose field the config no longer
|
|
64
|
+
* knows. That source resolves synchronously from the config; a promise (none
|
|
65
|
+
* today) yields no rows rather than a stale list.
|
|
66
|
+
*/
|
|
67
|
+
export function createSheetSuggestionSource(
|
|
68
|
+
config: InternalConfig,
|
|
69
|
+
source: SearchSource<PowerSearchItem>,
|
|
70
|
+
): SheetSuggestionSource {
|
|
71
|
+
// Every suggestion whose field the config knows is offered: the value step
|
|
72
|
+
// edits every operator, `nested` included.
|
|
73
|
+
const isEditable = (item: PowerSearchItem): boolean => {
|
|
74
|
+
const aux = item.auxiliaryData;
|
|
75
|
+
return aux != null && config.getField(aux.fieldKey) != null;
|
|
76
|
+
};
|
|
77
|
+
const settle = (
|
|
78
|
+
results: PowerSearchItem[] | Promise<PowerSearchItem[]>,
|
|
79
|
+
): PowerSearchItem[] =>
|
|
80
|
+
Array.isArray(results) ? results.filter(isEditable) : [];
|
|
81
|
+
return {
|
|
82
|
+
search: query => settle(source.search(query)),
|
|
83
|
+
bootstrap: () => settle(source.bootstrap()),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// =============================================================================
|
|
88
|
+
// Filter identity across controlled updates
|
|
89
|
+
// =============================================================================
|
|
90
|
+
|
|
91
|
+
function stableSerialize(value: unknown): string {
|
|
92
|
+
if (Array.isArray(value)) {
|
|
93
|
+
return `[${value.map(stableSerialize).join(',')}]`;
|
|
94
|
+
}
|
|
95
|
+
if (value != null && typeof value === 'object') {
|
|
96
|
+
return `{${Object.entries(value)
|
|
97
|
+
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
98
|
+
.map(([key, entry]) => `${JSON.stringify(key)}:${stableSerialize(entry)}`)
|
|
99
|
+
.join(',')}}`;
|
|
100
|
+
}
|
|
101
|
+
return JSON.stringify(value) ?? 'undefined';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Stable identities for the Filters rows across controlled updates, so a row
|
|
106
|
+
* keeps its element — and its focus — when the parent reorders the filters or
|
|
107
|
+
* removes one above it. A filter object seen before keeps its
|
|
108
|
+
* id; a new object takes the id of a filter from the previous update with the
|
|
109
|
+
* same signature that no present object claims (a parent that clones its
|
|
110
|
+
* values on every change); anything else mints a new id. Two equal filters
|
|
111
|
+
* are told apart by order. Call `next` once per render with the current list.
|
|
112
|
+
*/
|
|
113
|
+
export function createFilterIdentities(): {
|
|
114
|
+
next: (filters: ReadonlyArray<PowerSearchFilter>) => number[];
|
|
115
|
+
} {
|
|
116
|
+
const byObject = new WeakMap<PowerSearchFilter, number>();
|
|
117
|
+
let previousBySignature = new Map<string, number[]>();
|
|
118
|
+
let nextId = 0;
|
|
119
|
+
return {
|
|
120
|
+
next(filters) {
|
|
121
|
+
const used = new Set<number>();
|
|
122
|
+
const ids: (number | null)[] = filters.map(filter => {
|
|
123
|
+
const known = byObject.get(filter);
|
|
124
|
+
if (known == null || used.has(known)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
used.add(known);
|
|
128
|
+
return known;
|
|
129
|
+
});
|
|
130
|
+
const bySignature = new Map<string, number[]>();
|
|
131
|
+
filters.forEach((filter, index) => {
|
|
132
|
+
const signature = filterSignature(filter);
|
|
133
|
+
let id = ids[index];
|
|
134
|
+
if (id == null) {
|
|
135
|
+
id =
|
|
136
|
+
previousBySignature
|
|
137
|
+
.get(signature)
|
|
138
|
+
?.find(candidate => !used.has(candidate)) ?? nextId++;
|
|
139
|
+
used.add(id);
|
|
140
|
+
byObject.set(filter, id);
|
|
141
|
+
ids[index] = id;
|
|
142
|
+
}
|
|
143
|
+
bySignature.set(signature, [...(bySignature.get(signature) ?? []), id]);
|
|
144
|
+
});
|
|
145
|
+
previousBySignature = bySignature;
|
|
146
|
+
return ids as number[];
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Structural snapshot of a filter, for parents that clone their values. */
|
|
152
|
+
export function filterSignature(filter: PowerSearchFilter): string {
|
|
153
|
+
return stableSerialize({
|
|
154
|
+
field: filter.field,
|
|
155
|
+
operator: filter.operator,
|
|
156
|
+
value: filter.value,
|
|
157
|
+
isReadOnly: filter.isReadOnly ?? false,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Finds the filter a step was opened on after the controlled parent may have
|
|
163
|
+
* reordered, cloned, or removed it: object identity first, then the original
|
|
164
|
+
* slot when it still holds a structurally equal filter, then a unique
|
|
165
|
+
* structural match anywhere. Returns null when the target is gone or
|
|
166
|
+
* ambiguous, so an edit never lands on a different filter.
|
|
167
|
+
*/
|
|
168
|
+
export function resolveFilterIdentityIndex(
|
|
169
|
+
filters: ReadonlyArray<PowerSearchFilter>,
|
|
170
|
+
sourceFilter: PowerSearchFilter,
|
|
171
|
+
sourceSignature: string,
|
|
172
|
+
preferredIndex: number,
|
|
173
|
+
): number | null {
|
|
174
|
+
const identityIndex = filters.indexOf(sourceFilter);
|
|
175
|
+
if (identityIndex >= 0) {
|
|
176
|
+
return identityIndex;
|
|
177
|
+
}
|
|
178
|
+
if (
|
|
179
|
+
filters[preferredIndex] != null &&
|
|
180
|
+
filterSignature(filters[preferredIndex]) === sourceSignature
|
|
181
|
+
) {
|
|
182
|
+
return preferredIndex;
|
|
183
|
+
}
|
|
184
|
+
const matchingIndices = filters.flatMap((filter, index) =>
|
|
185
|
+
filterSignature(filter) === sourceSignature ? [index] : [],
|
|
186
|
+
);
|
|
187
|
+
return matchingIndices.length === 1 ? matchingIndices[0] : null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* After removing the filter at `removedIndex`, focus should land on the
|
|
192
|
+
* nearest remaining row that is a button, preferring the one after it.
|
|
193
|
+
* `isRowButton` is the Filters sheet's own rule for which rows are buttons:
|
|
194
|
+
* the field interactive and the filter not read-only (a `nested` or stale
|
|
195
|
+
* filter's row is a button too).
|
|
196
|
+
*/
|
|
197
|
+
export function nearestEditableIndex(
|
|
198
|
+
nextFilters: ReadonlyArray<PowerSearchFilter>,
|
|
199
|
+
removedIndex: number,
|
|
200
|
+
isRowButton: (filter: PowerSearchFilter) => boolean = filter =>
|
|
201
|
+
!filter.isReadOnly,
|
|
202
|
+
): number | undefined {
|
|
203
|
+
const editableIndices = nextFilters.flatMap((candidate, candidateIndex) =>
|
|
204
|
+
isRowButton(candidate) ? [candidateIndex] : [],
|
|
205
|
+
);
|
|
206
|
+
return editableIndices.reduce<number | undefined>((nearest, candidate) => {
|
|
207
|
+
if (nearest == null) {
|
|
208
|
+
return candidate;
|
|
209
|
+
}
|
|
210
|
+
const candidateDistance = Math.abs(candidate - removedIndex);
|
|
211
|
+
const nearestDistance = Math.abs(nearest - removedIndex);
|
|
212
|
+
if (candidateDistance < nearestDistance) {
|
|
213
|
+
return candidate;
|
|
214
|
+
}
|
|
215
|
+
if (
|
|
216
|
+
candidateDistance === nearestDistance &&
|
|
217
|
+
candidate >= removedIndex &&
|
|
218
|
+
nearest < removedIndex
|
|
219
|
+
) {
|
|
220
|
+
return candidate;
|
|
221
|
+
}
|
|
222
|
+
return nearest;
|
|
223
|
+
}, undefined);
|
|
224
|
+
}
|
package/src/PowerSearch/types.ts
CHANGED
|
@@ -61,7 +61,12 @@ export interface TimeOperatorValue {
|
|
|
61
61
|
|
|
62
62
|
export interface DateAbsoluteOperatorValue {
|
|
63
63
|
readonly type: 'date_absolute';
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* True or unset: the value is a calendar day, edited with a date picker.
|
|
66
|
+
* False: the value is an instant with a time of day, edited with a date
|
|
67
|
+
* picker and a time field and shown with its time in `timezoneID`, else
|
|
68
|
+
* the viewer's zone.
|
|
69
|
+
*/
|
|
65
70
|
readonly isDateOnly?: boolean;
|
|
66
71
|
}
|
|
67
72
|
|
|
@@ -407,6 +412,8 @@ export interface PowerSearchTokenProps {
|
|
|
407
412
|
readonly onClick?: () => void;
|
|
408
413
|
readonly onRemove?: () => void;
|
|
409
414
|
readonly isDisabled?: boolean;
|
|
415
|
+
/** The zone the field reads date values in; see PowerSearch `timezoneID`. */
|
|
416
|
+
readonly timezoneID?: string;
|
|
410
417
|
}
|
|
411
418
|
|
|
412
419
|
/**
|
|
@@ -75,6 +75,8 @@ export function useProgressBarTouch(
|
|
|
75
75
|
const watchesTrack = isTouch && hasMarks;
|
|
76
76
|
const trackRef = useRef<HTMLDivElement | null>(null);
|
|
77
77
|
const [trackWidth, setTrackWidth] = useState(0);
|
|
78
|
+
// Syncs the shared resize observer with the track while the track width is
|
|
79
|
+
// needed.
|
|
78
80
|
useEffect(() => {
|
|
79
81
|
const element = trackRef.current;
|
|
80
82
|
if (!watchesTrack || element == null) {
|