@actioneer/ads 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/components/ai-elements/chain-of-thought.d.ts +88 -19
  2. package/components/ai-elements/chain-of-thought.js +358 -149
  3. package/components/ai-elements/chart.d.ts +30 -0
  4. package/components/ai-elements/chart.js +303 -0
  5. package/components/ai-elements/index.d.ts +2 -1
  6. package/components/ai-elements/message.d.ts +19 -4
  7. package/components/ai-elements/message.js +177 -130
  8. package/components/ai-elements/research-activity.d.ts +45 -0
  9. package/components/ai-elements/research-activity.js +260 -0
  10. package/components/ai-elements/task-progress.js +69 -66
  11. package/components/ai-elements/tool.js +42 -38
  12. package/components/answer.d.ts +19 -0
  13. package/components/answer.js +363 -300
  14. package/components/assistant-ui/attachment.js +5 -1
  15. package/components/assistant-ui/composer-deep-research.js +44 -29
  16. package/components/assistant-ui/composer-harness.js +55 -38
  17. package/components/assistant-ui/composer.js +16 -16
  18. package/components/assistant-ui/index.d.ts +0 -1
  19. package/components/assistant-ui/message.d.ts +7 -0
  20. package/components/assistant-ui/message.js +64 -51
  21. package/components/assistant-ui/primitives.d.ts +1 -1
  22. package/components/assistant-ui/thread-context.d.ts +2 -0
  23. package/components/assistant-ui/thread.js +34 -32
  24. package/components/brand-texture.d.ts +37 -0
  25. package/components/brand-texture.js +54 -0
  26. package/components/chart.d.ts +64 -2
  27. package/components/chart.js +717 -456
  28. package/components/code-block.d.ts +36 -0
  29. package/components/code-block.js +136 -0
  30. package/components/command-palette.d.ts +43 -0
  31. package/components/command-palette.js +146 -0
  32. package/components/drawer.d.ts +1 -1
  33. package/components/file-dropzone.d.ts +32 -0
  34. package/components/file-dropzone.js +134 -0
  35. package/components/index.d.ts +11 -0
  36. package/components/index.js +480 -430
  37. package/components/infinite-canvas.d.ts +50 -0
  38. package/components/infinite-canvas.js +215 -0
  39. package/components/page-header.d.ts +22 -0
  40. package/components/page-header.js +52 -0
  41. package/components/resizable-panel.d.ts +29 -0
  42. package/components/resizable-panel.js +102 -0
  43. package/components/reveal.d.ts +36 -0
  44. package/components/reveal.js +35 -0
  45. package/components/scroll-area.d.ts +19 -0
  46. package/components/scroll-area.js +57 -0
  47. package/components/setting-row.d.ts +35 -0
  48. package/components/setting-row.js +86 -0
  49. package/components/sidebar.d.ts +4 -1
  50. package/components/sidebar.js +134 -132
  51. package/components/stepper.d.ts +32 -0
  52. package/components/stepper.js +113 -0
  53. package/components/table.js +16 -15
  54. package/components/tabs.js +1 -1
  55. package/hooks/agents-ui/voice-visualizer-types.js +1 -0
  56. package/lib/icons.d.ts +24 -0
  57. package/lib/icons.js +100 -110
  58. package/lib/motion.d.ts +5 -3
  59. package/lib/motion.js +46 -20
  60. package/lib/router.js +19 -0
  61. package/lib/utils.js +5 -0
  62. package/llms.txt +143 -39
  63. package/manifest.json +1232 -100
  64. package/package.json +2 -2
  65. package/styles.css +71 -28
  66. package/theme.css +19 -15
  67. package/components/ai-elements/reasoning.d.ts +0 -26
  68. package/components/ai-elements/reasoning.js +0 -131
  69. package/components/assistant-ui/smart-message-text.d.ts +0 -15
  70. package/components/assistant-ui/smart-message-text.js +0 -29
@@ -0,0 +1,30 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ export declare const aiChartVariants: (props?: ({
4
+ status?: "error" | "pending" | "querying" | "partial" | "rendering" | "ready" | "cancelled" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ export type AIChartStatus = NonNullable<VariantProps<typeof aiChartVariants>["status"]>;
7
+ export interface AIChartProgress {
8
+ received: number;
9
+ total?: number;
10
+ }
11
+ export interface AIChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "title">, VariantProps<typeof aiChartVariants> {
12
+ title: React.ReactNode;
13
+ tag?: React.ReactNode;
14
+ source?: string;
15
+ progress?: AIChartProgress;
16
+ /** Consumer-formatted elapsed time, for example `0:36` or `3:42`. */
17
+ elapsed?: string;
18
+ /** Replaces the status/progress metadata at the end of the trigger row. */
19
+ meta?: React.ReactNode;
20
+ /** Concise nonvisual summary of the chart's result and important values. */
21
+ accessibleSummary?: React.ReactNode;
22
+ open?: boolean;
23
+ defaultOpen?: boolean;
24
+ onOpenChange?: (open: boolean) => void;
25
+ onSourceSelect?: (source: string) => void;
26
+ errorContent?: React.ReactNode;
27
+ onRetry?: () => void;
28
+ children?: React.ReactNode;
29
+ }
30
+ export declare const AIChart: React.ForwardRefExoticComponent<AIChartProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,303 @@
1
+ "use client";
2
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
3
+ import * as x from "react";
4
+ import { cva as M } from "class-variance-authority";
5
+ import { Badge as Q } from "../badge.js";
6
+ import { Button as T } from "../button.js";
7
+ import { Collapsible as V, CollapsibleTrigger as W, CollapsibleContent as E } from "../collapsible.js";
8
+ import { Skeleton as g } from "../skeleton.js";
9
+ import { Spinner as v } from "../spinner.js";
10
+ import { Database as O, ChevronDown as P, WarningCircle as S, Refresh as F, CloseCircle as G } from "../../lib/icons.js";
11
+ import { cn as d } from "../../lib/cn.js";
12
+ const H = M(
13
+ "w-full overflow-hidden rounded-lg text-foreground",
14
+ {
15
+ variants: {
16
+ status: {
17
+ pending: "[&_[data-slot=ai-chart-icon]]:text-tertiary [&_[data-slot=ai-chart-meta]]:text-tertiary",
18
+ querying: "[&_[data-slot=ai-chart-icon]]:text-info-700 [&_[data-slot=ai-chart-meta]]:text-info-700",
19
+ partial: "[&_[data-slot=ai-chart-icon]]:text-info-700 [&_[data-slot=ai-chart-meta]]:text-info-700",
20
+ rendering: "[&_[data-slot=ai-chart-icon]]:text-info-700 [&_[data-slot=ai-chart-meta]]:text-info-700",
21
+ ready: "[&_[data-slot=ai-chart-icon]]:text-secondary [&_[data-slot=ai-chart-meta]]:text-tertiary",
22
+ error: "[&_[data-slot=ai-chart-icon]]:text-danger-700 [&_[data-slot=ai-chart-meta]]:text-danger-700",
23
+ cancelled: "[&_[data-slot=ai-chart-icon]]:text-tertiary [&_[data-slot=ai-chart-meta]]:text-tertiary"
24
+ }
25
+ },
26
+ defaultVariants: { status: "ready" }
27
+ }
28
+ ), J = {
29
+ pending: "Pending",
30
+ querying: "Querying",
31
+ partial: "Receiving",
32
+ rendering: "Rendering",
33
+ ready: "Chart",
34
+ error: "Error",
35
+ cancelled: "Cancelled"
36
+ }, K = {
37
+ pending: "Chart pending",
38
+ querying: "Querying chart data",
39
+ partial: "Chart data partially received",
40
+ rendering: "Rendering chart",
41
+ ready: "Chart ready",
42
+ error: "Chart failed",
43
+ cancelled: "Chart cancelled"
44
+ }, L = {
45
+ pending: "Waiting for chart data",
46
+ querying: "Querying chart data",
47
+ rendering: "Rendering chart"
48
+ };
49
+ function U(t) {
50
+ if (t)
51
+ return t.total == null ? `${t.received} received` : `${t.received} of ${t.total} received`;
52
+ }
53
+ function X(t, r, n) {
54
+ const o = [
55
+ r ? r.total == null ? `${r.received} received` : `${r.received} / ${r.total}` : J[t]
56
+ ];
57
+ return n && o.push(n), o.join(" · ");
58
+ }
59
+ function Y({
60
+ status: t
61
+ }) {
62
+ return /* @__PURE__ */ a(
63
+ "div",
64
+ {
65
+ className: "relative h-40 overflow-hidden rounded-md",
66
+ "data-slot": "ai-chart-skeleton",
67
+ children: [
68
+ /* @__PURE__ */ e(g, { className: "absolute inset-0 h-full w-full" }),
69
+ /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center gap-2 text-xs text-tertiary", children: [
70
+ t !== "pending" && /* @__PURE__ */ e(
71
+ v,
72
+ {
73
+ "aria-hidden": !0,
74
+ role: "presentation",
75
+ size: "sm",
76
+ color: "muted"
77
+ }
78
+ ),
79
+ /* @__PURE__ */ e("span", { children: L[t] })
80
+ ] })
81
+ ]
82
+ }
83
+ );
84
+ }
85
+ function Z({
86
+ status: t,
87
+ progress: r,
88
+ errorContent: n,
89
+ onRetry: o,
90
+ children: s
91
+ }) {
92
+ return t === "error" ? /* @__PURE__ */ a(
93
+ "div",
94
+ {
95
+ className: "flex min-h-40 flex-col items-center justify-center gap-3 rounded-md bg-surface p-4 text-center",
96
+ "data-slot": "ai-chart-error",
97
+ children: [
98
+ /* @__PURE__ */ e(S, { className: "size-5 text-danger-700", "aria-hidden": !0 }),
99
+ /* @__PURE__ */ e("div", { className: "text-xs text-secondary", children: n ?? "The chart could not be generated." }),
100
+ o && /* @__PURE__ */ e(
101
+ T,
102
+ {
103
+ type: "button",
104
+ size: "sm",
105
+ variant: "secondary",
106
+ startContent: /* @__PURE__ */ e(F, { "aria-hidden": !0 }),
107
+ onClick: o,
108
+ children: "Retry"
109
+ }
110
+ )
111
+ ]
112
+ }
113
+ ) : t === "cancelled" ? /* @__PURE__ */ a(
114
+ "div",
115
+ {
116
+ className: "flex min-h-40 flex-col items-center justify-center gap-2 rounded-md bg-surface p-4 text-center",
117
+ "data-slot": "ai-chart-cancelled",
118
+ children: [
119
+ /* @__PURE__ */ e(G, { className: "size-5 text-tertiary", "aria-hidden": !0 }),
120
+ /* @__PURE__ */ e("p", { className: "text-xs text-secondary", children: "Chart generation was cancelled." })
121
+ ]
122
+ }
123
+ ) : t === "partial" ? /* @__PURE__ */ a("div", { className: "space-y-2", "data-slot": "ai-chart-partial", children: [
124
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-xs text-info-700", children: [
125
+ /* @__PURE__ */ e(
126
+ v,
127
+ {
128
+ "aria-hidden": !0,
129
+ role: "presentation",
130
+ size: "sm",
131
+ color: "current"
132
+ }
133
+ ),
134
+ /* @__PURE__ */ e("span", { children: U(r) ?? "Receiving chart data" })
135
+ ] }),
136
+ /* @__PURE__ */ e("div", { className: "min-h-40", children: s ?? /* @__PURE__ */ e(g, { className: "h-40 w-full" }) })
137
+ ] }) : t !== "ready" ? /* @__PURE__ */ e(Y, { status: t }) : (
138
+ // The ready chart draws itself in left→right (the reveal wipe) instead of
139
+ // popping after the loading state — data entrance, not chrome.
140
+ /* @__PURE__ */ e("div", { className: "ads-reveal ads-reveal-wipe min-h-40", "data-slot": "ai-chart-visual", children: s })
141
+ );
142
+ }
143
+ const ee = x.forwardRef(
144
+ ({
145
+ className: t,
146
+ status: r,
147
+ title: n,
148
+ tag: o,
149
+ source: s,
150
+ progress: l,
151
+ elapsed: y,
152
+ meta: c,
153
+ accessibleSummary: u,
154
+ open: b,
155
+ defaultOpen: N = !1,
156
+ onOpenChange: C,
157
+ onSourceSelect: m,
158
+ errorContent: _,
159
+ onRetry: w,
160
+ children: k,
161
+ role: A = "region",
162
+ "aria-label": R,
163
+ "aria-describedby": j,
164
+ "aria-busy": z,
165
+ ...I
166
+ }, $) => {
167
+ const i = r ?? "ready", B = i === "querying" || i === "partial" || i === "rendering", h = c !== void 0 ? c : X(i, l, y), q = K[i], f = x.useId(), p = i === "ready" && u != null, D = [
168
+ j,
169
+ p ? f : void 0
170
+ ].filter(Boolean).join(" ") || void 0;
171
+ return /* @__PURE__ */ a(
172
+ V,
173
+ {
174
+ ref: $,
175
+ open: b,
176
+ defaultOpen: N,
177
+ onOpenChange: C,
178
+ role: A,
179
+ "aria-label": R ?? (typeof n == "string" ? n : "AI chart evidence"),
180
+ "aria-describedby": D,
181
+ "data-slot": "ai-chart",
182
+ "data-status": i,
183
+ className: d(H({ status: i }), t),
184
+ ...I,
185
+ children: [
186
+ /* @__PURE__ */ e(
187
+ "span",
188
+ {
189
+ className: "sr-only",
190
+ role: "status",
191
+ "aria-live": "polite",
192
+ "aria-atomic": "true",
193
+ children: q
194
+ }
195
+ ),
196
+ p && /* @__PURE__ */ e("span", { id: f, className: "sr-only", children: u }),
197
+ /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ a(
198
+ "button",
199
+ {
200
+ type: "button",
201
+ className: d(
202
+ "group/ai-chart-trigger flex min-h-9 w-full items-center gap-2 rounded-md px-1 py-1 text-left",
203
+ "outline-none transition-[background,color,transform] duration-(--duration-fast) ease-out hover:bg-muted active:scale-(--scale-press)",
204
+ "focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none"
205
+ ),
206
+ children: [
207
+ /* @__PURE__ */ e(
208
+ O,
209
+ {
210
+ "data-slot": "ai-chart-icon",
211
+ className: "size-4 shrink-0",
212
+ "aria-hidden": !0
213
+ }
214
+ ),
215
+ /* @__PURE__ */ e("span", { className: "min-w-0 truncate text-xs font-medium text-secondary", children: n }),
216
+ o != null && /* @__PURE__ */ e(
217
+ Q,
218
+ {
219
+ className: "shrink-0 rounded-sm px-1.5 font-normal",
220
+ color: "default",
221
+ variant: "solid",
222
+ children: o
223
+ }
224
+ ),
225
+ h != null && /* @__PURE__ */ e(
226
+ "span",
227
+ {
228
+ "data-slot": "ai-chart-meta",
229
+ className: "ml-auto shrink-0 text-xs tabular-nums",
230
+ children: h
231
+ }
232
+ ),
233
+ /* @__PURE__ */ e(
234
+ P,
235
+ {
236
+ className: "size-4 shrink-0 text-tertiary transition-transform duration-(--duration-normal) ease-out group-data-[state=open]/ai-chart-trigger:rotate-180 motion-reduce:transition-none",
237
+ "aria-hidden": !0
238
+ }
239
+ )
240
+ ]
241
+ }
242
+ ) }),
243
+ /* @__PURE__ */ a(
244
+ E,
245
+ {
246
+ className: d(
247
+ "overflow-hidden px-2.5 pb-2.5 outline-none",
248
+ "data-[state=closed]:pointer-events-none 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"
249
+ ),
250
+ children: [
251
+ /* @__PURE__ */ e(
252
+ "div",
253
+ {
254
+ "data-slot": "ai-chart-body",
255
+ "aria-busy": z ?? (B || void 0),
256
+ children: /* @__PURE__ */ e(
257
+ Z,
258
+ {
259
+ status: i,
260
+ progress: l,
261
+ errorContent: _,
262
+ onRetry: w,
263
+ children: k
264
+ }
265
+ )
266
+ }
267
+ ),
268
+ s && /* @__PURE__ */ e(
269
+ "div",
270
+ {
271
+ className: "mt-2 text-xs text-tertiary",
272
+ "data-slot": "ai-chart-source",
273
+ children: m ? /* @__PURE__ */ a(
274
+ "button",
275
+ {
276
+ type: "button",
277
+ className: "rounded-sm text-left outline-none transition-colors duration-(--duration-fast) ease-out hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
278
+ "aria-label": `Open source ${s}`,
279
+ onClick: () => m(s),
280
+ children: [
281
+ "from ",
282
+ /* @__PURE__ */ e("span", { className: "font-medium tabular-nums", children: s })
283
+ ]
284
+ }
285
+ ) : /* @__PURE__ */ a("p", { children: [
286
+ "from ",
287
+ /* @__PURE__ */ e("span", { className: "font-medium tabular-nums", children: s })
288
+ ] })
289
+ }
290
+ )
291
+ ]
292
+ }
293
+ )
294
+ ]
295
+ }
296
+ );
297
+ }
298
+ );
299
+ ee.displayName = "AIChart";
300
+ export {
301
+ ee as AIChart,
302
+ H as aiChartVariants
303
+ };
@@ -1,8 +1,9 @@
1
1
  export * from './chain-of-thought';
2
+ export * from './chart';
2
3
  export * from './inline-citation';
3
4
  export * from './message';
4
5
  export * from './queue';
5
- export * from './reasoning';
6
+ export * from './research-activity';
6
7
  export * from './shimmer';
7
8
  export * from './speech-input';
8
9
  export * from './task';
@@ -19,19 +19,34 @@ export type MessageFilePart = {
19
19
  mediaType?: string;
20
20
  filename?: string;
21
21
  };
22
- export type MessageProps = React.HTMLAttributes<HTMLDivElement> & {
22
+ declare const messageVariants: (props?: ({
23
+ align?: "end" | "start" | null | undefined;
24
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
25
+ export type MessageProps = Omit<React.HTMLAttributes<HTMLDivElement>, "align"> & VariantProps<typeof messageVariants> & {
23
26
  from: MessageRole;
24
27
  };
25
- export declare const Message: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
28
+ export declare const Message: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "align"> & VariantProps<(props?: ({
29
+ align?: "end" | "start" | null | undefined;
30
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
26
31
  from: MessageRole;
27
32
  } & React.RefAttributes<HTMLDivElement>>;
28
33
  declare const messageContentVariants: (props?: ({
29
- variant?: "flat" | "contained" | null | undefined;
34
+ variant?: "flat" | "plain" | "contained" | "request" | null | undefined;
30
35
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
31
36
  export type MessageContentProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof messageContentVariants>;
32
37
  export declare const MessageContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
33
- variant?: "flat" | "contained" | null | undefined;
38
+ variant?: "flat" | "plain" | "contained" | "request" | null | undefined;
34
39
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
40
+ export type MessageMetaProps = React.HTMLAttributes<HTMLDivElement>;
41
+ /**
42
+ * The quiet line beneath a request — when it was sent, and the parameters it
43
+ * carried (harness, research mode, sources). Place it after the question so
44
+ * the question leads and the metadata supports it.
45
+ *
46
+ * It resets the display typography the `request` variant applies to the user
47
+ * turn; without that reset the metadata inherits the question's size.
48
+ */
49
+ export declare const MessageMeta: React.ForwardRefExoticComponent<MessageMetaProps & React.RefAttributes<HTMLDivElement>>;
35
50
  export type MessageAvatarProps = React.HTMLAttributes<HTMLSpanElement> & {
36
51
  src: string;
37
52
  name?: string;