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