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