@actioneer/ads 0.2.4 → 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 (57) hide show
  1. package/components/ai-elements/chain-of-thought.d.ts +64 -2
  2. package/components/ai-elements/chain-of-thought.js +319 -100
  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 -0
  6. package/components/ai-elements/message.d.ts +12 -2
  7. package/components/ai-elements/message.js +133 -100
  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/tool.js +42 -38
  11. package/components/answer.d.ts +16 -0
  12. package/components/answer.js +273 -249
  13. package/components/assistant-ui/attachment.js +5 -1
  14. package/components/assistant-ui/composer-deep-research.js +44 -29
  15. package/components/assistant-ui/composer-harness.js +45 -27
  16. package/components/assistant-ui/composer.js +16 -16
  17. package/components/assistant-ui/index.d.ts +0 -1
  18. package/components/assistant-ui/message.d.ts +7 -0
  19. package/components/assistant-ui/message.js +36 -36
  20. package/components/assistant-ui/thread.js +1 -1
  21. package/components/brand-texture.d.ts +37 -0
  22. package/components/brand-texture.js +54 -0
  23. package/components/code-block.d.ts +36 -0
  24. package/components/code-block.js +136 -0
  25. package/components/drawer.d.ts +1 -1
  26. package/components/file-dropzone.d.ts +32 -0
  27. package/components/file-dropzone.js +134 -0
  28. package/components/index.d.ts +10 -0
  29. package/components/index.js +482 -433
  30. package/components/infinite-canvas.d.ts +50 -0
  31. package/components/infinite-canvas.js +215 -0
  32. package/components/page-header.d.ts +22 -0
  33. package/components/page-header.js +52 -0
  34. package/components/resizable-panel.d.ts +29 -0
  35. package/components/resizable-panel.js +102 -0
  36. package/components/reveal.d.ts +36 -0
  37. package/components/reveal.js +35 -0
  38. package/components/scroll-area.d.ts +19 -0
  39. package/components/scroll-area.js +57 -0
  40. package/components/setting-row.d.ts +35 -0
  41. package/components/setting-row.js +86 -0
  42. package/components/sidebar.js +131 -131
  43. package/components/stepper.d.ts +32 -0
  44. package/components/stepper.js +113 -0
  45. package/components/table.js +16 -15
  46. package/components/tabs.js +1 -1
  47. package/lib/icons.d.ts +12 -0
  48. package/lib/icons.js +98 -95
  49. package/lib/motion.d.ts +5 -3
  50. package/lib/motion.js +28 -27
  51. package/llms.txt +122 -28
  52. package/manifest.json +871 -73
  53. package/package.json +2 -2
  54. package/styles.css +71 -28
  55. package/theme.css +19 -15
  56. package/components/assistant-ui/smart-message-text.d.ts +0 -15
  57. package/components/assistant-ui/smart-message-text.js +0 -29
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { cn as i } from "../lib/cn.js";
4
+ import { PixelBlastSVG as s } from "./pixel-blast-svg.js";
5
+ function l({
6
+ paused: t = !1,
7
+ speed: a = 1.5,
8
+ className: r
9
+ }) {
10
+ return /* @__PURE__ */ e("div", { className: i("size-full bg-background", r), children: /* @__PURE__ */ e(
11
+ s,
12
+ {
13
+ variant: "custom",
14
+ color: "var(--color-ink-950)",
15
+ pixelSize: 4,
16
+ speed: a,
17
+ patternScale: 3,
18
+ patternDensity: 1.8,
19
+ pixelSizeJitter: 0.5,
20
+ enableRipples: !1,
21
+ liquid: !1,
22
+ toneAmount: 0,
23
+ edgeFade: 0.25,
24
+ transparent: !0,
25
+ paused: t
26
+ }
27
+ ) });
28
+ }
29
+ const o = ({
30
+ paused: t,
31
+ lifted: a,
32
+ speed: r = 1.5,
33
+ className: n,
34
+ ...d
35
+ }) => /* @__PURE__ */ e(
36
+ "div",
37
+ {
38
+ "aria-hidden": !0,
39
+ "data-slot": "brand-texture",
40
+ className: i(
41
+ "ads-texture-reveal ads-texture-lift pointer-events-none absolute inset-0 overflow-hidden",
42
+ a ? "ads-texture-lifted opacity-0" : "opacity-(--chat-texture-opacity)",
43
+ n
44
+ ),
45
+ ...d,
46
+ children: /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */ e(l, { paused: t, speed: r }) })
47
+ }
48
+ );
49
+ o.displayName = "BrandTexture";
50
+ l.displayName = "BrandTextureField";
51
+ export {
52
+ o as BrandTexture,
53
+ l as BrandTextureField
54
+ };
@@ -0,0 +1,36 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ /**
4
+ * CodeBlock — block-level source display: a query, a config, a tool payload.
5
+ * The inline sibling is `Code`; reach for this whenever the snippet owns its
6
+ * own line(s).
7
+ *
8
+ * A recessed, static surface — filled, never elevated (elevation means
9
+ * actionable) and never bordered. Long snippets scroll inside the block, so
10
+ * cap the height from the outside (`className="max-h-96"`) rather than letting
11
+ * the page grow.
12
+ *
13
+ * There is no syntax highlighting: it would cost a highlighter dependency and
14
+ * a second color language competing with the brand's monochrome. `language` is
15
+ * a label, not a lexer. The mono face and tabular figures carry the "this is
16
+ * code" signal.
17
+ */
18
+ declare const codeBlockVariants: (props?: ({
19
+ variant?: "soft" | "plain" | null | undefined;
20
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
21
+ export interface CodeBlockProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof codeBlockVariants> {
22
+ /** The source to display, verbatim. */
23
+ code: string;
24
+ /** Language label for the header, e.g. `sql`. A label only — not a lexer. */
25
+ language?: string;
26
+ /** Leading header label, e.g. `schema.yaml`. Takes the header's start slot. */
27
+ filename?: string;
28
+ /** Show the copy control. */
29
+ isCopyable?: boolean;
30
+ /** Number the lines in a non-selectable gutter. */
31
+ showLineNumbers?: boolean;
32
+ /** Accessible label for the copy control. */
33
+ copyLabel?: string;
34
+ }
35
+ export declare const CodeBlock: React.ForwardRefExoticComponent<CodeBlockProps & React.RefAttributes<HTMLDivElement>>;
36
+ export { codeBlockVariants };
@@ -0,0 +1,136 @@
1
+ "use client";
2
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
3
+ import * as r from "react";
4
+ import { cva as k } from "class-variance-authority";
5
+ import { Button as C } from "./button.js";
6
+ import { Check as w, Copy as N } from "../lib/icons.js";
7
+ import { cn as u } from "../lib/cn.js";
8
+ const B = k(
9
+ "group/code-block relative w-full overflow-hidden rounded-lg text-xs",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ /** Recessed fill — the default, for code sitting on a card or panel. */
14
+ soft: "bg-muted",
15
+ /** No fill, for code already inside a filled or tinted surface. */
16
+ plain: "bg-transparent"
17
+ }
18
+ },
19
+ defaultVariants: { variant: "soft" }
20
+ }
21
+ );
22
+ function T(n = 2e3) {
23
+ const [o, a] = r.useState(!1), t = r.useRef(null);
24
+ r.useEffect(
25
+ () => () => {
26
+ t.current !== null && window.clearTimeout(t.current);
27
+ },
28
+ []
29
+ );
30
+ const c = r.useCallback(
31
+ (i) => {
32
+ !i || typeof navigator > "u" || !navigator.clipboard || navigator.clipboard.writeText(i).then(
33
+ () => {
34
+ a(!0), t.current !== null && window.clearTimeout(t.current), t.current = window.setTimeout(
35
+ () => a(!1),
36
+ n
37
+ );
38
+ },
39
+ () => {
40
+ }
41
+ );
42
+ },
43
+ [n]
44
+ );
45
+ return { isCopied: o, copy: c };
46
+ }
47
+ const R = r.forwardRef(
48
+ ({
49
+ className: n,
50
+ code: o,
51
+ language: a,
52
+ filename: t,
53
+ variant: c,
54
+ isCopyable: i = !0,
55
+ showLineNumbers: l = !1,
56
+ copyLabel: h = "Copy code",
57
+ ...x
58
+ }, y) => {
59
+ const { isCopied: m, copy: v } = T(), d = !!(t || a), b = r.useMemo(
60
+ () => l ? o.replace(/\n$/, "").split(`
61
+ `) : [],
62
+ [o, l]
63
+ ), s = i ? /* @__PURE__ */ e(
64
+ C,
65
+ {
66
+ type: "button",
67
+ variant: "ghost",
68
+ size: "icon-xs",
69
+ "aria-label": h,
70
+ onClick: () => v(o),
71
+ children: m ? /* @__PURE__ */ e(w, { "aria-hidden": !0, className: "text-success" }) : /* @__PURE__ */ e(N, { "aria-hidden": !0 })
72
+ }
73
+ ) : null;
74
+ return /* @__PURE__ */ p(
75
+ "div",
76
+ {
77
+ ref: y,
78
+ "data-slot": "code-block",
79
+ className: u(B({ variant: c }), n),
80
+ ...x,
81
+ children: [
82
+ /* @__PURE__ */ e("span", { "aria-live": "polite", className: "sr-only", children: m ? "Copied to clipboard" : "" }),
83
+ d && /* @__PURE__ */ p(
84
+ "div",
85
+ {
86
+ "data-slot": "code-block-header",
87
+ className: "flex items-center gap-2 px-3 py-1.5 text-tertiary",
88
+ children: [
89
+ t && /* @__PURE__ */ e("span", { className: "min-w-0 truncate font-medium text-secondary", children: t }),
90
+ a && /* @__PURE__ */ e("span", { className: "shrink-0 font-mono text-[11px] uppercase", children: a }),
91
+ s && /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: s })
92
+ ]
93
+ }
94
+ ),
95
+ !d && s && /* @__PURE__ */ e(
96
+ "span",
97
+ {
98
+ className: u(
99
+ "absolute top-1.5 right-1.5 z-10 opacity-0 transition-opacity duration-(--duration-fast) ease-out",
100
+ "group-hover/code-block:opacity-100 focus-within:opacity-100",
101
+ "motion-reduce:transition-none"
102
+ ),
103
+ children: s
104
+ }
105
+ ),
106
+ /* @__PURE__ */ e(
107
+ "pre",
108
+ {
109
+ "data-slot": "code-block-content",
110
+ className: u(
111
+ "overflow-x-auto px-3 leading-relaxed text-foreground tabular-nums",
112
+ d ? "pb-3" : "py-3"
113
+ ),
114
+ children: /* @__PURE__ */ e("code", { className: "font-mono", children: l ? b.map((g, f) => /* @__PURE__ */ p("span", { className: "grid grid-cols-[2ch_1fr] gap-3", children: [
115
+ /* @__PURE__ */ e(
116
+ "span",
117
+ {
118
+ "aria-hidden": !0,
119
+ className: "select-none text-right text-tertiary",
120
+ children: f + 1
121
+ }
122
+ ),
123
+ /* @__PURE__ */ e("span", { children: g })
124
+ ] }, f)) : o })
125
+ }
126
+ )
127
+ ]
128
+ }
129
+ );
130
+ }
131
+ );
132
+ R.displayName = "CodeBlock";
133
+ export {
134
+ R as CodeBlock,
135
+ B as codeBlockVariants
136
+ };
@@ -14,7 +14,7 @@ export interface DrawerProps extends VariantProps<typeof panelVariants> {
14
14
  }
15
15
  /**
16
16
  * ModalDrawer — legacy portaled drawer. Kept for the demo product's
17
- * answer-sources / citation-preview / voice-campaigns screens where a blocking
17
+ * answer-sources / voice-campaigns screens where a blocking
18
18
  * side panel over the whole viewport is the intended pattern. New code should
19
19
  * prefer `Drawer` (the inline variant) — it doesn't leave the page while it's
20
20
  * open, so users can keep referencing content beside it.
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ /**
3
+ * FileDropzone — the drop-or-browse target for file input. ADS previously had
4
+ * no file primitive at all, so every upload surface hand-rolled a hidden
5
+ * `<input type="file">`.
6
+ *
7
+ * A dashed edge is the one sanctioned stroke here: it is the affordance
8
+ * ("something goes in this hole"), not decoration. The zone is actionable, so
9
+ * it takes hover, focus and press feedback; while a file is dragged over it
10
+ * the fill deepens rather than the stroke thickening, so nothing jumps.
11
+ */
12
+ declare const fileDropzoneVariants: (props?: ({
13
+ isDragging?: boolean | null | undefined;
14
+ isDisabled?: boolean | null | undefined;
15
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
16
+ export interface FileDropzoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onDrop" | "onChange"> {
17
+ /** Native accept string, e.g. `"image/*,.csv"`. */
18
+ accept?: string;
19
+ multiple?: boolean;
20
+ disabled?: boolean;
21
+ /** Fires with the chosen files, whether dropped or browsed. */
22
+ onFiles?: (files: File[]) => void;
23
+ /** The current selection — render the chosen state and a clear control. */
24
+ files?: File[];
25
+ onClear?: () => void;
26
+ /** Headline copy; defaults to a browse prompt. */
27
+ label?: React.ReactNode;
28
+ /** Sub-line, e.g. "CSV up to 10 MB". */
29
+ hint?: React.ReactNode;
30
+ }
31
+ export declare const FileDropzone: React.ForwardRefExoticComponent<FileDropzoneProps & React.RefAttributes<HTMLDivElement>>;
32
+ export { fileDropzoneVariants };
@@ -0,0 +1,134 @@
1
+ "use client";
2
+ import { jsxs as t, jsx as r, Fragment as f } from "react/jsx-runtime";
3
+ import * as i from "react";
4
+ import { cva as C } from "class-variance-authority";
5
+ import { cn as v } from "../lib/cn.js";
6
+ import { Button as D } from "./button.js";
7
+ import { FileText as R, Close as B, Upload as w } from "../lib/icons.js";
8
+ const T = C(
9
+ v(
10
+ "flex w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-xl px-6 py-8 text-center",
11
+ "border-2 border-dashed border-border-strong bg-surface outline-none",
12
+ "transition-[background-color,border-color,transform] duration-(--duration-fast) ease-out",
13
+ "hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring",
14
+ "active:scale-(--scale-press) motion-reduce:transition-none"
15
+ ),
16
+ {
17
+ variants: {
18
+ isDragging: {
19
+ true: "border-ring bg-accent",
20
+ false: ""
21
+ },
22
+ isDisabled: {
23
+ true: "pointer-events-none opacity-50",
24
+ false: ""
25
+ }
26
+ },
27
+ defaultVariants: { isDragging: !1, isDisabled: !1 }
28
+ }
29
+ ), j = (a) => a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${Math.round(a / 1024)} KB` : `${(a / (1024 * 1024)).toFixed(1)} MB`, $ = i.forwardRef(
30
+ ({
31
+ className: a,
32
+ accept: b,
33
+ multiple: c = !1,
34
+ disabled: n = !1,
35
+ onFiles: l,
36
+ files: s,
37
+ onClear: g,
38
+ label: N,
39
+ hint: p,
40
+ ...y
41
+ }, z) => {
42
+ const m = i.useRef(null), [h, d] = i.useState(!1), o = i.useRef(0), x = (e) => {
43
+ e != null && e.length && (l == null || l(c ? Array.from(e) : [e[0]]));
44
+ }, u = () => {
45
+ var e;
46
+ return (e = m.current) == null ? void 0 : e.click();
47
+ }, k = !!(s != null && s.length);
48
+ return /* @__PURE__ */ t(
49
+ "div",
50
+ {
51
+ ref: z,
52
+ "data-slot": "file-dropzone",
53
+ "data-dragging": h || void 0,
54
+ role: "button",
55
+ tabIndex: n ? -1 : 0,
56
+ "aria-disabled": n || void 0,
57
+ onClick: u,
58
+ onKeyDown: (e) => {
59
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u());
60
+ },
61
+ onDragEnter: (e) => {
62
+ e.preventDefault(), o.current += 1, d(!0);
63
+ },
64
+ onDragOver: (e) => e.preventDefault(),
65
+ onDragLeave: () => {
66
+ o.current -= 1, o.current <= 0 && (o.current = 0, d(!1));
67
+ },
68
+ onDrop: (e) => {
69
+ e.preventDefault(), o.current = 0, d(!1), n || x(e.dataTransfer.files);
70
+ },
71
+ className: v(
72
+ T({ isDragging: h, isDisabled: n }),
73
+ a
74
+ ),
75
+ ...y,
76
+ children: [
77
+ /* @__PURE__ */ r(
78
+ "input",
79
+ {
80
+ ref: m,
81
+ hidden: !0,
82
+ type: "file",
83
+ accept: b,
84
+ multiple: c,
85
+ disabled: n,
86
+ onChange: (e) => {
87
+ x(e.currentTarget.files), e.currentTarget.value = "";
88
+ }
89
+ }
90
+ ),
91
+ k ? /* @__PURE__ */ t(f, { children: [
92
+ /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "text-tertiary [&>svg]:size-6", children: /* @__PURE__ */ r(R, {}) }),
93
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: s.map((e) => /* @__PURE__ */ t("span", { className: "text-base text-foreground", children: [
94
+ e.name,
95
+ /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-tertiary tabular-nums", children: j(e.size) })
96
+ ] }, e.name)) }),
97
+ /* @__PURE__ */ t("div", { className: "mt-1 flex items-center gap-2", children: [
98
+ /* @__PURE__ */ r(D, { size: "sm", variant: "secondary", onClick: (e) => {
99
+ e.stopPropagation(), u();
100
+ }, children: "Replace" }),
101
+ g && /* @__PURE__ */ r(
102
+ D,
103
+ {
104
+ size: "sm",
105
+ variant: "ghost",
106
+ startContent: /* @__PURE__ */ r(B, {}),
107
+ onClick: (e) => {
108
+ e.stopPropagation(), g();
109
+ },
110
+ children: "Clear"
111
+ }
112
+ )
113
+ ] })
114
+ ] }) : /* @__PURE__ */ t(f, { children: [
115
+ /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "text-tertiary [&>svg]:size-6", children: /* @__PURE__ */ r(w, {}) }),
116
+ /* @__PURE__ */ r("span", { className: "text-base text-foreground", children: N ?? /* @__PURE__ */ t(f, { children: [
117
+ "Drop ",
118
+ c ? "files" : "a file",
119
+ " here, or",
120
+ " ",
121
+ /* @__PURE__ */ r("span", { className: "underline underline-offset-4", children: "browse" })
122
+ ] }) }),
123
+ p && /* @__PURE__ */ r("span", { className: "text-xs text-tertiary", children: p })
124
+ ] })
125
+ ]
126
+ }
127
+ );
128
+ }
129
+ );
130
+ $.displayName = "FileDropzone";
131
+ export {
132
+ $ as FileDropzone,
133
+ T as fileDropzoneVariants
134
+ };
@@ -3,11 +3,18 @@ export { interactive, type InteractiveProps } from '../lib/interactive';
3
3
  export { TooltipProvider } from './ui/tooltip';
4
4
  export * from './button';
5
5
  export * from './spinner';
6
+ export * from './reveal';
6
7
  export * from './field';
7
8
  export * from './typography';
8
9
  export * from './link';
9
10
  export * from './divider';
10
11
  export * from './kbd';
12
+ export * from './code-block';
13
+ export * from './setting-row';
14
+ export * from './file-dropzone';
15
+ export * from './scroll-area';
16
+ export * from './stepper';
17
+ export * from './resizable-panel';
11
18
  export * from './input';
12
19
  export * from './input-field';
13
20
  export * from './textarea';
@@ -31,6 +38,7 @@ export * from './card';
31
38
  export * from './carousel';
32
39
  export * from './chart';
33
40
  export * from './connector-card';
41
+ export * from './infinite-canvas';
34
42
  export * from './table';
35
43
  export * from './tabs';
36
44
  export * from './tree';
@@ -42,10 +50,12 @@ export * from './timeline';
42
50
  export * from './alert';
43
51
  export * from './brand-loader';
44
52
  export * from './pixel-blast-svg';
53
+ export * from './brand-texture';
45
54
  export * from './progress';
46
55
  export * from './progress-circle';
47
56
  export * from './skeleton';
48
57
  export * from './empty-state';
58
+ export * from './page-header';
49
59
  export * from './navbar';
50
60
  export * from './breadcrumbs';
51
61
  export * from './pagination';