@actioneer/ads 1.0.6 → 1.0.8
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 +80 -86
- package/README.md +6 -0
- package/components/ai-elements/chart.js +20 -20
- package/components/ai-elements/inline-citation.js +50 -50
- package/components/ai-elements/message.js +1 -1
- package/components/ai-elements/tool.js +5 -5
- package/components/alert.d.ts +5 -4
- package/components/alert.js +91 -79
- package/components/answer.js +1 -1
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +68 -49
- package/components/assistant-ui/composer-add-context.js +1 -1
- package/components/assistant-ui/composer-trigger-popover.js +1 -1
- package/components/assistant-ui/composer.js +13 -13
- package/components/assistant-ui/message-timing.js +6 -6
- package/components/assistant-ui/selection-toolbar.js +5 -5
- package/components/assistant-ui/sources.js +15 -15
- package/components/assistant-ui/tooltip-icon-button.js +18 -14
- package/components/audio-waveform.d.ts +21 -8
- package/components/audio-waveform.js +371 -94
- package/components/autocomplete.js +9 -9
- package/components/breadcrumbs.js +32 -38
- package/components/button.js +83 -73
- package/components/card.js +1 -1
- package/components/chart.js +732 -673
- package/components/chip.js +37 -35
- package/components/command-palette.js +12 -12
- package/components/connector-card.d.ts +1 -2
- package/components/connector-card.js +17 -17
- package/components/date-range-picker.js +1 -2
- package/components/drawer.js +9 -10
- package/components/dropdown.js +1 -1
- package/components/empty-state.d.ts +2 -0
- package/components/empty-state.js +17 -15
- package/components/field.js +9 -10
- package/components/file-dropzone.d.ts +6 -3
- package/components/file-dropzone.js +72 -60
- package/components/infinite-canvas.js +9 -9
- package/components/modal.js +1 -1
- package/components/page-body.js +8 -8
- package/components/popover.js +11 -11
- package/components/progress-circle.d.ts +1 -1
- package/components/progress-circle.js +57 -48
- package/components/radio.d.ts +1 -1
- package/components/radio.js +53 -53
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +34 -36
- package/components/select.js +2 -2
- package/components/selection-action-bar.js +32 -31
- package/components/setting-row.js +10 -10
- package/components/sidebar.js +74 -73
- package/components/slider.js +5 -5
- package/components/stepper.d.ts +1 -1
- package/components/stepper.js +1 -1
- package/components/switch.js +10 -10
- package/components/table.d.ts +17 -5
- package/components/table.js +559 -405
- package/components/tabs.js +41 -35
- package/components/timeline.js +3 -3
- package/components/toast.js +53 -56
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +1 -1
- package/components/viz-charts.js +263 -221
- package/examples/README.md +30 -0
- package/examples/agents-screen.tsx +477 -0
- package/examples/settings-screen.tsx +90 -0
- package/examples/workspace-header.tsx +71 -0
- package/lib/icons.d.ts +8 -0
- package/lib/icons.js +171 -118
- package/llms.txt +16 -16
- package/manifest.json +178 -54
- package/package.json +1 -1
- package/styles.css +60 -72
- package/theme.css +55 -63
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as r, jsxs as k } from "react/jsx-runtime";
|
|
3
3
|
import * as o from "react";
|
|
4
4
|
import { createPortal as M } from "react-dom";
|
|
5
5
|
import { MotionConfig as R, AnimatePresence as E, motion as L } from "motion/react";
|
|
@@ -7,7 +7,7 @@ import { cn as c } from "../../lib/cn.js";
|
|
|
7
7
|
import { floatVariants as T } from "../../lib/motion.js";
|
|
8
8
|
import { ArrowRight as P, ArrowLeft as z } from "../../lib/icons.js";
|
|
9
9
|
import { Badge as S } from "../badge.js";
|
|
10
|
-
const F = ({ className: e, ...t }) => /* @__PURE__ */
|
|
10
|
+
const F = ({ className: e, ...t }) => /* @__PURE__ */ r(
|
|
11
11
|
"span",
|
|
12
12
|
{
|
|
13
13
|
className: c("group/citation inline items-center gap-1", e),
|
|
@@ -16,7 +16,7 @@ const F = ({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
16
16
|
), H = ({
|
|
17
17
|
className: e,
|
|
18
18
|
...t
|
|
19
|
-
}) => /* @__PURE__ */
|
|
19
|
+
}) => /* @__PURE__ */ r(
|
|
20
20
|
"span",
|
|
21
21
|
{
|
|
22
22
|
className: c(
|
|
@@ -37,17 +37,17 @@ const Q = ({
|
|
|
37
37
|
open: t,
|
|
38
38
|
defaultOpen: s = !1,
|
|
39
39
|
onOpenChange: n,
|
|
40
|
-
openDelay:
|
|
40
|
+
openDelay: i = 0,
|
|
41
41
|
closeDelay: a = 0
|
|
42
42
|
}) => {
|
|
43
|
-
const d = t !== void 0, [C, l] = o.useState(s),
|
|
44
|
-
(
|
|
45
|
-
d || l(
|
|
43
|
+
const d = t !== void 0, [C, l] = o.useState(s), b = d ? t : C, u = o.useRef(null), f = o.useRef(null), m = o.useRef({}), x = o.useCallback(
|
|
44
|
+
(h) => {
|
|
45
|
+
d || l(h), n == null || n(h);
|
|
46
46
|
},
|
|
47
47
|
[d, n]
|
|
48
48
|
), p = o.useCallback(() => {
|
|
49
|
-
window.clearTimeout(m.current.close), m.current.open = window.setTimeout(() => x(!0),
|
|
50
|
-
}, [
|
|
49
|
+
window.clearTimeout(m.current.close), m.current.open = window.setTimeout(() => x(!0), i);
|
|
50
|
+
}, [i, x]), w = o.useCallback(() => {
|
|
51
51
|
window.clearTimeout(m.current.open), m.current.close = window.setTimeout(
|
|
52
52
|
() => x(!1),
|
|
53
53
|
a + 120
|
|
@@ -58,10 +58,10 @@ const Q = ({
|
|
|
58
58
|
window.clearTimeout(m.current.open), window.clearTimeout(m.current.close);
|
|
59
59
|
},
|
|
60
60
|
[]
|
|
61
|
-
), /* @__PURE__ */
|
|
61
|
+
), /* @__PURE__ */ r(
|
|
62
62
|
g.Provider,
|
|
63
63
|
{
|
|
64
|
-
value: { open:
|
|
64
|
+
value: { open: b, triggerRef: u, contentRef: f, handleOpen: p, handleClose: w },
|
|
65
65
|
children: e
|
|
66
66
|
}
|
|
67
67
|
);
|
|
@@ -70,7 +70,7 @@ const Q = ({
|
|
|
70
70
|
className: t,
|
|
71
71
|
...s
|
|
72
72
|
}) => {
|
|
73
|
-
const { open: n, triggerRef:
|
|
73
|
+
const { open: n, triggerRef: i, handleOpen: a, handleClose: d } = N(
|
|
74
74
|
"InlineCitationCardTrigger"
|
|
75
75
|
), C = o.useMemo(() => {
|
|
76
76
|
if (!e[0]) return "unknown";
|
|
@@ -81,10 +81,10 @@ const Q = ({
|
|
|
81
81
|
}
|
|
82
82
|
return e.length > 1 ? `${l} +${e.length - 1}` : l;
|
|
83
83
|
}, [e]);
|
|
84
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ r(
|
|
85
85
|
S,
|
|
86
86
|
{
|
|
87
|
-
ref:
|
|
87
|
+
ref: i,
|
|
88
88
|
variant: "soft",
|
|
89
89
|
className: c("ml-1 cursor-default align-middle", t),
|
|
90
90
|
role: "button",
|
|
@@ -104,21 +104,21 @@ const Q = ({
|
|
|
104
104
|
children: t,
|
|
105
105
|
...s
|
|
106
106
|
}) => {
|
|
107
|
-
const { open: n, triggerRef:
|
|
107
|
+
const { open: n, triggerRef: i, contentRef: a, handleOpen: d, handleClose: C } = N("InlineCitationCardBody"), [l, b] = o.useState(null);
|
|
108
108
|
return o.useLayoutEffect(() => {
|
|
109
109
|
if (!n) return;
|
|
110
|
-
const u =
|
|
110
|
+
const u = i.current;
|
|
111
111
|
if (!u) return;
|
|
112
112
|
const f = () => {
|
|
113
|
-
var
|
|
114
|
-
const m = u.getBoundingClientRect(), x = ((
|
|
115
|
-
|
|
113
|
+
var h;
|
|
114
|
+
const m = u.getBoundingClientRect(), x = ((h = a.current) == null ? void 0 : h.offsetWidth) ?? 320, p = window.innerWidth - x - 8, w = m.left > p ? Math.max(8, p) : m.left;
|
|
115
|
+
b({ top: m.bottom + 6, left: w });
|
|
116
116
|
};
|
|
117
117
|
return f(), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0), () => {
|
|
118
118
|
window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
|
|
119
119
|
};
|
|
120
|
-
}, [n,
|
|
121
|
-
/* @__PURE__ */
|
|
120
|
+
}, [n, i]), M(
|
|
121
|
+
/* @__PURE__ */ r(R, { reducedMotion: "user", children: /* @__PURE__ */ r(E, { children: n && /* @__PURE__ */ r(
|
|
122
122
|
L.div,
|
|
123
123
|
{
|
|
124
124
|
ref: a,
|
|
@@ -137,7 +137,7 @@ const Q = ({
|
|
|
137
137
|
transformOrigin: "top left"
|
|
138
138
|
},
|
|
139
139
|
className: c(
|
|
140
|
-
"z-50 w-80 overflow-hidden rounded-lg border border-border bg-elevated text-foreground
|
|
140
|
+
"z-50 w-80 overflow-hidden rounded-lg border border-border bg-elevated text-foreground",
|
|
141
141
|
e
|
|
142
142
|
),
|
|
143
143
|
...s,
|
|
@@ -160,20 +160,20 @@ const G = ({
|
|
|
160
160
|
children: t,
|
|
161
161
|
...s
|
|
162
162
|
}) => {
|
|
163
|
-
const [n,
|
|
164
|
-
() =>
|
|
163
|
+
const [n, i] = o.useState(0), [a, d] = o.useState(0), C = o.useCallback(
|
|
164
|
+
() => i((u) => Math.max(0, u - 1)),
|
|
165
165
|
[]
|
|
166
166
|
), l = o.useCallback(
|
|
167
|
-
() =>
|
|
167
|
+
() => i((u) => Math.min(Math.max(0, a - 1), u + 1)),
|
|
168
168
|
[a]
|
|
169
|
-
),
|
|
170
|
-
d(u),
|
|
169
|
+
), b = o.useCallback((u) => {
|
|
170
|
+
d(u), i((f) => Math.min(f, Math.max(0, u - 1)));
|
|
171
171
|
}, []);
|
|
172
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ r(
|
|
173
173
|
I.Provider,
|
|
174
174
|
{
|
|
175
|
-
value: { index: n, count: a, setCount:
|
|
176
|
-
children: /* @__PURE__ */
|
|
175
|
+
value: { index: n, count: a, setCount: b, scrollPrev: C, scrollNext: l },
|
|
176
|
+
children: /* @__PURE__ */ r("div", { className: c("w-full", e), ...s, children: t })
|
|
177
177
|
}
|
|
178
178
|
);
|
|
179
179
|
}, J = ({
|
|
@@ -181,10 +181,10 @@ const G = ({
|
|
|
181
181
|
children: t,
|
|
182
182
|
...s
|
|
183
183
|
}) => {
|
|
184
|
-
const { index: n, setCount:
|
|
184
|
+
const { index: n, setCount: i } = v(), a = o.Children.count(t);
|
|
185
185
|
return o.useEffect(() => {
|
|
186
|
-
|
|
187
|
-
}, [a,
|
|
186
|
+
i(a);
|
|
187
|
+
}, [a, i]), /* @__PURE__ */ r("div", { className: c("overflow-hidden", e), ...s, children: /* @__PURE__ */ r(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
190
|
className: "flex transition-transform duration-200 ease-out motion-reduce:transition-none",
|
|
@@ -195,7 +195,7 @@ const G = ({
|
|
|
195
195
|
}, K = ({
|
|
196
196
|
className: e,
|
|
197
197
|
...t
|
|
198
|
-
}) => /* @__PURE__ */
|
|
198
|
+
}) => /* @__PURE__ */ r(
|
|
199
199
|
"div",
|
|
200
200
|
{
|
|
201
201
|
className: c("w-full shrink-0 space-y-2 p-4", e),
|
|
@@ -204,7 +204,7 @@ const G = ({
|
|
|
204
204
|
), O = ({
|
|
205
205
|
className: e,
|
|
206
206
|
...t
|
|
207
|
-
}) => /* @__PURE__ */
|
|
207
|
+
}) => /* @__PURE__ */ r(
|
|
208
208
|
"div",
|
|
209
209
|
{
|
|
210
210
|
className: c(
|
|
@@ -218,8 +218,8 @@ const G = ({
|
|
|
218
218
|
className: t,
|
|
219
219
|
...s
|
|
220
220
|
}) => {
|
|
221
|
-
const { index: n, count:
|
|
222
|
-
return /* @__PURE__ */
|
|
221
|
+
const { index: n, count: i } = v();
|
|
222
|
+
return /* @__PURE__ */ r(
|
|
223
223
|
"div",
|
|
224
224
|
{
|
|
225
225
|
className: c(
|
|
@@ -227,7 +227,7 @@ const G = ({
|
|
|
227
227
|
t
|
|
228
228
|
),
|
|
229
229
|
...s,
|
|
230
|
-
children: e ?? `${
|
|
230
|
+
children: e ?? `${i === 0 ? 0 : n + 1}/${i}`
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}, y = c(
|
|
@@ -240,7 +240,7 @@ const G = ({
|
|
|
240
240
|
...t
|
|
241
241
|
}) => {
|
|
242
242
|
const { scrollPrev: s, index: n } = v();
|
|
243
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ r(
|
|
244
244
|
"button",
|
|
245
245
|
{
|
|
246
246
|
type: "button",
|
|
@@ -249,24 +249,24 @@ const G = ({
|
|
|
249
249
|
onClick: s,
|
|
250
250
|
className: c(y, e),
|
|
251
251
|
...t,
|
|
252
|
-
children: /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ r(z, { className: "size-4" })
|
|
253
253
|
}
|
|
254
254
|
);
|
|
255
255
|
}, _ = ({
|
|
256
256
|
className: e,
|
|
257
257
|
...t
|
|
258
258
|
}) => {
|
|
259
|
-
const { scrollNext: s, index: n, count:
|
|
260
|
-
return /* @__PURE__ */
|
|
259
|
+
const { scrollNext: s, index: n, count: i } = v();
|
|
260
|
+
return /* @__PURE__ */ r(
|
|
261
261
|
"button",
|
|
262
262
|
{
|
|
263
263
|
type: "button",
|
|
264
264
|
"aria-label": "Next source",
|
|
265
|
-
disabled: n >=
|
|
265
|
+
disabled: n >= i - 1,
|
|
266
266
|
onClick: s,
|
|
267
267
|
className: c(y, e),
|
|
268
268
|
...t,
|
|
269
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ r(P, { className: "size-4" })
|
|
270
270
|
}
|
|
271
271
|
);
|
|
272
272
|
}, D = ({
|
|
@@ -274,18 +274,18 @@ const G = ({
|
|
|
274
274
|
url: t,
|
|
275
275
|
description: s,
|
|
276
276
|
className: n,
|
|
277
|
-
children:
|
|
277
|
+
children: i,
|
|
278
278
|
...a
|
|
279
279
|
}) => /* @__PURE__ */ k("div", { className: c("space-y-1", n), ...a, children: [
|
|
280
|
-
e && /* @__PURE__ */
|
|
281
|
-
t && /* @__PURE__ */
|
|
282
|
-
s && /* @__PURE__ */
|
|
283
|
-
|
|
280
|
+
e && /* @__PURE__ */ r("p", { className: "truncate font-normal text-base leading-tight text-primary", children: e }),
|
|
281
|
+
t && /* @__PURE__ */ r("p", { className: "truncate break-all text-s text-tertiary", children: t }),
|
|
282
|
+
s && /* @__PURE__ */ r("p", { className: "line-clamp-3 text-base leading-relaxed text-secondary", children: s }),
|
|
283
|
+
i
|
|
284
284
|
] }), ee = ({
|
|
285
285
|
children: e,
|
|
286
286
|
className: t,
|
|
287
287
|
...s
|
|
288
|
-
}) => /* @__PURE__ */
|
|
288
|
+
}) => /* @__PURE__ */ r(
|
|
289
289
|
"blockquote",
|
|
290
290
|
{
|
|
291
291
|
className: c(
|
|
@@ -105,7 +105,7 @@ const S = i(
|
|
|
105
105
|
"[&_h3]:mt-3 [&_h3]:mb-1 [&_h3]:text-base [&_h3]:font-medium",
|
|
106
106
|
"[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-1",
|
|
107
107
|
"[&_a]:font-normal [&_a]:underline [&_a]:underline-offset-2",
|
|
108
|
-
"[&_code]:rounded-xs [&_code]:bg-
|
|
108
|
+
"[&_code]:rounded-xs [&_code]:bg-wg2 [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs [&_code]:tabular-nums",
|
|
109
109
|
"[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-surface [&_pre]:p-3 [&_pre]:text-xs [&_pre_code]:bg-transparent [&_pre_code]:p-0",
|
|
110
110
|
// Markdown tables only. Scoped off `[data-slot=table]` so a composed ADS
|
|
111
111
|
// <Table> nested in a response keeps its own padding and per-column
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
3
3
|
import { isValidElement as p } from "react";
|
|
4
|
-
import { Collapsible as m, CollapsibleTrigger as f, CollapsibleContent as
|
|
5
|
-
import { Badge as
|
|
4
|
+
import { Collapsible as m, CollapsibleTrigger as f, CollapsibleContent as x } from "../collapsible.js";
|
|
5
|
+
import { Badge as h } from "../badge.js";
|
|
6
6
|
import { ChevronDown as g, CloseCircle as b, CheckCircle as N, Clock as v, CircleDashed as y } from "../../lib/icons.js";
|
|
7
7
|
import { cn as r } from "../../lib/cn.js";
|
|
8
8
|
import { TraceStateIcon as w } from "./chain-of-thought-icon.js";
|
|
@@ -24,7 +24,7 @@ const T = {
|
|
|
24
24
|
"output-error": { label: "Error", color: "danger", icon: b }
|
|
25
25
|
}, S = ({ state: e }) => {
|
|
26
26
|
const { label: o, color: n, icon: a, pulse: i } = T[e];
|
|
27
|
-
return /* @__PURE__ */ l(
|
|
27
|
+
return /* @__PURE__ */ l(h, { variant: "soft", color: n, children: [
|
|
28
28
|
/* @__PURE__ */ t(
|
|
29
29
|
a,
|
|
30
30
|
{
|
|
@@ -57,7 +57,7 @@ const O = {
|
|
|
57
57
|
f,
|
|
58
58
|
{
|
|
59
59
|
className: r(
|
|
60
|
-
"group/tool-header flex w-full items-center justify-between gap-4 py-3 text-left transition-colors hover:text-primary motion-reduce:transition-none",
|
|
60
|
+
"group/tool-header flex w-full items-center justify-between gap-4 px-4 py-3 text-left transition-colors hover:text-primary motion-reduce:transition-none",
|
|
61
61
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
62
62
|
e
|
|
63
63
|
),
|
|
@@ -93,7 +93,7 @@ const O = {
|
|
|
93
93
|
);
|
|
94
94
|
j.displayName = "ToolHeader";
|
|
95
95
|
const k = ({ className: e, ...o }) => /* @__PURE__ */ t(
|
|
96
|
-
|
|
96
|
+
x,
|
|
97
97
|
{
|
|
98
98
|
className: r(
|
|
99
99
|
"overflow-hidden text-secondary outline-none",
|
package/components/alert.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
/**
|
|
4
|
-
* Alert — inline status messaging
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Alert — inline status messaging in an outlined container. The status tone
|
|
5
|
+
* lives in a soft wash across the banner (the tone's 50 step fading to White by
|
|
6
|
+
* 70% of the width); the icon, title and description stay neutral.
|
|
7
|
+
* Buttons are 24px tall and actions sit 16px below the message. Timed alerts
|
|
8
|
+
* retain their countdown and dismiss after it completes.
|
|
8
9
|
*/
|
|
9
10
|
declare const alertVariants: (props?: ({
|
|
10
11
|
variant?: "success" | "warning" | "danger" | "info" | "default" | null | undefined;
|
package/components/alert.js
CHANGED
|
@@ -1,90 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { Info as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { springOverlay as
|
|
9
|
-
const
|
|
10
|
-
"relative
|
|
2
|
+
import { jsx as t, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
import * as e from "react";
|
|
4
|
+
import { cva as j } from "class-variance-authority";
|
|
5
|
+
import { MotionConfig as z, motion as h } from "motion/react";
|
|
6
|
+
import { Info as y, WarningCircle as V, Warning as M, CheckCircle as S, Close as W } from "../lib/icons.js";
|
|
7
|
+
import { cn as m } from "../lib/cn.js";
|
|
8
|
+
import { fadeTransition as X, springOverlay as H } from "../lib/motion.js";
|
|
9
|
+
const O = j(
|
|
10
|
+
"relative grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-4 overflow-hidden rounded-lg border border-border bg-[linear-gradient(90deg,var(--alert-soft)_0%,var(--color-card)_70%)] p-4 text-on-white-primary [&_button]:h-6",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
|
-
default: "[--alert-accent:var(--foreground)]",
|
|
15
|
-
success: "[--alert-accent:var(--color-success-700)]",
|
|
16
|
-
warning: "[--alert-accent:var(--color-warning-700)]",
|
|
17
|
-
danger: "[--alert-accent:var(--color-danger-700)]",
|
|
18
|
-
info: "[--alert-accent:var(--color-info-700)]"
|
|
14
|
+
default: "[--alert-accent:var(--foreground)] [--alert-soft:var(--color-card)]",
|
|
15
|
+
success: "[--alert-accent:var(--color-success-700)] [--alert-soft:var(--color-success-50)]",
|
|
16
|
+
warning: "[--alert-accent:var(--color-warning-700)] [--alert-soft:var(--color-warning-50)]",
|
|
17
|
+
danger: "[--alert-accent:var(--color-danger-700)] [--alert-soft:var(--color-danger-50)]",
|
|
18
|
+
info: "[--alert-accent:var(--color-info-700)] [--alert-soft:var(--color-info-50)]"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: { variant: "default" }
|
|
22
22
|
}
|
|
23
|
-
),
|
|
24
|
-
default:
|
|
25
|
-
success:
|
|
26
|
-
warning:
|
|
27
|
-
danger:
|
|
28
|
-
info:
|
|
29
|
-
},
|
|
30
|
-
({ className:
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
), q = {
|
|
24
|
+
default: y,
|
|
25
|
+
success: S,
|
|
26
|
+
warning: M,
|
|
27
|
+
danger: V,
|
|
28
|
+
info: y
|
|
29
|
+
}, B = e.forwardRef(
|
|
30
|
+
({ className: o, variant: a = "default", icon: s, duration: i = 0, onClose: l, children: g, ...A }, E) => {
|
|
31
|
+
const _ = q[a ?? "default"], [n, T] = e.useState(!1), [c, k] = e.useState(!1), d = e.useRef(l), w = e.useRef(!1), u = e.Children.toArray(g);
|
|
32
|
+
let f = -1;
|
|
33
|
+
u.forEach((r, I) => {
|
|
34
|
+
if (!e.isValidElement(r)) return;
|
|
35
|
+
const x = typeof r.type == "string" ? void 0 : r.type.displayName;
|
|
36
|
+
(r.type === b || r.type === N || x === "AlertTitle" || x === "AlertDescription") && (f = I);
|
|
37
|
+
});
|
|
38
|
+
const C = f < 0 ? g : u.slice(0, f + 1), v = f < 0 ? [] : u.slice(f + 1);
|
|
39
|
+
e.useEffect(() => {
|
|
40
|
+
d.current = l;
|
|
34
41
|
}, [l]);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
return () => window.clearTimeout(
|
|
42
|
-
}, [
|
|
43
|
-
const
|
|
44
|
-
var
|
|
45
|
-
!
|
|
46
|
-
}, [
|
|
47
|
-
return
|
|
48
|
-
|
|
42
|
+
const p = e.useCallback(() => {
|
|
43
|
+
c || T(!0);
|
|
44
|
+
}, [c]);
|
|
45
|
+
e.useEffect(() => {
|
|
46
|
+
if (i <= 0 || n || c) return;
|
|
47
|
+
const r = window.setTimeout(p, i);
|
|
48
|
+
return () => window.clearTimeout(r);
|
|
49
|
+
}, [p, i, c, n]);
|
|
50
|
+
const D = e.useCallback(() => {
|
|
51
|
+
var r;
|
|
52
|
+
!n || w.current || (w.current = !0, k(!0), (r = d.current) == null || r.call(d));
|
|
53
|
+
}, [n]);
|
|
54
|
+
return c ? null : /* @__PURE__ */ t(z, { reducedMotion: "user", children: /* @__PURE__ */ t(
|
|
55
|
+
h.div,
|
|
49
56
|
{
|
|
57
|
+
className: "w-full min-w-0",
|
|
50
58
|
initial: { opacity: 1, x: 32 },
|
|
51
|
-
animate:
|
|
52
|
-
transition:
|
|
53
|
-
onAnimationComplete:
|
|
54
|
-
children: /* @__PURE__ */
|
|
59
|
+
animate: n ? { opacity: 0, x: -32 } : { opacity: 1, x: 0 },
|
|
60
|
+
transition: n ? X : H,
|
|
61
|
+
onAnimationComplete: D,
|
|
62
|
+
children: /* @__PURE__ */ R(
|
|
55
63
|
"div",
|
|
56
64
|
{
|
|
57
|
-
ref:
|
|
65
|
+
ref: E,
|
|
66
|
+
"data-slot": "alert",
|
|
58
67
|
role: "alert",
|
|
59
|
-
className:
|
|
60
|
-
|
|
68
|
+
className: m(
|
|
69
|
+
O({ variant: a }),
|
|
70
|
+
l && "grid-cols-[auto_minmax(0,1fr)_auto]",
|
|
71
|
+
o
|
|
72
|
+
),
|
|
73
|
+
...A,
|
|
61
74
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
l && /* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ t("span", { "data-slot": "alert-icon", className: "col-start-1 row-start-1 flex h-8 w-5 self-center select-none items-center justify-center text-on-white-primary [&_svg]:size-4", children: s ?? /* @__PURE__ */ t(_, { "aria-hidden": !0 }) }),
|
|
76
|
+
/* @__PURE__ */ t("div", { "data-slot": "alert-content", className: "col-start-2 row-start-1 flex min-w-0 flex-col items-start gap-0.5 self-center [overflow-wrap:anywhere]", children: C }),
|
|
77
|
+
l && /* @__PURE__ */ t(
|
|
65
78
|
"button",
|
|
66
79
|
{
|
|
67
80
|
type: "button",
|
|
68
81
|
"aria-label": "Dismiss",
|
|
69
|
-
onClick:
|
|
70
|
-
className:
|
|
71
|
-
"inline-flex size-6
|
|
72
|
-
"transition-
|
|
82
|
+
onClick: p,
|
|
83
|
+
className: m(
|
|
84
|
+
"col-start-3 row-start-1 inline-flex size-6 cursor-pointer items-center justify-center self-start rounded-sm text-on-white-tertiary",
|
|
85
|
+
"transition-[background-color,color,transform] duration-150 ease-out hover:bg-fill hover:text-on-white-primary",
|
|
86
|
+
"active:scale-[0.97] motion-reduce:active:scale-100 motion-reduce:transition-none",
|
|
73
87
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
74
88
|
"[&_svg]:size-4"
|
|
75
89
|
),
|
|
76
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ t(W, { "aria-hidden": !0 })
|
|
77
91
|
}
|
|
78
92
|
),
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
v.length > 0 && /* @__PURE__ */ t("div", { "data-slot": "alert-actions", className: "col-start-2 row-start-2 flex min-w-0 flex-wrap items-center gap-2 [&>*]:max-w-full", children: v }),
|
|
94
|
+
i > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "absolute inset-x-0 bottom-0 h-0.5 bg-wg3", children: /* @__PURE__ */ t(
|
|
95
|
+
h.span,
|
|
81
96
|
{
|
|
82
97
|
className: "block size-full origin-left bg-(--alert-accent)",
|
|
83
98
|
initial: { scaleX: 1 },
|
|
84
99
|
animate: { scaleX: 0 },
|
|
85
|
-
transition: { duration:
|
|
100
|
+
transition: { duration: i / 1e3, ease: "linear" }
|
|
86
101
|
},
|
|
87
|
-
|
|
102
|
+
i
|
|
88
103
|
) })
|
|
89
104
|
]
|
|
90
105
|
}
|
|
@@ -93,32 +108,29 @@ const D = A(
|
|
|
93
108
|
) });
|
|
94
109
|
}
|
|
95
110
|
);
|
|
96
|
-
|
|
97
|
-
const
|
|
111
|
+
B.displayName = "Alert";
|
|
112
|
+
const b = e.forwardRef(({ className: o, ...a }, s) => /* @__PURE__ */ t(
|
|
98
113
|
"p",
|
|
99
114
|
{
|
|
100
115
|
ref: s,
|
|
101
|
-
|
|
102
|
-
|
|
116
|
+
"data-slot": "alert-title",
|
|
117
|
+
className: m("text-m font-medium leading-6 text-on-white-primary", o),
|
|
118
|
+
...a
|
|
103
119
|
}
|
|
104
120
|
));
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
className: d("text-xs leading-normal text-muted-foreground", n),
|
|
115
|
-
...r
|
|
116
|
-
}
|
|
117
|
-
)
|
|
121
|
+
b.displayName = "AlertTitle";
|
|
122
|
+
const N = e.forwardRef(({ className: o, ...a }, s) => /* @__PURE__ */ t(
|
|
123
|
+
"p",
|
|
124
|
+
{
|
|
125
|
+
ref: s,
|
|
126
|
+
"data-slot": "alert-description",
|
|
127
|
+
className: m("text-m leading-relaxed text-on-white-secondary [overflow-wrap:anywhere]", o),
|
|
128
|
+
...a
|
|
129
|
+
}
|
|
118
130
|
));
|
|
119
|
-
|
|
131
|
+
N.displayName = "AlertDescription";
|
|
120
132
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
133
|
+
B as Alert,
|
|
134
|
+
N as AlertDescription,
|
|
135
|
+
b as AlertTitle
|
|
124
136
|
};
|
package/components/answer.js
CHANGED
|
@@ -1476,7 +1476,7 @@ const ue = p.forwardRef(({ spec: a, onFollowUp: l, onOptionSelect: c, onSourceSe
|
|
|
1476
1476
|
disabled: !r,
|
|
1477
1477
|
onClick: () => r == null ? void 0 : r(u),
|
|
1478
1478
|
className: g(
|
|
1479
|
-
"w-full rounded-xl bg-card px-4 py-3 text-left
|
|
1479
|
+
"w-full rounded-xl bg-card px-4 py-3 text-left",
|
|
1480
1480
|
"transition-[background,transform,box-shadow] duration-150 ease-out motion-reduce:transition-none",
|
|
1481
1481
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
1482
1482
|
"hover:bg-surface active:scale-[0.97]",
|
|
@@ -56,7 +56,7 @@ const z = ({ open: s, onOpenChange: i }) => {
|
|
|
56
56
|
side: "bottom",
|
|
57
57
|
align: "start",
|
|
58
58
|
sideOffset: 6,
|
|
59
|
-
className: "aui-action-bar-more-content bg-popover/95 text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-xl border p-1.5 shadow-
|
|
59
|
+
className: "aui-action-bar-more-content bg-popover/95 text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-xl border p-1.5 shadow-float backdrop-blur-sm",
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ t(
|
|
62
62
|
n.Item,
|