@actioneer/ads 0.1.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.
Files changed (231) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ads-init.mjs +314 -0
  3. package/components/accordion.d.ts +13 -0
  4. package/components/accordion.js +91 -0
  5. package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
  6. package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
  7. package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
  8. package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
  9. package/components/agents-ui/react-shader-toy.d.ts +87 -0
  10. package/components/agents-ui/react-shader-toy.js +531 -0
  11. package/components/ai-elements/chain-of-thought.d.ts +30 -0
  12. package/components/ai-elements/chain-of-thought.js +182 -0
  13. package/components/ai-elements/index.d.ts +11 -0
  14. package/components/ai-elements/inline-citation.d.ts +44 -0
  15. package/components/ai-elements/inline-citation.js +314 -0
  16. package/components/ai-elements/message.d.ts +96 -0
  17. package/components/ai-elements/message.js +308 -0
  18. package/components/ai-elements/queue.d.ts +60 -0
  19. package/components/ai-elements/queue.js +193 -0
  20. package/components/ai-elements/reasoning.d.ts +26 -0
  21. package/components/ai-elements/reasoning.js +131 -0
  22. package/components/ai-elements/shimmer.d.ts +25 -0
  23. package/components/ai-elements/shimmer.js +44 -0
  24. package/components/ai-elements/speech-input.d.ts +16 -0
  25. package/components/ai-elements/speech-input.js +151 -0
  26. package/components/ai-elements/task-progress.d.ts +41 -0
  27. package/components/ai-elements/task-progress.js +211 -0
  28. package/components/ai-elements/task.d.ts +35 -0
  29. package/components/ai-elements/task.js +73 -0
  30. package/components/ai-elements/tool.d.ts +53 -0
  31. package/components/ai-elements/tool.js +116 -0
  32. package/components/ai-elements/voice.d.ts +74 -0
  33. package/components/ai-elements/voice.js +875 -0
  34. package/components/alert.d.ts +21 -0
  35. package/components/alert.js +76 -0
  36. package/components/answer.d.ts +984 -0
  37. package/components/answer.js +543 -0
  38. package/components/assistant-ui/action-bar.d.ts +3 -0
  39. package/components/assistant-ui/action-bar.js +57 -0
  40. package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
  41. package/components/assistant-ui/answer-tool-ui.js +42 -0
  42. package/components/assistant-ui/attachment.d.ts +50 -0
  43. package/components/assistant-ui/attachment.js +353 -0
  44. package/components/assistant-ui/badge.d.ts +11 -0
  45. package/components/assistant-ui/badge.js +54 -0
  46. package/components/assistant-ui/branch-picker.d.ts +3 -0
  47. package/components/assistant-ui/branch-picker.js +36 -0
  48. package/components/assistant-ui/chain-of-thought.d.ts +46 -0
  49. package/components/assistant-ui/composer-add-context.d.ts +50 -0
  50. package/components/assistant-ui/composer-add-context.js +209 -0
  51. package/components/assistant-ui/composer-deep-research.d.ts +16 -0
  52. package/components/assistant-ui/composer-deep-research.js +38 -0
  53. package/components/assistant-ui/composer-harness.d.ts +18 -0
  54. package/components/assistant-ui/composer-harness.js +186 -0
  55. package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
  56. package/components/assistant-ui/composer-trigger-popover.js +147 -0
  57. package/components/assistant-ui/composer.d.ts +8 -0
  58. package/components/assistant-ui/composer.js +276 -0
  59. package/components/assistant-ui/directive-text.d.ts +16 -0
  60. package/components/assistant-ui/directive-text.js +40 -0
  61. package/components/assistant-ui/error.d.ts +6 -0
  62. package/components/assistant-ui/error.js +39 -0
  63. package/components/assistant-ui/file.d.ts +37 -0
  64. package/components/assistant-ui/file.js +159 -0
  65. package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
  66. package/components/assistant-ui/follow-up-suggestions.js +44 -0
  67. package/components/assistant-ui/image.d.ts +46 -0
  68. package/components/assistant-ui/image.js +351 -0
  69. package/components/assistant-ui/index.d.ts +28 -0
  70. package/components/assistant-ui/markdown-text.d.ts +1 -0
  71. package/components/assistant-ui/markdown-text.js +242 -0
  72. package/components/assistant-ui/message-timing.d.ts +25 -0
  73. package/components/assistant-ui/message-timing.js +56 -0
  74. package/components/assistant-ui/message.d.ts +4 -0
  75. package/components/assistant-ui/message.js +159 -0
  76. package/components/assistant-ui/primitives.d.ts +2 -0
  77. package/components/assistant-ui/quote.d.ts +37 -0
  78. package/components/assistant-ui/quote.js +150 -0
  79. package/components/assistant-ui/reasoning.d.ts +44 -0
  80. package/components/assistant-ui/reasoning.js +261 -0
  81. package/components/assistant-ui/selection-toolbar.d.ts +29 -0
  82. package/components/assistant-ui/selection-toolbar.js +91 -0
  83. package/components/assistant-ui/smart-message-text.d.ts +15 -0
  84. package/components/assistant-ui/smart-message-text.js +29 -0
  85. package/components/assistant-ui/sources.d.ts +17 -0
  86. package/components/assistant-ui/sources.js +121 -0
  87. package/components/assistant-ui/suggestions.d.ts +7 -0
  88. package/components/assistant-ui/suggestions.js +19 -0
  89. package/components/assistant-ui/thread-context.d.ts +37 -0
  90. package/components/assistant-ui/thread-context.js +8 -0
  91. package/components/assistant-ui/thread.d.ts +5 -0
  92. package/components/assistant-ui/thread.js +77 -0
  93. package/components/assistant-ui/tool-fallback.d.ts +36 -0
  94. package/components/assistant-ui/tool-fallback.js +428 -0
  95. package/components/assistant-ui/tool-group.d.ts +33 -0
  96. package/components/assistant-ui/tool-group.js +173 -0
  97. package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
  98. package/components/assistant-ui/tooltip-icon-button.js +31 -0
  99. package/components/assistant-ui/voice.d.ts +18 -0
  100. package/components/autocomplete.d.ts +18 -0
  101. package/components/autocomplete.js +162 -0
  102. package/components/avatar.d.ts +26 -0
  103. package/components/avatar.js +92 -0
  104. package/components/badge.d.ts +10 -0
  105. package/components/badge.js +83 -0
  106. package/components/brand-loader.d.ts +16 -0
  107. package/components/brand-loader.js +64 -0
  108. package/components/breadcrumbs.d.ts +8 -0
  109. package/components/breadcrumbs.js +58 -0
  110. package/components/button.d.ts +13 -0
  111. package/components/button.js +100 -0
  112. package/components/card.d.ts +19 -0
  113. package/components/card.js +82 -0
  114. package/components/carousel.d.ts +31 -0
  115. package/components/carousel.js +351 -0
  116. package/components/chart.d.ts +165 -0
  117. package/components/chart.js +841 -0
  118. package/components/checkbox.d.ts +13 -0
  119. package/components/checkbox.js +84 -0
  120. package/components/chip.d.ts +13 -0
  121. package/components/chip.js +112 -0
  122. package/components/collapsible.d.ts +5 -0
  123. package/components/collapsible.js +31 -0
  124. package/components/connector-card.d.ts +62 -0
  125. package/components/connector-card.js +154 -0
  126. package/components/divider.d.ts +23 -0
  127. package/components/divider.js +69 -0
  128. package/components/drawer.d.ts +45 -0
  129. package/components/drawer.js +234 -0
  130. package/components/dropdown.d.ts +33 -0
  131. package/components/dropdown.js +198 -0
  132. package/components/empty-state.d.ts +8 -0
  133. package/components/empty-state.js +30 -0
  134. package/components/field.d.ts +20 -0
  135. package/components/field.js +74 -0
  136. package/components/index.d.ts +56 -0
  137. package/components/index.js +444 -0
  138. package/components/input-field.d.ts +22 -0
  139. package/components/input-field.js +91 -0
  140. package/components/input.d.ts +8 -0
  141. package/components/input.js +61 -0
  142. package/components/kbd.d.ts +6 -0
  143. package/components/kbd.js +26 -0
  144. package/components/link.d.ts +14 -0
  145. package/components/link.js +72 -0
  146. package/components/modal.d.ts +18 -0
  147. package/components/modal.js +156 -0
  148. package/components/navbar.d.ts +15 -0
  149. package/components/navbar.js +68 -0
  150. package/components/number-field.d.ts +11 -0
  151. package/components/number-field.js +89 -0
  152. package/components/pagination.d.ts +28 -0
  153. package/components/pagination.js +179 -0
  154. package/components/panel.d.ts +14 -0
  155. package/components/panel.js +71 -0
  156. package/components/pixel-blast-svg.d.ts +22 -0
  157. package/components/pixel-blast-svg.js +154 -0
  158. package/components/popover.d.ts +20 -0
  159. package/components/popover.js +101 -0
  160. package/components/progress-circle.d.ts +11 -0
  161. package/components/progress-circle.js +75 -0
  162. package/components/progress.d.ts +22 -0
  163. package/components/progress.js +66 -0
  164. package/components/radio.d.ts +16 -0
  165. package/components/radio.js +101 -0
  166. package/components/segmented.d.ts +16 -0
  167. package/components/segmented.js +103 -0
  168. package/components/select.d.ts +28 -0
  169. package/components/select.js +180 -0
  170. package/components/selection-action-bar.d.ts +11 -0
  171. package/components/selection-action-bar.js +59 -0
  172. package/components/sidebar.d.ts +118 -0
  173. package/components/sidebar.js +375 -0
  174. package/components/skeleton.d.ts +6 -0
  175. package/components/skeleton.js +26 -0
  176. package/components/slider.d.ts +11 -0
  177. package/components/slider.js +62 -0
  178. package/components/spinner.d.ts +11 -0
  179. package/components/spinner.js +62 -0
  180. package/components/switch.d.ts +7 -0
  181. package/components/switch.js +61 -0
  182. package/components/table.d.ts +59 -0
  183. package/components/table.js +254 -0
  184. package/components/tabs.d.ts +29 -0
  185. package/components/tabs.js +371 -0
  186. package/components/textarea.d.ts +5 -0
  187. package/components/textarea.js +24 -0
  188. package/components/timeline.d.ts +7 -0
  189. package/components/timeline.js +47 -0
  190. package/components/toast.d.ts +74 -0
  191. package/components/toast.js +211 -0
  192. package/components/tooltip.d.ts +11 -0
  193. package/components/tooltip.js +143 -0
  194. package/components/tree.d.ts +42 -0
  195. package/components/tree.js +86 -0
  196. package/components/typography.d.ts +33 -0
  197. package/components/typography.js +65 -0
  198. package/components/ui/avatar.d.ts +11 -0
  199. package/components/ui/avatar.js +56 -0
  200. package/components/ui/button.d.ts +10 -0
  201. package/components/ui/button.js +57 -0
  202. package/components/ui/collapsible.d.ts +5 -0
  203. package/components/ui/collapsible.js +35 -0
  204. package/components/ui/dialog.d.ts +17 -0
  205. package/components/ui/dialog.js +93 -0
  206. package/components/ui/tabs.d.ts +22 -0
  207. package/components/ui/tooltip.d.ts +7 -0
  208. package/components/ui/tooltip.js +56 -0
  209. package/fonts/aribau-grotesk-400.otf +0 -0
  210. package/fonts/aribau-grotesk-700.otf +0 -0
  211. package/fonts.css +21 -0
  212. package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
  213. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
  214. package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
  215. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
  216. package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
  217. package/lib/cn.d.ts +3 -0
  218. package/lib/cn.js +9 -0
  219. package/lib/icons.d.ts +378 -0
  220. package/lib/icons.js +119 -0
  221. package/lib/interactive.d.ts +24 -0
  222. package/lib/interactive.js +36 -0
  223. package/lib/motion.d.ts +58 -0
  224. package/lib/motion.js +70 -0
  225. package/lib/router.d.ts +3 -0
  226. package/lib/utils.d.ts +6 -0
  227. package/llms.txt +537 -0
  228. package/manifest.json +5085 -0
  229. package/package.json +60 -0
  230. package/styles.css +653 -0
  231. package/theme.css +273 -0
@@ -0,0 +1,276 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as f, Fragment as M } from "react/jsx-runtime";
3
+ import * as l from "react";
4
+ import { useContext as L } from "react";
5
+ import { ComposerAttachments as D, ComposerAddImage as I } from "./attachment.js";
6
+ import { ComposerAddContext as F } from "./composer-add-context.js";
7
+ import { ComposerHarness as B } from "./composer-harness.js";
8
+ import { ComposerQuotePreview as H } from "./quote.js";
9
+ import { ThreadComponentsContext as K } from "./thread-context.js";
10
+ import { TooltipIconButton as S } from "./tooltip-icon-button.js";
11
+ import { Button as N } from "../ui/button.js";
12
+ import { ComposerPrimitive as s, MessagePrimitive as j, unstable_useComposerInput as q, AuiIf as _ } from "@assistant-ui/react";
13
+ import { Mic as U, Stop as R, ArrowUp as Y } from "../../lib/icons.js";
14
+ const O = 24, Q = 850, V = 1800, X = 3e3;
15
+ function G(i) {
16
+ return Math.min(
17
+ V,
18
+ Math.max(Q, i.length * O)
19
+ );
20
+ }
21
+ function J(i, t, p, x, T) {
22
+ if (t <= 0 || i.length === 0)
23
+ return p(i), { promise: Promise.resolve(), cancel: () => {
24
+ } };
25
+ let w = 0, v, o;
26
+ return {
27
+ promise: new Promise((d) => {
28
+ o = d;
29
+ let y = performance.now(), h = null;
30
+ const n = (c) => {
31
+ if (x()) {
32
+ d();
33
+ return;
34
+ }
35
+ if (T()) {
36
+ h === null && (h = c), v = window.setTimeout(() => n(performance.now()), 100);
37
+ return;
38
+ }
39
+ h !== null && (y += c - h, h = null);
40
+ const a = Math.min(1, (c - y) / t), u = a >= 1 ? i.length : Math.floor(a * i.length);
41
+ if (p(i.slice(0, u)), a >= 1) {
42
+ d();
43
+ return;
44
+ }
45
+ w = requestAnimationFrame(n);
46
+ };
47
+ w = requestAnimationFrame(n);
48
+ }),
49
+ cancel: () => {
50
+ cancelAnimationFrame(w), v !== void 0 && window.clearTimeout(v), o();
51
+ }
52
+ };
53
+ }
54
+ const W = () => {
55
+ const { setText: i } = q(), t = l.useContext(k), [p, x] = l.useState(
56
+ (t == null ? void 0 : t[0]) ?? "Send a message…"
57
+ ), [T, w] = l.useState(!1), v = l.useRef(null), [o, z] = l.useState(null), d = l.useRef(!1), y = l.useCallback((n) => {
58
+ v.current = n, z(n);
59
+ }, []);
60
+ l.useEffect(() => {
61
+ if (!o) return;
62
+ let n = 0;
63
+ const c = (r) => {
64
+ d.current = r || document.activeElement === o, w(r);
65
+ }, a = () => {
66
+ const r = o.value.length > 0;
67
+ c(r);
68
+ }, u = () => {
69
+ window.clearTimeout(n), n = window.setTimeout(a, 0);
70
+ }, g = () => {
71
+ d.current = o.value.length > 0 || document.activeElement === o;
72
+ }, E = (r, m) => {
73
+ i(r), o.value = r, o.dispatchEvent(new Event("input", { bubbles: !0 })), c(r.length > 0), window.setTimeout(() => {
74
+ document.activeElement === o && o.setSelectionRange(m, m);
75
+ }, 0);
76
+ }, P = (r) => {
77
+ const m = o.selectionStart ?? 0, A = o.selectionEnd ?? m;
78
+ return m === A || r.inputType !== "deleteContentBackward" && r.inputType !== "deleteContentForward" && r.inputType !== "deleteByCut" ? !1 : (r.preventDefault(), E(
79
+ o.value.slice(0, m) + o.value.slice(A),
80
+ m
81
+ ), !0);
82
+ }, C = (r) => {
83
+ if (!r.isComposing && !P(r)) {
84
+ if (typeof r.data == "string" && r.data.length > 0) {
85
+ c(!0);
86
+ return;
87
+ }
88
+ u();
89
+ }
90
+ }, b = (r) => {
91
+ (r.metaKey || r.ctrlKey) && !r.altKey && r.key.toLowerCase() === "a" && (r.preventDefault(), o.select());
92
+ };
93
+ return a(), o.addEventListener("beforeinput", C), o.addEventListener("input", a), o.addEventListener("focus", g), o.addEventListener("blur", g), o.addEventListener("keydown", b), () => {
94
+ window.clearTimeout(n), o.removeEventListener("beforeinput", C), o.removeEventListener("input", a), o.removeEventListener("focus", g), o.removeEventListener("blur", g), o.removeEventListener("keydown", b);
95
+ };
96
+ }, [o, i]), l.useEffect(() => {
97
+ var C;
98
+ if (!(t != null && t.length)) {
99
+ x("Send a message…");
100
+ return;
101
+ }
102
+ if ((C = window.matchMedia) != null && C.call(window, "(prefers-reduced-motion: reduce)").matches) {
103
+ x(t[0]);
104
+ return;
105
+ }
106
+ let n = !1, c = 0, a, u;
107
+ const g = (b) => new Promise((r) => {
108
+ a = window.setTimeout(r, b);
109
+ }), E = () => n;
110
+ return (async () => {
111
+ for (; !n; ) {
112
+ for (; d.current && !n; ) await g(100);
113
+ if (n) return;
114
+ const b = t[c];
115
+ x("");
116
+ const { promise: r, cancel: m } = J(
117
+ b,
118
+ G(b),
119
+ x,
120
+ E,
121
+ () => d.current
122
+ );
123
+ if (u = m, await r, u = void 0, n) return;
124
+ if (!d.current) {
125
+ if (await g(X), n) return;
126
+ c = (c + 1) % t.length;
127
+ }
128
+ }
129
+ })(), () => {
130
+ n = !0, u == null || u(), a && window.clearTimeout(a);
131
+ };
132
+ }, [t]);
133
+ const h = !!(t != null && t.length) && !T;
134
+ return /* @__PURE__ */ f("div", { className: "group/input relative", children: [
135
+ h && /* @__PURE__ */ e(
136
+ "div",
137
+ {
138
+ "aria-hidden": !0,
139
+ className: "pointer-events-none absolute inset-x-2.5 top-1 z-0 flex min-h-8 items-start overflow-hidden text-base leading-8 text-muted-foreground/80 group-focus-within/input:hidden",
140
+ children: /* @__PURE__ */ e("span", { children: p })
141
+ }
142
+ ),
143
+ /* @__PURE__ */ e(
144
+ s.Input,
145
+ {
146
+ ref: y,
147
+ placeholder: t != null && t.length ? "" : p,
148
+ className: "aui-composer-input caret-primary placeholder:text-muted-foreground/80 relative z-10 max-h-32 min-h-10 w-full resize-none bg-transparent px-2.5 py-1 text-base text-foreground outline-none",
149
+ rows: 1,
150
+ autoFocus: !0,
151
+ enterKeyHint: "send",
152
+ "aria-label": "Message input"
153
+ }
154
+ )
155
+ ] });
156
+ }, k = l.createContext(
157
+ void 0
158
+ );
159
+ function ue({
160
+ prompts: i,
161
+ children: t
162
+ }) {
163
+ return /* @__PURE__ */ e(k.Provider, { value: i, children: t });
164
+ }
165
+ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root animate-in fade-in slide-in-from-bottom-2 fill-mode-both relative flex w-full flex-col duration-(--duration-normal) delay-(--stagger-3)", children: /* @__PURE__ */ e(s.Unstable_TriggerPopoverRoot, { children: /* @__PURE__ */ e(s.AttachmentDropzone, { asChild: !0, children: /* @__PURE__ */ f(
166
+ "div",
167
+ {
168
+ "data-slot": "aui_composer-shell",
169
+ onMouseDown: (i) => {
170
+ var p;
171
+ i.target.closest("button, a, input, textarea, [role='button']") || (p = i.currentTarget.querySelector("textarea")) == null || p.focus();
172
+ },
173
+ className: "border-border/60 data-[dragging=true]:border-ring focus-within:border-border dark:border-muted-foreground/15 dark:focus-within:border-muted-foreground/30 relative flex w-full flex-col gap-2 rounded-(--composer-radius) border bg-(--composer-bg) p-(--composer-padding) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)] transition-[border-color,box-shadow] focus-within:shadow-[0_6px_24px_-8px_rgba(0,0,0,0.12),0_1px_2px_rgba(0,0,0,0.05)] data-[dragging=true]:border-dashed data-[dragging=true]:bg-[color-mix(in_oklab,var(--color-accent)_50%,var(--color-background))] dark:shadow-none",
174
+ children: [
175
+ /* @__PURE__ */ e(H, { className: "mx-0 mt-0" }),
176
+ /* @__PURE__ */ e(D, {}),
177
+ /* @__PURE__ */ e(W, {}),
178
+ /* @__PURE__ */ e(Z, {})
179
+ ]
180
+ }
181
+ ) }) }) }), Z = () => {
182
+ const { ComposerAccessories: i = $ } = L(K);
183
+ return /* @__PURE__ */ f("div", { className: "aui-composer-action-wrapper relative flex items-center justify-between", children: [
184
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ e(i, {}) }),
185
+ /* @__PURE__ */ f("div", { className: "flex items-center gap-1.5", children: [
186
+ /* @__PURE__ */ f(_, { condition: (t) => t.thread.capabilities.dictation, children: [
187
+ /* @__PURE__ */ e(_, { condition: (t) => t.composer.dictation == null, children: /* @__PURE__ */ e(s.Dictate, { asChild: !0, children: /* @__PURE__ */ e(
188
+ S,
189
+ {
190
+ tooltip: "Voice input",
191
+ side: "bottom",
192
+ type: "button",
193
+ variant: "ghost",
194
+ size: "icon",
195
+ className: "aui-composer-dictate size-7 rounded-full",
196
+ "aria-label": "Start voice input",
197
+ children: /* @__PURE__ */ e(U, { className: "aui-composer-dictate-icon size-4" })
198
+ }
199
+ ) }) }),
200
+ /* @__PURE__ */ e(_, { condition: (t) => t.composer.dictation != null, children: /* @__PURE__ */ e(s.StopDictation, { asChild: !0, children: /* @__PURE__ */ e(
201
+ S,
202
+ {
203
+ tooltip: "Stop dictation",
204
+ side: "bottom",
205
+ type: "button",
206
+ variant: "ghost",
207
+ size: "icon",
208
+ className: "aui-composer-stop-dictation text-destructive size-7 rounded-full",
209
+ "aria-label": "Stop voice input",
210
+ children: /* @__PURE__ */ e(R, { className: "aui-composer-stop-dictation-icon size-3.5 animate-pulse fill-current" })
211
+ }
212
+ ) }) })
213
+ ] }),
214
+ /* @__PURE__ */ e(_, { condition: (t) => !t.thread.isRunning, children: /* @__PURE__ */ e(s.Send, { asChild: !0, children: /* @__PURE__ */ e(
215
+ S,
216
+ {
217
+ tooltip: "Send message",
218
+ side: "bottom",
219
+ type: "button",
220
+ variant: "default",
221
+ size: "icon",
222
+ className: "aui-composer-send size-7 rounded-full",
223
+ "aria-label": "Send message",
224
+ children: /* @__PURE__ */ e(Y, { className: "aui-composer-send-icon size-4.5" })
225
+ }
226
+ ) }) }),
227
+ /* @__PURE__ */ e(_, { condition: (t) => t.thread.isRunning, children: /* @__PURE__ */ e(s.Cancel, { asChild: !0, children: /* @__PURE__ */ e(
228
+ N,
229
+ {
230
+ type: "button",
231
+ variant: "default",
232
+ size: "icon",
233
+ className: "aui-composer-cancel size-7 rounded-full",
234
+ "aria-label": "Stop generating",
235
+ children: /* @__PURE__ */ e(R, { className: "aui-composer-cancel-icon size-3.5 fill-current" })
236
+ }
237
+ ) }) })
238
+ ] })
239
+ ] });
240
+ }, $ = () => /* @__PURE__ */ f(M, { children: [
241
+ /* @__PURE__ */ e(F, {}),
242
+ /* @__PURE__ */ e(I, {}),
243
+ /* @__PURE__ */ e(B, {})
244
+ ] }), pe = () => /* @__PURE__ */ e(
245
+ j.Root,
246
+ {
247
+ "data-slot": "aui_edit-composer-wrapper",
248
+ className: "flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
249
+ children: /* @__PURE__ */ f(s.Root, { className: "aui-edit-composer-root border-border/60 dark:border-muted-foreground/15 ms-auto flex w-full max-w-[85%] flex-col rounded-(--composer-radius) border bg-(--composer-bg) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)] dark:shadow-none", children: [
250
+ /* @__PURE__ */ e(
251
+ s.Input,
252
+ {
253
+ className: "aui-edit-composer-input text-foreground min-h-14 w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none",
254
+ autoFocus: !0
255
+ }
256
+ ),
257
+ /* @__PURE__ */ f("div", { className: "aui-edit-composer-footer mx-2.5 mb-2.5 flex items-center gap-1.5 self-end", children: [
258
+ /* @__PURE__ */ e(s.Cancel, { asChild: !0, children: /* @__PURE__ */ e(
259
+ N,
260
+ {
261
+ variant: "ghost",
262
+ size: "sm",
263
+ className: "h-8 rounded-full px-3.5",
264
+ children: "Cancel"
265
+ }
266
+ ) }),
267
+ /* @__PURE__ */ e(s.Send, { asChild: !0, children: /* @__PURE__ */ e(N, { size: "sm", className: "h-8 rounded-full px-3.5", children: "Update" }) })
268
+ ] })
269
+ ] })
270
+ }
271
+ );
272
+ export {
273
+ me as Composer,
274
+ ue as ComposerPlaceholdersProvider,
275
+ pe as EditComposer
276
+ };
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ import { TextMessagePartComponent, Unstable_DirectiveFormatter } from '@assistant-ui/react';
3
+ type IconComponent = FC<{
4
+ className?: string;
5
+ }>;
6
+ export type CreateDirectiveTextOptions = {
7
+ /** Maps a directive `type` to an icon component. */
8
+ iconMap?: Record<string, IconComponent>;
9
+ /** Icon rendered when `iconMap` has no entry for the segment type. */
10
+ fallbackIcon?: IconComponent;
11
+ };
12
+ /** Creates a `Text` message part component that parses directive syntax and renders inline chips. */
13
+ export declare function createDirectiveText(formatter: Unstable_DirectiveFormatter, options?: CreateDirectiveTextOptions): TextMessagePartComponent;
14
+ /** `Text` message part component that renders directive syntax as inline chips. */
15
+ export declare const DirectiveText: TextMessagePartComponent;
16
+ export {};
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { jsx as r, Fragment as d, jsxs as p } from "react/jsx-runtime";
3
+ import { memo as x } from "react";
4
+ import { unstable_defaultDirectiveFormatter as v } from "@assistant-ui/react";
5
+ import { Badge as u } from "./badge.js";
6
+ function o(s, t) {
7
+ const a = t == null ? void 0 : t.iconMap, f = t == null ? void 0 : t.fallbackIcon, c = ({ text: n }) => {
8
+ const i = s.parse(n);
9
+ return i.length === 1 && i[0].kind === "text" ? /* @__PURE__ */ r(d, { children: n }) : /* @__PURE__ */ r(d, { children: i.map((e, l) => {
10
+ if (e.kind === "text")
11
+ return /* @__PURE__ */ r("span", { className: "whitespace-pre-wrap", children: e.text }, l);
12
+ const m = (a == null ? void 0 : a[e.type]) ?? f;
13
+ return /* @__PURE__ */ p(
14
+ u,
15
+ {
16
+ variant: "info",
17
+ size: "sm",
18
+ "data-slot": "directive-text-chip",
19
+ "data-directive-type": e.type,
20
+ "data-directive-id": e.id,
21
+ "aria-label": `${e.type}: ${e.label}`,
22
+ className: "aui-directive-chip items-baseline text-[13px] leading-none [&_svg]:self-center",
23
+ children: [
24
+ m && /* @__PURE__ */ r(m, {}),
25
+ e.label
26
+ ]
27
+ },
28
+ l
29
+ );
30
+ }) });
31
+ };
32
+ return c.displayName = "DirectiveText", c;
33
+ }
34
+ const h = o(
35
+ v
36
+ ), I = x(h);
37
+ export {
38
+ I as DirectiveText,
39
+ o as createDirectiveText
40
+ };
@@ -0,0 +1,6 @@
1
+ import { ErrorPrimitive } from '@assistant-ui/react';
2
+ import { ComponentProps, FC } from 'react';
3
+ export declare function ErrorRoot({ className, ...props }: ComponentProps<typeof ErrorPrimitive.Root>): import("react").JSX.Element;
4
+ export declare function ErrorText({ className, ...props }: ComponentProps<typeof ErrorPrimitive.Message>): import("react").JSX.Element;
5
+ /** Renders the message's error (if any) as a destructive banner. */
6
+ export declare const MessageError: FC;
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { ErrorPrimitive as o, MessagePrimitive as i } from "@assistant-ui/react";
4
+ import { cn as s } from "../../lib/cn.js";
5
+ function a({
6
+ className: e,
7
+ ...t
8
+ }) {
9
+ return /* @__PURE__ */ r(
10
+ o.Root,
11
+ {
12
+ "data-slot": "error-root",
13
+ className: s(
14
+ "aui-message-error-root border-destructive bg-destructive/10 text-destructive dark:bg-destructive/5 mt-2 rounded-md border p-3 text-xs dark:text-red-200",
15
+ e
16
+ ),
17
+ ...t
18
+ }
19
+ );
20
+ }
21
+ function d({
22
+ className: e,
23
+ ...t
24
+ }) {
25
+ return /* @__PURE__ */ r(
26
+ o.Message,
27
+ {
28
+ "data-slot": "error-text",
29
+ className: s("aui-message-error-message line-clamp-2", e),
30
+ ...t
31
+ }
32
+ );
33
+ }
34
+ const u = () => /* @__PURE__ */ r(i.Error, { children: /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(d, {}) }) });
35
+ export {
36
+ a as ErrorRoot,
37
+ d as ErrorText,
38
+ u as MessageError
39
+ };
@@ -0,0 +1,37 @@
1
+ import { FC } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { FileMessagePartComponent } from '@assistant-ui/react';
4
+ declare const fileVariants: (props?: ({
5
+ variant?: "muted" | "outline" | "ghost" | null | undefined;
6
+ size?: "default" | "sm" | "lg" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ declare function getMimeTypeIcon(mimeType: string): FC<{
9
+ className?: string;
10
+ }>;
11
+ declare function getBase64Size(base64: string): number;
12
+ declare function formatFileSize(bytes: number): string;
13
+ export type FileRootProps = React.ComponentProps<"div"> & VariantProps<typeof fileVariants>;
14
+ declare function FileRoot({ className, variant, size, children, ...props }: FileRootProps): import("react").JSX.Element;
15
+ type FileIconDisplayProps = React.ComponentProps<"span"> & {
16
+ mimeType?: string;
17
+ };
18
+ declare function FileIconDisplay({ mimeType, className, children, ...props }: FileIconDisplayProps): import("react").JSX.Element;
19
+ declare function FileName({ className, children, ...props }: React.ComponentProps<"span">): import("react").JSX.Element;
20
+ type FileSizeProps = React.ComponentProps<"span"> & {
21
+ bytes: number;
22
+ };
23
+ declare function FileSize({ bytes, className, ...props }: FileSizeProps): import("react").JSX.Element;
24
+ type FileDownloadProps = Omit<React.ComponentProps<"a">, "href"> & {
25
+ data: string;
26
+ mimeType: string;
27
+ filename?: string;
28
+ };
29
+ declare function FileDownload({ data, mimeType, filename, className, children, ...props }: FileDownloadProps): import("react").JSX.Element;
30
+ declare const File: FileMessagePartComponent & {
31
+ Root: typeof FileRoot;
32
+ Icon: typeof FileIconDisplay;
33
+ Name: typeof FileName;
34
+ Size: typeof FileSize;
35
+ Download: typeof FileDownload;
36
+ };
37
+ export { File, FileRoot, FileIconDisplay, FileName, FileSize, FileDownload, fileVariants, getMimeTypeIcon, getBase64Size, formatFileSize, };
@@ -0,0 +1,159 @@
1
+ "use client";
2
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
3
+ import { memo as F } from "react";
4
+ import { cva as v } from "class-variance-authority";
5
+ import { File as c, Download as N, Image as z, FileText as d, Braces as w, Music as I, Video as b } from "../../lib/icons.js";
6
+ import { cn as s } from "../../lib/cn.js";
7
+ const $ = v(
8
+ "aui-file-root inline-flex items-center gap-3 rounded-lg transition-colors",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ outline: "border-border hover:bg-muted/50 border",
13
+ ghost: "hover:bg-muted/50",
14
+ muted: "bg-muted/50 hover:bg-muted/70"
15
+ },
16
+ size: {
17
+ sm: "px-2.5 py-1.5 text-xs",
18
+ default: "px-3 py-2 text-sm",
19
+ lg: "px-4 py-3 text-base"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ variant: "outline",
24
+ size: "default"
25
+ }
26
+ }
27
+ );
28
+ function B(t) {
29
+ return t.startsWith("image/") ? z : t === "application/pdf" ? d : t === "application/json" ? w : t.startsWith("text/") ? d : t.startsWith("audio/") ? I : t.startsWith("video/") ? b : c;
30
+ }
31
+ function D(t) {
32
+ const e = t.indexOf(","), n = e >= 0 ? t.slice(e + 1) : t, r = (n.match(/=/g) || []).length;
33
+ return Math.floor(n.length * 3 / 4) - r;
34
+ }
35
+ function W(t) {
36
+ return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
37
+ }
38
+ function u({
39
+ className: t,
40
+ variant: e,
41
+ size: n,
42
+ children: r,
43
+ ...a
44
+ }) {
45
+ return /* @__PURE__ */ o(
46
+ "div",
47
+ {
48
+ "data-slot": "file-root",
49
+ "data-variant": e,
50
+ "data-size": n,
51
+ className: s($({ variant: e, size: n, className: t })),
52
+ ...a,
53
+ children: r
54
+ }
55
+ );
56
+ }
57
+ function f({
58
+ mimeType: t,
59
+ className: e,
60
+ children: n,
61
+ ...r
62
+ }) {
63
+ const a = t ? B(t) : c;
64
+ return /* @__PURE__ */ o(
65
+ "span",
66
+ {
67
+ "data-slot": "file-icon",
68
+ className: s("text-muted-foreground shrink-0", e),
69
+ ...r,
70
+ children: n ?? /* @__PURE__ */ o(a, { className: "size-5" })
71
+ }
72
+ );
73
+ }
74
+ function m({
75
+ className: t,
76
+ children: e,
77
+ ...n
78
+ }) {
79
+ return /* @__PURE__ */ o(
80
+ "span",
81
+ {
82
+ "data-slot": "file-name",
83
+ className: s("min-w-0 flex-1 truncate font-medium", t),
84
+ ...n,
85
+ children: e || "Unnamed file"
86
+ }
87
+ );
88
+ }
89
+ function x({ bytes: t, className: e, ...n }) {
90
+ return /* @__PURE__ */ o(
91
+ "span",
92
+ {
93
+ "data-slot": "file-size",
94
+ className: s("text-muted-foreground shrink-0", e),
95
+ ...n,
96
+ children: W(t)
97
+ }
98
+ );
99
+ }
100
+ function h({
101
+ data: t,
102
+ mimeType: e,
103
+ filename: n,
104
+ className: r,
105
+ children: a,
106
+ ...g
107
+ }) {
108
+ const p = t.startsWith("data:") ? t : `data:${e};base64,${t}`;
109
+ return /* @__PURE__ */ o(
110
+ "a",
111
+ {
112
+ "data-slot": "file-download",
113
+ href: p,
114
+ download: n || "download",
115
+ className: s(
116
+ "text-muted-foreground hover:bg-accent hover:text-accent-foreground shrink-0 rounded-md p-1 transition-colors",
117
+ r
118
+ ),
119
+ ...g,
120
+ children: a || /* @__PURE__ */ o(N, { className: "size-4" })
121
+ }
122
+ );
123
+ }
124
+ const M = ({ filename: t, data: e, mimeType: n }) => {
125
+ const r = D(e);
126
+ return /* @__PURE__ */ l(u, { children: [
127
+ /* @__PURE__ */ o(f, { mimeType: n }),
128
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
129
+ /* @__PURE__ */ o(m, { children: t }),
130
+ /* @__PURE__ */ o(x, { bytes: r, className: "text-xs" })
131
+ ] }),
132
+ /* @__PURE__ */ o(
133
+ h,
134
+ {
135
+ data: e,
136
+ mimeType: n,
137
+ ...t !== void 0 && { filename: t }
138
+ }
139
+ )
140
+ ] });
141
+ }, i = F(M);
142
+ i.displayName = "File";
143
+ i.Root = u;
144
+ i.Icon = f;
145
+ i.Name = m;
146
+ i.Size = x;
147
+ i.Download = h;
148
+ export {
149
+ i as File,
150
+ h as FileDownload,
151
+ f as FileIconDisplay,
152
+ m as FileName,
153
+ u as FileRoot,
154
+ x as FileSize,
155
+ $ as fileVariants,
156
+ W as formatFileSize,
157
+ D as getBase64Size,
158
+ B as getMimeTypeIcon
159
+ };
@@ -0,0 +1,7 @@
1
+ import { ButtonProps } from '../button';
2
+ import * as React from "react";
3
+ export interface FollowUpSuggestionProps extends Omit<ButtonProps, "size" | "variant"> {
4
+ }
5
+ /** Shared follow-up prompt button used both in answers and above the composer. */
6
+ export declare const FollowUpSuggestion: React.ForwardRefExoticComponent<FollowUpSuggestionProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export declare const ThreadFollowupSuggestions: React.FC;
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { jsx as o } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { useAuiState as s, AuiIf as a, ThreadPrimitive as u } from "@assistant-ui/react";
5
+ import { Button as l } from "../button.js";
6
+ import { cn as d } from "../../lib/cn.js";
7
+ const i = n.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ o(
8
+ l,
9
+ {
10
+ ref: r,
11
+ size: "xs",
12
+ variant: "outline",
13
+ className: d(
14
+ "aui-thread-followup-suggestion rounded-full border-border/60 bg-background px-3 font-normal hover:bg-muted/80",
15
+ t
16
+ ),
17
+ ...e
18
+ }
19
+ ));
20
+ i.displayName = "FollowUpSuggestion";
21
+ const h = () => {
22
+ const t = s((e) => e.thread.suggestions);
23
+ return /* @__PURE__ */ o(
24
+ a,
25
+ {
26
+ condition: (e) => !e.thread.isEmpty && !e.thread.isRunning && e.thread.suggestions.length > 0,
27
+ children: /* @__PURE__ */ o("div", { className: "aui-thread-followup-suggestions flex min-h-8 items-center justify-center gap-2", children: t.map((e, r) => /* @__PURE__ */ o(
28
+ u.Suggestion,
29
+ {
30
+ prompt: e.prompt,
31
+ method: "replace",
32
+ autoSend: !0,
33
+ asChild: !0,
34
+ children: /* @__PURE__ */ o(i, { children: e.prompt })
35
+ },
36
+ r
37
+ )) })
38
+ }
39
+ );
40
+ };
41
+ export {
42
+ i as FollowUpSuggestion,
43
+ h as ThreadFollowupSuggestions
44
+ };
@@ -0,0 +1,46 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { ImageMessagePart, ImageMessagePartComponent } from '@assistant-ui/react';
4
+ declare const imageVariants: (props?: ({
5
+ variant?: "muted" | "outline" | "ghost" | null | undefined;
6
+ size?: "default" | "sm" | "lg" | "full" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ export type ImageRootProps = React.ComponentProps<"div"> & VariantProps<typeof imageVariants>;
9
+ declare function ImageRoot({ className, variant, size, children, ...props }: ImageRootProps): import("react").JSX.Element;
10
+ type ImagePreviewProps = Omit<React.ComponentProps<"img">, "children"> & {
11
+ containerClassName?: string;
12
+ };
13
+ declare function ImagePreview({ className, containerClassName, onLoad, onError, alt, src, ...props }: ImagePreviewProps): import("react").JSX.Element;
14
+ declare function ImageFilename({ className, children, ...props }: React.ComponentProps<"span">): import("react").JSX.Element | null;
15
+ type ImageZoomProps = PropsWithChildren<{
16
+ src: string;
17
+ alt?: string;
18
+ }>;
19
+ declare function ImageZoom({ src, alt, children }: ImageZoomProps): import("react").JSX.Element;
20
+ declare function ImageGenerating({ className }: {
21
+ className?: string;
22
+ }): import("react").JSX.Element;
23
+ declare function ImageContentFilterError({ className, reason, }: {
24
+ className?: string;
25
+ reason?: string;
26
+ }): import("react").JSX.Element;
27
+ export type ImageActionsProps = {
28
+ part: ImageMessagePart;
29
+ /**
30
+ * Wire to your own generation call to show a regenerate button. The button
31
+ * renders only when this is set and the part carries a `prompt`.
32
+ */
33
+ onRegenerate?: () => void | Promise<void>;
34
+ className?: string;
35
+ };
36
+ declare function ImageActions({ part, onRegenerate, className }: ImageActionsProps): import("react").JSX.Element;
37
+ declare const Image: ImageMessagePartComponent & {
38
+ Root: typeof ImageRoot;
39
+ Preview: typeof ImagePreview;
40
+ Filename: typeof ImageFilename;
41
+ Zoom: typeof ImageZoom;
42
+ Actions: typeof ImageActions;
43
+ Generating: typeof ImageGenerating;
44
+ ContentFilterError: typeof ImageContentFilterError;
45
+ };
46
+ export { Image, ImageRoot, ImagePreview, ImageFilename, ImageZoom, ImageActions, ImageGenerating, ImageContentFilterError, imageVariants, };