@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
|
*/
|
|
@@ -20,6 +21,13 @@ import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
|
20
21
|
|
|
21
22
|
/** The paging attached to one row. */
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Where a row the paging holds is shown: its offset toward the end, and the
|
|
26
|
+
* travel it was taken over with.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** Hears a held row on each frame of the hold, and null at the hand-back. */
|
|
30
|
+
|
|
23
31
|
const values = new WeakSet();
|
|
24
32
|
// Each attached row's paging, for Carousel's own scroll calls.
|
|
25
33
|
const attachments = new WeakMap();
|
|
@@ -38,9 +46,12 @@ export function isSnapPaging(value) {
|
|
|
38
46
|
return typeof value === 'object' && value !== null && values.has(value);
|
|
39
47
|
}
|
|
40
48
|
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Attaches snap paging to `element`; the returned function detaches it.
|
|
51
|
+
* `onHeld` hears where the row is shown while the paging holds it.
|
|
52
|
+
*/
|
|
53
|
+
export function attachSnapPaging(value, element, onHeld) {
|
|
54
|
+
const attachment = value.attach(element, onHeld);
|
|
44
55
|
attachments.set(element, attachment);
|
|
45
56
|
return () => {
|
|
46
57
|
attachments.delete(element);
|
|
@@ -48,6 +59,20 @@ export function attachSnapPaging(value, element) {
|
|
|
48
59
|
};
|
|
49
60
|
}
|
|
50
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Moves the row through the paging to `target(shown, end)`, an offset toward
|
|
64
|
+
* the end, and takes the row over first when it is at rest. `end` is its
|
|
65
|
+
* travel. False when no paging is attached.
|
|
66
|
+
*/
|
|
67
|
+
export function moveSnapPaging(element, target) {
|
|
68
|
+
const attachment = attachments.get(element);
|
|
69
|
+
if (attachment == null) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
attachment.move(target);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
51
76
|
/**
|
|
52
77
|
* Moves a row the paging holds to `target(shown, end)`, an offset toward the
|
|
53
78
|
* end. `end` is its travel when taken over. False when it is not held.
|
|
@@ -61,6 +86,14 @@ export function nearestStop(stops, at) {
|
|
|
61
86
|
return stops.reduce((best, stop) => Math.abs(stop - at) < Math.abs(best - at) ? stop : best, stops[0] ?? at);
|
|
62
87
|
}
|
|
63
88
|
|
|
89
|
+
/**
|
|
90
|
+
* The scale a scaled ancestor gives the row's rects: the rect's width over the
|
|
91
|
+
* row's layout width. Scroll offsets do not have it.
|
|
92
|
+
*/
|
|
93
|
+
export function rowScale(element, box) {
|
|
94
|
+
return element.offsetWidth > 0 && box.width > 0 ? box.width / element.offsetWidth : 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
64
97
|
/**
|
|
65
98
|
* Each item's snap stop: the scroll offset that aligns its start edge with
|
|
66
99
|
* the scroll padding, clamped to `end`. Read from the items' rects, with the
|
|
@@ -69,8 +102,7 @@ export function nearestStop(stops, at) {
|
|
|
69
102
|
export function snapStops(element, shown, end) {
|
|
70
103
|
const rtl = isRtlElement(element);
|
|
71
104
|
const box = element.getBoundingClientRect();
|
|
72
|
-
|
|
73
|
-
const scale = element.offsetWidth > 0 && box.width > 0 ? box.width / element.offsetWidth : 1;
|
|
105
|
+
const scale = rowScale(element, box);
|
|
74
106
|
const border = rtl ? element.offsetWidth - element.clientWidth - element.clientLeft : element.clientLeft;
|
|
75
107
|
const style = getComputedStyle(element);
|
|
76
108
|
const padding = Number.parseFloat(rtl ? style.scrollPaddingRight : style.scrollPaddingLeft) || 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerOwnerContext.d.ts","sourceRoot":"","sources":["../../src/Spinner/SpinnerOwnerContext.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"SpinnerOwnerContext.d.ts","sourceRoot":"","sources":["../../src/Spinner/SpinnerOwnerContext.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,mBAAmB,kCAI/B,CAAC"}
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
* SYNC: When modified, update:
|
|
16
16
|
* - /packages/core/src/Spinner/Spinner.tsx
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
export const SpinnerOwnerContext =
|
|
18
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
19
|
+
export const SpinnerOwnerContext = createSharedContext('SpinnerOwnerContext', 1, false);
|
|
20
20
|
SpinnerOwnerContext.displayName = 'SpinnerOwnerContext';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepperContext.d.ts","sourceRoot":"","sources":["../../src/Stepper/StepperContext.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAM,KAAK,OAAO,EAAC,MAAM,OAAO,CAAC;AAGxC,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhE,iEAAiE;AACjE,MAAM,WAAW,0BAA0B;IACzC,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC;CAC/B;AAED,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9C,OAAO,EAAE,cAAc,CAAC;IACxB,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C;;;;;OAKG;IACH,YAAY,EAAE,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,0BAA0B,KACjC,MAAM,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;I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;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,2DAA2D;IAC3D,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,qCAKxB,CAAC;AAGJ,eAAO,MAAM,sBAAsB,6CAKhC,CAAC;AAaJ,+DAA+D;AAC/D,wBAAgB,yBAAyB,IAAI,2BAA2B,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,CAEvD"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* - /packages/core/src/Stepper/Stepper.public.test.ts
|
|
26
26
|
*/
|
|
27
27
|
import { use } from 'react';
|
|
28
|
-
import { createLayerScopedContext
|
|
28
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Controls where each step's indicator sits relative to the connector track.
|
|
@@ -45,9 +45,9 @@ import { createLayerScopedContext as createContext } from "../Layer/layerScopedC
|
|
|
45
45
|
* absent from the public component barrel.
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
|
-
export const StepperContext =
|
|
48
|
+
export const StepperContext = createLayerScopedContext('StepperContext', 1, null);
|
|
49
49
|
StepperContext.displayName = 'StepperContext';
|
|
50
|
-
export const StepperInternalContext =
|
|
50
|
+
export const StepperInternalContext = createLayerScopedContext('StepperInternalContext', 1, null);
|
|
51
51
|
StepperInternalContext.displayName = 'StepperInternalContext';
|
|
52
52
|
function useContextValue(context, hookName) {
|
|
53
53
|
const ctx = use(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwitchTouch.d.ts","sourceRoot":"","sources":["../../src/Switch/useSwitchTouch.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAmBxD,OAAO,EAQL,KAAK,mBAAmB,EACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,KAAK,U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;IACvE,OAAO,CAAC,UAAU;IAKlB,uEAAuE;IACvE,OAAO,CAAC,UAAU;IAKlB;;;;OAIG;IACH,OAAO,CAAC,IAAI;IAmBZ;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAgDd;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAsCpB,OAAO,CAAC,WAAW;CAQpB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,gBAAgB,EACvB,EACE,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,eAAe,GAChB,EAAE,kBAAkB,GACpB,IAAI,CAsDN"}
|
|
@@ -362,12 +362,17 @@ export class SwitchTouchController {
|
|
|
362
362
|
const time = now();
|
|
363
363
|
// The thumb's CSS rest moved with the value: shift it back by as much,
|
|
364
364
|
// so nothing moves on screen. A spring keeps its target through the shift
|
|
365
|
-
// and is sent to the new rest below. A
|
|
366
|
-
//
|
|
365
|
+
// and is sent to the new rest below. A spring already heading for the new
|
|
366
|
+
// rest moves whole instead, keeping its start time and velocity. A
|
|
367
|
+
// reduced-motion dip shifts whole, its end included, and keeps going.
|
|
367
368
|
const springs = thumb.reducedMotion() === 'off';
|
|
368
369
|
thumb.rebase({
|
|
369
370
|
x: this.direction * (this.rest(previous) - this.rest(isOn))
|
|
370
|
-
}
|
|
371
|
+
}, springs ? {
|
|
372
|
+
towards: {
|
|
373
|
+
x: this.toX(this.rest(isOn))
|
|
374
|
+
}
|
|
375
|
+
} : {});
|
|
371
376
|
// Each state has its own thumb size, the circle a mouse sees. The box the
|
|
372
377
|
// CSS now renders is the new value's. Its scale takes the old size over
|
|
373
378
|
// and grows or shrinks it from there.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabListContext.d.ts","sourceRoot":"","sources":["../../src/TabList/TabListContext.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"TabListContext.d.ts","sourceRoot":"","sources":["../../src/TabList/TabListContext.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,eAAO,MAAM,cAAc,qDAKxB,CAAC;AAGJ;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,CASvD"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* SYNC: When modified, update /packages/core/src/TabList/TabList.doc.mjs
|
|
12
12
|
*/
|
|
13
13
|
import { use } from 'react';
|
|
14
|
-
import { createLayerScopedContext
|
|
14
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Size variants for tab list items.
|
|
@@ -37,7 +37,7 @@ import { createLayerScopedContext as createContext } from "../Layer/layerScopedC
|
|
|
37
37
|
* pattern from TabList to children.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
export const TabListContext =
|
|
40
|
+
export const TabListContext = createLayerScopedContext('TabListContext', 1, null);
|
|
41
41
|
TabListContext.displayName = 'TabListContext';
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file BaseTable.tsx
|
|
3
|
-
* @input React, types.ts, columnUtils.ts
|
|
4
|
-
* @output Exports BaseTable component
|
|
3
|
+
* @input React, types.ts, columnUtils.ts, tableRowContextUsage.ts
|
|
4
|
+
* @output Exports BaseTable component; passes a TableRowContext to body row
|
|
5
|
+
* and cell transforms and a TableRenderContext to scroll-wrapper transforms
|
|
5
6
|
* @position Core structural component; wrapped by Table.tsx
|
|
6
7
|
*
|
|
7
8
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTable.d.ts","sourceRoot":"","sources":["../../src/Table/BaseTable.tsx"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"BaseTable.d.ts","sourceRoot":"","sources":["../../src/Table/BaseTable.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,KAAK,YAAY,EAEjB,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EACV,cAAc,EAcf,MAAM,SAAS,CAAC;AA0wBjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS,EAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3E,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAC,KACrD,YAAY,CAAC"}
|
package/dist/Table/BaseTable.js
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file BaseTable.tsx
|
|
7
|
-
* @input React, types.ts, columnUtils.ts
|
|
8
|
-
* @output Exports BaseTable component
|
|
7
|
+
* @input React, types.ts, columnUtils.ts, tableRowContextUsage.ts
|
|
8
|
+
* @output Exports BaseTable component; passes a TableRowContext to body row
|
|
9
|
+
* and cell transforms and a TableRenderContext to scroll-wrapper transforms
|
|
9
10
|
* @position Core structural component; wrapped by Table.tsx
|
|
10
11
|
*
|
|
11
12
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
* - /packages/core/src/Table/index.ts (exports if types change)
|
|
15
16
|
* - /packages/cli/assets/templates/blocks/components/Table/ (showcase blocks)
|
|
16
17
|
*/
|
|
17
|
-
import { memo, useId, useRef } from 'react';
|
|
18
|
+
import { memo, useId, useMemo, useRef } from 'react';
|
|
18
19
|
import { isRenderable } from "../utils/isRenderable.js";
|
|
19
20
|
import * as stylex from '@stylexjs/stylex';
|
|
20
21
|
import "../theme/tokens.stylex.js";
|
|
@@ -26,6 +27,8 @@ import { TableHeaderCell } from "./TableHeaderCell.js";
|
|
|
26
27
|
import { TableHeader } from "./TableHeader.js";
|
|
27
28
|
import { TableBody } from "./TableBody.js";
|
|
28
29
|
import { mergeProps } from "../utils/index.js";
|
|
30
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
31
|
+
import { readsRowCount, readsRowIndex, runPluginTransform, trackRowContext } from "./tableRowContextUsage.js";
|
|
29
32
|
import { devError } from "../utils/devWarning.js";
|
|
30
33
|
import { EmptyState } from "../EmptyState/index.js";
|
|
31
34
|
import { Text } from "../Text/index.js";
|
|
@@ -69,6 +72,26 @@ function applyPlugins(plugins, getter, initial, ...args) {
|
|
|
69
72
|
}, initial);
|
|
70
73
|
}
|
|
71
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Run a row-level pipeline. Each transform gets the row context as its last
|
|
77
|
+
* argument, tracked per plugin so row memoization knows what it reads.
|
|
78
|
+
*/
|
|
79
|
+
function applyRowPlugins(plugins, getter, initial, context, ...args) {
|
|
80
|
+
return applyPlugins(plugins, plugin => {
|
|
81
|
+
const transform = getter(plugin);
|
|
82
|
+
return transform == null ? undefined : (props, ...values) => runPluginTransform(plugin, () => transform(props, ...values, trackRowContext(plugin, context)));
|
|
83
|
+
}, initial, ...args);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The row model the plugins admit: the first non-flat declaration, `custom`
|
|
88
|
+
* for a body transform that declares no model, otherwise `flat`.
|
|
89
|
+
*/
|
|
90
|
+
function resolveRowModel(plugins) {
|
|
91
|
+
const modifier = plugins.find(plugin => plugin.rowModel !== 'flat' && (plugin.rowModel != null || plugin.transformBodyRow != null || plugin.transformBodyCell != null));
|
|
92
|
+
return modifier == null ? 'flat' : modifier.rowModel ?? 'custom';
|
|
93
|
+
}
|
|
94
|
+
|
|
72
95
|
// =============================================================================
|
|
73
96
|
// Memoized Table Row Component
|
|
74
97
|
// =============================================================================
|
|
@@ -108,8 +131,18 @@ function TableRowInner({
|
|
|
108
131
|
textOverflow,
|
|
109
132
|
RowComponent,
|
|
110
133
|
CellComponent,
|
|
134
|
+
renderContext,
|
|
111
135
|
ariaRowIndex
|
|
112
136
|
}) {
|
|
137
|
+
const context = useMemo(() => Object.freeze({
|
|
138
|
+
key: rowKey,
|
|
139
|
+
identityStatus: 'valid',
|
|
140
|
+
kind: renderContext.rowModel === 'flat' ? 'product' : 'unknown',
|
|
141
|
+
logicalIndex: rowIndex,
|
|
142
|
+
logicalRowCount: renderContext.logicalRowCount,
|
|
143
|
+
headerRowCount: renderContext.headerRowCount,
|
|
144
|
+
render: renderContext
|
|
145
|
+
}), [rowKey, rowIndex, renderContext]);
|
|
113
146
|
// Build cells first
|
|
114
147
|
const cells = columns.map((col, columnIndex) => {
|
|
115
148
|
// Apply column alignment to body cells
|
|
@@ -125,7 +158,7 @@ function TableRowInner({
|
|
|
125
158
|
columnIndex,
|
|
126
159
|
columns: columns
|
|
127
160
|
};
|
|
128
|
-
const cellRenderProps =
|
|
161
|
+
const cellRenderProps = applyRowPlugins(plugins, p => p.transformBodyCell, initialBodyCellRenderProps, context, col, item, columnIndex, columns);
|
|
129
162
|
const isDefaultRenderer = !col.renderCell;
|
|
130
163
|
let rawContent = null;
|
|
131
164
|
if (!cellRenderProps.isContentSuppressed) {
|
|
@@ -157,7 +190,7 @@ function TableRowInner({
|
|
|
157
190
|
// Apply plugin transforms for row (with pre-rendered children).
|
|
158
191
|
// Seed `aria-rowindex` (when the table opts into ARIA row indexing) as a
|
|
159
192
|
// base htmlProp so plugins compose over it and can still override.
|
|
160
|
-
const rowRenderProps =
|
|
193
|
+
const rowRenderProps = applyRowPlugins(plugins, p => p.transformBodyRow, {
|
|
161
194
|
htmlProps: ariaRowIndex == null ? {} : {
|
|
162
195
|
'aria-rowindex': ariaRowIndex
|
|
163
196
|
},
|
|
@@ -165,7 +198,7 @@ function TableRowInner({
|
|
|
165
198
|
children: /*#__PURE__*/_jsx(_Fragment, {
|
|
166
199
|
children: cells
|
|
167
200
|
})
|
|
168
|
-
}, item, rowIndex);
|
|
201
|
+
}, context, item, rowIndex);
|
|
169
202
|
const row = /*#__PURE__*/_jsx(RowComponent, {
|
|
170
203
|
ref: rowRenderProps.ref,
|
|
171
204
|
...rowRenderProps.htmlProps,
|
|
@@ -188,15 +221,22 @@ function TableRowInner({
|
|
|
188
221
|
* Shallow compares the item object and checks if columns/plugins references changed.
|
|
189
222
|
*
|
|
190
223
|
* The row index reaches a row's output only through a plugin's
|
|
191
|
-
* `transformBodyRow
|
|
192
|
-
*
|
|
193
|
-
* unless a plugin can show the index
|
|
224
|
+
* `transformBodyRow`, or through a cell transform that reads the context's
|
|
225
|
+
* `logicalIndex`, so it is compared only for those plugins: a re-sort that
|
|
226
|
+
* moves rows then re-renders none of them unless a plugin can show the index
|
|
227
|
+
* (row numbering, conditional formatting). A changed row count re-renders
|
|
228
|
+
* rows only when a plugin has read a count.
|
|
194
229
|
*/
|
|
195
230
|
function areRowPropsEqual(prevProps, nextProps) {
|
|
196
231
|
if (prevProps.rowKey !== nextProps.rowKey) {
|
|
197
232
|
return false;
|
|
198
233
|
}
|
|
199
|
-
if (prevProps.rowIndex !== nextProps.rowIndex && nextProps.plugins.some(plugin => plugin.transformBodyRow != null)) {
|
|
234
|
+
if (prevProps.rowIndex !== nextProps.rowIndex && nextProps.plugins.some(plugin => plugin.transformBodyRow != null || readsRowIndex(plugin))) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
const prevRender = prevProps.renderContext;
|
|
238
|
+
const nextRender = nextProps.renderContext;
|
|
239
|
+
if (prevRender !== nextRender && (prevRender.mode !== nextRender.mode || prevRender.rowModel !== nextRender.rowModel || prevRender.headerRowCount !== nextRender.headerRowCount || prevRender.viewport !== nextRender.viewport || prevRender.logicalRowCount !== nextRender.logicalRowCount && nextProps.plugins.some(readsRowCount))) {
|
|
200
240
|
return false;
|
|
201
241
|
}
|
|
202
242
|
if (prevProps.ariaRowIndex !== nextProps.ariaRowIndex) {
|
|
@@ -305,6 +345,18 @@ function BaseTableInner({
|
|
|
305
345
|
resolvedColumnsRef.current = transformedColumns;
|
|
306
346
|
}
|
|
307
347
|
const resolvedColumns = resolvedColumnsRef.current;
|
|
348
|
+
const mode = children ? 'children' : 'data';
|
|
349
|
+
const rowModel = resolveRowModel(plugins);
|
|
350
|
+
const logicalRowCount = data?.length ?? 0;
|
|
351
|
+
const headerRowCount = mode === 'data' && resolvedColumns.length > 0 ? 1 : 0;
|
|
352
|
+
const viewportRef = useRef(null);
|
|
353
|
+
const renderContext = useMemo(() => Object.freeze({
|
|
354
|
+
mode,
|
|
355
|
+
rowModel,
|
|
356
|
+
logicalRowCount,
|
|
357
|
+
headerRowCount,
|
|
358
|
+
viewport: viewportRef
|
|
359
|
+
}), [mode, rowModel, logicalRowCount, headerRowCount]);
|
|
308
360
|
|
|
309
361
|
// Resolve all column widths in a single pass — produces per-column
|
|
310
362
|
// inline styles and the aggregate table min-width.
|
|
@@ -457,6 +509,7 @@ function BaseTableInner({
|
|
|
457
509
|
textOverflow: textOverflow,
|
|
458
510
|
RowComponent: RowComponent,
|
|
459
511
|
CellComponent: CellComponent,
|
|
512
|
+
renderContext: renderContext,
|
|
460
513
|
ariaRowIndex: ariaRowIndexingEnabled ? firstRowAriaIndex + rowIndex : undefined
|
|
461
514
|
}, rowKey);
|
|
462
515
|
}) : data != null && emptyState !== false && /*#__PURE__*/_jsx("tr", {
|
|
@@ -480,13 +533,17 @@ function BaseTableInner({
|
|
|
480
533
|
// Before rendering the wrapper, run the plugin `transformScrollWrapper`
|
|
481
534
|
// pipeline so plugins can attach a ref to the scroll container (scroll-aware
|
|
482
535
|
// sticky shadows, virtualization) and inject before/after chrome.
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
536
|
+
const scrollWrapperRenderProps = ScrollWrapper ? applyPlugins(plugins, p => p.transformScrollWrapper, {
|
|
537
|
+
htmlProps: {},
|
|
538
|
+
xstyle: []
|
|
539
|
+
}, renderContext) : null;
|
|
540
|
+
const scrollWrapperRef = useMergedRefs(viewportRef, scrollWrapperRenderProps?.htmlProps.ref);
|
|
541
|
+
if (ScrollWrapper && scrollWrapperRenderProps) {
|
|
488
542
|
tableElement = /*#__PURE__*/_jsx(ScrollWrapper, {
|
|
489
|
-
htmlProps:
|
|
543
|
+
htmlProps: {
|
|
544
|
+
...scrollWrapperRenderProps.htmlProps,
|
|
545
|
+
ref: scrollWrapperRef
|
|
546
|
+
},
|
|
490
547
|
xstyle: scrollWrapperRenderProps.xstyle,
|
|
491
548
|
beforeTable: scrollWrapperRenderProps.beforeTable,
|
|
492
549
|
afterTable: scrollWrapperRenderProps.afterTable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table/Table.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table/Table.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,GAAG,EAAC,MAAM,OAAO,CAAC;AAShE,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,WAAW,EAEZ,MAAM,SAAS,CAAC;AAejB,oDAAoD;AAEpD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/D,kCAAkC;AAElC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjE,8DAA8D;AAE9D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEpD;;;;;GAKG;AAEH,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,IAAI,CACzE,cAAc,CAAC,CAAC,CAAC,EACjB,SAAS,GAAG,YAAY,CACzB;IACC,uCAAuC;IACvC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACnC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1C;AA2LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,KAAK,EAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAC,KACjD,YAAY,CAAC"}
|
package/dist/Table/Table.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* - /apps/storybook/stories/Table.stories.tsx (storybook stories)
|
|
17
17
|
* - /packages/cli/assets/templates/blocks/components/Table/ (showcase blocks)
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import { use, useMemo } from 'react';
|
|
20
20
|
import * as stylex from '@stylexjs/stylex';
|
|
21
21
|
import "../theme/tokens.stylex.js";
|
|
22
22
|
import { colorVars } from "../theme/tokens.stylex.js";
|
|
@@ -28,6 +28,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
28
28
|
import { themeProps } from "../utils/themeProps.js";
|
|
29
29
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
30
30
|
import english from "../i18n/generated-english/Table/Table.generated.js";
|
|
31
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
31
32
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
32
33
|
registerEnglishFallback(english);
|
|
33
34
|
|
|
@@ -80,7 +81,7 @@ const scrollWrapperStyles = {
|
|
|
80
81
|
* Internal to Table: the scroll wrapper is not given it as a prop, so it adds
|
|
81
82
|
* nothing to the public table types.
|
|
82
83
|
*/
|
|
83
|
-
const TableNameContext =
|
|
84
|
+
const TableNameContext = createSharedContext('TableNameContext', 1, null);
|
|
84
85
|
TableNameContext.displayName = 'TableNameContext';
|
|
85
86
|
function TableScrollWrapper({
|
|
86
87
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableContext.d.ts","sourceRoot":"","sources":["../../src/Table/TableContext.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC7C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"TableContext.d.ts","sourceRoot":"","sources":["../../src/Table/TableContext.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC7C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,kBAAkB,CAAC;IAClC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC;AAED,eAAO,MAAM,YAAY,mDAIxB,CAAC"}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* - /packages/core/src/Table/TableCell.tsx (consumer)
|
|
15
15
|
* - /packages/core/src/Table/index.ts (exports if types change)
|
|
16
16
|
*/
|
|
17
|
-
import { createLayerScopedContext
|
|
18
|
-
export const TableContext =
|
|
17
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
18
|
+
export const TableContext = createLayerScopedContext('TableContext', 1, null);
|
|
19
19
|
TableContext.displayName = 'TableContext';
|
package/dist/Table/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export { resolveContextActions } from './tableContextMenu.js';
|
|
|
48
48
|
export { useTableFiltering, useTableFilterState, toSearchFilters, } from './plugins/filtering/index.js';
|
|
49
49
|
export { useBaseTablePlugins } from './useBaseTablePlugins.js';
|
|
50
50
|
export { proportional, pixel, generateColumns, resolveColumnWidths, DEFAULT_MIN_COLUMN_WIDTH, } from './columnUtils.js';
|
|
51
|
-
export type { TableColumn, TableColumnAlign, TableVerticalAlign, ColumnWidth, ProportionalWidth, PixelWidth, TablePlugin, TableContextAction, TableContextActions, TableRenderProps, HeaderRowRenderProps, HeaderCellRenderProps, BodyRowRenderProps, BodyCellRenderProps, ScrollWrapperRenderProps, BaseTableProps, } from './types.js';
|
|
51
|
+
export type { TableColumn, TableColumnAlign, TableVerticalAlign, ColumnWidth, ProportionalWidth, PixelWidth, TablePlugin, TableContextAction, TableContextActions, TableRenderProps, HeaderRowRenderProps, HeaderCellRenderProps, BodyRowRenderProps, BodyCellRenderProps, ScrollWrapperRenderProps, BaseTableProps, TableRenderContext, TableRowContext, } from './types.js';
|
|
52
52
|
export type { TableProps, TableDensity, TableDividers, TableTextOverflow, } from './Table.js';
|
|
53
53
|
export type { TableRowProps } from './TableRow.js';
|
|
54
54
|
export type { TableCellProps } from './TableCell.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Table/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,uCAAuC,CAAC;AAE/E,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,mBAAmB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,C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BAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAC,yBAAyB,EAAC,MAAM,SAAS,CAAC;AACvD,YAAY,EAAC,wBAAwB,EAAC,MAAM,sBAAsB,CAAC;AACnE,YAAY,EACV,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iCAAiC,EACjC,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAC,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AACvE,YAAY,EAAC,2BAA2B,EAAC,MAAM,yBAAyB,CAAC;AACzE,YAAY,EAAC,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AACvE,YAAY,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACjE,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableFiltering.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/filtering/useTableFiltering.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTableFiltering.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/filtering/useTableFiltering.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EACV,WAAW,EAGZ,MAAM,aAAa,CAAC;AAGrB,OAAO,KAA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AAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,MAAM,EAAE,uBAAuB,GAC9B,WAAW,CAAC,CAAC,CAAC,CAiGhB"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - /packages/core/src/Table/Table.doc.mjs (filtering documentation)
|
|
13
13
|
* - /packages/core/src/Table/index.ts (exports)
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { use, useRef, useMemo, useState, useCallback } from 'react';
|
|
16
16
|
import * as stylex from '@stylexjs/stylex';
|
|
17
17
|
import "../../../theme/tokens.stylex.js";
|
|
18
18
|
import { spacingVars, radiusVars } from "../../../theme/tokens.stylex.js";
|
|
@@ -31,6 +31,7 @@ import { proportional } from "../../columnUtils.js";
|
|
|
31
31
|
import { useLocale } from "../../../i18n/index.js";
|
|
32
32
|
import { registerEnglishFallback, useComponentTranslator } from "../../../i18n/useComponentTranslator.js";
|
|
33
33
|
import english from "../../../i18n/generated-english/Table/plugins/filtering/useTableFiltering.generated.js";
|
|
34
|
+
import { createSharedContext } from "../../../utils/sharedContext.js";
|
|
34
35
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
36
|
registerEnglishFallback(english);
|
|
36
37
|
|
|
@@ -254,7 +255,7 @@ function tableValueToFilterValue(value, opValue) {
|
|
|
254
255
|
// Filter Store & Context
|
|
255
256
|
// =============================================================================
|
|
256
257
|
|
|
257
|
-
const FilterStoreContext =
|
|
258
|
+
const FilterStoreContext = createSharedContext('FilterStoreContext', 1, null);
|
|
258
259
|
FilterStoreContext.displayName = 'FilterStoreContext';
|
|
259
260
|
function useFilterStore() {
|
|
260
261
|
const store = use(FilterStoreContext);
|
|
@@ -266,7 +267,7 @@ function useFilterStore() {
|
|
|
266
267
|
|
|
267
268
|
/** Variant is stable per plugin instance — kept in a separate context so
|
|
268
269
|
* slot components can read it without going through the mutable store. */
|
|
269
|
-
const FilterVariantContext =
|
|
270
|
+
const FilterVariantContext = createSharedContext('FilterVariantContext', 1, 'popover');
|
|
270
271
|
FilterVariantContext.displayName = 'FilterVariantContext';
|
|
271
272
|
|
|
272
273
|
// =============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableRowExpansion.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/rowExpansion/useTableRowExpansion.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAwBf,OAAO,KAAK,EACV,WAAW,EAMZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAqBxC;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3E,0CAA0C;IAC1C,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kDAAkD;IAClD,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC/B;;;OAGG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;IACvC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAClC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC3C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACvC;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"useTableRowExpansion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6fhB"}
|
|
@@ -117,7 +117,7 @@ const expansionStyles = {
|
|
|
117
117
|
k3aq6I: "x7p49u4 xaafvuh",
|
|
118
118
|
$$css: true
|
|
119
119
|
},
|
|
120
|
-
|
|
120
|
+
mutedPanel: {
|
|
121
121
|
kWkggS: "xwmxj5m",
|
|
122
122
|
$$css: true
|
|
123
123
|
},
|
|
@@ -348,6 +348,7 @@ function PanelDividerModeWatch({
|
|
|
348
348
|
function ExpansionPanelCell({
|
|
349
349
|
colSpan,
|
|
350
350
|
cellsRef,
|
|
351
|
+
isMuted,
|
|
351
352
|
children
|
|
352
353
|
}) {
|
|
353
354
|
const ctx = useTableContext();
|
|
@@ -394,7 +395,7 @@ function ExpansionPanelCell({
|
|
|
394
395
|
return /*#__PURE__*/_jsx("td", {
|
|
395
396
|
ref: cellRef,
|
|
396
397
|
colSpan: colSpan,
|
|
397
|
-
...stylex.props(expansionStyles.expandedCell, panelIndentStyles[ctx?.density ?? 'balanced'], hasRowDividers && dividerStyles.panelCell, glidingDividerStyles.cell, hasRowDividers && glidingDividerStyles.panelCell),
|
|
398
|
+
...stylex.props(expansionStyles.expandedCell, isMuted && expansionStyles.mutedPanel, panelIndentStyles[ctx?.density ?? 'balanced'], hasRowDividers && dividerStyles.panelCell, glidingDividerStyles.cell, hasRowDividers && glidingDividerStyles.panelCell),
|
|
398
399
|
children: children
|
|
399
400
|
});
|
|
400
401
|
}
|
|
@@ -832,10 +833,11 @@ export function useTableRowExpansion(config) {
|
|
|
832
833
|
...stylex.props(
|
|
833
834
|
// Carries the marker so the panel cell's divider can ask whether
|
|
834
835
|
// this row is the table's last, the same way TableCell does.
|
|
835
|
-
tableRowMarker,
|
|
836
|
+
tableRowMarker, glidingDividerStyles.row),
|
|
836
837
|
children: /*#__PURE__*/_jsx(ExpansionPanelCell, {
|
|
837
838
|
colSpan: columnCountRef.current,
|
|
838
839
|
cellsRef: panelCellsRef,
|
|
840
|
+
isMuted: panelVariant === 'muted',
|
|
839
841
|
children: renderExpanded(item)
|
|
840
842
|
})
|
|
841
843
|
}, `${key}-expanded`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file useTableRowIndex.tsx
|
|
3
|
-
* @input React, StyleX, Table types
|
|
3
|
+
* @input React, StyleX, Table types, and each body row's TableRowContext
|
|
4
4
|
* @output Exports useTableRowIndex hook + config type
|
|
5
5
|
* @position Row-index plugin; consumed by Table via plugins prop
|
|
6
6
|
*
|
|
@@ -12,22 +12,20 @@ import type { TablePlugin } from '../../types.js';
|
|
|
12
12
|
/**
|
|
13
13
|
* Configuration for {@link useTableRowIndex}.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `<Table data>` — to derive each row's 1-based ordinal. Pass `getRowKey` when
|
|
18
|
-
* items don't have a stable identity by reference (e.g. new objects each
|
|
19
|
-
* render); it must return a **unique** string per row (duplicate keys collapse
|
|
20
|
-
* to a single ordinal).
|
|
15
|
+
* Without `data`, the plugin numbers each body row from the position Table
|
|
16
|
+
* gives it. With `data`, numbers follow that array, as before.
|
|
21
17
|
*/
|
|
22
18
|
export interface UseTableRowIndexConfig<T extends Record<string, unknown>> {
|
|
23
|
-
/** The data array currently rendered by the table (post sort/filter/page). */
|
|
24
|
-
data: T[];
|
|
25
19
|
/**
|
|
26
|
-
* Optional
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
* Optional: the array whose order the numbers follow. Omit it to number
|
|
21
|
+
* rows from the positions Table gives them.
|
|
22
|
+
*/
|
|
23
|
+
data?: T[];
|
|
24
|
+
/**
|
|
25
|
+
* Optional key extractor returning a **unique** string per row, used with
|
|
26
|
+
* `data`. When provided, rows match `data` by the returned string (stable
|
|
27
|
+
* across new object identities); otherwise by reference identity. For a
|
|
28
|
+
* stable plugin identity across renders, memoize this with `useCallback`.
|
|
31
29
|
*/
|
|
32
30
|
getRowKey?: (item: T) => string;
|
|
33
31
|
/** Header label for the index column. @default '#' */
|
|
@@ -37,14 +35,14 @@ export interface UseTableRowIndexConfig<T extends Record<string, unknown>> {
|
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
37
|
* Returns a {@link TablePlugin} that prepends a right-aligned, monospaced
|
|
40
|
-
* row-number column. Numbering follows the
|
|
41
|
-
*
|
|
38
|
+
* row-number column. Numbering follows the rows the table renders, so it
|
|
39
|
+
* reflects the current sort / filter / pagination view.
|
|
42
40
|
*
|
|
43
41
|
* @example
|
|
44
42
|
* ```
|
|
45
|
-
* const rowIndex = useTableRowIndex(
|
|
43
|
+
* const rowIndex = useTableRowIndex();
|
|
46
44
|
* <Table data={data} columns={columns} idKey="id" plugins={{rowIndex}} />;
|
|
47
45
|
* ```
|
|
48
46
|
*/
|
|
49
|
-
export declare function useTableRowIndex<T extends Record<string, unknown>>(config
|
|
47
|
+
export declare function useTableRowIndex<T extends Record<string, unknown>>(config?: UseTableRowIndexConfig<T>): TablePlugin<T>;
|
|
50
48
|
//# sourceMappingURL=useTableRowIndex.d.ts.map
|