@optimum-intelligence/opti-ui 0.8.0 → 0.9.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/README.md +3 -3
  3. package/dist/components/app-shell/AppShell.d.ts +6 -1
  4. package/dist/components/app-shell/AppShell.js +99 -94
  5. package/dist/components/app-shell/AppShell.js.map +1 -1
  6. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +6 -1
  7. package/dist/components/breadcrumbs/Breadcrumbs.js +42 -40
  8. package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
  9. package/dist/components/calendar/Calendar.js +29 -17
  10. package/dist/components/calendar/Calendar.js.map +1 -1
  11. package/dist/components/combobox/Combobox.d.ts +1 -1
  12. package/dist/components/combobox/Combobox.js +38 -29
  13. package/dist/components/combobox/Combobox.js.map +1 -1
  14. package/dist/components/command-palette/CommandPalette.d.ts +13 -4
  15. package/dist/components/command-palette/CommandPalette.js +91 -89
  16. package/dist/components/command-palette/CommandPalette.js.map +1 -1
  17. package/dist/components/data-table/DataTable.d.ts +38 -13
  18. package/dist/components/data-table/DataTable.js +421 -266
  19. package/dist/components/data-table/DataTable.js.map +1 -1
  20. package/dist/components/data-table/DataTableContent.d.ts +7 -1
  21. package/dist/components/data-table/DataTableContent.js +246 -210
  22. package/dist/components/data-table/DataTableContent.js.map +1 -1
  23. package/dist/components/data-table/DataTableFilters.d.ts +4 -3
  24. package/dist/components/data-table/DataTableFilters.js +311 -194
  25. package/dist/components/data-table/DataTableFilters.js.map +1 -1
  26. package/dist/components/data-table/DataTableRow.js +76 -72
  27. package/dist/components/data-table/DataTableRow.js.map +1 -1
  28. package/dist/components/data-table/layout.d.ts +5 -0
  29. package/dist/components/data-table/layout.js +23 -1
  30. package/dist/components/data-table/layout.js.map +1 -1
  31. package/dist/components/data-table/types.d.ts +57 -3
  32. package/dist/components/data-table/useDataTable.d.ts +1 -1
  33. package/dist/components/data-table/useDataTable.js +396 -351
  34. package/dist/components/data-table/useDataTable.js.map +1 -1
  35. package/dist/components/dialog/ConfirmDialog.d.ts +6 -1
  36. package/dist/components/dialog/ConfirmDialog.js +88 -85
  37. package/dist/components/dialog/ConfirmDialog.js.map +1 -1
  38. package/dist/components/progress/Progress.d.ts +2 -1
  39. package/dist/components/progress/Progress.js.map +1 -1
  40. package/dist/components/stat-card/StatCard.d.ts +7 -2
  41. package/dist/components/stat-card/StatCard.js +1 -1
  42. package/dist/components/stat-card/StatCard.js.map +1 -1
  43. package/dist/components/table/Table.d.ts +5 -1
  44. package/dist/components/table/Table.js +2 -1
  45. package/dist/components/table/Table.js.map +1 -1
  46. package/dist/components.json +124 -18
  47. package/dist/fonts/JetBrainsMono-OFL.txt +93 -0
  48. package/dist/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  49. package/dist/fonts/jetbrains-mono-latin.woff2 +0 -0
  50. package/dist/fonts.css +22 -1
  51. package/dist/icons/index.d.ts +4 -0
  52. package/dist/icons/index.js +12 -1
  53. package/dist/icons/index.js.map +1 -1
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.js +3 -2
  56. package/dist/labels/Labels.d.ts +9 -1
  57. package/dist/labels/Labels.js +4 -0
  58. package/dist/labels/Labels.js.map +1 -1
  59. package/dist/labels/hu.d.ts +17 -0
  60. package/dist/labels/hu.js +124 -0
  61. package/dist/labels/hu.js.map +1 -0
  62. package/dist/llms-full.txt +60 -17
  63. package/dist/llms.txt +2 -1
  64. package/dist/opti-ui.css +303 -70
  65. package/dist/utils/scroll-fade.d.ts +5 -1
  66. package/dist/utils/scroll-fade.js +11 -1
  67. package/dist/utils/scroll-fade.js.map +1 -1
  68. package/package.json +1 -1
@@ -1,14 +1,16 @@
1
1
  "use client";
2
2
  import { cx } from "../../utils/cx.js";
3
+ import { XIcon } from "../../icons/index.js";
3
4
  import { Skeleton } from "../skeleton/Skeleton.js";
4
- import { Button } from "../button/Button.js";
5
+ import { Button, IconButton } from "../button/Button.js";
5
6
  import { Checkbox } from "../choice/Choice.js";
6
7
  import { useMediaQuery } from "../../utils/media.js";
8
+ import { Tooltip } from "../tooltip/Tooltip.js";
7
9
  import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../table/Table.js";
8
10
  import { useDataTableContext } from "./context.js";
9
11
  import { EmptyState } from "../empty-state/EmptyState.js";
10
12
  import { DataTableRow, SizerRow, isTextEditor } from "./DataTableRow.js";
11
- import { pickSizerRows, useColumnLock, usePageHeight, useVirtualRows } from "./layout.js";
13
+ import { pickSizerRows, useColumnLock, useHeaderHeight, usePageHeight, useVirtualRows } from "./layout.js";
12
14
  import { c } from "react/compiler-runtime";
13
15
  import * as React from "react";
14
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -20,8 +22,8 @@ var ROW_ESTIMATE = {
20
22
  };
21
23
  /** The table itself, with its loading, empty and error states. */
22
24
  function DataTableContent(t0) {
23
- const $ = c(94);
24
- const { density: t1, striped, stickyHeader, layout: t2, maxHeight, virtualized: t3, onEndReached, stickyFirstColumn: t4, empty, tableProps } = t0;
25
+ const $ = c(96);
26
+ const { density: t1, striped, stickyHeader, layout: t2, maxHeight, virtualized: t3, onEndReached, stickyFirstColumn: t4, empty, tableProps, selectionActions } = t0;
25
27
  const density = t1 === void 0 ? "normal" : t1;
26
28
  const layout = t2 === void 0 ? "stable" : t2;
27
29
  const virtualized = t3 === void 0 ? false : t3;
@@ -56,205 +58,216 @@ function DataTableContent(t0) {
56
58
  } else t7 = $[4];
57
59
  const shown = t7;
58
60
  const span = columns.length + Number(table.selectable) + Number(hasActions);
61
+ let t8;
62
+ if ($[5] !== table.selectable || $[6] !== table.selection) {
63
+ t8 = table.selectable ? new Set(table.selection).size : 0;
64
+ $[5] = table.selectable;
65
+ $[6] = table.selection;
66
+ $[7] = t8;
67
+ } else t8 = $[7];
68
+ const selected = t8;
59
69
  const columnKey = [
60
70
  density,
61
71
  table.selectable,
62
72
  hasActions,
63
73
  ...columns.map(_temp2)
64
74
  ].join("|");
65
- const { lock, measuring } = useColumnLock(anchor, stable, columnKey, shown.length > 0);
66
- const t8 = ROW_ESTIMATE[density];
67
- const t9 = typeof maxHeight === "number" ? maxHeight : 512;
68
- let t10;
69
- if ($[5] !== density || $[6] !== overscan || $[7] !== rowHeight || $[8] !== shown.length || $[9] !== t8 || $[10] !== t9 || $[11] !== virtual) {
70
- t10 = {
75
+ const { lock, measuring } = useColumnLock(anchor, stable, columnKey, shown.length > 0 && !selected);
76
+ const headerHeight = useHeaderHeight(anchor, !selected);
77
+ const t9 = ROW_ESTIMATE[density];
78
+ const t10 = typeof maxHeight === "number" ? maxHeight : 512;
79
+ let t11;
80
+ if ($[8] !== density || $[9] !== overscan || $[10] !== rowHeight || $[11] !== shown.length || $[12] !== t10 || $[13] !== t9 || $[14] !== virtual) {
81
+ t11 = {
71
82
  enabled: virtual,
72
83
  count: shown.length,
73
84
  rowHeight,
74
85
  overscan,
75
- estimate: t8,
76
- viewport: t9,
86
+ estimate: t9,
87
+ viewport: t10,
77
88
  key: density
78
89
  };
79
- $[5] = density;
80
- $[6] = overscan;
81
- $[7] = rowHeight;
82
- $[8] = shown.length;
83
- $[9] = t8;
84
- $[10] = t9;
85
- $[11] = virtual;
90
+ $[8] = density;
91
+ $[9] = overscan;
92
+ $[10] = rowHeight;
93
+ $[11] = shown.length;
86
94
  $[12] = t10;
87
- } else t10 = $[12];
88
- const rows = useVirtualRows(anchor, t10);
89
- let t11;
90
- if ($[13] !== rows.end || $[14] !== rows.start || $[15] !== shown || $[16] !== virtual) {
91
- t11 = virtual ? shown.slice(rows.start, rows.end) : shown;
92
- $[13] = rows.end;
93
- $[14] = rows.start;
94
- $[15] = shown;
95
- $[16] = virtual;
96
- $[17] = t11;
97
- } else t11 = $[17];
98
- const rendered = t11;
95
+ $[13] = t9;
96
+ $[14] = virtual;
97
+ $[15] = t11;
98
+ } else t11 = $[15];
99
+ const rows = useVirtualRows(anchor, t11);
100
+ let t12;
101
+ if ($[16] !== rows.end || $[17] !== rows.start || $[18] !== shown || $[19] !== virtual) {
102
+ t12 = virtual ? shown.slice(rows.start, rows.end) : shown;
103
+ $[16] = rows.end;
104
+ $[17] = rows.start;
105
+ $[18] = shown;
106
+ $[19] = virtual;
107
+ $[20] = t12;
108
+ } else t12 = $[20];
109
+ const rendered = t12;
99
110
  const sizers = measuring && table.allRows.length > rendered.length ? pickSizerRows(table.allRows, columns) : [];
100
111
  const holdsPage = stable && table.paginated && !scrolls;
101
112
  const pageHeight = usePageHeight(anchor, holdsPage, shown.length === table.pageSize, `${density}|${table.pageSize}`);
102
113
  const shortPage = table.page > 1 && shown.length > 0 && shown.length < table.pageSize;
103
- let t12;
104
- if ($[18] !== density || $[19] !== loading || $[20] !== onEndReached || $[21] !== scrolls || $[22] !== shown.length) {
105
- t12 = (wrapper) => {
114
+ let t13;
115
+ if ($[21] !== density || $[22] !== loading || $[23] !== onEndReached || $[24] !== scrolls || $[25] !== shown.length) {
116
+ t13 = (wrapper) => {
106
117
  if (!onEndReached || !scrolls || loading || !shown.length || reported.current === shown.length) return;
107
118
  if (wrapper.scrollHeight - wrapper.scrollTop - wrapper.clientHeight > 4 * ROW_ESTIMATE[density]) return;
108
119
  reported.current = shown.length;
109
120
  onEndReached();
110
121
  };
111
- $[18] = density;
112
- $[19] = loading;
113
- $[20] = onEndReached;
114
- $[21] = scrolls;
115
- $[22] = shown.length;
116
- $[23] = t12;
117
- } else t12 = $[23];
118
- const reportEnd = t12;
119
- const t13 = table.page;
120
- const t14 = table.search;
121
- const t15 = table.sort?.id;
122
- const t16 = table.sort?.direction;
123
- let t17;
124
- if ($[24] !== table.filterValues) {
125
- t17 = JSON.stringify(table.filterValues);
126
- $[24] = table.filterValues;
127
- $[25] = t17;
128
- } else t17 = $[25];
122
+ $[21] = density;
123
+ $[22] = loading;
124
+ $[23] = onEndReached;
125
+ $[24] = scrolls;
126
+ $[25] = shown.length;
127
+ $[26] = t13;
128
+ } else t13 = $[26];
129
+ const reportEnd = t13;
130
+ const t14 = table.page;
131
+ const t15 = table.search;
132
+ const t16 = table.sort?.id;
133
+ const t17 = table.sort?.direction;
129
134
  let t18;
130
- if ($[26] !== t15 || $[27] !== t16 || $[28] !== t17 || $[29] !== table.page || $[30] !== table.search) {
131
- t18 = [
132
- t13,
135
+ if ($[27] !== table.filterValues) {
136
+ t18 = JSON.stringify(table.filterValues);
137
+ $[27] = table.filterValues;
138
+ $[28] = t18;
139
+ } else t18 = $[28];
140
+ let t19;
141
+ if ($[29] !== t16 || $[30] !== t17 || $[31] !== t18 || $[32] !== table.page || $[33] !== table.search) {
142
+ t19 = [
133
143
  t14,
134
144
  t15,
135
145
  t16,
136
- t17
146
+ t17,
147
+ t18
137
148
  ];
138
- $[26] = t15;
139
- $[27] = t16;
140
- $[28] = t17;
141
- $[29] = table.page;
142
- $[30] = table.search;
149
+ $[29] = t16;
150
+ $[30] = t17;
143
151
  $[31] = t18;
144
- } else t18 = $[31];
145
- const view = t18.join("|");
146
- let t19;
147
- if ($[32] !== anchor || $[33] !== scrolls) {
148
- t19 = () => {
149
- if (scrolls) anchor?.closest("table")?.parentElement?.scrollTo({ top: 0 });
150
- };
151
- $[32] = anchor;
152
- $[33] = scrolls;
152
+ $[32] = table.page;
153
+ $[33] = table.search;
153
154
  $[34] = t19;
154
155
  } else t19 = $[34];
156
+ const view = t19.join("|");
155
157
  let t20;
156
- if ($[35] !== anchor || $[36] !== scrolls || $[37] !== view) {
157
- t20 = [
158
+ if ($[35] !== anchor || $[36] !== scrolls) {
159
+ t20 = () => {
160
+ if (scrolls) anchor?.closest("table")?.parentElement?.scrollTo({ top: 0 });
161
+ };
162
+ $[35] = anchor;
163
+ $[36] = scrolls;
164
+ $[37] = t20;
165
+ } else t20 = $[37];
166
+ let t21;
167
+ if ($[38] !== anchor || $[39] !== scrolls || $[40] !== view) {
168
+ t21 = [
158
169
  anchor,
159
170
  scrolls,
160
171
  view
161
172
  ];
162
- $[35] = anchor;
163
- $[36] = scrolls;
164
- $[37] = view;
165
- $[38] = t20;
166
- } else t20 = $[38];
167
- React.useEffect(t19, t20);
168
- let t21;
169
- if ($[39] !== anchor || $[40] !== reportEnd) {
170
- t21 = () => {
171
- const wrapper_0 = anchor?.closest("table")?.parentElement;
172
- if (wrapper_0) reportEnd(wrapper_0);
173
- };
174
- $[39] = anchor;
175
- $[40] = reportEnd;
173
+ $[38] = anchor;
174
+ $[39] = scrolls;
175
+ $[40] = view;
176
176
  $[41] = t21;
177
177
  } else t21 = $[41];
178
- React.useEffect(t21);
178
+ React.useEffect(t20, t21);
179
179
  let t22;
180
- if ($[42] !== lock || $[43] !== tableProps?.style) {
181
- t22 = lock ? {
180
+ if ($[42] !== anchor || $[43] !== reportEnd) {
181
+ t22 = () => {
182
+ const wrapper_0 = anchor?.closest("table")?.parentElement;
183
+ if (wrapper_0) reportEnd(wrapper_0);
184
+ };
185
+ $[42] = anchor;
186
+ $[43] = reportEnd;
187
+ $[44] = t22;
188
+ } else t22 = $[44];
189
+ React.useEffect(t22);
190
+ let t23;
191
+ if ($[45] !== lock || $[46] !== table.selectable || $[47] !== tableProps?.style) {
192
+ t23 = lock ? {
182
193
  width: lock.table,
183
194
  minWidth: "100%",
195
+ ...table.selectable && { "--_check-width": `${lock.widths[0]}px` },
184
196
  ...tableProps?.style
185
197
  } : tableProps?.style;
186
- $[42] = lock;
187
- $[43] = tableProps?.style;
188
- $[44] = t22;
189
- } else t22 = $[44];
190
- const t23 = tableProps?.wrapperProps;
191
- const t24 = scrolls && "oui-data-table__scroll";
192
- const t25 = tableProps?.wrapperProps?.className;
193
- let t26;
194
- if ($[45] !== t24 || $[46] !== t25) {
195
- t26 = cx(t24, t25);
196
- $[45] = t24;
197
- $[46] = t25;
198
- $[47] = t26;
199
- } else t26 = $[47];
200
- const t27 = holdsPage && shortPage ? pageHeight : void 0;
201
- const t28 = tableProps?.wrapperProps?.style;
202
- let t29;
203
- if ($[48] !== height || $[49] !== t27 || $[50] !== t28) {
204
- t29 = {
205
- maxHeight: height,
206
- minHeight: t27,
207
- ...t28
208
- };
209
- $[48] = height;
210
- $[49] = t27;
211
- $[50] = t28;
212
- $[51] = t29;
213
- } else t29 = $[51];
198
+ $[45] = lock;
199
+ $[46] = table.selectable;
200
+ $[47] = tableProps?.style;
201
+ $[48] = t23;
202
+ } else t23 = $[48];
203
+ const t24 = tableProps?.wrapperProps;
204
+ const t25 = scrolls && "oui-data-table__scroll";
205
+ const t26 = tableProps?.wrapperProps?.className;
206
+ let t27;
207
+ if ($[49] !== t25 || $[50] !== t26) {
208
+ t27 = cx(t25, t26);
209
+ $[49] = t25;
210
+ $[50] = t26;
211
+ $[51] = t27;
212
+ } else t27 = $[51];
213
+ const t28 = holdsPage && shortPage ? pageHeight : void 0;
214
+ const t29 = tableProps?.wrapperProps?.style;
214
215
  let t30;
215
- if ($[52] !== reportEnd || $[53] !== rows || $[54] !== tableProps?.wrapperProps) {
216
- t30 = (event) => {
217
- tableProps?.wrapperProps?.onScroll?.(event);
218
- rows.onScroll(event);
219
- reportEnd(event.currentTarget);
216
+ if ($[52] !== height || $[53] !== t28 || $[54] !== t29) {
217
+ t30 = {
218
+ maxHeight: height,
219
+ minHeight: t28,
220
+ ...t29
220
221
  };
221
- $[52] = reportEnd;
222
- $[53] = rows;
223
- $[54] = tableProps?.wrapperProps;
222
+ $[52] = height;
223
+ $[53] = t28;
224
+ $[54] = t29;
224
225
  $[55] = t30;
225
226
  } else t30 = $[55];
226
227
  let t31;
227
- if ($[56] !== t23 || $[57] !== t26 || $[58] !== t29 || $[59] !== t30) {
228
- t31 = {
229
- ...t23,
230
- className: t26,
231
- style: t29,
232
- onScroll: t30
228
+ if ($[56] !== reportEnd || $[57] !== rows || $[58] !== tableProps?.wrapperProps) {
229
+ t31 = (event) => {
230
+ tableProps?.wrapperProps?.onScroll?.(event);
231
+ rows.onScroll(event);
232
+ reportEnd(event.currentTarget);
233
233
  };
234
- $[56] = t23;
235
- $[57] = t26;
236
- $[58] = t29;
237
- $[59] = t30;
238
- $[60] = t31;
239
- } else t31 = $[60];
234
+ $[56] = reportEnd;
235
+ $[57] = rows;
236
+ $[58] = tableProps?.wrapperProps;
237
+ $[59] = t31;
238
+ } else t31 = $[59];
240
239
  let t32;
241
- if ($[61] !== lock?.widths) {
242
- t32 = lock?.widths.map(_temp3);
243
- $[61] = lock?.widths;
244
- $[62] = t32;
245
- } else t32 = $[62];
240
+ if ($[60] !== t24 || $[61] !== t27 || $[62] !== t30 || $[63] !== t31) {
241
+ t32 = {
242
+ ...t24,
243
+ className: t27,
244
+ style: t30,
245
+ onScroll: t31
246
+ };
247
+ $[60] = t24;
248
+ $[61] = t27;
249
+ $[62] = t30;
250
+ $[63] = t31;
251
+ $[64] = t32;
252
+ } else t32 = $[64];
246
253
  let t33;
247
- if ($[63] !== t32) {
248
- t33 = /* @__PURE__ */ jsx("colgroup", {
254
+ if ($[65] !== lock?.widths) {
255
+ t33 = lock?.widths.map(_temp3);
256
+ $[65] = lock?.widths;
257
+ $[66] = t33;
258
+ } else t33 = $[66];
259
+ let t34;
260
+ if ($[67] !== t33) {
261
+ t34 = /* @__PURE__ */ jsx("colgroup", {
249
262
  ref: setAnchor,
250
- children: t32
263
+ children: t33
251
264
  });
252
- $[63] = t32;
253
- $[64] = t33;
254
- } else t33 = $[64];
255
- let t34;
256
- if ($[65] !== table || $[66] !== text) {
257
- t34 = table.selectable && /* @__PURE__ */ jsx(TableHead, {
265
+ $[67] = t33;
266
+ $[68] = t34;
267
+ } else t34 = $[68];
268
+ let t35;
269
+ if ($[69] !== table || $[70] !== text) {
270
+ t35 = table.selectable && /* @__PURE__ */ jsx(TableHead, {
258
271
  className: "oui-data-table__check",
259
272
  children: /* @__PURE__ */ jsx(Checkbox, {
260
273
  size: "sm",
@@ -265,42 +278,26 @@ function DataTableContent(t0) {
265
278
  onCheckedChange: (checked) => table.toggleAll(checked)
266
279
  })
267
280
  });
268
- $[65] = table;
269
- $[66] = text;
270
- $[67] = t34;
271
- } else t34 = $[67];
272
- let t35;
273
- if ($[68] !== lock || $[69] !== table) {
274
- t35 = (column_0) => /* @__PURE__ */ jsx(TableHead, {
275
- align: column_0.align ?? (column_0.numeric ? "end" : "start"),
276
- style: !lock && (column_0.width !== void 0 || column_0.minWidth !== void 0) ? {
277
- width: column_0.width,
278
- minWidth: column_0.minWidth
279
- } : void 0,
280
- "data-nowrap": column_0.nowrap || void 0,
281
- sort: table.isSortable(column_0) ? table.sort?.id === column_0.id ? table.sort.direction : false : void 0,
282
- onSort: () => table.toggleSort(column_0.id),
283
- children: column_0.header
284
- }, column_0.id);
285
- $[68] = lock;
286
281
  $[69] = table;
287
- $[70] = t35;
288
- } else t35 = $[70];
282
+ $[70] = text;
283
+ $[71] = t35;
284
+ } else t35 = $[71];
289
285
  let t36;
290
- if ($[71] !== hasActions || $[72] !== text) {
291
- t36 = hasActions && /* @__PURE__ */ jsx(TableHead, {
286
+ if ($[72] !== hasActions || $[73] !== selected || $[74] !== text) {
287
+ t36 = !selected && hasActions && /* @__PURE__ */ jsx(TableHead, {
292
288
  className: "oui-data-table__row-actions",
293
289
  children: /* @__PURE__ */ jsx("span", {
294
290
  className: "oui-visually-hidden",
295
291
  children: text.actions
296
292
  })
297
293
  });
298
- $[71] = hasActions;
299
- $[72] = text;
300
- $[73] = t36;
301
- } else t36 = $[73];
294
+ $[72] = hasActions;
295
+ $[73] = selected;
296
+ $[74] = text;
297
+ $[75] = t36;
298
+ } else t36 = $[75];
302
299
  let t37;
303
- if ($[74] !== rows.before || $[75] !== span) {
300
+ if ($[76] !== rows.before || $[77] !== span) {
304
301
  t37 = rows.before > 0 && /* @__PURE__ */ jsx("tbody", {
305
302
  className: "oui-data-table__spacer",
306
303
  "aria-hidden": true,
@@ -309,10 +306,10 @@ function DataTableContent(t0) {
309
306
  children: /* @__PURE__ */ jsx("td", { colSpan: span })
310
307
  })
311
308
  });
312
- $[74] = rows.before;
313
- $[75] = span;
314
- $[76] = t37;
315
- } else t37 = $[76];
309
+ $[76] = rows.before;
310
+ $[77] = span;
311
+ $[78] = t37;
312
+ } else t37 = $[78];
316
313
  const t38 = Array.from({ length: placeholders }, (_, index_0) => /* @__PURE__ */ jsxs(TableRow, {
317
314
  "aria-hidden": true,
318
315
  children: [
@@ -338,14 +335,14 @@ function DataTableContent(t0) {
338
335
  height: rows.rowHeight
339
336
  }, entry.id));
340
337
  let t40;
341
- if ($[77] !== t38 || $[78] !== t39) {
338
+ if ($[79] !== t38 || $[80] !== t39) {
342
339
  t40 = /* @__PURE__ */ jsxs(TableBody, { children: [t38, t39] });
343
- $[77] = t38;
344
- $[78] = t39;
345
- $[79] = t40;
346
- } else t40 = $[79];
340
+ $[79] = t38;
341
+ $[80] = t39;
342
+ $[81] = t40;
343
+ } else t40 = $[81];
347
344
  let t41;
348
- if ($[80] !== rows.after || $[81] !== span) {
345
+ if ($[82] !== rows.after || $[83] !== span) {
349
346
  t41 = rows.after > 0 && /* @__PURE__ */ jsx("tbody", {
350
347
  className: "oui-data-table__spacer",
351
348
  "aria-hidden": true,
@@ -354,12 +351,12 @@ function DataTableContent(t0) {
354
351
  children: /* @__PURE__ */ jsx("td", { colSpan: span })
355
352
  })
356
353
  });
357
- $[80] = rows.after;
358
- $[81] = span;
359
- $[82] = t41;
360
- } else t41 = $[82];
354
+ $[82] = rows.after;
355
+ $[83] = span;
356
+ $[84] = t41;
357
+ } else t41 = $[84];
361
358
  let t42;
362
- if ($[83] !== empty || $[84] !== error || $[85] !== loading || $[86] !== noMatch || $[87] !== table.activeFilterCount || $[88] !== table.filtered || $[89] !== table.onRetry || $[90] !== table.reset || $[91] !== table.rows || $[92] !== text) {
359
+ if ($[85] !== empty || $[86] !== error || $[87] !== loading || $[88] !== noMatch || $[89] !== table.activeFilterCount || $[90] !== table.filtered || $[91] !== table.onRetry || $[92] !== table.reset || $[93] !== table.rows || $[94] !== text) {
363
360
  t42 = error ? /* @__PURE__ */ jsx(EmptyState, {
364
361
  role: "alert",
365
362
  title: text.errorTitle,
@@ -380,18 +377,18 @@ function DataTableContent(t0) {
380
377
  children: table.activeFilterCount ? text.clearFilters : text.clearSearch
381
378
  }) : void 0
382
379
  }));
383
- $[83] = empty;
384
- $[84] = error;
385
- $[85] = loading;
386
- $[86] = noMatch;
387
- $[87] = table.activeFilterCount;
388
- $[88] = table.filtered;
389
- $[89] = table.onRetry;
390
- $[90] = table.reset;
391
- $[91] = table.rows;
392
- $[92] = text;
393
- $[93] = t42;
394
- } else t42 = $[93];
380
+ $[85] = empty;
381
+ $[86] = error;
382
+ $[87] = loading;
383
+ $[88] = noMatch;
384
+ $[89] = table.activeFilterCount;
385
+ $[90] = table.filtered;
386
+ $[91] = table.onRetry;
387
+ $[92] = table.reset;
388
+ $[93] = table.rows;
389
+ $[94] = text;
390
+ $[95] = t42;
391
+ } else t42 = $[95];
395
392
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Table, {
396
393
  density,
397
394
  striped,
@@ -403,15 +400,54 @@ function DataTableContent(t0) {
403
400
  "data-locked": lock ? "" : void 0,
404
401
  "data-virtualized": virtual ? "" : void 0,
405
402
  "data-sticky-column": stickyFirstColumn || void 0,
406
- style: t22,
407
- wrapperProps: t31,
403
+ style: t23,
404
+ wrapperProps: t32,
408
405
  children: [
409
- t33,
406
+ t34,
410
407
  /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, {
411
408
  "aria-rowindex": virtual ? 1 : void 0,
409
+ "data-selecting": selected > 0 || void 0,
412
410
  children: [
413
- t34,
414
- columns.map(t35),
411
+ t35,
412
+ selected > 0 ? /* @__PURE__ */ jsx(TableHead, {
413
+ colSpan: columns.length + Number(hasActions),
414
+ scope: "colgroup",
415
+ className: "oui-data-table__selection-head",
416
+ style: { height: headerHeight },
417
+ children: /* @__PURE__ */ jsxs("div", {
418
+ className: "oui-data-table__selection-bar",
419
+ children: [
420
+ /* @__PURE__ */ jsx("span", {
421
+ className: "oui-data-table__selection-count",
422
+ "aria-live": "polite",
423
+ children: text.selected(selected)
424
+ }),
425
+ /* @__PURE__ */ jsx(Tooltip, {
426
+ content: text.clearSelection,
427
+ children: /* @__PURE__ */ jsx(IconButton, {
428
+ size: "sm",
429
+ "aria-label": text.clearSelection,
430
+ onClick: table.clearSelection,
431
+ children: /* @__PURE__ */ jsx(XIcon, {})
432
+ })
433
+ }),
434
+ selectionActions && /* @__PURE__ */ jsx("div", {
435
+ className: "oui-data-table__selection-actions",
436
+ children: selectionActions
437
+ })
438
+ ]
439
+ })
440
+ }) : columns.map((column_0) => /* @__PURE__ */ jsx(TableHead, {
441
+ align: column_0.align ?? (column_0.numeric ? "end" : "start"),
442
+ style: !lock && (column_0.width !== void 0 || column_0.minWidth !== void 0) ? {
443
+ width: column_0.width,
444
+ minWidth: column_0.minWidth
445
+ } : void 0,
446
+ "data-nowrap": column_0.nowrap || void 0,
447
+ sort: table.isSortable(column_0) ? table.sort?.id === column_0.id ? table.sort.direction : false : void 0,
448
+ onSort: () => table.toggleSort(column_0.id),
449
+ children: column_0.header
450
+ }, column_0.id)),
415
451
  t36
416
452
  ]
417
453
  }) }),