@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.
- package/DESIGN.md +119 -91
- package/README.md +19 -1
- package/components/ai-elements/chart.js +20 -20
- package/components/ai-elements/inline-citation.js +50 -50
- package/components/ai-elements/message.js +1 -1
- package/components/ai-elements/tool.js +5 -5
- package/components/alert.d.ts +3 -2
- package/components/alert.js +25 -25
- package/components/answer.js +1 -1
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +68 -49
- package/components/assistant-ui/composer-add-context.js +1 -1
- package/components/assistant-ui/composer-harness.js +5 -4
- package/components/assistant-ui/composer-trigger-popover.js +1 -1
- package/components/assistant-ui/composer.js +13 -13
- package/components/assistant-ui/message-timing.js +6 -6
- package/components/assistant-ui/selection-toolbar.js +5 -5
- package/components/assistant-ui/sources.js +15 -15
- package/components/assistant-ui/tooltip-icon-button.js +18 -14
- package/components/audio-waveform.d.ts +21 -8
- package/components/audio-waveform.js +371 -94
- package/components/autocomplete.js +9 -9
- package/components/breadcrumbs.js +36 -42
- package/components/button.d.ts +16 -1
- package/components/button.js +86 -73
- package/components/card.js +1 -1
- package/components/chart.d.ts +31 -4
- package/components/chart.js +900 -666
- package/components/chip.d.ts +2 -1
- package/components/chip.js +56 -51
- package/components/command-palette.js +12 -12
- package/components/connector-card.d.ts +1 -2
- package/components/connector-card.js +17 -17
- package/components/date-range-picker.js +1 -2
- package/components/drawer.js +9 -10
- package/components/dropdown.js +1 -1
- package/components/empty-state.d.ts +2 -0
- package/components/empty-state.js +17 -15
- package/components/field.js +9 -10
- package/components/file-dropzone.d.ts +6 -3
- package/components/file-dropzone.js +72 -60
- package/components/filters.d.ts +37 -0
- package/components/filters.js +129 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +447 -444
- package/components/infinite-canvas.js +9 -9
- package/components/modal.d.ts +2 -1
- package/components/modal.js +102 -91
- package/components/page-body.js +8 -8
- package/components/popover.d.ts +6 -1
- package/components/popover.js +75 -65
- package/components/progress-circle.d.ts +1 -1
- package/components/progress-circle.js +57 -48
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +34 -36
- package/components/select.js +2 -2
- package/components/selection-action-bar.js +32 -31
- package/components/setting-row.js +10 -10
- package/components/sidebar.d.ts +15 -0
- package/components/sidebar.js +186 -149
- package/components/slider.js +5 -5
- package/components/stepper.d.ts +1 -1
- package/components/stepper.js +1 -1
- package/components/switch.js +10 -10
- package/components/table.d.ts +10 -2
- package/components/table.js +380 -366
- package/components/tabs.d.ts +6 -1
- package/components/tabs.js +32 -29
- package/components/timeline.js +3 -3
- package/components/toast.js +53 -56
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +1 -1
- package/components/viz-charts.js +263 -221
- package/demo/components/add-to-artifact.js +3 -2
- package/examples/README.md +31 -0
- package/examples/agents-screen.tsx +477 -0
- package/examples/campaign-analysis-screen.tsx +138 -0
- package/examples/campaigns-screen.tsx +439 -0
- package/examples/settings-screen.tsx +90 -0
- package/examples/workspace-header.tsx +71 -0
- package/lib/icons.d.ts +8 -0
- package/lib/icons.js +171 -118
- package/llms.txt +93 -29
- package/manifest.json +1660 -113
- package/package.json +1 -1
- package/styles.css +55 -68
- package/theme.css +50 -59
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { FileText as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
"flex w-full cursor-pointer
|
|
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
|
-
"
|
|
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-
|
|
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
|
-
),
|
|
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:
|
|
32
|
-
accept:
|
|
33
|
+
className: a,
|
|
34
|
+
accept: y,
|
|
33
35
|
multiple: c = !1,
|
|
34
36
|
disabled: n = !1,
|
|
35
37
|
onFiles: l,
|
|
36
|
-
files:
|
|
38
|
+
files: i,
|
|
37
39
|
onClear: g,
|
|
38
|
-
label:
|
|
39
|
-
hint:
|
|
40
|
-
...
|
|
41
|
-
},
|
|
42
|
-
const
|
|
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 =
|
|
47
|
-
},
|
|
48
|
-
return /* @__PURE__ */
|
|
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:
|
|
53
|
+
ref: k,
|
|
52
54
|
"data-slot": "file-dropzone",
|
|
53
|
-
"data-dragging":
|
|
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,
|
|
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,
|
|
68
|
+
o.current -= 1, o.current <= 0 && (o.current = 0, f(!1));
|
|
67
69
|
},
|
|
68
70
|
onDrop: (e) => {
|
|
69
|
-
e.preventDefault(), o.current = 0,
|
|
71
|
+
e.preventDefault(), o.current = 0, f(!1), n || b(e.dataTransfer.files);
|
|
70
72
|
},
|
|
71
|
-
className:
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
className: p(
|
|
74
|
+
C({ hasFiles: D, isDragging: d, isDisabled: n }),
|
|
75
|
+
a
|
|
74
76
|
),
|
|
75
|
-
...
|
|
77
|
+
...z,
|
|
76
78
|
children: [
|
|
77
79
|
/* @__PURE__ */ r(
|
|
78
80
|
"input",
|
|
79
81
|
{
|
|
80
|
-
ref:
|
|
82
|
+
ref: x,
|
|
81
83
|
hidden: !0,
|
|
82
84
|
type: "file",
|
|
83
|
-
accept:
|
|
85
|
+
accept: y,
|
|
84
86
|
multiple: c,
|
|
85
87
|
disabled: n,
|
|
86
88
|
onChange: (e) => {
|
|
87
|
-
|
|
89
|
+
b(e.currentTarget.files), e.currentTarget.value = "";
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */ r("
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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__ */
|
|
98
|
-
/* @__PURE__ */ r(
|
|
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
|
-
|
|
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__ */
|
|
115
|
-
/* @__PURE__ */ r(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
142
|
+
T.displayName = "FileDropzone";
|
|
131
143
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
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
|
+
};
|
package/components/index.d.ts
CHANGED