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