@actioneer/ads 0.7.0 → 0.8.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 +597 -0
- package/components/ai-elements/agent-trace.js +1 -1
- package/components/alert.js +3 -3
- package/components/answer.js +2 -2
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +11 -11
- package/components/assistant-ui/badge.js +18 -18
- package/components/assistant-ui/composer-trigger-popover.js +9 -9
- package/components/assistant-ui/composer.js +32 -32
- package/components/assistant-ui/image.js +61 -61
- package/components/assistant-ui/message-timing.js +1 -1
- package/components/assistant-ui/selection-toolbar.js +7 -7
- package/components/avatar.js +34 -34
- package/components/chip.js +8 -8
- package/components/divider.js +25 -25
- package/components/drawer.d.ts +2 -14
- package/components/drawer.js +103 -109
- package/components/field.js +9 -9
- package/components/index.js +423 -424
- package/components/input.js +21 -19
- package/components/modal.js +25 -25
- package/components/page-body.js +6 -6
- package/components/pagination.js +1 -1
- package/components/pixel-blast-svg.js +71 -73
- package/components/sidebar.js +47 -47
- package/components/table.d.ts +1 -1
- package/components/table.js +32 -33
- package/components/tabs.js +26 -26
- package/components/tree.js +17 -17
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +22 -22
- package/lib/icons.js +12 -12
- package/llms.txt +50 -49
- package/manifest.json +226 -237
- package/package.json +2 -1
- package/styles.css +128 -123
- package/theme.css +121 -112
package/components/sidebar.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { MotionConfig as z, motion as _ } from "motion/react";
|
|
5
5
|
import { User as j, PanelLeft as E } from "../lib/icons.js";
|
|
6
|
-
import { cn as
|
|
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";
|
|
9
9
|
import { Avatar as L } from "./avatar.js";
|
|
@@ -23,7 +23,7 @@ const K = s.forwardRef(
|
|
|
23
23
|
collapsed: e,
|
|
24
24
|
defaultCollapsed: a = !1,
|
|
25
25
|
onCollapsedChange: i,
|
|
26
|
-
animateOnMount:
|
|
26
|
+
animateOnMount: o = !1,
|
|
27
27
|
keyboardToggle: d = !0,
|
|
28
28
|
...l
|
|
29
29
|
}, m) => {
|
|
@@ -52,7 +52,7 @@ const K = s.forwardRef(
|
|
|
52
52
|
{
|
|
53
53
|
ref: m,
|
|
54
54
|
"data-collapsed": u ? "true" : "false",
|
|
55
|
-
initial:
|
|
55
|
+
initial: o ? {
|
|
56
56
|
width: u ? 56 : 240,
|
|
57
57
|
transform: "translate3d(-100%, 0, 0)",
|
|
58
58
|
opacity: 0
|
|
@@ -63,7 +63,7 @@ const K = s.forwardRef(
|
|
|
63
63
|
opacity: 1
|
|
64
64
|
},
|
|
65
65
|
transition: H,
|
|
66
|
-
className:
|
|
66
|
+
className: n(
|
|
67
67
|
"group/sidebar flex h-full shrink-0 flex-col bg-background",
|
|
68
68
|
t
|
|
69
69
|
),
|
|
@@ -82,13 +82,13 @@ function k({
|
|
|
82
82
|
tooltipSide: a = "right",
|
|
83
83
|
...i
|
|
84
84
|
}) {
|
|
85
|
-
const { collapsed:
|
|
85
|
+
const { collapsed: o, toggle: d } = M();
|
|
86
86
|
return /* @__PURE__ */ r(
|
|
87
87
|
I,
|
|
88
88
|
{
|
|
89
89
|
side: a,
|
|
90
90
|
content: /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5", children: [
|
|
91
|
-
|
|
91
|
+
o ? "Expand" : "Collapse",
|
|
92
92
|
/* @__PURE__ */ c("span", { className: "flex items-center gap-0.5", children: [
|
|
93
93
|
/* @__PURE__ */ r(S, { children: "⌘" }),
|
|
94
94
|
/* @__PURE__ */ r(S, { children: "B" })
|
|
@@ -98,12 +98,12 @@ function k({
|
|
|
98
98
|
"button",
|
|
99
99
|
{
|
|
100
100
|
type: "button",
|
|
101
|
-
"aria-label":
|
|
102
|
-
"aria-pressed":
|
|
101
|
+
"aria-label": o ? "Expand sidebar" : "Collapse sidebar",
|
|
102
|
+
"aria-pressed": o,
|
|
103
103
|
onClick: (l) => {
|
|
104
104
|
e == null || e(l), d();
|
|
105
105
|
},
|
|
106
|
-
className:
|
|
106
|
+
className: n(
|
|
107
107
|
"inline-flex size-(--sidebar-item) shrink-0 items-center justify-center rounded-sm border border-transparent text-muted-foreground",
|
|
108
108
|
"transition-colors hover:border-border hover:bg-elevated hover:text-foreground",
|
|
109
109
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
@@ -122,11 +122,11 @@ function Y({
|
|
|
122
122
|
href: e,
|
|
123
123
|
label: a = "Home",
|
|
124
124
|
showTrigger: i = !0,
|
|
125
|
-
children:
|
|
125
|
+
children: o,
|
|
126
126
|
className: d,
|
|
127
127
|
...l
|
|
128
128
|
}) {
|
|
129
|
-
const m =
|
|
129
|
+
const m = n(
|
|
130
130
|
// 20px mark centered in a 32px square — the same box as every other rail icon.
|
|
131
131
|
// group/brand lets a BrandMark logo play its blip loop on hover.
|
|
132
132
|
"group/brand flex size-(--sidebar-item) items-center justify-center",
|
|
@@ -139,7 +139,7 @@ function Y({
|
|
|
139
139
|
return /* @__PURE__ */ c(
|
|
140
140
|
"div",
|
|
141
141
|
{
|
|
142
|
-
className:
|
|
142
|
+
className: n(
|
|
143
143
|
"flex h-(--sidebar-header) shrink-0 items-center justify-between gap-2 px-4",
|
|
144
144
|
"group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:px-2",
|
|
145
145
|
d
|
|
@@ -150,7 +150,7 @@ function Y({
|
|
|
150
150
|
i && /* @__PURE__ */ r("div", { className: "hidden group-data-[collapsed=true]/sidebar:group-hover/sidebar:flex group-data-[collapsed=true]/sidebar:group-focus-within/sidebar:flex", children: /* @__PURE__ */ r(k, { tooltipSide: "right" }) }),
|
|
151
151
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-1 group-data-[collapsed=true]/sidebar:hidden", children: [
|
|
152
152
|
i && /* @__PURE__ */ r(k, { tooltipSide: "bottom" }),
|
|
153
|
-
|
|
153
|
+
o
|
|
154
154
|
] })
|
|
155
155
|
]
|
|
156
156
|
}
|
|
@@ -161,7 +161,7 @@ const q = s.forwardRef(
|
|
|
161
161
|
"div",
|
|
162
162
|
{
|
|
163
163
|
ref: a,
|
|
164
|
-
className:
|
|
164
|
+
className: n(
|
|
165
165
|
"flex h-(--sidebar-header) shrink-0 items-center justify-between gap-2 px-3",
|
|
166
166
|
"group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:px-2",
|
|
167
167
|
t
|
|
@@ -172,36 +172,36 @@ const q = s.forwardRef(
|
|
|
172
172
|
);
|
|
173
173
|
q.displayName = "SidebarHeader";
|
|
174
174
|
const A = s.forwardRef(
|
|
175
|
-
({ className: t, ...e }, a) => /* @__PURE__ */ r("nav", { ref: a, className:
|
|
175
|
+
({ className: t, ...e }, a) => /* @__PURE__ */ r("nav", { ref: a, className: n("min-h-0 flex-1 space-y-5 overflow-y-auto p-3", t), ...e })
|
|
176
176
|
);
|
|
177
177
|
A.displayName = "SidebarNav";
|
|
178
178
|
const B = s.forwardRef(
|
|
179
|
-
({ className: t, label: e, children: a, ...i },
|
|
180
|
-
e && /* @__PURE__ */ r("div", { className: "mb-1.5 px-3 text-s leading-[var(--text-s--line-height)] font-medium text-
|
|
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-[var(--text-s--line-height)] font-medium text-on-warm-grey-secondary 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
|
);
|
|
184
184
|
B.displayName = "SidebarSection";
|
|
185
185
|
const D = s.forwardRef(
|
|
186
|
-
({ className: t, icon: e, isActive: a, endContent: i, children:
|
|
186
|
+
({ className: t, icon: e, isActive: a, endContent: i, children: o, title: d, ...l }, m) => /* @__PURE__ */ c(
|
|
187
187
|
"a",
|
|
188
188
|
{
|
|
189
189
|
ref: m,
|
|
190
190
|
"aria-current": a ? "page" : void 0,
|
|
191
|
-
title: d ?? (typeof
|
|
192
|
-
className:
|
|
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-
|
|
191
|
+
title: d ?? (typeof o == "string" ? o : void 0),
|
|
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 transition-colors",
|
|
194
194
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
195
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 ? "border-
|
|
198
|
+
a ? "border-wg4 bg-card" : "hover:bg-sidebar-accent/60",
|
|
199
199
|
t
|
|
200
200
|
),
|
|
201
201
|
...l,
|
|
202
202
|
children: [
|
|
203
203
|
a && s.isValidElement(e) ? s.cloneElement(e, { weight: "fill" }) : e,
|
|
204
|
-
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate group-data-[collapsed=true]/sidebar:hidden", children:
|
|
204
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate group-data-[collapsed=true]/sidebar:hidden", children: o }),
|
|
205
205
|
i && /* @__PURE__ */ r("span", { className: "shrink-0 group-data-[collapsed=true]/sidebar:hidden", children: i })
|
|
206
206
|
]
|
|
207
207
|
}
|
|
@@ -213,21 +213,21 @@ const F = s.forwardRef(
|
|
|
213
213
|
"div",
|
|
214
214
|
{
|
|
215
215
|
ref: a,
|
|
216
|
-
className:
|
|
216
|
+
className: n("shrink-0 p-3 group-data-[collapsed=true]/sidebar:px-2", t),
|
|
217
217
|
...e
|
|
218
218
|
}
|
|
219
219
|
)
|
|
220
220
|
);
|
|
221
221
|
F.displayName = "SidebarFooter";
|
|
222
222
|
const W = s.forwardRef(
|
|
223
|
-
({ className: t, icon: e, children: a, ...i },
|
|
223
|
+
({ className: t, icon: e, children: a, ...i }, o) => /* @__PURE__ */ r("div", { className: "px-3 pb-0.5 group-data-[collapsed=true]/sidebar:px-2", children: /* @__PURE__ */ c(
|
|
224
224
|
"button",
|
|
225
225
|
{
|
|
226
|
-
ref:
|
|
226
|
+
ref: o,
|
|
227
227
|
type: "button",
|
|
228
|
-
className:
|
|
228
|
+
className: n(
|
|
229
229
|
"flex h-9 w-full items-center justify-start gap-2 rounded-md px-3",
|
|
230
|
-
"text-m leading-[var(--text-m--line-height)] font-normal text-
|
|
230
|
+
"text-m leading-[var(--text-m--line-height)] font-normal text-wg12",
|
|
231
231
|
// Reads as a normal nav item: transparent at rest, the shared grey
|
|
232
232
|
// hover wash on hover (no fill-at-rest, no elevation).
|
|
233
233
|
"transition-colors duration-150 ease-out motion-reduce:transition-none",
|
|
@@ -247,21 +247,21 @@ const W = s.forwardRef(
|
|
|
247
247
|
);
|
|
248
248
|
W.displayName = "SidebarAction";
|
|
249
249
|
const $ = s.forwardRef(
|
|
250
|
-
({ className: t, label: e, children: a, ...i },
|
|
250
|
+
({ className: t, label: e, children: a, ...i }, o) => /* @__PURE__ */ c(
|
|
251
251
|
"div",
|
|
252
252
|
{
|
|
253
|
-
ref:
|
|
254
|
-
className:
|
|
253
|
+
ref: o,
|
|
254
|
+
className: n("group-data-[collapsed=true]/sidebar:hidden", t),
|
|
255
255
|
...i,
|
|
256
256
|
children: [
|
|
257
|
-
e && /* @__PURE__ */ r("div", { className: "mb-1.5 px-3 text-s leading-[var(--text-s--line-height)] font-medium text-
|
|
257
|
+
e && /* @__PURE__ */ r("div", { className: "mb-1.5 px-3 text-s leading-[var(--text-s--line-height)] font-medium text-on-warm-grey-secondary", children: e }),
|
|
258
258
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: a })
|
|
259
259
|
]
|
|
260
260
|
}
|
|
261
261
|
)
|
|
262
262
|
);
|
|
263
263
|
$.displayName = "SidebarHistory";
|
|
264
|
-
const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActive:
|
|
264
|
+
const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActive: o, icon: d, ...l }, m) => {
|
|
265
265
|
const v = s.useRef(null), y = s.useRef(null), [b, u] = s.useState(0);
|
|
266
266
|
s.useLayoutEffect(() => {
|
|
267
267
|
const x = v.current, p = y.current;
|
|
@@ -278,10 +278,10 @@ const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActi
|
|
|
278
278
|
return /* @__PURE__ */ c(
|
|
279
279
|
"div",
|
|
280
280
|
{
|
|
281
|
-
className:
|
|
281
|
+
className: n(
|
|
282
282
|
"group/hist relative flex items-center rounded-md transition-colors",
|
|
283
|
-
"text-
|
|
284
|
-
|
|
283
|
+
"text-wg12",
|
|
284
|
+
o ? "bg-sidebar-accent/60" : "hover:bg-sidebar-accent/60"
|
|
285
285
|
),
|
|
286
286
|
children: [
|
|
287
287
|
d && /* @__PURE__ */ r(
|
|
@@ -297,7 +297,7 @@ const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActi
|
|
|
297
297
|
{
|
|
298
298
|
ref: m,
|
|
299
299
|
title: a ?? (typeof e == "string" ? e : void 0),
|
|
300
|
-
className:
|
|
300
|
+
className: n(
|
|
301
301
|
// Left pad matches a SidebarItem's text column (px-3 + icon size-4 +
|
|
302
302
|
// gap-2.5 = 2.375rem) so history titles line up under the nav labels.
|
|
303
303
|
"block min-w-0 flex-1 rounded-md py-1.5 pr-3 ps-(--sidebar-text-indent) text-m leading-[var(--text-m--line-height)] font-normal",
|
|
@@ -309,19 +309,19 @@ const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActi
|
|
|
309
309
|
"span",
|
|
310
310
|
{
|
|
311
311
|
ref: v,
|
|
312
|
-
className:
|
|
312
|
+
className: n(
|
|
313
313
|
"block overflow-hidden",
|
|
314
314
|
// Rest: fade the right edge (no ellipsis). Hover: the title scrolls,
|
|
315
315
|
// so fade the LEFT edge where it exits; the action backdrop (or the
|
|
316
316
|
// string's own end) handles the right.
|
|
317
|
-
g && "[mask-image:linear-gradient(to_right
|
|
318
|
-
g && "group-hover/hist:[mask-image:linear-gradient(to_right,transparent
|
|
317
|
+
g && "[mask-image:linear-gradient(to_right,var(--color-wg12)_calc(100%-1.5rem),transparent)]",
|
|
318
|
+
g && "group-hover/hist:[mask-image:linear-gradient(to_right,transparent,var(--color-wg12)_1.25rem,var(--color-wg12)_100%)]"
|
|
319
319
|
),
|
|
320
320
|
children: /* @__PURE__ */ r(
|
|
321
321
|
"span",
|
|
322
322
|
{
|
|
323
323
|
ref: y,
|
|
324
|
-
className:
|
|
324
|
+
className: n(
|
|
325
325
|
"block w-max whitespace-nowrap transition-transform ease-linear",
|
|
326
326
|
g && "group-hover/hist:[transform:translateX(var(--mq-x))]",
|
|
327
327
|
"motion-reduce:transition-none motion-reduce:group-hover/hist:[transform:none]"
|
|
@@ -340,7 +340,7 @@ const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActi
|
|
|
340
340
|
i && /* @__PURE__ */ r(
|
|
341
341
|
"span",
|
|
342
342
|
{
|
|
343
|
-
className:
|
|
343
|
+
className: n(
|
|
344
344
|
// Rounded end matches the row's radius so the backdrop doesn't
|
|
345
345
|
// square off the highlight's right corners.
|
|
346
346
|
"absolute inset-y-0 right-0 flex items-center rounded-e-md pl-8 pr-1",
|
|
@@ -358,20 +358,20 @@ const O = s.forwardRef(({ className: t, children: e, title: a, action: i, isActi
|
|
|
358
358
|
});
|
|
359
359
|
O.displayName = "SidebarHistoryItem";
|
|
360
360
|
const P = s.forwardRef(
|
|
361
|
-
({ className: t, name: e, role: a, src: i, hideAvatar:
|
|
361
|
+
({ className: t, name: e, role: a, src: i, hideAvatar: o, ...d }, l) => /* @__PURE__ */ c(
|
|
362
362
|
"a",
|
|
363
363
|
{
|
|
364
364
|
ref: l,
|
|
365
|
-
className:
|
|
366
|
-
"flex items-center gap-2.5 rounded-md border border-transparent p-2 transition-colors hover:border-
|
|
365
|
+
className: n(
|
|
366
|
+
"flex items-center gap-2.5 rounded-md border border-transparent p-2 transition-colors hover:border-wg10",
|
|
367
367
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
368
368
|
"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",
|
|
369
369
|
t
|
|
370
370
|
),
|
|
371
371
|
...d,
|
|
372
372
|
children: [
|
|
373
|
-
!
|
|
374
|
-
|
|
373
|
+
!o && /* @__PURE__ */ r(L, { size: "sm", name: e, src: i }),
|
|
374
|
+
o && /* @__PURE__ */ r(
|
|
375
375
|
j,
|
|
376
376
|
{
|
|
377
377
|
"aria-hidden": !0,
|
package/components/table.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface TableProps extends Omit<React.TableHTMLAttributes<HTMLTableElem
|
|
|
32
32
|
/**
|
|
33
33
|
* Turns the final `sticky="right"` column into a persistent action surface.
|
|
34
34
|
* Its cells stay on `bg-elevated` while one flat Table-level
|
|
35
|
-
* `shadow-elevation` compatibility hook spans the body below the
|
|
35
|
+
* `shadow-elevation` compatibility hook spans the body below the WG1 header.
|
|
36
36
|
* The matching header cell stays transparent and scrolls normally, so it
|
|
37
37
|
* never becomes a blank sticky surface over the header labels.
|
|
38
38
|
*/
|
package/components/table.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as d, jsxs as T } from "react/jsx-runtime";
|
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { cn as m } from "../lib/cn.js";
|
|
5
5
|
import { Checkbox as ne } from "./checkbox.js";
|
|
6
|
-
import { ChevronUp as ve, ChevronDown as
|
|
6
|
+
import { ChevronUp as ve, ChevronDown as ye, SortIcon as we } from "../lib/icons.js";
|
|
7
7
|
const se = (r) => r === "center" ? "text-center" : r === "right" ? "text-right" : "text-left", ae = (r, t = !1) => r === "left" ? m(
|
|
8
8
|
"sticky left-0 z-10",
|
|
9
9
|
// Scroll-aware: the smudge only appears once content is actually
|
|
@@ -17,18 +17,16 @@ const se = (r) => r === "center" ? "text-center" : r === "right" ? "text-right"
|
|
|
17
17
|
!t && "group-data-[scroll-right=true]/table-shell:shadow-table-smudge-right"
|
|
18
18
|
) : void 0, ie = n.createContext(!1), le = (r) => m(
|
|
19
19
|
"bg-card align-middle transition-colors",
|
|
20
|
-
// The header is the first NG1 band, so the first body row stays white.
|
|
21
|
-
"group-even/row:bg-ng1",
|
|
22
20
|
// Functional row hairline; the table shell carries the outer stroke.
|
|
23
21
|
"border-b border-table-stroke group-last/row:border-b-0",
|
|
24
22
|
r && m(
|
|
25
|
-
// Use
|
|
23
|
+
// Use WG2 without introducing a new
|
|
26
24
|
// rounded silhouette. The wash is pre-composited so scrolled text
|
|
27
25
|
// cannot show through sticky cells.
|
|
28
26
|
"group-hover/row:bg-(--table-row-hover) group-focus-within/row:bg-(--table-row-hover)",
|
|
29
27
|
"group-data-[selected]/row:bg-(--table-row-selected)"
|
|
30
28
|
)
|
|
31
|
-
), ce = "bg-
|
|
29
|
+
), ce = "bg-card", ue = m(
|
|
32
30
|
"after:pointer-events-none after:absolute after:right-0 after:top-1/2",
|
|
33
31
|
"after:h-4 after:w-px after:-translate-y-1/2 after:rounded-sm",
|
|
34
32
|
"after:bg-border-strong last:after:hidden"
|
|
@@ -102,13 +100,13 @@ function Ne(r) {
|
|
|
102
100
|
if (!n.isValidElement(e)) return e;
|
|
103
101
|
for (; (t[u] ?? 0) > c; )
|
|
104
102
|
u += 1;
|
|
105
|
-
const N = Math.max(1, Number(e.props.colSpan ?? 1)), x = Math.max(1, Number(e.props.rowSpan ?? 1)),
|
|
103
|
+
const N = Math.max(1, Number(e.props.colSpan ?? 1)), x = Math.max(1, Number(e.props.rowSpan ?? 1)), y = u;
|
|
106
104
|
for (let g = 0; g < N; g += 1)
|
|
107
|
-
t[
|
|
108
|
-
t[
|
|
105
|
+
t[y + g] = Math.max(
|
|
106
|
+
t[y + g] ?? 0,
|
|
109
107
|
c + x
|
|
110
108
|
);
|
|
111
|
-
return u += N, e.type !== be ? e : n.cloneElement(e, { _sortColumnIndex:
|
|
109
|
+
return u += N, e.type !== be ? e : n.cloneElement(e, { _sortColumnIndex: y });
|
|
112
110
|
});
|
|
113
111
|
return n.cloneElement(s, void 0, f);
|
|
114
112
|
});
|
|
@@ -153,7 +151,7 @@ const ze = n.forwardRef(
|
|
|
153
151
|
elevatedActionColumn: e = !1,
|
|
154
152
|
actionColumnWidth: N = "3rem",
|
|
155
153
|
sortDescriptor: x,
|
|
156
|
-
onSortChange:
|
|
154
|
+
onSortChange: y,
|
|
157
155
|
allowsSorting: g = !0,
|
|
158
156
|
isStatic: A = !1,
|
|
159
157
|
resizableColumns: E = !0,
|
|
@@ -176,13 +174,13 @@ const ze = n.forwardRef(
|
|
|
176
174
|
[h, c, D, z, C, v]
|
|
177
175
|
), I = n.useCallback(() => {
|
|
178
176
|
h && h(R ? /* @__PURE__ */ new Set() : new Set(C));
|
|
179
|
-
}, [h, R, C]), [H, U] = n.useState(), p = g && !
|
|
177
|
+
}, [h, R, C]), [H, U] = n.useState(), p = g && !y, l = p ? H ?? x : x, S = n.useCallback(
|
|
180
178
|
(i) => {
|
|
181
179
|
if (!g) return;
|
|
182
|
-
const b = (l == null ? void 0 : l.column) === i && l.direction === "ascending" ? "descending" : "ascending",
|
|
183
|
-
|
|
180
|
+
const b = (l == null ? void 0 : l.column) === i && l.direction === "ascending" ? "descending" : "ascending", w = { column: i, direction: b };
|
|
181
|
+
y ? y(w) : U(w);
|
|
184
182
|
},
|
|
185
|
-
[l, g,
|
|
183
|
+
[l, g, y]
|
|
186
184
|
), j = n.useMemo(
|
|
187
185
|
() => p ? me(s, l) : s,
|
|
188
186
|
[l, p, s]
|
|
@@ -192,9 +190,9 @@ const ze = n.forwardRef(
|
|
|
192
190
|
}), q = n.useCallback(() => {
|
|
193
191
|
const i = M.current;
|
|
194
192
|
if (!i) return;
|
|
195
|
-
const b = i.scrollWidth - i.clientWidth,
|
|
193
|
+
const b = i.scrollWidth - i.clientWidth, w = i.scrollLeft > 1, L = i.scrollLeft < b - 1;
|
|
196
194
|
he(
|
|
197
|
-
(K) => K.left ===
|
|
195
|
+
(K) => K.left === w && K.right === L ? K : { left: w, right: L }
|
|
198
196
|
);
|
|
199
197
|
}, []);
|
|
200
198
|
n.useEffect(() => {
|
|
@@ -203,8 +201,8 @@ const ze = n.forwardRef(
|
|
|
203
201
|
if (!i || typeof ResizeObserver > "u") return;
|
|
204
202
|
const b = new ResizeObserver(q);
|
|
205
203
|
b.observe(i);
|
|
206
|
-
const
|
|
207
|
-
return
|
|
204
|
+
const w = i.querySelector("table");
|
|
205
|
+
return w && b.observe(w), () => b.disconnect();
|
|
208
206
|
}, [q]);
|
|
209
207
|
const [P, J] = n.useState(
|
|
210
208
|
null
|
|
@@ -213,15 +211,15 @@ const ze = n.forwardRef(
|
|
|
213
211
|
J(
|
|
214
212
|
(b) => b ?? Array.from(
|
|
215
213
|
i.cells,
|
|
216
|
-
(
|
|
214
|
+
(w) => w.getBoundingClientRect().width
|
|
217
215
|
)
|
|
218
216
|
);
|
|
219
217
|
},
|
|
220
218
|
[]
|
|
221
219
|
), te = n.useCallback((i, b) => {
|
|
222
|
-
J((
|
|
223
|
-
if (!
|
|
224
|
-
const L = [...
|
|
220
|
+
J((w) => {
|
|
221
|
+
if (!w) return w;
|
|
222
|
+
const L = [...w];
|
|
225
223
|
return L[i] = Math.max(Q, b), L;
|
|
226
224
|
});
|
|
227
225
|
}, []), re = n.useCallback(
|
|
@@ -275,7 +273,7 @@ const ze = n.forwardRef(
|
|
|
275
273
|
"data-scroll-left": F.left ? "true" : "false",
|
|
276
274
|
"data-scroll-right": F.right ? "true" : "false",
|
|
277
275
|
className: m(
|
|
278
|
-
"group/table-shell overflow-clip rounded-m border border-table-stroke bg-
|
|
276
|
+
"group/table-shell overflow-clip rounded-m border border-table-stroke bg-table-shell",
|
|
279
277
|
"[--table-card-radius:var(--radius-m)]",
|
|
280
278
|
t
|
|
281
279
|
),
|
|
@@ -374,7 +372,7 @@ const pe = n.forwardRef(({ className: r, ...t }, a) => {
|
|
|
374
372
|
ref: a,
|
|
375
373
|
className: m(
|
|
376
374
|
"text-s font-medium uppercase text-table-header-foreground",
|
|
377
|
-
(o == null ? void 0 : o.elevatedActionColumn) && "relative z-30 bg-
|
|
375
|
+
(o == null ? void 0 : o.elevatedActionColumn) && "relative z-30 bg-wg1",
|
|
378
376
|
r
|
|
379
377
|
),
|
|
380
378
|
...t
|
|
@@ -394,13 +392,13 @@ const Z = n.forwardRef(
|
|
|
394
392
|
role: c,
|
|
395
393
|
...u
|
|
396
394
|
}, h) => {
|
|
397
|
-
const f = B(), e = n.useContext(Y), N = !!f && f.selectionMode !== "none", x = e === "body" && !(f != null && f.isStatic) && (o || N || typeof s == "function" || c === "button" || u["aria-expanded"] !== void 0),
|
|
395
|
+
const f = B(), e = n.useContext(Y), N = !!f && f.selectionMode !== "none", x = e === "body" && !(f != null && f.isStatic) && (o || N || typeof s == "function" || c === "button" || u["aria-expanded"] !== void 0), y = N && e === "body" && t !== void 0 ? f.isSelected(t) : !1;
|
|
398
396
|
return /* @__PURE__ */ d(ie.Provider, { value: x, children: /* @__PURE__ */ T(
|
|
399
397
|
"tr",
|
|
400
398
|
{
|
|
401
399
|
ref: h,
|
|
402
400
|
"data-interactive": x || void 0,
|
|
403
|
-
"data-selected":
|
|
401
|
+
"data-selected": y || void 0,
|
|
404
402
|
className: m("group/row", e === "body" && "h-12", r),
|
|
405
403
|
onClick: s,
|
|
406
404
|
role: c,
|
|
@@ -448,7 +446,7 @@ const Z = n.forwardRef(
|
|
|
448
446
|
{
|
|
449
447
|
size: "sm",
|
|
450
448
|
"aria-label": `Select ${t}`,
|
|
451
|
-
checked:
|
|
449
|
+
checked: y,
|
|
452
450
|
onChange: () => f.toggleKey(t)
|
|
453
451
|
}
|
|
454
452
|
)
|
|
@@ -473,7 +471,7 @@ const be = n.forwardRef(
|
|
|
473
471
|
...h
|
|
474
472
|
}, f) => {
|
|
475
473
|
var I, H, U;
|
|
476
|
-
const e = B(), x = (e != null && e.automaticSorting && c !== void 0 ? `${G}${c}` : void 0) ?? o,
|
|
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 = (p) => {
|
|
477
475
|
if (p.button !== 0 || !e) return;
|
|
478
476
|
const l = p.currentTarget.parentElement, S = l == null ? void 0 : l.parentElement;
|
|
479
477
|
if (!(!l || !S)) {
|
|
@@ -525,7 +523,7 @@ const be = n.forwardRef(
|
|
|
525
523
|
// decorative one; the last column never shows a handle.
|
|
526
524
|
O && "after:hidden [&:last-child>[data-slot=resize-handle]]:hidden",
|
|
527
525
|
// Capped-height tables scroll under the header: pin it to the
|
|
528
|
-
// viewport top, painted
|
|
526
|
+
// viewport top, painted WG1 so rows pass beneath.
|
|
529
527
|
(e == null ? void 0 : e.stickyHeader) && "sticky top-0 z-30",
|
|
530
528
|
se(t),
|
|
531
529
|
a && (a === "right" && (e != null && e.elevatedActionColumn) ? m(
|
|
@@ -555,7 +553,7 @@ const be = n.forwardRef(
|
|
|
555
553
|
),
|
|
556
554
|
children: [
|
|
557
555
|
u,
|
|
558
|
-
k ? _ === "ascending" ? /* @__PURE__ */ d(ve, { className: "size-3.5" }) : /* @__PURE__ */ d(
|
|
556
|
+
k ? _ === "ascending" ? /* @__PURE__ */ d(ve, { className: "size-3.5" }) : /* @__PURE__ */ d(ye, { className: "size-3.5" }) : /* @__PURE__ */ d(we, { className: "size-3.5 opacity-0 transition-opacity group-hover/sort:opacity-60" })
|
|
559
557
|
]
|
|
560
558
|
}
|
|
561
559
|
) : A ? u : /* @__PURE__ */ d("span", { className: "sr-only", children: h["aria-label"] ?? "Table column" }),
|
|
@@ -617,7 +615,9 @@ const Se = n.forwardRef(
|
|
|
617
615
|
// overflow-x-auto viewport scrolls horizontally instead, matching the
|
|
618
616
|
// header cells. Opt back into wrapping with `whitespace-normal` for
|
|
619
617
|
// deliberate multi-line content (e.g. an EmptyState in a colSpan cell).
|
|
620
|
-
|
|
618
|
+
// Cell values own the ADS 15px body-text contract instead of relying
|
|
619
|
+
// on inheritance from <Table>; nested content stays 15px by default.
|
|
620
|
+
"h-12 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),
|
|
@@ -627,8 +627,7 @@ const Se = n.forwardRef(
|
|
|
627
627
|
"max-w-[var(--table-action-column-width)]",
|
|
628
628
|
"px-2",
|
|
629
629
|
"bg-elevated",
|
|
630
|
-
// Keep the action column
|
|
631
|
-
"group-even/row:bg-elevated",
|
|
630
|
+
// Keep the action column on its elevated surface during hover.
|
|
632
631
|
"group-hover/row:bg-elevated group-focus-within/row:bg-elevated"
|
|
633
632
|
),
|
|
634
633
|
r
|
package/components/tabs.js
CHANGED
|
@@ -18,13 +18,13 @@ const _ = r.forwardRef(
|
|
|
18
18
|
value: e,
|
|
19
19
|
defaultValue: t,
|
|
20
20
|
onValueChange: a,
|
|
21
|
-
variant:
|
|
21
|
+
variant: y,
|
|
22
22
|
orientation: d = "horizontal",
|
|
23
23
|
size: b,
|
|
24
24
|
children: R,
|
|
25
25
|
...A
|
|
26
26
|
}, S) => {
|
|
27
|
-
const x = e !== void 0, [
|
|
27
|
+
const x = e !== void 0, [g, v] = r.useState(t), T = r.useId().replaceAll(":", ""), c = r.useId(), w = r.useRef([]), h = r.useRef(/* @__PURE__ */ new Set()), u = x ? e : g, I = r.useCallback(
|
|
28
28
|
(l) => {
|
|
29
29
|
x || v(l), a == null || a(l);
|
|
30
30
|
},
|
|
@@ -33,7 +33,7 @@ const _ = r.forwardRef(
|
|
|
33
33
|
w.current.includes(l) || w.current.push(l);
|
|
34
34
|
}, []), s = r.useMemo(
|
|
35
35
|
() => ({
|
|
36
|
-
value:
|
|
36
|
+
value: u,
|
|
37
37
|
setValue: I,
|
|
38
38
|
baseId: T,
|
|
39
39
|
registerTab: i,
|
|
@@ -43,7 +43,7 @@ const _ = r.forwardRef(
|
|
|
43
43
|
orientation: d
|
|
44
44
|
}),
|
|
45
45
|
[
|
|
46
|
-
|
|
46
|
+
u,
|
|
47
47
|
I,
|
|
48
48
|
T,
|
|
49
49
|
i,
|
|
@@ -99,7 +99,7 @@ const C = L("inline-flex gap-0 text-m", {
|
|
|
99
99
|
B.displayName = "TabList";
|
|
100
100
|
const H = L(
|
|
101
101
|
p(
|
|
102
|
-
"relative inline-flex items-center whitespace-nowrap
|
|
102
|
+
"relative inline-flex items-center whitespace-nowrap select-none",
|
|
103
103
|
"transition-colors duration-150 cursor-pointer",
|
|
104
104
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
105
105
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
@@ -111,8 +111,8 @@ const H = L(
|
|
|
111
111
|
vertical: "h-8 justify-start px-3 pr-4 -mr-px"
|
|
112
112
|
},
|
|
113
113
|
selected: {
|
|
114
|
-
true: "text-action-primary-text",
|
|
115
|
-
false: "text-
|
|
114
|
+
true: "font-medium text-action-primary-text",
|
|
115
|
+
false: "font-normal text-secondary hover:text-foreground"
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
defaultVariants: {
|
|
@@ -121,17 +121,17 @@ const H = L(
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
), O = r.forwardRef(
|
|
124
|
-
({ className: o, value: e, isDisabled: t, count: a, children:
|
|
124
|
+
({ className: o, value: e, isDisabled: t, count: a, children: y, onClick: d, onKeyDown: b, ...R }, A) => {
|
|
125
125
|
const {
|
|
126
126
|
value: S,
|
|
127
127
|
setValue: x,
|
|
128
|
-
baseId:
|
|
128
|
+
baseId: g,
|
|
129
129
|
registerTab: v,
|
|
130
130
|
tabs: T,
|
|
131
131
|
disabled: c,
|
|
132
132
|
thumbId: w,
|
|
133
133
|
orientation: h
|
|
134
|
-
} = z("Tab"),
|
|
134
|
+
} = z("Tab"), u = S === e;
|
|
135
135
|
r.useEffect(() => {
|
|
136
136
|
v(e);
|
|
137
137
|
}, [v, e]), r.useEffect(() => {
|
|
@@ -154,19 +154,19 @@ const H = L(
|
|
|
154
154
|
n = (n - 1 + s.length) % s.length;
|
|
155
155
|
while (c.current.has(s[n]) && n !== l);
|
|
156
156
|
} else if (i.key === "Home")
|
|
157
|
-
n = s.findIndex((
|
|
157
|
+
n = s.findIndex((f) => !c.current.has(f));
|
|
158
158
|
else if (i.key === "End") {
|
|
159
|
-
for (let
|
|
160
|
-
if (!c.current.has(s[
|
|
161
|
-
n =
|
|
159
|
+
for (let f = s.length - 1; f >= 0; f--)
|
|
160
|
+
if (!c.current.has(s[f])) {
|
|
161
|
+
n = f;
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
if (n !== null && n !== -1) {
|
|
166
166
|
i.preventDefault();
|
|
167
|
-
const
|
|
168
|
-
x(
|
|
169
|
-
const k = document.getElementById(N(
|
|
167
|
+
const f = s[n];
|
|
168
|
+
x(f);
|
|
169
|
+
const k = document.getElementById(N(g, "tab", f));
|
|
170
170
|
k == null || k.focus();
|
|
171
171
|
}
|
|
172
172
|
};
|
|
@@ -176,15 +176,15 @@ const H = L(
|
|
|
176
176
|
ref: A,
|
|
177
177
|
type: "button",
|
|
178
178
|
role: "tab",
|
|
179
|
-
id: N(
|
|
180
|
-
"aria-selected":
|
|
179
|
+
id: N(g, "tab", e),
|
|
180
|
+
"aria-selected": u,
|
|
181
181
|
"aria-disabled": t || void 0,
|
|
182
182
|
disabled: t,
|
|
183
|
-
"data-selected":
|
|
183
|
+
"data-selected": u || void 0,
|
|
184
184
|
"data-disabled": t || void 0,
|
|
185
|
-
tabIndex:
|
|
185
|
+
tabIndex: u && !t ? 0 : -1,
|
|
186
186
|
className: p(
|
|
187
|
-
H({ orientation: h, selected:
|
|
187
|
+
H({ orientation: h, selected: u }),
|
|
188
188
|
o
|
|
189
189
|
),
|
|
190
190
|
onClick: (i) => {
|
|
@@ -193,7 +193,7 @@ const H = L(
|
|
|
193
193
|
onKeyDown: I,
|
|
194
194
|
...R,
|
|
195
195
|
children: [
|
|
196
|
-
|
|
196
|
+
u && /* @__PURE__ */ m(
|
|
197
197
|
M.span,
|
|
198
198
|
{
|
|
199
199
|
layoutId: w,
|
|
@@ -206,7 +206,7 @@ const H = L(
|
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
208
|
/* @__PURE__ */ E("span", { className: "relative inline-flex items-center gap-1", children: [
|
|
209
|
-
|
|
209
|
+
y,
|
|
210
210
|
a != null && /* @__PURE__ */ E("span", { className: "tabular-nums text-muted-foreground", children: [
|
|
211
211
|
"· ",
|
|
212
212
|
a
|
|
@@ -239,12 +239,12 @@ const q = r.forwardRef(
|
|
|
239
239
|
);
|
|
240
240
|
q.displayName = "TabSeparator";
|
|
241
241
|
const F = r.forwardRef(
|
|
242
|
-
({ className: o, value: e, children: t, ...a },
|
|
242
|
+
({ className: o, value: e, children: t, ...a }, y) => {
|
|
243
243
|
const { value: d, baseId: b } = z("TabPanel");
|
|
244
244
|
return d !== e ? null : /* @__PURE__ */ m(
|
|
245
245
|
"div",
|
|
246
246
|
{
|
|
247
|
-
ref:
|
|
247
|
+
ref: y,
|
|
248
248
|
role: "tabpanel",
|
|
249
249
|
id: N(b, "panel", e),
|
|
250
250
|
"aria-labelledby": N(b, "tab", e),
|