@astryxdesign/core 0.7.11 → 0.7.12-canary.ccb4a6d
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/AppShellMobileContext.d.ts.map +1 -1
- package/dist/AppShell/AppShellMobileContext.js +4 -3
- package/dist/AppShell/useAppShellMainId.d.ts.map +1 -1
- package/dist/AppShell/useAppShellMainId.js +3 -2
- package/dist/Avatar/AvatarSizeContext.d.ts.map +1 -1
- package/dist/Avatar/AvatarSizeContext.js +2 -2
- package/dist/Avatar/AvatarStatusLabelContext.d.ts +2 -2
- package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusLabelContext.js +3 -3
- package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupContext.js +2 -2
- package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetHostContext.js +3 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +48 -4
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcherContext.js +2 -2
- package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetEscape.js +2 -2
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +2 -13
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +25 -42
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +12 -21
- package/dist/Button/buttonHitArea.d.ts.map +1 -1
- package/dist/Button/buttonHitArea.js +3 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +13 -7
- package/dist/ButtonGroup/ButtonGroupContext.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroupContext.js +2 -2
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +24 -15
- package/dist/Chat/ChatContext.d.ts.map +1 -1
- package/dist/Chat/ChatContext.js +6 -5
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +7 -22
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxRowPressContext.js +1 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListContext.js +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.js +3 -3
- package/dist/CommandPalette/CommandPaletteContext.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteContext.js +4 -3
- package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -1
- package/dist/CommandPalette/busyStartSettle.js +2 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +41 -4
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogContext.js +3 -2
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +6 -5
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +4 -15
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -1
- package/dist/DropdownMenu/menuRegionStops.js +2 -37
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +2 -2
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +19 -16
- package/dist/HoverCard/HoverCard.d.ts +1 -2
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +1 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +5 -1
- package/dist/Icon/IconDefaultSizeContext.d.ts.map +1 -1
- package/dist/Icon/IconDefaultSizeContext.js +2 -2
- package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupContext.js +2 -2
- package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupInternalContext.js +2 -2
- package/dist/InteractiveRoleContext/InteractiveRoleContext.d.ts.map +1 -1
- package/dist/InteractiveRoleContext/InteractiveRoleContext.js +5 -3
- package/dist/Item/ItemDescriptionContext.d.ts.map +1 -1
- package/dist/Item/ItemDescriptionContext.js +3 -3
- package/dist/Item/ItemListRowContext.d.ts.map +1 -1
- package/dist/Item/ItemListRowContext.js +3 -3
- package/dist/Item/ItemMarkerColumnsContext.d.ts +1 -1
- package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -1
- package/dist/Item/ItemMarkerColumnsContext.js +2 -2
- package/dist/Layer/LayerContext.d.ts.map +1 -1
- package/dist/Layer/LayerContext.js +3 -2
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -1
- package/dist/Layer/LayerDepthContext.js +3 -2
- package/dist/Layer/LayerTouch.d.ts +3 -2
- package/dist/Layer/LayerTouch.d.ts.map +1 -1
- package/dist/Layer/LayerTouch.js +3 -2
- package/dist/Layer/anchorName.d.ts.map +1 -1
- package/dist/Layer/anchorName.js +5 -1
- package/dist/Layer/inputHold.d.ts.map +1 -1
- package/dist/Layer/inputHold.js +115 -13
- package/dist/Layer/layerScopedContext.d.ts +5 -2
- package/dist/Layer/layerScopedContext.d.ts.map +1 -1
- package/dist/Layer/layerScopedContext.js +27 -10
- package/dist/Layer/layerSlideRules.d.ts +28 -26
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +41 -40
- package/dist/Layer/outsidePress.d.ts +21 -3
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +119 -29
- package/dist/Layer/settledBox.d.ts +9 -8
- package/dist/Layer/settledBox.d.ts.map +1 -1
- package/dist/Layer/settledBox.js +169 -49
- package/dist/Layer/toastHost.d.ts.map +1 -1
- package/dist/Layer/toastHost.js +3 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +172 -60
- package/dist/Layer/useLayerKeyboardClearance.d.ts +14 -2
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
- package/dist/Layer/useLayerKeyboardClearance.js +83 -12
- package/dist/Layer/useTouchTrigger.d.ts +21 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +61 -37
- package/dist/Layout/Layout.d.ts +1 -1
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +10 -6
- package/dist/Layout/LayoutAreaContext.d.ts.map +1 -1
- package/dist/Layout/LayoutAreaContext.js +3 -3
- package/dist/Layout/LayoutContent.d.ts +6 -6
- package/dist/Layout/LayoutContent.js +9 -9
- package/dist/Layout/LayoutDividerContext.d.ts.map +1 -1
- package/dist/Layout/LayoutDividerContext.js +2 -2
- package/dist/Layout/LayoutSlotsContext.d.ts.map +1 -1
- package/dist/Layout/LayoutSlotsContext.js +2 -2
- package/dist/Link/LinkContext.d.ts +16 -0
- package/dist/Link/LinkContext.d.ts.map +1 -1
- package/dist/Link/LinkContext.js +3 -3
- package/dist/List/List.d.ts +12 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +29 -10
- package/dist/List/ListContext.d.ts +18 -3
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +9 -6
- package/dist/List/ListItem.d.ts +13 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +37 -10
- package/dist/List/listLayoutUpdates.d.ts +34 -0
- package/dist/List/listLayoutUpdates.d.ts.map +1 -0
- package/dist/List/listLayoutUpdates.js +539 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +57 -10
- package/dist/Markdown/blockDirection.d.ts +26 -0
- package/dist/Markdown/blockDirection.d.ts.map +1 -0
- package/dist/Markdown/blockDirection.js +68 -0
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts +3 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +3 -1
- package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListContext.js +2 -2
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +5 -4
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +9 -9
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -8
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +2 -2
- package/dist/RadioList/RadioListReasonContext.d.ts.map +1 -1
- package/dist/RadioList/RadioListReasonContext.js +1 -1
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlContext.js +2 -2
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -1
- package/dist/SelectableCard/selectableCardInput.js +2 -2
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -1
- package/dist/Selector/SelectorRowLayoutContext.js +2 -2
- package/dist/SideNav/SideNavCollapseButton.d.ts +4 -3
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseContext.js +4 -3
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavFocusTargetsContext.js +2 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -2
- package/dist/SideNav/SideNavRenderContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavRenderContext.js +4 -3
- package/dist/SideNav/railMotion.d.ts +40 -0
- package/dist/SideNav/railMotion.d.ts.map +1 -1
- package/dist/SideNav/railMotion.js +2 -2
- package/dist/SizeContext/SizeContext.d.ts.map +1 -1
- package/dist/SizeContext/SizeContext.js +2 -2
- package/dist/SnapPaging/SnapPaging.d.ts.map +1 -1
- package/dist/SnapPaging/SnapPaging.js +162 -36
- package/dist/SnapPaging/snapPagingValue.d.ts +29 -3
- package/dist/SnapPaging/snapPagingValue.d.ts.map +1 -1
- package/dist/SnapPaging/snapPagingValue.js +38 -6
- package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -1
- package/dist/Spinner/SpinnerOwnerContext.js +2 -2
- package/dist/Stepper/StepperContext.d.ts.map +1 -1
- package/dist/Stepper/StepperContext.js +3 -3
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +8 -3
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +2 -2
- package/dist/Table/BaseTable.d.ts +3 -2
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +73 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -2
- package/dist/Table/TableContext.d.ts.map +1 -1
- package/dist/Table/TableContext.js +2 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +4 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +5 -3
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +16 -18
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +48 -39
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +4 -2
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +3 -2
- package/dist/Table/tableRowContextUsage.d.ts +21 -0
- package/dist/Table/tableRowContextUsage.d.ts.map +1 -0
- package/dist/Table/tableRowContextUsage.js +88 -0
- package/dist/Table/types.d.ts +58 -5
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -2
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +18 -14
- package/dist/Text/TruncationTooltip.d.ts +45 -0
- package/dist/Text/TruncationTooltip.d.ts.map +1 -0
- package/dist/Text/TruncationTooltip.js +123 -0
- package/dist/Text/textClampContext.d.ts.map +1 -1
- package/dist/Text/textClampContext.js +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +4 -0
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
- package/dist/Token/TokenNamingContext.d.ts.map +1 -1
- package/dist/Token/TokenNamingContext.js +2 -2
- package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerClearAllMessageContext.js +2 -2
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +12 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +2 -2
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +12 -6
- package/dist/Tooltip/tooltipPresentInterest.d.ts +29 -0
- package/dist/Tooltip/tooltipPresentInterest.d.ts.map +1 -0
- package/dist/Tooltip/tooltipPresentInterest.js +29 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +30 -4
- package/dist/TopNav/TopNavContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavContext.js +2 -2
- package/dist/TopNav/TopNavMobileContentContext.d.ts +1 -1
- package/dist/TopNav/TopNavMobileContentContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavMobileContentContext.js +4 -3
- package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavRenderContext.js +4 -3
- package/dist/Typeahead/busyIndicatorLane.d.ts.map +1 -1
- package/dist/Typeahead/busyIndicatorLane.js +3 -2
- package/dist/Typeahead/committedChoicesKey.d.ts.map +1 -1
- package/dist/Typeahead/committedChoicesKey.js +3 -2
- package/dist/Typeahead/trailingKeyDown.d.ts.map +1 -1
- package/dist/Typeahead/trailingKeyDown.js +3 -2
- package/dist/astryx.css +18 -8
- package/dist/gestures/GestureArena.d.ts +2 -0
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +8 -1
- package/dist/gestures/GestureRecognizer.d.ts +6 -0
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +9 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +9 -4
- package/dist/hooks/focusableSelector.d.ts +13 -1
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +22 -2
- package/dist/hooks/longPressDetector.d.ts.map +1 -1
- package/dist/hooks/longPressDetector.js +1 -25
- package/dist/hooks/pressGroupContext.d.ts.map +1 -1
- package/dist/hooks/pressGroupContext.js +1 -1
- package/dist/hooks/useActionGroupTracking.d.ts +18 -1
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
- package/dist/hooks/useActionGroupTracking.js +13 -2
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +3 -2
- package/dist/hooks/useFocusTrap.d.ts +11 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +47 -2
- package/dist/hooks/useListFocus.d.ts +7 -0
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +20 -3
- package/dist/hooks/usePager.d.ts.map +1 -1
- package/dist/hooks/usePager.js +26 -3
- package/dist/hooks/useScrollOverflow.d.ts +22 -0
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +67 -11
- package/dist/i18n/InternationalizationContext.d.ts +19 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -3
- package/dist/i18n/englishFallback.d.ts.map +1 -1
- package/dist/i18n/englishFallback.js +5 -1
- package/dist/i18n/firstStrongDirection.d.ts +7 -0
- package/dist/i18n/firstStrongDirection.d.ts.map +1 -0
- package/dist/i18n/firstStrongDirection.js +65 -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/internal/scroll-anchoring.d.ts +16 -0
- package/dist/internal/scroll-anchoring.d.ts.map +1 -0
- package/dist/internal/scroll-anchoring.js +16 -0
- package/dist/internal/touch.d.ts +2 -0
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +4 -1
- package/dist/motion/animatedLayout.d.ts +8 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +51 -3
- package/dist/motion/animator.d.ts +19 -2
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +72 -7
- package/dist/privateAttributes/itemKey.stylex.d.ts +5 -0
- package/dist/privateAttributes/itemKey.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/itemKey.stylex.js +25 -0
- package/dist/privateAttributes/leaving.stylex.d.ts +5 -0
- package/dist/privateAttributes/leaving.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/leaving.stylex.js +23 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +13 -3
- package/dist/privateAttributes/scrollAnchoring.stylex.d.ts +7 -0
- package/dist/privateAttributes/scrollAnchoring.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/scrollAnchoring.stylex.js +50 -0
- package/dist/privateAttributes/travelling.stylex.d.ts +27 -0
- package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/travelling.stylex.js +51 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +95 -49
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +3 -2
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +3 -2
- package/dist/utils/calendarSystem.d.ts.map +1 -1
- package/dist/utils/calendarSystem.js +4 -1
- package/dist/utils/flatTree.d.ts +13 -0
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +28 -4
- package/dist/utils/inputAge.d.ts +22 -0
- package/dist/utils/inputAge.d.ts.map +1 -0
- package/dist/utils/inputAge.js +54 -0
- package/dist/utils/inputStream.d.ts +8 -0
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +53 -3
- package/dist/utils/moduleLoader.d.ts +23 -0
- package/dist/utils/moduleLoader.d.ts.map +1 -0
- package/dist/utils/moduleLoader.js +31 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +13 -8
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +7 -14
- package/dist/utils/sharedContext.d.ts +18 -0
- package/dist/utils/sharedContext.d.ts.map +1 -0
- package/dist/utils/sharedContext.js +33 -0
- package/dist/utils/sharedRealm.d.ts +24 -0
- package/dist/utils/sharedRealm.d.ts.map +1 -0
- package/dist/utils/sharedRealm.js +38 -0
- package/locales/en.json +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +10 -5
- package/src/AppShell/AppShellMobileContext.tsx +8 -3
- package/src/AppShell/useAppShellMainId.ts +7 -2
- package/src/Avatar/AvatarSizeContext.ts +6 -2
- package/src/Avatar/AvatarStatusLabelContext.ts +8 -3
- package/src/AvatarGroup/AvatarGroupContext.ts +7 -4
- package/src/BottomSheet/BottomSheetHostContext.ts +7 -3
- package/src/BottomSheet/BottomSheetPanel.tsx +56 -7
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +7 -2
- package/src/BottomSheet/bottomSheetEscape.ts +6 -2
- package/src/BottomSheet/bottomSheetStack.ts +6 -14
- package/src/BottomSheet/useSheetGestures.ts +28 -48
- package/src/Breadcrumbs/Breadcrumbs.tsx +6 -5
- package/src/Button/Button.doc.mjs +3 -3
- package/src/Button/Button.tsx +10 -22
- package/src/Button/buttonHitArea.ts +7 -4
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -3
- package/src/ButtonGroup/ButtonGroup.tsx +27 -16
- package/src/ButtonGroup/ButtonGroupContext.ts +7 -4
- package/src/Carousel/Carousel.tsx +33 -15
- package/src/Chat/ChatContext.tsx +23 -7
- package/src/Chat/useChatStreamScroll.ts +7 -26
- package/src/CheckboxInput/CheckboxRowPressContext.ts +5 -1
- package/src/CheckboxList/CheckboxListContext.tsx +5 -1
- package/src/Collapsible/CollapsibleGroupContext.tsx +11 -3
- package/src/CommandPalette/CommandPaletteContext.ts +8 -3
- package/src/CommandPalette/busyStartSettle.ts +6 -2
- package/src/DateInput/TouchDateField.tsx +62 -4
- package/src/Dialog/DialogContext.ts +7 -2
- package/src/DropdownMenu/DropdownMenuContext.tsx +18 -5
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +6 -18
- package/src/DropdownMenu/menuRegionStops.ts +1 -49
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Heading/Heading.tsx +34 -18
- package/src/HoverCard/HoverCard.doc.mjs +3 -3
- package/src/HoverCard/HoverCard.tsx +1 -2
- package/src/HoverCard/useHoverCard.tsx +6 -2
- package/src/Icon/IconDefaultSizeContext.ts +6 -2
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/InputGroup/InputGroupContext.ts +7 -4
- package/src/InputGroup/InputGroupInternalContext.ts +6 -2
- package/src/InteractiveRoleContext/InteractiveRoleContext.ts +8 -3
- package/src/Item/ItemDescriptionContext.tsx +7 -3
- package/src/Item/ItemListRowContext.tsx +7 -3
- package/src/Item/ItemMarkerColumnsContext.tsx +7 -2
- package/src/Layer/LayerContext.ts +7 -2
- package/src/Layer/LayerDepthContext.tsx +3 -2
- package/src/Layer/LayerTouch.ts +6 -2
- package/src/Layer/anchorName.ts +8 -4
- package/src/Layer/inputHold.ts +138 -21
- package/src/Layer/layerScopedContext.tsx +34 -7
- package/src/Layer/layerSlideRules.ts +43 -40
- package/src/Layer/outsidePress.ts +144 -28
- package/src/Layer/settledBox.ts +216 -54
- package/src/Layer/toastHost.tsx +6 -2
- package/src/Layer/useLayer.tsx +200 -69
- package/src/Layer/useLayerKeyboardClearance.ts +90 -12
- package/src/Layer/useTouchTrigger.ts +89 -40
- package/src/Layout/Layout.doc.mjs +17 -0
- package/src/Layout/Layout.tsx +13 -9
- package/src/Layout/LayoutAreaContext.ts +8 -9
- package/src/Layout/LayoutContent.doc.mjs +11 -0
- package/src/Layout/LayoutContent.tsx +9 -9
- package/src/Layout/LayoutDividerContext.ts +6 -2
- package/src/Layout/LayoutSlotsContext.ts +6 -3
- package/src/Link/LinkContext.ts +7 -3
- package/src/List/List.doc.mjs +5 -0
- package/src/List/List.tsx +53 -5
- package/src/List/ListContext.tsx +28 -6
- package/src/List/ListItem.doc.mjs +11 -0
- package/src/List/ListItem.tsx +51 -14
- package/src/List/listLayoutUpdates.ts +603 -0
- package/src/Markdown/Markdown.tsx +93 -5
- package/src/Markdown/blockDirection.ts +100 -0
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +4 -0
- package/src/MetadataList/MetadataListContext.tsx +6 -2
- package/src/NavMenu/NavMenuContext.tsx +14 -5
- package/src/Popover/Popover.tsx +23 -16
- package/src/Popover/usePopover.tsx +21 -7
- package/src/RadioList/RadioList.tsx +7 -4
- package/src/RadioList/RadioListReasonContext.ts +1 -1
- package/src/Section/Section.doc.mjs +22 -0
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -2
- package/src/SelectableCard/selectableCardInput.ts +6 -2
- package/src/Selector/SelectorRowLayoutContext.ts +6 -2
- package/src/SideNav/SideNavCollapseButton.doc.mjs +5 -5
- package/src/SideNav/SideNavCollapseButton.tsx +4 -3
- package/src/SideNav/SideNavCollapseContext.ts +12 -7
- package/src/SideNav/SideNavFocusTargetsContext.ts +6 -2
- package/src/SideNav/SideNavItem.tsx +6 -2
- package/src/SideNav/SideNavRenderContext.ts +9 -8
- package/src/SideNav/railMotion.ts +6 -2
- package/src/SizeContext/SizeContext.ts +6 -2
- package/src/SnapPaging/SnapPaging.ts +164 -39
- package/src/SnapPaging/snapPagingValue.ts +59 -12
- package/src/Spinner/SpinnerOwnerContext.ts +6 -2
- package/src/Stepper/StepperContext.ts +12 -3
- package/src/Switch/useSwitchTouch.ts +7 -5
- package/src/TabList/TabListContext.ts +7 -2
- package/src/Table/BaseTable.tsx +143 -19
- package/src/Table/Table.tsx +4 -3
- package/src/Table/TableContext.ts +6 -2
- package/src/Table/index.ts +2 -0
- package/src/Table/plugins/filtering/useTableFiltering.tsx +11 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +10 -3
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +38 -29
- package/src/Table/plugins/selection/useTableSelection.tsx +7 -2
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +6 -2
- package/src/Table/tableRowContextUsage.ts +105 -0
- package/src/Table/types.ts +60 -2
- package/src/Table/useBaseTablePlugins.ts +5 -2
- package/src/Table/useTableRowIndex.doc.mjs +6 -7
- package/src/Text/Text.tsx +34 -18
- package/src/Text/TruncationTooltip.tsx +179 -0
- package/src/Text/textClampContext.ts +5 -1
- package/src/TimeInput/TimeInput.tsx +4 -0
- package/src/ToggleButton/ToggleButtonGroup.tsx +6 -2
- package/src/Token/TokenNamingContext.ts +6 -2
- package/src/Tokenizer/TokenizerClearAllMessageContext.ts +4 -4
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +3 -3
- package/src/Toolbar/Toolbar.tsx +16 -9
- package/src/Tooltip/tooltipPresentInterest.ts +43 -0
- package/src/Tooltip/useTooltip.tsx +33 -0
- package/src/TopNav/TopNavContext.ts +6 -2
- package/src/TopNav/TopNavMobileContentContext.ts +8 -3
- package/src/TopNav/TopNavRenderContext.ts +8 -4
- package/src/Typeahead/busyIndicatorLane.tsx +7 -2
- package/src/Typeahead/committedChoicesKey.tsx +4 -3
- package/src/Typeahead/trailingKeyDown.tsx +7 -2
- package/src/gestures/GestureArena.ts +8 -1
- package/src/gestures/GestureRecognizer.ts +9 -0
- package/src/gestures/PressTracker.ts +13 -4
- package/src/hooks/focusableSelector.ts +29 -1
- package/src/hooks/longPressDetector.ts +1 -35
- package/src/hooks/pressGroupContext.ts +5 -1
- package/src/hooks/useActionGroupTracking.ts +29 -2
- package/src/hooks/useAnnounce.ts +8 -4
- package/src/hooks/useFocusTrap.ts +62 -2
- package/src/hooks/useListFocus.ts +34 -7
- package/src/hooks/usePager.ts +30 -3
- package/src/hooks/useScrollOverflow.ts +65 -7
- package/src/i18n/InternationalizationContext.ts +12 -8
- package/src/i18n/englishFallback.ts +7 -1
- package/src/i18n/firstStrongDirection.ts +69 -0
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/internal/scroll-anchoring.ts +16 -0
- package/src/internal/touch.ts +4 -0
- package/src/motion/animatedLayout.ts +44 -3
- package/src/motion/animator.ts +97 -9
- package/src/privateAttributes/itemKey.stylex.ts +25 -0
- package/src/privateAttributes/leaving.stylex.ts +23 -0
- package/src/privateAttributes/press.stylex.ts +19 -7
- package/src/privateAttributes/scrollAnchoring.stylex.ts +50 -0
- package/src/privateAttributes/travelling.stylex.ts +88 -0
- package/src/theme/Theme.tsx +124 -60
- package/src/theme/syntax/SyntaxTheme.tsx +7 -2
- package/src/theme/useTheme.ts +7 -8
- package/src/utils/calendarSystem.ts +7 -1
- package/src/utils/flatTree.ts +31 -4
- package/src/utils/inputAge.ts +66 -0
- package/src/utils/inputStream.ts +52 -3
- package/src/utils/moduleLoader.ts +47 -0
- package/src/utils/pressFeedback.ts +16 -7
- package/src/utils/selectionLock.ts +8 -18
- package/src/utils/sharedContext.ts +42 -0
- package/src/utils/sharedRealm.ts +42 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import {use} from 'react';
|
|
15
|
-
import {createLayerScopedContext
|
|
15
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
16
16
|
|
|
17
17
|
export type SegmentedControlSize = 'sm' | 'md' | 'lg';
|
|
18
18
|
export type SegmentedControlLayout = 'hug' | 'fill';
|
|
@@ -38,7 +38,11 @@ export interface SegmentedControlContextValue {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const SegmentedControlContext =
|
|
41
|
-
|
|
41
|
+
createLayerScopedContext<SegmentedControlContextValue | null>(
|
|
42
|
+
'SegmentedControlContext',
|
|
43
|
+
1,
|
|
44
|
+
null,
|
|
45
|
+
);
|
|
42
46
|
SegmentedControlContext.displayName = 'SegmentedControlContext';
|
|
43
47
|
|
|
44
48
|
export function useSegmentedControlContext(): SegmentedControlContextValue {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* SelectableCard's public props do not change.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
16
16
|
|
|
17
17
|
/** The native input a group gives one card. */
|
|
18
18
|
export interface SelectableCardInput {
|
|
@@ -26,5 +26,9 @@ export interface SelectableCardInput {
|
|
|
26
26
|
|
|
27
27
|
/** Without a provider, a card renders its own checkbox. */
|
|
28
28
|
export const SelectableCardInputContext =
|
|
29
|
-
|
|
29
|
+
createSharedContext<SelectableCardInput | null>(
|
|
30
|
+
'SelectableCardInputContext',
|
|
31
|
+
1,
|
|
32
|
+
null,
|
|
33
|
+
);
|
|
30
34
|
SelectableCardInputContext.displayName = 'SelectableCardInputContext';
|
|
@@ -16,12 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {use} from 'react';
|
|
19
|
-
import {createLayerScopedContext
|
|
19
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
20
20
|
|
|
21
21
|
export type SelectorRowLayout = 'stacked' | 'inline';
|
|
22
22
|
|
|
23
23
|
export const SelectorRowLayoutContext =
|
|
24
|
-
|
|
24
|
+
createLayerScopedContext<SelectorRowLayout>(
|
|
25
|
+
'SelectorRowLayoutContext',
|
|
26
|
+
1,
|
|
27
|
+
'stacked',
|
|
28
|
+
);
|
|
25
29
|
SelectorRowLayoutContext.displayName = 'SelectorRowLayoutContext';
|
|
26
30
|
|
|
27
31
|
/**
|
|
@@ -19,8 +19,8 @@ export const docs = {
|
|
|
19
19
|
props: [
|
|
20
20
|
{
|
|
21
21
|
name: 'collapsible',
|
|
22
|
-
type: '{isCollapsed: boolean, onCollapsedChange: (isCollapsed: boolean) => void}',
|
|
23
|
-
description: 'The same controlled collapsible config passed to SideNav. Only needed when the button is rendered outside the sidenav, where collapse context cannot reach it.',
|
|
22
|
+
type: '{isCollapsed: boolean, onCollapsedChange: (isCollapsed: boolean) => void, defaultIsCollapsed?: boolean, hasButton?: boolean, buttonLabel?: string}',
|
|
23
|
+
description: 'The same controlled collapsible config passed to SideNav, with all its keys. Only needed when the button is rendered outside the sidenav, where collapse context cannot reach it.',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: 'handleRef',
|
|
@@ -53,8 +53,8 @@ export const docsZh = {
|
|
|
53
53
|
props: [
|
|
54
54
|
{
|
|
55
55
|
name: 'collapsible',
|
|
56
|
-
type: '{isCollapsed: boolean, onCollapsedChange: (isCollapsed: boolean) => void}',
|
|
57
|
-
description: '与 SideNav 相同的受控 collapsible
|
|
56
|
+
type: '{isCollapsed: boolean, onCollapsedChange: (isCollapsed: boolean) => void, defaultIsCollapsed?: boolean, hasButton?: boolean, buttonLabel?: string}',
|
|
57
|
+
description: '与 SideNav 相同的受控 collapsible 配置,包含其全部键。仅在按钮渲染在侧边栏外部、无法读取折叠上下文时需要。',
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
name: 'handleRef',
|
|
@@ -85,7 +85,7 @@ export const docsDense = {
|
|
|
85
85
|
displayName: 'Side Nav Collapse Button',
|
|
86
86
|
description: 'Toggle button for sidenav collapse. Place inside SideNav (reads context) or outside (pass the same controlled collapsible config both get). Icon-only ghost button by default.',
|
|
87
87
|
propDescriptions: {
|
|
88
|
-
collapsible: 'Controlled collapsible config, same object SideNav gets. Only needed when button rendered outside sidenav.',
|
|
88
|
+
collapsible: 'Controlled collapsible config, same object SideNav gets, all keys allowed. Only needed when button rendered outside sidenav.',
|
|
89
89
|
handleRef: 'Deprecated. Pass collapsible instead.',
|
|
90
90
|
label: 'Custom label. Text button w/ chevron when provided, icon-only when omitted.',
|
|
91
91
|
size: "Button size. Inherits from the container ('sm' in a SideNav footer), else 'md'.",
|
|
@@ -77,9 +77,10 @@ const styles = stylex.create({
|
|
|
77
77
|
export interface SideNavCollapseButtonProps extends BaseProps<HTMLButtonElement> {
|
|
78
78
|
ref?: React.Ref<HTMLButtonElement>;
|
|
79
79
|
/**
|
|
80
|
-
* The same controlled `collapsible` config given to SideNav
|
|
81
|
-
* (`
|
|
82
|
-
* rendered outside the sidenav, where collapse context
|
|
80
|
+
* The same controlled `collapsible` config given to SideNav, with all its
|
|
81
|
+
* keys (`isCollapsed` and `onCollapsedChange` are required). Needed only
|
|
82
|
+
* when the button is rendered outside the sidenav, where collapse context
|
|
83
|
+
* cannot reach it.
|
|
83
84
|
*/
|
|
84
85
|
collapsible?: SideNavControlledCollapsible;
|
|
85
86
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file SideNavCollapseContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, use
|
|
8
8
|
* @output Exports SideNavCollapseContext and useSideNavCollapse hook
|
|
9
9
|
* @position Internal context for sidenav collapse state
|
|
10
10
|
*
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* takes the controlled `collapsible` config as a prop instead.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {use} from 'react';
|
|
18
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
18
19
|
|
|
19
20
|
export interface SideNavCollapseState {
|
|
20
21
|
/** Whether the sidenav is currently collapsed */
|
|
@@ -52,11 +53,15 @@ export interface SideNavImperativeCollapseHandle {
|
|
|
52
53
|
getCollapseState: () => SideNavCollapseState | null;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
export const SideNavCollapseContext =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
export const SideNavCollapseContext = createSharedContext<SideNavCollapseState>(
|
|
57
|
+
'SideNavCollapseContext',
|
|
58
|
+
1,
|
|
59
|
+
{
|
|
60
|
+
isCollapsed: false,
|
|
61
|
+
toggle: () => {},
|
|
62
|
+
isCollapsible: false,
|
|
63
|
+
},
|
|
64
|
+
);
|
|
60
65
|
SideNavCollapseContext.displayName = 'SideNavCollapseContext';
|
|
61
66
|
|
|
62
67
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* rendered inside the SideNav, registers itself (`component:SideNav` AR3).
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
16
16
|
|
|
17
17
|
export interface SideNavFocusTargets {
|
|
18
18
|
/**
|
|
@@ -25,5 +25,9 @@ export interface SideNavFocusTargets {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const SideNavFocusTargetsContext =
|
|
28
|
-
|
|
28
|
+
createSharedContext<SideNavFocusTargets | null>(
|
|
29
|
+
'SideNavFocusTargetsContext',
|
|
30
|
+
1,
|
|
31
|
+
null,
|
|
32
|
+
);
|
|
29
33
|
SideNavFocusTargetsContext.displayName = 'SideNavFocusTargetsContext';
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
import {
|
|
38
|
-
createContext,
|
|
39
38
|
use,
|
|
40
39
|
useCallback,
|
|
41
40
|
useId,
|
|
@@ -87,6 +86,7 @@ import {
|
|
|
87
86
|
} from '../i18n/useComponentTranslator';
|
|
88
87
|
import english from '../i18n/generated-english/SideNav/SideNavItem.generated';
|
|
89
88
|
import {isRenderable} from '../utils/isRenderable';
|
|
89
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
90
90
|
|
|
91
91
|
registerEnglishFallback(english);
|
|
92
92
|
// =============================================================================
|
|
@@ -299,7 +299,11 @@ const indentStyles = stylex.create({
|
|
|
299
299
|
* 1 inside one parent, and so on. A collapsed rail's flyout resets it to 0,
|
|
300
300
|
* since the flyout lists a parent's children as its own top level.
|
|
301
301
|
*/
|
|
302
|
-
const SideNavItemDepthContext =
|
|
302
|
+
const SideNavItemDepthContext = createSharedContext(
|
|
303
|
+
'SideNavItemDepthContext',
|
|
304
|
+
1,
|
|
305
|
+
0,
|
|
306
|
+
);
|
|
303
307
|
SideNavItemDepthContext.displayName = 'SideNavItemDepthContext';
|
|
304
308
|
|
|
305
309
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file SideNavRenderContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, use
|
|
8
8
|
* @output Exports SideNavRenderContext and useSideNavRenderMode hook
|
|
9
9
|
* @position Internal context for controlling SideNav rendering mode
|
|
10
10
|
*
|
|
@@ -15,16 +15,17 @@
|
|
|
15
15
|
* - 'drawer': children only, skip heading + footerIcons (mobile drawer)
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import {use} from 'react';
|
|
19
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
19
20
|
|
|
20
21
|
export type SideNavRenderMode =
|
|
21
|
-
| '
|
|
22
|
-
| 'topbar'
|
|
23
|
-
| 'drawer'
|
|
24
|
-
| 'drawer-content';
|
|
22
|
+
'default' | 'topbar' | 'drawer' | 'drawer-content';
|
|
25
23
|
|
|
26
|
-
export const SideNavRenderContext =
|
|
27
|
-
|
|
24
|
+
export const SideNavRenderContext = createSharedContext<SideNavRenderMode>(
|
|
25
|
+
'SideNavRenderContext',
|
|
26
|
+
1,
|
|
27
|
+
'default',
|
|
28
|
+
);
|
|
28
29
|
SideNavRenderContext.displayName = 'SideNavRenderContext';
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
* SideNavRailMotion.test.tsx.
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
import {createContext} from 'react';
|
|
47
46
|
import {
|
|
48
47
|
createAnimatedLayout,
|
|
49
48
|
holdLayoutEdge,
|
|
@@ -52,6 +51,7 @@ import {
|
|
|
52
51
|
type LayoutEdgeHold,
|
|
53
52
|
type LayoutSwap,
|
|
54
53
|
} from '../motion/animatedLayout';
|
|
54
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
55
55
|
|
|
56
56
|
/** What AppShell lends its SideNav; outside AppShell, nothing. */
|
|
57
57
|
export interface SideNavShell {
|
|
@@ -69,7 +69,11 @@ export interface SideNavShell {
|
|
|
69
69
|
landContent(): void;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
export const SideNavShellContext =
|
|
72
|
+
export const SideNavShellContext = createSharedContext<SideNavShell | null>(
|
|
73
|
+
'SideNavShellContext',
|
|
74
|
+
1,
|
|
75
|
+
null,
|
|
76
|
+
);
|
|
73
77
|
SideNavShellContext.displayName = 'SideNavShellContext';
|
|
74
78
|
|
|
75
79
|
/** A SideNav outside AppShell holds its own handle over its parent. */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import {use} from 'react';
|
|
17
|
-
import {createLayerScopedContext
|
|
17
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Standard element sizes used across interactive components.
|
|
@@ -26,7 +26,11 @@ export type ElementSize = 'sm' | 'md' | 'lg';
|
|
|
26
26
|
*
|
|
27
27
|
* `null` means no container is providing a size — components use their own default.
|
|
28
28
|
*/
|
|
29
|
-
export const SizeContext =
|
|
29
|
+
export const SizeContext = createLayerScopedContext<ElementSize | null>(
|
|
30
|
+
'SizeContext',
|
|
31
|
+
1,
|
|
32
|
+
null,
|
|
33
|
+
);
|
|
30
34
|
SizeContext.displayName = 'SizeContext';
|
|
31
35
|
|
|
32
36
|
/**
|
|
@@ -18,7 +18,9 @@ import {isRtlElement} from '../hooks/isRtlElement';
|
|
|
18
18
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
19
19
|
import {animatorFor, type MotionHandle} from '../motion/animator';
|
|
20
20
|
import {
|
|
21
|
+
type HeldRowListener,
|
|
21
22
|
makeSnapPaging,
|
|
23
|
+
rowScale,
|
|
22
24
|
type SnapPaging,
|
|
23
25
|
type SnapPagingAttachment,
|
|
24
26
|
type SnapPagingOptions,
|
|
@@ -53,7 +55,9 @@ export function useSnapPaging(options: SnapPagingOptions = {}): SnapPaging {
|
|
|
53
55
|
return optionsRef.current.pages;
|
|
54
56
|
},
|
|
55
57
|
};
|
|
56
|
-
return makeSnapPaging(
|
|
58
|
+
return makeSnapPaging((element, onHeld) =>
|
|
59
|
+
attachPaging(element, live, onHeld),
|
|
60
|
+
);
|
|
57
61
|
});
|
|
58
62
|
return value;
|
|
59
63
|
}
|
|
@@ -116,10 +120,21 @@ function combined(handles: ReadonlyArray<MotionHandle>): MotionHandle {
|
|
|
116
120
|
* offset holds, and every child moves by the same translate from there. The
|
|
117
121
|
* settle hands the position back to native scrolling.
|
|
118
122
|
*/
|
|
119
|
-
function childTrack(element: HTMLElement) {
|
|
123
|
+
function childTrack(element: HTMLElement, onHeld?: HeldRowListener) {
|
|
120
124
|
let isMoving = false;
|
|
121
125
|
let heldOffset = 0;
|
|
122
126
|
let heldTravel = 0;
|
|
127
|
+
// The direction and the lead child, read at the takeover, so a frame of the
|
|
128
|
+
// hold reads no style or layout.
|
|
129
|
+
let heldSign = 1;
|
|
130
|
+
let lead: HTMLElement | null = null;
|
|
131
|
+
let followFrame = 0;
|
|
132
|
+
// The row's travel, the children's span and the row's width at the
|
|
133
|
+
// takeover. A resize while the row is held moves the travel by the change in
|
|
134
|
+
// span and width.
|
|
135
|
+
let takeoverTravel = 0;
|
|
136
|
+
let heldSpan = 0;
|
|
137
|
+
let heldWidth = 0;
|
|
123
138
|
// The row's own inline snap type, back at the hand-back.
|
|
124
139
|
let ownSnapType = '';
|
|
125
140
|
const children = () =>
|
|
@@ -127,8 +142,9 @@ function childTrack(element: HTMLElement) {
|
|
|
127
142
|
(child): child is HTMLElement => child instanceof HTMLElement,
|
|
128
143
|
);
|
|
129
144
|
const isRtl = () => isRtlElement(element);
|
|
130
|
-
// The pager's x for a position, and what a child's translate adds to it.
|
|
131
|
-
|
|
145
|
+
// The pager's x for a position, and what a child's translate adds to it. A
|
|
146
|
+
// held row keeps the direction it was taken over with.
|
|
147
|
+
const sign = () => (isMoving ? heldSign : isRtl() ? -1 : 1);
|
|
132
148
|
const xOf = (position: number) => -sign() * position;
|
|
133
149
|
const nativePosition = () => Math.abs(element.scrollLeft);
|
|
134
150
|
const padding = () => {
|
|
@@ -147,8 +163,66 @@ function childTrack(element: HTMLElement) {
|
|
|
147
163
|
return -sign() * (animatorFor(first).get('x') - sign() * heldOffset);
|
|
148
164
|
}
|
|
149
165
|
|
|
166
|
+
// Reports where the held row is shown, once a frame, from the lead child's
|
|
167
|
+
// own animator.
|
|
168
|
+
function follow(): void {
|
|
169
|
+
if (onHeld == null || !isMoving) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const offset =
|
|
173
|
+
lead == null
|
|
174
|
+
? heldOffset
|
|
175
|
+
: -heldSign * (animatorFor(lead).get('x') - heldSign * heldOffset);
|
|
176
|
+
onHeld({offset, travel: heldTravel});
|
|
177
|
+
followFrame = requestAnimationFrame(follow);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Every child carries the same translate, so a held row's span is its
|
|
181
|
+
// layout's.
|
|
182
|
+
function span(): number {
|
|
183
|
+
const items = children();
|
|
184
|
+
if (items.length === 0) {
|
|
185
|
+
return 0;
|
|
186
|
+
}
|
|
187
|
+
let start = Infinity;
|
|
188
|
+
let end = -Infinity;
|
|
189
|
+
for (const child of items) {
|
|
190
|
+
const rect = child.getBoundingClientRect();
|
|
191
|
+
start = Math.min(start, rect.left);
|
|
192
|
+
end = Math.max(end, rect.right);
|
|
193
|
+
}
|
|
194
|
+
return (end - start) / rowScale(element, element.getBoundingClientRect());
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// A resize while the row is held moves its travel with the row's width and
|
|
198
|
+
// the children's span. A frame of the hold reads the result, not the row.
|
|
199
|
+
function remeasure(): void {
|
|
200
|
+
if (!isMoving) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const nextSpan = span();
|
|
204
|
+
const nextWidth = element.clientWidth;
|
|
205
|
+
const native = nativePosition();
|
|
206
|
+
// WebKit truncates a fractional scroll offset, so the travel stays a whole
|
|
207
|
+
// number of pixels, as the scroll width is. It rounds once, from the
|
|
208
|
+
// takeover, so a resize over many frames adds up no rounding.
|
|
209
|
+
heldTravel = Math.max(
|
|
210
|
+
0,
|
|
211
|
+
Math.round(
|
|
212
|
+
takeoverTravel + (nextSpan - heldSpan) - (nextWidth - heldWidth),
|
|
213
|
+
),
|
|
214
|
+
);
|
|
215
|
+
// A shorter travel clamps the row's own scroll offset. The children take
|
|
216
|
+
// up the clamp, so the row still shows where the pager holds it.
|
|
217
|
+
if (native !== heldOffset) {
|
|
218
|
+
const at = position();
|
|
219
|
+
heldOffset = native;
|
|
220
|
+
place(at);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
150
224
|
// A held row's translate widens its overflow, so its travel is the one it
|
|
151
|
-
// was taken over with.
|
|
225
|
+
// was taken over with, moved by any resize since.
|
|
152
226
|
function travel(): number {
|
|
153
227
|
return isMoving
|
|
154
228
|
? heldTravel
|
|
@@ -165,8 +239,14 @@ function childTrack(element: HTMLElement) {
|
|
|
165
239
|
}
|
|
166
240
|
|
|
167
241
|
function place(at: number): void {
|
|
242
|
+
const x = toChild(xOf(at));
|
|
168
243
|
for (const child of children()) {
|
|
169
|
-
animatorFor(child)
|
|
244
|
+
const animator = animatorFor(child);
|
|
245
|
+
// A set reads the element's style back, so a child already there
|
|
246
|
+
// gets none.
|
|
247
|
+
if (animator.get('x') !== x) {
|
|
248
|
+
animator.set({x});
|
|
249
|
+
}
|
|
170
250
|
}
|
|
171
251
|
}
|
|
172
252
|
|
|
@@ -174,25 +254,29 @@ function childTrack(element: HTMLElement) {
|
|
|
174
254
|
if (isMoving) {
|
|
175
255
|
return;
|
|
176
256
|
}
|
|
177
|
-
|
|
178
|
-
|
|
257
|
+
// Every read comes before the first write, so the takeover forces no
|
|
258
|
+
// layout of its own.
|
|
259
|
+
const offset = nativePosition();
|
|
260
|
+
const rowTravel = Math.max(0, element.scrollWidth - element.clientWidth);
|
|
261
|
+
const rowSign = isRtl() ? -1 : 1;
|
|
262
|
+
const items = children();
|
|
263
|
+
const rowSpan = span();
|
|
264
|
+
const rowWidth = element.clientWidth;
|
|
265
|
+
heldOffset = offset;
|
|
266
|
+
heldTravel = rowTravel;
|
|
267
|
+
takeoverTravel = rowTravel;
|
|
268
|
+
heldSpan = rowSpan;
|
|
269
|
+
heldWidth = rowWidth;
|
|
270
|
+
heldSign = rowSign;
|
|
271
|
+
lead = items[0] ?? null;
|
|
179
272
|
isMoving = true;
|
|
180
273
|
// A snap type would snap the row again as its children move.
|
|
181
274
|
ownSnapType = element.style.getPropertyValue('scroll-snap-type');
|
|
182
275
|
element.style.setProperty('scroll-snap-type', 'none');
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
const box = element.getBoundingClientRect();
|
|
186
|
-
for (const child of children()) {
|
|
187
|
-
const rect = child.getBoundingClientRect();
|
|
188
|
-
if (
|
|
189
|
-
rect.right >= box.left - box.width &&
|
|
190
|
-
rect.left <= box.right + box.width
|
|
191
|
-
) {
|
|
192
|
-
child.style.setProperty('will-change', 'transform');
|
|
193
|
-
}
|
|
194
|
-
}
|
|
276
|
+
// Each child's animator gives it a layer while it moves and takes the layer
|
|
277
|
+
// away after the motion. So the takeover writes no will-change itself.
|
|
195
278
|
place(heldOffset);
|
|
279
|
+
follow();
|
|
196
280
|
}
|
|
197
281
|
|
|
198
282
|
function handBack(): void {
|
|
@@ -205,7 +289,6 @@ function childTrack(element: HTMLElement) {
|
|
|
205
289
|
animator.stop(['x']);
|
|
206
290
|
animator.set({x: 0});
|
|
207
291
|
child.style.removeProperty('translate');
|
|
208
|
-
child.style.removeProperty('will-change');
|
|
209
292
|
}
|
|
210
293
|
isMoving = false;
|
|
211
294
|
if (ownSnapType === '') {
|
|
@@ -214,6 +297,11 @@ function childTrack(element: HTMLElement) {
|
|
|
214
297
|
element.style.setProperty('scroll-snap-type', ownSnapType);
|
|
215
298
|
}
|
|
216
299
|
element.scrollTo({left: isRtl() ? -at : at, behavior: 'instant'});
|
|
300
|
+
if (onHeld != null) {
|
|
301
|
+
cancelAnimationFrame(followFrame);
|
|
302
|
+
onHeld({offset: at, travel: heldTravel});
|
|
303
|
+
onHeld(null);
|
|
304
|
+
}
|
|
217
305
|
}
|
|
218
306
|
|
|
219
307
|
const animator: PagerAnimator = {
|
|
@@ -275,6 +363,7 @@ function childTrack(element: HTMLElement) {
|
|
|
275
363
|
},
|
|
276
364
|
position,
|
|
277
365
|
travel,
|
|
366
|
+
remeasure,
|
|
278
367
|
stops,
|
|
279
368
|
viewWidth,
|
|
280
369
|
place,
|
|
@@ -291,10 +380,40 @@ function childTrack(element: HTMLElement) {
|
|
|
291
380
|
function attachPaging(
|
|
292
381
|
element: HTMLElement,
|
|
293
382
|
options: SnapPagingOptions,
|
|
383
|
+
onHeld?: HeldRowListener,
|
|
294
384
|
): SnapPagingAttachment {
|
|
295
|
-
const track = childTrack(element);
|
|
385
|
+
const track = childTrack(element, onHeld);
|
|
386
|
+
// A child's animator reads its stylesheet's will-change in a later task. So
|
|
387
|
+
// a press that moves the row reads no style in its own task.
|
|
388
|
+
for (const child of Array.from(element.children)) {
|
|
389
|
+
if (child instanceof HTMLElement) {
|
|
390
|
+
animatorFor(child);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
296
393
|
// The stop that view pages count from, set when a gesture takes over.
|
|
297
394
|
let anchor = 0;
|
|
395
|
+
// The row's stops and view width, read before a takeover's first write.
|
|
396
|
+
let measured: {stops: number[]; viewWidth: number} | null = null;
|
|
397
|
+
const takeOverShown = (at: number) => {
|
|
398
|
+
// Every read comes before the takeover's first write.
|
|
399
|
+
const stops = track.stops();
|
|
400
|
+
const viewWidth = track.viewWidth();
|
|
401
|
+
anchor = stops.reduce(
|
|
402
|
+
(best, stop, i) =>
|
|
403
|
+
Math.abs(stop - at) < Math.abs(stops[best] - at) ? i : best,
|
|
404
|
+
0,
|
|
405
|
+
);
|
|
406
|
+
measured = {stops, viewWidth};
|
|
407
|
+
pager.setOptions({});
|
|
408
|
+
measured = null;
|
|
409
|
+
// The pager learns its page while the row is at rest, which moves
|
|
410
|
+
// nothing. The takeover then holds the row where it is shown.
|
|
411
|
+
pager.goTo(pager.nearestPage(at), {
|
|
412
|
+
animated: false,
|
|
413
|
+
reason: 'controlled',
|
|
414
|
+
});
|
|
415
|
+
track.takeOver();
|
|
416
|
+
};
|
|
298
417
|
const pager = createPager(
|
|
299
418
|
{
|
|
300
419
|
count: 1,
|
|
@@ -303,32 +422,21 @@ function attachPaging(
|
|
|
303
422
|
// the pointer kinds.
|
|
304
423
|
panOptions: {allowedPointerTypes: ['touch', 'pen']},
|
|
305
424
|
measurePages: () => {
|
|
306
|
-
|
|
425
|
+
// A resize while the row is held moves its travel first.
|
|
426
|
+
track.remeasure();
|
|
427
|
+
const stops = measured?.stops ?? track.stops();
|
|
307
428
|
return (options.pages ?? 'view') === 'item'
|
|
308
429
|
? stops
|
|
309
430
|
: viewPages(
|
|
310
431
|
stops,
|
|
311
432
|
Math.min(anchor, stops.length - 1),
|
|
312
|
-
track.viewWidth(),
|
|
433
|
+
measured?.viewWidth ?? track.viewWidth(),
|
|
313
434
|
);
|
|
314
435
|
},
|
|
315
436
|
shouldBeginPan: () => {
|
|
437
|
+
// The finger catches the row where it is shown.
|
|
316
438
|
if (!track.isMoving) {
|
|
317
|
-
|
|
318
|
-
const stops = track.stops();
|
|
319
|
-
anchor = stops.reduce(
|
|
320
|
-
(best, stop, i) =>
|
|
321
|
-
Math.abs(stop - at) < Math.abs(stops[best] - at) ? i : best,
|
|
322
|
-
0,
|
|
323
|
-
);
|
|
324
|
-
track.takeOver();
|
|
325
|
-
pager.setOptions({});
|
|
326
|
-
pager.goTo(pager.nearestPage(at), {
|
|
327
|
-
animated: false,
|
|
328
|
-
reason: 'controlled',
|
|
329
|
-
});
|
|
330
|
-
// The finger catches the row where it is shown.
|
|
331
|
-
track.place(at);
|
|
439
|
+
takeOverShown(track.position());
|
|
332
440
|
}
|
|
333
441
|
return true;
|
|
334
442
|
},
|
|
@@ -347,6 +455,23 @@ function attachPaging(
|
|
|
347
455
|
pager.dispose();
|
|
348
456
|
track.handBack();
|
|
349
457
|
},
|
|
458
|
+
move: target => {
|
|
459
|
+
// A finger on the row keeps it.
|
|
460
|
+
if (pager.isDragging) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
// The target reads the row too, so every read comes before the
|
|
464
|
+
// takeover's first write.
|
|
465
|
+
const at = track.position();
|
|
466
|
+
const end = track.travel();
|
|
467
|
+
const to = Math.min(Math.max(target(at, end), 0), end);
|
|
468
|
+
// A move from rest is the pager's own too. So a touch catches it as it
|
|
469
|
+
// catches a settle, and the release rests on a page.
|
|
470
|
+
if (!track.isMoving) {
|
|
471
|
+
takeOverShown(at);
|
|
472
|
+
}
|
|
473
|
+
pager.goTo(pager.nearestPage(to), {offset: to});
|
|
474
|
+
},
|
|
350
475
|
moveHeld: target => {
|
|
351
476
|
if (!track.isMoving) {
|
|
352
477
|
return false;
|