@astryxdesign/core 0.7.7 → 0.7.8-canary.30b1896
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +46 -6
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +5 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +1 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +25 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
- package/dist/BottomSheet/useMobileKeyboard.js +6 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +15 -16
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +4 -0
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +2 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useChatDictation.js +2 -0
- package/dist/Chat/useChatNewMessages.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +2 -0
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +3 -0
- package/dist/Chat/useTriggerMenu.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +17 -12
- package/dist/CodeBlock/CodeBlock.d.ts +10 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +28 -11
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +2 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +5 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +1 -0
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +4 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -1
- package/dist/DateInput/useOwnScrollGesture.js +3 -0
- 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/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +9 -32
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +3 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +5 -0
- package/dist/Field/Field.js +2 -2
- package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts.map +1 -1
- package/dist/FieldStatus/useFieldStatusAnnouncement.js +1 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -1
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts +6 -4
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +48 -3
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +20 -33
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/Item/useSwipeAction.d.ts.map +1 -1
- package/dist/Item/useSwipeAction.js +3 -0
- package/dist/Layer/modalOutlet.d.ts.map +1 -1
- package/dist/Layer/modalOutlet.js +2 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +1 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +3 -0
- package/dist/Layer/usePressPin.d.ts +17 -5
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +62 -12
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +3 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +19 -0
- package/dist/MobileNav/MobileNav.d.ts +3 -2
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +9 -25
- package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromDOM.js +3 -0
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +3 -0
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -0
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -0
- package/dist/PowerSearch/PowerSearch.d.ts +43 -4
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +445 -134
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +102 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1919 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +25 -6
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -2
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +193 -83
- package/dist/PowerSearch/formatFilterValue.d.ts +18 -6
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +33 -12
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +162 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts +21 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchDateZone.js +37 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/PowerSearch/types.d.ts +2 -0
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.js +2 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts +2 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +101 -77
- package/dist/Resizable/createResizable.d.ts +145 -0
- package/dist/Resizable/createResizable.d.ts.map +1 -0
- package/dist/Resizable/createResizable.js +575 -0
- package/dist/Resizable/useResizable.d.ts +3 -3
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +252 -459
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +2 -0
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +36 -11
- package/dist/SelectableCard/selectableCardInput.d.ts +12 -0
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -0
- package/dist/SelectableCard/selectableCardInput.js +20 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -8
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +60 -58
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +3 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +4 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +2 -0
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +2 -0
- package/dist/Timestamp/Timestamp.js +1 -1
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +97 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +1 -0
- package/dist/Tokenizer/Tokenizer.d.ts +49 -37
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +22 -19
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +19 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +34 -53
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +27 -18
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +36 -6
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
- package/dist/hooks/ModalAnnounceProvider.js +1 -0
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/longPressDetector.d.ts +66 -0
- package/dist/hooks/longPressDetector.d.ts.map +1 -0
- package/dist/hooks/longPressDetector.js +200 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/rootScrollStyles.d.ts +48 -0
- package/dist/hooks/rootScrollStyles.d.ts.map +1 -0
- package/dist/hooks/rootScrollStyles.js +207 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts +13 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts.map +1 -0
- package/dist/hooks/scrollLockTouchGuard.js +134 -0
- package/dist/hooks/scrollbarGutter.d.ts +4 -4
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -1
- package/dist/hooks/scrollbarGutter.js +36 -23
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +1 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -1
- package/dist/hooks/useAutoMediaMode.js +1 -0
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +2 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -1
- package/dist/hooks/useDevWarning.js +2 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -0
- package/dist/hooks/useGridFocus.d.ts +8 -5
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +4 -3
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -0
- package/dist/hooks/useImageMode.d.ts.map +1 -1
- package/dist/hooks/useImageMode.js +3 -0
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useKeyboardHint.js +1 -1
- package/dist/hooks/useLongPress.d.ts +8 -9
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +23 -106
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +2 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +3 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +2 -1
- package/dist/hooks/usePressFeedback.d.ts.map +1 -1
- package/dist/hooks/usePressFeedback.js +1 -0
- package/dist/hooks/useResolvedRequired.d.ts +3 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +3 -0
- package/dist/hooks/useScrollLock.d.ts +7 -9
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +55 -48
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +5 -0
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +3 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/internal/selectable-card.d.ts +21 -0
- package/dist/internal/selectable-card.d.ts.map +1 -0
- package/dist/internal/selectable-card.js +20 -0
- package/dist/internal/sheetDraft.d.ts +2 -2
- package/dist/internal/sheetDraft.js +2 -2
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +7 -7
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +45 -20
- package/dist/motion/progress.d.ts +88 -0
- package/dist/motion/progress.d.ts.map +1 -0
- package/dist/motion/progress.js +128 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +3 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +22 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +36 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts +23 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/reducedMotion.stylex.js +40 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +29 -4
- package/dist/theme/motionKnobs.d.ts +4 -3
- package/dist/theme/motionKnobs.d.ts.map +1 -1
- package/dist/theme/motionKnobs.js +3 -2
- package/dist/theme/themeMotion.d.ts +6 -0
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +7 -0
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/focusReturn.d.ts +15 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +28 -0
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +4 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/plainDate.d.ts +8 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +19 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +14 -9
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +46 -5
- package/src/AppShell/AppShell.tsx +4 -0
- package/src/BottomSheet/BottomSheet.tsx +1 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +39 -3
- package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
- package/src/BottomSheet/useMobileKeyboard.ts +4 -0
- package/src/BottomSheet/useSheetGestures.ts +10 -1
- package/src/Button/Button.tsx +26 -4
- package/src/Calendar/Calendar.tsx +36 -25
- package/src/Carousel/Carousel.tsx +1 -0
- package/src/Chat/ChatComposerInput.tsx +2 -0
- package/src/Chat/ChatMessageList.tsx +2 -1
- package/src/Chat/useChatDictation.ts +1 -0
- package/src/Chat/useChatNewMessages.ts +1 -1
- package/src/Chat/useChatStreamScroll.ts +2 -0
- package/src/Chat/useSpeechRecognition.ts +2 -0
- package/src/Chat/useTriggerMenu.tsx +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +38 -15
- package/src/CodeBlock/CodeBlock.doc.mjs +9 -1
- package/src/CodeBlock/CodeBlock.tsx +41 -4
- package/src/CommandPalette/CommandPalette.tsx +1 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/MonthScroller.tsx +8 -2
- package/src/DateInput/TouchDateField.tsx +1 -0
- package/src/DateInput/Wheel.tsx +4 -0
- package/src/DateInput/useOwnScrollGesture.ts +2 -0
- package/src/DateInput/usePointerDragScroll.ts +1 -0
- package/src/DateInput/useScrollSettle.ts +2 -0
- package/src/Dialog/Dialog.tsx +12 -32
- package/src/Drawer/useDrawerDialogPresence.ts +2 -0
- package/src/DropdownMenu/useMenuOverflow.ts +3 -0
- package/src/Field/Field.tsx +2 -2
- package/src/FieldStatus/useFieldStatusAnnouncement.ts +1 -0
- package/src/FormLayout/FormLayout.doc.mjs +181 -46
- package/src/FormLayout/FormLayout.tsx +5 -1
- package/src/HoverCard/HoverCard.doc.mjs +10 -8
- package/src/HoverCard/HoverCard.tsx +58 -6
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +49 -54
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/IconButton/IconButton.doc.mjs +141 -21
- package/src/Item/useSwipeAction.ts +2 -0
- package/src/Layer/modalOutlet.ts +2 -0
- package/src/Layer/outsidePress.ts +1 -0
- package/src/Layer/useLayer.tsx +2 -0
- package/src/Layer/useLayerDismissal.ts +2 -0
- package/src/Layer/usePressPin.ts +81 -15
- package/src/Layer/useTouchTrigger.ts +2 -0
- package/src/Lightbox/Lightbox.tsx +19 -0
- package/src/MobileNav/MobileNav.tsx +9 -30
- package/src/Outline/useOutlineFromDOM.ts +2 -0
- package/src/Outline/useScrollSpy.ts +2 -0
- package/src/OverflowList/OverflowList.tsx +2 -0
- package/src/Popover/Popover.tsx +4 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +60 -8
- package/src/PowerSearch/PowerSearch.tsx +627 -157
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2525 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +39 -6
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +2 -0
- package/src/PowerSearch/PowerSearchToken.tsx +7 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +244 -58
- package/src/PowerSearch/formatFilterValue.ts +55 -17
- package/src/PowerSearch/formatTokenValue.ts +222 -0
- package/src/PowerSearch/powerSearchDateZone.ts +64 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/PowerSearch/types.ts +2 -0
- package/src/ProgressBar/ProgressBarTouch.ts +2 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/Resizable.doc.mjs +5 -4
- package/src/Resizable/ResizeHandle.tsx +169 -109
- package/src/Resizable/createResizable.ts +831 -0
- package/src/Resizable/useResizable.ts +292 -623
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/SelectableCard/SelectableCard.tsx +39 -10
- package/src/SelectableCard/selectableCardInput.ts +30 -0
- package/src/Selector/Selector.tsx +5 -12
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/Switch.tsx +2 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +1 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/TimeInput/TimeInput.tsx +2 -0
- package/src/Timer/Timer.tsx +1 -0
- package/src/Timestamp/Timestamp.tsx +1 -1
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +123 -35
- package/src/Toast/types.ts +9 -3
- package/src/Toast/useToast.tsx +1 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +19 -3
- package/src/Tokenizer/Tokenizer.tsx +73 -51
- package/src/Tokenizer/TokenizerBottomSheet.tsx +1 -1
- package/src/Tokenizer/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +61 -56
- package/src/Typeahead/BaseTypeahead.tsx +27 -17
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +10 -4
- package/src/hooks/ModalAnnounceProvider.tsx +1 -0
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/longPressDetector.ts +273 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/rootScrollStyles.ts +247 -0
- package/src/hooks/scrollLockTouchGuard.ts +182 -0
- package/src/hooks/scrollbarGutter.ts +41 -26
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAnnounceRenderedText.ts +1 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useAutoMediaMode.ts +1 -0
- package/src/hooks/useBusyAnnouncement.ts +2 -0
- package/src/hooks/useDevWarning.ts +2 -0
- package/src/hooks/useFocusTrap.ts +2 -0
- package/src/hooks/useGridFocus.doc.mjs +6 -6
- package/src/hooks/useGridFocus.ts +10 -7
- package/src/hooks/useHotkeys.ts +2 -0
- package/src/hooks/useImageMode.ts +2 -0
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useKeyboardHint.tsx +1 -1
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +32 -122
- package/src/hooks/useMenuHover.ts +1 -0
- package/src/hooks/useMenuPress.ts +2 -0
- package/src/hooks/useOverflow.ts +2 -1
- package/src/hooks/usePressFeedback.ts +1 -0
- package/src/hooks/useResolvedRequired.ts +3 -0
- package/src/hooks/useScrollLock.doc.mjs +51 -12
- package/src/hooks/useScrollLock.ts +57 -60
- package/src/hooks/useScrollableArea.ts +4 -0
- package/src/hooks/useStreamingText.ts +2 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/selectable-card.ts +21 -0
- package/src/internal/sheetDraft.ts +2 -2
- package/src/motion/README.md +9 -5
- package/src/motion/animatedLayout.ts +10 -5
- package/src/motion/animator.ts +66 -31
- package/src/motion/progress.ts +155 -0
- package/src/motion/reducedMotion.ts +3 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +44 -0
- package/src/privateAttributes/reducedMotion.stylex.ts +45 -0
- package/src/theme/Theme.tsx +37 -3
- package/src/theme/motionKnobs.ts +4 -3
- package/src/theme/themeMotion.ts +7 -0
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionModality.ts +4 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/plainDate.ts +21 -0
- package/src/utils/pressFeedback.ts +24 -6
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/internal/touch-sheet.d.ts +0 -21
- package/dist/internal/touch-sheet.d.ts.map +0 -1
- package/dist/internal/touch-sheet.js +0 -19
- package/src/internal/touch-sheet.ts +0 -21
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file PowerSearchValueEditor.tsx
|
|
7
|
-
* @input OperatorValue, FilterValue, onChange callback
|
|
7
|
+
* @input OperatorValue, FilterValue, onChange callback, and the presentation
|
|
8
|
+
* the editor renders in
|
|
8
9
|
* @output Renders the appropriate editor for a filter value type
|
|
9
|
-
* @position Sub-component; consumed by PowerSearchEditPopover
|
|
10
|
+
* @position Sub-component; consumed by PowerSearchEditPopover (popover
|
|
11
|
+
* presentation) and PowerSearchBottomSheet (sheet presentation, which
|
|
12
|
+
* renders the closed vocabularies as rows itself)
|
|
10
13
|
*
|
|
11
14
|
* SYNC: When modified, update:
|
|
12
15
|
* - /packages/core/src/PowerSearch/index.ts
|
|
@@ -39,13 +42,19 @@ import {
|
|
|
39
42
|
type NumberInputCommitDecision,
|
|
40
43
|
} from '../NumberInput/numberInputCommit';
|
|
41
44
|
import {DateInput} from '../DateInput';
|
|
45
|
+
import {
|
|
46
|
+
isoDateToUnixSeconds,
|
|
47
|
+
resolveDateZone,
|
|
48
|
+
unixSecondsToISODate,
|
|
49
|
+
} from './powerSearchDateZone';
|
|
42
50
|
import {DateRangeInput, type DateRange} from '../DateRangeInput';
|
|
43
51
|
import {resolveDateTimeRangePart} from './resolveDateTimeRangePart';
|
|
44
52
|
import {TimeInput} from '../TimeInput';
|
|
45
53
|
import {Selector} from '../Selector';
|
|
46
|
-
import {Tokenizer} from '../Tokenizer';
|
|
54
|
+
import {Tokenizer} from '../Tokenizer/Tokenizer';
|
|
47
55
|
import {Typeahead} from '../Typeahead';
|
|
48
56
|
import {useLocale} from '../i18n';
|
|
57
|
+
import type {TranslatorFn} from '../i18n';
|
|
49
58
|
import {
|
|
50
59
|
registerEnglishFallback,
|
|
51
60
|
useComponentTranslator,
|
|
@@ -64,8 +73,30 @@ export interface PowerSearchValueEditorProps {
|
|
|
64
73
|
maxMenuItems?: number;
|
|
65
74
|
isDisabled?: boolean;
|
|
66
75
|
timezoneID?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Called when a staged value no longer stands — the number input's draft is
|
|
78
|
+
* empty or does not parse — so the sheet presentation's confirm action
|
|
79
|
+
* disables again. Only the `bottom-sheet` presentation stages as typed; the
|
|
80
|
+
* popover commits on blur or Enter and never calls this.
|
|
81
|
+
*/
|
|
82
|
+
onUnstage?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Where the editor renders. In the `bottom-sheet` presentation the inputs
|
|
85
|
+
* fill the sheet's width, number inputs stage every parseable keystroke
|
|
86
|
+
* (the sheet's footer confirms; there is no Enter-to-save), the date range
|
|
87
|
+
* shows one month, and list values open the Tokenizer's own sheet titled
|
|
88
|
+
* with `fieldLabel`.
|
|
89
|
+
* @default 'popover'
|
|
90
|
+
*/
|
|
91
|
+
presentation?: 'popover' | 'bottom-sheet';
|
|
92
|
+
/** The field's label; names the Tokenizer sheet in the sheet presentation. */
|
|
93
|
+
fieldLabel?: string;
|
|
67
94
|
}
|
|
68
95
|
|
|
96
|
+
type EditorPresentation = NonNullable<
|
|
97
|
+
PowerSearchValueEditorProps['presentation']
|
|
98
|
+
>;
|
|
99
|
+
|
|
69
100
|
// =============================================================================
|
|
70
101
|
// Helpers
|
|
71
102
|
// =============================================================================
|
|
@@ -96,10 +127,9 @@ function enumItemsToSearchableItems(
|
|
|
96
127
|
function dateRangePartToISO(
|
|
97
128
|
part: DateTimeRangePart,
|
|
98
129
|
nowSeconds: number,
|
|
130
|
+
zone: string | undefined,
|
|
99
131
|
): ISODateString {
|
|
100
|
-
return
|
|
101
|
-
.toISOString()
|
|
102
|
-
.split('T')[0] as ISODateString;
|
|
132
|
+
return unixSecondsToISODate(resolveDateTimeRangePart(part, nowSeconds), zone);
|
|
103
133
|
}
|
|
104
134
|
|
|
105
135
|
// =============================================================================
|
|
@@ -113,6 +143,7 @@ function StringEditor({
|
|
|
113
143
|
onEnter: _onEnter,
|
|
114
144
|
maxMenuItems,
|
|
115
145
|
isDisabled,
|
|
146
|
+
presentation,
|
|
116
147
|
}: {
|
|
117
148
|
operatorValue: OperatorValue & {type: 'string'};
|
|
118
149
|
filterValue: FilterValue | undefined;
|
|
@@ -120,8 +151,10 @@ function StringEditor({
|
|
|
120
151
|
onEnter?: () => void;
|
|
121
152
|
maxMenuItems?: number;
|
|
122
153
|
isDisabled?: boolean;
|
|
154
|
+
presentation: EditorPresentation;
|
|
123
155
|
}) {
|
|
124
156
|
const t = useComponentTranslator();
|
|
157
|
+
const width = presentation === 'bottom-sheet' ? '100%' : undefined;
|
|
125
158
|
const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
|
|
126
159
|
|
|
127
160
|
// When a searchSource is provided, render a typeahead instead of a plain
|
|
@@ -148,6 +181,7 @@ function StringEditor({
|
|
|
148
181
|
placeholder={t('@astryx.powersearch.valueEditor.searchPlaceholder')}
|
|
149
182
|
debounceMs={150}
|
|
150
183
|
maxMenuItems={maxMenuItems}
|
|
184
|
+
width={width}
|
|
151
185
|
/>
|
|
152
186
|
);
|
|
153
187
|
}
|
|
@@ -162,6 +196,7 @@ function StringEditor({
|
|
|
162
196
|
onChange={(value: string) => {
|
|
163
197
|
onChange({type: 'string', value});
|
|
164
198
|
}}
|
|
199
|
+
width={width}
|
|
165
200
|
/>
|
|
166
201
|
);
|
|
167
202
|
}
|
|
@@ -172,14 +207,19 @@ function StringListEditor({
|
|
|
172
207
|
onChange,
|
|
173
208
|
maxMenuItems,
|
|
174
209
|
isDisabled,
|
|
210
|
+
presentation,
|
|
211
|
+
fieldLabel,
|
|
175
212
|
}: {
|
|
176
213
|
operatorValue: OperatorValue & {type: 'string_list'};
|
|
177
214
|
filterValue: FilterValue | undefined;
|
|
178
215
|
onChange: (value: FilterValue) => void;
|
|
179
216
|
maxMenuItems?: number;
|
|
180
217
|
isDisabled?: boolean;
|
|
218
|
+
presentation: EditorPresentation;
|
|
219
|
+
fieldLabel?: string;
|
|
181
220
|
}) {
|
|
182
221
|
const t = useComponentTranslator();
|
|
222
|
+
const isSheet = presentation === 'bottom-sheet';
|
|
183
223
|
const currentValue: SearchableItem[] = useMemo(() => {
|
|
184
224
|
if (filterValue?.type !== 'string_list') {
|
|
185
225
|
return [];
|
|
@@ -203,9 +243,16 @@ function StringListEditor({
|
|
|
203
243
|
const hasCreate =
|
|
204
244
|
operatorValue.isArbitraryStringAllowed || !operatorValue.searchSource;
|
|
205
245
|
|
|
246
|
+
// In the sheet presentation the list value edits through the Tokenizer's
|
|
247
|
+
// own sheet, titled with the field's label; a popover menu inside a sheet
|
|
248
|
+
// would stack a second anchored layer on a surface the person is already in.
|
|
206
249
|
return (
|
|
207
250
|
<Tokenizer
|
|
208
|
-
label={
|
|
251
|
+
label={
|
|
252
|
+
isSheet && fieldLabel != null
|
|
253
|
+
? fieldLabel
|
|
254
|
+
: t('@astryx.powersearch.valueEditor.values')
|
|
255
|
+
}
|
|
209
256
|
isLabelHidden
|
|
210
257
|
isDisabled={isDisabled}
|
|
211
258
|
searchSource={source}
|
|
@@ -220,6 +267,8 @@ function StringListEditor({
|
|
|
220
267
|
debounceMs={operatorValue.searchSource ? 150 : 0}
|
|
221
268
|
hasCreate={hasCreate}
|
|
222
269
|
maxMenuItems={maxMenuItems}
|
|
270
|
+
width={isSheet ? '100%' : undefined}
|
|
271
|
+
presentation={isSheet ? 'bottom-sheet' : 'popover'}
|
|
223
272
|
/>
|
|
224
273
|
);
|
|
225
274
|
}
|
|
@@ -231,6 +280,8 @@ function useNumberEditorHandlers({
|
|
|
231
280
|
isIntegerOnly,
|
|
232
281
|
onChange,
|
|
233
282
|
onEnter,
|
|
283
|
+
onUnstage,
|
|
284
|
+
stagesAsTyped,
|
|
234
285
|
}: {
|
|
235
286
|
valueType: 'integer' | 'float';
|
|
236
287
|
min?: number;
|
|
@@ -238,6 +289,14 @@ function useNumberEditorHandlers({
|
|
|
238
289
|
isIntegerOnly: boolean;
|
|
239
290
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
240
291
|
onEnter?: () => void;
|
|
292
|
+
onUnstage?: () => void;
|
|
293
|
+
/**
|
|
294
|
+
* Stage every keystroke the input would commit, and unstage when the draft
|
|
295
|
+
* stops parsing. The sheet presentation confirms from its footer, so the
|
|
296
|
+
* confirm action must enable while the person is still typing and disable
|
|
297
|
+
* again over an empty field; the popover commits on blur or Enter.
|
|
298
|
+
*/
|
|
299
|
+
stagesAsTyped: boolean;
|
|
241
300
|
}) {
|
|
242
301
|
const locale = useLocale();
|
|
243
302
|
const pendingDecisionRef = useRef<NumberInputCommitDecision | null>(null);
|
|
@@ -259,12 +318,30 @@ function useNumberEditorHandlers({
|
|
|
259
318
|
}, []);
|
|
260
319
|
const handleInput = useCallback(
|
|
261
320
|
(event: FormEvent<HTMLElement>) => {
|
|
262
|
-
|
|
321
|
+
const decision = resolveNumberInputCommit(
|
|
263
322
|
(event.currentTarget as HTMLInputElement).value,
|
|
264
323
|
{min, max, isIntegerOnly, locale, hasClear: false},
|
|
265
324
|
);
|
|
325
|
+
pendingDecisionRef.current = decision;
|
|
326
|
+
if (stagesAsTyped) {
|
|
327
|
+
if (decision.type === 'commit') {
|
|
328
|
+
onChange(toFilterValue(decision.value));
|
|
329
|
+
} else {
|
|
330
|
+
// Cleared, or not a number: nothing stands to confirm.
|
|
331
|
+
onUnstage?.();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
266
334
|
},
|
|
267
|
-
[
|
|
335
|
+
[
|
|
336
|
+
isIntegerOnly,
|
|
337
|
+
locale,
|
|
338
|
+
max,
|
|
339
|
+
min,
|
|
340
|
+
onChange,
|
|
341
|
+
onUnstage,
|
|
342
|
+
stagesAsTyped,
|
|
343
|
+
toFilterValue,
|
|
344
|
+
],
|
|
268
345
|
);
|
|
269
346
|
const handleEnter = useCallback(() => {
|
|
270
347
|
const decision = pendingDecisionRef.current;
|
|
@@ -292,13 +369,17 @@ function IntegerEditor({
|
|
|
292
369
|
filterValue,
|
|
293
370
|
onChange,
|
|
294
371
|
onEnter,
|
|
372
|
+
onUnstage,
|
|
295
373
|
isDisabled,
|
|
374
|
+
presentation,
|
|
296
375
|
}: {
|
|
297
376
|
operatorValue: OperatorValue & {type: 'integer'};
|
|
298
377
|
filterValue: FilterValue | undefined;
|
|
299
378
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
300
379
|
onEnter?: () => void;
|
|
380
|
+
onUnstage?: () => void;
|
|
301
381
|
isDisabled?: boolean;
|
|
382
|
+
presentation: EditorPresentation;
|
|
302
383
|
}) {
|
|
303
384
|
const t = useComponentTranslator();
|
|
304
385
|
const currentValue =
|
|
@@ -310,6 +391,8 @@ function IntegerEditor({
|
|
|
310
391
|
isIntegerOnly: true,
|
|
311
392
|
onChange,
|
|
312
393
|
onEnter,
|
|
394
|
+
onUnstage,
|
|
395
|
+
stagesAsTyped: presentation === 'bottom-sheet',
|
|
313
396
|
});
|
|
314
397
|
|
|
315
398
|
return (
|
|
@@ -328,6 +411,7 @@ function IntegerEditor({
|
|
|
328
411
|
units={operatorValue.units}
|
|
329
412
|
isIntegerOnly
|
|
330
413
|
placeholder={t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')}
|
|
414
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
331
415
|
/>
|
|
332
416
|
);
|
|
333
417
|
}
|
|
@@ -337,13 +421,17 @@ function FloatEditor({
|
|
|
337
421
|
filterValue,
|
|
338
422
|
onChange,
|
|
339
423
|
onEnter,
|
|
424
|
+
onUnstage,
|
|
340
425
|
isDisabled,
|
|
426
|
+
presentation,
|
|
341
427
|
}: {
|
|
342
428
|
operatorValue: OperatorValue & {type: 'float'};
|
|
343
429
|
filterValue: FilterValue | undefined;
|
|
344
430
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
345
431
|
onEnter?: () => void;
|
|
432
|
+
onUnstage?: () => void;
|
|
346
433
|
isDisabled?: boolean;
|
|
434
|
+
presentation: EditorPresentation;
|
|
347
435
|
}) {
|
|
348
436
|
const t = useComponentTranslator();
|
|
349
437
|
const currentValue =
|
|
@@ -355,6 +443,8 @@ function FloatEditor({
|
|
|
355
443
|
isIntegerOnly: false,
|
|
356
444
|
onChange,
|
|
357
445
|
onEnter,
|
|
446
|
+
onUnstage,
|
|
447
|
+
stagesAsTyped: presentation === 'bottom-sheet',
|
|
358
448
|
});
|
|
359
449
|
|
|
360
450
|
return (
|
|
@@ -372,6 +462,7 @@ function FloatEditor({
|
|
|
372
462
|
max={operatorValue.maxValue}
|
|
373
463
|
units={operatorValue.units}
|
|
374
464
|
placeholder={t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')}
|
|
465
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
375
466
|
/>
|
|
376
467
|
);
|
|
377
468
|
}
|
|
@@ -381,11 +472,13 @@ function TimeEditor({
|
|
|
381
472
|
filterValue,
|
|
382
473
|
onChange,
|
|
383
474
|
isDisabled,
|
|
475
|
+
presentation,
|
|
384
476
|
}: {
|
|
385
477
|
operatorValue: OperatorValue & {type: 'time'};
|
|
386
478
|
filterValue: FilterValue | undefined;
|
|
387
479
|
onChange: (value: FilterValue) => void;
|
|
388
480
|
isDisabled?: boolean;
|
|
481
|
+
presentation: EditorPresentation;
|
|
389
482
|
}) {
|
|
390
483
|
const t = useComponentTranslator();
|
|
391
484
|
const currentValue =
|
|
@@ -406,46 +499,117 @@ function TimeEditor({
|
|
|
406
499
|
}}
|
|
407
500
|
min={operatorValue.minValue as ISOTimeString | undefined}
|
|
408
501
|
max={operatorValue.maxValue as ISOTimeString | undefined}
|
|
502
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
409
503
|
/>
|
|
410
504
|
);
|
|
411
505
|
}
|
|
412
506
|
|
|
413
507
|
function DateAbsoluteEditor({
|
|
508
|
+
operatorValue,
|
|
414
509
|
filterValue,
|
|
415
510
|
onChange,
|
|
416
511
|
isDisabled,
|
|
512
|
+
presentation,
|
|
513
|
+
timezoneID,
|
|
417
514
|
}: {
|
|
418
515
|
operatorValue: OperatorValue & {type: 'date_absolute'};
|
|
419
516
|
filterValue: FilterValue | undefined;
|
|
420
517
|
onChange: (value: FilterValue) => void;
|
|
421
518
|
isDisabled?: boolean;
|
|
519
|
+
presentation: EditorPresentation;
|
|
520
|
+
timezoneID?: string;
|
|
422
521
|
}) {
|
|
423
522
|
const t = useComponentTranslator();
|
|
424
|
-
//
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
523
|
+
// A date-only value edits in the zone the token and the label use. An
|
|
524
|
+
// `isDateOnly: false` value edits its UTC day.
|
|
525
|
+
const zone =
|
|
526
|
+
operatorValue.isDateOnly === false
|
|
527
|
+
? 'UTC'
|
|
528
|
+
: resolveDateZone(timezoneID, true);
|
|
529
|
+
const unixSeconds =
|
|
530
|
+
filterValue?.type === 'date_absolute' ? filterValue.unixSeconds : undefined;
|
|
432
531
|
|
|
433
532
|
return (
|
|
434
533
|
<DateInput
|
|
435
534
|
label={t('@astryx.powersearch.valueEditor.date')}
|
|
436
535
|
isLabelHidden
|
|
437
536
|
isDisabled={isDisabled}
|
|
438
|
-
value={
|
|
537
|
+
value={
|
|
538
|
+
unixSeconds == null
|
|
539
|
+
? undefined
|
|
540
|
+
: unixSecondsToISODate(unixSeconds, zone)
|
|
541
|
+
}
|
|
439
542
|
onChange={value => {
|
|
440
543
|
if (value != null) {
|
|
441
|
-
|
|
442
|
-
|
|
544
|
+
onChange({
|
|
545
|
+
type: 'date_absolute',
|
|
546
|
+
unixSeconds: isoDateToUnixSeconds(value, zone),
|
|
547
|
+
});
|
|
443
548
|
}
|
|
444
549
|
}}
|
|
550
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
445
551
|
/>
|
|
446
552
|
);
|
|
447
553
|
}
|
|
448
554
|
|
|
555
|
+
const RELATIVE_DATE_UNITS = [
|
|
556
|
+
{
|
|
557
|
+
unit: 'day',
|
|
558
|
+
plural: 'days',
|
|
559
|
+
amounts: [1, 3, 7, 14, 30],
|
|
560
|
+
ago: '@astryx.powersearch.sheet.relativeDaysAgo',
|
|
561
|
+
fromNow: '@astryx.powersearch.sheet.relativeDaysFromNow',
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
unit: 'week',
|
|
565
|
+
plural: 'weeks',
|
|
566
|
+
amounts: [1, 2, 4],
|
|
567
|
+
ago: '@astryx.powersearch.sheet.relativeWeeksAgo',
|
|
568
|
+
fromNow: '@astryx.powersearch.sheet.relativeWeeksFromNow',
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
unit: 'month',
|
|
572
|
+
plural: 'months',
|
|
573
|
+
amounts: [1, 3, 6, 12],
|
|
574
|
+
ago: '@astryx.powersearch.sheet.relativeMonthsAgo',
|
|
575
|
+
fromNow: '@astryx.powersearch.sheet.relativeMonthsFromNow',
|
|
576
|
+
},
|
|
577
|
+
] as const;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* The relative-date choices an operator offers, in display order. Shared by
|
|
581
|
+
* the popover's Selector and the sheet presentation's rows so both list the
|
|
582
|
+
* same values. With `t` the labels resolve through the catalog's ICU plural
|
|
583
|
+
* messages (the sheet presentation's rows); without it they are the popover
|
|
584
|
+
* editor's own literals. In English the two read identically.
|
|
585
|
+
*/
|
|
586
|
+
export function buildRelativeDateOptions(
|
|
587
|
+
operatorValue: OperatorValue & {type: 'date_relative'},
|
|
588
|
+
t?: TranslatorFn,
|
|
589
|
+
): {value: string; label: string}[] {
|
|
590
|
+
const result: {value: string; label: string}[] = [];
|
|
591
|
+
for (const {unit, plural, amounts, ago, fromNow} of RELATIVE_DATE_UNITS) {
|
|
592
|
+
for (const amount of amounts) {
|
|
593
|
+
const unitWord = amount === 1 ? unit : plural;
|
|
594
|
+
if (operatorValue.isPastAllowed !== false) {
|
|
595
|
+
result.push({
|
|
596
|
+
value: `${amount}${unit[0]}_ago`,
|
|
597
|
+
label: t ? t(ago, {count: amount}) : `${amount} ${unitWord} ago`,
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
if (operatorValue.isFutureAllowed !== false) {
|
|
601
|
+
result.push({
|
|
602
|
+
value: `${amount}${unit[0]}_from_now`,
|
|
603
|
+
label: t
|
|
604
|
+
? t(fromNow, {count: amount})
|
|
605
|
+
: `${amount} ${unitWord} from now`,
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return result;
|
|
611
|
+
}
|
|
612
|
+
|
|
449
613
|
function DateRelativeEditor({
|
|
450
614
|
operatorValue,
|
|
451
615
|
filterValue,
|
|
@@ -461,37 +625,18 @@ function DateRelativeEditor({
|
|
|
461
625
|
const currentValue =
|
|
462
626
|
filterValue?.type === 'date_relative' ? filterValue.value : undefined;
|
|
463
627
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
{
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
? [1, 2, 4]
|
|
477
|
-
: [1, 3, 6, 12];
|
|
478
|
-
for (const amount of amounts) {
|
|
479
|
-
if (operatorValue.isPastAllowed !== false) {
|
|
480
|
-
result.push({
|
|
481
|
-
value: `${amount}${unit[0]}_ago`,
|
|
482
|
-
label: `${amount} ${amount === 1 ? unit : plural} ago`,
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
if (operatorValue.isFutureAllowed !== false) {
|
|
486
|
-
result.push({
|
|
487
|
-
value: `${amount}${unit[0]}_from_now`,
|
|
488
|
-
label: `${amount} ${amount === 1 ? unit : plural} from now`,
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
return result;
|
|
494
|
-
}, [operatorValue.isPastAllowed, operatorValue.isFutureAllowed]);
|
|
628
|
+
// The choices depend on the two flags only; a config that rebuilds its
|
|
629
|
+
// operator objects per render keeps the same memoized list.
|
|
630
|
+
const {isPastAllowed, isFutureAllowed} = operatorValue;
|
|
631
|
+
const options = useMemo(
|
|
632
|
+
() =>
|
|
633
|
+
buildRelativeDateOptions({
|
|
634
|
+
type: 'date_relative',
|
|
635
|
+
isPastAllowed,
|
|
636
|
+
isFutureAllowed,
|
|
637
|
+
}),
|
|
638
|
+
[isPastAllowed, isFutureAllowed],
|
|
639
|
+
);
|
|
495
640
|
|
|
496
641
|
return (
|
|
497
642
|
<Selector
|
|
@@ -511,13 +656,19 @@ function DateRangeEditor({
|
|
|
511
656
|
filterValue,
|
|
512
657
|
onChange,
|
|
513
658
|
isDisabled,
|
|
659
|
+
presentation,
|
|
660
|
+
timezoneID,
|
|
514
661
|
}: {
|
|
515
662
|
operatorValue: OperatorValue & {type: 'date_range'};
|
|
516
663
|
filterValue: FilterValue | undefined;
|
|
517
664
|
onChange: (value: FilterValue) => void;
|
|
518
665
|
isDisabled?: boolean;
|
|
666
|
+
presentation: EditorPresentation;
|
|
667
|
+
timezoneID?: string;
|
|
519
668
|
}) {
|
|
520
669
|
const t = useComponentTranslator();
|
|
670
|
+
// A range part is a calendar day, read and written as a date-only value is.
|
|
671
|
+
const zone = resolveDateZone(timezoneID, true);
|
|
521
672
|
const currentValue = useMemo<DateRange | null>(() => {
|
|
522
673
|
if (filterValue?.type !== 'date_range') {
|
|
523
674
|
return null;
|
|
@@ -525,10 +676,10 @@ function DateRangeEditor({
|
|
|
525
676
|
const {start, end} = filterValue.value;
|
|
526
677
|
const nowSeconds = Date.now() / 1000;
|
|
527
678
|
return {
|
|
528
|
-
start: dateRangePartToISO(start, nowSeconds),
|
|
529
|
-
end: dateRangePartToISO(end, nowSeconds),
|
|
679
|
+
start: dateRangePartToISO(start, nowSeconds, zone),
|
|
680
|
+
end: dateRangePartToISO(end, nowSeconds, zone),
|
|
530
681
|
};
|
|
531
|
-
}, [filterValue]);
|
|
682
|
+
}, [filterValue, zone]);
|
|
532
683
|
|
|
533
684
|
const handleChange = useCallback(
|
|
534
685
|
(range: DateRange | null) => {
|
|
@@ -540,16 +691,16 @@ function DateRangeEditor({
|
|
|
540
691
|
value: {
|
|
541
692
|
start: {
|
|
542
693
|
type: 'ABSOLUTE',
|
|
543
|
-
unixSeconds:
|
|
694
|
+
unixSeconds: isoDateToUnixSeconds(range.start, zone),
|
|
544
695
|
},
|
|
545
696
|
end: {
|
|
546
697
|
type: 'ABSOLUTE',
|
|
547
|
-
unixSeconds:
|
|
698
|
+
unixSeconds: isoDateToUnixSeconds(range.end, zone),
|
|
548
699
|
},
|
|
549
700
|
},
|
|
550
701
|
});
|
|
551
702
|
},
|
|
552
|
-
[onChange],
|
|
703
|
+
[onChange, zone],
|
|
553
704
|
);
|
|
554
705
|
|
|
555
706
|
const handleKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {
|
|
@@ -569,6 +720,9 @@ function DateRangeEditor({
|
|
|
569
720
|
value={currentValue}
|
|
570
721
|
onChange={handleChange}
|
|
571
722
|
hasClear={false}
|
|
723
|
+
// A phone-wide sheet fits one month; the popover keeps the default.
|
|
724
|
+
numberOfMonths={presentation === 'bottom-sheet' ? 1 : undefined}
|
|
725
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
572
726
|
/>
|
|
573
727
|
</div>
|
|
574
728
|
);
|
|
@@ -661,6 +815,7 @@ function EnumListEditor({
|
|
|
661
815
|
// all of them instead of BaseTypeahead's 10-suggestion default, which
|
|
662
816
|
// would silently drop valid choices with no way to reach them.
|
|
663
817
|
maxMenuItems={items.length}
|
|
818
|
+
presentation="popover"
|
|
664
819
|
/>
|
|
665
820
|
);
|
|
666
821
|
}
|
|
@@ -671,14 +826,19 @@ function EntityListEditor({
|
|
|
671
826
|
onChange,
|
|
672
827
|
maxMenuItems,
|
|
673
828
|
isDisabled,
|
|
829
|
+
presentation,
|
|
830
|
+
fieldLabel,
|
|
674
831
|
}: {
|
|
675
832
|
operatorValue: OperatorValue & {type: 'entity_list'};
|
|
676
833
|
filterValue: FilterValue | undefined;
|
|
677
834
|
onChange: (value: FilterValue) => void;
|
|
678
835
|
maxMenuItems?: number;
|
|
679
836
|
isDisabled?: boolean;
|
|
837
|
+
presentation: EditorPresentation;
|
|
838
|
+
fieldLabel?: string;
|
|
680
839
|
}) {
|
|
681
840
|
const t = useComponentTranslator();
|
|
841
|
+
const isSheet = presentation === 'bottom-sheet';
|
|
682
842
|
const source = useMemo<SearchSource<SearchableItem>>(() => {
|
|
683
843
|
if (operatorValue.searchSource) {
|
|
684
844
|
return operatorValue.searchSource;
|
|
@@ -701,9 +861,15 @@ function EntityListEditor({
|
|
|
701
861
|
}));
|
|
702
862
|
}, [filterValue]);
|
|
703
863
|
|
|
864
|
+
// Sheet presentation: the Tokenizer's own sheet, titled with the field
|
|
865
|
+
// label, as for string_list.
|
|
704
866
|
return (
|
|
705
867
|
<Tokenizer
|
|
706
|
-
label={
|
|
868
|
+
label={
|
|
869
|
+
isSheet && fieldLabel != null
|
|
870
|
+
? fieldLabel
|
|
871
|
+
: t('@astryx.powersearch.valueEditor.entities')
|
|
872
|
+
}
|
|
707
873
|
isLabelHidden
|
|
708
874
|
isDisabled={isDisabled}
|
|
709
875
|
searchSource={source}
|
|
@@ -726,6 +892,8 @@ function EntityListEditor({
|
|
|
726
892
|
placeholder={t('@astryx.powersearch.valueEditor.searchPlaceholder')}
|
|
727
893
|
debounceMs={operatorValue.searchSource ? 150 : 0}
|
|
728
894
|
maxMenuItems={maxMenuItems}
|
|
895
|
+
width={isSheet ? '100%' : undefined}
|
|
896
|
+
presentation={isSheet ? 'bottom-sheet' : 'popover'}
|
|
729
897
|
/>
|
|
730
898
|
);
|
|
731
899
|
}
|
|
@@ -771,6 +939,10 @@ export function PowerSearchValueEditor({
|
|
|
771
939
|
onEnter,
|
|
772
940
|
maxMenuItems,
|
|
773
941
|
isDisabled,
|
|
942
|
+
onUnstage,
|
|
943
|
+
presentation = 'popover',
|
|
944
|
+
fieldLabel,
|
|
945
|
+
timezoneID,
|
|
774
946
|
}: PowerSearchValueEditorProps) {
|
|
775
947
|
switch (operatorValue.type) {
|
|
776
948
|
case 'empty':
|
|
@@ -780,6 +952,7 @@ export function PowerSearchValueEditor({
|
|
|
780
952
|
return (
|
|
781
953
|
<StringEditor
|
|
782
954
|
isDisabled={isDisabled}
|
|
955
|
+
presentation={presentation}
|
|
783
956
|
operatorValue={operatorValue}
|
|
784
957
|
filterValue={filterValue}
|
|
785
958
|
onChange={onChange}
|
|
@@ -792,6 +965,8 @@ export function PowerSearchValueEditor({
|
|
|
792
965
|
return (
|
|
793
966
|
<StringListEditor
|
|
794
967
|
isDisabled={isDisabled}
|
|
968
|
+
presentation={presentation}
|
|
969
|
+
fieldLabel={fieldLabel}
|
|
795
970
|
operatorValue={operatorValue}
|
|
796
971
|
filterValue={filterValue}
|
|
797
972
|
onChange={onChange}
|
|
@@ -803,6 +978,8 @@ export function PowerSearchValueEditor({
|
|
|
803
978
|
return (
|
|
804
979
|
<IntegerEditor
|
|
805
980
|
isDisabled={isDisabled}
|
|
981
|
+
presentation={presentation}
|
|
982
|
+
onUnstage={onUnstage}
|
|
806
983
|
operatorValue={operatorValue}
|
|
807
984
|
filterValue={filterValue}
|
|
808
985
|
onChange={onChange}
|
|
@@ -814,6 +991,8 @@ export function PowerSearchValueEditor({
|
|
|
814
991
|
return (
|
|
815
992
|
<FloatEditor
|
|
816
993
|
isDisabled={isDisabled}
|
|
994
|
+
presentation={presentation}
|
|
995
|
+
onUnstage={onUnstage}
|
|
817
996
|
operatorValue={operatorValue}
|
|
818
997
|
filterValue={filterValue}
|
|
819
998
|
onChange={onChange}
|
|
@@ -825,6 +1004,7 @@ export function PowerSearchValueEditor({
|
|
|
825
1004
|
return (
|
|
826
1005
|
<TimeEditor
|
|
827
1006
|
isDisabled={isDisabled}
|
|
1007
|
+
presentation={presentation}
|
|
828
1008
|
operatorValue={operatorValue}
|
|
829
1009
|
filterValue={filterValue}
|
|
830
1010
|
onChange={onChange}
|
|
@@ -835,9 +1015,11 @@ export function PowerSearchValueEditor({
|
|
|
835
1015
|
return (
|
|
836
1016
|
<DateAbsoluteEditor
|
|
837
1017
|
isDisabled={isDisabled}
|
|
1018
|
+
presentation={presentation}
|
|
838
1019
|
operatorValue={operatorValue}
|
|
839
1020
|
filterValue={filterValue}
|
|
840
1021
|
onChange={onChange}
|
|
1022
|
+
timezoneID={timezoneID}
|
|
841
1023
|
/>
|
|
842
1024
|
);
|
|
843
1025
|
|
|
@@ -855,9 +1037,11 @@ export function PowerSearchValueEditor({
|
|
|
855
1037
|
return (
|
|
856
1038
|
<DateRangeEditor
|
|
857
1039
|
isDisabled={isDisabled}
|
|
1040
|
+
presentation={presentation}
|
|
858
1041
|
operatorValue={operatorValue}
|
|
859
1042
|
filterValue={filterValue}
|
|
860
1043
|
onChange={onChange}
|
|
1044
|
+
timezoneID={timezoneID}
|
|
861
1045
|
/>
|
|
862
1046
|
);
|
|
863
1047
|
|
|
@@ -885,6 +1069,8 @@ export function PowerSearchValueEditor({
|
|
|
885
1069
|
return (
|
|
886
1070
|
<EntityListEditor
|
|
887
1071
|
isDisabled={isDisabled}
|
|
1072
|
+
presentation={presentation}
|
|
1073
|
+
fieldLabel={fieldLabel}
|
|
888
1074
|
operatorValue={operatorValue}
|
|
889
1075
|
filterValue={filterValue}
|
|
890
1076
|
onChange={onChange}
|