@astryxdesign/core 0.7.8 → 0.7.9-canary.07992bb
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 +5 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- 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.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +54 -11
- 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/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +4 -1
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +7 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +5 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +4 -1
- package/dist/Dialog/Dialog.d.ts +2 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +12 -1
- 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 +9 -4
- 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 +1 -0
- 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 +2 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +29 -6
- 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/preserveAnimations.d.ts +1 -5
- package/dist/Layer/preserveAnimations.d.ts.map +1 -1
- package/dist/Layer/preserveAnimations.js +12 -214
- 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/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 +4 -1
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +13 -4
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -0
- 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/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 +22 -4
- 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/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/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 +162 -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/astryx.css +45 -18
- 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/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 +27 -5
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +41 -5
- 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/useMenuPress.d.ts +34 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +93 -5
- 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 +21 -3
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +8 -3
- 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 +1 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +1 -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/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 +139 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/press.stylex.js +97 -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/calendarSystem.d.ts +114 -0
- package/dist/utils/calendarSystem.d.ts.map +1 -0
- package/dist/utils/calendarSystem.js +386 -0
- 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/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +82 -5
- 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 +23 -7
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +57 -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.stylex.d.ts +35 -0
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
- package/dist/utils/touchHitArea.stylex.js +32 -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 +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +10 -4
- package/src/AppShell/observeMainOverflow.ts +9 -6
- package/src/BottomSheet/BottomSheet.tsx +5 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- 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 +3 -2
- package/src/CheckboxInput/CheckboxInput.tsx +71 -9
- package/src/ClickableCard/ClickableCard.tsx +8 -1
- package/src/DateInput/DateInput.tsx +2 -0
- package/src/DateInput/PickerWheel.tsx +7 -2
- package/src/DateRangeInput/DateRangeInput.tsx +3 -1
- package/src/DateTimeInput/DateTimeInput.tsx +2 -0
- package/src/Dialog/Dialog.doc.mjs +1 -1
- package/src/Dialog/Dialog.tsx +12 -1
- 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 +29 -5
- 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 +1 -0
- 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 +51 -9
- package/src/Layer/holdEntranceInput.ts +84 -0
- package/src/Layer/inputHold.ts +734 -0
- package/src/Layer/preserveAnimations.ts +12 -275
- package/src/Layer/useLayer.tsx +77 -4
- package/src/Layout/LayoutContent.doc.mjs +6 -3
- package/src/Layout/LayoutContent.tsx +10 -4
- package/src/Layout/LayoutPanel.doc.mjs +6 -3
- package/src/Layout/LayoutPanel.tsx +11 -4
- package/src/Lightbox/Lightbox.tsx +4 -0
- 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/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 +25 -7
- package/src/SelectableCard/SelectableCard.tsx +8 -1
- 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/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 +178 -80
- package/src/TreeList/TreeListItem.tsx +36 -2
- 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/menuPressGesture.ts +244 -38
- package/src/hooks/menuPressValues.ts +18 -0
- package/src/hooks/useClickableContainer.doc.mjs +8 -2
- package/src/hooks/useClickableContainer.ts +72 -6
- package/src/hooks/useFocusTrap.ts +268 -151
- package/src/hooks/useMenuPress.ts +118 -11
- 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 +33 -3
- package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useCalendarSystem.ts +95 -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 +243 -0
- package/src/theme/themeMotion.ts +3 -2
- package/src/theme/tokens.stylex.ts +1 -1
- package/src/utils/calendarSystem.ts +548 -0
- package/src/utils/flatTree.ts +15 -3
- package/src/utils/hitArea.ts +107 -5
- package/src/utils/inputStream.ts +47 -10
- package/src/utils/interactionOverlay.stylex.ts +19 -22
- package/src/utils/plainDate.ts +84 -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 +41 -0
- package/src/utils/triggerFocus.ts +17 -4
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAkC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7E,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,qBAuMpB;yBAtNe,aAAa"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - /apps/storybook/stories/RadioList.stories.tsx
|
|
18
18
|
* - /packages/cli/assets/templates/blocks/components/RadioList/ (showcase blocks)
|
|
19
19
|
*/
|
|
20
|
-
import React, { use, useId, useRef } from 'react';
|
|
20
|
+
import React, { use, useCallback, useId, useRef } from 'react';
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import { RadioListContext } from "./RadioList.js";
|
|
23
23
|
import { RadioListReasonContext } from "./RadioListReasonContext.js";
|
|
@@ -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 { watchHitArea, writeHitInsets } from "../utils/hitArea.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,18 @@ 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 watch lives as long as the row
|
|
196
|
+
// is attached: the ref's cleanup stops it.
|
|
197
|
+
const watchRowHitArea = useCallback(row => {
|
|
198
|
+
if (row == null || isDisabled) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
return watchHitArea(row, insets => writeHitInsets(row, insets));
|
|
202
|
+
}, [isDisabled]);
|
|
203
|
+
const mergedRowRef = useMergedRefs(ref, watchRowHitArea);
|
|
189
204
|
const radioCircle = /*#__PURE__*/_jsxs("div", {
|
|
190
205
|
...stylex.props(styles.radioWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay),
|
|
191
206
|
...focusProps,
|
|
@@ -251,7 +266,7 @@ export function RadioListItem({
|
|
|
251
266
|
children: [radioCircle, startContent]
|
|
252
267
|
}) : radioCircle;
|
|
253
268
|
return /*#__PURE__*/_jsx(Item, {
|
|
254
|
-
ref:
|
|
269
|
+
ref: mergedRowRef,
|
|
255
270
|
...(isDisabled ? undefined : pressable),
|
|
256
271
|
startContent: mediaContent
|
|
257
272
|
// Delegate row-surface clicks (label text, description, and the empty
|
|
@@ -276,11 +291,14 @@ export function RadioListItem({
|
|
|
276
291
|
// the painting row element (Item), the same element that carries the
|
|
277
292
|
// theme target, so a theme's hover styling stays in step with the tint.
|
|
278
293
|
!isDisabled && indicatorScope,
|
|
294
|
+
// The row keeps no press paint of its own: the circle paints, and
|
|
295
|
+
// reads the strength whose release the row keeps.
|
|
296
|
+
rowPressLayerStyles.cellWithoutLayer,
|
|
279
297
|
// Restore the bare default look: zero Item's padding/radius and its
|
|
280
298
|
// interactive hover/press background. Applied after Item's own base
|
|
281
299
|
// styles so it wins within the base layer; a `radio-list-item` theme
|
|
282
300
|
// still overrides it from the higher `astryx-theme` layer.
|
|
283
|
-
rowStyles.root, !isDisabled && rowStyles.press, xstyle],
|
|
301
|
+
rowStyles.root, !isDisabled && rowStyles.press, !isDisabled && touchHitAreaStyles.layer, xstyle],
|
|
284
302
|
...mergeProps(
|
|
285
303
|
// One target for every row, carrying its size and runtime state so a
|
|
286
304
|
// theme can express "selected option at large" or restyle disabled
|
|
@@ -104,7 +104,7 @@ export interface SelectableCardProps extends Omit<BaseProps, 'onChange'> {
|
|
|
104
104
|
* </SelectableCard>
|
|
105
105
|
* ```
|
|
106
106
|
*/
|
|
107
|
-
export declare function SelectableCard({ label, isSelected, onChange, onClick: onClickProp, onMouseUp: onMouseUpProp, isDisabled, children, padding, variant, elevation, width, height, maxWidth, ref, xstyle: xstyleProp, className: classNameProp, style, ...props }: SelectableCardProps): import("react").JSX.Element;
|
|
107
|
+
export declare function SelectableCard({ label, isSelected, onChange, onClick: onClickProp, onMouseUp: onMouseUpProp, onPointerDown: onPointerDownProp, isDisabled, children, padding, variant, elevation, width, height, maxWidth, ref, xstyle: xstyleProp, className: classNameProp, style, ...props }: SelectableCardProps): import("react").JSX.Element;
|
|
108
108
|
export declare namespace SelectableCard {
|
|
109
109
|
var displayName: string;
|
|
110
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableCard.d.ts","sourceRoot":"","sources":["../../src/SelectableCard/SelectableCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,KAAK,SAAS,EAMd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectableCard.d.ts","sourceRoot":"","sources":["../../src/SelectableCard/SelectableCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,KAAK,SAAS,EAMd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAItE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAuN5C,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACtE,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAE1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAExC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,yBAAyB;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA4CD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,UAAU,EACV,QAAQ,EACR,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,aAAa,EAAE,iBAAiB,EAChC,UAAkB,EAClB,QAAQ,EACR,OAAO,EACP,OAAmB,EACnB,SAAkB,EAClB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,GAAG,EACH,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,aAAa,EACxB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAkKrB;yBAtLe,cAAc"}
|
|
@@ -34,6 +34,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
34
34
|
import "../theme/tokens.stylex.js";
|
|
35
35
|
import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
36
36
|
import { isImeKeyEvent, mergeProps } from "../utils/index.js";
|
|
37
|
+
import { chainEventHandlers } from "../utils/chainEventHandlers.js";
|
|
37
38
|
import { Card } from "../Card/Card.js";
|
|
38
39
|
import { useClickableContainer } from "../hooks/useClickableContainer.js";
|
|
39
40
|
import { closestLayerRoot } from "../privateAttributes/layerRoot.stylex.js";
|
|
@@ -257,6 +258,7 @@ export function SelectableCard({
|
|
|
257
258
|
onChange,
|
|
258
259
|
onClick: onClickProp,
|
|
259
260
|
onMouseUp: onMouseUpProp,
|
|
261
|
+
onPointerDown: onPointerDownProp,
|
|
260
262
|
isDisabled = false,
|
|
261
263
|
children,
|
|
262
264
|
padding,
|
|
@@ -311,7 +313,8 @@ export function SelectableCard({
|
|
|
311
313
|
}, [isDisabled, requestChange]);
|
|
312
314
|
const {
|
|
313
315
|
onClick,
|
|
314
|
-
onMouseUp
|
|
316
|
+
onMouseUp,
|
|
317
|
+
onPointerDown
|
|
315
318
|
} = useClickableContainer({
|
|
316
319
|
containerRef,
|
|
317
320
|
interactiveRef,
|
|
@@ -361,6 +364,7 @@ export function SelectableCard({
|
|
|
361
364
|
!isDisabled && interactionOverlayStyles.pressedAlpha, isDisabled && styles.disabled, xstyleProp],
|
|
362
365
|
onClick: !isDisabled ? composedOnClick : undefined,
|
|
363
366
|
onMouseUp: !isDisabled ? composedOnMouseUp : undefined,
|
|
367
|
+
onPointerDown: !isDisabled ? chainEventHandlers(onPointerDown, onPointerDownProp) : onPointerDownProp,
|
|
364
368
|
...props,
|
|
365
369
|
onClickCapture: !isDisabled && handleLayerClickCapture ? e => {
|
|
366
370
|
handleLayerClickCapture(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA8B5C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKV,CAAC;AA2SF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,KAAK,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAW,EACX,KAAiB,EACjB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,SAAS,EACb,EAAE,YAAY,+BAqId;yBAhJe,OAAO"}
|
package/dist/Spinner/Spinner.js
CHANGED
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
import { useId } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import "../theme/tokens.stylex.js";
|
|
21
|
-
import { colorVars,
|
|
21
|
+
import { colorVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
22
22
|
import { Text } from "../Text/Text.js";
|
|
23
23
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
24
24
|
import { themeProps } from "../utils/themeProps.js";
|
|
25
25
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
26
26
|
import english from "../i18n/generated-english/Spinner/Spinner.generated.js";
|
|
27
|
+
import { spinnerRotorStyles, syncRotationPhase } from "./spinnerRotor.js";
|
|
27
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
29
|
registerEnglishFallback(english);
|
|
29
30
|
|
|
@@ -32,13 +33,13 @@ registerEnglishFallback(english);
|
|
|
32
33
|
// =============================================================================
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
36
|
+
* The fraction of the ring the arc covers: SPINNER_ARC_FRACTION. StyleX reads
|
|
37
|
+
* only a literal in this file, and a test pins the two together.
|
|
37
38
|
*
|
|
38
39
|
* Themeable via `--spinner-arc-fraction`, declared alongside the other public
|
|
39
40
|
* vars in `sizeStyles` below. Only the inline `strokeDasharray` attribute
|
|
40
|
-
* (the pre-stylesheet render
|
|
41
|
-
*
|
|
41
|
+
* (the pre-stylesheet render) still reads the constant directly; the CSS side
|
|
42
|
+
* composes the dash from the live var.
|
|
42
43
|
*/
|
|
43
44
|
const ARC_FRACTION = 0.375;
|
|
44
45
|
const PI = 3.141592653589793;
|
|
@@ -155,69 +156,6 @@ function registerSpinnerVars() {
|
|
|
155
156
|
// elide.
|
|
156
157
|
registerSpinnerVars();
|
|
157
158
|
|
|
158
|
-
/**
|
|
159
|
-
* Pin every ring's rotation to the document timeline's origin instead of its
|
|
160
|
-
* own start time, so spinners mounted seconds apart stay in phase.
|
|
161
|
-
*
|
|
162
|
-
* Setting `startTime` is exact where arithmetic on a clock read is not. A
|
|
163
|
-
* negative `animation-delay` computed at mount is only as good as the gap
|
|
164
|
-
* between the clock read and the frame the animation starts in. At 10x CPU
|
|
165
|
-
* throttling that gap measured 116 degrees of drift.
|
|
166
|
-
*
|
|
167
|
-
* Rotors are collected and pinned in one frame. `getAnimations()` resolves
|
|
168
|
-
* style, and `startTime` dirties it again. So pinning them one at a time makes
|
|
169
|
-
* each mount re-force what the previous one invalidated: 53 style recalcs for
|
|
170
|
-
* 38 spinners, against 19 batched.
|
|
171
|
-
*/
|
|
172
|
-
const pendingRotors = new Set();
|
|
173
|
-
let flushScheduled = false;
|
|
174
|
-
function pinRotorsToTimelineOrigin() {
|
|
175
|
-
flushScheduled = false;
|
|
176
|
-
const animations = [];
|
|
177
|
-
for (const rotor of pendingRotors) {
|
|
178
|
-
animations.push(...rotor.getAnimations());
|
|
179
|
-
}
|
|
180
|
-
pendingRotors.clear();
|
|
181
|
-
for (const animation of animations) {
|
|
182
|
-
animation.startTime = 0;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Ref callback for the rotor: the one place a mounted ring touches the DOM.
|
|
188
|
-
*
|
|
189
|
-
* It reads nothing back — the geometry is resolved by the cascade, not in JS.
|
|
190
|
-
*/
|
|
191
|
-
function syncRotationPhase(rotor) {
|
|
192
|
-
if (rotor == null) {
|
|
193
|
-
return undefined;
|
|
194
|
-
}
|
|
195
|
-
// jsdom implements no Web Animations, and this runs in every consumer's
|
|
196
|
-
// component tests.
|
|
197
|
-
if (typeof rotor.getAnimations !== 'function') {
|
|
198
|
-
return undefined;
|
|
199
|
-
}
|
|
200
|
-
pendingRotors.add(rotor);
|
|
201
|
-
if (!flushScheduled) {
|
|
202
|
-
flushScheduled = true;
|
|
203
|
-
requestAnimationFrame(pinRotorsToTimelineOrigin);
|
|
204
|
-
}
|
|
205
|
-
return () => {
|
|
206
|
-
pendingRotors.delete(rotor);
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// =============================================================================
|
|
211
|
-
// Animation
|
|
212
|
-
// =============================================================================
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* A `transform` animation runs on the compositor, so the ring keeps turning
|
|
216
|
-
* while a script runs. A `stroke-dashoffset` animation would repaint the arc
|
|
217
|
-
* on the main thread every frame, so it would stop while a script runs.
|
|
218
|
-
*/
|
|
219
|
-
const rotation = "xqng64z-B";
|
|
220
|
-
|
|
221
159
|
// =============================================================================
|
|
222
160
|
// Styles
|
|
223
161
|
// =============================================================================
|
|
@@ -240,6 +178,13 @@ const styles = {
|
|
|
240
178
|
kmuXW: "x2lah0s",
|
|
241
179
|
$$css: true
|
|
242
180
|
},
|
|
181
|
+
rotor: {
|
|
182
|
+
k1xSpc: "x1lliihq",
|
|
183
|
+
kJuA4N: "x15r89dc",
|
|
184
|
+
kzqmXN: "x6v0vjy",
|
|
185
|
+
kZKoxP: "x7yyq19",
|
|
186
|
+
$$css: true
|
|
187
|
+
},
|
|
243
188
|
circle: {
|
|
244
189
|
kDwRjp: "xbh8q5q",
|
|
245
190
|
kR8GR0: "x1764fhq",
|
|
@@ -447,9 +392,7 @@ export function Spinner({
|
|
|
447
392
|
}), /*#__PURE__*/_jsx("span", {
|
|
448
393
|
ref: syncRotationPhase,
|
|
449
394
|
"aria-hidden": "true",
|
|
450
|
-
...
|
|
451
|
-
className: "x1lliihq x15r89dc x6v0vjy x7yyq19 x1so62im x1qcljrn xnh0sag xa4qsjk x1ka1v4i x1esw782"
|
|
452
|
-
},
|
|
395
|
+
...stylex.props(styles.rotor, spinnerRotorStyles.turn),
|
|
453
396
|
children: /*#__PURE__*/_jsx("svg", {
|
|
454
397
|
width: frameSize,
|
|
455
398
|
height: frameSize,
|
package/dist/Spinner/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* SYNC: When modified, update this header and /packages/core/src/Spinner/Spinner.doc.mjs
|
|
8
8
|
*/
|
|
9
9
|
export { Spinner } from './Spinner.js';
|
|
10
|
-
export type { SpinnerProps, SpinnerSize, SpinnerShade
|
|
10
|
+
export type { SpinnerProps, SpinnerSize, SpinnerShade } from './Spinner.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Spinner/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Spinner/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,YAAY,EAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAC,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file spinnerRotor.ts
|
|
3
|
+
* @input StyleX keyframes and the slow-min duration token
|
|
4
|
+
* @output The one turning arc: SPINNER_ARC_FRACTION, spinnerRotorStyles.turn
|
|
5
|
+
* and syncRotationPhase
|
|
6
|
+
* @position Spinner's rotor, shared by Spinner and Lab's indeterminate
|
|
7
|
+
* CircularProgress (through `@astryxdesign/core/internal/spinner-rotor`), so
|
|
8
|
+
* both rings turn the same way on the compositor.
|
|
9
|
+
*/
|
|
10
|
+
import * as stylex from '@stylexjs/stylex';
|
|
11
|
+
/** The fraction of the ring the arc covers: 135°. */
|
|
12
|
+
export declare const SPINNER_ARC_FRACTION = 0.375;
|
|
13
|
+
export declare const spinnerRotorStyles: Readonly<{
|
|
14
|
+
readonly turn: Readonly<{
|
|
15
|
+
readonly willChange: stylex.StyleXClassNameFor<"willChange", "transform">;
|
|
16
|
+
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", `calc(var(--_astryx-pre-tempo-duration-slow-min, ${stylex.StyleXVar<"730ms">}) * 100)` | "calc(3s * 100)">;
|
|
17
|
+
readonly animationIterationCount: stylex.StyleXClassNameFor<"animationIterationCount", "infinite">;
|
|
18
|
+
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
19
|
+
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "linear">;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Ref callback for a rotor: the one place a mounted ring touches the DOM.
|
|
24
|
+
*
|
|
25
|
+
* It reads nothing back — the geometry is resolved by the cascade, not in JS.
|
|
26
|
+
*/
|
|
27
|
+
export declare function syncRotationPhase(rotor: Element | null): (() => void) | undefined;
|
|
28
|
+
//# sourceMappingURL=spinnerRotor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinnerRotor.d.ts","sourceRoot":"","sources":["../../src/Spinner/spinnerRotor.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAsB1C,eAAO,MAAM,kBAAkB;;;;;;;;EAiB7B,CAAC;AA+BH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,GAAG,IAAI,GACpB,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAiB1B"}
|