@15gifts/back-office-kit 0.1.0-alpha.0 → 0.1.0
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/README.md +9 -6
- package/dist/browser/back-office-kit.js +6649 -5932
- package/dist/components/Alert/Alert.css.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +12 -2
- package/dist/components/Alert/Alert.js +33 -29
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styles.js +2 -2
- package/dist/components/Alert/Alert.styles.js.map +1 -1
- package/dist/components/AppShell/AppShell.css.d.ts +2 -0
- package/dist/components/AppShell/AppShell.d.ts +3 -1
- package/dist/components/AppShell/AppShell.js +42 -26
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/AppShell/AppShell.styles.js +3 -2
- package/dist/components/AppShell/AppShell.styles.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -0
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Badge/Badge.css.d.ts +5 -0
- package/dist/components/Badge/Badge.d.ts +4 -1
- package/dist/components/Badge/Badge.js +6 -5
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.styles.js +16 -15
- package/dist/components/Badge/Badge.styles.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.css.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +27 -27
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/dist/components/Button/Button.css.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +5 -4
- package/dist/components/Button/Button.js +21 -21
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styles.js.map +1 -1
- package/dist/components/Card/Card.css.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +7 -1
- package/dist/components/Card/Card.js +33 -22
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.styles.js +2 -2
- package/dist/components/Card/Card.styles.js.map +1 -1
- package/dist/components/ChatTranscript/ChatTranscript.d.ts +2 -2
- package/dist/components/ChatTranscript/ChatTranscript.js +74 -71
- package/dist/components/ChatTranscript/ChatTranscript.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +30 -34
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.styles.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.css.d.ts +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +28 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js +66 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +10 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js.map +1 -0
- package/dist/components/CheckboxGroup/index.d.ts +2 -0
- package/dist/components/Chip/Chip.css.d.ts +2 -0
- package/dist/components/Chip/Chip.d.ts +15 -3
- package/dist/components/Chip/Chip.js +35 -16
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styles.js +2 -2
- package/dist/components/Chip/Chip.styles.js.map +1 -1
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
- package/dist/components/ColorPicker/ColorPicker.js +46 -47
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.styles.js.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +28 -4
- package/dist/components/Combobox/Combobox.js +130 -109
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +11 -0
- package/dist/components/CopyButton/CopyButton.js +40 -0
- package/dist/components/CopyButton/CopyButton.js.map +1 -0
- package/dist/components/CopyButton/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +10 -3
- package/dist/components/DateRangePicker/DateRangePicker.js +107 -110
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.styles.js +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.styles.js.map +1 -1
- package/dist/components/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/components/DateTimeInput/DateTimeInput.js +20 -28
- package/dist/components/DateTimeInput/DateTimeInput.js.map +1 -1
- package/dist/components/DateTimeInput/DateTimeInput.styles.js +1 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +8 -0
- package/dist/components/DescriptionList/DescriptionList.js +2 -1
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/DetailsSummary/DetailsSummary.css.d.ts +1 -0
- package/dist/components/DetailsSummary/DetailsSummary.d.ts +5 -1
- package/dist/components/DetailsSummary/DetailsSummary.js +15 -15
- package/dist/components/DetailsSummary/DetailsSummary.js.map +1 -1
- package/dist/components/DetailsSummary/DetailsSummary.styles.js +10 -2
- package/dist/components/DetailsSummary/DetailsSummary.styles.js.map +1 -1
- package/dist/components/DetailsSummary/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.css.d.ts +3 -0
- package/dist/components/Drawer/Drawer.d.ts +24 -3
- package/dist/components/Drawer/Drawer.js +55 -46
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.styles.js +7 -2
- package/dist/components/Drawer/Drawer.styles.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.css.d.ts +16 -0
- package/dist/components/EmptyState/EmptyState.d.ts +15 -0
- package/dist/components/EmptyState/EmptyState.js +37 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.styles.js +15 -0
- package/dist/components/EmptyState/EmptyState.styles.js.map +1 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.css.d.ts +5 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.d.ts +13 -5
- package/dist/components/EnvironmentChip/EnvironmentChip.js +14 -3
- package/dist/components/EnvironmentChip/EnvironmentChip.js.map +1 -1
- package/dist/components/EnvironmentChip/EnvironmentChip.styles.js +3 -2
- package/dist/components/EnvironmentChip/EnvironmentChip.styles.js.map +1 -1
- package/dist/components/EnvironmentChip/index.d.ts +2 -2
- package/dist/components/Field/Field.css.d.ts +0 -1
- package/dist/components/Field/Field.d.ts +11 -28
- package/dist/components/Field/Field.js +25 -36
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/Field.styles.js +2 -2
- package/dist/components/Field/Field.styles.js.map +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.d.ts +1 -0
- package/dist/components/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Fieldset/Fieldset.styles.js.map +1 -1
- package/dist/components/Grid/Grid.css.d.ts +22 -0
- package/dist/components/Grid/Grid.d.ts +21 -0
- package/dist/components/Grid/Grid.js +23 -0
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Grid/Grid.styles.js +28 -0
- package/dist/components/Grid/Grid.styles.js.map +1 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/List/List.d.ts +1 -0
- package/dist/components/List/List.js.map +1 -1
- package/dist/components/Loader/Loader.d.ts +1 -1
- package/dist/components/Loader/Loader.js +6 -2
- package/dist/components/Loader/Loader.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +25 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/Menu.styles.js.map +1 -1
- package/dist/components/MetricBar/MetricBar.css.d.ts +5 -0
- package/dist/components/MetricBar/MetricBar.d.ts +9 -1
- package/dist/components/MetricBar/MetricBar.js +38 -22
- package/dist/components/MetricBar/MetricBar.js.map +1 -1
- package/dist/components/MetricBar/MetricBar.styles.js +15 -10
- package/dist/components/MetricBar/MetricBar.styles.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +6 -0
- package/dist/components/Modal/Modal.js +25 -28
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.styles.js +2 -1
- package/dist/components/Modal/Modal.styles.js.map +1 -1
- package/dist/components/NavRail/NavRail.css.d.ts +2 -0
- package/dist/components/NavRail/NavRail.d.ts +22 -7
- package/dist/components/NavRail/NavRail.js +79 -58
- package/dist/components/NavRail/NavRail.js.map +1 -1
- package/dist/components/NavRail/NavRail.styles.js +3 -2
- package/dist/components/NavRail/NavRail.styles.js.map +1 -1
- package/dist/components/NavRail/index.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +9 -1
- package/dist/components/NumberInput/NumberInput.js +37 -31
- package/dist/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.css.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +3 -1
- package/dist/components/PageHeader/PageHeader.js +21 -23
- package/dist/components/PageHeader/PageHeader.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.styles.js +1 -1
- package/dist/components/PageHeader/PageHeader.styles.js.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +5 -0
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +9 -1
- package/dist/components/Popover/Popover.js +7 -6
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/Popover.styles.js.map +1 -1
- package/dist/components/PortalContainer/PortalContainer.d.ts +1 -0
- package/dist/components/PortalContainer/PortalContainer.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.css.d.ts +3 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +5 -1
- package/dist/components/ProgressBar/ProgressBar.js +21 -7
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.styles.js +6 -6
- package/dist/components/ProgressBar/ProgressBar.styles.js.map +1 -1
- package/dist/components/RadioCards/RadioCards.d.ts +8 -2
- package/dist/components/RadioCards/RadioCards.js +40 -44
- package/dist/components/RadioCards/RadioCards.js.map +1 -1
- package/dist/components/SaveBar/SaveBar.d.ts +6 -1
- package/dist/components/SaveBar/SaveBar.js +1 -2
- package/dist/components/SaveBar/SaveBar.js.map +1 -1
- package/dist/components/SaveBar/SaveBar.styles.js.map +1 -1
- package/dist/components/Select/Select.css.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +32 -5
- package/dist/components/Select/Select.js +91 -62
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.styles.js +3 -2
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.js +20 -19
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Stack/Stack.css.d.ts +4 -1
- package/dist/components/Stack/Stack.d.ts +7 -3
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/Stack.styles.js +16 -23
- package/dist/components/Stack/Stack.styles.js.map +1 -1
- package/dist/components/StatCard/StatCard.d.ts +3 -0
- package/dist/components/StatCard/StatCard.js.map +1 -1
- package/dist/components/StatCard/StatCard.styles.js.map +1 -1
- package/dist/components/StatsGrid/StatsGrid.d.ts +3 -6
- package/dist/components/StatsGrid/StatsGrid.js +3 -7
- package/dist/components/StatsGrid/StatsGrid.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.d.ts +3 -2
- package/dist/components/StatusBadge/StatusBadge.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -1
- package/dist/components/Switch/Switch.js +27 -31
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switcher/Switcher.css.d.ts +0 -1
- package/dist/components/Switcher/Switcher.d.ts +13 -1
- package/dist/components/Switcher/Switcher.js +35 -35
- package/dist/components/Switcher/Switcher.js.map +1 -1
- package/dist/components/Switcher/Switcher.styles.js +2 -2
- package/dist/components/Switcher/Switcher.styles.js.map +1 -1
- package/dist/components/Table/Table.css.d.ts +16 -1
- package/dist/components/Table/Table.d.ts +110 -13
- package/dist/components/Table/Table.js +214 -102
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.styles.js +7 -6
- package/dist/components/Table/Table.styles.js.map +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +23 -8
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/Tabs.styles.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tag/Tag.css.d.ts +33 -0
- package/dist/components/Tag/Tag.d.ts +5 -2
- package/dist/components/Tag/Tag.js +23 -6
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/Tag.styles.js +12 -1
- package/dist/components/Tag/Tag.styles.js.map +1 -1
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +13 -2
- package/dist/components/TextInput/TextInput.js +45 -48
- package/dist/components/TextInput/TextInput.js.map +1 -1
- package/dist/components/Textarea/Textarea.css.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +5 -2
- package/dist/components/Textarea/Textarea.js +37 -37
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.styles.js +3 -2
- package/dist/components/Textarea/Textarea.styles.js.map +1 -1
- package/dist/components/ThemeMenu/ThemeMenu.d.ts +13 -0
- package/dist/components/ThemeMenu/ThemeMenu.js +52 -0
- package/dist/components/ThemeMenu/ThemeMenu.js.map +1 -0
- package/dist/components/ThemeMenu/index.d.ts +2 -0
- package/dist/components/ThemePicker/ThemePicker.d.ts +9 -1
- package/dist/components/ThemePicker/ThemePicker.js +3 -1
- package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
- package/dist/components/TimeInput/TimeInput.d.ts +10 -0
- package/dist/components/TimeInput/TimeInput.js +29 -0
- package/dist/components/TimeInput/TimeInput.js.map +1 -0
- package/dist/components/TimeInput/index.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +30 -10
- package/dist/components/ToggleGroup/ToggleGroup.js +60 -59
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.styles.js.map +1 -1
- package/dist/components/ToggleGroup/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.css.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +9 -5
- package/dist/components/Tooltip/Tooltip.js +9 -9
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.styles.js +2 -2
- package/dist/components/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/components/TopBar/TopBar.styles.js.map +1 -1
- package/dist/components/UserMenu/UserMenu.d.ts +4 -3
- package/dist/components/UserMenu/UserMenu.js.map +1 -1
- package/dist/examples/Crm.css.d.ts +3 -0
- package/dist/examples/ExampleShell.d.ts +28 -0
- package/dist/examples/Expenses.css.d.ts +2 -0
- package/dist/examples/HiringTracker.css.d.ts +13 -0
- package/dist/examples/SalesPipeline.css.d.ts +11 -0
- package/dist/foundations/Foundations.css.d.ts +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +51 -45
- package/dist/styles/input.css.d.ts +8 -0
- package/dist/styles/input.styles.js +3 -2
- package/dist/styles/input.styles.js.map +1 -1
- package/dist/styles/shared.css.d.ts +5 -0
- package/dist/styles/shared.styles.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/fontSize.d.ts +4 -4
- package/dist/theme/fontSize.js +8 -23
- package/dist/theme/fontSize.js.map +1 -1
- package/dist/theme/htmlSetting.d.ts +14 -0
- package/dist/theme/htmlSetting.js +33 -0
- package/dist/theme/htmlSetting.js.map +1 -0
- package/dist/theme/theme.d.ts +4 -4
- package/dist/theme/theme.js +18 -33
- package/dist/theme/theme.js.map +1 -1
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens.js +1 -2
- package/package.json +8 -3
- package/skills/back-office-kit/SKILL.md +27 -14
- package/skills/back-office-kit/references/artifact-template.html +1 -0
- package/skills/back-office-kit/references/components.md +482 -251
- package/skills/back-office-kit/references/install.md +27 -4
- package/skills/back-office-kit/references/migrate.md +58 -2
- package/skills/back-office-kit/references/patterns.md +129 -33
- package/skills/back-office-kit/references/testing.md +26 -22
- package/dist/tokens/sprinkles.css.d.ts +0 -38
- package/dist/tokens/sprinkles.styles.js +0 -349
- package/dist/tokens/sprinkles.styles.js.map +0 -1
|
@@ -1,66 +1,163 @@
|
|
|
1
|
-
import { ComponentProps, CSSProperties, Key, ReactNode, Ref } from 'react';
|
|
1
|
+
import { ComponentProps, CSSProperties, Key, ReactElement, ReactNode, Ref } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
2
3
|
import { DataAttributes } from '../Field/Field';
|
|
3
4
|
type Align = 'left' | 'center' | 'right';
|
|
5
|
+
export type SortDirection = 'asc' | 'desc';
|
|
6
|
+
/** The sorted column and its direction. */
|
|
7
|
+
export interface SortState {
|
|
8
|
+
key: string;
|
|
9
|
+
direction: SortDirection;
|
|
10
|
+
}
|
|
4
11
|
export interface TableRootProps extends ComponentProps<'table'> {
|
|
12
|
+
/** `compact` tightens cell padding for dense data. */
|
|
5
13
|
density?: 'default' | 'compact';
|
|
6
|
-
/** Ref to the
|
|
14
|
+
/** Ref to the `<div>` that scrolls the table sideways, e.g. for scroll hints. */
|
|
7
15
|
scrollRef?: Ref<HTMLDivElement>;
|
|
16
|
+
/** The table's `<caption>`, which names it. Visually hidden unless `captionVisible`. */
|
|
17
|
+
caption?: ReactNode;
|
|
18
|
+
/** Shows the caption above the table. */
|
|
19
|
+
captionVisible?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Rows are out of date, e.g. while new filters load. The table is `aria-busy`, and after 300ms
|
|
22
|
+
* (so quick loads don't flicker) a progress bar slides along its top edge.
|
|
23
|
+
*/
|
|
24
|
+
stale?: boolean;
|
|
25
|
+
/** Shown under the table, inside the frame, e.g. `Table.LoadMore` or `Pagination`. Doesn't scroll sideways. */
|
|
26
|
+
footer?: ReactNode;
|
|
8
27
|
}
|
|
9
|
-
/**
|
|
10
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The card-framed `<table>` inside a horizontally scrolling `<div>` (see `scrollRef`). Other props
|
|
30
|
+
* go to the `<table>`. Inside a `Card`, the card is the frame.
|
|
31
|
+
*/
|
|
32
|
+
declare function Root({ density, scrollRef, caption, captionVisible, stale, footer, className, children, ...props }: TableRootProps): import('react').JSX.Element;
|
|
11
33
|
declare function Head(props: ComponentProps<'thead'>): import('react').JSX.Element;
|
|
12
34
|
declare function Body(props: ComponentProps<'tbody'>): import('react').JSX.Element;
|
|
13
|
-
|
|
35
|
+
export interface TableRowProps extends ComponentProps<'tr'> {
|
|
36
|
+
/**
|
|
37
|
+
* Hover and pointer styles, and `onClick` only fires for clicks on the row itself: not on links,
|
|
38
|
+
* buttons or inputs in it, text selections or portalled popups. Defaults to `true` when `onClick`
|
|
39
|
+
* is set. Keyboard users can't click a row, so also give it a link or button.
|
|
40
|
+
*/
|
|
41
|
+
clickable?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare function Row({ clickable, onClick, className, ...props }: TableRowProps): import('react').JSX.Element;
|
|
44
|
+
/** A full-width group heading. Put each group in its own `Table.Body`, starting with this row. */
|
|
45
|
+
export interface TableGroupRowProps extends ComponentProps<'tr'> {
|
|
46
|
+
/** The number of columns, so the heading spans them all. */
|
|
47
|
+
colSpan: number;
|
|
48
|
+
}
|
|
49
|
+
declare function GroupRow({ colSpan, className, children, ...props }: TableGroupRowProps): import('react').JSX.Element;
|
|
14
50
|
export interface TableCellProps extends ComponentProps<'td'> {
|
|
51
|
+
/** Text alignment. Use `right` for numbers (they get tabular figures). */
|
|
15
52
|
align?: Align;
|
|
16
53
|
}
|
|
17
54
|
declare function Cell({ align, className, ...props }: TableCellProps): import('react').JSX.Element;
|
|
18
55
|
export interface TableHeaderCellProps extends ComponentProps<'th'> {
|
|
56
|
+
/** Match the column's cells. `scope` defaults to `col`; use `scope="row"` for row headers. */
|
|
19
57
|
align?: Align;
|
|
58
|
+
/** The column's current sort, or `false` when another column is sorted. Sets `aria-sort`. */
|
|
59
|
+
sort?: SortDirection | false;
|
|
60
|
+
/** Makes the header a sort button. */
|
|
61
|
+
onSort?: () => void;
|
|
62
|
+
}
|
|
63
|
+
declare function HeaderCell({ align, scope, sort, onSort, className, children, ...props }: TableHeaderCellProps): import('react').JSX.Element;
|
|
64
|
+
export interface TableSecondaryProps extends ComponentProps<'span'> {
|
|
65
|
+
/** Monospace, for IDs and codes. Set `false` for plain text. */
|
|
66
|
+
mono?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** A muted line under a cell's main value, e.g. a run ID. */
|
|
69
|
+
declare function Secondary({ mono, className, ...props }: TableSecondaryProps): import('react').JSX.Element;
|
|
70
|
+
export interface TableLoadMoreProps extends Omit<ButtonProps, 'onClick' | 'children'> {
|
|
71
|
+
/** Loads the next page, e.g. from a cursor. */
|
|
72
|
+
onLoadMore: () => void;
|
|
73
|
+
/** While `false`, nothing renders. */
|
|
74
|
+
hasMore?: boolean;
|
|
75
|
+
/** Button text. */
|
|
76
|
+
label?: ReactNode;
|
|
20
77
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
declare function Secondary({ className, ...props }: ComponentProps<'span'>): import('react').JSX.Element;
|
|
78
|
+
/** A "Load more" button for cursor paging. Put it in `footer`. Use `Pagination` for page numbers. */
|
|
79
|
+
declare function LoadMore({ onLoadMore, hasMore, label, loadingLabel, variant, size, className, ...props }: TableLoadMoreProps): import('react').JSX.Element | null;
|
|
24
80
|
export interface TableColumn<Row> {
|
|
81
|
+
/** Unique column ID. Also the row field shown when there's no `render`. */
|
|
25
82
|
key: string;
|
|
83
|
+
/** Column header content. */
|
|
26
84
|
header: ReactNode;
|
|
85
|
+
/** Text alignment. Use `right` for numbers. */
|
|
27
86
|
align?: Align;
|
|
87
|
+
/** Column width, e.g. `1` to shrink an actions column to fit. */
|
|
28
88
|
width?: CSSProperties['width'];
|
|
29
89
|
/** Defaults to `row[key]`. */
|
|
30
90
|
render?: (row: Row) => ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* Shown after the cell's content and outside the row's link or button, so it isn't part of its
|
|
93
|
+
* accessible name, e.g. tags beside a name.
|
|
94
|
+
*/
|
|
95
|
+
extra?: (row: Row) => ReactNode;
|
|
96
|
+
/** Makes the header a sort button (see `sort`). */
|
|
97
|
+
sortable?: boolean;
|
|
98
|
+
/** Ascending order for client-side sorting. Without it, rows show in the order given (the server sorts). */
|
|
99
|
+
compare?: (a: Row, b: Row) => number;
|
|
100
|
+
/** One line with an ellipsis. A string sets the max width, e.g. `'16rem'` (default `20rem`). */
|
|
101
|
+
truncate?: boolean | string;
|
|
31
102
|
}
|
|
32
103
|
export interface TableProps<Row> extends Omit<TableRootProps, 'children'> {
|
|
104
|
+
/** Column definitions, left to right. */
|
|
33
105
|
columns: TableColumn<Row>[];
|
|
106
|
+
/** The data, one row each. */
|
|
34
107
|
rows: Row[];
|
|
108
|
+
/** A stable, unique key for each row, e.g. `(row) => row.id`. */
|
|
35
109
|
getRowKey: (row: Row) => Key;
|
|
36
110
|
/** Shows skeleton rows while there are no rows yet. Existing rows stay during a refetch. */
|
|
37
111
|
loading?: boolean;
|
|
38
|
-
/** Shown when there are no rows. */
|
|
112
|
+
/** Shown when there are no rows, across all columns. Can be a block such as an empty state. */
|
|
39
113
|
empty?: ReactNode;
|
|
40
114
|
/**
|
|
41
115
|
* Makes each row clickable. The primary column's cell becomes a button (so keyboard and screen
|
|
42
116
|
* reader users reach it with Tab and press Enter or Space), and a click anywhere else on the row
|
|
43
117
|
* clicks it too. Clicks on other buttons, links or inputs in the row are left alone. Don't put
|
|
44
|
-
* interactive content in the primary column.
|
|
118
|
+
* interactive content in the primary column; use the column's `extra` for tags and the like.
|
|
45
119
|
*/
|
|
46
120
|
onRowClick?: (row: Row) => void;
|
|
47
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Makes each row a link: the primary column's content becomes an `<a href>` (so middle-click
|
|
123
|
+
* and "open in new tab" work), and a click anywhere else on the row follows it. `onRowClick`,
|
|
124
|
+
* if set, is also called.
|
|
125
|
+
*/
|
|
126
|
+
getRowHref?: (row: Row) => string;
|
|
127
|
+
/** A router link per row instead of `getRowHref`, e.g. `(run) => <Link to={`/runs/${run.id}`} />`. */
|
|
128
|
+
rowLinkRender?: (row: Row) => ReactElement;
|
|
129
|
+
/** `key` of the column that holds the row's button or link. Defaults to the first column. */
|
|
48
130
|
primaryColumn?: string;
|
|
49
131
|
/** Props for each row's `<tr>`, e.g. `(row) => ({ 'data-testid': `run-${row.id}` })`. */
|
|
50
132
|
getRowProps?: (row: Row) => ComponentProps<'tr'> & DataAttributes;
|
|
133
|
+
/** Sorted column (controlled). */
|
|
134
|
+
sort?: SortState;
|
|
135
|
+
/** Initially sorted column (uncontrolled). */
|
|
136
|
+
defaultSort?: SortState;
|
|
137
|
+
/**
|
|
138
|
+
* Called when a sortable header is clicked. A new column sorts descending first; clicking the
|
|
139
|
+
* sorted column flips its direction. Without the column's `compare`, sort the rows yourself.
|
|
140
|
+
*/
|
|
141
|
+
onSortChange?: (sort: SortState) => void;
|
|
142
|
+
/** Groups rows under full-width headings. Groups appear in first-seen order. */
|
|
143
|
+
groupBy?: (row: Row) => Key;
|
|
144
|
+
/** The group heading. Defaults to the key. */
|
|
145
|
+
renderGroup?: (key: Key, rows: Row[]) => ReactNode;
|
|
51
146
|
}
|
|
52
|
-
declare function TableComponent<Row>({ columns, rows, getRowKey, loading, empty, onRowClick, primaryColumn, getRowProps, ...props }: TableProps<Row>): import('react').JSX.Element;
|
|
147
|
+
declare function TableComponent<Row>({ columns, rows, getRowKey, loading, empty, onRowClick, getRowHref, rowLinkRender, primaryColumn, getRowProps, sort: sortProp, defaultSort, onSortChange, groupBy, renderGroup, ...props }: TableProps<Row>): import('react').JSX.Element;
|
|
53
148
|
/**
|
|
54
149
|
* A data table. Pass `columns` and `rows`, or compose `Table.Root`, `Table.Head`, `Table.Body`,
|
|
55
|
-
* `Table.Row`, `Table.HeaderCell` and `Table.Cell` for custom layouts.
|
|
150
|
+
* `Table.Row`, `Table.GroupRow`, `Table.HeaderCell` and `Table.Cell` for custom layouts.
|
|
56
151
|
*/
|
|
57
152
|
export declare const Table: typeof TableComponent & {
|
|
58
153
|
Root: typeof Root;
|
|
59
154
|
Head: typeof Head;
|
|
60
155
|
Body: typeof Body;
|
|
61
156
|
Row: typeof Row;
|
|
157
|
+
GroupRow: typeof GroupRow;
|
|
62
158
|
Cell: typeof Cell;
|
|
63
159
|
HeaderCell: typeof HeaderCell;
|
|
64
160
|
Secondary: typeof Secondary;
|
|
161
|
+
LoadMore: typeof LoadMore;
|
|
65
162
|
};
|
|
66
163
|
export {};
|
|
@@ -1,136 +1,248 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import "../../styles/shared.styles.js";
|
|
2
|
+
import { Button as e } from "../Button/Button.js";
|
|
3
|
+
import { Skeleton as t } from "../Skeleton/Skeleton.js";
|
|
4
|
+
import { align as n, cell as r, frame as i, groupCell as a, headerCell as o, loadMore as s, row as c, rowAction as l, secondary as u, sortButton as d, sortIcon as f, sortIconIdle as p, staleBar as m, table as h, truncate as g, wrapper as _ } from "./Table.styles.js";
|
|
5
|
+
import { createElement as v, useEffect as y, useId as b, useImperativeHandle as x, useRef as S, useState as C } from "react";
|
|
6
|
+
import { clsx as w } from "clsx";
|
|
7
|
+
import { ArrowDown as T, ArrowUp as E, ChevronsUpDown as D } from "lucide-react";
|
|
8
|
+
import { useRender as O } from "@base-ui/react/use-render";
|
|
9
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
6
10
|
// src/components/Table/Table.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
function j({ density: e = "default", scrollRef: t, caption: n, captionVisible: r = !1, stale: a = !1, footer: o, className: s, children: c, ...l }) {
|
|
12
|
+
let u = S(null);
|
|
13
|
+
x(t, () => u.current, []);
|
|
14
|
+
let [d, f] = C(!1);
|
|
15
|
+
y(() => {
|
|
16
|
+
let e = u.current;
|
|
17
|
+
if (!e) return;
|
|
18
|
+
let t = () => f(e.scrollWidth > e.clientWidth);
|
|
19
|
+
t();
|
|
20
|
+
let n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(t);
|
|
21
|
+
return n ? (n.observe(e), e.firstElementChild && n.observe(e.firstElementChild)) : window.addEventListener("resize", t), () => {
|
|
22
|
+
n?.disconnect(), window.removeEventListener("resize", t);
|
|
18
23
|
};
|
|
19
|
-
}, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
}, []);
|
|
25
|
+
let p = b(), g = b(), v = l["aria-label"], T = l["aria-labelledby"] ?? (n == null ? void 0 : g), E = v ? { "aria-label": `${v}, scrollable` } : T ? { "aria-labelledby": `${T} ${p}` } : { "aria-label": "Scrollable table" };
|
|
26
|
+
return /* @__PURE__ */ A("div", {
|
|
27
|
+
className: i,
|
|
28
|
+
"data-stale": a || void 0,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ k("div", {
|
|
31
|
+
className: m,
|
|
32
|
+
"aria-hidden": !0
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ A("div", {
|
|
35
|
+
ref: u,
|
|
36
|
+
className: _,
|
|
37
|
+
...d && {
|
|
38
|
+
tabIndex: 0,
|
|
39
|
+
role: "region",
|
|
40
|
+
...E
|
|
41
|
+
},
|
|
42
|
+
children: [/* @__PURE__ */ A("table", {
|
|
43
|
+
"data-density": e,
|
|
44
|
+
className: w(h, s),
|
|
45
|
+
...l,
|
|
46
|
+
"aria-busy": a || l["aria-busy"] || void 0,
|
|
47
|
+
children: [n != null && /* @__PURE__ */ k("caption", {
|
|
48
|
+
id: g,
|
|
49
|
+
className: r ? "_1t5z8gj5" : "tyvs8e1",
|
|
50
|
+
children: n
|
|
51
|
+
}), c]
|
|
52
|
+
}), d && !v && T && /* @__PURE__ */ k("span", {
|
|
53
|
+
id: p,
|
|
54
|
+
hidden: !0,
|
|
55
|
+
children: "scrollable"
|
|
56
|
+
})]
|
|
57
|
+
}),
|
|
58
|
+
o != null && /* @__PURE__ */ k("div", {
|
|
59
|
+
className: "_1t5z8gj2",
|
|
60
|
+
children: o
|
|
61
|
+
})
|
|
62
|
+
]
|
|
34
63
|
});
|
|
35
64
|
}
|
|
36
|
-
function
|
|
37
|
-
return /* @__PURE__ */
|
|
65
|
+
function M(e) {
|
|
66
|
+
return /* @__PURE__ */ k("thead", { ...e });
|
|
38
67
|
}
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */
|
|
68
|
+
function N(e) {
|
|
69
|
+
return /* @__PURE__ */ k("tbody", { ...e });
|
|
41
70
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
var P = "a, button, input, select, textarea, label, [role=\"button\"], [role=\"checkbox\"]", F = (e) => {
|
|
72
|
+
let t = e.target;
|
|
73
|
+
return !e.defaultPrevented && e.currentTarget.contains(t) && !t.closest(P) && !window.getSelection()?.toString();
|
|
74
|
+
};
|
|
75
|
+
function I({ clickable: e, onClick: t, className: n, ...r }) {
|
|
76
|
+
let i = e ?? t !== void 0;
|
|
77
|
+
return /* @__PURE__ */ k("tr", {
|
|
78
|
+
className: w(c, i && "_1t5z8gjm", n),
|
|
79
|
+
onClick: i && t ? (e) => {
|
|
80
|
+
F(e) && t(e);
|
|
81
|
+
} : t,
|
|
82
|
+
...r
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function L({ colSpan: e, className: t, children: n, ...r }) {
|
|
86
|
+
return /* @__PURE__ */ k("tr", {
|
|
87
|
+
className: t,
|
|
88
|
+
...r,
|
|
89
|
+
children: /* @__PURE__ */ k("th", {
|
|
90
|
+
scope: "rowgroup",
|
|
91
|
+
colSpan: e,
|
|
92
|
+
className: a,
|
|
93
|
+
children: n
|
|
94
|
+
})
|
|
46
95
|
});
|
|
47
96
|
}
|
|
48
|
-
function
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
className:
|
|
97
|
+
function R({ align: e = "left", className: t, ...i }) {
|
|
98
|
+
return /* @__PURE__ */ k("td", {
|
|
99
|
+
className: w(r, n[e], t),
|
|
51
100
|
...i
|
|
52
101
|
});
|
|
53
102
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
103
|
+
var z = {
|
|
104
|
+
asc: "ascending",
|
|
105
|
+
desc: "descending"
|
|
106
|
+
};
|
|
107
|
+
function B({ align: e = "left", scope: t = "col", sort: r = !1, onSort: i, className: a, children: s, ...c }) {
|
|
108
|
+
let l = r === "asc" ? E : r === "desc" ? T : D;
|
|
109
|
+
return /* @__PURE__ */ k("th", {
|
|
110
|
+
scope: t,
|
|
111
|
+
"aria-sort": r ? z[r] : void 0,
|
|
112
|
+
className: w(o, n[e], a),
|
|
113
|
+
...c,
|
|
114
|
+
children: i ? /* @__PURE__ */ A("button", {
|
|
115
|
+
type: "button",
|
|
116
|
+
className: d,
|
|
117
|
+
onClick: i,
|
|
118
|
+
children: [s, /* @__PURE__ */ k(l, {
|
|
119
|
+
size: "1.15em",
|
|
120
|
+
"aria-hidden": !0,
|
|
121
|
+
className: r ? f : p
|
|
122
|
+
})]
|
|
123
|
+
}) : s
|
|
59
124
|
});
|
|
60
125
|
}
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
className:
|
|
64
|
-
...
|
|
126
|
+
function V({ mono: e = !0, className: t, ...n }) {
|
|
127
|
+
return /* @__PURE__ */ k("span", {
|
|
128
|
+
className: w(u, e && "_1t5z8gjk", t),
|
|
129
|
+
...n
|
|
65
130
|
});
|
|
66
131
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
132
|
+
function H({ onLoadMore: t, hasMore: n = !0, label: r = "Load more", loadingLabel: i = "Loading more", variant: a = "secondary", size: o = "sm", className: c, ...l }) {
|
|
133
|
+
return n ? /* @__PURE__ */ k(e, {
|
|
134
|
+
variant: a,
|
|
135
|
+
size: o,
|
|
136
|
+
loadingLabel: i,
|
|
137
|
+
className: w(s, c),
|
|
138
|
+
onClick: t,
|
|
139
|
+
...l,
|
|
140
|
+
children: r
|
|
141
|
+
}) : null;
|
|
142
|
+
}
|
|
143
|
+
function U({ render: e, ...t }) {
|
|
144
|
+
return O({
|
|
145
|
+
defaultTagName: "a",
|
|
146
|
+
render: e,
|
|
147
|
+
props: t
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
var W = [
|
|
71
151
|
0,
|
|
72
152
|
1,
|
|
73
153
|
2,
|
|
74
154
|
3,
|
|
75
155
|
4
|
|
76
|
-
];
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
|
|
156
|
+
], G = "20rem";
|
|
157
|
+
function K({ columns: e, rows: n, getRowKey: r, loading: i = !1, empty: a = "No results", onRowClick: o, getRowHref: s, rowLinkRender: c, primaryColumn: u, getRowProps: d, sort: f, defaultSort: p, onSortChange: m, groupBy: h, renderGroup: _, ...y }) {
|
|
158
|
+
let [b, x] = C(p), S = f ?? b, T = i && n.length === 0, E = u ?? e[0]?.key, D = !!(s || c), O = D || !!o, P = (e) => {
|
|
159
|
+
let t = {
|
|
160
|
+
key: e,
|
|
161
|
+
direction: S?.key === e && S.direction === "desc" ? "asc" : "desc"
|
|
162
|
+
};
|
|
163
|
+
f === void 0 && x(t), m?.(t);
|
|
164
|
+
}, z = S && e.find((e) => e.key === S.key)?.compare, V = z && S ? [...n].sort((e, t) => S.direction === "asc" ? z(e, t) : z(t, e)) : n, H = /* @__PURE__ */ new Map();
|
|
165
|
+
if (h) for (let e of V) {
|
|
166
|
+
let t = h(e), n = H.get(t);
|
|
167
|
+
n ? n.push(e) : H.set(t, [e]);
|
|
168
|
+
}
|
|
169
|
+
let K = (e, t) => {
|
|
170
|
+
let n = e.render ? e.render(t) : t[e.key] ?? null;
|
|
171
|
+
return e.truncate && (n = /* @__PURE__ */ k("span", {
|
|
172
|
+
className: g,
|
|
173
|
+
style: { maxWidth: e.truncate === !0 ? G : e.truncate },
|
|
174
|
+
title: typeof n == "string" || typeof n == "number" ? String(n) : void 0,
|
|
175
|
+
children: n
|
|
176
|
+
})), O && e.key === E && (n = D ? /* @__PURE__ */ k(U, {
|
|
177
|
+
"data-row-action": "",
|
|
178
|
+
...s && { href: s(t) },
|
|
179
|
+
render: c?.(t),
|
|
180
|
+
className: l,
|
|
181
|
+
onClick: () => o?.(t),
|
|
182
|
+
children: n
|
|
183
|
+
}) : /* @__PURE__ */ k("button", {
|
|
184
|
+
type: "button",
|
|
185
|
+
"data-row-action": "",
|
|
186
|
+
className: l,
|
|
187
|
+
onClick: () => o?.(t),
|
|
188
|
+
children: n
|
|
189
|
+
})), /* @__PURE__ */ A(R, {
|
|
190
|
+
align: e.align,
|
|
191
|
+
children: [n, e.extra?.(t)]
|
|
192
|
+
}, e.key);
|
|
193
|
+
}, q = (t) => {
|
|
194
|
+
let n = d?.(t);
|
|
195
|
+
return /* @__PURE__ */ v(I, {
|
|
196
|
+
...n,
|
|
197
|
+
key: r(t),
|
|
198
|
+
clickable: !1,
|
|
199
|
+
className: w(O && "_1t5z8gjm", n?.className),
|
|
200
|
+
onClick: (e) => {
|
|
201
|
+
n?.onClick?.(e), O && F(e) && e.currentTarget.querySelector("[data-row-action]")?.click();
|
|
202
|
+
}
|
|
203
|
+
}, e.map((e) => K(e, t)));
|
|
204
|
+
};
|
|
205
|
+
return /* @__PURE__ */ A(j, {
|
|
80
206
|
"aria-busy": i || void 0,
|
|
81
|
-
...
|
|
82
|
-
children: [/* @__PURE__ */
|
|
207
|
+
...y,
|
|
208
|
+
children: [/* @__PURE__ */ k(M, { children: /* @__PURE__ */ k(I, { children: e.map((e) => /* @__PURE__ */ k(B, {
|
|
83
209
|
align: e.align,
|
|
84
210
|
style: { width: e.width },
|
|
211
|
+
sort: S?.key === e.key && S.direction,
|
|
212
|
+
onSort: e.sortable ? () => P(e.key) : void 0,
|
|
85
213
|
children: e.header
|
|
86
|
-
}, e.key)) }) }), /* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
214
|
+
}, e.key)) }) }), h && V.length > 0 ? [...H].map(([t, n]) => /* @__PURE__ */ A(N, { children: [/* @__PURE__ */ k(L, {
|
|
215
|
+
colSpan: e.length,
|
|
216
|
+
children: _ ? _(t, n) : String(t)
|
|
217
|
+
}), n.map(q)] }, t)) : /* @__PURE__ */ A(N, { children: [
|
|
218
|
+
T && W.map((n) => /* @__PURE__ */ k(I, { children: e.map((e, n) => /* @__PURE__ */ k(R, {
|
|
219
|
+
align: e.align,
|
|
220
|
+
children: /* @__PURE__ */ k(t, {
|
|
90
221
|
variant: "text",
|
|
91
222
|
width: n === 0 ? "70%" : "50%",
|
|
92
|
-
style:
|
|
223
|
+
style: e.align === "right" ? { marginLeft: "auto" } : void 0
|
|
93
224
|
})
|
|
94
|
-
},
|
|
95
|
-
!i && n.length === 0 && /* @__PURE__ */
|
|
96
|
-
colSpan:
|
|
97
|
-
className: "
|
|
98
|
-
children:
|
|
225
|
+
}, e.key)) }, n)),
|
|
226
|
+
!i && n.length === 0 && /* @__PURE__ */ k(I, { children: /* @__PURE__ */ k(R, {
|
|
227
|
+
colSpan: e.length,
|
|
228
|
+
className: "_1t5z8gjl",
|
|
229
|
+
children: a
|
|
99
230
|
}) }),
|
|
100
|
-
|
|
101
|
-
let n = u?.(e);
|
|
102
|
-
return /* @__PURE__ */ l(y, {
|
|
103
|
-
...n,
|
|
104
|
-
key: r(e),
|
|
105
|
-
className: f(s && "_1t5z8gja", n?.className),
|
|
106
|
-
onClick: (t) => {
|
|
107
|
-
n?.onClick?.(t), s && w(t) && s(e);
|
|
108
|
-
}
|
|
109
|
-
}, t.map((t) => {
|
|
110
|
-
let n = t.render ? t.render(e) : e[t.key] ?? null;
|
|
111
|
-
return /* @__PURE__ */ p(b, {
|
|
112
|
-
align: t.align,
|
|
113
|
-
children: s && t.key === S ? /* @__PURE__ */ p("button", {
|
|
114
|
-
type: "button",
|
|
115
|
-
className: a,
|
|
116
|
-
onClick: () => s(e),
|
|
117
|
-
children: n
|
|
118
|
-
}) : n
|
|
119
|
-
}, t.key);
|
|
120
|
-
}));
|
|
121
|
-
})
|
|
231
|
+
V.map(q)
|
|
122
232
|
] })]
|
|
123
233
|
});
|
|
124
234
|
}
|
|
125
|
-
var
|
|
126
|
-
Root:
|
|
127
|
-
Head:
|
|
128
|
-
Body:
|
|
129
|
-
Row:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
235
|
+
var q = Object.assign(K, {
|
|
236
|
+
Root: j,
|
|
237
|
+
Head: M,
|
|
238
|
+
Body: N,
|
|
239
|
+
Row: I,
|
|
240
|
+
GroupRow: L,
|
|
241
|
+
Cell: R,
|
|
242
|
+
HeaderCell: B,
|
|
243
|
+
Secondary: V,
|
|
244
|
+
LoadMore: H
|
|
133
245
|
});
|
|
134
|
-
export {
|
|
246
|
+
export { q as Table };
|
|
135
247
|
|
|
136
248
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","names":["styles.wrapper","styles.table","styles.row","styles.cell","styles.align","align","styles.headerCell","styles.secondary","empty","styles.rowAction","setRef","ref","value","Root","props","overflows","setOverflows","useState","measure","useCallback","scrollRef","node","check","observer","wrapper","density","clsx","table","className","Head","Body","Row","row","Cell","align$1","cell","align","HeaderCell","align$2","headerCell","Secondary","secondary","INTERACTIVE","isRowClick","target","event","LOADING_ROWS","TableComponent","empty$1","showSkeleton","loading","rows","actionColumn","primaryColumn","columns","col","Skeleton","c","i","rowProps","getRowProps","getRowKey","onRowClick","content","rowAction","Table"],"sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport {\n useCallback,\n useState,\n type ComponentProps,\n type CSSProperties,\n type Key,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from 'react'\n\nimport type { DataAttributes } from '../Field/Field'\nimport { Skeleton } from '../Skeleton'\nimport * as styles from './Table.css'\n\ntype Align = 'left' | 'center' | 'right'\n\nfunction setRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === 'function') ref(value)\n else if (ref) ref.current = value\n}\n\nexport interface TableRootProps extends ComponentProps<'table'> {\n density?: 'default' | 'compact'\n /** Ref to the card-framed `<div>` that scrolls the table sideways, e.g. for scroll hints. */\n scrollRef?: Ref<HTMLDivElement>\n}\n\n/** The card-framed `<table>` inside a horizontally scrolling `<div>` (see `scrollRef`). Other props go to the `<table>`. */\nfunction Root({ density = 'default', scrollRef, className, ...props }: TableRootProps) {\n // When the table overflows, the scroll box becomes a named, focusable region so keyboard users\n // can scroll it. Tables that fit get no extra tab stop.\n const [overflows, setOverflows] = useState(false)\n const measure = useCallback(\n (node: HTMLDivElement | null) => {\n setRef(scrollRef, node)\n if (!node) return undefined\n const check = () => setOverflows(node.scrollWidth > node.clientWidth)\n check()\n // Missing in jsdom (app unit tests); the table still renders, just without the overflow check.\n if (typeof ResizeObserver === 'undefined') return () => setRef(scrollRef, null)\n const observer = new ResizeObserver(check)\n observer.observe(node)\n if (node.firstElementChild) observer.observe(node.firstElementChild)\n return () => {\n observer.disconnect()\n setRef(scrollRef, null)\n }\n },\n [scrollRef],\n )\n return (\n <div\n ref={measure}\n className={styles.wrapper}\n {...(overflows && {\n tabIndex: 0,\n role: 'region',\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-label'] ? undefined : props['aria-labelledby'],\n })}\n >\n <table data-density={density} className={clsx(styles.table, className)} {...props} />\n </div>\n )\n}\n\nfunction Head(props: ComponentProps<'thead'>) {\n return <thead {...props} />\n}\n\nfunction Body(props: ComponentProps<'tbody'>) {\n return <tbody {...props} />\n}\n\nfunction Row({ className, ...props }: ComponentProps<'tr'>) {\n return <tr className={clsx(styles.row, className)} {...props} />\n}\n\nexport interface TableCellProps extends ComponentProps<'td'> {\n align?: Align\n}\n\nfunction Cell({ align = 'left', className, ...props }: TableCellProps) {\n return <td className={clsx(styles.cell, styles.align[align], className)} {...props} />\n}\n\nexport interface TableHeaderCellProps extends ComponentProps<'th'> {\n align?: Align\n}\n\nfunction HeaderCell({ align = 'left', scope = 'col', className, ...props }: TableHeaderCellProps) {\n return (\n <th\n scope={scope}\n className={clsx(styles.headerCell, styles.align[align], className)}\n {...props}\n />\n )\n}\n\n/** A muted mono line under a cell's main value, e.g. a run ID. */\nfunction Secondary({ className, ...props }: ComponentProps<'span'>) {\n return <span className={clsx(styles.secondary, className)} {...props} />\n}\n\nexport interface TableColumn<Row> {\n key: string\n header: ReactNode\n align?: Align\n width?: CSSProperties['width']\n /** Defaults to `row[key]`. */\n render?: (row: Row) => ReactNode\n}\n\nexport interface TableProps<Row> extends Omit<TableRootProps, 'children'> {\n columns: TableColumn<Row>[]\n rows: Row[]\n getRowKey: (row: Row) => Key\n /** Shows skeleton rows while there are no rows yet. Existing rows stay during a refetch. */\n loading?: boolean\n /** Shown when there are no rows. */\n empty?: ReactNode\n /**\n * Makes each row clickable. The primary column's cell becomes a button (so keyboard and screen\n * reader users reach it with Tab and press Enter or Space), and a click anywhere else on the row\n * clicks it too. Clicks on other buttons, links or inputs in the row are left alone. Don't put\n * interactive content in the primary column.\n */\n onRowClick?: (row: Row) => void\n /** `key` of the column that holds the row's button. Defaults to the first column. */\n primaryColumn?: string\n /** Props for each row's `<tr>`, e.g. `(row) => ({ 'data-testid': `run-${row.id}` })`. */\n getRowProps?: (row: Row) => ComponentProps<'tr'> & DataAttributes\n}\n\n// Clicks on these inside a row do their own thing.\nconst INTERACTIVE = 'a, button, input, select, textarea, label, [role=\"button\"], [role=\"checkbox\"]'\n\nconst isRowClick = (event: MouseEvent<HTMLTableRowElement>) => {\n const target = event.target as Element\n return (\n !event.defaultPrevented &&\n // Not from a portal (e.g. a Menu opened from a cell) or another control.\n event.currentTarget.contains(target) &&\n !target.closest(INTERACTIVE) &&\n // Not the end of a text selection.\n !window.getSelection()?.toString()\n )\n}\n\nconst LOADING_ROWS = [0, 1, 2, 3, 4]\n\nfunction TableComponent<Row>({\n columns,\n rows,\n getRowKey,\n loading = false,\n empty = 'No results',\n onRowClick,\n primaryColumn,\n getRowProps,\n ...props\n}: TableProps<Row>) {\n const showSkeleton = loading && rows.length === 0\n const actionColumn = primaryColumn ?? columns[0]?.key\n return (\n <Root aria-busy={loading || undefined} {...props}>\n <Head>\n <Row>\n {columns.map((col) => (\n <HeaderCell key={col.key} align={col.align} style={{ width: col.width }}>\n {col.header}\n </HeaderCell>\n ))}\n </Row>\n </Head>\n <Body>\n {showSkeleton &&\n LOADING_ROWS.map((i) => (\n <Row key={i}>\n {columns.map((col, c) => (\n <Cell key={col.key} align={col.align}>\n <Skeleton\n variant=\"text\"\n width={c === 0 ? '70%' : '50%'}\n style={col.align === 'right' ? { marginLeft: 'auto' } : undefined}\n />\n </Cell>\n ))}\n </Row>\n ))}\n {!loading && rows.length === 0 && (\n <Row>\n <Cell colSpan={columns.length} className={styles.empty}>\n {empty}\n </Cell>\n </Row>\n )}\n {rows.map((row) => {\n const rowProps = getRowProps?.(row)\n return (\n <Row\n {...rowProps}\n key={getRowKey(row)}\n className={clsx(onRowClick && styles.clickableRow, rowProps?.className)}\n onClick={(event) => {\n rowProps?.onClick?.(event)\n if (onRowClick && isRowClick(event)) onRowClick(row)\n }}\n >\n {columns.map((col) => {\n const content = col.render\n ? col.render(row)\n : ((row as Record<string, ReactNode>)[col.key] ?? null)\n return (\n <Cell key={col.key} align={col.align}>\n {onRowClick && col.key === actionColumn ? (\n <button\n type=\"button\"\n className={styles.rowAction}\n onClick={() => onRowClick(row)}\n >\n {content}\n </button>\n ) : (\n content\n )}\n </Cell>\n )\n })}\n </Row>\n )\n })}\n </Body>\n </Root>\n )\n}\n\n/**\n * A data table. Pass `columns` and `rows`, or compose `Table.Root`, `Table.Head`, `Table.Body`,\n * `Table.Row`, `Table.HeaderCell` and `Table.Cell` for custom layouts.\n */\nexport const Table = Object.assign(TableComponent, {\n Root,\n Head,\n Body,\n Row,\n Cell,\n HeaderCell,\n Secondary,\n})\n"],"mappings":";;;;;;AAkBA,SAASU,EAAU,GAAyB,GAAiB;CAC3D,AAAI,OAAOC,KAAQ,aAAYA,EAAIC,CAAK,IAC/BD,MAAK,EAAI,UAAUC;AAC9B;AASA,SAASC,EAAK,EAAE,aAAU,WAAW,cAAW,cAAW,GAAGC,KAAyB;CAGrF,IAAM,CAACC,GAAWC,KAAgBC,EAAS,EAAK,GAC1CC,IAAUC,GACb,MAAgC;EAE/B,IADAT,EAAOU,GAAWC,CAAI,GAClB,CAACA,GAAM;EACX,IAAMC,UAAcN,EAAaK,EAAK,cAAcA,EAAK,WAAW;EAGpE,IAFAC,EAAM,GAEF,OAAO,iBAAmB,KAAa,aAAaZ,EAAOU,GAAW,IAAI;EAC9E,IAAMG,IAAW,IAAI,eAAeD,CAAK;EAGzC,OAFAC,EAAS,QAAQF,CAAI,GACjBA,EAAK,qBAAmBE,EAAS,QAAQF,EAAK,iBAAiB,SACtD;GAEX,AADAE,EAAS,WAAW,GACpBb,EAAOU,GAAW,IAAI;EACxB;CACF,GACA,CAACA,CAAS,CACZ;CACA,OACE,kBAAC,OAAD;EACE,KA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,GAAU,SAAS;KACtE,UAAU,MAAU;MAElB,AADAA,GAAU,UAAUd,CAAK,GACrBiB,KAAcnB,EAAWE,CAAK,KAAGiB,EAAW9B,CAAG;KACrD;IAsBG,GApBFsB,EAAQ,KAAK,MAAQ;KACpB,IAAMS,IAAUR,EAAI,SAChBA,EAAI,OAAOvB,CAAG,IACZA,EAAkCuB,EAAI,QAAQ;KACpD,OACE,kBAACtB,GAAD;MAAoB,OAAOsB,EAAI;MAC5B,UAAAO,KAAcP,EAAI,QAAQH,IACzB,kBAAC,UAAD;OACE,MAAK;OACL,WAAW3C;OACX,eAAeqD,EAAW9B,CAAG;OAE5B,UAAA+B;MACK,CAAA,IAERA;KAEE,GAZKR,EAAI,GAYT;IAEV,CAAC,CACE;GAET,CAAC;EACG,EAAA,CAAA,CACF;;AAEV;AAMA,IAAaU,IAAQ,OAAO,OAAOlB,GAAgB;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Table.js","names":["caption","styles.frame","styles.staleBar","styles.wrapper","styles.table","footer","styles.row","styles.groupCell","styles.cell","styles.align","align","styles.headerCell","styles.sortButton","styles.sortIcon","styles.sortIconIdle","styles.secondary","mono","styles.loadMore","styles.truncate","styles.rowAction","empty","Root","caption$1","footer$1","props","scrollBox","useRef","scrollRef","overflows","setOverflows","useState","node","check","observer","hintId","useId","captionId","label","labelledBy","regionName","frame","stale","staleBar","wrapper","density","clsx","table","className","captionVisible","children","Head","Body","INTERACTIVE","isRowClick","target","event","Row","isClickable","clickable","onClick","row","GroupRow","groupCell","Cell","align$2","cell","align","ARIA_SORT","HeaderCell","align$1","Icon","sort","ArrowUp","ArrowDown","ChevronsUpDown","headerCell","onSort","sortButton","sortIcon","sortIconIdle","Secondary","mono$1","secondary","LoadMore","hasMore","Button","loadMore","onLoadMore","RowLink","useRender","LOADING_ROWS","DEFAULT_TRUNCATE","TableComponent","empty$1","sortProp","sortState","setSortState","defaultSort","showSkeleton","loading","rows","actionColumn","primaryColumn","columns","isLink","getRowHref","rowLinkRender","onRowClick","handleSort","next","key","onSortChange","compare","col","sorted","a","b","groups","groupBy","group","renderCell","content","truncate","rowAction","renderRow","rowProps","getRowProps","getRowKey","groupRows","renderGroup","Skeleton","c","i","Table"],"sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport { ArrowDown, ArrowUp, ChevronsUpDown } from 'lucide-react'\nimport {\n useEffect,\n useId,\n useImperativeHandle,\n useRef,\n useState,\n type ComponentProps,\n type CSSProperties,\n type Key,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\n\nimport { visuallyHidden } from '../../styles/shared.css'\nimport { Button, type ButtonProps } from '../Button'\nimport type { DataAttributes } from '../Field/Field'\nimport { Skeleton } from '../Skeleton'\nimport * as styles from './Table.css'\n\ntype Align = 'left' | 'center' | 'right'\n\nexport type SortDirection = 'asc' | 'desc'\n\n/** The sorted column and its direction. */\nexport interface SortState {\n key: string\n direction: SortDirection\n}\n\nexport interface TableRootProps extends ComponentProps<'table'> {\n /** `compact` tightens cell padding for dense data. */\n density?: 'default' | 'compact'\n /** Ref to the `<div>` that scrolls the table sideways, e.g. for scroll hints. */\n scrollRef?: Ref<HTMLDivElement>\n /** The table's `<caption>`, which names it. Visually hidden unless `captionVisible`. */\n caption?: ReactNode\n /** Shows the caption above the table. */\n captionVisible?: boolean\n /**\n * Rows are out of date, e.g. while new filters load. The table is `aria-busy`, and after 300ms\n * (so quick loads don't flicker) a progress bar slides along its top edge.\n */\n stale?: boolean\n /** Shown under the table, inside the frame, e.g. `Table.LoadMore` or `Pagination`. Doesn't scroll sideways. */\n footer?: ReactNode\n}\n\n/**\n * The card-framed `<table>` inside a horizontally scrolling `<div>` (see `scrollRef`). Other props\n * go to the `<table>`. Inside a `Card`, the card is the frame.\n */\nfunction Root({\n density = 'default',\n scrollRef,\n caption,\n captionVisible = false,\n stale = false,\n footer,\n className,\n children,\n ...props\n}: TableRootProps) {\n const scrollBox = useRef<HTMLDivElement>(null)\n useImperativeHandle(scrollRef, () => scrollBox.current as HTMLDivElement, [])\n\n // When the table overflows, the scroll box becomes a named, focusable region so keyboard users\n // can scroll it. Tables that fit get no extra tab stop.\n const [overflows, setOverflows] = useState(false)\n useEffect(() => {\n const node = scrollBox.current\n if (!node) return\n const check = () => setOverflows(node.scrollWidth > node.clientWidth)\n check()\n // ResizeObserver also catches rows and columns changing. Without it (jsdom), re-check on resize.\n const observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(check)\n if (observer) {\n observer.observe(node)\n if (node.firstElementChild) observer.observe(node.firstElementChild)\n } else {\n window.addEventListener('resize', check)\n }\n return () => {\n observer?.disconnect()\n window.removeEventListener('resize', check)\n }\n }, [])\n\n // The region is named \"<table name>, scrollable\" so it isn't read as a second copy of the table.\n const hintId = useId()\n const captionId = useId()\n const label = props['aria-label']\n const labelledBy = props['aria-labelledby'] ?? (caption != null ? captionId : undefined)\n const regionName = label\n ? { 'aria-label': `${label}, scrollable` }\n : labelledBy\n ? { 'aria-labelledby': `${labelledBy} ${hintId}` }\n : { 'aria-label': 'Scrollable table' }\n\n return (\n <div className={styles.frame} data-stale={stale || undefined}>\n <div className={styles.staleBar} aria-hidden />\n <div\n ref={scrollBox}\n className={styles.wrapper}\n {...(overflows && { tabIndex: 0, role: 'region', ...regionName })}\n >\n <table\n data-density={density}\n className={clsx(styles.table, className)}\n {...props}\n aria-busy={stale || props['aria-busy'] || undefined}\n >\n {caption != null && (\n <caption id={captionId} className={captionVisible ? styles.caption : visuallyHidden}>\n {caption}\n </caption>\n )}\n {children}\n </table>\n {overflows && !label && labelledBy && (\n <span id={hintId} hidden>\n scrollable\n </span>\n )}\n </div>\n {footer != null && <div className={styles.footer}>{footer}</div>}\n </div>\n )\n}\n\nfunction Head(props: ComponentProps<'thead'>) {\n return <thead {...props} />\n}\n\nfunction Body(props: ComponentProps<'tbody'>) {\n return <tbody {...props} />\n}\n\n// Clicks on these inside a row do their own thing.\nconst INTERACTIVE = 'a, button, input, select, textarea, label, [role=\"button\"], [role=\"checkbox\"]'\n\nconst isRowClick = (event: MouseEvent<HTMLTableRowElement>) => {\n const target = event.target as Element\n return (\n !event.defaultPrevented &&\n // Not from a portal (e.g. a Menu opened from a cell) or another control.\n event.currentTarget.contains(target) &&\n !target.closest(INTERACTIVE) &&\n // Not the end of a text selection.\n !window.getSelection()?.toString()\n )\n}\n\nexport interface TableRowProps extends ComponentProps<'tr'> {\n /**\n * Hover and pointer styles, and `onClick` only fires for clicks on the row itself: not on links,\n * buttons or inputs in it, text selections or portalled popups. Defaults to `true` when `onClick`\n * is set. Keyboard users can't click a row, so also give it a link or button.\n */\n clickable?: boolean\n}\n\nfunction Row({ clickable, onClick, className, ...props }: TableRowProps) {\n const isClickable = clickable ?? onClick !== undefined\n return (\n <tr\n className={clsx(styles.row, isClickable && styles.clickableRow, className)}\n onClick={\n isClickable && onClick\n ? (event) => {\n if (isRowClick(event)) onClick(event)\n }\n : onClick\n }\n {...props}\n />\n )\n}\n\n/** A full-width group heading. Put each group in its own `Table.Body`, starting with this row. */\nexport interface TableGroupRowProps extends ComponentProps<'tr'> {\n /** The number of columns, so the heading spans them all. */\n colSpan: number\n}\n\nfunction GroupRow({ colSpan, className, children, ...props }: TableGroupRowProps) {\n return (\n <tr className={className} {...props}>\n <th scope=\"rowgroup\" colSpan={colSpan} className={styles.groupCell}>\n {children}\n </th>\n </tr>\n )\n}\n\nexport interface TableCellProps extends ComponentProps<'td'> {\n /** Text alignment. Use `right` for numbers (they get tabular figures). */\n align?: Align\n}\n\nfunction Cell({ align = 'left', className, ...props }: TableCellProps) {\n return <td className={clsx(styles.cell, styles.align[align], className)} {...props} />\n}\n\nexport interface TableHeaderCellProps extends ComponentProps<'th'> {\n /** Match the column's cells. `scope` defaults to `col`; use `scope=\"row\"` for row headers. */\n align?: Align\n /** The column's current sort, or `false` when another column is sorted. Sets `aria-sort`. */\n sort?: SortDirection | false\n /** Makes the header a sort button. */\n onSort?: () => void\n}\n\nconst ARIA_SORT = { asc: 'ascending', desc: 'descending' } as const\n\nfunction HeaderCell({\n align = 'left',\n scope = 'col',\n sort = false,\n onSort,\n className,\n children,\n ...props\n}: TableHeaderCellProps) {\n const Icon = sort === 'asc' ? ArrowUp : sort === 'desc' ? ArrowDown : ChevronsUpDown\n return (\n <th\n scope={scope}\n aria-sort={sort ? ARIA_SORT[sort] : undefined}\n className={clsx(styles.headerCell, styles.align[align], className)}\n {...props}\n >\n {onSort ? (\n <button type=\"button\" className={styles.sortButton} onClick={onSort}>\n {children}\n <Icon\n size=\"1.15em\"\n aria-hidden\n className={sort ? styles.sortIcon : styles.sortIconIdle}\n />\n </button>\n ) : (\n children\n )}\n </th>\n )\n}\n\nexport interface TableSecondaryProps extends ComponentProps<'span'> {\n /** Monospace, for IDs and codes. Set `false` for plain text. */\n mono?: boolean\n}\n\n/** A muted line under a cell's main value, e.g. a run ID. */\nfunction Secondary({ mono = true, className, ...props }: TableSecondaryProps) {\n return <span className={clsx(styles.secondary, mono && styles.mono, className)} {...props} />\n}\n\nexport interface TableLoadMoreProps extends Omit<ButtonProps, 'onClick' | 'children'> {\n /** Loads the next page, e.g. from a cursor. */\n onLoadMore: () => void\n /** While `false`, nothing renders. */\n hasMore?: boolean\n /** Button text. */\n label?: ReactNode\n}\n\n/** A \"Load more\" button for cursor paging. Put it in `footer`. Use `Pagination` for page numbers. */\nfunction LoadMore({\n onLoadMore,\n hasMore = true,\n label = 'Load more',\n loadingLabel = 'Loading more',\n variant = 'secondary',\n size = 'sm',\n className,\n ...props\n}: TableLoadMoreProps) {\n if (!hasMore) return null\n return (\n <Button\n variant={variant}\n size={size}\n loadingLabel={loadingLabel}\n className={clsx(styles.loadMore, className)}\n onClick={onLoadMore}\n {...props}\n >\n {label}\n </Button>\n )\n}\n\nexport interface TableColumn<Row> {\n /** Unique column ID. Also the row field shown when there's no `render`. */\n key: string\n /** Column header content. */\n header: ReactNode\n /** Text alignment. Use `right` for numbers. */\n align?: Align\n /** Column width, e.g. `1` to shrink an actions column to fit. */\n width?: CSSProperties['width']\n /** Defaults to `row[key]`. */\n render?: (row: Row) => ReactNode\n /**\n * Shown after the cell's content and outside the row's link or button, so it isn't part of its\n * accessible name, e.g. tags beside a name.\n */\n extra?: (row: Row) => ReactNode\n /** Makes the header a sort button (see `sort`). */\n sortable?: boolean\n /** Ascending order for client-side sorting. Without it, rows show in the order given (the server sorts). */\n compare?: (a: Row, b: Row) => number\n /** One line with an ellipsis. A string sets the max width, e.g. `'16rem'` (default `20rem`). */\n truncate?: boolean | string\n}\n\nexport interface TableProps<Row> extends Omit<TableRootProps, 'children'> {\n /** Column definitions, left to right. */\n columns: TableColumn<Row>[]\n /** The data, one row each. */\n rows: Row[]\n /** A stable, unique key for each row, e.g. `(row) => row.id`. */\n getRowKey: (row: Row) => Key\n /** Shows skeleton rows while there are no rows yet. Existing rows stay during a refetch. */\n loading?: boolean\n /** Shown when there are no rows, across all columns. Can be a block such as an empty state. */\n empty?: ReactNode\n /**\n * Makes each row clickable. The primary column's cell becomes a button (so keyboard and screen\n * reader users reach it with Tab and press Enter or Space), and a click anywhere else on the row\n * clicks it too. Clicks on other buttons, links or inputs in the row are left alone. Don't put\n * interactive content in the primary column; use the column's `extra` for tags and the like.\n */\n onRowClick?: (row: Row) => void\n /**\n * Makes each row a link: the primary column's content becomes an `<a href>` (so middle-click\n * and \"open in new tab\" work), and a click anywhere else on the row follows it. `onRowClick`,\n * if set, is also called.\n */\n getRowHref?: (row: Row) => string\n /** A router link per row instead of `getRowHref`, e.g. `(run) => <Link to={`/runs/${run.id}`} />`. */\n rowLinkRender?: (row: Row) => ReactElement\n /** `key` of the column that holds the row's button or link. Defaults to the first column. */\n primaryColumn?: string\n /** Props for each row's `<tr>`, e.g. `(row) => ({ 'data-testid': `run-${row.id}` })`. */\n getRowProps?: (row: Row) => ComponentProps<'tr'> & DataAttributes\n /** Sorted column (controlled). */\n sort?: SortState\n /** Initially sorted column (uncontrolled). */\n defaultSort?: SortState\n /**\n * Called when a sortable header is clicked. A new column sorts descending first; clicking the\n * sorted column flips its direction. Without the column's `compare`, sort the rows yourself.\n */\n onSortChange?: (sort: SortState) => void\n /** Groups rows under full-width headings. Groups appear in first-seen order. */\n groupBy?: (row: Row) => Key\n /** The group heading. Defaults to the key. */\n renderGroup?: (key: Key, rows: Row[]) => ReactNode\n}\n\nfunction RowLink({ render, ...props }: ComponentProps<'a'> & { render?: ReactElement }) {\n return useRender({ defaultTagName: 'a', render, props })\n}\n\nconst LOADING_ROWS = [0, 1, 2, 3, 4]\nconst DEFAULT_TRUNCATE = '20rem'\n\nfunction TableComponent<Row>({\n columns,\n rows,\n getRowKey,\n loading = false,\n empty = 'No results',\n onRowClick,\n getRowHref,\n rowLinkRender,\n primaryColumn,\n getRowProps,\n sort: sortProp,\n defaultSort,\n onSortChange,\n groupBy,\n renderGroup,\n ...props\n}: TableProps<Row>) {\n const [sortState, setSortState] = useState(defaultSort)\n const sort = sortProp ?? sortState\n const showSkeleton = loading && rows.length === 0\n const actionColumn = primaryColumn ?? columns[0]?.key\n const isLink = !!(getRowHref || rowLinkRender)\n const clickable = isLink || !!onRowClick\n\n const handleSort = (key: string) => {\n const next: SortState = {\n key,\n direction: sort?.key === key && sort.direction === 'desc' ? 'asc' : 'desc',\n }\n if (sortProp === undefined) setSortState(next)\n onSortChange?.(next)\n }\n\n const compare = sort && columns.find((col) => col.key === sort.key)?.compare\n const sorted =\n compare && sort\n ? [...rows].sort((a, b) => (sort.direction === 'asc' ? compare(a, b) : compare(b, a)))\n : rows\n\n const groups = new Map<Key, Row[]>()\n if (groupBy) {\n for (const row of sorted) {\n const key = groupBy(row)\n const group = groups.get(key)\n if (group) group.push(row)\n else groups.set(key, [row])\n }\n }\n\n const renderCell = (col: TableColumn<Row>, row: Row) => {\n let content = col.render\n ? col.render(row)\n : ((row as Record<string, ReactNode>)[col.key] ?? null)\n if (col.truncate) {\n content = (\n <span\n className={styles.truncate}\n style={{ maxWidth: col.truncate === true ? DEFAULT_TRUNCATE : col.truncate }}\n title={\n typeof content === 'string' || typeof content === 'number' ? String(content) : undefined\n }\n >\n {content}\n </span>\n )\n }\n if (clickable && col.key === actionColumn) {\n content = isLink ? (\n <RowLink\n data-row-action=\"\"\n {...(getRowHref && { href: getRowHref(row) })}\n render={rowLinkRender?.(row)}\n className={styles.rowAction}\n onClick={() => onRowClick?.(row)}\n >\n {content}\n </RowLink>\n ) : (\n <button\n type=\"button\"\n data-row-action=\"\"\n className={styles.rowAction}\n onClick={() => onRowClick?.(row)}\n >\n {content}\n </button>\n )\n }\n return (\n <Cell key={col.key} align={col.align}>\n {content}\n {col.extra?.(row)}\n </Cell>\n )\n }\n\n const renderRow = (row: Row) => {\n const rowProps = getRowProps?.(row)\n return (\n <Row\n {...rowProps}\n key={getRowKey(row)}\n clickable={false}\n className={clsx(clickable && styles.clickableRow, rowProps?.className)}\n onClick={(event) => {\n rowProps?.onClick?.(event)\n // Clicks elsewhere on the row go to its button or link.\n if (clickable && isRowClick(event)) {\n event.currentTarget.querySelector<HTMLElement>('[data-row-action]')?.click()\n }\n }}\n >\n {columns.map((col) => renderCell(col, row))}\n </Row>\n )\n }\n\n return (\n <Root aria-busy={loading || undefined} {...props}>\n <Head>\n <Row>\n {columns.map((col) => (\n <HeaderCell\n key={col.key}\n align={col.align}\n style={{ width: col.width }}\n sort={sort?.key === col.key && sort.direction}\n onSort={col.sortable ? () => handleSort(col.key) : undefined}\n >\n {col.header}\n </HeaderCell>\n ))}\n </Row>\n </Head>\n {groupBy && sorted.length > 0 ? (\n [...groups].map(([key, groupRows]) => (\n <Body key={key}>\n <GroupRow colSpan={columns.length}>\n {renderGroup ? renderGroup(key, groupRows) : String(key)}\n </GroupRow>\n {groupRows.map(renderRow)}\n </Body>\n ))\n ) : (\n <Body>\n {showSkeleton &&\n LOADING_ROWS.map((i) => (\n <Row key={i}>\n {columns.map((col, c) => (\n <Cell key={col.key} align={col.align}>\n <Skeleton\n variant=\"text\"\n width={c === 0 ? '70%' : '50%'}\n style={col.align === 'right' ? { marginLeft: 'auto' } : undefined}\n />\n </Cell>\n ))}\n </Row>\n ))}\n {!loading && rows.length === 0 && (\n <Row>\n <Cell colSpan={columns.length} className={styles.empty}>\n {empty}\n </Cell>\n </Row>\n )}\n {sorted.map(renderRow)}\n </Body>\n )}\n </Root>\n )\n}\n\n/**\n * A data table. Pass `columns` and `rows`, or compose `Table.Root`, `Table.Head`, `Table.Body`,\n * `Table.Row`, `Table.GroupRow`, `Table.HeaderCell` and `Table.Cell` for custom layouts.\n */\nexport const Table = Object.assign(TableComponent, {\n Root,\n Head,\n Body,\n Row,\n GroupRow,\n Cell,\n HeaderCell,\n Secondary,\n LoadMore,\n})\n"],"mappings":";;;;;;;;;;AAwDA,SAASqB,EAAK,EACZ,aAAU,WACV,cACA,SAAAC,GACA,oBAAiB,IACjB,WAAQ,IACR,QAAAC,GACA,cACA,aACA,GAAGC,KACc;CACjB,IAAMC,IAAYC,EAAuB,IAAI;CAC7C,EAAoBC,SAAiBF,EAAU,SAA2B,CAAC,CAAC;CAI5E,IAAM,CAACG,GAAWC,KAAgBC,EAAS,EAAK;CAChD,QAAgB;EACd,IAAMC,IAAON,EAAU;EACvB,IAAI,CAACM,GAAM;EACX,IAAMC,UAAcH,EAAaE,EAAK,cAAcA,EAAK,WAAW;EACpE,EAAM;EAEN,IAAME,IAAW,OAAO,iBAAmB,MAAc,KAAA,IAAY,IAAI,eAAeD,CAAK;EAO7F,OANIC,KACFA,EAAS,QAAQF,CAAI,GACjBA,EAAK,qBAAmBE,EAAS,QAAQF,EAAK,iBAAiB,KAEnE,OAAO,iBAAiB,UAAUC,CAAK,SAE5B;GAEX,AADAC,GAAU,WAAW,GACrB,OAAO,oBAAoB,UAAUD,CAAK;EAC5C;CACF,GAAG,CAAC,CAAC;CAGL,IAAME,IAASC,EAAM,GACfC,IAAYD,EAAM,GAClBE,IAAQb,EAAM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