@brightlocal/ui-components 2.26.0 → 2.27.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 (89) hide show
  1. package/README.md +4 -2
  2. package/component-meta.json +3761 -360
  3. package/dist/blocks/progress-screen.cjs +1 -0
  4. package/dist/blocks/progress-screen.d.ts +109 -0
  5. package/dist/blocks/progress-screen.d.ts.map +1 -0
  6. package/dist/blocks/progress-screen.js +339 -0
  7. package/dist/blocks/sidebar.cjs +1 -1
  8. package/dist/blocks/sidebar.d.ts.map +1 -1
  9. package/dist/blocks/sidebar.js +155 -153
  10. package/dist/brand-illustration-motif.d.ts +1 -1
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.d.ts.map +1 -1
  13. package/dist/breadcrumb.js +44 -40
  14. package/dist/button.cjs +1 -1
  15. package/dist/button.d.ts.map +1 -1
  16. package/dist/button.js +28 -28
  17. package/dist/chip.cjs +1 -1
  18. package/dist/chip.d.ts +1 -1
  19. package/dist/chip.d.ts.map +1 -1
  20. package/dist/chip.js +42 -41
  21. package/dist/combobox.cjs +3 -3
  22. package/dist/combobox.d.ts +4 -2
  23. package/dist/combobox.d.ts.map +1 -1
  24. package/dist/combobox.js +161 -161
  25. package/dist/data-table.cjs +1 -1
  26. package/dist/data-table.d.ts +138 -3
  27. package/dist/data-table.d.ts.map +1 -1
  28. package/dist/data-table.js +455 -309
  29. package/dist/global-layout.cjs +1 -1
  30. package/dist/global-layout.d.ts +31 -5
  31. package/dist/global-layout.d.ts.map +1 -1
  32. package/dist/global-layout.js +276 -194
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +462 -451
  37. package/dist/lib/motion.cjs +1 -1
  38. package/dist/lib/motion.js +10 -8
  39. package/dist/link.cjs +1 -1
  40. package/dist/link.d.ts +8 -6
  41. package/dist/link.d.ts.map +1 -1
  42. package/dist/link.js +52 -20
  43. package/dist/list.cjs +1 -1
  44. package/dist/list.js +65 -63
  45. package/dist/progress.cjs +1 -1
  46. package/dist/progress.d.ts +61 -3
  47. package/dist/progress.d.ts.map +1 -1
  48. package/dist/progress.js +142 -65
  49. package/dist/route-progress.cjs +1 -0
  50. package/dist/route-progress.d.ts +103 -0
  51. package/dist/route-progress.d.ts.map +1 -0
  52. package/dist/route-progress.js +106 -0
  53. package/dist/sheet.cjs +1 -1
  54. package/dist/sheet.d.ts +35 -2
  55. package/dist/sheet.d.ts.map +1 -1
  56. package/dist/sheet.js +102 -65
  57. package/dist/sonner.cjs +1 -1
  58. package/dist/sonner.d.ts.map +1 -1
  59. package/dist/sonner.js +11 -15
  60. package/dist/spinner.cjs +1 -0
  61. package/dist/spinner.d.ts +57 -0
  62. package/dist/spinner.d.ts.map +1 -0
  63. package/dist/spinner.js +35 -0
  64. package/dist/stepper.cjs +1 -1
  65. package/dist/stepper.d.ts.map +1 -1
  66. package/dist/stepper.js +26 -25
  67. package/dist/table.cjs +1 -1
  68. package/dist/table.d.ts +1 -1
  69. package/dist/table.d.ts.map +1 -1
  70. package/dist/table.js +6 -2
  71. package/package.json +14 -2
  72. package/src/blocks/progress-screen.tsx +481 -0
  73. package/src/blocks/sidebar.tsx +22 -15
  74. package/src/components/breadcrumb.tsx +9 -4
  75. package/src/components/button.tsx +2 -5
  76. package/src/components/chip.tsx +4 -3
  77. package/src/components/combobox.tsx +15 -8
  78. package/src/components/data-table.tsx +333 -14
  79. package/src/components/global-layout.tsx +228 -62
  80. package/src/components/link.tsx +39 -5
  81. package/src/components/list.tsx +5 -5
  82. package/src/components/progress.tsx +217 -30
  83. package/src/components/route-progress.tsx +354 -0
  84. package/src/components/sheet.tsx +87 -5
  85. package/src/components/sonner.tsx +3 -12
  86. package/src/components/spinner.tsx +94 -0
  87. package/src/components/stepper.tsx +3 -4
  88. package/src/components/table.tsx +6 -2
  89. package/src/index.ts +3 -0
@@ -1,109 +1,111 @@
1
- import { jsx as t, jsxs as S, Fragment as R } from "react/jsx-runtime";
2
- import * as g from "react";
3
- import { useReactTable as oe, getExpandedRowModel as le, getFilteredRowModel as ie, getSortedRowModel as re, getPaginationRowModel as se, getCoreRowModel as ce, flexRender as V } from "@tanstack/react-table";
4
- import { useVirtualizer as de } from "@tanstack/react-virtual";
5
- import { ArrowDown as ue, ArrowUp as ge, ArrowUpDown as me, Search as pe, X as he } from "@brightlocal/icons";
6
- import { cn as m } from "@brightlocal/ui-components/lib/utils";
7
- import { Button as E } from "./button.js";
8
- import { Checkbox as j } from "./checkbox.js";
9
- import { InputGroup as fe, InputGroupAddon as H, InputGroupInput as be } from "./input-group.js";
10
- import { usePagination as we, Pagination as Se, PaginationContent as Ce, PaginationItem as I, PaginationPrevious as xe, PaginationNext as ke, PaginationEllipsis as Pe, PaginationLink as Te } from "./pagination.js";
11
- import { Skeleton as ve } from "./skeleton.js";
12
- import { Table as G, TableBody as L, TableRow as k, TableCell as P, TableHeader as Re, TableHead as De } from "./table.js";
13
- import { TypographyMuted as ye } from "./typography.js";
14
- function v(e, n, l) {
15
- const [a, i] = g.useState(n), o = e !== void 0 ? e : a, r = g.useRef(o);
16
- g.useEffect(() => {
1
+ import { jsx as a, jsxs as f, Fragment as T } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import { useReactTable as re, getExpandedRowModel as se, getFilteredRowModel as de, getSortedRowModel as ce, getPaginationRowModel as ue, getCoreRowModel as ge, flexRender as G } from "@tanstack/react-table";
4
+ import { useVirtualizer as pe } from "@tanstack/react-virtual";
5
+ import { ArrowDown as me, ArrowUp as he, ArrowUpDown as be, ChevronRight as fe, Search as xe, X as Se } from "@brightlocal/icons";
6
+ import { cn as g } from "@brightlocal/ui-components/lib/utils";
7
+ import { Button as V } from "./button.js";
8
+ import { Checkbox as L } from "./checkbox.js";
9
+ import { InputGroup as we, InputGroupAddon as j, InputGroupInput as Ce } from "./input-group.js";
10
+ import { usePagination as ke, Pagination as ve, PaginationContent as Te, PaginationItem as E, PaginationPrevious as Pe, PaginationNext as Re, PaginationEllipsis as ye, PaginationLink as De } from "./pagination.js";
11
+ import { Skeleton as B } from "./skeleton.js";
12
+ import { Table as _, TableBody as U, TableRow as k, TableCell as v, TableHeader as Ne, TableHead as ze } from "./table.js";
13
+ import { TypographyMuted as Ae } from "./typography.js";
14
+ function y(e, n, l) {
15
+ const [t, i] = p.useState(n), o = e !== void 0 ? e : t, r = p.useRef(o);
16
+ p.useEffect(() => {
17
17
  r.current = o;
18
18
  });
19
- const c = e !== void 0, d = g.useCallback(
20
- (s) => {
21
- const u = typeof s == "function" ? s(r.current) : s;
22
- c || i(u), l?.(u);
19
+ const s = e !== void 0, d = p.useCallback(
20
+ (c) => {
21
+ const u = typeof c == "function" ? c(r.current) : c;
22
+ s || i(u), l?.(u);
23
23
  },
24
- [c, l]
24
+ [s, l]
25
25
  );
26
26
  return [o, d];
27
27
  }
28
- function nt(e) {
28
+ function sa(e) {
29
29
  const {
30
30
  columns: n,
31
31
  data: l,
32
- enableSorting: a = !0,
32
+ enableSorting: t = !0,
33
33
  enableGlobalFiltering: i = !1,
34
34
  enableRowSelection: o = !1,
35
35
  enablePagination: r = !1,
36
- pageSize: c = 10,
36
+ pageSize: s = 10,
37
37
  manualSorting: d = !1,
38
- manualFiltering: s = !1,
38
+ manualFiltering: c = !1,
39
39
  manualPagination: u = !1,
40
40
  rowCount: h,
41
- pageCount: p,
42
- enableExpanding: f = !1,
43
- getSubRows: b,
44
- getRowId: C,
45
- pagination: x,
46
- onPaginationChange: $,
47
- sorting: D,
48
- onSortingChange: T,
49
- globalFilter: y,
50
- onGlobalFilterChange: w,
51
- rowSelection: F,
52
- onRowSelectionChange: N,
53
- expanded: z,
54
- onExpandedChange: M
55
- } = e, [A, K] = v(
56
- x,
57
- { pageIndex: 0, pageSize: c },
58
- $
59
- ), [O, Q] = v(
60
- D,
41
+ pageCount: m,
42
+ enableExpanding: S = !1,
43
+ getSubRows: x,
44
+ getRowCanExpand: w,
45
+ paginateExpandedRows: P = !1,
46
+ getRowId: b,
47
+ pagination: I,
48
+ onPaginationChange: D,
49
+ sorting: R,
50
+ onSortingChange: N,
51
+ globalFilter: C,
52
+ onGlobalFilterChange: F,
53
+ rowSelection: z,
54
+ onRowSelectionChange: A,
55
+ expanded: M,
56
+ onExpandedChange: $
57
+ } = e, [Q, Y] = y(
58
+ I,
59
+ { pageIndex: 0, pageSize: s },
60
+ D
61
+ ), [Z, ee] = y(
62
+ R,
61
63
  [],
62
- T
63
- ), [Y, Z] = v(
64
- y,
64
+ N
65
+ ), [ae, te] = y(
66
+ C,
65
67
  "",
66
- w
67
- ), [ee, te] = v(F, {}, N), [ae, ne] = v(
68
- z,
68
+ F
69
+ ), [ne, oe] = y(z, {}, A), [le, ie] = y(
70
+ M,
69
71
  {},
70
- M
72
+ $
71
73
  );
72
- return oe({
74
+ return re({
73
75
  data: l,
74
76
  columns: n,
75
- getCoreRowModel: ce(),
76
- ...C && { getRowId: C },
77
+ getCoreRowModel: ge(),
78
+ ...b && { getRowId: b },
77
79
  ...(r || u) && {
78
- onPaginationChange: K
80
+ onPaginationChange: Y
79
81
  },
80
82
  ...r && {
81
83
  ...!u && {
82
- getPaginationRowModel: se()
84
+ getPaginationRowModel: ue()
83
85
  }
84
86
  },
85
87
  ...u && {
86
88
  manualPagination: !0,
87
89
  ...h != null && { rowCount: h },
88
- ...p != null && { pageCount: p }
90
+ ...m != null && { pageCount: m }
89
91
  },
90
92
  // Always forward the flag — TanStack defaults `enableSorting` to true,
91
93
  // so omitting it would leave `column.getCanSort()` returning true even
92
94
  // when the consumer disabled sorting table-wide.
93
- enableSorting: a,
94
- ...a && {
95
+ enableSorting: t,
96
+ ...t && {
95
97
  ...!d && {
96
- getSortedRowModel: re()
98
+ getSortedRowModel: ce()
97
99
  },
98
- onSortingChange: Q,
100
+ onSortingChange: ee,
99
101
  ...d && { manualSorting: !0 }
100
102
  },
101
103
  ...i && {
102
- ...!s && {
103
- getFilteredRowModel: ie()
104
+ ...!c && {
105
+ getFilteredRowModel: de()
104
106
  },
105
- ...s && { manualFiltering: !0 },
106
- onGlobalFilterChange: Z,
107
+ ...c && { manualFiltering: !0 },
108
+ onGlobalFilterChange: te,
107
109
  globalFilterFn: "includesString"
108
110
  },
109
111
  // Always forward — TanStack defaults `enableRowSelection` to true, so
@@ -111,206 +113,275 @@ function nt(e) {
111
113
  // `DataTableSelectRowCheckbox` enabled on tables without selection.
112
114
  enableRowSelection: o,
113
115
  ...o && {
114
- onRowSelectionChange: te
116
+ onRowSelectionChange: oe
115
117
  },
116
- ...f && {
117
- getExpandedRowModel: le(),
118
- onExpandedChange: ne,
119
- getSubRows: b
118
+ // Always forward the flag — TanStack defaults `enableExpanding` to true,
119
+ // so omitting it would leave `row.getCanExpand()` returning true and
120
+ // `DataTableExpandRowButton` interactive on tables without expanding.
121
+ enableExpanding: S,
122
+ ...S && {
123
+ getExpandedRowModel: se(),
124
+ onExpandedChange: ie,
125
+ getSubRows: x,
126
+ ...w && { getRowCanExpand: w },
127
+ // Forward only with client-side pagination: `paginateExpandedRows:
128
+ // false` defers expansion to the pagination row model, so without one
129
+ // it would suppress row expansion entirely.
130
+ ...r && !u && { paginateExpandedRows: P }
120
131
  },
121
132
  state: {
122
- pagination: A,
123
- sorting: O,
124
- globalFilter: Y,
125
- rowSelection: ee,
126
- expanded: ae
133
+ pagination: Q,
134
+ sorting: Z,
135
+ globalFilter: ae,
136
+ rowSelection: ne,
137
+ expanded: le
127
138
  }
128
139
  });
129
140
  }
130
- function Ne({
141
+ function $e({
131
142
  table: e,
132
143
  dataHook: n,
133
144
  trackingEl: l,
134
- trackingLabel: a,
145
+ trackingLabel: t,
135
146
  isLoading: i = !1,
136
147
  skeletonRowCount: o,
137
148
  noResultsMessage: r = "No results.",
138
- stickyHeader: c = !1,
149
+ stickyHeader: s = !1,
139
150
  className: d,
140
- layout: s,
151
+ layout: c,
141
152
  minWidth: u,
142
153
  scrollRegionLabel: h,
143
- footer: p
154
+ footer: m,
155
+ getRowClassName: S,
156
+ renderExpandedContent: x
144
157
  }) {
145
- const f = e.getVisibleLeafColumns().length, b = o ?? e.getState().pagination.pageSize ?? 10;
146
- return /* @__PURE__ */ t(
158
+ const w = e.getVisibleLeafColumns().length, P = o ?? e.getState().pagination.pageSize ?? 10;
159
+ return /* @__PURE__ */ a(
147
160
  "div",
148
161
  {
149
162
  "aria-busy": i || void 0,
150
- className: m("border-border overflow-auto rounded-md border", d),
163
+ className: g("border-border overflow-auto rounded-md border", d),
151
164
  "data-hook": n,
152
165
  "data-slot": "data-table-view",
153
166
  "data-tracking-el": l,
154
- "data-tracking-label": a,
155
- children: /* @__PURE__ */ S(
156
- G,
167
+ "data-tracking-label": t,
168
+ children: /* @__PURE__ */ f(
169
+ _,
157
170
  {
158
171
  dataHook: `${n}-table`,
159
- layout: s,
172
+ layout: c,
160
173
  minWidth: u,
161
174
  scrollRegionLabel: h,
162
175
  children: [
163
- /* @__PURE__ */ t(U, { stickyHeader: c, table: e }),
164
- /* @__PURE__ */ t(L, { children: i ? /* @__PURE__ */ S(R, { children: [
165
- /* @__PURE__ */ t(
166
- _,
176
+ /* @__PURE__ */ a(W, { stickyHeader: s, table: e }),
177
+ /* @__PURE__ */ a(U, { children: i ? /* @__PURE__ */ f(T, { children: [
178
+ /* @__PURE__ */ a(
179
+ X,
167
180
  {
168
- colCount: f,
169
- rowCount: b
181
+ colCount: w,
182
+ rowCount: P
170
183
  }
171
184
  ),
172
- /* @__PURE__ */ t(k, { className: "sr-only", children: /* @__PURE__ */ t(P, { colSpan: f, children: /* @__PURE__ */ t("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
173
- ] }) : /* @__PURE__ */ t(R, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((C) => /* @__PURE__ */ t(W, { row: C }, C.id)) : /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(P, { align: "center", colSpan: f, size: "lg", children: /* @__PURE__ */ t("div", { "aria-live": "polite", role: "status", children: r }) }) }) }) }),
174
- p
185
+ /* @__PURE__ */ a(k, { className: "sr-only", children: /* @__PURE__ */ a(v, { colSpan: w, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
186
+ ] }) : /* @__PURE__ */ a(T, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((b) => /* @__PURE__ */ a(
187
+ O,
188
+ {
189
+ columnCount: w,
190
+ getRowClassName: S,
191
+ renderExpandedContent: x,
192
+ row: b
193
+ },
194
+ b.id
195
+ )) : /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(v, { align: "center", colSpan: w, size: "lg", children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }) }),
196
+ m
175
197
  ]
176
198
  }
177
199
  )
178
200
  }
179
201
  );
180
202
  }
181
- Ne.displayName = "DataTable";
182
- function U({
203
+ $e.displayName = "DataTable";
204
+ function W({
183
205
  table: e,
184
206
  stickyHeader: n
185
207
  }) {
186
- return /* @__PURE__ */ t(Re, { className: m(n && "sticky top-0 z-10"), children: e.getHeaderGroups().map((l) => /* @__PURE__ */ t(k, { children: l.headers.map((a) => {
187
- const i = a.column.getCanSort() ? a.column.getIsSorted() : !1, o = i === "asc" ? "ascending" : i === "desc" ? "descending" : a.column.getCanSort() ? "none" : void 0, r = a.column.columnDef.meta;
188
- return /* @__PURE__ */ t(
189
- De,
208
+ return /* @__PURE__ */ a(Ne, { className: g(n && "sticky top-0 z-10"), children: e.getHeaderGroups().map((l) => /* @__PURE__ */ a(k, { children: l.headers.map((t) => {
209
+ const i = t.column.getCanSort() ? t.column.getIsSorted() : !1, o = i === "asc" ? "ascending" : i === "desc" ? "descending" : t.column.getCanSort() ? "none" : void 0, r = t.column.columnDef.meta;
210
+ return /* @__PURE__ */ a(
211
+ ze,
190
212
  {
191
213
  "aria-sort": o,
192
- colSpan: a.colSpan,
214
+ colSpan: t.colSpan,
193
215
  minWidth: r?.minWidth,
194
216
  width: r?.width,
195
- children: a.isPlaceholder ? null : V(
196
- a.column.columnDef.header,
197
- a.getContext()
217
+ children: t.isPlaceholder ? null : G(
218
+ t.column.columnDef.header,
219
+ t.getContext()
198
220
  )
199
221
  },
200
- a.id
222
+ t.id
201
223
  );
202
224
  }) }, l.id)) });
203
225
  }
204
- function W({ row: e }) {
205
- return /* @__PURE__ */ t(k, { "data-state": e.getIsSelected() ? "selected" : void 0, children: e.getVisibleCells().map((n) => /* @__PURE__ */ t(P, { children: V(n.column.columnDef.cell, n.getContext()) }, n.id)) });
226
+ function O({
227
+ row: e,
228
+ columnCount: n,
229
+ getRowClassName: l,
230
+ renderExpandedContent: t
231
+ }) {
232
+ const i = e.getCanExpand(), o = e.getIsExpanded(), r = t && i && o ? t(e) : null;
233
+ return /* @__PURE__ */ f(T, { children: [
234
+ /* @__PURE__ */ a(
235
+ k,
236
+ {
237
+ className: g(
238
+ // Rows have no hover of their own — the chevron/action buttons are
239
+ // the interactive elements. Ghost buttons (the only bg-transparent
240
+ // variant) get bg-secondary on hover because their default
241
+ // hover:bg-accent is invisible on bg-muted rows (accent equals
242
+ // muted in light mode). Scoped to .bg-transparent so variant
243
+ // buttons in cells (primary, destructive, …) keep their own hover.
244
+ "[&_[data-slot=button].bg-transparent:hover]:bg-secondary",
245
+ // Surfaces are mutually exclusive: an expanded parent shares the
246
+ // table head's bg-muted at ANY depth; other expanded-zone rows
247
+ // (sub-rows) get the lighter accent wash.
248
+ i && o ? "bg-muted" : e.depth > 0 && "bg-accent/50",
249
+ l?.(e)
250
+ ),
251
+ "data-depth": e.depth,
252
+ "data-expanded": i ? String(o) : void 0,
253
+ "data-state": e.getIsSelected() ? "selected" : void 0,
254
+ children: e.getVisibleCells().map((s) => /* @__PURE__ */ a(v, { children: G(s.column.columnDef.cell, s.getContext()) }, s.id))
255
+ }
256
+ ),
257
+ r != null && // No data-depth here: panels are not data rows, and sharing the
258
+ // parent's depth would break depth-based selectors and counts.
259
+ /* @__PURE__ */ a(
260
+ k,
261
+ {
262
+ className: "bg-accent/50 [&_[data-slot=button].bg-transparent:hover]:bg-secondary",
263
+ "data-slot": "data-table-expanded-row",
264
+ children: /* @__PURE__ */ a(v, { colSpan: n, children: r })
265
+ }
266
+ )
267
+ ] });
206
268
  }
207
- function _({
269
+ function X({
208
270
  rowCount: e,
209
271
  colCount: n
210
272
  }) {
211
- return /* @__PURE__ */ t(R, { children: Array.from({ length: e }).map((l, a) => /* @__PURE__ */ t(k, { children: Array.from({ length: n }).map((i, o) => /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(ve, { className: "h-4 w-full" }) }, `skeleton-${a}-${o}`)) }, `skeleton-${a}`)) });
273
+ return /* @__PURE__ */ a(T, { children: Array.from({ length: e }).map((l, t) => /* @__PURE__ */ a(k, { children: Array.from({ length: n }).map((i, o) => /* @__PURE__ */ a(v, { children: /* @__PURE__ */ a(B, { className: "h-4 w-full" }) }, `skeleton-${t}-${o}`)) }, `skeleton-${t}`)) });
212
274
  }
213
- function ze({
275
+ function Ee({
214
276
  table: e,
215
277
  dataHook: n,
216
278
  trackingEl: l,
217
- trackingLabel: a,
279
+ trackingLabel: t,
218
280
  isLoading: i = !1,
219
281
  skeletonRowCount: o,
220
282
  noResultsMessage: r = "No results.",
221
- stickyHeader: c = !1,
283
+ stickyHeader: s = !1,
222
284
  className: d,
223
- layout: s,
285
+ layout: c,
224
286
  minWidth: u,
225
287
  scrollRegionLabel: h,
226
- footer: p,
227
- height: f,
228
- estimateSize: b = 48,
229
- overscan: C = 5
288
+ footer: m,
289
+ getRowClassName: S,
290
+ height: x,
291
+ estimateSize: w = 48,
292
+ overscan: P = 5
230
293
  }) {
231
- const x = e.getVisibleLeafColumns().length, $ = o ?? e.getState().pagination.pageSize ?? 10, D = g.useRef(null), T = e.getRowModel().rows, y = de({
232
- count: T.length,
294
+ const b = e.getVisibleLeafColumns().length, I = o ?? e.getState().pagination.pageSize ?? 10, D = p.useRef(null), R = e.getRowModel().rows, N = pe({
295
+ count: R.length,
233
296
  getScrollElement: () => D.current,
234
- estimateSize: () => b,
235
- overscan: C
236
- }), w = y.getVirtualItems(), F = y.getTotalSize(), N = w.length > 0 ? w[0].start : 0, z = w.length > 0 ? F - w[w.length - 1].end : 0;
237
- return /* @__PURE__ */ t(
297
+ estimateSize: () => w,
298
+ overscan: P
299
+ }), C = N.getVirtualItems(), F = N.getTotalSize(), z = C.length > 0 ? C[0].start : 0, A = C.length > 0 ? F - C[C.length - 1].end : 0;
300
+ return /* @__PURE__ */ a(
238
301
  "div",
239
302
  {
240
303
  ref: D,
241
304
  "aria-busy": i || void 0,
242
- className: m("border-border overflow-auto rounded-md border", d),
305
+ className: g("border-border overflow-auto rounded-md border", d),
243
306
  "data-hook": n,
244
307
  "data-slot": "data-table-view",
245
308
  "data-tracking-el": l,
246
- "data-tracking-label": a,
247
- style: f != null ? { height: f } : void 0,
248
- children: /* @__PURE__ */ S(
249
- G,
309
+ "data-tracking-label": t,
310
+ style: x != null ? { height: x } : void 0,
311
+ children: /* @__PURE__ */ f(
312
+ _,
250
313
  {
251
314
  dataHook: `${n}-table`,
252
- layout: s,
315
+ layout: c,
253
316
  minWidth: u,
254
317
  scrollRegionLabel: h,
255
318
  children: [
256
- /* @__PURE__ */ t(U, { stickyHeader: c, table: e }),
257
- /* @__PURE__ */ t(L, { children: i ? /* @__PURE__ */ S(R, { children: [
258
- /* @__PURE__ */ t(
259
- _,
319
+ /* @__PURE__ */ a(W, { stickyHeader: s, table: e }),
320
+ /* @__PURE__ */ a(U, { children: i ? /* @__PURE__ */ f(T, { children: [
321
+ /* @__PURE__ */ a(
322
+ X,
260
323
  {
261
- colCount: x,
262
- rowCount: $
324
+ colCount: b,
325
+ rowCount: I
263
326
  }
264
327
  ),
265
- /* @__PURE__ */ t(k, { className: "sr-only", children: /* @__PURE__ */ t(P, { colSpan: x, children: /* @__PURE__ */ t("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
266
- ] }) : T.length > 0 ? /* @__PURE__ */ S(R, { children: [
267
- N > 0 && /* @__PURE__ */ t("tr", { "aria-hidden": "true", children: /* @__PURE__ */ t("td", { colSpan: x, style: { height: N } }) }),
268
- w.map((M) => {
269
- const A = T[M.index];
270
- return /* @__PURE__ */ t(W, { row: A }, A.id);
328
+ /* @__PURE__ */ a(k, { className: "sr-only", children: /* @__PURE__ */ a(v, { colSpan: b, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
329
+ ] }) : R.length > 0 ? /* @__PURE__ */ f(T, { children: [
330
+ z > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: b, style: { height: z } }) }),
331
+ C.map((M) => {
332
+ const $ = R[M.index];
333
+ return /* @__PURE__ */ a(
334
+ O,
335
+ {
336
+ columnCount: b,
337
+ getRowClassName: S,
338
+ row: $
339
+ },
340
+ $.id
341
+ );
271
342
  }),
272
- z > 0 && /* @__PURE__ */ t("tr", { "aria-hidden": "true", children: /* @__PURE__ */ t("td", { colSpan: x, style: { height: z } }) })
273
- ] }) : /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(P, { align: "center", colSpan: x, size: "lg", children: /* @__PURE__ */ t("div", { "aria-live": "polite", role: "status", children: r }) }) }) }),
274
- p
343
+ A > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: b, style: { height: A } }) })
344
+ ] }) : /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(v, { align: "center", colSpan: b, size: "lg", children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }),
345
+ m
275
346
  ]
276
347
  }
277
348
  )
278
349
  }
279
350
  );
280
351
  }
281
- ze.displayName = "VirtualizedDataTable";
282
- function Ae({
352
+ Ee.displayName = "VirtualizedDataTable";
353
+ function Ie({
283
354
  column: e,
284
355
  title: n,
285
356
  className: l,
286
- dataHook: a,
357
+ dataHook: t,
287
358
  trackingEl: i,
288
359
  trackingLabel: o,
289
360
  align: r = "left",
290
- getSortLabel: c
361
+ getSortLabel: s
291
362
  }) {
292
363
  if (!e.getCanSort())
293
- return /* @__PURE__ */ t(
364
+ return /* @__PURE__ */ a(
294
365
  "div",
295
366
  {
296
- className: m(
367
+ className: g(
297
368
  "text-muted-foreground text-left text-sm leading-normal font-medium",
298
369
  r === "right" && "text-right",
299
370
  r === "center" && "text-center",
300
371
  l
301
372
  ),
302
- "data-hook": a,
373
+ "data-hook": t,
303
374
  "data-slot": "data-table-column-header",
304
375
  "data-tracking-el": i,
305
376
  "data-tracking-label": o,
306
377
  children: n
307
378
  }
308
379
  );
309
- const d = e.getIsSorted(), s = c ? c(n, d) : d === "desc" ? `Sort by ${n}, currently descending` : d === "asc" ? `Sort by ${n}, currently ascending` : `Sort by ${n}`;
310
- return /* @__PURE__ */ t(
380
+ const d = e.getIsSorted(), c = s ? s(n, d) : d === "desc" ? `Sort by ${n}, currently descending` : d === "asc" ? `Sort by ${n}, currently ascending` : `Sort by ${n}`;
381
+ return /* @__PURE__ */ a(
311
382
  "div",
312
383
  {
313
- className: m(
384
+ className: g(
314
385
  "flex items-center",
315
386
  r === "right" && "justify-end",
316
387
  r === "center" && "justify-center",
@@ -319,23 +390,23 @@ function Ae({
319
390
  "data-slot": "data-table-column-header",
320
391
  "data-tracking-el": i,
321
392
  "data-tracking-label": o,
322
- children: /* @__PURE__ */ S(
323
- E,
393
+ children: /* @__PURE__ */ f(
394
+ V,
324
395
  {
325
- "aria-label": s,
396
+ "aria-label": c,
326
397
  className: "text-muted-foreground h-auto p-0 text-sm font-medium",
327
- dataHook: a || `column-header-${e.id}`,
398
+ dataHook: t || `column-header-${e.id}`,
328
399
  size: "sm",
329
400
  variant: "ghost",
330
401
  onClick: () => e.toggleSorting(d === "asc"),
331
402
  children: [
332
- /* @__PURE__ */ t("span", { "aria-hidden": "true", children: n }),
333
- /* @__PURE__ */ t(
403
+ /* @__PURE__ */ a("span", { "aria-hidden": "true", children: n }),
404
+ /* @__PURE__ */ a(
334
405
  "span",
335
406
  {
336
407
  "aria-hidden": "true",
337
408
  className: "flex size-3 items-center justify-center",
338
- children: d === "desc" ? /* @__PURE__ */ t(ue, { size: 12 }) : d === "asc" ? /* @__PURE__ */ t(ge, { size: 12 }) : /* @__PURE__ */ t(me, { size: 12 })
409
+ children: d === "desc" ? /* @__PURE__ */ a(me, { size: 12 }) : d === "asc" ? /* @__PURE__ */ a(he, { size: 12 }) : /* @__PURE__ */ a(be, { size: 12 })
339
410
  }
340
411
  )
341
412
  ]
@@ -344,162 +415,162 @@ function Ae({
344
415
  }
345
416
  );
346
417
  }
347
- Ae.displayName = "DataTableColumnHeader";
348
- function Ie({
418
+ Ie.displayName = "DataTableColumnHeader";
419
+ function Fe({
349
420
  table: e,
350
421
  ariaLabel: n,
351
422
  placeholder: l,
352
- clearSearchAriaLabel: a,
423
+ clearSearchAriaLabel: t,
353
424
  ...i
354
425
  }) {
355
- const o = e.getState().globalFilter ?? "", r = (c) => {
356
- e.setGlobalFilter(c);
426
+ const o = e.getState().globalFilter ?? "", r = (s) => {
427
+ e.setGlobalFilter(s);
357
428
  };
358
- return /* @__PURE__ */ S(fe, { "data-slot": "data-table-search", ...i, children: [
359
- /* @__PURE__ */ t(H, { className: "pl-3", children: /* @__PURE__ */ t(pe, {}) }),
360
- /* @__PURE__ */ t(
361
- be,
429
+ return /* @__PURE__ */ f(we, { "data-slot": "data-table-search", ...i, children: [
430
+ /* @__PURE__ */ a(j, { className: "pl-3", children: /* @__PURE__ */ a(xe, {}) }),
431
+ /* @__PURE__ */ a(
432
+ Ce,
362
433
  {
363
434
  "aria-label": n ?? "Search table",
364
435
  placeholder: l ?? "Search...",
365
436
  type: "text",
366
437
  value: o,
367
- onChange: (c) => r(c.target.value)
438
+ onChange: (s) => r(s.target.value)
368
439
  }
369
440
  ),
370
- o && /* @__PURE__ */ t(H, { className: "pr-1", children: /* @__PURE__ */ t(
371
- E,
441
+ o && /* @__PURE__ */ a(j, { className: "pr-1", children: /* @__PURE__ */ a(
442
+ V,
372
443
  {
373
- "aria-label": a ?? "Clear search",
444
+ "aria-label": t ?? "Clear search",
374
445
  className: "h-auto p-1",
375
446
  "data-slot": "data-table-search-clear",
376
447
  dataHook: `${i.dataHook}-clear`,
377
448
  variant: "ghost",
378
449
  onClick: () => r(""),
379
- children: /* @__PURE__ */ t(he, { size: 14 })
450
+ children: /* @__PURE__ */ a(Se, { size: 14 })
380
451
  }
381
452
  ) })
382
453
  ] });
383
454
  }
384
- Ie.displayName = "DataTableSearch";
385
- function $e(e) {
386
- const { pageIndex: n, pageSize: l } = e.getState().pagination, a = e.getRowCount(), i = e.getPageCount(), o = e.getCanPreviousPage(), r = e.getCanNextPage(), c = n + 1, d = a === 0 ? 0 : n * l + 1, s = Math.min(c * l, a), u = g.useCallback(
387
- (b) => e.setPageIndex(b - 1),
455
+ Fe.displayName = "DataTableSearch";
456
+ function Me(e) {
457
+ const { pageIndex: n, pageSize: l } = e.getState().pagination, t = e.getRowCount(), i = e.getPageCount(), o = e.getCanPreviousPage(), r = e.getCanNextPage(), s = n + 1, d = t === 0 ? 0 : n * l + 1, c = Math.min(s * l, t), u = p.useCallback(
458
+ (x) => e.setPageIndex(x - 1),
388
459
  [e]
389
- ), h = g.useCallback(() => e.nextPage(), [e]), p = g.useCallback(() => e.previousPage(), [e]), f = g.useCallback(
390
- (b) => e.setPageSize(b),
460
+ ), h = p.useCallback(() => e.nextPage(), [e]), m = p.useCallback(() => e.previousPage(), [e]), S = p.useCallback(
461
+ (x) => e.setPageSize(x),
391
462
  [e]
392
463
  );
393
- return g.useMemo(
464
+ return p.useMemo(
394
465
  () => ({
395
466
  pageIndex: n,
396
467
  pageSize: l,
397
- totalRows: a,
468
+ totalRows: t,
398
469
  totalPages: i,
399
470
  startRow: d,
400
- endRow: s,
401
- currentPage: c,
471
+ endRow: c,
472
+ currentPage: s,
402
473
  canPrev: o,
403
474
  canNext: r,
404
475
  goToPage: u,
405
476
  nextPage: h,
406
- previousPage: p,
407
- setPageSize: f
477
+ previousPage: m,
478
+ setPageSize: S
408
479
  }),
409
480
  [
410
481
  n,
411
482
  l,
412
- a,
483
+ t,
413
484
  i,
414
485
  d,
415
- s,
416
486
  c,
487
+ s,
417
488
  o,
418
489
  r,
419
490
  u,
420
491
  h,
421
- p,
422
- f
492
+ m,
493
+ S
423
494
  ]
424
495
  );
425
496
  }
426
- const B = g.createContext(null);
427
- function X() {
428
- const e = g.useContext(B);
497
+ const H = p.createContext(null);
498
+ function q() {
499
+ const e = p.useContext(H);
429
500
  if (!e)
430
501
  throw new Error(
431
502
  "DataTablePagination sub-components must be used within <DataTablePagination>"
432
503
  );
433
504
  return e;
434
505
  }
435
- function Fe({
506
+ function Be({
436
507
  renderText: e,
437
508
  className: n
438
509
  }) {
439
- const { info: l } = X(), { startRow: a, endRow: i, totalRows: o, pageIndex: r, pageSize: c } = l, d = e ? e({ startRow: a, endRow: i, totalRows: o, pageIndex: r, pageSize: c }) : o === 0 ? null : `${a}-${i} of ${o}`;
440
- return d == null ? null : /* @__PURE__ */ t(
510
+ const { info: l } = q(), { startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: s } = l, d = e ? e({ startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: s }) : o === 0 ? null : `${t}-${i} of ${o}`;
511
+ return d == null ? null : /* @__PURE__ */ a(
441
512
  "span",
442
513
  {
443
- className: m("text-muted-foreground text-sm", n),
514
+ className: g("text-muted-foreground text-sm", n),
444
515
  "data-slot": "data-table-pagination-row-count",
445
516
  children: d
446
517
  }
447
518
  );
448
519
  }
449
- Fe.displayName = "DataTablePaginationRowCount";
450
- function q({
520
+ Be.displayName = "DataTablePaginationRowCount";
521
+ function J({
451
522
  ariaLabel: e = "Table pagination",
452
523
  dataHook: n,
453
524
  className: l
454
525
  }) {
455
- const { info: a } = X(), i = we({
456
- page: a.currentPage,
457
- totalPages: a.totalPages
526
+ const { info: t } = q(), i = ke({
527
+ page: t.currentPage,
528
+ totalPages: t.totalPages
458
529
  });
459
- return /* @__PURE__ */ t(
460
- Se,
530
+ return /* @__PURE__ */ a(
531
+ ve,
461
532
  {
462
533
  ariaLabel: e,
463
- className: m("mx-0 w-auto justify-end", l),
534
+ className: g("mx-0 w-auto justify-end", l),
464
535
  dataHook: n ?? "pagination-nav",
465
- children: /* @__PURE__ */ t(Ce, { children: i.map((o, r) => o === "previous" ? /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
466
- xe,
536
+ children: /* @__PURE__ */ a(Te, { children: i.map((o, r) => o === "previous" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
537
+ Pe,
467
538
  {
468
- disabled: !a.canPrev,
469
- onClick: () => a.previousPage()
539
+ disabled: !t.canPrev,
540
+ onClick: () => t.previousPage()
470
541
  }
471
- ) }, "previous") : o === "next" ? /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
472
- ke,
542
+ ) }, "previous") : o === "next" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
543
+ Re,
473
544
  {
474
- disabled: !a.canNext,
475
- onClick: () => a.nextPage()
545
+ disabled: !t.canNext,
546
+ onClick: () => t.nextPage()
476
547
  }
477
- ) }, "next") : o === "ellipsis" ? /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(Pe, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
478
- Te,
548
+ ) }, "next") : o === "ellipsis" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(ye, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
549
+ De,
479
550
  {
480
- isActive: o === a.currentPage,
551
+ isActive: o === t.currentPage,
481
552
  page: o,
482
- onClick: () => a.goToPage(o)
553
+ onClick: () => t.goToPage(o)
483
554
  }
484
555
  ) }, o)) })
485
556
  }
486
557
  );
487
558
  }
488
- q.displayName = "DataTablePaginationNav";
489
- function Me({
559
+ J.displayName = "DataTablePaginationNav";
560
+ function He({
490
561
  table: e,
491
562
  dataHook: n,
492
563
  showRowCount: l = !0,
493
- renderRowCount: a,
564
+ renderRowCount: t,
494
565
  trackingEl: i,
495
566
  trackingLabel: o,
496
567
  className: r,
497
- ariaLabel: c = "Table pagination",
568
+ ariaLabel: s = "Table pagination",
498
569
  children: d
499
570
  }) {
500
- const s = $e(e), u = g.useMemo(
501
- () => ({ info: s }),
502
- [s]
571
+ const c = Me(e), u = p.useMemo(
572
+ () => ({ info: c }),
573
+ [c]
503
574
  ), h = {
504
575
  "data-hook": n,
505
576
  "data-slot": "data-table-pagination",
@@ -507,36 +578,36 @@ function Me({
507
578
  "data-tracking-label": o
508
579
  };
509
580
  if (d)
510
- return /* @__PURE__ */ t(B.Provider, { value: u, children: /* @__PURE__ */ t(
581
+ return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ a(
511
582
  "div",
512
583
  {
513
- className: m("flex w-full items-center gap-4", r),
584
+ className: g("flex w-full items-center gap-4", r),
514
585
  ...h,
515
586
  children: d
516
587
  }
517
588
  ) });
518
- const p = !l || a === null ? null : a ? a({
519
- startRow: s.startRow,
520
- endRow: s.endRow,
521
- totalRows: s.totalRows,
522
- pageIndex: s.pageIndex,
523
- pageSize: s.pageSize
524
- }) : s.totalRows === 0 ? null : `${s.startRow}-${s.endRow} of ${s.totalRows}`;
525
- return /* @__PURE__ */ t(B.Provider, { value: u, children: /* @__PURE__ */ S(
589
+ const m = !l || t === null ? null : t ? t({
590
+ startRow: c.startRow,
591
+ endRow: c.endRow,
592
+ totalRows: c.totalRows,
593
+ pageIndex: c.pageIndex,
594
+ pageSize: c.pageSize
595
+ }) : c.totalRows === 0 ? null : `${c.startRow}-${c.endRow} of ${c.totalRows}`;
596
+ return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ f(
526
597
  "div",
527
598
  {
528
- className: m(
599
+ className: g(
529
600
  "flex w-full items-center gap-4",
530
- p != null ? "justify-between" : "justify-end",
601
+ m != null ? "justify-between" : "justify-end",
531
602
  r
532
603
  ),
533
604
  ...h,
534
605
  children: [
535
- p != null && /* @__PURE__ */ t("span", { className: "text-muted-foreground text-sm", children: p }),
536
- /* @__PURE__ */ t(
537
- q,
606
+ m != null && /* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children: m }),
607
+ /* @__PURE__ */ a(
608
+ J,
538
609
  {
539
- ariaLabel: c,
610
+ ariaLabel: s,
540
611
  dataHook: `${n}-nav`
541
612
  }
542
613
  )
@@ -544,125 +615,198 @@ function Me({
544
615
  }
545
616
  ) });
546
617
  }
547
- Me.displayName = "DataTablePagination";
548
- function Be({
618
+ He.displayName = "DataTablePagination";
619
+ function Ve({
549
620
  table: e,
550
621
  dataHook: n,
551
622
  trackingEl: l,
552
- trackingLabel: a,
623
+ trackingLabel: t,
553
624
  selectAllAriaLabel: i
554
625
  }) {
555
- return /* @__PURE__ */ t(
556
- j,
626
+ return /* @__PURE__ */ a(
627
+ L,
557
628
  {
558
629
  "aria-label": i ?? "Select all",
559
630
  checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
560
631
  dataHook: n || "select-all-checkbox",
561
632
  trackingEl: l,
562
- trackingLabel: a,
633
+ trackingLabel: t,
563
634
  onCheckedChange: (o) => e.toggleAllPageRowsSelected(!!o)
564
635
  }
565
636
  );
566
637
  }
567
- Be.displayName = "DataTableSelectAllCheckbox";
568
- function He({
638
+ Ve.displayName = "DataTableSelectAllCheckbox";
639
+ function je({
569
640
  row: e,
570
641
  dataHook: n,
571
642
  trackingEl: l,
572
- trackingLabel: a,
643
+ trackingLabel: t,
573
644
  selectRowAriaLabel: i
574
645
  }) {
575
- return /* @__PURE__ */ t(
576
- j,
646
+ return /* @__PURE__ */ a(
647
+ L,
577
648
  {
578
649
  "aria-label": i ?? "Select row",
579
650
  checked: e.getIsSelected(),
580
651
  dataHook: n || `select-row-${e.id}`,
581
652
  disabled: !e.getCanSelect(),
582
653
  trackingEl: l,
583
- trackingLabel: a,
654
+ trackingLabel: t,
584
655
  onCheckedChange: (o) => e.toggleSelected(!!o)
585
656
  }
586
657
  );
587
658
  }
588
- He.displayName = "DataTableSelectRowCheckbox";
589
- const J = g.createContext(null);
590
- function Ve() {
591
- const e = g.useContext(J);
659
+ je.displayName = "DataTableSelectRowCheckbox";
660
+ function Ge({
661
+ row: e,
662
+ rowName: n,
663
+ dataHook: l,
664
+ trackingEl: t,
665
+ trackingLabel: i,
666
+ expandLabel: o,
667
+ collapseLabel: r,
668
+ className: s
669
+ }) {
670
+ if (!e.getCanExpand())
671
+ return /* @__PURE__ */ a(
672
+ "span",
673
+ {
674
+ "aria-hidden": "true",
675
+ className: g("inline-block size-9", s),
676
+ "data-slot": "data-table-expand-row-spacer"
677
+ }
678
+ );
679
+ const d = e.getIsExpanded(), c = d ? r : o;
680
+ let u;
681
+ return c && (n !== void 0 || !c.includes("{name}")) ? u = c.replaceAll("{name}", n ?? "") : n !== void 0 ? u = d ? `Collapse details for ${n}` : `Expand details for ${n}` : u = d ? "Collapse row" : "Expand row", /* @__PURE__ */ a(
682
+ V,
683
+ {
684
+ iconOnly: !0,
685
+ "aria-expanded": d,
686
+ "aria-label": u,
687
+ className: s,
688
+ "data-state": d ? "open" : "closed",
689
+ dataHook: l || `expand-row-${e.id}`,
690
+ size: "sm",
691
+ trackingEl: t,
692
+ trackingLabel: i,
693
+ variant: "ghost",
694
+ onClick: e.getToggleExpandedHandler(),
695
+ children: /* @__PURE__ */ a(
696
+ fe,
697
+ {
698
+ "aria-hidden": "true",
699
+ className: g(
700
+ "duration-base transition-transform ease-in-out",
701
+ d && "rotate-90"
702
+ )
703
+ }
704
+ )
705
+ }
706
+ );
707
+ }
708
+ Ge.displayName = "DataTableExpandRowButton";
709
+ function Le({
710
+ fields: e = 3,
711
+ loadingLabel: n,
712
+ dataHook: l,
713
+ className: t
714
+ }) {
715
+ return /* @__PURE__ */ f(
716
+ "div",
717
+ {
718
+ className: g("relative flex flex-col gap-2 py-1", t),
719
+ "data-hook": l || "data-table-expanded-skeleton",
720
+ "data-slot": "data-table-expanded-skeleton",
721
+ role: "status",
722
+ children: [
723
+ /* @__PURE__ */ a("span", { className: "sr-only", children: n ?? "Loading details" }),
724
+ Array.from({ length: e }, (i, o) => /* @__PURE__ */ f("div", { "aria-hidden": "true", className: "flex items-center gap-4", children: [
725
+ /* @__PURE__ */ a(B, { className: "h-4 w-24 shrink-0" }),
726
+ /* @__PURE__ */ a(B, { className: "h-4 w-48 max-w-full" })
727
+ ] }, o))
728
+ ]
729
+ }
730
+ );
731
+ }
732
+ Le.displayName = "DataTableExpandedSkeleton";
733
+ const K = p.createContext(null);
734
+ function _e() {
735
+ const e = p.useContext(K);
592
736
  if (!e)
593
737
  throw new Error(
594
738
  "DataTableBulkActions components must be used within <DataTableBulkActions>"
595
739
  );
596
740
  return e;
597
741
  }
598
- function Ee({
742
+ function Ue({
599
743
  table: e,
600
744
  dataHook: n,
601
745
  trackingEl: l,
602
- trackingLabel: a,
746
+ trackingLabel: t,
603
747
  className: i,
604
748
  children: o
605
749
  }) {
606
- const r = e.getFilteredSelectedRowModel().rows.length, c = e.getRowCount(), d = g.useMemo(
607
- () => ({ selectedCount: r, totalCount: c }),
608
- [r, c]
750
+ const r = e.getFilteredSelectedRowModel().rows.length, s = e.getRowCount(), d = p.useMemo(
751
+ () => ({ selectedCount: r, totalCount: s }),
752
+ [r, s]
609
753
  );
610
- return r === 0 ? null : /* @__PURE__ */ t(J.Provider, { value: d, children: /* @__PURE__ */ t(
754
+ return r === 0 ? null : /* @__PURE__ */ a(K.Provider, { value: d, children: /* @__PURE__ */ a(
611
755
  "div",
612
756
  {
613
- className: m("flex items-center gap-2.5", i),
757
+ className: g("flex items-center gap-2.5", i),
614
758
  "data-hook": n,
615
759
  "data-slot": "data-table-bulk-actions",
616
760
  "data-tracking-el": l ?? "data-table-bulk-actions",
617
- "data-tracking-label": a,
761
+ "data-tracking-label": t,
618
762
  children: o
619
763
  }
620
764
  ) });
621
765
  }
622
- Ee.displayName = "DataTableBulkActions";
623
- function je({
766
+ Ue.displayName = "DataTableBulkActions";
767
+ function We({
624
768
  dataHook: e = "data-table-bulk-actions-summary",
625
769
  className: n,
626
770
  children: l
627
771
  }) {
628
- const { selectedCount: a, totalCount: i } = Ve();
772
+ const { selectedCount: t, totalCount: i } = _e();
629
773
  let o;
630
- return typeof l == "function" ? o = l({ selectedCount: a, totalCount: i }) : l != null ? o = l : o = `${a} of ${i} row(s) selected.`, /* @__PURE__ */ t(
631
- ye,
774
+ return typeof l == "function" ? o = l({ selectedCount: t, totalCount: i }) : l != null ? o = l : o = `${t} of ${i} row(s) selected.`, /* @__PURE__ */ a(
775
+ Ae,
632
776
  {
633
777
  asChild: !0,
634
- className: m("min-w-0", n),
778
+ className: g("min-w-0", n),
635
779
  dataHook: e,
636
- children: /* @__PURE__ */ t("span", { "data-slot": "data-table-bulk-actions-summary", role: "status", children: o })
780
+ children: /* @__PURE__ */ a("span", { "data-slot": "data-table-bulk-actions-summary", role: "status", children: o })
637
781
  }
638
782
  );
639
783
  }
640
- je.displayName = "DataTableBulkActionsSummary";
641
- function Ge({
784
+ We.displayName = "DataTableBulkActionsSummary";
785
+ function Oe({
642
786
  dataHook: e = "data-table-bulk-actions-actions",
643
787
  className: n,
644
788
  children: l
645
789
  }) {
646
- return /* @__PURE__ */ t(
790
+ return /* @__PURE__ */ a(
647
791
  "div",
648
792
  {
649
- className: m("flex shrink-0 items-center gap-2", n),
793
+ className: g("flex shrink-0 items-center gap-2", n),
650
794
  "data-hook": e,
651
795
  "data-slot": "data-table-bulk-actions-actions",
652
796
  children: l
653
797
  }
654
798
  );
655
799
  }
656
- Ge.displayName = "DataTableBulkActionsActions";
657
- function Le({
800
+ Oe.displayName = "DataTableBulkActionsActions";
801
+ function Xe({
658
802
  dataHook: e,
659
803
  className: n,
660
804
  children: l
661
805
  }) {
662
- return /* @__PURE__ */ t(
806
+ return /* @__PURE__ */ a(
663
807
  "div",
664
808
  {
665
- className: m(
809
+ className: g(
666
810
  "flex flex-col gap-3 py-4 sm:flex-row sm:items-center",
667
811
  n
668
812
  ),
@@ -672,15 +816,15 @@ function Le({
672
816
  }
673
817
  );
674
818
  }
675
- Le.displayName = "DataTableToolbar";
676
- function Ue({
819
+ Xe.displayName = "DataTableToolbar";
820
+ function qe({
677
821
  className: e,
678
822
  children: n
679
823
  }) {
680
- return /* @__PURE__ */ t(
824
+ return /* @__PURE__ */ a(
681
825
  "div",
682
826
  {
683
- className: m(
827
+ className: g(
684
828
  "flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-1",
685
829
  e
686
830
  ),
@@ -689,15 +833,15 @@ function Ue({
689
833
  }
690
834
  );
691
835
  }
692
- Ue.displayName = "DataTableToolbarLeft";
693
- function We({
836
+ qe.displayName = "DataTableToolbarLeft";
837
+ function Je({
694
838
  className: e,
695
839
  children: n
696
840
  }) {
697
- return /* @__PURE__ */ t(
841
+ return /* @__PURE__ */ a(
698
842
  "div",
699
843
  {
700
- className: m(
844
+ className: g(
701
845
  "flex w-full items-center justify-end gap-2 sm:w-auto",
702
846
  e
703
847
  ),
@@ -706,23 +850,25 @@ function We({
706
850
  }
707
851
  );
708
852
  }
709
- We.displayName = "DataTableToolbarRight";
853
+ Je.displayName = "DataTableToolbarRight";
710
854
  export {
711
- Ne as DataTable,
712
- Ee as DataTableBulkActions,
713
- Ge as DataTableBulkActionsActions,
714
- je as DataTableBulkActionsSummary,
715
- Ae as DataTableColumnHeader,
716
- Me as DataTablePagination,
717
- q as DataTablePaginationNav,
718
- Fe as DataTablePaginationRowCount,
719
- Ie as DataTableSearch,
720
- Be as DataTableSelectAllCheckbox,
721
- He as DataTableSelectRowCheckbox,
722
- Le as DataTableToolbar,
723
- Ue as DataTableToolbarLeft,
724
- We as DataTableToolbarRight,
725
- ze as VirtualizedDataTable,
726
- nt as useDataTable,
727
- Ve as useDataTableBulkActionsContext
855
+ $e as DataTable,
856
+ Ue as DataTableBulkActions,
857
+ Oe as DataTableBulkActionsActions,
858
+ We as DataTableBulkActionsSummary,
859
+ Ie as DataTableColumnHeader,
860
+ Ge as DataTableExpandRowButton,
861
+ Le as DataTableExpandedSkeleton,
862
+ He as DataTablePagination,
863
+ J as DataTablePaginationNav,
864
+ Be as DataTablePaginationRowCount,
865
+ Fe as DataTableSearch,
866
+ Ve as DataTableSelectAllCheckbox,
867
+ je as DataTableSelectRowCheckbox,
868
+ Xe as DataTableToolbar,
869
+ qe as DataTableToolbarLeft,
870
+ Je as DataTableToolbarRight,
871
+ Ee as VirtualizedDataTable,
872
+ sa as useDataTable,
873
+ _e as useDataTableBulkActionsContext
728
874
  };