@actioneer/ads 0.2.3 → 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.
@@ -1,54 +1,65 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as f, Fragment as N } from "react/jsx-runtime";
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 M } from "class-variance-authority";
4
+ import { cva as x } from "class-variance-authority";
5
5
  import { cn as l } from "../../lib/cn.js";
6
- import { Button as p } from "../button.js";
7
- import { Avatar as w } from "../avatar.js";
8
- import { Tooltip as x } from "../tooltip.js";
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 = o.forwardRef(
11
- ({ className: e, from: t, ...s }, a) => /* @__PURE__ */ r(
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: a,
22
+ ref: n,
15
23
  className: l(
16
- "group flex w-full max-w-[95%] flex-col gap-2",
17
- t === "user" ? "is-user ml-auto justify-end" : "is-assistant",
18
- e
24
+ z({ align: e ?? (s === "user" ? "end" : "start") }),
25
+ s === "user" ? "is-user" : "is-assistant",
26
+ t
19
27
  ),
20
- ...s
28
+ ...a
21
29
  }
22
30
  )
23
31
  );
24
- z.displayName = "Message";
25
- const k = M(
26
- "flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-base",
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: "group-[.is-user]:ml-auto 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",
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: "group-[.is-user]:ml-auto 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"
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
- ), P = o.forwardRef(({ children: e, className: t, variant: s, ...a }, n) => /* @__PURE__ */ r(
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(k({ variant: s }), t),
55
+ className: l(P({ variant: s }), t),
45
56
  ...a,
46
57
  children: e
47
58
  }
48
59
  ));
49
- P.displayName = "MessageContent";
50
- const T = o.forwardRef(({ src: e, name: t, className: s, ...a }, n) => /* @__PURE__ */ r(
51
- w,
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
- T.displayName = "MessageAvatar";
62
- const j = l(
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(j, e), ...s, children: t })
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 V = o.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ r(
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
- V.displayName = "MessageActions";
91
- const W = o.forwardRef(
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(p, { ref: d, size: n, type: "button", variant: a, ...i, children: [
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(x, { content: e, children: c }) : c;
108
+ return e ? /* @__PURE__ */ r(_, { content: e, children: c }) : c;
98
109
  }
99
110
  );
100
- W.displayName = "MessageAction";
101
- const _ = o.createContext(null), m = () => {
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
- }, E = o.forwardRef(({ defaultBranch: e = 0, onBranchChange: t, className: s, ...a }, n) => {
109
- const [i, d] = o.useState(e), [c, g] = o.useState([]), h = (u) => {
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
- }, b = () => {
122
+ }, v = () => {
112
123
  const u = i > 0 ? i - 1 : c.length - 1;
113
- h(u);
124
+ p(u);
114
125
  }, y = () => {
115
126
  const u = i < c.length - 1 ? i + 1 : 0;
116
- h(u);
117
- }, v = {
127
+ p(u);
128
+ }, N = {
118
129
  currentBranch: i,
119
130
  totalBranches: c.length,
120
- goToPrevious: b,
131
+ goToPrevious: v,
121
132
  goToNext: y,
122
133
  branches: c,
123
- setBranches: g
134
+ setBranches: m
124
135
  };
125
- return /* @__PURE__ */ r(_.Provider, { value: v, children: /* @__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
- E.displayName = "MessageBranch";
135
- const I = ({
145
+ I.displayName = "MessageBranch";
146
+ const L = ({
136
147
  children: e,
137
148
  ...t
138
149
  }) => {
139
- const { currentBranch: s, setBranches: a, branches: n } = m(), i = o.Children.toArray(
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(N, { children: i.map((d, c) => /* @__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
- I.displayName = "MessageBranchContent";
158
- const L = o.forwardRef(({ className: e, from: t, ...s }, a) => {
159
- const { totalBranches: n } = m();
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
- L.displayName = "MessageBranchSelector";
170
- const F = o.forwardRef(({ children: e, ...t }, s) => {
171
- const { goToPrevious: a, totalBranches: n } = m();
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
- p,
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
- F.displayName = "MessageBranchPrevious";
188
- const q = o.forwardRef(({ children: e, ...t }, s) => {
189
- const { goToNext: a, totalBranches: n } = m();
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
- p,
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
- q.displayName = "MessageBranchNext";
206
- const D = o.forwardRef(({ className: e, ...t }, s) => {
207
- const { currentBranch: a, totalBranches: n } = m();
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
- D.displayName = "MessageBranchPage";
226
- const G = o.forwardRef(({ data: e, className: t, onRemove: s, ...a }, n) => {
227
- var g;
228
- const i = e.filename || "", d = !!((g = e.mediaType) != null && g.startsWith("image/") && e.url), c = i || (d ? "Image" : "Attachment");
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(x, { content: c, children: /* @__PURE__ */ r("div", { className: "flex size-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ r(A, { className: "size-4" }) }) }),
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
- p,
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: (h) => {
256
- h.stopPropagation(), s();
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
- G.displayName = "MessageAttachment";
269
- const H = o.forwardRef(({ children: e, className: t, ...s }, a) => e ? /* @__PURE__ */ r(
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("ml-auto flex w-fit flex-wrap items-start gap-2", t),
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
- H.displayName = "MessageAttachments";
279
- const J = o.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ r(
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
- J.displayName = "MessageToolbar";
305
+ K.displayName = "MessageToolbar";
292
306
  export {
293
- z as Message,
294
- W as MessageAction,
295
- V as MessageActions,
296
- G as MessageAttachment,
297
- H as MessageAttachments,
298
- T as MessageAvatar,
299
- E as MessageBranch,
300
- I as MessageBranchContent,
301
- q as MessageBranchNext,
302
- D as MessageBranchPage,
303
- F as MessageBranchPrevious,
304
- L as MessageBranchSelector,
305
- P as MessageContent,
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
- J as MessageToolbar
321
+ K as MessageToolbar
308
322
  };
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as n, Fragment as q } from "react/jsx-runtime";
3
- import * as l from "react";
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 o } from "../../lib/cn.js";
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
- "flex w-full flex-col rounded-2xl bg-transparent [&_.aui-composer-root]:relative [&_.aui-composer-root]:z-10 [&_.aui-composer-root]:-mt-px",
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 = l.createContext(!1), Y = l.forwardRef(({ className: t, isSticky: s, ...d }, f) => /* @__PURE__ */ a(w.Provider, { value: !0, children: /* @__PURE__ */ a(
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: o(X({ isSticky: s }), t),
43
+ className: l(X({ isSticky: r }), a),
41
44
  ...d
42
45
  }
43
46
  ) }));
44
47
  Y.displayName = "TaskProgressDock";
45
- function y({ status: t }) {
48
+ function y({ status: a }) {
46
49
  return /* @__PURE__ */ n(
47
50
  "span",
48
51
  {
49
52
  "aria-hidden": !0,
50
- className: o(
53
+ className: l(
51
54
  "flex size-5 shrink-0 items-center justify-center",
52
- t === "complete" && "text-success",
53
- t === "active" && "text-info",
54
- t === "pending" && "text-tertiary"
55
+ a === "complete" && "text-success",
56
+ a === "active" && "text-info",
57
+ a === "pending" && "text-tertiary"
55
58
  ),
56
59
  children: [
57
- t === "complete" && /* @__PURE__ */ a(M, { className: "size-4", strokeWidth: 2 }),
58
- t === "active" && /* @__PURE__ */ a(J, { size: "sm", color: "current", role: "presentation", "aria-hidden": !0 }),
59
- t === "pending" && /* @__PURE__ */ a(Q, { className: "size-4" })
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: t }) {
70
- return t ? /* @__PURE__ */ n("span", { className: "flex shrink-0 items-center gap-3 text-xs text-tertiary tabular-nums", children: [
71
- /* @__PURE__ */ a("span", { "aria-hidden": !0, className: "h-4 w-px bg-border" }),
72
- /* @__PURE__ */ a("span", { "aria-label": `Elapsed ${t}`, children: t })
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 = l.forwardRef(
78
+ const O = i.forwardRef(
76
79
  ({
77
- className: t,
78
- steps: s,
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: P,
84
- emptyLabel: I = "No task steps",
85
- isSticky: T,
86
- role: $,
87
- "aria-label": z,
88
- "aria-busy": D,
89
- ...S
90
- }, V) => {
91
- const b = l.useContext(w), x = d !== void 0, [j, E] = l.useState(f), m = x ? d : j, i = s.findIndex((e) => e.status === "active"), p = s.reduce(
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
- ), R = s.findIndex(
97
+ ), E = r.findIndex(
95
98
  (e) => e.status === "pending"
96
- ), h = i >= 0 ? i : p >= 0 ? p : R, r = h >= 0 ? s[h] : void 0, g = i >= 0 ? i + 1 : p >= 0 ? p + 1 : 0, _ = s.filter(
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, k = s.length > 0 && s.every((e) => e.status === "complete"), A = i >= 0 ? "active" : k ? "complete" : "pending", v = r ? r.accessibilityLabel ?? (typeof r.label == "string" ? r.label : "") : "", L = l.useCallback(
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
- x || E(e), u == null || u(e);
103
+ b || j(e), u == null || u(e);
101
104
  },
102
- [x, u]
105
+ [b, u]
103
106
  );
104
107
  return /* @__PURE__ */ n(
105
108
  B,
106
109
  {
107
- ref: V,
110
+ ref: S,
108
111
  open: m,
109
112
  onOpenChange: L,
110
- role: $ ?? "region",
111
- "aria-label": z ?? c,
112
- "aria-busy": D ?? (i >= 0 || void 0),
113
- ...S,
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: o(
117
- U({ isSticky: b ? !1 : T }),
118
- b && "rounded-b-none",
119
- t
119
+ className: l(
120
+ U({ isSticky: g ? !1 : I }),
121
+ g && "rounded-b-none",
122
+ a
120
123
  ),
121
124
  children: [
122
- /* @__PURE__ */ a(
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": s.length,
130
- "aria-valuenow": g
132
+ "aria-valuemax": r.length,
133
+ "aria-valuenow": x
131
134
  }
132
135
  ),
133
- /* @__PURE__ */ a("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: k ? `All ${s.length} steps complete` : `Step ${g} of ${s.length}${v ? `: ${v}` : ""}. ${_} pending.` }),
134
- /* @__PURE__ */ a(G, { asChild: !0, children: /* @__PURE__ */ n(
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: o(
140
- "flex min-h-(--panel-header-height) w-full items-center gap-3 px-4 text-left sm:px-5",
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__ */ a("span", { className: "min-w-0 flex-1 truncate text-base font-bold text-secondary", children: c }) : /* @__PURE__ */ n(q, { children: [
146
- /* @__PURE__ */ a(y, { status: (r == null ? void 0 : r.status) ?? "pending" }),
147
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-base text-primary", children: P ?? (r == null ? void 0 : r.label) ?? I }),
148
- (r == null ? void 0 : r.status) === "active" && /* @__PURE__ */ a(N, { elapsed: r.elapsed })
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
- g,
159
+ x,
157
160
  " / ",
158
- s.length
161
+ r.length
159
162
  ]
160
163
  }
161
164
  ),
162
- /* @__PURE__ */ a(
165
+ /* @__PURE__ */ t(
163
166
  K,
164
167
  {
165
168
  "aria-hidden": !0,
166
- className: o(
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__ */ a(H, { className: "outline-none", children: /* @__PURE__ */ a(
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: s.map((e) => /* @__PURE__ */ n(
183
+ children: r.map((e) => /* @__PURE__ */ n(
181
184
  "li",
182
185
  {
183
186
  "data-status": e.status,
184
- className: o(
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__ */ a(y, { status: e.status }),
194
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate", children: e.label }),
195
- e.status === "active" && /* @__PURE__ */ a(N, { elapsed: e.elapsed })
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
@@ -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>;