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