@actioneer/ads 1.0.7 → 1.0.9

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 (87) hide show
  1. package/DESIGN.md +119 -91
  2. package/README.md +19 -1
  3. package/components/ai-elements/chart.js +20 -20
  4. package/components/ai-elements/inline-citation.js +50 -50
  5. package/components/ai-elements/message.js +1 -1
  6. package/components/ai-elements/tool.js +5 -5
  7. package/components/alert.d.ts +3 -2
  8. package/components/alert.js +25 -25
  9. package/components/answer.js +1 -1
  10. package/components/assistant-ui/action-bar.js +1 -1
  11. package/components/assistant-ui/attachment.js +68 -49
  12. package/components/assistant-ui/composer-add-context.js +1 -1
  13. package/components/assistant-ui/composer-harness.js +5 -4
  14. package/components/assistant-ui/composer-trigger-popover.js +1 -1
  15. package/components/assistant-ui/composer.js +13 -13
  16. package/components/assistant-ui/message-timing.js +6 -6
  17. package/components/assistant-ui/selection-toolbar.js +5 -5
  18. package/components/assistant-ui/sources.js +15 -15
  19. package/components/assistant-ui/tooltip-icon-button.js +18 -14
  20. package/components/audio-waveform.d.ts +21 -8
  21. package/components/audio-waveform.js +371 -94
  22. package/components/autocomplete.js +9 -9
  23. package/components/breadcrumbs.js +36 -42
  24. package/components/button.d.ts +16 -1
  25. package/components/button.js +86 -73
  26. package/components/card.js +1 -1
  27. package/components/chart.d.ts +31 -4
  28. package/components/chart.js +900 -666
  29. package/components/chip.d.ts +2 -1
  30. package/components/chip.js +56 -51
  31. package/components/command-palette.js +12 -12
  32. package/components/connector-card.d.ts +1 -2
  33. package/components/connector-card.js +17 -17
  34. package/components/date-range-picker.js +1 -2
  35. package/components/drawer.js +9 -10
  36. package/components/dropdown.js +1 -1
  37. package/components/empty-state.d.ts +2 -0
  38. package/components/empty-state.js +17 -15
  39. package/components/field.js +9 -10
  40. package/components/file-dropzone.d.ts +6 -3
  41. package/components/file-dropzone.js +72 -60
  42. package/components/filters.d.ts +37 -0
  43. package/components/filters.js +129 -0
  44. package/components/index.d.ts +1 -0
  45. package/components/index.js +447 -444
  46. package/components/infinite-canvas.js +9 -9
  47. package/components/modal.d.ts +2 -1
  48. package/components/modal.js +102 -91
  49. package/components/page-body.js +8 -8
  50. package/components/popover.d.ts +6 -1
  51. package/components/popover.js +75 -65
  52. package/components/progress-circle.d.ts +1 -1
  53. package/components/progress-circle.js +57 -48
  54. package/components/segmented.d.ts +1 -0
  55. package/components/segmented.js +34 -36
  56. package/components/select.js +2 -2
  57. package/components/selection-action-bar.js +32 -31
  58. package/components/setting-row.js +10 -10
  59. package/components/sidebar.d.ts +15 -0
  60. package/components/sidebar.js +186 -149
  61. package/components/slider.js +5 -5
  62. package/components/stepper.d.ts +1 -1
  63. package/components/stepper.js +1 -1
  64. package/components/switch.js +10 -10
  65. package/components/table.d.ts +10 -2
  66. package/components/table.js +380 -366
  67. package/components/tabs.d.ts +6 -1
  68. package/components/tabs.js +32 -29
  69. package/components/timeline.js +3 -3
  70. package/components/toast.js +53 -56
  71. package/components/ui/button.js +4 -4
  72. package/components/ui/dialog.js +1 -1
  73. package/components/viz-charts.js +263 -221
  74. package/demo/components/add-to-artifact.js +3 -2
  75. package/examples/README.md +31 -0
  76. package/examples/agents-screen.tsx +477 -0
  77. package/examples/campaign-analysis-screen.tsx +138 -0
  78. package/examples/campaigns-screen.tsx +439 -0
  79. package/examples/settings-screen.tsx +90 -0
  80. package/examples/workspace-header.tsx +71 -0
  81. package/lib/icons.d.ts +8 -0
  82. package/lib/icons.js +171 -118
  83. package/llms.txt +93 -29
  84. package/manifest.json +1660 -113
  85. package/package.json +1 -1
  86. package/styles.css +55 -68
  87. package/theme.css +50 -59
@@ -1,75 +1,82 @@
1
1
  "use client";
2
- import { jsx as d, jsxs as $, Fragment as Pe } from "react/jsx-runtime";
2
+ import { jsx as u, jsxs as M, Fragment as Ae } from "react/jsx-runtime";
3
3
  import * as r from "react";
4
- import { MotionConfig as Ae, motion as De } from "motion/react";
5
- import { cn as g } from "../lib/cn.js";
6
- import { Button as We } from "./button.js";
7
- import { Checkbox as be } from "./checkbox.js";
8
- import { Radio as Me } from "./radio.js";
9
- import { ChevronRight as Ve, ChevronUp as $e, ChevronDown as Le, SortIcon as _e } from "../lib/icons.js";
4
+ import { MotionConfig as De, motion as We } from "motion/react";
5
+ import { cn as b } from "../lib/cn.js";
6
+ import { Button as Me } from "./button.js";
7
+ import { Checkbox as ge } from "./checkbox.js";
8
+ import { Radio as Ve } from "./radio.js";
9
+ import { ChevronRight as $e, ChevronUp as Le, ChevronDown as _e, SortIcon as Fe } from "../lib/icons.js";
10
10
  import { springDisclosure as je } from "../lib/motion.js";
11
- const ge = (t) => t === "center" ? "text-center" : t === "right" ? "text-right" : "text-left", ve = (t, e = !1) => t === "left" ? g(
11
+ const ve = (t) => t === "center" ? "text-center" : t === "right" ? "text-right" : "text-left", ye = (t, e = !1) => t === "left" ? b(
12
12
  "sticky left-0 z-10",
13
13
  // Scroll-aware: the smudge only appears once content is actually
14
14
  // hidden behind the pinned column (nothing to scroll back to at the
15
15
  // far left → no shadow).
16
16
  "group-data-[scroll-left=true]/table-shell:shadow-table-smudge-left"
17
- ) : t === "right" ? g(
17
+ ) : t === "right" ? b(
18
18
  "sticky right-0 z-10",
19
19
  // Backward-compatible fallback. Action columns should opt into the
20
20
  // Table-level elevation so one shadow spans the complete column.
21
21
  !e && "group-data-[scroll-right=true]/table-shell:shadow-table-smudge-right"
22
- ) : void 0, ye = r.createContext({ interactive: !1, selected: !1 }), we = { depth: 0, hidden: !1 }, se = r.createContext(we), ae = {
22
+ ) : void 0, we = r.createContext({ interactive: !1, selected: !1 }), xe = { depth: 0, hidden: !1 }, le = r.createContext(xe), Ne = (t) => ({
23
23
  backgroundColor: "var(--card)",
24
- backgroundImage: "linear-gradient(to right, var(--table-row-selected), var(--card))",
24
+ backgroundImage: `linear-gradient(to right, ${t}, var(--card))`,
25
25
  backgroundSize: "var(--table-selection-width, 100%) 100%",
26
26
  backgroundRepeat: "no-repeat"
27
- }, xe = (t) => g(
27
+ }), ce = Ne("var(--table-row-selected)"), Oe = Ne("var(--table-row-hover)"), Ce = (t, { sticky: e, selected: s = !1 } = {}) => b(
28
28
  "bg-card align-middle transition-colors",
29
29
  // Functional row hairline; the table shell carries the outer stroke.
30
30
  "border-b border-table-stroke group-last/row:border-b-0",
31
- t && g(
32
- // Use WG1 without introducing a new
33
- // rounded silhouette. The wash is pre-composited so scrolled text
34
- // cannot show through sticky cells.
35
- "group-hover/row:bg-(--table-row-hover) group-focus-within/row:bg-(--table-row-hover)",
36
- "group-data-[selected]/row:bg-transparent"
37
- )
38
- ), Ne = "bg-table-shell", Ce = g(
31
+ t && !e && // Scrolling cells fade to transparent so the row's continuous WG1 →
32
+ // White hover fade shows through without a new rounded silhouette.
33
+ "group-hover/row:bg-transparent group-focus-within/row:bg-transparent",
34
+ t && e && !s && b(
35
+ // Pinned cells stay opaque over scrolled content and fade in their
36
+ // slice of the same row-wide hover gradient.
37
+ "before:pointer-events-none before:absolute before:inset-0 before:-z-10",
38
+ "before:bg-[image:linear-gradient(to_right,var(--table-row-hover),var(--card))]",
39
+ "before:bg-[length:var(--table-selection-width,100%)_100%] before:bg-no-repeat",
40
+ e === "left" ? "before:bg-left" : "before:bg-right",
41
+ "before:opacity-0 before:transition-opacity before:duration-150 before:ease-out",
42
+ "group-hover/row:before:opacity-100 group-focus-within/row:before:opacity-100"
43
+ ),
44
+ t && "group-data-[selected]/row:bg-transparent group-data-[active]/row:bg-transparent"
45
+ ), ke = "bg-table-shell", Re = b(
39
46
  "after:pointer-events-none after:absolute after:right-0 after:top-1/2",
40
47
  "after:h-4 after:w-px after:-translate-y-1/2 after:rounded-sm",
41
48
  "after:bg-border-strong last:after:hidden"
42
- ), ie = "__ads_table_column_", le = 64, Oe = new Intl.Collator(void 0, {
49
+ ), de = "__ads_table_column_", ue = 64, Xe = new Intl.Collator(void 0, {
43
50
  numeric: !0,
44
51
  sensitivity: "base"
45
52
  });
46
- function L(t) {
53
+ function V(t) {
47
54
  const e = [];
48
55
  return r.Children.forEach(t, (s) => {
49
56
  if (r.isValidElement(s) && s.type === r.Fragment) {
50
- e.push(...L(s.props.children));
57
+ e.push(...V(s.props.children));
51
58
  return;
52
59
  }
53
60
  e.push(s);
54
61
  }), e;
55
62
  }
56
- function z(t, e) {
63
+ function R(t, e) {
57
64
  return t === e || !!(e.displayName && t && (typeof t == "object" || typeof t == "function") && "displayName" in t && t.displayName === e.displayName);
58
65
  }
59
- function ke(t) {
60
- return L(t).some((e) => !r.isValidElement(e) || z(e.type, de) ? !1 : z(e.type, K) && L(e.props.childRows).some(r.isValidElement) || ke(e.props.children));
66
+ function Se(t) {
67
+ return V(t).some((e) => !r.isValidElement(e) || R(e.type, fe) ? !1 : R(e.type, K) && V(e.props.childRows).some(r.isValidElement) || Se(e.props.children));
61
68
  }
62
- function Xe(t) {
63
- const e = /* @__PURE__ */ new Map(), s = (i) => L(i).flatMap((n) => {
69
+ function Be(t) {
70
+ const e = /* @__PURE__ */ new Map(), s = (i) => V(i).flatMap((n) => {
64
71
  if (!r.isValidElement(n)) return [];
65
- if (z(n.type, de) || z(n.type, ue)) return [];
66
- if (!z(n.type, K)) return s(n.props.children);
72
+ if (R(n.type, fe) || R(n.type, me)) return [];
73
+ if (!R(n.type, K)) return s(n.props.children);
67
74
  const c = s(n.props.childRows);
68
75
  return n.props.rowKey === void 0 ? c : (c.length > 0 && e.set(n.props.rowKey, c), [n.props.rowKey, ...c]);
69
76
  });
70
77
  return { keys: s(t), descendants: e };
71
78
  }
72
- function oe(t, e) {
79
+ function ie(t, e) {
73
80
  for (const [s, i] of e)
74
81
  i.every((n) => t.has(n)) ? t.add(s) : t.delete(s);
75
82
  return t;
@@ -113,63 +120,63 @@ function he(t) {
113
120
  const n = /^\d{4}[-/]\d{1,2}[-/]\d{1,2}/.test(e) || /\b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\b/i.test(e) ? Date.parse(e) : Number.NaN;
114
121
  return Number.isNaN(n) ? { kind: "text", value: e } : { kind: "number", value: n };
115
122
  }
116
- function Be(t, e, s) {
123
+ function Ue(t, e, s) {
117
124
  const i = he(t), n = he(e);
118
125
  if (i.kind === "empty") return n.kind === "empty" ? 0 : 1;
119
126
  if (n.kind === "empty") return -1;
120
- const c = i.kind === "number" && n.kind === "number" ? i.value - n.value : Oe.compare(String(i.value), String(n.value));
127
+ const c = i.kind === "number" && n.kind === "number" ? i.value - n.value : Xe.compare(String(i.value), String(n.value));
121
128
  return s === "ascending" ? c : -c;
122
129
  }
123
- const Re = r.createContext(null), te = () => r.useContext(Re), ce = r.createContext("body");
124
- function Ue(t) {
125
- const e = [], i = L(t.props.children).map((n, c) => {
126
- if (!r.isValidElement(n) || !z(n.type, K))
130
+ const ze = r.createContext(null), oe = () => r.useContext(ze), pe = r.createContext("body");
131
+ function He(t) {
132
+ const e = [], i = V(t.props.children).map((n, c) => {
133
+ if (!r.isValidElement(n) || !R(n.type, K))
127
134
  return n;
128
- let b = 0;
129
- const A = L(n.props.children).map((o) => {
135
+ let g = 0;
136
+ const T = V(n.props.children).map((o) => {
130
137
  if (!r.isValidElement(o)) return o;
131
- for (; (e[b] ?? 0) > c; )
132
- b += 1;
133
- const _ = Math.max(1, Number(o.props.colSpan ?? 1)), E = Math.max(1, Number(o.props.rowSpan ?? 1)), x = b;
134
- for (let N = 0; N < _; N += 1)
135
- e[x + N] = Math.max(
136
- e[x + N] ?? 0,
137
- c + E
138
+ for (; (e[g] ?? 0) > c; )
139
+ g += 1;
140
+ const $ = Math.max(1, Number(o.props.colSpan ?? 1)), A = Math.max(1, Number(o.props.rowSpan ?? 1)), x = g;
141
+ for (let w = 0; w < $; w += 1)
142
+ e[x + w] = Math.max(
143
+ e[x + w] ?? 0,
144
+ c + A
138
145
  );
139
- return b += _, z(o.type, pe) ? r.cloneElement(o, { _sortColumnIndex: x }) : o;
146
+ return g += $, R(o.type, be) ? r.cloneElement(o, { _sortColumnIndex: x }) : o;
140
147
  });
141
- return r.cloneElement(n, void 0, A);
148
+ return r.cloneElement(n, void 0, T);
142
149
  });
143
150
  return r.cloneElement(t, void 0, i);
144
151
  }
145
- function Se(t, e, s = "ascending") {
146
- const i = L(t).map((n, c) => {
147
- if (!r.isValidElement(n) || !z(n.type, K))
152
+ function Ee(t, e, s = "ascending") {
153
+ const i = V(t).map((n, c) => {
154
+ if (!r.isValidElement(n) || !R(n.type, K))
148
155
  return { row: n, index: c, value: "" };
149
- const b = L(n.props.children);
156
+ const g = V(n.props.children);
150
157
  return {
151
158
  row: r.cloneElement(n, {
152
159
  key: n.key ?? n.props.rowKey ?? c,
153
- ...n.props.childRows ? { childRows: Se(n.props.childRows, e, s) } : {}
160
+ ...n.props.childRows ? { childRows: Ee(n.props.childRows, e, s) } : {}
154
161
  }),
155
162
  index: c,
156
- value: e === void 0 ? "" : ee(b[e])
163
+ value: e === void 0 ? "" : ee(g[e])
157
164
  };
158
165
  });
159
- return e !== void 0 && i.sort((n, c) => Be(n.value, c.value, s) || n.index - c.index), i.map(({ row: n }) => n);
166
+ return e !== void 0 && i.sort((n, c) => Ue(n.value, c.value, s) || n.index - c.index), i.map(({ row: n }) => n);
160
167
  }
161
- function Fe(t, e, s) {
162
- return r.cloneElement(t, void 0, Se(t.props.children, e, s));
168
+ function qe(t, e, s) {
169
+ return r.cloneElement(t, void 0, Ee(t.props.children, e, s));
163
170
  }
164
- function ze(t, e) {
165
- const s = e != null && e.column.startsWith(ie) ? Number(e.column.slice(ie.length)) : Number.NaN;
171
+ function Te(t, e) {
172
+ const s = e != null && e.column.startsWith(de) ? Number(e.column.slice(de.length)) : Number.NaN;
166
173
  return r.Children.map(t, (i) => r.isValidElement(i) ? i.type === r.Fragment ? r.cloneElement(
167
174
  i,
168
175
  void 0,
169
- ze(i.props.children, e)
170
- ) : z(i.type, ue) ? Ue(i) : z(i.type, Ee) ? Fe(i, Number.isInteger(s) && s >= 0 ? s : void 0, e == null ? void 0 : e.direction) : i : i);
176
+ Te(i.props.children, e)
177
+ ) : R(i.type, me) ? He(i) : R(i.type, Ie) ? qe(i, Number.isInteger(s) && s >= 0 ? s : void 0, e == null ? void 0 : e.direction) : i : i);
171
178
  }
172
- const de = r.forwardRef(
179
+ const fe = r.forwardRef(
173
180
  ({
174
181
  className: t,
175
182
  wrapperClassName: e,
@@ -177,168 +184,168 @@ const de = r.forwardRef(
177
184
  footer: i,
178
185
  children: n,
179
186
  selectionMode: c = "none",
180
- selectedKeys: b,
181
- onSelectionChange: v,
182
- rowKeys: A,
187
+ selectedKeys: g,
188
+ onSelectionChange: y,
189
+ rowKeys: T,
183
190
  elevatedActionColumn: o = !1,
184
- actionColumnWidth: _ = "3rem",
185
- sortDescriptor: E,
191
+ actionColumnWidth: $ = "3rem",
192
+ sortDescriptor: A,
186
193
  onSortChange: x,
187
- allowsSorting: N = !0,
188
- isStatic: F = !1,
194
+ allowsSorting: w = !0,
195
+ isStatic: U = !1,
189
196
  resizableColumns: j = !0,
190
- maxBodyHeight: D,
191
- ...q
192
- }, u) => {
193
- const k = r.useId(), R = r.useMemo(() => ke(n), [n]), y = r.useMemo(() => Xe(n), [n]), T = r.useMemo(() => A ?? [], [A]), J = b === "all", W = r.useMemo(() => {
194
- const a = new Set(b === "all" ? [...T, ...y.keys] : b);
197
+ maxBodyHeight: S,
198
+ ...Y
199
+ }, Z) => {
200
+ const d = r.useId(), C = r.useMemo(() => Se(n), [n]), f = r.useMemo(() => Be(n), [n]), I = r.useMemo(() => T ?? [], [T]), H = g === "all", P = r.useMemo(() => {
201
+ const a = new Set(g === "all" ? [...I, ...f.keys] : g);
195
202
  if (c !== "multiple") return a;
196
- for (const p of [...a])
197
- for (const h of y.descendants.get(p) ?? []) a.add(h);
198
- return oe(a, y.descendants);
199
- }, [b, c, T, y]), S = r.useCallback(
200
- (a) => J || W.has(a),
201
- [J, W]
202
- ), B = r.useCallback(
203
+ for (const m of [...a])
204
+ for (const v of f.descendants.get(m) ?? []) a.add(v);
205
+ return ie(a, f.descendants);
206
+ }, [g, c, I, f]), k = r.useCallback(
207
+ (a) => H || P.has(a),
208
+ [H, P]
209
+ ), O = r.useCallback(
203
210
  (a) => {
204
- var p;
205
- return c === "multiple" && !S(a) && (((p = y.descendants.get(a)) == null ? void 0 : p.some((h) => W.has(h))) ?? !1);
211
+ var m;
212
+ return c === "multiple" && !k(a) && (((m = f.descendants.get(a)) == null ? void 0 : m.some((v) => P.has(v))) ?? !1);
206
213
  },
207
- [c, S, y, W]
208
- ), C = T.length > 0 && T.every(S), O = !C && T.some((a) => S(a) || B(a)), m = r.useCallback(
214
+ [c, k, f, P]
215
+ ), D = I.length > 0 && I.every(k), z = !D && I.some((a) => k(a) || O(a)), h = r.useCallback(
209
216
  (a) => {
210
- if (!v) return;
217
+ if (!y) return;
211
218
  if (c === "single") {
212
- S(a) || v(/* @__PURE__ */ new Set([a]));
219
+ k(a) || y(/* @__PURE__ */ new Set([a]));
213
220
  return;
214
221
  }
215
- const p = new Set(W), h = !S(a);
216
- for (const U of [a, ...y.descendants.get(a) ?? []])
217
- h ? p.add(U) : p.delete(U);
218
- v(oe(p, y.descendants));
222
+ const m = new Set(P), v = !k(a);
223
+ for (const B of [a, ...f.descendants.get(a) ?? []])
224
+ v ? m.add(B) : m.delete(B);
225
+ y(ie(m, f.descendants));
219
226
  },
220
- [v, c, S, W, y]
221
- ), f = r.useCallback(() => {
222
- if (!v) return;
227
+ [y, c, k, P, f]
228
+ ), p = r.useCallback(() => {
229
+ if (!y) return;
223
230
  const a = /* @__PURE__ */ new Set();
224
- if (!C)
225
- for (const p of T) {
226
- a.add(p);
227
- for (const h of y.descendants.get(p) ?? []) a.add(h);
231
+ if (!D)
232
+ for (const m of I) {
233
+ a.add(m);
234
+ for (const v of f.descendants.get(m) ?? []) a.add(v);
228
235
  }
229
- v(oe(a, y.descendants));
230
- }, [v, C, T, y]), [M, X] = r.useState(), I = N && !x, w = I ? M ?? E : E, V = r.useCallback(
236
+ y(ie(a, f.descendants));
237
+ }, [y, D, I, f]), [L, q] = r.useState(), E = w && !x, N = E ? L ?? A : A, J = r.useCallback(
231
238
  (a) => {
232
- if (!N) return;
233
- const p = (w == null ? void 0 : w.column) === a && w.direction === "ascending" ? "descending" : "ascending", h = { column: a, direction: p };
234
- x ? x(h) : X(h);
239
+ if (!w) return;
240
+ const m = (N == null ? void 0 : N.column) === a && N.direction === "ascending" ? "descending" : "ascending", v = { column: a, direction: m };
241
+ x ? x(v) : q(v);
235
242
  },
236
- [w, N, x]
237
- ), re = r.useMemo(
238
- () => I ? ze(n, w) : n,
239
- [w, I, n]
240
- ), G = r.useRef(null), [Q, l] = r.useState({
243
+ [N, w, x]
244
+ ), X = r.useMemo(
245
+ () => E ? Te(n, N) : n,
246
+ [N, E, n]
247
+ ), _ = r.useRef(null), [F, se] = r.useState({
241
248
  left: !1,
242
249
  right: !1
243
- }), P = r.useCallback(() => {
244
- const a = G.current;
250
+ }), G = r.useCallback(() => {
251
+ const a = _.current;
245
252
  if (!a) return;
246
253
  a.style.setProperty("--table-selection-width", `${a.clientWidth}px`), a.style.setProperty("--table-selection-scroll", `${a.scrollLeft}px`);
247
- const p = a.scrollWidth - a.clientWidth, h = a.scrollLeft > 1, U = a.scrollLeft < p - 1;
248
- l(
249
- (ne) => ne.left === h && ne.right === U ? ne : { left: h, right: U }
254
+ const m = a.scrollWidth - a.clientWidth, v = a.scrollLeft > 1, B = a.scrollLeft < m - 1;
255
+ se(
256
+ (ae) => ae.left === v && ae.right === B ? ae : { left: v, right: B }
250
257
  );
251
258
  }, []);
252
259
  r.useLayoutEffect(() => {
253
- P();
254
- const a = G.current;
260
+ G();
261
+ const a = _.current;
255
262
  if (!a || typeof ResizeObserver > "u") return;
256
- const p = new ResizeObserver(P);
257
- p.observe(a);
258
- const h = a.querySelector("table");
259
- return h && p.observe(h), () => p.disconnect();
260
- }, [P]);
261
- const [H, Y] = r.useState(
263
+ const m = new ResizeObserver(G);
264
+ m.observe(a);
265
+ const v = a.querySelector("table");
266
+ return v && m.observe(v), () => m.disconnect();
267
+ }, [G]);
268
+ const [Q, l] = r.useState(
262
269
  null
263
- ), Z = r.useCallback(
270
+ ), W = r.useCallback(
264
271
  (a) => {
265
- Y(
266
- (p) => p ?? Array.from(
272
+ l(
273
+ (m) => m ?? Array.from(
267
274
  a.cells,
268
- (h) => h.getBoundingClientRect().width
275
+ (v) => v.getBoundingClientRect().width
269
276
  )
270
277
  );
271
278
  },
272
279
  []
273
- ), me = r.useCallback((a, p) => {
274
- Y((h) => {
275
- if (!h) return h;
276
- const U = [...h];
277
- return U[a] = Math.max(le, p), U;
280
+ ), te = r.useCallback((a, m) => {
281
+ l((v) => {
282
+ if (!v) return v;
283
+ const B = [...v];
284
+ return B[a] = Math.max(ue, m), B;
278
285
  });
279
- }, []), fe = r.useCallback(
280
- () => Y(null),
286
+ }, []), re = r.useCallback(
287
+ () => l(null),
281
288
  []
282
- ), Ie = r.useMemo(
289
+ ), ne = r.useMemo(
283
290
  () => ({
284
291
  selectionMode: c,
285
- selectionName: k,
286
- hasNestedRows: R,
287
- isSelected: S,
288
- isIndeterminate: B,
289
- toggleKey: m,
290
- toggleAll: f,
291
- allSelected: C,
292
- someSelected: O,
293
- isStatic: F,
294
- sortDescriptor: w,
295
- requestSort: N ? V : void 0,
296
- automaticSorting: I,
292
+ selectionName: d,
293
+ hasNestedRows: C,
294
+ isSelected: k,
295
+ isIndeterminate: O,
296
+ toggleKey: h,
297
+ toggleAll: p,
298
+ allSelected: D,
299
+ someSelected: z,
300
+ isStatic: U,
301
+ sortDescriptor: N,
302
+ requestSort: w ? J : void 0,
303
+ automaticSorting: E,
297
304
  elevatedActionColumn: o,
298
305
  resizableColumns: j,
299
- columnWidths: H,
300
- snapshotColumnWidths: Z,
301
- setColumnWidth: me,
302
- resetColumnWidths: fe,
303
- stickyHeader: D != null
306
+ columnWidths: Q,
307
+ snapshotColumnWidths: W,
308
+ setColumnWidth: te,
309
+ resetColumnWidths: re,
310
+ stickyHeader: S != null
304
311
  }),
305
312
  [
306
313
  c,
307
- k,
308
- R,
309
- S,
310
- B,
311
- m,
312
- f,
314
+ d,
313
315
  C,
316
+ k,
314
317
  O,
315
- F,
316
- w,
318
+ h,
319
+ p,
320
+ D,
321
+ z,
322
+ U,
317
323
  N,
318
- I,
319
- V,
324
+ w,
325
+ E,
326
+ J,
320
327
  o,
321
328
  j,
322
- H,
323
- Z,
324
- me,
325
- fe,
326
- D
329
+ Q,
330
+ W,
331
+ te,
332
+ re,
333
+ S
327
334
  ]
328
335
  );
329
- return /* @__PURE__ */ d(Re.Provider, { value: Ie, children: /* @__PURE__ */ d(se.Provider, { value: we, children: /* @__PURE__ */ $(
336
+ return /* @__PURE__ */ u(ze.Provider, { value: ne, children: /* @__PURE__ */ u(le.Provider, { value: xe, children: /* @__PURE__ */ M(
330
337
  "div",
331
338
  {
332
339
  "data-slot": "table-container",
333
- "data-scroll-left": Q.left ? "true" : "false",
334
- "data-scroll-right": Q.right ? "true" : "false",
335
- className: g(
340
+ "data-scroll-left": F.left ? "true" : "false",
341
+ "data-scroll-right": F.right ? "true" : "false",
342
+ className: b(
336
343
  "group/table-shell w-full min-w-0 overflow-clip rounded-m border border-table-stroke bg-table-shell",
337
344
  "[--table-card-radius:var(--radius-m)]",
338
345
  e
339
346
  ),
340
347
  children: [
341
- s && /* @__PURE__ */ d(
348
+ s && /* @__PURE__ */ u(
342
349
  "div",
343
350
  {
344
351
  "data-slot": "table-toolbar",
@@ -346,65 +353,65 @@ const de = r.forwardRef(
346
353
  children: s
347
354
  }
348
355
  ),
349
- /* @__PURE__ */ $(
356
+ /* @__PURE__ */ M(
350
357
  "div",
351
358
  {
352
359
  className: "relative",
353
360
  style: o ? {
354
- "--table-action-column-width": _
361
+ "--table-action-column-width": $
355
362
  } : void 0,
356
363
  children: [
357
- /* @__PURE__ */ d(
364
+ /* @__PURE__ */ u(
358
365
  "div",
359
366
  {
360
- ref: G,
361
- onScroll: P,
362
- className: g(
367
+ ref: _,
368
+ onScroll: G,
369
+ className: b(
363
370
  "overflow-x-auto rounded-(--table-card-radius)",
364
- D != null && "overflow-y-auto"
371
+ S != null && "overflow-y-auto"
365
372
  ),
366
- style: D != null ? { maxHeight: D } : void 0,
367
- children: /* @__PURE__ */ $(
373
+ style: S != null ? { maxHeight: S } : void 0,
374
+ children: /* @__PURE__ */ M(
368
375
  "table",
369
376
  {
370
- ref: u,
377
+ ref: Z,
371
378
  "data-slot": "table",
372
- className: g(
379
+ className: b(
373
380
  "w-full border-separate border-spacing-0 text-m font-normal",
374
381
  // Manual widths need fixed layout so the <colgroup> wins;
375
382
  // until the first resize the automatic layout is untouched.
376
- H && "table-fixed",
383
+ Q && "table-fixed",
377
384
  t
378
385
  ),
379
- ...q,
386
+ ...Y,
380
387
  children: [
381
- H && /* @__PURE__ */ d("colgroup", { children: H.map((a, p) => /* @__PURE__ */ d("col", { style: { width: a } }, p)) }),
382
- re
388
+ Q && /* @__PURE__ */ u("colgroup", { children: Q.map((a, m) => /* @__PURE__ */ u("col", { style: { width: a } }, m)) }),
389
+ X
383
390
  ]
384
391
  }
385
392
  )
386
393
  }
387
394
  ),
388
- /* @__PURE__ */ d(
395
+ /* @__PURE__ */ u(
389
396
  "div",
390
397
  {
391
398
  "aria-hidden": "true",
392
399
  "data-slot": "table-scroll-hint",
393
- className: g(
400
+ className: b(
394
401
  "pointer-events-none absolute inset-y-0 z-20 w-10",
395
402
  "bg-gradient-to-l from-(--table-scroll-hint) to-transparent",
396
403
  "opacity-0 transition-opacity duration-150 ease-out motion-reduce:transition-none",
397
- Q.right && "opacity-100",
404
+ F.right && "opacity-100",
398
405
  o ? "right-[var(--table-action-column-width)]" : "right-0"
399
406
  )
400
407
  }
401
408
  ),
402
- o && /* @__PURE__ */ d(
409
+ o && /* @__PURE__ */ u(
403
410
  "div",
404
411
  {
405
412
  "aria-hidden": "true",
406
413
  "data-slot": "table-action-column-elevation",
407
- className: g(
414
+ className: b(
408
415
  "pointer-events-none absolute inset-y-0 right-0 z-20",
409
416
  "w-[var(--table-action-column-width)]"
410
417
  // No shadow of its own: while columns hide behind the pinned
@@ -417,20 +424,20 @@ const de = r.forwardRef(
417
424
  ]
418
425
  }
419
426
  ),
420
- i && /* @__PURE__ */ d("div", { className: "flex items-center border-t border-table-stroke px-4 py-2.5", children: i })
427
+ i && /* @__PURE__ */ u("div", { className: "flex items-center border-t border-table-stroke px-4 py-2.5", children: i })
421
428
  ]
422
429
  }
423
430
  ) }) });
424
431
  }
425
432
  );
426
- de.displayName = "Table";
427
- const ue = r.forwardRef(({ className: t, ...e }, s) => {
428
- const i = te();
429
- return /* @__PURE__ */ d(ce.Provider, { value: "header", children: /* @__PURE__ */ d(
433
+ fe.displayName = "Table";
434
+ const me = r.forwardRef(({ className: t, ...e }, s) => {
435
+ const i = oe();
436
+ return /* @__PURE__ */ u(pe.Provider, { value: "header", children: /* @__PURE__ */ u(
430
437
  "thead",
431
438
  {
432
439
  ref: s,
433
- className: g(
440
+ className: b(
434
441
  "text-s font-medium text-table-header-foreground",
435
442
  (i == null ? void 0 : i.elevatedActionColumn) && "relative z-30 bg-table-shell",
436
443
  t
@@ -439,9 +446,9 @@ const ue = r.forwardRef(({ className: t, ...e }, s) => {
439
446
  }
440
447
  ) });
441
448
  });
442
- ue.displayName = "TableHeader";
443
- const Ee = r.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ d(ce.Provider, { value: "body", children: /* @__PURE__ */ d("tbody", { ref: s, className: g("[&>tr:not([hidden],[data-collapsed]):not(:has(~tr:not([hidden],[data-collapsed])))>td]:border-b-0", t), ...e }) }));
444
- Ee.displayName = "TableBody";
449
+ me.displayName = "TableHeader";
450
+ const Ie = r.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ u(pe.Provider, { value: "body", children: /* @__PURE__ */ u("tbody", { ref: s, className: b("[&>tr:not([hidden],[data-collapsed]):not(:has(~tr:not([hidden],[data-collapsed])))>td]:border-b-0", t), ...e }) }));
451
+ Ie.displayName = "TableBody";
445
452
  const K = r.forwardRef(
446
453
  ({
447
454
  className: t,
@@ -450,161 +457,168 @@ const K = r.forwardRef(
450
457
  childRows: i,
451
458
  expanded: n,
452
459
  defaultExpanded: c = !1,
453
- onExpandedChange: b,
454
- disclosureLabel: v,
455
- id: A,
460
+ onExpandedChange: g,
461
+ disclosureLabel: y,
462
+ id: T,
456
463
  hidden: o,
457
- isInteractive: _ = !1,
458
- onClick: E,
459
- onKeyDown: x,
460
- role: N,
461
- tabIndex: F,
462
- style: j,
463
- ...D
464
- }, q) => {
465
- const u = te(), k = r.useContext(ce), R = r.useContext(se), y = r.useId(), T = A ?? y, [J, W] = r.useState(c), [S, B] = r.useState(!1), C = n ?? J, O = L(i).map((l, P) => !r.isValidElement(l) || !z(l.type, K) ? l : r.cloneElement(l, {
466
- key: l.key ?? l.props.rowKey ?? P,
467
- id: l.props.id ?? `${T}-child-${encodeURIComponent(String(l.props.rowKey ?? P))}`
468
- })), m = k === "body" && O.some(r.isValidElement), f = O.flatMap((l) => r.isValidElement(l) && l.props.id ? [l.props.id] : []), M = (l) => {
469
- B(l), n === void 0 && W(!C), b == null || b(!C);
470
- }, X = !!u && u.selectionMode !== "none", I = k === "body" && (typeof E == "function" || m || X && e !== void 0), w = k === "body" && !(u != null && u.isStatic) && (I || _), V = X && k === "body" && e !== void 0 ? u.isSelected(e) : !1, re = r.useMemo(
471
- () => ({ interactive: w, selected: V }),
472
- [w, V]
464
+ isInteractive: $ = !1,
465
+ isActive: A = !1,
466
+ onClick: x,
467
+ onKeyDown: w,
468
+ role: U,
469
+ tabIndex: j,
470
+ style: S,
471
+ ...Y
472
+ }, Z) => {
473
+ const d = oe(), C = r.useContext(pe), f = r.useContext(le), I = r.useId(), H = T ?? I, [P, k] = r.useState(c), [O, D] = r.useState(!1), z = n ?? P, h = V(i).map((l, W) => !r.isValidElement(l) || !R(l.type, K) ? l : r.cloneElement(l, {
474
+ key: l.key ?? l.props.rowKey ?? W,
475
+ id: l.props.id ?? `${H}-child-${encodeURIComponent(String(l.props.rowKey ?? W))}`
476
+ })), p = C === "body" && h.some(r.isValidElement), L = h.flatMap((l) => r.isValidElement(l) && l.props.id ? [l.props.id] : []), q = (l) => {
477
+ D(l), n === void 0 && k(!z), g == null || g(!z);
478
+ }, E = !!d && d.selectionMode !== "none", N = C === "body" && (typeof x == "function" || p || E && e !== void 0), J = C === "body" && A, X = C === "body" && !(d != null && d.isStatic) && (N || $ || J), _ = E && C === "body" && e !== void 0 ? d.isSelected(e) : !1, F = _ || J, se = r.useMemo(
479
+ () => ({ interactive: X, selected: F }),
480
+ [X, F]
473
481
  );
474
482
  let G = !0;
475
- const Q = u != null && u.hasNestedRows || m || R.depth > 0 ? L(s).map((l, P) => {
476
- if (!G || !r.isValidElement(l) || !z(l.type, Te) && !z(l.type, pe)) return l;
483
+ const Q = d != null && d.hasNestedRows || p || f.depth > 0 ? V(s).map((l, W) => {
484
+ if (!G || !r.isValidElement(l) || !R(l.type, Pe) && !R(l.type, be)) return l;
477
485
  G = !1;
478
- const H = v ?? String(ee(l.props.children)).trim(), Y = k === "header" ? "span" : "div";
479
- return r.cloneElement(l, { key: l.key ?? P }, /* @__PURE__ */ d(
480
- Y,
486
+ const te = y ?? String(ee(l.props.children)).trim(), re = C === "header" ? "span" : "div";
487
+ return r.cloneElement(l, { key: l.key ?? W }, /* @__PURE__ */ u(
488
+ re,
481
489
  {
482
490
  className: "inline-flex items-center gap-2",
483
- style: R.depth > 0 ? { paddingInlineStart: `calc(var(--spacing) * 6 * ${R.depth})` } : void 0,
484
- children: m ? /* @__PURE__ */ $(
485
- We,
491
+ style: f.depth > 0 ? { paddingInlineStart: `calc(var(--spacing) * 6 * ${f.depth})` } : void 0,
492
+ children: p ? /* @__PURE__ */ M(
493
+ Me,
486
494
  {
487
495
  type: "button",
488
496
  variant: "ghost",
489
497
  size: "sm",
490
498
  className: "-mx-2 h-8 shrink-0 border-0 px-2 text-left text-inherit enabled:hover:bg-transparent enabled:hover:text-action-primary-text enabled:active:bg-transparent enabled:active:text-action-primary-text [&>span]:gap-2",
491
499
  style: { fontWeight: "inherit" },
492
- "aria-label": `${C ? "Collapse" : "Expand"} ${H || "row"}`,
493
- "aria-expanded": C,
494
- "aria-controls": f.join(" ") || void 0,
495
- onClick: (Z) => {
496
- Z.stopPropagation(), M(Z.detail === 0);
500
+ "aria-label": `${z ? "Collapse" : "Expand"} ${te || "row"}`,
501
+ "aria-expanded": z,
502
+ "aria-controls": L.join(" ") || void 0,
503
+ onClick: (ne) => {
504
+ ne.stopPropagation(), q(ne.detail === 0);
497
505
  },
498
506
  children: [
499
- /* @__PURE__ */ d(Ae, { reducedMotion: "user", children: /* @__PURE__ */ d(De.span, { initial: !1, animate: { rotate: C ? 90 : 0 }, transition: S ? { duration: 0 } : je, className: "inline-flex size-6 shrink-0 items-center justify-center", children: /* @__PURE__ */ d(Ve, { "aria-hidden": !0 }) }) }),
507
+ /* @__PURE__ */ u(De, { reducedMotion: "user", children: /* @__PURE__ */ u(We.span, { initial: !1, animate: { rotate: z ? 90 : 0 }, transition: O ? { duration: 0 } : je, className: "inline-flex size-6 shrink-0 items-center justify-center", children: /* @__PURE__ */ u($e, { "aria-hidden": !0 }) }) }),
500
508
  l.props.children
501
509
  ]
502
510
  }
503
- ) : /* @__PURE__ */ $(Pe, { children: [
504
- /* @__PURE__ */ d("span", { "aria-hidden": !0, className: "size-6 shrink-0" }),
511
+ ) : /* @__PURE__ */ M(Ae, { children: [
512
+ /* @__PURE__ */ u("span", { "aria-hidden": !0, className: "size-6 shrink-0" }),
505
513
  l.props.children
506
514
  ] })
507
515
  }
508
516
  ));
509
517
  }) : s;
510
- return /* @__PURE__ */ $(ye.Provider, { value: re, children: [
511
- /* @__PURE__ */ $(
518
+ return /* @__PURE__ */ M(we.Provider, { value: se, children: [
519
+ /* @__PURE__ */ M(
512
520
  "tr",
513
521
  {
514
- ref: q,
515
- id: T,
522
+ ref: Z,
523
+ id: H,
516
524
  hidden: o,
517
- "aria-hidden": R.hidden || void 0,
518
- "data-collapsed": R.hidden || void 0,
519
- "data-depth": u != null && u.hasNestedRows ? R.depth : void 0,
520
- "data-interactive": w || void 0,
521
- "data-selected": V || void 0,
522
- className: g(
525
+ "aria-hidden": f.hidden || void 0,
526
+ "data-collapsed": f.hidden || void 0,
527
+ "data-depth": d != null && d.hasNestedRows ? f.depth : void 0,
528
+ "data-interactive": X || void 0,
529
+ "data-selected": _ || void 0,
530
+ "data-active": J || void 0,
531
+ "aria-current": J ? "true" : void 0,
532
+ className: b(
523
533
  "group/row",
524
- k === "body" && "h-16",
534
+ C === "body" && "h-16",
525
535
  // Native table-row collapse removes height while preserving the
526
536
  // intrinsic column widths. `hidden` / display:none would make
527
537
  // every column shift when longer descendants become visible.
528
- R.hidden && "collapse",
529
- I && "cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
538
+ f.hidden && "collapse",
539
+ N && "cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
530
540
  t
531
541
  ),
532
- style: w && V ? {
533
- ...ae,
542
+ style: X ? {
543
+ ...F ? ce : Oe,
534
544
  backgroundPositionX: "var(--table-selection-scroll, 0px)",
535
- ...j
536
- } : j,
545
+ ...S
546
+ } : S,
537
547
  onClick: (l) => {
538
- const P = l.target;
539
- P instanceof Element && P.closest(
548
+ const W = l.target;
549
+ W instanceof Element && W.closest(
540
550
  "a, button, input, select, textarea, [role='button'], [role='link'], [contenteditable='true']"
541
- ) || (E ? E(l) : X && e !== void 0 ? u == null || u.toggleKey(e) : m && M(l.detail === 0));
551
+ ) || (x ? x(l) : E && e !== void 0 ? d == null || d.toggleKey(e) : p && q(l.detail === 0));
542
552
  },
543
553
  onKeyDown: (l) => {
544
- x == null || x(l), !l.defaultPrevented && I && l.target === l.currentTarget && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), l.currentTarget.click());
554
+ w == null || w(l), !l.defaultPrevented && N && l.target === l.currentTarget && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), l.currentTarget.click());
545
555
  },
546
- role: N,
547
- tabIndex: F ?? (I ? 0 : void 0),
548
- ...D,
556
+ role: U,
557
+ tabIndex: j ?? (N ? 0 : void 0),
558
+ ...Y,
549
559
  children: [
550
- X && (k === "header" ? /* @__PURE__ */ $(
560
+ E && (C === "header" ? /* @__PURE__ */ M(
551
561
  "th",
552
562
  {
553
563
  scope: "col",
554
- className: g(
564
+ className: b(
555
565
  "w-10 border-b border-table-stroke px-4 py-2.5",
556
- Ce,
566
+ Re,
557
567
  // Sticky without the baked shadow — an always-on smudge
558
568
  // muddies the shell's corners (elevation = actionability).
559
569
  // (sticky is positioned, so the ::after tick anchors to it —
560
570
  // no `relative` needed, and it would conflict with sticky.)
561
571
  "sticky left-0 z-10",
562
- Ne
572
+ ke
563
573
  ),
564
574
  children: [
565
- /* @__PURE__ */ d("span", { className: "sr-only", children: "Row selection" }),
566
- u.selectionMode === "multiple" && /* @__PURE__ */ d(
567
- be,
575
+ /* @__PURE__ */ u("span", { className: "sr-only", children: "Row selection" }),
576
+ d.selectionMode === "multiple" && /* @__PURE__ */ u(
577
+ ge,
568
578
  {
569
579
  size: "sm",
570
580
  "aria-label": "Select all rows",
571
- checked: u.allSelected,
572
- indeterminate: u.someSelected,
573
- onChange: u.toggleAll
581
+ checked: d.allSelected,
582
+ indeterminate: d.someSelected,
583
+ onChange: d.toggleAll
574
584
  }
575
585
  )
576
586
  ]
577
587
  }
578
- ) : /* @__PURE__ */ d(
588
+ ) : /* @__PURE__ */ u(
579
589
  "td",
580
590
  {
581
- className: g(
591
+ className: b(
582
592
  "h-16 w-10 px-4 py-2",
583
- xe(w),
593
+ Ce(X, { sticky: "left", selected: F }),
584
594
  "sticky left-0 z-10"
585
595
  ),
586
- style: w && V ? {
587
- ...ae,
596
+ style: X && F ? {
597
+ ...ce,
588
598
  backgroundPositionX: "left"
589
599
  } : void 0,
590
600
  onClick: (l) => l.stopPropagation(),
591
- children: e !== void 0 && (u.selectionMode === "single" ? /* @__PURE__ */ d(
592
- Me,
601
+ children: e !== void 0 && (d.selectionMode === "single" ? /* @__PURE__ */ u(
602
+ Ve,
593
603
  {
594
- name: u.selectionName,
604
+ name: d.selectionName,
595
605
  value: e,
596
606
  "aria-label": `Select ${e}`,
597
- checked: V,
598
- onChange: () => u.toggleKey(e)
607
+ checked: _,
608
+ onChange: () => d.toggleKey(e)
599
609
  }
600
- ) : /* @__PURE__ */ d(
601
- be,
610
+ ) : /* @__PURE__ */ u(
611
+ ge,
602
612
  {
603
613
  size: "sm",
604
614
  "aria-label": `Select ${e}`,
605
- checked: V,
606
- indeterminate: u.isIndeterminate(e),
607
- onChange: () => u.toggleKey(e)
615
+ checked: _,
616
+ indeterminate: d.isIndeterminate(e),
617
+ onChange: () => d.toggleKey(e),
618
+ className: b(
619
+ "transition-opacity duration-150 ease-out motion-reduce:transition-none",
620
+ _ || d.isIndeterminate(e) ? "opacity-100" : "opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100"
621
+ )
608
622
  }
609
623
  ))
610
624
  }
@@ -613,12 +627,12 @@ const K = r.forwardRef(
613
627
  ]
614
628
  }
615
629
  ),
616
- m && /* @__PURE__ */ d(se.Provider, { value: { depth: R.depth + 1, hidden: R.hidden || !C || !!o }, children: O })
630
+ p && /* @__PURE__ */ u(le.Provider, { value: { depth: f.depth + 1, hidden: f.hidden || !z || !!o }, children: h })
617
631
  ] });
618
632
  }
619
633
  );
620
634
  K.displayName = "TableRow";
621
- const pe = r.forwardRef(
635
+ const be = r.forwardRef(
622
636
  ({
623
637
  className: t,
624
638
  align: e,
@@ -626,66 +640,66 @@ const pe = r.forwardRef(
626
640
  sortKey: i,
627
641
  allowsSorting: n = !0,
628
642
  _sortColumnIndex: c,
629
- children: b,
630
- ...v
631
- }, A) => {
632
- var B, C, O;
633
- const o = te(), E = (o != null && o.automaticSorting && c !== void 0 ? `${ie}${c}` : void 0) ?? i, x = Number(v.colSpan ?? 1) === 1, N = String(ee(b)).trim(), F = N.length > 0, j = n && x && s !== "right" && F && !!E && !!(o != null && o.requestSort), D = j && ((B = o == null ? void 0 : o.sortDescriptor) == null ? void 0 : B.column) === E, q = (C = o == null ? void 0 : o.sortDescriptor) == null ? void 0 : C.direction, u = !!(o != null && o.resizableColumns) && x && s !== "right", k = r.useRef(null), [R, y] = r.useState(!1), T = (m) => {
634
- if (m.button !== 0 || !o) return;
635
- const f = m.currentTarget.parentElement, M = f == null ? void 0 : f.parentElement;
636
- if (!(!f || !M)) {
637
- o.snapshotColumnWidths(M), k.current = {
638
- index: f.cellIndex,
639
- startX: m.clientX,
640
- startWidth: f.getBoundingClientRect().width
641
- }, y(!0);
643
+ children: g,
644
+ ...y
645
+ }, T) => {
646
+ var O, D, z;
647
+ const o = oe(), A = (o != null && o.automaticSorting && c !== void 0 ? `${de}${c}` : void 0) ?? i, x = Number(y.colSpan ?? 1) === 1, w = String(ee(g)).trim(), U = w.length > 0, j = n && x && s !== "right" && U && !!A && !!(o != null && o.requestSort), S = j && ((O = o == null ? void 0 : o.sortDescriptor) == null ? void 0 : O.column) === A, Y = (D = o == null ? void 0 : o.sortDescriptor) == null ? void 0 : D.direction, Z = !!(o != null && o.resizableColumns) && x && s !== "right", d = r.useRef(null), [C, f] = r.useState(!1), I = (h) => {
648
+ if (h.button !== 0 || !o) return;
649
+ const p = h.currentTarget.parentElement, L = p == null ? void 0 : p.parentElement;
650
+ if (!(!p || !L)) {
651
+ o.snapshotColumnWidths(L), d.current = {
652
+ index: p.cellIndex,
653
+ startX: h.clientX,
654
+ startWidth: p.getBoundingClientRect().width
655
+ }, f(!0);
642
656
  try {
643
- m.currentTarget.setPointerCapture(m.pointerId);
657
+ h.currentTarget.setPointerCapture(h.pointerId);
644
658
  } catch {
645
659
  }
646
- m.preventDefault();
660
+ h.preventDefault();
647
661
  }
648
- }, J = (m) => {
649
- const f = k.current;
650
- !f || !o || o.setColumnWidth(
651
- f.index,
652
- f.startWidth + (m.clientX - f.startX)
662
+ }, H = (h) => {
663
+ const p = d.current;
664
+ !p || !o || o.setColumnWidth(
665
+ p.index,
666
+ p.startWidth + (h.clientX - p.startX)
653
667
  );
654
- }, W = () => {
655
- k.current = null, y(!1);
656
- }, S = (m) => {
657
- if (m.key !== "ArrowLeft" && m.key !== "ArrowRight" || !o) return;
658
- m.preventDefault();
659
- const f = m.currentTarget.parentElement, M = f == null ? void 0 : f.parentElement;
660
- if (!f || !M) return;
661
- o.snapshotColumnWidths(M);
662
- const X = m.shiftKey ? 32 : 8, I = m.key === "ArrowRight" ? X : -X;
668
+ }, P = () => {
669
+ d.current = null, f(!1);
670
+ }, k = (h) => {
671
+ if (h.key !== "ArrowLeft" && h.key !== "ArrowRight" || !o) return;
672
+ h.preventDefault();
673
+ const p = h.currentTarget.parentElement, L = p == null ? void 0 : p.parentElement;
674
+ if (!p || !L) return;
675
+ o.snapshotColumnWidths(L);
676
+ const q = h.shiftKey ? 32 : 8, E = h.key === "ArrowRight" ? q : -q;
663
677
  o.setColumnWidth(
664
- f.cellIndex,
665
- f.getBoundingClientRect().width + I
678
+ p.cellIndex,
679
+ p.getBoundingClientRect().width + E
666
680
  );
667
681
  };
668
- return /* @__PURE__ */ $(
682
+ return /* @__PURE__ */ M(
669
683
  "th",
670
684
  {
671
- ref: A,
685
+ ref: T,
672
686
  scope: "col",
673
- "aria-sort": D ? q === "ascending" ? "ascending" : "descending" : j ? "none" : void 0,
674
- className: g(
687
+ "aria-sort": S ? Y === "ascending" ? "ascending" : "descending" : j ? "none" : void 0,
688
+ className: b(
675
689
  // whitespace-nowrap: header labels hug their content — the table
676
690
  // scrolls horizontally, so wrapping "Null %" to two lines only
677
691
  // wastes header height without saving any width.
678
692
  "relative whitespace-nowrap border-b border-table-stroke px-4 py-2.5 text-s font-medium text-table-header-foreground",
679
- Ne,
680
- Ce,
693
+ ke,
694
+ Re,
681
695
  // The resize handle carries its own tick visual, so drop the
682
696
  // decorative one; the last column never shows a handle.
683
- u && "after:hidden [&:last-child>[data-slot=resize-handle]]:hidden",
697
+ Z && "after:hidden [&:last-child>[data-slot=resize-handle]]:hidden",
684
698
  // Capped-height tables scroll under the header: pin it to the
685
699
  // viewport top, painted like the table surface so rows pass beneath.
686
700
  (o == null ? void 0 : o.stickyHeader) && "sticky top-0 z-30",
687
- ge(e),
688
- s && (s === "right" && (o != null && o.elevatedActionColumn) ? g(
701
+ ve(e),
702
+ s && (s === "right" && (o != null && o.elevatedActionColumn) ? b(
689
703
  // Preserve the semantic column width, but do not pin or paint
690
704
  // a blank header cell over the labels behind it. Only body
691
705
  // action cells participate in the sticky elevated surface.
@@ -694,57 +708,57 @@ const pe = r.forwardRef(
694
708
  "max-w-[var(--table-action-column-width)]",
695
709
  "px-2",
696
710
  "bg-transparent"
697
- ) : ve(s)),
711
+ ) : ye(s)),
698
712
  t
699
713
  ),
700
- ...v,
714
+ ...y,
701
715
  children: [
702
- j ? /* @__PURE__ */ $(
716
+ j ? /* @__PURE__ */ M(
703
717
  "button",
704
718
  {
705
719
  type: "button",
706
- onClick: () => o.requestSort(E),
707
- className: g(
720
+ onClick: () => o.requestSort(A),
721
+ className: b(
708
722
  "group/sort -mx-1 inline-flex items-center gap-1 rounded px-1 outline-none transition-colors",
709
723
  "hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
710
724
  e === "right" && "flex-row-reverse",
711
- D && "font-medium"
725
+ S && "font-medium"
712
726
  ),
713
727
  children: [
714
- b,
715
- D ? q === "ascending" ? /* @__PURE__ */ d($e, { className: "size-3.5" }) : /* @__PURE__ */ d(Le, { className: "size-3.5" }) : /* @__PURE__ */ d(_e, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
728
+ g,
729
+ S ? Y === "ascending" ? /* @__PURE__ */ u(Le, { className: "size-3.5" }) : /* @__PURE__ */ u(_e, { className: "size-3.5" }) : /* @__PURE__ */ u(Fe, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
716
730
  ]
717
731
  }
718
- ) : F ? b : /* @__PURE__ */ d("span", { className: "sr-only", children: v["aria-label"] ?? "Table column" }),
719
- u && /* @__PURE__ */ d(
732
+ ) : U ? g : /* @__PURE__ */ u("span", { className: "sr-only", children: y["aria-label"] ?? "Table column" }),
733
+ Z && /* @__PURE__ */ u(
720
734
  "span",
721
735
  {
722
736
  "data-slot": "resize-handle",
723
737
  role: "separator",
724
738
  "aria-orientation": "vertical",
725
- "aria-label": `Resize ${N || "this"} column`,
726
- "aria-valuemin": le,
739
+ "aria-label": `Resize ${w || "this"} column`,
740
+ "aria-valuemin": ue,
727
741
  "aria-valuemax": 2e3,
728
- "aria-valuenow": ((O = o == null ? void 0 : o.columnWidths) == null ? void 0 : O[c ?? -1]) ?? le,
742
+ "aria-valuenow": ((z = o == null ? void 0 : o.columnWidths) == null ? void 0 : z[c ?? -1]) ?? ue,
729
743
  tabIndex: 0,
730
- "data-resizing": R ? "true" : void 0,
731
- onPointerDown: T,
732
- onPointerMove: J,
733
- onPointerUp: W,
734
- onPointerCancel: W,
735
- onKeyDown: S,
744
+ "data-resizing": C ? "true" : void 0,
745
+ onPointerDown: I,
746
+ onPointerMove: H,
747
+ onPointerUp: P,
748
+ onPointerCancel: P,
749
+ onKeyDown: k,
736
750
  onDoubleClick: () => o == null ? void 0 : o.resetColumnWidths(),
737
- className: g(
751
+ className: b(
738
752
  // 12px hit area straddling the column edge; the 1px tick inside
739
753
  // is the visible affordance (it replaces the decorative one).
740
754
  "group/resize absolute -right-1.5 top-0 z-10 flex h-full w-3 cursor-col-resize touch-none select-none items-center justify-center rounded-sm outline-none",
741
755
  "focus-visible:ring-2 focus-visible:ring-ring"
742
756
  ),
743
- children: /* @__PURE__ */ d(
757
+ children: /* @__PURE__ */ u(
744
758
  "span",
745
759
  {
746
760
  "aria-hidden": "true",
747
- className: g(
761
+ className: b(
748
762
  "h-4 w-px rounded-sm bg-border-strong",
749
763
  "transition-[transform,background-color] duration-150 ease-out motion-reduce:transition-none",
750
764
  "group-hover/resize:scale-y-125 group-hover/resize:bg-foreground/60",
@@ -760,21 +774,21 @@ const pe = r.forwardRef(
760
774
  );
761
775
  }
762
776
  );
763
- pe.displayName = "TableColumn";
764
- const Te = r.forwardRef(
765
- ({ className: t, align: e, sticky: s, sortValue: i, style: n, ...c }, b) => {
766
- const v = te(), { interactive: A, selected: o } = r.useContext(ye), _ = s === "right" && (v == null ? void 0 : v.elevatedActionColumn);
767
- return /* @__PURE__ */ d(
777
+ be.displayName = "TableColumn";
778
+ const Pe = r.forwardRef(
779
+ ({ className: t, align: e, sticky: s, sortValue: i, style: n, ...c }, g) => {
780
+ const y = oe(), { interactive: T, selected: o } = r.useContext(we), $ = s === "right" && (y == null ? void 0 : y.elevatedActionColumn);
781
+ return /* @__PURE__ */ u(
768
782
  "td",
769
783
  {
770
- ref: b,
784
+ ref: g,
771
785
  "data-sort-value": i instanceof Date ? i.toISOString() : i,
772
- style: A && o && s ? {
773
- ...ae,
786
+ style: T && o && s ? {
787
+ ...ce,
774
788
  backgroundPositionX: s,
775
789
  ...n
776
790
  } : n,
777
- className: g(
791
+ className: b(
778
792
  // whitespace-nowrap: cell content never wraps — the table's
779
793
  // overflow-x-auto viewport scrolls horizontally instead, matching the
780
794
  // header cells. Opt back into wrapping with `whitespace-normal` for
@@ -782,10 +796,10 @@ const Te = r.forwardRef(
782
796
  // Cell values own the ADS 14px body-text contract instead of relying
783
797
  // on inheritance from <Table>; nested content stays 14px by default.
784
798
  "h-16 whitespace-nowrap px-4 py-2 text-m",
785
- xe(A),
786
- ge(e),
787
- s && ve(s, v == null ? void 0 : v.elevatedActionColumn),
788
- _ && g(
799
+ Ce(T, { sticky: s, selected: o }),
800
+ ve(e),
801
+ s && ye(s, y == null ? void 0 : y.elevatedActionColumn),
802
+ $ && b(
789
803
  "w-[var(--table-action-column-width)]",
790
804
  "min-w-[var(--table-action-column-width)]",
791
805
  "max-w-[var(--table-action-column-width)]",
@@ -800,12 +814,12 @@ const Te = r.forwardRef(
800
814
  );
801
815
  }
802
816
  );
803
- Te.displayName = "TableCell";
817
+ Pe.displayName = "TableCell";
804
818
  export {
805
- de as Table,
806
- Ee as TableBody,
807
- Te as TableCell,
808
- pe as TableColumn,
809
- ue as TableHeader,
819
+ fe as Table,
820
+ Ie as TableBody,
821
+ Pe as TableCell,
822
+ be as TableColumn,
823
+ me as TableHeader,
810
824
  K as TableRow
811
825
  };