@actioneer/ads 0.5.5 → 0.5.7

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 (41) hide show
  1. package/components/agent-icon.js +3 -2
  2. package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
  3. package/components/ai-elements/chain-of-thought-icon.js +341 -201
  4. package/components/ai-elements/chain-of-thought.d.ts +1 -1
  5. package/components/answer-sources.d.ts +42 -0
  6. package/components/answer-sources.js +111 -0
  7. package/components/answer.d.ts +1 -0
  8. package/components/answer.js +665 -671
  9. package/components/assistant-ui/answer-tool-ui.js +11 -7
  10. package/components/assistant-ui/attachment.js +39 -39
  11. package/components/assistant-ui/composer-harness.js +5 -4
  12. package/components/assistant-ui/follow-up-suggestions.d.ts +5 -1
  13. package/components/assistant-ui/follow-up-suggestions.js +47 -19
  14. package/components/assistant-ui/thread-context.d.ts +2 -0
  15. package/components/assistant-ui/thread.js +41 -40
  16. package/components/avatar.js +14 -14
  17. package/components/dropdown.d.ts +1 -1
  18. package/components/dropdown.js +1 -1
  19. package/components/empty-state.d.ts +4 -4
  20. package/components/field.js +16 -16
  21. package/components/index.d.ts +1 -0
  22. package/components/index.js +414 -408
  23. package/components/infinite-canvas.js +1 -1
  24. package/components/pixel-icon.d.ts +3 -1
  25. package/components/pixel-icon.js +294 -214
  26. package/components/segmented.d.ts +4 -1
  27. package/components/segmented.js +9 -8
  28. package/components/sidebar.d.ts +2 -2
  29. package/components/switch.js +22 -4
  30. package/components/table.d.ts +15 -7
  31. package/components/table.js +313 -199
  32. package/components/textarea.js +1 -2
  33. package/components/tooltip.js +1 -1
  34. package/components/ui/tooltip.js +5 -5
  35. package/lib/icons.d.ts +8 -0
  36. package/lib/icons.js +103 -101
  37. package/llms.txt +18 -7
  38. package/manifest.json +125 -13
  39. package/package.json +1 -1
  40. package/styles.css +42 -47
  41. package/theme.css +24 -45
@@ -1,31 +1,31 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as z } from "react/jsx-runtime";
2
+ import { jsx as d, jsxs as A } from "react/jsx-runtime";
3
3
  import * as a from "react";
4
- import { cn as t } from "../lib/cn.js";
4
+ import { cn as u } from "../lib/cn.js";
5
5
  import { Checkbox as j } from "./checkbox.js";
6
- import { ChevronUp as Q, ChevronDown as V, SortIcon as X } from "../lib/icons.js";
7
- const L = (o) => o === "center" ? "text-center" : o === "right" ? "text-right" : "text-left", O = (o, n = !1) => o === "left" ? t(
6
+ import { ChevronUp as ie, ChevronDown as ce, SortIcon as ue } from "../lib/icons.js";
7
+ const W = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", X = (e, t = !1) => e === "left" ? u(
8
8
  "sticky left-0 z-10",
9
9
  // Scroll-aware: the smudge only appears once content is actually
10
10
  // hidden behind the pinned column (nothing to scroll back to at the
11
11
  // far left → no shadow).
12
12
  "group-data-[scroll-left=true]/table-shell:shadow-table-smudge-left"
13
- ) : o === "right" ? t(
13
+ ) : e === "right" ? u(
14
14
  "sticky right-0 z-10",
15
15
  // Backward-compatible fallback. Action columns should opt into the
16
16
  // Table-level elevation so one shadow spans the complete column.
17
- !n && "group-data-[scroll-right=true]/table-shell:shadow-table-smudge-right"
18
- ) : void 0, W = (o) => o === "right" ? t(
19
- "group-first/row:before:pointer-events-none group-first/row:before:absolute group-first/row:before:right-0 group-first/row:before:top-0 group-first/row:before:size-5 group-first/row:before:content-[''] group-first/row:before:[background:radial-gradient(circle_at_0%_100%,transparent_19.5px,var(--table-shell)_20px)]",
20
- "group-last/row:after:pointer-events-none group-last/row:after:absolute group-last/row:after:right-0 group-last/row:after:bottom-0 group-last/row:after:size-5 group-last/row:after:content-[''] group-last/row:after:[background:radial-gradient(circle_at_0%_0%,transparent_19.5px,var(--table-shell)_20px)]"
21
- ) : t(
22
- "group-first/row:before:pointer-events-none group-first/row:before:absolute group-first/row:before:left-0 group-first/row:before:top-0 group-first/row:before:size-5 group-first/row:before:content-[''] group-first/row:before:[background:radial-gradient(circle_at_100%_100%,transparent_19.5px,var(--table-shell)_20px)]",
23
- "group-last/row:after:pointer-events-none group-last/row:after:absolute group-last/row:after:left-0 group-last/row:after:bottom-0 group-last/row:after:size-5 group-last/row:after:content-[''] group-last/row:after:[background:radial-gradient(circle_at_100%_0%,transparent_19.5px,var(--table-shell)_20px)]"
24
- ), F = (o) => t(
17
+ !t && "group-data-[scroll-right=true]/table-shell:shadow-table-smudge-right"
18
+ ) : void 0, G = (e) => e === "right" ? u(
19
+ "group-first/row:before:pointer-events-none group-first/row:before:absolute group-first/row:before:right-0 group-first/row:before:top-0 group-first/row:before:size-1 group-first/row:before:content-[''] group-first/row:before:[background:radial-gradient(circle_at_0%_100%,transparent_3.5px,var(--table-shell)_4px)]",
20
+ "group-last/row:after:pointer-events-none group-last/row:after:absolute group-last/row:after:right-0 group-last/row:after:bottom-0 group-last/row:after:size-1 group-last/row:after:content-[''] group-last/row:after:[background:radial-gradient(circle_at_0%_0%,transparent_3.5px,var(--table-shell)_4px)]"
21
+ ) : u(
22
+ "group-first/row:before:pointer-events-none group-first/row:before:absolute group-first/row:before:left-0 group-first/row:before:top-0 group-first/row:before:size-1 group-first/row:before:content-[''] group-first/row:before:[background:radial-gradient(circle_at_100%_100%,transparent_3.5px,var(--table-shell)_4px)]",
23
+ "group-last/row:after:pointer-events-none group-last/row:after:absolute group-last/row:after:left-0 group-last/row:after:bottom-0 group-last/row:after:size-1 group-last/row:after:content-[''] group-last/row:after:[background:radial-gradient(circle_at_100%_0%,transparent_3.5px,var(--table-shell)_4px)]"
24
+ ), Q = (e) => u(
25
25
  "bg-card align-middle transition-colors",
26
26
  // Row separators — functional hairline, none under the last row.
27
27
  "border-b border-border group-last/row:border-b-0",
28
- !o && t(
28
+ !e && u(
29
29
  // Restore the original quiet neutral hover: the row softly sinks
30
30
  // toward the shell instead of picking up a brand tint or a new
31
31
  // rounded silhouette. The wash is pre-composited so scrolled text
@@ -33,167 +33,280 @@ const L = (o) => o === "center" ? "text-center" : o === "right" ? "text-right" :
33
33
  "group-hover/row:bg-(--table-row-hover) group-focus-within/row:bg-(--table-row-hover)",
34
34
  "group-data-[selected]/row:bg-(--table-row-selected)"
35
35
  )
36
- ), Y = t(
37
- "group-first/row:rounded-tl-[calc(var(--radius-2xl)-var(--spacing))]",
38
- "group-last/row:rounded-bl-[calc(var(--radius-2xl)-var(--spacing))]"
39
- ), Z = t(
40
- "group-first/row:first:rounded-tl-[calc(var(--radius-2xl)-var(--spacing))]",
41
- "group-first/row:last:rounded-tr-[calc(var(--radius-2xl)-var(--spacing))]",
42
- "group-last/row:first:rounded-bl-[calc(var(--radius-2xl)-var(--spacing))]",
43
- "group-last/row:last:rounded-br-[calc(var(--radius-2xl)-var(--spacing))]"
44
- ), I = t(
36
+ ), de = u(
37
+ "group-first/row:rounded-tl-sm",
38
+ "group-last/row:rounded-bl-sm"
39
+ ), pe = u(
40
+ "group-first/row:first:rounded-tl-sm",
41
+ "group-first/row:last:rounded-tr-sm",
42
+ "group-last/row:first:rounded-bl-sm",
43
+ "group-last/row:last:rounded-br-sm"
44
+ ), Y = u(
45
45
  "after:pointer-events-none after:absolute after:right-0 after:top-1/2",
46
46
  "after:h-4 after:w-px after:-translate-y-1/2 after:rounded-sm",
47
47
  "after:bg-border-strong last:after:hidden"
48
- ), M = a.createContext(null), T = () => a.useContext(M), q = a.createContext("body"), D = a.forwardRef(
48
+ ), H = "__ads_table_column_", fe = new Intl.Collator(void 0, {
49
+ numeric: !0,
50
+ sensitivity: "base"
51
+ });
52
+ function z(e) {
53
+ const t = [];
54
+ return a.Children.forEach(e, (n) => {
55
+ if (a.isValidElement(n) && n.type === a.Fragment) {
56
+ t.push(...z(n.props.children));
57
+ return;
58
+ }
59
+ t.push(n);
60
+ }), t;
61
+ }
62
+ function D(e) {
63
+ if (e == null || typeof e == "boolean")
64
+ return "";
65
+ if (typeof e == "number" || typeof e == "string") return e;
66
+ if (Array.isArray(e))
67
+ return e.map((r) => String(D(r))).join(" ").trim();
68
+ if (!a.isValidElement(e)) return "";
69
+ const t = e.props.sortValue;
70
+ if (typeof t == "string" || typeof t == "number" || t instanceof Date)
71
+ return t;
72
+ const n = D(e.props.children);
73
+ if (String(n).trim()) return n;
74
+ for (const r of [
75
+ "value",
76
+ "label",
77
+ "status",
78
+ "name",
79
+ "title",
80
+ "health"
81
+ ]) {
82
+ const o = e.props[r];
83
+ if (typeof o == "string" || typeof o == "number") return o;
84
+ }
85
+ return "";
86
+ }
87
+ function J(e) {
88
+ if (e instanceof Date)
89
+ return { kind: "number", value: e.getTime() };
90
+ if (typeof e == "number")
91
+ return { kind: "number", value: e };
92
+ const t = e.trim();
93
+ if (!t || t === "—" || t === "-")
94
+ return { kind: "empty", value: "" };
95
+ const n = t.replace(/[,\s]/g, "").replace(/^[₹$€£]/, "").replace(/%$/, "");
96
+ if (/^[+-]?(?:\d+\.?\d*|\.\d+)$/.test(n))
97
+ return { kind: "number", value: Number(n) };
98
+ const o = /^\d{4}[-/]\d{1,2}[-/]\d{1,2}/.test(t) || /\b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\b/i.test(t) ? Date.parse(t) : Number.NaN;
99
+ return Number.isNaN(o) ? { kind: "text", value: t } : { kind: "number", value: o };
100
+ }
101
+ function me(e, t, n) {
102
+ const r = J(e), o = J(t);
103
+ if (r.kind === "empty") return o.kind === "empty" ? 0 : 1;
104
+ if (o.kind === "empty") return -1;
105
+ const l = r.kind === "number" && o.kind === "number" ? r.value - o.value : fe.compare(String(r.value), String(o.value));
106
+ return n === "ascending" ? l : -l;
107
+ }
108
+ const Z = a.createContext(null), V = () => a.useContext(Z), P = a.createContext("body");
109
+ function be(e) {
110
+ const t = [], r = z(e.props.children).map((o, l) => {
111
+ if (!a.isValidElement(o) || o.type !== $)
112
+ return o;
113
+ let s = 0;
114
+ const f = z(o.props.children).map((i) => {
115
+ if (!a.isValidElement(i)) return i;
116
+ for (; (t[s] ?? 0) > l; )
117
+ s += 1;
118
+ const S = Math.max(1, Number(i.props.colSpan ?? 1)), h = Math.max(1, Number(i.props.rowSpan ?? 1)), g = s;
119
+ for (let x = 0; x < S; x += 1)
120
+ t[g + x] = Math.max(
121
+ t[g + x] ?? 0,
122
+ l + h
123
+ );
124
+ return s += S, i.type !== re ? i : a.cloneElement(i, { _sortColumnIndex: g });
125
+ });
126
+ return a.cloneElement(o, void 0, f);
127
+ });
128
+ return a.cloneElement(e, void 0, r);
129
+ }
130
+ function ge(e, t, n) {
131
+ const r = z(e.props.children).map((o, l) => {
132
+ if (!a.isValidElement(o) || o.type !== $)
133
+ return { row: o, index: l, value: "" };
134
+ const s = z(o.props.children);
135
+ return {
136
+ row: o,
137
+ index: l,
138
+ value: D(s[t])
139
+ };
140
+ });
141
+ return r.sort((o, l) => me(o.value, l.value, n) || o.index - l.index), a.cloneElement(
142
+ e,
143
+ void 0,
144
+ r.map(({ row: o }) => o)
145
+ );
146
+ }
147
+ function K(e, t) {
148
+ const n = t != null && t.column.startsWith(H) ? Number(t.column.slice(H.length)) : Number.NaN;
149
+ return a.Children.map(e, (r) => a.isValidElement(r) ? r.type === a.Fragment ? a.cloneElement(
150
+ r,
151
+ void 0,
152
+ K(r.props.children, t)
153
+ ) : r.type === ee ? be(r) : r.type === te && t && Number.isInteger(n) && n >= 0 ? ge(r, n, t.direction) : r : r);
154
+ }
155
+ const he = a.forwardRef(
49
156
  ({
50
- className: o,
51
- wrapperClassName: n,
52
- footer: i,
53
- children: d,
54
- selectionMode: g = "none",
55
- selectedKeys: e,
56
- onSelectionChange: c,
57
- rowKeys: l,
58
- elevatedActionColumn: u = !1,
59
- actionColumnWidth: h = "4rem",
60
- sortDescriptor: b,
61
- onSortChange: w,
157
+ className: e,
158
+ wrapperClassName: t,
159
+ footer: n,
160
+ children: r,
161
+ selectionMode: o = "none",
162
+ selectedKeys: l,
163
+ onSelectionChange: s,
164
+ rowKeys: b,
165
+ elevatedActionColumn: f = !1,
166
+ actionColumnWidth: i = "4rem",
167
+ sortDescriptor: S,
168
+ onSortChange: h,
169
+ allowsSorting: g = !0,
62
170
  isStatic: x = !1,
63
- ...U
64
- }, $) => {
65
- const v = a.useMemo(() => l ?? [], [l]), m = e === "all", f = m ? null : e ?? /* @__PURE__ */ new Set(), C = a.useCallback(
66
- (r) => m || !!(f != null && f.has(r)),
67
- [m, f]
68
- ), N = v.length > 0 && (m || v.every((r) => f == null ? void 0 : f.has(r))), H = !N && (m || v.some((r) => f == null ? void 0 : f.has(r))), P = a.useCallback(
69
- (r) => {
70
- if (!c) return;
71
- if (g === "single") {
72
- c(C(r) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([r]));
171
+ ...C
172
+ }, _) => {
173
+ const w = a.useMemo(() => b ?? [], [b]), v = l === "all", p = v ? null : l ?? /* @__PURE__ */ new Set(), R = a.useCallback(
174
+ (c) => v || !!(p != null && p.has(c)),
175
+ [v, p]
176
+ ), k = w.length > 0 && (v || w.every((c) => p == null ? void 0 : p.has(c))), q = !k && (v || w.some((c) => p == null ? void 0 : p.has(c))), F = a.useCallback(
177
+ (c) => {
178
+ if (!s) return;
179
+ if (o === "single") {
180
+ s(R(c) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([c]));
73
181
  return;
74
182
  }
75
- const p = new Set(m ? v : f ?? /* @__PURE__ */ new Set());
76
- p.has(r) ? p.delete(r) : p.add(r), c(p);
183
+ const m = new Set(v ? w : p ?? /* @__PURE__ */ new Set());
184
+ m.has(c) ? m.delete(c) : m.add(c), s(m);
77
185
  },
78
- [c, g, C, m, v, f]
79
- ), A = a.useCallback(() => {
80
- c && c(N ? /* @__PURE__ */ new Set() : new Set(v));
81
- }, [c, N, v]), B = a.useCallback(
82
- (r) => {
83
- if (!w) return;
84
- const p = (b == null ? void 0 : b.column) === r && b.direction === "ascending" ? "descending" : "ascending";
85
- w({ column: r, direction: p });
186
+ [s, o, R, v, w, p]
187
+ ), I = a.useCallback(() => {
188
+ s && s(k ? /* @__PURE__ */ new Set() : new Set(w));
189
+ }, [s, k, w]), [oe, ne] = a.useState(), T = g && !h, y = T ? oe ?? S : S, B = a.useCallback(
190
+ (c) => {
191
+ if (!g) return;
192
+ const m = (y == null ? void 0 : y.column) === c && y.direction === "ascending" ? "descending" : "ascending", N = { column: c, direction: m };
193
+ h ? h(N) : ne(N);
86
194
  },
87
- [w, b]
88
- ), R = a.useRef(null), [S, G] = a.useState({
195
+ [y, g, h]
196
+ ), ae = a.useMemo(
197
+ () => T ? K(r, y) : r,
198
+ [y, T, r]
199
+ ), M = a.useRef(null), [L, se] = a.useState({
89
200
  left: !1,
90
201
  right: !1
91
- }), _ = a.useCallback(() => {
92
- const r = R.current;
93
- if (!r) return;
94
- const p = r.scrollWidth - r.clientWidth, y = r.scrollLeft > 1, E = r.scrollLeft < p - 1;
95
- G(
96
- (k) => k.left === y && k.right === E ? k : { left: y, right: E }
202
+ }), E = a.useCallback(() => {
203
+ const c = M.current;
204
+ if (!c) return;
205
+ const m = c.scrollWidth - c.clientWidth, N = c.scrollLeft > 1, U = c.scrollLeft < m - 1;
206
+ se(
207
+ (O) => O.left === N && O.right === U ? O : { left: N, right: U }
97
208
  );
98
209
  }, []);
99
210
  a.useEffect(() => {
100
- _();
101
- const r = R.current;
102
- if (!r || typeof ResizeObserver > "u") return;
103
- const p = new ResizeObserver(_);
104
- p.observe(r);
105
- const y = r.querySelector("table");
106
- return y && p.observe(y), () => p.disconnect();
107
- }, [_]);
108
- const J = a.useMemo(
211
+ E();
212
+ const c = M.current;
213
+ if (!c || typeof ResizeObserver > "u") return;
214
+ const m = new ResizeObserver(E);
215
+ m.observe(c);
216
+ const N = c.querySelector("table");
217
+ return N && m.observe(N), () => m.disconnect();
218
+ }, [E]);
219
+ const le = a.useMemo(
109
220
  () => ({
110
- selectionMode: g,
111
- isSelected: C,
112
- toggleKey: P,
113
- toggleAll: A,
114
- allSelected: N,
115
- someSelected: H,
221
+ selectionMode: o,
222
+ isSelected: R,
223
+ toggleKey: F,
224
+ toggleAll: I,
225
+ allSelected: k,
226
+ someSelected: q,
116
227
  isStatic: x,
117
- sortDescriptor: b,
118
- requestSort: w ? B : void 0,
119
- elevatedActionColumn: u
228
+ sortDescriptor: y,
229
+ requestSort: g ? B : void 0,
230
+ automaticSorting: T,
231
+ elevatedActionColumn: f
120
232
  }),
121
233
  [
122
- g,
123
- C,
124
- P,
125
- A,
126
- N,
127
- H,
234
+ o,
235
+ R,
236
+ F,
237
+ I,
238
+ k,
239
+ q,
128
240
  x,
129
- b,
130
- w,
241
+ y,
242
+ g,
243
+ T,
131
244
  B,
132
- u
245
+ f
133
246
  ]
134
247
  );
135
- return /* @__PURE__ */ s(M.Provider, { value: J, children: /* @__PURE__ */ z(
248
+ return /* @__PURE__ */ d(Z.Provider, { value: le, children: /* @__PURE__ */ A(
136
249
  "div",
137
250
  {
138
- "data-scroll-left": S.left ? "true" : "false",
139
- "data-scroll-right": S.right ? "true" : "false",
140
- className: t(
251
+ "data-scroll-left": L.left ? "true" : "false",
252
+ "data-scroll-right": L.right ? "true" : "false",
253
+ className: u(
141
254
  "group/table-shell overflow-clip rounded-2xl bg-table-shell px-1 pb-1",
142
- n
255
+ t
143
256
  ),
144
257
  children: [
145
- /* @__PURE__ */ z(
258
+ /* @__PURE__ */ A(
146
259
  "div",
147
260
  {
148
261
  className: "relative",
149
- style: u ? {
150
- "--table-action-column-width": h
262
+ style: f ? {
263
+ "--table-action-column-width": i
151
264
  } : void 0,
152
265
  children: [
153
- /* @__PURE__ */ s(
266
+ /* @__PURE__ */ d(
154
267
  "div",
155
268
  {
156
- ref: R,
157
- onScroll: _,
158
- className: "overflow-x-auto rounded-[calc(var(--radius-2xl)-var(--spacing))]",
159
- children: /* @__PURE__ */ s(
269
+ ref: M,
270
+ onScroll: E,
271
+ className: "overflow-x-auto rounded-sm",
272
+ children: /* @__PURE__ */ d(
160
273
  "table",
161
274
  {
162
- ref: $,
275
+ ref: _,
163
276
  "data-slot": "table",
164
- className: t(
277
+ className: u(
165
278
  "w-full border-separate border-spacing-0 text-base",
166
- o
279
+ e
167
280
  ),
168
- ...U,
169
- children: d
281
+ ...C,
282
+ children: ae
170
283
  }
171
284
  )
172
285
  }
173
286
  ),
174
- /* @__PURE__ */ s(
287
+ /* @__PURE__ */ d(
175
288
  "div",
176
289
  {
177
290
  "aria-hidden": "true",
178
291
  "data-slot": "table-scroll-hint",
179
- className: t(
292
+ className: u(
180
293
  "pointer-events-none absolute inset-y-0 z-20 w-10",
181
294
  "bg-gradient-to-l from-(--table-scroll-hint) to-transparent",
182
295
  "opacity-0 transition-opacity duration-(--duration-fast) ease-out motion-reduce:transition-none",
183
- S.right && "opacity-100",
184
- u ? "right-[var(--table-action-column-width)]" : "right-0"
296
+ L.right && "opacity-100",
297
+ f ? "right-[var(--table-action-column-width)]" : "right-0"
185
298
  )
186
299
  }
187
300
  ),
188
- u && /* @__PURE__ */ s(
301
+ f && /* @__PURE__ */ d(
189
302
  "div",
190
303
  {
191
304
  "aria-hidden": "true",
192
305
  "data-slot": "table-action-column-elevation",
193
- className: t(
306
+ className: u(
194
307
  "pointer-events-none absolute inset-y-0 right-0 z-20",
195
308
  "w-[var(--table-action-column-width)]",
196
- "rounded-br-[calc(var(--radius-2xl)-var(--spacing))]"
309
+ "rounded-br-sm"
197
310
  // No shadow of its own: while columns hide behind the pinned
198
311
  // surface the scroll-hint gradient is already washing the
199
312
  // seam — stacking a cast on top of it read harsh. The hint
@@ -204,113 +317,113 @@ const L = (o) => o === "center" ? "text-center" : o === "right" ? "text-right" :
204
317
  ]
205
318
  }
206
319
  ),
207
- i && /* @__PURE__ */ s("div", { className: "flex items-center px-4 py-2.5", children: i })
320
+ n && /* @__PURE__ */ d("div", { className: "flex items-center px-4 py-2.5", children: n })
208
321
  ]
209
322
  }
210
323
  ) });
211
324
  }
212
325
  );
213
- D.displayName = "Table";
214
- const K = a.forwardRef(({ className: o, ...n }, i) => {
215
- const d = T();
216
- return /* @__PURE__ */ s(q.Provider, { value: "header", children: /* @__PURE__ */ s(
326
+ he.displayName = "Table";
327
+ const ee = a.forwardRef(({ className: e, ...t }, n) => {
328
+ const r = V();
329
+ return /* @__PURE__ */ d(P.Provider, { value: "header", children: /* @__PURE__ */ d(
217
330
  "thead",
218
331
  {
219
- ref: i,
220
- className: t(
332
+ ref: n,
333
+ className: u(
221
334
  "text-xs text-muted-foreground",
222
- (d == null ? void 0 : d.elevatedActionColumn) && "relative z-30 bg-table-shell",
223
- o
335
+ (r == null ? void 0 : r.elevatedActionColumn) && "relative z-30 bg-table-shell",
336
+ e
224
337
  ),
225
- ...n
338
+ ...t
226
339
  }
227
340
  ) });
228
341
  });
229
- K.displayName = "TableHeader";
230
- const ee = a.forwardRef(({ className: o, ...n }, i) => /* @__PURE__ */ s(q.Provider, { value: "body", children: /* @__PURE__ */ s("tbody", { ref: i, className: t(o), ...n }) }));
231
- ee.displayName = "TableBody";
232
- const re = a.forwardRef(
233
- ({ className: o, rowKey: n, children: i, ...d }, g) => {
234
- const e = T(), c = a.useContext(q), l = !!e && e.selectionMode !== "none", u = l && c === "body" && n !== void 0 ? e.isSelected(n) : !1;
235
- return /* @__PURE__ */ z(
342
+ ee.displayName = "TableHeader";
343
+ const te = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(P.Provider, { value: "body", children: /* @__PURE__ */ d("tbody", { ref: n, className: u(e), ...t }) }));
344
+ te.displayName = "TableBody";
345
+ const $ = a.forwardRef(
346
+ ({ className: e, rowKey: t, children: n, ...r }, o) => {
347
+ const l = V(), s = a.useContext(P), b = !!l && l.selectionMode !== "none", f = b && s === "body" && t !== void 0 ? l.isSelected(t) : !1;
348
+ return /* @__PURE__ */ A(
236
349
  "tr",
237
350
  {
238
- ref: g,
239
- "data-selected": u || void 0,
240
- className: t("group/row", o),
241
- ...d,
351
+ ref: o,
352
+ "data-selected": f || void 0,
353
+ className: u("group/row", e),
354
+ ...r,
242
355
  children: [
243
- l && (c === "header" ? /* @__PURE__ */ s(
356
+ b && (s === "header" ? /* @__PURE__ */ d(
244
357
  "th",
245
358
  {
246
359
  scope: "col",
247
- className: t(
360
+ className: u(
248
361
  "w-10 px-4 py-2.5",
249
- I,
362
+ Y,
250
363
  // Sticky without the baked shadow — an always-on smudge
251
364
  // muddies the shell's corners (elevation = actionability).
252
365
  // (sticky is positioned, so the ::after tick anchors to it —
253
366
  // no `relative` needed, and it would conflict with sticky.)
254
367
  "sticky left-0 z-10 bg-table-shell"
255
368
  ),
256
- children: e.selectionMode === "multiple" && /* @__PURE__ */ s(
369
+ children: l.selectionMode === "multiple" && /* @__PURE__ */ d(
257
370
  j,
258
371
  {
259
372
  size: "sm",
260
373
  "aria-label": "Select all rows",
261
- checked: e.allSelected,
262
- indeterminate: e.someSelected,
263
- onChange: e.toggleAll
374
+ checked: l.allSelected,
375
+ indeterminate: l.someSelected,
376
+ onChange: l.toggleAll
264
377
  }
265
378
  )
266
379
  }
267
- ) : /* @__PURE__ */ s(
380
+ ) : /* @__PURE__ */ d(
268
381
  "td",
269
382
  {
270
- className: t(
383
+ className: u(
271
384
  "w-10 px-4 py-3",
272
- F(e.isStatic),
273
- Y,
385
+ Q(l.isStatic),
386
+ de,
274
387
  "sticky left-0 z-10",
275
388
  // Same white-behind-white corner problem as pinned data cells.
276
- W("left")
389
+ G("left")
277
390
  ),
278
- onClick: (h) => h.stopPropagation(),
279
- children: n !== void 0 && /* @__PURE__ */ s(
391
+ onClick: (i) => i.stopPropagation(),
392
+ children: t !== void 0 && /* @__PURE__ */ d(
280
393
  j,
281
394
  {
282
395
  size: "sm",
283
- "aria-label": `Select ${n}`,
284
- checked: u,
285
- onChange: () => e.toggleKey(n)
396
+ "aria-label": `Select ${t}`,
397
+ checked: f,
398
+ onChange: () => l.toggleKey(t)
286
399
  }
287
400
  )
288
401
  }
289
402
  )),
290
- i
403
+ n
291
404
  ]
292
405
  }
293
406
  );
294
407
  }
295
408
  );
296
- re.displayName = "TableRow";
297
- const te = a.forwardRef(({ className: o, align: n, sticky: i, sortKey: d, children: g, ...e }, c) => {
298
- var w, x;
299
- const l = T(), u = !!d && !!(l != null && l.requestSort), h = u && ((w = l == null ? void 0 : l.sortDescriptor) == null ? void 0 : w.column) === d, b = (x = l == null ? void 0 : l.sortDescriptor) == null ? void 0 : x.direction;
300
- return /* @__PURE__ */ s(
409
+ $.displayName = "TableRow";
410
+ const re = a.forwardRef(({ className: e, align: t, sticky: n, sortKey: r, allowsSorting: o = !0, _sortColumnIndex: l, children: s, ...b }, f) => {
411
+ var v, p;
412
+ const i = V(), h = (i != null && i.automaticSorting && l !== void 0 ? `${H}${l}` : void 0) ?? r, g = Number(b.colSpan ?? 1) === 1, x = String(D(s)).trim().length > 0, C = o && g && n !== "right" && x && !!h && !!(i != null && i.requestSort), _ = C && ((v = i == null ? void 0 : i.sortDescriptor) == null ? void 0 : v.column) === h, w = (p = i == null ? void 0 : i.sortDescriptor) == null ? void 0 : p.direction;
413
+ return /* @__PURE__ */ d(
301
414
  "th",
302
415
  {
303
- ref: c,
416
+ ref: f,
304
417
  scope: "col",
305
- "aria-sort": h ? b === "ascending" ? "ascending" : "descending" : u ? "none" : void 0,
306
- className: t(
418
+ "aria-sort": _ ? w === "ascending" ? "ascending" : "descending" : C ? "none" : void 0,
419
+ className: u(
307
420
  // whitespace-nowrap: header labels hug their content — the table
308
421
  // scrolls horizontally, so wrapping "Null %" to two lines only
309
422
  // wastes header height without saving any width.
310
423
  "relative whitespace-nowrap px-4 py-2.5 font-normal",
311
- I,
312
- L(n),
313
- i && (i === "right" && (l != null && l.elevatedActionColumn) ? t(
424
+ Y,
425
+ W(t),
426
+ n && (n === "right" && (i != null && i.elevatedActionColumn) ? u(
314
427
  // Preserve the semantic column width, but do not pin or paint
315
428
  // a blank header cell over the labels behind it. Only body
316
429
  // action cells participate in the sticky elevated surface.
@@ -318,69 +431,70 @@ const te = a.forwardRef(({ className: o, align: n, sticky: i, sortKey: d, childr
318
431
  "min-w-[var(--table-action-column-width)]",
319
432
  "max-w-[var(--table-action-column-width)]",
320
433
  "bg-transparent"
321
- ) : t(O(i), "bg-table-shell")),
322
- o
434
+ ) : u(X(n), "bg-table-shell")),
435
+ e
323
436
  ),
324
- ...e,
325
- children: u ? /* @__PURE__ */ z(
437
+ ...b,
438
+ children: C ? /* @__PURE__ */ A(
326
439
  "button",
327
440
  {
328
441
  type: "button",
329
- onClick: () => l.requestSort(d),
330
- className: t(
442
+ onClick: () => i.requestSort(h),
443
+ className: u(
331
444
  "group/sort -mx-1 inline-flex items-center gap-1 rounded px-1 outline-none transition-colors",
332
445
  "hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
333
- n === "right" && "flex-row-reverse",
334
- h && "text-foreground"
446
+ t === "right" && "flex-row-reverse",
447
+ _ && "text-foreground"
335
448
  ),
336
449
  children: [
337
- g,
338
- h ? b === "ascending" ? /* @__PURE__ */ s(Q, { className: "size-3.5" }) : /* @__PURE__ */ s(V, { className: "size-3.5" }) : /* @__PURE__ */ s(X, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
450
+ s,
451
+ _ ? w === "ascending" ? /* @__PURE__ */ d(ie, { className: "size-3.5" }) : /* @__PURE__ */ d(ce, { className: "size-3.5" }) : /* @__PURE__ */ d(ue, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
339
452
  ]
340
453
  }
341
- ) : g
454
+ ) : s
342
455
  }
343
456
  );
344
457
  });
345
- te.displayName = "TableColumn";
346
- const oe = a.forwardRef(
347
- ({ className: o, align: n, sticky: i, ...d }, g) => {
348
- const e = T(), c = i === "right" && (e == null ? void 0 : e.elevatedActionColumn);
349
- return /* @__PURE__ */ s(
458
+ re.displayName = "TableColumn";
459
+ const we = a.forwardRef(
460
+ ({ className: e, align: t, sticky: n, sortValue: r, ...o }, l) => {
461
+ const s = V(), b = n === "right" && (s == null ? void 0 : s.elevatedActionColumn);
462
+ return /* @__PURE__ */ d(
350
463
  "td",
351
464
  {
352
- ref: g,
353
- className: t(
465
+ ref: l,
466
+ "data-sort-value": r instanceof Date ? r.toISOString() : r,
467
+ className: u(
354
468
  // whitespace-nowrap: cell content never wraps — the table's
355
469
  // overflow-x-auto viewport scrolls horizontally instead, matching the
356
470
  // header cells. Opt back into wrapping with `whitespace-normal` for
357
471
  // deliberate multi-line content (e.g. an EmptyState in a colSpan cell).
358
472
  "whitespace-nowrap px-4 py-3",
359
- F((e == null ? void 0 : e.isStatic) ?? !1),
360
- Z,
361
- L(n),
362
- i && O(i, e == null ? void 0 : e.elevatedActionColumn),
363
- i && W(i),
364
- c && t(
473
+ Q((s == null ? void 0 : s.isStatic) ?? !1),
474
+ pe,
475
+ W(t),
476
+ n && X(n, s == null ? void 0 : s.elevatedActionColumn),
477
+ n && G(n),
478
+ b && u(
365
479
  "w-[var(--table-action-column-width)]",
366
480
  "min-w-[var(--table-action-column-width)]",
367
481
  "max-w-[var(--table-action-column-width)]",
368
482
  "bg-elevated",
369
483
  "group-hover/row:bg-elevated group-focus-within/row:bg-elevated"
370
484
  ),
371
- o
485
+ e
372
486
  ),
373
- ...d
487
+ ...o
374
488
  }
375
489
  );
376
490
  }
377
491
  );
378
- oe.displayName = "TableCell";
492
+ we.displayName = "TableCell";
379
493
  export {
380
- D as Table,
381
- ee as TableBody,
382
- oe as TableCell,
383
- te as TableColumn,
384
- K as TableHeader,
385
- re as TableRow
494
+ he as Table,
495
+ te as TableBody,
496
+ we as TableCell,
497
+ re as TableColumn,
498
+ ee as TableHeader,
499
+ $ as TableRow
386
500
  };