@astryxdesign/core 0.7.7-canary.c0929c8 → 0.7.7-canary.c19ca12
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 +36 -6
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +79 -9
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +23 -4
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +5 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +7 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +47 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +13 -2
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +7 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +10 -2
- 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/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +13 -27
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +22 -41
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +23 -45
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +15 -11
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +5 -1
- package/dist/Field/Field.js +2 -2
- package/dist/Field/PanelSearchInput.d.ts +9 -1
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +3 -1
- package/dist/HoverCard/HoverCard.d.ts +4 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +17 -31
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/InfoTip/InfoTip.d.ts +63 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -0
- package/dist/InfoTip/InfoTip.js +126 -0
- package/dist/InfoTip/index.d.ts +10 -0
- package/dist/InfoTip/index.d.ts.map +1 -0
- package/dist/InfoTip/index.js +12 -0
- package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +25 -20
- package/dist/Layer/useBackdropPress.d.ts +27 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -0
- package/dist/Layer/useBackdropPress.js +53 -0
- package/dist/Layer/usePressPin.d.ts +20 -10
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +66 -18
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +18 -0
- package/dist/MobileNav/MobileNav.js +0 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +2 -4
- package/dist/Outline/Outline.d.ts +2 -4
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -52
- package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromMarkdown.js +1 -0
- package/dist/Outline/useScrollSpy.js +3 -3
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +571 -302
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -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/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +8 -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.map +1 -1
- package/dist/Resizable/ResizeHandle.js +118 -260
- package/dist/Resizable/resizeGesture.d.ts +91 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -0
- package/dist/Resizable/resizeGesture.js +251 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +115 -8
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +8 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +96 -67
- package/dist/Selector/optionShape.d.ts +24 -0
- package/dist/Selector/optionShape.d.ts.map +1 -0
- package/dist/Selector/optionShape.js +48 -0
- package/dist/Selector/selectableOptionEntries.d.ts +20 -0
- package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
- package/dist/Selector/selectableOptionEntries.js +38 -0
- package/dist/Selector/utils.d.ts +2 -17
- package/dist/Selector/utils.d.ts.map +1 -1
- package/dist/Selector/utils.js +3 -51
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -9
- 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/switchTouch.d.ts +0 -7
- package/dist/Switch/switchTouch.d.ts.map +1 -1
- package/dist/Switch/switchTouch.js +2 -10
- package/dist/Switch/useSwitchTouch.d.ts +2 -11
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +35 -93
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- 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/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +30 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +94 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +13 -4
- package/dist/Token/TokenNamingContext.d.ts +14 -0
- package/dist/Token/TokenNamingContext.d.ts.map +1 -0
- package/dist/Token/TokenNamingContext.js +23 -0
- package/dist/Tokenizer/Tokenizer.d.ts +46 -59
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +40 -57
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
- package/dist/Tooltip/Tooltip.d.ts +25 -30
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +24 -5
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +45 -28
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +52 -59
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +4 -7
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -7
- 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 +96 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +157 -21
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/actionGroupTracker.d.ts +7 -4
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +19 -56
- 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/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- 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/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts +11 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
- package/dist/hooks/useHighlightedOptionScroll.js +112 -11
- 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/useLongPress.d.ts +6 -2
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +95 -15
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +7 -4
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -2
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -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-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +33 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/internal/SheetConfirmation.d.ts +11 -0
- package/dist/internal/SheetConfirmation.d.ts.map +1 -0
- package/dist/internal/SheetConfirmation.js +92 -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/sheetDraft.d.ts +35 -0
- package/dist/internal/sheetDraft.d.ts.map +1 -0
- package/dist/internal/sheetDraft.js +65 -0
- package/dist/internal/touch-sheet.d.ts +21 -0
- package/dist/internal/touch-sheet.d.ts.map +1 -0
- package/dist/internal/touch-sheet.js +19 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
- package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/reducedMotion.d.ts +24 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +78 -1
- package/dist/motion/roles.d.ts +7 -1
- package/dist/motion/roles.d.ts.map +1 -1
- package/dist/motion/roles.js +20 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/motion/uikit/index.d.ts +6 -5
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +6 -5
- package/dist/motion/uikit/segmented.d.ts +55 -0
- package/dist/motion/uikit/segmented.d.ts.map +1 -0
- package/dist/motion/uikit/segmented.js +77 -0
- package/dist/motion/uikit/springs.d.ts +0 -18
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +5 -21
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts +5 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
- package/dist/utils/browserClickWait.d.ts +35 -0
- package/dist/utils/browserClickWait.d.ts.map +1 -0
- package/dist/utils/browserClickWait.js +123 -0
- package/dist/utils/clickGuard.d.ts +14 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +46 -1
- 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/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/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +19 -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 +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +18 -8
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
- package/src/BottomSheet/BottomSheet.tsx +95 -10
- package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
- package/src/BottomSheet/bottomSheetStack.ts +8 -4
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Breadcrumbs/BreadcrumbItem.tsx +13 -3
- package/src/Button/Button.tsx +63 -5
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +36 -9
- package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
- package/src/CheckboxList/CheckboxList.tsx +6 -0
- package/src/CheckboxList/CheckboxListContext.tsx +6 -0
- package/src/CheckboxList/CheckboxListItem.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +30 -32
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +54 -45
- package/src/Drawer/Drawer.tsx +28 -11
- package/src/Drawer/useDrawerDialogPresence.ts +5 -1
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.doc.mjs +4 -2
- package/src/HoverCard/HoverCard.tsx +35 -4
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +46 -52
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/InfoTip/InfoTip.doc.mjs +192 -0
- package/src/InfoTip/InfoTip.tsx +186 -0
- package/src/InfoTip/index.ts +14 -0
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/useBackdropPress.ts +81 -0
- package/src/Layer/usePressPin.ts +86 -26
- package/src/Lightbox/Lightbox.tsx +18 -0
- package/src/MobileNav/MobileNav.tsx +1 -1
- package/src/MultiSelector/hooks.ts +2 -4
- package/src/Outline/Outline.doc.mjs +177 -51
- package/src/Outline/Outline.tsx +5 -57
- package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
- package/src/Outline/useOutlineFromMarkdown.ts +1 -0
- package/src/Outline/useScrollSpy.ts +3 -3
- package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
- package/src/PowerSearch/PowerSearch.tsx +798 -324
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioList.tsx +7 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/ResizeHandle.tsx +133 -328
- package/src/Resizable/resizeGesture.ts +368 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/SegmentedControl.tsx +179 -5
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +12 -1
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
- package/src/Selector/Selector.tsx +136 -89
- package/src/Selector/optionShape.ts +64 -0
- package/src/Selector/selectableOptionEntries.ts +39 -0
- package/src/Selector/utils.ts +9 -68
- package/src/SideNav/SideNavItem.tsx +3 -7
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/switchTouch.ts +2 -10
- package/src/Switch/useSwitchTouch.ts +38 -104
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +57 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- package/src/Token/Token.tsx +15 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
- package/src/Tokenizer/Tokenizer.tsx +89 -85
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- package/src/Tooltip/Tooltip.doc.mjs +123 -54
- package/src/Tooltip/Tooltip.tsx +36 -39
- package/src/Tooltip/index.ts +0 -1
- package/src/Tooltip/useTooltip.doc.mjs +171 -33
- package/src/Tooltip/useTooltip.tsx +98 -86
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- 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 +198 -20
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +7 -1
- package/src/hooks/actionGroupTracker.ts +32 -61
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- 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/useAttachment.ts +1 -1
- package/src/hooks/useHighlightedOptionScroll.ts +123 -15
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +136 -15
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -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-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
- package/src/i18n/generated-locales/en.generated.ts +43 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
- package/src/index.ts +14 -0
- package/src/internal/SheetConfirmation.tsx +101 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/sheetDraft.ts +80 -0
- package/src/internal/touch-sheet.ts +21 -0
- package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
- package/src/motion/MEASUREMENTS.md +7 -0
- package/src/motion/README.md +9 -5
- package/src/motion/animator.ts +61 -29
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/roles.ts +20 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +5 -5
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +5 -21
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
- package/src/utils/browserClickWait.ts +133 -0
- package/src/utils/clickGuard.ts +64 -1
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +19 -6
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/internal/tokenizer-presentation.d.ts +0 -21
- package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
- package/dist/internal/tokenizer-presentation.js +0 -21
- package/src/internal/tokenizer-presentation.ts +0 -25
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file PowerSearchEditPopover.tsx
|
|
7
7
|
* @input InternalConfig, PartialFilter
|
|
8
|
-
* @output Edit popover content with field/operator selectors and value editor
|
|
8
|
+
* @output Edit popover content with field/operator selectors and value editor;
|
|
9
|
+
* the built-in NestedEditor the sheet presentation's value step shares
|
|
9
10
|
* @position Sub-component; consumed by PowerSearch
|
|
10
11
|
*
|
|
11
12
|
* SYNC: When modified, update:
|
|
@@ -384,7 +385,7 @@ function NestedSubFilterRow({
|
|
|
384
385
|
// Nested editor
|
|
385
386
|
// =============================================================================
|
|
386
387
|
|
|
387
|
-
interface NestedEditorProps {
|
|
388
|
+
export interface NestedEditorProps {
|
|
388
389
|
config: InternalConfig;
|
|
389
390
|
partialFilter: PartialFilter;
|
|
390
391
|
operatorOptions: {value: string; label: string}[];
|
|
@@ -392,9 +393,25 @@ interface NestedEditorProps {
|
|
|
392
393
|
onPartialFilterChange: (filter: PartialFilter) => void;
|
|
393
394
|
maxMenuItems?: number;
|
|
394
395
|
isReadOnly: boolean;
|
|
396
|
+
/** Styles for the editor's tree root (the sheet makes it a query container). */
|
|
397
|
+
xstyle?: stylex.StyleXStyles;
|
|
398
|
+
/**
|
|
399
|
+
* Whether the tree root offers the group-operator picker when the field has
|
|
400
|
+
* several operators. The popover shows it; the sheet presentation's value
|
|
401
|
+
* step owns the operator choice in its own Operator group and hides it.
|
|
402
|
+
* @default true
|
|
403
|
+
*/
|
|
404
|
+
hasRootOperatorPicker?: boolean;
|
|
395
405
|
}
|
|
396
406
|
|
|
397
|
-
|
|
407
|
+
/**
|
|
408
|
+
* The built-in editor for a `nested` value: a tree of sub-filters with Add,
|
|
409
|
+
* field/operator/value rows and removal. The popover renders it below its
|
|
410
|
+
* field selector; the sheet presentation's value step renders the same editor
|
|
411
|
+
* in its body, so a `nested` filter is created
|
|
412
|
+
* and edited the same way in both presentations.
|
|
413
|
+
*/
|
|
414
|
+
export function NestedEditor({
|
|
398
415
|
config,
|
|
399
416
|
partialFilter,
|
|
400
417
|
operatorOptions,
|
|
@@ -402,6 +419,8 @@ function NestedEditor({
|
|
|
402
419
|
onPartialFilterChange,
|
|
403
420
|
maxMenuItems,
|
|
404
421
|
isReadOnly,
|
|
422
|
+
xstyle,
|
|
423
|
+
hasRootOperatorPicker = true,
|
|
405
424
|
}: NestedEditorProps) {
|
|
406
425
|
const t = useComponentTranslator();
|
|
407
426
|
const [subFilters, setSubFilters] = useState<EditablePartialFilter[]>(() => {
|
|
@@ -587,7 +606,7 @@ function NestedEditor({
|
|
|
587
606
|
|
|
588
607
|
const rootLabel = (
|
|
589
608
|
<div {...stylex.props(styles.nestedRootLabel)}>
|
|
590
|
-
{operatorOptions.length > 1 ? (
|
|
609
|
+
{hasRootOperatorPicker && operatorOptions.length > 1 ? (
|
|
591
610
|
<div {...stylex.props(styles.operatorSelector)}>
|
|
592
611
|
<Selector
|
|
593
612
|
label={t('@astryx.powersearch.editor.groupOperator')}
|
|
@@ -600,7 +619,10 @@ function NestedEditor({
|
|
|
600
619
|
/>
|
|
601
620
|
</div>
|
|
602
621
|
) : (
|
|
603
|
-
(operatorOptions
|
|
622
|
+
(operatorOptions.find(option => option.value === partialFilter.operator)
|
|
623
|
+
?.label ??
|
|
624
|
+
operatorOptions[0]?.label ??
|
|
625
|
+
t('@astryx.powersearch.editor.group'))
|
|
604
626
|
)}
|
|
605
627
|
</div>
|
|
606
628
|
);
|
|
@@ -614,7 +636,7 @@ function NestedEditor({
|
|
|
614
636
|
},
|
|
615
637
|
];
|
|
616
638
|
|
|
617
|
-
return <TreeList items={items} density="balanced" />;
|
|
639
|
+
return <TreeList items={items} density="balanced" xstyle={xstyle} />;
|
|
618
640
|
}
|
|
619
641
|
|
|
620
642
|
// =============================================================================
|
|
@@ -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
|
|
@@ -43,9 +46,10 @@ import {DateRangeInput, type DateRange} from '../DateRangeInput';
|
|
|
43
46
|
import {resolveDateTimeRangePart} from './resolveDateTimeRangePart';
|
|
44
47
|
import {TimeInput} from '../TimeInput';
|
|
45
48
|
import {Selector} from '../Selector';
|
|
46
|
-
import {Tokenizer} from '../Tokenizer';
|
|
49
|
+
import {Tokenizer} from '../Tokenizer/Tokenizer';
|
|
47
50
|
import {Typeahead} from '../Typeahead';
|
|
48
51
|
import {useLocale} from '../i18n';
|
|
52
|
+
import type {TranslatorFn} from '../i18n';
|
|
49
53
|
import {
|
|
50
54
|
registerEnglishFallback,
|
|
51
55
|
useComponentTranslator,
|
|
@@ -64,8 +68,30 @@ export interface PowerSearchValueEditorProps {
|
|
|
64
68
|
maxMenuItems?: number;
|
|
65
69
|
isDisabled?: boolean;
|
|
66
70
|
timezoneID?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Called when a staged value no longer stands — the number input's draft is
|
|
73
|
+
* empty or does not parse — so the sheet presentation's confirm action
|
|
74
|
+
* disables again. Only the `bottom-sheet` presentation stages as typed; the
|
|
75
|
+
* popover commits on blur or Enter and never calls this.
|
|
76
|
+
*/
|
|
77
|
+
onUnstage?: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Where the editor renders. In the `bottom-sheet` presentation the inputs
|
|
80
|
+
* fill the sheet's width, number inputs stage every parseable keystroke
|
|
81
|
+
* (the sheet's footer confirms; there is no Enter-to-save), the date range
|
|
82
|
+
* shows one month, and list values open the Tokenizer's own sheet titled
|
|
83
|
+
* with `fieldLabel`.
|
|
84
|
+
* @default 'popover'
|
|
85
|
+
*/
|
|
86
|
+
presentation?: 'popover' | 'bottom-sheet';
|
|
87
|
+
/** The field's label; names the Tokenizer sheet in the sheet presentation. */
|
|
88
|
+
fieldLabel?: string;
|
|
67
89
|
}
|
|
68
90
|
|
|
91
|
+
type EditorPresentation = NonNullable<
|
|
92
|
+
PowerSearchValueEditorProps['presentation']
|
|
93
|
+
>;
|
|
94
|
+
|
|
69
95
|
// =============================================================================
|
|
70
96
|
// Helpers
|
|
71
97
|
// =============================================================================
|
|
@@ -113,6 +139,7 @@ function StringEditor({
|
|
|
113
139
|
onEnter: _onEnter,
|
|
114
140
|
maxMenuItems,
|
|
115
141
|
isDisabled,
|
|
142
|
+
presentation,
|
|
116
143
|
}: {
|
|
117
144
|
operatorValue: OperatorValue & {type: 'string'};
|
|
118
145
|
filterValue: FilterValue | undefined;
|
|
@@ -120,8 +147,10 @@ function StringEditor({
|
|
|
120
147
|
onEnter?: () => void;
|
|
121
148
|
maxMenuItems?: number;
|
|
122
149
|
isDisabled?: boolean;
|
|
150
|
+
presentation: EditorPresentation;
|
|
123
151
|
}) {
|
|
124
152
|
const t = useComponentTranslator();
|
|
153
|
+
const width = presentation === 'bottom-sheet' ? '100%' : undefined;
|
|
125
154
|
const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
|
|
126
155
|
|
|
127
156
|
// When a searchSource is provided, render a typeahead instead of a plain
|
|
@@ -148,6 +177,7 @@ function StringEditor({
|
|
|
148
177
|
placeholder={t('@astryx.powersearch.valueEditor.searchPlaceholder')}
|
|
149
178
|
debounceMs={150}
|
|
150
179
|
maxMenuItems={maxMenuItems}
|
|
180
|
+
width={width}
|
|
151
181
|
/>
|
|
152
182
|
);
|
|
153
183
|
}
|
|
@@ -162,6 +192,7 @@ function StringEditor({
|
|
|
162
192
|
onChange={(value: string) => {
|
|
163
193
|
onChange({type: 'string', value});
|
|
164
194
|
}}
|
|
195
|
+
width={width}
|
|
165
196
|
/>
|
|
166
197
|
);
|
|
167
198
|
}
|
|
@@ -172,14 +203,19 @@ function StringListEditor({
|
|
|
172
203
|
onChange,
|
|
173
204
|
maxMenuItems,
|
|
174
205
|
isDisabled,
|
|
206
|
+
presentation,
|
|
207
|
+
fieldLabel,
|
|
175
208
|
}: {
|
|
176
209
|
operatorValue: OperatorValue & {type: 'string_list'};
|
|
177
210
|
filterValue: FilterValue | undefined;
|
|
178
211
|
onChange: (value: FilterValue) => void;
|
|
179
212
|
maxMenuItems?: number;
|
|
180
213
|
isDisabled?: boolean;
|
|
214
|
+
presentation: EditorPresentation;
|
|
215
|
+
fieldLabel?: string;
|
|
181
216
|
}) {
|
|
182
217
|
const t = useComponentTranslator();
|
|
218
|
+
const isSheet = presentation === 'bottom-sheet';
|
|
183
219
|
const currentValue: SearchableItem[] = useMemo(() => {
|
|
184
220
|
if (filterValue?.type !== 'string_list') {
|
|
185
221
|
return [];
|
|
@@ -203,9 +239,16 @@ function StringListEditor({
|
|
|
203
239
|
const hasCreate =
|
|
204
240
|
operatorValue.isArbitraryStringAllowed || !operatorValue.searchSource;
|
|
205
241
|
|
|
242
|
+
// In the sheet presentation the list value edits through the Tokenizer's
|
|
243
|
+
// own sheet, titled with the field's label; a popover menu inside a sheet
|
|
244
|
+
// would stack a second anchored layer on a surface the person is already in.
|
|
206
245
|
return (
|
|
207
246
|
<Tokenizer
|
|
208
|
-
label={
|
|
247
|
+
label={
|
|
248
|
+
isSheet && fieldLabel != null
|
|
249
|
+
? fieldLabel
|
|
250
|
+
: t('@astryx.powersearch.valueEditor.values')
|
|
251
|
+
}
|
|
209
252
|
isLabelHidden
|
|
210
253
|
isDisabled={isDisabled}
|
|
211
254
|
searchSource={source}
|
|
@@ -220,6 +263,8 @@ function StringListEditor({
|
|
|
220
263
|
debounceMs={operatorValue.searchSource ? 150 : 0}
|
|
221
264
|
hasCreate={hasCreate}
|
|
222
265
|
maxMenuItems={maxMenuItems}
|
|
266
|
+
width={isSheet ? '100%' : undefined}
|
|
267
|
+
experimental={isSheet ? {presentation: 'bottom-sheet'} : undefined}
|
|
223
268
|
/>
|
|
224
269
|
);
|
|
225
270
|
}
|
|
@@ -231,6 +276,8 @@ function useNumberEditorHandlers({
|
|
|
231
276
|
isIntegerOnly,
|
|
232
277
|
onChange,
|
|
233
278
|
onEnter,
|
|
279
|
+
onUnstage,
|
|
280
|
+
stagesAsTyped,
|
|
234
281
|
}: {
|
|
235
282
|
valueType: 'integer' | 'float';
|
|
236
283
|
min?: number;
|
|
@@ -238,6 +285,14 @@ function useNumberEditorHandlers({
|
|
|
238
285
|
isIntegerOnly: boolean;
|
|
239
286
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
240
287
|
onEnter?: () => void;
|
|
288
|
+
onUnstage?: () => void;
|
|
289
|
+
/**
|
|
290
|
+
* Stage every keystroke the input would commit, and unstage when the draft
|
|
291
|
+
* stops parsing. The sheet presentation confirms from its footer, so the
|
|
292
|
+
* confirm action must enable while the person is still typing and disable
|
|
293
|
+
* again over an empty field; the popover commits on blur or Enter.
|
|
294
|
+
*/
|
|
295
|
+
stagesAsTyped: boolean;
|
|
241
296
|
}) {
|
|
242
297
|
const locale = useLocale();
|
|
243
298
|
const pendingDecisionRef = useRef<NumberInputCommitDecision | null>(null);
|
|
@@ -259,12 +314,30 @@ function useNumberEditorHandlers({
|
|
|
259
314
|
}, []);
|
|
260
315
|
const handleInput = useCallback(
|
|
261
316
|
(event: FormEvent<HTMLElement>) => {
|
|
262
|
-
|
|
317
|
+
const decision = resolveNumberInputCommit(
|
|
263
318
|
(event.currentTarget as HTMLInputElement).value,
|
|
264
319
|
{min, max, isIntegerOnly, locale, hasClear: false},
|
|
265
320
|
);
|
|
321
|
+
pendingDecisionRef.current = decision;
|
|
322
|
+
if (stagesAsTyped) {
|
|
323
|
+
if (decision.type === 'commit') {
|
|
324
|
+
onChange(toFilterValue(decision.value));
|
|
325
|
+
} else {
|
|
326
|
+
// Cleared, or not a number: nothing stands to confirm.
|
|
327
|
+
onUnstage?.();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
266
330
|
},
|
|
267
|
-
[
|
|
331
|
+
[
|
|
332
|
+
isIntegerOnly,
|
|
333
|
+
locale,
|
|
334
|
+
max,
|
|
335
|
+
min,
|
|
336
|
+
onChange,
|
|
337
|
+
onUnstage,
|
|
338
|
+
stagesAsTyped,
|
|
339
|
+
toFilterValue,
|
|
340
|
+
],
|
|
268
341
|
);
|
|
269
342
|
const handleEnter = useCallback(() => {
|
|
270
343
|
const decision = pendingDecisionRef.current;
|
|
@@ -292,13 +365,17 @@ function IntegerEditor({
|
|
|
292
365
|
filterValue,
|
|
293
366
|
onChange,
|
|
294
367
|
onEnter,
|
|
368
|
+
onUnstage,
|
|
295
369
|
isDisabled,
|
|
370
|
+
presentation,
|
|
296
371
|
}: {
|
|
297
372
|
operatorValue: OperatorValue & {type: 'integer'};
|
|
298
373
|
filterValue: FilterValue | undefined;
|
|
299
374
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
300
375
|
onEnter?: () => void;
|
|
376
|
+
onUnstage?: () => void;
|
|
301
377
|
isDisabled?: boolean;
|
|
378
|
+
presentation: EditorPresentation;
|
|
302
379
|
}) {
|
|
303
380
|
const t = useComponentTranslator();
|
|
304
381
|
const currentValue =
|
|
@@ -310,6 +387,8 @@ function IntegerEditor({
|
|
|
310
387
|
isIntegerOnly: true,
|
|
311
388
|
onChange,
|
|
312
389
|
onEnter,
|
|
390
|
+
onUnstage,
|
|
391
|
+
stagesAsTyped: presentation === 'bottom-sheet',
|
|
313
392
|
});
|
|
314
393
|
|
|
315
394
|
return (
|
|
@@ -328,6 +407,7 @@ function IntegerEditor({
|
|
|
328
407
|
units={operatorValue.units}
|
|
329
408
|
isIntegerOnly
|
|
330
409
|
placeholder={t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')}
|
|
410
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
331
411
|
/>
|
|
332
412
|
);
|
|
333
413
|
}
|
|
@@ -337,13 +417,17 @@ function FloatEditor({
|
|
|
337
417
|
filterValue,
|
|
338
418
|
onChange,
|
|
339
419
|
onEnter,
|
|
420
|
+
onUnstage,
|
|
340
421
|
isDisabled,
|
|
422
|
+
presentation,
|
|
341
423
|
}: {
|
|
342
424
|
operatorValue: OperatorValue & {type: 'float'};
|
|
343
425
|
filterValue: FilterValue | undefined;
|
|
344
426
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
345
427
|
onEnter?: () => void;
|
|
428
|
+
onUnstage?: () => void;
|
|
346
429
|
isDisabled?: boolean;
|
|
430
|
+
presentation: EditorPresentation;
|
|
347
431
|
}) {
|
|
348
432
|
const t = useComponentTranslator();
|
|
349
433
|
const currentValue =
|
|
@@ -355,6 +439,8 @@ function FloatEditor({
|
|
|
355
439
|
isIntegerOnly: false,
|
|
356
440
|
onChange,
|
|
357
441
|
onEnter,
|
|
442
|
+
onUnstage,
|
|
443
|
+
stagesAsTyped: presentation === 'bottom-sheet',
|
|
358
444
|
});
|
|
359
445
|
|
|
360
446
|
return (
|
|
@@ -372,6 +458,7 @@ function FloatEditor({
|
|
|
372
458
|
max={operatorValue.maxValue}
|
|
373
459
|
units={operatorValue.units}
|
|
374
460
|
placeholder={t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')}
|
|
461
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
375
462
|
/>
|
|
376
463
|
);
|
|
377
464
|
}
|
|
@@ -381,11 +468,13 @@ function TimeEditor({
|
|
|
381
468
|
filterValue,
|
|
382
469
|
onChange,
|
|
383
470
|
isDisabled,
|
|
471
|
+
presentation,
|
|
384
472
|
}: {
|
|
385
473
|
operatorValue: OperatorValue & {type: 'time'};
|
|
386
474
|
filterValue: FilterValue | undefined;
|
|
387
475
|
onChange: (value: FilterValue) => void;
|
|
388
476
|
isDisabled?: boolean;
|
|
477
|
+
presentation: EditorPresentation;
|
|
389
478
|
}) {
|
|
390
479
|
const t = useComponentTranslator();
|
|
391
480
|
const currentValue =
|
|
@@ -406,6 +495,7 @@ function TimeEditor({
|
|
|
406
495
|
}}
|
|
407
496
|
min={operatorValue.minValue as ISOTimeString | undefined}
|
|
408
497
|
max={operatorValue.maxValue as ISOTimeString | undefined}
|
|
498
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
409
499
|
/>
|
|
410
500
|
);
|
|
411
501
|
}
|
|
@@ -414,11 +504,13 @@ function DateAbsoluteEditor({
|
|
|
414
504
|
filterValue,
|
|
415
505
|
onChange,
|
|
416
506
|
isDisabled,
|
|
507
|
+
presentation,
|
|
417
508
|
}: {
|
|
418
509
|
operatorValue: OperatorValue & {type: 'date_absolute'};
|
|
419
510
|
filterValue: FilterValue | undefined;
|
|
420
511
|
onChange: (value: FilterValue) => void;
|
|
421
512
|
isDisabled?: boolean;
|
|
513
|
+
presentation: EditorPresentation;
|
|
422
514
|
}) {
|
|
423
515
|
const t = useComponentTranslator();
|
|
424
516
|
// Convert unixSeconds to ISO date string for the date input
|
|
@@ -442,10 +534,69 @@ function DateAbsoluteEditor({
|
|
|
442
534
|
onChange({type: 'date_absolute', unixSeconds});
|
|
443
535
|
}
|
|
444
536
|
}}
|
|
537
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
445
538
|
/>
|
|
446
539
|
);
|
|
447
540
|
}
|
|
448
541
|
|
|
542
|
+
const RELATIVE_DATE_UNITS = [
|
|
543
|
+
{
|
|
544
|
+
unit: 'day',
|
|
545
|
+
plural: 'days',
|
|
546
|
+
amounts: [1, 3, 7, 14, 30],
|
|
547
|
+
ago: '@astryx.powersearch.sheet.relativeDaysAgo',
|
|
548
|
+
fromNow: '@astryx.powersearch.sheet.relativeDaysFromNow',
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
unit: 'week',
|
|
552
|
+
plural: 'weeks',
|
|
553
|
+
amounts: [1, 2, 4],
|
|
554
|
+
ago: '@astryx.powersearch.sheet.relativeWeeksAgo',
|
|
555
|
+
fromNow: '@astryx.powersearch.sheet.relativeWeeksFromNow',
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
unit: 'month',
|
|
559
|
+
plural: 'months',
|
|
560
|
+
amounts: [1, 3, 6, 12],
|
|
561
|
+
ago: '@astryx.powersearch.sheet.relativeMonthsAgo',
|
|
562
|
+
fromNow: '@astryx.powersearch.sheet.relativeMonthsFromNow',
|
|
563
|
+
},
|
|
564
|
+
] as const;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* The relative-date choices an operator offers, in display order. Shared by
|
|
568
|
+
* the popover's Selector and the sheet presentation's rows so both list the
|
|
569
|
+
* same values. With `t` the labels resolve through the catalog's ICU plural
|
|
570
|
+
* messages (the sheet presentation's rows); without it they are the popover
|
|
571
|
+
* editor's own literals. In English the two read identically.
|
|
572
|
+
*/
|
|
573
|
+
export function buildRelativeDateOptions(
|
|
574
|
+
operatorValue: OperatorValue & {type: 'date_relative'},
|
|
575
|
+
t?: TranslatorFn,
|
|
576
|
+
): {value: string; label: string}[] {
|
|
577
|
+
const result: {value: string; label: string}[] = [];
|
|
578
|
+
for (const {unit, plural, amounts, ago, fromNow} of RELATIVE_DATE_UNITS) {
|
|
579
|
+
for (const amount of amounts) {
|
|
580
|
+
const unitWord = amount === 1 ? unit : plural;
|
|
581
|
+
if (operatorValue.isPastAllowed !== false) {
|
|
582
|
+
result.push({
|
|
583
|
+
value: `${amount}${unit[0]}_ago`,
|
|
584
|
+
label: t ? t(ago, {count: amount}) : `${amount} ${unitWord} ago`,
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
if (operatorValue.isFutureAllowed !== false) {
|
|
588
|
+
result.push({
|
|
589
|
+
value: `${amount}${unit[0]}_from_now`,
|
|
590
|
+
label: t
|
|
591
|
+
? t(fromNow, {count: amount})
|
|
592
|
+
: `${amount} ${unitWord} from now`,
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return result;
|
|
598
|
+
}
|
|
599
|
+
|
|
449
600
|
function DateRelativeEditor({
|
|
450
601
|
operatorValue,
|
|
451
602
|
filterValue,
|
|
@@ -461,37 +612,18 @@ function DateRelativeEditor({
|
|
|
461
612
|
const currentValue =
|
|
462
613
|
filterValue?.type === 'date_relative' ? filterValue.value : undefined;
|
|
463
614
|
|
|
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]);
|
|
615
|
+
// The choices depend on the two flags only; a config that rebuilds its
|
|
616
|
+
// operator objects per render keeps the same memoized list.
|
|
617
|
+
const {isPastAllowed, isFutureAllowed} = operatorValue;
|
|
618
|
+
const options = useMemo(
|
|
619
|
+
() =>
|
|
620
|
+
buildRelativeDateOptions({
|
|
621
|
+
type: 'date_relative',
|
|
622
|
+
isPastAllowed,
|
|
623
|
+
isFutureAllowed,
|
|
624
|
+
}),
|
|
625
|
+
[isPastAllowed, isFutureAllowed],
|
|
626
|
+
);
|
|
495
627
|
|
|
496
628
|
return (
|
|
497
629
|
<Selector
|
|
@@ -511,11 +643,13 @@ function DateRangeEditor({
|
|
|
511
643
|
filterValue,
|
|
512
644
|
onChange,
|
|
513
645
|
isDisabled,
|
|
646
|
+
presentation,
|
|
514
647
|
}: {
|
|
515
648
|
operatorValue: OperatorValue & {type: 'date_range'};
|
|
516
649
|
filterValue: FilterValue | undefined;
|
|
517
650
|
onChange: (value: FilterValue) => void;
|
|
518
651
|
isDisabled?: boolean;
|
|
652
|
+
presentation: EditorPresentation;
|
|
519
653
|
}) {
|
|
520
654
|
const t = useComponentTranslator();
|
|
521
655
|
const currentValue = useMemo<DateRange | null>(() => {
|
|
@@ -569,6 +703,9 @@ function DateRangeEditor({
|
|
|
569
703
|
value={currentValue}
|
|
570
704
|
onChange={handleChange}
|
|
571
705
|
hasClear={false}
|
|
706
|
+
// A phone-wide sheet fits one month; the popover keeps the default.
|
|
707
|
+
numberOfMonths={presentation === 'bottom-sheet' ? 1 : undefined}
|
|
708
|
+
width={presentation === 'bottom-sheet' ? '100%' : undefined}
|
|
572
709
|
/>
|
|
573
710
|
</div>
|
|
574
711
|
);
|
|
@@ -671,14 +808,19 @@ function EntityListEditor({
|
|
|
671
808
|
onChange,
|
|
672
809
|
maxMenuItems,
|
|
673
810
|
isDisabled,
|
|
811
|
+
presentation,
|
|
812
|
+
fieldLabel,
|
|
674
813
|
}: {
|
|
675
814
|
operatorValue: OperatorValue & {type: 'entity_list'};
|
|
676
815
|
filterValue: FilterValue | undefined;
|
|
677
816
|
onChange: (value: FilterValue) => void;
|
|
678
817
|
maxMenuItems?: number;
|
|
679
818
|
isDisabled?: boolean;
|
|
819
|
+
presentation: EditorPresentation;
|
|
820
|
+
fieldLabel?: string;
|
|
680
821
|
}) {
|
|
681
822
|
const t = useComponentTranslator();
|
|
823
|
+
const isSheet = presentation === 'bottom-sheet';
|
|
682
824
|
const source = useMemo<SearchSource<SearchableItem>>(() => {
|
|
683
825
|
if (operatorValue.searchSource) {
|
|
684
826
|
return operatorValue.searchSource;
|
|
@@ -701,9 +843,15 @@ function EntityListEditor({
|
|
|
701
843
|
}));
|
|
702
844
|
}, [filterValue]);
|
|
703
845
|
|
|
846
|
+
// Sheet presentation: the Tokenizer's own sheet, titled with the field
|
|
847
|
+
// label, as for string_list.
|
|
704
848
|
return (
|
|
705
849
|
<Tokenizer
|
|
706
|
-
label={
|
|
850
|
+
label={
|
|
851
|
+
isSheet && fieldLabel != null
|
|
852
|
+
? fieldLabel
|
|
853
|
+
: t('@astryx.powersearch.valueEditor.entities')
|
|
854
|
+
}
|
|
707
855
|
isLabelHidden
|
|
708
856
|
isDisabled={isDisabled}
|
|
709
857
|
searchSource={source}
|
|
@@ -726,6 +874,8 @@ function EntityListEditor({
|
|
|
726
874
|
placeholder={t('@astryx.powersearch.valueEditor.searchPlaceholder')}
|
|
727
875
|
debounceMs={operatorValue.searchSource ? 150 : 0}
|
|
728
876
|
maxMenuItems={maxMenuItems}
|
|
877
|
+
width={isSheet ? '100%' : undefined}
|
|
878
|
+
experimental={isSheet ? {presentation: 'bottom-sheet'} : undefined}
|
|
729
879
|
/>
|
|
730
880
|
);
|
|
731
881
|
}
|
|
@@ -771,6 +921,9 @@ export function PowerSearchValueEditor({
|
|
|
771
921
|
onEnter,
|
|
772
922
|
maxMenuItems,
|
|
773
923
|
isDisabled,
|
|
924
|
+
onUnstage,
|
|
925
|
+
presentation = 'popover',
|
|
926
|
+
fieldLabel,
|
|
774
927
|
}: PowerSearchValueEditorProps) {
|
|
775
928
|
switch (operatorValue.type) {
|
|
776
929
|
case 'empty':
|
|
@@ -780,6 +933,7 @@ export function PowerSearchValueEditor({
|
|
|
780
933
|
return (
|
|
781
934
|
<StringEditor
|
|
782
935
|
isDisabled={isDisabled}
|
|
936
|
+
presentation={presentation}
|
|
783
937
|
operatorValue={operatorValue}
|
|
784
938
|
filterValue={filterValue}
|
|
785
939
|
onChange={onChange}
|
|
@@ -792,6 +946,8 @@ export function PowerSearchValueEditor({
|
|
|
792
946
|
return (
|
|
793
947
|
<StringListEditor
|
|
794
948
|
isDisabled={isDisabled}
|
|
949
|
+
presentation={presentation}
|
|
950
|
+
fieldLabel={fieldLabel}
|
|
795
951
|
operatorValue={operatorValue}
|
|
796
952
|
filterValue={filterValue}
|
|
797
953
|
onChange={onChange}
|
|
@@ -803,6 +959,8 @@ export function PowerSearchValueEditor({
|
|
|
803
959
|
return (
|
|
804
960
|
<IntegerEditor
|
|
805
961
|
isDisabled={isDisabled}
|
|
962
|
+
presentation={presentation}
|
|
963
|
+
onUnstage={onUnstage}
|
|
806
964
|
operatorValue={operatorValue}
|
|
807
965
|
filterValue={filterValue}
|
|
808
966
|
onChange={onChange}
|
|
@@ -814,6 +972,8 @@ export function PowerSearchValueEditor({
|
|
|
814
972
|
return (
|
|
815
973
|
<FloatEditor
|
|
816
974
|
isDisabled={isDisabled}
|
|
975
|
+
presentation={presentation}
|
|
976
|
+
onUnstage={onUnstage}
|
|
817
977
|
operatorValue={operatorValue}
|
|
818
978
|
filterValue={filterValue}
|
|
819
979
|
onChange={onChange}
|
|
@@ -825,6 +985,7 @@ export function PowerSearchValueEditor({
|
|
|
825
985
|
return (
|
|
826
986
|
<TimeEditor
|
|
827
987
|
isDisabled={isDisabled}
|
|
988
|
+
presentation={presentation}
|
|
828
989
|
operatorValue={operatorValue}
|
|
829
990
|
filterValue={filterValue}
|
|
830
991
|
onChange={onChange}
|
|
@@ -835,6 +996,7 @@ export function PowerSearchValueEditor({
|
|
|
835
996
|
return (
|
|
836
997
|
<DateAbsoluteEditor
|
|
837
998
|
isDisabled={isDisabled}
|
|
999
|
+
presentation={presentation}
|
|
838
1000
|
operatorValue={operatorValue}
|
|
839
1001
|
filterValue={filterValue}
|
|
840
1002
|
onChange={onChange}
|
|
@@ -855,6 +1017,7 @@ export function PowerSearchValueEditor({
|
|
|
855
1017
|
return (
|
|
856
1018
|
<DateRangeEditor
|
|
857
1019
|
isDisabled={isDisabled}
|
|
1020
|
+
presentation={presentation}
|
|
858
1021
|
operatorValue={operatorValue}
|
|
859
1022
|
filterValue={filterValue}
|
|
860
1023
|
onChange={onChange}
|
|
@@ -885,6 +1048,8 @@ export function PowerSearchValueEditor({
|
|
|
885
1048
|
return (
|
|
886
1049
|
<EntityListEditor
|
|
887
1050
|
isDisabled={isDisabled}
|
|
1051
|
+
presentation={presentation}
|
|
1052
|
+
fieldLabel={fieldLabel}
|
|
888
1053
|
operatorValue={operatorValue}
|
|
889
1054
|
filterValue={filterValue}
|
|
890
1055
|
onChange={onChange}
|
|
@@ -32,10 +32,27 @@ function formatEnumLabel(
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function formatNumber(value: number, locale: Locale, units?: string): string {
|
|
35
|
-
const formatted =
|
|
35
|
+
const formatted = formatSharedNumber(value, locale);
|
|
36
36
|
return units ? `${formatted} ${units}` : formatted;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* A number in the provider locale's digits, decimal mark, and — unless the
|
|
41
|
+
* options say otherwise — grouping. The shared number helper for
|
|
42
|
+
* PowerSearch's own readings of a value — this module owns the raw `Intl`
|
|
43
|
+
* access.
|
|
44
|
+
*/
|
|
45
|
+
export function formatSharedNumber(
|
|
46
|
+
value: number,
|
|
47
|
+
locale: Locale,
|
|
48
|
+
options?: Pick<
|
|
49
|
+
Intl.NumberFormatOptions,
|
|
50
|
+
'useGrouping' | 'maximumFractionDigits'
|
|
51
|
+
>,
|
|
52
|
+
): string {
|
|
53
|
+
return new Intl.NumberFormat(locale, options).format(value);
|
|
54
|
+
}
|
|
55
|
+
|
|
39
56
|
export function formatDateAbsolute(
|
|
40
57
|
unixSeconds: number,
|
|
41
58
|
locale: Locale,
|