@actioneer/ads 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/components/ai-elements/agent-trace.d.ts +2 -2
  2. package/components/ai-elements/agent-trace.js +163 -104
  3. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  4. package/components/ai-elements/chain-of-thought.js +1 -1
  5. package/components/ai-elements/index.d.ts +0 -5
  6. package/components/ai-elements/inline-citation.js +1 -1
  7. package/components/alert.d.ts +6 -6
  8. package/components/alert.js +89 -53
  9. package/components/answer-sources.d.ts +2 -6
  10. package/components/answer-sources.js +58 -60
  11. package/components/answer.d.ts +5 -0
  12. package/components/answer.js +311 -271
  13. package/components/assistant-ui/composer-harness.js +15 -20
  14. package/components/assistant-ui/composer.d.ts +3 -1
  15. package/components/assistant-ui/composer.js +148 -144
  16. package/components/assistant-ui/index.d.ts +0 -3
  17. package/components/assistant-ui/thread-context.d.ts +3 -1
  18. package/components/assistant-ui/thread.js +50 -42
  19. package/components/avatar.js +42 -42
  20. package/components/badge.d.ts +5 -6
  21. package/components/badge.js +13 -76
  22. package/components/body-page-header.d.ts +15 -0
  23. package/components/body-page-header.js +24 -0
  24. package/components/brand-loader.d.ts +0 -3
  25. package/components/brand-loader.js +10 -32
  26. package/components/breadcrumbs.d.ts +0 -7
  27. package/components/breadcrumbs.js +54 -71
  28. package/components/button.d.ts +1 -1
  29. package/components/button.js +55 -49
  30. package/components/chart.js +298 -296
  31. package/components/chip.d.ts +13 -1
  32. package/components/chip.js +93 -80
  33. package/components/collection-header.d.ts +17 -0
  34. package/components/collection-header.js +31 -0
  35. package/components/connector-card.d.ts +6 -6
  36. package/components/connector-card.js +31 -32
  37. package/components/date-range-picker.d.ts +2 -1
  38. package/components/date-range-picker.js +158 -122
  39. package/components/drawer.d.ts +19 -3
  40. package/components/drawer.js +109 -100
  41. package/components/dropdown.d.ts +1 -2
  42. package/components/dropdown.js +88 -89
  43. package/components/field.js +39 -34
  44. package/components/file-dropzone.js +1 -1
  45. package/components/index.d.ts +4 -4
  46. package/components/index.js +499 -546
  47. package/components/infinite-canvas.js +24 -24
  48. package/components/input-field.d.ts +18 -3
  49. package/components/input-field.js +88 -72
  50. package/components/input.js +16 -15
  51. package/components/modal.d.ts +31 -3
  52. package/components/modal.js +243 -169
  53. package/components/number-field.js +45 -42
  54. package/components/page-body.d.ts +12 -0
  55. package/components/page-body.js +18 -0
  56. package/components/pagination.js +36 -36
  57. package/components/select.d.ts +21 -0
  58. package/components/select.js +189 -148
  59. package/components/setting-row.d.ts +6 -5
  60. package/components/setting-row.js +33 -32
  61. package/components/sidebar.d.ts +2 -0
  62. package/components/sidebar.js +165 -155
  63. package/components/skeleton.js +8 -7
  64. package/components/slider.js +1 -1
  65. package/components/surface-loader.d.ts +11 -0
  66. package/components/surface-loader.js +35 -0
  67. package/components/table.d.ts +16 -10
  68. package/components/table.js +426 -410
  69. package/components/tabs.d.ts +2 -0
  70. package/components/tabs.js +159 -294
  71. package/components/textarea.js +9 -9
  72. package/components/toast.d.ts +1 -1
  73. package/components/toast.js +181 -118
  74. package/components/tree.d.ts +5 -1
  75. package/components/tree.js +54 -49
  76. package/components/typography.d.ts +4 -4
  77. package/components/typography.js +13 -13
  78. package/components/ui/button.d.ts +1 -1
  79. package/components/ui/dialog.js +33 -33
  80. package/demo/components/add-to-artifact.js +6 -10
  81. package/lib/cn.js +11 -4
  82. package/lib/icons.d.ts +4 -0
  83. package/lib/icons.js +107 -106
  84. package/lib/interactive.d.ts +1 -1
  85. package/llms.txt +95 -152
  86. package/manifest.json +1628 -2729
  87. package/package.json +1 -2
  88. package/styles.css +347 -223
  89. package/theme.css +303 -177
  90. package/components/agent-icon.d.ts +0 -76
  91. package/components/agent-icon.js +0 -265
  92. package/components/ai-elements/queue.d.ts +0 -60
  93. package/components/ai-elements/queue.js +0 -193
  94. package/components/ai-elements/speech-input.d.ts +0 -16
  95. package/components/ai-elements/speech-input.js +0 -151
  96. package/components/ai-elements/task-progress.d.ts +0 -41
  97. package/components/ai-elements/task-progress.js +0 -224
  98. package/components/ai-elements/task.d.ts +0 -39
  99. package/components/ai-elements/task.js +0 -105
  100. package/components/ai-elements/voice.d.ts +0 -90
  101. package/components/ai-elements/voice.js +0 -496
  102. package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
  103. package/components/assistant-ui/follow-up-suggestions.js +0 -72
  104. package/components/assistant-ui/suggestions.d.ts +0 -7
  105. package/components/assistant-ui/suggestions.js +0 -19
  106. package/components/assistant-ui/voice.d.ts +0 -18
  107. package/components/link.d.ts +0 -14
  108. package/components/link.js +0 -72
  109. package/components/navbar.d.ts +0 -15
  110. package/components/navbar.js +0 -68
  111. package/components/pixel-icon.d.ts +0 -37
  112. package/components/pixel-icon.js +0 -859
@@ -1,77 +1,64 @@
1
1
  "use client";
2
- import { jsx as p, jsxs as T } from "react/jsx-runtime";
3
- import * as o from "react";
4
- import { cn as u } from "../lib/cn.js";
5
- import { Checkbox as re } from "./checkbox.js";
6
- import { ChevronUp as ge, ChevronDown as he, SortIcon as we } from "../lib/icons.js";
7
- const ne = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", ae = (e, t = !1) => e === "left" ? u(
2
+ import { jsx as d, jsxs as T } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { cn as m } from "../lib/cn.js";
5
+ import { Checkbox as ne } from "./checkbox.js";
6
+ import { ChevronUp as ve, ChevronDown as we, SortIcon as ye } from "../lib/icons.js";
7
+ const se = (r) => r === "center" ? "text-center" : r === "right" ? "text-right" : "text-left", ae = (r, t = !1) => r === "left" ? m(
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
- ) : e === "right" ? u(
13
+ ) : r === "right" ? m(
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
17
  !t && "group-data-[scroll-right=true]/table-shell:shadow-table-smudge-right"
18
- ) : void 0, se = (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-3 group-first/row:before:content-[''] group-first/row:before:[background:radial-gradient(circle_at_0%_100%,transparent_11.5px,var(--table-shell)_12px)]",
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-3 group-last/row:after:content-[''] group-last/row:after:[background:radial-gradient(circle_at_0%_0%,transparent_11.5px,var(--table-shell)_12px)]"
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-3 group-first/row:before:content-[''] group-first/row:before:[background:radial-gradient(circle_at_100%_100%,transparent_11.5px,var(--table-shell)_12px)]",
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-3 group-last/row:after:content-[''] group-last/row:after:[background:radial-gradient(circle_at_100%_0%,transparent_11.5px,var(--table-shell)_12px)]"
24
- ), le = (e) => u(
18
+ ) : void 0, ie = n.createContext(!1), le = (r) => m(
25
19
  "bg-card align-middle transition-colors",
26
- // Row separators — functional hairline, none under the last row.
27
- "border-b border-border group-last/row:border-b-0",
28
- !e && u(
29
- // Restore the original quiet neutral hover: the row softly sinks
30
- // toward the shell instead of picking up a brand tint or a new
20
+ // The header is the first NG1 band, so the first body row stays white.
21
+ "group-even/row:bg-ng1",
22
+ // Functional row hairline; the table shell carries the outer stroke.
23
+ "border-b border-table-stroke group-last/row:border-b-0",
24
+ r && m(
25
+ // Use NG2 without introducing a new
31
26
  // rounded silhouette. The wash is pre-composited so scrolled text
32
27
  // cannot show through sticky cells.
33
28
  "group-hover/row:bg-(--table-row-hover) group-focus-within/row:bg-(--table-row-hover)",
34
29
  "group-data-[selected]/row:bg-(--table-row-selected)"
35
30
  )
36
- ), ve = u(
37
- "group-first/row:rounded-tl-(--table-card-radius)",
38
- "group-last/row:rounded-bl-(--table-card-radius)"
39
- ), ye = u(
40
- "group-first/row:first:rounded-tl-(--table-card-radius)",
41
- "group-first/row:last:rounded-tr-(--table-card-radius)",
42
- "group-last/row:first:rounded-bl-(--table-card-radius)",
43
- "group-last/row:last:rounded-br-(--table-card-radius)"
44
- ), ie = u(
31
+ ), ce = "bg-ng1", ue = m(
45
32
  "after:pointer-events-none after:absolute after:right-0 after:top-1/2",
46
33
  "after:h-4 after:w-px after:-translate-y-1/2 after:rounded-sm",
47
34
  "after:bg-border-strong last:after:hidden"
48
- ), K = "__ads_table_column_", G = 64, xe = new Intl.Collator(void 0, {
35
+ ), G = "__ads_table_column_", Q = 64, xe = new Intl.Collator(void 0, {
49
36
  numeric: !0,
50
37
  sensitivity: "base"
51
38
  });
52
- function V(e) {
39
+ function V(r) {
53
40
  const t = [];
54
- return o.Children.forEach(e, (a) => {
55
- if (o.isValidElement(a) && a.type === o.Fragment) {
41
+ return n.Children.forEach(r, (a) => {
42
+ if (n.isValidElement(a) && a.type === n.Fragment) {
56
43
  t.push(...V(a.props.children));
57
44
  return;
58
45
  }
59
46
  t.push(a);
60
47
  }), t;
61
48
  }
62
- function X(e) {
63
- if (e == null || typeof e == "boolean")
49
+ function X(r) {
50
+ if (r == null || typeof r == "boolean")
64
51
  return "";
65
- if (typeof e == "number" || typeof e == "string") return e;
66
- if (Array.isArray(e))
67
- return e.map((n) => String(X(n))).join(" ").trim();
68
- if (!o.isValidElement(e)) return "";
69
- const t = e.props.sortValue;
52
+ if (typeof r == "number" || typeof r == "string") return r;
53
+ if (Array.isArray(r))
54
+ return r.map((o) => String(X(o))).join(" ").trim();
55
+ if (!n.isValidElement(r)) return "";
56
+ const t = r.props.sortValue;
70
57
  if (typeof t == "string" || typeof t == "number" || t instanceof Date)
71
58
  return t;
72
- const a = X(e.props.children);
59
+ const a = X(r.props.children);
73
60
  if (String(a).trim()) return a;
74
- for (const n of [
61
+ for (const o of [
75
62
  "value",
76
63
  "label",
77
64
  "status",
@@ -79,17 +66,17 @@ function X(e) {
79
66
  "title",
80
67
  "health"
81
68
  ]) {
82
- const s = e.props[n];
69
+ const s = r.props[o];
83
70
  if (typeof s == "string" || typeof s == "number") return s;
84
71
  }
85
72
  return "";
86
73
  }
87
- function oe(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();
74
+ function oe(r) {
75
+ if (r instanceof Date)
76
+ return { kind: "number", value: r.getTime() };
77
+ if (typeof r == "number")
78
+ return { kind: "number", value: r };
79
+ const t = r.trim();
93
80
  if (!t || t === "—" || t === "-")
94
81
  return { kind: "empty", value: "" };
95
82
  const a = t.replace(/[,\s]/g, "").replace(/^[₹$€£]/, "").replace(/%$/, "");
@@ -98,267 +85,270 @@ function oe(e) {
98
85
  const s = /^\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
86
  return Number.isNaN(s) ? { kind: "text", value: t } : { kind: "number", value: s };
100
87
  }
101
- function Ce(e, t, a) {
102
- const n = oe(e), s = oe(t);
103
- if (n.kind === "empty") return s.kind === "empty" ? 0 : 1;
88
+ function Ce(r, t, a) {
89
+ const o = oe(r), s = oe(t);
90
+ if (o.kind === "empty") return s.kind === "empty" ? 0 : 1;
104
91
  if (s.kind === "empty") return -1;
105
- const i = n.kind === "number" && s.kind === "number" ? n.value - s.value : xe.compare(String(n.value), String(s.value));
106
- return a === "ascending" ? i : -i;
92
+ const c = o.kind === "number" && s.kind === "number" ? o.value - s.value : xe.compare(String(o.value), String(s.value));
93
+ return a === "ascending" ? c : -c;
107
94
  }
108
- const ce = o.createContext(null), j = () => o.useContext(ce), Q = o.createContext("body");
109
- function Ne(e) {
110
- const t = [], n = V(e.props.children).map((s, i) => {
111
- if (!o.isValidElement(s) || s.type !== Y)
95
+ const de = n.createContext(null), B = () => n.useContext(de), Y = n.createContext("body");
96
+ function Ne(r) {
97
+ const t = [], o = V(r.props.children).map((s, c) => {
98
+ if (!n.isValidElement(s) || s.type !== Z)
112
99
  return s;
113
- let l = 0;
114
- const w = V(s.props.children).map((r) => {
115
- if (!o.isValidElement(r)) return r;
116
- for (; (t[l] ?? 0) > i; )
117
- l += 1;
118
- const E = Math.max(1, Number(r.props.colSpan ?? 1)), x = Math.max(1, Number(r.props.rowSpan ?? 1)), v = l;
119
- for (let C = 0; C < E; C += 1)
120
- t[v + C] = Math.max(
121
- t[v + C] ?? 0,
122
- i + x
100
+ let u = 0;
101
+ const f = V(s.props.children).map((e) => {
102
+ if (!n.isValidElement(e)) return e;
103
+ for (; (t[u] ?? 0) > c; )
104
+ u += 1;
105
+ const N = Math.max(1, Number(e.props.colSpan ?? 1)), x = Math.max(1, Number(e.props.rowSpan ?? 1)), w = u;
106
+ for (let g = 0; g < N; g += 1)
107
+ t[w + g] = Math.max(
108
+ t[w + g] ?? 0,
109
+ c + x
123
110
  );
124
- return l += E, r.type !== fe ? r : o.cloneElement(r, { _sortColumnIndex: v });
111
+ return u += N, e.type !== be ? e : n.cloneElement(e, { _sortColumnIndex: w });
125
112
  });
126
- return o.cloneElement(s, void 0, w);
113
+ return n.cloneElement(s, void 0, f);
127
114
  });
128
- return o.cloneElement(e, void 0, n);
115
+ return n.cloneElement(r, void 0, o);
129
116
  }
130
- function ze(e, t, a) {
131
- const n = V(e.props.children).map((s, i) => {
132
- if (!o.isValidElement(s) || s.type !== Y)
133
- return { row: s, index: i, value: "" };
134
- const l = V(s.props.children);
117
+ function ke(r, t, a) {
118
+ const o = V(r.props.children).map((s, c) => {
119
+ if (!n.isValidElement(s) || s.type !== Z)
120
+ return { row: s, index: c, value: "" };
121
+ const u = V(s.props.children);
135
122
  return {
136
123
  row: s,
137
- index: i,
138
- value: X(l[t])
124
+ index: c,
125
+ value: X(u[t])
139
126
  };
140
127
  });
141
- return n.sort((s, i) => Ce(s.value, i.value, a) || s.index - i.index), o.cloneElement(
142
- e,
128
+ return o.sort((s, c) => Ce(s.value, c.value, a) || s.index - c.index), n.cloneElement(
129
+ r,
143
130
  void 0,
144
- n.map(({ row: s }) => s)
131
+ o.map(({ row: s }) => s)
145
132
  );
146
133
  }
147
- function ue(e, t) {
148
- const a = t != null && t.column.startsWith(K) ? Number(t.column.slice(K.length)) : Number.NaN;
149
- return o.Children.map(e, (n) => o.isValidElement(n) ? n.type === o.Fragment ? o.cloneElement(
150
- n,
134
+ function me(r, t) {
135
+ const a = t != null && t.column.startsWith(G) ? Number(t.column.slice(G.length)) : Number.NaN;
136
+ return n.Children.map(r, (o) => n.isValidElement(o) ? o.type === n.Fragment ? n.cloneElement(
137
+ o,
151
138
  void 0,
152
- ue(n.props.children, t)
153
- ) : n.type === de ? Ne(n) : n.type === pe && t && Number.isInteger(a) && a >= 0 ? ze(n, a, t.direction) : n : n);
139
+ me(o.props.children, t)
140
+ ) : o.type === pe ? Ne(o) : o.type === fe && t && Number.isInteger(a) && a >= 0 ? ke(o, a, t.direction) : o : o);
154
141
  }
155
- const Se = o.forwardRef(
142
+ const ze = n.forwardRef(
156
143
  ({
157
- className: e,
144
+ className: r,
158
145
  wrapperClassName: t,
159
- footer: a,
160
- children: n,
161
- selectionMode: s = "none",
162
- selectedKeys: i,
163
- onSelectionChange: l,
164
- rowKeys: h,
165
- elevatedActionColumn: w = !1,
166
- actionColumnWidth: r = "4rem",
167
- sortDescriptor: E,
168
- onSortChange: x,
169
- allowsSorting: v = !0,
170
- isStatic: C = !1,
171
- resizableColumns: A = !0,
172
- maxBodyHeight: z,
173
- ...W
146
+ toolbar: a,
147
+ footer: o,
148
+ children: s,
149
+ selectionMode: c = "none",
150
+ selectedKeys: u,
151
+ onSelectionChange: h,
152
+ rowKeys: f,
153
+ elevatedActionColumn: e = !1,
154
+ actionColumnWidth: N = "3rem",
155
+ sortDescriptor: x,
156
+ onSortChange: w,
157
+ allowsSorting: g = !0,
158
+ isStatic: A = !1,
159
+ resizableColumns: E = !0,
160
+ maxBodyHeight: k,
161
+ ..._
174
162
  }, O) => {
175
- const N = o.useMemo(() => h ?? [], [h]), y = i === "all", b = y ? null : i ?? /* @__PURE__ */ new Set(), k = o.useCallback(
176
- (c) => y || !!(b != null && b.has(c)),
177
- [y, b]
178
- ), R = N.length > 0 && (y || N.every((c) => b == null ? void 0 : b.has(c))), $ = !R && (y || N.some((c) => b == null ? void 0 : b.has(c))), M = o.useCallback(
179
- (c) => {
180
- if (!l) return;
181
- if (s === "single") {
182
- l(k(c) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([c]));
163
+ const C = n.useMemo(() => f ?? [], [f]), z = u === "all", v = z ? null : u ?? /* @__PURE__ */ new Set(), D = n.useCallback(
164
+ (i) => z || !!(v != null && v.has(i)),
165
+ [z, v]
166
+ ), R = C.length > 0 && (z || C.every((i) => v == null ? void 0 : v.has(i))), W = !R && (z || C.some((i) => v == null ? void 0 : v.has(i))), $ = n.useCallback(
167
+ (i) => {
168
+ if (!h) return;
169
+ if (c === "single") {
170
+ h(D(i) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([i]));
183
171
  return;
184
172
  }
185
- const m = new Set(y ? N : b ?? /* @__PURE__ */ new Set());
186
- m.has(c) ? m.delete(c) : m.add(c), l(m);
173
+ const b = new Set(z ? C : v ?? /* @__PURE__ */ new Set());
174
+ b.has(i) ? b.delete(i) : b.add(i), h(b);
187
175
  },
188
- [l, s, k, y, N, b]
189
- ), H = o.useCallback(() => {
190
- l && l(R ? /* @__PURE__ */ new Set() : new Set(N));
191
- }, [l, R, N]), [U, q] = o.useState(), S = v && !x, d = S ? U ?? E : E, f = o.useCallback(
192
- (c) => {
193
- if (!v) return;
194
- const m = (d == null ? void 0 : d.column) === c && d.direction === "ascending" ? "descending" : "ascending", g = { column: c, direction: m };
195
- x ? x(g) : q(g);
176
+ [h, c, D, z, C, v]
177
+ ), I = n.useCallback(() => {
178
+ h && h(R ? /* @__PURE__ */ new Set() : new Set(C));
179
+ }, [h, R, C]), [H, U] = n.useState(), p = g && !w, l = p ? H ?? x : x, S = n.useCallback(
180
+ (i) => {
181
+ if (!g) return;
182
+ const b = (l == null ? void 0 : l.column) === i && l.direction === "ascending" ? "descending" : "ascending", y = { column: i, direction: b };
183
+ w ? w(y) : U(y);
196
184
  },
197
- [d, v, x]
198
- ), _ = o.useMemo(
199
- () => S ? ue(n, d) : n,
200
- [d, S, n]
201
- ), D = o.useRef(null), [I, me] = o.useState({
185
+ [l, g, w]
186
+ ), j = n.useMemo(
187
+ () => p ? me(s, l) : s,
188
+ [l, p, s]
189
+ ), M = n.useRef(null), [F, he] = n.useState({
202
190
  left: !1,
203
191
  right: !1
204
- }), F = o.useCallback(() => {
205
- const c = D.current;
206
- if (!c) return;
207
- const m = c.scrollWidth - c.clientWidth, g = c.scrollLeft > 1, L = c.scrollLeft < m - 1;
208
- me(
209
- (J) => J.left === g && J.right === L ? J : { left: g, right: L }
192
+ }), q = n.useCallback(() => {
193
+ const i = M.current;
194
+ if (!i) return;
195
+ const b = i.scrollWidth - i.clientWidth, y = i.scrollLeft > 1, L = i.scrollLeft < b - 1;
196
+ he(
197
+ (K) => K.left === y && K.right === L ? K : { left: y, right: L }
210
198
  );
211
199
  }, []);
212
- o.useEffect(() => {
213
- F();
214
- const c = D.current;
215
- if (!c || typeof ResizeObserver > "u") return;
216
- const m = new ResizeObserver(F);
217
- m.observe(c);
218
- const g = c.querySelector("table");
219
- return g && m.observe(g), () => m.disconnect();
220
- }, [F]);
221
- const [P, B] = o.useState(
200
+ n.useEffect(() => {
201
+ q();
202
+ const i = M.current;
203
+ if (!i || typeof ResizeObserver > "u") return;
204
+ const b = new ResizeObserver(q);
205
+ b.observe(i);
206
+ const y = i.querySelector("table");
207
+ return y && b.observe(y), () => b.disconnect();
208
+ }, [q]);
209
+ const [P, J] = n.useState(
222
210
  null
223
- ), Z = o.useCallback(
224
- (c) => {
225
- B(
226
- (m) => m ?? Array.from(
227
- c.cells,
228
- (g) => g.getBoundingClientRect().width
211
+ ), ee = n.useCallback(
212
+ (i) => {
213
+ J(
214
+ (b) => b ?? Array.from(
215
+ i.cells,
216
+ (y) => y.getBoundingClientRect().width
229
217
  )
230
218
  );
231
219
  },
232
220
  []
233
- ), ee = o.useCallback(
234
- (c, m) => {
235
- B((g) => {
236
- if (!g) return g;
237
- const L = [...g];
238
- return L[c] = Math.max(G, m), L;
239
- });
240
- },
241
- []
242
- ), te = o.useCallback(
243
- () => B(null),
221
+ ), te = n.useCallback((i, b) => {
222
+ J((y) => {
223
+ if (!y) return y;
224
+ const L = [...y];
225
+ return L[i] = Math.max(Q, b), L;
226
+ });
227
+ }, []), re = n.useCallback(
228
+ () => J(null),
244
229
  []
245
- ), be = o.useMemo(
230
+ ), ge = n.useMemo(
246
231
  () => ({
247
- selectionMode: s,
248
- isSelected: k,
249
- toggleKey: M,
250
- toggleAll: H,
232
+ selectionMode: c,
233
+ isSelected: D,
234
+ toggleKey: $,
235
+ toggleAll: I,
251
236
  allSelected: R,
252
- someSelected: $,
253
- isStatic: C,
254
- sortDescriptor: d,
255
- requestSort: v ? f : void 0,
256
- automaticSorting: S,
257
- elevatedActionColumn: w,
258
- resizableColumns: A,
237
+ someSelected: W,
238
+ isStatic: A,
239
+ sortDescriptor: l,
240
+ requestSort: g ? S : void 0,
241
+ automaticSorting: p,
242
+ elevatedActionColumn: e,
243
+ resizableColumns: E,
259
244
  columnWidths: P,
260
- snapshotColumnWidths: Z,
261
- setColumnWidth: ee,
262
- resetColumnWidths: te,
263
- stickyHeader: z != null
245
+ snapshotColumnWidths: ee,
246
+ setColumnWidth: te,
247
+ resetColumnWidths: re,
248
+ stickyHeader: k != null
264
249
  }),
265
250
  [
266
- s,
267
- k,
268
- M,
269
- H,
270
- R,
251
+ c,
252
+ D,
271
253
  $,
272
- C,
273
- d,
274
- v,
275
- S,
276
- f,
277
- w,
254
+ I,
255
+ R,
256
+ W,
278
257
  A,
258
+ l,
259
+ g,
260
+ p,
261
+ S,
262
+ e,
263
+ E,
279
264
  P,
280
- Z,
281
265
  ee,
282
266
  te,
283
- z
267
+ re,
268
+ k
284
269
  ]
285
270
  );
286
- return /* @__PURE__ */ p(ce.Provider, { value: be, children: /* @__PURE__ */ T(
271
+ return /* @__PURE__ */ d(de.Provider, { value: ge, children: /* @__PURE__ */ T(
287
272
  "div",
288
273
  {
289
- "data-scroll-left": I.left ? "true" : "false",
290
- "data-scroll-right": I.right ? "true" : "false",
291
- className: u(
292
- "group/table-shell overflow-clip rounded-2xl bg-table-shell px-1 pb-1",
293
- // Concentric inner radius for the white body card: shell radius
294
- // minus the 4px inset above. Every card corner (cells, viewport,
295
- // pinned caps) derives from this one value.
296
- "[--table-card-radius:calc(var(--radius-2xl)-0.25rem)]",
274
+ "data-slot": "table-container",
275
+ "data-scroll-left": F.left ? "true" : "false",
276
+ "data-scroll-right": F.right ? "true" : "false",
277
+ className: m(
278
+ "group/table-shell overflow-clip rounded-m border border-table-stroke bg-white",
279
+ "[--table-card-radius:var(--radius-m)]",
297
280
  t
298
281
  ),
299
282
  children: [
283
+ a && /* @__PURE__ */ d(
284
+ "div",
285
+ {
286
+ "data-slot": "table-toolbar",
287
+ className: "flex min-h-12 items-center justify-end border-b border-table-stroke px-4 py-2",
288
+ children: a
289
+ }
290
+ ),
300
291
  /* @__PURE__ */ T(
301
292
  "div",
302
293
  {
303
294
  className: "relative",
304
- style: w ? {
305
- "--table-action-column-width": r
295
+ style: e ? {
296
+ "--table-action-column-width": N
306
297
  } : void 0,
307
298
  children: [
308
- /* @__PURE__ */ p(
299
+ /* @__PURE__ */ d(
309
300
  "div",
310
301
  {
311
- ref: D,
312
- onScroll: F,
313
- className: u(
302
+ ref: M,
303
+ onScroll: q,
304
+ className: m(
314
305
  "overflow-x-auto rounded-(--table-card-radius)",
315
- z != null && "overflow-y-auto"
306
+ k != null && "overflow-y-auto"
316
307
  ),
317
- style: z != null ? { maxHeight: z } : void 0,
308
+ style: k != null ? { maxHeight: k } : void 0,
318
309
  children: /* @__PURE__ */ T(
319
310
  "table",
320
311
  {
321
312
  ref: O,
322
313
  "data-slot": "table",
323
- className: u(
324
- "w-full border-separate border-spacing-0 text-base",
314
+ className: m(
315
+ "w-full border-separate border-spacing-0 text-m font-normal",
325
316
  // Manual widths need fixed layout so the <colgroup> wins;
326
317
  // until the first resize the automatic layout is untouched.
327
318
  P && "table-fixed",
328
- e
319
+ r
329
320
  ),
330
- ...W,
321
+ ..._,
331
322
  children: [
332
- P && /* @__PURE__ */ p("colgroup", { children: P.map((c, m) => /* @__PURE__ */ p("col", { style: { width: c } }, m)) }),
333
- _
323
+ P && /* @__PURE__ */ d("colgroup", { children: P.map((i, b) => /* @__PURE__ */ d("col", { style: { width: i } }, b)) }),
324
+ j
334
325
  ]
335
326
  }
336
327
  )
337
328
  }
338
329
  ),
339
- /* @__PURE__ */ p(
330
+ /* @__PURE__ */ d(
340
331
  "div",
341
332
  {
342
333
  "aria-hidden": "true",
343
334
  "data-slot": "table-scroll-hint",
344
- className: u(
335
+ className: m(
345
336
  "pointer-events-none absolute inset-y-0 z-20 w-10",
346
337
  "bg-gradient-to-l from-(--table-scroll-hint) to-transparent",
347
338
  "opacity-0 transition-opacity duration-150 ease-out motion-reduce:transition-none",
348
- I.right && "opacity-100",
349
- w ? "right-[var(--table-action-column-width)]" : "right-0"
339
+ F.right && "opacity-100",
340
+ e ? "right-[var(--table-action-column-width)]" : "right-0"
350
341
  )
351
342
  }
352
343
  ),
353
- w && /* @__PURE__ */ p(
344
+ e && /* @__PURE__ */ d(
354
345
  "div",
355
346
  {
356
347
  "aria-hidden": "true",
357
348
  "data-slot": "table-action-column-elevation",
358
- className: u(
349
+ className: m(
359
350
  "pointer-events-none absolute inset-y-0 right-0 z-20",
360
- "w-[var(--table-action-column-width)]",
361
- "rounded-br-(--table-card-radius)"
351
+ "w-[var(--table-action-column-width)]"
362
352
  // No shadow of its own: while columns hide behind the pinned
363
353
  // surface the scroll-hint gradient is already washing the
364
354
  // seam — stacking a cast on top of it read harsh. The hint
@@ -369,88 +359,97 @@ const Se = o.forwardRef(
369
359
  ]
370
360
  }
371
361
  ),
372
- a && /* @__PURE__ */ p("div", { className: "flex items-center px-4 py-2.5", children: a })
362
+ o && /* @__PURE__ */ d("div", { className: "flex items-center border-t border-table-stroke px-4 py-2.5", children: o })
373
363
  ]
374
364
  }
375
365
  ) });
376
366
  }
377
367
  );
378
- Se.displayName = "Table";
379
- const de = o.forwardRef(({ className: e, ...t }, a) => {
380
- const n = j();
381
- return /* @__PURE__ */ p(Q.Provider, { value: "header", children: /* @__PURE__ */ p(
368
+ ze.displayName = "Table";
369
+ const pe = n.forwardRef(({ className: r, ...t }, a) => {
370
+ const o = B();
371
+ return /* @__PURE__ */ d(Y.Provider, { value: "header", children: /* @__PURE__ */ d(
382
372
  "thead",
383
373
  {
384
374
  ref: a,
385
- className: u(
386
- "text-xs text-muted-foreground",
387
- (n == null ? void 0 : n.elevatedActionColumn) && "relative z-30 bg-table-shell",
388
- e
375
+ className: m(
376
+ "text-s font-medium uppercase text-table-header-foreground",
377
+ (o == null ? void 0 : o.elevatedActionColumn) && "relative z-30 bg-ng1",
378
+ r
389
379
  ),
390
380
  ...t
391
381
  }
392
382
  ) });
393
383
  });
394
- de.displayName = "TableHeader";
395
- const pe = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ p(Q.Provider, { value: "body", children: /* @__PURE__ */ p("tbody", { ref: a, className: u(e), ...t }) }));
396
- pe.displayName = "TableBody";
397
- const Y = o.forwardRef(
398
- ({ className: e, rowKey: t, children: a, ...n }, s) => {
399
- const i = j(), l = o.useContext(Q), h = !!i && i.selectionMode !== "none", w = h && l === "body" && t !== void 0 ? i.isSelected(t) : !1;
400
- return /* @__PURE__ */ T(
384
+ pe.displayName = "TableHeader";
385
+ const fe = n.forwardRef(({ className: r, ...t }, a) => /* @__PURE__ */ d(Y.Provider, { value: "body", children: /* @__PURE__ */ d("tbody", { ref: a, className: m(r), ...t }) }));
386
+ fe.displayName = "TableBody";
387
+ const Z = n.forwardRef(
388
+ ({
389
+ className: r,
390
+ rowKey: t,
391
+ children: a,
392
+ isInteractive: o = !1,
393
+ onClick: s,
394
+ role: c,
395
+ ...u
396
+ }, h) => {
397
+ const f = B(), e = n.useContext(Y), N = !!f && f.selectionMode !== "none", x = e === "body" && !(f != null && f.isStatic) && (o || N || typeof s == "function" || c === "button" || u["aria-expanded"] !== void 0), w = N && e === "body" && t !== void 0 ? f.isSelected(t) : !1;
398
+ return /* @__PURE__ */ d(ie.Provider, { value: x, children: /* @__PURE__ */ T(
401
399
  "tr",
402
400
  {
403
- ref: s,
401
+ ref: h,
402
+ "data-interactive": x || void 0,
404
403
  "data-selected": w || void 0,
405
- className: u("group/row", e),
406
- ...n,
404
+ className: m("group/row", e === "body" && "h-12", r),
405
+ onClick: s,
406
+ role: c,
407
+ ...u,
407
408
  children: [
408
- h && (l === "header" ? /* @__PURE__ */ T(
409
+ N && (e === "header" ? /* @__PURE__ */ T(
409
410
  "th",
410
411
  {
411
412
  scope: "col",
412
- className: u(
413
- "w-10 px-4 py-2.5",
414
- ie,
413
+ className: m(
414
+ "w-10 border-b border-table-stroke px-4 py-2.5",
415
+ ue,
415
416
  // Sticky without the baked shadow — an always-on smudge
416
417
  // muddies the shell's corners (elevation = actionability).
417
418
  // (sticky is positioned, so the ::after tick anchors to it —
418
419
  // no `relative` needed, and it would conflict with sticky.)
419
- "sticky left-0 z-10 bg-table-shell"
420
+ "sticky left-0 z-10",
421
+ ce
420
422
  ),
421
423
  children: [
422
- /* @__PURE__ */ p("span", { className: "sr-only", children: "Row selection" }),
423
- i.selectionMode === "multiple" && /* @__PURE__ */ p(
424
- re,
424
+ /* @__PURE__ */ d("span", { className: "sr-only", children: "Row selection" }),
425
+ f.selectionMode === "multiple" && /* @__PURE__ */ d(
426
+ ne,
425
427
  {
426
428
  size: "sm",
427
429
  "aria-label": "Select all rows",
428
- checked: i.allSelected,
429
- indeterminate: i.someSelected,
430
- onChange: i.toggleAll
430
+ checked: f.allSelected,
431
+ indeterminate: f.someSelected,
432
+ onChange: f.toggleAll
431
433
  }
432
434
  )
433
435
  ]
434
436
  }
435
- ) : /* @__PURE__ */ p(
437
+ ) : /* @__PURE__ */ d(
436
438
  "td",
437
439
  {
438
- className: u(
439
- "w-10 px-4 py-3",
440
- le(i.isStatic),
441
- ve,
442
- "sticky left-0 z-10",
443
- // Same white-behind-white corner problem as pinned data cells.
444
- se("left")
440
+ className: m(
441
+ "h-12 w-10 px-4 py-2",
442
+ le(x),
443
+ "sticky left-0 z-10"
445
444
  ),
446
- onClick: (r) => r.stopPropagation(),
447
- children: t !== void 0 && /* @__PURE__ */ p(
448
- re,
445
+ onClick: (g) => g.stopPropagation(),
446
+ children: t !== void 0 && /* @__PURE__ */ d(
447
+ ne,
449
448
  {
450
449
  size: "sm",
451
450
  "aria-label": `Select ${t}`,
452
451
  checked: w,
453
- onChange: () => i.toggleKey(t)
452
+ onChange: () => f.toggleKey(t)
454
453
  }
455
454
  )
456
455
  }
@@ -458,176 +457,193 @@ const Y = o.forwardRef(
458
457
  a
459
458
  ]
460
459
  }
461
- );
460
+ ) });
462
461
  }
463
462
  );
464
- Y.displayName = "TableRow";
465
- const fe = o.forwardRef(({ className: e, align: t, sticky: a, sortKey: n, allowsSorting: s = !0, _sortColumnIndex: i, children: l, ...h }, w) => {
466
- var U, q, S;
467
- const r = j(), x = (r != null && r.automaticSorting && i !== void 0 ? `${K}${i}` : void 0) ?? n, v = Number(h.colSpan ?? 1) === 1, C = String(X(l)).trim(), A = C.length > 0, z = s && v && a !== "right" && A && !!x && !!(r != null && r.requestSort), W = z && ((U = r == null ? void 0 : r.sortDescriptor) == null ? void 0 : U.column) === x, O = (q = r == null ? void 0 : r.sortDescriptor) == null ? void 0 : q.direction, N = !!(r != null && r.resizableColumns) && v && a !== "right", y = o.useRef(null), [b, k] = o.useState(!1), R = (d) => {
468
- if (d.button !== 0 || !r) return;
469
- const f = d.currentTarget.parentElement, _ = f == null ? void 0 : f.parentElement;
470
- if (!(!f || !_)) {
471
- r.snapshotColumnWidths(_), y.current = {
472
- index: f.cellIndex,
473
- startX: d.clientX,
474
- startWidth: f.getBoundingClientRect().width
475
- }, k(!0);
476
- try {
477
- d.currentTarget.setPointerCapture(d.pointerId);
478
- } catch {
463
+ Z.displayName = "TableRow";
464
+ const be = n.forwardRef(
465
+ ({
466
+ className: r,
467
+ align: t,
468
+ sticky: a,
469
+ sortKey: o,
470
+ allowsSorting: s = !0,
471
+ _sortColumnIndex: c,
472
+ children: u,
473
+ ...h
474
+ }, f) => {
475
+ var I, H, U;
476
+ const e = B(), x = (e != null && e.automaticSorting && c !== void 0 ? `${G}${c}` : void 0) ?? o, w = Number(h.colSpan ?? 1) === 1, g = String(X(u)).trim(), A = g.length > 0, E = s && w && a !== "right" && A && !!x && !!(e != null && e.requestSort), k = E && ((I = e == null ? void 0 : e.sortDescriptor) == null ? void 0 : I.column) === x, _ = (H = e == null ? void 0 : e.sortDescriptor) == null ? void 0 : H.direction, O = !!(e != null && e.resizableColumns) && w && a !== "right", C = n.useRef(null), [z, v] = n.useState(!1), D = (p) => {
477
+ if (p.button !== 0 || !e) return;
478
+ const l = p.currentTarget.parentElement, S = l == null ? void 0 : l.parentElement;
479
+ if (!(!l || !S)) {
480
+ e.snapshotColumnWidths(S), C.current = {
481
+ index: l.cellIndex,
482
+ startX: p.clientX,
483
+ startWidth: l.getBoundingClientRect().width
484
+ }, v(!0);
485
+ try {
486
+ p.currentTarget.setPointerCapture(p.pointerId);
487
+ } catch {
488
+ }
489
+ p.preventDefault();
490
+ }
491
+ }, R = (p) => {
492
+ const l = C.current;
493
+ !l || !e || e.setColumnWidth(
494
+ l.index,
495
+ l.startWidth + (p.clientX - l.startX)
496
+ );
497
+ }, W = () => {
498
+ C.current = null, v(!1);
499
+ }, $ = (p) => {
500
+ if (p.key !== "ArrowLeft" && p.key !== "ArrowRight" || !e) return;
501
+ p.preventDefault();
502
+ const l = p.currentTarget.parentElement, S = l == null ? void 0 : l.parentElement;
503
+ if (!l || !S) return;
504
+ e.snapshotColumnWidths(S);
505
+ const j = p.shiftKey ? 32 : 8, M = p.key === "ArrowRight" ? j : -j;
506
+ e.setColumnWidth(
507
+ l.cellIndex,
508
+ l.getBoundingClientRect().width + M
509
+ );
510
+ };
511
+ return /* @__PURE__ */ T(
512
+ "th",
513
+ {
514
+ ref: f,
515
+ scope: "col",
516
+ "aria-sort": k ? _ === "ascending" ? "ascending" : "descending" : E ? "none" : void 0,
517
+ className: m(
518
+ // whitespace-nowrap: header labels hug their content — the table
519
+ // scrolls horizontally, so wrapping "Null %" to two lines only
520
+ // wastes header height without saving any width.
521
+ "relative whitespace-nowrap border-b border-table-stroke px-4 py-2.5 font-medium uppercase",
522
+ ce,
523
+ ue,
524
+ // The resize handle carries its own tick visual, so drop the
525
+ // decorative one; the last column never shows a handle.
526
+ O && "after:hidden [&:last-child>[data-slot=resize-handle]]:hidden",
527
+ // Capped-height tables scroll under the header: pin it to the
528
+ // viewport top, painted NG1 so rows pass beneath.
529
+ (e == null ? void 0 : e.stickyHeader) && "sticky top-0 z-30",
530
+ se(t),
531
+ a && (a === "right" && (e != null && e.elevatedActionColumn) ? m(
532
+ // Preserve the semantic column width, but do not pin or paint
533
+ // a blank header cell over the labels behind it. Only body
534
+ // action cells participate in the sticky elevated surface.
535
+ "w-[var(--table-action-column-width)]",
536
+ "min-w-[var(--table-action-column-width)]",
537
+ "max-w-[var(--table-action-column-width)]",
538
+ "px-2",
539
+ "bg-transparent"
540
+ ) : ae(a)),
541
+ r
542
+ ),
543
+ ...h,
544
+ children: [
545
+ E ? /* @__PURE__ */ T(
546
+ "button",
547
+ {
548
+ type: "button",
549
+ onClick: () => e.requestSort(x),
550
+ className: m(
551
+ "group/sort -mx-1 inline-flex items-center gap-1 rounded px-1 uppercase outline-none transition-colors",
552
+ "hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
553
+ t === "right" && "flex-row-reverse",
554
+ k && "font-medium"
555
+ ),
556
+ children: [
557
+ u,
558
+ k ? _ === "ascending" ? /* @__PURE__ */ d(ve, { className: "size-3.5" }) : /* @__PURE__ */ d(we, { className: "size-3.5" }) : /* @__PURE__ */ d(ye, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
559
+ ]
560
+ }
561
+ ) : A ? u : /* @__PURE__ */ d("span", { className: "sr-only", children: h["aria-label"] ?? "Table column" }),
562
+ O && /* @__PURE__ */ d(
563
+ "span",
564
+ {
565
+ "data-slot": "resize-handle",
566
+ role: "separator",
567
+ "aria-orientation": "vertical",
568
+ "aria-label": `Resize ${g || "this"} column`,
569
+ "aria-valuemin": Q,
570
+ "aria-valuemax": 2e3,
571
+ "aria-valuenow": ((U = e == null ? void 0 : e.columnWidths) == null ? void 0 : U[c ?? -1]) ?? Q,
572
+ tabIndex: 0,
573
+ "data-resizing": z ? "true" : void 0,
574
+ onPointerDown: D,
575
+ onPointerMove: R,
576
+ onPointerUp: W,
577
+ onPointerCancel: W,
578
+ onKeyDown: $,
579
+ onDoubleClick: () => e == null ? void 0 : e.resetColumnWidths(),
580
+ className: m(
581
+ // 12px hit area straddling the column edge; the 1px tick inside
582
+ // is the visible affordance (it replaces the decorative one).
583
+ "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",
584
+ "focus-visible:ring-2 focus-visible:ring-ring"
585
+ ),
586
+ children: /* @__PURE__ */ d(
587
+ "span",
588
+ {
589
+ "aria-hidden": "true",
590
+ className: m(
591
+ "h-4 w-px rounded-sm bg-border-strong",
592
+ "transition-[transform,background-color] duration-150 ease-out motion-reduce:transition-none",
593
+ "group-hover/resize:scale-y-125 group-hover/resize:bg-foreground/60",
594
+ "group-focus-visible/resize:scale-y-125 group-focus-visible/resize:bg-foreground/60",
595
+ "group-data-[resizing]/resize:scale-y-125 group-data-[resizing]/resize:bg-foreground/60"
596
+ )
597
+ }
598
+ )
599
+ }
600
+ )
601
+ ]
479
602
  }
480
- d.preventDefault();
481
- }
482
- }, $ = (d) => {
483
- const f = y.current;
484
- !f || !r || r.setColumnWidth(
485
- f.index,
486
- f.startWidth + (d.clientX - f.startX)
487
603
  );
488
- }, M = () => {
489
- y.current = null, k(!1);
490
- }, H = (d) => {
491
- if (d.key !== "ArrowLeft" && d.key !== "ArrowRight" || !r) return;
492
- d.preventDefault();
493
- const f = d.currentTarget.parentElement, _ = f == null ? void 0 : f.parentElement;
494
- if (!f || !_) return;
495
- r.snapshotColumnWidths(_);
496
- const D = d.shiftKey ? 32 : 8, I = d.key === "ArrowRight" ? D : -D;
497
- r.setColumnWidth(f.cellIndex, f.getBoundingClientRect().width + I);
498
- };
499
- return /* @__PURE__ */ T(
500
- "th",
501
- {
502
- ref: w,
503
- scope: "col",
504
- "aria-sort": W ? O === "ascending" ? "ascending" : "descending" : z ? "none" : void 0,
505
- className: u(
506
- // whitespace-nowrap: header labels hug their content — the table
507
- // scrolls horizontally, so wrapping "Null %" to two lines only
508
- // wastes header height without saving any width.
509
- "relative whitespace-nowrap px-4 py-2.5 font-normal",
510
- ie,
511
- // The resize handle carries its own tick visual, so drop the
512
- // decorative one; the last column never shows a handle.
513
- N && "after:hidden [&:last-child>[data-slot=resize-handle]]:hidden",
514
- // Capped-height tables scroll under the header: pin it to the
515
- // viewport top, painted on the shell gray so rows pass beneath.
516
- (r == null ? void 0 : r.stickyHeader) && "sticky top-0 z-30 bg-table-shell",
517
- ne(t),
518
- a && (a === "right" && (r != null && r.elevatedActionColumn) ? u(
519
- // Preserve the semantic column width, but do not pin or paint
520
- // a blank header cell over the labels behind it. Only body
521
- // action cells participate in the sticky elevated surface.
522
- "w-[var(--table-action-column-width)]",
523
- "min-w-[var(--table-action-column-width)]",
524
- "max-w-[var(--table-action-column-width)]",
525
- "bg-transparent"
526
- ) : u(ae(a), "bg-table-shell")),
527
- e
528
- ),
529
- ...h,
530
- children: [
531
- z ? /* @__PURE__ */ T(
532
- "button",
533
- {
534
- type: "button",
535
- onClick: () => r.requestSort(x),
536
- className: u(
537
- "group/sort -mx-1 inline-flex items-center gap-1 rounded px-1 outline-none transition-colors",
538
- "hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
539
- t === "right" && "flex-row-reverse",
540
- W && "text-foreground"
541
- ),
542
- children: [
543
- l,
544
- W ? O === "ascending" ? /* @__PURE__ */ p(ge, { className: "size-3.5" }) : /* @__PURE__ */ p(he, { className: "size-3.5" }) : /* @__PURE__ */ p(we, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
545
- ]
546
- }
547
- ) : A ? l : /* @__PURE__ */ p("span", { className: "sr-only", children: h["aria-label"] ?? "Table column" }),
548
- N && /* @__PURE__ */ p(
549
- "span",
550
- {
551
- "data-slot": "resize-handle",
552
- role: "separator",
553
- "aria-orientation": "vertical",
554
- "aria-label": `Resize ${C || "this"} column`,
555
- "aria-valuemin": G,
556
- "aria-valuemax": 2e3,
557
- "aria-valuenow": ((S = r == null ? void 0 : r.columnWidths) == null ? void 0 : S[i ?? -1]) ?? G,
558
- tabIndex: 0,
559
- "data-resizing": b ? "true" : void 0,
560
- onPointerDown: R,
561
- onPointerMove: $,
562
- onPointerUp: M,
563
- onPointerCancel: M,
564
- onKeyDown: H,
565
- onDoubleClick: () => r == null ? void 0 : r.resetColumnWidths(),
566
- className: u(
567
- // 12px hit area straddling the column edge; the 1px tick inside
568
- // is the visible affordance (it replaces the decorative one).
569
- "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",
570
- "focus-visible:ring-2 focus-visible:ring-ring"
571
- ),
572
- children: /* @__PURE__ */ p(
573
- "span",
574
- {
575
- "aria-hidden": "true",
576
- className: u(
577
- "h-4 w-px rounded-sm bg-border-strong",
578
- "transition-[transform,background-color] duration-150 ease-out motion-reduce:transition-none",
579
- "group-hover/resize:scale-y-125 group-hover/resize:bg-foreground/60",
580
- "group-focus-visible/resize:scale-y-125 group-focus-visible/resize:bg-foreground/60",
581
- "group-data-[resizing]/resize:scale-y-125 group-data-[resizing]/resize:bg-foreground/60"
582
- )
583
- }
584
- )
585
- }
586
- )
587
- ]
588
- }
589
- );
590
- });
591
- fe.displayName = "TableColumn";
592
- const ke = o.forwardRef(
593
- ({ className: e, align: t, sticky: a, sortValue: n, ...s }, i) => {
594
- const l = j(), h = a === "right" && (l == null ? void 0 : l.elevatedActionColumn);
595
- return /* @__PURE__ */ p(
604
+ }
605
+ );
606
+ be.displayName = "TableColumn";
607
+ const Se = n.forwardRef(
608
+ ({ className: r, align: t, sticky: a, sortValue: o, ...s }, c) => {
609
+ const u = B(), h = n.useContext(ie), f = a === "right" && (u == null ? void 0 : u.elevatedActionColumn);
610
+ return /* @__PURE__ */ d(
596
611
  "td",
597
612
  {
598
- ref: i,
599
- "data-sort-value": n instanceof Date ? n.toISOString() : n,
600
- className: u(
613
+ ref: c,
614
+ "data-sort-value": o instanceof Date ? o.toISOString() : o,
615
+ className: m(
601
616
  // whitespace-nowrap: cell content never wraps — the table's
602
617
  // overflow-x-auto viewport scrolls horizontally instead, matching the
603
618
  // header cells. Opt back into wrapping with `whitespace-normal` for
604
619
  // deliberate multi-line content (e.g. an EmptyState in a colSpan cell).
605
- "whitespace-nowrap px-4 py-3",
606
- le((l == null ? void 0 : l.isStatic) ?? !1),
607
- ye,
608
- ne(t),
609
- a && ae(a, l == null ? void 0 : l.elevatedActionColumn),
610
- a && se(a),
611
- h && u(
620
+ "h-12 whitespace-nowrap px-4 py-2",
621
+ le(h),
622
+ se(t),
623
+ a && ae(a, u == null ? void 0 : u.elevatedActionColumn),
624
+ f && m(
612
625
  "w-[var(--table-action-column-width)]",
613
626
  "min-w-[var(--table-action-column-width)]",
614
627
  "max-w-[var(--table-action-column-width)]",
628
+ "px-2",
615
629
  "bg-elevated",
630
+ // Keep the action column off the zebra wash.
631
+ "group-even/row:bg-elevated",
616
632
  "group-hover/row:bg-elevated group-focus-within/row:bg-elevated"
617
633
  ),
618
- e
634
+ r
619
635
  ),
620
636
  ...s
621
637
  }
622
638
  );
623
639
  }
624
640
  );
625
- ke.displayName = "TableCell";
641
+ Se.displayName = "TableCell";
626
642
  export {
627
- Se as Table,
628
- pe as TableBody,
629
- ke as TableCell,
630
- fe as TableColumn,
631
- de as TableHeader,
632
- Y as TableRow
643
+ ze as Table,
644
+ fe as TableBody,
645
+ Se as TableCell,
646
+ be as TableColumn,
647
+ pe as TableHeader,
648
+ Z as TableRow
633
649
  };