@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,182 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as d } from "react/jsx-runtime";
3
+ import { Badge as C } from "../badge.js";
4
+ import { Collapsible as p, CollapsibleTrigger as N, CollapsibleContent as O } from "../collapsible.js";
5
+ import { Brain as v, ChevronDown as y } from "../../lib/icons.js";
6
+ import { cn as i } from "../../lib/cn.js";
7
+ import { createContext as T, memo as c, useMemo as b, useState as w, useRef as S, useCallback as z, useContext as j } from "react";
8
+ function R({
9
+ prop: e,
10
+ defaultProp: a,
11
+ onChange: n
12
+ }) {
13
+ const [s, r] = w(a), l = e !== void 0, h = l ? e : s, o = S(n);
14
+ o.current = n;
15
+ const u = z(
16
+ (m) => {
17
+ var f;
18
+ l || r(m), (f = o.current) == null || f.call(o, m);
19
+ },
20
+ [l]
21
+ );
22
+ return [h, u];
23
+ }
24
+ const g = T(
25
+ null
26
+ ), x = () => {
27
+ const e = j(g);
28
+ if (!e)
29
+ throw new Error(
30
+ "ChainOfThought components must be used within ChainOfThought"
31
+ );
32
+ return e;
33
+ }, I = c(
34
+ ({
35
+ className: e,
36
+ open: a,
37
+ defaultOpen: n = !1,
38
+ onOpenChange: s,
39
+ children: r,
40
+ ...l
41
+ }) => {
42
+ const [h, o] = R({
43
+ prop: a,
44
+ defaultProp: n,
45
+ onChange: s
46
+ }), u = b(
47
+ () => ({ isOpen: h, setIsOpen: o }),
48
+ [h, o]
49
+ );
50
+ return /* @__PURE__ */ t(g.Provider, { value: u, children: /* @__PURE__ */ t("div", { className: i("max-w-prose space-y-4", e), ...l, children: r }) });
51
+ }
52
+ ), B = c(
53
+ ({ className: e, children: a, ...n }) => {
54
+ const { isOpen: s, setIsOpen: r } = x();
55
+ return /* @__PURE__ */ t(p, { onOpenChange: r, open: s, children: /* @__PURE__ */ d(
56
+ N,
57
+ {
58
+ className: i(
59
+ "flex w-full items-center gap-2 text-base text-secondary transition-colors hover:text-foreground",
60
+ e
61
+ ),
62
+ ...n,
63
+ children: [
64
+ /* @__PURE__ */ t(v, { className: "size-4" }),
65
+ /* @__PURE__ */ t("span", { className: "flex-1 text-left", children: a ?? "Chain of Thought" }),
66
+ /* @__PURE__ */ t(
67
+ y,
68
+ {
69
+ className: i(
70
+ "size-4 transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
71
+ s ? "rotate-180" : "rotate-0"
72
+ )
73
+ }
74
+ )
75
+ ]
76
+ }
77
+ ) });
78
+ }
79
+ ), H = c(
80
+ ({
81
+ className: e,
82
+ icon: a,
83
+ label: n,
84
+ description: s,
85
+ status: r = "complete",
86
+ children: l,
87
+ ...h
88
+ }) => /* @__PURE__ */ d(
89
+ "div",
90
+ {
91
+ className: i(
92
+ "flex gap-2 text-base",
93
+ {
94
+ complete: "text-secondary",
95
+ active: "text-primary",
96
+ pending: "text-tertiary/60"
97
+ }[r],
98
+ "fade-in-0 slide-in-from-top-2 animate-in motion-reduce:animate-none",
99
+ e
100
+ ),
101
+ ...h,
102
+ children: [
103
+ /* @__PURE__ */ d("div", { className: "relative mt-0.5", children: [
104
+ a ? /* @__PURE__ */ t(a, { className: "size-4" }) : (
105
+ // ADS status markers are square (principle 6), not a filled dot.
106
+ /* @__PURE__ */ t(
107
+ "span",
108
+ {
109
+ "aria-hidden": !0,
110
+ className: "flex size-4 items-center justify-center",
111
+ children: /* @__PURE__ */ t("span", { className: "size-1.5 rounded-dot bg-current" })
112
+ }
113
+ )
114
+ ),
115
+ /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-1/2 top-7 w-px -translate-x-1/2 bg-border" })
116
+ ] }),
117
+ /* @__PURE__ */ d("div", { className: "flex-1 space-y-2 overflow-hidden", children: [
118
+ /* @__PURE__ */ t("div", { children: n }),
119
+ s && /* @__PURE__ */ t("div", { className: "text-xs text-tertiary", children: s }),
120
+ l
121
+ ] })
122
+ ]
123
+ }
124
+ )
125
+ ), P = c(
126
+ ({ className: e, ...a }) => /* @__PURE__ */ t(
127
+ "div",
128
+ {
129
+ className: i("flex flex-wrap items-center gap-2", e),
130
+ ...a
131
+ }
132
+ )
133
+ ), k = c(
134
+ ({ className: e, children: a, ...n }) => /* @__PURE__ */ t(
135
+ C,
136
+ {
137
+ className: i("gap-1 font-normal", e),
138
+ color: "default",
139
+ variant: "soft",
140
+ ...n,
141
+ children: a
142
+ }
143
+ )
144
+ ), D = c(
145
+ ({ className: e, children: a, ...n }) => {
146
+ const { isOpen: s } = x();
147
+ return /* @__PURE__ */ t(p, { open: s, children: /* @__PURE__ */ t(
148
+ O,
149
+ {
150
+ className: i(
151
+ "mt-2 space-y-3",
152
+ "text-foreground outline-none",
153
+ "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none",
154
+ e
155
+ ),
156
+ ...n,
157
+ children: a
158
+ }
159
+ ) });
160
+ }
161
+ ), E = c(
162
+ ({ className: e, children: a, caption: n, ...s }) => /* @__PURE__ */ d("div", { className: i("mt-2 space-y-2", e), ...s, children: [
163
+ /* @__PURE__ */ t("div", { className: "relative flex max-h-88 items-center justify-center overflow-hidden rounded-lg bg-muted p-3", children: a }),
164
+ n && /* @__PURE__ */ t("p", { className: "text-xs text-tertiary", children: n })
165
+ ] })
166
+ );
167
+ I.displayName = "ChainOfThought";
168
+ B.displayName = "ChainOfThoughtHeader";
169
+ H.displayName = "ChainOfThoughtStep";
170
+ P.displayName = "ChainOfThoughtSearchResults";
171
+ k.displayName = "ChainOfThoughtSearchResult";
172
+ D.displayName = "ChainOfThoughtContent";
173
+ E.displayName = "ChainOfThoughtImage";
174
+ export {
175
+ I as ChainOfThought,
176
+ D as ChainOfThoughtContent,
177
+ B as ChainOfThoughtHeader,
178
+ E as ChainOfThoughtImage,
179
+ k as ChainOfThoughtSearchResult,
180
+ P as ChainOfThoughtSearchResults,
181
+ H as ChainOfThoughtStep
182
+ };
@@ -0,0 +1,11 @@
1
+ export * from './chain-of-thought';
2
+ export * from './inline-citation';
3
+ export * from './message';
4
+ export * from './queue';
5
+ export * from './reasoning';
6
+ export * from './shimmer';
7
+ export * from './speech-input';
8
+ export * from './task';
9
+ export * from './task-progress';
10
+ export * from './tool';
11
+ export * from './voice';
@@ -0,0 +1,44 @@
1
+ import { BadgeProps } from '../badge';
2
+ import * as React from "react";
3
+ export type InlineCitationProps = React.ComponentProps<"span">;
4
+ export declare const InlineCitation: ({ className, ...props }: InlineCitationProps) => React.JSX.Element;
5
+ export type InlineCitationTextProps = React.ComponentProps<"span">;
6
+ export declare const InlineCitationText: ({ className, ...props }: InlineCitationTextProps) => React.JSX.Element;
7
+ export interface InlineCitationCardProps {
8
+ children?: React.ReactNode;
9
+ /** Controlled open state. */
10
+ open?: boolean;
11
+ defaultOpen?: boolean;
12
+ onOpenChange?: (open: boolean) => void;
13
+ openDelay?: number;
14
+ closeDelay?: number;
15
+ }
16
+ export declare const InlineCitationCard: ({ children, open: openProp, defaultOpen, onOpenChange, openDelay, closeDelay, }: InlineCitationCardProps) => React.JSX.Element;
17
+ export type InlineCitationCardTriggerProps = BadgeProps & {
18
+ sources: string[];
19
+ };
20
+ export declare const InlineCitationCardTrigger: ({ sources, className, ...props }: InlineCitationCardTriggerProps) => React.JSX.Element;
21
+ export type InlineCitationCardBodyProps = React.ComponentProps<"div">;
22
+ export declare const InlineCitationCardBody: ({ className, children, ...props }: InlineCitationCardBodyProps) => React.ReactPortal;
23
+ export type InlineCitationCarouselProps = React.ComponentProps<"div">;
24
+ export declare const InlineCitationCarousel: ({ className, children, ...props }: InlineCitationCarouselProps) => React.JSX.Element;
25
+ export type InlineCitationCarouselContentProps = React.ComponentProps<"div">;
26
+ export declare const InlineCitationCarouselContent: ({ className, children, ...props }: InlineCitationCarouselContentProps) => React.JSX.Element;
27
+ export type InlineCitationCarouselItemProps = React.ComponentProps<"div">;
28
+ export declare const InlineCitationCarouselItem: ({ className, ...props }: InlineCitationCarouselItemProps) => React.JSX.Element;
29
+ export type InlineCitationCarouselHeaderProps = React.ComponentProps<"div">;
30
+ export declare const InlineCitationCarouselHeader: ({ className, ...props }: InlineCitationCarouselHeaderProps) => React.JSX.Element;
31
+ export type InlineCitationCarouselIndexProps = React.ComponentProps<"div">;
32
+ export declare const InlineCitationCarouselIndex: ({ children, className, ...props }: InlineCitationCarouselIndexProps) => React.JSX.Element;
33
+ export type InlineCitationCarouselPrevProps = React.ComponentProps<"button">;
34
+ export declare const InlineCitationCarouselPrev: ({ className, ...props }: InlineCitationCarouselPrevProps) => React.JSX.Element;
35
+ export type InlineCitationCarouselNextProps = React.ComponentProps<"button">;
36
+ export declare const InlineCitationCarouselNext: ({ className, ...props }: InlineCitationCarouselNextProps) => React.JSX.Element;
37
+ export type InlineCitationSourceProps = React.ComponentProps<"div"> & {
38
+ title?: string;
39
+ url?: string;
40
+ description?: string;
41
+ };
42
+ export declare const InlineCitationSource: ({ title, url, description, className, children, ...props }: InlineCitationSourceProps) => React.JSX.Element;
43
+ export type InlineCitationQuoteProps = React.ComponentProps<"blockquote">;
44
+ export declare const InlineCitationQuote: ({ children, className, ...props }: InlineCitationQuoteProps) => React.JSX.Element;
@@ -0,0 +1,314 @@
1
+ "use client";
2
+ import { jsx as i, jsxs as k } from "react/jsx-runtime";
3
+ import * as o from "react";
4
+ import { createPortal as M } from "react-dom";
5
+ import { MotionConfig as R, AnimatePresence as E, motion as L } from "motion/react";
6
+ import { cn as c } from "../../lib/cn.js";
7
+ import { floatVariants as T } from "../../lib/motion.js";
8
+ import { ArrowRight as P, ArrowLeft as z } from "../../lib/icons.js";
9
+ import { Badge as S } from "../badge.js";
10
+ const F = ({ className: e, ...t }) => /* @__PURE__ */ i(
11
+ "span",
12
+ {
13
+ className: c("group/citation inline items-center gap-1", e),
14
+ ...t
15
+ }
16
+ ), H = ({
17
+ className: e,
18
+ ...t
19
+ }) => /* @__PURE__ */ i(
20
+ "span",
21
+ {
22
+ className: c(
23
+ "rounded-xs transition-colors group-hover/citation:bg-accent",
24
+ e
25
+ ),
26
+ ...t
27
+ }
28
+ ), g = o.createContext(null);
29
+ function N(e) {
30
+ const t = o.useContext(g);
31
+ if (!t)
32
+ throw new Error(`${e} must be used within an <InlineCitationCard>.`);
33
+ return t;
34
+ }
35
+ const Q = ({
36
+ children: e,
37
+ open: t,
38
+ defaultOpen: s = !1,
39
+ onOpenChange: n,
40
+ openDelay: r = 0,
41
+ closeDelay: a = 0
42
+ }) => {
43
+ const d = t !== void 0, [C, l] = o.useState(s), h = d ? t : C, u = o.useRef(null), f = o.useRef(null), m = o.useRef({}), x = o.useCallback(
44
+ (b) => {
45
+ d || l(b), n == null || n(b);
46
+ },
47
+ [d, n]
48
+ ), p = o.useCallback(() => {
49
+ window.clearTimeout(m.current.close), m.current.open = window.setTimeout(() => x(!0), r);
50
+ }, [r, x]), w = o.useCallback(() => {
51
+ window.clearTimeout(m.current.open), m.current.close = window.setTimeout(
52
+ () => x(!1),
53
+ a + 120
54
+ );
55
+ }, [a, x]);
56
+ return o.useEffect(
57
+ () => () => {
58
+ window.clearTimeout(m.current.open), window.clearTimeout(m.current.close);
59
+ },
60
+ []
61
+ ), /* @__PURE__ */ i(
62
+ g.Provider,
63
+ {
64
+ value: { open: h, triggerRef: u, contentRef: f, handleOpen: p, handleClose: w },
65
+ children: e
66
+ }
67
+ );
68
+ }, V = ({
69
+ sources: e,
70
+ className: t,
71
+ ...s
72
+ }) => {
73
+ const { open: n, triggerRef: r, handleOpen: a, handleClose: d } = N(
74
+ "InlineCitationCardTrigger"
75
+ ), C = o.useMemo(() => {
76
+ if (!e[0]) return "unknown";
77
+ let l = e[0];
78
+ try {
79
+ l = new URL(e[0]).hostname;
80
+ } catch {
81
+ }
82
+ return e.length > 1 ? `${l} +${e.length - 1}` : l;
83
+ }, [e]);
84
+ return /* @__PURE__ */ i(
85
+ S,
86
+ {
87
+ ref: r,
88
+ variant: "soft",
89
+ className: c("ml-1 cursor-default align-middle", t),
90
+ role: "button",
91
+ tabIndex: 0,
92
+ "aria-expanded": n,
93
+ "aria-haspopup": "dialog",
94
+ onMouseEnter: a,
95
+ onMouseLeave: d,
96
+ onFocus: a,
97
+ onBlur: d,
98
+ ...s,
99
+ children: C
100
+ }
101
+ );
102
+ }, X = ({
103
+ className: e,
104
+ children: t,
105
+ ...s
106
+ }) => {
107
+ const { open: n, triggerRef: r, contentRef: a, handleOpen: d, handleClose: C } = N("InlineCitationCardBody"), [l, h] = o.useState(null);
108
+ return o.useLayoutEffect(() => {
109
+ if (!n) return;
110
+ const u = r.current;
111
+ if (!u) return;
112
+ const f = () => {
113
+ var b;
114
+ const m = u.getBoundingClientRect(), x = ((b = a.current) == null ? void 0 : b.offsetWidth) ?? 320, p = window.innerWidth - x - 8, w = m.left > p ? Math.max(8, p) : m.left;
115
+ h({ top: m.bottom + 6, left: w });
116
+ };
117
+ return f(), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0), () => {
118
+ window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
119
+ };
120
+ }, [n, r]), M(
121
+ /* @__PURE__ */ i(R, { reducedMotion: "user", children: /* @__PURE__ */ i(E, { children: n && /* @__PURE__ */ i(
122
+ L.div,
123
+ {
124
+ ref: a,
125
+ role: "dialog",
126
+ variants: T,
127
+ initial: "hidden",
128
+ animate: "visible",
129
+ exit: "hidden",
130
+ onMouseEnter: d,
131
+ onMouseLeave: C,
132
+ style: {
133
+ position: "fixed",
134
+ top: (l == null ? void 0 : l.top) ?? 0,
135
+ left: (l == null ? void 0 : l.left) ?? 0,
136
+ visibility: l ? "visible" : "hidden",
137
+ transformOrigin: "top left"
138
+ },
139
+ className: c(
140
+ "z-50 w-80 overflow-hidden rounded-lg border border-border bg-elevated text-foreground shadow-elevation",
141
+ e
142
+ ),
143
+ ...s,
144
+ children: t
145
+ }
146
+ ) }) }),
147
+ document.body
148
+ );
149
+ }, I = o.createContext(null);
150
+ function v() {
151
+ const e = o.useContext(I);
152
+ if (!e)
153
+ throw new Error(
154
+ "InlineCitationCarousel parts must be used within an <InlineCitationCarousel>."
155
+ );
156
+ return e;
157
+ }
158
+ const G = ({
159
+ className: e,
160
+ children: t,
161
+ ...s
162
+ }) => {
163
+ const [n, r] = o.useState(0), [a, d] = o.useState(0), C = o.useCallback(
164
+ () => r((u) => Math.max(0, u - 1)),
165
+ []
166
+ ), l = o.useCallback(
167
+ () => r((u) => Math.min(Math.max(0, a - 1), u + 1)),
168
+ [a]
169
+ ), h = o.useCallback((u) => {
170
+ d(u), r((f) => Math.min(f, Math.max(0, u - 1)));
171
+ }, []);
172
+ return /* @__PURE__ */ i(
173
+ I.Provider,
174
+ {
175
+ value: { index: n, count: a, setCount: h, scrollPrev: C, scrollNext: l },
176
+ children: /* @__PURE__ */ i("div", { className: c("w-full", e), ...s, children: t })
177
+ }
178
+ );
179
+ }, J = ({
180
+ className: e,
181
+ children: t,
182
+ ...s
183
+ }) => {
184
+ const { index: n, setCount: r } = v(), a = o.Children.count(t);
185
+ return o.useEffect(() => {
186
+ r(a);
187
+ }, [a, r]), /* @__PURE__ */ i("div", { className: c("overflow-hidden", e), ...s, children: /* @__PURE__ */ i(
188
+ "div",
189
+ {
190
+ className: "flex transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
191
+ style: { transform: `translateX(-${n * 100}%)` },
192
+ children: t
193
+ }
194
+ ) });
195
+ }, K = ({
196
+ className: e,
197
+ ...t
198
+ }) => /* @__PURE__ */ i(
199
+ "div",
200
+ {
201
+ className: c("w-full shrink-0 space-y-2 p-4", e),
202
+ ...t
203
+ }
204
+ ), O = ({
205
+ className: e,
206
+ ...t
207
+ }) => /* @__PURE__ */ i(
208
+ "div",
209
+ {
210
+ className: c(
211
+ "flex items-center justify-between gap-2 rounded-t-lg bg-muted p-2",
212
+ e
213
+ ),
214
+ ...t
215
+ }
216
+ ), Y = ({
217
+ children: e,
218
+ className: t,
219
+ ...s
220
+ }) => {
221
+ const { index: n, count: r } = v();
222
+ return /* @__PURE__ */ i(
223
+ "div",
224
+ {
225
+ className: c(
226
+ "flex flex-1 items-center justify-end px-3 py-1 text-xs text-tertiary tabular-nums",
227
+ t
228
+ ),
229
+ ...s,
230
+ children: e ?? `${r === 0 ? 0 : n + 1}/${r}`
231
+ }
232
+ );
233
+ }, y = c(
234
+ "inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-secondary",
235
+ "outline-none transition-colors hover:text-foreground",
236
+ "focus-visible:ring-3 focus-visible:ring-ring",
237
+ "disabled:pointer-events-none disabled:opacity-40"
238
+ ), Z = ({
239
+ className: e,
240
+ ...t
241
+ }) => {
242
+ const { scrollPrev: s, index: n } = v();
243
+ return /* @__PURE__ */ i(
244
+ "button",
245
+ {
246
+ type: "button",
247
+ "aria-label": "Previous source",
248
+ disabled: n <= 0,
249
+ onClick: s,
250
+ className: c(y, e),
251
+ ...t,
252
+ children: /* @__PURE__ */ i(z, { className: "size-4" })
253
+ }
254
+ );
255
+ }, _ = ({
256
+ className: e,
257
+ ...t
258
+ }) => {
259
+ const { scrollNext: s, index: n, count: r } = v();
260
+ return /* @__PURE__ */ i(
261
+ "button",
262
+ {
263
+ type: "button",
264
+ "aria-label": "Next source",
265
+ disabled: n >= r - 1,
266
+ onClick: s,
267
+ className: c(y, e),
268
+ ...t,
269
+ children: /* @__PURE__ */ i(P, { className: "size-4" })
270
+ }
271
+ );
272
+ }, D = ({
273
+ title: e,
274
+ url: t,
275
+ description: s,
276
+ className: n,
277
+ children: r,
278
+ ...a
279
+ }) => /* @__PURE__ */ k("div", { className: c("space-y-1", n), ...a, children: [
280
+ e && /* @__PURE__ */ i("p", { className: "truncate font-medium text-base leading-tight text-primary", children: e }),
281
+ t && /* @__PURE__ */ i("p", { className: "truncate break-all text-xs text-tertiary", children: t }),
282
+ s && /* @__PURE__ */ i("p", { className: "line-clamp-3 text-base leading-relaxed text-secondary", children: s }),
283
+ r
284
+ ] }), ee = ({
285
+ children: e,
286
+ className: t,
287
+ ...s
288
+ }) => /* @__PURE__ */ i(
289
+ "blockquote",
290
+ {
291
+ className: c(
292
+ "border-l-2 border-border pl-3 text-base italic text-tertiary",
293
+ t
294
+ ),
295
+ ...s,
296
+ children: e
297
+ }
298
+ );
299
+ export {
300
+ F as InlineCitation,
301
+ Q as InlineCitationCard,
302
+ X as InlineCitationCardBody,
303
+ V as InlineCitationCardTrigger,
304
+ G as InlineCitationCarousel,
305
+ J as InlineCitationCarouselContent,
306
+ O as InlineCitationCarouselHeader,
307
+ Y as InlineCitationCarouselIndex,
308
+ K as InlineCitationCarouselItem,
309
+ _ as InlineCitationCarouselNext,
310
+ Z as InlineCitationCarouselPrev,
311
+ ee as InlineCitationQuote,
312
+ D as InlineCitationSource,
313
+ H as InlineCitationText
314
+ };
@@ -0,0 +1,96 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { ButtonProps } from '../button';
3
+ import * as React from "react";
4
+ /**
5
+ * Message — the chat turn family, ported from Vercel AI Elements onto ADS.
6
+ *
7
+ * Standalone and props-driven (no assistant-ui runtime): the same compound
8
+ * API as upstream (`Message` + `from`, `MessageContent`, `MessageResponse`,
9
+ * the `MessageBranch*` navigator, `MessageActions`/`MessageAction`,
10
+ * `MessageAttachment(s)`, `MessageToolbar`) so upstream examples translate
11
+ * 1:1 — implemented with ADS tokens, primitives, and icons.
12
+ */
13
+ /** Mirror of `ai`'s `UIMessage["role"]` (inlined to avoid the `ai` dep). */
14
+ export type MessageRole = "user" | "assistant" | "system";
15
+ /** Mirror of `ai`'s `FileUIPart` (inlined to avoid the `ai` dep). */
16
+ export type MessageFilePart = {
17
+ type?: "file";
18
+ url: string;
19
+ mediaType?: string;
20
+ filename?: string;
21
+ };
22
+ export type MessageProps = React.HTMLAttributes<HTMLDivElement> & {
23
+ from: MessageRole;
24
+ };
25
+ export declare const Message: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
26
+ from: MessageRole;
27
+ } & React.RefAttributes<HTMLDivElement>>;
28
+ declare const messageContentVariants: (props?: ({
29
+ variant?: "flat" | "contained" | null | undefined;
30
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
31
+ export type MessageContentProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof messageContentVariants>;
32
+ export declare const MessageContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
33
+ variant?: "flat" | "contained" | null | undefined;
34
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
35
+ export type MessageAvatarProps = React.HTMLAttributes<HTMLSpanElement> & {
36
+ src: string;
37
+ name?: string;
38
+ };
39
+ export declare const MessageAvatar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
40
+ src: string;
41
+ name?: string;
42
+ } & React.RefAttributes<HTMLSpanElement>>;
43
+ export type MessageResponseProps = React.HTMLAttributes<HTMLDivElement> & {
44
+ children?: React.ReactNode;
45
+ };
46
+ export declare const MessageResponse: React.NamedExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
47
+ children?: React.ReactNode;
48
+ } & React.RefAttributes<HTMLDivElement>>;
49
+ export type MessageActionsProps = React.HTMLAttributes<HTMLDivElement>;
50
+ export declare const MessageActions: React.ForwardRefExoticComponent<MessageActionsProps & React.RefAttributes<HTMLDivElement>>;
51
+ export type MessageActionProps = ButtonProps & {
52
+ tooltip?: string;
53
+ label?: string;
54
+ };
55
+ export declare const MessageAction: React.ForwardRefExoticComponent<ButtonProps & {
56
+ tooltip?: string;
57
+ label?: string;
58
+ } & React.RefAttributes<HTMLButtonElement>>;
59
+ export type MessageBranchProps = React.HTMLAttributes<HTMLDivElement> & {
60
+ defaultBranch?: number;
61
+ onBranchChange?: (branchIndex: number) => void;
62
+ };
63
+ export declare const MessageBranch: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
64
+ defaultBranch?: number;
65
+ onBranchChange?: (branchIndex: number) => void;
66
+ } & React.RefAttributes<HTMLDivElement>>;
67
+ export type MessageBranchContentProps = React.HTMLAttributes<HTMLDivElement>;
68
+ export declare const MessageBranchContent: {
69
+ ({ children, ...props }: MessageBranchContentProps): React.JSX.Element;
70
+ displayName: string;
71
+ };
72
+ export type MessageBranchSelectorProps = React.HTMLAttributes<HTMLDivElement> & {
73
+ from: MessageRole;
74
+ };
75
+ export declare const MessageBranchSelector: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
76
+ from: MessageRole;
77
+ } & React.RefAttributes<HTMLDivElement>>;
78
+ export type MessageBranchPreviousProps = ButtonProps;
79
+ export declare const MessageBranchPrevious: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
80
+ export type MessageBranchNextProps = ButtonProps;
81
+ export declare const MessageBranchNext: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
82
+ export type MessageBranchPageProps = React.HTMLAttributes<HTMLSpanElement>;
83
+ export declare const MessageBranchPage: React.ForwardRefExoticComponent<MessageBranchPageProps & React.RefAttributes<HTMLSpanElement>>;
84
+ export type MessageAttachmentProps = React.HTMLAttributes<HTMLDivElement> & {
85
+ data: MessageFilePart;
86
+ onRemove?: () => void;
87
+ };
88
+ export declare const MessageAttachment: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
89
+ data: MessageFilePart;
90
+ onRemove?: () => void;
91
+ } & React.RefAttributes<HTMLDivElement>>;
92
+ export type MessageAttachmentsProps = React.HTMLAttributes<HTMLDivElement>;
93
+ export declare const MessageAttachments: React.ForwardRefExoticComponent<MessageAttachmentsProps & React.RefAttributes<HTMLDivElement>>;
94
+ export type MessageToolbarProps = React.HTMLAttributes<HTMLDivElement>;
95
+ export declare const MessageToolbar: React.ForwardRefExoticComponent<MessageToolbarProps & React.RefAttributes<HTMLDivElement>>;
96
+ export {};