@actioneer/ads 1.0.7 → 1.0.8

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 (71) hide show
  1. package/DESIGN.md +80 -86
  2. package/README.md +6 -0
  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-trigger-popover.js +1 -1
  14. package/components/assistant-ui/composer.js +13 -13
  15. package/components/assistant-ui/message-timing.js +6 -6
  16. package/components/assistant-ui/selection-toolbar.js +5 -5
  17. package/components/assistant-ui/sources.js +15 -15
  18. package/components/assistant-ui/tooltip-icon-button.js +18 -14
  19. package/components/audio-waveform.d.ts +21 -8
  20. package/components/audio-waveform.js +371 -94
  21. package/components/autocomplete.js +9 -9
  22. package/components/breadcrumbs.js +32 -38
  23. package/components/button.js +83 -73
  24. package/components/card.js +1 -1
  25. package/components/chart.js +732 -673
  26. package/components/chip.js +37 -35
  27. package/components/command-palette.js +12 -12
  28. package/components/connector-card.d.ts +1 -2
  29. package/components/connector-card.js +17 -17
  30. package/components/date-range-picker.js +1 -2
  31. package/components/drawer.js +9 -10
  32. package/components/dropdown.js +1 -1
  33. package/components/empty-state.d.ts +2 -0
  34. package/components/empty-state.js +17 -15
  35. package/components/field.js +9 -10
  36. package/components/file-dropzone.d.ts +6 -3
  37. package/components/file-dropzone.js +72 -60
  38. package/components/infinite-canvas.js +9 -9
  39. package/components/modal.js +1 -1
  40. package/components/page-body.js +8 -8
  41. package/components/popover.js +11 -11
  42. package/components/progress-circle.d.ts +1 -1
  43. package/components/progress-circle.js +57 -48
  44. package/components/segmented.d.ts +1 -0
  45. package/components/segmented.js +34 -36
  46. package/components/select.js +2 -2
  47. package/components/selection-action-bar.js +32 -31
  48. package/components/setting-row.js +10 -10
  49. package/components/slider.js +5 -5
  50. package/components/stepper.d.ts +1 -1
  51. package/components/stepper.js +1 -1
  52. package/components/switch.js +10 -10
  53. package/components/table.d.ts +2 -2
  54. package/components/table.js +177 -170
  55. package/components/tabs.js +41 -35
  56. package/components/timeline.js +3 -3
  57. package/components/toast.js +53 -56
  58. package/components/ui/button.js +4 -4
  59. package/components/ui/dialog.js +1 -1
  60. package/components/viz-charts.js +263 -221
  61. package/examples/README.md +30 -0
  62. package/examples/agents-screen.tsx +477 -0
  63. package/examples/settings-screen.tsx +90 -0
  64. package/examples/workspace-header.tsx +71 -0
  65. package/lib/icons.d.ts +8 -0
  66. package/lib/icons.js +171 -118
  67. package/llms.txt +14 -14
  68. package/manifest.json +77 -48
  69. package/package.json +1 -1
  70. package/styles.css +55 -68
  71. package/theme.css +50 -59
@@ -1,45 +1,52 @@
1
1
  "use client";
2
- import { jsx as d, jsxs as $, Fragment as Pe } from "react/jsx-runtime";
2
+ import { jsx as d, jsxs as $, 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";
4
+ import { MotionConfig as De, motion as We } from "motion/react";
5
+ import { cn as h } from "../lib/cn.js";
6
+ import { Button as Me } from "./button.js";
7
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";
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 he = (t) => t === "center" ? "text-center" : t === "right" ? "text-right" : "text-left", ve = (t, e = !1) => t === "left" ? h(
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" ? h(
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, ye = r.createContext({ interactive: !1, selected: !1 }), we = { depth: 0, hidden: !1 }, se = r.createContext(we), xe = (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
+ }), ae = xe("var(--table-row-selected)"), Oe = xe("var(--table-row-hover)"), Ne = (t, { sticky: e, selected: s = !1 } = {}) => h(
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 && h(
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"
45
+ ), Ce = "bg-table-shell", ke = h(
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
+ ), ie = "__ads_table_column_", le = 64, Xe = new Intl.Collator(void 0, {
43
50
  numeric: !0,
44
51
  sensitivity: "base"
45
52
  });
@@ -56,10 +63,10 @@ function L(t) {
56
63
  function z(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 Re(t) {
67
+ return L(t).some((e) => !r.isValidElement(e) || z(e.type, de) ? !1 : z(e.type, K) && L(e.props.childRows).some(r.isValidElement) || Re(e.props.children));
61
68
  }
62
- function Xe(t) {
69
+ function Be(t) {
63
70
  const e = /* @__PURE__ */ new Map(), s = (i) => L(i).flatMap((n) => {
64
71
  if (!r.isValidElement(n)) return [];
65
72
  if (z(n.type, de) || z(n.type, ue)) return [];
@@ -99,7 +106,7 @@ function ee(t) {
99
106
  }
100
107
  return "";
101
108
  }
102
- function he(t) {
109
+ function ge(t) {
103
110
  if (t instanceof Date)
104
111
  return { kind: "number", value: t.getTime() };
105
112
  if (typeof t == "number")
@@ -113,15 +120,15 @@ 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) {
117
- const i = he(t), n = he(e);
123
+ function Ue(t, e, s) {
124
+ const i = ge(t), n = ge(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) {
130
+ const Se = r.createContext(null), te = () => r.useContext(Se), ce = r.createContext("body");
131
+ function He(t) {
125
132
  const e = [], i = L(t.props.children).map((n, c) => {
126
133
  if (!r.isValidElement(n) || !z(n.type, K))
127
134
  return n;
@@ -142,7 +149,7 @@ function Ue(t) {
142
149
  });
143
150
  return r.cloneElement(t, void 0, i);
144
151
  }
145
- function Se(t, e, s = "ascending") {
152
+ function ze(t, e, s = "ascending") {
146
153
  const i = L(t).map((n, c) => {
147
154
  if (!r.isValidElement(n) || !z(n.type, K))
148
155
  return { row: n, index: c, value: "" };
@@ -150,24 +157,24 @@ function Se(t, e, s = "ascending") {
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: ze(n.props.childRows, e, s) } : {}
154
161
  }),
155
162
  index: c,
156
163
  value: e === void 0 ? "" : ee(b[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, ze(t.props.children, e, s));
163
170
  }
164
- function ze(t, e) {
171
+ function Ee(t, e) {
165
172
  const s = e != null && e.column.startsWith(ie) ? Number(e.column.slice(ie.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
+ Ee(i.props.children, e)
177
+ ) : z(i.type, ue) ? He(i) : z(i.type, Te) ? qe(i, Number.isInteger(s) && s >= 0 ? s : void 0, e == null ? void 0 : e.direction) : i : i);
171
178
  }
172
179
  const de = r.forwardRef(
173
180
  ({
@@ -185,57 +192,57 @@ const de = r.forwardRef(
185
192
  sortDescriptor: E,
186
193
  onSortChange: x,
187
194
  allowsSorting: N = !0,
188
- isStatic: F = !1,
189
- resizableColumns: j = !0,
195
+ isStatic: U = !1,
196
+ resizableColumns: F = !0,
190
197
  maxBodyHeight: D,
191
198
  ...q
192
199
  }, 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(() => {
200
+ const k = r.useId(), R = r.useMemo(() => Re(n), [n]), y = r.useMemo(() => Be(n), [n]), T = r.useMemo(() => A ?? [], [A]), J = b === "all", W = r.useMemo(() => {
194
201
  const a = new Set(b === "all" ? [...T, ...y.keys] : b);
195
202
  if (c !== "multiple") return a;
196
203
  for (const p of [...a])
197
- for (const h of y.descendants.get(p) ?? []) a.add(h);
204
+ for (const g of y.descendants.get(p) ?? []) a.add(g);
198
205
  return oe(a, y.descendants);
199
206
  }, [b, c, T, y]), S = r.useCallback(
200
207
  (a) => J || W.has(a),
201
208
  [J, W]
202
- ), B = r.useCallback(
209
+ ), X = r.useCallback(
203
210
  (a) => {
204
211
  var p;
205
- return c === "multiple" && !S(a) && (((p = y.descendants.get(a)) == null ? void 0 : p.some((h) => W.has(h))) ?? !1);
212
+ return c === "multiple" && !S(a) && (((p = y.descendants.get(a)) == null ? void 0 : p.some((g) => W.has(g))) ?? !1);
206
213
  },
207
214
  [c, S, y, W]
208
- ), C = T.length > 0 && T.every(S), O = !C && T.some((a) => S(a) || B(a)), m = r.useCallback(
215
+ ), C = T.length > 0 && T.every(S), j = !C && T.some((a) => S(a) || X(a)), f = r.useCallback(
209
216
  (a) => {
210
217
  if (!v) return;
211
218
  if (c === "single") {
212
219
  S(a) || v(/* @__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);
222
+ const p = new Set(W), g = !S(a);
223
+ for (const B of [a, ...y.descendants.get(a) ?? []])
224
+ g ? p.add(B) : p.delete(B);
218
225
  v(oe(p, y.descendants));
219
226
  },
220
227
  [v, c, S, W, y]
221
- ), f = r.useCallback(() => {
228
+ ), m = r.useCallback(() => {
222
229
  if (!v) return;
223
230
  const a = /* @__PURE__ */ new Set();
224
231
  if (!C)
225
232
  for (const p of T) {
226
233
  a.add(p);
227
- for (const h of y.descendants.get(p) ?? []) a.add(h);
234
+ for (const g of y.descendants.get(p) ?? []) a.add(g);
228
235
  }
229
236
  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(
237
+ }, [v, C, T, y]), [V, O] = r.useState(), I = N && !x, w = I ? V ?? E : E, M = r.useCallback(
231
238
  (a) => {
232
239
  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);
240
+ const p = (w == null ? void 0 : w.column) === a && w.direction === "ascending" ? "descending" : "ascending", g = { column: a, direction: p };
241
+ x ? x(g) : O(g);
235
242
  },
236
243
  [w, N, x]
237
244
  ), re = r.useMemo(
238
- () => I ? ze(n, w) : n,
245
+ () => I ? Ee(n, w) : n,
239
246
  [w, I, n]
240
247
  ), G = r.useRef(null), [Q, l] = r.useState({
241
248
  left: !1,
@@ -244,9 +251,9 @@ const de = r.forwardRef(
244
251
  const a = G.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;
254
+ const p = a.scrollWidth - a.clientWidth, g = a.scrollLeft > 1, B = a.scrollLeft < p - 1;
248
255
  l(
249
- (ne) => ne.left === h && ne.right === U ? ne : { left: h, right: U }
256
+ (ne) => ne.left === g && ne.right === B ? ne : { left: g, right: B }
250
257
  );
251
258
  }, []);
252
259
  r.useLayoutEffect(() => {
@@ -255,8 +262,8 @@ const de = r.forwardRef(
255
262
  if (!a || typeof ResizeObserver > "u") return;
256
263
  const p = new ResizeObserver(P);
257
264
  p.observe(a);
258
- const h = a.querySelector("table");
259
- return h && p.observe(h), () => p.disconnect();
265
+ const g = a.querySelector("table");
266
+ return g && p.observe(g), () => p.disconnect();
260
267
  }, [P]);
261
268
  const [H, Y] = r.useState(
262
269
  null
@@ -265,41 +272,41 @@ const de = r.forwardRef(
265
272
  Y(
266
273
  (p) => p ?? Array.from(
267
274
  a.cells,
268
- (h) => h.getBoundingClientRect().width
275
+ (g) => g.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
+ ), fe = r.useCallback((a, p) => {
281
+ Y((g) => {
282
+ if (!g) return g;
283
+ const B = [...g];
284
+ return B[a] = Math.max(le, p), B;
278
285
  });
279
- }, []), fe = r.useCallback(
286
+ }, []), me = r.useCallback(
280
287
  () => Y(null),
281
288
  []
282
- ), Ie = r.useMemo(
289
+ ), Pe = r.useMemo(
283
290
  () => ({
284
291
  selectionMode: c,
285
292
  selectionName: k,
286
293
  hasNestedRows: R,
287
294
  isSelected: S,
288
- isIndeterminate: B,
289
- toggleKey: m,
290
- toggleAll: f,
295
+ isIndeterminate: X,
296
+ toggleKey: f,
297
+ toggleAll: m,
291
298
  allSelected: C,
292
- someSelected: O,
293
- isStatic: F,
299
+ someSelected: j,
300
+ isStatic: U,
294
301
  sortDescriptor: w,
295
- requestSort: N ? V : void 0,
302
+ requestSort: N ? M : void 0,
296
303
  automaticSorting: I,
297
304
  elevatedActionColumn: o,
298
- resizableColumns: j,
305
+ resizableColumns: F,
299
306
  columnWidths: H,
300
307
  snapshotColumnWidths: Z,
301
- setColumnWidth: me,
302
- resetColumnWidths: fe,
308
+ setColumnWidth: fe,
309
+ resetColumnWidths: me,
303
310
  stickyHeader: D != null
304
311
  }),
305
312
  [
@@ -307,32 +314,32 @@ const de = r.forwardRef(
307
314
  k,
308
315
  R,
309
316
  S,
310
- B,
311
- m,
317
+ X,
312
318
  f,
319
+ m,
313
320
  C,
314
- O,
315
- F,
321
+ j,
322
+ U,
316
323
  w,
317
324
  N,
318
325
  I,
319
- V,
326
+ M,
320
327
  o,
321
- j,
328
+ F,
322
329
  H,
323
330
  Z,
324
- me,
325
331
  fe,
332
+ me,
326
333
  D
327
334
  ]
328
335
  );
329
- return /* @__PURE__ */ d(Re.Provider, { value: Ie, children: /* @__PURE__ */ d(se.Provider, { value: we, children: /* @__PURE__ */ $(
336
+ return /* @__PURE__ */ d(Se.Provider, { value: Pe, children: /* @__PURE__ */ d(se.Provider, { value: we, children: /* @__PURE__ */ $(
330
337
  "div",
331
338
  {
332
339
  "data-slot": "table-container",
333
340
  "data-scroll-left": Q.left ? "true" : "false",
334
341
  "data-scroll-right": Q.right ? "true" : "false",
335
- className: g(
342
+ className: h(
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
@@ -359,7 +366,7 @@ const de = r.forwardRef(
359
366
  {
360
367
  ref: G,
361
368
  onScroll: P,
362
- className: g(
369
+ className: h(
363
370
  "overflow-x-auto rounded-(--table-card-radius)",
364
371
  D != null && "overflow-y-auto"
365
372
  ),
@@ -369,7 +376,7 @@ const de = r.forwardRef(
369
376
  {
370
377
  ref: u,
371
378
  "data-slot": "table",
372
- className: g(
379
+ className: h(
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.
@@ -390,7 +397,7 @@ const de = r.forwardRef(
390
397
  {
391
398
  "aria-hidden": "true",
392
399
  "data-slot": "table-scroll-hint",
393
- className: g(
400
+ className: h(
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",
@@ -404,7 +411,7 @@ const de = r.forwardRef(
404
411
  {
405
412
  "aria-hidden": "true",
406
413
  "data-slot": "table-action-column-elevation",
407
- className: g(
414
+ className: h(
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
@@ -430,7 +437,7 @@ const ue = r.forwardRef(({ className: t, ...e }, s) => {
430
437
  "thead",
431
438
  {
432
439
  ref: s,
433
- className: g(
440
+ className: h(
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
@@ -440,8 +447,8 @@ const ue = r.forwardRef(({ className: t, ...e }, s) => {
440
447
  ) });
441
448
  });
442
449
  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";
450
+ const Te = r.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ d(ce.Provider, { value: "body", children: /* @__PURE__ */ d("tbody", { ref: s, className: h("[&>tr:not([hidden],[data-collapsed]):not(:has(~tr:not([hidden],[data-collapsed])))>td]:border-b-0", t), ...e }) }));
451
+ Te.displayName = "TableBody";
445
452
  const K = r.forwardRef(
446
453
  ({
447
454
  className: t,
@@ -458,22 +465,22 @@ const K = r.forwardRef(
458
465
  onClick: E,
459
466
  onKeyDown: x,
460
467
  role: N,
461
- tabIndex: F,
462
- style: j,
468
+ tabIndex: U,
469
+ style: F,
463
470
  ...D
464
471
  }, 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, {
472
+ const u = te(), k = r.useContext(ce), R = r.useContext(se), y = r.useId(), T = A ?? y, [J, W] = r.useState(c), [S, X] = r.useState(!1), C = n ?? J, j = L(i).map((l, P) => !r.isValidElement(l) || !z(l.type, K) ? l : r.cloneElement(l, {
466
473
  key: l.key ?? l.props.rowKey ?? P,
467
474
  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]
475
+ })), f = k === "body" && j.some(r.isValidElement), m = j.flatMap((l) => r.isValidElement(l) && l.props.id ? [l.props.id] : []), V = (l) => {
476
+ X(l), n === void 0 && W(!C), b == null || b(!C);
477
+ }, O = !!u && u.selectionMode !== "none", I = k === "body" && (typeof E == "function" || f || O && e !== void 0), w = k === "body" && !(u != null && u.isStatic) && (I || _), M = O && k === "body" && e !== void 0 ? u.isSelected(e) : !1, re = r.useMemo(
478
+ () => ({ interactive: w, selected: M }),
479
+ [w, M]
473
480
  );
474
481
  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;
482
+ const Q = u != null && u.hasNestedRows || f || R.depth > 0 ? L(s).map((l, P) => {
483
+ if (!G || !r.isValidElement(l) || !z(l.type, Ie) && !z(l.type, pe)) return l;
477
484
  G = !1;
478
485
  const H = v ?? String(ee(l.props.children)).trim(), Y = k === "header" ? "span" : "div";
479
486
  return r.cloneElement(l, { key: l.key ?? P }, /* @__PURE__ */ d(
@@ -481,8 +488,8 @@ const K = r.forwardRef(
481
488
  {
482
489
  className: "inline-flex items-center gap-2",
483
490
  style: R.depth > 0 ? { paddingInlineStart: `calc(var(--spacing) * 6 * ${R.depth})` } : void 0,
484
- children: m ? /* @__PURE__ */ $(
485
- We,
491
+ children: f ? /* @__PURE__ */ $(
492
+ Me,
486
493
  {
487
494
  type: "button",
488
495
  variant: "ghost",
@@ -491,16 +498,16 @@ const K = r.forwardRef(
491
498
  style: { fontWeight: "inherit" },
492
499
  "aria-label": `${C ? "Collapse" : "Expand"} ${H || "row"}`,
493
500
  "aria-expanded": C,
494
- "aria-controls": f.join(" ") || void 0,
501
+ "aria-controls": m.join(" ") || void 0,
495
502
  onClick: (Z) => {
496
- Z.stopPropagation(), M(Z.detail === 0);
503
+ Z.stopPropagation(), V(Z.detail === 0);
497
504
  },
498
505
  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 }) }) }),
506
+ /* @__PURE__ */ d(De, { reducedMotion: "user", children: /* @__PURE__ */ d(We.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($e, { "aria-hidden": !0 }) }) }),
500
507
  l.props.children
501
508
  ]
502
509
  }
503
- ) : /* @__PURE__ */ $(Pe, { children: [
510
+ ) : /* @__PURE__ */ $(Ae, { children: [
504
511
  /* @__PURE__ */ d("span", { "aria-hidden": !0, className: "size-6 shrink-0" }),
505
512
  l.props.children
506
513
  ] })
@@ -518,8 +525,8 @@ const K = r.forwardRef(
518
525
  "data-collapsed": R.hidden || void 0,
519
526
  "data-depth": u != null && u.hasNestedRows ? R.depth : void 0,
520
527
  "data-interactive": w || void 0,
521
- "data-selected": V || void 0,
522
- className: g(
528
+ "data-selected": M || void 0,
529
+ className: h(
523
530
  "group/row",
524
531
  k === "body" && "h-16",
525
532
  // Native table-row collapse removes height while preserving the
@@ -529,37 +536,37 @@ const K = r.forwardRef(
529
536
  I && "cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
530
537
  t
531
538
  ),
532
- style: w && V ? {
533
- ...ae,
539
+ style: w ? {
540
+ ...M ? ae : Oe,
534
541
  backgroundPositionX: "var(--table-selection-scroll, 0px)",
535
- ...j
536
- } : j,
542
+ ...F
543
+ } : F,
537
544
  onClick: (l) => {
538
545
  const P = l.target;
539
546
  P instanceof Element && P.closest(
540
547
  "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));
548
+ ) || (E ? E(l) : O && e !== void 0 ? u == null || u.toggleKey(e) : f && V(l.detail === 0));
542
549
  },
543
550
  onKeyDown: (l) => {
544
551
  x == null || x(l), !l.defaultPrevented && I && l.target === l.currentTarget && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), l.currentTarget.click());
545
552
  },
546
553
  role: N,
547
- tabIndex: F ?? (I ? 0 : void 0),
554
+ tabIndex: U ?? (I ? 0 : void 0),
548
555
  ...D,
549
556
  children: [
550
- X && (k === "header" ? /* @__PURE__ */ $(
557
+ O && (k === "header" ? /* @__PURE__ */ $(
551
558
  "th",
552
559
  {
553
560
  scope: "col",
554
- className: g(
561
+ className: h(
555
562
  "w-10 border-b border-table-stroke px-4 py-2.5",
556
- Ce,
563
+ ke,
557
564
  // Sticky without the baked shadow — an always-on smudge
558
565
  // muddies the shell's corners (elevation = actionability).
559
566
  // (sticky is positioned, so the ::after tick anchors to it —
560
567
  // no `relative` needed, and it would conflict with sticky.)
561
568
  "sticky left-0 z-10",
562
- Ne
569
+ Ce
563
570
  ),
564
571
  children: [
565
572
  /* @__PURE__ */ d("span", { className: "sr-only", children: "Row selection" }),
@@ -578,23 +585,23 @@ const K = r.forwardRef(
578
585
  ) : /* @__PURE__ */ d(
579
586
  "td",
580
587
  {
581
- className: g(
588
+ className: h(
582
589
  "h-16 w-10 px-4 py-2",
583
- xe(w),
590
+ Ne(w, { sticky: "left", selected: M }),
584
591
  "sticky left-0 z-10"
585
592
  ),
586
- style: w && V ? {
593
+ style: w && M ? {
587
594
  ...ae,
588
595
  backgroundPositionX: "left"
589
596
  } : void 0,
590
597
  onClick: (l) => l.stopPropagation(),
591
598
  children: e !== void 0 && (u.selectionMode === "single" ? /* @__PURE__ */ d(
592
- Me,
599
+ Ve,
593
600
  {
594
601
  name: u.selectionName,
595
602
  value: e,
596
603
  "aria-label": `Select ${e}`,
597
- checked: V,
604
+ checked: M,
598
605
  onChange: () => u.toggleKey(e)
599
606
  }
600
607
  ) : /* @__PURE__ */ d(
@@ -602,7 +609,7 @@ const K = r.forwardRef(
602
609
  {
603
610
  size: "sm",
604
611
  "aria-label": `Select ${e}`,
605
- checked: V,
612
+ checked: M,
606
613
  indeterminate: u.isIndeterminate(e),
607
614
  onChange: () => u.toggleKey(e)
608
615
  }
@@ -613,7 +620,7 @@ const K = r.forwardRef(
613
620
  ]
614
621
  }
615
622
  ),
616
- m && /* @__PURE__ */ d(se.Provider, { value: { depth: R.depth + 1, hidden: R.hidden || !C || !!o }, children: O })
623
+ f && /* @__PURE__ */ d(se.Provider, { value: { depth: R.depth + 1, hidden: R.hidden || !C || !!o }, children: j })
617
624
  ] });
618
625
  }
619
626
  );
@@ -629,40 +636,40 @@ const pe = r.forwardRef(
629
636
  children: b,
630
637
  ...v
631
638
  }, 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
639
+ var X, C, j;
640
+ 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(), U = N.length > 0, F = n && x && s !== "right" && U && !!E && !!(o != null && o.requestSort), D = F && ((X = o == null ? void 0 : o.sortDescriptor) == null ? void 0 : X.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 = (f) => {
641
+ if (f.button !== 0 || !o) return;
642
+ const m = f.currentTarget.parentElement, V = m == null ? void 0 : m.parentElement;
643
+ if (!(!m || !V)) {
644
+ o.snapshotColumnWidths(V), k.current = {
645
+ index: m.cellIndex,
646
+ startX: f.clientX,
647
+ startWidth: m.getBoundingClientRect().width
641
648
  }, y(!0);
642
649
  try {
643
- m.currentTarget.setPointerCapture(m.pointerId);
650
+ f.currentTarget.setPointerCapture(f.pointerId);
644
651
  } catch {
645
652
  }
646
- m.preventDefault();
653
+ f.preventDefault();
647
654
  }
648
- }, J = (m) => {
649
- const f = k.current;
650
- !f || !o || o.setColumnWidth(
651
- f.index,
652
- f.startWidth + (m.clientX - f.startX)
655
+ }, J = (f) => {
656
+ const m = k.current;
657
+ !m || !o || o.setColumnWidth(
658
+ m.index,
659
+ m.startWidth + (f.clientX - m.startX)
653
660
  );
654
661
  }, W = () => {
655
662
  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;
663
+ }, S = (f) => {
664
+ if (f.key !== "ArrowLeft" && f.key !== "ArrowRight" || !o) return;
665
+ f.preventDefault();
666
+ const m = f.currentTarget.parentElement, V = m == null ? void 0 : m.parentElement;
667
+ if (!m || !V) return;
668
+ o.snapshotColumnWidths(V);
669
+ const O = f.shiftKey ? 32 : 8, I = f.key === "ArrowRight" ? O : -O;
663
670
  o.setColumnWidth(
664
- f.cellIndex,
665
- f.getBoundingClientRect().width + I
671
+ m.cellIndex,
672
+ m.getBoundingClientRect().width + I
666
673
  );
667
674
  };
668
675
  return /* @__PURE__ */ $(
@@ -670,22 +677,22 @@ const pe = r.forwardRef(
670
677
  {
671
678
  ref: A,
672
679
  scope: "col",
673
- "aria-sort": D ? q === "ascending" ? "ascending" : "descending" : j ? "none" : void 0,
674
- className: g(
680
+ "aria-sort": D ? q === "ascending" ? "ascending" : "descending" : F ? "none" : void 0,
681
+ className: h(
675
682
  // whitespace-nowrap: header labels hug their content — the table
676
683
  // scrolls horizontally, so wrapping "Null %" to two lines only
677
684
  // wastes header height without saving any width.
678
685
  "relative whitespace-nowrap border-b border-table-stroke px-4 py-2.5 text-s font-medium text-table-header-foreground",
679
- Ne,
680
686
  Ce,
687
+ ke,
681
688
  // The resize handle carries its own tick visual, so drop the
682
689
  // decorative one; the last column never shows a handle.
683
690
  u && "after:hidden [&:last-child>[data-slot=resize-handle]]:hidden",
684
691
  // Capped-height tables scroll under the header: pin it to the
685
692
  // viewport top, painted like the table surface so rows pass beneath.
686
693
  (o == null ? void 0 : o.stickyHeader) && "sticky top-0 z-30",
687
- ge(e),
688
- s && (s === "right" && (o != null && o.elevatedActionColumn) ? g(
694
+ he(e),
695
+ s && (s === "right" && (o != null && o.elevatedActionColumn) ? h(
689
696
  // Preserve the semantic column width, but do not pin or paint
690
697
  // a blank header cell over the labels behind it. Only body
691
698
  // action cells participate in the sticky elevated surface.
@@ -699,12 +706,12 @@ const pe = r.forwardRef(
699
706
  ),
700
707
  ...v,
701
708
  children: [
702
- j ? /* @__PURE__ */ $(
709
+ F ? /* @__PURE__ */ $(
703
710
  "button",
704
711
  {
705
712
  type: "button",
706
713
  onClick: () => o.requestSort(E),
707
- className: g(
714
+ className: h(
708
715
  "group/sort -mx-1 inline-flex items-center gap-1 rounded px-1 outline-none transition-colors",
709
716
  "hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
710
717
  e === "right" && "flex-row-reverse",
@@ -712,10 +719,10 @@ const pe = r.forwardRef(
712
719
  ),
713
720
  children: [
714
721
  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" })
722
+ D ? q === "ascending" ? /* @__PURE__ */ d(Le, { className: "size-3.5" }) : /* @__PURE__ */ d(_e, { className: "size-3.5" }) : /* @__PURE__ */ d(Fe, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
716
723
  ]
717
724
  }
718
- ) : F ? b : /* @__PURE__ */ d("span", { className: "sr-only", children: v["aria-label"] ?? "Table column" }),
725
+ ) : U ? b : /* @__PURE__ */ d("span", { className: "sr-only", children: v["aria-label"] ?? "Table column" }),
719
726
  u && /* @__PURE__ */ d(
720
727
  "span",
721
728
  {
@@ -725,7 +732,7 @@ const pe = r.forwardRef(
725
732
  "aria-label": `Resize ${N || "this"} column`,
726
733
  "aria-valuemin": le,
727
734
  "aria-valuemax": 2e3,
728
- "aria-valuenow": ((O = o == null ? void 0 : o.columnWidths) == null ? void 0 : O[c ?? -1]) ?? le,
735
+ "aria-valuenow": ((j = o == null ? void 0 : o.columnWidths) == null ? void 0 : j[c ?? -1]) ?? le,
729
736
  tabIndex: 0,
730
737
  "data-resizing": R ? "true" : void 0,
731
738
  onPointerDown: T,
@@ -734,7 +741,7 @@ const pe = r.forwardRef(
734
741
  onPointerCancel: W,
735
742
  onKeyDown: S,
736
743
  onDoubleClick: () => o == null ? void 0 : o.resetColumnWidths(),
737
- className: g(
744
+ className: h(
738
745
  // 12px hit area straddling the column edge; the 1px tick inside
739
746
  // is the visible affordance (it replaces the decorative one).
740
747
  "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",
@@ -744,7 +751,7 @@ const pe = r.forwardRef(
744
751
  "span",
745
752
  {
746
753
  "aria-hidden": "true",
747
- className: g(
754
+ className: h(
748
755
  "h-4 w-px rounded-sm bg-border-strong",
749
756
  "transition-[transform,background-color] duration-150 ease-out motion-reduce:transition-none",
750
757
  "group-hover/resize:scale-y-125 group-hover/resize:bg-foreground/60",
@@ -761,7 +768,7 @@ const pe = r.forwardRef(
761
768
  }
762
769
  );
763
770
  pe.displayName = "TableColumn";
764
- const Te = r.forwardRef(
771
+ const Ie = r.forwardRef(
765
772
  ({ className: t, align: e, sticky: s, sortValue: i, style: n, ...c }, b) => {
766
773
  const v = te(), { interactive: A, selected: o } = r.useContext(ye), _ = s === "right" && (v == null ? void 0 : v.elevatedActionColumn);
767
774
  return /* @__PURE__ */ d(
@@ -774,7 +781,7 @@ const Te = r.forwardRef(
774
781
  backgroundPositionX: s,
775
782
  ...n
776
783
  } : n,
777
- className: g(
784
+ className: h(
778
785
  // whitespace-nowrap: cell content never wraps — the table's
779
786
  // overflow-x-auto viewport scrolls horizontally instead, matching the
780
787
  // header cells. Opt back into wrapping with `whitespace-normal` for
@@ -782,10 +789,10 @@ const Te = r.forwardRef(
782
789
  // Cell values own the ADS 14px body-text contract instead of relying
783
790
  // on inheritance from <Table>; nested content stays 14px by default.
784
791
  "h-16 whitespace-nowrap px-4 py-2 text-m",
785
- xe(A),
786
- ge(e),
792
+ Ne(A, { sticky: s, selected: o }),
793
+ he(e),
787
794
  s && ve(s, v == null ? void 0 : v.elevatedActionColumn),
788
- _ && g(
795
+ _ && h(
789
796
  "w-[var(--table-action-column-width)]",
790
797
  "min-w-[var(--table-action-column-width)]",
791
798
  "max-w-[var(--table-action-column-width)]",
@@ -800,11 +807,11 @@ const Te = r.forwardRef(
800
807
  );
801
808
  }
802
809
  );
803
- Te.displayName = "TableCell";
810
+ Ie.displayName = "TableCell";
804
811
  export {
805
812
  de as Table,
806
- Ee as TableBody,
807
- Te as TableCell,
813
+ Te as TableBody,
814
+ Ie as TableCell,
808
815
  pe as TableColumn,
809
816
  ue as TableHeader,
810
817
  K as TableRow