@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
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
* layer counts when the finger lifts too, or when a scroll takes the touch,
|
|
44
45
|
* which is when UIKit dismisses a popover.
|
|
45
46
|
*/
|
|
46
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
47
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
47
48
|
import { currentGesture } from "./gestureCounter.js";
|
|
48
49
|
import { noteOutsideDismissal } from "./outsidePress.js";
|
|
49
50
|
import { innermostInteractive, matchesInteractiveSelectors } from "../hooks/useClickableContainer.js";
|
|
@@ -67,6 +68,56 @@ import { useInteractionModalityTrackingFor } from "../utils/interactionModality.
|
|
|
67
68
|
* once it lands. See `handlePointerEnter`.
|
|
68
69
|
*/
|
|
69
70
|
export const TOUCH_POINTER_TYPES = new Set(['touch', 'pen']);
|
|
71
|
+
|
|
72
|
+
/** Waits for the tap that a touch or pen press may become. Internal. */
|
|
73
|
+
|
|
74
|
+
/** One tap recognizer for a trigger, released on unmount. Internal. */
|
|
75
|
+
export function useTapRecognizer() {
|
|
76
|
+
const [recognizer] = useState(createTapRecognizer);
|
|
77
|
+
// Releases a pending tap on unmount.
|
|
78
|
+
useEffect(() => () => recognizer.forget(), [recognizer]);
|
|
79
|
+
return recognizer;
|
|
80
|
+
}
|
|
81
|
+
function createTapRecognizer() {
|
|
82
|
+
let stopWaiting = null;
|
|
83
|
+
const forget = () => {
|
|
84
|
+
stopWaiting?.();
|
|
85
|
+
stopWaiting = null;
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
press(event, trigger, onTap) {
|
|
89
|
+
forget();
|
|
90
|
+
if (!TOUCH_POINTER_TYPES.has(event.pointerType)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (trigger == null) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
// The tap must belong to this press. A key press or a new pointer press
|
|
97
|
+
// advances the gesture, so a keyboard activation that later fires
|
|
98
|
+
// `click` on the trigger (Enter on a button) is not mistaken for it.
|
|
99
|
+
const gesture = currentGesture();
|
|
100
|
+
const stop = () => {
|
|
101
|
+
trigger.removeEventListener('click', handleTap);
|
|
102
|
+
trigger.removeEventListener('pointercancel', stop);
|
|
103
|
+
if (stopWaiting === stop) {
|
|
104
|
+
stopWaiting = null;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const handleTap = tapEvent => {
|
|
108
|
+
stop();
|
|
109
|
+
if (currentGesture() === gesture) {
|
|
110
|
+
onTap(tapEvent);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
trigger.addEventListener('click', handleTap);
|
|
114
|
+
trigger.addEventListener('pointercancel', stop);
|
|
115
|
+
stopWaiting = stop;
|
|
116
|
+
return true;
|
|
117
|
+
},
|
|
118
|
+
forget
|
|
119
|
+
};
|
|
120
|
+
}
|
|
70
121
|
export function useTapStop(event) {
|
|
71
122
|
const pressIsTapRef = useRef(false);
|
|
72
123
|
const onPointerDown = pointer => {
|
|
@@ -260,9 +311,7 @@ onReleaseInLayer) {
|
|
|
260
311
|
// The documents the outside dismissal listens on: the page's, and the
|
|
261
312
|
// trigger's own when it renders in another document, such as an iframe.
|
|
262
313
|
const outsideDocumentsRef = useRef([]);
|
|
263
|
-
|
|
264
|
-
// waiting. The next press, a cancel, the tap itself or unmounting calls it.
|
|
265
|
-
const forgetPendingTapRef = useRef(null);
|
|
314
|
+
const tapRecognizer = useTapRecognizer();
|
|
266
315
|
const readModality = useInteractionModalityTrackingFor(triggerRef);
|
|
267
316
|
const disarmOutsideDismiss = useCallback(() => {
|
|
268
317
|
isTapOpenRef.current = false;
|
|
@@ -322,8 +371,6 @@ onReleaseInLayer) {
|
|
|
322
371
|
|
|
323
372
|
// Releases the outside-dismiss listener on unmount.
|
|
324
373
|
useEffect(() => disarmOutsideDismiss, [disarmOutsideDismiss]);
|
|
325
|
-
// Releases a pending tap on unmount.
|
|
326
|
-
useEffect(() => () => forgetPendingTapRef.current?.(), []);
|
|
327
374
|
const isTouchInteraction = useCallback(() => isTouchPointerRef.current && readModality() === 'pointer', [readModality]);
|
|
328
375
|
const handlePointerEnter = useCallback(event => {
|
|
329
376
|
// Only a finger is hoverless on arrival. A pen in detection range hovers
|
|
@@ -340,7 +387,7 @@ onReleaseInLayer) {
|
|
|
340
387
|
const trigger = triggerRef.current;
|
|
341
388
|
// A tap that landed in a disabled control is that control's: its reason
|
|
342
389
|
// opens. Every other tap is the trigger's to decide.
|
|
343
|
-
const tapped = tapEvent
|
|
390
|
+
const tapped = tapEvent?.target instanceof Element ? tapEvent.target : null;
|
|
344
391
|
const mode = touchTrigger === 'auto' ? tapped != null && tapLandsOnDisabledControl(tapped) ? 'tap' : trigger != null && isActionTrigger(trigger) ? 'none' : 'tap' : touchTrigger;
|
|
345
392
|
if (mode === 'none' || !isEnabled) {
|
|
346
393
|
// A layer left open by an earlier tap must not survive the next one.
|
|
@@ -362,39 +409,14 @@ onReleaseInLayer) {
|
|
|
362
409
|
const handlePointerDown = useCallback(event => {
|
|
363
410
|
const isTouch = TOUCH_POINTER_TYPES.has(event.pointerType);
|
|
364
411
|
isTouchPointerRef.current = isTouch;
|
|
365
|
-
// A new press replaces one that never became a tap.
|
|
366
|
-
forgetPendingTapRef.current?.();
|
|
367
412
|
if (!isTouch || isControlled) {
|
|
413
|
+
tapRecognizer.forget();
|
|
368
414
|
return false;
|
|
369
415
|
}
|
|
370
416
|
const trigger = event.currentTarget instanceof Element ? event.currentTarget : triggerRef.current;
|
|
371
|
-
|
|
372
|
-
return true;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
// The tap must belong to this press. A key press or a new pointer press
|
|
376
|
-
// advances the gesture, so a keyboard activation that later fires
|
|
377
|
-
// `click` on the trigger (Enter on a button) is not mistaken for it.
|
|
378
|
-
const gesture = currentGesture();
|
|
379
|
-
const forget = () => {
|
|
380
|
-
trigger.removeEventListener('click', handleTap);
|
|
381
|
-
trigger.removeEventListener('pointercancel', forget);
|
|
382
|
-
if (forgetPendingTapRef.current === forget) {
|
|
383
|
-
forgetPendingTapRef.current = null;
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
const handleTap = tapEvent => {
|
|
387
|
-
forget();
|
|
388
|
-
if (currentGesture() === gesture) {
|
|
389
|
-
answerTapRef.current(tapEvent);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
trigger.addEventListener('click', handleTap);
|
|
393
|
-
// The browser took the touch for a scroll or a pinch: no tap is coming.
|
|
394
|
-
trigger.addEventListener('pointercancel', forget);
|
|
395
|
-
forgetPendingTapRef.current = forget;
|
|
417
|
+
tapRecognizer.press(event, trigger, tapEvent => answerTapRef.current(tapEvent));
|
|
396
418
|
return true;
|
|
397
|
-
}, [isControlled, triggerRef]);
|
|
419
|
+
}, [isControlled, triggerRef, tapRecognizer]);
|
|
398
420
|
|
|
399
421
|
// A layer closed by any other path (Escape, a consumer, the browser) leaves
|
|
400
422
|
// no tap-open to dismiss. Only a true open→closed transition counts: a
|
|
@@ -408,12 +430,14 @@ onReleaseInLayer) {
|
|
|
408
430
|
}
|
|
409
431
|
wasOpenRef.current = isOpen;
|
|
410
432
|
}, [isOpen, disarmOutsideDismiss]);
|
|
433
|
+
const answerTap = useCallback(tapEvent => answerTapRef.current(tapEvent), []);
|
|
411
434
|
return {
|
|
412
435
|
isTouchPointerRef,
|
|
413
436
|
isTouchInteraction,
|
|
414
437
|
handlePointerEnter,
|
|
415
438
|
handlePointerDown,
|
|
416
439
|
clearTapOpen: disarmOutsideDismiss,
|
|
417
|
-
armOutsideDismiss
|
|
440
|
+
armOutsideDismiss,
|
|
441
|
+
answerTap
|
|
418
442
|
};
|
|
419
443
|
}
|
package/dist/Layout/Layout.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Layout.tsx
|
|
3
|
-
* @input Uses React, stack/stackItem utilities, LayoutAreaContext, LayoutSlotsContext
|
|
3
|
+
* @input Uses React, stack/stackItem utilities, isRenderable, LayoutAreaContext, LayoutSlotsContext
|
|
4
4
|
* @output Exports Layout component and LayoutProps, LayoutHeight types
|
|
5
5
|
* @position General five-slot layout primitive for arranging header, start, content, end, and footer regions.
|
|
6
6
|
* Building a page area with a side panel? Use Layout with start/end slots.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/Layout/Layout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/Layout/Layout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAU9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAO3D;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAsJ3C,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;IAC7D;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,GAAG,EACH,MAAM,EACN,MAAM,EACN,MAAe,EACf,OAAO,EACP,GAAG,EACH,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,SAAS,EACb,EAAE,WAAW,+BAuGb;yBAvHe,MAAM"}
|
package/dist/Layout/Layout.js
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.
|
|
@@ -24,6 +24,7 @@ import { LayoutDividerContext } from "./LayoutDividerContext.js";
|
|
|
24
24
|
import { stack } from "../Stack/stack.stylex.js";
|
|
25
25
|
import { stackItem } from "../Stack/stackItem.stylex.js";
|
|
26
26
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
27
|
+
import { isRenderable } from "../utils/isRenderable.js";
|
|
27
28
|
import "./layoutEdges.stylex.js";
|
|
28
29
|
import { layoutFooterMarker, layoutHeaderMarker } from "./layoutEdges.stylex.js";
|
|
29
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -67,6 +68,8 @@ const styles = {
|
|
|
67
68
|
"--layout-alignment-width": "x19kr0ht",
|
|
68
69
|
"--layout-padding-own-outer-x": "x1vii845",
|
|
69
70
|
"--layout-padding-own-outer-y": "xojybgt",
|
|
71
|
+
"--_layout-flush-block-start": "xu9n9za",
|
|
72
|
+
"--_layout-flush-block-end": "xt8hc1d",
|
|
70
73
|
$$css: true
|
|
71
74
|
},
|
|
72
75
|
fill: {
|
|
@@ -231,11 +234,12 @@ export function Layout({
|
|
|
231
234
|
defaultHasDividers
|
|
232
235
|
} : null, [defaultHasDividers]);
|
|
233
236
|
|
|
234
|
-
//
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
const
|
|
237
|
+
// A slot that renders nothing, such as `false` from `isOpen && <LayoutHeader />`,
|
|
238
|
+
// is absent, so its neighbours take the outer inset on that side.
|
|
239
|
+
const hasHeader = isRenderable(header);
|
|
240
|
+
const hasFooter = isRenderable(footer);
|
|
241
|
+
const hasStart = isRenderable(start);
|
|
242
|
+
const hasEnd = isRenderable(end);
|
|
239
243
|
const hasBothPanels = hasStart && hasEnd;
|
|
240
244
|
const hasSinglePanel = hasStart !== hasEnd;
|
|
241
245
|
const usesInternalContentWidth = contentWidth != null && supportsInternalContentWidthAlignment(contentWidth);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutAreaContext.d.ts","sourceRoot":"","sources":["../../src/Layout/LayoutAreaContext.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"LayoutAreaContext.d.ts","sourceRoot":"","sources":["../../src/Layout/LayoutAreaContext.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,MAAM,UAAU,GACpB,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,qCAI7B,CAAC"}
|
|
@@ -4,14 +4,14 @@
|
|
|
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
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
12
|
* - /packages/core/src/Layout/Layout.doc.mjs
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Layout area type representing which slot a component is rendered in.
|
|
@@ -25,5 +25,5 @@ import { createContext } from 'react';
|
|
|
25
25
|
* - Apply correct semantic elements
|
|
26
26
|
* - Adjust internal spacing
|
|
27
27
|
*/
|
|
28
|
-
export const LayoutAreaContext =
|
|
28
|
+
export const LayoutAreaContext = createSharedContext('LayoutAreaContext', 1, null);
|
|
29
29
|
LayoutAreaContext.displayName = 'LayoutAreaContext';
|
|
@@ -54,13 +54,13 @@ export interface LayoutContentProps extends BaseProps<HTMLDivElement> {
|
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```
|
|
57
|
-
* <
|
|
57
|
+
* <Card>
|
|
58
58
|
* <Layout
|
|
59
59
|
* header={<LayoutHeader>Title</LayoutHeader>}
|
|
60
60
|
* content={<LayoutContent>Main body content</LayoutContent>}
|
|
61
61
|
* />
|
|
62
|
-
* </
|
|
63
|
-
* <
|
|
62
|
+
* </Card>
|
|
63
|
+
* <Card>
|
|
64
64
|
* <Layout
|
|
65
65
|
* content={
|
|
66
66
|
* <LayoutContent padding={0}>
|
|
@@ -68,8 +68,8 @@ export interface LayoutContentProps extends BaseProps<HTMLDivElement> {
|
|
|
68
68
|
* </LayoutContent>
|
|
69
69
|
* }
|
|
70
70
|
* />
|
|
71
|
-
* </
|
|
72
|
-
* <
|
|
71
|
+
* </Card>
|
|
72
|
+
* <Card>
|
|
73
73
|
* <Layout
|
|
74
74
|
* content={
|
|
75
75
|
* <LayoutContent isScrollable={false}>
|
|
@@ -77,7 +77,7 @@ export interface LayoutContentProps extends BaseProps<HTMLDivElement> {
|
|
|
77
77
|
* </LayoutContent>
|
|
78
78
|
* }
|
|
79
79
|
* />
|
|
80
|
-
* </
|
|
80
|
+
* </Card>
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
83
|
export declare function LayoutContent({ children, isScrollable, padding, label, role, xstyle, className, style, ref, ...props }: LayoutContentProps): import("react").JSX.Element;
|
|
@@ -38,18 +38,18 @@ const styles = {
|
|
|
38
38
|
kGO01o: "x12g7ifj",
|
|
39
39
|
"--container-padding-inline-start": "x408pgh",
|
|
40
40
|
"--container-padding-inline-end": "xikqloz",
|
|
41
|
-
"--container-padding-block-start": "
|
|
42
|
-
"--container-padding-block-end": "
|
|
41
|
+
"--container-padding-block-start": "xzrhu1o",
|
|
42
|
+
"--container-padding-block-end": "x165zlxo",
|
|
43
43
|
$$css: true
|
|
44
44
|
},
|
|
45
45
|
noStart: {
|
|
46
46
|
kZCmMZ: "xaku5ci",
|
|
47
47
|
"--container-padding-inline-start": "xt2a87w",
|
|
48
|
-
"--container-padding-inline-end": "xhq06x6",
|
|
49
48
|
$$css: true
|
|
50
49
|
},
|
|
51
50
|
noEnd: {
|
|
52
51
|
kwRFfy: "x19eyx77",
|
|
52
|
+
"--container-padding-inline-end": "xhq06x6",
|
|
53
53
|
$$css: true
|
|
54
54
|
},
|
|
55
55
|
noHeader: {
|
|
@@ -103,13 +103,13 @@ const styles = {
|
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
105
|
* ```
|
|
106
|
-
* <
|
|
106
|
+
* <Card>
|
|
107
107
|
* <Layout
|
|
108
108
|
* header={<LayoutHeader>Title</LayoutHeader>}
|
|
109
109
|
* content={<LayoutContent>Main body content</LayoutContent>}
|
|
110
110
|
* />
|
|
111
|
-
* </
|
|
112
|
-
* <
|
|
111
|
+
* </Card>
|
|
112
|
+
* <Card>
|
|
113
113
|
* <Layout
|
|
114
114
|
* content={
|
|
115
115
|
* <LayoutContent padding={0}>
|
|
@@ -117,8 +117,8 @@ const styles = {
|
|
|
117
117
|
* </LayoutContent>
|
|
118
118
|
* }
|
|
119
119
|
* />
|
|
120
|
-
* </
|
|
121
|
-
* <
|
|
120
|
+
* </Card>
|
|
121
|
+
* <Card>
|
|
122
122
|
* <Layout
|
|
123
123
|
* content={
|
|
124
124
|
* <LayoutContent isScrollable={false}>
|
|
@@ -126,7 +126,7 @@ const styles = {
|
|
|
126
126
|
* </LayoutContent>
|
|
127
127
|
* }
|
|
128
128
|
* />
|
|
129
|
-
* </
|
|
129
|
+
* </Card>
|
|
130
130
|
* ```
|
|
131
131
|
*/
|
|
132
132
|
export function LayoutContent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutDividerContext.d.ts","sourceRoot":"","sources":["../../src/Layout/LayoutDividerContext.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"LayoutDividerContext.d.ts","sourceRoot":"","sources":["../../src/Layout/LayoutDividerContext.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,oBAAoB,2DAK9B,CAAC"}
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
* - /packages/core/src/Layout/LayoutHeader.tsx
|
|
16
16
|
* - /packages/core/src/Layout/LayoutFooter.tsx
|
|
17
17
|
*/
|
|
18
|
-
import { createLayerScopedContext
|
|
19
|
-
export const LayoutDividerContext =
|
|
18
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
19
|
+
export const LayoutDividerContext = createLayerScopedContext('LayoutDividerContext', 1, null);
|
|
20
20
|
LayoutDividerContext.displayName = 'LayoutDividerContext';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutSlotsContext.d.ts","sourceRoot":"","sources":["../../src/Layout/LayoutSlotsContext.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,EAAE,WAKlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"LayoutSlotsContext.d.ts","sourceRoot":"","sources":["../../src/Layout/LayoutSlotsContext.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,EAAE,WAKlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,sCAI9B,CAAC"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - /packages/core/src/Layout/Layout.doc.mjs
|
|
13
13
|
* - /packages/core/src/Layout/Layout/index.ts
|
|
14
14
|
*/
|
|
15
|
-
import { createLayerScopedContext
|
|
15
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Information about which layout slots are filled.
|
|
@@ -36,5 +36,5 @@ export const DEFAULT_LAYOUT_SLOTS = {
|
|
|
36
36
|
* Content area components use this to determine if they are at an edge
|
|
37
37
|
* (for applying outer padding).
|
|
38
38
|
*/
|
|
39
|
-
export const LayoutSlotsContext =
|
|
39
|
+
export const LayoutSlotsContext = createLayerScopedContext('LayoutSlotsContext', 1, DEFAULT_LAYOUT_SLOTS);
|
|
40
40
|
LayoutSlotsContext.displayName = 'LayoutSlotsContext';
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file LinkContext.ts
|
|
3
|
+
* @input createSharedContext, LinkComponentType
|
|
4
|
+
* @output Exports LinkContext and LinkContextValue
|
|
5
|
+
* @position Context definition for polymorphic link support
|
|
6
|
+
*
|
|
7
|
+
* Separated from LinkProvider.tsx to allow components to consume
|
|
8
|
+
* the context without pulling in the full provider implementation.
|
|
9
|
+
* Follows the ThemeContext.ts / Theme.tsx pattern.
|
|
10
|
+
*
|
|
11
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
12
|
+
* - /packages/core/src/Link/LinkProvider.tsx
|
|
13
|
+
* - /packages/core/src/Link/useLinkComponent.ts
|
|
14
|
+
* - /packages/core/src/Link/index.ts
|
|
15
|
+
* - /packages/core/src/Link/Link.doc.mjs
|
|
16
|
+
*/
|
|
1
17
|
import type { LinkComponentType } from './types.js';
|
|
2
18
|
/**
|
|
3
19
|
* Context value for the link provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkContext.d.ts","sourceRoot":"","sources":["../../src/Link/LinkContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinkContext.d.ts","sourceRoot":"","sources":["../../src/Link/LinkContext.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAG/C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,kDAIvB,CAAC"}
|
package/dist/Link/LinkContext.js
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
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* - /packages/core/src/Link/index.ts
|
|
19
19
|
* - /packages/core/src/Link/Link.doc.mjs
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
21
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Context value for the link provider.
|
|
@@ -28,5 +28,5 @@ import { createContext } from 'react';
|
|
|
28
28
|
* Context for providing a custom link component to all Astryx components.
|
|
29
29
|
* Defaults to null (components fall back to native `<a>`).
|
|
30
30
|
*/
|
|
31
|
-
export const LinkContext =
|
|
31
|
+
export const LinkContext = createSharedContext('LinkContext', 1, null);
|
|
32
32
|
LinkContext.displayName = 'LinkContext';
|
package/dist/List/List.d.ts
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { type ReactNode } from 'react';
|
|
18
18
|
import type { BaseProps } from '../BaseProps.js';
|
|
19
19
|
import { type ListDensity, type ListEdge, type ListMarkerStyle } from './ListContext.js';
|
|
20
|
+
import type { AnimatedLayout } from '../motion/animatedLayout.js';
|
|
20
21
|
export { type ListDensity, type ListEdge, type ListMarkerStyle as ListStyle, } from './ListContext.js';
|
|
21
22
|
export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement> {
|
|
22
23
|
/** Ref forwarded to the root element */
|
|
@@ -33,6 +34,16 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
33
34
|
* @default 'balanced'
|
|
34
35
|
*/
|
|
35
36
|
density?: ListDensity;
|
|
37
|
+
/**
|
|
38
|
+
* The handle from `useAnimatedLayout({containerRef})`. With it, the list
|
|
39
|
+
* animates its row changes on one shared motion, under every pointer. An
|
|
40
|
+
* inserted row enters, and a removed row collapses in place. A row that
|
|
41
|
+
* crosses rows moving the other way rides above them. The rows after a
|
|
42
|
+
* change, and the content after the list up to that container, glide to
|
|
43
|
+
* their new places. A row's identity is its `itemKey`, so a row without one
|
|
44
|
+
* changes at once. Without a handle the list changes at once.
|
|
45
|
+
*/
|
|
46
|
+
animatedLayout?: AnimatedLayout;
|
|
36
47
|
/**
|
|
37
48
|
* Whether to show dividers between list items.
|
|
38
49
|
* @default false
|
|
@@ -121,7 +132,7 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
121
132
|
* </List>
|
|
122
133
|
* ```
|
|
123
134
|
*/
|
|
124
|
-
export declare function List({ children, density, hasDividers, edge: edgeProp, edgeCompensation, header, listStyle, start, xstyle, className, style, 'data-testid': testId, ref, ...props }: ListProps): import("react").JSX.Element;
|
|
135
|
+
export declare function List({ children, animatedLayout, density, hasDividers, edge: edgeProp, edgeCompensation, header, listStyle, start, xstyle, className, style, 'data-testid': testId, ref, ...props }: ListProps): import("react").JSX.Element;
|
|
125
136
|
export declare namespace List {
|
|
126
137
|
var displayName: string;
|
|
127
138
|
}
|
package/dist/List/List.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/List/List.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/List/List.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAyB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAI7D,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,eAAe,IAAI,SAAS,GAClC,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,SAAU,SAAQ,SAAS,CAC1C,gBAAgB,GAAG,gBAAgB,CACpC;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;IACrD;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA8ED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,cAAc,EACd,OAAoB,EACpB,WAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,gBAAgB,EAChB,MAAM,EACN,SAAkB,EAClB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BAmGX;yBAnHe,IAAI"}
|
package/dist/List/List.js
CHANGED
|
@@ -18,12 +18,15 @@
|
|
|
18
18
|
* - /apps/storybook/stories/List.stories.tsx
|
|
19
19
|
* - /packages/cli/assets/templates/blocks/components/List/ (showcase blocks)
|
|
20
20
|
*/
|
|
21
|
-
import { useId, useMemo } from 'react';
|
|
21
|
+
import { useId, useMemo, useRef } from 'react';
|
|
22
22
|
import * as stylex from '@stylexjs/stylex';
|
|
23
23
|
import "../theme/tokens.stylex.js";
|
|
24
24
|
import { spacingVars } from "../theme/tokens.stylex.js";
|
|
25
25
|
import { ListContext } from "./ListContext.js";
|
|
26
26
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
27
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
28
|
+
import { useListLayoutUpdates } from "./listLayoutUpdates.js";
|
|
29
|
+
import { LayoutChangeSnapshot } from "../motion/LayoutChangeSnapshot.js";
|
|
27
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
28
31
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
29
32
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -43,6 +46,10 @@ const styles = {
|
|
|
43
46
|
kHBbk8: "xsmms64",
|
|
44
47
|
$$css: true
|
|
45
48
|
},
|
|
49
|
+
animatedIsolation: {
|
|
50
|
+
kHBbk8: "xc8icb0",
|
|
51
|
+
$$css: true
|
|
52
|
+
},
|
|
46
53
|
numberColumns: {
|
|
47
54
|
k1xSpc: "x78zum5 x1tx5i3l",
|
|
48
55
|
kumcoG: "x16lqc3j",
|
|
@@ -106,6 +113,7 @@ const dynamicStyles = {
|
|
|
106
113
|
*/
|
|
107
114
|
export function List({
|
|
108
115
|
children,
|
|
116
|
+
animatedLayout,
|
|
109
117
|
density = 'balanced',
|
|
110
118
|
hasDividers = false,
|
|
111
119
|
edge: edgeProp,
|
|
@@ -121,6 +129,9 @@ export function List({
|
|
|
121
129
|
...props
|
|
122
130
|
}) {
|
|
123
131
|
const headerId = useId();
|
|
132
|
+
const listRef = useRef(null);
|
|
133
|
+
const measureRows = useListLayoutUpdates(listRef, animatedLayout);
|
|
134
|
+
const mergedRef = useMergedRefs(listRef, ref);
|
|
124
135
|
const isOrdered = listStyle === 'decimal';
|
|
125
136
|
const Tag = isOrdered ? 'ol' : 'ul';
|
|
126
137
|
// Plain use of the deprecated prop is reported by its @deprecated type;
|
|
@@ -132,10 +143,11 @@ export function List({
|
|
|
132
143
|
density,
|
|
133
144
|
hasDividers,
|
|
134
145
|
edge,
|
|
135
|
-
listStyle
|
|
136
|
-
|
|
146
|
+
listStyle,
|
|
147
|
+
animatedLayout
|
|
148
|
+
}), [density, hasDividers, edge, listStyle, animatedLayout]);
|
|
137
149
|
const listElement = /*#__PURE__*/_jsx(Tag, {
|
|
138
|
-
ref:
|
|
150
|
+
ref: mergedRef
|
|
139
151
|
// Consumer props first: everything the component sets for itself below
|
|
140
152
|
// is part of its contract and wins on conflict.
|
|
141
153
|
,
|
|
@@ -160,18 +172,25 @@ export function List({
|
|
|
160
172
|
...mergeProps(themeProps('list', {
|
|
161
173
|
density,
|
|
162
174
|
listStyle
|
|
163
|
-
}), stylex.props(styles.list, isOrdered && styles.numberColumns, hasDividers && styles.withDividers, reachesContainerPadding && styles.reachesContainerPadding, listStyle !== 'none' && (start != null && start !== 1 ? dynamicStyles.counterStart(start - 1) : styles.withCounter), xstyle), className, style),
|
|
175
|
+
}), stylex.props(styles.list, animatedLayout != null && styles.animatedIsolation, isOrdered && styles.numberColumns, hasDividers && styles.withDividers, reachesContainerPadding && styles.reachesContainerPadding, listStyle !== 'none' && (start != null && start !== 1 ? dynamicStyles.counterStart(start - 1) : styles.withCounter), xstyle), className, style),
|
|
164
176
|
children: children
|
|
165
177
|
});
|
|
178
|
+
|
|
179
|
+
// Every change of the rows is measured before it lands. LayoutChangeSnapshot
|
|
180
|
+
// calls this in the commit, before the DOM changes.
|
|
181
|
+
const snapshot = animatedLayout != null ? /*#__PURE__*/_jsx(LayoutChangeSnapshot, {
|
|
182
|
+
value: children,
|
|
183
|
+
onBeforeChange: measureRows
|
|
184
|
+
}) : null;
|
|
166
185
|
if (header == null) {
|
|
167
|
-
return /*#__PURE__*/
|
|
186
|
+
return /*#__PURE__*/_jsxs(ListContext, {
|
|
168
187
|
value: contextValue,
|
|
169
|
-
children: listElement
|
|
188
|
+
children: [snapshot, listElement]
|
|
170
189
|
});
|
|
171
190
|
}
|
|
172
|
-
return /*#__PURE__*/
|
|
191
|
+
return /*#__PURE__*/_jsxs(ListContext, {
|
|
173
192
|
value: contextValue,
|
|
174
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
193
|
+
children: [snapshot, /*#__PURE__*/_jsxs("div", {
|
|
175
194
|
...{
|
|
176
195
|
className: "x78zum5 xdt5ytf"
|
|
177
196
|
},
|
|
@@ -182,7 +201,7 @@ export function List({
|
|
|
182
201
|
},
|
|
183
202
|
children: header
|
|
184
203
|
}), listElement]
|
|
185
|
-
})
|
|
204
|
+
})]
|
|
186
205
|
});
|
|
187
206
|
}
|
|
188
207
|
List.displayName = 'List';
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @position Internal context; consumed by List.tsx and ListItem.tsx
|
|
10
10
|
*/
|
|
11
11
|
import { type ReactNode } from 'react';
|
|
12
|
+
import type { AnimatedLayout } from '../hooks/useAnimatedLayout.js';
|
|
12
13
|
export type ListDensity = 'compact' | 'balanced' | 'spacious';
|
|
13
14
|
export type ListMarkerStyle = 'none' | 'disc' | 'decimal' | 'circle';
|
|
14
15
|
/**
|
|
@@ -51,6 +52,18 @@ export interface ListContextValue {
|
|
|
51
52
|
* on their List, so its text starts match RichText without a width threshold.
|
|
52
53
|
*/
|
|
53
54
|
hasMarkerGutter?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether a numbered item lays out outside the List's shared number
|
|
57
|
+
* columns, with its counter beside its own text as a bullet row has it; set
|
|
58
|
+
* by ListMarkerScope; internal. Markdown sets it on an item that reads
|
|
59
|
+
* against its list, so that item's text never widens the shared counter
|
|
60
|
+
* column for the other rows.
|
|
61
|
+
*/
|
|
62
|
+
isOutsideNumberColumns?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The list's `animatedLayout` handle, for its rows.
|
|
65
|
+
*/
|
|
66
|
+
animatedLayout?: AnimatedLayout;
|
|
54
67
|
}
|
|
55
68
|
export declare const ListContext: import("react").Context<ListContextValue | null>;
|
|
56
69
|
/**
|
|
@@ -58,13 +71,15 @@ export declare const ListContext: import("react").Context<ListContextValue | nul
|
|
|
58
71
|
* List's `listStyle` names, or `task`'s read-only checkbox in place of either;
|
|
59
72
|
* internal, for Markdown's nested lists and task items in mixed lists. With
|
|
60
73
|
* `hasMarkerGutter`, counters keep the ordinary marker column and may paint
|
|
61
|
-
* outside it toward inline-start.
|
|
62
|
-
*
|
|
74
|
+
* outside it toward inline-start. With `isOutsideNumberColumns`, a numbered
|
|
75
|
+
* item keeps its counter beside its own text instead of in the shared column.
|
|
76
|
+
* Outside a List, or in a List without markers, it changes nothing.
|
|
63
77
|
*/
|
|
64
|
-
export declare function ListMarkerScope({ marker, task, hasMarkerGutter, children, }: {
|
|
78
|
+
export declare function ListMarkerScope({ marker, task, hasMarkerGutter, isOutsideNumberColumns, children, }: {
|
|
65
79
|
readonly marker: ListMarker;
|
|
66
80
|
readonly task?: ListTaskMarker;
|
|
67
81
|
readonly hasMarkerGutter?: boolean;
|
|
82
|
+
readonly isOutsideNumberColumns?: boolean;
|
|
68
83
|
readonly children: ReactNode;
|
|
69
84
|
}): ReactNode;
|
|
70
85
|
//# sourceMappingURL=ListContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListContext.d.ts","sourceRoot":"","sources":["../../src/List/ListContext.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAe,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ListContext.d.ts","sourceRoot":"","sources":["../../src/List/ListContext.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAe,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,UAAU,GACpB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,CAAC;AAE3E,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,eAAe,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,eAAO,MAAM,WAAW,kDAIvB,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,IAAI,EACJ,eAAuB,EACvB,sBAA8B,EAC9B,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,GAAG,SAAS,CAcZ"}
|