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