@devalok/shilp-sutra 0.31.0 → 0.32.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 (233) hide show
  1. package/dist/_chunks/badge-group.js +123 -172
  2. package/dist/_chunks/document-preview.js +92 -0
  3. package/dist/_chunks/file-preview.js +511 -0
  4. package/dist/_chunks/image-preview.js +90 -0
  5. package/dist/_chunks/primitives.js +109 -109
  6. package/dist/_chunks/stat-row.js +144 -124
  7. package/dist/_chunks/use-calendar.js +558 -490
  8. package/dist/ai/block-renderer.d.ts +2 -1
  9. package/dist/ai/block-renderer.d.ts.map +1 -1
  10. package/dist/ai/block-renderer.js +30 -29
  11. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  12. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  13. package/dist/ai/blocks/divider.d.ts.map +1 -1
  14. package/dist/ai/blocks/error.d.ts.map +1 -1
  15. package/dist/ai/blocks/info.d.ts.map +1 -1
  16. package/dist/ai/blocks/loading.d.ts.map +1 -1
  17. package/dist/ai/blocks/stat-row.d.ts.map +1 -1
  18. package/dist/ai/blocks/success.d.ts.map +1 -1
  19. package/dist/ai/blocks/text.d.ts.map +1 -1
  20. package/dist/ai/command-bar.d.ts +18 -0
  21. package/dist/ai/command-bar.d.ts.map +1 -1
  22. package/dist/ai/command-bar.js +126 -125
  23. package/dist/ai/conversation.d.ts +13 -1
  24. package/dist/ai/conversation.d.ts.map +1 -1
  25. package/dist/ai/conversation.js +78 -78
  26. package/dist/ai/types.d.ts +0 -1
  27. package/dist/ai/types.d.ts.map +1 -1
  28. package/dist/ai/types.js +0 -1
  29. package/dist/composed/bulk-action-bar.d.ts +6 -4
  30. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  31. package/dist/composed/bulk-action-bar.js +102 -58
  32. package/dist/composed/command-palette.d.ts +9 -0
  33. package/dist/composed/command-palette.d.ts.map +1 -1
  34. package/dist/composed/command-palette.js +68 -68
  35. package/dist/composed/confirm-dialog.d.ts +1 -1
  36. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  37. package/dist/composed/confirm-dialog.js +10 -10
  38. package/dist/composed/date-picker/date-picker.d.ts +11 -1
  39. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  40. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  41. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  42. package/dist/composed/deadline-indicator.d.ts +1 -1
  43. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  44. package/dist/composed/deadline-indicator.js +39 -36
  45. package/dist/composed/emoji-picker.d.ts +6 -0
  46. package/dist/composed/emoji-picker.d.ts.map +1 -1
  47. package/dist/composed/emoji-picker.js +22 -20
  48. package/dist/composed/error-boundary.d.ts +21 -1
  49. package/dist/composed/error-boundary.d.ts.map +1 -1
  50. package/dist/composed/error-boundary.js +47 -32
  51. package/dist/composed/file-preview/audio-preview.d.ts +7 -0
  52. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
  53. package/dist/composed/file-preview/document-preview.d.ts +7 -0
  54. package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
  55. package/dist/composed/file-preview/embed-preview.d.ts +7 -0
  56. package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
  57. package/dist/composed/file-preview/image-preview.d.ts +7 -0
  58. package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
  59. package/dist/composed/file-preview/shared.d.ts +20 -0
  60. package/dist/composed/file-preview/shared.d.ts.map +1 -0
  61. package/dist/composed/file-preview/video-preview.d.ts +6 -0
  62. package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
  63. package/dist/composed/file-preview.d.ts.map +1 -1
  64. package/dist/composed/file-preview.js +10 -662
  65. package/dist/composed/filter-bar.d.ts +10 -2
  66. package/dist/composed/filter-bar.d.ts.map +1 -1
  67. package/dist/composed/filter-bar.js +42 -43
  68. package/dist/composed/form-section.d.ts +1 -1
  69. package/dist/composed/form-section.d.ts.map +1 -1
  70. package/dist/composed/form-section.js +22 -21
  71. package/dist/composed/index.d.ts +2 -2
  72. package/dist/composed/index.d.ts.map +1 -1
  73. package/dist/composed/index.js +58 -57
  74. package/dist/composed/inline-edit.d.ts +1 -1
  75. package/dist/composed/inline-edit.d.ts.map +1 -1
  76. package/dist/composed/inline-edit.js +33 -32
  77. package/dist/composed/markdown-viewer.d.ts +1 -1
  78. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  79. package/dist/composed/markdown-viewer.js +60 -59
  80. package/dist/composed/master-detail.d.ts +11 -7
  81. package/dist/composed/master-detail.d.ts.map +1 -1
  82. package/dist/composed/master-detail.js +123 -84
  83. package/dist/composed/responsive-overlay.d.ts +8 -0
  84. package/dist/composed/responsive-overlay.d.ts.map +1 -1
  85. package/dist/composed/rich-text-editor.d.ts +11 -3
  86. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  87. package/dist/composed/rich-text-editor.js +21 -20
  88. package/dist/composed/schedule-view.d.ts +9 -1
  89. package/dist/composed/schedule-view.d.ts.map +1 -1
  90. package/dist/hooks/index.d.ts +2 -0
  91. package/dist/hooks/index.d.ts.map +1 -1
  92. package/dist/hooks/index.js +8 -4
  93. package/dist/hooks/use-touch-device.d.ts +12 -0
  94. package/dist/hooks/use-touch-device.d.ts.map +1 -0
  95. package/dist/hooks/use-touch-device.js +13 -0
  96. package/dist/hooks/use-viewport-height.d.ts +11 -0
  97. package/dist/hooks/use-viewport-height.d.ts.map +1 -0
  98. package/dist/hooks/use-viewport-height.js +16 -0
  99. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  100. package/dist/shell/bottom-navbar.js +72 -63
  101. package/dist/shell/command-registry.d.ts.map +1 -1
  102. package/dist/shell/notification-center.d.ts.map +1 -1
  103. package/dist/shell/notification-center.js +77 -77
  104. package/dist/shell/top-bar.d.ts +2 -2
  105. package/dist/shell/top-bar.d.ts.map +1 -1
  106. package/dist/shell/top-bar.js +61 -60
  107. package/dist/tailwind/index.cjs +51 -7
  108. package/dist/tailwind/preset.d.ts.map +1 -1
  109. package/dist/tailwind/preset.js +51 -7
  110. package/dist/tokens/primitives.css +3 -1
  111. package/dist/tokens/semantic.css +16 -13
  112. package/dist/ui/autocomplete.d.ts.map +1 -1
  113. package/dist/ui/autocomplete.js +38 -39
  114. package/dist/ui/badge.d.ts +104 -2
  115. package/dist/ui/badge.d.ts.map +1 -1
  116. package/dist/ui/banner.d.ts.map +1 -1
  117. package/dist/ui/banner.js +8 -7
  118. package/dist/ui/button.d.ts +2 -2
  119. package/dist/ui/button.d.ts.map +1 -1
  120. package/dist/ui/button.js +54 -74
  121. package/dist/ui/card.js +24 -24
  122. package/dist/ui/charts/area-chart.d.ts +2 -0
  123. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  124. package/dist/ui/charts/bar-chart.d.ts +2 -0
  125. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  126. package/dist/ui/charts/chart-container.d.ts +2 -0
  127. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  128. package/dist/ui/charts/index.js +583 -577
  129. package/dist/ui/charts/line-chart.d.ts +2 -0
  130. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  131. package/dist/ui/charts/pie-chart.d.ts +2 -0
  132. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  133. package/dist/ui/charts/radar-chart.d.ts +2 -0
  134. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  135. package/dist/ui/checkbox.d.ts +2 -0
  136. package/dist/ui/checkbox.d.ts.map +1 -1
  137. package/dist/ui/checkbox.js +36 -27
  138. package/dist/ui/color-input.js +5 -5
  139. package/dist/ui/combobox.d.ts +6 -1
  140. package/dist/ui/combobox.d.ts.map +1 -1
  141. package/dist/ui/combobox.js +1 -1
  142. package/dist/ui/context-menu.js +1 -1
  143. package/dist/ui/data-table-body.d.ts +12 -0
  144. package/dist/ui/data-table-body.d.ts.map +1 -0
  145. package/dist/ui/data-table-body.js +219 -0
  146. package/dist/ui/data-table-bulk-actions.d.ts +19 -0
  147. package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
  148. package/dist/ui/data-table-bulk-actions.js +61 -0
  149. package/dist/ui/data-table-card.d.ts +9 -0
  150. package/dist/ui/data-table-card.d.ts.map +1 -0
  151. package/dist/ui/data-table-card.js +73 -0
  152. package/dist/ui/data-table-context.d.ts +62 -0
  153. package/dist/ui/data-table-context.d.ts.map +1 -0
  154. package/dist/ui/data-table-context.js +48 -0
  155. package/dist/ui/data-table-header.d.ts +10 -0
  156. package/dist/ui/data-table-header.d.ts.map +1 -0
  157. package/dist/ui/data-table-header.js +141 -0
  158. package/dist/ui/data-table-pagination.d.ts +13 -0
  159. package/dist/ui/data-table-pagination.d.ts.map +1 -0
  160. package/dist/ui/data-table-pagination.js +84 -0
  161. package/dist/ui/data-table.d.ts +11 -9
  162. package/dist/ui/data-table.d.ts.map +1 -1
  163. package/dist/ui/data-table.js +258 -573
  164. package/dist/ui/dialog.d.ts +6 -2
  165. package/dist/ui/dialog.d.ts.map +1 -1
  166. package/dist/ui/dialog.js +84 -82
  167. package/dist/ui/dropdown-menu.js +1 -1
  168. package/dist/ui/hover-card.d.ts +7 -0
  169. package/dist/ui/hover-card.d.ts.map +1 -1
  170. package/dist/ui/hover-card.js +3 -3
  171. package/dist/ui/icon-group.d.ts +2 -4
  172. package/dist/ui/icon-group.d.ts.map +1 -1
  173. package/dist/ui/icon-group.js +22 -23
  174. package/dist/ui/index.d.ts +1 -2
  175. package/dist/ui/index.d.ts.map +1 -1
  176. package/dist/ui/index.js +94 -99
  177. package/dist/ui/label.js +1 -1
  178. package/dist/ui/lib/bottom-sheet.d.ts +16 -0
  179. package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
  180. package/dist/ui/menubar.d.ts.map +1 -1
  181. package/dist/ui/menubar.js +64 -73
  182. package/dist/ui/navigation-menu.d.ts.map +1 -1
  183. package/dist/ui/navigation-menu.js +40 -44
  184. package/dist/ui/number-input.d.ts.map +1 -1
  185. package/dist/ui/number-input.js +19 -17
  186. package/dist/ui/popover.d.ts.map +1 -1
  187. package/dist/ui/popover.js +107 -32
  188. package/dist/ui/progress-ring.d.ts.map +1 -1
  189. package/dist/ui/progress-ring.js +80 -80
  190. package/dist/ui/progress.js +4 -4
  191. package/dist/ui/radio.d.ts +5 -2
  192. package/dist/ui/radio.d.ts.map +1 -1
  193. package/dist/ui/radio.js +29 -20
  194. package/dist/ui/search-input.d.ts.map +1 -1
  195. package/dist/ui/search-input.js +13 -12
  196. package/dist/ui/segmented-control.d.ts +6 -108
  197. package/dist/ui/segmented-control.d.ts.map +1 -1
  198. package/dist/ui/segmented-control.js +86 -272
  199. package/dist/ui/select.js +5 -5
  200. package/dist/ui/separator.js +5 -5
  201. package/dist/ui/sheet.d.ts +2 -0
  202. package/dist/ui/sheet.d.ts.map +1 -1
  203. package/dist/ui/sheet.js +102 -84
  204. package/dist/ui/sidebar.d.ts.map +1 -1
  205. package/dist/ui/sidebar.js +200 -175
  206. package/dist/ui/slider.js +14 -14
  207. package/dist/ui/status-dot.js +8 -8
  208. package/dist/ui/stepper.d.ts.map +1 -1
  209. package/dist/ui/stepper.js +33 -31
  210. package/dist/ui/switch.js +3 -3
  211. package/dist/ui/tabs.js +6 -6
  212. package/dist/ui/toast-types.d.ts +0 -1
  213. package/dist/ui/toast-types.d.ts.map +1 -1
  214. package/dist/ui/toast-types.js +0 -1
  215. package/dist/ui/toast.d.ts.map +1 -1
  216. package/dist/ui/toast.js +156 -150
  217. package/dist/ui/toggle-group.js +1 -1
  218. package/dist/ui/toggle.js +1 -1
  219. package/dist/ui/tooltip.js +3 -3
  220. package/docs/components/ui/data-table-body.md +13 -0
  221. package/docs/components/ui/data-table-bulk-actions.md +13 -0
  222. package/docs/components/ui/data-table-card.md +13 -0
  223. package/docs/components/ui/data-table-context.md +13 -0
  224. package/docs/components/ui/data-table-header.md +13 -0
  225. package/docs/components/ui/data-table-pagination.md +13 -0
  226. package/llms-full.txt +79 -48
  227. package/llms.txt +32 -0
  228. package/package.json +1 -6
  229. package/dist/ui/chip.d.ts +0 -19
  230. package/dist/ui/chip.d.ts.map +0 -1
  231. package/dist/ui/chip.js +0 -14
  232. package/dist/ui/lib/use-ripple.d.ts +0 -14
  233. package/dist/ui/lib/use-ripple.d.ts.map +0 -1
@@ -1,164 +1,129 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as n } from "react/jsx-runtime";
3
- import st, { useState as u, useRef as D, useEffect as E, useCallback as M, useMemo as lt } from "react";
4
- import { useReactTable as at, getExpandedRowModel as ot, getPaginationRowModel as rt, getFilteredRowModel as it, getSortedRowModel as ct, getCoreRowModel as dt, flexRender as Z } from "@tanstack/react-table";
5
- import { useVirtualizer as ut } from "@tanstack/react-virtual";
6
- import { IconArrowUp as ft, IconArrowDown as mt, IconArrowsSort as gt, IconSearch as pt, IconChevronLeft as ht, IconChevronRight as Se, IconX as bt } from "@tabler/icons-react";
7
- import { Icon as h } from "./icon.js";
8
- import { Table as xt, TableHeader as yt, TableRow as z, TableHead as Ne, TableBody as P, TableCell as _ } from "./table.js";
9
- import { Button as Ct } from "./button.js";
10
- import { Checkbox as we } from "./checkbox.js";
11
- import { Skeleton as Re } from "./skeleton.js";
12
- import { cn as a } from "./lib/utils.js";
13
- import { springs as ee } from "./lib/motion.js";
14
- import { DataTableToolbar as St } from "./data-table-toolbar.js";
15
- import { A as Nt, m as te } from "../_chunks/framer.js";
16
- function ke(f) {
17
- if (!f) return "";
18
- const o = [];
19
- return f.align === "right" && o.push("text-right tabular-nums"), f.align === "center" && o.push("text-center"), f.hideBelow === "sm" && o.push("hidden sm:table-cell"), f.hideBelow === "md" && o.push("hidden md:table-cell"), f.hideBelow === "lg" && o.push("hidden lg:table-cell"), o.join(" ");
20
- }
21
- const wt = {
22
- compact: "py-ds-02",
23
- standard: "py-ds-05",
24
- comfortable: "py-ds-07"
25
- };
26
- function Rt({
27
- initialValue: f,
28
- onSave: o,
29
- onCancel: B
2
+ import { jsx as l, jsxs as G } from "react/jsx-runtime";
3
+ import { useState as a, useEffect as m, useRef as b, useCallback as K, useMemo as ue } from "react";
4
+ import { useReactTable as Je, getExpandedRowModel as Qe, getPaginationRowModel as Ue, getFilteredRowModel as We, getSortedRowModel as Xe, getCoreRowModel as Ze } from "@tanstack/react-table";
5
+ import { useVirtualizer as ve } from "@tanstack/react-virtual";
6
+ import { IconSearch as et, IconChevronRight as tt } from "@tabler/icons-react";
7
+ import { Icon as me } from "./icon.js";
8
+ import { Table as nt } from "./table.js";
9
+ import { Checkbox as he } from "./checkbox.js";
10
+ import { cn as L } from "./lib/utils.js";
11
+ import { DataTableToolbar as ot } from "./data-table-toolbar.js";
12
+ import { densityPaddingMap as lt, DataTableProvider as at } from "./data-table-context.js";
13
+ import { DataTableHeader as st } from "./data-table-header.js";
14
+ import { DataTableBody as ct } from "./data-table-body.js";
15
+ import { DataTableCards as it } from "./data-table-card.js";
16
+ import { DataTablePagination as rt } from "./data-table-pagination.js";
17
+ import { DataTableBulkActions as dt } from "./data-table-bulk-actions.js";
18
+ function gt({
19
+ columns: Ce,
20
+ data: i,
21
+ className: pe,
22
+ noResultsText: q,
23
+ sortable: h = !1,
24
+ filterable: w = !1,
25
+ globalFilter: y = !1,
26
+ paginated: Se = !1,
27
+ pageSize: P,
28
+ pageSizeOptions: xe,
29
+ selectable: s = !1,
30
+ onSelectionChange: z,
31
+ toolbar: Y = !1,
32
+ density: be = "standard",
33
+ columnPinning: $,
34
+ editable: A = !1,
35
+ onCellEdit: J,
36
+ expandable: C = !1,
37
+ renderExpanded: Q,
38
+ virtualRows: f = !1,
39
+ virtualRowHeight: we = 48,
40
+ maxHeight: ye = 600,
41
+ onSort: p,
42
+ emptyState: U,
43
+ loading: W = !1,
44
+ selectedIds: M,
45
+ selectableFilter: X,
46
+ getRowId: c,
47
+ pagination: o,
48
+ singleExpand: I = !1,
49
+ stickyHeader: Re = !1,
50
+ onRowClick: Z,
51
+ bulkActions: R,
52
+ mobileView: T = "table"
30
53
  }) {
31
- const [I, N] = u(f), b = D(null);
32
- E(() => {
33
- b.current?.focus(), b.current?.select();
54
+ const [ze, v] = a(!1);
55
+ m(() => {
56
+ const e = window.matchMedia("(max-width: 639px)"), t = () => v(e.matches);
57
+ return e.addEventListener("change", t), v(e.matches), () => e.removeEventListener("change", t);
34
58
  }, []);
35
- const x = M(() => {
36
- o(I);
37
- }, [o, I]);
38
- return /* @__PURE__ */ n(
39
- "input",
40
- {
41
- ref: b,
42
- type: "text",
43
- value: I,
44
- onChange: (g) => N(g.target.value),
45
- onBlur: x,
46
- onKeyDown: (g) => {
47
- g.key === "Enter" ? (g.preventDefault(), x()) : g.key === "Escape" && (g.preventDefault(), B());
48
- },
49
- className: a(
50
- "h-ds-xs-plus w-full rounded-ds-md",
51
- "border border-accent-7 bg-surface-raised-hover",
52
- "px-ds-02 text-ds-sm",
53
- "text-surface-fg placeholder:text-surface-fg-subtle",
54
- "outline-none focus:border-accent-7"
55
- ),
56
- "aria-label": "Edit cell value"
57
- }
58
- );
59
- }
60
- const kt = 'button, a, input, select, textarea, [role="checkbox"]';
61
- function zt({
62
- columns: f,
63
- data: o,
64
- className: B,
65
- noResultsText: I,
66
- sortable: N = !1,
67
- filterable: b = !1,
68
- globalFilter: x = !1,
69
- paginated: g = !1,
70
- pageSize: ne,
71
- pageSizeOptions: ze,
72
- selectable: w = !1,
73
- onSelectionChange: H,
74
- toolbar: se = !1,
75
- density: De = "standard",
76
- columnPinning: le,
77
- editable: Ee = !1,
78
- onCellEdit: Ie,
79
- expandable: j = !1,
80
- renderExpanded: ae,
81
- virtualRows: y = !1,
82
- virtualRowHeight: ve = 48,
83
- maxHeight: Fe = 600,
84
- onSort: v,
85
- emptyState: oe,
86
- loading: Te = !1,
87
- selectedIds: A,
88
- selectableFilter: re,
89
- getRowId: p,
90
- pagination: r,
91
- singleExpand: O = !1,
92
- stickyHeader: Me = !1,
93
- onRowClick: F,
94
- bulkActions: V
95
- }) {
96
- const [je, ie] = u([]), [Ve, $e] = u([]), [K, G] = u(""), [Pe, L] = u({
97
- pageIndex: r ? r.page - 1 : 0,
98
- pageSize: r?.pageSize ?? ne ?? 10
99
- }), [C, ce] = u({}), [_e, Be] = u({}), [de, He] = u({
100
- left: le?.left ?? [],
101
- right: le?.right ?? []
102
- }), [ue, Ae] = u(De), [fe, Y] = u(null), [Oe, me] = u({}), ge = D(null), U = D(!1);
103
- E(() => {
104
- if (A) {
105
- U.current = !0;
59
+ const Me = T === "card" && ze, [Ie, ee] = a([]), [Te, De] = a([]), [D, E] = a(""), [Ee, F] = a({
60
+ pageIndex: o ? o.page - 1 : 0,
61
+ pageSize: o?.pageSize ?? P ?? 10
62
+ }), [r, te] = a({}), [Fe, je] = a({}), [j, ke] = a({
63
+ left: $?.left ?? [],
64
+ right: $?.right ?? []
65
+ }), [ne, Ne] = a(be), [oe, Ve] = a(null), [He, le] = a({}), ae = b(null), k = b(!1);
66
+ m(() => {
67
+ if (M) {
68
+ k.current = !0;
106
69
  const e = {};
107
- A.forEach((t) => {
70
+ M.forEach((t) => {
108
71
  e[t] = !0;
109
- }), ce(e);
72
+ }), te(e);
110
73
  }
111
- }, [A]), E(() => {
112
- r && L((e) => ({
74
+ }, [M]), m(() => {
75
+ o && F((e) => ({
113
76
  ...e,
114
- pageIndex: r.page - 1,
115
- pageSize: r.pageSize
77
+ pageIndex: o.page - 1,
78
+ pageSize: o.pageSize
116
79
  }));
117
- }, [r?.page, r?.pageSize]);
118
- const Ke = M(
80
+ }, [o?.page, o?.pageSize]);
81
+ const Be = K(
119
82
  (e) => {
120
- ie((t) => {
121
- const s = typeof e == "function" ? e(t) : e;
122
- return v && (s.length === 0 && t.length > 0 ? v(t[0].id, !1) : s.length > 0 && v(s[0].id, s[0].desc ? "desc" : "asc")), s;
83
+ ee((t) => {
84
+ const n = typeof e == "function" ? e(t) : e;
85
+ return p && (n.length === 0 && t.length > 0 ? p(t[0].id, !1) : n.length > 0 && p(n[0].id, n[0].desc ? "desc" : "asc")), n;
123
86
  });
124
87
  },
125
- [v]
126
- ), Ge = M(
88
+ [p]
89
+ ), Oe = K(
127
90
  (e) => {
128
- me((t) => {
129
- const s = typeof e == "function" ? e(t) : e;
130
- if (!O || s === !0 || typeof s != "object") return s;
131
- const l = typeof t == "object" ? Object.keys(t).filter((m) => t[m]) : [], k = Object.keys(s).filter((m) => s[m]).filter((m) => !l.includes(m));
132
- return k.length > 0 ? { [k[k.length - 1]]: !0 } : s;
91
+ le((t) => {
92
+ const n = typeof e == "function" ? e(t) : e;
93
+ if (!I || n === !0 || typeof n != "object") return n;
94
+ const u = typeof t == "object" ? Object.keys(t).filter((x) => t[x]) : [], _ = Object.keys(n).filter((x) => n[x]).filter((x) => !u.includes(x));
95
+ return _.length > 0 ? { [_[_.length - 1]]: !0 } : n;
133
96
  });
134
97
  },
135
- [O]
136
- ), W = D(r?.onPageChange);
137
- E(() => {
138
- W.current = r?.onPageChange;
139
- }, [r?.onPageChange]);
140
- const Le = M(
98
+ [I]
99
+ ), N = b(o?.onPageChange);
100
+ m(() => {
101
+ N.current = o?.onPageChange;
102
+ }, [o?.onPageChange]);
103
+ const _e = K(
141
104
  (e) => {
142
- L((t) => {
143
- const s = typeof e == "function" ? e(t) : e;
144
- return W.current && s.pageIndex !== t.pageIndex && W.current(s.pageIndex + 1), s;
105
+ F((t) => {
106
+ const n = typeof e == "function" ? e(t) : e;
107
+ return N.current && n.pageIndex !== t.pageIndex && N.current(n.pageIndex + 1), n;
145
108
  });
146
109
  },
147
110
  []
148
- ), Ye = {
111
+ ), Ge = {
149
112
  id: "_select",
150
- header: ({ table: e }) => /* @__PURE__ */ n(
151
- we,
113
+ header: ({ table: e }) => /* @__PURE__ */ l(
114
+ he,
152
115
  {
116
+ size: "sm",
153
117
  checked: e.getIsAllPageRowsSelected(),
154
118
  indeterminate: e.getIsSomePageRowsSelected(),
155
119
  onCheckedChange: (t) => e.toggleAllPageRowsSelected(!!t),
156
120
  "aria-label": "Select all rows"
157
121
  }
158
122
  ),
159
- cell: ({ row: e }) => /* @__PURE__ */ n(
160
- we,
123
+ cell: ({ row: e }) => /* @__PURE__ */ l(
124
+ he,
161
125
  {
126
+ size: "sm",
162
127
  checked: e.getIsSelected(),
163
128
  disabled: !e.getCanSelect(),
164
129
  onCheckedChange: (t) => e.toggleSelected(!!t),
@@ -168,22 +133,22 @@ function zt({
168
133
  enableSorting: !1,
169
134
  enableColumnFilter: !1,
170
135
  enableHiding: !1
171
- }, Ue = {
136
+ }, Ke = {
172
137
  id: "_expand",
173
138
  header: () => null,
174
- cell: ({ row: e }) => /* @__PURE__ */ n(
139
+ cell: ({ row: e }) => /* @__PURE__ */ l(
175
140
  "button",
176
141
  {
177
142
  type: "button",
178
143
  onClick: () => e.toggleExpanded(),
179
144
  "aria-label": e.getIsExpanded() ? "Collapse row" : "Expand row",
180
145
  className: "flex items-center justify-center p-ds-01 rounded-ds-sm hover:bg-surface-raised transition-colors",
181
- children: /* @__PURE__ */ n(
182
- h,
146
+ children: /* @__PURE__ */ l(
147
+ me,
183
148
  {
184
- icon: Se,
149
+ icon: tt,
185
150
  size: "sm",
186
- className: a(
151
+ className: L(
187
152
  "transition-transform duration-moderate-02",
188
153
  e.getIsExpanded() && "rotate-90"
189
154
  )
@@ -194,346 +159,155 @@ function zt({
194
159
  enableSorting: !1,
195
160
  enableColumnFilter: !1,
196
161
  enableHiding: !1
197
- }, R = [
198
- ...w ? [Ye] : [],
199
- ...j ? [Ue] : [],
200
- ...f
201
- ], T = !!r, X = g || T, S = {
202
- columnVisibility: _e,
203
- columnPinning: de
162
+ }, V = [
163
+ ...s ? [Ge] : [],
164
+ ...C ? [Ke] : [],
165
+ ...Ce
166
+ ], S = !!o, H = Se || S, d = {
167
+ columnVisibility: Fe,
168
+ columnPinning: j
204
169
  };
205
- N && (S.sorting = je), (b || x) && (S.columnFilters = Ve, S.globalFilter = K), X && (S.pagination = Pe), w && (S.rowSelection = C), j && (S.expanded = Oe);
206
- const pe = N && !!v, i = at({
207
- data: o,
208
- columns: R,
209
- state: S,
210
- onColumnVisibilityChange: Be,
211
- onColumnPinningChange: He,
212
- getCoreRowModel: dt(),
213
- ...N && {
214
- onSortingChange: pe ? Ke : ie,
215
- ...pe ? { manualSorting: !0 } : { getSortedRowModel: ct() }
170
+ h && (d.sorting = Ie), (w || y) && (d.columnFilters = Te, d.globalFilter = D), H && (d.pagination = Ee), s && (d.rowSelection = r), C && (d.expanded = He);
171
+ const se = h && !!p, g = Je({
172
+ data: i,
173
+ columns: V,
174
+ state: d,
175
+ onColumnVisibilityChange: je,
176
+ onColumnPinningChange: ke,
177
+ getCoreRowModel: Ze(),
178
+ ...h && {
179
+ onSortingChange: se ? Be : ee,
180
+ ...se ? { manualSorting: !0 } : { getSortedRowModel: Xe() }
216
181
  },
217
- ...(b || x) && {
218
- onColumnFiltersChange: $e,
219
- onGlobalFilterChange: G,
220
- getFilteredRowModel: it()
182
+ ...(w || y) && {
183
+ onColumnFiltersChange: De,
184
+ onGlobalFilterChange: E,
185
+ getFilteredRowModel: We()
221
186
  },
222
- ...X && {
223
- onPaginationChange: T ? Le : L,
224
- ...T ? {
187
+ ...H && {
188
+ onPaginationChange: S ? _e : F,
189
+ ...S ? {
225
190
  manualPagination: !0,
226
191
  pageCount: Math.ceil(
227
- r.total / r.pageSize
192
+ o.total / o.pageSize
228
193
  )
229
- } : { getPaginationRowModel: rt() }
194
+ } : { getPaginationRowModel: Ue() }
230
195
  },
231
- ...w && {
232
- onRowSelectionChange: ce,
233
- enableRowSelection: re ? (e) => re(e.original) : !0
196
+ ...s && {
197
+ onRowSelectionChange: te,
198
+ enableRowSelection: X ? (e) => X(e.original) : !0
234
199
  },
235
- ...j && {
236
- onExpandedChange: O ? Ge : me,
237
- getExpandedRowModel: ot()
200
+ ...C && {
201
+ onExpandedChange: I ? Oe : le,
202
+ getExpandedRowModel: Qe()
238
203
  },
239
- ...p && {
240
- getRowId: (e) => p(e)
204
+ ...c && {
205
+ getRowId: (e) => c(e)
241
206
  }
242
- }), q = D(H), J = D(p);
243
- E(() => {
244
- q.current = H, J.current = p;
245
- }, [H, p]), E(() => {
246
- if (U.current) {
247
- U.current = !1;
207
+ }), B = b(z), O = b(c);
208
+ m(() => {
209
+ B.current = z, O.current = c;
210
+ }, [z, c]), m(() => {
211
+ if (k.current) {
212
+ k.current = !1;
248
213
  return;
249
214
  }
250
- if (!q.current) return;
251
- const e = Object.keys(C).filter((s) => C[s]), t = o.filter((s, l) => {
252
- const c = J.current ? J.current(o[l]) : String(l);
253
- return e.includes(c);
215
+ if (!B.current) return;
216
+ const e = Object.keys(r).filter((n) => r[n]), t = i.filter((n, u) => {
217
+ const fe = O.current ? O.current(i[u]) : String(u);
218
+ return e.includes(fe);
254
219
  });
255
- q.current(t);
256
- }, [C, o]);
257
- function he(e) {
258
- const { left: t = [], right: s = [] } = de, l = t.indexOf(e), c = s.indexOf(e);
259
- return l !== -1 ? {
260
- className: "sticky bg-surface-base z-raised",
261
- style: { left: 0 }
262
- } : c !== -1 ? {
263
- className: "sticky bg-surface-base z-raised",
264
- style: { right: 0 }
265
- } : { className: "", style: {} };
266
- }
267
- function We(e) {
268
- if (!Ee || e === "_select" || e === "_expand") return !1;
269
- const t = i.getColumn(e);
270
- return !(!t || t.columnDef.meta?.enableEditing === !1);
271
- }
272
- const be = wt[ue], $ = i.getRowModel().rows, xe = ut({
273
- count: y ? $.length : 0,
274
- getScrollElement: () => ge.current,
275
- estimateSize: () => ve,
220
+ B.current(t);
221
+ }, [r, i]);
222
+ const ce = lt[ne], Le = g.getRowModel().rows, ie = ve({
223
+ count: f ? Le.length : 0,
224
+ getScrollElement: () => ae.current,
225
+ estimateSize: () => we,
276
226
  overscan: 10
277
- }), Xe = r?.pageSize ?? ne ?? 5, qe = R.length, Je = M(
278
- (e, t) => {
279
- !F || t.target.closest(kt) || F(e);
280
- },
281
- [F]
282
- );
283
- function ye(e, t) {
284
- const s = e.getVisibleCells();
285
- return /* @__PURE__ */ n(
286
- z,
287
- {
288
- "data-state": e.getIsSelected() && "selected",
289
- style: t,
290
- className: a(
291
- y ? "absolute w-full flex" : void 0,
292
- F && "cursor-pointer"
293
- ),
294
- onClick: F ? (l) => Je(e.original, l) : void 0,
295
- children: s.map((l) => {
296
- const c = he(l.column.id), k = fe?.rowIndex === e.index && fe?.columnId === l.column.id;
297
- return /* @__PURE__ */ n(
298
- _,
299
- {
300
- className: a(
301
- be,
302
- c.className,
303
- y && "flex-1",
304
- ke(l.column.columnDef.meta)
305
- ),
306
- style: c.style,
307
- onDoubleClick: () => {
308
- We(l.column.id) && Y({
309
- rowIndex: e.index,
310
- columnId: l.column.id
311
- });
312
- },
313
- children: k ? /* @__PURE__ */ n(
314
- Rt,
315
- {
316
- initialValue: String(l.getValue() ?? ""),
317
- onSave: (m) => {
318
- Ie?.(e.index, l.column.id, m), Y(null);
319
- },
320
- onCancel: () => Y(null)
321
- }
322
- ) : Z(l.column.columnDef.cell, l.getContext())
323
- },
324
- l.id
325
- );
326
- })
327
- },
328
- e.id
329
- );
330
- }
331
- function Qe(e, t) {
332
- return !j || !e.getIsExpanded() || !ae ? null : /* @__PURE__ */ n(
333
- z,
334
- {
335
- style: t,
336
- className: y ? "absolute w-full flex" : void 0,
337
- children: /* @__PURE__ */ n(
338
- _,
339
- {
340
- colSpan: R.length,
341
- className: a(
342
- "bg-surface-raised p-ds-05",
343
- y && "flex-1"
344
- ),
345
- children: ae(e.original)
346
- }
347
- )
348
- },
349
- `${e.id}-expanded`
350
- );
351
- }
352
- function Ze() {
353
- const e = ["w-3/4", "w-1/2", "w-2/3", "w-full"];
354
- return /* @__PURE__ */ n(P, { children: Array.from({ length: Xe }, (t, s) => /* @__PURE__ */ n(z, { children: Array.from({ length: qe }, (l, c) => {
355
- const m = (R[c]?.id ?? R[c]?.header) === "_select";
356
- return /* @__PURE__ */ n(
357
- _,
358
- {
359
- className: be,
360
- children: m ? /* @__PURE__ */ n(Re, { variant: "text", className: "h-4 w-4", animation: "pulse" }) : /* @__PURE__ */ n(Re, { variant: "text", className: a("h-4", e[c % e.length]), animation: "pulse" })
361
- },
362
- `skeleton-${s}-${c}`
363
- );
364
- }) }, `skeleton-${s}`)) });
365
- }
366
- function et() {
367
- if (Te)
368
- return Ze();
369
- if (!$.length)
370
- return /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
371
- _,
372
- {
373
- colSpan: R.length,
374
- className: a(
375
- "h-24 text-center",
376
- !oe && "text-surface-fg-subtle"
377
- ),
378
- children: oe || I || "No results."
379
- }
380
- ) }) });
381
- if (y) {
382
- const e = xe.getVirtualItems(), t = xe.getTotalSize();
383
- return /* @__PURE__ */ n(
384
- P,
385
- {
386
- style: {
387
- height: `${t}px`,
388
- position: "relative"
389
- },
390
- children: e.map((s) => {
391
- const l = $[s.index];
392
- return ye(l, {
393
- position: "absolute",
394
- top: 0,
395
- left: 0,
396
- width: "100%",
397
- height: `${s.size}px`,
398
- transform: `translateY(${s.start}px)`
399
- });
400
- })
401
- }
402
- );
403
- }
404
- return /* @__PURE__ */ n(P, { children: $.map((e) => /* @__PURE__ */ d(st.Fragment, { children: [
405
- ye(e),
406
- Qe(e)
407
- ] }, e.id)) });
408
- }
409
- const Q = lt(() => {
410
- if (!V || !w) return [];
411
- const e = Object.keys(C).filter((t) => C[t]);
412
- return o.filter((t, s) => {
413
- const l = p ? p(o[s]) : String(s);
414
- return e.includes(l);
227
+ }), re = o?.pageSize ?? P ?? 5, de = ue(() => {
228
+ if (!R || !s) return [];
229
+ const e = Object.keys(r).filter((t) => r[t]);
230
+ return i.filter((t, n) => {
231
+ const u = c ? c(i[n]) : String(n);
232
+ return e.includes(u);
415
233
  });
416
- }, [V, w, C, o, p]), tt = Q.length > 0, nt = T ? r.total : i.getFilteredRowModel().rows.length, Ce = /* @__PURE__ */ d(xt, { children: [
417
- /* @__PURE__ */ d(
418
- yt,
234
+ }, [R, s, r, i, c]), qe = de.length > 0, Pe = S ? o.total : g.getFilteredRowModel().rows.length, Ye = ue(
235
+ () => ({
236
+ table: g,
237
+ allColumns: V.map((e) => ({
238
+ id: e.id,
239
+ header: e.header
240
+ })),
241
+ cellPadding: ce,
242
+ columnPinningState: j,
243
+ sortable: h,
244
+ filterable: w,
245
+ editable: A,
246
+ expandable: C,
247
+ virtualRows: f,
248
+ selectable: s,
249
+ mobileView: T,
250
+ editingCell: oe,
251
+ setEditingCell: Ve,
252
+ onCellEdit: J,
253
+ renderExpanded: Q,
254
+ onRowClick: Z
255
+ }),
256
+ // eslint-disable-next-line react-hooks/exhaustive-deps
257
+ [
258
+ g,
259
+ V.length,
260
+ ce,
261
+ j,
262
+ h,
263
+ w,
264
+ A,
265
+ C,
266
+ f,
267
+ s,
268
+ T,
269
+ oe,
270
+ J,
271
+ Q,
272
+ Z
273
+ ]
274
+ ), $e = f ? ie.getVirtualItems() : void 0, Ae = f ? ie.getTotalSize() : void 0, ge = /* @__PURE__ */ G(nt, { children: [
275
+ /* @__PURE__ */ l(st, { stickyHeader: Re }),
276
+ /* @__PURE__ */ l(
277
+ ct,
419
278
  {
420
- className: a(
421
- Me && "sticky top-0 z-10 bg-surface-base"
422
- ),
423
- children: [
424
- i.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => {
425
- const s = N && t.column.getCanSort(), l = t.column.getIsSorted(), c = he(t.column.id);
426
- return /* @__PURE__ */ n(
427
- Ne,
428
- {
429
- className: a(c.className, ke(t.column.columnDef.meta)),
430
- style: c.style,
431
- children: t.isPlaceholder ? null : s ? /* @__PURE__ */ d(
432
- "button",
433
- {
434
- type: "button",
435
- className: a(
436
- "flex items-center gap-ds-01 font-medium",
437
- "cursor-pointer select-none",
438
- "-ml-ds-01 rounded-ds-sm px-ds-01 py-ds-01",
439
- "hover:bg-surface-raised transition-colors"
440
- ),
441
- onClick: t.column.getToggleSortingHandler(),
442
- "aria-label": `Sort by ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
443
- children: [
444
- Z(
445
- t.column.columnDef.header,
446
- t.getContext()
447
- ),
448
- /* @__PURE__ */ n(Nt, { mode: "wait", initial: !1, children: l === "asc" ? /* @__PURE__ */ n(
449
- te.span,
450
- {
451
- initial: { opacity: 0, rotate: 90 },
452
- animate: { opacity: 1, rotate: 0 },
453
- exit: { opacity: 0, rotate: -90 },
454
- transition: ee.snappy,
455
- className: "inline-flex",
456
- children: /* @__PURE__ */ n(h, { icon: ft, size: "sm", className: "text-surface-fg-muted" })
457
- },
458
- "asc"
459
- ) : l === "desc" ? /* @__PURE__ */ n(
460
- te.span,
461
- {
462
- initial: { opacity: 0, rotate: -90 },
463
- animate: { opacity: 1, rotate: 0 },
464
- exit: { opacity: 0, rotate: 90 },
465
- transition: ee.snappy,
466
- className: "inline-flex",
467
- children: /* @__PURE__ */ n(h, { icon: mt, size: "sm", className: "text-surface-fg-muted" })
468
- },
469
- "desc"
470
- ) : /* @__PURE__ */ n(
471
- te.span,
472
- {
473
- initial: { opacity: 0 },
474
- animate: { opacity: 1 },
475
- exit: { opacity: 0 },
476
- transition: ee.snappy,
477
- className: "inline-flex",
478
- children: /* @__PURE__ */ n(h, { icon: gt, size: "sm", className: "text-surface-fg-subtle" })
479
- },
480
- "unsorted"
481
- ) })
482
- ]
483
- }
484
- ) : Z(
485
- t.column.columnDef.header,
486
- t.getContext()
487
- )
488
- },
489
- t.id
490
- );
491
- }) }, e.id)),
492
- b && i.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => /* @__PURE__ */ n(Ne, { className: "py-ds-01", children: t.isPlaceholder || t.column.columnDef.enableColumnFilter === !1 ? null : /* @__PURE__ */ n(
493
- "input",
494
- {
495
- type: "text",
496
- value: t.column.getFilterValue() ?? "",
497
- onChange: (s) => t.column.setFilterValue(s.target.value),
498
- placeholder: `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : ""}...`,
499
- "aria-label": `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
500
- className: a(
501
- "h-ds-xs-plus w-full rounded-ds-md",
502
- "border border-surface-border-strong bg-surface-raised-hover",
503
- "px-ds-02 text-ds-sm",
504
- "text-surface-fg placeholder:text-surface-fg-subtle",
505
- "outline-none focus:border-accent-7"
506
- )
507
- }
508
- ) }, `${t.id}-filter`)) }, `${e.id}-filters`))
509
- ]
279
+ loading: W,
280
+ skeletonRowCount: re,
281
+ noResultsText: q,
282
+ emptyState: U,
283
+ virtualItems: $e,
284
+ totalVirtualSize: Ae
510
285
  }
511
- ),
512
- et()
286
+ )
513
287
  ] });
514
- return /* @__PURE__ */ d("div", { className: a(B), children: [
515
- se && /* @__PURE__ */ n(
516
- St,
288
+ return /* @__PURE__ */ l(at, { value: Ye, children: /* @__PURE__ */ G("div", { className: L(pe), children: [
289
+ Y && /* @__PURE__ */ l(
290
+ ot,
517
291
  {
518
- table: i,
519
- globalFilter: x,
520
- globalFilterValue: K,
521
- onGlobalFilterChange: G,
522
- density: ue,
523
- onDensityChange: Ae
292
+ table: g,
293
+ globalFilter: y,
294
+ globalFilterValue: D,
295
+ onGlobalFilterChange: E,
296
+ density: ne,
297
+ onDensityChange: Ne
524
298
  }
525
299
  ),
526
- x && !se && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03 pb-ds-04 border-b border-surface-border mb-ds-04", children: [
527
- /* @__PURE__ */ n(h, { icon: pt, size: "sm", className: "text-surface-fg-subtle" }),
528
- /* @__PURE__ */ n(
300
+ y && !Y && /* @__PURE__ */ G("div", { className: "flex items-center gap-ds-03 pb-ds-04 border-b border-surface-border mb-ds-04", children: [
301
+ /* @__PURE__ */ l(me, { icon: et, size: "sm", className: "text-surface-fg-subtle" }),
302
+ /* @__PURE__ */ l(
529
303
  "input",
530
304
  {
531
305
  type: "text",
532
- value: K,
533
- onChange: (e) => G(e.target.value),
306
+ value: D,
307
+ onChange: (e) => E(e.target.value),
534
308
  placeholder: "Search all columns...",
535
309
  "aria-label": "Search all columns",
536
- className: a(
310
+ className: L(
537
311
  "flex-1 bg-transparent text-ds-md",
538
312
  "text-surface-fg placeholder:text-surface-fg-subtle",
539
313
  "outline-none"
@@ -541,131 +315,42 @@ function zt({
541
315
  }
542
316
  )
543
317
  ] }),
544
- y ? /* @__PURE__ */ n(
545
- "div",
318
+ Me ? /* @__PURE__ */ l(
319
+ it,
546
320
  {
547
- ref: ge,
548
- style: { maxHeight: `${Fe}px`, overflowY: "auto" },
549
- children: Ce
321
+ loading: W,
322
+ skeletonRowCount: re,
323
+ noResultsText: q,
324
+ emptyState: U
550
325
  }
551
- ) : Ce,
552
- X && /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-surface-border", children: [
553
- /* @__PURE__ */ d("span", { className: "text-ds-sm text-surface-fg-muted", children: [
554
- nt,
555
- " total rows"
556
- ] }),
557
- /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
558
- !T && /* @__PURE__ */ n(
559
- "select",
560
- {
561
- value: i.getState().pagination.pageSize,
562
- onChange: (e) => {
563
- i.setPageSize(Number(e.target.value));
564
- },
565
- "aria-label": "Rows per page",
566
- className: a(
567
- "h-ds-sm rounded-ds-md",
568
- "border border-surface-border-strong bg-surface-raised-hover",
569
- "px-ds-03 text-ds-sm",
570
- "text-surface-fg"
571
- ),
572
- children: (ze ?? [10, 20, 50, 100]).map((e) => /* @__PURE__ */ d("option", { value: e, children: [
573
- e,
574
- " rows"
575
- ] }, e))
576
- }
577
- ),
578
- /* @__PURE__ */ n(
579
- "button",
580
- {
581
- type: "button",
582
- disabled: !i.getCanPreviousPage(),
583
- onClick: () => i.previousPage(),
584
- "aria-label": "Previous page",
585
- className: a(
586
- "h-ds-sm w-ds-sm flex items-center justify-center",
587
- "rounded-ds-md border border-surface-border-strong",
588
- "enabled:hover:bg-surface-raised",
589
- "disabled:opacity-action-disabled disabled:cursor-not-allowed",
590
- "transition-colors"
591
- ),
592
- children: /* @__PURE__ */ n(h, { icon: ht, size: "sm" })
593
- }
594
- ),
595
- /* @__PURE__ */ d("span", { className: "text-ds-sm text-surface-fg-muted", children: [
596
- "Page ",
597
- i.getState().pagination.pageIndex + 1,
598
- " of",
599
- " ",
600
- i.getPageCount()
601
- ] }),
602
- /* @__PURE__ */ n(
603
- "button",
604
- {
605
- type: "button",
606
- disabled: !i.getCanNextPage(),
607
- onClick: () => i.nextPage(),
608
- "aria-label": "Next page",
609
- className: a(
610
- "h-ds-sm w-ds-sm flex items-center justify-center",
611
- "rounded-ds-md border border-surface-border-strong",
612
- "enabled:hover:bg-surface-raised",
613
- "disabled:opacity-action-disabled disabled:cursor-not-allowed",
614
- "transition-colors"
615
- ),
616
- children: /* @__PURE__ */ n(h, { icon: Se, size: "sm" })
617
- }
618
- )
619
- ] })
620
- ] }),
621
- V && w && tt && /* @__PURE__ */ d(
326
+ ) : f ? /* @__PURE__ */ l(
622
327
  "div",
623
328
  {
624
- className: a(
625
- "fixed bottom-6 left-1/2 -translate-x-1/2 z-50",
626
- "flex items-center gap-ds-04 px-ds-05 py-ds-03",
627
- "rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating",
628
- "animate-in slide-in-from-bottom-2"
629
- ),
630
- role: "toolbar",
631
- "aria-label": "Bulk actions",
632
- children: [
633
- /* @__PURE__ */ d("span", { className: "text-ds-sm font-medium text-surface-fg whitespace-nowrap", children: [
634
- Q.length,
635
- " selected"
636
- ] }),
637
- /* @__PURE__ */ n("div", { className: "h-5 w-px bg-surface-border", "aria-hidden": "true" }),
638
- V.map((e) => /* @__PURE__ */ n(
639
- Ct,
640
- {
641
- size: "sm",
642
- variant: e.color === "error" ? "destructive" : "outline",
643
- disabled: e.disabled,
644
- onClick: () => e.onClick(Q),
645
- children: e.label
646
- },
647
- e.label
648
- )),
649
- /* @__PURE__ */ n(
650
- "button",
651
- {
652
- type: "button",
653
- onClick: () => i.resetRowSelection(),
654
- "aria-label": "Clear selection",
655
- className: a(
656
- "flex items-center justify-center p-ds-01",
657
- "rounded-ds-sm hover:bg-surface-raised transition-colors",
658
- "text-surface-fg-muted hover:text-surface-fg"
659
- ),
660
- children: /* @__PURE__ */ n(h, { icon: bt, size: "sm" })
661
- }
662
- )
663
- ]
329
+ ref: ae,
330
+ style: { maxHeight: `${ye}px`, overflowY: "auto" },
331
+ children: ge
332
+ }
333
+ ) : ge,
334
+ H && /* @__PURE__ */ l(
335
+ rt,
336
+ {
337
+ table: g,
338
+ totalRowCount: Pe,
339
+ useServerPagination: S,
340
+ pageSizeOptions: xe
341
+ }
342
+ ),
343
+ R && s && qe && /* @__PURE__ */ l(
344
+ dt,
345
+ {
346
+ table: g,
347
+ selectedRows: de,
348
+ bulkActions: R
664
349
  }
665
350
  )
666
- ] });
351
+ ] }) });
667
352
  }
668
- zt.displayName = "DataTable";
353
+ gt.displayName = "DataTable";
669
354
  export {
670
- zt as DataTable
355
+ gt as DataTable
671
356
  };