@rovula/ui 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/DataTable/DataTable.d.ts +10 -1
- package/dist/cjs/types/components/DataTable/DataTable.stories.d.ts +8 -0
- package/dist/components/DataTable/DataTable.js +16 -2
- package/dist/components/DataTable/DataTable.stories.js +15 -0
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/DataTable/DataTable.d.ts +10 -1
- package/dist/esm/types/components/DataTable/DataTable.stories.d.ts +8 -0
- package/dist/index.d.ts +10 -1
- package/dist/src/theme/global.css +31 -31
- package/package.json +1 -1
- package/src/components/DataTable/DataTable.stories.tsx +53 -0
- package/src/components/DataTable/DataTable.tsx +41 -2
- package/src/theme/main-preset.js +4 -0
- package/src/theme/themes/variable.css +31 -31
|
@@ -52,6 +52,15 @@ export interface DataTableProps<TData, TValue> extends DataTableEditingProps<TDa
|
|
|
52
52
|
loading?: boolean;
|
|
53
53
|
/** Label for the initial-loading state (default: "Loading…"). */
|
|
54
54
|
loadingLabel?: string;
|
|
55
|
+
/** Icon rendered in the empty-state placeholder. Replaces the default `ClipboardList` icon. */
|
|
56
|
+
emptyIcon?: React.ReactNode;
|
|
57
|
+
/** Text rendered in the empty-state placeholder (default: "There is no information yet."). */
|
|
58
|
+
emptyText?: React.ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Fully replaces the empty-state cell content. When provided, `emptyIcon` and
|
|
61
|
+
* `emptyText` are ignored.
|
|
62
|
+
*/
|
|
63
|
+
renderEmpty?: () => React.ReactNode;
|
|
55
64
|
/**
|
|
56
65
|
* When true, DataTable will only render a vertical window of rows based on
|
|
57
66
|
* the scroll position of its internal scroll container. This is a basic
|
|
@@ -197,4 +206,4 @@ export interface ColumnManagementOptions {
|
|
|
197
206
|
/** Show "Show all" button. @default true */
|
|
198
207
|
showAll?: boolean;
|
|
199
208
|
}
|
|
200
|
-
export declare function DataTable<TData, TValue>({ data, columns, manualSorting, onSorting, paginationMode, totalCount, pageIndex: controlledPageIndex, pageSize: controlledPageSize, onPaginationChange, pageSizeOptions, fetchMoreData, fetchMoreOffset, fetchingMore, fetchingMoreLabel, loading, loadingLabel, highlightRowId, scrollToHighlightOnMouseLeave, selectable, onRowSelectionChange, rowActions, reorderable, getRowId: getRowIdProp, onRowReorder, isRowReorderLocked, onRowClick, onCellClick, getSubRows, defaultExpanded, expanded: controlledExpanded, onExpandedChange, bordered, surface, striped, divided, rowClassName, cellClassName, headerCellClassName, headerClassName, headerRowClassName, sortIndicatorVisibility, tableLayout, columnManagement: columnManagementProp, resizable, columnMinSize, columnMaxSize, virtualized, virtualRowEstimate, className, enableEditing, editDisplayMode, editTrigger, onCellCommit, alwaysEditing, enableCellTabTraversal, editableColumnIds: editableColumnIdsProp, testId, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
209
|
+
export declare function DataTable<TData, TValue>({ data, columns, manualSorting, onSorting, paginationMode, totalCount, pageIndex: controlledPageIndex, pageSize: controlledPageSize, onPaginationChange, pageSizeOptions, fetchMoreData, fetchMoreOffset, fetchingMore, fetchingMoreLabel, loading, loadingLabel, emptyIcon, emptyText, renderEmpty, highlightRowId, scrollToHighlightOnMouseLeave, selectable, onRowSelectionChange, rowActions, reorderable, getRowId: getRowIdProp, onRowReorder, isRowReorderLocked, onRowClick, onCellClick, getSubRows, defaultExpanded, expanded: controlledExpanded, onExpandedChange, bordered, surface, striped, divided, rowClassName, cellClassName, headerCellClassName, headerClassName, headerRowClassName, sortIndicatorVisibility, tableLayout, columnManagement: columnManagementProp, resizable, columnMinSize, columnMaxSize, virtualized, virtualRowEstimate, className, enableEditing, editDisplayMode, editTrigger, onCellCommit, alwaysEditing, enableCellTabTraversal, editableColumnIds: editableColumnIdsProp, testId, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -48,6 +48,9 @@ declare const meta: {
|
|
|
48
48
|
fetchingMoreLabel?: string | undefined;
|
|
49
49
|
loading?: boolean | undefined;
|
|
50
50
|
loadingLabel?: string | undefined;
|
|
51
|
+
emptyIcon?: React.ReactNode;
|
|
52
|
+
emptyText?: React.ReactNode;
|
|
53
|
+
renderEmpty?: (() => React.ReactNode) | undefined;
|
|
51
54
|
virtualized?: boolean | undefined;
|
|
52
55
|
virtualRowEstimate?: number | undefined;
|
|
53
56
|
highlightRowId?: string | string[] | undefined;
|
|
@@ -165,6 +168,11 @@ export declare const PerformanceLargeDataset: StoryObj;
|
|
|
165
168
|
export declare const WithVirtualizedRows: StoryObj;
|
|
166
169
|
/** Checkbox selection — header checkbox selects all; row checkboxes select individually. */
|
|
167
170
|
export declare const WithSelection: StoryObj;
|
|
171
|
+
/**
|
|
172
|
+
* Select rows then hit "Delete selected" — the header checkbox should clear
|
|
173
|
+
* automatically once the rows are gone (regression test for stale selection state).
|
|
174
|
+
*/
|
|
175
|
+
export declare const WithSelectionAndDelete: StoryObj;
|
|
168
176
|
/**
|
|
169
177
|
* Row highlight + scroll — use `highlightRowId` to visually mark important rows
|
|
170
178
|
* (uses the same token as selected rows) and automatically scroll them into view.
|
package/dist/index.d.ts
CHANGED
|
@@ -958,6 +958,15 @@ interface DataTableProps<TData, TValue> extends DataTableEditingProps<TData> {
|
|
|
958
958
|
loading?: boolean;
|
|
959
959
|
/** Label for the initial-loading state (default: "Loading…"). */
|
|
960
960
|
loadingLabel?: string;
|
|
961
|
+
/** Icon rendered in the empty-state placeholder. Replaces the default `ClipboardList` icon. */
|
|
962
|
+
emptyIcon?: React__default.ReactNode;
|
|
963
|
+
/** Text rendered in the empty-state placeholder (default: "There is no information yet."). */
|
|
964
|
+
emptyText?: React__default.ReactNode;
|
|
965
|
+
/**
|
|
966
|
+
* Fully replaces the empty-state cell content. When provided, `emptyIcon` and
|
|
967
|
+
* `emptyText` are ignored.
|
|
968
|
+
*/
|
|
969
|
+
renderEmpty?: () => React__default.ReactNode;
|
|
961
970
|
/**
|
|
962
971
|
* When true, DataTable will only render a vertical window of rows based on
|
|
963
972
|
* the scroll position of its internal scroll container. This is a basic
|
|
@@ -1103,7 +1112,7 @@ interface ColumnManagementOptions {
|
|
|
1103
1112
|
/** Show "Show all" button. @default true */
|
|
1104
1113
|
showAll?: boolean;
|
|
1105
1114
|
}
|
|
1106
|
-
declare function DataTable<TData, TValue>({ data, columns, manualSorting, onSorting, paginationMode, totalCount, pageIndex: controlledPageIndex, pageSize: controlledPageSize, onPaginationChange, pageSizeOptions, fetchMoreData, fetchMoreOffset, fetchingMore, fetchingMoreLabel, loading, loadingLabel, highlightRowId, scrollToHighlightOnMouseLeave, selectable, onRowSelectionChange, rowActions, reorderable, getRowId: getRowIdProp, onRowReorder, isRowReorderLocked, onRowClick, onCellClick, getSubRows, defaultExpanded, expanded: controlledExpanded, onExpandedChange, bordered, surface, striped, divided, rowClassName, cellClassName, headerCellClassName, headerClassName, headerRowClassName, sortIndicatorVisibility, tableLayout, columnManagement: columnManagementProp, resizable, columnMinSize, columnMaxSize, virtualized, virtualRowEstimate, className, enableEditing, editDisplayMode, editTrigger, onCellCommit, alwaysEditing, enableCellTabTraversal, editableColumnIds: editableColumnIdsProp, testId, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
1115
|
+
declare function DataTable<TData, TValue>({ data, columns, manualSorting, onSorting, paginationMode, totalCount, pageIndex: controlledPageIndex, pageSize: controlledPageSize, onPaginationChange, pageSizeOptions, fetchMoreData, fetchMoreOffset, fetchingMore, fetchingMoreLabel, loading, loadingLabel, emptyIcon, emptyText, renderEmpty, highlightRowId, scrollToHighlightOnMouseLeave, selectable, onRowSelectionChange, rowActions, reorderable, getRowId: getRowIdProp, onRowReorder, isRowReorderLocked, onRowClick, onCellClick, getSubRows, defaultExpanded, expanded: controlledExpanded, onExpandedChange, bordered, surface, striped, divided, rowClassName, cellClassName, headerCellClassName, headerClassName, headerRowClassName, sortIndicatorVisibility, tableLayout, columnManagement: columnManagementProp, resizable, columnMinSize, columnMaxSize, virtualized, virtualRowEstimate, className, enableEditing, editDisplayMode, editTrigger, onCellCommit, alwaysEditing, enableCellTabTraversal, editableColumnIds: editableColumnIdsProp, testId, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
1107
1116
|
|
|
1108
1117
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
1109
1118
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
--state-primary-default-skyller: #2563eb;
|
|
51
51
|
--state-primary-hover-xspector: #ddcd00;
|
|
52
52
|
--state-primary-hover-report-xspector-light-mode: #35475b;
|
|
53
|
-
--state-primary-hover-skyller: #
|
|
53
|
+
--state-primary-hover-skyller: #1e4fbc;
|
|
54
54
|
--state-primary-stroke-xspector: rgba(177 164 0 / 0.48);
|
|
55
55
|
--state-primary-stroke-report-xspector-light-mode: rgba(30 50 73 / 0.64);
|
|
56
56
|
--state-primary-stroke-skyller: rgba(189 189 189 / 0.64);
|
|
57
57
|
--state-primary-hover-bg-xspector: rgba(221 205 0 / 0.08);
|
|
58
58
|
--state-primary-hover-bg-report-xspector-light-mode: rgba(30 50 73 / 0.08);
|
|
59
|
-
--state-primary-hover-bg-skyller: rgba(
|
|
59
|
+
--state-primary-hover-bg-skyller: rgba(30 79 188 / 0.08);
|
|
60
60
|
--state-primary-pressed-xspector: #6f6700;
|
|
61
61
|
--state-primary-pressed-report-xspector-light-mode: #152333;
|
|
62
62
|
--state-primary-pressed-skyller: #1e40af;
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
--state-primary-text-outline-skyller: #2563eb;
|
|
72
72
|
--state-primary-text-hover-xspector: #ddcd00;
|
|
73
73
|
--state-primary-text-hover-report-xspector-light-mode: #35475b;
|
|
74
|
-
--state-primary-text-hover-skyller: #
|
|
74
|
+
--state-primary-text-hover-skyller: #1e4fbc;
|
|
75
75
|
--state-primary-text-pressed-xspector: #6f6700;
|
|
76
76
|
--state-primary-text-pressed-report-xspector-light-mode: #152333;
|
|
77
77
|
--state-primary-text-pressed-skyller: #1e40af;
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
--state-secondary-default-skyller: #171717;
|
|
81
81
|
--state-secondary-hover-xspector: #fafafa;
|
|
82
82
|
--state-secondary-hover-report-xspector-light-mode: #b1a400;
|
|
83
|
-
--state-secondary-hover-skyller: #
|
|
83
|
+
--state-secondary-hover-skyller: #000000;
|
|
84
84
|
--state-secondary-stroke-xspector: rgba(236 236 236 / 0.48);
|
|
85
85
|
--state-secondary-stroke-report-xspector-light-mode: rgba(155 143 0 / 0.64);
|
|
86
86
|
--state-secondary-stroke-skyller: rgba(189 189 189 / 0.64);
|
|
87
87
|
--state-secondary-hover-bg-xspector: rgba(250 250 250 / 0.08);
|
|
88
88
|
--state-secondary-hover-bg-report-xspector-light-mode: rgba(221 205 0 / 0.08);
|
|
89
|
-
--state-secondary-hover-bg-skyller: rgba(
|
|
89
|
+
--state-secondary-hover-bg-skyller: rgba(0 0 0 / 0.08);
|
|
90
90
|
--state-secondary-pressed-xspector: #bbbbbb;
|
|
91
91
|
--state-secondary-pressed-report-xspector-light-mode: #6f6700;
|
|
92
92
|
--state-secondary-pressed-skyller: #000000;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
--state-secondary-text-outline-skyller: #171717;
|
|
102
102
|
--state-secondary-text-hover-xspector: #fafafa;
|
|
103
103
|
--state-secondary-text-hover-report-xspector-light-mode: #b1a400;
|
|
104
|
-
--state-secondary-text-hover-skyller: #
|
|
104
|
+
--state-secondary-text-hover-skyller: #000000;
|
|
105
105
|
--state-secondary-text-pressed-xspector: #c5c5c5;
|
|
106
106
|
--state-secondary-text-pressed-report-xspector-light-mode: #6f6700;
|
|
107
107
|
--state-secondary-text-pressed-skyller: #000000;
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
--state-tertiary-default-skyller: #60a5fa;
|
|
111
111
|
--state-tertiary-hover-xspector: #adcad6;
|
|
112
112
|
--state-tertiary-hover-report-xspector-light-mode: #6f6f6f;
|
|
113
|
-
--state-tertiary-hover-skyller: #
|
|
113
|
+
--state-tertiary-hover-skyller: #4d84c8;
|
|
114
114
|
--state-tertiary-stroke-xspector: rgba(138 162 171 / 0.48);
|
|
115
115
|
--state-tertiary-stroke-report-xspector-light-mode: rgba(79 79 79 / 0.48);
|
|
116
116
|
--state-tertiary-stroke-skyller: rgba(189 189 189 / 0.48);
|
|
117
117
|
--state-tertiary-hover-bg-xspector: rgba(173 202 214 / 0.08);
|
|
118
118
|
--state-tertiary-hover-bg-report-xspector-light-mode: rgba(158 158 158 / 0.08);
|
|
119
|
-
--state-tertiary-hover-bg-skyller: rgba(
|
|
119
|
+
--state-tertiary-hover-bg-skyller: rgba(77 132 200 / 0.08);
|
|
120
120
|
--state-tertiary-pressed-xspector: #57656b;
|
|
121
121
|
--state-tertiary-pressed-report-xspector-light-mode: #b1b1b1;
|
|
122
122
|
--state-tertiary-pressed-skyller: #1e40af;
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
--state-tertiary-text-outline-skyller: #60a5fa;
|
|
132
132
|
--state-tertiary-text-hover-xspector: #adcad6;
|
|
133
133
|
--state-tertiary-text-hover-report-xspector-light-mode: #6f6f6f;
|
|
134
|
-
--state-tertiary-text-hover-skyller: #
|
|
134
|
+
--state-tertiary-text-hover-skyller: #4d84c8;
|
|
135
135
|
--state-tertiary-text-pressed-xspector: #57656b;
|
|
136
136
|
--state-tertiary-text-pressed-report-xspector-light-mode: #b1b1b1;
|
|
137
137
|
--state-tertiary-text-pressed-skyller: #1e40af;
|
|
@@ -140,13 +140,13 @@
|
|
|
140
140
|
--state-info-default-skyller: #2563eb;
|
|
141
141
|
--state-info-hover-xspector: #2998ff;
|
|
142
142
|
--state-info-hover-report-xspector-light-mode: #2998ff;
|
|
143
|
-
--state-info-hover-skyller: #
|
|
143
|
+
--state-info-hover-skyller: #1d4ed8;
|
|
144
144
|
--state-info-stroke-xspector: rgba(27 125 245 / 0.48);
|
|
145
145
|
--state-info-stroke-report-xspector-light-mode: rgba(41 152 255 / 0.48);
|
|
146
146
|
--state-info-stroke-skyller: rgba(37 99 235 / 0.48);
|
|
147
147
|
--state-info-hover-bg-xspector: rgba(41 152 255 / 0.08);
|
|
148
148
|
--state-info-hover-bg-report-xspector-light-mode: rgba(41 152 255 / 0.08);
|
|
149
|
-
--state-info-hover-bg-skyller: rgba(
|
|
149
|
+
--state-info-hover-bg-skyller: rgba(29 78 216 / 0.08);
|
|
150
150
|
--state-info-pressed-xspector: #1752b6;
|
|
151
151
|
--state-info-pressed-report-xspector-light-mode: #1752b6;
|
|
152
152
|
--state-info-pressed-skyller: #1e40af;
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
--state-info-text-outline-skyller: #2563eb;
|
|
162
162
|
--state-info-text-hover-xspector: #2998ff;
|
|
163
163
|
--state-info-text-hover-report-xspector-light-mode: #2998ff;
|
|
164
|
-
--state-info-text-hover-skyller: #
|
|
164
|
+
--state-info-text-hover-skyller: #1d4ed8;
|
|
165
165
|
--state-info-text-pressed-xspector: #1752b6;
|
|
166
166
|
--state-info-text-pressed-report-xspector-light-mode: #1752b6;
|
|
167
167
|
--state-info-text-pressed-skyller: #1e40af;
|
|
@@ -170,13 +170,13 @@
|
|
|
170
170
|
--state-success-default-skyller: #16a34a;
|
|
171
171
|
--state-success-hover-xspector: #54d62c;
|
|
172
172
|
--state-success-hover-report-xspector-light-mode: #54d62c;
|
|
173
|
-
--state-success-hover-skyller: #
|
|
173
|
+
--state-success-hover-skyller: #15803d;
|
|
174
174
|
--state-success-stroke-xspector: rgba(49 153 23 / 0.48);
|
|
175
175
|
--state-success-stroke-report-xspector-light-mode: rgba(68 192 34 / 0.48);
|
|
176
176
|
--state-success-stroke-skyller: rgba(22 163 74 / 0.48);
|
|
177
177
|
--state-success-hover-bg-xspector: rgba(84 214 44 / 0.08);
|
|
178
178
|
--state-success-hover-bg-report-xspector-light-mode: rgba(84 214 44 / 0.08);
|
|
179
|
-
--state-success-hover-bg-skyller: rgba(
|
|
179
|
+
--state-success-hover-bg-skyller: rgba(21 128 61 / 0.08);
|
|
180
180
|
--state-success-pressed-xspector: #235d17;
|
|
181
181
|
--state-success-pressed-report-xspector-light-mode: #235d17;
|
|
182
182
|
--state-success-pressed-skyller: #166534;
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
--state-success-text-outline-skyller: #16a34a;
|
|
192
192
|
--state-success-text-hover-xspector: #54d62c;
|
|
193
193
|
--state-success-text-hover-report-xspector-light-mode: #54d62c;
|
|
194
|
-
--state-success-text-hover-skyller: #
|
|
194
|
+
--state-success-text-hover-skyller: #15803d;
|
|
195
195
|
--state-success-text-pressed-xspector: #235d17;
|
|
196
196
|
--state-success-text-pressed-report-xspector-light-mode: #235d17;
|
|
197
197
|
--state-success-text-pressed-skyller: #166534;
|
|
@@ -200,13 +200,13 @@
|
|
|
200
200
|
--state-warning-default-skyller: #f59e0b;
|
|
201
201
|
--state-warning-hover-xspector: #ffdf1b;
|
|
202
202
|
--state-warning-hover-report-xspector-light-mode: #ffdf1b;
|
|
203
|
-
--state-warning-hover-skyller: #
|
|
203
|
+
--state-warning-hover-skyller: #d97706;
|
|
204
204
|
--state-warning-stroke-xspector: rgba(255 193 7 / 0.48);
|
|
205
205
|
--state-warning-stroke-report-xspector-light-mode: rgba(255 223 27 / 0.48);
|
|
206
206
|
--state-warning-stroke-skyller: rgba(245 158 11 / 0.48);
|
|
207
207
|
--state-warning-hover-bg-xspector: rgba(255 193 7 / 0.08);
|
|
208
208
|
--state-warning-hover-bg-report-xspector-light-mode: rgba(255 193 7 / 0.08);
|
|
209
|
-
--state-warning-hover-bg-skyller: rgba(
|
|
209
|
+
--state-warning-hover-bg-skyller: rgba(217 119 6 / 0.08);
|
|
210
210
|
--state-warning-pressed-xspector: #985108;
|
|
211
211
|
--state-warning-pressed-report-xspector-light-mode: #985108;
|
|
212
212
|
--state-warning-pressed-skyller: #d97706;
|
|
@@ -221,22 +221,22 @@
|
|
|
221
221
|
--state-warning-text-outline-skyller: #f59e0b;
|
|
222
222
|
--state-warning-text-hover-xspector: #ffdf1b;
|
|
223
223
|
--state-warning-text-hover-report-xspector-light-mode: #ffdf1b;
|
|
224
|
-
--state-warning-text-hover-skyller: #
|
|
224
|
+
--state-warning-text-hover-skyller: #d97706;
|
|
225
225
|
--state-warning-text-pressed-xspector: #985108;
|
|
226
226
|
--state-warning-text-pressed-report-xspector-light-mode: #985108;
|
|
227
|
-
--state-warning-text-pressed-skyller: #
|
|
227
|
+
--state-warning-text-pressed-skyller: #92400e;
|
|
228
228
|
--state-error-default-xspector: #ff4d35;
|
|
229
229
|
--state-error-default-report-xspector-light-mode: #ed2f15;
|
|
230
230
|
--state-error-default-skyller: #ef4444;
|
|
231
231
|
--state-error-hover-xspector: #f87171;
|
|
232
232
|
--state-error-hover-report-xspector-light-mode: #ff4d35;
|
|
233
|
-
--state-error-hover-skyller: #
|
|
233
|
+
--state-error-hover-skyller: #b91c1c;
|
|
234
234
|
--state-error-stroke-xspector: rgba(255 77 53 / 0.48);
|
|
235
235
|
--state-error-stroke-report-xspector-light-mode: rgba(237 47 21 / 0.64);
|
|
236
236
|
--state-error-stroke-skyller: rgba(220 38 38 / 0.64);
|
|
237
237
|
--state-error-hover-bg-xspector: rgba(248 113 113 / 0.08);
|
|
238
238
|
--state-error-hover-bg-report-xspector-light-mode: rgba(255 77 53 / 0.08);
|
|
239
|
-
--state-error-hover-bg-skyller: rgba(
|
|
239
|
+
--state-error-hover-bg-skyller: rgba(185 28 28 / 0.08);
|
|
240
240
|
--state-error-pressed-xspector: #a5210f;
|
|
241
241
|
--state-error-pressed-report-xspector-light-mode: #a5210f;
|
|
242
242
|
--state-error-pressed-skyller: #991b1b;
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
--state-error-text-outline-skyller: #dc2626;
|
|
252
252
|
--state-error-text-hover-xspector: #f87171;
|
|
253
253
|
--state-error-text-hover-report-xspector-light-mode: #ff4d35;
|
|
254
|
-
--state-error-text-hover-skyller: #
|
|
254
|
+
--state-error-text-hover-skyller: #b91c1c;
|
|
255
255
|
--state-error-text-pressed-xspector: #a5210f;
|
|
256
256
|
--state-error-text-pressed-report-xspector-light-mode: #a5210f;
|
|
257
257
|
--state-error-text-pressed-skyller: #991b1b;
|
|
@@ -872,13 +872,13 @@
|
|
|
872
872
|
--function-default-solid-skyller: #171717;
|
|
873
873
|
--function-default-hover-xspector: #fafafa;
|
|
874
874
|
--function-default-hover-report-xspector-light-mode: #35475b;
|
|
875
|
-
--function-default-hover-skyller: #
|
|
875
|
+
--function-default-hover-skyller: #000000;
|
|
876
876
|
--function-default-hover-bg-xspector: rgba(250 250 250 / 0.08);
|
|
877
877
|
--function-default-hover-bg-report-xspector-light-mode: rgba(30 50 73 / 0.08);
|
|
878
878
|
--function-default-hover-bg-skyller: rgba(23 23 23 / 0.08);
|
|
879
879
|
--function-default-stroke-xspector: rgba(158 158 158 / 0.24);
|
|
880
880
|
--function-default-stroke-report-xspector-light-mode: rgba(30 50 73 / 0.48);
|
|
881
|
-
--function-default-stroke-skyller: rgba(
|
|
881
|
+
--function-default-stroke-skyller: rgba(0 0 0 / 0.48);
|
|
882
882
|
--function-default-icon-xspector: #212b36;
|
|
883
883
|
--function-default-icon-report-xspector-light-mode: #ffffff;
|
|
884
884
|
--function-default-icon-skyller: #ffffff;
|
|
@@ -890,13 +890,13 @@
|
|
|
890
890
|
--function-active-solid-skyller: #2563eb;
|
|
891
891
|
--function-active-hover-xspector: #ddcd00;
|
|
892
892
|
--function-active-hover-report-xspector-light-mode: #b1a400;
|
|
893
|
-
--function-active-hover-skyller: #
|
|
893
|
+
--function-active-hover-skyller: #1e4fbc;
|
|
894
894
|
--function-active-hover-bg-xspector: rgba(221 205 0 / 0.08);
|
|
895
895
|
--function-active-hover-bg-report-xspector-light-mode: rgba(221 205 0 / 0.08);
|
|
896
896
|
--function-active-hover-bg-skyller: rgba(81 130 239 / 0.08);
|
|
897
897
|
--function-active-stroke-xspector: rgba(177 164 0 / 0.48);
|
|
898
898
|
--function-active-stroke-report-xspector-light-mode: rgba(177 164 0 / 0.48);
|
|
899
|
-
--function-active-stroke-skyller: rgba(
|
|
899
|
+
--function-active-stroke-skyller: rgba(30 79 188 / 0.48);
|
|
900
900
|
--function-active-icon-xspector: #212b36;
|
|
901
901
|
--function-active-icon-report-xspector-light-mode: #ffffff;
|
|
902
902
|
--function-active-icon-skyller: #ffffff;
|
|
@@ -1055,7 +1055,7 @@
|
|
|
1055
1055
|
--bg-stroke5-skyller: #000000;
|
|
1056
1056
|
--table-bg-main-xspector: #091a2a;
|
|
1057
1057
|
--table-bg-main-report-xspector-light-mode: #e5e5e5;
|
|
1058
|
-
--table-bg-main-skyller: #
|
|
1058
|
+
--table-bg-main-skyller: #bfdbfd;
|
|
1059
1059
|
--table-bg-line-xspector: #1c3955;
|
|
1060
1060
|
--table-bg-line-report-xspector-light-mode: #d2d2d2;
|
|
1061
1061
|
--table-bg-line-skyller: #ececec;
|
|
@@ -1064,13 +1064,13 @@
|
|
|
1064
1064
|
--table-bg-a-skyller: #fdfdfd;
|
|
1065
1065
|
--table-bg-b-xspector: #0f2f50;
|
|
1066
1066
|
--table-bg-b-report-xspector-light-mode: #f3f3f3;
|
|
1067
|
-
--table-bg-b-skyller: #
|
|
1067
|
+
--table-bg-b-skyller: #eff6ff;
|
|
1068
1068
|
--table-panel-hover-xspector: #343638;
|
|
1069
1069
|
--table-panel-hover-report-xspector-light-mode: #d4d4d4;
|
|
1070
|
-
--table-panel-hover-skyller: #
|
|
1070
|
+
--table-panel-hover-skyller: #dfedfe;
|
|
1071
1071
|
--table-bg-hover-xspector: #103861;
|
|
1072
1072
|
--table-bg-hover-report-xspector-light-mode: #ffffff;
|
|
1073
|
-
--table-bg-hover-skyller: #
|
|
1073
|
+
--table-bg-hover-skyller: #cfe4fd;
|
|
1074
1074
|
--table-panel-sub-line-xspector: #393b3f;
|
|
1075
1075
|
--table-panel-sub-line-report-xspector-light-mode: #d4d4d4;
|
|
1076
1076
|
--table-panel-sub-line-skyller: #ececec;
|
|
@@ -1079,7 +1079,7 @@
|
|
|
1079
1079
|
--table-panel-main-line-skyller: #d4d4d4;
|
|
1080
1080
|
--table-panel-selected-xspector: #6f6700;
|
|
1081
1081
|
--table-panel-selected-report-xspector-light-mode: #d4d4d4;
|
|
1082
|
-
--table-panel-selected-skyller: #
|
|
1082
|
+
--table-panel-selected-skyller: #afd2fd;
|
|
1083
1083
|
--modal-dropdown-surface-xspector: #252628;
|
|
1084
1084
|
--modal-dropdown-surface-report-xspector-light-mode: #ffffff;
|
|
1085
1085
|
--modal-dropdown-surface-skyller: #ffffff;
|
package/package.json
CHANGED
|
@@ -814,6 +814,59 @@ export const WithSelection: StoryObj = {
|
|
|
814
814
|
},
|
|
815
815
|
};
|
|
816
816
|
|
|
817
|
+
/**
|
|
818
|
+
* Select rows then hit "Delete selected" — the header checkbox should clear
|
|
819
|
+
* automatically once the rows are gone (regression test for stale selection state).
|
|
820
|
+
*/
|
|
821
|
+
export const WithSelectionAndDelete: StoryObj = {
|
|
822
|
+
render: () => {
|
|
823
|
+
const [rows, setRows] = React.useState<Project[]>(projectData);
|
|
824
|
+
const [selected, setSelected] = React.useState<Record<string, boolean>>({});
|
|
825
|
+
|
|
826
|
+
const selectedIds = Object.keys(selected).filter((k) => selected[k]);
|
|
827
|
+
|
|
828
|
+
const handleDelete = () => {
|
|
829
|
+
setRows((prev) => prev.filter((r) => !selected[r.id]));
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
return (
|
|
833
|
+
<div className="flex flex-col gap-3 w-full h-full">
|
|
834
|
+
<div className="flex items-center gap-3 px-1">
|
|
835
|
+
<p className="typography-small2 text-text-g-contrast-high flex-1">
|
|
836
|
+
Selected IDs: {selectedIds.join(", ") || "–"}
|
|
837
|
+
</p>
|
|
838
|
+
<Button
|
|
839
|
+
size="sm"
|
|
840
|
+
variant="solid"
|
|
841
|
+
color="error"
|
|
842
|
+
disabled={selectedIds.length === 0}
|
|
843
|
+
onClick={handleDelete}
|
|
844
|
+
startIcon={<Trash2 className="size-4" />}
|
|
845
|
+
>
|
|
846
|
+
Delete selected ({selectedIds.length})
|
|
847
|
+
</Button>
|
|
848
|
+
<Button
|
|
849
|
+
size="sm"
|
|
850
|
+
variant="outline"
|
|
851
|
+
onClick={() => setRows(projectData)}
|
|
852
|
+
>
|
|
853
|
+
Reset
|
|
854
|
+
</Button>
|
|
855
|
+
</div>
|
|
856
|
+
<DataTable
|
|
857
|
+
columns={projectColumns}
|
|
858
|
+
data={rows}
|
|
859
|
+
getRowId={(r) => r.id}
|
|
860
|
+
selectable
|
|
861
|
+
onRowSelectionChange={setSelected}
|
|
862
|
+
striped
|
|
863
|
+
divided
|
|
864
|
+
/>
|
|
865
|
+
</div>
|
|
866
|
+
);
|
|
867
|
+
},
|
|
868
|
+
};
|
|
869
|
+
|
|
817
870
|
/**
|
|
818
871
|
* Row highlight + scroll — use `highlightRowId` to visually mark important rows
|
|
819
872
|
* (uses the same token as selected rows) and automatically scroll them into view.
|
|
@@ -345,6 +345,15 @@ export interface DataTableProps<TData, TValue>
|
|
|
345
345
|
loading?: boolean;
|
|
346
346
|
/** Label for the initial-loading state (default: "Loading…"). */
|
|
347
347
|
loadingLabel?: string;
|
|
348
|
+
/** Icon rendered in the empty-state placeholder. Replaces the default `ClipboardList` icon. */
|
|
349
|
+
emptyIcon?: React.ReactNode;
|
|
350
|
+
/** Text rendered in the empty-state placeholder (default: "There is no information yet."). */
|
|
351
|
+
emptyText?: React.ReactNode;
|
|
352
|
+
/**
|
|
353
|
+
* Fully replaces the empty-state cell content. When provided, `emptyIcon` and
|
|
354
|
+
* `emptyText` are ignored.
|
|
355
|
+
*/
|
|
356
|
+
renderEmpty?: () => React.ReactNode;
|
|
348
357
|
|
|
349
358
|
// --- Virtualization (experimental) ---
|
|
350
359
|
/**
|
|
@@ -1055,6 +1064,9 @@ export function DataTable<TData, TValue>({
|
|
|
1055
1064
|
fetchingMoreLabel = "Loading more…",
|
|
1056
1065
|
loading = false,
|
|
1057
1066
|
loadingLabel = "Loading…",
|
|
1067
|
+
emptyIcon,
|
|
1068
|
+
emptyText = "There is no information yet.",
|
|
1069
|
+
renderEmpty,
|
|
1058
1070
|
highlightRowId,
|
|
1059
1071
|
scrollToHighlightOnMouseLeave = false,
|
|
1060
1072
|
selectable = false,
|
|
@@ -1380,6 +1392,23 @@ export function DataTable<TData, TValue>({
|
|
|
1380
1392
|
onRowSelectionChange?.(rowSelection);
|
|
1381
1393
|
}, [rowSelection, onRowSelectionChange]);
|
|
1382
1394
|
|
|
1395
|
+
// Prune stale selection keys when rows are removed (e.g. after deleting selected rows).
|
|
1396
|
+
useEffect(() => {
|
|
1397
|
+
if (!selectable) return;
|
|
1398
|
+
const currentIds = new Set(
|
|
1399
|
+
table.getRowModel().rows.map((r) => r.id),
|
|
1400
|
+
);
|
|
1401
|
+
setRowSelection((prev) => {
|
|
1402
|
+
const pruned = Object.fromEntries(
|
|
1403
|
+
Object.entries(prev).filter(([id]) => currentIds.has(id)),
|
|
1404
|
+
);
|
|
1405
|
+
// Avoid re-render if nothing changed.
|
|
1406
|
+
if (Object.keys(pruned).length === Object.keys(prev).length) return prev;
|
|
1407
|
+
return pruned;
|
|
1408
|
+
});
|
|
1409
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1410
|
+
}, [data, selectable]);
|
|
1411
|
+
|
|
1383
1412
|
// Infinite scroll — listener on the wrapper div
|
|
1384
1413
|
useEffect(() => {
|
|
1385
1414
|
if (paginationMode !== "infinite") return;
|
|
@@ -2282,8 +2311,18 @@ export function DataTable<TData, TValue>({
|
|
|
2282
2311
|
className="typography-body1 text-text-g-contrast-medium text-center h-full"
|
|
2283
2312
|
>
|
|
2284
2313
|
<div className="flex flex-1 h-full flex-col items-center justify-center gap-3 py-16">
|
|
2285
|
-
|
|
2286
|
-
|
|
2314
|
+
{renderEmpty ? (
|
|
2315
|
+
renderEmpty()
|
|
2316
|
+
) : (
|
|
2317
|
+
<>
|
|
2318
|
+
{emptyIcon !== undefined ? (
|
|
2319
|
+
emptyIcon
|
|
2320
|
+
) : (
|
|
2321
|
+
<ClipboardList className="w-8 text-secondary-120" />
|
|
2322
|
+
)}
|
|
2323
|
+
{emptyText}
|
|
2324
|
+
</>
|
|
2325
|
+
)}
|
|
2287
2326
|
</div>
|
|
2288
2327
|
</TableCell>
|
|
2289
2328
|
</TableRow>
|
package/src/theme/main-preset.js
CHANGED
|
@@ -325,6 +325,10 @@ module.exports = {
|
|
|
325
325
|
"accordion-down": "accordion-down 0.2s ease-out",
|
|
326
326
|
"accordion-up": "accordion-up 0.2s ease-out",
|
|
327
327
|
},
|
|
328
|
+
boxShadow: {
|
|
329
|
+
card: "0 6px 12px 0 rgba(0, 0, 0, 0.08)",
|
|
330
|
+
modal: "0 12px 24px -4px rgba(0, 0, 0, 0.12)",
|
|
331
|
+
},
|
|
328
332
|
},
|
|
329
333
|
},
|
|
330
334
|
presets: [require("./presets/colors"), require("tailwindcss-animate")],
|