@brightlocal/ui-components 2.21.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.
@@ -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,
42
+ getSubRows: b,
43
+ getRowId: C,
44
+ pagination: x,
45
+ onPaginationChange: F,
46
+ sorting: D,
47
+ onSortingChange: R,
48
48
  globalFilter: N,
49
- onGlobalFilterChange: y,
50
- rowSelection: $,
51
- onRowSelectionChange: D,
52
- expanded: X,
53
- onExpandedChange: q
54
- } = e, [J, K] = R(
55
- v,
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(
61
+ R
62
+ ), [Q, Y] = T(
63
63
  N,
64
64
  "",
65
- y
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 Ne({
122
+ function De({
123
123
  table: e,
124
124
  dataHook: n,
125
125
  trackingEl: l,
@@ -129,52 +129,66 @@ function Ne({
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
- Ne.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,16 +199,16 @@ 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
- function ye({
211
+ function Ne({
198
212
  table: e,
199
213
  dataHook: n,
200
214
  trackingEl: l,
@@ -204,54 +218,66 @@ function ye({
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(), N = b.length > 0 ? b[0].start : 0, y = 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
- N > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: f, style: { height: N } }) }),
242
- b.map(($) => {
243
- const D = v[$.index];
244
- return /* @__PURE__ */ a(L, { row: D }, D.id);
245
- }),
246
- y > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: f, style: { height: y } }) })
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
- ye.displayName = "VirtualizedDataTable";
254
- function De({
279
+ Ne.displayName = "VirtualizedDataTable";
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,23 +434,23 @@ 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
455
  totalPages: t.totalPages
430
456
  });
@@ -432,21 +458,21 @@ function _({
432
458
  Se,
433
459
  {
434
460
  ariaLabel: e,
435
- className: h("mx-0 w-auto justify-end", l),
461
+ className: p("mx-0 w-auto justify-end", l),
436
462
  dataHook: n ?? "pagination-nav",
437
- 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(
438
464
  Ce,
439
465
  {
440
466
  disabled: !t.canPrev,
441
467
  onClick: () => t.previousPage()
442
468
  }
443
- ) }, "previous") : o === "next" ? /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(
469
+ ) }, "previous") : o === "next" ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(
444
470
  xe,
445
471
  {
446
472
  disabled: !t.canNext,
447
473
  onClick: () => t.nextPage()
448
474
  }
449
- ) }, "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(
450
476
  ve,
451
477
  {
452
478
  isActive: o === t.currentPage,
@@ -457,7 +483,7 @@ function _({
457
483
  }
458
484
  );
459
485
  }
460
- _.displayName = "DataTablePaginationNav";
486
+ q.displayName = "DataTablePaginationNav";
461
487
  function Fe({
462
488
  table: e,
463
489
  dataHook: n,
@@ -472,18 +498,18 @@ function Fe({
472
498
  const s = Ie(e), u = m.useMemo(
473
499
  () => ({ info: s }),
474
500
  [s]
475
- ), p = {
501
+ ), h = {
476
502
  "data-hook": n,
477
503
  "data-slot": "data-table-pagination",
478
504
  "data-tracking-el": i,
479
505
  "data-tracking-label": o
480
506
  };
481
507
  if (c)
482
- return /* @__PURE__ */ a(F.Provider, { value: u, children: /* @__PURE__ */ a(
508
+ return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ a(
483
509
  "div",
484
510
  {
485
- className: h("flex w-full items-center gap-4", r),
486
- ...p,
511
+ className: p("flex w-full items-center gap-4", r),
512
+ ...h,
487
513
  children: c
488
514
  }
489
515
  ) });
@@ -494,19 +520,19 @@ function Fe({
494
520
  pageIndex: s.pageIndex,
495
521
  pageSize: s.pageSize
496
522
  }) : s.totalRows === 0 ? null : `${s.startRow}-${s.endRow} of ${s.totalRows}`;
497
- return /* @__PURE__ */ a(F.Provider, { value: u, children: /* @__PURE__ */ S(
523
+ return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ w(
498
524
  "div",
499
525
  {
500
- className: h(
526
+ className: p(
501
527
  "flex w-full items-center gap-4",
502
528
  g != null ? "justify-between" : "justify-end",
503
529
  r
504
530
  ),
505
- ...p,
531
+ ...h,
506
532
  children: [
507
533
  g != null && /* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children: g }),
508
534
  /* @__PURE__ */ a(
509
- _,
535
+ q,
510
536
  {
511
537
  ariaLabel: d,
512
538
  dataHook: `${n}-nav`
@@ -525,7 +551,7 @@ function Me({
525
551
  selectAllAriaLabel: i
526
552
  }) {
527
553
  return /* @__PURE__ */ a(
528
- V,
554
+ G,
529
555
  {
530
556
  "aria-label": i ?? "Select all",
531
557
  checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
@@ -545,7 +571,7 @@ function Ae({
545
571
  selectRowAriaLabel: i
546
572
  }) {
547
573
  return /* @__PURE__ */ a(
548
- V,
574
+ G,
549
575
  {
550
576
  "aria-label": i ?? "Select row",
551
577
  checked: e.getIsSelected(),
@@ -566,7 +592,7 @@ function He({
566
592
  return /* @__PURE__ */ a(
567
593
  "div",
568
594
  {
569
- className: h(
595
+ className: p(
570
596
  "flex flex-col gap-3 py-4 sm:flex-row sm:items-center",
571
597
  n
572
598
  ),
@@ -584,7 +610,7 @@ function Ve({
584
610
  return /* @__PURE__ */ a(
585
611
  "div",
586
612
  {
587
- className: h(
613
+ className: p(
588
614
  "flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-1",
589
615
  e
590
616
  ),
@@ -601,7 +627,7 @@ function je({
601
627
  return /* @__PURE__ */ a(
602
628
  "div",
603
629
  {
604
- className: h(
630
+ className: p(
605
631
  "flex w-full items-center justify-end gap-2 sm:w-auto",
606
632
  e
607
633
  ),
@@ -612,10 +638,10 @@ function je({
612
638
  }
613
639
  je.displayName = "DataTableToolbarRight";
614
640
  export {
615
- Ne as DataTable,
616
- De as DataTableColumnHeader,
641
+ De as DataTable,
642
+ ye as DataTableColumnHeader,
617
643
  Fe as DataTablePagination,
618
- _ as DataTablePaginationNav,
644
+ q as DataTablePaginationNav,
619
645
  $e as DataTablePaginationRowCount,
620
646
  ze as DataTableSearch,
621
647
  Me as DataTableSelectAllCheckbox,
@@ -623,6 +649,6 @@ export {
623
649
  He as DataTableToolbar,
624
650
  Ve as DataTableToolbarLeft,
625
651
  je as DataTableToolbarRight,
626
- ye as VirtualizedDataTable,
627
- Qe as useDataTable
652
+ Ne as VirtualizedDataTable,
653
+ Oe as useDataTable
628
654
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),b=require("@radix-ui/react-hover-card"),c=require("@brightlocal/ui-components/lib/utils");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const u=l(v),n=l(b);function m({openDelay:e=300,closeDelay:t=300,...a}){return o.jsx(n.Root,{closeDelay:t,openDelay:e,...a})}m.displayName="HoverCard";const g=u.forwardRef(({className:e,disabled:t,dataHook:a,trackingEl:r,trackingLabel:d,...i},s)=>o.jsx(n.Trigger,{ref:s,"aria-disabled":t,className:c.cn("text-link cursor-pointer text-sm leading-5 font-medium underline",t&&"pointer-events-none cursor-not-allowed opacity-50",e),"data-hook":a,"data-slot":"hover-card-trigger","data-tracking-el":r,"data-tracking-label":d,...i}));g.displayName="HoverCardTrigger";const f=u.forwardRef(({className:e,align:t="center",sideOffset:a=4,dataHook:r,trackingEl:d,trackingLabel:i,...s},p)=>o.jsx(n.Portal,{children:o.jsx(n.Content,{ref:p,align:t,className:c.cn("border-border bg-popover text-popover-foreground z-50 w-80 rounded-lg border p-4 shadow-md outline-hidden","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),"data-hook":r,"data-slot":"hover-card-content","data-tracking-el":d,"data-tracking-label":i,sideOffset:a,...s})}));f.displayName="HoverCardContent";exports.HoverCard=m;exports.HoverCardContent=f;exports.HoverCardTrigger=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("react"),C=require("@radix-ui/react-hover-card"),s=require("@brightlocal/ui-components/lib/utils");function l(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const u=l(f),n=l(C);function g({openDelay:e=300,closeDelay:r=300,...t}){return a.jsx(n.Root,{closeDelay:r,openDelay:e,...t})}g.displayName="HoverCard";const m=u.forwardRef(({className:e,disabled:r,dataHook:t,trackingEl:o,trackingLabel:d,...i},c)=>a.jsx(n.Trigger,{ref:c,"aria-disabled":r,className:s.cn("text-link cursor-pointer text-sm leading-5 font-medium underline",r&&"pointer-events-none cursor-not-allowed opacity-50",e),"data-hook":t,"data-slot":"hover-card-trigger","data-tracking-el":o,"data-tracking-label":d,...i}));m.displayName="HoverCardTrigger";const v=u.forwardRef(({className:e,align:r="center",sideOffset:t=4,dataHook:o,trackingEl:d,trackingLabel:i,...c},p)=>a.jsx(n.Portal,{children:a.jsx(n.Content,{ref:p,align:r,className:s.cn("border-border bg-popover text-popover-foreground z-50 w-max max-w-sm rounded-lg border p-4 shadow-md outline-hidden",s.FLOATING_CONTENT_ANIMATION,e),"data-hook":o,"data-slot":"hover-card-content","data-tracking-el":d,"data-tracking-label":i,sideOffset:t,...c})}));v.displayName="HoverCardContent";exports.HoverCard=g;exports.HoverCardContent=v;exports.HoverCardTrigger=m;
@@ -1 +1 @@
1
- {"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAGjE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAC1D,OAAO,kBAAkB,CAAC,IAAI,CAC/B;IACC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAe,EACf,UAAgB,EAChB,GAAG,KAAK,EACT,EAAE,cAAc,2CAUhB;kBAdQ,SAAS;;;AAkBlB,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CACjE,OAAO,kBAAkB,CAAC,OAAO,CAClC;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,gBAAgB,8GAuBrB,CAAC;AAIF,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,wBAAwB,CAC3E,OAAO,kBAAkB,CAAC,OAAO,CAClC;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,gBAAgB,8FAkCrB,CAAC;AAGF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAMjE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAC1D,OAAO,kBAAkB,CAAC,IAAI,CAC/B;IACC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAe,EACf,UAAgB,EAChB,GAAG,KAAK,EACT,EAAE,cAAc,2CAUhB;kBAdQ,SAAS;;;AAkBlB,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CACjE,OAAO,kBAAkB,CAAC,OAAO,CAClC;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,gBAAgB,8GAuBrB,CAAC;AAIF,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,wBAAwB,CAC3E,OAAO,kBAAkB,CAAC,OAAO,CAClC;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,gBAAgB,8FAkCrB,CAAC;AAGF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}