@actioneer/ads 0.5.7 → 0.5.9
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/bin/ads-init.mjs +6 -0
- package/components/accordion.js +50 -48
- package/components/agent-icon.d.ts +12 -0
- package/components/agent-icon.js +133 -120
- package/components/ai-elements/chain-of-thought.d.ts +1 -1
- package/components/ai-elements/chain-of-thought.js +108 -108
- package/components/ai-elements/chart.js +16 -14
- package/components/ai-elements/inline-citation.js +41 -41
- package/components/ai-elements/message.js +4 -4
- package/components/ai-elements/queue.js +7 -7
- package/components/ai-elements/research-activity.js +114 -114
- package/components/ai-elements/shimmer.d.ts +2 -2
- package/components/ai-elements/speech-input.js +28 -28
- package/components/ai-elements/task-progress.js +26 -16
- package/components/ai-elements/task.js +17 -17
- package/components/ai-elements/tool.js +6 -6
- package/components/ai-elements/transcript.js +6 -5
- package/components/ai-elements/voice.js +1 -1
- package/components/alert.js +10 -10
- package/components/answer-sources.js +1 -1
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +103 -75
- package/components/assistant-ui/badge.d.ts +1 -1
- package/components/assistant-ui/badge.js +17 -17
- package/components/assistant-ui/chain-of-thought.d.ts +1 -1
- package/components/assistant-ui/composer-add-context.js +9 -9
- package/components/assistant-ui/composer-deep-research.js +5 -5
- package/components/assistant-ui/composer-harness.js +11 -9
- package/components/assistant-ui/composer-trigger-popover.js +45 -34
- package/components/assistant-ui/composer.js +59 -59
- package/components/assistant-ui/error.js +14 -14
- package/components/assistant-ui/file.d.ts +1 -1
- package/components/assistant-ui/image.d.ts +1 -1
- package/components/assistant-ui/image.js +113 -103
- package/components/assistant-ui/markdown-text.js +18 -18
- package/components/assistant-ui/message.js +46 -45
- package/components/assistant-ui/quote.js +1 -1
- package/components/assistant-ui/reasoning.d.ts +1 -1
- package/components/assistant-ui/reasoning.js +66 -77
- package/components/assistant-ui/suggestions.js +4 -4
- package/components/assistant-ui/thread.js +22 -22
- package/components/assistant-ui/tool-fallback.js +60 -63
- package/components/assistant-ui/tool-group.d.ts +1 -1
- package/components/assistant-ui/tool-group.js +36 -42
- package/components/audio-waveform.js +25 -24
- package/components/autocomplete.d.ts +1 -0
- package/components/autocomplete.js +45 -43
- package/components/avatar.d.ts +1 -0
- package/components/avatar.js +27 -26
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.d.ts +2 -0
- package/components/breadcrumbs.js +52 -50
- package/components/button.d.ts +2 -2
- package/components/button.js +22 -20
- package/components/card.js +8 -8
- package/components/carousel.js +105 -104
- package/components/chart.d.ts +6 -0
- package/components/chart.js +743 -672
- package/components/checkbox.js +74 -38
- package/components/chip.d.ts +1 -1
- package/components/code-block.js +3 -3
- package/components/collapsible.js +67 -23
- package/components/connector-card.js +6 -6
- package/components/drawer.d.ts +18 -11
- package/components/drawer.js +81 -78
- package/components/dropdown.d.ts +2 -0
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +1 -1
- package/components/empty-state.js +7 -7
- package/components/field.d.ts +4 -0
- package/components/field.js +45 -34
- package/components/file-dropzone.js +12 -12
- package/components/index.d.ts +3 -0
- package/components/index.js +584 -558
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.d.ts +5 -1
- package/components/modal.js +121 -76
- package/components/navbar.d.ts +1 -1
- package/components/navbar.js +1 -1
- package/components/number-field.js +38 -29
- package/components/page-header.js +12 -12
- package/components/pagination.js +19 -19
- package/components/panel.js +2 -2
- package/components/pixel-blast-svg.js +3 -3
- package/components/pixel-icon.d.ts +4 -0
- package/components/pixel-icon.js +210 -164
- package/components/popover.d.ts +1 -1
- package/components/popover.js +66 -64
- package/components/progress-circle.js +36 -32
- package/components/progress.js +28 -24
- package/components/radio.js +59 -49
- package/components/resizable-panel.js +1 -1
- package/components/reveal.d.ts +2 -2
- package/components/ripple.d.ts +3 -3
- package/components/scroll-area.js +17 -16
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +39 -36
- package/components/select.d.ts +7 -0
- package/components/select.js +186 -137
- package/components/setting-row.js +45 -42
- package/components/sidebar.js +131 -127
- package/components/skeleton.js +5 -5
- package/components/spinner.d.ts +13 -4
- package/components/spinner.js +42 -42
- package/components/stepper.js +21 -21
- package/components/switch.js +41 -39
- package/components/table.d.ts +16 -0
- package/components/table.js +393 -260
- package/components/tabs.js +149 -137
- package/components/toast.js +66 -66
- package/components/tooltip.js +2 -2
- package/components/tree.js +62 -51
- package/components/typography.d.ts +2 -1
- package/components/typography.js +33 -32
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +19 -19
- package/components/ui/collapsible.d.ts +1 -5
- package/components/ui/dialog.d.ts +3 -3
- package/components/ui/dialog.js +95 -58
- package/components/ui/tooltip.d.ts +2 -2
- package/components/ui/tooltip.js +67 -33
- package/components/viz-charts.js +95 -95
- package/demo/components/add-to-artifact.js +363 -0
- package/demo/lib/artifact-library.js +142 -0
- package/demo/lib/artifact-pin-guard.js +12 -0
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
- package/fonts.css +11 -11
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
- package/lib/icons.d.ts +24 -0
- package/lib/icons.js +114 -108
- package/lib/motion.d.ts +42 -39
- package/lib/motion.js +112 -52
- package/lib/spinner-mark.d.ts +9 -0
- package/lib/spinner-mark.js +98 -0
- package/llms.txt +53 -19
- package/manifest.json +258 -36
- package/package.json +1 -1
- package/styles.css +143 -124
- package/theme.css +90 -93
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
package/components/table.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as p, jsxs as T } from "react/jsx-runtime";
|
|
3
|
+
import * as o from "react";
|
|
4
4
|
import { cn as u } from "../lib/cn.js";
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { ChevronUp as
|
|
7
|
-
const
|
|
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(
|
|
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
|
|
@@ -15,13 +15,13 @@ const W = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" :
|
|
|
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,
|
|
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-
|
|
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
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-
|
|
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
|
-
),
|
|
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(
|
|
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",
|
|
@@ -33,45 +33,45 @@ const W = (e) => e === "center" ? "text-center" : e === "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
|
+
), 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(
|
|
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
|
+
), K = "__ads_table_column_", G = 64, xe = new Intl.Collator(void 0, {
|
|
49
49
|
numeric: !0,
|
|
50
50
|
sensitivity: "base"
|
|
51
51
|
});
|
|
52
|
-
function
|
|
52
|
+
function V(e) {
|
|
53
53
|
const t = [];
|
|
54
|
-
return
|
|
55
|
-
if (
|
|
56
|
-
t.push(...
|
|
54
|
+
return o.Children.forEach(e, (a) => {
|
|
55
|
+
if (o.isValidElement(a) && a.type === o.Fragment) {
|
|
56
|
+
t.push(...V(a.props.children));
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
t.push(
|
|
59
|
+
t.push(a);
|
|
60
60
|
}), t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function X(e) {
|
|
63
63
|
if (e == null || typeof e == "boolean")
|
|
64
64
|
return "";
|
|
65
65
|
if (typeof e == "number" || typeof e == "string") return e;
|
|
66
66
|
if (Array.isArray(e))
|
|
67
|
-
return e.map((
|
|
68
|
-
if (!
|
|
67
|
+
return e.map((n) => String(X(n))).join(" ").trim();
|
|
68
|
+
if (!o.isValidElement(e)) return "";
|
|
69
69
|
const t = e.props.sortValue;
|
|
70
70
|
if (typeof t == "string" || typeof t == "number" || t instanceof Date)
|
|
71
71
|
return t;
|
|
72
|
-
const
|
|
73
|
-
if (String(
|
|
74
|
-
for (const
|
|
72
|
+
const a = X(e.props.children);
|
|
73
|
+
if (String(a).trim()) return a;
|
|
74
|
+
for (const n of [
|
|
75
75
|
"value",
|
|
76
76
|
"label",
|
|
77
77
|
"status",
|
|
@@ -79,12 +79,12 @@ function D(e) {
|
|
|
79
79
|
"title",
|
|
80
80
|
"health"
|
|
81
81
|
]) {
|
|
82
|
-
const
|
|
83
|
-
if (typeof
|
|
82
|
+
const s = e.props[n];
|
|
83
|
+
if (typeof s == "string" || typeof s == "number") return s;
|
|
84
84
|
}
|
|
85
85
|
return "";
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function oe(e) {
|
|
88
88
|
if (e instanceof Date)
|
|
89
89
|
return { kind: "number", value: e.getTime() };
|
|
90
90
|
if (typeof e == "number")
|
|
@@ -92,199 +92,251 @@ function J(e) {
|
|
|
92
92
|
const t = e.trim();
|
|
93
93
|
if (!t || t === "—" || t === "-")
|
|
94
94
|
return { kind: "empty", value: "" };
|
|
95
|
-
const
|
|
96
|
-
if (/^[+-]?(?:\d+\.?\d*|\.\d+)$/.test(
|
|
97
|
-
return { kind: "number", value: Number(
|
|
98
|
-
const
|
|
99
|
-
return Number.isNaN(
|
|
95
|
+
const a = t.replace(/[,\s]/g, "").replace(/^[₹$€£]/, "").replace(/%$/, "");
|
|
96
|
+
if (/^[+-]?(?:\d+\.?\d*|\.\d+)$/.test(a))
|
|
97
|
+
return { kind: "number", value: Number(a) };
|
|
98
|
+
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
|
+
return Number.isNaN(s) ? { kind: "text", value: t } : { kind: "number", value: s };
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
return
|
|
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;
|
|
104
|
+
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;
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
110
|
-
const t = [],
|
|
111
|
-
if (!
|
|
112
|
-
return
|
|
113
|
-
let
|
|
114
|
-
const
|
|
115
|
-
if (!
|
|
116
|
-
for (; (t[
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
for (let
|
|
120
|
-
t[
|
|
121
|
-
t[
|
|
122
|
-
|
|
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)
|
|
112
|
+
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
|
|
123
123
|
);
|
|
124
|
-
return
|
|
124
|
+
return l += E, r.type !== fe ? r : o.cloneElement(r, { _sortColumnIndex: v });
|
|
125
125
|
});
|
|
126
|
-
return
|
|
126
|
+
return o.cloneElement(s, void 0, w);
|
|
127
127
|
});
|
|
128
|
-
return
|
|
128
|
+
return o.cloneElement(e, void 0, n);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
const
|
|
132
|
-
if (!
|
|
133
|
-
return { row:
|
|
134
|
-
const
|
|
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);
|
|
135
135
|
return {
|
|
136
|
-
row:
|
|
137
|
-
index:
|
|
138
|
-
value:
|
|
136
|
+
row: s,
|
|
137
|
+
index: i,
|
|
138
|
+
value: X(l[t])
|
|
139
139
|
};
|
|
140
140
|
});
|
|
141
|
-
return
|
|
141
|
+
return n.sort((s, i) => Ce(s.value, i.value, a) || s.index - i.index), o.cloneElement(
|
|
142
142
|
e,
|
|
143
143
|
void 0,
|
|
144
|
-
|
|
144
|
+
n.map(({ row: s }) => s)
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
const
|
|
149
|
-
return
|
|
150
|
-
|
|
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,
|
|
151
151
|
void 0,
|
|
152
|
-
|
|
153
|
-
) :
|
|
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);
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const Se = o.forwardRef(
|
|
156
156
|
({
|
|
157
157
|
className: e,
|
|
158
158
|
wrapperClassName: t,
|
|
159
|
-
footer:
|
|
160
|
-
children:
|
|
161
|
-
selectionMode:
|
|
162
|
-
selectedKeys:
|
|
163
|
-
onSelectionChange:
|
|
164
|
-
rowKeys:
|
|
165
|
-
elevatedActionColumn:
|
|
166
|
-
actionColumnWidth:
|
|
167
|
-
sortDescriptor:
|
|
168
|
-
onSortChange:
|
|
169
|
-
allowsSorting:
|
|
170
|
-
isStatic:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
|
174
|
+
}, 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(
|
|
177
179
|
(c) => {
|
|
178
|
-
if (!
|
|
179
|
-
if (
|
|
180
|
-
|
|
180
|
+
if (!l) return;
|
|
181
|
+
if (s === "single") {
|
|
182
|
+
l(k(c) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([c]));
|
|
181
183
|
return;
|
|
182
184
|
}
|
|
183
|
-
const m = new Set(
|
|
184
|
-
m.has(c) ? m.delete(c) : m.add(c),
|
|
185
|
+
const m = new Set(y ? N : b ?? /* @__PURE__ */ new Set());
|
|
186
|
+
m.has(c) ? m.delete(c) : m.add(c), l(m);
|
|
185
187
|
},
|
|
186
|
-
[
|
|
187
|
-
),
|
|
188
|
-
|
|
189
|
-
}, [
|
|
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(
|
|
190
192
|
(c) => {
|
|
191
|
-
if (!
|
|
192
|
-
const m = (
|
|
193
|
-
|
|
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);
|
|
194
196
|
},
|
|
195
|
-
[
|
|
196
|
-
),
|
|
197
|
-
() =>
|
|
198
|
-
[
|
|
199
|
-
),
|
|
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({
|
|
200
202
|
left: !1,
|
|
201
203
|
right: !1
|
|
202
|
-
}),
|
|
203
|
-
const c =
|
|
204
|
+
}), F = o.useCallback(() => {
|
|
205
|
+
const c = D.current;
|
|
204
206
|
if (!c) return;
|
|
205
|
-
const m = c.scrollWidth - c.clientWidth,
|
|
206
|
-
|
|
207
|
-
(
|
|
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 }
|
|
208
210
|
);
|
|
209
211
|
}, []);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const c =
|
|
212
|
+
o.useEffect(() => {
|
|
213
|
+
F();
|
|
214
|
+
const c = D.current;
|
|
213
215
|
if (!c || typeof ResizeObserver > "u") return;
|
|
214
|
-
const m = new ResizeObserver(
|
|
216
|
+
const m = new ResizeObserver(F);
|
|
215
217
|
m.observe(c);
|
|
216
|
-
const
|
|
217
|
-
return
|
|
218
|
-
}, [
|
|
219
|
-
const
|
|
218
|
+
const g = c.querySelector("table");
|
|
219
|
+
return g && m.observe(g), () => m.disconnect();
|
|
220
|
+
}, [F]);
|
|
221
|
+
const [P, B] = o.useState(
|
|
222
|
+
null
|
|
223
|
+
), Z = o.useCallback(
|
|
224
|
+
(c) => {
|
|
225
|
+
B(
|
|
226
|
+
(m) => m ?? Array.from(
|
|
227
|
+
c.cells,
|
|
228
|
+
(g) => g.getBoundingClientRect().width
|
|
229
|
+
)
|
|
230
|
+
);
|
|
231
|
+
},
|
|
232
|
+
[]
|
|
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),
|
|
244
|
+
[]
|
|
245
|
+
), be = o.useMemo(
|
|
220
246
|
() => ({
|
|
221
|
-
selectionMode:
|
|
222
|
-
isSelected:
|
|
223
|
-
toggleKey:
|
|
224
|
-
toggleAll:
|
|
225
|
-
allSelected:
|
|
226
|
-
someSelected:
|
|
227
|
-
isStatic:
|
|
228
|
-
sortDescriptor:
|
|
229
|
-
requestSort:
|
|
230
|
-
automaticSorting:
|
|
231
|
-
elevatedActionColumn:
|
|
247
|
+
selectionMode: s,
|
|
248
|
+
isSelected: k,
|
|
249
|
+
toggleKey: M,
|
|
250
|
+
toggleAll: H,
|
|
251
|
+
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,
|
|
259
|
+
columnWidths: P,
|
|
260
|
+
snapshotColumnWidths: Z,
|
|
261
|
+
setColumnWidth: ee,
|
|
262
|
+
resetColumnWidths: te,
|
|
263
|
+
stickyHeader: z != null
|
|
232
264
|
}),
|
|
233
265
|
[
|
|
234
|
-
|
|
235
|
-
R,
|
|
236
|
-
F,
|
|
237
|
-
I,
|
|
266
|
+
s,
|
|
238
267
|
k,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
268
|
+
M,
|
|
269
|
+
H,
|
|
270
|
+
R,
|
|
271
|
+
$,
|
|
272
|
+
C,
|
|
273
|
+
d,
|
|
274
|
+
v,
|
|
275
|
+
S,
|
|
276
|
+
f,
|
|
277
|
+
w,
|
|
278
|
+
A,
|
|
279
|
+
P,
|
|
280
|
+
Z,
|
|
281
|
+
ee,
|
|
282
|
+
te,
|
|
283
|
+
z
|
|
246
284
|
]
|
|
247
285
|
);
|
|
248
|
-
return /* @__PURE__ */
|
|
286
|
+
return /* @__PURE__ */ p(ce.Provider, { value: be, children: /* @__PURE__ */ T(
|
|
249
287
|
"div",
|
|
250
288
|
{
|
|
251
|
-
"data-scroll-left":
|
|
252
|
-
"data-scroll-right":
|
|
289
|
+
"data-scroll-left": I.left ? "true" : "false",
|
|
290
|
+
"data-scroll-right": I.right ? "true" : "false",
|
|
253
291
|
className: u(
|
|
254
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)]",
|
|
255
297
|
t
|
|
256
298
|
),
|
|
257
299
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ T(
|
|
259
301
|
"div",
|
|
260
302
|
{
|
|
261
303
|
className: "relative",
|
|
262
|
-
style:
|
|
263
|
-
"--table-action-column-width":
|
|
304
|
+
style: w ? {
|
|
305
|
+
"--table-action-column-width": r
|
|
264
306
|
} : void 0,
|
|
265
307
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ p(
|
|
267
309
|
"div",
|
|
268
310
|
{
|
|
269
|
-
ref:
|
|
270
|
-
onScroll:
|
|
271
|
-
className:
|
|
272
|
-
|
|
311
|
+
ref: D,
|
|
312
|
+
onScroll: F,
|
|
313
|
+
className: u(
|
|
314
|
+
"overflow-x-auto rounded-(--table-card-radius)",
|
|
315
|
+
z != null && "overflow-y-auto"
|
|
316
|
+
),
|
|
317
|
+
style: z != null ? { maxHeight: z } : void 0,
|
|
318
|
+
children: /* @__PURE__ */ T(
|
|
273
319
|
"table",
|
|
274
320
|
{
|
|
275
|
-
ref:
|
|
321
|
+
ref: O,
|
|
276
322
|
"data-slot": "table",
|
|
277
323
|
className: u(
|
|
278
324
|
"w-full border-separate border-spacing-0 text-base",
|
|
325
|
+
// Manual widths need fixed layout so the <colgroup> wins;
|
|
326
|
+
// until the first resize the automatic layout is untouched.
|
|
327
|
+
P && "table-fixed",
|
|
279
328
|
e
|
|
280
329
|
),
|
|
281
|
-
...
|
|
282
|
-
children:
|
|
330
|
+
...W,
|
|
331
|
+
children: [
|
|
332
|
+
P && /* @__PURE__ */ p("colgroup", { children: P.map((c, m) => /* @__PURE__ */ p("col", { style: { width: c } }, m)) }),
|
|
333
|
+
_
|
|
334
|
+
]
|
|
283
335
|
}
|
|
284
336
|
)
|
|
285
337
|
}
|
|
286
338
|
),
|
|
287
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ p(
|
|
288
340
|
"div",
|
|
289
341
|
{
|
|
290
342
|
"aria-hidden": "true",
|
|
@@ -292,13 +344,13 @@ const he = a.forwardRef(
|
|
|
292
344
|
className: u(
|
|
293
345
|
"pointer-events-none absolute inset-y-0 z-20 w-10",
|
|
294
346
|
"bg-gradient-to-l from-(--table-scroll-hint) to-transparent",
|
|
295
|
-
"opacity-0 transition-opacity duration-
|
|
296
|
-
|
|
297
|
-
|
|
347
|
+
"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"
|
|
298
350
|
)
|
|
299
351
|
}
|
|
300
352
|
),
|
|
301
|
-
|
|
353
|
+
w && /* @__PURE__ */ p(
|
|
302
354
|
"div",
|
|
303
355
|
{
|
|
304
356
|
"aria-hidden": "true",
|
|
@@ -306,7 +358,7 @@ const he = a.forwardRef(
|
|
|
306
358
|
className: u(
|
|
307
359
|
"pointer-events-none absolute inset-y-0 right-0 z-20",
|
|
308
360
|
"w-[var(--table-action-column-width)]",
|
|
309
|
-
"rounded-br-
|
|
361
|
+
"rounded-br-(--table-card-radius)"
|
|
310
362
|
// No shadow of its own: while columns hide behind the pinned
|
|
311
363
|
// surface the scroll-hint gradient is already washing the
|
|
312
364
|
// seam — stacking a cast on top of it read harsh. The hint
|
|
@@ -317,113 +369,153 @@ const he = a.forwardRef(
|
|
|
317
369
|
]
|
|
318
370
|
}
|
|
319
371
|
),
|
|
320
|
-
|
|
372
|
+
a && /* @__PURE__ */ p("div", { className: "flex items-center px-4 py-2.5", children: a })
|
|
321
373
|
]
|
|
322
374
|
}
|
|
323
375
|
) });
|
|
324
376
|
}
|
|
325
377
|
);
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
const
|
|
329
|
-
return /* @__PURE__ */
|
|
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(
|
|
330
382
|
"thead",
|
|
331
383
|
{
|
|
332
|
-
ref:
|
|
384
|
+
ref: a,
|
|
333
385
|
className: u(
|
|
334
386
|
"text-xs text-muted-foreground",
|
|
335
|
-
(
|
|
387
|
+
(n == null ? void 0 : n.elevatedActionColumn) && "relative z-30 bg-table-shell",
|
|
336
388
|
e
|
|
337
389
|
),
|
|
338
390
|
...t
|
|
339
391
|
}
|
|
340
392
|
) });
|
|
341
393
|
});
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
({ className: e, rowKey: t, children:
|
|
347
|
-
const
|
|
348
|
-
return /* @__PURE__ */
|
|
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(
|
|
349
401
|
"tr",
|
|
350
402
|
{
|
|
351
|
-
ref:
|
|
352
|
-
"data-selected":
|
|
403
|
+
ref: s,
|
|
404
|
+
"data-selected": w || void 0,
|
|
353
405
|
className: u("group/row", e),
|
|
354
|
-
...
|
|
406
|
+
...n,
|
|
355
407
|
children: [
|
|
356
|
-
|
|
408
|
+
h && (l === "header" ? /* @__PURE__ */ T(
|
|
357
409
|
"th",
|
|
358
410
|
{
|
|
359
411
|
scope: "col",
|
|
360
412
|
className: u(
|
|
361
413
|
"w-10 px-4 py-2.5",
|
|
362
|
-
|
|
414
|
+
ie,
|
|
363
415
|
// Sticky without the baked shadow — an always-on smudge
|
|
364
416
|
// muddies the shell's corners (elevation = actionability).
|
|
365
417
|
// (sticky is positioned, so the ::after tick anchors to it —
|
|
366
418
|
// no `relative` needed, and it would conflict with sticky.)
|
|
367
419
|
"sticky left-0 z-10 bg-table-shell"
|
|
368
420
|
),
|
|
369
|
-
children:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ p("span", { className: "sr-only", children: "Row selection" }),
|
|
423
|
+
i.selectionMode === "multiple" && /* @__PURE__ */ p(
|
|
424
|
+
re,
|
|
425
|
+
{
|
|
426
|
+
size: "sm",
|
|
427
|
+
"aria-label": "Select all rows",
|
|
428
|
+
checked: i.allSelected,
|
|
429
|
+
indeterminate: i.someSelected,
|
|
430
|
+
onChange: i.toggleAll
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
]
|
|
379
434
|
}
|
|
380
|
-
) : /* @__PURE__ */
|
|
435
|
+
) : /* @__PURE__ */ p(
|
|
381
436
|
"td",
|
|
382
437
|
{
|
|
383
438
|
className: u(
|
|
384
439
|
"w-10 px-4 py-3",
|
|
385
|
-
|
|
386
|
-
|
|
440
|
+
le(i.isStatic),
|
|
441
|
+
ve,
|
|
387
442
|
"sticky left-0 z-10",
|
|
388
443
|
// Same white-behind-white corner problem as pinned data cells.
|
|
389
|
-
|
|
444
|
+
se("left")
|
|
390
445
|
),
|
|
391
|
-
onClick: (
|
|
392
|
-
children: t !== void 0 && /* @__PURE__ */
|
|
393
|
-
|
|
446
|
+
onClick: (r) => r.stopPropagation(),
|
|
447
|
+
children: t !== void 0 && /* @__PURE__ */ p(
|
|
448
|
+
re,
|
|
394
449
|
{
|
|
395
450
|
size: "sm",
|
|
396
451
|
"aria-label": `Select ${t}`,
|
|
397
|
-
checked:
|
|
398
|
-
onChange: () =>
|
|
452
|
+
checked: w,
|
|
453
|
+
onChange: () => i.toggleKey(t)
|
|
399
454
|
}
|
|
400
455
|
)
|
|
401
456
|
}
|
|
402
457
|
)),
|
|
403
|
-
|
|
458
|
+
a
|
|
404
459
|
]
|
|
405
460
|
}
|
|
406
461
|
);
|
|
407
462
|
}
|
|
408
463
|
);
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
var
|
|
412
|
-
const
|
|
413
|
-
|
|
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 {
|
|
479
|
+
}
|
|
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
|
+
);
|
|
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(
|
|
414
500
|
"th",
|
|
415
501
|
{
|
|
416
|
-
ref:
|
|
502
|
+
ref: w,
|
|
417
503
|
scope: "col",
|
|
418
|
-
"aria-sort":
|
|
504
|
+
"aria-sort": W ? O === "ascending" ? "ascending" : "descending" : z ? "none" : void 0,
|
|
419
505
|
className: u(
|
|
420
506
|
// whitespace-nowrap: header labels hug their content — the table
|
|
421
507
|
// scrolls horizontally, so wrapping "Null %" to two lines only
|
|
422
508
|
// wastes header height without saving any width.
|
|
423
509
|
"relative whitespace-nowrap px-4 py-2.5 font-normal",
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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(
|
|
427
519
|
// Preserve the semantic column width, but do not pin or paint
|
|
428
520
|
// a blank header cell over the labels behind it. Only body
|
|
429
521
|
// action cells participate in the sticky elevated surface.
|
|
@@ -431,51 +523,92 @@ const re = a.forwardRef(({ className: e, align: t, sticky: n, sortKey: r, allows
|
|
|
431
523
|
"min-w-[var(--table-action-column-width)]",
|
|
432
524
|
"max-w-[var(--table-action-column-width)]",
|
|
433
525
|
"bg-transparent"
|
|
434
|
-
) : u(
|
|
526
|
+
) : u(ae(a), "bg-table-shell")),
|
|
435
527
|
e
|
|
436
528
|
),
|
|
437
|
-
...
|
|
438
|
-
children:
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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
|
+
]
|
|
455
588
|
}
|
|
456
589
|
);
|
|
457
590
|
});
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
({ className: e, align: t, sticky:
|
|
461
|
-
const
|
|
462
|
-
return /* @__PURE__ */
|
|
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(
|
|
463
596
|
"td",
|
|
464
597
|
{
|
|
465
|
-
ref:
|
|
466
|
-
"data-sort-value":
|
|
598
|
+
ref: i,
|
|
599
|
+
"data-sort-value": n instanceof Date ? n.toISOString() : n,
|
|
467
600
|
className: u(
|
|
468
601
|
// whitespace-nowrap: cell content never wraps — the table's
|
|
469
602
|
// overflow-x-auto viewport scrolls horizontally instead, matching the
|
|
470
603
|
// header cells. Opt back into wrapping with `whitespace-normal` for
|
|
471
604
|
// deliberate multi-line content (e.g. an EmptyState in a colSpan cell).
|
|
472
605
|
"whitespace-nowrap px-4 py-3",
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
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(
|
|
479
612
|
"w-[var(--table-action-column-width)]",
|
|
480
613
|
"min-w-[var(--table-action-column-width)]",
|
|
481
614
|
"max-w-[var(--table-action-column-width)]",
|
|
@@ -484,17 +617,17 @@ const we = a.forwardRef(
|
|
|
484
617
|
),
|
|
485
618
|
e
|
|
486
619
|
),
|
|
487
|
-
...
|
|
620
|
+
...s
|
|
488
621
|
}
|
|
489
622
|
);
|
|
490
623
|
}
|
|
491
624
|
);
|
|
492
|
-
|
|
625
|
+
ke.displayName = "TableCell";
|
|
493
626
|
export {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
627
|
+
Se as Table,
|
|
628
|
+
pe as TableBody,
|
|
629
|
+
ke as TableCell,
|
|
630
|
+
fe as TableColumn,
|
|
631
|
+
de as TableHeader,
|
|
632
|
+
Y as TableRow
|
|
500
633
|
};
|