@actioneer/ads 0.5.7 → 0.5.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.
Files changed (140) hide show
  1. package/bin/ads-init.mjs +6 -0
  2. package/components/accordion.js +50 -48
  3. package/components/agent-icon.d.ts +12 -0
  4. package/components/agent-icon.js +133 -120
  5. package/components/ai-elements/chain-of-thought.d.ts +1 -1
  6. package/components/ai-elements/chain-of-thought.js +108 -108
  7. package/components/ai-elements/chart.js +16 -14
  8. package/components/ai-elements/inline-citation.js +41 -41
  9. package/components/ai-elements/message.js +4 -4
  10. package/components/ai-elements/queue.js +7 -7
  11. package/components/ai-elements/research-activity.js +114 -114
  12. package/components/ai-elements/shimmer.d.ts +2 -2
  13. package/components/ai-elements/speech-input.js +28 -28
  14. package/components/ai-elements/task-progress.js +26 -16
  15. package/components/ai-elements/task.js +17 -17
  16. package/components/ai-elements/tool.js +6 -6
  17. package/components/ai-elements/transcript.js +6 -5
  18. package/components/ai-elements/voice.js +1 -1
  19. package/components/alert.js +10 -10
  20. package/components/answer-sources.js +1 -1
  21. package/components/answer.js +115 -114
  22. package/components/assistant-ui/action-bar.js +94 -48
  23. package/components/assistant-ui/attachment.js +103 -75
  24. package/components/assistant-ui/badge.d.ts +1 -1
  25. package/components/assistant-ui/badge.js +17 -17
  26. package/components/assistant-ui/chain-of-thought.d.ts +1 -1
  27. package/components/assistant-ui/composer-add-context.js +9 -9
  28. package/components/assistant-ui/composer-deep-research.js +5 -5
  29. package/components/assistant-ui/composer-harness.js +11 -9
  30. package/components/assistant-ui/composer-trigger-popover.js +45 -34
  31. package/components/assistant-ui/composer.js +59 -59
  32. package/components/assistant-ui/error.js +14 -14
  33. package/components/assistant-ui/file.d.ts +1 -1
  34. package/components/assistant-ui/image.d.ts +1 -1
  35. package/components/assistant-ui/image.js +113 -103
  36. package/components/assistant-ui/markdown-text.js +18 -18
  37. package/components/assistant-ui/message.js +46 -45
  38. package/components/assistant-ui/quote.js +1 -1
  39. package/components/assistant-ui/reasoning.d.ts +1 -1
  40. package/components/assistant-ui/reasoning.js +66 -77
  41. package/components/assistant-ui/suggestions.js +4 -4
  42. package/components/assistant-ui/thread.js +22 -22
  43. package/components/assistant-ui/tool-fallback.js +60 -63
  44. package/components/assistant-ui/tool-group.d.ts +1 -1
  45. package/components/assistant-ui/tool-group.js +36 -42
  46. package/components/audio-waveform.js +25 -24
  47. package/components/autocomplete.d.ts +1 -0
  48. package/components/autocomplete.js +45 -43
  49. package/components/avatar.js +24 -24
  50. package/components/badge.d.ts +1 -1
  51. package/components/breadcrumbs.js +2 -2
  52. package/components/button.d.ts +2 -2
  53. package/components/button.js +22 -20
  54. package/components/card.js +8 -8
  55. package/components/carousel.js +105 -104
  56. package/components/chart.js +9 -7
  57. package/components/checkbox.js +74 -38
  58. package/components/chip.d.ts +1 -1
  59. package/components/code-block.js +3 -3
  60. package/components/collapsible.js +67 -23
  61. package/components/connector-card.js +6 -6
  62. package/components/drawer.d.ts +15 -10
  63. package/components/drawer.js +78 -77
  64. package/components/dropdown.d.ts +2 -0
  65. package/components/dropdown.js +88 -79
  66. package/components/empty-state.d.ts +1 -1
  67. package/components/empty-state.js +7 -7
  68. package/components/field.d.ts +4 -0
  69. package/components/field.js +45 -34
  70. package/components/file-dropzone.js +12 -12
  71. package/components/index.d.ts +3 -0
  72. package/components/index.js +584 -558
  73. package/components/input-field.js +51 -46
  74. package/components/input.js +20 -20
  75. package/components/link.js +9 -9
  76. package/components/modal.js +105 -73
  77. package/components/navbar.d.ts +1 -1
  78. package/components/navbar.js +1 -1
  79. package/components/number-field.js +38 -29
  80. package/components/page-header.js +12 -12
  81. package/components/pagination.js +19 -19
  82. package/components/panel.js +2 -2
  83. package/components/pixel-blast-svg.js +3 -3
  84. package/components/pixel-icon.js +0 -1
  85. package/components/popover.d.ts +1 -1
  86. package/components/popover.js +66 -64
  87. package/components/progress-circle.js +36 -32
  88. package/components/progress.js +28 -24
  89. package/components/radio.js +59 -49
  90. package/components/resizable-panel.js +1 -1
  91. package/components/reveal.d.ts +2 -2
  92. package/components/ripple.d.ts +3 -3
  93. package/components/scroll-area.js +17 -16
  94. package/components/segmented.js +26 -26
  95. package/components/select.d.ts +2 -0
  96. package/components/select.js +61 -57
  97. package/components/setting-row.js +45 -42
  98. package/components/sidebar.js +131 -127
  99. package/components/skeleton.js +5 -5
  100. package/components/spinner.d.ts +13 -4
  101. package/components/spinner.js +42 -42
  102. package/components/stepper.js +21 -21
  103. package/components/switch.js +41 -39
  104. package/components/table.d.ts +9 -0
  105. package/components/table.js +370 -247
  106. package/components/tabs.js +149 -137
  107. package/components/toast.js +66 -66
  108. package/components/tooltip.js +2 -2
  109. package/components/tree.js +62 -51
  110. package/components/typography.d.ts +2 -1
  111. package/components/typography.js +33 -32
  112. package/components/ui/button.d.ts +2 -2
  113. package/components/ui/button.js +19 -19
  114. package/components/ui/collapsible.d.ts +1 -5
  115. package/components/ui/dialog.d.ts +3 -3
  116. package/components/ui/dialog.js +95 -58
  117. package/components/ui/tooltip.d.ts +2 -2
  118. package/components/ui/tooltip.js +67 -33
  119. package/components/viz-charts.js +95 -95
  120. package/demo/components/add-to-artifact.js +341 -0
  121. package/demo/lib/artifact-library.js +134 -0
  122. package/fonts/aribau-grotesk-medium.woff2 +0 -0
  123. package/fonts/aribau-grotesk-regular.woff2 +0 -0
  124. package/fonts.css +11 -11
  125. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
  126. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
  127. package/lib/icons.d.ts +4 -0
  128. package/lib/icons.js +103 -102
  129. package/lib/motion.d.ts +42 -39
  130. package/lib/motion.js +112 -52
  131. package/lib/spinner-mark.d.ts +9 -0
  132. package/lib/spinner-mark.js +98 -0
  133. package/llms.txt +52 -18
  134. package/manifest.json +240 -31
  135. package/package.json +1 -1
  136. package/styles.css +143 -124
  137. package/theme.css +90 -93
  138. package/components/ui/collapsible.js +0 -35
  139. package/fonts/aribau-grotesk-500.otf +0 -0
  140. package/fonts/aribau-grotesk-600.woff2 +0 -0
@@ -2,8 +2,8 @@
2
2
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
3
3
  import { memo as U, useState as C, useRef as _, useCallback as P } from "react";
4
4
  import { ChevronDown as q } from "../../lib/icons.js";
5
- import { useScrollLock as $, useToolCallElapsed as B } from "@assistant-ui/react";
6
- import { Collapsible as M, CollapsibleTrigger as J, CollapsibleContent as V } from "../ui/collapsible.js";
5
+ import { useScrollLock as $, useToolCallElapsed as M } from "@assistant-ui/react";
6
+ import { Collapsible as B, CollapsibleTrigger as J, CollapsibleContent as V } from "../collapsible.js";
7
7
  import { cn as c } from "../../lib/cn.js";
8
8
  import { Button as v } from "../ui/button.js";
9
9
  import { TraceStateIcon as K } from "../ai-elements/chain-of-thought-icon.js";
@@ -11,29 +11,29 @@ const W = 200, w = "active:scale-[0.98]";
11
11
  function D({
12
12
  className: e,
13
13
  open: l,
14
- onOpenChange: t,
14
+ onOpenChange: a,
15
15
  defaultOpen: n = !1,
16
16
  children: r,
17
- ...f
17
+ ...u
18
18
  }) {
19
- const s = _(null), [i, N] = C(n), k = $(s, W), d = l !== void 0, b = d ? l : i, u = P(
19
+ const s = _(null), [i, N] = C(n), k = $(s, W), d = l !== void 0, p = d ? l : i, f = P(
20
20
  (h) => {
21
- k(), d || N(h), t == null || t(h);
21
+ k(), d || N(h), a == null || a(h);
22
22
  },
23
- [k, d, t]
23
+ [k, d, a]
24
24
  );
25
25
  return /* @__PURE__ */ o(
26
- M,
26
+ B,
27
27
  {
28
28
  ref: s,
29
29
  "data-slot": "tool-fallback-root",
30
- open: b,
31
- onOpenChange: u,
30
+ open: p,
31
+ onOpenChange: f,
32
32
  className: c(
33
33
  "aui-tool-fallback-root group/tool-fallback-root w-full",
34
34
  e
35
35
  ),
36
- ...f,
36
+ ...u,
37
37
  children: r
38
38
  }
39
39
  );
@@ -52,8 +52,8 @@ function Q({
52
52
  className: e,
53
53
  ...l
54
54
  }) {
55
- const t = B();
56
- return t === void 0 ? null : /* @__PURE__ */ o(
55
+ const a = M();
56
+ return a === void 0 ? null : /* @__PURE__ */ o(
57
57
  "span",
58
58
  {
59
59
  "data-slot": "tool-fallback-duration",
@@ -62,24 +62,24 @@ function Q({
62
62
  e
63
63
  ),
64
64
  ...l,
65
- children: H(t)
65
+ children: H(a)
66
66
  }
67
67
  );
68
68
  }
69
69
  function R({
70
70
  toolName: e,
71
71
  status: l,
72
- className: t,
72
+ className: a,
73
73
  ...n
74
74
  }) {
75
- const r = (l == null ? void 0 : l.type) ?? "complete", f = r === "running", s = (l == null ? void 0 : l.type) === "incomplete" && l.reason === "cancelled", i = s ? "Cancelled tool" : "Used tool";
75
+ const r = (l == null ? void 0 : l.type) ?? "complete", u = r === "running", s = (l == null ? void 0 : l.type) === "incomplete" && l.reason === "cancelled", i = s ? "Cancelled tool" : "Used tool";
76
76
  return /* @__PURE__ */ m(
77
77
  J,
78
78
  {
79
79
  "data-slot": "tool-fallback-trigger",
80
80
  className: c(
81
81
  "aui-tool-fallback-trigger group/trigger text-muted-foreground hover:text-foreground flex w-fit origin-left items-center gap-2 py-1.5 text-xs transition-[color,scale] active:scale-[0.98]",
82
- t
82
+ a
83
83
  ),
84
84
  ...n,
85
85
  children: [
@@ -110,7 +110,7 @@ function R({
110
110
  ": ",
111
111
  /* @__PURE__ */ o("b", { children: e })
112
112
  ] }),
113
- f && /* @__PURE__ */ m(
113
+ u && /* @__PURE__ */ m(
114
114
  "span",
115
115
  {
116
116
  "aria-hidden": !0,
@@ -133,7 +133,7 @@ function R({
133
133
  "data-slot": "tool-fallback-trigger-chevron",
134
134
  className: c(
135
135
  "aui-tool-fallback-trigger-chevron size-4 shrink-0",
136
- "transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
136
+ "transition-transform duration-200 ease-out motion-reduce:transition-none",
137
137
  "group-data-[state=closed]/trigger:-rotate-90",
138
138
  "group-data-[state=open]/trigger:rotate-0"
139
139
  )
@@ -146,7 +146,7 @@ function R({
146
146
  function S({
147
147
  className: e,
148
148
  children: l,
149
- ...t
149
+ ...a
150
150
  }) {
151
151
  return /* @__PURE__ */ o(
152
152
  V,
@@ -158,15 +158,12 @@ function S({
158
158
  "data-[state=closed]:pointer-events-none",
159
159
  e
160
160
  ),
161
- ...t,
161
+ ...a,
162
162
  children: /* @__PURE__ */ o(
163
163
  "div",
164
164
  {
165
165
  className: c(
166
- "flex flex-col gap-2 ps-6 pt-1 pb-2 ease-out motion-reduce:animate-none",
167
- "group-data-[state=open]/collapsible-content:animate-in group-data-[state=open]/collapsible-content:fade-in-0 group-data-[state=open]/collapsible-content:blur-in-[2px] group-data-[state=open]/collapsible-content:slide-in-from-top-1",
168
- "group-data-[state=closed]/collapsible-content:animate-out group-data-[state=closed]/collapsible-content:fade-out-0 group-data-[state=closed]/collapsible-content:blur-out-[2px] group-data-[state=closed]/collapsible-content:slide-out-to-top-1",
169
- "group-data-[state=closed]/collapsible-content:duration-(--duration-normal) group-data-[state=open]/collapsible-content:duration-(--duration-normal)"
166
+ "flex flex-col gap-2 ps-6 pt-1 pb-2"
170
167
  ),
171
168
  children: l
172
169
  }
@@ -177,14 +174,14 @@ function S({
177
174
  function E({
178
175
  argsText: e,
179
176
  className: l,
180
- ...t
177
+ ...a
181
178
  }) {
182
179
  return e ? /* @__PURE__ */ o(
183
180
  "div",
184
181
  {
185
182
  "data-slot": "tool-fallback-args",
186
183
  className: c("aui-tool-fallback-args", l),
187
- ...t,
184
+ ...a,
188
185
  children: /* @__PURE__ */ o("pre", { className: "aui-tool-fallback-args-value bg-muted/50 text-foreground/90 rounded-md p-2.5 text-xs whitespace-pre-wrap", children: e })
189
186
  }
190
187
  ) : null;
@@ -192,14 +189,14 @@ function E({
192
189
  function I({
193
190
  result: e,
194
191
  className: l,
195
- ...t
192
+ ...a
196
193
  }) {
197
194
  return e === void 0 ? null : /* @__PURE__ */ m(
198
195
  "div",
199
196
  {
200
197
  "data-slot": "tool-fallback-result",
201
198
  className: c("aui-tool-fallback-result", l),
202
- ...t,
199
+ ...a,
203
200
  children: [
204
201
  /* @__PURE__ */ o("p", { className: "aui-tool-fallback-result-header text-muted-foreground text-xs font-medium", children: "Result:" }),
205
202
  /* @__PURE__ */ o("pre", { className: "aui-tool-fallback-result-content bg-muted/50 text-foreground/90 mt-1 rounded-md p-2.5 text-xs whitespace-pre-wrap", children: typeof e == "string" ? e : JSON.stringify(e, null, 2) })
@@ -210,7 +207,7 @@ function I({
210
207
  function L({
211
208
  status: e,
212
209
  className: l,
213
- ...t
210
+ ...a
214
211
  }) {
215
212
  if ((e == null ? void 0 : e.type) !== "incomplete") return null;
216
213
  const n = e.error, r = n ? typeof n == "string" ? n : JSON.stringify(n) : null;
@@ -221,43 +218,43 @@ function L({
221
218
  {
222
219
  "data-slot": "tool-fallback-error",
223
220
  className: c("aui-tool-fallback-error", l),
224
- ...t,
221
+ ...a,
225
222
  children: [
226
- /* @__PURE__ */ o("p", { className: "aui-tool-fallback-error-header text-muted-foreground font-semibold", children: s }),
223
+ /* @__PURE__ */ o("p", { className: "aui-tool-fallback-error-header text-muted-foreground font-medium", children: s }),
227
224
  /* @__PURE__ */ o("p", { className: "aui-tool-fallback-error-reason text-muted-foreground", children: r })
228
225
  ]
229
226
  }
230
227
  );
231
228
  }
232
- const X = "Approved by user", Y = "User denied tool execution", O = {
229
+ const X = "Approved by user", Y = "User denied tool execution", A = {
233
230
  "allow-once": "Allow",
234
231
  "allow-always": "Always allow",
235
232
  "reject-once": "Deny",
236
233
  "reject-always": "Always deny"
237
- }, A = (e) => e === "allow-once" || e === "allow-always", F = (e) => e.label ?? (Object.hasOwn(O, e.kind) ? O[e.kind] : void 0) ?? e.id;
234
+ }, F = (e) => e === "allow-once" || e === "allow-always", O = (e) => e.label ?? (Object.hasOwn(A, e.kind) ? A[e.kind] : void 0) ?? e.id;
238
235
  function j({
239
236
  className: e,
240
237
  addResult: l,
241
- resume: t,
238
+ resume: a,
242
239
  interrupt: n,
243
240
  approval: r,
244
- respondToApproval: f,
241
+ respondToApproval: u,
245
242
  ...s
246
243
  }) {
247
244
  const [i, N] = C(!1), [k, d] = C(null);
248
245
  if (r != null && (r.approved !== void 0 || r.resolution !== void 0))
249
246
  return null;
250
- const b = f ? r == null ? void 0 : r.options : void 0, u = b == null ? void 0 : b.filter(
251
- (a) => Object.hasOwn(O, a.kind)
252
- ), h = (a) => {
253
- i || (r != null && r.approved === void 0 && f ? f({ approved: a }) : n ? t == null || t({ approved: a }) : l == null || l(a ? X : Y), N(!0));
254
- }, T = (a) => {
255
- i || (f == null || f({ optionId: a.id }), N(!0), d(null));
256
- }, z = (a) => {
257
- a.confirm ? d(a.id) : T(a);
258
- }, g = k != null ? u == null ? void 0 : u.find((a) => a.id === k) : void 0;
247
+ const p = u ? r == null ? void 0 : r.options : void 0, f = p == null ? void 0 : p.filter(
248
+ (t) => Object.hasOwn(A, t.kind)
249
+ ), h = (t) => {
250
+ i || (r != null && r.approved === void 0 && u ? u({ approved: t }) : n ? a == null || a({ approved: t }) : l == null || l(t ? X : Y), N(!0));
251
+ }, T = (t) => {
252
+ i || (u == null || u({ optionId: t.id }), N(!0), d(null));
253
+ }, z = (t) => {
254
+ t.confirm ? d(t.id) : T(t);
255
+ }, g = k != null ? f == null ? void 0 : f.find((t) => t.id === k) : void 0;
259
256
  if (g) {
260
- const a = typeof g.confirm == "object" ? g.confirm : void 0, y = (a == null ? void 0 : a.description) ?? g.description;
257
+ const t = typeof g.confirm == "object" ? g.confirm : void 0, y = (t == null ? void 0 : t.description) ?? g.description;
261
258
  return /* @__PURE__ */ m(
262
259
  "div",
263
260
  {
@@ -268,9 +265,9 @@ function j({
268
265
  ),
269
266
  ...s,
270
267
  children: [
271
- /* @__PURE__ */ o("p", { className: "aui-tool-fallback-approval-confirm-title font-semibold", children: (a == null ? void 0 : a.title) ?? `${F(g)}?` }),
268
+ /* @__PURE__ */ o("p", { className: "aui-tool-fallback-approval-confirm-title font-medium", children: (t == null ? void 0 : t.title) ?? `${O(g)}?` }),
272
269
  y && /* @__PURE__ */ o("p", { className: "aui-tool-fallback-approval-confirm-description text-muted-foreground", children: y }),
273
- g.grants && g.grants.length > 0 && /* @__PURE__ */ o("ul", { className: "aui-tool-fallback-approval-confirm-grants flex flex-col gap-1", children: g.grants.map((p) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("code", { className: "aui-tool-fallback-approval-confirm-grant bg-muted rounded px-1.5 py-0.5 text-xs", children: p }) }, p)) }),
270
+ g.grants && g.grants.length > 0 && /* @__PURE__ */ o("ul", { className: "aui-tool-fallback-approval-confirm-grants flex flex-col gap-1", children: g.grants.map((b) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("code", { className: "aui-tool-fallback-approval-confirm-grant bg-muted rounded px-1.5 py-0.5 text-xs", children: b }) }, b)) }),
274
271
  /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
275
272
  /* @__PURE__ */ o(
276
273
  v,
@@ -279,7 +276,7 @@ function j({
279
276
  className: w,
280
277
  onClick: () => T(g),
281
278
  disabled: i,
282
- children: "Confirm"
279
+ children: O(g)
283
280
  }
284
281
  ),
285
282
  /* @__PURE__ */ o(
@@ -290,7 +287,7 @@ function j({
290
287
  className: w,
291
288
  onClick: () => d(null),
292
289
  disabled: i,
293
- children: "Back"
290
+ children: "Cancel"
294
291
  }
295
292
  )
296
293
  ] })
@@ -298,8 +295,8 @@ function j({
298
295
  }
299
296
  );
300
297
  }
301
- if (b && b.length > 0) {
302
- const a = (u == null ? void 0 : u.filter((p) => A(p.kind))) ?? [], y = (u == null ? void 0 : u.filter((p) => !A(p.kind))) ?? [];
298
+ if (p && p.length > 0) {
299
+ const t = (f == null ? void 0 : f.filter((b) => F(b.kind))) ?? [], y = (f == null ? void 0 : f.filter((b) => !F(b.kind))) ?? [];
303
300
  return /* @__PURE__ */ m(
304
301
  "div",
305
302
  {
@@ -310,17 +307,17 @@ function j({
310
307
  ),
311
308
  ...s,
312
309
  children: [
313
- [...a, ...y].map((p) => /* @__PURE__ */ o(
310
+ [...t, ...y].map((b) => /* @__PURE__ */ o(
314
311
  v,
315
312
  {
316
313
  size: "sm",
317
- variant: p === a[0] ? "default" : "outline",
314
+ variant: b === t[0] ? "default" : "outline",
318
315
  className: w,
319
- onClick: () => z(p),
316
+ onClick: () => z(b),
320
317
  disabled: i,
321
- children: F(p)
318
+ children: O(b)
322
319
  },
323
- p.id
320
+ b.id
324
321
  )),
325
322
  y.length === 0 && /* @__PURE__ */ o(
326
323
  v,
@@ -375,16 +372,16 @@ function j({
375
372
  const Z = ({
376
373
  toolName: e,
377
374
  argsText: l,
378
- result: t,
375
+ result: a,
379
376
  status: n,
380
377
  addResult: r,
381
- resume: f,
378
+ resume: u,
382
379
  interrupt: s,
383
380
  approval: i,
384
381
  respondToApproval: N
385
382
  }) => {
386
- const k = (n == null ? void 0 : n.type) === "incomplete" && n.reason === "cancelled", d = (n == null ? void 0 : n.type) === "requires-action", [b, u] = C(d), [h, T] = C(d);
387
- return d !== h && (T(d), d && u(!0)), /* @__PURE__ */ m(D, { open: b, onOpenChange: u, children: [
383
+ const k = (n == null ? void 0 : n.type) === "incomplete" && n.reason === "cancelled", d = (n == null ? void 0 : n.type) === "requires-action", [p, f] = C(d), [h, T] = C(d);
384
+ return d !== h && (T(d), d && f(!0)), /* @__PURE__ */ m(D, { open: p, onOpenChange: f, children: [
388
385
  /* @__PURE__ */ o(R, { toolName: e, status: n }),
389
386
  /* @__PURE__ */ m(S, { children: [
390
387
  /* @__PURE__ */ o(L, { status: n }),
@@ -399,13 +396,13 @@ const Z = ({
399
396
  j,
400
397
  {
401
398
  addResult: r,
402
- resume: f,
399
+ resume: u,
403
400
  interrupt: s,
404
401
  approval: i,
405
402
  respondToApproval: N
406
403
  }
407
404
  ),
408
- !k && /* @__PURE__ */ o(I, { result: t })
405
+ !k && /* @__PURE__ */ o(I, { result: a })
409
406
  ] })
410
407
  ] });
411
408
  }, x = U(
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
3
3
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible';
4
4
  import { ActiveChainOfThoughtState } from '../ai-elements/chain-of-thought-icon';
5
5
  declare const toolGroupVariants: (props?: ({
6
- variant?: "muted" | "outline" | "ghost" | null | undefined;
6
+ variant?: "outline" | "muted" | "ghost" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  export type ToolGroupRootProps = Omit<React.ComponentProps<typeof Collapsible>, "open" | "onOpenChange"> & VariantProps<typeof toolGroupVariants> & {
9
9
  open?: boolean;
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsxs as p, jsx as t } from "react/jsx-runtime";
3
- import { memo as w, useRef as y, useState as C, useCallback as k } from "react";
4
- import { ChevronDown as G } from "../../lib/icons.js";
5
- import { cva as I } from "class-variance-authority";
6
- import { useScrollLock as R } from "@assistant-ui/react";
7
- import { Collapsible as S, CollapsibleTrigger as A, CollapsibleContent as j } from "../ui/collapsible.js";
8
- import { cn as n } from "../../lib/cn.js";
3
+ import { memo as w, useRef as C, useState as k, useCallback as G } from "react";
4
+ import { ChevronDown as I } from "../../lib/icons.js";
5
+ import { cva as R } from "class-variance-authority";
6
+ import { useScrollLock as y } from "@assistant-ui/react";
7
+ import { Collapsible as S, CollapsibleTrigger as A, CollapsibleContent as j } from "../collapsible.js";
8
+ import { cn as l } from "../../lib/cn.js";
9
9
  import { TraceStateIcon as z } from "../ai-elements/chain-of-thought-icon.js";
10
- const D = 200, U = I("aui-tool-group-root group/tool-group w-full", {
10
+ const D = 200, U = R("aui-tool-group-root group/tool-group w-full", {
11
11
  variants: {
12
12
  variant: {
13
13
  outline: "rounded-lg border py-3",
@@ -17,18 +17,18 @@ const D = 200, U = I("aui-tool-group-root group/tool-group w-full", {
17
17
  },
18
18
  defaultVariants: { variant: "outline" }
19
19
  });
20
- function c({
20
+ function m({
21
21
  className: r,
22
22
  variant: o,
23
23
  open: a,
24
24
  onOpenChange: e,
25
- defaultOpen: u = !1,
26
- children: l,
25
+ defaultOpen: i = !1,
26
+ children: n,
27
27
  ...h
28
28
  }) {
29
- const s = y(null), [x, b] = C(u), d = R(s, D), g = a !== void 0, N = g ? a : x, T = k(
30
- (m) => {
31
- d(), g || b(m), e == null || e(m);
29
+ const s = C(null), [x, b] = k(i), d = y(s, D), g = a !== void 0, N = g ? a : x, T = G(
30
+ (c) => {
31
+ d(), g || b(c), e == null || e(c);
32
32
  },
33
33
  [d, g, e]
34
34
  );
@@ -40,13 +40,13 @@ function c({
40
40
  "data-variant": o ?? "outline",
41
41
  open: N,
42
42
  onOpenChange: T,
43
- className: n(
43
+ className: l(
44
44
  U({ variant: o }),
45
45
  "group/tool-group-root",
46
46
  r
47
47
  ),
48
48
  ...h,
49
- children: l
49
+ children: n
50
50
  }
51
51
  );
52
52
  }
@@ -55,21 +55,21 @@ function v({
55
55
  active: o = !1,
56
56
  stage: a = "thinking",
57
57
  className: e,
58
- ...u
58
+ ...i
59
59
  }) {
60
- const l = `${r} tool ${r === 1 ? "call" : "calls"}`;
60
+ const n = `${r} tool ${r === 1 ? "call" : "calls"}`;
61
61
  return /* @__PURE__ */ p(
62
62
  A,
63
63
  {
64
64
  "data-slot": "tool-group-trigger",
65
- className: n(
65
+ className: l(
66
66
  "aui-tool-group-trigger group/trigger flex origin-left items-center gap-2 text-xs transition-[color,scale] active:scale-[0.98]",
67
67
  "group-data-[variant=ghost]/tool-group-root:text-muted-foreground group-data-[variant=ghost]/tool-group-root:hover:text-foreground group-data-[variant=ghost]/tool-group-root:py-1.5",
68
68
  "group-data-[variant=outline]/tool-group-root:w-full group-data-[variant=outline]/tool-group-root:px-4",
69
69
  "group-data-[variant=muted]/tool-group-root:w-full group-data-[variant=muted]/tool-group-root:px-4",
70
70
  e
71
71
  ),
72
- ...u,
72
+ ...i,
73
73
  children: [
74
74
  /* @__PURE__ */ t(
75
75
  z,
@@ -85,33 +85,33 @@ function v({
85
85
  "span",
86
86
  {
87
87
  "data-slot": "tool-group-trigger-label",
88
- className: n(
88
+ className: l(
89
89
  "aui-tool-group-trigger-label-wrapper relative inline-block text-start leading-none font-medium",
90
90
  "group-data-[variant=ghost]/tool-group-root:font-normal",
91
91
  "group-data-[variant=outline]/tool-group-root:grow",
92
92
  "group-data-[variant=muted]/tool-group-root:grow"
93
93
  ),
94
94
  children: [
95
- /* @__PURE__ */ t("span", { className: "text-xs", children: l }),
95
+ /* @__PURE__ */ t("span", { className: "text-xs", children: n }),
96
96
  o && /* @__PURE__ */ t(
97
97
  "span",
98
98
  {
99
99
  "aria-hidden": !0,
100
100
  "data-slot": "tool-group-trigger-shimmer",
101
101
  className: "aui-tool-group-trigger-shimmer shimmer pointer-events-none absolute inset-0 text-xs motion-reduce:animate-none",
102
- children: l
102
+ children: n
103
103
  }
104
104
  )
105
105
  ]
106
106
  }
107
107
  ),
108
108
  /* @__PURE__ */ t(
109
- G,
109
+ I,
110
110
  {
111
111
  "data-slot": "tool-group-trigger-chevron",
112
- className: n(
112
+ className: l(
113
113
  "aui-tool-group-trigger-chevron size-3 shrink-0",
114
- "transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
114
+ "transition-transform duration-200 ease-out motion-reduce:transition-none",
115
115
  "group-data-[state=closed]/trigger:-rotate-90",
116
116
  "group-data-[state=open]/trigger:rotate-0"
117
117
  )
@@ -130,7 +130,7 @@ function f({
130
130
  j,
131
131
  {
132
132
  "data-slot": "tool-group-content",
133
- className: n(
133
+ className: l(
134
134
  "aui-tool-group-content relative overflow-hidden text-xs outline-none",
135
135
  "group/collapsible-content",
136
136
  "data-[state=closed]:pointer-events-none",
@@ -140,17 +140,11 @@ function f({
140
140
  children: /* @__PURE__ */ t(
141
141
  "div",
142
142
  {
143
- className: n(
143
+ className: l(
144
144
  "mt-2 flex flex-col gap-2",
145
145
  "group-data-[variant=ghost]/tool-group-root:mt-1 group-data-[variant=ghost]/tool-group-root:gap-1",
146
146
  "group-data-[variant=outline]/tool-group-root:mt-3 group-data-[variant=outline]/tool-group-root:border-t group-data-[variant=outline]/tool-group-root:px-4 group-data-[variant=outline]/tool-group-root:pt-3",
147
- "group-data-[variant=muted]/tool-group-root:mt-3 group-data-[variant=muted]/tool-group-root:border-t group-data-[variant=muted]/tool-group-root:px-4 group-data-[variant=muted]/tool-group-root:pt-3",
148
- "[&>*]:animate-in [&>*]:fade-in-0 [&>*]:blur-in-[2px] [&>*]:slide-in-from-top-1 [&>*]:duration-(--duration-normal) [&>*]:ease-out",
149
- "[&>*]:motion-reduce:animate-none",
150
- "[&>*:nth-child(2)]:[animation-delay:40ms]",
151
- "[&>*:nth-child(3)]:[animation-delay:80ms]",
152
- "[&>*:nth-child(4)]:[animation-delay:120ms]",
153
- "[&>*:nth-child(n+5)]:[animation-delay:160ms]"
147
+ "group-data-[variant=muted]/tool-group-root:mt-3 group-data-[variant=muted]/tool-group-root:border-t group-data-[variant=muted]/tool-group-root:px-4 group-data-[variant=muted]/tool-group-root:pt-3"
154
148
  ),
155
149
  children: o
156
150
  }
@@ -160,19 +154,19 @@ function f({
160
154
  }
161
155
  const V = ({ children: r, startIndex: o, endIndex: a }) => {
162
156
  const e = a - o + 1;
163
- return /* @__PURE__ */ p(c, { children: [
157
+ return /* @__PURE__ */ p(m, { children: [
164
158
  /* @__PURE__ */ t(v, { count: e }),
165
159
  /* @__PURE__ */ t(f, { children: r })
166
160
  ] });
167
- }, i = w(V);
168
- i.displayName = "ToolGroup";
169
- i.Root = c;
170
- i.Trigger = v;
171
- i.Content = f;
161
+ }, u = w(V);
162
+ u.displayName = "ToolGroup";
163
+ u.Root = m;
164
+ u.Trigger = v;
165
+ u.Content = f;
172
166
  export {
173
- i as ToolGroup,
167
+ u as ToolGroup,
174
168
  f as ToolGroupContent,
175
- c as ToolGroupRoot,
169
+ m as ToolGroupRoot,
176
170
  v as ToolGroupTrigger,
177
171
  U as toolGroupVariants
178
172
  };