@actioneer/ads 0.5.6 → 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.
- package/components/agent-icon.js +3 -2
- package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
- package/components/ai-elements/chain-of-thought-icon.js +341 -201
- package/components/ai-elements/chain-of-thought.d.ts +1 -1
- package/components/answer-sources.d.ts +42 -0
- package/components/answer-sources.js +111 -0
- package/components/assistant-ui/attachment.js +39 -39
- package/components/assistant-ui/composer-harness.js +5 -4
- package/components/assistant-ui/thread-context.d.ts +2 -0
- package/components/assistant-ui/thread.js +41 -40
- package/components/avatar.js +14 -14
- package/components/dropdown.d.ts +1 -1
- package/components/dropdown.js +1 -1
- package/components/empty-state.d.ts +4 -4
- package/components/index.d.ts +1 -0
- package/components/index.js +408 -403
- package/components/infinite-canvas.js +1 -1
- package/components/pixel-icon.d.ts +3 -1
- package/components/pixel-icon.js +294 -214
- package/components/segmented.d.ts +4 -1
- package/components/segmented.js +9 -8
- package/components/sidebar.d.ts +2 -2
- package/components/switch.js +22 -4
- package/components/table.d.ts +15 -7
- package/components/table.js +313 -199
- package/components/textarea.js +1 -2
- package/components/tooltip.js +1 -1
- package/components/ui/tooltip.js +5 -5
- package/lib/icons.d.ts +8 -0
- package/lib/icons.js +103 -101
- package/llms.txt +17 -8
- package/manifest.json +107 -14
- package/package.json +1 -1
- package/styles.css +42 -47
- package/theme.css +24 -45
package/components/table.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as d, jsxs as A } from "react/jsx-runtime";
|
|
3
3
|
import * as a from "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as u } from "../lib/cn.js";
|
|
5
5
|
import { Checkbox as j } from "./checkbox.js";
|
|
6
|
-
import { ChevronUp as
|
|
7
|
-
const
|
|
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
|
-
) :
|
|
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
|
-
!
|
|
18
|
-
) : void 0,
|
|
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-
|
|
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-
|
|
21
|
-
) :
|
|
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-
|
|
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-
|
|
24
|
-
),
|
|
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
|
-
!
|
|
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
|
-
),
|
|
37
|
-
"group-first/row:rounded-tl-
|
|
38
|
-
"group-last/row:rounded-bl-
|
|
39
|
-
),
|
|
40
|
-
"group-first/row:first:rounded-tl-
|
|
41
|
-
"group-first/row:last:rounded-tr-
|
|
42
|
-
"group-last/row:first:rounded-bl-
|
|
43
|
-
"group-last/row:last:rounded-br-
|
|
44
|
-
),
|
|
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
|
-
),
|
|
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:
|
|
51
|
-
wrapperClassName:
|
|
52
|
-
footer:
|
|
53
|
-
children:
|
|
54
|
-
selectionMode:
|
|
55
|
-
selectedKeys:
|
|
56
|
-
onSelectionChange:
|
|
57
|
-
rowKeys:
|
|
58
|
-
elevatedActionColumn:
|
|
59
|
-
actionColumnWidth:
|
|
60
|
-
sortDescriptor:
|
|
61
|
-
onSortChange:
|
|
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
|
-
...
|
|
64
|
-
},
|
|
65
|
-
const
|
|
66
|
-
(
|
|
67
|
-
[
|
|
68
|
-
),
|
|
69
|
-
(
|
|
70
|
-
if (!
|
|
71
|
-
if (
|
|
72
|
-
|
|
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
|
|
76
|
-
|
|
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
|
-
[
|
|
79
|
-
),
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
(
|
|
83
|
-
if (!
|
|
84
|
-
const
|
|
85
|
-
|
|
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
|
-
[
|
|
88
|
-
),
|
|
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
|
-
}),
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
(
|
|
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
|
|
102
|
-
if (!
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
return
|
|
107
|
-
}, [
|
|
108
|
-
const
|
|
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:
|
|
111
|
-
isSelected:
|
|
112
|
-
toggleKey:
|
|
113
|
-
toggleAll:
|
|
114
|
-
allSelected:
|
|
115
|
-
someSelected:
|
|
221
|
+
selectionMode: o,
|
|
222
|
+
isSelected: R,
|
|
223
|
+
toggleKey: F,
|
|
224
|
+
toggleAll: I,
|
|
225
|
+
allSelected: k,
|
|
226
|
+
someSelected: q,
|
|
116
227
|
isStatic: x,
|
|
117
|
-
sortDescriptor:
|
|
118
|
-
requestSort:
|
|
119
|
-
|
|
228
|
+
sortDescriptor: y,
|
|
229
|
+
requestSort: g ? B : void 0,
|
|
230
|
+
automaticSorting: T,
|
|
231
|
+
elevatedActionColumn: f
|
|
120
232
|
}),
|
|
121
233
|
[
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
234
|
+
o,
|
|
235
|
+
R,
|
|
236
|
+
F,
|
|
237
|
+
I,
|
|
238
|
+
k,
|
|
239
|
+
q,
|
|
128
240
|
x,
|
|
129
|
-
|
|
130
|
-
|
|
241
|
+
y,
|
|
242
|
+
g,
|
|
243
|
+
T,
|
|
131
244
|
B,
|
|
132
|
-
|
|
245
|
+
f
|
|
133
246
|
]
|
|
134
247
|
);
|
|
135
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ d(Z.Provider, { value: le, children: /* @__PURE__ */ A(
|
|
136
249
|
"div",
|
|
137
250
|
{
|
|
138
|
-
"data-scroll-left":
|
|
139
|
-
"data-scroll-right":
|
|
140
|
-
className:
|
|
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
|
-
|
|
255
|
+
t
|
|
143
256
|
),
|
|
144
257
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ A(
|
|
146
259
|
"div",
|
|
147
260
|
{
|
|
148
261
|
className: "relative",
|
|
149
|
-
style:
|
|
150
|
-
"--table-action-column-width":
|
|
262
|
+
style: f ? {
|
|
263
|
+
"--table-action-column-width": i
|
|
151
264
|
} : void 0,
|
|
152
265
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ d(
|
|
154
267
|
"div",
|
|
155
268
|
{
|
|
156
|
-
ref:
|
|
157
|
-
onScroll:
|
|
158
|
-
className: "overflow-x-auto rounded-
|
|
159
|
-
children: /* @__PURE__ */
|
|
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:
|
|
277
|
+
className: u(
|
|
165
278
|
"w-full border-separate border-spacing-0 text-base",
|
|
166
|
-
|
|
279
|
+
e
|
|
167
280
|
),
|
|
168
|
-
...
|
|
169
|
-
children:
|
|
281
|
+
...C,
|
|
282
|
+
children: ae
|
|
170
283
|
}
|
|
171
284
|
)
|
|
172
285
|
}
|
|
173
286
|
),
|
|
174
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ d(
|
|
175
288
|
"div",
|
|
176
289
|
{
|
|
177
290
|
"aria-hidden": "true",
|
|
178
291
|
"data-slot": "table-scroll-hint",
|
|
179
|
-
className:
|
|
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
|
-
|
|
184
|
-
|
|
296
|
+
L.right && "opacity-100",
|
|
297
|
+
f ? "right-[var(--table-action-column-width)]" : "right-0"
|
|
185
298
|
)
|
|
186
299
|
}
|
|
187
300
|
),
|
|
188
|
-
|
|
301
|
+
f && /* @__PURE__ */ d(
|
|
189
302
|
"div",
|
|
190
303
|
{
|
|
191
304
|
"aria-hidden": "true",
|
|
192
305
|
"data-slot": "table-action-column-elevation",
|
|
193
|
-
className:
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
return /* @__PURE__ */
|
|
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:
|
|
220
|
-
className:
|
|
332
|
+
ref: n,
|
|
333
|
+
className: u(
|
|
221
334
|
"text-xs text-muted-foreground",
|
|
222
|
-
(
|
|
223
|
-
|
|
335
|
+
(r == null ? void 0 : r.elevatedActionColumn) && "relative z-30 bg-table-shell",
|
|
336
|
+
e
|
|
224
337
|
),
|
|
225
|
-
...
|
|
338
|
+
...t
|
|
226
339
|
}
|
|
227
340
|
) });
|
|
228
341
|
});
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
({ className:
|
|
234
|
-
const
|
|
235
|
-
return /* @__PURE__ */
|
|
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:
|
|
239
|
-
"data-selected":
|
|
240
|
-
className:
|
|
241
|
-
...
|
|
351
|
+
ref: o,
|
|
352
|
+
"data-selected": f || void 0,
|
|
353
|
+
className: u("group/row", e),
|
|
354
|
+
...r,
|
|
242
355
|
children: [
|
|
243
|
-
|
|
356
|
+
b && (s === "header" ? /* @__PURE__ */ d(
|
|
244
357
|
"th",
|
|
245
358
|
{
|
|
246
359
|
scope: "col",
|
|
247
|
-
className:
|
|
360
|
+
className: u(
|
|
248
361
|
"w-10 px-4 py-2.5",
|
|
249
|
-
|
|
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:
|
|
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:
|
|
262
|
-
indeterminate:
|
|
263
|
-
onChange:
|
|
374
|
+
checked: l.allSelected,
|
|
375
|
+
indeterminate: l.someSelected,
|
|
376
|
+
onChange: l.toggleAll
|
|
264
377
|
}
|
|
265
378
|
)
|
|
266
379
|
}
|
|
267
|
-
) : /* @__PURE__ */
|
|
380
|
+
) : /* @__PURE__ */ d(
|
|
268
381
|
"td",
|
|
269
382
|
{
|
|
270
|
-
className:
|
|
383
|
+
className: u(
|
|
271
384
|
"w-10 px-4 py-3",
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
389
|
+
G("left")
|
|
277
390
|
),
|
|
278
|
-
onClick: (
|
|
279
|
-
children:
|
|
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 ${
|
|
284
|
-
checked:
|
|
285
|
-
onChange: () =>
|
|
396
|
+
"aria-label": `Select ${t}`,
|
|
397
|
+
checked: f,
|
|
398
|
+
onChange: () => l.toggleKey(t)
|
|
286
399
|
}
|
|
287
400
|
)
|
|
288
401
|
}
|
|
289
402
|
)),
|
|
290
|
-
|
|
403
|
+
n
|
|
291
404
|
]
|
|
292
405
|
}
|
|
293
406
|
);
|
|
294
407
|
}
|
|
295
408
|
);
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
var
|
|
299
|
-
const l =
|
|
300
|
-
return /* @__PURE__ */
|
|
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:
|
|
416
|
+
ref: f,
|
|
304
417
|
scope: "col",
|
|
305
|
-
"aria-sort":
|
|
306
|
-
className:
|
|
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
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
) :
|
|
322
|
-
|
|
434
|
+
) : u(X(n), "bg-table-shell")),
|
|
435
|
+
e
|
|
323
436
|
),
|
|
324
|
-
...
|
|
325
|
-
children:
|
|
437
|
+
...b,
|
|
438
|
+
children: C ? /* @__PURE__ */ A(
|
|
326
439
|
"button",
|
|
327
440
|
{
|
|
328
441
|
type: "button",
|
|
329
|
-
onClick: () =>
|
|
330
|
-
className:
|
|
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
|
-
|
|
334
|
-
|
|
446
|
+
t === "right" && "flex-row-reverse",
|
|
447
|
+
_ && "text-foreground"
|
|
335
448
|
),
|
|
336
449
|
children: [
|
|
337
|
-
|
|
338
|
-
|
|
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
|
-
) :
|
|
454
|
+
) : s
|
|
342
455
|
}
|
|
343
456
|
);
|
|
344
457
|
});
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
({ className:
|
|
348
|
-
const
|
|
349
|
-
return /* @__PURE__ */
|
|
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:
|
|
353
|
-
|
|
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
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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
|
-
|
|
485
|
+
e
|
|
372
486
|
),
|
|
373
|
-
...
|
|
487
|
+
...o
|
|
374
488
|
}
|
|
375
489
|
);
|
|
376
490
|
}
|
|
377
491
|
);
|
|
378
|
-
|
|
492
|
+
we.displayName = "TableCell";
|
|
379
493
|
export {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
|
};
|