@actioneer/ads 1.0.7 → 1.0.9

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 (87) hide show
  1. package/DESIGN.md +119 -91
  2. package/README.md +19 -1
  3. package/components/ai-elements/chart.js +20 -20
  4. package/components/ai-elements/inline-citation.js +50 -50
  5. package/components/ai-elements/message.js +1 -1
  6. package/components/ai-elements/tool.js +5 -5
  7. package/components/alert.d.ts +3 -2
  8. package/components/alert.js +25 -25
  9. package/components/answer.js +1 -1
  10. package/components/assistant-ui/action-bar.js +1 -1
  11. package/components/assistant-ui/attachment.js +68 -49
  12. package/components/assistant-ui/composer-add-context.js +1 -1
  13. package/components/assistant-ui/composer-harness.js +5 -4
  14. package/components/assistant-ui/composer-trigger-popover.js +1 -1
  15. package/components/assistant-ui/composer.js +13 -13
  16. package/components/assistant-ui/message-timing.js +6 -6
  17. package/components/assistant-ui/selection-toolbar.js +5 -5
  18. package/components/assistant-ui/sources.js +15 -15
  19. package/components/assistant-ui/tooltip-icon-button.js +18 -14
  20. package/components/audio-waveform.d.ts +21 -8
  21. package/components/audio-waveform.js +371 -94
  22. package/components/autocomplete.js +9 -9
  23. package/components/breadcrumbs.js +36 -42
  24. package/components/button.d.ts +16 -1
  25. package/components/button.js +86 -73
  26. package/components/card.js +1 -1
  27. package/components/chart.d.ts +31 -4
  28. package/components/chart.js +900 -666
  29. package/components/chip.d.ts +2 -1
  30. package/components/chip.js +56 -51
  31. package/components/command-palette.js +12 -12
  32. package/components/connector-card.d.ts +1 -2
  33. package/components/connector-card.js +17 -17
  34. package/components/date-range-picker.js +1 -2
  35. package/components/drawer.js +9 -10
  36. package/components/dropdown.js +1 -1
  37. package/components/empty-state.d.ts +2 -0
  38. package/components/empty-state.js +17 -15
  39. package/components/field.js +9 -10
  40. package/components/file-dropzone.d.ts +6 -3
  41. package/components/file-dropzone.js +72 -60
  42. package/components/filters.d.ts +37 -0
  43. package/components/filters.js +129 -0
  44. package/components/index.d.ts +1 -0
  45. package/components/index.js +447 -444
  46. package/components/infinite-canvas.js +9 -9
  47. package/components/modal.d.ts +2 -1
  48. package/components/modal.js +102 -91
  49. package/components/page-body.js +8 -8
  50. package/components/popover.d.ts +6 -1
  51. package/components/popover.js +75 -65
  52. package/components/progress-circle.d.ts +1 -1
  53. package/components/progress-circle.js +57 -48
  54. package/components/segmented.d.ts +1 -0
  55. package/components/segmented.js +34 -36
  56. package/components/select.js +2 -2
  57. package/components/selection-action-bar.js +32 -31
  58. package/components/setting-row.js +10 -10
  59. package/components/sidebar.d.ts +15 -0
  60. package/components/sidebar.js +186 -149
  61. package/components/slider.js +5 -5
  62. package/components/stepper.d.ts +1 -1
  63. package/components/stepper.js +1 -1
  64. package/components/switch.js +10 -10
  65. package/components/table.d.ts +10 -2
  66. package/components/table.js +380 -366
  67. package/components/tabs.d.ts +6 -1
  68. package/components/tabs.js +32 -29
  69. package/components/timeline.js +3 -3
  70. package/components/toast.js +53 -56
  71. package/components/ui/button.js +4 -4
  72. package/components/ui/dialog.js +1 -1
  73. package/components/viz-charts.js +263 -221
  74. package/demo/components/add-to-artifact.js +3 -2
  75. package/examples/README.md +31 -0
  76. package/examples/agents-screen.tsx +477 -0
  77. package/examples/campaign-analysis-screen.tsx +138 -0
  78. package/examples/campaigns-screen.tsx +439 -0
  79. package/examples/settings-screen.tsx +90 -0
  80. package/examples/workspace-header.tsx +71 -0
  81. package/lib/icons.d.ts +8 -0
  82. package/lib/icons.js +171 -118
  83. package/llms.txt +93 -29
  84. package/manifest.json +1660 -113
  85. package/package.json +1 -1
  86. package/styles.css +55 -68
  87. package/theme.css +50 -59
@@ -1,22 +1,24 @@
1
1
  "use client";
2
- import { jsxs as a, 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 border-dashed border-border-strong bg-surface outline-none",
2
+ import { jsxs as t, jsx as r, Fragment as m } from "react/jsx-runtime";
3
+ import * as s from "react";
4
+ import { cva as R } from "class-variance-authority";
5
+ import { cn as p } from "../lib/cn.js";
6
+ import { Button as v } from "./button.js";
7
+ import { FileText as j, Upload as B } from "../lib/icons.js";
8
+ const C = R(
9
+ p(
10
+ "flex w-full cursor-pointer rounded-lg border bg-card outline-none",
12
11
  "transition-[background-color,border-color,transform] duration-150 ease-out",
13
- "hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring",
14
- "active:scale-[0.97] motion-reduce:transition-none"
12
+ "focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none"
15
13
  ),
16
14
  {
17
15
  variants: {
16
+ hasFiles: {
17
+ true: "flex-row items-center justify-between gap-4 border-solid border-border p-3 text-left",
18
+ false: "flex-col items-center justify-center gap-3 border-dashed border-border-strong px-6 py-7 text-center hover:bg-wg1 active:scale-[0.99] motion-reduce:active:scale-100"
19
+ },
18
20
  isDragging: {
19
- true: "border-ring bg-accent",
21
+ true: "border-dashed border-field-focus bg-t1 hover:bg-t1",
20
22
  false: ""
21
23
  },
22
24
  isDisabled: {
@@ -24,33 +26,33 @@ const T = C(
24
26
  false: ""
25
27
  }
26
28
  },
27
- defaultVariants: { isDragging: !1, isDisabled: !1 }
29
+ defaultVariants: { hasFiles: !1, isDragging: !1, isDisabled: !1 }
28
30
  }
29
- ), j = (t) => t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${Math.round(t / 1024)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`, $ = i.forwardRef(
31
+ ), N = "inline-flex size-9 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground [&>svg]:size-4.5", F = (a) => a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${Math.round(a / 1024)} KB` : `${(a / (1024 * 1024)).toFixed(1)} MB`, T = s.forwardRef(
30
32
  ({
31
- className: t,
32
- accept: b,
33
+ className: a,
34
+ accept: y,
33
35
  multiple: c = !1,
34
36
  disabled: n = !1,
35
37
  onFiles: l,
36
- files: s,
38
+ files: i,
37
39
  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) => {
40
+ label: w,
41
+ hint: h,
42
+ ...z
43
+ }, k) => {
44
+ const x = s.useRef(null), [d, f] = s.useState(!1), o = s.useRef(0), b = (e) => {
43
45
  e != null && e.length && (l == null || l(c ? Array.from(e) : [e[0]]));
44
46
  }, u = () => {
45
47
  var e;
46
- return (e = m.current) == null ? void 0 : e.click();
47
- }, k = !!(s != null && s.length);
48
- return /* @__PURE__ */ a(
48
+ return (e = x.current) == null ? void 0 : e.click();
49
+ }, D = !!(i != null && i.length);
50
+ return /* @__PURE__ */ t(
49
51
  "div",
50
52
  {
51
- ref: z,
53
+ ref: k,
52
54
  "data-slot": "file-dropzone",
53
- "data-dragging": h || void 0,
55
+ "data-dragging": d || void 0,
54
56
  role: "button",
55
57
  tabIndex: n ? -1 : 0,
56
58
  "aria-disabled": n || void 0,
@@ -59,51 +61,52 @@ const T = C(
59
61
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u());
60
62
  },
61
63
  onDragEnter: (e) => {
62
- e.preventDefault(), o.current += 1, d(!0);
64
+ e.preventDefault(), o.current += 1, f(!0);
63
65
  },
64
66
  onDragOver: (e) => e.preventDefault(),
65
67
  onDragLeave: () => {
66
- o.current -= 1, o.current <= 0 && (o.current = 0, d(!1));
68
+ o.current -= 1, o.current <= 0 && (o.current = 0, f(!1));
67
69
  },
68
70
  onDrop: (e) => {
69
- e.preventDefault(), o.current = 0, d(!1), n || x(e.dataTransfer.files);
71
+ e.preventDefault(), o.current = 0, f(!1), n || b(e.dataTransfer.files);
70
72
  },
71
- className: v(
72
- T({ isDragging: h, isDisabled: n }),
73
- t
73
+ className: p(
74
+ C({ hasFiles: D, isDragging: d, isDisabled: n }),
75
+ a
74
76
  ),
75
- ...y,
77
+ ...z,
76
78
  children: [
77
79
  /* @__PURE__ */ r(
78
80
  "input",
79
81
  {
80
- ref: m,
82
+ ref: x,
81
83
  hidden: !0,
82
84
  type: "file",
83
- accept: b,
85
+ accept: y,
84
86
  multiple: c,
85
87
  disabled: n,
86
88
  onChange: (e) => {
87
- x(e.currentTarget.files), e.currentTarget.value = "";
89
+ b(e.currentTarget.files), e.currentTarget.value = "";
88
90
  }
89
91
  }
90
92
  ),
91
- k ? /* @__PURE__ */ a(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__ */ a("span", { className: "text-base text-foreground", children: [
94
- e.name,
95
- /* @__PURE__ */ r("span", { className: "ml-2 text-s text-tertiary tabular-nums", children: j(e.size) })
93
+ D ? /* @__PURE__ */ t(m, { children: [
94
+ /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 flex-col gap-2.5", children: i.map((e) => /* @__PURE__ */ t("span", { className: "flex min-w-0 items-center gap-3", children: [
95
+ /* @__PURE__ */ r("span", { "aria-hidden": !0, className: N, children: /* @__PURE__ */ r(j, {}) }),
96
+ /* @__PURE__ */ t("span", { className: "flex min-w-0 flex-col", children: [
97
+ /* @__PURE__ */ r("span", { className: "truncate text-m font-medium text-foreground", children: e.name }),
98
+ /* @__PURE__ */ r("span", { className: "text-s text-tertiary tabular-nums", children: F(e.size) })
99
+ ] })
96
100
  ] }, e.name)) }),
97
- /* @__PURE__ */ a("div", { className: "mt-1 flex items-center gap-2", children: [
98
- /* @__PURE__ */ r(D, { size: "sm", variant: "secondary", onClick: (e) => {
101
+ /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-1", children: [
102
+ /* @__PURE__ */ r(v, { size: "sm", variant: "outline", onClick: (e) => {
99
103
  e.stopPropagation(), u();
100
104
  }, children: "Replace" }),
101
105
  g && /* @__PURE__ */ r(
102
- D,
106
+ v,
103
107
  {
104
108
  size: "sm",
105
109
  variant: "ghost",
106
- startContent: /* @__PURE__ */ r(B, {}),
107
110
  onClick: (e) => {
108
111
  e.stopPropagation(), g();
109
112
  },
@@ -111,24 +114,33 @@ const T = C(
111
114
  }
112
115
  )
113
116
  ] })
114
- ] }) : /* @__PURE__ */ a(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__ */ a(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-s text-tertiary", children: p })
117
+ ] }) : /* @__PURE__ */ t(m, { children: [
118
+ /* @__PURE__ */ r(
119
+ "span",
120
+ {
121
+ "aria-hidden": !0,
122
+ className: p(N, d && "text-action-primary"),
123
+ children: /* @__PURE__ */ r(B, {})
124
+ }
125
+ ),
126
+ /* @__PURE__ */ t("span", { className: "flex flex-col items-center gap-0.5", children: [
127
+ /* @__PURE__ */ r("span", { className: "text-m font-medium text-foreground", children: w ?? /* @__PURE__ */ t(m, { children: [
128
+ "Drop ",
129
+ c ? "files" : "a file",
130
+ " here, or",
131
+ " ",
132
+ /* @__PURE__ */ r("span", { className: "text-action-primary-text", children: "browse" })
133
+ ] }) }),
134
+ h && /* @__PURE__ */ r("span", { className: "text-s text-tertiary", children: h })
135
+ ] })
124
136
  ] })
125
137
  ]
126
138
  }
127
139
  );
128
140
  }
129
141
  );
130
- $.displayName = "FileDropzone";
142
+ T.displayName = "FileDropzone";
131
143
  export {
132
- $ as FileDropzone,
133
- T as fileDropzoneVariants
144
+ T as FileDropzone,
145
+ C as fileDropzoneVariants
134
146
  };
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ export interface FilterOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ export interface FilterGroup {
7
+ /** Stable key passed back through `onChange`. */
8
+ id: string;
9
+ /** Accessible name for the group's Select (e.g. "Status"). */
10
+ label: string;
11
+ /** The first option is the group's "All …" default. */
12
+ options: FilterOption[];
13
+ /** The selected option value. */
14
+ value: string;
15
+ }
16
+ export interface FiltersProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "title"> {
17
+ groups: FilterGroup[];
18
+ /** Called with the group id and its newly selected option value. */
19
+ onChange: (id: string, value: string) => void;
20
+ /**
21
+ * Called by "Clear all". When omitted, Clear all resets every applied group
22
+ * to its first option through `onChange`.
23
+ */
24
+ onClearAll?: () => void;
25
+ /** Panel title. Defaults to "Filters". */
26
+ title?: string;
27
+ /** Accessible label for the icon-only trigger. Defaults to `title`. */
28
+ triggerLabel?: string;
29
+ /** Which trigger edge the panel aligns to. Defaults to `"end"`. */
30
+ align?: "start" | "end";
31
+ /** Controlled open state — pair with `onOpenChange`. */
32
+ open?: boolean;
33
+ /** Uncontrolled initial open state. */
34
+ defaultOpen?: boolean;
35
+ onOpenChange?: (open: boolean) => void;
36
+ }
37
+ export declare const Filters: React.ForwardRefExoticComponent<FiltersProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,129 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as m } from "react/jsx-runtime";
3
+ import * as o from "react";
4
+ import { cn as u } from "../lib/cn.js";
5
+ import { Filter as T } from "../lib/icons.js";
6
+ import { Button as F } from "./button.js";
7
+ import { Popover as z, PopoverTrigger as D, PopoverContent as K } from "./popover.js";
8
+ import { Field as P } from "./field.js";
9
+ import { Select as U } from "./select.js";
10
+ const N = (i) => i.options.length > 0 && i.value !== i.options[0].value, C = o.forwardRef(
11
+ ({
12
+ groups: i,
13
+ onChange: p,
14
+ onClearAll: v,
15
+ title: d = "Filters",
16
+ triggerLabel: w,
17
+ align: $ = "end",
18
+ open: f,
19
+ defaultOpen: R = !1,
20
+ onOpenChange: s,
21
+ className: j,
22
+ ...k
23
+ }, c) => {
24
+ const [E, S] = o.useState(R), a = f ?? E, q = o.useCallback(
25
+ (e) => {
26
+ f === void 0 && S(e), s == null || s(e);
27
+ },
28
+ [f, s]
29
+ ), b = o.useRef(null), A = (e) => {
30
+ b.current = e, typeof c == "function" ? c(e) : c && (c.current = e);
31
+ }, n = o.useId(), r = i.filter(N).length, h = a || r > 0, x = w ?? d;
32
+ o.useEffect(() => {
33
+ if (!a) return;
34
+ const e = requestAnimationFrame(() => {
35
+ var l, y;
36
+ (y = (l = document.getElementById(n)) == null ? void 0 : l.querySelector("[role=combobox]")) == null || y.focus();
37
+ });
38
+ return () => cancelAnimationFrame(e);
39
+ }, [a, n]);
40
+ const I = () => {
41
+ var e, l;
42
+ return (l = (e = b.current) == null ? void 0 : e.querySelector("button")) == null ? void 0 : l.focus();
43
+ }, B = () => {
44
+ v ? v() : i.forEach((e) => {
45
+ N(e) && p(e.id, e.options[0].value);
46
+ });
47
+ };
48
+ return /* @__PURE__ */ t(
49
+ "div",
50
+ {
51
+ ref: A,
52
+ "data-slot": "filters",
53
+ "data-state": a ? "open" : "closed",
54
+ className: u("relative inline-flex", j),
55
+ ...k,
56
+ children: /* @__PURE__ */ m(z, { open: a, onOpenChange: q, children: [
57
+ /* @__PURE__ */ t(D, { children: /* @__PURE__ */ m(
58
+ F,
59
+ {
60
+ type: "button",
61
+ variant: "outline",
62
+ size: "icon-sm",
63
+ "aria-label": r > 0 ? `${x}, ${r} applied` : x,
64
+ "aria-controls": a ? n : void 0,
65
+ "data-active": h || void 0,
66
+ className: u(h && "border-action-primary text-action-primary"),
67
+ children: [
68
+ /* @__PURE__ */ t(T, { "aria-hidden": !0 }),
69
+ r > 0 && /* @__PURE__ */ t(
70
+ "span",
71
+ {
72
+ "aria-hidden": !0,
73
+ "data-slot": "filters-count",
74
+ className: u(
75
+ "pointer-events-none absolute -top-1.5 -right-1.5 inline-flex h-4 min-w-4 items-center justify-center",
76
+ "rounded-full bg-action-primary px-1 text-xs leading-none font-medium tabular-nums text-action-primary-foreground"
77
+ ),
78
+ children: r
79
+ }
80
+ )
81
+ ]
82
+ }
83
+ ) }),
84
+ /* @__PURE__ */ m(
85
+ K,
86
+ {
87
+ id: n,
88
+ align: $,
89
+ "aria-label": d,
90
+ onKeyDown: (e) => {
91
+ e.key === "Escape" && I();
92
+ },
93
+ className: "flex w-76 min-w-0 flex-col gap-4 p-4 text-m",
94
+ children: [
95
+ /* @__PURE__ */ m("div", { className: "flex min-h-5 items-center justify-between gap-4", children: [
96
+ /* @__PURE__ */ t("div", { className: "text-l font-medium text-on-white-primary", children: d }),
97
+ r > 0 && /* @__PURE__ */ t(
98
+ F,
99
+ {
100
+ type: "button",
101
+ variant: "link",
102
+ className: "h-auto px-0",
103
+ onClick: B,
104
+ children: "Clear all"
105
+ }
106
+ )
107
+ ] }),
108
+ i.map((e) => /* @__PURE__ */ t(P, { label: e.label, htmlFor: `${n}-${e.id}`, children: /* @__PURE__ */ t(
109
+ U,
110
+ {
111
+ id: `${n}-${e.id}`,
112
+ "aria-label": e.label,
113
+ items: e.options,
114
+ value: e.value,
115
+ onChange: (l) => p(e.id, l)
116
+ }
117
+ ) }, e.id))
118
+ ]
119
+ }
120
+ )
121
+ ] })
122
+ }
123
+ );
124
+ }
125
+ );
126
+ C.displayName = "Filters";
127
+ export {
128
+ C as Filters
129
+ };
@@ -32,6 +32,7 @@ export * from './date-range-picker';
32
32
  export * from './autocomplete';
33
33
  export * from './slider';
34
34
  export * from './segmented';
35
+ export * from './filters';
35
36
  export * from './modal';
36
37
  export * from './command-palette';
37
38
  export * from './drawer';