@astryxdesign/core 0.1.1 → 0.1.2-canary.04e71b2
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/CHANGELOG.md +105 -0
- package/README.md +131 -13
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +11 -5
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +4 -1
- package/dist/Banner/Banner.d.ts +7 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +9 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +24 -5
- package/dist/Button/Button.d.ts +12 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +53 -17
- package/dist/Calendar/Calendar.d.ts +5 -4
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +82 -43
- package/dist/Calendar/hooks/index.d.ts +0 -2
- package/dist/Calendar/hooks/index.d.ts.map +1 -1
- package/dist/Calendar/hooks/index.js +1 -2
- package/dist/Calendar/index.d.ts +3 -3
- package/dist/Calendar/index.d.ts.map +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar/styles.d.ts +3 -9
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +3 -11
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +17 -3
- package/dist/Center/Center.d.ts +11 -1
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +9 -3
- package/dist/Chat/ChatMessageList.d.ts +14 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +2 -0
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +4 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts +23 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +51 -9
- package/dist/CheckboxList/CheckboxList.d.ts +13 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +39 -9
- package/dist/CheckboxList/CheckboxListContext.d.ts +7 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +49 -37
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +5 -5
- package/dist/ContextMenu/ContextMenu.d.ts +4 -5
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +93 -11
- package/dist/DateInput/DateInput.d.ts +23 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +59 -8
- package/dist/DateRangeInput/DateRangeInput.d.ts +23 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +42 -9
- package/dist/DateTimeInput/DateTimeInput.d.ts +35 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +78 -15
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +12 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +42 -14
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +7 -1
- package/dist/Field/Field.d.ts +19 -2
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +4 -0
- package/dist/Field/FieldLabel.d.ts +21 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +41 -26
- package/dist/FileInput/FileInput.d.ts +22 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +56 -10
- package/dist/Grid/Grid.d.ts +11 -1
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +8 -0
- package/dist/HoverCard/HoverCard.d.ts +2 -2
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +18 -6
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +7 -3
- package/dist/InputGroup/InputGroup.d.ts +2 -2
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +14 -5
- package/dist/InputGroup/InputGroupContext.d.ts +4 -0
- package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupContext.js +2 -2
- package/dist/InputGroup/index.d.ts +1 -0
- package/dist/InputGroup/index.d.ts.map +1 -1
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +34 -2
- package/dist/Layer/anchorName.d.ts +20 -0
- package/dist/Layer/anchorName.d.ts.map +1 -0
- package/dist/Layer/anchorName.js +36 -0
- package/dist/Layer/layerAnimations.stylex.d.ts +4 -0
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +8 -4
- package/dist/Layer/useLayer.d.ts +29 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +55 -11
- package/dist/Layout/Layout.d.ts +4 -11
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +10 -11
- package/dist/Layout/LayoutFooter.d.ts +2 -2
- package/dist/Layout/LayoutFooter.d.ts.map +1 -1
- package/dist/Layout/LayoutHeader.d.ts +2 -2
- package/dist/Layout/LayoutHeader.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.d.ts +2 -2
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.d.ts +51 -0
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +63 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -2
- package/dist/Link/Link.d.ts +17 -2
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +20 -9
- package/dist/Link/LinkProvider.d.ts +1 -0
- package/dist/Link/LinkProvider.d.ts.map +1 -1
- package/dist/Link/LinkProvider.js +1 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +18 -3
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +13 -0
- package/dist/MoreMenu/MoreMenu.d.ts +1 -7
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +0 -2
- package/dist/MultiSelector/MultiSelector.d.ts +25 -2
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +103 -22
- package/dist/MultiSelector/hooks.d.ts +12 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +14 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +34 -3
- package/dist/NumberInput/NumberInput.d.ts +23 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +62 -12
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +46 -28
- package/dist/Popover/usePopover.d.ts +25 -2
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +18 -6
- package/dist/PowerSearch/PowerSearch.d.ts +11 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +6 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +3 -5
- package/dist/RadioList/RadioList.d.ts +20 -2
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +105 -9
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +13 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts +13 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +78 -44
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +7 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +13 -2
- package/dist/Selector/Selector.d.ts +22 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +84 -23
- package/dist/Selector/hooks.d.ts +8 -1
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +14 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +1 -1
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +8 -2
- package/dist/Slider/Slider.d.ts +21 -0
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +38 -11
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +1 -1
- package/dist/Stack/Stack.d.ts +38 -23
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +25 -1
- package/dist/Stack/StackItem.d.ts +12 -23
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +8 -1
- package/dist/Switch/Switch.d.ts +23 -2
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +41 -11
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +6 -0
- package/dist/TabList/TabList.d.ts +16 -4
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +86 -10
- package/dist/TabList/TabListContext.d.ts +5 -0
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +5 -0
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +6 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +38 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +36 -7
- package/dist/Table/TableCell.d.ts +8 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +10 -10
- package/dist/Table/TableHeaderCell.d.ts +8 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +16 -16
- package/dist/Table/TableRow.d.ts +6 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +15 -7
- package/dist/Table/index.d.ts +4 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +3 -2
- package/dist/Table/plugins/pagination/paginateData.d.ts +2 -1
- package/dist/Table/plugins/pagination/paginateData.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/paginateData.js +8 -3
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +6 -1
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +59 -3
- package/dist/Table/plugins/stickyColumns/index.d.ts +3 -0
- package/dist/Table/plugins/stickyColumns/index.d.ts.map +1 -0
- package/dist/Table/plugins/stickyColumns/index.js +3 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts +25 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +369 -0
- package/dist/Table/tableContextMenu.d.ts +33 -0
- package/dist/Table/tableContextMenu.d.ts.map +1 -0
- package/dist/Table/tableContextMenu.js +133 -0
- package/dist/Table/types.d.ts +161 -5
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +1 -1
- package/dist/Text/text.stylex.d.ts +2 -2
- package/dist/Text/text.stylex.js +2 -2
- package/dist/TextArea/TextArea.d.ts +22 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +41 -9
- package/dist/TextInput/TextInput.d.ts +23 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +55 -10
- package/dist/TimeInput/TimeInput.d.ts +23 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +53 -10
- package/dist/Timestamp/Timestamp.d.ts +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +28 -3
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +14 -0
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +132 -3
- package/dist/ToggleButton/ToggleButton.d.ts +7 -9
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +34 -57
- package/dist/Tokenizer/Tokenizer.d.ts +12 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +27 -5
- package/dist/Toolbar/Toolbar.d.ts +3 -3
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +51 -7
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +57 -9
- package/dist/TreeList/TreeList.d.ts +1 -1
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +72 -2
- package/dist/TreeList/TreeListItem.d.ts +11 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +51 -12
- package/dist/TreeList/treeListItem.markers.stylex.d.ts +16 -0
- package/dist/TreeList/treeListItem.markers.stylex.d.ts.map +1 -0
- package/dist/TreeList/treeListItem.markers.stylex.js +22 -0
- package/dist/Typeahead/BaseTypeahead.d.ts +9 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +67 -6
- package/dist/Typeahead/Typeahead.d.ts +24 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +29 -5
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +61 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.js +65 -0
- package/dist/VisuallyHidden/index.d.ts +11 -0
- package/dist/VisuallyHidden/index.d.ts.map +1 -0
- package/dist/VisuallyHidden/index.js +13 -0
- package/dist/astryx.css +40 -1
- package/dist/astryx.umd.js +147 -0
- package/dist/astryx.umd.js.map +7 -0
- package/dist/hooks/focusableSelector.d.ts +22 -0
- package/dist/hooks/focusableSelector.d.ts.map +1 -0
- package/dist/hooks/focusableSelector.js +24 -0
- package/dist/hooks/index.d.ts +12 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +7 -2
- package/dist/hooks/useAnnounce.d.ts +40 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -0
- package/dist/hooks/useAnnounce.js +142 -0
- package/dist/hooks/useClickableContainer.d.ts +16 -1
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +16 -4
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +4 -4
- package/dist/hooks/useFocusTrap.d.ts +18 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +87 -3
- package/dist/hooks/useGridFocus.d.ts +88 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +261 -62
- package/dist/hooks/useKeyboardHint.d.ts +82 -0
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHint.js +220 -0
- package/dist/hooks/useListFocus.d.ts +78 -7
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +305 -52
- package/dist/hooks/useLongPress.d.ts +21 -0
- package/dist/hooks/useLongPress.d.ts.map +1 -0
- package/dist/hooks/useLongPress.js +89 -0
- package/dist/hooks/useTreeFocus.d.ts +157 -0
- package/dist/hooks/useTreeFocus.d.ts.map +1 -0
- package/dist/hooks/useTreeFocus.js +337 -0
- package/dist/hooks/useTypeahead.d.ts +63 -0
- package/dist/hooks/useTypeahead.d.ts.map +1 -0
- package/dist/hooks/useTypeahead.js +117 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/generateThemeRules.js +1 -1
- package/dist/theme/syntax/SyntaxTheme.d.ts +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +2 -2
- package/dist/theme/syntax/presets.d.ts +1 -1
- package/dist/theme/syntax/presets.d.ts.map +1 -1
- package/dist/theme/syntax/presets.js +1 -1
- package/dist/theme/syntax/tokens.d.ts +1 -1
- package/dist/theme/syntax/tokens.js +1 -1
- package/dist/theme/types.d.ts +1 -1
- package/dist/utils/dateTypes.d.ts +12 -0
- package/dist/utils/dateTypes.d.ts.map +1 -1
- package/dist/utils/dateTypes.js +41 -1
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/inputAria.d.ts +29 -0
- package/dist/utils/inputAria.d.ts.map +1 -0
- package/dist/utils/inputAria.js +30 -0
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +5 -2
- package/package.json +15 -5
- package/src/Avatar/Avatar.test.tsx +37 -0
- package/src/Avatar/Avatar.tsx +10 -5
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +3 -0
- package/src/Banner/Banner.doc.mjs +8 -0
- package/src/Banner/Banner.test.tsx +16 -7
- package/src/Banner/Banner.tsx +9 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +25 -7
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +31 -10
- package/src/Button/Button.doc.mjs +6 -0
- package/src/Button/Button.test.tsx +105 -11
- package/src/Button/Button.tsx +76 -21
- package/src/Calendar/Calendar.doc.mjs +4 -4
- package/src/Calendar/Calendar.test.tsx +168 -30
- package/src/Calendar/Calendar.tsx +121 -66
- package/src/Calendar/hooks/index.ts +0 -6
- package/src/Calendar/index.ts +1 -3
- package/src/Calendar/styles.ts +4 -9
- package/src/Carousel/Carousel.doc.mjs +7 -1
- package/src/Carousel/Carousel.test.tsx +20 -0
- package/src/Carousel/Carousel.tsx +16 -1
- package/src/Center/Center.doc.mjs +12 -2
- package/src/Center/Center.tsx +28 -3
- package/src/Chat/ChatComposer.doc.mjs +3 -0
- package/src/Chat/ChatComposerDrawer.doc.mjs +12 -0
- package/src/Chat/ChatMessageList.doc.mjs +8 -0
- package/src/Chat/ChatMessageList.test.tsx +18 -0
- package/src/Chat/ChatMessageList.tsx +16 -0
- package/src/Chat/useTriggerMenu.tsx +3 -0
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +172 -27
- package/src/CheckboxInput/CheckboxInput.tsx +78 -6
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxList.test.tsx +169 -16
- package/src/CheckboxList/CheckboxList.tsx +56 -3
- package/src/CheckboxList/CheckboxListContext.tsx +7 -0
- package/src/Citation/Citation.doc.mjs +10 -0
- package/src/Citation/Citation.test.tsx +117 -0
- package/src/Citation/Citation.tsx +9 -1
- package/src/ClickableCard/ClickableCard.doc.mjs +15 -0
- package/src/CodeBlock/CodeBlock.test.tsx +115 -0
- package/src/CodeBlock/CodeBlock.tsx +61 -33
- package/src/CommandPalette/CommandPalette.test.tsx +47 -1
- package/src/CommandPalette/CommandPalette.tsx +9 -21
- package/src/ContextMenu/ContextMenu.doc.mjs +4 -4
- package/src/ContextMenu/ContextMenu.test.tsx +155 -1
- package/src/ContextMenu/ContextMenu.tsx +113 -16
- package/src/DateInput/DateInput.doc.mjs +281 -56
- package/src/DateInput/DateInput.test.tsx +188 -2
- package/src/DateInput/DateInput.tsx +89 -10
- package/src/DateRangeInput/DateRangeInput.doc.mjs +251 -46
- package/src/DateRangeInput/DateRangeInput.test.tsx +182 -20
- package/src/DateRangeInput/DateRangeInput.tsx +63 -5
- package/src/DateTimeInput/DateTimeInput.doc.mjs +368 -67
- package/src/DateTimeInput/DateTimeInput.test.tsx +279 -11
- package/src/DateTimeInput/DateTimeInput.tsx +125 -17
- package/src/Dialog/Dialog.doc.mjs +2 -2
- package/src/Dialog/Dialog.tsx +12 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -8
- package/src/DropdownMenu/DropdownMenu.test.tsx +56 -42
- package/src/DropdownMenu/DropdownMenu.tsx +52 -18
- package/src/EmptyState/EmptyState.test.tsx +4 -2
- package/src/EmptyState/EmptyState.tsx +6 -2
- package/src/Field/Field.test.tsx +32 -0
- package/src/Field/Field.tsx +23 -5
- package/src/Field/FieldLabel.tsx +55 -17
- package/src/FileInput/FileInput.doc.mjs +17 -0
- package/src/FileInput/FileInput.test.tsx +283 -49
- package/src/FileInput/FileInput.tsx +76 -4
- package/src/Grid/Grid.doc.mjs +14 -4
- package/src/Grid/Grid.tsx +20 -0
- package/src/HoverCard/HoverCard.doc.mjs +3 -0
- package/src/HoverCard/HoverCard.test.tsx +189 -2
- package/src/HoverCard/HoverCard.tsx +20 -16
- package/src/HoverCard/useHoverCard.tsx +13 -10
- package/src/Icon/Icon.doc.mjs +8 -0
- package/src/InputGroup/InputGroup.doc.mjs +2 -2
- package/src/InputGroup/InputGroup.test.tsx +98 -60
- package/src/InputGroup/InputGroup.tsx +21 -4
- package/src/InputGroup/InputGroupContext.ts +9 -4
- package/src/InputGroup/index.ts +1 -0
- package/src/Kbd/Kbd.test.tsx +22 -4
- package/src/Kbd/Kbd.tsx +37 -12
- package/src/Layer/anchorName.test.ts +146 -0
- package/src/Layer/anchorName.ts +46 -0
- package/src/Layer/layerAnimations.stylex.ts +20 -4
- package/src/Layer/useLayer.doc.mjs +12 -2
- package/src/Layer/useLayer.tsx +100 -15
- package/src/Layout/Layout.doc.mjs +1 -1
- package/src/Layout/Layout.tsx +8 -16
- package/src/Layout/LayoutFooter.doc.mjs +4 -4
- package/src/Layout/LayoutFooter.tsx +3 -3
- package/src/Layout/LayoutHeader.doc.mjs +4 -4
- package/src/Layout/LayoutHeader.tsx +3 -3
- package/src/Layout/LayoutPanel.tsx +3 -3
- package/src/Layout/padding.stylex.ts +52 -0
- package/src/Lightbox/Lightbox.doc.mjs +9 -2
- package/src/Lightbox/Lightbox.test.tsx +53 -5
- package/src/Lightbox/Lightbox.tsx +9 -4
- package/src/Link/Link.doc.mjs +14 -0
- package/src/Link/Link.test.tsx +52 -2
- package/src/Link/Link.tsx +42 -7
- package/src/Link/LinkProvider.tsx +1 -0
- package/src/List/List.doc.mjs +7 -0
- package/src/Markdown/Markdown.doc.mjs +2 -0
- package/src/Markdown/Markdown.test.tsx +28 -26
- package/src/Markdown/Markdown.tsx +21 -6
- package/src/MetadataList/MetadataListItem.doc.mjs +4 -0
- package/src/MobileNav/MobileNav.doc.mjs +8 -8
- package/src/MobileNav/MobileNav.tsx +13 -0
- package/src/MobileNav/MobileNavReopen.test.tsx +118 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -17
- package/src/MoreMenu/MoreMenu.tsx +0 -9
- package/src/MultiSelector/MultiSelector.doc.mjs +25 -0
- package/src/MultiSelector/MultiSelector.test.tsx +375 -8
- package/src/MultiSelector/MultiSelector.tsx +145 -21
- package/src/MultiSelector/hooks.ts +27 -0
- package/src/NavMenu/NavHeadingMenu.test.tsx +77 -1
- package/src/NavMenu/NavHeadingMenu.tsx +50 -3
- package/src/NumberInput/NumberInput.doc.mjs +17 -0
- package/src/NumberInput/NumberInput.test.tsx +242 -40
- package/src/NumberInput/NumberInput.tsx +89 -11
- package/src/OverflowList/OverflowList.doc.mjs +17 -0
- package/src/Pagination/Pagination.doc.mjs +3 -3
- package/src/Pagination/Pagination.test.tsx +250 -14
- package/src/Pagination/Pagination.tsx +54 -29
- package/src/Popover/usePopover.doc.mjs +7 -3
- package/src/Popover/usePopover.tsx +49 -6
- package/src/PowerSearch/PowerSearch.doc.mjs +15 -0
- package/src/PowerSearch/PowerSearch.test.tsx +97 -1
- package/src/PowerSearch/PowerSearch.tsx +16 -3
- package/src/ProgressBar/ProgressBar.test.tsx +45 -27
- package/src/ProgressBar/ProgressBar.tsx +3 -4
- package/src/RadioList/RadioList.doc.mjs +9 -0
- package/src/RadioList/RadioList.test.tsx +252 -16
- package/src/RadioList/RadioList.tsx +166 -10
- package/src/RadioList/RadioListItem.tsx +14 -2
- package/src/Resizable/Resizable.doc.mjs +1 -1
- package/src/Section/Section.doc.mjs +11 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +9 -0
- package/src/SegmentedControl/SegmentedControl.test.tsx +214 -42
- package/src/SegmentedControl/SegmentedControl.tsx +102 -54
- package/src/SegmentedControl/SegmentedControlContext.ts +7 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +14 -1
- package/src/SelectableCard/SelectableCard.doc.mjs +15 -0
- package/src/Selector/Selector.doc.mjs +25 -0
- package/src/Selector/Selector.test.tsx +322 -15
- package/src/Selector/Selector.tsx +126 -40
- package/src/Selector/hooks.ts +23 -0
- package/src/SideNav/SideNav.test.tsx +16 -0
- package/src/SideNav/SideNavItem.tsx +2 -4
- package/src/Skeleton/Skeleton.doc.mjs +11 -1
- package/src/Skeleton/Skeleton.test.tsx +25 -0
- package/src/Skeleton/Skeleton.tsx +11 -1
- package/src/Slider/Slider.doc.mjs +19 -0
- package/src/Slider/Slider.test.tsx +158 -18
- package/src/Slider/Slider.tsx +54 -6
- package/src/Spinner/Spinner.tsx +7 -1
- package/src/Stack/Stack.doc.mjs +77 -0
- package/src/Stack/Stack.test.tsx +55 -5
- package/src/Stack/Stack.tsx +73 -24
- package/src/Stack/StackItem.test.tsx +23 -0
- package/src/Stack/StackItem.tsx +20 -23
- package/src/Switch/Switch.doc.mjs +15 -0
- package/src/Switch/Switch.test.tsx +162 -27
- package/src/Switch/Switch.tsx +61 -21
- package/src/TabList/Tab.tsx +6 -0
- package/src/TabList/TabList.doc.mjs +12 -0
- package/src/TabList/TabList.test.tsx +208 -0
- package/src/TabList/TabList.tsx +102 -12
- package/src/TabList/TabListContext.ts +7 -3
- package/src/TabList/TabMenu.tsx +6 -3
- package/src/Table/BaseTable.tsx +72 -41
- package/src/Table/Table.doc.mjs +14 -0
- package/src/Table/Table.test.tsx +39 -30
- package/src/Table/Table.tsx +27 -1
- package/src/Table/TableCell.tsx +25 -23
- package/src/Table/TableHeaderCell.tsx +28 -29
- package/src/Table/TableRow.tsx +37 -7
- package/src/Table/index.ts +6 -2
- package/src/Table/plugins/pagination/paginateData.ts +10 -3
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +16 -0
- package/src/Table/plugins/pagination/useTablePagination.tsx +8 -1
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +91 -2
- package/src/Table/plugins/sortable/useTableSortable.tsx +53 -1
- package/src/Table/plugins/stickyColumns/index.ts +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.test.tsx +163 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +407 -0
- package/src/Table/tableContextMenu.test.tsx +157 -0
- package/src/Table/tableContextMenu.tsx +142 -0
- package/src/Table/types.ts +175 -4
- package/src/Table/useBaseTablePlugins.ts +1 -0
- package/src/Table/useTableColumnResize.doc.mjs +96 -0
- package/src/Table/useTableStickyColumns.doc.mjs +59 -0
- package/src/Text/Heading.doc.mjs +15 -2
- package/src/Text/Text.doc.mjs +7 -1
- package/src/Text/text.stylex.ts +2 -2
- package/src/TextArea/TextArea.doc.mjs +17 -0
- package/src/TextArea/TextArea.test.tsx +167 -35
- package/src/TextArea/TextArea.tsx +62 -15
- package/src/TextInput/TextInput.doc.mjs +17 -0
- package/src/TextInput/TextInput.test.tsx +168 -34
- package/src/TextInput/TextInput.tsx +77 -9
- package/src/TimeInput/TimeInput.doc.mjs +335 -60
- package/src/TimeInput/TimeInput.test.tsx +144 -7
- package/src/TimeInput/TimeInput.tsx +74 -5
- package/src/Timestamp/Timestamp.doc.mjs +9 -0
- package/src/Timestamp/Timestamp.test.tsx +44 -18
- package/src/Timestamp/Timestamp.tsx +30 -10
- package/src/Toast/Toast.tsx +14 -0
- package/src/Toast/ToastViewport.test.tsx +204 -0
- package/src/Toast/ToastViewport.tsx +167 -21
- package/src/ToggleButton/ToggleButton.doc.mjs +9 -3
- package/src/ToggleButton/ToggleButton.test.tsx +39 -18
- package/src/ToggleButton/ToggleButton.tsx +46 -83
- package/src/Tokenizer/Tokenizer.doc.mjs +15 -0
- package/src/Tokenizer/Tokenizer.test.tsx +105 -1
- package/src/Tokenizer/Tokenizer.tsx +41 -2
- package/src/Toolbar/Toolbar.doc.mjs +65 -5
- package/src/Toolbar/Toolbar.test.tsx +109 -6
- package/src/Toolbar/Toolbar.tsx +59 -5
- package/src/Tooltip/Tooltip.test.tsx +81 -0
- package/src/Tooltip/useTooltip.tsx +57 -11
- package/src/TreeList/TreeList.test.tsx +295 -6
- package/src/TreeList/TreeList.tsx +73 -1
- package/src/TreeList/TreeListItem.tsx +51 -5
- package/src/TreeList/treeListItem.markers.stylex.ts +20 -0
- package/src/Typeahead/BaseTypeahead.tsx +86 -9
- package/src/Typeahead/Typeahead.doc.mjs +136 -30
- package/src/Typeahead/Typeahead.test.tsx +331 -1
- package/src/Typeahead/Typeahead.tsx +52 -1
- package/src/VisuallyHidden/VisuallyHidden.doc.mjs +80 -0
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +76 -0
- package/src/VisuallyHidden/VisuallyHidden.tsx +113 -0
- package/src/VisuallyHidden/index.ts +15 -0
- package/src/hooks/focusableSelector.ts +25 -0
- package/src/hooks/index.ts +28 -2
- package/src/hooks/useAnnounce.test.tsx +101 -0
- package/src/hooks/useAnnounce.ts +168 -0
- package/src/hooks/useClickableContainer.ts +16 -4
- package/src/hooks/useEntryAnimation.ts +16 -4
- package/src/hooks/useFocusTrap.test.tsx +132 -0
- package/src/hooks/useFocusTrap.ts +98 -4
- package/src/hooks/useGridFocus.doc.mjs +40 -2
- package/src/hooks/useGridFocus.test.tsx +132 -0
- package/src/hooks/useGridFocus.ts +343 -67
- package/src/hooks/useImageMode.test.ts +133 -0
- package/src/hooks/useKeyboardHint.doc.mjs +101 -0
- package/src/hooks/useKeyboardHint.test.tsx +70 -0
- package/src/hooks/useKeyboardHint.tsx +332 -0
- package/src/hooks/useListFocus.doc.mjs +50 -10
- package/src/hooks/useListFocus.test.tsx +375 -0
- package/src/hooks/useListFocus.ts +395 -57
- package/src/hooks/useLongPress.test.tsx +134 -0
- package/src/hooks/useLongPress.ts +119 -0
- package/src/hooks/useTreeFocus.doc.mjs +140 -0
- package/src/hooks/useTreeFocus.test.tsx +214 -0
- package/src/hooks/useTreeFocus.ts +559 -0
- package/src/hooks/useTypeahead.test.tsx +109 -0
- package/src/hooks/useTypeahead.ts +183 -0
- package/src/index.ts +1 -0
- package/src/theme/derivedVarRegistry.test.ts +4 -0
- package/src/theme/generateThemeRules.test.ts +7 -8
- package/src/theme/generateThemeRules.ts +1 -1
- package/src/theme/syntax/SyntaxTheme.tsx +1 -1
- package/src/theme/syntax/defineSyntaxTheme.ts +20 -11
- package/src/theme/syntax/presets.ts +5 -2
- package/src/theme/syntax/tokens.ts +1 -1
- package/src/theme/types.ts +1 -1
- package/src/utils/dateTypes.test.ts +40 -0
- package/src/utils/dateTypes.ts +40 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/inputAria.test.ts +39 -0
- package/src/utils/inputAria.ts +58 -0
- package/src/utils/timeParser.test.ts +10 -0
- package/src/utils/timeParser.ts +5 -2
- package/dist/Calendar/hooks/useCalendarRovingTabindex.d.ts +0 -57
- package/dist/Calendar/hooks/useCalendarRovingTabindex.d.ts.map +0 -1
- package/dist/Calendar/hooks/useCalendarRovingTabindex.js +0 -96
- package/src/Calendar/hooks/useCalendarRovingTabindex.ts +0 -118
package/src/Table/BaseTable.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import type {
|
|
|
26
26
|
HeaderCellRenderProps,
|
|
27
27
|
BodyRowRenderProps,
|
|
28
28
|
BodyCellRenderProps,
|
|
29
|
+
ScrollWrapperRenderProps,
|
|
29
30
|
TableRowComponentProps,
|
|
30
31
|
TableCellComponentProps,
|
|
31
32
|
TableHeaderCellComponentProps,
|
|
@@ -152,22 +153,27 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
152
153
|
CellComponent,
|
|
153
154
|
}: TableRowProps<T>): ReactElement {
|
|
154
155
|
// Build cells first
|
|
155
|
-
const cells = columns.map(col => {
|
|
156
|
+
const cells = columns.map((col, columnIndex) => {
|
|
156
157
|
// Apply column alignment to body cells
|
|
157
158
|
const initialCellHtmlProps: Record<string, unknown> = {};
|
|
158
159
|
if (col.align) {
|
|
159
160
|
initialCellHtmlProps.style = {textAlign: col.align};
|
|
160
161
|
}
|
|
161
162
|
|
|
163
|
+
const initialBodyCellRenderProps: BodyCellRenderProps = {
|
|
164
|
+
htmlProps: initialCellHtmlProps,
|
|
165
|
+
styles: [],
|
|
166
|
+
columnIndex,
|
|
167
|
+
columns: columns as ReadonlyArray<TableColumn<Record<string, unknown>>>,
|
|
168
|
+
};
|
|
162
169
|
const cellRenderProps = applyPlugins(
|
|
163
170
|
plugins,
|
|
164
171
|
p => p.transformBodyCell,
|
|
165
|
-
|
|
166
|
-
htmlProps: initialCellHtmlProps,
|
|
167
|
-
styles: [],
|
|
168
|
-
} satisfies BodyCellRenderProps,
|
|
172
|
+
initialBodyCellRenderProps,
|
|
169
173
|
col,
|
|
170
174
|
item,
|
|
175
|
+
columnIndex,
|
|
176
|
+
columns,
|
|
171
177
|
);
|
|
172
178
|
|
|
173
179
|
const isDefaultRenderer = !col.renderCell;
|
|
@@ -199,6 +205,7 @@ function TableRowInner<T extends Record<string, unknown>>({
|
|
|
199
205
|
<CellComponent
|
|
200
206
|
key={col.key}
|
|
201
207
|
{...cellRenderProps.htmlProps}
|
|
208
|
+
contextMenuActions={cellRenderProps.contextMenuActions}
|
|
202
209
|
xstyle={cellRenderProps.styles}>
|
|
203
210
|
{content}
|
|
204
211
|
</CellComponent>
|
|
@@ -313,8 +320,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
313
320
|
// Use stable empty array when no plugins provided
|
|
314
321
|
const plugins = pluginsProp ?? (EMPTY_PLUGINS as TablePlugin<T>[]);
|
|
315
322
|
|
|
316
|
-
const RowComponent =
|
|
317
|
-
TableRow as React.ComponentType<TableRowComponentProps>;
|
|
323
|
+
const RowComponent = TableRow as React.ComponentType<TableRowComponentProps>;
|
|
318
324
|
const CellComponent =
|
|
319
325
|
TableCell as React.ComponentType<TableCellComponentProps>;
|
|
320
326
|
const HeaderCellComponent =
|
|
@@ -354,7 +360,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
354
360
|
} satisfies TableRenderProps);
|
|
355
361
|
|
|
356
362
|
// --- Plugin pipeline: header cells ---
|
|
357
|
-
const headerCells = resolvedColumns.map(col => {
|
|
363
|
+
const headerCells = resolvedColumns.map((col, columnIndex) => {
|
|
358
364
|
const headerContent = col.header ?? col.key;
|
|
359
365
|
|
|
360
366
|
// Build initial htmlProps with column alignment if specified
|
|
@@ -365,15 +371,22 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
365
371
|
initialHeaderHtmlProps.style = {textAlign: col.align};
|
|
366
372
|
}
|
|
367
373
|
|
|
374
|
+
const initialHeaderRenderProps: HeaderCellRenderProps = {
|
|
375
|
+
htmlProps: initialHeaderHtmlProps,
|
|
376
|
+
styles: [],
|
|
377
|
+
content: headerContent,
|
|
378
|
+
columnIndex,
|
|
379
|
+
columns: resolvedColumns as ReadonlyArray<
|
|
380
|
+
TableColumn<Record<string, unknown>>
|
|
381
|
+
>,
|
|
382
|
+
};
|
|
368
383
|
const cellRenderProps = applyPlugins(
|
|
369
384
|
plugins,
|
|
370
385
|
p => p.transformHeaderCell,
|
|
371
|
-
|
|
372
|
-
htmlProps: initialHeaderHtmlProps,
|
|
373
|
-
styles: [],
|
|
374
|
-
content: headerContent,
|
|
375
|
-
} satisfies HeaderCellRenderProps,
|
|
386
|
+
initialHeaderRenderProps,
|
|
376
387
|
col,
|
|
388
|
+
columnIndex,
|
|
389
|
+
resolvedColumns,
|
|
377
390
|
);
|
|
378
391
|
|
|
379
392
|
// Apply pre-computed column width styles on the <th>.
|
|
@@ -397,29 +410,32 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
397
410
|
const hasSlots =
|
|
398
411
|
before != null || after != null || overlay != null || below != null;
|
|
399
412
|
|
|
413
|
+
const headerInner = hasSlots ? (
|
|
414
|
+
<>
|
|
415
|
+
{before}
|
|
416
|
+
{after != null ? (
|
|
417
|
+
<div {...stylex.props(styles.headerLabelRow)}>
|
|
418
|
+
{resolvedContent}
|
|
419
|
+
{after}
|
|
420
|
+
</div>
|
|
421
|
+
) : (
|
|
422
|
+
resolvedContent
|
|
423
|
+
)}
|
|
424
|
+
{overlay}
|
|
425
|
+
{below}
|
|
426
|
+
</>
|
|
427
|
+
) : (
|
|
428
|
+
resolvedContent
|
|
429
|
+
);
|
|
430
|
+
|
|
400
431
|
return (
|
|
401
432
|
<HeaderCellComponent
|
|
402
433
|
key={col.key}
|
|
403
434
|
{...mergedHtmlProps}
|
|
404
435
|
{...headerTitleProp}
|
|
436
|
+
contextMenuActions={cellRenderProps.contextMenuActions}
|
|
405
437
|
xstyle={cellRenderProps.styles}>
|
|
406
|
-
{
|
|
407
|
-
<>
|
|
408
|
-
{before}
|
|
409
|
-
{after != null ? (
|
|
410
|
-
<div {...stylex.props(styles.headerLabelRow)}>
|
|
411
|
-
{resolvedContent}
|
|
412
|
-
{after}
|
|
413
|
-
</div>
|
|
414
|
-
) : (
|
|
415
|
-
resolvedContent
|
|
416
|
-
)}
|
|
417
|
-
{overlay}
|
|
418
|
-
{below}
|
|
419
|
-
</>
|
|
420
|
-
) : (
|
|
421
|
-
resolvedContent
|
|
422
|
-
)}
|
|
438
|
+
{headerInner}
|
|
423
439
|
</HeaderCellComponent>
|
|
424
440
|
);
|
|
425
441
|
});
|
|
@@ -465,6 +481,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
465
481
|
<TableHeader>
|
|
466
482
|
<RowComponent
|
|
467
483
|
{...headerRowRenderProps.htmlProps}
|
|
484
|
+
isHeaderRow
|
|
468
485
|
xstyle={headerRowRenderProps.styles}>
|
|
469
486
|
{headerRowRenderProps.children}
|
|
470
487
|
</RowComponent>
|
|
@@ -497,9 +514,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
497
514
|
emptyState !== false && (
|
|
498
515
|
<tr>
|
|
499
516
|
<td colSpan={resolvedColumns.length}>
|
|
500
|
-
{emptyState ??
|
|
501
|
-
<EmptyState title="No data" isCompact />
|
|
502
|
-
)}
|
|
517
|
+
{emptyState ?? <EmptyState title="No data" isCompact />}
|
|
503
518
|
</td>
|
|
504
519
|
</tr>
|
|
505
520
|
)}
|
|
@@ -513,8 +528,29 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
513
528
|
// when columns exceed the container width. This wrapper sits between
|
|
514
529
|
// the <table> and transformTableContext, so plugin chrome (pagination,
|
|
515
530
|
// toolbars) renders outside the scroll area.
|
|
531
|
+
//
|
|
532
|
+
// Before rendering the wrapper, run the plugin `transformScrollWrapper`
|
|
533
|
+
// pipeline so plugins can attach a ref to the scroll container (scroll-aware
|
|
534
|
+
// sticky shadows, virtualization) and inject before/after chrome.
|
|
516
535
|
if (ScrollWrapper) {
|
|
517
|
-
|
|
536
|
+
const scrollWrapperRenderProps = applyPlugins(
|
|
537
|
+
plugins,
|
|
538
|
+
p => p.transformScrollWrapper,
|
|
539
|
+
{
|
|
540
|
+
htmlProps: {},
|
|
541
|
+
styles: [],
|
|
542
|
+
} satisfies ScrollWrapperRenderProps,
|
|
543
|
+
);
|
|
544
|
+
|
|
545
|
+
tableElement = (
|
|
546
|
+
<ScrollWrapper
|
|
547
|
+
htmlProps={scrollWrapperRenderProps.htmlProps}
|
|
548
|
+
styles={scrollWrapperRenderProps.styles}
|
|
549
|
+
beforeTable={scrollWrapperRenderProps.beforeTable}
|
|
550
|
+
afterTable={scrollWrapperRenderProps.afterTable}>
|
|
551
|
+
{tableElement}
|
|
552
|
+
</ScrollWrapper>
|
|
553
|
+
);
|
|
518
554
|
}
|
|
519
555
|
|
|
520
556
|
// Apply transformTableContext from each plugin.
|
|
@@ -527,10 +563,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
527
563
|
try {
|
|
528
564
|
tableElement = plugin.transformTableContext(tableElement);
|
|
529
565
|
} catch (error) {
|
|
530
|
-
console.error(
|
|
531
|
-
'[Table] Plugin threw in transformTableContext:',
|
|
532
|
-
error,
|
|
533
|
-
);
|
|
566
|
+
console.error('[Table] Plugin threw in transformTableContext:', error);
|
|
534
567
|
}
|
|
535
568
|
}
|
|
536
569
|
}
|
|
@@ -556,9 +589,7 @@ function BaseTableInner<T extends Record<string, unknown>>({
|
|
|
556
589
|
* />
|
|
557
590
|
* ```
|
|
558
591
|
*/
|
|
559
|
-
export const BaseTable = BaseTableInner as <
|
|
560
|
-
T extends Record<string, unknown>,
|
|
561
|
-
>(
|
|
592
|
+
export const BaseTable = BaseTableInner as <T extends Record<string, unknown>>(
|
|
562
593
|
props: BaseTableProps<T> & {ref?: Ref<HTMLTableElement>},
|
|
563
594
|
) => ReactElement;
|
|
564
595
|
|
package/src/Table/Table.doc.mjs
CHANGED
|
@@ -71,6 +71,18 @@ export const docs = {
|
|
|
71
71
|
description: 'Applies a hover highlight background to rows on pointer devices.',
|
|
72
72
|
default: 'false',
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
name: 'verticalAlign',
|
|
76
|
+
type: "'middle' | 'top' | 'bottom'",
|
|
77
|
+
description: 'Vertical alignment for body row cells. Controls `vertical-align` on the `<td>` elements.',
|
|
78
|
+
default: "'middle'",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'textOverflow',
|
|
82
|
+
type: "'wrap' | 'truncate'",
|
|
83
|
+
description: "How body cell text behaves when it exceeds the column width. 'wrap' lets text wrap and the row grow taller; 'truncate' clips with an ellipsis (default-rendered cells show a tooltip on hover when truncated). Header cells always truncate.",
|
|
84
|
+
default: "'wrap'",
|
|
85
|
+
},
|
|
74
86
|
{
|
|
75
87
|
name: 'plugins',
|
|
76
88
|
type: 'Record<string, TablePlugin<T>>',
|
|
@@ -106,6 +118,7 @@ export const docs = {
|
|
|
106
118
|
{ guidance: true, description: 'Use density and divider variants to match the information density and scanning needs of your data.' },
|
|
107
119
|
{ guidance: true, description: 'Compose rich cell content with Astryx components like Badge, StatusDot, and Avatar via renderCell.' },
|
|
108
120
|
{ guidance: true, description: 'Set explicit width on every column using proportional() or pixel(). proportional(1) gives equal flex distribution with a 120px minimum that prevents columns from collapsing on narrow viewports. Omitting width skips the minimum.' },
|
|
121
|
+
{ guidance: true, description: 'Use the data-driven API from React Server Components: proportional(), pixel(), and column definitions without function props are server-safe. Columns using renderCell (or any function prop) need the table wrapped in a "use client" component, since functions cannot cross the server-client boundary.' },
|
|
109
122
|
{ guidance: false, description: 'Use a table for data without consistent columns. Use a list or card layout for heterogeneous content.' },
|
|
110
123
|
{ guidance: false, description: 'Enable every plugin at once. Add only the features your use case requires to keep the interface focused.' },
|
|
111
124
|
{ guidance: false, description: 'Omit width on text-heavy columns; without an explicit proportional() width they have no minimum and can squish to near-zero on mobile.' },
|
|
@@ -153,6 +166,7 @@ export const docsDense = {
|
|
|
153
166
|
{ guidance: true, description: 'Use density and divider variants to match the information density and scanning needs of your data.' },
|
|
154
167
|
{ guidance: true, description: 'Compose rich cell content with Astryx components like Badge, StatusDot, and Avatar via renderCell.' },
|
|
155
168
|
{ guidance: true, description: 'Set explicit width on every column via proportional() or pixel(). proportional(1) = equal flex w/ 120px min preventing collapse on narrow viewports. Omitting width skips the minimum.' },
|
|
169
|
+
{ guidance: true, description: 'Data-driven API is RSC-safe: proportional(), pixel(), column defs w/o function props work in Server Components. renderCell (any function prop) requires a "use client" wrapper.' },
|
|
156
170
|
{ guidance: false, description: 'Use a table for data without consistent columns. Use a list or card layout for heterogeneous content.' },
|
|
157
171
|
{ guidance: false, description: 'Enable every plugin at once. Add only the features your use case requires to keep the interface focused.' },
|
|
158
172
|
{ guidance: false, description: 'Omit width on text-heavy columns; w/o explicit proportional() width they have no minimum and can squish to near-zero on mobile.' },
|
package/src/Table/Table.test.tsx
CHANGED
|
@@ -245,6 +245,27 @@ describe('BaseTable', () => {
|
|
|
245
245
|
expect(screen.getAllByRole('row')).toHaveLength(4);
|
|
246
246
|
});
|
|
247
247
|
|
|
248
|
+
it('does not apply hover styling to the header row when hasHover is set', () => {
|
|
249
|
+
// Use the public Table (provides TableContext); BaseTable alone has no
|
|
250
|
+
// context, so rows wouldn't pick up hover styling at all.
|
|
251
|
+
const {container} = render(
|
|
252
|
+
<Table data={users} columns={columns} hasHover />,
|
|
253
|
+
);
|
|
254
|
+
const headerRow = container.querySelector('thead tr');
|
|
255
|
+
const bodyRow = container.querySelector('tbody tr');
|
|
256
|
+
expect(headerRow).not.toBeNull();
|
|
257
|
+
expect(bodyRow).not.toBeNull();
|
|
258
|
+
|
|
259
|
+
const headerClasses = new Set(
|
|
260
|
+
(headerRow?.className ?? '').split(/\s+/).filter(Boolean),
|
|
261
|
+
);
|
|
262
|
+
// The body row carries hover-styling class(es) that the header row does not.
|
|
263
|
+
const bodyOnlyClasses = (bodyRow?.className ?? '')
|
|
264
|
+
.split(/\s+/)
|
|
265
|
+
.filter(c => c && !headerClasses.has(c));
|
|
266
|
+
expect(bodyOnlyClasses.length).toBeGreaterThan(0);
|
|
267
|
+
});
|
|
268
|
+
|
|
248
269
|
it('auto-generates columns from data keys when columns omitted', () => {
|
|
249
270
|
render(<BaseTable data={users} />);
|
|
250
271
|
const headers = screen.getAllByRole('columnheader');
|
|
@@ -276,11 +297,7 @@ describe('BaseTable', () => {
|
|
|
276
297
|
|
|
277
298
|
it('uses idKey function to key rows', () => {
|
|
278
299
|
render(
|
|
279
|
-
<BaseTable
|
|
280
|
-
data={users}
|
|
281
|
-
columns={columns}
|
|
282
|
-
idKey={item => item.email}
|
|
283
|
-
/>,
|
|
300
|
+
<BaseTable data={users} columns={columns} idKey={item => item.email} />,
|
|
284
301
|
);
|
|
285
302
|
expect(screen.getAllByRole('row')).toHaveLength(4);
|
|
286
303
|
});
|
|
@@ -374,9 +391,7 @@ describe('BaseTable', () => {
|
|
|
374
391
|
htmlProps: {...props.htmlProps, 'data-testid': 'plugin-table'},
|
|
375
392
|
}),
|
|
376
393
|
};
|
|
377
|
-
render(
|
|
378
|
-
<BaseTable data={users} columns={columns} plugins={[plugin]} />,
|
|
379
|
-
);
|
|
394
|
+
render(<BaseTable data={users} columns={columns} plugins={[plugin]} />);
|
|
380
395
|
expect(screen.getByTestId('plugin-table')).toBeInTheDocument();
|
|
381
396
|
});
|
|
382
397
|
|
|
@@ -387,9 +402,7 @@ describe('BaseTable', () => {
|
|
|
387
402
|
htmlProps: {...props.htmlProps, 'data-testid': 'plugin-header-row'},
|
|
388
403
|
}),
|
|
389
404
|
};
|
|
390
|
-
render(
|
|
391
|
-
<BaseTable data={users} columns={columns} plugins={[plugin]} />,
|
|
392
|
-
);
|
|
405
|
+
render(<BaseTable data={users} columns={columns} plugins={[plugin]} />);
|
|
393
406
|
expect(screen.getByTestId('plugin-header-row')).toBeInTheDocument();
|
|
394
407
|
});
|
|
395
408
|
|
|
@@ -404,9 +417,7 @@ describe('BaseTable', () => {
|
|
|
404
417
|
};
|
|
405
418
|
},
|
|
406
419
|
};
|
|
407
|
-
render(
|
|
408
|
-
<BaseTable data={users} columns={columns} plugins={[plugin]} />,
|
|
409
|
-
);
|
|
420
|
+
render(<BaseTable data={users} columns={columns} plugins={[plugin]} />);
|
|
410
421
|
expect(receivedKeys).toEqual(['name', 'age', 'email']);
|
|
411
422
|
const headers = screen.getAllByRole('columnheader');
|
|
412
423
|
expect(headers[0]).toHaveAttribute('data-column', 'name');
|
|
@@ -423,9 +434,7 @@ describe('BaseTable', () => {
|
|
|
423
434
|
};
|
|
424
435
|
},
|
|
425
436
|
};
|
|
426
|
-
render(
|
|
427
|
-
<BaseTable data={users} columns={columns} plugins={[plugin]} />,
|
|
428
|
-
);
|
|
437
|
+
render(<BaseTable data={users} columns={columns} plugins={[plugin]} />);
|
|
429
438
|
expect(receivedItems).toEqual(['Alice', 'Bob', 'Charlie']);
|
|
430
439
|
});
|
|
431
440
|
|
|
@@ -437,9 +446,7 @@ describe('BaseTable', () => {
|
|
|
437
446
|
return props;
|
|
438
447
|
},
|
|
439
448
|
};
|
|
440
|
-
render(
|
|
441
|
-
<BaseTable data={users} columns={columns} plugins={[plugin]} />,
|
|
442
|
-
);
|
|
449
|
+
render(<BaseTable data={users} columns={columns} plugins={[plugin]} />);
|
|
443
450
|
// 3 rows * 3 columns = 9 calls
|
|
444
451
|
expect(calls).toHaveLength(9);
|
|
445
452
|
expect(calls[0]).toEqual({col: 'name', name: 'Alice'});
|
|
@@ -626,6 +633,16 @@ describe('Table', () => {
|
|
|
626
633
|
expect(wrapper!.className).toContain('astryx-table-scroll-wrapper');
|
|
627
634
|
});
|
|
628
635
|
|
|
636
|
+
it('makes the scroll container keyboard-focusable', () => {
|
|
637
|
+
render(<Table data={users} columns={columns} />);
|
|
638
|
+
const table = screen.getByRole('table');
|
|
639
|
+
const wrapper = table.parentElement;
|
|
640
|
+
expect(wrapper).toBeTruthy();
|
|
641
|
+
expect(wrapper!).toHaveAttribute('tabindex', '0');
|
|
642
|
+
expect(wrapper!).toHaveAttribute('role', 'region');
|
|
643
|
+
expect(wrapper!).toHaveAttribute('aria-label', 'Table');
|
|
644
|
+
});
|
|
645
|
+
|
|
629
646
|
it('uses table-layout: auto in children mode', () => {
|
|
630
647
|
const {container} = render(
|
|
631
648
|
<Table dividers="rows">
|
|
@@ -746,11 +763,7 @@ describe('Table', () => {
|
|
|
746
763
|
}),
|
|
747
764
|
};
|
|
748
765
|
render(
|
|
749
|
-
<Table
|
|
750
|
-
data={users}
|
|
751
|
-
columns={columns}
|
|
752
|
-
plugins={{custom: userPlugin}}
|
|
753
|
-
/>,
|
|
766
|
+
<Table data={users} columns={columns} plugins={{custom: userPlugin}} />,
|
|
754
767
|
);
|
|
755
768
|
expect(screen.getByTestId('custom-plugin')).toBeInTheDocument();
|
|
756
769
|
});
|
|
@@ -767,11 +780,7 @@ describe('Table', () => {
|
|
|
767
780
|
},
|
|
768
781
|
};
|
|
769
782
|
render(
|
|
770
|
-
<Table
|
|
771
|
-
data={users}
|
|
772
|
-
columns={columns}
|
|
773
|
-
plugins={{custom: userPlugin}}
|
|
774
|
-
/>,
|
|
783
|
+
<Table data={users} columns={columns} plugins={{custom: userPlugin}} />,
|
|
775
784
|
);
|
|
776
785
|
expect(screen.getByTestId('after-xds')).toBeInTheDocument();
|
|
777
786
|
});
|
package/src/Table/Table.tsx
CHANGED
|
@@ -30,6 +30,7 @@ import type {
|
|
|
30
30
|
TablePlugin,
|
|
31
31
|
TableRenderProps,
|
|
32
32
|
} from './types';
|
|
33
|
+
import type {StyleXStyles} from '../theme/types';
|
|
33
34
|
|
|
34
35
|
// =============================================================================
|
|
35
36
|
// Table Types
|
|
@@ -131,17 +132,42 @@ const scrollWrapperStyles = stylex.create({
|
|
|
131
132
|
},
|
|
132
133
|
});
|
|
133
134
|
|
|
134
|
-
function TableScrollWrapper({
|
|
135
|
+
function TableScrollWrapper({
|
|
136
|
+
children,
|
|
137
|
+
htmlProps,
|
|
138
|
+
styles: pluginStyles,
|
|
139
|
+
beforeTable,
|
|
140
|
+
afterTable,
|
|
141
|
+
}: {
|
|
142
|
+
children: React.ReactNode;
|
|
143
|
+
htmlProps?: React.HTMLAttributes<HTMLDivElement> & {
|
|
144
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
145
|
+
};
|
|
146
|
+
styles?: StyleXStyles[];
|
|
147
|
+
beforeTable?: React.ReactNode;
|
|
148
|
+
afterTable?: React.ReactNode;
|
|
149
|
+
}) {
|
|
150
|
+
const {ref, ...restHtmlProps} = htmlProps ?? {};
|
|
135
151
|
return (
|
|
136
152
|
<div
|
|
153
|
+
ref={ref}
|
|
154
|
+
// Keyboard-focusable so keyboard users can scroll a horizontally
|
|
155
|
+
// overflowing table. Callers may override role/aria-label via htmlProps.
|
|
156
|
+
tabIndex={0}
|
|
157
|
+
role="region"
|
|
158
|
+
aria-label="Table"
|
|
159
|
+
{...restHtmlProps}
|
|
137
160
|
{...mergeProps(
|
|
138
161
|
themeProps('table-scroll-wrapper'),
|
|
139
162
|
stylex.props(
|
|
140
163
|
scrollWrapperStyles.base,
|
|
141
164
|
scrollWrapperStyles.containerBleed,
|
|
165
|
+
...(pluginStyles ?? []),
|
|
142
166
|
),
|
|
143
167
|
)}>
|
|
168
|
+
{beforeTable}
|
|
144
169
|
{children}
|
|
170
|
+
{afterTable}
|
|
145
171
|
</div>
|
|
146
172
|
);
|
|
147
173
|
}
|
package/src/Table/TableCell.tsx
CHANGED
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
typeScaleVars,
|
|
25
25
|
} from '../theme/tokens.stylex';
|
|
26
26
|
import type {StyleXStyles} from '../theme/types';
|
|
27
|
+
import type {TableContextActions} from './types';
|
|
28
|
+
import {wrapInTableContextMenu} from './tableContextMenu';
|
|
27
29
|
import {
|
|
28
30
|
overflowStyles,
|
|
29
31
|
wrapStyles,
|
|
@@ -56,6 +58,12 @@ export interface TableCellProps extends BaseProps<HTMLTableCellElement> {
|
|
|
56
58
|
* Must be a `stylex.create()` value — not an inline style object.
|
|
57
59
|
*/
|
|
58
60
|
xstyle?: StyleXStyles | StyleXStyles[];
|
|
61
|
+
/**
|
|
62
|
+
* Right-click actions rendered as a context menu around the cell content.
|
|
63
|
+
* The cell owns the wrapper so it controls how the menu interacts with its
|
|
64
|
+
* padding / content. Empty or undefined renders no menu.
|
|
65
|
+
*/
|
|
66
|
+
contextMenuActions?: TableContextActions;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
const densityStyles = stylex.create({
|
|
@@ -138,33 +146,27 @@ export function TableCell({
|
|
|
138
146
|
ref,
|
|
139
147
|
className: incomingClassName,
|
|
140
148
|
style: incomingStyle,
|
|
149
|
+
contextMenuActions,
|
|
141
150
|
...props
|
|
142
151
|
}: TableCellProps) {
|
|
143
152
|
const ctx = useTableContext();
|
|
144
153
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
</td>
|
|
158
|
-
);
|
|
159
|
-
}
|
|
154
|
+
// Standalone (no table context) renders plain, with no density/divider styles.
|
|
155
|
+
const cellStyles: StyleXStyles[] = ctx
|
|
156
|
+
? [
|
|
157
|
+
densityStyles[ctx.density],
|
|
158
|
+
ctx.textOverflow === 'truncate'
|
|
159
|
+
? overflowStyles.cell
|
|
160
|
+
: wrapStyles.cell,
|
|
161
|
+
containerEdgeStyles[ctx.density],
|
|
162
|
+
verticalAlignStyles[ctx.verticalAlign],
|
|
163
|
+
...buildDividerStyles(ctx, dividerRowStyles.cell, dividerColumnStyles.cell),
|
|
164
|
+
]
|
|
165
|
+
: [];
|
|
160
166
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
containerEdgeStyles[ctx.density],
|
|
165
|
-
verticalAlignStyles[ctx.verticalAlign],
|
|
166
|
-
...buildDividerStyles(ctx, dividerRowStyles.cell, dividerColumnStyles.cell),
|
|
167
|
-
];
|
|
167
|
+
// The cell owns the context-menu wrapper so it controls how the menu
|
|
168
|
+
// interacts with its padding / content. No-op when no actions.
|
|
169
|
+
const content = wrapInTableContextMenu(children, contextMenuActions);
|
|
168
170
|
|
|
169
171
|
return (
|
|
170
172
|
<td
|
|
@@ -176,7 +178,7 @@ export function TableCell({
|
|
|
176
178
|
incomingClassName,
|
|
177
179
|
incomingStyle,
|
|
178
180
|
)}>
|
|
179
|
-
{
|
|
181
|
+
{content}
|
|
180
182
|
</td>
|
|
181
183
|
);
|
|
182
184
|
}
|
|
@@ -25,8 +25,10 @@ import {
|
|
|
25
25
|
borderVars,
|
|
26
26
|
} from '../theme/tokens.stylex';
|
|
27
27
|
import type {StyleXStyles} from '../theme/types';
|
|
28
|
+
import type {TableContextActions} from './types';
|
|
28
29
|
import {overflowStyles, containerEdgeStyles} from './table.stylex';
|
|
29
30
|
import {useTableContext, mergeXStyle} from './useTableCellStyles';
|
|
31
|
+
import {wrapInTableContextMenu} from './tableContextMenu';
|
|
30
32
|
import {mergeProps} from '../utils';
|
|
31
33
|
import {themeProps} from '../utils/themeProps';
|
|
32
34
|
|
|
@@ -42,6 +44,12 @@ export interface TableHeaderCellProps extends BaseProps<HTMLTableCellElement> {
|
|
|
42
44
|
* Must be a `stylex.create()` value — not an inline style object.
|
|
43
45
|
*/
|
|
44
46
|
xstyle?: StyleXStyles | StyleXStyles[];
|
|
47
|
+
/**
|
|
48
|
+
* Right-click actions rendered as a context menu around the cell content.
|
|
49
|
+
* The cell owns the wrapper so it controls how the menu interacts with its
|
|
50
|
+
* padding / content. Empty or undefined renders no menu.
|
|
51
|
+
*/
|
|
52
|
+
contextMenuActions?: TableContextActions;
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
const densityStyles = stylex.create({
|
|
@@ -117,41 +125,32 @@ export function TableHeaderCell({
|
|
|
117
125
|
ref,
|
|
118
126
|
className: incomingClassName,
|
|
119
127
|
style: incomingStyle,
|
|
128
|
+
contextMenuActions,
|
|
120
129
|
...props
|
|
121
130
|
}: TableHeaderCellProps) {
|
|
122
131
|
const ctx = useTableContext();
|
|
123
132
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
{children}
|
|
136
|
-
</th>
|
|
133
|
+
// Header cells always get the bottom divider (separates header from body).
|
|
134
|
+
// When used standalone (no table context) the cell renders plain, with no
|
|
135
|
+
// density/divider styles.
|
|
136
|
+
const cellStyles: StyleXStyles[] = [];
|
|
137
|
+
if (ctx) {
|
|
138
|
+
cellStyles.push(
|
|
139
|
+
headerStyles.cell,
|
|
140
|
+
densityStyles[ctx.density],
|
|
141
|
+
headerDividerStyles.cell,
|
|
142
|
+
overflowStyles.cell,
|
|
143
|
+
containerEdgeStyles[ctx.density],
|
|
137
144
|
);
|
|
145
|
+
// Column dividers come from the shared builder (column axis only).
|
|
146
|
+
if (ctx.dividers === 'columns' || ctx.dividers === 'grid') {
|
|
147
|
+
cellStyles.push(dividerColumnStyles.cell);
|
|
148
|
+
}
|
|
138
149
|
}
|
|
139
150
|
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
const cellStyles: StyleXStyles[] = [
|
|
144
|
-
headerStyles.cell,
|
|
145
|
-
densityStyles[ctx.density],
|
|
146
|
-
headerDividerStyles.cell,
|
|
147
|
-
overflowStyles.cell,
|
|
148
|
-
containerEdgeStyles[ctx.density],
|
|
149
|
-
];
|
|
150
|
-
|
|
151
|
-
// Only add column dividers from the shared builder
|
|
152
|
-
if (ctx.dividers === 'columns' || ctx.dividers === 'grid') {
|
|
153
|
-
cellStyles.push(dividerColumnStyles.cell);
|
|
154
|
-
}
|
|
151
|
+
// The cell owns the context-menu wrapper so it controls how the menu
|
|
152
|
+
// interacts with its padding / content. No-op when no actions.
|
|
153
|
+
const content = wrapInTableContextMenu(children, contextMenuActions);
|
|
155
154
|
|
|
156
155
|
return (
|
|
157
156
|
<th
|
|
@@ -163,7 +162,7 @@ export function TableHeaderCell({
|
|
|
163
162
|
incomingClassName,
|
|
164
163
|
incomingStyle,
|
|
165
164
|
)}>
|
|
166
|
-
{
|
|
165
|
+
{content}
|
|
167
166
|
</th>
|
|
168
167
|
);
|
|
169
168
|
}
|