@actioneer/ads 1.0.8 → 1.0.10
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 +125 -50
- package/README.md +31 -7
- package/components/answer.js +1 -1
- package/components/assistant-ui/composer-harness.js +14 -10
- package/components/body-page-header.d.ts +9 -4
- package/components/body-page-header.js +10 -10
- package/components/breadcrumbs.js +15 -15
- package/components/button.d.ts +16 -1
- package/components/button.js +7 -4
- package/components/card.js +18 -18
- package/components/chart.d.ts +40 -4
- package/components/chart.js +824 -628
- package/components/chip.d.ts +2 -1
- package/components/chip.js +49 -46
- package/components/collection-header.js +4 -4
- package/components/connector-card.js +30 -30
- package/components/date-range-picker.js +1 -1
- package/components/detail-list.d.ts +28 -0
- package/components/detail-list.js +52 -0
- package/components/drawer.d.ts +38 -15
- package/components/drawer.js +150 -86
- package/components/empty-state.d.ts +3 -2
- package/components/empty-state.js +22 -22
- package/components/field.d.ts +16 -0
- package/components/field.js +63 -42
- package/components/file-dropzone.d.ts +15 -4
- package/components/file-dropzone.js +100 -64
- package/components/filter-bar.d.ts +44 -0
- package/components/filter-bar.js +89 -0
- package/components/filters.d.ts +37 -0
- package/components/filters.js +129 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +526 -510
- package/components/input-field.d.ts +1 -1
- package/components/input-field.js +24 -22
- package/components/modal.d.ts +2 -1
- package/components/modal.js +120 -106
- package/components/panel.js +26 -27
- package/components/popover.d.ts +6 -1
- package/components/popover.js +74 -64
- package/components/sidebar.d.ts +15 -0
- package/components/sidebar.js +166 -129
- package/components/sparkline.d.ts +30 -0
- package/components/sparkline.js +69 -0
- package/components/table.d.ts +8 -0
- package/components/table.js +357 -350
- package/components/tabs.d.ts +6 -1
- package/components/tabs.js +28 -31
- package/demo/components/add-to-artifact.js +6 -2
- package/examples/README.md +5 -2
- package/examples/call-logs-screen.tsx +381 -0
- package/examples/campaign-analysis-screen.tsx +180 -0
- package/examples/campaigns-screen.tsx +497 -0
- package/examples/guardrails-settings-screen.tsx +123 -0
- package/fonts/geist-variable.woff2 +0 -0
- package/fonts.css +12 -17
- package/lib/icons.js +3 -3
- package/llms.txt +162 -30
- package/manifest.json +11604 -7878
- package/package.json +1 -1
- package/styles.css +102 -59
- package/theme.css +81 -37
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
|
@@ -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
|
@@ -32,6 +32,8 @@ export * from './date-range-picker';
|
|
|
32
32
|
export * from './autocomplete';
|
|
33
33
|
export * from './slider';
|
|
34
34
|
export * from './segmented';
|
|
35
|
+
export * from './filters';
|
|
36
|
+
export * from './filter-bar';
|
|
35
37
|
export * from './modal';
|
|
36
38
|
export * from './command-palette';
|
|
37
39
|
export * from './drawer';
|
|
@@ -55,6 +57,8 @@ export * from './avatar';
|
|
|
55
57
|
export * from './badge';
|
|
56
58
|
export * from './chip';
|
|
57
59
|
export * from './timeline';
|
|
60
|
+
export * from './detail-list';
|
|
61
|
+
export * from './sparkline';
|
|
58
62
|
export * from './alert';
|
|
59
63
|
export * from './surface-loader';
|
|
60
64
|
export * from './brand-loader';
|