@astryxdesign/core 0.7.8 → 0.7.9-canary.0236bb8
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/AppShell/observeMainOverflow.d.ts.map +1 -1
- package/dist/AppShell/observeMainOverflow.js +9 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +7 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +61 -21
- package/dist/Calendar/Calendar.d.ts +14 -2
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +63 -74
- package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +7 -5
- package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +57 -64
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
- package/dist/Calendar/styles.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +74 -18
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +40 -14
- package/dist/ClickableCard/ClickableCard.d.ts +1 -1
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +2 -0
- package/dist/DateInput/DateInput.d.ts +37 -6
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +97 -124
- package/dist/DateInput/MonthScroller.d.ts +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +26 -29
- package/dist/DateInput/MonthYearWheels.d.ts +10 -1
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
- package/dist/DateInput/MonthYearWheels.js +54 -42
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +7 -1
- package/dist/DateInput/TouchDateField.d.ts +1 -1
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +26 -21
- package/dist/DateInput/monthGeometry.d.ts +42 -8
- package/dist/DateInput/monthGeometry.d.ts.map +1 -1
- package/dist/DateInput/monthGeometry.js +81 -7
- package/dist/DateInput/useCalendarPresentation.d.ts +10 -0
- package/dist/DateInput/useCalendarPresentation.d.ts.map +1 -0
- package/dist/DateInput/useCalendarPresentation.js +32 -0
- package/dist/DateInput/useTypedDate.d.ts +92 -0
- package/dist/DateInput/useTypedDate.d.ts.map +1 -0
- package/dist/DateInput/useTypedDate.js +269 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts +17 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +15 -8
- package/dist/DateTimeInput/DateTimeInput.d.ts +26 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +92 -88
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +26 -20
- package/dist/Dialog/Dialog.d.ts +2 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +14 -3
- package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +11 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +11 -8
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -4
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +16 -2
- package/dist/HoverCard/useHoverCard.d.ts +3 -1
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/InfoTip/InfoTip.d.ts +1 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +6 -18
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +2 -2
- package/dist/InputGroup/groupStyles.d.ts +1 -1
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +1 -1
- package/dist/Item/Item.d.ts +20 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +97 -29
- package/dist/Item/ItemListRowContext.d.ts +2 -0
- package/dist/Item/ItemListRowContext.d.ts.map +1 -0
- package/dist/Item/ItemListRowContext.js +16 -0
- package/dist/Layer/holdEntranceInput.d.ts +24 -0
- package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
- package/dist/Layer/holdEntranceInput.js +65 -0
- package/dist/Layer/inputHold.d.ts +49 -0
- package/dist/Layer/inputHold.d.ts.map +1 -0
- package/dist/Layer/inputHold.js +636 -0
- package/dist/Layer/outsidePress.d.ts +4 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +18 -1
- package/dist/Layer/preserveAnimations.d.ts +1 -5
- package/dist/Layer/preserveAnimations.d.ts.map +1 -1
- package/dist/Layer/preserveAnimations.js +12 -214
- package/dist/Layer/useBackdropPress.d.ts +8 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -1
- package/dist/Layer/useBackdropPress.js +31 -2
- package/dist/Layer/useLayer.d.ts +3 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +64 -4
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Layout/LayoutContent.d.ts +3 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +12 -4
- package/dist/Layout/LayoutPanel.d.ts +13 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +70 -9
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -0
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +1 -0
- package/dist/List/ListItem.d.ts +5 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +45 -9
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +56 -39
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +11 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +39 -1
- package/dist/MoreMenu/MoreMenu.d.ts +5 -3
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -9
- package/dist/NumberInput/NumberInput.d.ts +4 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +244 -11
- package/dist/Popover/usePopover.d.ts +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +12 -5
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +14 -11
- package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +6 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +16 -3
- package/dist/Resizable/ResizeHandle.d.ts +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +44 -5
- package/dist/Resizable/resizablePane.d.ts +58 -0
- package/dist/Resizable/resizablePane.d.ts.map +1 -0
- package/dist/Resizable/resizablePane.js +137 -0
- package/dist/Resizable/useResizable.d.ts +7 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +13 -0
- package/dist/SelectableCard/SelectableCard.d.ts +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +5 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +51 -10
- package/dist/SideNav/SideNav.d.ts +9 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +45 -10
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +14 -71
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.d.ts.map +1 -1
- package/dist/Spinner/spinnerRotor.d.ts +28 -0
- package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
- package/dist/Spinner/spinnerRotor.js +98 -0
- package/dist/Stack/StackItem.d.ts +8 -4
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +17 -4
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -10
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -8
- package/dist/Timestamp/formatInstant.d.ts +10 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +13 -27
- package/dist/Timestamp/tooltipEntries.d.ts +5 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +6 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +9 -0
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +4 -1
- package/dist/Tokenizer/Tokenizer.d.ts +14 -10
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +189 -89
- package/dist/Tooltip/useTooltip.d.ts +3 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +164 -59
- package/dist/TreeList/TreeListItem.d.ts +2 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -3
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/astryx.css +362 -325
- package/dist/gestures/GestureHost.d.ts +2 -2
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +21 -6
- package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +15 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.d.ts +3 -6
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +7 -52
- package/dist/gestures/wheelSegmenter.d.ts +68 -1
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +199 -10
- package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
- package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
- package/dist/hooks/StackItemScrollRegion.js +40 -0
- package/dist/hooks/computeOverflow.d.ts +2 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +1 -1
- package/dist/hooks/menuPressGesture.d.ts +133 -21
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +155 -30
- package/dist/hooks/menuPressValues.d.ts +16 -0
- package/dist/hooks/menuPressValues.d.ts.map +1 -0
- package/dist/hooks/menuPressValues.js +18 -0
- package/dist/hooks/useClickableContainer.d.ts +36 -7
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +63 -14
- package/dist/hooks/useFocusTrap.d.ts +10 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +225 -132
- package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
- package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHighlight.js +38 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +37 -12
- package/dist/hooks/useMenuPress.d.ts +34 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +93 -5
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +190 -21
- package/dist/hooks/usePressFeedback.d.ts +6 -6
- package/dist/hooks/usePressFeedback.js +6 -6
- package/dist/hooks/useScrollRegionProps.d.ts +35 -0
- package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
- package/dist/hooks/useScrollRegionProps.js +51 -0
- package/dist/i18n/InternationalizationContext.d.ts +6 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.d.ts +23 -3
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +8 -3
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/DateInput.generated.js +0 -1
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +16 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +0 -1
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/useCalendarSystem.d.ts +19 -0
- package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
- package/dist/i18n/useCalendarSystem.js +61 -0
- package/dist/internal/calendar-system.d.ts +18 -0
- package/dist/internal/calendar-system.d.ts.map +1 -0
- package/dist/internal/calendar-system.js +19 -0
- package/dist/internal/spinner-rotor.d.ts +16 -0
- package/dist/internal/spinner-rotor.d.ts.map +1 -0
- package/dist/internal/spinner-rotor.js +16 -0
- package/dist/internal/touch.d.ts +14 -1
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +20 -2
- package/dist/motion/carryAnimations.d.ts +58 -0
- package/dist/motion/carryAnimations.d.ts.map +1 -0
- package/dist/motion/carryAnimations.js +305 -0
- package/dist/motion/transientCopy.d.ts +4 -2
- package/dist/motion/transientCopy.d.ts.map +1 -1
- package/dist/motion/transientCopy.js +34 -5
- package/dist/motion/uikit/gestures.d.ts +41 -0
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +25 -0
- package/dist/motion/uikit/index.d.ts +1 -1
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +1 -1
- package/dist/motion/uikit/timing.d.ts +14 -10
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +7 -5
- package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
- package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
- package/dist/privateAttributes/press.stylex.d.ts +142 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/press.stylex.js +101 -0
- package/dist/theme/themeMotion.d.ts +3 -2
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +3 -2
- package/dist/theme/tokens.stylex.d.ts +2 -2
- package/dist/theme/tokens.stylex.js +1 -1
- package/dist/utils/calendarDateParser.d.ts +110 -0
- package/dist/utils/calendarDateParser.d.ts.map +1 -0
- package/dist/utils/calendarDateParser.js +1225 -0
- package/dist/utils/calendarSystem.d.ts +176 -0
- package/dist/utils/calendarSystem.d.ts.map +1 -0
- package/dist/utils/calendarSystem.js +569 -0
- package/dist/utils/coarsePointer.d.ts +5 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -1
- package/dist/utils/coarsePointer.js +22 -13
- package/dist/utils/flatTree.d.ts +6 -3
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +13 -3
- package/dist/utils/focusReturn.d.ts +10 -2
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +16 -3
- package/dist/utils/hitArea.d.ts +8 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +99 -9
- package/dist/utils/inputPresentation.d.ts +9 -1
- package/dist/utils/inputPresentation.d.ts.map +1 -1
- package/dist/utils/inputPresentation.js +15 -1
- package/dist/utils/inputStream.d.ts +14 -1
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +40 -9
- package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +29 -31
- package/dist/utils/plainDate.d.ts +38 -7
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +92 -18
- package/dist/utils/pressFeedback.d.ts +10 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +40 -15
- package/dist/utils/pressGesture.d.ts +12 -6
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +26 -8
- package/dist/utils/scrollView.d.ts +25 -0
- package/dist/utils/scrollView.d.ts.map +1 -0
- package/dist/utils/scrollView.js +108 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +1 -10
- package/dist/utils/touchHitArea.d.ts +30 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +167 -0
- package/dist/utils/touchHitArea.stylex.d.ts +38 -0
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
- package/dist/utils/touchHitArea.stylex.js +48 -0
- package/dist/utils/triggerFocus.d.ts +5 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -1
- package/dist/utils/triggerFocus.js +9 -2
- package/locales/en.json +21 -1
- package/locales/pseudo.json +15 -0
- package/package.json +15 -4
- package/src/AppShell/observeMainOverflow.ts +9 -6
- package/src/BottomSheet/BottomSheet.tsx +7 -2
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/BottomSheet/useSheetGestures.ts +83 -20
- package/src/Calendar/Calendar.doc.mjs +76 -6
- package/src/Calendar/Calendar.tsx +123 -104
- package/src/Calendar/getInitialFocusDate.ts +22 -8
- package/src/Calendar/hooks/useCalendarDays.ts +89 -63
- package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
- package/src/CheckboxInput/CheckboxInput.doc.mjs +5 -4
- package/src/CheckboxInput/CheckboxInput.tsx +105 -20
- package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/CheckboxList/CheckboxListItem.tsx +35 -14
- package/src/ClickableCard/ClickableCard.tsx +8 -1
- package/src/ContextMenu/ContextMenu.tsx +2 -0
- package/src/DateInput/DateInput.doc.mjs +45 -12
- package/src/DateInput/DateInput.tsx +165 -179
- package/src/DateInput/MonthScroller.tsx +39 -37
- package/src/DateInput/MonthYearWheels.tsx +68 -47
- package/src/DateInput/PickerWheel.tsx +7 -2
- package/src/DateInput/TouchDateField.tsx +45 -17
- package/src/DateInput/monthGeometry.ts +110 -8
- package/src/DateInput/useCalendarPresentation.ts +64 -0
- package/src/DateInput/useTypedDate.ts +469 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +9 -0
- package/src/DateRangeInput/DateRangeInput.tsx +43 -9
- package/src/DateTimeInput/DateTimeInput.doc.mjs +42 -9
- package/src/DateTimeInput/DateTimeInput.tsx +138 -148
- package/src/DateTimeInput/TouchDateTimeField.tsx +31 -16
- package/src/Dialog/Dialog.doc.mjs +1 -1
- package/src/Dialog/Dialog.tsx +14 -2
- package/src/Drawer/Drawer.doc.mjs +1 -1
- package/src/Drawer/useDrawerDialogPresence.ts +9 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
- package/src/DropdownMenu/DropdownMenu.tsx +31 -7
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
- package/src/FileInput/FileInput.tsx +16 -2
- package/src/HoverCard/useHoverCard.tsx +3 -1
- package/src/InfoTip/InfoTip.doc.mjs +26 -2
- package/src/InfoTip/InfoTip.tsx +6 -27
- package/src/InputGroup/InputGroup.doc.mjs +4 -3
- package/src/InputGroup/InputGroup.tsx +4 -3
- package/src/InputGroup/groupStyles.ts +3 -1
- package/src/Item/Item.tsx +139 -35
- package/src/Item/ItemListRowContext.tsx +18 -0
- package/src/Layer/holdEntranceInput.ts +84 -0
- package/src/Layer/inputHold.ts +734 -0
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/preserveAnimations.ts +12 -275
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useLayer.tsx +77 -4
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Layout/LayoutContent.doc.mjs +6 -3
- package/src/Layout/LayoutContent.tsx +10 -4
- package/src/Layout/LayoutPanel.doc.mjs +14 -11
- package/src/Layout/LayoutPanel.tsx +98 -15
- package/src/Lightbox/Lightbox.tsx +4 -0
- package/src/List/List.doc.mjs +10 -1
- package/src/List/List.tsx +5 -0
- package/src/List/ListItem.tsx +63 -8
- package/src/Markdown/parser.ts +65 -42
- package/src/MetadataList/MetadataList.tsx +1 -1
- package/src/MobileNav/MobileNav.doc.mjs +3 -3
- package/src/MobileNav/MobileNav.tsx +39 -1
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
- package/src/MoreMenu/MoreMenu.tsx +5 -3
- package/src/MultiSelector/MultiSelector.tsx +7 -17
- package/src/NumberInput/NumberInput.doc.mjs +1 -1
- package/src/NumberInput/NumberInput.tsx +259 -11
- package/src/Popover/usePopover.tsx +1 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/PowerSearch/PowerSearch.tsx +20 -3
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -11
- package/src/PowerSearch/formatTokenValue.ts +7 -1
- package/src/RadioList/RadioListItem.doc.mjs +3 -2
- package/src/RadioList/RadioListItem.tsx +16 -6
- package/src/Resizable/Resizable.doc.mjs +40 -12
- package/src/Resizable/ResizeHandle.tsx +68 -6
- package/src/Resizable/resizablePane.ts +179 -0
- package/src/Resizable/useResizable.ts +15 -0
- package/src/SelectableCard/SelectableCard.tsx +8 -1
- package/src/Selector/Selector.tsx +83 -8
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.tsx +87 -12
- package/src/Spinner/Spinner.tsx +7 -89
- package/src/Spinner/index.ts +1 -5
- package/src/Spinner/spinnerRotor.ts +113 -0
- package/src/Stack/Stack.doc.mjs +1 -1
- package/src/Stack/StackItem.tsx +27 -13
- package/src/Switch/Switch.tsx +7 -6
- package/src/TabList/Tab.tsx +5 -1
- package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -3
- package/src/Timestamp/Timestamp.tsx +13 -8
- package/src/Timestamp/formatInstant.ts +49 -28
- package/src/Timestamp/tooltipEntries.ts +7 -3
- package/src/Token/Token.tsx +18 -1
- package/src/Token/TokenLink.tsx +7 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
- package/src/Tokenizer/Tokenizer.tsx +252 -115
- package/src/Tooltip/useTooltip.tsx +180 -80
- package/src/TreeList/TreeListItem.tsx +36 -2
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/gestures/GestureHost.ts +21 -5
- package/src/gestures/PanGestureRecognizer.ts +19 -2
- package/src/gestures/README.md +14 -5
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
- package/src/gestures/nativeScroll.ts +12 -68
- package/src/gestures/wheelSegmenter.ts +243 -10
- package/src/hooks/StackItemScrollRegion.tsx +57 -0
- package/src/hooks/computeOverflow.ts +1 -1
- package/src/hooks/menuPressGesture.ts +244 -38
- package/src/hooks/menuPressValues.ts +18 -0
- package/src/hooks/useClickableContainer.doc.mjs +8 -2
- package/src/hooks/useClickableContainer.ts +93 -15
- package/src/hooks/useFocusTrap.ts +268 -151
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useMenuPress.ts +118 -11
- package/src/hooks/useOverflow.ts +297 -73
- package/src/hooks/usePressFeedback.doc.mjs +3 -3
- package/src/hooks/usePressFeedback.ts +6 -6
- package/src/hooks/useScrollRegionProps.ts +76 -0
- package/src/i18n/InternationalizationContext.ts +6 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
- package/src/i18n/InternationalizationProvider.tsx +35 -3
- package/src/i18n/generated-english/DateInput/DateInput.generated.ts +0 -1
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +17 -0
- package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +0 -1
- package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
- package/src/i18n/generated-locales/en.generated.ts +7 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useCalendarSystem.ts +95 -0
- package/src/internal/calendar-system.ts +26 -0
- package/src/internal/spinner-rotor.ts +20 -0
- package/src/internal/touch.ts +34 -1
- package/src/motion/MEASUREMENTS.md +11 -0
- package/src/motion/carryAnimations.ts +389 -0
- package/src/motion/transientCopy.ts +45 -5
- package/src/motion/uikit/gestures.ts +22 -0
- package/src/motion/uikit/index.ts +1 -0
- package/src/motion/uikit/timing.ts +7 -5
- package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
- package/src/privateAttributes/press.stylex.ts +261 -0
- package/src/theme/themeMotion.ts +3 -2
- package/src/theme/tokens.stylex.ts +1 -1
- package/src/utils/calendarDateParser.ts +1385 -0
- package/src/utils/calendarSystem.ts +832 -0
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/flatTree.ts +15 -3
- package/src/utils/focusReturn.ts +17 -3
- package/src/utils/hitArea.ts +138 -9
- package/src/utils/inputPresentation.ts +21 -1
- package/src/utils/inputStream.ts +47 -10
- package/src/utils/interactionOverlay.stylex.ts +19 -22
- package/src/utils/plainDate.ts +130 -19
- package/src/utils/pressFeedback.ts +46 -14
- package/src/utils/pressGesture.ts +35 -9
- package/src/utils/scrollView.ts +135 -0
- package/src/utils/selectionLock.ts +5 -10
- package/src/utils/touchHitArea.stylex.ts +56 -0
- package/src/utils/touchHitArea.ts +177 -0
- package/src/utils/triggerFocus.ts +17 -4
|
@@ -50,6 +50,7 @@ import { buildRelativeDateOptions, PowerSearchValueEditor } from "./PowerSearchV
|
|
|
50
50
|
import { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
51
51
|
import { themeProps } from "../utils/themeProps.js";
|
|
52
52
|
import { useLocale } from "../i18n/useLocale.js";
|
|
53
|
+
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
53
54
|
import { formatTokenValueText } from "./formatTokenValue.js";
|
|
54
55
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
55
56
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
@@ -306,6 +307,7 @@ export function PowerSearch({
|
|
|
306
307
|
const searchSource = usePowerSearchSource(config, maxSearchResults);
|
|
307
308
|
const t = useComponentTranslator();
|
|
308
309
|
const locale = useLocale();
|
|
310
|
+
const calendar = useCalendarSystem(undefined, 'PowerSearch');
|
|
309
311
|
const label = labelFromProps ?? t('@astryx.powersearch.label');
|
|
310
312
|
const placeholder = placeholderFromProps ?? t('@astryx.powersearch.placeholder');
|
|
311
313
|
const popoverSaveButtonLabel = popoverSaveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
|
|
@@ -398,13 +400,13 @@ export function PowerSearch({
|
|
|
398
400
|
const fieldLabel = field?.label ?? '';
|
|
399
401
|
const operatorLabel = operator ? resolveOperatorLabel(operator, t) : '';
|
|
400
402
|
const label = `${fieldLabel}: ${operatorLabel}`.trim();
|
|
401
|
-
const value = operator ? formatTokenValueText(operator.value, filter.value, Math.max(maxTokenLength - fieldLabel.length - operatorLabel.length, 10), locale, undefined, undefined, timezoneID) : null;
|
|
403
|
+
const value = operator ? formatTokenValueText(operator.value, filter.value, Math.max(maxTokenLength - fieldLabel.length - operatorLabel.length, 10), locale, calendar, undefined, undefined, timezoneID) : null;
|
|
402
404
|
return {
|
|
403
405
|
label,
|
|
404
406
|
value,
|
|
405
407
|
full: value != null ? `${label} ${value}` : label
|
|
406
408
|
};
|
|
407
|
-
}, [config, maxTokenLength, t, locale, timezoneID]);
|
|
409
|
+
}, [config, maxTokenLength, t, locale, timezoneID, calendar]);
|
|
408
410
|
// The built-in token being edited. A token from a `components` override
|
|
409
411
|
// names itself, so its editor keeps the plain popover.
|
|
410
412
|
const editedFilter = popoverState.type === 'editing' ? filters[popoverState.filterIndex] : undefined;
|
|
@@ -526,7 +528,7 @@ export function PowerSearch({
|
|
|
526
528
|
const operator = config.getOperator(filter.field, filter.operator);
|
|
527
529
|
const resolvedOp = operator ? resolveOperatorLabel(operator, t) : '';
|
|
528
530
|
const operatorLabel = resolvedOp ? `: ${resolvedOp}` : '';
|
|
529
|
-
const valueStr = operator ? formatFilterValue(config, operator.value, filter.value, maxTokenLength, t, locale, timezoneID) : '';
|
|
531
|
+
const valueStr = operator ? formatFilterValue(config, operator.value, filter.value, maxTokenLength, t, locale, timezoneID, calendar) : '';
|
|
530
532
|
const displayLabel = valueStr ? `${field?.label ?? filter.field}${operatorLabel} ${valueStr}` : `${field?.label ?? filter.field}${operatorLabel}`;
|
|
531
533
|
return {
|
|
532
534
|
id: `filter-${index}-${filter.field}-${filter.operator}`,
|
|
@@ -539,7 +541,7 @@ export function PowerSearch({
|
|
|
539
541
|
}
|
|
540
542
|
};
|
|
541
543
|
});
|
|
542
|
-
}, [filters, config, maxTokenLength, timezoneID, t, locale]);
|
|
544
|
+
}, [filters, config, maxTokenLength, timezoneID, t, locale, calendar]);
|
|
543
545
|
|
|
544
546
|
// Handle tokenizer onChange (field selected from typeahead)
|
|
545
547
|
const handleTokenizerChange = useCallback((_items, change) => {
|
|
@@ -1032,7 +1034,12 @@ export function PowerSearch({
|
|
|
1032
1034
|
className: "xjyslct xfoc8du xkh2ocl x78zum5 x6s0dn4 xt970qd x7a5moj x1ghz6dp xc342km xng3xce xjbqb8w xv1l7n4 x9ynric xjm74w1 xw6l6zx x1yc453h xuxw1ft x1ypdohk xvivl9a x1a2a7pz x10l6tqk x10a8y8t xeuugli x1717udv"
|
|
1033
1035
|
}
|
|
1034
1036
|
}[!!(filters.length > 0) << 0],
|
|
1035
|
-
children: filters.length === 0 ?
|
|
1037
|
+
children: filters.length === 0 ? /*#__PURE__*/_jsx("span", {
|
|
1038
|
+
...{
|
|
1039
|
+
className: "xeuugli xb3r6kr xlyipyv xuxw1ft"
|
|
1040
|
+
},
|
|
1041
|
+
children: placeholder
|
|
1042
|
+
}) : null
|
|
1036
1043
|
})]
|
|
1037
1044
|
}), (endContent || isRenderable(resultCountText)) && /*#__PURE__*/_jsxs("div", {
|
|
1038
1045
|
ref: endLaneRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchBottomSheet.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchBottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchBottomSheet.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchBottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAmCrD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAe3D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAIV,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EAEjB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAajB;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IACtD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;CAC3D;AAED,MAAM,WAAW,2BAA2B;IAC1C,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,aAAa,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,yEAAyE;IACzE,UAAU,EAAE,iBAAiB,CAAC;IAC9B,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,EAAE,CACR,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;IACV,4EAA4E;IAC5E,YAAY,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC5C,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAMD,kJAAkJ;AAClJ,UAAU,SAAS;IACjB,MAAM,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACzC,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACxC,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAwCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACtC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAC/B,MAAM,EAAE,CACN,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,KACV,IAAI,GACR,aAAa,CAAC,iBAAiB,CAAC,CA+ClC;AAwmBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,EACN,UAAU,EACV,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,eAAe,EAAE,wBAAwB,EACzC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,GACR,EAAE,2BAA2B,qBAqsD7B;yBAztDe,sBAAsB"}
|
|
@@ -62,6 +62,7 @@ import { TextInput } from "../TextInput/TextInput.js";
|
|
|
62
62
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
63
63
|
import { useListFormatter } from "../i18n/useListFormatter.js";
|
|
64
64
|
import { useLocale } from "../i18n/useLocale.js";
|
|
65
|
+
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
65
66
|
import { SheetConfirmation } from "../internal/SheetConfirmation.js";
|
|
66
67
|
import { useDismissSearchOnTouchDrag } from "../internal/useDismissSearchOnTouchDrag.js";
|
|
67
68
|
import "../theme/tokens.stylex.js";
|
|
@@ -609,6 +610,7 @@ export function PowerSearchBottomSheet({
|
|
|
609
610
|
} = editors;
|
|
610
611
|
const t = useComponentTranslator();
|
|
611
612
|
const locale = useLocale();
|
|
613
|
+
const calendar = useCalendarSystem(undefined, 'PowerSearch');
|
|
612
614
|
const formatList = useListFormatter();
|
|
613
615
|
const isInteractive = !isDisabled && !isReadOnly;
|
|
614
616
|
|
|
@@ -1037,12 +1039,12 @@ export function PowerSearchBottomSheet({
|
|
|
1037
1039
|
// as the value step's choice row does ("3 days ago"), through the
|
|
1038
1040
|
// catalog's relative-date messages, so the sheet agrees with itself. The popover token
|
|
1039
1041
|
// shows the stored key (a known gap of the record).
|
|
1040
|
-
const value = operator.value.type === 'date_relative' && filter.value.type === 'date_relative' ? resolveRelativeDateLabel(operator.value, filter.value.value, t, editors.buildRelativeDateOptions) : formatTokenValueText(operator.value, filter.value, Number.MAX_SAFE_INTEGER, locale, t, formatList, timezoneID);
|
|
1042
|
+
const value = operator.value.type === 'date_relative' && filter.value.type === 'date_relative' ? resolveRelativeDateLabel(operator.value, filter.value.value, t, editors.buildRelativeDateOptions) : formatTokenValueText(operator.value, filter.value, Number.MAX_SAFE_INTEGER, locale, calendar, t, formatList, timezoneID);
|
|
1041
1043
|
return {
|
|
1042
1044
|
label,
|
|
1043
1045
|
value
|
|
1044
1046
|
};
|
|
1045
|
-
}, [config, editors, formatList, locale, t, timezoneID]);
|
|
1047
|
+
}, [calendar, config, editors, formatList, locale, t, timezoneID]);
|
|
1046
1048
|
const describeFilter = useCallback(filter => {
|
|
1047
1049
|
const parts = describeFilterParts(filter);
|
|
1048
1050
|
return parts.value ? t('@astryx.powersearch.sheet.labelValue', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchToken.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchToken.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchToken.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchToken.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AASnD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE,qBAAqB,qBAiDvB;yBA3De,gBAAgB"}
|
|
@@ -12,6 +12,7 @@ import React from 'react';
|
|
|
12
12
|
import * as stylex from '@stylexjs/stylex';
|
|
13
13
|
import { Token } from "../Token/index.js";
|
|
14
14
|
import { useLocale } from "../i18n/useLocale.js";
|
|
15
|
+
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
15
16
|
import "../theme/tokens.stylex.js";
|
|
16
17
|
import { fontWeightVars } from "../theme/tokens.stylex.js";
|
|
17
18
|
import { formatFilterValue } from "./formatFilterValue.js";
|
|
@@ -40,12 +41,13 @@ export function PowerSearchToken({
|
|
|
40
41
|
const config = useInternalConfig(configProp);
|
|
41
42
|
const t = useComponentTranslator();
|
|
42
43
|
const locale = useLocale();
|
|
44
|
+
const calendar = useCalendarSystem(undefined, 'PowerSearchToken');
|
|
43
45
|
const fieldLabel = field.label;
|
|
44
46
|
const resolvedOperatorLabel = resolveOperatorLabel(operator, t);
|
|
45
47
|
const operatorLabel = resolvedOperatorLabel ? `: ${resolvedOperatorLabel}` : '';
|
|
46
48
|
const tokenLabel = `${fieldLabel}${operatorLabel}`;
|
|
47
49
|
const adjustedMaxLength = Math.max(maxLength - fieldLabel.length - resolvedOperatorLabel.length, 10);
|
|
48
|
-
const valueStr = formatFilterValue(config, operator.value, filter.value, adjustedMaxLength, t, locale, timezoneID);
|
|
50
|
+
const valueStr = formatFilterValue(config, operator.value, filter.value, adjustedMaxLength, t, locale, timezoneID, calendar);
|
|
49
51
|
const valueContent = valueStr ? /*#__PURE__*/_jsx("span", {
|
|
50
52
|
...{
|
|
51
53
|
className: "x1lvx875"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file formatFilterValue.ts
|
|
3
|
-
* @input OperatorValue, FilterValue, config
|
|
3
|
+
* @input OperatorValue, FilterValue, config, locale, time zone, calendar
|
|
4
4
|
* @output Formatted display string for a filter value
|
|
5
5
|
* @position Pure utility; consumed by PowerSearch token rendering
|
|
6
6
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import type { OperatorValue, FilterValue } from './types.js';
|
|
11
11
|
import type { InternalConfig } from './useInternalConfig.js';
|
|
12
12
|
import type { Locale, TranslatorFn } from '../i18n/index.js';
|
|
13
|
+
import { type CalendarSystem } from '../utils/calendarSystem.js';
|
|
13
14
|
/**
|
|
14
15
|
* A number in the provider locale's digits, decimal mark, and — unless the
|
|
15
16
|
* options say otherwise — grouping. The shared number helper for
|
|
@@ -25,6 +26,11 @@ export declare function formatSharedNumber(value: number, locale: Locale, option
|
|
|
25
26
|
* `isDateOnly: false` is an instant: its date and time in `timezoneID`,
|
|
26
27
|
* else the viewer's zone, the time its editor reads and writes.
|
|
27
28
|
*/
|
|
28
|
-
export declare function formatDateAbsolute(unixSeconds: number, locale: Locale, timezoneID: string | undefined, isDateOnly?: boolean): string;
|
|
29
|
-
|
|
29
|
+
export declare function formatDateAbsolute(unixSeconds: number, locale: Locale, timezoneID: string | undefined, isDateOnly?: boolean, calendar?: CalendarSystem): string;
|
|
30
|
+
/**
|
|
31
|
+
* The display text of a filter value. A `date_absolute` value is written in
|
|
32
|
+
* `calendar`, which defaults to Gregorian; PowerSearch passes the calendar that
|
|
33
|
+
* its provider resolves.
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatFilterValue(_config: InternalConfig, operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, t: TranslatorFn, locale: Locale, timezoneID?: string, calendar?: CalendarSystem): string;
|
|
30
36
|
//# sourceMappingURL=formatFilterValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAyBjC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,IAAI,CACZ,IAAI,CAAC,mBAAmB,EACxB,aAAa,GAAG,uBAAuB,CACxC,GACA,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,UAAU,UAAO,EACjB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CAiBR;AAcD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,CAAC,EAAE,YAAY,EACf,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CA+HR"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file formatFilterValue.ts
|
|
5
|
-
* @input OperatorValue, FilterValue, config
|
|
5
|
+
* @input OperatorValue, FilterValue, config, locale, time zone, calendar
|
|
6
6
|
* @output Formatted display string for a filter value
|
|
7
7
|
* @position Pure utility; consumed by PowerSearch token rendering
|
|
8
8
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - /packages/core/src/PowerSearch/index.ts
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { formatCalendarInstant } from "../utils/calendarSystem.js";
|
|
13
14
|
import { truncateCharacters } from "../utils/characters.js";
|
|
14
15
|
import { registerEnglishFallback } from "../i18n/englishFallback.js";
|
|
15
16
|
import english from "../i18n/generated-english/PowerSearch/formatFilterValue.generated.js";
|
|
@@ -45,23 +46,19 @@ export function formatSharedNumber(value, locale, options) {
|
|
|
45
46
|
* `isDateOnly: false` is an instant: its date and time in `timezoneID`,
|
|
46
47
|
* else the viewer's zone, the time its editor reads and writes.
|
|
47
48
|
*/
|
|
48
|
-
export function formatDateAbsolute(unixSeconds, locale, timezoneID, isDateOnly = true) {
|
|
49
|
+
export function formatDateAbsolute(unixSeconds, locale, timezoneID, isDateOnly = true, calendar = 'gregory') {
|
|
49
50
|
const options = isDateOnly ? {
|
|
50
51
|
year: 'numeric',
|
|
51
52
|
month: 'short',
|
|
52
|
-
day: 'numeric'
|
|
53
|
-
timeZone: resolveDateZone(timezoneID, true),
|
|
54
|
-
calendar: 'gregory'
|
|
53
|
+
day: 'numeric'
|
|
55
54
|
} : {
|
|
56
55
|
year: 'numeric',
|
|
57
56
|
month: 'short',
|
|
58
57
|
day: 'numeric',
|
|
59
58
|
hour: 'numeric',
|
|
60
|
-
minute: '2-digit'
|
|
61
|
-
timeZone: resolveDateZone(timezoneID, false),
|
|
62
|
-
calendar: 'gregory'
|
|
59
|
+
minute: '2-digit'
|
|
63
60
|
};
|
|
64
|
-
return
|
|
61
|
+
return formatCalendarInstant(calendar, new Date(unixSeconds * 1000), options, locale, resolveDateZone(timezoneID, isDateOnly));
|
|
65
62
|
}
|
|
66
63
|
function formatRelativeDate(value) {
|
|
67
64
|
// value is stored as a descriptive string like "7d" or "1w"
|
|
@@ -70,7 +67,13 @@ function formatRelativeDate(value) {
|
|
|
70
67
|
function formatDateRange(_value, t) {
|
|
71
68
|
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
72
69
|
}
|
|
73
|
-
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The display text of a filter value. A `date_absolute` value is written in
|
|
73
|
+
* `calendar`, which defaults to Gregorian; PowerSearch passes the calendar that
|
|
74
|
+
* its provider resolves.
|
|
75
|
+
*/
|
|
76
|
+
export function formatFilterValue(_config, operatorValue, filterValue, maxLength, t, locale, timezoneID, calendar = 'gregory') {
|
|
74
77
|
switch (filterValue.type) {
|
|
75
78
|
case 'empty':
|
|
76
79
|
return '';
|
|
@@ -148,7 +151,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
148
151
|
case 'time':
|
|
149
152
|
return filterValue.value;
|
|
150
153
|
case 'date_absolute':
|
|
151
|
-
return truncate(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false), maxLength);
|
|
154
|
+
return truncate(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false, calendar), maxLength);
|
|
152
155
|
case 'date_relative':
|
|
153
156
|
return formatRelativeDate(filterValue.value);
|
|
154
157
|
case 'date_range':
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview The text a PowerSearch filter token shows for a value.
|
|
3
3
|
*
|
|
4
|
-
* @input `OperatorValue`, `FilterValue`, a width budget, and the
|
|
4
|
+
* @input `OperatorValue`, `FilterValue`, a width budget, the locale, and the
|
|
5
|
+
* calendar.
|
|
5
6
|
* @output `formatTokenValueText` — one string, or null for an empty value.
|
|
6
7
|
* @position Shared by the token itself (`PowerSearch.tsx`) and the sheet
|
|
7
8
|
* presentation's Filters rows and removal announcement
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
*/
|
|
11
12
|
import type { OperatorValue, FilterValue } from './types.js';
|
|
12
13
|
import type { Locale, TranslatorFn } from '../i18n/index.js';
|
|
14
|
+
import type { CalendarSystem } from '../utils/calendarSystem.js';
|
|
13
15
|
type ListFormatFn = (items: ReadonlyArray<string>) => string;
|
|
14
16
|
/**
|
|
15
17
|
* The text a filter token shows for a value: the one place that decides how
|
|
@@ -17,12 +19,14 @@ type ListFormatFn = (items: ReadonlyArray<string>) => string;
|
|
|
17
19
|
* the sheet presentation's Filters rows and its removal announcement — can
|
|
18
20
|
* use the same words and the same zone handling. `maxLength` is the token's
|
|
19
21
|
* width budget; pass `Number.MAX_SAFE_INTEGER` for the untruncated text.
|
|
22
|
+
* A `date_absolute` value is written in `calendar`, the calendar that the
|
|
23
|
+
* provider resolves.
|
|
20
24
|
* With `t`, the list, date-range and nested summaries resolve through the
|
|
21
25
|
* catalog (`@astryx.powersearch.valueEditor.*`); without it they are the
|
|
22
26
|
* token's own literals. With `formatList` (the provider's list formatter),
|
|
23
27
|
* several labels join as a list in the locale; without it they join with
|
|
24
28
|
* the token's literal ", ".
|
|
25
29
|
*/
|
|
26
|
-
export declare function formatTokenValueText(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, locale: Locale, t?: TranslatorFn, formatList?: ListFormatFn, timezoneID?: string): string | null;
|
|
30
|
+
export declare function formatTokenValueText(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, locale: Locale, calendar: CalendarSystem, t?: TranslatorFn, formatList?: ListFormatFn, timezoneID?: string): string | null;
|
|
27
31
|
export {};
|
|
28
32
|
//# sourceMappingURL=formatTokenValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatTokenValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatTokenValue.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"formatTokenValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatTokenValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAQ5D,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC;AA6E7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,CAAC,CAAC,EAAE,YAAY,EAChB,UAAU,CAAC,EAAE,YAAY,EACzB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAqGf"}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview The text a PowerSearch filter token shows for a value.
|
|
5
5
|
*
|
|
6
|
-
* @input `OperatorValue`, `FilterValue`, a width budget, and the
|
|
6
|
+
* @input `OperatorValue`, `FilterValue`, a width budget, the locale, and the
|
|
7
|
+
* calendar.
|
|
7
8
|
* @output `formatTokenValueText` — one string, or null for an empty value.
|
|
8
9
|
* @position Shared by the token itself (`PowerSearch.tsx`) and the sheet
|
|
9
10
|
* presentation's Filters rows and removal announcement
|
|
@@ -88,13 +89,15 @@ function formatListText(labels, maxLength, t, formatList) {
|
|
|
88
89
|
* the sheet presentation's Filters rows and its removal announcement — can
|
|
89
90
|
* use the same words and the same zone handling. `maxLength` is the token's
|
|
90
91
|
* width budget; pass `Number.MAX_SAFE_INTEGER` for the untruncated text.
|
|
92
|
+
* A `date_absolute` value is written in `calendar`, the calendar that the
|
|
93
|
+
* provider resolves.
|
|
91
94
|
* With `t`, the list, date-range and nested summaries resolve through the
|
|
92
95
|
* catalog (`@astryx.powersearch.valueEditor.*`); without it they are the
|
|
93
96
|
* token's own literals. With `formatList` (the provider's list formatter),
|
|
94
97
|
* several labels join as a list in the locale; without it they join with
|
|
95
98
|
* the token's literal ", ".
|
|
96
99
|
*/
|
|
97
|
-
export function formatTokenValueText(operatorValue, filterValue, maxLength, locale, t, formatList, timezoneID) {
|
|
100
|
+
export function formatTokenValueText(operatorValue, filterValue, maxLength, locale, calendar, t, formatList, timezoneID) {
|
|
98
101
|
switch (filterValue.type) {
|
|
99
102
|
case 'empty':
|
|
100
103
|
return null;
|
|
@@ -130,7 +133,7 @@ export function formatTokenValueText(operatorValue, filterValue, maxLength, loca
|
|
|
130
133
|
return filterValue.value;
|
|
131
134
|
case 'date_absolute':
|
|
132
135
|
// The token reads a value in the zone its editor uses.
|
|
133
|
-
return truncateString(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false), maxLength);
|
|
136
|
+
return truncateString(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false, calendar), maxLength);
|
|
134
137
|
case 'date_relative':
|
|
135
138
|
return truncateString(filterValue.value, maxLength);
|
|
136
139
|
case 'date_range':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAe5C,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AAsIlD,MAAM,WAAW,kBAAmB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;OAUG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EAAE,cAAsB,EAClC,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,GAAG,IAAI,EACR,EAAE,kBAAkB,qBA+LpB;yBA9Me,aAAa"}
|
|
@@ -31,9 +31,13 @@ import "../Indicator/indicator.markers.stylex.js";
|
|
|
31
31
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
32
32
|
import { useIndicatorFocusRing } from "../hooks/useIndicatorFocusRing.js";
|
|
33
33
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
34
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
35
|
+
import { useTouchHitArea } from "../utils/touchHitArea.js";
|
|
36
|
+
import { touchHitAreaStyles } from "../utils/touchHitArea.stylex.js";
|
|
34
37
|
import { useIndicator } from "../Indicator/useIndicator.js";
|
|
35
38
|
import { Item } from "../Item/Item.js";
|
|
36
39
|
import { themeProps } from "../utils/themeProps.js";
|
|
40
|
+
import { rowPressLayerStyles } from "../privateAttributes/press.stylex.js";
|
|
37
41
|
|
|
38
42
|
// The touch press's paint, declared by the shared overlay styles on the
|
|
39
43
|
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
@@ -104,7 +108,6 @@ const rowStyles = {
|
|
|
104
108
|
kaIpWk: "x2u8bby",
|
|
105
109
|
k7Eaqz: "xeuugli",
|
|
106
110
|
kWkggS: "xjbqb8w",
|
|
107
|
-
kKwaWg: "x18o3ruo",
|
|
108
111
|
$$css: true
|
|
109
112
|
},
|
|
110
113
|
press: {
|
|
@@ -186,6 +189,13 @@ export function RadioListItem({
|
|
|
186
189
|
// since the visible label is now a plain (non-`<label>`) text node — a real
|
|
187
190
|
// `<label htmlFor>` would double-fire under delegation.
|
|
188
191
|
const radioRef = useRef(null);
|
|
192
|
+
|
|
193
|
+
// Under a coarse pointer an option's row grows toward 44 px through an
|
|
194
|
+
// invisible band, and the row keeps its size. A tap on the band lands on
|
|
195
|
+
// the row, which hands it to the radio. The band's insets stay live while
|
|
196
|
+
// the row takes taps, and clear when it stops.
|
|
197
|
+
const watchRowHitArea = useTouchHitArea(!isDisabled);
|
|
198
|
+
const mergedRowRef = useMergedRefs(ref, watchRowHitArea);
|
|
189
199
|
const radioCircle = /*#__PURE__*/_jsxs("div", {
|
|
190
200
|
...stylex.props(styles.radioWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay),
|
|
191
201
|
...focusProps,
|
|
@@ -251,7 +261,7 @@ export function RadioListItem({
|
|
|
251
261
|
children: [radioCircle, startContent]
|
|
252
262
|
}) : radioCircle;
|
|
253
263
|
return /*#__PURE__*/_jsx(Item, {
|
|
254
|
-
ref:
|
|
264
|
+
ref: mergedRowRef,
|
|
255
265
|
...(isDisabled ? undefined : pressable),
|
|
256
266
|
startContent: mediaContent
|
|
257
267
|
// Delegate row-surface clicks (label text, description, and the empty
|
|
@@ -276,11 +286,14 @@ export function RadioListItem({
|
|
|
276
286
|
// the painting row element (Item), the same element that carries the
|
|
277
287
|
// theme target, so a theme's hover styling stays in step with the tint.
|
|
278
288
|
!isDisabled && indicatorScope,
|
|
289
|
+
// The row keeps no press paint of its own: the circle paints, and
|
|
290
|
+
// reads the strength whose release the row keeps.
|
|
291
|
+
rowPressLayerStyles.cellWithoutLayer,
|
|
279
292
|
// Restore the bare default look: zero Item's padding/radius and its
|
|
280
293
|
// interactive hover/press background. Applied after Item's own base
|
|
281
294
|
// styles so it wins within the base layer; a `radio-list-item` theme
|
|
282
295
|
// still overrides it from the higher `astryx-theme` layer.
|
|
283
|
-
rowStyles.root, !isDisabled && rowStyles.press, xstyle],
|
|
296
|
+
rowStyles.root, !isDisabled && rowStyles.press, !isDisabled && touchHitAreaStyles.layer, xstyle],
|
|
284
297
|
...mergeProps(
|
|
285
298
|
// One target for every row, carrying its size and runtime state so a
|
|
286
299
|
// theme can express "selected option at large" or restyle disabled
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { BaseProps } from '../BaseProps.js';
|
|
3
|
-
import { type ResizableProps } from './useResizable.js';
|
|
3
|
+
import { type ResizableProps, type ResizableRegion } from './useResizable.js';
|
|
4
4
|
type PillPlacement = 'start' | 'end' | 'center' | 'auto';
|
|
5
5
|
export interface ResizeHandleProps extends Omit<BaseProps<HTMLDivElement>, 'style'> {
|
|
6
6
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -57,8 +57,8 @@ export interface ResizeHandleProps extends Omit<BaseProps<HTMLDivElement>, 'styl
|
|
|
57
57
|
* @default 'Resize handle'
|
|
58
58
|
*/
|
|
59
59
|
label?: string;
|
|
60
|
-
/**
|
|
61
|
-
resizable?: ResizableProps;
|
|
60
|
+
/** The output of `useResizable()`, or its `props`. */
|
|
61
|
+
resizable?: ResizableRegion | ResizableProps;
|
|
62
62
|
/** Custom handle content. Overrides the default pill. */
|
|
63
63
|
children?: ReactNode;
|
|
64
64
|
}
|
|
@@ -72,12 +72,12 @@ export interface ResizeHandleProps extends Omit<BaseProps<HTMLDivElement>, 'styl
|
|
|
72
72
|
* @example
|
|
73
73
|
* ```
|
|
74
74
|
* <ResizeHandle
|
|
75
|
-
* resizable={
|
|
75
|
+
* resizable={resizable}
|
|
76
76
|
* direction="horizontal"
|
|
77
77
|
* hasDivider />
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
export declare function ResizeHandle({ direction, position: positionMode, isReversed, isDisabled, hasDivider, isAlwaysVisible, pillPlacement, label: labelFromProps, resizable, children, xstyle, className, ref, ...props }: ResizeHandleProps): import("react").JSX.Element;
|
|
80
|
+
export declare function ResizeHandle({ direction, position: positionMode, isReversed, isDisabled, hasDivider, isAlwaysVisible, pillPlacement, label: labelFromProps, resizable: resizableValue, children, xstyle, className, ref, ...props }: ResizeHandleProps): import("react").JSX.Element;
|
|
81
81
|
export declare namespace ResizeHandle {
|
|
82
82
|
var displayName: string;
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AA4BxB,KAAK,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AA8PzD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB,OAAO,CACR;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAEtC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAEhC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sDAAsD;IACtD,SAAS,CAAC,EAAE,eAAe,GAAG,cAAc,CAAC;IAE7C,yDAAyD;IACzD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,YAAY,CAAC,EAC3B,SAAwB,EACxB,QAAQ,EAAE,YAAuB,EACjC,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAsB,EACtB,aAAsB,EACtB,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,cAAc,EACzB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAyVnB;yBAxWe,YAAY"}
|
|
@@ -11,18 +11,21 @@
|
|
|
11
11
|
* A drag takes pointer capture on the element it starts on, so moves over an
|
|
12
12
|
* embedded frame still arrive.
|
|
13
13
|
*/
|
|
14
|
-
import { useEffect, useRef, useState } from 'react';
|
|
14
|
+
import { useCallback, useEffect, useReducer, useRef, useState } from 'react';
|
|
15
15
|
import * as stylex from '@stylexjs/stylex';
|
|
16
16
|
import "../theme/tokens.stylex.js";
|
|
17
17
|
import { colorVars, durationVars, easeVars, radiusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
18
18
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
19
19
|
import { mergeProps, rtlStyles } from "../utils/index.js";
|
|
20
|
-
import { getCollapseControls, getEffectiveMaxPx } from "./useResizable.js";
|
|
20
|
+
import { getCollapseControls, getEffectiveMaxPx, resizablePropsOf } from "./useResizable.js";
|
|
21
21
|
import { createResizeGesture } from "./resizeGesture.js";
|
|
22
|
+
import { handOverPane, registerResizeHandle, resizablePaneFor, watchResizablePanes } from "./resizablePane.js";
|
|
22
23
|
import { separatorAttributes } from "./separatorAttributes.js";
|
|
23
24
|
import { themeProps } from "../utils/themeProps.js";
|
|
24
25
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
26
|
+
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
25
27
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
28
|
+
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
26
29
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
27
30
|
import english from "../i18n/generated-english/Resizable/ResizeHandle.generated.js";
|
|
28
31
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -277,7 +280,7 @@ const dynamicStyles = {
|
|
|
277
280
|
* @example
|
|
278
281
|
* ```
|
|
279
282
|
* <ResizeHandle
|
|
280
|
-
* resizable={
|
|
283
|
+
* resizable={resizable}
|
|
281
284
|
* direction="horizontal"
|
|
282
285
|
* hasDivider />
|
|
283
286
|
* ```
|
|
@@ -292,13 +295,14 @@ export function ResizeHandle({
|
|
|
292
295
|
isAlwaysVisible = true,
|
|
293
296
|
pillPlacement = 'auto',
|
|
294
297
|
label: labelFromProps,
|
|
295
|
-
resizable,
|
|
298
|
+
resizable: resizableValue,
|
|
296
299
|
children,
|
|
297
300
|
xstyle,
|
|
298
301
|
className,
|
|
299
302
|
ref,
|
|
300
303
|
...props
|
|
301
304
|
}) {
|
|
305
|
+
const resizable = resizableValue == null ? undefined : resizablePropsOf(resizableValue);
|
|
302
306
|
const t = useComponentTranslator();
|
|
303
307
|
const label = labelFromProps ?? t('@astryx.resizable.handle.label');
|
|
304
308
|
const handleRef = useRef(null);
|
|
@@ -410,6 +414,41 @@ export function ResizeHandle({
|
|
|
410
414
|
};
|
|
411
415
|
}, [hasRegion, regionGesture]);
|
|
412
416
|
|
|
417
|
+
// --- The LayoutPanel beside a handle given `resizable` props ---
|
|
418
|
+
|
|
419
|
+
// A collapsing panel moves focus here, and the ring follows the last input.
|
|
420
|
+
const {
|
|
421
|
+
ref: modalityRef
|
|
422
|
+
} = useInteractionModalityTracking();
|
|
423
|
+
// A LayoutPanel at the region's size, with no `resizable` prop, has no
|
|
424
|
+
// controller to find it. This handle holds it collapsed with the region, so
|
|
425
|
+
// focus inside it moves here and it goes inert. A panel lent later is found
|
|
426
|
+
// at once.
|
|
427
|
+
const [, rerender] = useReducer(count => count + 1, 0);
|
|
428
|
+
const heldPaneRef = useRef(null);
|
|
429
|
+
// The element goes in the handle registry, for a collapsing panel beside it
|
|
430
|
+
// to hand focus to. When the element goes, a held panel opens.
|
|
431
|
+
const registryRef = useCallback(element => {
|
|
432
|
+
if (element == null) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const unregister = registerResizeHandle(element);
|
|
436
|
+
return () => {
|
|
437
|
+
unregister();
|
|
438
|
+
heldPaneRef.current = handOverPane(heldPaneRef.current, null, false, null);
|
|
439
|
+
};
|
|
440
|
+
}, []);
|
|
441
|
+
const isRegionCollapsed = resizable?._isCollapsed ?? false;
|
|
442
|
+
// Syncs with the lent-panel registry. A panel lent or taken back re-renders
|
|
443
|
+
// this handle, so it looks for its pane again.
|
|
444
|
+
useEffect(() => hasRegion ? watchResizablePanes(rerender) : undefined, [hasRegion]);
|
|
445
|
+
// Syncs the held panel with the region's collapse state after each commit.
|
|
446
|
+
useIsomorphicLayoutEffect(() => {
|
|
447
|
+
const element = handleRef.current;
|
|
448
|
+
const pane = hasRegion && element != null ? resizablePaneFor(element, isReversed) : null;
|
|
449
|
+
heldPaneRef.current = handOverPane(heldPaneRef.current, pane, isRegionCollapsed, element);
|
|
450
|
+
});
|
|
451
|
+
|
|
413
452
|
// --- ARIA ---
|
|
414
453
|
const sizeNow = resizable?._size;
|
|
415
454
|
const minNow = resizable?._minSizePx;
|
|
@@ -451,7 +490,7 @@ export function ResizeHandle({
|
|
|
451
490
|
}
|
|
452
491
|
};
|
|
453
492
|
return /*#__PURE__*/_jsxs("div", {
|
|
454
|
-
ref: useMergedRefs(ref, handleRef),
|
|
493
|
+
ref: useMergedRefs(ref, handleRef, registryRef, modalityRef),
|
|
455
494
|
role: "separator",
|
|
456
495
|
...aria,
|
|
457
496
|
"aria-label": label,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file resizablePane.ts
|
|
3
|
+
* @input A LayoutPanel's element, and the collapse state the ResizeHandle
|
|
4
|
+
* beside it reports
|
|
5
|
+
* @output The internal channel through which a LayoutPanel at a region's size
|
|
6
|
+
* lends its element to the ResizeHandle beside it, and the ResizeHandle a
|
|
7
|
+
* collapsing panel hands focus to
|
|
8
|
+
* @position Internal to Resizable and Layout; no entry point exports it. No
|
|
9
|
+
* React, and no DOM work on import
|
|
10
|
+
*/
|
|
11
|
+
/** What a LayoutPanel lends the ResizeHandle beside it. */
|
|
12
|
+
export interface ResizablePane {
|
|
13
|
+
readonly element: HTMLElement;
|
|
14
|
+
/**
|
|
15
|
+
* The handle says whether its region is collapsed, and which handle focus
|
|
16
|
+
* inside the panel moves to as it collapses. The panel is then inert and
|
|
17
|
+
* hidden from assistive technology while it is collapsed.
|
|
18
|
+
*/
|
|
19
|
+
setCollapsed(isCollapsed: boolean, focusTarget: HTMLElement | null): void;
|
|
20
|
+
}
|
|
21
|
+
/** ResizeHandle registers the element it renders; returns the unregister. */
|
|
22
|
+
export declare function registerResizeHandle(element: Element): () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Calls `listener` whenever a panel is lent beside a handle or taken back, so
|
|
25
|
+
* a handle looks for its pane again. Returns the function that stops it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function watchResizablePanes(listener: () => void): () => void;
|
|
28
|
+
/**
|
|
29
|
+
* The pane a resize handle resizes: the lent LayoutPanel just before it, or
|
|
30
|
+
* just after it when the region is reversed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resizablePaneFor(handle: Element, isReversed: boolean): ResizablePane | null;
|
|
33
|
+
/**
|
|
34
|
+
* Moves a handle's hold from `held` to `next`, and returns `next`. A pane the
|
|
35
|
+
* handle no longer holds opens. The held pane takes the region's collapse
|
|
36
|
+
* state, and focus inside it moves to `handle` as it collapses.
|
|
37
|
+
*/
|
|
38
|
+
export declare function handOverPane(held: ResizablePane | null, next: ResizablePane | null, isCollapsed: boolean, handle: HTMLElement | null): ResizablePane | null;
|
|
39
|
+
/**
|
|
40
|
+
* The ResizeHandle beside a panel, on the side that faces the content. It is
|
|
41
|
+
* after a start panel, before an end panel, and on either side elsewhere.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resizeHandleBeside(panel: Element, area: string | null | undefined): HTMLElement | null;
|
|
44
|
+
/** LayoutPanel's side of the channel, one per panel. */
|
|
45
|
+
export interface ResizablePaneLink {
|
|
46
|
+
/** For useSyncExternalStore: whether a handle holds the panel collapsed. */
|
|
47
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
48
|
+
readonly isCollapsed: () => boolean;
|
|
49
|
+
/** The handle that named itself for focus to move to, if any. */
|
|
50
|
+
focusTarget(): HTMLElement | null;
|
|
51
|
+
/**
|
|
52
|
+
* From the panel's callback ref: its element, lent beside its handle for
|
|
53
|
+
* the handle to find. Null takes it back.
|
|
54
|
+
*/
|
|
55
|
+
attach(element: HTMLElement | null): void;
|
|
56
|
+
}
|
|
57
|
+
export declare function createResizablePaneLink(): ResizablePaneLink;
|
|
58
|
+
//# sourceMappingURL=resizablePane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizablePane.d.ts","sourceRoot":"","sources":["../../src/Resizable/resizablePane.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3E;AAOD,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,IAAI,CAKjE;AAQD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,OAAO,GAClB,aAAa,GAAG,IAAI,CAKtB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,WAAW,GAAG,IAAI,GACzB,aAAa,GAAG,IAAI,CAMtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC9B,WAAW,GAAG,IAAI,CAapB;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC;IACpC,iEAAiE;IACjE,WAAW,IAAI,WAAW,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3C;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAwD3D"}
|