@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
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @file useTouchTrigger.ts
|
|
7
7
|
* @input Touch trigger mode, layer open state, trigger ref, show/hide callbacks
|
|
8
8
|
* @output Exports useTouchTrigger hook, isActionTrigger, LayerTouchTrigger type,
|
|
9
|
-
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES and
|
|
9
|
+
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES, useTapRecognizer and
|
|
10
|
+
* useTapStop (internal:
|
|
10
11
|
* not re-exported from index). Also useTouchTriggerInternal, with the
|
|
11
12
|
* outside dismissal's arm for useTooltip's hold (Core-internal).
|
|
12
13
|
* @position Layer hook; shared touch behavior for useTooltip and useHoverCard
|
|
@@ -48,6 +49,7 @@ import {
|
|
|
48
49
|
useCallback,
|
|
49
50
|
useEffect,
|
|
50
51
|
useRef,
|
|
52
|
+
useState,
|
|
51
53
|
type MouseEvent as ReactMouseEvent,
|
|
52
54
|
type PointerEvent as ReactPointerEvent,
|
|
53
55
|
type RefObject,
|
|
@@ -80,6 +82,72 @@ export type LayerTouchTrigger = 'auto' | 'tap' | 'none';
|
|
|
80
82
|
*/
|
|
81
83
|
export const TOUCH_POINTER_TYPES = new Set(['touch', 'pen']);
|
|
82
84
|
|
|
85
|
+
/** Waits for the tap that a touch or pen press may become. Internal. */
|
|
86
|
+
export interface TapRecognizer {
|
|
87
|
+
/**
|
|
88
|
+
* Call on every press. A touch or pen press on `trigger` waits for its tap:
|
|
89
|
+
* the press's own `click`. A touch the browser takes for a scroll or a
|
|
90
|
+
* pinch (`pointercancel`) is no tap, and a new press replaces one still
|
|
91
|
+
* waiting. Returns whether the press is touch or pen.
|
|
92
|
+
*/
|
|
93
|
+
press(
|
|
94
|
+
event: PointerEvent,
|
|
95
|
+
trigger: Element | null,
|
|
96
|
+
onTap: (tapEvent: Event) => void,
|
|
97
|
+
): boolean;
|
|
98
|
+
/** Stops waiting for a press still waiting for its tap. */
|
|
99
|
+
forget(): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** One tap recognizer for a trigger, released on unmount. Internal. */
|
|
103
|
+
export function useTapRecognizer(): TapRecognizer {
|
|
104
|
+
const [recognizer] = useState(createTapRecognizer);
|
|
105
|
+
// Releases a pending tap on unmount.
|
|
106
|
+
useEffect(() => () => recognizer.forget(), [recognizer]);
|
|
107
|
+
return recognizer;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function createTapRecognizer(): TapRecognizer {
|
|
111
|
+
let stopWaiting: (() => void) | null = null;
|
|
112
|
+
const forget = () => {
|
|
113
|
+
stopWaiting?.();
|
|
114
|
+
stopWaiting = null;
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
press(event, trigger, onTap) {
|
|
118
|
+
forget();
|
|
119
|
+
if (!TOUCH_POINTER_TYPES.has(event.pointerType)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (trigger == null) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
// The tap must belong to this press. A key press or a new pointer press
|
|
126
|
+
// advances the gesture, so a keyboard activation that later fires
|
|
127
|
+
// `click` on the trigger (Enter on a button) is not mistaken for it.
|
|
128
|
+
const gesture = currentGesture();
|
|
129
|
+
const stop = () => {
|
|
130
|
+
trigger.removeEventListener('click', handleTap);
|
|
131
|
+
trigger.removeEventListener('pointercancel', stop);
|
|
132
|
+
if (stopWaiting === stop) {
|
|
133
|
+
stopWaiting = null;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const handleTap = (tapEvent: Event) => {
|
|
137
|
+
stop();
|
|
138
|
+
if (currentGesture() === gesture) {
|
|
139
|
+
onTap(tapEvent);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
trigger.addEventListener('click', handleTap);
|
|
143
|
+
trigger.addEventListener('pointercancel', stop);
|
|
144
|
+
stopWaiting = stop;
|
|
145
|
+
return true;
|
|
146
|
+
},
|
|
147
|
+
forget,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
83
151
|
export function useTapStop(event: 'click'): {
|
|
84
152
|
onPointerDown: (event: ReactPointerEvent<Element>) => void;
|
|
85
153
|
onClick: (event: ReactMouseEvent<Element>) => void;
|
|
@@ -296,6 +364,11 @@ export interface UseTouchTriggerInternalReturn extends UseTouchTriggerReturn {
|
|
|
296
364
|
* hold arms it too.
|
|
297
365
|
*/
|
|
298
366
|
armOutsideDismiss: () => void;
|
|
367
|
+
/**
|
|
368
|
+
* Answers a tap the trigger completed before the layer mounted, by the same
|
|
369
|
+
* rules as a tap it sees, and arms the outside dismissal when it opens.
|
|
370
|
+
*/
|
|
371
|
+
answerTap: (tapEvent: Event | null) => void;
|
|
299
372
|
}
|
|
300
373
|
|
|
301
374
|
/**
|
|
@@ -379,9 +452,7 @@ export function useTouchTriggerInternal(
|
|
|
379
452
|
// The documents the outside dismissal listens on: the page's, and the
|
|
380
453
|
// trigger's own when it renders in another document, such as an iframe.
|
|
381
454
|
const outsideDocumentsRef = useRef<Document[]>([]);
|
|
382
|
-
|
|
383
|
-
// waiting. The next press, a cancel, the tap itself or unmounting calls it.
|
|
384
|
-
const forgetPendingTapRef = useRef<(() => void) | null>(null);
|
|
455
|
+
const tapRecognizer = useTapRecognizer();
|
|
385
456
|
|
|
386
457
|
const readModality = useInteractionModalityTrackingFor(triggerRef);
|
|
387
458
|
|
|
@@ -453,9 +524,6 @@ export function useTouchTriggerInternal(
|
|
|
453
524
|
|
|
454
525
|
// Releases the outside-dismiss listener on unmount.
|
|
455
526
|
useEffect(() => disarmOutsideDismiss, [disarmOutsideDismiss]);
|
|
456
|
-
// Releases a pending tap on unmount.
|
|
457
|
-
useEffect(() => () => forgetPendingTapRef.current?.(), []);
|
|
458
|
-
|
|
459
527
|
const isTouchInteraction = useCallback(
|
|
460
528
|
() => isTouchPointerRef.current && readModality() === 'pointer',
|
|
461
529
|
[readModality],
|
|
@@ -471,12 +539,12 @@ export function useTouchTriggerInternal(
|
|
|
471
539
|
|
|
472
540
|
// What a tap on the trigger does. It runs from the tap's `click`, after the
|
|
473
541
|
// render that armed it, so it reads the latest props through this ref.
|
|
474
|
-
const answerTapRef = useRef<(tapEvent: Event) => void>(() => {});
|
|
475
|
-
answerTapRef.current = (tapEvent: Event) => {
|
|
542
|
+
const answerTapRef = useRef<(tapEvent: Event | null) => void>(() => {});
|
|
543
|
+
answerTapRef.current = (tapEvent: Event | null) => {
|
|
476
544
|
const trigger = triggerRef.current;
|
|
477
545
|
// A tap that landed in a disabled control is that control's: its reason
|
|
478
546
|
// opens. Every other tap is the trigger's to decide.
|
|
479
|
-
const tapped = tapEvent
|
|
547
|
+
const tapped = tapEvent?.target instanceof Element ? tapEvent.target : null;
|
|
480
548
|
const mode =
|
|
481
549
|
touchTrigger === 'auto'
|
|
482
550
|
? tapped != null && tapLandsOnDisabledControl(tapped)
|
|
@@ -509,45 +577,20 @@ export function useTouchTriggerInternal(
|
|
|
509
577
|
(event: PointerEvent): boolean => {
|
|
510
578
|
const isTouch = TOUCH_POINTER_TYPES.has(event.pointerType);
|
|
511
579
|
isTouchPointerRef.current = isTouch;
|
|
512
|
-
// A new press replaces one that never became a tap.
|
|
513
|
-
forgetPendingTapRef.current?.();
|
|
514
|
-
|
|
515
580
|
if (!isTouch || isControlled) {
|
|
581
|
+
tapRecognizer.forget();
|
|
516
582
|
return false;
|
|
517
583
|
}
|
|
518
|
-
|
|
519
584
|
const trigger =
|
|
520
585
|
event.currentTarget instanceof Element
|
|
521
586
|
? event.currentTarget
|
|
522
587
|
: triggerRef.current;
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
// The tap must belong to this press. A key press or a new pointer press
|
|
528
|
-
// advances the gesture, so a keyboard activation that later fires
|
|
529
|
-
// `click` on the trigger (Enter on a button) is not mistaken for it.
|
|
530
|
-
const gesture = currentGesture();
|
|
531
|
-
const forget = () => {
|
|
532
|
-
trigger.removeEventListener('click', handleTap);
|
|
533
|
-
trigger.removeEventListener('pointercancel', forget);
|
|
534
|
-
if (forgetPendingTapRef.current === forget) {
|
|
535
|
-
forgetPendingTapRef.current = null;
|
|
536
|
-
}
|
|
537
|
-
};
|
|
538
|
-
const handleTap = (tapEvent: Event) => {
|
|
539
|
-
forget();
|
|
540
|
-
if (currentGesture() === gesture) {
|
|
541
|
-
answerTapRef.current(tapEvent);
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
trigger.addEventListener('click', handleTap);
|
|
545
|
-
// The browser took the touch for a scroll or a pinch: no tap is coming.
|
|
546
|
-
trigger.addEventListener('pointercancel', forget);
|
|
547
|
-
forgetPendingTapRef.current = forget;
|
|
588
|
+
tapRecognizer.press(event, trigger, tapEvent =>
|
|
589
|
+
answerTapRef.current(tapEvent),
|
|
590
|
+
);
|
|
548
591
|
return true;
|
|
549
592
|
},
|
|
550
|
-
[isControlled, triggerRef],
|
|
593
|
+
[isControlled, triggerRef, tapRecognizer],
|
|
551
594
|
);
|
|
552
595
|
|
|
553
596
|
// A layer closed by any other path (Escape, a consumer, the browser) leaves
|
|
@@ -563,6 +606,11 @@ export function useTouchTriggerInternal(
|
|
|
563
606
|
wasOpenRef.current = isOpen;
|
|
564
607
|
}, [isOpen, disarmOutsideDismiss]);
|
|
565
608
|
|
|
609
|
+
const answerTap = useCallback(
|
|
610
|
+
(tapEvent: Event | null) => answerTapRef.current(tapEvent),
|
|
611
|
+
[],
|
|
612
|
+
);
|
|
613
|
+
|
|
566
614
|
return {
|
|
567
615
|
isTouchPointerRef,
|
|
568
616
|
isTouchInteraction,
|
|
@@ -570,5 +618,6 @@ export function useTouchTriggerInternal(
|
|
|
570
618
|
handlePointerDown,
|
|
571
619
|
clearTapOpen: disarmOutsideDismiss,
|
|
572
620
|
armOutsideDismiss,
|
|
621
|
+
answerTap,
|
|
573
622
|
};
|
|
574
623
|
}
|
|
@@ -144,6 +144,17 @@ export const docs = {
|
|
|
144
144
|
description:
|
|
145
145
|
"Padding at the layout's outer edges using the spacing scale. Applies to this Layout's own header, footer, panels, and content. A nested Layout does not inherit it: without `padding`, its regions use the enclosing Card, Section, or Dialog padding, or the default inset (spacing 4). That keeps a page Layout inside AppShell inset even though AppShell's own regions are full bleed.",
|
|
146
146
|
},
|
|
147
|
+
{
|
|
148
|
+
name: 'children',
|
|
149
|
+
type: 'ReactNode',
|
|
150
|
+
description:
|
|
151
|
+
'Shorthand for the content slot: `<Layout>{main}</Layout>` is the same as `<Layout content={main} />`. When both are given, `content` wins.',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'ref',
|
|
155
|
+
type: 'React.Ref<HTMLDivElement>',
|
|
156
|
+
description: 'Ref forwarded to the root layout element.',
|
|
157
|
+
},
|
|
147
158
|
{
|
|
148
159
|
name: 'defaultHasDividers',
|
|
149
160
|
type: 'boolean',
|
|
@@ -165,6 +176,8 @@ export const docs = {
|
|
|
165
176
|
bestPractices: [
|
|
166
177
|
{ guidance: true, description: 'Use Layout when content needs named header, start, content, end, or footer regions.' },
|
|
167
178
|
{ guidance: true, description: 'Use HStack and VStack for simple directional stacking within a content area.' },
|
|
179
|
+
{ guidance: true, description: 'Hide a region by passing `false`, `null`, or `undefined` to its slot, for example `isOpen && <LayoutPanel />`. The slot counts as empty, so the neighbouring regions move out to the layout edge.' },
|
|
180
|
+
{ guidance: true, description: 'Give a region a landmark role and label on the region component when it is a page landmark, for example `<LayoutPanel role="navigation" label="Sections">`. Layout adds no role or name.' },
|
|
168
181
|
{ guidance: false, description: 'Use Layout for simple stacking layouts; use HStack or VStack instead.' },
|
|
169
182
|
{ guidance: false, description: 'Use Layout as the page shell or for app-wide navigation; use AppShell for that responsibility.' },
|
|
170
183
|
],
|
|
@@ -230,6 +243,8 @@ export const docsZh = {
|
|
|
230
243
|
bestPractices: [
|
|
231
244
|
{ guidance: true, description: 'Use Layout when content needs named header, start, content, end, or footer regions.' },
|
|
232
245
|
{ guidance: true, description: 'Use HStack and VStack for simple directional stacking within a content area.' },
|
|
246
|
+
{ guidance: true, description: 'Hide a region by passing `false`, `null`, or `undefined` to its slot, for example `isOpen && <LayoutPanel />`. The slot counts as empty, so the neighbouring regions move out to the layout edge.' },
|
|
247
|
+
{ guidance: true, description: 'Give a region a landmark role and label on the region component when it is a page landmark, for example `<LayoutPanel role="navigation" label="Sections">`. Layout adds no role or name.' },
|
|
233
248
|
{ guidance: false, description: 'Use Layout for simple stacking layouts; use HStack or VStack instead.' },
|
|
234
249
|
{ guidance: false, description: 'Use Layout as the page shell or for app-wide navigation; use AppShell for that responsibility.' },
|
|
235
250
|
],
|
|
@@ -246,6 +261,8 @@ export const docsDense = {
|
|
|
246
261
|
bestPractices: [
|
|
247
262
|
{ guidance: true, description: 'Use Layout when content needs named header, start, content, end, or footer regions.' },
|
|
248
263
|
{ guidance: true, description: 'Use HStack and VStack for simple directional stacking within a content area.' },
|
|
264
|
+
{ guidance: true, description: 'Hide a region by passing `false`, `null`, or `undefined` to its slot, for example `isOpen && <LayoutPanel />`. The slot counts as empty, so the neighbouring regions move out to the layout edge.' },
|
|
265
|
+
{ guidance: true, description: 'Give a region a landmark role and label on the region component when it is a page landmark, for example `<LayoutPanel role="navigation" label="Sections">`. Layout adds no role or name.' },
|
|
249
266
|
{ guidance: false, description: 'Use Layout for simple stacking layouts; use HStack or VStack instead.' },
|
|
250
267
|
{ guidance: false, description: 'Use Layout as the page shell or for app-wide navigation; use AppShell for that responsibility.' },
|
|
251
268
|
],
|
package/src/Layout/Layout.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Layout.tsx
|
|
7
|
-
* @input Uses React, stack/stackItem utilities, LayoutAreaContext, LayoutSlotsContext
|
|
7
|
+
* @input Uses React, stack/stackItem utilities, isRenderable, LayoutAreaContext, LayoutSlotsContext
|
|
8
8
|
* @output Exports Layout component and LayoutProps, LayoutHeight types
|
|
9
9
|
* @position General five-slot layout primitive for arranging header, start, content, end, and footer regions.
|
|
10
10
|
* Building a page area with a side panel? Use Layout with start/end slots.
|
|
@@ -25,6 +25,7 @@ import {LayoutDividerContext} from './LayoutDividerContext';
|
|
|
25
25
|
import {stack} from '../Stack/stack.stylex';
|
|
26
26
|
import {stackItem} from '../Stack/stackItem.stylex';
|
|
27
27
|
import {mergeProps} from '../utils/mergeProps';
|
|
28
|
+
import {isRenderable} from '../utils/isRenderable';
|
|
28
29
|
import {layoutFooterMarker, layoutHeaderMarker} from './layoutEdges.stylex';
|
|
29
30
|
import type {BaseProps} from '../BaseProps';
|
|
30
31
|
import type {SizeValue, SpacingStep} from '../utils/types';
|
|
@@ -89,6 +90,8 @@ const styles = stylex.create({
|
|
|
89
90
|
// explicit `padding` on this Layout overrides this on the same node.
|
|
90
91
|
'--layout-padding-own-outer-x': 'initial',
|
|
91
92
|
'--layout-padding-own-outer-y': 'initial',
|
|
93
|
+
'--_layout-flush-block-start': 'initial',
|
|
94
|
+
'--_layout-flush-block-end': 'initial',
|
|
92
95
|
},
|
|
93
96
|
fill: {
|
|
94
97
|
// Add 2x container block padding to compensate for negative block margins
|
|
@@ -106,9 +109,9 @@ const styles = stylex.create({
|
|
|
106
109
|
// LayoutFooter without one right after it, removes the matching inner
|
|
107
110
|
// padding of LayoutContent (it reads these, falling back to its padding).
|
|
108
111
|
// Sibling relations on this row only: a `:has()` on the layout followed
|
|
109
|
-
// by `*` restyles everything inside it on any change. Unset otherwise
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
+
// by `*` restyles everything inside it on any change. Unset otherwise:
|
|
113
|
+
// the inner stack clears both values, so a nested Layout does not take an
|
|
114
|
+
// outer row's collapse.
|
|
112
115
|
'--_layout-flush-block-start': {
|
|
113
116
|
default: null,
|
|
114
117
|
[stylex.when.siblingBefore(':not([data-divider])', layoutHeaderMarker)]:
|
|
@@ -366,11 +369,12 @@ export function Layout({
|
|
|
366
369
|
[defaultHasDividers],
|
|
367
370
|
);
|
|
368
371
|
|
|
369
|
-
//
|
|
370
|
-
|
|
371
|
-
const
|
|
372
|
-
const
|
|
373
|
-
const
|
|
372
|
+
// A slot that renders nothing, such as `false` from `isOpen && <LayoutHeader />`,
|
|
373
|
+
// is absent, so its neighbours take the outer inset on that side.
|
|
374
|
+
const hasHeader = isRenderable(header);
|
|
375
|
+
const hasFooter = isRenderable(footer);
|
|
376
|
+
const hasStart = isRenderable(start);
|
|
377
|
+
const hasEnd = isRenderable(end);
|
|
374
378
|
const hasBothPanels = hasStart && hasEnd;
|
|
375
379
|
const hasSinglePanel = hasStart !== hasEnd;
|
|
376
380
|
const usesInternalContentWidth =
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file LayoutAreaContext.ts
|
|
7
|
-
* @input Uses
|
|
7
|
+
* @input Uses createSharedContext
|
|
8
8
|
* @output Exports LayoutAreaContext and LayoutArea type
|
|
9
9
|
* @position Context for layout slot detection
|
|
10
10
|
*
|
|
@@ -12,19 +12,14 @@
|
|
|
12
12
|
* - /packages/core/src/Layout/Layout.doc.mjs
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Layout area type representing which slot a component is rendered in.
|
|
19
19
|
* Used by content area components to detect their position and adjust styling.
|
|
20
20
|
*/
|
|
21
21
|
export type LayoutArea =
|
|
22
|
-
| '
|
|
23
|
-
| 'footer'
|
|
24
|
-
| 'content'
|
|
25
|
-
| 'start'
|
|
26
|
-
| 'end'
|
|
27
|
-
| null;
|
|
22
|
+
'header' | 'footer' | 'content' | 'start' | 'end' | null;
|
|
28
23
|
|
|
29
24
|
/**
|
|
30
25
|
* Context for detecting which layout area a component is rendered in.
|
|
@@ -33,5 +28,9 @@ export type LayoutArea =
|
|
|
33
28
|
* - Apply correct semantic elements
|
|
34
29
|
* - Adjust internal spacing
|
|
35
30
|
*/
|
|
36
|
-
export const LayoutAreaContext =
|
|
31
|
+
export const LayoutAreaContext = createSharedContext<LayoutArea>(
|
|
32
|
+
'LayoutAreaContext',
|
|
33
|
+
1,
|
|
34
|
+
null,
|
|
35
|
+
);
|
|
37
36
|
LayoutAreaContext.displayName = 'LayoutAreaContext';
|
|
@@ -38,6 +38,11 @@ export const docs = {
|
|
|
38
38
|
type: 'AriaRole',
|
|
39
39
|
description: 'ARIA landmark role.',
|
|
40
40
|
},
|
|
41
|
+
{
|
|
42
|
+
name: 'ref',
|
|
43
|
+
type: 'React.Ref<HTMLDivElement>',
|
|
44
|
+
description: 'Ref forwarded to the content region element.',
|
|
45
|
+
},
|
|
41
46
|
],
|
|
42
47
|
};
|
|
43
48
|
|
|
@@ -75,6 +80,11 @@ export const docsZh = {
|
|
|
75
80
|
type: 'AriaRole',
|
|
76
81
|
description: 'ARIA 地标角色。',
|
|
77
82
|
},
|
|
83
|
+
{
|
|
84
|
+
name: 'ref',
|
|
85
|
+
type: 'React.Ref<HTMLDivElement>',
|
|
86
|
+
description: '转发到内容区域元素的 ref。',
|
|
87
|
+
},
|
|
78
88
|
],
|
|
79
89
|
};
|
|
80
90
|
|
|
@@ -91,5 +101,6 @@ export const docsDense = {
|
|
|
91
101
|
label:
|
|
92
102
|
'Accessible label for landmark element; also names the region while it scrolls (default "Content").',
|
|
93
103
|
role: 'ARIA landmark role.',
|
|
104
|
+
ref: 'Ref forwarded to the content region element.',
|
|
94
105
|
},
|
|
95
106
|
};
|
|
@@ -51,18 +51,18 @@ const styles = stylex.create({
|
|
|
51
51
|
// Publish container padding vars for bleed children (Table, Divider, etc.)
|
|
52
52
|
'--container-padding-inline-start': `var(--layout-padding-inner-x, ${spacingVars['--spacing-4']})`,
|
|
53
53
|
'--container-padding-inline-end': `var(--layout-padding-inner-x, ${spacingVars['--spacing-4']})`,
|
|
54
|
-
'--container-padding-block-start': `var(--layout-padding-inner-y, ${spacingVars['--spacing-4']})`,
|
|
55
|
-
'--container-padding-block-end': `var(--layout-padding-inner-y, ${spacingVars['--spacing-4']})`,
|
|
54
|
+
'--container-padding-block-start': `var(--_layout-flush-block-start, var(--layout-padding-inner-y, ${spacingVars['--spacing-4']}))`,
|
|
55
|
+
'--container-padding-block-end': `var(--_layout-flush-block-end, var(--layout-padding-inner-y, ${spacingVars['--spacing-4']}))`,
|
|
56
56
|
},
|
|
57
57
|
// When no start panel: outer-x on left edge
|
|
58
58
|
noStart: {
|
|
59
59
|
paddingInlineStart: `var(--layout-padding-own-outer-x, var(--layout-padding-outer-x, ${spacingVars['--spacing-4']}))`,
|
|
60
60
|
'--container-padding-inline-start': `var(--layout-padding-own-outer-x, var(--layout-padding-outer-x, ${spacingVars['--spacing-4']}))`,
|
|
61
|
-
'--container-padding-inline-end': `var(--layout-padding-own-outer-x, var(--layout-padding-outer-x, ${spacingVars['--spacing-4']}))`,
|
|
62
61
|
},
|
|
63
62
|
// When no end panel: outer-x on right edge
|
|
64
63
|
noEnd: {
|
|
65
64
|
paddingInlineEnd: `var(--layout-padding-own-outer-x, var(--layout-padding-outer-x, ${spacingVars['--spacing-4']}))`,
|
|
65
|
+
'--container-padding-inline-end': `var(--layout-padding-own-outer-x, var(--layout-padding-outer-x, ${spacingVars['--spacing-4']}))`,
|
|
66
66
|
},
|
|
67
67
|
// When no header: outer-y on top
|
|
68
68
|
noHeader: {
|
|
@@ -155,13 +155,13 @@ export interface LayoutContentProps extends BaseProps<HTMLDivElement> {
|
|
|
155
155
|
*
|
|
156
156
|
* @example
|
|
157
157
|
* ```
|
|
158
|
-
* <
|
|
158
|
+
* <Card>
|
|
159
159
|
* <Layout
|
|
160
160
|
* header={<LayoutHeader>Title</LayoutHeader>}
|
|
161
161
|
* content={<LayoutContent>Main body content</LayoutContent>}
|
|
162
162
|
* />
|
|
163
|
-
* </
|
|
164
|
-
* <
|
|
163
|
+
* </Card>
|
|
164
|
+
* <Card>
|
|
165
165
|
* <Layout
|
|
166
166
|
* content={
|
|
167
167
|
* <LayoutContent padding={0}>
|
|
@@ -169,8 +169,8 @@ export interface LayoutContentProps extends BaseProps<HTMLDivElement> {
|
|
|
169
169
|
* </LayoutContent>
|
|
170
170
|
* }
|
|
171
171
|
* />
|
|
172
|
-
* </
|
|
173
|
-
* <
|
|
172
|
+
* </Card>
|
|
173
|
+
* <Card>
|
|
174
174
|
* <Layout
|
|
175
175
|
* content={
|
|
176
176
|
* <LayoutContent isScrollable={false}>
|
|
@@ -178,7 +178,7 @@ export interface LayoutContentProps extends BaseProps<HTMLDivElement> {
|
|
|
178
178
|
* </LayoutContent>
|
|
179
179
|
* }
|
|
180
180
|
* />
|
|
181
|
-
* </
|
|
181
|
+
* </Card>
|
|
182
182
|
* ```
|
|
183
183
|
*/
|
|
184
184
|
export function LayoutContent({
|
|
@@ -16,12 +16,16 @@
|
|
|
16
16
|
* - /packages/core/src/Layout/LayoutFooter.tsx
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import {createLayerScopedContext
|
|
19
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
20
20
|
|
|
21
21
|
export interface LayoutDividerContextValue {
|
|
22
22
|
defaultHasDividers: boolean;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export const LayoutDividerContext =
|
|
26
|
-
|
|
26
|
+
createLayerScopedContext<LayoutDividerContextValue | null>(
|
|
27
|
+
'LayoutDividerContext',
|
|
28
|
+
1,
|
|
29
|
+
null,
|
|
30
|
+
);
|
|
27
31
|
LayoutDividerContext.displayName = 'LayoutDividerContext';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* - /packages/core/src/Layout/Layout/index.ts
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {createLayerScopedContext
|
|
16
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Information about which layout slots are filled.
|
|
@@ -47,6 +47,9 @@ export const DEFAULT_LAYOUT_SLOTS: LayoutSlots = {
|
|
|
47
47
|
* Content area components use this to determine if they are at an edge
|
|
48
48
|
* (for applying outer padding).
|
|
49
49
|
*/
|
|
50
|
-
export const LayoutSlotsContext =
|
|
51
|
-
|
|
50
|
+
export const LayoutSlotsContext = createLayerScopedContext<LayoutSlots>(
|
|
51
|
+
'LayoutSlotsContext',
|
|
52
|
+
1,
|
|
53
|
+
DEFAULT_LAYOUT_SLOTS,
|
|
54
|
+
);
|
|
52
55
|
LayoutSlotsContext.displayName = 'LayoutSlotsContext';
|
package/src/Link/LinkContext.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file LinkContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, LinkComponentType
|
|
8
8
|
* @output Exports LinkContext and LinkContextValue
|
|
9
9
|
* @position Context definition for polymorphic link support
|
|
10
10
|
*
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* - /packages/core/src/Link/Link.doc.mjs
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {createContext} from 'react';
|
|
23
22
|
import type {LinkComponentType} from './types';
|
|
23
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Context value for the link provider.
|
|
@@ -33,5 +33,9 @@ export interface LinkContextValue {
|
|
|
33
33
|
* Context for providing a custom link component to all Astryx components.
|
|
34
34
|
* Defaults to null (components fall back to native `<a>`).
|
|
35
35
|
*/
|
|
36
|
-
export const LinkContext =
|
|
36
|
+
export const LinkContext = createSharedContext<LinkContextValue | null>(
|
|
37
|
+
'LinkContext',
|
|
38
|
+
1,
|
|
39
|
+
null,
|
|
40
|
+
);
|
|
37
41
|
LinkContext.displayName = 'LinkContext';
|
package/src/List/List.doc.mjs
CHANGED
|
@@ -50,6 +50,11 @@ export const docs = {
|
|
|
50
50
|
description: 'Show dividers between items.',
|
|
51
51
|
default: 'false',
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
name: 'animatedLayout',
|
|
55
|
+
type: 'AnimatedLayout',
|
|
56
|
+
description: 'The handle from useAnimatedLayout({containerRef}). With it, when rows are inserted, removed or reordered, an inserted row enters, a removed row collapses in place, a row that crosses rows moving the other way rides above them with the surface color behind it, and the rows after a change and the content after the list, up to that container, glide to their new places, all on one shared motion, under every pointer. Under Reduce Motion nothing travels. A row is identified by its itemKey: a row without one changes at once. Without a handle the list changes at once.',
|
|
57
|
+
},
|
|
53
58
|
{
|
|
54
59
|
name: 'edge',
|
|
55
60
|
type: "'padded' | 'flush' | 'outset' | 'bleed'",
|
package/src/List/List.tsx
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* - /packages/cli/assets/templates/blocks/components/List/ (showcase blocks)
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {useId, useMemo, type ReactNode} from 'react';
|
|
22
|
+
import {useId, useMemo, useRef, type ReactNode} from 'react';
|
|
23
23
|
import * as stylex from '@stylexjs/stylex';
|
|
24
24
|
import {spacingVars} from '../theme/tokens.stylex';
|
|
25
25
|
import type {BaseProps} from '../BaseProps';
|
|
@@ -30,6 +30,10 @@ import {
|
|
|
30
30
|
type ListMarkerStyle,
|
|
31
31
|
} from './ListContext';
|
|
32
32
|
import {mergeProps} from '../utils/mergeProps';
|
|
33
|
+
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
34
|
+
import {useListLayoutUpdates} from './listLayoutUpdates';
|
|
35
|
+
import {LayoutChangeSnapshot} from '../motion/LayoutChangeSnapshot';
|
|
36
|
+
import type {AnimatedLayout} from '../motion/animatedLayout';
|
|
33
37
|
import {themeProps} from '../utils/themeProps';
|
|
34
38
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
35
39
|
|
|
@@ -58,6 +62,17 @@ export interface ListProps extends BaseProps<
|
|
|
58
62
|
*/
|
|
59
63
|
density?: ListDensity;
|
|
60
64
|
|
|
65
|
+
/**
|
|
66
|
+
* The handle from `useAnimatedLayout({containerRef})`. With it, the list
|
|
67
|
+
* animates its row changes on one shared motion, under every pointer. An
|
|
68
|
+
* inserted row enters, and a removed row collapses in place. A row that
|
|
69
|
+
* crosses rows moving the other way rides above them. The rows after a
|
|
70
|
+
* change, and the content after the list up to that container, glide to
|
|
71
|
+
* their new places. A row's identity is its `itemKey`, so a row without one
|
|
72
|
+
* changes at once. Without a handle the list changes at once.
|
|
73
|
+
*/
|
|
74
|
+
animatedLayout?: AnimatedLayout;
|
|
75
|
+
|
|
61
76
|
/**
|
|
62
77
|
* Whether to show dividers between list items.
|
|
63
78
|
* @default false
|
|
@@ -154,6 +169,12 @@ const styles = stylex.create({
|
|
|
154
169
|
// mouse nothing rises, so the list keeps its stacking.
|
|
155
170
|
isolation: {default: null, '@media (pointer: coarse)': 'isolate'},
|
|
156
171
|
},
|
|
172
|
+
// A list under an `animatedLayout` handle isolates for every pointer. A row
|
|
173
|
+
// that slides across others rides above them with a mouse too, and it must
|
|
174
|
+
// stay below a page-level sticky header.
|
|
175
|
+
animatedIsolation: {
|
|
176
|
+
isolation: 'isolate',
|
|
177
|
+
},
|
|
157
178
|
// Subgridded numbered rows contribute their marker's intrinsic width to
|
|
158
179
|
// one column, so text and nested lists never move with an individual number.
|
|
159
180
|
numberColumns: {
|
|
@@ -225,6 +246,7 @@ const dynamicStyles = stylex.create({
|
|
|
225
246
|
*/
|
|
226
247
|
export function List({
|
|
227
248
|
children,
|
|
249
|
+
animatedLayout,
|
|
228
250
|
density = 'balanced',
|
|
229
251
|
hasDividers = false,
|
|
230
252
|
edge: edgeProp,
|
|
@@ -240,6 +262,12 @@ export function List({
|
|
|
240
262
|
...props
|
|
241
263
|
}: ListProps) {
|
|
242
264
|
const headerId = useId();
|
|
265
|
+
const listRef = useRef<HTMLUListElement & HTMLOListElement>(null);
|
|
266
|
+
const measureRows = useListLayoutUpdates(listRef, animatedLayout);
|
|
267
|
+
const mergedRef = useMergedRefs(
|
|
268
|
+
listRef,
|
|
269
|
+
ref as React.Ref<HTMLUListElement & HTMLOListElement>,
|
|
270
|
+
);
|
|
243
271
|
const isOrdered = listStyle === 'decimal';
|
|
244
272
|
const Tag = isOrdered ? 'ol' : 'ul';
|
|
245
273
|
// Plain use of the deprecated prop is reported by its @deprecated type;
|
|
@@ -255,13 +283,19 @@ export function List({
|
|
|
255
283
|
const reachesContainerPadding = edge === 'outset' || edge === 'bleed';
|
|
256
284
|
|
|
257
285
|
const contextValue = useMemo(
|
|
258
|
-
() => ({
|
|
259
|
-
|
|
286
|
+
() => ({
|
|
287
|
+
density,
|
|
288
|
+
hasDividers,
|
|
289
|
+
edge,
|
|
290
|
+
listStyle,
|
|
291
|
+
animatedLayout,
|
|
292
|
+
}),
|
|
293
|
+
[density, hasDividers, edge, listStyle, animatedLayout],
|
|
260
294
|
);
|
|
261
295
|
|
|
262
296
|
const listElement = (
|
|
263
297
|
<Tag
|
|
264
|
-
ref={
|
|
298
|
+
ref={mergedRef}
|
|
265
299
|
// Consumer props first: everything the component sets for itself below
|
|
266
300
|
// is part of its contract and wins on conflict.
|
|
267
301
|
{...props}
|
|
@@ -281,6 +315,7 @@ export function List({
|
|
|
281
315
|
themeProps('list', {density, listStyle}),
|
|
282
316
|
stylex.props(
|
|
283
317
|
styles.list,
|
|
318
|
+
animatedLayout != null && styles.animatedIsolation,
|
|
284
319
|
isOrdered && styles.numberColumns,
|
|
285
320
|
hasDividers && styles.withDividers,
|
|
286
321
|
reachesContainerPadding && styles.reachesContainerPadding,
|
|
@@ -297,12 +332,25 @@ export function List({
|
|
|
297
332
|
</Tag>
|
|
298
333
|
);
|
|
299
334
|
|
|
335
|
+
// Every change of the rows is measured before it lands. LayoutChangeSnapshot
|
|
336
|
+
// calls this in the commit, before the DOM changes.
|
|
337
|
+
const snapshot =
|
|
338
|
+
animatedLayout != null ? (
|
|
339
|
+
<LayoutChangeSnapshot value={children} onBeforeChange={measureRows} />
|
|
340
|
+
) : null;
|
|
341
|
+
|
|
300
342
|
if (header == null) {
|
|
301
|
-
return
|
|
343
|
+
return (
|
|
344
|
+
<ListContext value={contextValue}>
|
|
345
|
+
{snapshot}
|
|
346
|
+
{listElement}
|
|
347
|
+
</ListContext>
|
|
348
|
+
);
|
|
302
349
|
}
|
|
303
350
|
|
|
304
351
|
return (
|
|
305
352
|
<ListContext value={contextValue}>
|
|
353
|
+
{snapshot}
|
|
306
354
|
<div {...stylex.props(styles.root)}>
|
|
307
355
|
<div id={headerId} {...stylex.props(styles.header)}>
|
|
308
356
|
{header}
|