@actioneer/ads 0.8.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESIGN.md +31 -31
- package/components/assistant-ui/attachment.js +1 -1
- package/components/assistant-ui/composer-harness.js +5 -4
- package/components/assistant-ui/directive-text.js +5 -5
- package/components/assistant-ui/markdown-text.js +7 -7
- package/components/assistant-ui/sources.js +1 -1
- package/components/avatar.d.ts +1 -1
- package/components/avatar.js +1 -1
- package/components/body-page-header.d.ts +1 -1
- package/components/body-page-header.js +1 -1
- package/components/chart.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +466 -464
- package/components/infinite-canvas.js +1 -1
- package/components/modal.js +1 -1
- package/components/page-header.js +1 -1
- package/components/search-disclosure.d.ts +18 -0
- package/components/search-disclosure.js +106 -0
- package/components/sidebar.js +16 -9
- package/components/table.js +49 -49
- package/components/tabs.js +69 -60
- package/components/typography.d.ts +1 -1
- package/components/typography.js +1 -1
- package/components/ui/button.d.ts +1 -1
- package/components/ui/dialog.js +1 -1
- package/components/viz-charts.js +36 -36
- package/demo/components/add-to-artifact.js +3 -2
- package/lib/cn.js +7 -7
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +108 -107
- package/llms.txt +3 -1
- package/manifest.json +55 -21
- package/package.json +1 -1
- package/styles.css +48 -35
- package/theme.css +46 -33
|
@@ -7,7 +7,7 @@ import "@xyflow/react/dist/style.css";
|
|
|
7
7
|
import { cn as W } from "../lib/cn.js";
|
|
8
8
|
import { Minus as q, Plus as J, Maximize as Q, Magnet as X } from "../lib/icons.js";
|
|
9
9
|
import { Button as a } from "./button.js";
|
|
10
|
-
const x = 16, Y = 1.2, $ = [x, x], ee = 1.4, w = 18, oe = 2, te = [8, 4], re =
|
|
10
|
+
const x = 16, Y = 1.2, $ = [x, x], ee = 1.4, w = 18, oe = 2, te = [8, 4], re = "var(--text-xs)", I = 150, ae = 200, ne = 0.28, R = "var(--canvas-edge)";
|
|
11
11
|
function v(o) {
|
|
12
12
|
return typeof window > "u" || !window.matchMedia ? o : window.matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : o;
|
|
13
13
|
}
|
package/components/modal.js
CHANGED
|
@@ -182,7 +182,7 @@ const F = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
|
182
182
|
F.displayName = "ModalHeader";
|
|
183
183
|
const G = r.forwardRef(({ className: o, id: e, ...a }, i) => {
|
|
184
184
|
const l = r.useContext(x), d = n(
|
|
185
|
-
"text-
|
|
185
|
+
"text-l font-semibold leading-5 text-foreground",
|
|
186
186
|
o
|
|
187
187
|
);
|
|
188
188
|
return l ? /* @__PURE__ */ t(
|
|
@@ -37,7 +37,7 @@ const x = o.forwardRef(
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ t("div", { className: "min-w-0", children: [
|
|
40
|
-
/* @__PURE__ */ e("h1", { className: "flex min-h-8 items-center text-
|
|
40
|
+
/* @__PURE__ */ e("h1", { className: "flex min-h-8 items-center text-2xl font-medium tracking-tight text-foreground", children: s }),
|
|
41
41
|
r && /* @__PURE__ */ e("p", { className: "mt-1 max-w-2xl text-xs text-muted-foreground", children: r })
|
|
42
42
|
] })
|
|
43
43
|
] }),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface SearchDisclosureProps extends Omit<HTMLMotionProps<"div">, "onChange"> {
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
inputLabel?: string;
|
|
11
|
+
triggerLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A compact search action that reveals an inline field from its anchored right
|
|
15
|
+
* edge. The field keeps its full width while the container clips it, avoiding
|
|
16
|
+
* squeezed text and malformed borders during the disclosure spring.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SearchDisclosure: React.ForwardRefExoticComponent<Omit<SearchDisclosureProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { MotionConfig as S, motion as n, AnimatePresence as g } from "motion/react";
|
|
5
|
+
import { Close as k, Search as u } from "../lib/icons.js";
|
|
6
|
+
import { springDisclosure as s } from "../lib/motion.js";
|
|
7
|
+
import { cn as D } from "../lib/cn.js";
|
|
8
|
+
import { Button as C } from "./button.js";
|
|
9
|
+
import { Input as z } from "./input.js";
|
|
10
|
+
import { Tooltip as j } from "./tooltip.js";
|
|
11
|
+
const I = o.forwardRef(
|
|
12
|
+
({
|
|
13
|
+
className: f,
|
|
14
|
+
value: c,
|
|
15
|
+
onValueChange: h,
|
|
16
|
+
open: l,
|
|
17
|
+
defaultOpen: p = !1,
|
|
18
|
+
onOpenChange: t,
|
|
19
|
+
placeholder: y = "Search…",
|
|
20
|
+
inputLabel: v = "Search",
|
|
21
|
+
triggerLabel: m = "Search",
|
|
22
|
+
...b
|
|
23
|
+
}, x) => {
|
|
24
|
+
const [w, N] = o.useState(p), r = l !== void 0, d = r ? l : w, a = o.useCallback(
|
|
25
|
+
(i) => {
|
|
26
|
+
r || N(i), t == null || t(i);
|
|
27
|
+
},
|
|
28
|
+
[r, t]
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ e(S, { reducedMotion: "user", children: /* @__PURE__ */ e(
|
|
31
|
+
n.div,
|
|
32
|
+
{
|
|
33
|
+
ref: x,
|
|
34
|
+
initial: !1,
|
|
35
|
+
animate: { width: d ? 256 : 32 },
|
|
36
|
+
transition: s,
|
|
37
|
+
className: D("relative h-8 shrink-0 overflow-hidden", f),
|
|
38
|
+
...b,
|
|
39
|
+
children: /* @__PURE__ */ e(g, { initial: !1, mode: "popLayout", children: d ? /* @__PURE__ */ e(
|
|
40
|
+
n.div,
|
|
41
|
+
{
|
|
42
|
+
initial: { opacity: 0 },
|
|
43
|
+
animate: { opacity: 1 },
|
|
44
|
+
exit: { opacity: 0 },
|
|
45
|
+
transition: s,
|
|
46
|
+
className: "absolute inset-y-0 right-0 w-64",
|
|
47
|
+
children: /* @__PURE__ */ e(
|
|
48
|
+
z,
|
|
49
|
+
{
|
|
50
|
+
autoFocus: !0,
|
|
51
|
+
type: "search",
|
|
52
|
+
size: "sm",
|
|
53
|
+
className: "w-full",
|
|
54
|
+
startContent: /* @__PURE__ */ e(u, { "aria-hidden": "true" }),
|
|
55
|
+
endContent: /* @__PURE__ */ e(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
"aria-label": "Close search",
|
|
60
|
+
onClick: () => a(!1),
|
|
61
|
+
className: "-mr-1 inline-flex size-6 items-center justify-center rounded-xs outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
|
|
62
|
+
children: /* @__PURE__ */ e(k, { "aria-hidden": "true" })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
value: c,
|
|
66
|
+
onChange: (i) => h(i.currentTarget.value),
|
|
67
|
+
onKeyDown: (i) => {
|
|
68
|
+
i.key === "Escape" && (i.preventDefault(), a(!1));
|
|
69
|
+
},
|
|
70
|
+
placeholder: y,
|
|
71
|
+
"aria-label": v
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
},
|
|
75
|
+
"search-field"
|
|
76
|
+
) : /* @__PURE__ */ e(
|
|
77
|
+
n.div,
|
|
78
|
+
{
|
|
79
|
+
initial: { opacity: 0 },
|
|
80
|
+
animate: { opacity: 1 },
|
|
81
|
+
exit: { opacity: 0 },
|
|
82
|
+
transition: s,
|
|
83
|
+
className: "absolute inset-y-0 right-0 w-8",
|
|
84
|
+
children: /* @__PURE__ */ e(j, { content: m, children: /* @__PURE__ */ e(
|
|
85
|
+
C,
|
|
86
|
+
{
|
|
87
|
+
variant: "outline",
|
|
88
|
+
size: "icon-sm",
|
|
89
|
+
"aria-label": m,
|
|
90
|
+
"data-active": c.trim() || void 0,
|
|
91
|
+
onClick: () => a(!0),
|
|
92
|
+
className: "data-[active=true]:text-action-primary-text",
|
|
93
|
+
children: /* @__PURE__ */ e(u, { "aria-hidden": "true" })
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
},
|
|
97
|
+
"search-trigger"
|
|
98
|
+
) })
|
|
99
|
+
}
|
|
100
|
+
) });
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
I.displayName = "SearchDisclosure";
|
|
104
|
+
export {
|
|
105
|
+
I as SearchDisclosure
|
|
106
|
+
};
|
package/components/sidebar.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import { MotionConfig as z, motion as
|
|
5
|
-
import { User as
|
|
4
|
+
import { MotionConfig as z, motion as j } from "motion/react";
|
|
5
|
+
import { User as _, PanelLeft as E } from "../lib/icons.js";
|
|
6
6
|
import { cn as n } from "../lib/cn.js";
|
|
7
7
|
import { springSidebar as H } from "../lib/motion.js";
|
|
8
8
|
import { Tooltip as I } from "./tooltip.js";
|
|
@@ -48,7 +48,7 @@ const K = s.forwardRef(
|
|
|
48
48
|
[u, h, g]
|
|
49
49
|
);
|
|
50
50
|
return /* @__PURE__ */ r(R.Provider, { value: x, children: /* @__PURE__ */ r(z, { reducedMotion: "user", children: /* @__PURE__ */ r(
|
|
51
|
-
|
|
51
|
+
j.aside,
|
|
52
52
|
{
|
|
53
53
|
ref: m,
|
|
54
54
|
"data-collapsed": u ? "true" : "false",
|
|
@@ -177,7 +177,7 @@ const A = s.forwardRef(
|
|
|
177
177
|
A.displayName = "SidebarNav";
|
|
178
178
|
const B = s.forwardRef(
|
|
179
179
|
({ className: t, label: e, children: a, ...i }, o) => /* @__PURE__ */ c("div", { ref: o, className: t, ...i, children: [
|
|
180
|
-
e && /* @__PURE__ */ r("div", { className: "mb-1.5 px-3 text-s leading-
|
|
180
|
+
e && /* @__PURE__ */ r("div", { className: "mb-1.5 px-3 text-s font-normal uppercase leading-4 tracking-wider text-tertiary group-data-[collapsed=true]/sidebar:hidden", children: e }),
|
|
181
181
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5 group-data-[collapsed=true]/sidebar:gap-2", children: a })
|
|
182
182
|
] })
|
|
183
183
|
);
|
|
@@ -190,17 +190,24 @@ const D = s.forwardRef(
|
|
|
190
190
|
"aria-current": a ? "page" : void 0,
|
|
191
191
|
title: d ?? (typeof o == "string" ? o : void 0),
|
|
192
192
|
className: n(
|
|
193
|
-
"flex h-9 items-center gap-2.5 rounded-md border border-transparent px-3 text-m leading-[var(--text-m--line-height)] font-normal text-wg12
|
|
193
|
+
"group/sidebar-item flex h-9 items-center gap-2.5 rounded-md border border-transparent px-3 text-m leading-[var(--text-m--line-height)] font-normal text-wg12",
|
|
194
|
+
"transition-[background-color,border-color,color] duration-150 ease-out motion-reduce:transition-none",
|
|
194
195
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
195
|
-
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
196
196
|
// Collapsed: a centered square (--sidebar-item) so every rail item lines up.
|
|
197
197
|
"group-data-[collapsed=true]/sidebar:mx-auto group-data-[collapsed=true]/sidebar:size-(--sidebar-item) group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:p-0",
|
|
198
|
-
a ? "
|
|
198
|
+
a ? "bg-sidebar-accent" : "hover:bg-sidebar-accent/60",
|
|
199
199
|
t
|
|
200
200
|
),
|
|
201
201
|
...l,
|
|
202
202
|
children: [
|
|
203
|
-
|
|
203
|
+
e && /* @__PURE__ */ r(
|
|
204
|
+
"span",
|
|
205
|
+
{
|
|
206
|
+
"aria-hidden": !0,
|
|
207
|
+
className: "flex shrink-0 items-center justify-center transition-transform duration-150 ease-out group-hover/sidebar-item:scale-110 motion-reduce:transition-none motion-reduce:group-hover/sidebar-item:scale-100 [&_svg]:size-4 [&_svg]:shrink-0",
|
|
208
|
+
children: a && s.isValidElement(e) ? s.cloneElement(e, { weight: "fill" }) : e
|
|
209
|
+
}
|
|
210
|
+
),
|
|
204
211
|
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate group-data-[collapsed=true]/sidebar:hidden", children: o }),
|
|
205
212
|
i && /* @__PURE__ */ r("span", { className: "shrink-0 group-data-[collapsed=true]/sidebar:hidden", children: i })
|
|
206
213
|
]
|
|
@@ -372,7 +379,7 @@ const P = s.forwardRef(
|
|
|
372
379
|
children: [
|
|
373
380
|
!o && /* @__PURE__ */ r(L, { size: "sm", name: e, src: i }),
|
|
374
381
|
o && /* @__PURE__ */ r(
|
|
375
|
-
|
|
382
|
+
_,
|
|
376
383
|
{
|
|
377
384
|
"aria-hidden": !0,
|
|
378
385
|
className: "hidden size-4 shrink-0 text-muted-foreground group-data-[collapsed=true]/sidebar:block"
|
package/components/table.js
CHANGED
|
@@ -20,13 +20,13 @@ const se = (r) => r === "center" ? "text-center" : r === "right" ? "text-right"
|
|
|
20
20
|
// Functional row hairline; the table shell carries the outer stroke.
|
|
21
21
|
"border-b border-table-stroke group-last/row:border-b-0",
|
|
22
22
|
r && m(
|
|
23
|
-
// Use
|
|
23
|
+
// Use WG3 without introducing a new
|
|
24
24
|
// rounded silhouette. The wash is pre-composited so scrolled text
|
|
25
25
|
// cannot show through sticky cells.
|
|
26
26
|
"group-hover/row:bg-(--table-row-hover) group-focus-within/row:bg-(--table-row-hover)",
|
|
27
27
|
"group-data-[selected]/row:bg-(--table-row-selected)"
|
|
28
28
|
)
|
|
29
|
-
), ce = "bg-
|
|
29
|
+
), ce = "bg-wg1", ue = m(
|
|
30
30
|
"after:pointer-events-none after:absolute after:right-0 after:top-1/2",
|
|
31
31
|
"after:h-4 after:w-px after:-translate-y-1/2 after:rounded-sm",
|
|
32
32
|
"after:bg-border-strong last:after:hidden"
|
|
@@ -96,7 +96,7 @@ function Ne(r) {
|
|
|
96
96
|
if (!n.isValidElement(s) || s.type !== Z)
|
|
97
97
|
return s;
|
|
98
98
|
let u = 0;
|
|
99
|
-
const
|
|
99
|
+
const p = V(s.props.children).map((e) => {
|
|
100
100
|
if (!n.isValidElement(e)) return e;
|
|
101
101
|
for (; (t[u] ?? 0) > c; )
|
|
102
102
|
u += 1;
|
|
@@ -108,7 +108,7 @@ function Ne(r) {
|
|
|
108
108
|
);
|
|
109
109
|
return u += N, e.type !== be ? e : n.cloneElement(e, { _sortColumnIndex: y });
|
|
110
110
|
});
|
|
111
|
-
return n.cloneElement(s, void 0,
|
|
111
|
+
return n.cloneElement(s, void 0, p);
|
|
112
112
|
});
|
|
113
113
|
return n.cloneElement(r, void 0, o);
|
|
114
114
|
}
|
|
@@ -135,7 +135,7 @@ function me(r, t) {
|
|
|
135
135
|
o,
|
|
136
136
|
void 0,
|
|
137
137
|
me(o.props.children, t)
|
|
138
|
-
) : o.type ===
|
|
138
|
+
) : o.type === fe ? Ne(o) : o.type === pe && t && Number.isInteger(a) && a >= 0 ? ke(o, a, t.direction) : o : o);
|
|
139
139
|
}
|
|
140
140
|
const ze = n.forwardRef(
|
|
141
141
|
({
|
|
@@ -147,7 +147,7 @@ const ze = n.forwardRef(
|
|
|
147
147
|
selectionMode: c = "none",
|
|
148
148
|
selectedKeys: u,
|
|
149
149
|
onSelectionChange: h,
|
|
150
|
-
rowKeys:
|
|
150
|
+
rowKeys: p,
|
|
151
151
|
elevatedActionColumn: e = !1,
|
|
152
152
|
actionColumnWidth: N = "3rem",
|
|
153
153
|
sortDescriptor: x,
|
|
@@ -158,7 +158,7 @@ const ze = n.forwardRef(
|
|
|
158
158
|
maxBodyHeight: k,
|
|
159
159
|
..._
|
|
160
160
|
}, O) => {
|
|
161
|
-
const C = n.useMemo(() =>
|
|
161
|
+
const C = n.useMemo(() => p ?? [], [p]), z = u === "all", v = z ? null : u ?? /* @__PURE__ */ new Set(), D = n.useCallback(
|
|
162
162
|
(i) => z || !!(v != null && v.has(i)),
|
|
163
163
|
[z, v]
|
|
164
164
|
), R = C.length > 0 && (z || C.every((i) => v == null ? void 0 : v.has(i))), W = !R && (z || C.some((i) => v == null ? void 0 : v.has(i))), $ = n.useCallback(
|
|
@@ -174,7 +174,7 @@ const ze = n.forwardRef(
|
|
|
174
174
|
[h, c, D, z, C, v]
|
|
175
175
|
), I = n.useCallback(() => {
|
|
176
176
|
h && h(R ? /* @__PURE__ */ new Set() : new Set(C));
|
|
177
|
-
}, [h, R, C]), [H, U] = n.useState(),
|
|
177
|
+
}, [h, R, C]), [H, U] = n.useState(), f = g && !y, l = f ? H ?? x : x, S = n.useCallback(
|
|
178
178
|
(i) => {
|
|
179
179
|
if (!g) return;
|
|
180
180
|
const b = (l == null ? void 0 : l.column) === i && l.direction === "ascending" ? "descending" : "ascending", w = { column: i, direction: b };
|
|
@@ -182,8 +182,8 @@ const ze = n.forwardRef(
|
|
|
182
182
|
},
|
|
183
183
|
[l, g, y]
|
|
184
184
|
), j = n.useMemo(
|
|
185
|
-
() =>
|
|
186
|
-
[l,
|
|
185
|
+
() => f ? me(s, l) : s,
|
|
186
|
+
[l, f, s]
|
|
187
187
|
), M = n.useRef(null), [F, he] = n.useState({
|
|
188
188
|
left: !1,
|
|
189
189
|
right: !1
|
|
@@ -236,7 +236,7 @@ const ze = n.forwardRef(
|
|
|
236
236
|
isStatic: A,
|
|
237
237
|
sortDescriptor: l,
|
|
238
238
|
requestSort: g ? S : void 0,
|
|
239
|
-
automaticSorting:
|
|
239
|
+
automaticSorting: f,
|
|
240
240
|
elevatedActionColumn: e,
|
|
241
241
|
resizableColumns: E,
|
|
242
242
|
columnWidths: P,
|
|
@@ -255,7 +255,7 @@ const ze = n.forwardRef(
|
|
|
255
255
|
A,
|
|
256
256
|
l,
|
|
257
257
|
g,
|
|
258
|
-
|
|
258
|
+
f,
|
|
259
259
|
S,
|
|
260
260
|
e,
|
|
261
261
|
E,
|
|
@@ -364,14 +364,14 @@ const ze = n.forwardRef(
|
|
|
364
364
|
}
|
|
365
365
|
);
|
|
366
366
|
ze.displayName = "Table";
|
|
367
|
-
const
|
|
367
|
+
const fe = n.forwardRef(({ className: r, ...t }, a) => {
|
|
368
368
|
const o = B();
|
|
369
369
|
return /* @__PURE__ */ d(Y.Provider, { value: "header", children: /* @__PURE__ */ d(
|
|
370
370
|
"thead",
|
|
371
371
|
{
|
|
372
372
|
ref: a,
|
|
373
373
|
className: m(
|
|
374
|
-
"text-s font-medium
|
|
374
|
+
"text-s font-medium text-table-header-foreground",
|
|
375
375
|
(o == null ? void 0 : o.elevatedActionColumn) && "relative z-30 bg-wg1",
|
|
376
376
|
r
|
|
377
377
|
),
|
|
@@ -379,9 +379,9 @@ const pe = n.forwardRef(({ className: r, ...t }, a) => {
|
|
|
379
379
|
}
|
|
380
380
|
) });
|
|
381
381
|
});
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
-
|
|
382
|
+
fe.displayName = "TableHeader";
|
|
383
|
+
const pe = n.forwardRef(({ className: r, ...t }, a) => /* @__PURE__ */ d(Y.Provider, { value: "body", children: /* @__PURE__ */ d("tbody", { ref: a, className: m(r), ...t }) }));
|
|
384
|
+
pe.displayName = "TableBody";
|
|
385
385
|
const Z = n.forwardRef(
|
|
386
386
|
({
|
|
387
387
|
className: r,
|
|
@@ -392,14 +392,14 @@ const Z = n.forwardRef(
|
|
|
392
392
|
role: c,
|
|
393
393
|
...u
|
|
394
394
|
}, h) => {
|
|
395
|
-
const
|
|
395
|
+
const p = B(), e = n.useContext(Y), N = !!p && p.selectionMode !== "none", x = e === "body" && !(p != null && p.isStatic) && (o || N || typeof s == "function" || c === "button" || u["aria-expanded"] !== void 0), y = N && e === "body" && t !== void 0 ? p.isSelected(t) : !1;
|
|
396
396
|
return /* @__PURE__ */ d(ie.Provider, { value: x, children: /* @__PURE__ */ T(
|
|
397
397
|
"tr",
|
|
398
398
|
{
|
|
399
399
|
ref: h,
|
|
400
400
|
"data-interactive": x || void 0,
|
|
401
401
|
"data-selected": y || void 0,
|
|
402
|
-
className: m("group/row", e === "body" && "h-
|
|
402
|
+
className: m("group/row", e === "body" && "h-16", r),
|
|
403
403
|
onClick: s,
|
|
404
404
|
role: c,
|
|
405
405
|
...u,
|
|
@@ -420,14 +420,14 @@ const Z = n.forwardRef(
|
|
|
420
420
|
),
|
|
421
421
|
children: [
|
|
422
422
|
/* @__PURE__ */ d("span", { className: "sr-only", children: "Row selection" }),
|
|
423
|
-
|
|
423
|
+
p.selectionMode === "multiple" && /* @__PURE__ */ d(
|
|
424
424
|
ne,
|
|
425
425
|
{
|
|
426
426
|
size: "sm",
|
|
427
427
|
"aria-label": "Select all rows",
|
|
428
|
-
checked:
|
|
429
|
-
indeterminate:
|
|
430
|
-
onChange:
|
|
428
|
+
checked: p.allSelected,
|
|
429
|
+
indeterminate: p.someSelected,
|
|
430
|
+
onChange: p.toggleAll
|
|
431
431
|
}
|
|
432
432
|
)
|
|
433
433
|
]
|
|
@@ -436,7 +436,7 @@ const Z = n.forwardRef(
|
|
|
436
436
|
"td",
|
|
437
437
|
{
|
|
438
438
|
className: m(
|
|
439
|
-
"h-
|
|
439
|
+
"h-16 w-10 px-4 py-2",
|
|
440
440
|
le(x),
|
|
441
441
|
"sticky left-0 z-10"
|
|
442
442
|
),
|
|
@@ -447,7 +447,7 @@ const Z = n.forwardRef(
|
|
|
447
447
|
size: "sm",
|
|
448
448
|
"aria-label": `Select ${t}`,
|
|
449
449
|
checked: y,
|
|
450
|
-
onChange: () =>
|
|
450
|
+
onChange: () => p.toggleKey(t)
|
|
451
451
|
}
|
|
452
452
|
)
|
|
453
453
|
}
|
|
@@ -469,38 +469,38 @@ const be = n.forwardRef(
|
|
|
469
469
|
_sortColumnIndex: c,
|
|
470
470
|
children: u,
|
|
471
471
|
...h
|
|
472
|
-
},
|
|
472
|
+
}, p) => {
|
|
473
473
|
var I, H, U;
|
|
474
|
-
const e = B(), x = (e != null && e.automaticSorting && c !== void 0 ? `${G}${c}` : void 0) ?? o, y = Number(h.colSpan ?? 1) === 1, g = String(X(u)).trim(), A = g.length > 0, E = s && y && a !== "right" && A && !!x && !!(e != null && e.requestSort), k = E && ((I = e == null ? void 0 : e.sortDescriptor) == null ? void 0 : I.column) === x, _ = (H = e == null ? void 0 : e.sortDescriptor) == null ? void 0 : H.direction, O = !!(e != null && e.resizableColumns) && y && a !== "right", C = n.useRef(null), [z, v] = n.useState(!1), D = (
|
|
475
|
-
if (
|
|
476
|
-
const l =
|
|
474
|
+
const e = B(), x = (e != null && e.automaticSorting && c !== void 0 ? `${G}${c}` : void 0) ?? o, y = Number(h.colSpan ?? 1) === 1, g = String(X(u)).trim(), A = g.length > 0, E = s && y && a !== "right" && A && !!x && !!(e != null && e.requestSort), k = E && ((I = e == null ? void 0 : e.sortDescriptor) == null ? void 0 : I.column) === x, _ = (H = e == null ? void 0 : e.sortDescriptor) == null ? void 0 : H.direction, O = !!(e != null && e.resizableColumns) && y && a !== "right", C = n.useRef(null), [z, v] = n.useState(!1), D = (f) => {
|
|
475
|
+
if (f.button !== 0 || !e) return;
|
|
476
|
+
const l = f.currentTarget.parentElement, S = l == null ? void 0 : l.parentElement;
|
|
477
477
|
if (!(!l || !S)) {
|
|
478
478
|
e.snapshotColumnWidths(S), C.current = {
|
|
479
479
|
index: l.cellIndex,
|
|
480
|
-
startX:
|
|
480
|
+
startX: f.clientX,
|
|
481
481
|
startWidth: l.getBoundingClientRect().width
|
|
482
482
|
}, v(!0);
|
|
483
483
|
try {
|
|
484
|
-
|
|
484
|
+
f.currentTarget.setPointerCapture(f.pointerId);
|
|
485
485
|
} catch {
|
|
486
486
|
}
|
|
487
|
-
|
|
487
|
+
f.preventDefault();
|
|
488
488
|
}
|
|
489
|
-
}, R = (
|
|
489
|
+
}, R = (f) => {
|
|
490
490
|
const l = C.current;
|
|
491
491
|
!l || !e || e.setColumnWidth(
|
|
492
492
|
l.index,
|
|
493
|
-
l.startWidth + (
|
|
493
|
+
l.startWidth + (f.clientX - l.startX)
|
|
494
494
|
);
|
|
495
495
|
}, W = () => {
|
|
496
496
|
C.current = null, v(!1);
|
|
497
|
-
}, $ = (
|
|
498
|
-
if (
|
|
499
|
-
|
|
500
|
-
const l =
|
|
497
|
+
}, $ = (f) => {
|
|
498
|
+
if (f.key !== "ArrowLeft" && f.key !== "ArrowRight" || !e) return;
|
|
499
|
+
f.preventDefault();
|
|
500
|
+
const l = f.currentTarget.parentElement, S = l == null ? void 0 : l.parentElement;
|
|
501
501
|
if (!l || !S) return;
|
|
502
502
|
e.snapshotColumnWidths(S);
|
|
503
|
-
const j =
|
|
503
|
+
const j = f.shiftKey ? 32 : 8, M = f.key === "ArrowRight" ? j : -j;
|
|
504
504
|
e.setColumnWidth(
|
|
505
505
|
l.cellIndex,
|
|
506
506
|
l.getBoundingClientRect().width + M
|
|
@@ -509,14 +509,14 @@ const be = n.forwardRef(
|
|
|
509
509
|
return /* @__PURE__ */ T(
|
|
510
510
|
"th",
|
|
511
511
|
{
|
|
512
|
-
ref:
|
|
512
|
+
ref: p,
|
|
513
513
|
scope: "col",
|
|
514
514
|
"aria-sort": k ? _ === "ascending" ? "ascending" : "descending" : E ? "none" : void 0,
|
|
515
515
|
className: m(
|
|
516
516
|
// whitespace-nowrap: header labels hug their content — the table
|
|
517
517
|
// scrolls horizontally, so wrapping "Null %" to two lines only
|
|
518
518
|
// wastes header height without saving any width.
|
|
519
|
-
"relative whitespace-nowrap border-b border-table-stroke px-4 py-2.5 font-medium
|
|
519
|
+
"relative whitespace-nowrap border-b border-table-stroke px-4 py-2.5 text-s font-medium text-table-header-foreground",
|
|
520
520
|
ce,
|
|
521
521
|
ue,
|
|
522
522
|
// The resize handle carries its own tick visual, so drop the
|
|
@@ -546,7 +546,7 @@ const be = n.forwardRef(
|
|
|
546
546
|
type: "button",
|
|
547
547
|
onClick: () => e.requestSort(x),
|
|
548
548
|
className: m(
|
|
549
|
-
"group/sort -mx-1 inline-flex items-center gap-1 rounded px-1
|
|
549
|
+
"group/sort -mx-1 inline-flex items-center gap-1 rounded px-1 outline-none transition-colors",
|
|
550
550
|
"hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
551
551
|
t === "right" && "flex-row-reverse",
|
|
552
552
|
k && "font-medium"
|
|
@@ -604,7 +604,7 @@ const be = n.forwardRef(
|
|
|
604
604
|
be.displayName = "TableColumn";
|
|
605
605
|
const Se = n.forwardRef(
|
|
606
606
|
({ className: r, align: t, sticky: a, sortValue: o, ...s }, c) => {
|
|
607
|
-
const u = B(), h = n.useContext(ie),
|
|
607
|
+
const u = B(), h = n.useContext(ie), p = a === "right" && (u == null ? void 0 : u.elevatedActionColumn);
|
|
608
608
|
return /* @__PURE__ */ d(
|
|
609
609
|
"td",
|
|
610
610
|
{
|
|
@@ -615,13 +615,13 @@ const Se = n.forwardRef(
|
|
|
615
615
|
// overflow-x-auto viewport scrolls horizontally instead, matching the
|
|
616
616
|
// header cells. Opt back into wrapping with `whitespace-normal` for
|
|
617
617
|
// deliberate multi-line content (e.g. an EmptyState in a colSpan cell).
|
|
618
|
-
// Cell values own the ADS
|
|
619
|
-
// on inheritance from <Table>; nested content stays
|
|
620
|
-
"h-
|
|
618
|
+
// Cell values own the ADS 14px body-text contract instead of relying
|
|
619
|
+
// on inheritance from <Table>; nested content stays 14px by default.
|
|
620
|
+
"h-16 whitespace-nowrap px-4 py-2 text-m",
|
|
621
621
|
le(h),
|
|
622
622
|
se(t),
|
|
623
623
|
a && ae(a, u == null ? void 0 : u.elevatedActionColumn),
|
|
624
|
-
|
|
624
|
+
p && m(
|
|
625
625
|
"w-[var(--table-action-column-width)]",
|
|
626
626
|
"min-w-[var(--table-action-column-width)]",
|
|
627
627
|
"max-w-[var(--table-action-column-width)]",
|
|
@@ -640,9 +640,9 @@ const Se = n.forwardRef(
|
|
|
640
640
|
Se.displayName = "TableCell";
|
|
641
641
|
export {
|
|
642
642
|
ze as Table,
|
|
643
|
-
|
|
643
|
+
pe as TableBody,
|
|
644
644
|
Se as TableCell,
|
|
645
645
|
be as TableColumn,
|
|
646
|
-
|
|
646
|
+
fe as TableHeader,
|
|
647
647
|
Z as TableRow
|
|
648
648
|
};
|