@dashforge/tw 0.11.0-beta → 1.0.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/CHANGELOG.md +13 -12
- package/COVERAGE.md +2 -2
- package/PARITY.md +7 -9
- package/PERFORMANCE.md +3 -4
- package/THEME-AUDIT.md +3 -4
- package/dist/components/Accordion/Accordion.d.ts +21 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/accordion.types.d.ts +74 -0
- package/dist/components/Accordion/accordion.types.d.ts.map +1 -0
- package/dist/components/Accordion/accordion.variants.d.ts +58 -0
- package/dist/components/Accordion/accordion.variants.d.ts.map +1 -0
- package/dist/components/AppShell/AppShell.d.ts +46 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/AppShell/appShell.types.d.ts +62 -0
- package/dist/components/AppShell/appShell.types.d.ts.map +1 -0
- package/dist/components/AppShell/appShell.variants.d.ts +65 -0
- package/dist/components/AppShell/appShell.variants.d.ts.map +1 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +36 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts.map +1 -0
- package/dist/components/AspectRatio/aspectRatio.types.d.ts +50 -0
- package/dist/components/AspectRatio/aspectRatio.types.d.ts.map +1 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +32 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -0
- package/dist/components/Autocomplete/autocomplete.types.d.ts +214 -0
- package/dist/components/Autocomplete/autocomplete.types.d.ts.map +1 -0
- package/dist/components/Autocomplete/autocomplete.variants.d.ts +214 -0
- package/dist/components/Autocomplete/autocomplete.variants.d.ts.map +1 -0
- package/dist/components/Box/Box.d.ts +36 -0
- package/dist/components/Box/Box.d.ts.map +1 -0
- package/dist/components/Box/box.types.d.ts +54 -0
- package/dist/components/Box/box.types.d.ts.map +1 -0
- package/dist/components/Box/box.variants.d.ts +402 -0
- package/dist/components/Box/box.variants.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts +98 -0
- package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts +85 -0
- package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +44 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/button.types.d.ts +66 -0
- package/dist/components/Button/button.types.d.ts.map +1 -0
- package/dist/components/Button/button.variants.d.ts +104 -0
- package/dist/components/Button/button.variants.d.ts.map +1 -0
- package/dist/components/Calendar/Calendar.d.ts +14 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar/calendar.types.d.ts +72 -0
- package/dist/components/Calendar/calendar.types.d.ts.map +1 -0
- package/dist/components/Calendar/calendar.variants.d.ts +99 -0
- package/dist/components/Calendar/calendar.variants.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +31 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/checkbox.types.d.ts +86 -0
- package/dist/components/Checkbox/checkbox.types.d.ts.map +1 -0
- package/dist/components/Checkbox/checkbox.variants.d.ts +109 -0
- package/dist/components/Checkbox/checkbox.variants.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +38 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/confirmDialog.types.d.ts +80 -0
- package/dist/components/ConfirmDialog/confirmDialog.types.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts +90 -0
- package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts.map +1 -0
- package/dist/components/Container/Container.d.ts +35 -0
- package/dist/components/Container/Container.d.ts.map +1 -0
- package/dist/components/Container/container.types.d.ts +41 -0
- package/dist/components/Container/container.types.d.ts.map +1 -0
- package/dist/components/Container/container.variants.d.ts +93 -0
- package/dist/components/Container/container.variants.d.ts.map +1 -0
- package/dist/components/DataGrid/DataGrid.d.ts +29 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -0
- package/dist/components/DataGrid/dataGrid.types.d.ts +214 -0
- package/dist/components/DataGrid/dataGrid.types.d.ts.map +1 -0
- package/dist/components/DataGrid/dataGrid.variants.d.ts +222 -0
- package/dist/components/DataGrid/dataGrid.variants.d.ts.map +1 -0
- package/dist/components/DataGrid/filters/ColumnFilters.d.ts +23 -0
- package/dist/components/DataGrid/filters/ColumnFilters.d.ts.map +1 -0
- package/dist/components/DataGrid/reorder/useColumnReorder.d.ts +50 -0
- package/dist/components/DataGrid/reorder/useColumnReorder.d.ts.map +1 -0
- package/dist/components/DataGrid/resize/useColumnResize.d.ts +39 -0
- package/dist/components/DataGrid/resize/useColumnResize.d.ts.map +1 -0
- package/dist/components/DataGrid/visibility/ColumnVisibilityMenu.d.ts +44 -0
- package/dist/components/DataGrid/visibility/ColumnVisibilityMenu.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +14 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/datePicker.types.d.ts +88 -0
- package/dist/components/DatePicker/datePicker.types.d.ts.map +1 -0
- package/dist/components/DatePicker/datePicker.variants.d.ts +97 -0
- package/dist/components/DatePicker/datePicker.variants.d.ts.map +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +13 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker/dateRangePicker.types.d.ts +85 -0
- package/dist/components/DateRangePicker/dateRangePicker.types.d.ts.map +1 -0
- package/dist/components/DateRangePicker/dateRangePicker.variants.d.ts +183 -0
- package/dist/components/DateRangePicker/dateRangePicker.variants.d.ts.map +1 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +13 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -0
- package/dist/components/DateTimePicker/dateTimePicker.types.d.ts +90 -0
- package/dist/components/DateTimePicker/dateTimePicker.types.d.ts.map +1 -0
- package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts +107 -0
- package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +17 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/dialog.types.d.ts +75 -0
- package/dist/components/Dialog/dialog.types.d.ts.map +1 -0
- package/dist/components/Dialog/dialog.variants.d.ts +80 -0
- package/dist/components/Dialog/dialog.variants.d.ts.map +1 -0
- package/dist/components/Divider/Divider.d.ts +50 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/divider.types.d.ts +47 -0
- package/dist/components/Divider/divider.types.d.ts.map +1 -0
- package/dist/components/Divider/divider.variants.d.ts +129 -0
- package/dist/components/Divider/divider.variants.d.ts.map +1 -0
- package/dist/components/Grid/Grid.d.ts +32 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/grid.types.d.ts +103 -0
- package/dist/components/Grid/grid.types.d.ts.map +1 -0
- package/dist/components/Grid/grid.variants.d.ts +453 -0
- package/dist/components/Grid/grid.variants.d.ts.map +1 -0
- package/dist/components/LeftNav/LeftNav.d.ts +34 -0
- package/dist/components/LeftNav/LeftNav.d.ts.map +1 -0
- package/dist/components/LeftNav/leftNav.types.d.ts +136 -0
- package/dist/components/LeftNav/leftNav.types.d.ts.map +1 -0
- package/dist/components/LeftNav/leftNav.variants.d.ts +143 -0
- package/dist/components/LeftNav/leftNav.variants.d.ts.map +1 -0
- package/dist/components/NumberField/NumberField.d.ts +18 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -0
- package/dist/components/NumberField/numberField.types.d.ts +79 -0
- package/dist/components/NumberField/numberField.types.d.ts.map +1 -0
- package/dist/components/NumberField/numberField.variants.d.ts +169 -0
- package/dist/components/NumberField/numberField.variants.d.ts.map +1 -0
- package/dist/components/OTPField/OTPField.d.ts +25 -0
- package/dist/components/OTPField/OTPField.d.ts.map +1 -0
- package/dist/components/OTPField/otpField.types.d.ts +74 -0
- package/dist/components/OTPField/otpField.types.d.ts.map +1 -0
- package/dist/components/OTPField/otpField.variants.d.ts +105 -0
- package/dist/components/OTPField/otpField.variants.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +32 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/pagination.helpers.d.ts +23 -0
- package/dist/components/Pagination/pagination.helpers.d.ts.map +1 -0
- package/dist/components/Pagination/pagination.types.d.ts +120 -0
- package/dist/components/Pagination/pagination.types.d.ts.map +1 -0
- package/dist/components/Pagination/pagination.variants.d.ts +150 -0
- package/dist/components/Pagination/pagination.variants.d.ts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +15 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/popover.types.d.ts +45 -0
- package/dist/components/Popover/popover.types.d.ts.map +1 -0
- package/dist/components/Popover/popover.variants.d.ts +34 -0
- package/dist/components/Popover/popover.variants.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup/radioGroup.types.d.ts +103 -0
- package/dist/components/RadioGroup/radioGroup.types.d.ts.map +1 -0
- package/dist/components/RadioGroup/radioGroup.variants.d.ts +166 -0
- package/dist/components/RadioGroup/radioGroup.variants.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +23 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/skeleton.types.d.ts +56 -0
- package/dist/components/Skeleton/skeleton.types.d.ts.map +1 -0
- package/dist/components/Skeleton/skeleton.variants.d.ts +110 -0
- package/dist/components/Skeleton/skeleton.variants.d.ts.map +1 -0
- package/dist/components/Snackbar/Snackbar.d.ts +37 -0
- package/dist/components/Snackbar/Snackbar.d.ts.map +1 -0
- package/dist/components/Snackbar/snackbar.types.d.ts +86 -0
- package/dist/components/Snackbar/snackbar.types.d.ts.map +1 -0
- package/dist/components/Snackbar/snackbar.variants.d.ts +153 -0
- package/dist/components/Snackbar/snackbar.variants.d.ts.map +1 -0
- package/dist/components/Stack/Stack.d.ts +24 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/stack.types.d.ts +61 -0
- package/dist/components/Stack/stack.types.d.ts.map +1 -0
- package/dist/components/Stack/stack.variants.d.ts +163 -0
- package/dist/components/Stack/stack.variants.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +15 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/switch.types.d.ts +47 -0
- package/dist/components/Switch/switch.types.d.ts.map +1 -0
- package/dist/components/Switch/switch.variants.d.ts +105 -0
- package/dist/components/Switch/switch.variants.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +24 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/cells/RenderButton.d.ts +13 -0
- package/dist/components/Table/cells/RenderButton.d.ts.map +1 -0
- package/dist/components/Table/cells/RenderChip.d.ts +80 -0
- package/dist/components/Table/cells/RenderChip.d.ts.map +1 -0
- package/dist/components/Table/cells/RenderText.d.ts +21 -0
- package/dist/components/Table/cells/RenderText.d.ts.map +1 -0
- package/dist/components/Table/cells/RenderTwoLine.d.ts +20 -0
- package/dist/components/Table/cells/RenderTwoLine.d.ts.map +1 -0
- package/dist/components/Table/cells/RowActionsMenu.d.ts +36 -0
- package/dist/components/Table/cells/RowActionsMenu.d.ts.map +1 -0
- package/dist/components/Table/cells/index.d.ts +11 -0
- package/dist/components/Table/cells/index.d.ts.map +1 -0
- package/dist/components/Table/table.types.d.ts +399 -0
- package/dist/components/Table/table.types.d.ts.map +1 -0
- package/dist/components/Table/table.variants.d.ts +285 -0
- package/dist/components/Table/table.variants.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +19 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/tabs.types.d.ts +61 -0
- package/dist/components/Tabs/tabs.types.d.ts.map +1 -0
- package/dist/components/Tabs/tabs.variants.d.ts +82 -0
- package/dist/components/Tabs/tabs.variants.d.ts.map +1 -0
- package/dist/components/Tabs/useTabs.d.ts +55 -0
- package/dist/components/Tabs/useTabs.d.ts.map +1 -0
- package/dist/components/TextField/TextField.d.ts +25 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -0
- package/dist/components/TextField/textField.types.d.ts +98 -0
- package/dist/components/TextField/textField.types.d.ts.map +1 -0
- package/dist/components/TextField/textField.variants.d.ts +166 -0
- package/dist/components/TextField/textField.variants.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +16 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea/textarea.types.d.ts +63 -0
- package/dist/components/Textarea/textarea.types.d.ts.map +1 -0
- package/dist/components/Textarea/textarea.variants.d.ts +197 -0
- package/dist/components/Textarea/textarea.variants.d.ts.map +1 -0
- package/dist/components/TimePicker/TimePicker.d.ts +12 -0
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -0
- package/dist/components/TimePicker/timePicker.types.d.ts +80 -0
- package/dist/components/TimePicker/timePicker.types.d.ts.map +1 -0
- package/dist/components/TimePicker/timePicker.variants.d.ts +103 -0
- package/dist/components/TimePicker/timePicker.variants.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +29 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/tooltip.types.d.ts +47 -0
- package/dist/components/Tooltip/tooltip.types.d.ts.map +1 -0
- package/dist/components/Tooltip/tooltip.variants.d.ts +34 -0
- package/dist/components/Tooltip/tooltip.variants.d.ts.map +1 -0
- package/dist/components/TopBar/TopBar.d.ts +33 -0
- package/dist/components/TopBar/TopBar.d.ts.map +1 -0
- package/dist/components/TopBar/topBar.types.d.ts +49 -0
- package/dist/components/TopBar/topBar.types.d.ts.map +1 -0
- package/dist/components/TopBar/topBar.variants.d.ts +79 -0
- package/dist/components/TopBar/topBar.variants.d.ts.map +1 -0
- package/dist/components/Typography/Typography.d.ts +42 -0
- package/dist/components/Typography/Typography.d.ts.map +1 -0
- package/dist/components/Typography/typography.types.d.ts +61 -0
- package/dist/components/Typography/typography.types.d.ts.map +1 -0
- package/dist/components/Typography/typography.variants.d.ts +167 -0
- package/dist/components/Typography/typography.variants.d.ts.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +42 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/VisuallyHidden/visuallyHidden.types.d.ts +42 -0
- package/dist/components/VisuallyHidden/visuallyHidden.types.d.ts.map +1 -0
- package/dist/components/_shared/data/getNestedValue.d.ts +20 -0
- package/dist/components/_shared/data/getNestedValue.d.ts.map +1 -0
- package/dist/components/_shared/data/useColumnAutoDetect.d.ts +45 -0
- package/dist/components/_shared/data/useColumnAutoDetect.d.ts.map +1 -0
- package/dist/components/_shared/data/useControllableState.d.ts +23 -0
- package/dist/components/_shared/data/useControllableState.d.ts.map +1 -0
- package/dist/components/_shared/data/useDebouncedValue.d.ts +10 -0
- package/dist/components/_shared/data/useDebouncedValue.d.ts.map +1 -0
- package/dist/components/_shared/data/useTableFilter.d.ts +36 -0
- package/dist/components/_shared/data/useTableFilter.d.ts.map +1 -0
- package/dist/components/_shared/data/useTableSearch.d.ts +23 -0
- package/dist/components/_shared/data/useTableSearch.d.ts.map +1 -0
- package/dist/components/_shared/data/useTableSelection.d.ts +25 -0
- package/dist/components/_shared/data/useTableSelection.d.ts.map +1 -0
- package/dist/components/_shared/data/useTableSort.d.ts +20 -0
- package/dist/components/_shared/data/useTableSort.d.ts.map +1 -0
- package/dist/components/_shared/data/useVirtualizer.d.ts +107 -0
- package/dist/components/_shared/data/useVirtualizer.d.ts.map +1 -0
- package/dist/components/_shared/resolveValidationState.d.ts +42 -0
- package/dist/components/_shared/resolveValidationState.d.ts.map +1 -0
- package/dist/hooks/useAccessState.d.ts +37 -0
- package/dist/hooks/useAccessState.d.ts.map +1 -0
- package/dist/index.d.ts +146 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/utils/cn.d.ts +26 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/package.json +7 -7
- package/src/components/TextField/TextField.test.tsx +5 -1
- package/vite.config.ts +8 -0
- package/vitest.config.mts +8 -1
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AccessRequirement } from '@dashforge/rbac';
|
|
3
|
+
import type { TableVariants } from './table.variants.js';
|
|
4
|
+
/**
|
|
5
|
+
* Type-level dotted path through an object's nested structure.
|
|
6
|
+
*
|
|
7
|
+
* `NestedKeyOf<{ user: { name: string } }>` → `'user' | 'user.name'`.
|
|
8
|
+
*
|
|
9
|
+
* Used as the `field` of a column to give autocomplete on nested
|
|
10
|
+
* paths. The runtime lookup happens via `getNestedValue` in
|
|
11
|
+
* `_internal/getNestedValue.ts` (split on `.` and walk).
|
|
12
|
+
*/
|
|
13
|
+
export type NestedKeyOf<T extends object> = {
|
|
14
|
+
[K in keyof T & (string | number)]: T[K] extends object | undefined ? T[K] extends ReadonlyArray<unknown> ? `${K}` : NonNullable<T[K]> extends object ? `${K}` | `${K}.${NestedKeyOf<NonNullable<T[K]>>}` : `${K}` : `${K}`;
|
|
15
|
+
}[keyof T & (string | number)];
|
|
16
|
+
/**
|
|
17
|
+
* Auto-detected primitive type for a column. Drives smart defaults:
|
|
18
|
+
* - `number` → align right + monospace (`tabular-nums`)
|
|
19
|
+
* - `date` → align left + monospace (consistent ISO width)
|
|
20
|
+
* - `boolean` → align center
|
|
21
|
+
* - `string` → align left (default)
|
|
22
|
+
* - `unknown` → fallback to left, no monospace
|
|
23
|
+
*/
|
|
24
|
+
export type TableColumnInferredType = 'number' | 'date' | 'boolean' | 'string' | 'unknown';
|
|
25
|
+
/**
|
|
26
|
+
* Context passed to a custom `cellRenderer`. Mirrors what the consumer
|
|
27
|
+
* needs to render a cell: row, resolved value, position, selection
|
|
28
|
+
* state, expand state, and the resolved RBAC access state for THIS
|
|
29
|
+
* column.
|
|
30
|
+
*/
|
|
31
|
+
export interface TableCellContext<T> {
|
|
32
|
+
row: T;
|
|
33
|
+
value: unknown;
|
|
34
|
+
rowIndex: number;
|
|
35
|
+
isSelected: boolean;
|
|
36
|
+
isExpanded: boolean;
|
|
37
|
+
/** Resolved RBAC state for this column. `null` if no `access` set. */
|
|
38
|
+
access: {
|
|
39
|
+
hidden: boolean;
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
readonly: boolean;
|
|
42
|
+
} | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One column definition for `<Table>`.
|
|
46
|
+
*
|
|
47
|
+
* **i18n**: pass `t('users.name')` directly to `header` — `header`
|
|
48
|
+
* accepts `string` for the common case. Use the function form
|
|
49
|
+
* `header: () => <span>…</span>` only when you need richer JSX.
|
|
50
|
+
*
|
|
51
|
+
* **Smart defaults**: when `align` / `monospace` are omitted, the
|
|
52
|
+
* Table auto-detects the column type from the first non-null value
|
|
53
|
+
* across the visible rows and applies `right + tabular-nums` for
|
|
54
|
+
* numbers, `center` for booleans, etc. Explicit props always win.
|
|
55
|
+
*/
|
|
56
|
+
export interface TableColumn<T extends object> {
|
|
57
|
+
/**
|
|
58
|
+
* Dotted path to the value in each row. Supports nested keys
|
|
59
|
+
* (`'address.city.zipCode'`) thanks to `NestedKeyOf<T>` typing +
|
|
60
|
+
* runtime `getNestedValue()`.
|
|
61
|
+
*/
|
|
62
|
+
field: NestedKeyOf<T> | (string & {});
|
|
63
|
+
/**
|
|
64
|
+
* Visible header. Pass a translation string directly:
|
|
65
|
+
* `header: t('users.name')`. Use the function form for richer
|
|
66
|
+
* JSX (e.g. header with an icon).
|
|
67
|
+
*/
|
|
68
|
+
header: string | (() => ReactNode);
|
|
69
|
+
/** Pixel width (`px`). Mutually informative with `flex`. */
|
|
70
|
+
width?: number;
|
|
71
|
+
/** Flex grow factor (CSS `flex: <n> 1 0`). */
|
|
72
|
+
flex?: number;
|
|
73
|
+
/** Minimum pixel width (for resizable columns — deferred to v1-bis). */
|
|
74
|
+
minWidth?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Horizontal alignment. Default is auto-detected from value type
|
|
77
|
+
* (number → right, boolean → center, otherwise left).
|
|
78
|
+
*/
|
|
79
|
+
align?: 'left' | 'right' | 'center';
|
|
80
|
+
/**
|
|
81
|
+
* Opt-in to a monospace **font family** for this column. The
|
|
82
|
+
* library never auto-applies `font-mono` — it would override the
|
|
83
|
+
* consumer's theme `font-sans`. Set `true` explicitly only when
|
|
84
|
+
* the design calls for a typewriter font (e.g. raw hex IDs).
|
|
85
|
+
*
|
|
86
|
+
* The dashforgePreset does NOT own the `fontFamily` axis; the
|
|
87
|
+
* consumer configures the mono stack in their own
|
|
88
|
+
* `tailwind.config.ts` (`theme.extend.fontFamily.mono`).
|
|
89
|
+
*/
|
|
90
|
+
monospace?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Apply `font-variant-numeric: tabular-nums` so every digit
|
|
93
|
+
* occupies the same width — clean alignment for currency / metric
|
|
94
|
+
* columns. Does NOT change the font family. Auto-applied for
|
|
95
|
+
* `number` and `date` columns; pass `false` explicitly to opt out
|
|
96
|
+
* or `true` to force on a string column.
|
|
97
|
+
*/
|
|
98
|
+
tabularNums?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Make the column sortable. Pass `true` for default comparator
|
|
101
|
+
* (works for string/number/date/boolean) or a custom
|
|
102
|
+
* `(a, b) => number`.
|
|
103
|
+
*/
|
|
104
|
+
sortable?: boolean | ((a: T, b: T) => number);
|
|
105
|
+
/**
|
|
106
|
+
* Include this column in the global search filter.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
searchable?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Enable per-column quick filter UI in the column header.
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
filterable?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Override the filter UI type. By default the type is auto-detected
|
|
117
|
+
* from `useColumnAutoDetect` (number → range, date → range,
|
|
118
|
+
* boolean → select, anything else → text contains). Force a
|
|
119
|
+
* specific UI when the autodetect picks the wrong one — e.g. an
|
|
120
|
+
* ID column stored as a number that should filter by text contains.
|
|
121
|
+
*/
|
|
122
|
+
filterType?: TableFilterType;
|
|
123
|
+
/**
|
|
124
|
+
* Custom cell renderer. Receives the full row + the resolved
|
|
125
|
+
* (potentially nested) value, the row index, selection state,
|
|
126
|
+
* expansion state, and the RBAC access state.
|
|
127
|
+
*/
|
|
128
|
+
cellRenderer?: (ctx: TableCellContext<T>) => ReactNode;
|
|
129
|
+
/**
|
|
130
|
+
* Per-column RBAC. `onUnauthorized: 'hide'` removes the column
|
|
131
|
+
* entirely from header AND every row cell (a11y-correct).
|
|
132
|
+
* `disable` / `readonly` are forwarded to `cellRenderer` via
|
|
133
|
+
* `ctx.access` — the renderer is expected to honor them.
|
|
134
|
+
*/
|
|
135
|
+
access?: AccessRequirement;
|
|
136
|
+
/**
|
|
137
|
+
* Pin this column during horizontal scroll. `'left'` (DataGrid v1)
|
|
138
|
+
* uses CSS `position: sticky; left: 0`. `'right'` is reserved for
|
|
139
|
+
* v1-bis (CSS edge cases around last-column borders). Table
|
|
140
|
+
* (non-virtualized) ignores this prop today — only DataGrid honors
|
|
141
|
+
* it (Sprint 4.2).
|
|
142
|
+
*/
|
|
143
|
+
sticky?: 'left' | 'right';
|
|
144
|
+
/**
|
|
145
|
+
* Allow user to hide this column from the column-visibility dialog.
|
|
146
|
+
* Pass `false` for structurally required columns (e.g. an ID column).
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
hideable?: boolean;
|
|
150
|
+
/** Hidden on first render (the user can re-show via the dialog). */
|
|
151
|
+
defaultHidden?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Allow user to resize this column by dragging the right edge of
|
|
154
|
+
* its header. Pass `false` to opt out per-column. The grid-level
|
|
155
|
+
* `enableColumnResize` flag must also be on (default `true`).
|
|
156
|
+
* @default true
|
|
157
|
+
*/
|
|
158
|
+
resizable?: boolean;
|
|
159
|
+
/** Maximum width (px) honored by the resize drag. */
|
|
160
|
+
maxWidth?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Allow user to reorder this column by dragging its header. Pass
|
|
163
|
+
* `false` to pin its position. The grid-level `enableColumnReorder`
|
|
164
|
+
* flag must also be on (default `true`).
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
167
|
+
reorderable?: boolean;
|
|
168
|
+
}
|
|
169
|
+
export type TableSortDirection = 'asc' | 'desc';
|
|
170
|
+
export interface TableSortItem {
|
|
171
|
+
field: string;
|
|
172
|
+
direction: TableSortDirection;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Sort model. Single-column sort = array of length 1. Multi-column
|
|
176
|
+
* sort = array of N (typically up to 3). The order matters: first
|
|
177
|
+
* item is the primary sort key, subsequent items break ties.
|
|
178
|
+
*/
|
|
179
|
+
export type TableSortModel = TableSortItem[];
|
|
180
|
+
/**
|
|
181
|
+
* Filter operator. The value shape depends on the operator:
|
|
182
|
+
* - `contains` → `value: string` (text substring match)
|
|
183
|
+
* - `equals` → `value: unknown` (exact match, used for booleans)
|
|
184
|
+
* - `between` → `value: [min, max]` where each end can be `null`
|
|
185
|
+
* for an open range. Used for number ranges (`value: [10, 50]`)
|
|
186
|
+
* and date ranges (`value: ['2024-01-01', '2024-12-31']` as ISO).
|
|
187
|
+
*/
|
|
188
|
+
export type TableFilterOperator = 'contains' | 'equals' | 'between';
|
|
189
|
+
export interface TableFilterItem {
|
|
190
|
+
field: string;
|
|
191
|
+
op: TableFilterOperator;
|
|
192
|
+
value: unknown;
|
|
193
|
+
}
|
|
194
|
+
export type TableFilterModel = TableFilterItem[];
|
|
195
|
+
/**
|
|
196
|
+
* Column-level filter type hint. Determines which filter UI to
|
|
197
|
+
* render in the column header Popover. Auto-detected from
|
|
198
|
+
* `useColumnAutoDetect` when omitted:
|
|
199
|
+
*
|
|
200
|
+
* - `number` → number range filter
|
|
201
|
+
* - `date` → date range filter
|
|
202
|
+
* - `boolean` → true/false/all select
|
|
203
|
+
* - `string` (or anything else) → text contains
|
|
204
|
+
*/
|
|
205
|
+
export type TableFilterType = 'text' | 'number' | 'boolean' | 'date';
|
|
206
|
+
export type TableRowSelectionMode = 'none' | 'single' | 'multiple';
|
|
207
|
+
/**
|
|
208
|
+
* Internal default strings used by the Table for accessibility
|
|
209
|
+
* announcements, density toggle, search placeholder, etc. Pass the
|
|
210
|
+
* subset you need to translate; the rest fall back to English.
|
|
211
|
+
*
|
|
212
|
+
* For column headers, empty state, bulk actions and row action
|
|
213
|
+
* labels — pass the translated value directly via the matching
|
|
214
|
+
* prop (`header`, `emptyState`, `bulkActions`, `rowActions`).
|
|
215
|
+
*/
|
|
216
|
+
export interface TableLabels {
|
|
217
|
+
searchPlaceholder?: string;
|
|
218
|
+
/** Shown when the dataset itself is empty (0 input rows). */
|
|
219
|
+
noData?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Shown when the dataset has rows but an active search / filter
|
|
222
|
+
* excluded them all. Distinct from `noData` so the user can tell
|
|
223
|
+
* "nothing here" from "nothing matches your query".
|
|
224
|
+
*/
|
|
225
|
+
noResults?: string;
|
|
226
|
+
loading?: string;
|
|
227
|
+
ariaSortNone?: string;
|
|
228
|
+
ariaSortAscending?: string;
|
|
229
|
+
ariaSortDescending?: string;
|
|
230
|
+
ariaSelectRow?: string;
|
|
231
|
+
ariaSelectAllRows?: string;
|
|
232
|
+
ariaExpandRow?: string;
|
|
233
|
+
ariaCollapseRow?: string;
|
|
234
|
+
/** "X selected" — `{count}` placeholder gets replaced. */
|
|
235
|
+
selectedCount?: string;
|
|
236
|
+
clearSelection?: string;
|
|
237
|
+
/** Per-column filter Popover. */
|
|
238
|
+
filterColumn?: string;
|
|
239
|
+
filterApply?: string;
|
|
240
|
+
filterClear?: string;
|
|
241
|
+
/** Number / date range filter inputs. */
|
|
242
|
+
filterMin?: string;
|
|
243
|
+
filterMax?: string;
|
|
244
|
+
filterFrom?: string;
|
|
245
|
+
filterTo?: string;
|
|
246
|
+
/** Boolean filter radio options. */
|
|
247
|
+
filterAll?: string;
|
|
248
|
+
filterTrue?: string;
|
|
249
|
+
filterFalse?: string;
|
|
250
|
+
/** Density toggle. */
|
|
251
|
+
density?: string;
|
|
252
|
+
densityCompact?: string;
|
|
253
|
+
densityComfortable?: string;
|
|
254
|
+
densitySpacious?: string;
|
|
255
|
+
/** Column visibility menu (Popover-based, auto-commit). */
|
|
256
|
+
columnsButton?: string;
|
|
257
|
+
columnsTitle?: string;
|
|
258
|
+
/** Aria-label for the tri-state show/hide-all master checkbox. */
|
|
259
|
+
columnsToggleAll?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface TableSlotProps {
|
|
262
|
+
root?: {
|
|
263
|
+
className?: string;
|
|
264
|
+
};
|
|
265
|
+
toolbar?: {
|
|
266
|
+
className?: string;
|
|
267
|
+
};
|
|
268
|
+
search?: {
|
|
269
|
+
className?: string;
|
|
270
|
+
};
|
|
271
|
+
scroll?: {
|
|
272
|
+
className?: string;
|
|
273
|
+
};
|
|
274
|
+
table?: {
|
|
275
|
+
className?: string;
|
|
276
|
+
};
|
|
277
|
+
thead?: {
|
|
278
|
+
className?: string;
|
|
279
|
+
};
|
|
280
|
+
tbody?: {
|
|
281
|
+
className?: string;
|
|
282
|
+
};
|
|
283
|
+
headerRow?: {
|
|
284
|
+
className?: string;
|
|
285
|
+
};
|
|
286
|
+
headerCell?: {
|
|
287
|
+
className?: string;
|
|
288
|
+
};
|
|
289
|
+
row?: {
|
|
290
|
+
className?: string;
|
|
291
|
+
};
|
|
292
|
+
cell?: {
|
|
293
|
+
className?: string;
|
|
294
|
+
};
|
|
295
|
+
emptyState?: {
|
|
296
|
+
className?: string;
|
|
297
|
+
};
|
|
298
|
+
loadingOverlay?: {
|
|
299
|
+
className?: string;
|
|
300
|
+
};
|
|
301
|
+
selectionCell?: {
|
|
302
|
+
className?: string;
|
|
303
|
+
};
|
|
304
|
+
expandToggleCell?: {
|
|
305
|
+
className?: string;
|
|
306
|
+
};
|
|
307
|
+
expandedRow?: {
|
|
308
|
+
className?: string;
|
|
309
|
+
};
|
|
310
|
+
rowActionsCell?: {
|
|
311
|
+
className?: string;
|
|
312
|
+
};
|
|
313
|
+
bulkActionFooter?: {
|
|
314
|
+
className?: string;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
export interface TableExpandableConfig<T> {
|
|
318
|
+
render: (row: T) => ReactNode;
|
|
319
|
+
expandedRowIds?: string[];
|
|
320
|
+
onExpandChange?: (ids: string[]) => void;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Props for `<Table>`.
|
|
324
|
+
*
|
|
325
|
+
* Hybrid declarative-first architecture: by default every state piece
|
|
326
|
+
* (sort, filter, search, selection, expansion) is internal. Pass the
|
|
327
|
+
* matching controlled prop + change handler to lift state up.
|
|
328
|
+
*
|
|
329
|
+
* Smart defaults: column types are auto-detected on first render —
|
|
330
|
+
* number columns get right-align + tabular-nums, dates get monospace,
|
|
331
|
+
* booleans get center-align, etc. Override via explicit `align` /
|
|
332
|
+
* `monospace` per column.
|
|
333
|
+
*
|
|
334
|
+
* Visual style: Stripe-inspired clean lines by default
|
|
335
|
+
* (`variant="lines"`), row actions revealed on hover, sticky header,
|
|
336
|
+
* `comfortable` density. Switch via variant / density / size props.
|
|
337
|
+
*
|
|
338
|
+
* i18n: column `header` accepts plain strings (use `t('...')`
|
|
339
|
+
* directly). All internal label strings configurable via `labels`
|
|
340
|
+
* prop with English defaults.
|
|
341
|
+
*/
|
|
342
|
+
export interface TableProps<T extends object> extends Pick<TableVariants, 'variant' | 'size' | 'density'> {
|
|
343
|
+
rows: T[];
|
|
344
|
+
cols: TableColumn<T>[];
|
|
345
|
+
/**
|
|
346
|
+
* Stable row-id resolver — the React key + the identity used by
|
|
347
|
+
* selection and row-expansion state.
|
|
348
|
+
*
|
|
349
|
+
* **Strongly recommended whenever sort / search / selection /
|
|
350
|
+
* expandable rows are used.** The default falls back to the
|
|
351
|
+
* positional index (`String(index)`); once rows reorder (sort) or
|
|
352
|
+
* change presence (search / filter), index `2` points at a
|
|
353
|
+
* *different* row, so selection and expansion state silently jump
|
|
354
|
+
* to the wrong rows. Pass a value derived from the data itself:
|
|
355
|
+
*
|
|
356
|
+
* ```tsx
|
|
357
|
+
* <Table getRowId={(row) => row.id} … />
|
|
358
|
+
* ```
|
|
359
|
+
*
|
|
360
|
+
* Dashforge emits a `console.warn` in development when `getRowId`
|
|
361
|
+
* is omitted and one of those features is active. (`<DataGrid>`
|
|
362
|
+
* makes this prop required for the same reason.)
|
|
363
|
+
*/
|
|
364
|
+
getRowId?: (row: T, index: number) => string;
|
|
365
|
+
sortModel?: TableSortModel;
|
|
366
|
+
onSortChange?: (model: TableSortModel) => void;
|
|
367
|
+
/** Default sort applied when uncontrolled. */
|
|
368
|
+
defaultSortModel?: TableSortModel;
|
|
369
|
+
enableSearch?: boolean;
|
|
370
|
+
searchQuery?: string;
|
|
371
|
+
onSearchQueryChange?: (q: string) => void;
|
|
372
|
+
searchPlaceholder?: string;
|
|
373
|
+
searchDebounceMs?: number;
|
|
374
|
+
filterModel?: TableFilterModel;
|
|
375
|
+
onFilterChange?: (model: TableFilterModel) => void;
|
|
376
|
+
rowSelection?: TableRowSelectionMode;
|
|
377
|
+
selectedRowIds?: string[];
|
|
378
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
379
|
+
/** Sticky bulk action footer (visible only when selection > 0). */
|
|
380
|
+
bulkActions?: (selectedRows: T[]) => ReactNode;
|
|
381
|
+
expandable?: TableExpandableConfig<T>;
|
|
382
|
+
rowActions?: (row: T) => ReactNode;
|
|
383
|
+
loading?: boolean;
|
|
384
|
+
/** Number of skeleton rows shown while `loading=true`. @default 5 */
|
|
385
|
+
loadingRowCount?: number;
|
|
386
|
+
emptyState?: ReactNode;
|
|
387
|
+
/** Sticky header. @default true */
|
|
388
|
+
stickyHeader?: boolean;
|
|
389
|
+
/** Optional caption for screen readers. */
|
|
390
|
+
caption?: ReactNode;
|
|
391
|
+
/** Renders the caption visually too (otherwise sr-only). @default false */
|
|
392
|
+
showCaption?: boolean;
|
|
393
|
+
/** Table-level RBAC. `hide` returns null; `disable` greys everything. */
|
|
394
|
+
access?: AccessRequirement;
|
|
395
|
+
labels?: TableLabels;
|
|
396
|
+
sx?: string;
|
|
397
|
+
slotProps?: TableSlotProps;
|
|
398
|
+
}
|
|
399
|
+
//# sourceMappingURL=table.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.types.d.ts","sourceRoot":"","sources":["../../../src/components/Table/table.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI;KACzC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,GAC/D,CAAC,CAAC,CAAC,CAAC,SAAS,aAAa,CAAC,OAAO,CAAC,GACjC,GAAG,C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
|
|
3
|
+
* `<Table>` variant recipe.
|
|
4
|
+
*
|
|
5
|
+
* Slots:
|
|
6
|
+
* - `root` — outer wrapper
|
|
7
|
+
* - `toolbar` — search + filter chips row above table
|
|
8
|
+
* - `search` — search input
|
|
9
|
+
* - `scroll` — `<div class="overflow-auto">` wrapping the table
|
|
10
|
+
* - `table` — `<table>` element
|
|
11
|
+
* - `thead` — `<thead>` (sticky positioning here)
|
|
12
|
+
* - `tbody` — `<tbody>`
|
|
13
|
+
* - `headerRow` — `<tr>` inside `<thead>`
|
|
14
|
+
* - `headerCell` — `<th>` cell
|
|
15
|
+
* - `headerCellButton` — `<button>` inside sortable `<th>`
|
|
16
|
+
* - `row` — `<tr>` inside `<tbody>` (data row)
|
|
17
|
+
* - `cell` — `<td>` data cell
|
|
18
|
+
* - `selectionCell` — first `<td>` when selection mode active
|
|
19
|
+
* - `expandToggleCell` — second `<td>` when expandable active
|
|
20
|
+
* - `expandedRow` — full-width `<tr>` rendered after an expanded row
|
|
21
|
+
* - `rowActionsCell` — last `<td>` when `rowActions` provided
|
|
22
|
+
* - `emptyState` — placeholder when rows is empty
|
|
23
|
+
* - `loadingOverlay` — skeleton overlay when loading
|
|
24
|
+
* - `bulkActionFooter` — sticky footer with bulk actions
|
|
25
|
+
*
|
|
26
|
+
* Variant axes:
|
|
27
|
+
* - `variant` — visual row-division style:
|
|
28
|
+
* - `plain` — minimal separators
|
|
29
|
+
* - `lines` — Stripe-style thin horizontal dividers (default)
|
|
30
|
+
* - `striped` — alternating row backgrounds (zebra)
|
|
31
|
+
* - `bordered` — full cell borders
|
|
32
|
+
* - `card` — each row rendered as a separate surface card
|
|
33
|
+
* - `size` — `sm` / `md` (default) / `lg`
|
|
34
|
+
* - `density` — `compact` (40px row) / `comfortable` (default 48px) / `spacious` (56px)
|
|
35
|
+
*
|
|
36
|
+
* Smart-default alignment (per column) is applied by the Table
|
|
37
|
+
* component code, NOT here — it depends on the runtime-detected
|
|
38
|
+
* value type, which the recipe doesn't see.
|
|
39
|
+
*
|
|
40
|
+
* **Dashforge identity rule** (memory: `feedback_dashforge_preset_is_identity`):
|
|
41
|
+
* This recipe uses NO `dark:` variants on the neutral palette. The
|
|
42
|
+
* `dashforgePreset()` CSS-variable swap auto-inverts neutral tokens
|
|
43
|
+
* (`bg-neutral-50` is light surface in light mode, dark surface in
|
|
44
|
+
* dark mode — same class, different physical color). Adding a
|
|
45
|
+
* `dark:` variant on neutral palette = DOUBLE inversion = breaks
|
|
46
|
+
* dark mode. The selected-row state uses the canonical LeftNav
|
|
47
|
+
* `itemActive` pattern (`bg-primary-100 text-primary-900 font-medium`),
|
|
48
|
+
* which works in both modes because the primary palette has no
|
|
49
|
+
* inversion (both `bg` and `text` resolve to the same physical
|
|
50
|
+
* colors regardless of mode → guaranteed contrast).
|
|
51
|
+
*/
|
|
52
|
+
export declare const tableVariants: import("tailwind-variants").TVReturnType<{
|
|
53
|
+
variant: {
|
|
54
|
+
plain: {};
|
|
55
|
+
lines: {};
|
|
56
|
+
striped: {
|
|
57
|
+
row: string;
|
|
58
|
+
};
|
|
59
|
+
bordered: {
|
|
60
|
+
table: string;
|
|
61
|
+
cell: string;
|
|
62
|
+
headerCell: string;
|
|
63
|
+
};
|
|
64
|
+
card: {
|
|
65
|
+
scroll: string;
|
|
66
|
+
table: string;
|
|
67
|
+
row: string[];
|
|
68
|
+
cell: string;
|
|
69
|
+
headerCell: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
size: {
|
|
73
|
+
sm: {
|
|
74
|
+
headerCell: string;
|
|
75
|
+
cell: string;
|
|
76
|
+
search: string;
|
|
77
|
+
};
|
|
78
|
+
md: {
|
|
79
|
+
headerCell: string;
|
|
80
|
+
cell: string;
|
|
81
|
+
search: string;
|
|
82
|
+
};
|
|
83
|
+
lg: {
|
|
84
|
+
headerCell: string;
|
|
85
|
+
cell: string;
|
|
86
|
+
search: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
density: {
|
|
90
|
+
compact: {
|
|
91
|
+
headerCell: string;
|
|
92
|
+
cell: string;
|
|
93
|
+
};
|
|
94
|
+
comfortable: {
|
|
95
|
+
headerCell: string;
|
|
96
|
+
cell: string;
|
|
97
|
+
};
|
|
98
|
+
spacious: {
|
|
99
|
+
headerCell: string;
|
|
100
|
+
cell: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
stickyHeader: {
|
|
104
|
+
true: {
|
|
105
|
+
thead: string;
|
|
106
|
+
};
|
|
107
|
+
false: {};
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
root: string;
|
|
111
|
+
toolbar: string;
|
|
112
|
+
search: string[];
|
|
113
|
+
scroll: string;
|
|
114
|
+
table: string;
|
|
115
|
+
thead: string;
|
|
116
|
+
tbody: string;
|
|
117
|
+
headerRow: string;
|
|
118
|
+
headerCell: string[];
|
|
119
|
+
headerCellButton: string[];
|
|
120
|
+
row: string[];
|
|
121
|
+
cell: string[];
|
|
122
|
+
selectionCell: string;
|
|
123
|
+
expandToggleCell: string;
|
|
124
|
+
expandedRow: string;
|
|
125
|
+
rowActionsCell: string[];
|
|
126
|
+
emptyState: string[];
|
|
127
|
+
loadingOverlay: string[];
|
|
128
|
+
bulkActionFooter: string[];
|
|
129
|
+
}, undefined, {
|
|
130
|
+
variant: {
|
|
131
|
+
plain: {};
|
|
132
|
+
lines: {};
|
|
133
|
+
striped: {
|
|
134
|
+
row: string;
|
|
135
|
+
};
|
|
136
|
+
bordered: {
|
|
137
|
+
table: string;
|
|
138
|
+
cell: string;
|
|
139
|
+
headerCell: string;
|
|
140
|
+
};
|
|
141
|
+
card: {
|
|
142
|
+
scroll: string;
|
|
143
|
+
table: string;
|
|
144
|
+
row: string[];
|
|
145
|
+
cell: string;
|
|
146
|
+
headerCell: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
size: {
|
|
150
|
+
sm: {
|
|
151
|
+
headerCell: string;
|
|
152
|
+
cell: string;
|
|
153
|
+
search: string;
|
|
154
|
+
};
|
|
155
|
+
md: {
|
|
156
|
+
headerCell: string;
|
|
157
|
+
cell: string;
|
|
158
|
+
search: string;
|
|
159
|
+
};
|
|
160
|
+
lg: {
|
|
161
|
+
headerCell: string;
|
|
162
|
+
cell: string;
|
|
163
|
+
search: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
density: {
|
|
167
|
+
compact: {
|
|
168
|
+
headerCell: string;
|
|
169
|
+
cell: string;
|
|
170
|
+
};
|
|
171
|
+
comfortable: {
|
|
172
|
+
headerCell: string;
|
|
173
|
+
cell: string;
|
|
174
|
+
};
|
|
175
|
+
spacious: {
|
|
176
|
+
headerCell: string;
|
|
177
|
+
cell: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
stickyHeader: {
|
|
181
|
+
true: {
|
|
182
|
+
thead: string;
|
|
183
|
+
};
|
|
184
|
+
false: {};
|
|
185
|
+
};
|
|
186
|
+
}, {
|
|
187
|
+
root: string;
|
|
188
|
+
toolbar: string;
|
|
189
|
+
search: string[];
|
|
190
|
+
scroll: string;
|
|
191
|
+
table: string;
|
|
192
|
+
thead: string;
|
|
193
|
+
tbody: string;
|
|
194
|
+
headerRow: string;
|
|
195
|
+
headerCell: string[];
|
|
196
|
+
headerCellButton: string[];
|
|
197
|
+
row: string[];
|
|
198
|
+
cell: string[];
|
|
199
|
+
selectionCell: string;
|
|
200
|
+
expandToggleCell: string;
|
|
201
|
+
expandedRow: string;
|
|
202
|
+
rowActionsCell: string[];
|
|
203
|
+
emptyState: string[];
|
|
204
|
+
loadingOverlay: string[];
|
|
205
|
+
bulkActionFooter: string[];
|
|
206
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
207
|
+
variant: {
|
|
208
|
+
plain: {};
|
|
209
|
+
lines: {};
|
|
210
|
+
striped: {
|
|
211
|
+
row: string;
|
|
212
|
+
};
|
|
213
|
+
bordered: {
|
|
214
|
+
table: string;
|
|
215
|
+
cell: string;
|
|
216
|
+
headerCell: string;
|
|
217
|
+
};
|
|
218
|
+
card: {
|
|
219
|
+
scroll: string;
|
|
220
|
+
table: string;
|
|
221
|
+
row: string[];
|
|
222
|
+
cell: string;
|
|
223
|
+
headerCell: string;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
size: {
|
|
227
|
+
sm: {
|
|
228
|
+
headerCell: string;
|
|
229
|
+
cell: string;
|
|
230
|
+
search: string;
|
|
231
|
+
};
|
|
232
|
+
md: {
|
|
233
|
+
headerCell: string;
|
|
234
|
+
cell: string;
|
|
235
|
+
search: string;
|
|
236
|
+
};
|
|
237
|
+
lg: {
|
|
238
|
+
headerCell: string;
|
|
239
|
+
cell: string;
|
|
240
|
+
search: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
density: {
|
|
244
|
+
compact: {
|
|
245
|
+
headerCell: string;
|
|
246
|
+
cell: string;
|
|
247
|
+
};
|
|
248
|
+
comfortable: {
|
|
249
|
+
headerCell: string;
|
|
250
|
+
cell: string;
|
|
251
|
+
};
|
|
252
|
+
spacious: {
|
|
253
|
+
headerCell: string;
|
|
254
|
+
cell: string;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
stickyHeader: {
|
|
258
|
+
true: {
|
|
259
|
+
thead: string;
|
|
260
|
+
};
|
|
261
|
+
false: {};
|
|
262
|
+
};
|
|
263
|
+
}, {
|
|
264
|
+
root: string;
|
|
265
|
+
toolbar: string;
|
|
266
|
+
search: string[];
|
|
267
|
+
scroll: string;
|
|
268
|
+
table: string;
|
|
269
|
+
thead: string;
|
|
270
|
+
tbody: string;
|
|
271
|
+
headerRow: string;
|
|
272
|
+
headerCell: string[];
|
|
273
|
+
headerCellButton: string[];
|
|
274
|
+
row: string[];
|
|
275
|
+
cell: string[];
|
|
276
|
+
selectionCell: string;
|
|
277
|
+
expandToggleCell: string;
|
|
278
|
+
expandedRow: string;
|
|
279
|
+
rowActionsCell: string[];
|
|
280
|
+
emptyState: string[];
|
|
281
|
+
loadingOverlay: string[];
|
|
282
|
+
bulkActionFooter: string[];
|
|
283
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
284
|
+
export type TableVariants = VariantProps<typeof tableVariants>;
|
|
285
|
+
//# sourceMappingURL=table.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Table/table.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwJxB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC"}
|