@actioneer/ads 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ads-init.mjs +176 -28
- package/components/ai-elements/chain-of-thought.d.ts +26 -19
- package/components/ai-elements/chain-of-thought.js +140 -150
- package/components/ai-elements/index.d.ts +0 -1
- package/components/ai-elements/message.d.ts +9 -4
- package/components/ai-elements/message.js +102 -88
- package/components/ai-elements/task-progress.js +69 -66
- package/components/answer.d.ts +3 -0
- package/components/answer.js +251 -212
- package/components/assistant-ui/composer-harness.js +24 -25
- package/components/assistant-ui/message.js +49 -36
- package/components/assistant-ui/primitives.d.ts +1 -1
- package/components/assistant-ui/thread-context.d.ts +2 -0
- package/components/assistant-ui/thread.js +33 -31
- package/components/chart.d.ts +64 -2
- package/components/chart.js +717 -456
- package/components/command-palette.d.ts +43 -0
- package/components/command-palette.js +146 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +383 -382
- package/components/sidebar.d.ts +4 -1
- package/components/sidebar.js +57 -55
- package/hooks/agents-ui/voice-visualizer-types.js +1 -0
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +97 -110
- package/lib/motion.js +47 -22
- package/lib/router.js +19 -0
- package/lib/utils.js +5 -0
- package/llms.txt +44 -34
- package/manifest.json +485 -186
- package/package.json +1 -1
- package/styles.css +10 -10
- package/theme.css +9 -9
- package/components/ai-elements/reasoning.d.ts +0 -26
- package/components/ai-elements/reasoning.js +0 -131
|
@@ -1,54 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as f, Fragment as
|
|
2
|
+
import { jsx as r, jsxs as f, Fragment as w } from "react/jsx-runtime";
|
|
3
3
|
import * as o from "react";
|
|
4
|
-
import { cva as
|
|
4
|
+
import { cva as x } from "class-variance-authority";
|
|
5
5
|
import { cn as l } from "../../lib/cn.js";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Avatar as
|
|
8
|
-
import { Tooltip as
|
|
6
|
+
import { Button as h } from "../button.js";
|
|
7
|
+
import { Avatar as M } from "../avatar.js";
|
|
8
|
+
import { Tooltip as _ } from "../tooltip.js";
|
|
9
9
|
import { ChevronLeft as B, ChevronRight as R, Paperclip as A, Close as C } from "../../lib/icons.js";
|
|
10
|
-
const z =
|
|
11
|
-
|
|
10
|
+
const z = x("group flex w-full max-w-[95%] flex-col gap-2", {
|
|
11
|
+
variants: {
|
|
12
|
+
align: {
|
|
13
|
+
start: "is-align-start mr-auto items-start",
|
|
14
|
+
end: "is-align-end ml-auto items-end"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { align: "start" }
|
|
18
|
+
}), k = o.forwardRef(
|
|
19
|
+
({ align: e, className: t, from: s, ...a }, n) => /* @__PURE__ */ r(
|
|
12
20
|
"div",
|
|
13
21
|
{
|
|
14
|
-
ref:
|
|
22
|
+
ref: n,
|
|
15
23
|
className: l(
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
z({ align: e ?? (s === "user" ? "end" : "start") }),
|
|
25
|
+
s === "user" ? "is-user" : "is-assistant",
|
|
26
|
+
t
|
|
19
27
|
),
|
|
20
|
-
...
|
|
28
|
+
...a
|
|
21
29
|
}
|
|
22
30
|
)
|
|
23
31
|
);
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
"flex
|
|
32
|
+
k.displayName = "Message";
|
|
33
|
+
const P = x(
|
|
34
|
+
"flex max-w-full min-w-0 flex-col gap-2 overflow-hidden text-base",
|
|
27
35
|
{
|
|
28
36
|
variants: {
|
|
29
37
|
variant: {
|
|
30
38
|
// Contained: the user turn reads as a quiet filled bubble; the
|
|
31
39
|
// assistant turn is plain full-width text.
|
|
32
|
-
contained: "
|
|
40
|
+
contained: "w-fit group-[.is-user]:rounded-xl group-[.is-user]:bg-muted group-[.is-user]:px-4 group-[.is-user]:py-2.5 group-[.is-user]:text-foreground group-[.is-assistant]:text-foreground",
|
|
33
41
|
// Flat: the user turn steps to a recessed tint (no bubble); the
|
|
34
42
|
// assistant turn is full-width plain text — a cleaner, modern look.
|
|
35
|
-
flat: "
|
|
43
|
+
flat: "w-fit group-[.is-user]:rounded-lg group-[.is-user]:bg-surface group-[.is-user]:px-3 group-[.is-user]:py-2 group-[.is-user]:text-foreground group-[.is-assistant]:text-foreground",
|
|
44
|
+
// Plain: no fill, radius, or padding. Pair `align="start"` with a
|
|
45
|
+
// user turn for the clean, left-aligned prompt treatment.
|
|
46
|
+
plain: "w-full text-foreground group-[.is-user]:text-lg"
|
|
36
47
|
}
|
|
37
48
|
},
|
|
38
49
|
defaultVariants: { variant: "contained" }
|
|
39
50
|
}
|
|
40
|
-
),
|
|
51
|
+
), T = o.forwardRef(({ children: e, className: t, variant: s, ...a }, n) => /* @__PURE__ */ r(
|
|
41
52
|
"div",
|
|
42
53
|
{
|
|
43
54
|
ref: n,
|
|
44
|
-
className: l(
|
|
55
|
+
className: l(P({ variant: s }), t),
|
|
45
56
|
...a,
|
|
46
57
|
children: e
|
|
47
58
|
}
|
|
48
59
|
));
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
60
|
+
T.displayName = "MessageContent";
|
|
61
|
+
const j = o.forwardRef(({ src: e, name: t, className: s, ...a }, n) => /* @__PURE__ */ r(
|
|
62
|
+
M,
|
|
52
63
|
{
|
|
53
64
|
ref: n,
|
|
54
65
|
src: e,
|
|
@@ -58,8 +69,8 @@ const T = o.forwardRef(({ src: e, name: t, className: s, ...a }, n) => /* @__PUR
|
|
|
58
69
|
...a
|
|
59
70
|
}
|
|
60
71
|
));
|
|
61
|
-
|
|
62
|
-
const
|
|
72
|
+
j.displayName = "MessageAvatar";
|
|
73
|
+
const V = l(
|
|
63
74
|
"size-full text-base leading-relaxed text-foreground",
|
|
64
75
|
"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
65
76
|
"[&_p]:my-2",
|
|
@@ -73,12 +84,12 @@ const j = l(
|
|
|
73
84
|
"[&_table]:my-3 [&_table]:w-full [&_table]:text-xs [&_th]:px-2 [&_th]:py-1.5 [&_th]:text-left [&_th]:font-bold [&_td]:px-2 [&_td]:py-1.5 [&_thead]:text-secondary"
|
|
74
85
|
), S = o.memo(
|
|
75
86
|
o.forwardRef(
|
|
76
|
-
({ className: e, children: t, ...s }, a) => /* @__PURE__ */ r("div", { ref: a, className: l(
|
|
87
|
+
({ className: e, children: t, ...s }, a) => /* @__PURE__ */ r("div", { ref: a, className: l(V, e), ...s, children: t })
|
|
77
88
|
),
|
|
78
89
|
(e, t) => e.children === t.children
|
|
79
90
|
);
|
|
80
91
|
S.displayName = "MessageResponse";
|
|
81
|
-
const
|
|
92
|
+
const W = o.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ r(
|
|
82
93
|
"div",
|
|
83
94
|
{
|
|
84
95
|
ref: a,
|
|
@@ -87,42 +98,42 @@ const V = o.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__
|
|
|
87
98
|
children: t
|
|
88
99
|
}
|
|
89
100
|
));
|
|
90
|
-
|
|
91
|
-
const
|
|
101
|
+
W.displayName = "MessageActions";
|
|
102
|
+
const E = o.forwardRef(
|
|
92
103
|
({ tooltip: e, children: t, label: s, variant: a = "ghost", size: n = "icon-sm", ...i }, d) => {
|
|
93
|
-
const c = /* @__PURE__ */ f(
|
|
104
|
+
const c = /* @__PURE__ */ f(h, { ref: d, size: n, type: "button", variant: a, ...i, children: [
|
|
94
105
|
t,
|
|
95
106
|
/* @__PURE__ */ r("span", { className: "sr-only", children: s || e })
|
|
96
107
|
] });
|
|
97
|
-
return e ? /* @__PURE__ */ r(
|
|
108
|
+
return e ? /* @__PURE__ */ r(_, { content: e, children: c }) : c;
|
|
98
109
|
}
|
|
99
110
|
);
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
const e = o.useContext(
|
|
111
|
+
E.displayName = "MessageAction";
|
|
112
|
+
const b = o.createContext(null), g = () => {
|
|
113
|
+
const e = o.useContext(b);
|
|
103
114
|
if (!e)
|
|
104
115
|
throw new Error(
|
|
105
116
|
"MessageBranch components must be used within MessageBranch"
|
|
106
117
|
);
|
|
107
118
|
return e;
|
|
108
|
-
},
|
|
109
|
-
const [i, d] = o.useState(e), [c,
|
|
119
|
+
}, I = o.forwardRef(({ defaultBranch: e = 0, onBranchChange: t, className: s, ...a }, n) => {
|
|
120
|
+
const [i, d] = o.useState(e), [c, m] = o.useState([]), p = (u) => {
|
|
110
121
|
d(u), t == null || t(u);
|
|
111
|
-
},
|
|
122
|
+
}, v = () => {
|
|
112
123
|
const u = i > 0 ? i - 1 : c.length - 1;
|
|
113
|
-
|
|
124
|
+
p(u);
|
|
114
125
|
}, y = () => {
|
|
115
126
|
const u = i < c.length - 1 ? i + 1 : 0;
|
|
116
|
-
|
|
117
|
-
},
|
|
127
|
+
p(u);
|
|
128
|
+
}, N = {
|
|
118
129
|
currentBranch: i,
|
|
119
130
|
totalBranches: c.length,
|
|
120
|
-
goToPrevious:
|
|
131
|
+
goToPrevious: v,
|
|
121
132
|
goToNext: y,
|
|
122
133
|
branches: c,
|
|
123
|
-
setBranches:
|
|
134
|
+
setBranches: m
|
|
124
135
|
};
|
|
125
|
-
return /* @__PURE__ */ r(
|
|
136
|
+
return /* @__PURE__ */ r(b.Provider, { value: N, children: /* @__PURE__ */ r(
|
|
126
137
|
"div",
|
|
127
138
|
{
|
|
128
139
|
ref: n,
|
|
@@ -131,17 +142,17 @@ const _ = o.createContext(null), m = () => {
|
|
|
131
142
|
}
|
|
132
143
|
) });
|
|
133
144
|
});
|
|
134
|
-
|
|
135
|
-
const
|
|
145
|
+
I.displayName = "MessageBranch";
|
|
146
|
+
const L = ({
|
|
136
147
|
children: e,
|
|
137
148
|
...t
|
|
138
149
|
}) => {
|
|
139
|
-
const { currentBranch: s, setBranches: a, branches: n } =
|
|
150
|
+
const { currentBranch: s, setBranches: a, branches: n } = g(), i = o.Children.toArray(
|
|
140
151
|
e
|
|
141
152
|
);
|
|
142
153
|
return o.useEffect(() => {
|
|
143
154
|
n.length !== i.length && a(i);
|
|
144
|
-
}, [i, n, a]), /* @__PURE__ */ r(
|
|
155
|
+
}, [i, n, a]), /* @__PURE__ */ r(w, { children: i.map((d, c) => /* @__PURE__ */ r(
|
|
145
156
|
"div",
|
|
146
157
|
{
|
|
147
158
|
className: l(
|
|
@@ -154,9 +165,9 @@ const I = ({
|
|
|
154
165
|
d.key
|
|
155
166
|
)) });
|
|
156
167
|
};
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
const { totalBranches: n } =
|
|
168
|
+
L.displayName = "MessageBranchContent";
|
|
169
|
+
const F = o.forwardRef(({ className: e, from: t, ...s }, a) => {
|
|
170
|
+
const { totalBranches: n } = g();
|
|
160
171
|
return n <= 1 ? null : /* @__PURE__ */ r(
|
|
161
172
|
"div",
|
|
162
173
|
{
|
|
@@ -166,11 +177,11 @@ const L = o.forwardRef(({ className: e, from: t, ...s }, a) => {
|
|
|
166
177
|
}
|
|
167
178
|
);
|
|
168
179
|
});
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
const { goToPrevious: a, totalBranches: n } =
|
|
180
|
+
F.displayName = "MessageBranchSelector";
|
|
181
|
+
const q = o.forwardRef(({ children: e, ...t }, s) => {
|
|
182
|
+
const { goToPrevious: a, totalBranches: n } = g();
|
|
172
183
|
return /* @__PURE__ */ r(
|
|
173
|
-
|
|
184
|
+
h,
|
|
174
185
|
{
|
|
175
186
|
ref: s,
|
|
176
187
|
"aria-label": "Previous branch",
|
|
@@ -184,11 +195,11 @@ const F = o.forwardRef(({ children: e, ...t }, s) => {
|
|
|
184
195
|
}
|
|
185
196
|
);
|
|
186
197
|
});
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
const { goToNext: a, totalBranches: n } =
|
|
198
|
+
q.displayName = "MessageBranchPrevious";
|
|
199
|
+
const D = o.forwardRef(({ children: e, ...t }, s) => {
|
|
200
|
+
const { goToNext: a, totalBranches: n } = g();
|
|
190
201
|
return /* @__PURE__ */ r(
|
|
191
|
-
|
|
202
|
+
h,
|
|
192
203
|
{
|
|
193
204
|
ref: s,
|
|
194
205
|
"aria-label": "Next branch",
|
|
@@ -202,9 +213,9 @@ const q = o.forwardRef(({ children: e, ...t }, s) => {
|
|
|
202
213
|
}
|
|
203
214
|
);
|
|
204
215
|
});
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
const { currentBranch: a, totalBranches: n } =
|
|
216
|
+
D.displayName = "MessageBranchNext";
|
|
217
|
+
const G = o.forwardRef(({ className: e, ...t }, s) => {
|
|
218
|
+
const { currentBranch: a, totalBranches: n } = g();
|
|
208
219
|
return /* @__PURE__ */ f(
|
|
209
220
|
"span",
|
|
210
221
|
{
|
|
@@ -222,10 +233,10 @@ const D = o.forwardRef(({ className: e, ...t }, s) => {
|
|
|
222
233
|
}
|
|
223
234
|
);
|
|
224
235
|
});
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
var
|
|
228
|
-
const i = e.filename || "", d = !!((
|
|
236
|
+
G.displayName = "MessageBranchPage";
|
|
237
|
+
const H = o.forwardRef(({ data: e, className: t, onRemove: s, ...a }, n) => {
|
|
238
|
+
var m;
|
|
239
|
+
const i = e.filename || "", d = !!((m = e.mediaType) != null && m.startsWith("image/") && e.url), c = i || (d ? "Image" : "Attachment");
|
|
229
240
|
return /* @__PURE__ */ f(
|
|
230
241
|
"div",
|
|
231
242
|
{
|
|
@@ -243,17 +254,17 @@ const G = o.forwardRef(({ data: e, className: t, onRemove: s, ...a }, n) => {
|
|
|
243
254
|
className: "size-full object-cover",
|
|
244
255
|
src: e.url
|
|
245
256
|
}
|
|
246
|
-
) : /* @__PURE__ */ r(
|
|
257
|
+
) : /* @__PURE__ */ r(_, { content: c, children: /* @__PURE__ */ r("div", { className: "flex size-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ r(A, { className: "size-4" }) }) }),
|
|
247
258
|
s && /* @__PURE__ */ r(
|
|
248
|
-
|
|
259
|
+
h,
|
|
249
260
|
{
|
|
250
261
|
"aria-label": "Remove attachment",
|
|
251
262
|
className: l(
|
|
252
263
|
"absolute top-1.5 right-1.5 size-6 rounded-full p-0 opacity-0 transition-opacity group-hover/attachment:opacity-100",
|
|
253
264
|
d && "bg-elevated/80 backdrop-blur-sm hover:bg-elevated"
|
|
254
265
|
),
|
|
255
|
-
onClick: (
|
|
256
|
-
|
|
266
|
+
onClick: (p) => {
|
|
267
|
+
p.stopPropagation(), s();
|
|
257
268
|
},
|
|
258
269
|
size: "icon-xs",
|
|
259
270
|
type: "button",
|
|
@@ -265,18 +276,21 @@ const G = o.forwardRef(({ data: e, className: t, onRemove: s, ...a }, n) => {
|
|
|
265
276
|
}
|
|
266
277
|
);
|
|
267
278
|
});
|
|
268
|
-
|
|
269
|
-
const
|
|
279
|
+
H.displayName = "MessageAttachment";
|
|
280
|
+
const J = o.forwardRef(({ children: e, className: t, ...s }, a) => e ? /* @__PURE__ */ r(
|
|
270
281
|
"div",
|
|
271
282
|
{
|
|
272
283
|
ref: a,
|
|
273
|
-
className: l(
|
|
284
|
+
className: l(
|
|
285
|
+
"flex w-fit flex-wrap items-start gap-2 group-[.is-align-start]:mr-auto group-[.is-align-end]:ml-auto",
|
|
286
|
+
t
|
|
287
|
+
),
|
|
274
288
|
...s,
|
|
275
289
|
children: e
|
|
276
290
|
}
|
|
277
291
|
) : null);
|
|
278
|
-
|
|
279
|
-
const
|
|
292
|
+
J.displayName = "MessageAttachments";
|
|
293
|
+
const K = o.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ r(
|
|
280
294
|
"div",
|
|
281
295
|
{
|
|
282
296
|
ref: a,
|
|
@@ -288,21 +302,21 @@ const J = o.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__
|
|
|
288
302
|
children: t
|
|
289
303
|
}
|
|
290
304
|
));
|
|
291
|
-
|
|
305
|
+
K.displayName = "MessageToolbar";
|
|
292
306
|
export {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
307
|
+
k as Message,
|
|
308
|
+
E as MessageAction,
|
|
309
|
+
W as MessageActions,
|
|
310
|
+
H as MessageAttachment,
|
|
311
|
+
J as MessageAttachments,
|
|
312
|
+
j as MessageAvatar,
|
|
313
|
+
I as MessageBranch,
|
|
314
|
+
L as MessageBranchContent,
|
|
315
|
+
D as MessageBranchNext,
|
|
316
|
+
G as MessageBranchPage,
|
|
317
|
+
q as MessageBranchPrevious,
|
|
318
|
+
F as MessageBranchSelector,
|
|
319
|
+
T as MessageContent,
|
|
306
320
|
S as MessageResponse,
|
|
307
|
-
|
|
321
|
+
K as MessageToolbar
|
|
308
322
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as t, jsxs as n, Fragment as q } from "react/jsx-runtime";
|
|
3
|
+
import * as i from "react";
|
|
4
4
|
import { cva as C } from "class-variance-authority";
|
|
5
5
|
import { Collapsible as B, CollapsibleTrigger as G, CollapsibleContent as H } from "../collapsible.js";
|
|
6
6
|
import { Spinner as J } from "../spinner.js";
|
|
7
7
|
import { ChevronDown as K, Check as M, Clock as Q } from "../../lib/icons.js";
|
|
8
|
-
import { cn as
|
|
8
|
+
import { cn as l } from "../../lib/cn.js";
|
|
9
9
|
const U = C(
|
|
10
|
-
"w-full overflow-hidden rounded-2xl bg-card text-foreground",
|
|
10
|
+
"w-full overflow-hidden rounded-2xl bg-card text-foreground before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-[linear-gradient(to_bottom,var(--border-strong)_0%,transparent_100%)] before:p-px before:content-[''] before:[mask:linear-gradient(var(--foreground)_0_0)_content-box,linear-gradient(var(--foreground)_0_0)] before:[mask-composite:exclude]!",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
isSticky: {
|
|
@@ -20,7 +20,10 @@ const U = C(
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
), X = C(
|
|
23
|
-
|
|
23
|
+
// The composer must sit flush under the progress bar: kill its standalone
|
|
24
|
+
// entrance animation (a mid-flight slide-in reads as a gap between the two
|
|
25
|
+
// surfaces) and square the shell's top corners to butt-joint the bar.
|
|
26
|
+
"flex w-full flex-col rounded-2xl bg-transparent [&_.aui-composer-root]:relative [&_.aui-composer-root]:z-10 [&_.aui-composer-root]:-mt-px [&_.aui-composer-root]:animate-none [&_.aui-composer-root>*:first-child]:rounded-t-none",
|
|
24
27
|
{
|
|
25
28
|
variants: {
|
|
26
29
|
isSticky: {
|
|
@@ -32,31 +35,31 @@ const U = C(
|
|
|
32
35
|
isSticky: !0
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
|
-
), w =
|
|
38
|
+
), w = i.createContext(!1), Y = i.forwardRef(({ className: a, isSticky: r, ...d }, f) => /* @__PURE__ */ t(w.Provider, { value: !0, children: /* @__PURE__ */ t(
|
|
36
39
|
"div",
|
|
37
40
|
{
|
|
38
41
|
ref: f,
|
|
39
42
|
"data-slot": "task-progress-dock",
|
|
40
|
-
className:
|
|
43
|
+
className: l(X({ isSticky: r }), a),
|
|
41
44
|
...d
|
|
42
45
|
}
|
|
43
46
|
) }));
|
|
44
47
|
Y.displayName = "TaskProgressDock";
|
|
45
|
-
function y({ status:
|
|
48
|
+
function y({ status: a }) {
|
|
46
49
|
return /* @__PURE__ */ n(
|
|
47
50
|
"span",
|
|
48
51
|
{
|
|
49
52
|
"aria-hidden": !0,
|
|
50
|
-
className:
|
|
53
|
+
className: l(
|
|
51
54
|
"flex size-5 shrink-0 items-center justify-center",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
a === "complete" && "text-success",
|
|
56
|
+
a === "active" && "text-info",
|
|
57
|
+
a === "pending" && "text-tertiary"
|
|
55
58
|
),
|
|
56
59
|
children: [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
a === "complete" && /* @__PURE__ */ t(M, { className: "size-4", strokeWidth: 2 }),
|
|
61
|
+
a === "active" && /* @__PURE__ */ t(J, { size: "sm", color: "current", role: "presentation", "aria-hidden": !0 }),
|
|
62
|
+
a === "pending" && /* @__PURE__ */ t(Q, { className: "size-4" })
|
|
60
63
|
]
|
|
61
64
|
}
|
|
62
65
|
);
|
|
@@ -66,86 +69,86 @@ const Z = {
|
|
|
66
69
|
active: "In progress",
|
|
67
70
|
pending: "Pending"
|
|
68
71
|
};
|
|
69
|
-
function N({ elapsed:
|
|
70
|
-
return
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
function N({ elapsed: a }) {
|
|
73
|
+
return a ? /* @__PURE__ */ n("span", { className: "flex shrink-0 items-center gap-3 text-xs text-tertiary tabular-nums", children: [
|
|
74
|
+
/* @__PURE__ */ t("span", { "aria-hidden": !0, className: "h-4 w-px bg-border" }),
|
|
75
|
+
/* @__PURE__ */ t("span", { "aria-label": `Elapsed ${a}`, children: a })
|
|
73
76
|
] }) : null;
|
|
74
77
|
}
|
|
75
|
-
const O =
|
|
78
|
+
const O = i.forwardRef(
|
|
76
79
|
({
|
|
77
|
-
className:
|
|
78
|
-
steps:
|
|
80
|
+
className: a,
|
|
81
|
+
steps: r,
|
|
79
82
|
open: d,
|
|
80
83
|
defaultOpen: f = !1,
|
|
81
84
|
onOpenChange: u,
|
|
82
85
|
title: c = "Task progress",
|
|
83
|
-
summary:
|
|
84
|
-
emptyLabel:
|
|
85
|
-
isSticky:
|
|
86
|
-
role:
|
|
87
|
-
"aria-label":
|
|
88
|
-
"aria-busy":
|
|
89
|
-
...
|
|
90
|
-
},
|
|
91
|
-
const
|
|
86
|
+
summary: _,
|
|
87
|
+
emptyLabel: P = "No task steps",
|
|
88
|
+
isSticky: I,
|
|
89
|
+
role: T,
|
|
90
|
+
"aria-label": $,
|
|
91
|
+
"aria-busy": z,
|
|
92
|
+
...D
|
|
93
|
+
}, S) => {
|
|
94
|
+
const g = i.useContext(w), b = d !== void 0, [V, j] = i.useState(f), m = b ? d : V, o = r.findIndex((e) => e.status === "active"), p = r.reduce(
|
|
92
95
|
(e, F, W) => F.status === "complete" ? W : e,
|
|
93
96
|
-1
|
|
94
|
-
),
|
|
97
|
+
), E = r.findIndex(
|
|
95
98
|
(e) => e.status === "pending"
|
|
96
|
-
), h =
|
|
99
|
+
), h = o >= 0 ? o : p >= 0 ? p : E, s = h >= 0 ? r[h] : void 0, x = o >= 0 ? o + 1 : p >= 0 ? p + 1 : 0, R = r.filter(
|
|
97
100
|
(e) => e.status === "pending"
|
|
98
|
-
).length,
|
|
101
|
+
).length, v = r.length > 0 && r.every((e) => e.status === "complete"), A = o >= 0 ? "active" : v ? "complete" : "pending", k = s ? s.accessibilityLabel ?? (typeof s.label == "string" ? s.label : "") : "", L = i.useCallback(
|
|
99
102
|
(e) => {
|
|
100
|
-
|
|
103
|
+
b || j(e), u == null || u(e);
|
|
101
104
|
},
|
|
102
|
-
[
|
|
105
|
+
[b, u]
|
|
103
106
|
);
|
|
104
107
|
return /* @__PURE__ */ n(
|
|
105
108
|
B,
|
|
106
109
|
{
|
|
107
|
-
ref:
|
|
110
|
+
ref: S,
|
|
108
111
|
open: m,
|
|
109
112
|
onOpenChange: L,
|
|
110
|
-
role:
|
|
111
|
-
"aria-label":
|
|
112
|
-
"aria-busy":
|
|
113
|
-
...
|
|
113
|
+
role: T ?? "region",
|
|
114
|
+
"aria-label": $ ?? c,
|
|
115
|
+
"aria-busy": z ?? (o >= 0 || void 0),
|
|
116
|
+
...D,
|
|
114
117
|
"data-slot": "task-progress",
|
|
115
118
|
"data-status": A,
|
|
116
|
-
className:
|
|
117
|
-
U({ isSticky:
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
className: l(
|
|
120
|
+
U({ isSticky: g ? !1 : I }),
|
|
121
|
+
g && "rounded-b-none",
|
|
122
|
+
a
|
|
120
123
|
),
|
|
121
124
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ t(
|
|
123
126
|
"span",
|
|
124
127
|
{
|
|
125
128
|
className: "sr-only",
|
|
126
129
|
role: "progressbar",
|
|
127
130
|
"aria-label": c,
|
|
128
131
|
"aria-valuemin": 0,
|
|
129
|
-
"aria-valuemax":
|
|
130
|
-
"aria-valuenow":
|
|
132
|
+
"aria-valuemax": r.length,
|
|
133
|
+
"aria-valuenow": x
|
|
131
134
|
}
|
|
132
135
|
),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ t("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: v ? `All ${r.length} steps complete` : `Step ${x} of ${r.length}${k ? `: ${k}` : ""}. ${R} pending.` }),
|
|
137
|
+
/* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ n(
|
|
135
138
|
"button",
|
|
136
139
|
{
|
|
137
140
|
type: "button",
|
|
138
141
|
"aria-label": m ? `Collapse ${c}` : `Expand ${c}`,
|
|
139
|
-
className:
|
|
140
|
-
"flex min-h-
|
|
142
|
+
className: l(
|
|
143
|
+
"flex min-h-14 w-full items-center gap-3 px-4 text-left sm:px-5",
|
|
141
144
|
"rounded-t-2xl rounded-b-sm outline-none focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring",
|
|
142
145
|
"transition-[color,transform] duration-(--duration-fast) ease-out active:scale-(--scale-press) motion-reduce:transition-none"
|
|
143
146
|
),
|
|
144
147
|
children: [
|
|
145
|
-
m ? /* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
(
|
|
148
|
+
m ? /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-base font-bold text-secondary", children: c }) : /* @__PURE__ */ n(q, { children: [
|
|
149
|
+
/* @__PURE__ */ t(y, { status: (s == null ? void 0 : s.status) ?? "pending" }),
|
|
150
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-base text-primary", children: _ ?? (s == null ? void 0 : s.label) ?? P }),
|
|
151
|
+
(s == null ? void 0 : s.status) === "active" && /* @__PURE__ */ t(N, { elapsed: s.elapsed })
|
|
149
152
|
] }),
|
|
150
153
|
/* @__PURE__ */ n(
|
|
151
154
|
"span",
|
|
@@ -153,17 +156,17 @@ const O = l.forwardRef(
|
|
|
153
156
|
"aria-hidden": !0,
|
|
154
157
|
className: "shrink-0 text-xs font-bold text-tertiary tabular-nums",
|
|
155
158
|
children: [
|
|
156
|
-
|
|
159
|
+
x,
|
|
157
160
|
" / ",
|
|
158
|
-
|
|
161
|
+
r.length
|
|
159
162
|
]
|
|
160
163
|
}
|
|
161
164
|
),
|
|
162
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ t(
|
|
163
166
|
K,
|
|
164
167
|
{
|
|
165
168
|
"aria-hidden": !0,
|
|
166
|
-
className:
|
|
169
|
+
className: l(
|
|
167
170
|
"size-4 shrink-0 text-tertiary",
|
|
168
171
|
m && "rotate-180"
|
|
169
172
|
)
|
|
@@ -172,16 +175,16 @@ const O = l.forwardRef(
|
|
|
172
175
|
]
|
|
173
176
|
}
|
|
174
177
|
) }),
|
|
175
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ t(H, { className: "outline-none", children: /* @__PURE__ */ t(
|
|
176
179
|
"ol",
|
|
177
180
|
{
|
|
178
181
|
"aria-label": "Task steps",
|
|
179
182
|
className: "max-h-64 space-y-1 overflow-y-auto px-4 pb-4 sm:px-5",
|
|
180
|
-
children:
|
|
183
|
+
children: r.map((e) => /* @__PURE__ */ n(
|
|
181
184
|
"li",
|
|
182
185
|
{
|
|
183
186
|
"data-status": e.status,
|
|
184
|
-
className:
|
|
187
|
+
className: l(
|
|
185
188
|
"flex min-h-8 items-center gap-3 text-base",
|
|
186
189
|
e.status === "pending" ? "text-tertiary" : "text-primary"
|
|
187
190
|
),
|
|
@@ -190,9 +193,9 @@ const O = l.forwardRef(
|
|
|
190
193
|
Z[e.status],
|
|
191
194
|
": "
|
|
192
195
|
] }),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
e.status === "active" && /* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ t(y, { status: e.status }),
|
|
197
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: e.label }),
|
|
198
|
+
e.status === "active" && /* @__PURE__ */ t(N, { elapsed: e.elapsed })
|
|
196
199
|
]
|
|
197
200
|
},
|
|
198
201
|
e.id
|
package/components/answer.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare const ComparisonAnswerSchema: z.ZodObject<{
|
|
|
44
44
|
}, z.core.$strip>], null>;
|
|
45
45
|
rows: z.ZodArray<z.ZodObject<{
|
|
46
46
|
label: z.ZodString;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
47
48
|
values: z.ZodTuple<[z.ZodObject<{
|
|
48
49
|
value: z.ZodString;
|
|
49
50
|
detail: z.ZodOptional<z.ZodString>;
|
|
@@ -349,6 +350,7 @@ export declare const AnswerSpecSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
349
350
|
}, z.core.$strip>], null>;
|
|
350
351
|
rows: z.ZodArray<z.ZodObject<{
|
|
351
352
|
label: z.ZodString;
|
|
353
|
+
description: z.ZodOptional<z.ZodString>;
|
|
352
354
|
values: z.ZodTuple<[z.ZodObject<{
|
|
353
355
|
value: z.ZodString;
|
|
354
356
|
detail: z.ZodOptional<z.ZodString>;
|
|
@@ -662,6 +664,7 @@ export declare const answerTool: {
|
|
|
662
664
|
}, z.core.$strip>], null>;
|
|
663
665
|
rows: z.ZodArray<z.ZodObject<{
|
|
664
666
|
label: z.ZodString;
|
|
667
|
+
description: z.ZodOptional<z.ZodString>;
|
|
665
668
|
values: z.ZodTuple<[z.ZodObject<{
|
|
666
669
|
value: z.ZodString;
|
|
667
670
|
detail: z.ZodOptional<z.ZodString>;
|