@actioneer/ads 0.2.3 → 0.3.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/components/ai-elements/chain-of-thought.d.ts +88 -19
- package/components/ai-elements/chain-of-thought.js +358 -149
- package/components/ai-elements/chart.d.ts +30 -0
- package/components/ai-elements/chart.js +303 -0
- package/components/ai-elements/index.d.ts +2 -1
- package/components/ai-elements/message.d.ts +19 -4
- package/components/ai-elements/message.js +177 -130
- package/components/ai-elements/research-activity.d.ts +45 -0
- package/components/ai-elements/research-activity.js +260 -0
- package/components/ai-elements/task-progress.js +69 -66
- package/components/ai-elements/tool.js +42 -38
- package/components/answer.d.ts +19 -0
- package/components/answer.js +363 -300
- package/components/assistant-ui/attachment.js +5 -1
- package/components/assistant-ui/composer-deep-research.js +44 -29
- package/components/assistant-ui/composer-harness.js +55 -38
- package/components/assistant-ui/composer.js +16 -16
- package/components/assistant-ui/index.d.ts +0 -1
- package/components/assistant-ui/message.d.ts +7 -0
- package/components/assistant-ui/message.js +64 -51
- 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 +34 -32
- package/components/brand-texture.d.ts +37 -0
- package/components/brand-texture.js +54 -0
- package/components/chart.d.ts +64 -2
- package/components/chart.js +717 -456
- package/components/code-block.d.ts +36 -0
- package/components/code-block.js +136 -0
- package/components/command-palette.d.ts +43 -0
- package/components/command-palette.js +146 -0
- package/components/drawer.d.ts +1 -1
- package/components/file-dropzone.d.ts +32 -0
- package/components/file-dropzone.js +134 -0
- package/components/index.d.ts +11 -0
- package/components/index.js +480 -430
- package/components/infinite-canvas.d.ts +50 -0
- package/components/infinite-canvas.js +215 -0
- package/components/page-header.d.ts +22 -0
- package/components/page-header.js +52 -0
- package/components/resizable-panel.d.ts +29 -0
- package/components/resizable-panel.js +102 -0
- package/components/reveal.d.ts +36 -0
- package/components/reveal.js +35 -0
- package/components/scroll-area.d.ts +19 -0
- package/components/scroll-area.js +57 -0
- package/components/setting-row.d.ts +35 -0
- package/components/setting-row.js +86 -0
- package/components/sidebar.d.ts +4 -1
- package/components/sidebar.js +134 -132
- package/components/stepper.d.ts +32 -0
- package/components/stepper.js +113 -0
- package/components/table.js +16 -15
- package/components/tabs.js +1 -1
- package/hooks/agents-ui/voice-visualizer-types.js +1 -0
- package/lib/icons.d.ts +24 -0
- package/lib/icons.js +100 -110
- package/lib/motion.d.ts +5 -3
- package/lib/motion.js +46 -20
- package/lib/router.js +19 -0
- package/lib/utils.js +5 -0
- package/llms.txt +143 -39
- package/manifest.json +1232 -100
- package/package.json +2 -2
- package/styles.css +71 -28
- package/theme.css +19 -15
- package/components/ai-elements/reasoning.d.ts +0 -26
- package/components/ai-elements/reasoning.js +0 -131
- package/components/assistant-ui/smart-message-text.d.ts +0 -15
- package/components/assistant-ui/smart-message-text.js +0 -29
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as t, jsx as e, Fragment as K } from "react/jsx-runtime";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { MotionConfig as Y, AnimatePresence as Z, motion as C } from "motion/react";
|
|
5
|
+
import { cva as I } from "class-variance-authority";
|
|
6
|
+
import { Collapsible as O, CollapsibleTrigger as j, CollapsibleContent as ee } from "../collapsible.js";
|
|
7
|
+
import { Spinner as L } from "../spinner.js";
|
|
8
|
+
import { Sparkles as M, ChevronDown as T } from "../../lib/icons.js";
|
|
9
|
+
import { EASE_OUT as V } from "../../lib/motion.js";
|
|
10
|
+
import { cn as m } from "../../lib/cn.js";
|
|
11
|
+
import { Shimmer as D } from "./shimmer.js";
|
|
12
|
+
const re = I("w-full", {
|
|
13
|
+
variants: {
|
|
14
|
+
status: {
|
|
15
|
+
active: "text-foreground",
|
|
16
|
+
complete: "text-secondary"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}), te = {
|
|
20
|
+
initial: {
|
|
21
|
+
opacity: 0,
|
|
22
|
+
transform: "translate3d(0, 7px, 0)",
|
|
23
|
+
filter: "blur(2px)"
|
|
24
|
+
},
|
|
25
|
+
animate: {
|
|
26
|
+
opacity: 1,
|
|
27
|
+
transform: "translate3d(0, 0, 0)",
|
|
28
|
+
filter: "blur(0px)",
|
|
29
|
+
transition: { duration: 0.18, ease: V }
|
|
30
|
+
},
|
|
31
|
+
exit: {
|
|
32
|
+
opacity: 0,
|
|
33
|
+
transform: "translate3d(0, -7px, 0)",
|
|
34
|
+
filter: "blur(2px)",
|
|
35
|
+
transition: { duration: 0.12, ease: V }
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function F({
|
|
39
|
+
elapsed: r,
|
|
40
|
+
firstInsight: n,
|
|
41
|
+
sourceCount: d
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ t("span", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
44
|
+
/* @__PURE__ */ t("span", { children: [
|
|
45
|
+
"Researched ",
|
|
46
|
+
d,
|
|
47
|
+
" ",
|
|
48
|
+
d === 1 ? "source" : "sources"
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-tertiary", children: "·" }),
|
|
51
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-tertiary tabular-nums", children: r }),
|
|
52
|
+
n != null && /* @__PURE__ */ t(K, { children: [
|
|
53
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-tertiary", children: "·" }),
|
|
54
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-tertiary", children: [
|
|
55
|
+
"first insight",
|
|
56
|
+
" ",
|
|
57
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: n })
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
const ae = s.forwardRef(
|
|
63
|
+
({
|
|
64
|
+
status: r,
|
|
65
|
+
elapsed: n,
|
|
66
|
+
sourceCount: d,
|
|
67
|
+
firstInsight: N,
|
|
68
|
+
sticky: b = !1,
|
|
69
|
+
activity: o,
|
|
70
|
+
activityKey: P,
|
|
71
|
+
stepIndex: g,
|
|
72
|
+
stepCount: R,
|
|
73
|
+
summary: f,
|
|
74
|
+
open: w,
|
|
75
|
+
defaultOpen: U = !1,
|
|
76
|
+
onOpenChange: a,
|
|
77
|
+
children: _,
|
|
78
|
+
className: $,
|
|
79
|
+
role: q,
|
|
80
|
+
"aria-label": B,
|
|
81
|
+
"aria-busy": G,
|
|
82
|
+
...H
|
|
83
|
+
}, J) => {
|
|
84
|
+
const c = w !== void 0, i = o != null, [Q, p] = s.useState(
|
|
85
|
+
!i && r === "active" || U
|
|
86
|
+
), k = s.useRef(r), h = s.useRef(!1), S = s.useRef(null), x = s.useRef(null), y = c ? w : Q, v = !i && r === "active" || y;
|
|
87
|
+
s.useLayoutEffect(() => {
|
|
88
|
+
var E, A;
|
|
89
|
+
const u = k.current;
|
|
90
|
+
if (k.current = r, r === "active") {
|
|
91
|
+
u !== "active" && (h.current = !1), u !== "active" && !i && !c && p(!0);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (u !== "active" || h.current && i) return;
|
|
95
|
+
const z = document.activeElement;
|
|
96
|
+
z && ((E = S.current) != null && E.contains(z)) && ((A = x.current) == null || A.focus()), c || p(!1), a == null || a(!1);
|
|
97
|
+
}, [i, c, a, r]);
|
|
98
|
+
const W = s.useCallback(
|
|
99
|
+
(u) => {
|
|
100
|
+
!i && r !== "complete" || (h.current = !0, c || p(u), a == null || a(u));
|
|
101
|
+
},
|
|
102
|
+
[i, c, a, r]
|
|
103
|
+
), l = r === "active", X = l ? `activity-${P ?? (typeof o == "string" ? o : "current")}` : "summary";
|
|
104
|
+
return /* @__PURE__ */ t(
|
|
105
|
+
O,
|
|
106
|
+
{
|
|
107
|
+
ref: J,
|
|
108
|
+
open: v,
|
|
109
|
+
onOpenChange: W,
|
|
110
|
+
role: q ?? "region",
|
|
111
|
+
"aria-label": B ?? "Research activity",
|
|
112
|
+
"aria-busy": G ?? (l || void 0),
|
|
113
|
+
...H,
|
|
114
|
+
"data-slot": "research-activity",
|
|
115
|
+
"data-status": r,
|
|
116
|
+
className: m(re({ status: r }), $),
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ e("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: l ? "Research in progress" : "Research complete" }),
|
|
119
|
+
i ? /* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ t(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
ref: x,
|
|
123
|
+
type: "button",
|
|
124
|
+
"data-slot": "research-activity-trigger",
|
|
125
|
+
className: m(
|
|
126
|
+
"group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-sm py-1 text-left text-sm outline-none",
|
|
127
|
+
"transition-[color,transform] duration-(--duration-fast) ease-out hover:text-primary active:scale-(--scale-press)",
|
|
128
|
+
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
|
|
129
|
+
b && "sticky top-0 z-10 bg-background"
|
|
130
|
+
),
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: [
|
|
133
|
+
v ? "Collapse" : "Expand",
|
|
134
|
+
" research activity:",
|
|
135
|
+
" "
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: l ? /* @__PURE__ */ e(L, { size: "sm", color: "current", role: "presentation" }) : /* @__PURE__ */ e(M, { className: "size-4" }) }),
|
|
138
|
+
/* @__PURE__ */ e(Y, { reducedMotion: "user", children: /* @__PURE__ */ e("span", { className: "relative h-5 min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e(Z, { initial: !1, children: /* @__PURE__ */ e(
|
|
139
|
+
C.span,
|
|
140
|
+
{
|
|
141
|
+
variants: te,
|
|
142
|
+
initial: "initial",
|
|
143
|
+
animate: "animate",
|
|
144
|
+
exit: "exit",
|
|
145
|
+
className: "absolute inset-0 flex items-center truncate whitespace-nowrap",
|
|
146
|
+
children: l ? typeof o == "string" ? /* @__PURE__ */ e(D, { as: "span", className: "truncate text-sm", children: o }) : o : f !== void 0 ? f : /* @__PURE__ */ e(
|
|
147
|
+
F,
|
|
148
|
+
{
|
|
149
|
+
elapsed: n,
|
|
150
|
+
firstInsight: N,
|
|
151
|
+
sourceCount: d
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
},
|
|
155
|
+
X
|
|
156
|
+
) }) }) }),
|
|
157
|
+
l && /* @__PURE__ */ t("span", { className: "shrink-0 text-xs text-tertiary tabular-nums", children: [
|
|
158
|
+
g != null && R != null && /* @__PURE__ */ t(K, { children: [
|
|
159
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Step " }),
|
|
160
|
+
g,
|
|
161
|
+
" of ",
|
|
162
|
+
R,
|
|
163
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, children: " · " })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
|
|
166
|
+
n
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ e(
|
|
169
|
+
T,
|
|
170
|
+
{
|
|
171
|
+
"aria-hidden": !0,
|
|
172
|
+
className: m(
|
|
173
|
+
"size-4 shrink-0 text-tertiary transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
|
|
174
|
+
v && "rotate-180"
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
) }) : l ? /* @__PURE__ */ t(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
"data-slot": "research-activity-header",
|
|
184
|
+
className: "flex min-h-9 w-full items-center gap-2.5 py-1 text-left",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ e(
|
|
187
|
+
L,
|
|
188
|
+
{
|
|
189
|
+
size: "sm",
|
|
190
|
+
color: "current",
|
|
191
|
+
role: "presentation",
|
|
192
|
+
"aria-hidden": !0
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ e(D, { as: "span", className: "text-sm", children: "Researching…" }),
|
|
196
|
+
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 text-xs text-tertiary tabular-nums", children: [
|
|
197
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
|
|
198
|
+
n
|
|
199
|
+
] })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
) : /* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ t(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
ref: x,
|
|
206
|
+
type: "button",
|
|
207
|
+
"data-slot": "research-activity-trigger",
|
|
208
|
+
className: m(
|
|
209
|
+
"group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm py-1 text-left text-sm outline-none",
|
|
210
|
+
"transition-[color,transform] duration-(--duration-fast) ease-out hover:text-primary active:scale-(--scale-press)",
|
|
211
|
+
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
|
|
212
|
+
b && "sticky top-0 z-10 bg-background"
|
|
213
|
+
),
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: [
|
|
216
|
+
y ? "Collapse" : "Expand",
|
|
217
|
+
" research activity:",
|
|
218
|
+
" "
|
|
219
|
+
] }),
|
|
220
|
+
/* @__PURE__ */ e(M, { "aria-hidden": !0, className: "size-4 shrink-0" }),
|
|
221
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: f !== void 0 ? f : /* @__PURE__ */ e(
|
|
222
|
+
F,
|
|
223
|
+
{
|
|
224
|
+
elapsed: n,
|
|
225
|
+
firstInsight: N,
|
|
226
|
+
sourceCount: d
|
|
227
|
+
}
|
|
228
|
+
) }),
|
|
229
|
+
/* @__PURE__ */ e(
|
|
230
|
+
T,
|
|
231
|
+
{
|
|
232
|
+
"aria-hidden": !0,
|
|
233
|
+
className: m(
|
|
234
|
+
"size-4 shrink-0 text-tertiary transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
|
|
235
|
+
y && "rotate-180"
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
) }),
|
|
242
|
+
/* @__PURE__ */ e(
|
|
243
|
+
ee,
|
|
244
|
+
{
|
|
245
|
+
ref: S,
|
|
246
|
+
forceMount: !0,
|
|
247
|
+
"data-slot": "research-activity-content",
|
|
248
|
+
className: "mt-3 overflow-hidden text-foreground outline-none data-[state=closed]:hidden",
|
|
249
|
+
children: _
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
ae.displayName = "ResearchActivity";
|
|
258
|
+
export {
|
|
259
|
+
ae as ResearchActivity
|
|
260
|
+
};
|
|
@@ -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
|