@brightlocal/ui-components 2.20.0 → 2.22.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 (66) hide show
  1. package/AI_USAGE.md +2 -0
  2. package/README.md +26 -13
  3. package/component-meta.json +41 -14
  4. package/dist/blocks/data-table.cjs +1 -1
  5. package/dist/blocks/data-table.d.ts +35 -3
  6. package/dist/blocks/data-table.d.ts.map +1 -1
  7. package/dist/blocks/data-table.js +178 -154
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts +2 -2
  10. package/dist/blocks/sidebar.js +18 -18
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.d.ts +1 -1
  13. package/dist/breadcrumb.d.ts.map +1 -1
  14. package/dist/breadcrumb.js +9 -6
  15. package/dist/button.cjs +1 -1
  16. package/dist/button.d.ts.map +1 -1
  17. package/dist/button.js +12 -12
  18. package/dist/hover-card.cjs +1 -1
  19. package/dist/hover-card.d.ts.map +1 -1
  20. package/dist/hover-card.js +45 -45
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +69 -68
  23. package/dist/lib/utils.cjs +1 -1
  24. package/dist/lib/utils.d.ts +1 -0
  25. package/dist/lib/utils.d.ts.map +1 -1
  26. package/dist/lib/utils.js +7 -5
  27. package/dist/logo.cjs +1 -1
  28. package/dist/logo.d.ts +1 -1
  29. package/dist/logo.js +2 -2
  30. package/dist/navigation-menu.cjs +1 -1
  31. package/dist/navigation-menu.d.ts +17 -0
  32. package/dist/navigation-menu.d.ts.map +1 -1
  33. package/dist/navigation-menu.js +120 -90
  34. package/dist/pagination.cjs +1 -1
  35. package/dist/pagination.d.ts +12 -8
  36. package/dist/pagination.d.ts.map +1 -1
  37. package/dist/pagination.js +117 -113
  38. package/dist/progress.cjs +1 -1
  39. package/dist/progress.d.ts +28 -2
  40. package/dist/progress.d.ts.map +1 -1
  41. package/dist/progress.js +90 -49
  42. package/dist/skeleton.cjs +1 -1
  43. package/dist/skeleton.js +1 -1
  44. package/dist/sonner.d.ts +1 -1
  45. package/dist/table.cjs +1 -1
  46. package/dist/table.d.ts +22 -2
  47. package/dist/table.d.ts.map +1 -1
  48. package/dist/table.js +57 -43
  49. package/dist/tooltip.cjs +1 -1
  50. package/dist/tooltip.d.ts.map +1 -1
  51. package/dist/tooltip.js +36 -36
  52. package/package.json +7 -3
  53. package/src/blocks/data-table.tsx +56 -4
  54. package/src/blocks/sidebar.tsx +5 -5
  55. package/src/components/breadcrumb.tsx +6 -3
  56. package/src/components/button.tsx +7 -1
  57. package/src/components/hover-card.tsx +6 -3
  58. package/src/components/logo.tsx +3 -3
  59. package/src/components/navigation-menu.tsx +113 -32
  60. package/src/components/pagination.tsx +47 -67
  61. package/src/components/progress.tsx +118 -14
  62. package/src/components/skeleton.tsx +1 -1
  63. package/src/components/sonner.tsx +1 -1
  64. package/src/components/table.tsx +44 -7
  65. package/src/components/tooltip.tsx +8 -5
  66. package/src/lib/utils.ts +3 -0
@@ -1,16 +1,16 @@
1
- import { jsx as a, jsxs as S, Fragment as T } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as w, Fragment as k } from "react/jsx-runtime";
2
2
  import * as m from "react";
3
- import { useReactTable as ne, getExpandedRowModel as oe, getFilteredRowModel as le, getSortedRowModel as ie, getPaginationRowModel as re, getCoreRowModel as se, flexRender as A } from "@tanstack/react-table";
3
+ import { useReactTable as ne, getExpandedRowModel as oe, getFilteredRowModel as le, getSortedRowModel as ie, getPaginationRowModel as re, getCoreRowModel as se, flexRender as j } from "@tanstack/react-table";
4
4
  import { useVirtualizer as ce } from "@tanstack/react-virtual";
5
- import { ArrowDown as de, ArrowUp as ue, ArrowUpDown as ge, Search as me, X as pe } from "@brightlocal/icons";
6
- import { cn as h } from "@brightlocal/ui-components/lib/utils";
7
- import { Button as H } from "../button.js";
8
- import { Checkbox as V } from "../checkbox.js";
9
- import { InputGroup as he, InputGroupAddon as M, InputGroupInput as fe } from "../input-group.js";
10
- import { usePagination as be, Pagination as Se, PaginationContent as we, PaginationItem as z, PaginationPrevious as Ce, PaginationNext as xe, PaginationEllipsis as Pe, PaginationLink as ve } from "../pagination.js";
5
+ import { ArrowDown as de, ArrowUp as ue, ArrowUpDown as ge, Search as me, X as he } from "@brightlocal/icons";
6
+ import { cn as p } from "@brightlocal/ui-components/lib/utils";
7
+ import { Button as E } from "../button.js";
8
+ import { Checkbox as G } from "../checkbox.js";
9
+ import { InputGroup as pe, InputGroupAddon as V, InputGroupInput as fe } from "../input-group.js";
10
+ import { usePagination as be, Pagination as Se, PaginationContent as we, PaginationItem as $, PaginationPrevious as Ce, PaginationNext as xe, PaginationEllipsis as Pe, PaginationLink as ve } from "../pagination.js";
11
11
  import { Skeleton as Re } from "../skeleton.js";
12
- import { Table as j, TableBody as E, TableRow as C, TableCell as x, TableHeader as Te, TableHead as ke } from "../table.js";
13
- function R(e, n, l) {
12
+ import { Table as L, TableBody as B, TableRow as P, TableCell as v, TableHeader as Te, TableHead as ke } from "../table.js";
13
+ function T(e, n, l) {
14
14
  const [t, i] = m.useState(n), o = e !== void 0 ? e : t, r = m.useRef(o);
15
15
  m.useEffect(() => {
16
16
  r.current = o;
@@ -24,7 +24,7 @@ function R(e, n, l) {
24
24
  );
25
25
  return [o, c];
26
26
  }
27
- function Qe(e) {
27
+ function Oe(e) {
28
28
  const {
29
29
  columns: n,
30
30
  data: l,
@@ -36,45 +36,45 @@ function Qe(e) {
36
36
  manualSorting: c = !1,
37
37
  manualFiltering: s = !1,
38
38
  manualPagination: u = !1,
39
- rowCount: p,
39
+ rowCount: h,
40
40
  pageCount: g,
41
41
  enableExpanding: f = !1,
42
- getSubRows: w,
43
- getRowId: P,
44
- pagination: v,
45
- onPaginationChange: k,
46
- sorting: b,
47
- onSortingChange: I,
48
- globalFilter: y,
49
- onGlobalFilterChange: N,
50
- rowSelection: $,
51
- onRowSelectionChange: D,
52
- expanded: X,
53
- onExpandedChange: q
54
- } = e, [J, K] = R(
55
- v,
42
+ getSubRows: b,
43
+ getRowId: C,
44
+ pagination: x,
45
+ onPaginationChange: F,
46
+ sorting: D,
47
+ onSortingChange: R,
48
+ globalFilter: N,
49
+ onGlobalFilterChange: S,
50
+ rowSelection: M,
51
+ onRowSelectionChange: y,
52
+ expanded: z,
53
+ onExpandedChange: A
54
+ } = e, [I, J] = T(
55
+ x,
56
56
  { pageIndex: 0, pageSize: d },
57
- k
58
- ), [O, Q] = R(
59
- b,
57
+ F
58
+ ), [K, O] = T(
59
+ D,
60
60
  [],
61
- I
62
- ), [W, Y] = R(
63
- y,
61
+ R
62
+ ), [Q, Y] = T(
63
+ N,
64
64
  "",
65
- N
66
- ), [Z, ee] = R($, {}, D), [ae, te] = R(
67
- X,
65
+ S
66
+ ), [Z, ee] = T(M, {}, y), [ae, te] = T(
67
+ z,
68
68
  {},
69
- q
69
+ A
70
70
  );
71
71
  return ne({
72
72
  data: l,
73
73
  columns: n,
74
74
  getCoreRowModel: se(),
75
- ...P && { getRowId: P },
75
+ ...C && { getRowId: C },
76
76
  ...(r || u) && {
77
- onPaginationChange: K
77
+ onPaginationChange: J
78
78
  },
79
79
  ...r && {
80
80
  ...!u && {
@@ -83,14 +83,14 @@ function Qe(e) {
83
83
  },
84
84
  ...u && {
85
85
  manualPagination: !0,
86
- ...p != null && { rowCount: p },
86
+ ...h != null && { rowCount: h },
87
87
  ...g != null && { pageCount: g }
88
88
  },
89
89
  ...t && {
90
90
  ...!c && {
91
91
  getSortedRowModel: ie()
92
92
  },
93
- onSortingChange: Q,
93
+ onSortingChange: O,
94
94
  ...c && { manualSorting: !0 }
95
95
  },
96
96
  ...i && {
@@ -108,18 +108,18 @@ function Qe(e) {
108
108
  ...f && {
109
109
  getExpandedRowModel: oe(),
110
110
  onExpandedChange: te,
111
- getSubRows: w
111
+ getSubRows: b
112
112
  },
113
113
  state: {
114
- pagination: J,
115
- sorting: O,
116
- globalFilter: W,
114
+ pagination: I,
115
+ sorting: K,
116
+ globalFilter: Q,
117
117
  rowSelection: Z,
118
118
  expanded: ae
119
119
  }
120
120
  });
121
121
  }
122
- function ye({
122
+ function De({
123
123
  table: e,
124
124
  dataHook: n,
125
125
  trackingEl: l,
@@ -129,52 +129,66 @@ function ye({
129
129
  noResultsMessage: r = "No results.",
130
130
  stickyHeader: d = !1,
131
131
  className: c,
132
- footer: s
132
+ layout: s,
133
+ minWidth: u,
134
+ scrollRegionLabel: h,
135
+ footer: g
133
136
  }) {
134
- const u = e.getVisibleLeafColumns().length, p = o ?? e.getState().pagination.pageSize ?? 10;
137
+ const f = e.getVisibleLeafColumns().length, b = o ?? e.getState().pagination.pageSize ?? 10;
135
138
  return /* @__PURE__ */ a(
136
139
  "div",
137
140
  {
138
141
  "aria-busy": i || void 0,
139
- className: h("border-border overflow-auto rounded-md border", c),
142
+ className: p("border-border overflow-auto rounded-md border", c),
140
143
  "data-hook": n,
141
144
  "data-slot": "data-table-view",
142
145
  "data-tracking-el": l,
143
146
  "data-tracking-label": t,
144
- children: /* @__PURE__ */ S(j, { dataHook: `${n}-table`, children: [
145
- /* @__PURE__ */ a(G, { stickyHeader: d, table: e }),
146
- /* @__PURE__ */ a(E, { children: i ? /* @__PURE__ */ S(T, { children: [
147
- /* @__PURE__ */ a(
148
- B,
149
- {
150
- colCount: u,
151
- rowCount: p
152
- }
153
- ),
154
- /* @__PURE__ */ a(C, { className: "sr-only", children: /* @__PURE__ */ a(x, { colSpan: u, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
155
- ] }) : /* @__PURE__ */ a(T, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((g) => /* @__PURE__ */ a(L, { row: g }, g.id)) : /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(x, { colSpan: u, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }) }),
156
- s
157
- ] })
147
+ children: /* @__PURE__ */ w(
148
+ L,
149
+ {
150
+ dataHook: `${n}-table`,
151
+ layout: s,
152
+ minWidth: u,
153
+ scrollRegionLabel: h,
154
+ children: [
155
+ /* @__PURE__ */ a(U, { stickyHeader: d, table: e }),
156
+ /* @__PURE__ */ a(B, { children: i ? /* @__PURE__ */ w(k, { children: [
157
+ /* @__PURE__ */ a(
158
+ _,
159
+ {
160
+ colCount: f,
161
+ rowCount: b
162
+ }
163
+ ),
164
+ /* @__PURE__ */ a(P, { className: "sr-only", children: /* @__PURE__ */ a(v, { colSpan: f, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
165
+ ] }) : /* @__PURE__ */ a(k, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((C) => /* @__PURE__ */ a(W, { row: C }, C.id)) : /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a(v, { colSpan: f, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }) }),
166
+ g
167
+ ]
168
+ }
169
+ )
158
170
  }
159
171
  );
160
172
  }
161
- ye.displayName = "DataTable";
162
- function G({
173
+ De.displayName = "DataTable";
174
+ function U({
163
175
  table: e,
164
176
  stickyHeader: n
165
177
  }) {
166
178
  return /* @__PURE__ */ a(
167
179
  Te,
168
180
  {
169
- className: h(n && "bg-background sticky top-0 z-10"),
170
- children: e.getHeaderGroups().map((l) => /* @__PURE__ */ a(C, { children: l.headers.map((t) => {
171
- const i = t.column.getCanSort() ? t.column.getIsSorted() : !1, o = i === "asc" ? "ascending" : i === "desc" ? "descending" : t.column.getCanSort() ? "none" : void 0;
181
+ className: p(n && "bg-background sticky top-0 z-10"),
182
+ children: e.getHeaderGroups().map((l) => /* @__PURE__ */ a(P, { children: l.headers.map((t) => {
183
+ 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;
172
184
  return /* @__PURE__ */ a(
173
185
  ke,
174
186
  {
175
187
  "aria-sort": o,
176
188
  colSpan: t.colSpan,
177
- children: t.isPlaceholder ? null : A(
189
+ minWidth: r?.minWidth,
190
+ width: r?.width,
191
+ children: t.isPlaceholder ? null : j(
178
192
  t.column.columnDef.header,
179
193
  t.getContext()
180
194
  )
@@ -185,14 +199,14 @@ function G({
185
199
  }
186
200
  );
187
201
  }
188
- function L({ row: e }) {
189
- return /* @__PURE__ */ a(C, { "data-state": e.getIsSelected() ? "selected" : void 0, children: e.getVisibleCells().map((n) => /* @__PURE__ */ a(x, { children: A(n.column.columnDef.cell, n.getContext()) }, n.id)) });
202
+ function W({ row: e }) {
203
+ return /* @__PURE__ */ a(P, { "data-state": e.getIsSelected() ? "selected" : void 0, children: e.getVisibleCells().map((n) => /* @__PURE__ */ a(v, { children: j(n.column.columnDef.cell, n.getContext()) }, n.id)) });
190
204
  }
191
- function B({
205
+ function _({
192
206
  rowCount: e,
193
207
  colCount: n
194
208
  }) {
195
- return /* @__PURE__ */ a(T, { children: Array.from({ length: e }).map((l, t) => /* @__PURE__ */ a(C, { children: Array.from({ length: n }).map((i, o) => /* @__PURE__ */ a(x, { children: /* @__PURE__ */ a(Re, { className: "h-4 w-full" }) }, `skeleton-${t}-${o}`)) }, `skeleton-${t}`)) });
209
+ return /* @__PURE__ */ a(k, { children: Array.from({ length: e }).map((l, t) => /* @__PURE__ */ a(P, { children: Array.from({ length: n }).map((i, o) => /* @__PURE__ */ a(v, { children: /* @__PURE__ */ a(Re, { className: "h-4 w-full" }) }, `skeleton-${t}-${o}`)) }, `skeleton-${t}`)) });
196
210
  }
197
211
  function Ne({
198
212
  table: e,
@@ -204,54 +218,66 @@ function Ne({
204
218
  noResultsMessage: r = "No results.",
205
219
  stickyHeader: d = !1,
206
220
  className: c,
207
- footer: s,
208
- height: u,
209
- estimateSize: p = 48,
210
- overscan: g = 5
221
+ layout: s,
222
+ minWidth: u,
223
+ scrollRegionLabel: h,
224
+ footer: g,
225
+ height: f,
226
+ estimateSize: b = 48,
227
+ overscan: C = 5
211
228
  }) {
212
- const f = e.getVisibleLeafColumns().length, w = o ?? e.getState().pagination.pageSize ?? 10, P = m.useRef(null), v = e.getRowModel().rows, k = ce({
213
- count: v.length,
214
- getScrollElement: () => P.current,
215
- estimateSize: () => p,
216
- overscan: g
217
- }), b = k.getVirtualItems(), I = k.getTotalSize(), y = b.length > 0 ? b[0].start : 0, N = b.length > 0 ? I - b[b.length - 1].end : 0;
229
+ const x = e.getVisibleLeafColumns().length, F = o ?? e.getState().pagination.pageSize ?? 10, D = m.useRef(null), R = e.getRowModel().rows, N = ce({
230
+ count: R.length,
231
+ getScrollElement: () => D.current,
232
+ estimateSize: () => b,
233
+ overscan: C
234
+ }), S = N.getVirtualItems(), M = N.getTotalSize(), y = S.length > 0 ? S[0].start : 0, z = S.length > 0 ? M - S[S.length - 1].end : 0;
218
235
  return /* @__PURE__ */ a(
219
236
  "div",
220
237
  {
221
- ref: P,
238
+ ref: D,
222
239
  "aria-busy": i || void 0,
223
- className: h("border-border overflow-auto rounded-md border", c),
240
+ className: p("border-border overflow-auto rounded-md border", c),
224
241
  "data-hook": n,
225
242
  "data-slot": "data-table-view",
226
243
  "data-tracking-el": l,
227
244
  "data-tracking-label": t,
228
- style: u != null ? { height: u } : void 0,
229
- children: /* @__PURE__ */ S(j, { dataHook: `${n}-table`, children: [
230
- /* @__PURE__ */ a(G, { stickyHeader: d, table: e }),
231
- /* @__PURE__ */ a(E, { children: i ? /* @__PURE__ */ S(T, { children: [
232
- /* @__PURE__ */ a(
233
- B,
234
- {
235
- colCount: f,
236
- rowCount: w
237
- }
238
- ),
239
- /* @__PURE__ */ a(C, { className: "sr-only", children: /* @__PURE__ */ a(x, { colSpan: f, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
240
- ] }) : v.length > 0 ? /* @__PURE__ */ S(T, { children: [
241
- y > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: f, style: { height: y } }) }),
242
- b.map(($) => {
243
- const D = v[$.index];
244
- return /* @__PURE__ */ a(L, { row: D }, D.id);
245
- }),
246
- N > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: f, style: { height: N } }) })
247
- ] }) : /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(x, { colSpan: f, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }),
248
- s
249
- ] })
245
+ style: f != null ? { height: f } : void 0,
246
+ children: /* @__PURE__ */ w(
247
+ L,
248
+ {
249
+ dataHook: `${n}-table`,
250
+ layout: s,
251
+ minWidth: u,
252
+ scrollRegionLabel: h,
253
+ children: [
254
+ /* @__PURE__ */ a(U, { stickyHeader: d, table: e }),
255
+ /* @__PURE__ */ a(B, { children: i ? /* @__PURE__ */ w(k, { children: [
256
+ /* @__PURE__ */ a(
257
+ _,
258
+ {
259
+ colCount: x,
260
+ rowCount: F
261
+ }
262
+ ),
263
+ /* @__PURE__ */ a(P, { className: "sr-only", children: /* @__PURE__ */ a(v, { colSpan: x, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
264
+ ] }) : R.length > 0 ? /* @__PURE__ */ w(k, { children: [
265
+ y > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: x, style: { height: y } }) }),
266
+ S.map((A) => {
267
+ const I = R[A.index];
268
+ return /* @__PURE__ */ a(W, { row: I }, I.id);
269
+ }),
270
+ z > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: x, style: { height: z } }) })
271
+ ] }) : /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a(v, { colSpan: x, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }),
272
+ g
273
+ ]
274
+ }
275
+ )
250
276
  }
251
277
  );
252
278
  }
253
279
  Ne.displayName = "VirtualizedDataTable";
254
- function De({
280
+ function ye({
255
281
  column: e,
256
282
  title: n,
257
283
  className: l,
@@ -265,7 +291,7 @@ function De({
265
291
  return /* @__PURE__ */ a(
266
292
  "div",
267
293
  {
268
- className: h(
294
+ className: p(
269
295
  "text-muted-foreground text-left text-sm leading-normal font-medium",
270
296
  r === "right" && "text-right",
271
297
  r === "center" && "text-center",
@@ -282,7 +308,7 @@ function De({
282
308
  return /* @__PURE__ */ a(
283
309
  "div",
284
310
  {
285
- className: h(
311
+ className: p(
286
312
  "flex items-center",
287
313
  r === "right" && "justify-end",
288
314
  r === "center" && "justify-center",
@@ -291,8 +317,8 @@ function De({
291
317
  "data-slot": "data-table-column-header",
292
318
  "data-tracking-el": i,
293
319
  "data-tracking-label": o,
294
- children: /* @__PURE__ */ S(
295
- H,
320
+ children: /* @__PURE__ */ w(
321
+ E,
296
322
  {
297
323
  "aria-label": s,
298
324
  className: "text-muted-foreground h-auto p-0 text-sm font-medium",
@@ -316,7 +342,7 @@ function De({
316
342
  }
317
343
  );
318
344
  }
319
- De.displayName = "DataTableColumnHeader";
345
+ ye.displayName = "DataTableColumnHeader";
320
346
  function ze({
321
347
  table: e,
322
348
  ariaLabel: n,
@@ -327,8 +353,8 @@ function ze({
327
353
  const o = e.getState().globalFilter ?? "", r = (d) => {
328
354
  e.setGlobalFilter(d);
329
355
  };
330
- return /* @__PURE__ */ S(he, { "data-slot": "data-table-search", ...i, children: [
331
- /* @__PURE__ */ a(M, { className: "pl-3", children: /* @__PURE__ */ a(me, {}) }),
356
+ return /* @__PURE__ */ w(pe, { "data-slot": "data-table-search", ...i, children: [
357
+ /* @__PURE__ */ a(V, { className: "pl-3", children: /* @__PURE__ */ a(me, {}) }),
332
358
  /* @__PURE__ */ a(
333
359
  fe,
334
360
  {
@@ -339,8 +365,8 @@ function ze({
339
365
  onChange: (d) => r(d.target.value)
340
366
  }
341
367
  ),
342
- o && /* @__PURE__ */ a(M, { className: "pr-1", children: /* @__PURE__ */ a(
343
- H,
368
+ o && /* @__PURE__ */ a(V, { className: "pr-1", children: /* @__PURE__ */ a(
369
+ E,
344
370
  {
345
371
  "aria-label": t ?? "Clear search",
346
372
  className: "h-auto p-1",
@@ -348,7 +374,7 @@ function ze({
348
374
  dataHook: `${i.dataHook}-clear`,
349
375
  variant: "ghost",
350
376
  onClick: () => r(""),
351
- children: /* @__PURE__ */ a(pe, { size: 14 })
377
+ children: /* @__PURE__ */ a(he, { size: 14 })
352
378
  }
353
379
  ) })
354
380
  ] });
@@ -356,10 +382,10 @@ function ze({
356
382
  ze.displayName = "DataTableSearch";
357
383
  function Ie(e) {
358
384
  const { pageIndex: n, pageSize: l } = e.getState().pagination, t = e.getRowCount(), i = e.getPageCount(), o = e.getCanPreviousPage(), r = e.getCanNextPage(), d = n + 1, c = t === 0 ? 0 : n * l + 1, s = Math.min(d * l, t), u = m.useCallback(
359
- (w) => e.setPageIndex(w - 1),
385
+ (b) => e.setPageIndex(b - 1),
360
386
  [e]
361
- ), p = m.useCallback(() => e.nextPage(), [e]), g = m.useCallback(() => e.previousPage(), [e]), f = m.useCallback(
362
- (w) => e.setPageSize(w),
387
+ ), h = m.useCallback(() => e.nextPage(), [e]), g = m.useCallback(() => e.previousPage(), [e]), f = m.useCallback(
388
+ (b) => e.setPageSize(b),
363
389
  [e]
364
390
  );
365
391
  return m.useMemo(
@@ -374,7 +400,7 @@ function Ie(e) {
374
400
  canPrev: o,
375
401
  canNext: r,
376
402
  goToPage: u,
377
- nextPage: p,
403
+ nextPage: h,
378
404
  previousPage: g,
379
405
  setPageSize: f
380
406
  }),
@@ -389,15 +415,15 @@ function Ie(e) {
389
415
  o,
390
416
  r,
391
417
  u,
392
- p,
418
+ h,
393
419
  g,
394
420
  f
395
421
  ]
396
422
  );
397
423
  }
398
- const F = m.createContext(null);
399
- function U() {
400
- const e = m.useContext(F);
424
+ const H = m.createContext(null);
425
+ function X() {
426
+ const e = m.useContext(H);
401
427
  if (!e)
402
428
  throw new Error(
403
429
  "DataTablePagination sub-components must be used within <DataTablePagination>"
@@ -408,47 +434,45 @@ function $e({
408
434
  renderText: e,
409
435
  className: n
410
436
  }) {
411
- const { info: l } = U(), { startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: d } = l, c = e ? e({ startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: d }) : o === 0 ? null : `${t}-${i} of ${o}`;
437
+ const { info: l } = X(), { startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: d } = l, c = e ? e({ startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: d }) : o === 0 ? null : `${t}-${i} of ${o}`;
412
438
  return c == null ? null : /* @__PURE__ */ a(
413
439
  "span",
414
440
  {
415
- className: h("text-muted-foreground text-sm", n),
441
+ className: p("text-muted-foreground text-sm", n),
416
442
  "data-slot": "data-table-pagination-row-count",
417
443
  children: c
418
444
  }
419
445
  );
420
446
  }
421
447
  $e.displayName = "DataTablePaginationRowCount";
422
- function _({
448
+ function q({
423
449
  ariaLabel: e = "Table pagination",
424
450
  dataHook: n,
425
451
  className: l
426
452
  }) {
427
- const { info: t } = U(), i = be({
453
+ const { info: t } = X(), i = be({
428
454
  page: t.currentPage,
429
- totalPages: t.totalPages,
430
- siblingCount: 1,
431
- boundaryCount: 1
455
+ totalPages: t.totalPages
432
456
  });
433
457
  return /* @__PURE__ */ a(
434
458
  Se,
435
459
  {
436
460
  ariaLabel: e,
437
- className: h("mx-0 w-auto justify-end", l),
461
+ className: p("mx-0 w-auto justify-end", l),
438
462
  dataHook: n ?? "pagination-nav",
439
- children: /* @__PURE__ */ a(we, { children: i.map((o, r) => o === "previous" ? /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(
463
+ children: /* @__PURE__ */ a(we, { children: i.map((o, r) => o === "previous" ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(
440
464
  Ce,
441
465
  {
442
466
  disabled: !t.canPrev,
443
467
  onClick: () => t.previousPage()
444
468
  }
445
- ) }, "previous") : o === "next" ? /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(
469
+ ) }, "previous") : o === "next" ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(
446
470
  xe,
447
471
  {
448
472
  disabled: !t.canNext,
449
473
  onClick: () => t.nextPage()
450
474
  }
451
- ) }, "next") : o === "ellipsis" ? /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(Pe, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(
475
+ ) }, "next") : o === "ellipsis" ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(Pe, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(
452
476
  ve,
453
477
  {
454
478
  isActive: o === t.currentPage,
@@ -459,7 +483,7 @@ function _({
459
483
  }
460
484
  );
461
485
  }
462
- _.displayName = "DataTablePaginationNav";
486
+ q.displayName = "DataTablePaginationNav";
463
487
  function Fe({
464
488
  table: e,
465
489
  dataHook: n,
@@ -474,18 +498,18 @@ function Fe({
474
498
  const s = Ie(e), u = m.useMemo(
475
499
  () => ({ info: s }),
476
500
  [s]
477
- ), p = {
501
+ ), h = {
478
502
  "data-hook": n,
479
503
  "data-slot": "data-table-pagination",
480
504
  "data-tracking-el": i,
481
505
  "data-tracking-label": o
482
506
  };
483
507
  if (c)
484
- return /* @__PURE__ */ a(F.Provider, { value: u, children: /* @__PURE__ */ a(
508
+ return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ a(
485
509
  "div",
486
510
  {
487
- className: h("flex w-full items-center gap-4", r),
488
- ...p,
511
+ className: p("flex w-full items-center gap-4", r),
512
+ ...h,
489
513
  children: c
490
514
  }
491
515
  ) });
@@ -496,19 +520,19 @@ function Fe({
496
520
  pageIndex: s.pageIndex,
497
521
  pageSize: s.pageSize
498
522
  }) : s.totalRows === 0 ? null : `${s.startRow}-${s.endRow} of ${s.totalRows}`;
499
- return /* @__PURE__ */ a(F.Provider, { value: u, children: /* @__PURE__ */ S(
523
+ return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ w(
500
524
  "div",
501
525
  {
502
- className: h(
526
+ className: p(
503
527
  "flex w-full items-center gap-4",
504
528
  g != null ? "justify-between" : "justify-end",
505
529
  r
506
530
  ),
507
- ...p,
531
+ ...h,
508
532
  children: [
509
533
  g != null && /* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children: g }),
510
534
  /* @__PURE__ */ a(
511
- _,
535
+ q,
512
536
  {
513
537
  ariaLabel: d,
514
538
  dataHook: `${n}-nav`
@@ -527,7 +551,7 @@ function Me({
527
551
  selectAllAriaLabel: i
528
552
  }) {
529
553
  return /* @__PURE__ */ a(
530
- V,
554
+ G,
531
555
  {
532
556
  "aria-label": i ?? "Select all",
533
557
  checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
@@ -547,7 +571,7 @@ function Ae({
547
571
  selectRowAriaLabel: i
548
572
  }) {
549
573
  return /* @__PURE__ */ a(
550
- V,
574
+ G,
551
575
  {
552
576
  "aria-label": i ?? "Select row",
553
577
  checked: e.getIsSelected(),
@@ -568,7 +592,7 @@ function He({
568
592
  return /* @__PURE__ */ a(
569
593
  "div",
570
594
  {
571
- className: h(
595
+ className: p(
572
596
  "flex flex-col gap-3 py-4 sm:flex-row sm:items-center",
573
597
  n
574
598
  ),
@@ -586,7 +610,7 @@ function Ve({
586
610
  return /* @__PURE__ */ a(
587
611
  "div",
588
612
  {
589
- className: h(
613
+ className: p(
590
614
  "flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-1",
591
615
  e
592
616
  ),
@@ -603,7 +627,7 @@ function je({
603
627
  return /* @__PURE__ */ a(
604
628
  "div",
605
629
  {
606
- className: h(
630
+ className: p(
607
631
  "flex w-full items-center justify-end gap-2 sm:w-auto",
608
632
  e
609
633
  ),
@@ -614,10 +638,10 @@ function je({
614
638
  }
615
639
  je.displayName = "DataTableToolbarRight";
616
640
  export {
617
- ye as DataTable,
618
- De as DataTableColumnHeader,
641
+ De as DataTable,
642
+ ye as DataTableColumnHeader,
619
643
  Fe as DataTablePagination,
620
- _ as DataTablePaginationNav,
644
+ q as DataTablePaginationNav,
621
645
  $e as DataTablePaginationRowCount,
622
646
  ze as DataTableSearch,
623
647
  Me as DataTableSelectAllCheckbox,
@@ -626,5 +650,5 @@ export {
626
650
  Ve as DataTableToolbarLeft,
627
651
  je as DataTableToolbarRight,
628
652
  Ne as VirtualizedDataTable,
629
- Qe as useDataTable
653
+ Oe as useDataTable
630
654
  };