@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as u, jsx as n, Fragment as E } from "react/jsx-runtime";
|
|
3
3
|
import { memo as D, useRef as F, useState as p, useEffect as b } from "react";
|
|
4
4
|
import { createPortal as O } from "react-dom";
|
|
5
5
|
import { cva as P } from "class-variance-authority";
|
|
@@ -24,10 +24,10 @@ const G = (e) => {
|
|
|
24
24
|
}
|
|
25
25
|
}, z = (e) => {
|
|
26
26
|
var r;
|
|
27
|
-
const [t,
|
|
27
|
+
const [t, a] = e.split(","), i = ((r = t == null ? void 0 : t.match(/data:([^;]+)/)) == null ? void 0 : r[1]) ?? "application/octet-stream";
|
|
28
28
|
if (!/;base64/i.test(t ?? ""))
|
|
29
|
-
return new Blob([decodeURIComponent(
|
|
30
|
-
const l = atob(
|
|
29
|
+
return new Blob([decodeURIComponent(a ?? "")], { type: i });
|
|
30
|
+
const l = atob(a ?? ""), o = new Uint8Array(l.length);
|
|
31
31
|
for (let s = 0; s < l.length; s++) o[s] = l.charCodeAt(s);
|
|
32
32
|
return new Blob([o], { type: i });
|
|
33
33
|
}, N = (e) => {
|
|
@@ -35,13 +35,13 @@ const G = (e) => {
|
|
|
35
35
|
return (t = e.match(/^data:([^;,]+)/)) == null ? void 0 : t[1];
|
|
36
36
|
}, K = (e) => {
|
|
37
37
|
if (typeof document > "u") return;
|
|
38
|
-
const t = G(N(e.image)),
|
|
39
|
-
r.href = o, r.download =
|
|
38
|
+
const t = G(N(e.image)), a = e.filename ?? `image.${t}`, l = e.image.startsWith("data:") ? URL.createObjectURL(z(e.image)) : null, o = l ?? e.image, r = document.createElement("a");
|
|
39
|
+
r.href = o, r.download = a, r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r), l && URL.revokeObjectURL(l);
|
|
40
40
|
}, M = async (e) => {
|
|
41
41
|
if (typeof navigator > "u" || !navigator.clipboard || typeof ClipboardItem > "u")
|
|
42
42
|
throw new Error("Clipboard API is not available in this environment.");
|
|
43
|
-
const t = e.image.startsWith("data:") ? z(e.image) : await fetch(e.image).then((i) => i.blob()),
|
|
44
|
-
await navigator.clipboard.write([new ClipboardItem({ [
|
|
43
|
+
const t = e.image.startsWith("data:") ? z(e.image) : await fetch(e.image).then((i) => i.blob()), a = N(e.image) ?? t.type ?? "image/png";
|
|
44
|
+
await navigator.clipboard.write([new ClipboardItem({ [a]: t })]);
|
|
45
45
|
}, T = P(
|
|
46
46
|
"aui-image-root relative overflow-hidden rounded-lg",
|
|
47
47
|
{
|
|
@@ -67,17 +67,17 @@ const G = (e) => {
|
|
|
67
67
|
function h({
|
|
68
68
|
className: e,
|
|
69
69
|
variant: t,
|
|
70
|
-
size:
|
|
70
|
+
size: a,
|
|
71
71
|
children: i,
|
|
72
72
|
...l
|
|
73
73
|
}) {
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ n(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
"data-slot": "image-root",
|
|
78
78
|
"data-variant": t,
|
|
79
|
-
"data-size":
|
|
80
|
-
className: d(T({ variant: t, size:
|
|
79
|
+
"data-size": a,
|
|
80
|
+
className: d(T({ variant: t, size: a, className: e })),
|
|
81
81
|
...l,
|
|
82
82
|
children: i
|
|
83
83
|
}
|
|
@@ -86,7 +86,7 @@ function h({
|
|
|
86
86
|
function C({
|
|
87
87
|
className: e,
|
|
88
88
|
containerClassName: t,
|
|
89
|
-
onLoad:
|
|
89
|
+
onLoad: a,
|
|
90
90
|
onError: i,
|
|
91
91
|
alt: l = "Image content",
|
|
92
92
|
src: o,
|
|
@@ -94,20 +94,20 @@ function C({
|
|
|
94
94
|
}) {
|
|
95
95
|
const s = F(null), [f, m] = p(void 0), [y, U] = p(void 0), x = f === o, I = y === o;
|
|
96
96
|
return b(() => {
|
|
97
|
-
var
|
|
98
|
-
typeof o == "string" && ((
|
|
99
|
-
}, [o]), /* @__PURE__ */
|
|
97
|
+
var g;
|
|
98
|
+
typeof o == "string" && ((g = s.current) != null && g.complete) && s.current.naturalWidth > 0 && m(o);
|
|
99
|
+
}, [o]), /* @__PURE__ */ u(
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
102
|
"data-slot": "image-preview",
|
|
103
103
|
className: d("relative min-h-32", t),
|
|
104
104
|
children: [
|
|
105
|
-
!x && !I && /* @__PURE__ */
|
|
105
|
+
!x && !I && /* @__PURE__ */ n(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
"data-slot": "image-preview-loading",
|
|
109
109
|
className: "bg-muted/50 absolute inset-0 flex items-center justify-center",
|
|
110
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ n(
|
|
111
111
|
w,
|
|
112
112
|
{
|
|
113
113
|
variant: "content",
|
|
@@ -118,14 +118,14 @@ function C({
|
|
|
118
118
|
)
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
I ? /* @__PURE__ */
|
|
121
|
+
I ? /* @__PURE__ */ n(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
124
|
"data-slot": "image-preview-error",
|
|
125
125
|
className: "bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ n(S, { className: "text-muted-foreground size-8" })
|
|
127
127
|
}
|
|
128
|
-
) : /* @__PURE__ */
|
|
128
|
+
) : /* @__PURE__ */ n(
|
|
129
129
|
"img",
|
|
130
130
|
{
|
|
131
131
|
ref: s,
|
|
@@ -136,11 +136,11 @@ function C({
|
|
|
136
136
|
!x && "invisible",
|
|
137
137
|
e
|
|
138
138
|
),
|
|
139
|
-
onLoad: (
|
|
140
|
-
typeof o == "string" && m(o),
|
|
139
|
+
onLoad: (g) => {
|
|
140
|
+
typeof o == "string" && m(o), a == null || a(g);
|
|
141
141
|
},
|
|
142
|
-
onError: (
|
|
143
|
-
typeof o == "string" && U(o), i == null || i(
|
|
142
|
+
onError: (g) => {
|
|
143
|
+
typeof o == "string" && U(o), i == null || i(g);
|
|
144
144
|
},
|
|
145
145
|
...r
|
|
146
146
|
}
|
|
@@ -152,9 +152,9 @@ function C({
|
|
|
152
152
|
function v({
|
|
153
153
|
className: e,
|
|
154
154
|
children: t,
|
|
155
|
-
...
|
|
155
|
+
...a
|
|
156
156
|
}) {
|
|
157
|
-
return t ? /* @__PURE__ */
|
|
157
|
+
return t ? /* @__PURE__ */ n(
|
|
158
158
|
"span",
|
|
159
159
|
{
|
|
160
160
|
"data-slot": "image-filename",
|
|
@@ -162,12 +162,12 @@ function v({
|
|
|
162
162
|
"text-muted-foreground block truncate px-2 py-1.5 text-xs",
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
...
|
|
165
|
+
...a,
|
|
166
166
|
children: t
|
|
167
167
|
}
|
|
168
168
|
) : null;
|
|
169
169
|
}
|
|
170
|
-
function j({ src: e, alt: t = "Image preview", children:
|
|
170
|
+
function j({ src: e, alt: t = "Image preview", children: a }) {
|
|
171
171
|
const [i, l] = p(!1), [o, r] = p(!1);
|
|
172
172
|
b(() => {
|
|
173
173
|
l(!0);
|
|
@@ -185,8 +185,8 @@ function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
185
185
|
return document.body.style.overflow = "hidden", () => {
|
|
186
186
|
document.body.style.overflow = m;
|
|
187
187
|
};
|
|
188
|
-
}, [o]), /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
188
|
+
}, [o]), /* @__PURE__ */ u(E, { children: [
|
|
189
|
+
/* @__PURE__ */ n(
|
|
190
190
|
"div",
|
|
191
191
|
{
|
|
192
192
|
onClick: s,
|
|
@@ -195,21 +195,21 @@ function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
195
195
|
tabIndex: 0,
|
|
196
196
|
className: "aui-image-zoom-trigger cursor-zoom-in",
|
|
197
197
|
"aria-label": "Click to zoom image",
|
|
198
|
-
children:
|
|
198
|
+
children: a
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
201
|
i && o && O(
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ n(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
"data-slot": "image-zoom-overlay",
|
|
206
206
|
role: "button",
|
|
207
207
|
tabIndex: 0,
|
|
208
|
-
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-
|
|
208
|
+
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-wg12/80 duration-200",
|
|
209
209
|
onClick: f,
|
|
210
210
|
onKeyDown: (m) => m.key === "Enter" && f(),
|
|
211
211
|
"aria-label": "Close zoomed image",
|
|
212
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ n(
|
|
213
213
|
"img",
|
|
214
214
|
{
|
|
215
215
|
"data-slot": "image-zoom-content",
|
|
@@ -228,7 +228,7 @@ function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
228
228
|
] });
|
|
229
229
|
}
|
|
230
230
|
function k({ className: e }) {
|
|
231
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ n(
|
|
232
232
|
"div",
|
|
233
233
|
{
|
|
234
234
|
"data-slot": "image-generating",
|
|
@@ -236,7 +236,7 @@ function k({ className: e }) {
|
|
|
236
236
|
"bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
237
237
|
e
|
|
238
238
|
),
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ n(
|
|
240
240
|
w,
|
|
241
241
|
{
|
|
242
242
|
variant: "surface",
|
|
@@ -252,7 +252,7 @@ function R({
|
|
|
252
252
|
className: e,
|
|
253
253
|
reason: t
|
|
254
254
|
}) {
|
|
255
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ u(
|
|
256
256
|
"div",
|
|
257
257
|
{
|
|
258
258
|
"data-slot": "image-content-filter-error",
|
|
@@ -261,9 +261,9 @@ function R({
|
|
|
261
261
|
e
|
|
262
262
|
),
|
|
263
263
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
t && /* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ n(B, { className: "text-muted-foreground size-8" }),
|
|
265
|
+
/* @__PURE__ */ n("p", { className: "text-sm font-medium", children: "Image could not be generated" }),
|
|
266
|
+
t && /* @__PURE__ */ n("p", { className: "text-muted-foreground text-xs", children: t })
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
);
|
|
@@ -271,17 +271,17 @@ function R({
|
|
|
271
271
|
function V({
|
|
272
272
|
onRegenerate: e
|
|
273
273
|
}) {
|
|
274
|
-
const [t,
|
|
275
|
-
return /* @__PURE__ */
|
|
274
|
+
const [t, a] = p(!1);
|
|
275
|
+
return /* @__PURE__ */ n(
|
|
276
276
|
"button",
|
|
277
277
|
{
|
|
278
278
|
type: "button",
|
|
279
279
|
onClick: async () => {
|
|
280
|
-
|
|
280
|
+
a(!0);
|
|
281
281
|
try {
|
|
282
282
|
await e();
|
|
283
283
|
} finally {
|
|
284
|
-
|
|
284
|
+
a(!1);
|
|
285
285
|
}
|
|
286
286
|
},
|
|
287
287
|
disabled: t,
|
|
@@ -289,18 +289,18 @@ function V({
|
|
|
289
289
|
"aria-label": "Regenerate image",
|
|
290
290
|
"aria-busy": t || void 0,
|
|
291
291
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded disabled:opacity-50",
|
|
292
|
-
children: t ? /* @__PURE__ */
|
|
292
|
+
children: t ? /* @__PURE__ */ n(w, { variant: "action", size: "sm", "aria-hidden": !0 }) : /* @__PURE__ */ n(W, { className: "size-4" })
|
|
293
293
|
}
|
|
294
294
|
);
|
|
295
295
|
}
|
|
296
|
-
function Z({ part: e, onRegenerate: t, className:
|
|
297
|
-
return /* @__PURE__ */
|
|
296
|
+
function Z({ part: e, onRegenerate: t, className: a }) {
|
|
297
|
+
return /* @__PURE__ */ u(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
300
|
"data-slot": "image-actions",
|
|
301
|
-
className: d("flex items-center gap-1 p-1",
|
|
301
|
+
className: d("flex items-center gap-1 p-1", a),
|
|
302
302
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ n(
|
|
304
304
|
"button",
|
|
305
305
|
{
|
|
306
306
|
type: "button",
|
|
@@ -308,10 +308,10 @@ function Z({ part: e, onRegenerate: t, className: n }) {
|
|
|
308
308
|
"data-slot": "image-download",
|
|
309
309
|
"aria-label": "Download image",
|
|
310
310
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
311
|
-
children: /* @__PURE__ */
|
|
311
|
+
children: /* @__PURE__ */ n(A, { className: "size-4" })
|
|
312
312
|
}
|
|
313
313
|
),
|
|
314
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ n(
|
|
315
315
|
"button",
|
|
316
316
|
{
|
|
317
317
|
type: "button",
|
|
@@ -322,22 +322,22 @@ function Z({ part: e, onRegenerate: t, className: n }) {
|
|
|
322
322
|
"data-slot": "image-copy",
|
|
323
323
|
"aria-label": "Copy image",
|
|
324
324
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
325
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ n(L, { className: "size-4" })
|
|
326
326
|
}
|
|
327
327
|
),
|
|
328
|
-
t && /* @__PURE__ */
|
|
328
|
+
t && /* @__PURE__ */ n(V, { onRegenerate: t })
|
|
329
329
|
]
|
|
330
330
|
}
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
333
|
const $ = (e) => {
|
|
334
|
-
const { image: t, filename:
|
|
335
|
-
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
334
|
+
const { image: t, filename: a, status: i } = e;
|
|
335
|
+
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */ u(h, { children: [
|
|
336
|
+
/* @__PURE__ */ n(k, {}),
|
|
337
|
+
/* @__PURE__ */ n(v, { children: a })
|
|
338
|
+
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */ n(h, { children: /* @__PURE__ */ n(R, { reason: "The provider blocked this image." }) }) : /* @__PURE__ */ u(h, { children: [
|
|
339
|
+
/* @__PURE__ */ n(j, { src: t, alt: a || "Image content", children: /* @__PURE__ */ n(C, { src: t, alt: a || "Image content" }) }),
|
|
340
|
+
/* @__PURE__ */ n(v, { children: a })
|
|
341
341
|
] });
|
|
342
342
|
}, c = D($);
|
|
343
343
|
c.displayName = "Image";
|
|
@@ -25,7 +25,7 @@ const r = (s) => s === void 0 ? "—" : s < 1e3 ? `${Math.round(s)}ms` : `${(s /
|
|
|
25
25
|
side: o,
|
|
26
26
|
sideOffset: 8,
|
|
27
27
|
"data-slot": "message-timing-popover",
|
|
28
|
-
className: "bg-popover text-popover-foreground rounded-lg border px-3 py-2 shadow-
|
|
28
|
+
className: "bg-popover text-popover-foreground rounded-lg border px-3 py-2 shadow-300 [&_span>svg]:hidden!",
|
|
29
29
|
children: /* @__PURE__ */ n("div", { className: "grid min-w-35 gap-1.5 text-xs", children: [
|
|
30
30
|
e.firstTokenTime !== void 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4", children: [
|
|
31
31
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "First token" }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, jsx as t, Fragment as
|
|
2
|
+
import { jsxs as l, jsx as t, Fragment as p } from "react/jsx-runtime";
|
|
3
3
|
import { memo as f } from "react";
|
|
4
|
-
import { SelectionToolbarPrimitive as
|
|
4
|
+
import { SelectionToolbarPrimitive as m } from "@assistant-ui/react";
|
|
5
5
|
import { Quote as y, Copy as S } from "../../lib/icons.js";
|
|
6
6
|
import { cn as i } from "../../lib/cn.js";
|
|
7
7
|
function d({
|
|
@@ -9,11 +9,11 @@ function d({
|
|
|
9
9
|
...e
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ t(
|
|
12
|
-
|
|
12
|
+
m.Root,
|
|
13
13
|
{
|
|
14
14
|
"data-slot": "selection-toolbar",
|
|
15
15
|
className: i(
|
|
16
|
-
"bg-popover flex items-center gap-1 rounded-lg border px-1 py-1 shadow-
|
|
16
|
+
"bg-popover flex items-center gap-1 rounded-lg border px-1 py-1 shadow-300",
|
|
17
17
|
o
|
|
18
18
|
),
|
|
19
19
|
...e
|
|
@@ -26,7 +26,7 @@ function u({
|
|
|
26
26
|
...r
|
|
27
27
|
}) {
|
|
28
28
|
return /* @__PURE__ */ t(
|
|
29
|
-
|
|
29
|
+
m.Quote,
|
|
30
30
|
{
|
|
31
31
|
"data-slot": "selection-toolbar-quote",
|
|
32
32
|
className: i(
|
|
@@ -34,7 +34,7 @@ function u({
|
|
|
34
34
|
o
|
|
35
35
|
),
|
|
36
36
|
...r,
|
|
37
|
-
children: e ?? /* @__PURE__ */ l(
|
|
37
|
+
children: e ?? /* @__PURE__ */ l(p, { children: [
|
|
38
38
|
/* @__PURE__ */ t(y, { className: "size-3.5" }),
|
|
39
39
|
"Quote"
|
|
40
40
|
] })
|
|
@@ -63,7 +63,7 @@ function b({
|
|
|
63
63
|
), (s = window.getSelection()) == null || s.removeAllRanges(), r == null || r(x);
|
|
64
64
|
},
|
|
65
65
|
...g,
|
|
66
|
-
children: e ?? /* @__PURE__ */ l(
|
|
66
|
+
children: e ?? /* @__PURE__ */ l(p, { children: [
|
|
67
67
|
/* @__PURE__ */ t(S, { className: "size-3.5" }),
|
|
68
68
|
"Copy"
|
|
69
69
|
] })
|
package/components/avatar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { cn as s } from "../lib/cn.js";
|
|
5
5
|
const m = {
|
|
@@ -8,69 +8,69 @@ const m = {
|
|
|
8
8
|
md: "size-10 text-xs",
|
|
9
9
|
lg: "size-12 text-base",
|
|
10
10
|
xl: "size-16 text-lg"
|
|
11
|
-
},
|
|
11
|
+
}, p = {
|
|
12
12
|
full: "rounded-full",
|
|
13
13
|
lg: "rounded-lg"
|
|
14
14
|
};
|
|
15
|
-
function v(
|
|
16
|
-
const e =
|
|
15
|
+
function v(t) {
|
|
16
|
+
const e = t.trim().split(/\s+/).filter(Boolean);
|
|
17
17
|
return e.length === 0 ? "" : e.length === 1 ? e[0].slice(0, 2).toUpperCase() : (e[0][0] + e[e.length - 1][0]).toUpperCase();
|
|
18
18
|
}
|
|
19
19
|
const g = [
|
|
20
|
-
"bg-g9 text-
|
|
21
|
-
"bg-g10 text-
|
|
22
|
-
"bg-g11 text-
|
|
20
|
+
"bg-g9 text-action-primary-foreground",
|
|
21
|
+
"bg-g10 text-action-primary-foreground",
|
|
22
|
+
"bg-g11 text-action-primary-foreground",
|
|
23
23
|
"bg-g4 text-g12"
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
const e = Array.from(
|
|
27
|
-
(
|
|
25
|
+
function y(t) {
|
|
26
|
+
const e = Array.from(t).reduce(
|
|
27
|
+
(r, i) => r + i.charCodeAt(0),
|
|
28
28
|
0
|
|
29
29
|
);
|
|
30
30
|
return g[e % g.length];
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
({ className:
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */
|
|
32
|
+
const N = f.forwardRef(
|
|
33
|
+
({ className: t, src: e, name: r, size: i = "md", radius: o = "full", ...a }, d) => {
|
|
34
|
+
const l = r ? v(r) : "";
|
|
35
|
+
return /* @__PURE__ */ n(
|
|
36
36
|
"span",
|
|
37
37
|
{
|
|
38
38
|
ref: d,
|
|
39
39
|
role: "img",
|
|
40
|
-
"aria-label":
|
|
40
|
+
"aria-label": r,
|
|
41
41
|
className: s(
|
|
42
42
|
"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-normal",
|
|
43
43
|
// Images sit on the neutral fill; initials use the ADS green ramp.
|
|
44
|
-
e || !
|
|
44
|
+
e || !r ? "bg-fill text-fill-foreground" : y(r),
|
|
45
45
|
m[i],
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
p[o],
|
|
47
|
+
t
|
|
48
48
|
),
|
|
49
49
|
...a,
|
|
50
|
-
children: e ? /* @__PURE__ */
|
|
50
|
+
children: e ? /* @__PURE__ */ n(
|
|
51
51
|
"img",
|
|
52
52
|
{
|
|
53
53
|
src: e,
|
|
54
|
-
alt:
|
|
54
|
+
alt: r ?? "",
|
|
55
55
|
className: "size-full object-cover"
|
|
56
56
|
}
|
|
57
|
-
) : /* @__PURE__ */
|
|
57
|
+
) : /* @__PURE__ */ n("span", { "aria-hidden": !0, children: l })
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
({ className:
|
|
65
|
-
const
|
|
62
|
+
N.displayName = "Avatar";
|
|
63
|
+
const A = f.forwardRef(
|
|
64
|
+
({ className: t, max: e, size: r = "md", radius: i = "full", children: o, ...a }, d) => {
|
|
65
|
+
const l = f.Children.toArray(o), c = typeof e == "number" ? l.length - e : 0, h = typeof e == "number" ? l.slice(0, e) : l;
|
|
66
66
|
return /* @__PURE__ */ b(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
ref: d,
|
|
70
|
-
className: s("flex items-center",
|
|
70
|
+
className: s("flex items-center", t),
|
|
71
71
|
...a,
|
|
72
72
|
children: [
|
|
73
|
-
|
|
73
|
+
h.map((x, u) => /* @__PURE__ */ n(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
className: s(
|
|
@@ -81,7 +81,7 @@ const w = f.forwardRef(
|
|
|
81
81
|
},
|
|
82
82
|
u
|
|
83
83
|
)),
|
|
84
|
-
c > 0 && /* @__PURE__ */
|
|
84
|
+
c > 0 && /* @__PURE__ */ n("div", { className: s("ring-2 ring-background rounded-full -ml-2"), children: /* @__PURE__ */ n(
|
|
85
85
|
"span",
|
|
86
86
|
{
|
|
87
87
|
role: "img",
|
|
@@ -89,10 +89,10 @@ const w = f.forwardRef(
|
|
|
89
89
|
className: s(
|
|
90
90
|
"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-normal",
|
|
91
91
|
"bg-muted text-muted-foreground",
|
|
92
|
-
m[
|
|
93
|
-
|
|
92
|
+
m[r],
|
|
93
|
+
p[i]
|
|
94
94
|
),
|
|
95
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ n("span", { "aria-hidden": !0, children: `+${c}` })
|
|
96
96
|
}
|
|
97
97
|
) })
|
|
98
98
|
]
|
|
@@ -100,8 +100,8 @@ const w = f.forwardRef(
|
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
|
-
|
|
103
|
+
A.displayName = "AvatarGroup";
|
|
104
104
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
N as Avatar,
|
|
106
|
+
A as AvatarGroup
|
|
107
107
|
};
|
package/components/chip.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as x, Fragment as h, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { Close as
|
|
3
|
+
import * as w from "react";
|
|
4
|
+
import { cva as N } from "class-variance-authority";
|
|
5
|
+
import { Close as y } from "../lib/icons.js";
|
|
6
6
|
import { cn as i } from "../lib/cn.js";
|
|
7
|
-
const k =
|
|
7
|
+
const k = N(
|
|
8
8
|
"inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-[4px] border px-2 py-0 text-s font-medium leading-[var(--text-s--line-height)]",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -23,8 +23,8 @@ const k = y(
|
|
|
23
23
|
},
|
|
24
24
|
compoundVariants: [
|
|
25
25
|
// solid — the default tinted surface
|
|
26
|
-
{ variant: "solid", color: "default", className: "border-
|
|
27
|
-
{ variant: "solid", color: "primary", className: "border-
|
|
26
|
+
{ variant: "solid", color: "default", className: "border-wg6 bg-wg2 text-muted-foreground" },
|
|
27
|
+
{ variant: "solid", color: "primary", className: "border-wg5 bg-fill text-fill-foreground" },
|
|
28
28
|
{ variant: "solid", color: "success", className: "border-success-400 bg-success-50 text-success-700" },
|
|
29
29
|
{ variant: "solid", color: "warning", className: "border-warning-300 bg-warning-50 text-warning-700" },
|
|
30
30
|
{ variant: "solid", color: "danger", className: "border-danger-300 bg-danger-50 text-danger-700" },
|
|
@@ -46,7 +46,7 @@ const k = y(
|
|
|
46
46
|
warning: "bg-warning",
|
|
47
47
|
danger: "bg-danger",
|
|
48
48
|
info: "bg-info"
|
|
49
|
-
}, j =
|
|
49
|
+
}, j = w.forwardRef(
|
|
50
50
|
({
|
|
51
51
|
className: u,
|
|
52
52
|
variant: b = "solid",
|
|
@@ -93,7 +93,7 @@ const k = y(
|
|
|
93
93
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
94
94
|
"[&_svg]:size-3"
|
|
95
95
|
),
|
|
96
|
-
children: /* @__PURE__ */ e(
|
|
96
|
+
children: /* @__PURE__ */ e(y, { "aria-hidden": !0 })
|
|
97
97
|
}
|
|
98
98
|
)
|
|
99
99
|
] });
|
package/components/divider.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import * as b from "react";
|
|
4
4
|
import { cn as e } from "../lib/cn.js";
|
|
5
|
-
const p = "linear-gradient(to right,
|
|
5
|
+
const p = "linear-gradient(to right, var(--color-wg12), transparent)", g = "linear-gradient(to bottom, var(--color-wg12), transparent)", v = b.forwardRef(
|
|
6
6
|
({
|
|
7
|
-
className:
|
|
7
|
+
className: o,
|
|
8
8
|
orientation: m = "horizontal",
|
|
9
|
-
variant:
|
|
9
|
+
variant: x = "primary",
|
|
10
10
|
fade: c = !1,
|
|
11
11
|
label: d,
|
|
12
|
-
style:
|
|
12
|
+
style: n,
|
|
13
13
|
...i
|
|
14
14
|
}, s) => {
|
|
15
|
-
const
|
|
16
|
-
WebkitMaskImage:
|
|
17
|
-
maskImage:
|
|
15
|
+
const f = x === "secondary", r = m === "vertical", t = f ? r ? "w-px [background-image:linear-gradient(to_bottom,var(--color-border)_50%,transparent_50%)] [background-size:1px_12px] [background-repeat:repeat-y]" : "h-px [background-image:linear-gradient(to_right,var(--color-border)_50%,transparent_50%)] [background-size:12px_1px] [background-repeat:repeat-x]" : r ? "w-px bg-border" : "h-px bg-border", l = c ? {
|
|
16
|
+
WebkitMaskImage: r ? g : p,
|
|
17
|
+
maskImage: r ? g : p
|
|
18
18
|
} : void 0;
|
|
19
|
-
return
|
|
19
|
+
return r ? /* @__PURE__ */ a(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
ref: s,
|
|
23
23
|
role: "separator",
|
|
24
24
|
"aria-orientation": "vertical",
|
|
25
|
-
className: e("h-full self-stretch", t,
|
|
26
|
-
style: { ...l, ...
|
|
25
|
+
className: e("h-full self-stretch", t, o),
|
|
26
|
+
style: { ...l, ...n },
|
|
27
27
|
...i
|
|
28
28
|
}
|
|
29
|
-
) : d != null ? /* @__PURE__ */
|
|
29
|
+
) : d != null ? /* @__PURE__ */ u(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
ref: s,
|
|
33
33
|
role: "separator",
|
|
34
34
|
"aria-orientation": "horizontal",
|
|
35
|
-
className: e("flex items-center gap-3 w-full",
|
|
36
|
-
style:
|
|
35
|
+
className: e("flex items-center gap-3 w-full", o),
|
|
36
|
+
style: n,
|
|
37
37
|
...i,
|
|
38
38
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ a("span", { className: e("flex-1", t), style: l }),
|
|
40
|
+
/* @__PURE__ */ a("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: d }),
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
42
|
"span",
|
|
43
43
|
{
|
|
44
44
|
className: e("flex-1", t),
|
|
45
45
|
style: c ? {
|
|
46
|
-
WebkitMaskImage: "linear-gradient(to left,
|
|
47
|
-
maskImage: "linear-gradient(to left,
|
|
46
|
+
WebkitMaskImage: "linear-gradient(to left, var(--color-wg12), transparent)",
|
|
47
|
+
maskImage: "linear-gradient(to left, var(--color-wg12), transparent)"
|
|
48
48
|
} : void 0
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
|
-
) : /* @__PURE__ */
|
|
53
|
+
) : /* @__PURE__ */ a(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
ref: s,
|
|
57
57
|
role: "separator",
|
|
58
58
|
"aria-orientation": "horizontal",
|
|
59
|
-
className: e("w-full", t,
|
|
60
|
-
style: { ...l, ...
|
|
59
|
+
className: e("w-full", t, o),
|
|
60
|
+
style: { ...l, ...n },
|
|
61
61
|
...i
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
|
-
|
|
66
|
+
v.displayName = "Divider";
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
v as Divider
|
|
69
69
|
};
|