@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
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @file snapPagingValue.ts
|
|
5
5
|
* @input A scrolling row of snap items
|
|
6
6
|
* @output The `SnapPaging` value, the calls Carousel makes on it
|
|
7
|
-
* (`isSnapPaging`, `attachSnapPaging`, `
|
|
7
|
+
* (`isSnapPaging`, `attachSnapPaging`, `moveSnapPaging`,
|
|
8
|
+
* `moveHeldSnapPaging`), where a held row is shown, and stops
|
|
8
9
|
* @position Carousel's only link to snap paging. It imports no pager code,
|
|
9
10
|
* so a Carousel without `hasSnap={useSnapPaging()}` bundles none
|
|
10
11
|
*/
|
|
@@ -34,11 +35,29 @@ export interface SnapPaging {
|
|
|
34
35
|
/** The paging attached to one row. */
|
|
35
36
|
export interface SnapPagingAttachment {
|
|
36
37
|
readonly detach: () => void;
|
|
38
|
+
readonly move: (target: (at: number, end: number) => number) => void;
|
|
37
39
|
readonly moveHeld: (target: (at: number, end: number) => number) => boolean;
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Where a row the paging holds is shown: its offset toward the end, and the
|
|
44
|
+
* travel it was taken over with.
|
|
45
|
+
*/
|
|
46
|
+
export interface HeldRow {
|
|
47
|
+
readonly offset: number;
|
|
48
|
+
readonly travel: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Hears a held row on each frame of the hold, and null at the hand-back. */
|
|
52
|
+
export type HeldRowListener = (held: HeldRow | null) => void;
|
|
53
|
+
|
|
54
|
+
type Attach = (
|
|
55
|
+
element: HTMLElement,
|
|
56
|
+
onHeld?: HeldRowListener,
|
|
57
|
+
) => SnapPagingAttachment;
|
|
58
|
+
|
|
40
59
|
interface SnapPagingValue {
|
|
41
|
-
readonly attach:
|
|
60
|
+
readonly attach: Attach;
|
|
42
61
|
}
|
|
43
62
|
|
|
44
63
|
const values = new WeakSet<object>();
|
|
@@ -46,9 +65,7 @@ const values = new WeakSet<object>();
|
|
|
46
65
|
const attachments = new WeakMap<HTMLElement, SnapPagingAttachment>();
|
|
47
66
|
|
|
48
67
|
/** A `SnapPaging` value that attaches with `attach`. */
|
|
49
|
-
export function makeSnapPaging(
|
|
50
|
-
attach: (element: HTMLElement) => SnapPagingAttachment,
|
|
51
|
-
): SnapPaging {
|
|
68
|
+
export function makeSnapPaging(attach: Attach): SnapPaging {
|
|
52
69
|
const value: SnapPagingValue = {attach};
|
|
53
70
|
values.add(value);
|
|
54
71
|
return value as unknown as SnapPaging;
|
|
@@ -59,12 +76,19 @@ export function isSnapPaging(value: unknown): value is SnapPaging {
|
|
|
59
76
|
return typeof value === 'object' && value !== null && values.has(value);
|
|
60
77
|
}
|
|
61
78
|
|
|
62
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Attaches snap paging to `element`; the returned function detaches it.
|
|
81
|
+
* `onHeld` hears where the row is shown while the paging holds it.
|
|
82
|
+
*/
|
|
63
83
|
export function attachSnapPaging(
|
|
64
84
|
value: SnapPaging,
|
|
65
85
|
element: HTMLElement,
|
|
86
|
+
onHeld?: HeldRowListener,
|
|
66
87
|
): () => void {
|
|
67
|
-
const attachment = (value as unknown as SnapPagingValue).attach(
|
|
88
|
+
const attachment = (value as unknown as SnapPagingValue).attach(
|
|
89
|
+
element,
|
|
90
|
+
onHeld,
|
|
91
|
+
);
|
|
68
92
|
attachments.set(element, attachment);
|
|
69
93
|
return () => {
|
|
70
94
|
attachments.delete(element);
|
|
@@ -72,6 +96,23 @@ export function attachSnapPaging(
|
|
|
72
96
|
};
|
|
73
97
|
}
|
|
74
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Moves the row through the paging to `target(shown, end)`, an offset toward
|
|
101
|
+
* the end, and takes the row over first when it is at rest. `end` is its
|
|
102
|
+
* travel. False when no paging is attached.
|
|
103
|
+
*/
|
|
104
|
+
export function moveSnapPaging(
|
|
105
|
+
element: HTMLElement,
|
|
106
|
+
target: (shown: number, end: number) => number,
|
|
107
|
+
): boolean {
|
|
108
|
+
const attachment = attachments.get(element);
|
|
109
|
+
if (attachment == null) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
attachment.move(target);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
75
116
|
/**
|
|
76
117
|
* Moves a row the paging holds to `target(shown, end)`, an offset toward the
|
|
77
118
|
* end. `end` is its travel when taken over. False when it is not held.
|
|
@@ -91,6 +132,16 @@ export function nearestStop(stops: ReadonlyArray<number>, at: number): number {
|
|
|
91
132
|
);
|
|
92
133
|
}
|
|
93
134
|
|
|
135
|
+
/**
|
|
136
|
+
* The scale a scaled ancestor gives the row's rects: the rect's width over the
|
|
137
|
+
* row's layout width. Scroll offsets do not have it.
|
|
138
|
+
*/
|
|
139
|
+
export function rowScale(element: HTMLElement, box: DOMRect): number {
|
|
140
|
+
return element.offsetWidth > 0 && box.width > 0
|
|
141
|
+
? box.width / element.offsetWidth
|
|
142
|
+
: 1;
|
|
143
|
+
}
|
|
144
|
+
|
|
94
145
|
/**
|
|
95
146
|
* Each item's snap stop: the scroll offset that aligns its start edge with
|
|
96
147
|
* the scroll padding, clamped to `end`. Read from the items' rects, with the
|
|
@@ -103,11 +154,7 @@ export function snapStops(
|
|
|
103
154
|
): number[] {
|
|
104
155
|
const rtl = isRtlElement(element);
|
|
105
156
|
const box = element.getBoundingClientRect();
|
|
106
|
-
|
|
107
|
-
const scale =
|
|
108
|
-
element.offsetWidth > 0 && box.width > 0
|
|
109
|
-
? box.width / element.offsetWidth
|
|
110
|
-
: 1;
|
|
157
|
+
const scale = rowScale(element, box);
|
|
111
158
|
const border = rtl
|
|
112
159
|
? element.offsetWidth - element.clientWidth - element.clientLeft
|
|
113
160
|
: element.clientLeft;
|
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
* - /packages/core/src/Spinner/Spinner.tsx
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
20
20
|
|
|
21
|
-
export const SpinnerOwnerContext =
|
|
21
|
+
export const SpinnerOwnerContext = createSharedContext(
|
|
22
|
+
'SpinnerOwnerContext',
|
|
23
|
+
1,
|
|
24
|
+
false,
|
|
25
|
+
);
|
|
22
26
|
SpinnerOwnerContext.displayName = 'SpinnerOwnerContext';
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import {use, type Context} from 'react';
|
|
29
|
-
import {createLayerScopedContext
|
|
29
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
30
30
|
|
|
31
31
|
export type StepperOrientation = 'horizontal' | 'vertical';
|
|
32
32
|
export type StepperDensity = 'compact' | 'balanced' | 'spacious';
|
|
@@ -89,11 +89,20 @@ export interface StepperInternalContextValue extends StepperContextValue {
|
|
|
89
89
|
summarySlot: HTMLElement | null;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
export const StepperContext =
|
|
92
|
+
export const StepperContext =
|
|
93
|
+
createLayerScopedContext<StepperContextValue | null>(
|
|
94
|
+
'StepperContext',
|
|
95
|
+
1,
|
|
96
|
+
null,
|
|
97
|
+
);
|
|
93
98
|
StepperContext.displayName = 'StepperContext';
|
|
94
99
|
|
|
95
100
|
export const StepperInternalContext =
|
|
96
|
-
|
|
101
|
+
createLayerScopedContext<StepperInternalContextValue | null>(
|
|
102
|
+
'StepperInternalContext',
|
|
103
|
+
1,
|
|
104
|
+
null,
|
|
105
|
+
);
|
|
97
106
|
StepperInternalContext.displayName = 'StepperInternalContext';
|
|
98
107
|
|
|
99
108
|
function useContextValue<T>(context: Context<T | null>, hookName: string): T {
|
|
@@ -435,12 +435,14 @@ export class SwitchTouchController {
|
|
|
435
435
|
const time = now();
|
|
436
436
|
// The thumb's CSS rest moved with the value: shift it back by as much,
|
|
437
437
|
// so nothing moves on screen. A spring keeps its target through the shift
|
|
438
|
-
// and is sent to the new rest below. A
|
|
439
|
-
//
|
|
438
|
+
// and is sent to the new rest below. A spring already heading for the new
|
|
439
|
+
// rest moves whole instead, keeping its start time and velocity. A
|
|
440
|
+
// reduced-motion dip shifts whole, its end included, and keeps going.
|
|
440
441
|
const springs = thumb.reducedMotion() === 'off';
|
|
441
|
-
thumb.rebase(
|
|
442
|
-
x: this.direction * (this.rest(previous) - this.rest(isOn)),
|
|
443
|
-
|
|
442
|
+
thumb.rebase(
|
|
443
|
+
{x: this.direction * (this.rest(previous) - this.rest(isOn))},
|
|
444
|
+
springs ? {towards: {x: this.toX(this.rest(isOn))}} : {},
|
|
445
|
+
);
|
|
444
446
|
// Each state has its own thumb size, the circle a mouse sees. The box the
|
|
445
447
|
// CSS now renders is the new value's. Its scale takes the old size over
|
|
446
448
|
// and grows or shrinks it from there.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import {use} from 'react';
|
|
15
|
-
import {createLayerScopedContext
|
|
15
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Size variants for tab list items.
|
|
@@ -48,7 +48,12 @@ export interface TabListContextValue {
|
|
|
48
48
|
pattern: TabListPattern;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export const TabListContext =
|
|
51
|
+
export const TabListContext =
|
|
52
|
+
createLayerScopedContext<TabListContextValue | null>(
|
|
53
|
+
'TabListContext',
|
|
54
|
+
1,
|
|
55
|
+
null,
|
|
56
|
+
);
|
|
52
57
|
TabListContext.displayName = 'TabListContext';
|
|
53
58
|
|
|
54
59
|
/**
|
package/src/Table/BaseTable.tsx
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
/**
|
|
5
5
|
* @file BaseTable.tsx
|
|
6
|
-
* @input React, types.ts, columnUtils.ts
|
|
7
|
-
* @output Exports BaseTable component
|
|
6
|
+
* @input React, types.ts, columnUtils.ts, tableRowContextUsage.ts
|
|
7
|
+
* @output Exports BaseTable component; passes a TableRowContext to body row
|
|
8
|
+
* and cell transforms and a TableRenderContext to scroll-wrapper transforms
|
|
8
9
|
* @position Core structural component; wrapped by Table.tsx
|
|
9
10
|
*
|
|
10
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
import {
|
|
18
19
|
memo,
|
|
19
20
|
useId,
|
|
21
|
+
useMemo,
|
|
20
22
|
useRef,
|
|
21
23
|
type ReactElement,
|
|
22
24
|
type ReactNode,
|
|
@@ -35,6 +37,8 @@ import type {
|
|
|
35
37
|
BodyRowRenderProps,
|
|
36
38
|
BodyCellRenderProps,
|
|
37
39
|
ScrollWrapperRenderProps,
|
|
40
|
+
TableRenderContext,
|
|
41
|
+
TableRowContext,
|
|
38
42
|
TableRowComponentProps,
|
|
39
43
|
TableCellComponentProps,
|
|
40
44
|
TableHeaderCellComponentProps,
|
|
@@ -51,6 +55,13 @@ import {TableHeaderCell} from './TableHeaderCell';
|
|
|
51
55
|
import {TableHeader} from './TableHeader';
|
|
52
56
|
import {TableBody} from './TableBody';
|
|
53
57
|
import {mergeProps} from '../utils';
|
|
58
|
+
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
59
|
+
import {
|
|
60
|
+
readsRowCount,
|
|
61
|
+
readsRowIndex,
|
|
62
|
+
runPluginTransform,
|
|
63
|
+
trackRowContext,
|
|
64
|
+
} from './tableRowContextUsage';
|
|
54
65
|
import {devError} from '../utils/devWarning';
|
|
55
66
|
import {EmptyState} from '../EmptyState';
|
|
56
67
|
import {Text} from '../Text';
|
|
@@ -114,6 +125,58 @@ function applyPlugins<TPlugin, TProps, TArgs extends unknown[]>(
|
|
|
114
125
|
}, initial);
|
|
115
126
|
}
|
|
116
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Run a row-level pipeline. Each transform gets the row context as its last
|
|
130
|
+
* argument, tracked per plugin so row memoization knows what it reads.
|
|
131
|
+
*/
|
|
132
|
+
function applyRowPlugins<
|
|
133
|
+
T extends Record<string, unknown>,
|
|
134
|
+
TProps,
|
|
135
|
+
TArgs extends unknown[],
|
|
136
|
+
>(
|
|
137
|
+
plugins: TablePlugin<T>[],
|
|
138
|
+
getter: (
|
|
139
|
+
plugin: TablePlugin<T>,
|
|
140
|
+
) =>
|
|
141
|
+
| ((props: TProps, ...args: [...TArgs, TableRowContext?]) => TProps)
|
|
142
|
+
| undefined,
|
|
143
|
+
initial: TProps,
|
|
144
|
+
context: TableRowContext,
|
|
145
|
+
...args: TArgs
|
|
146
|
+
): TProps {
|
|
147
|
+
return applyPlugins(
|
|
148
|
+
plugins,
|
|
149
|
+
plugin => {
|
|
150
|
+
const transform = getter(plugin);
|
|
151
|
+
return transform == null
|
|
152
|
+
? undefined
|
|
153
|
+
: (props: TProps, ...values: TArgs) =>
|
|
154
|
+
runPluginTransform(plugin, () =>
|
|
155
|
+
transform(props, ...values, trackRowContext(plugin, context)),
|
|
156
|
+
);
|
|
157
|
+
},
|
|
158
|
+
initial,
|
|
159
|
+
...args,
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The row model the plugins admit: the first non-flat declaration, `custom`
|
|
165
|
+
* for a body transform that declares no model, otherwise `flat`.
|
|
166
|
+
*/
|
|
167
|
+
function resolveRowModel<T extends Record<string, unknown>>(
|
|
168
|
+
plugins: ReadonlyArray<TablePlugin<T>>,
|
|
169
|
+
): TableRenderContext['rowModel'] {
|
|
170
|
+
const modifier = plugins.find(
|
|
171
|
+
plugin =>
|
|
172
|
+
plugin.rowModel !== 'flat' &&
|
|
173
|
+
(plugin.rowModel != null ||
|
|
174
|
+
plugin.transformBodyRow != null ||
|
|
175
|
+
plugin.transformBodyCell != null),
|
|
176
|
+
);
|
|
177
|
+
return modifier == null ? 'flat' : (modifier.rowModel ?? 'custom');
|
|
178
|
+
}
|
|
179
|
+
|
|
117
180
|
// =============================================================================
|
|
118
181
|
// Memoized Table Row Component
|
|
119
182
|
// =============================================================================
|
|
@@ -149,6 +212,7 @@ interface TableRowProps<T extends Record<string, unknown>> {
|
|
|
149
212
|
textOverflow: 'wrap' | 'truncate';
|
|
150
213
|
RowComponent: React.ComponentType<TableRowComponentProps>;
|
|
151
214
|
CellComponent: React.ComponentType<TableCellComponentProps>;
|
|
215
|
+
renderContext: TableRenderContext;
|
|
152
216
|
/**
|
|
153
217
|
* 1-based ARIA row index for this row's position in the full dataset.
|
|
154
218
|
* `undefined` when the table hasn't opted into ARIA row indexing, in which
|
|
@@ -171,8 +235,22 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
171
235
|
textOverflow,
|
|
172
236
|
RowComponent,
|
|
173
237
|
CellComponent,
|
|
238
|
+
renderContext,
|
|
174
239
|
ariaRowIndex,
|
|
175
240
|
}: TableRowProps<T>): ReactElement {
|
|
241
|
+
const context = useMemo<TableRowContext>(
|
|
242
|
+
() =>
|
|
243
|
+
Object.freeze({
|
|
244
|
+
key: rowKey,
|
|
245
|
+
identityStatus: 'valid',
|
|
246
|
+
kind: renderContext.rowModel === 'flat' ? 'product' : 'unknown',
|
|
247
|
+
logicalIndex: rowIndex,
|
|
248
|
+
logicalRowCount: renderContext.logicalRowCount,
|
|
249
|
+
headerRowCount: renderContext.headerRowCount,
|
|
250
|
+
render: renderContext,
|
|
251
|
+
}),
|
|
252
|
+
[rowKey, rowIndex, renderContext],
|
|
253
|
+
);
|
|
176
254
|
// Build cells first
|
|
177
255
|
const cells = columns.map((col, columnIndex) => {
|
|
178
256
|
// Apply column alignment to body cells
|
|
@@ -187,10 +265,11 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
187
265
|
columnIndex,
|
|
188
266
|
columns: columns as ReadonlyArray<TableColumn<Record<string, unknown>>>,
|
|
189
267
|
};
|
|
190
|
-
const cellRenderProps =
|
|
268
|
+
const cellRenderProps = applyRowPlugins(
|
|
191
269
|
plugins,
|
|
192
270
|
p => p.transformBodyCell,
|
|
193
271
|
initialBodyCellRenderProps,
|
|
272
|
+
context,
|
|
194
273
|
col,
|
|
195
274
|
item,
|
|
196
275
|
columnIndex,
|
|
@@ -239,7 +318,7 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
239
318
|
// Apply plugin transforms for row (with pre-rendered children).
|
|
240
319
|
// Seed `aria-rowindex` (when the table opts into ARIA row indexing) as a
|
|
241
320
|
// base htmlProp so plugins compose over it and can still override.
|
|
242
|
-
const rowRenderProps =
|
|
321
|
+
const rowRenderProps = applyRowPlugins(
|
|
243
322
|
plugins,
|
|
244
323
|
p => p.transformBodyRow,
|
|
245
324
|
{
|
|
@@ -247,6 +326,7 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
247
326
|
xstyle: [],
|
|
248
327
|
children: <>{cells}</>,
|
|
249
328
|
} satisfies BodyRowRenderProps,
|
|
329
|
+
context,
|
|
250
330
|
item,
|
|
251
331
|
rowIndex,
|
|
252
332
|
);
|
|
@@ -280,9 +360,11 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
280
360
|
* Shallow compares the item object and checks if columns/plugins references changed.
|
|
281
361
|
*
|
|
282
362
|
* The row index reaches a row's output only through a plugin's
|
|
283
|
-
* `transformBodyRow
|
|
284
|
-
*
|
|
285
|
-
* unless a plugin can show the index
|
|
363
|
+
* `transformBodyRow`, or through a cell transform that reads the context's
|
|
364
|
+
* `logicalIndex`, so it is compared only for those plugins: a re-sort that
|
|
365
|
+
* moves rows then re-renders none of them unless a plugin can show the index
|
|
366
|
+
* (row numbering, conditional formatting). A changed row count re-renders
|
|
367
|
+
* rows only when a plugin has read a count.
|
|
286
368
|
*/
|
|
287
369
|
function areRowPropsEqual<T extends Record<string, unknown>>(
|
|
288
370
|
prevProps: TableRowProps<T>,
|
|
@@ -293,7 +375,22 @@ function areRowPropsEqual<T extends Record<string, unknown>>(
|
|
|
293
375
|
}
|
|
294
376
|
if (
|
|
295
377
|
prevProps.rowIndex !== nextProps.rowIndex &&
|
|
296
|
-
nextProps.plugins.some(
|
|
378
|
+
nextProps.plugins.some(
|
|
379
|
+
plugin => plugin.transformBodyRow != null || readsRowIndex(plugin),
|
|
380
|
+
)
|
|
381
|
+
) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
const prevRender = prevProps.renderContext;
|
|
385
|
+
const nextRender = nextProps.renderContext;
|
|
386
|
+
if (
|
|
387
|
+
prevRender !== nextRender &&
|
|
388
|
+
(prevRender.mode !== nextRender.mode ||
|
|
389
|
+
prevRender.rowModel !== nextRender.rowModel ||
|
|
390
|
+
prevRender.headerRowCount !== nextRender.headerRowCount ||
|
|
391
|
+
prevRender.viewport !== nextRender.viewport ||
|
|
392
|
+
(prevRender.logicalRowCount !== nextRender.logicalRowCount &&
|
|
393
|
+
nextProps.plugins.some(readsRowCount)))
|
|
297
394
|
) {
|
|
298
395
|
return false;
|
|
299
396
|
}
|
|
@@ -419,6 +516,23 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
419
516
|
}
|
|
420
517
|
const resolvedColumns = resolvedColumnsRef.current;
|
|
421
518
|
|
|
519
|
+
const mode = children ? 'children' : 'data';
|
|
520
|
+
const rowModel = resolveRowModel(plugins);
|
|
521
|
+
const logicalRowCount = data?.length ?? 0;
|
|
522
|
+
const headerRowCount = mode === 'data' && resolvedColumns.length > 0 ? 1 : 0;
|
|
523
|
+
const viewportRef = useRef<HTMLDivElement | null>(null);
|
|
524
|
+
const renderContext = useMemo<TableRenderContext>(
|
|
525
|
+
() =>
|
|
526
|
+
Object.freeze({
|
|
527
|
+
mode,
|
|
528
|
+
rowModel,
|
|
529
|
+
logicalRowCount,
|
|
530
|
+
headerRowCount,
|
|
531
|
+
viewport: viewportRef,
|
|
532
|
+
}),
|
|
533
|
+
[mode, rowModel, logicalRowCount, headerRowCount],
|
|
534
|
+
);
|
|
535
|
+
|
|
422
536
|
// Resolve all column widths in a single pass — produces per-column
|
|
423
537
|
// inline styles and the aggregate table min-width.
|
|
424
538
|
const resolvedWidths = resolveColumnWidths(resolvedColumns);
|
|
@@ -622,6 +736,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
622
736
|
textOverflow={textOverflow}
|
|
623
737
|
RowComponent={RowComponent}
|
|
624
738
|
CellComponent={CellComponent}
|
|
739
|
+
renderContext={renderContext}
|
|
625
740
|
ariaRowIndex={
|
|
626
741
|
ariaRowIndexingEnabled
|
|
627
742
|
? firstRowAriaIndex + rowIndex
|
|
@@ -657,19 +772,28 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
657
772
|
// Before rendering the wrapper, run the plugin `transformScrollWrapper`
|
|
658
773
|
// pipeline so plugins can attach a ref to the scroll container (scroll-aware
|
|
659
774
|
// sticky shadows, virtualization) and inject before/after chrome.
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
775
|
+
const scrollWrapperRenderProps = ScrollWrapper
|
|
776
|
+
? applyPlugins(
|
|
777
|
+
plugins,
|
|
778
|
+
p => p.transformScrollWrapper,
|
|
779
|
+
{
|
|
780
|
+
htmlProps: {},
|
|
781
|
+
xstyle: [],
|
|
782
|
+
} satisfies ScrollWrapperRenderProps,
|
|
783
|
+
renderContext,
|
|
784
|
+
)
|
|
785
|
+
: null;
|
|
786
|
+
const scrollWrapperRef = useMergedRefs(
|
|
787
|
+
viewportRef,
|
|
788
|
+
scrollWrapperRenderProps?.htmlProps.ref,
|
|
789
|
+
);
|
|
790
|
+
if (ScrollWrapper && scrollWrapperRenderProps) {
|
|
670
791
|
tableElement = (
|
|
671
792
|
<ScrollWrapper
|
|
672
|
-
htmlProps={
|
|
793
|
+
htmlProps={{
|
|
794
|
+
...scrollWrapperRenderProps.htmlProps,
|
|
795
|
+
ref: scrollWrapperRef,
|
|
796
|
+
}}
|
|
673
797
|
xstyle={scrollWrapperRenderProps.xstyle}
|
|
674
798
|
beforeTable={scrollWrapperRenderProps.beforeTable}
|
|
675
799
|
afterTable={scrollWrapperRenderProps.afterTable}>
|
package/src/Table/Table.tsx
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - /packages/cli/assets/templates/blocks/components/Table/ (showcase blocks)
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import {use, useMemo, type ReactElement, type Ref} from 'react';
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import {colorVars} from '../theme/tokens.stylex';
|
|
23
23
|
import {BaseTable} from './BaseTable';
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
useComponentTranslator,
|
|
39
39
|
} from '../i18n/useComponentTranslator';
|
|
40
40
|
import english from '../i18n/generated-english/Table/Table.generated';
|
|
41
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
41
42
|
|
|
42
43
|
registerEnglishFallback(english);
|
|
43
44
|
|
|
@@ -146,10 +147,10 @@ const scrollWrapperStyles = stylex.create({
|
|
|
146
147
|
* Internal to Table: the scroll wrapper is not given it as a prop, so it adds
|
|
147
148
|
* nothing to the public table types.
|
|
148
149
|
*/
|
|
149
|
-
const TableNameContext =
|
|
150
|
+
const TableNameContext = createSharedContext<{
|
|
150
151
|
label?: string;
|
|
151
152
|
labelledBy?: string;
|
|
152
|
-
} | null>(null);
|
|
153
|
+
} | null>('TableNameContext', 1, null);
|
|
153
154
|
TableNameContext.displayName = 'TableNameContext';
|
|
154
155
|
|
|
155
156
|
function TableScrollWrapper({
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - /packages/core/src/Table/index.ts (exports if types change)
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {createLayerScopedContext
|
|
18
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
19
19
|
import type {TableVerticalAlign} from './types';
|
|
20
20
|
|
|
21
21
|
export interface TableContextValue {
|
|
@@ -27,5 +27,9 @@ export interface TableContextValue {
|
|
|
27
27
|
textOverflow: 'wrap' | 'truncate';
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export const TableContext =
|
|
30
|
+
export const TableContext = createLayerScopedContext<TableContextValue | null>(
|
|
31
|
+
'TableContext',
|
|
32
|
+
1,
|
|
33
|
+
null,
|
|
34
|
+
);
|
|
31
35
|
TableContext.displayName = 'TableContext';
|
package/src/Table/index.ts
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
|
-
createContext,
|
|
18
17
|
use,
|
|
19
18
|
useRef,
|
|
20
19
|
useMemo,
|
|
@@ -69,6 +68,7 @@ import {
|
|
|
69
68
|
useComponentTranslator,
|
|
70
69
|
} from '../../../i18n/useComponentTranslator';
|
|
71
70
|
import english from '../../../i18n/generated-english/Table/plugins/filtering/useTableFiltering.generated';
|
|
71
|
+
import {createSharedContext} from '../../../utils/sharedContext';
|
|
72
72
|
|
|
73
73
|
registerEnglishFallback(english);
|
|
74
74
|
|
|
@@ -338,7 +338,11 @@ interface FilterStore {
|
|
|
338
338
|
getConfig: () => UseTableFilteringConfig;
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
const FilterStoreContext =
|
|
341
|
+
const FilterStoreContext = createSharedContext<FilterStore | null>(
|
|
342
|
+
'FilterStoreContext',
|
|
343
|
+
1,
|
|
344
|
+
null,
|
|
345
|
+
);
|
|
342
346
|
FilterStoreContext.displayName = 'FilterStoreContext';
|
|
343
347
|
|
|
344
348
|
function useFilterStore(): FilterStore {
|
|
@@ -353,7 +357,11 @@ function useFilterStore(): FilterStore {
|
|
|
353
357
|
|
|
354
358
|
/** Variant is stable per plugin instance — kept in a separate context so
|
|
355
359
|
* slot components can read it without going through the mutable store. */
|
|
356
|
-
const FilterVariantContext =
|
|
360
|
+
const FilterVariantContext = createSharedContext<TableFilterVariant>(
|
|
361
|
+
'FilterVariantContext',
|
|
362
|
+
1,
|
|
363
|
+
'popover',
|
|
364
|
+
);
|
|
357
365
|
FilterVariantContext.displayName = 'FilterVariantContext';
|
|
358
366
|
|
|
359
367
|
// =============================================================================
|
|
@@ -255,7 +255,11 @@ const expansionStyles = stylex.create({
|
|
|
255
255
|
':is([dir="rtl"] *)': 'scaleX(-1) rotate(0deg)',
|
|
256
256
|
},
|
|
257
257
|
},
|
|
258
|
-
|
|
258
|
+
// The wash goes on the panel's cell, not on its row. A row that paints its
|
|
259
|
+
// own box plays in under a clip that moves with its edge. On iOS that clip
|
|
260
|
+
// can trail the rows that glide below it. The cell slides in with the
|
|
261
|
+
// panel's content.
|
|
262
|
+
mutedPanel: {
|
|
259
263
|
backgroundColor: colorVars['--color-background-muted'],
|
|
260
264
|
},
|
|
261
265
|
expandedCell: {
|
|
@@ -506,10 +510,12 @@ function PanelDividerModeWatch({
|
|
|
506
510
|
function ExpansionPanelCell({
|
|
507
511
|
colSpan,
|
|
508
512
|
cellsRef,
|
|
513
|
+
isMuted,
|
|
509
514
|
children,
|
|
510
515
|
}: {
|
|
511
516
|
colSpan: number;
|
|
512
517
|
cellsRef: RefObject<Set<HTMLTableCellElement>>;
|
|
518
|
+
isMuted: boolean;
|
|
513
519
|
children: ReactNode;
|
|
514
520
|
}) {
|
|
515
521
|
const ctx = useTableContext();
|
|
@@ -559,6 +565,7 @@ function ExpansionPanelCell({
|
|
|
559
565
|
colSpan={colSpan}
|
|
560
566
|
{...stylex.props(
|
|
561
567
|
expansionStyles.expandedCell,
|
|
568
|
+
isMuted && expansionStyles.mutedPanel,
|
|
562
569
|
panelIndentStyles[ctx?.density ?? 'balanced'],
|
|
563
570
|
hasRowDividers && dividerStyles.panelCell,
|
|
564
571
|
glidingDividerStyles.cell,
|
|
@@ -1104,12 +1111,12 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
1104
1111
|
// Carries the marker so the panel cell's divider can ask whether
|
|
1105
1112
|
// this row is the table's last, the same way TableCell does.
|
|
1106
1113
|
tableRowMarker,
|
|
1107
|
-
panelVariant === 'muted' && expansionStyles.expandedRow,
|
|
1108
1114
|
glidingDividerStyles.row,
|
|
1109
1115
|
)}>
|
|
1110
1116
|
<ExpansionPanelCell
|
|
1111
1117
|
colSpan={columnCountRef.current}
|
|
1112
|
-
cellsRef={panelCellsRef}
|
|
1118
|
+
cellsRef={panelCellsRef}
|
|
1119
|
+
isMuted={panelVariant === 'muted'}>
|
|
1113
1120
|
{renderExpanded(item)}
|
|
1114
1121
|
</ExpansionPanelCell>
|
|
1115
1122
|
</tr>
|