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