@astryxdesign/core 0.7.8 → 0.7.9-canary.0200dfe
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 +37 -3
- 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/DateInput/wheelStrip.js +2 -2
- 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/InputGroupText.d.ts +2 -1
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -1
- 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 +81 -11
- 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/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- 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/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- 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/Slider/sliderTouchController.js +2 -2
- 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/Switch/useSwitchTouch.js +4 -4
- 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/animator/createAnimator.js +2 -2
- 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 +10 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +214 -23
- 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 +20 -2
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +29 -3
- package/dist/motion/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +7 -6
- 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 +34 -13
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +64 -17
- 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 +45 -3
- 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/DateInput/wheelStrip.ts +2 -2
- 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/Icon/useIcon.doc.mjs +94 -0
- 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/InputGroupText.doc.mjs +45 -3
- package/src/InputGroup/InputGroupText.tsx +2 -1
- 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 +113 -16
- 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/OverflowList/OverflowList.tsx +15 -9
- 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/SegmentedControl/useSegmentedSelectionMotion.ts +3 -3
- 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/Slider/sliderTouchController.ts +2 -2
- 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/Switch/useSwitchTouch.ts +4 -4
- 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/animator/createAnimator.ts +3 -3
- 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 +321 -75
- 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 +43 -2
- package/src/motion/MEASUREMENTS.md +11 -0
- package/src/motion/README.md +3 -3
- package/src/motion/animator.ts +7 -7
- 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 +78 -18
- 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
package/dist/SideNav/SideNav.js
CHANGED
|
@@ -30,7 +30,7 @@ import { SideNavCollapseContext } from "./SideNavCollapseContext.js";
|
|
|
30
30
|
import { SideNavCollapseButton } from "./SideNavCollapseButton.js";
|
|
31
31
|
import { useSideNavRenderMode } from "./SideNavRenderContext.js";
|
|
32
32
|
import { MobileNav } from "../MobileNav/MobileNav.js";
|
|
33
|
-
import { useResizable } from "../Resizable/useResizable.js";
|
|
33
|
+
import { isResizableRegion, useResizable } from "../Resizable/useResizable.js";
|
|
34
34
|
import { ResizeHandle } from "../Resizable/ResizeHandle.js";
|
|
35
35
|
import { themeProps } from "../utils/themeProps.js";
|
|
36
36
|
import { SizeProvider } from "../SizeContext/SizeContext.js";
|
|
@@ -93,6 +93,33 @@ function describeCollapseConflict(collapsible, resizable) {
|
|
|
93
93
|
return `${collapsibleKeys.map(key => `collapsible.${key}`).join(', ')} and ` + `${resizableKeys.map(key => `resizable.${key}`).join(', ')} address the ` + `same collapse state. resizable wins; the collapsible ` + `${collapsibleKeys.length === 1 ? 'value is' : 'values are'} ignored.`;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* The collapse config when `resizable` is useResizable's output. The region
|
|
98
|
+
* owns the collapse state and decides whether the rail collapses. A
|
|
99
|
+
* `collapsible` prop that sets state or disagrees is ignored and named in a
|
|
100
|
+
* development warning.
|
|
101
|
+
*/
|
|
102
|
+
function resolveRegionCollapseConfig(collapsible, region) {
|
|
103
|
+
const fromCollapsible = typeof collapsible === 'object' ? collapsible : {};
|
|
104
|
+
const ignoredKeys = [fromCollapsible.defaultIsCollapsed !== undefined && 'defaultIsCollapsed', fromCollapsible.isCollapsed !== undefined && 'isCollapsed', fromCollapsible.onCollapsedChange !== undefined && 'onCollapsedChange'].filter(key => key !== false);
|
|
105
|
+
// The region's own `collapsible` option decides whether the rail collapses.
|
|
106
|
+
const isRegionCollapsible = region.props._collapsible ?? false;
|
|
107
|
+
const conflicts = [];
|
|
108
|
+
if (ignoredKeys.length > 0) {
|
|
109
|
+
conflicts.push(`\`collapsible\` sets ${ignoredKeys.map(key => `\`${key}\``).join(', ')}, ` + 'which the rail ignores: it follows the region.');
|
|
110
|
+
}
|
|
111
|
+
if (collapsible !== undefined && Boolean(collapsible) !== isRegionCollapsible) {
|
|
112
|
+
conflicts.push(isRegionCollapsible ? '`collapsible` is false, but the region is collapsible, so the rail still collapses.' : '`collapsible` turns collapse on, but the region is not collapsible, so the rail never collapses.');
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
isCollapsible: isRegionCollapsible,
|
|
116
|
+
defaultIsCollapsed: region.isCollapsed,
|
|
117
|
+
isCollapsed: undefined,
|
|
118
|
+
onCollapsedChange: undefined,
|
|
119
|
+
conflict: conflicts.length === 0 ? null : "`resizable` is useResizable's output, which owns the collapse " + `state and decides whether the rail collapses. ${conflicts.join(' ')}`
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
96
123
|
// =============================================================================
|
|
97
124
|
// Styles
|
|
98
125
|
// =============================================================================
|
|
@@ -178,7 +205,7 @@ export function SideNav({
|
|
|
178
205
|
children,
|
|
179
206
|
footer,
|
|
180
207
|
footerIcons,
|
|
181
|
-
collapsible
|
|
208
|
+
collapsible: collapsibleProp,
|
|
182
209
|
resizable = false,
|
|
183
210
|
xstyle,
|
|
184
211
|
className,
|
|
@@ -189,14 +216,19 @@ export function SideNav({
|
|
|
189
216
|
...props
|
|
190
217
|
}) {
|
|
191
218
|
const t = useComponentTranslator();
|
|
219
|
+
// Only a left-out `collapsible` becomes false, as before; `??` would also
|
|
220
|
+
// turn null into false.
|
|
221
|
+
const collapsible = collapsibleProp === undefined ? false : collapsibleProp;
|
|
192
222
|
// Parse collapsible prop
|
|
193
223
|
const collapsibleConfig = typeof collapsible === 'object' ? collapsible : {};
|
|
194
224
|
const hasCollapseButton = collapsibleConfig.hasButton ?? true;
|
|
195
225
|
|
|
226
|
+
// useResizable's output: the caller's region owns the width and collapse.
|
|
227
|
+
const ownerRegion = isResizableRegion(resizable) ? resizable : null;
|
|
196
228
|
// Resizable config
|
|
197
|
-
const resizableConfig = typeof resizable === 'object' ? resizable : {};
|
|
229
|
+
const resizableConfig = typeof resizable === 'object' && !isResizableRegion(resizable) ? resizable : {};
|
|
198
230
|
const isResizable = !!resizable;
|
|
199
|
-
const collapseConfig = resolveCollapseConfig(collapsible, resizable);
|
|
231
|
+
const collapseConfig = ownerRegion == null ? resolveCollapseConfig(collapsible, isResizableRegion(resizable) ? false : resizable) : resolveRegionCollapseConfig(collapsibleProp, ownerRegion);
|
|
200
232
|
const {
|
|
201
233
|
isCollapsible,
|
|
202
234
|
onCollapsedChange
|
|
@@ -236,6 +268,8 @@ export function SideNav({
|
|
|
236
268
|
|
|
237
269
|
// useResizable is the sole collapse owner in every SideNav mode. Keeping that
|
|
238
270
|
// owner mounted when resize is toggled preserves the current collapse state.
|
|
271
|
+
// Given the hook's output, the caller's region is the owner, and this one
|
|
272
|
+
// stays idle.
|
|
239
273
|
const resizableHook = useResizable({
|
|
240
274
|
defaultSize: resizableConfig.defaultWidth ?? 260,
|
|
241
275
|
minSize: resizableConfig.minWidth ?? 180,
|
|
@@ -248,7 +282,8 @@ export function SideNav({
|
|
|
248
282
|
onSizeChange: resizableConfig.onWidthChange,
|
|
249
283
|
onCollapseChange: onCollapsedChange
|
|
250
284
|
});
|
|
251
|
-
const
|
|
285
|
+
const region = ownerRegion ?? resizableHook;
|
|
286
|
+
const collapsed = region.isCollapsed;
|
|
252
287
|
|
|
253
288
|
// A collapse or expand plays the rail's motion, except an app's change
|
|
254
289
|
// before the rail's first paint. It is measured in the commit before the
|
|
@@ -404,11 +439,11 @@ export function SideNav({
|
|
|
404
439
|
isCollapsed: next
|
|
405
440
|
};
|
|
406
441
|
if (next) {
|
|
407
|
-
|
|
442
|
+
region.collapse();
|
|
408
443
|
} else {
|
|
409
|
-
|
|
444
|
+
region.expand();
|
|
410
445
|
}
|
|
411
|
-
}, [collapsed,
|
|
446
|
+
}, [collapsed, region]);
|
|
412
447
|
const showResizeHandle = isResizable && !collapsed;
|
|
413
448
|
collapseStateRef.current = {
|
|
414
449
|
isCollapsed: collapsed,
|
|
@@ -515,7 +550,7 @@ export function SideNav({
|
|
|
515
550
|
// When resizable, override the nav width via inline style
|
|
516
551
|
const resizableNavStyle = isResizable ? {
|
|
517
552
|
...(style ?? {}),
|
|
518
|
-
width: collapsed ? undefined :
|
|
553
|
+
width: collapsed ? undefined : region.size
|
|
519
554
|
} : style;
|
|
520
555
|
const navElement = /*#__PURE__*/_jsxs("nav", {
|
|
521
556
|
ref: mergedNavRef,
|
|
@@ -613,7 +648,7 @@ export function SideNav({
|
|
|
613
648
|
pillPlacement: "end",
|
|
614
649
|
isAlwaysVisible: false,
|
|
615
650
|
xstyle: styles.resizableHandle,
|
|
616
|
-
resizable: resizableHook.props,
|
|
651
|
+
resizable: ownerRegion ?? resizableHook.props,
|
|
617
652
|
label: t('@astryx.sideNav.resizeSidebar'),
|
|
618
653
|
"aria-controls": navId
|
|
619
654
|
})]
|
|
@@ -21,7 +21,7 @@ import { PRESS_PROFILES, createPressTracker } from "../gestures/PressTracker.js"
|
|
|
21
21
|
import { lockSelection } from "../gestures/selectionLock.js";
|
|
22
22
|
import { TapGestureRecognizer } from "../gestures/TapGestureRecognizer.js";
|
|
23
23
|
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
24
|
-
import {
|
|
24
|
+
import { createMotionEngine } from "../motion/animator.js";
|
|
25
25
|
import { projectDistance } from "../motion/projection.js";
|
|
26
26
|
import { resolveMotion } from "../motion/resolveMotion.js";
|
|
27
27
|
import { solveSpring, toSpring } from "../motion/spring.js";
|
|
@@ -995,7 +995,7 @@ export class SliderTouchController {
|
|
|
995
995
|
animatorFor(element) {
|
|
996
996
|
let animator = this.animators.get(element);
|
|
997
997
|
if (animator == null) {
|
|
998
|
-
animator =
|
|
998
|
+
animator = createMotionEngine(element);
|
|
999
999
|
this.animators.set(element, animator);
|
|
1000
1000
|
}
|
|
1001
1001
|
return animator;
|
|
@@ -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"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file spinnerRotor.ts
|
|
7
|
+
* @input StyleX keyframes and the slow-min duration token
|
|
8
|
+
* @output The one turning arc: SPINNER_ARC_FRACTION, spinnerRotorStyles.turn
|
|
9
|
+
* and syncRotationPhase
|
|
10
|
+
* @position Spinner's rotor, shared by Spinner and Lab's indeterminate
|
|
11
|
+
* CircularProgress (through `@astryxdesign/core/internal/spinner-rotor`), so
|
|
12
|
+
* both rings turn the same way on the compositor.
|
|
13
|
+
*/
|
|
14
|
+
import * as stylex from '@stylexjs/stylex';
|
|
15
|
+
import "../theme/tokens.stylex.js";
|
|
16
|
+
import { durationVars } from "../theme/tokens.stylex.js";
|
|
17
|
+
|
|
18
|
+
/** The fraction of the ring the arc covers: 135°. */
|
|
19
|
+
export const SPINNER_ARC_FRACTION = 0.375;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Full turns in one iteration of the rotation.
|
|
23
|
+
*
|
|
24
|
+
* Chromium wakes the main thread at each iteration boundary while the
|
|
25
|
+
* document listens for `animationiteration`. React listens for it on every
|
|
26
|
+
* root. One iteration holds 100 turns, so the wake comes once in 100 turns.
|
|
27
|
+
* Each turn is 360 degrees, so the ring looks the same.
|
|
28
|
+
*/
|
|
29
|
+
const TURNS_PER_ITERATION = 100;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A `transform` animation runs on the compositor, so the ring keeps turning
|
|
33
|
+
* while a script runs. A `stroke-dashoffset` animation would repaint the arc
|
|
34
|
+
* on the main thread every frame, so it would stop while a script runs.
|
|
35
|
+
*/
|
|
36
|
+
const rotation = "x11cqc53-B";
|
|
37
|
+
export const spinnerRotorStyles = {
|
|
38
|
+
turn: {
|
|
39
|
+
k6sLGO: "x1so62im",
|
|
40
|
+
k44tkh: "xidn0ey x14hxw50",
|
|
41
|
+
ko0y90: "xa4qsjk",
|
|
42
|
+
kKVMdj: "x129v4ae",
|
|
43
|
+
kyAemX: "x1esw782",
|
|
44
|
+
$$css: true
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Pin every ring's rotation to the document timeline's origin instead of its
|
|
50
|
+
* own start time, so spinners mounted seconds apart stay in phase.
|
|
51
|
+
*
|
|
52
|
+
* Setting `startTime` is exact where arithmetic on a clock read is not. A
|
|
53
|
+
* negative `animation-delay` computed at mount is only as good as the gap
|
|
54
|
+
* between the clock read and the frame the animation starts in. At 10x CPU
|
|
55
|
+
* throttling that gap measured 116 degrees of drift.
|
|
56
|
+
*
|
|
57
|
+
* Rotors are collected and pinned in one frame. `getAnimations()` resolves
|
|
58
|
+
* style, and `startTime` dirties it again. So pinning them one at a time makes
|
|
59
|
+
* each mount re-force what the previous one invalidated: 53 style recalcs for
|
|
60
|
+
* 38 spinners, against 19 batched.
|
|
61
|
+
*/
|
|
62
|
+
const pendingRotors = new Set();
|
|
63
|
+
let flushScheduled = false;
|
|
64
|
+
function pinRotorsToTimelineOrigin() {
|
|
65
|
+
flushScheduled = false;
|
|
66
|
+
const animations = [];
|
|
67
|
+
for (const rotor of pendingRotors) {
|
|
68
|
+
animations.push(...rotor.getAnimations());
|
|
69
|
+
}
|
|
70
|
+
pendingRotors.clear();
|
|
71
|
+
for (const animation of animations) {
|
|
72
|
+
animation.startTime = 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Ref callback for a rotor: the one place a mounted ring touches the DOM.
|
|
78
|
+
*
|
|
79
|
+
* It reads nothing back — the geometry is resolved by the cascade, not in JS.
|
|
80
|
+
*/
|
|
81
|
+
export function syncRotationPhase(rotor) {
|
|
82
|
+
if (rotor == null) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
// jsdom implements no Web Animations, and this runs in every consumer's
|
|
86
|
+
// component tests.
|
|
87
|
+
if (typeof rotor.getAnimations !== 'function') {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
pendingRotors.add(rotor);
|
|
91
|
+
if (!flushScheduled) {
|
|
92
|
+
flushScheduled = true;
|
|
93
|
+
requestAnimationFrame(pinRotorsToTimelineOrigin);
|
|
94
|
+
}
|
|
95
|
+
return () => {
|
|
96
|
+
pendingRotors.delete(rotor);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file StackItem.tsx
|
|
3
|
-
* @input Uses React, ElementType, stackItem utility
|
|
3
|
+
* @input Uses React, ElementType, stackItem utility, StackItemScrollRegion
|
|
4
4
|
* @output Exports StackItem polymorphic component and StackItemProps
|
|
5
|
-
* @position Layout/Stack component; uses stackItem.stylex.ts
|
|
5
|
+
* @position Layout/Stack component; uses stackItem.stylex.ts. A scrollable
|
|
6
|
+
* `div` or `span` item renders through StackItemScrollRegion, which names
|
|
7
|
+
* it while it scrolls.
|
|
6
8
|
*
|
|
7
9
|
* SYNC: When modified, update these files to stay in sync:
|
|
8
10
|
* - /packages/core/src/Stack/Stack.doc.mjs
|
|
@@ -34,7 +36,9 @@ export interface StackItemProps extends BaseProps<HTMLElement> {
|
|
|
34
36
|
* reset, so `<StackItem size="fill" isScrollable>` is a complete scroll
|
|
35
37
|
* region — it grows to fill the stack and scrolls its own overflow with
|
|
36
38
|
* no extra style plumbing. Matches `isScrollable` on `LayoutContent`
|
|
37
|
-
* and `LayoutPanel`.
|
|
39
|
+
* and `LayoutPanel`. While its content overflows, a `div` or `span` item
|
|
40
|
+
* is a group named by the caller's `aria-label`, or by a translated
|
|
41
|
+
* "Content". Another element keeps its own role.
|
|
38
42
|
* @default false
|
|
39
43
|
*/
|
|
40
44
|
isScrollable?: boolean;
|
|
@@ -62,7 +66,7 @@ export interface StackItemProps extends BaseProps<HTMLElement> {
|
|
|
62
66
|
* </HStack>
|
|
63
67
|
* ```
|
|
64
68
|
*/
|
|
65
|
-
export declare function StackItem({ crossAlignSelf, size, isScrollable, as: element, xstyle, className, style, children, ref, ...props }: StackItemProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any
|
|
69
|
+
export declare function StackItem({ crossAlignSelf, size, isScrollable, as: element, xstyle, className, style, children, ref, ...props }: StackItemProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").FunctionComponentElement<import("../hooks/StackItemScrollRegion.js").StackItemScrollRegionProps>;
|
|
66
70
|
export declare namespace StackItem {
|
|
67
71
|
var displayName: string;
|
|
68
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackItem.d.ts","sourceRoot":"","sources":["../../src/Stack/StackItem.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"StackItem.d.ts","sourceRoot":"","sources":["../../src/Stack/StackItem.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAChF,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAW5B,MAAM,WAAW,cAAe,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAC;IAEzC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EACxB,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,EAAE,EAAE,OAAe,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,0MA8BhB;yBAzCe,SAAS"}
|
package/dist/Stack/StackItem.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file StackItem.tsx
|
|
5
|
-
* @input Uses React, ElementType, stackItem utility
|
|
5
|
+
* @input Uses React, ElementType, stackItem utility, StackItemScrollRegion
|
|
6
6
|
* @output Exports StackItem polymorphic component and StackItemProps
|
|
7
|
-
* @position Layout/Stack component; uses stackItem.stylex.ts
|
|
7
|
+
* @position Layout/Stack component; uses stackItem.stylex.ts. A scrollable
|
|
8
|
+
* `div` or `span` item renders through StackItemScrollRegion, which names
|
|
9
|
+
* it while it scrolls.
|
|
8
10
|
*
|
|
9
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
10
12
|
* - /packages/core/src/Stack/Stack.doc.mjs
|
|
@@ -16,6 +18,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
16
18
|
import { stackItem } from "./stackItem.stylex.js";
|
|
17
19
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
18
20
|
import { themeProps } from "../utils/themeProps.js";
|
|
21
|
+
import { StackItemScrollRegion } from "../hooks/StackItemScrollRegion.js";
|
|
19
22
|
const overflowStyles = {
|
|
20
23
|
scrollable: {
|
|
21
24
|
kVQacm: "xysyzu8",
|
|
@@ -52,12 +55,22 @@ export function StackItem({
|
|
|
52
55
|
crossAlignSelf,
|
|
53
56
|
size
|
|
54
57
|
}), isScrollable && overflowStyles.scrollable, xstyle);
|
|
55
|
-
|
|
56
|
-
ref: ref,
|
|
58
|
+
const elementProps = {
|
|
57
59
|
...mergeProps(themeProps('stack-item', {
|
|
58
60
|
size
|
|
59
61
|
}), stylexProps, className, style),
|
|
60
62
|
...props
|
|
63
|
+
};
|
|
64
|
+
if (isScrollable && (element === 'div' || element === 'span')) {
|
|
65
|
+
return /*#__PURE__*/createElement(StackItemScrollRegion, {
|
|
66
|
+
as: element,
|
|
67
|
+
ref,
|
|
68
|
+
elementProps
|
|
69
|
+
}, children);
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/createElement(element, {
|
|
72
|
+
ref: ref,
|
|
73
|
+
...elementProps
|
|
61
74
|
}, children);
|
|
62
75
|
}
|
|
63
76
|
StackItem.displayName = 'StackItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/Switch/Switch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAQL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/Switch/Switch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAQL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAinB9C,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,KAAK,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACxE;;OAEG;IACH,YAAY,CAAC,EAAE,CACb,OAAO,EAAE,OAAO,EAChB,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAC7B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACpD;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,KAAK,EACL,UAAkB,EAClB,QAAQ,EACR,eAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,OAAO,EACP,MAAM,EACN,SAAS,EACT,YAAY,EACZ,aAAqB,EACrB,YAAoB,EACpB,MAAM,EACN,IAAW,EACX,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,kBAAkB,EAAE,mBAAmB,EACvC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,IAAI,EACR,EAAE,WAAW,+BA4Rb;yBAzTe,MAAM"}
|
package/dist/Switch/Switch.js
CHANGED
|
@@ -33,8 +33,10 @@ import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
|
33
33
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
34
34
|
import english from "../i18n/generated-english/Switch/Switch.generated.js";
|
|
35
35
|
registerEnglishFallback(english);
|
|
36
|
+
import "../motion/reducedMotion.stylex.js";
|
|
37
|
+
import { reducedMotionFadeConsts } from "../motion/reducedMotion.stylex.js";
|
|
36
38
|
import "../utils/interactionOverlay.stylex.js";
|
|
37
|
-
import { interactionOverlayStyles,
|
|
39
|
+
import { interactionOverlayStyles, pressVars } from "../utils/interactionOverlay.stylex.js";
|
|
38
40
|
import { pressHoldsDragProps } from "../privateAttributes/pressHoldsDrag.stylex.js";
|
|
39
41
|
import { useSwitchTouch } from "./useSwitchTouch.js";
|
|
40
42
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
@@ -65,14 +67,15 @@ const PRESS_FADING = '[data-astryx-press="fading"]';
|
|
|
65
67
|
|
|
66
68
|
/**
|
|
67
69
|
* The shared press release, for the press layers the switch fades on the
|
|
68
|
-
* compositor
|
|
69
|
-
*
|
|
70
|
+
* compositor: the theme's exit motion tokens, no longer than the Reduce
|
|
71
|
+
* Motion fade under Reduce Motion. Switch.test.tsx compares them with
|
|
72
|
+
* the overlay's.
|
|
70
73
|
* SYNC: utils/interactionOverlay.stylex.ts PRESS_RELEASE_DURATION,
|
|
71
74
|
* PRESS_RELEASE_DURATION_REDUCED and RELEASE_EASE.
|
|
72
75
|
*/
|
|
73
|
-
const PRESS_RELEASE_DURATION =
|
|
74
|
-
const PRESS_RELEASE_DURATION_REDUCED = `min(${
|
|
75
|
-
const PRESS_RELEASE_EASE = '
|
|
76
|
+
const PRESS_RELEASE_DURATION = durationVars['--duration-exit'];
|
|
77
|
+
const PRESS_RELEASE_DURATION_REDUCED = `min(${durationVars['--duration-exit']}, ${reducedMotionFadeConsts.duration})`;
|
|
78
|
+
const PRESS_RELEASE_EASE = easeVars['--ease-exit'];
|
|
76
79
|
|
|
77
80
|
// The measured hit insets (utils/hitArea), 0 until measured.
|
|
78
81
|
const HIT_TOP = 'var(--astryx-hit-inset-top, 0px)';
|
|
@@ -262,8 +265,8 @@ const styles = {
|
|
|
262
265
|
kLkRvE: "x1my3e5g",
|
|
263
266
|
k5QlbN: "x2huugr x1ccaw7f",
|
|
264
267
|
k7EzDT: "xxhzo2e",
|
|
265
|
-
kQZAMR: "
|
|
266
|
-
kZiNAr: "
|
|
268
|
+
kQZAMR: "xs8z9ty x1e7l4zx",
|
|
269
|
+
kZiNAr: "x15baseh",
|
|
267
270
|
k8Tatv: "xq2jpp1",
|
|
268
271
|
k5JduY: "x1s928wv",
|
|
269
272
|
kc3QkE: "x1h1zc6f x1ep27e9",
|
|
@@ -320,8 +323,8 @@ const styles = {
|
|
|
320
323
|
kLkRvE: "x1my3e5g",
|
|
321
324
|
k5QlbN: "x2huugr x1ccaw7f",
|
|
322
325
|
k7EzDT: "xxhzo2e",
|
|
323
|
-
kQZAMR: "
|
|
324
|
-
kZiNAr: "
|
|
326
|
+
kQZAMR: "xs8z9ty x1e7l4zx",
|
|
327
|
+
kZiNAr: "x15baseh",
|
|
325
328
|
k8Tatv: "xq2jpp1",
|
|
326
329
|
k5JduY: "x1s928wv",
|
|
327
330
|
kc3QkE: "x1h1zc6f x1ep27e9",
|
|
@@ -20,7 +20,7 @@ import { getGestureHost } from "../gestures/GestureHost.js";
|
|
|
20
20
|
import { createPressTracker } from "../gestures/PressTracker.js";
|
|
21
21
|
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
22
22
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
23
|
-
import {
|
|
23
|
+
import { createMotionEngine } from "../motion/animator.js";
|
|
24
24
|
import { solveSpring, toSpring } from "../motion/spring.js";
|
|
25
25
|
import { UIKIT_GESTURES } from "../motion/uikit/gestures.js";
|
|
26
26
|
import { registerSwitchTable, switchControl } from "../motion/uikit/switch.js";
|
|
@@ -203,10 +203,10 @@ export class SwitchTouchController {
|
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
registerSwitchTable();
|
|
206
|
-
this.thumb =
|
|
206
|
+
this.thumb = createMotionEngine(elements.thumb);
|
|
207
207
|
// The layer rests clear (its class's opacity 0) while the visuals show
|
|
208
208
|
// the value; from here its opacity is the animator's.
|
|
209
|
-
this.fade =
|
|
209
|
+
this.fade = createMotionEngine(elements.track, {
|
|
210
210
|
pseudoElement: '::after',
|
|
211
211
|
initial: {
|
|
212
212
|
opacity: 0
|
|
@@ -215,7 +215,7 @@ export class SwitchTouchController {
|
|
|
215
215
|
this.fade.set({
|
|
216
216
|
opacity: 0
|
|
217
217
|
});
|
|
218
|
-
this.shadow =
|
|
218
|
+
this.shadow = createMotionEngine(elements.thumb, {
|
|
219
219
|
pseudoElement: '::after',
|
|
220
220
|
initial: {
|
|
221
221
|
opacity: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../src/TabList/Tab.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAYzD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../src/TabList/Tab.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAYzD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AASrD,MAAM,WAAW,QAAS,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC5D;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AA2KD;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,EAClB,EAAE,EACF,GAAG,EACH,KAAK,EACL,KAAK,EACL,aAAqB,EACrB,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,GAAG,SAAS,EACb,EAAE,QAAQ,qBAuLV;yBAvMe,GAAG"}
|
package/dist/TabList/Tab.js
CHANGED
|
@@ -28,6 +28,7 @@ import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
|
28
28
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
29
29
|
import { mergeProps } from "../utils/index.js";
|
|
30
30
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
31
|
+
import { withholdCallerHandlers } from "../utils/disabledInteraction.js";
|
|
31
32
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
32
33
|
import { themeProps } from "../utils/themeProps.js";
|
|
33
34
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
@@ -216,7 +217,10 @@ export function Tab({
|
|
|
216
217
|
children: displayIcon
|
|
217
218
|
}) : null;
|
|
218
219
|
const sharedProps = {
|
|
219
|
-
|
|
220
|
+
// A disabled tab keeps its tab stop, so the browser still sends it events.
|
|
221
|
+
// It runs no caller handler other than `onFocus` and `onBlur`, as a natively
|
|
222
|
+
// disabled control runs none. `onClick` is guarded in `handleSelect`.
|
|
223
|
+
...withholdCallerHandlers(restProps, isDisabled),
|
|
220
224
|
...pressable,
|
|
221
225
|
...(isLabelHidden ? {
|
|
222
226
|
'aria-label': label
|