@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,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guardrails settings — the ADS settings-screen recipe, built only from ADS
|
|
3
|
+
* exports.
|
|
4
|
+
*
|
|
5
|
+
* Follows principle `settings-screens` (see `get_principles`):
|
|
6
|
+
*
|
|
7
|
+
* - One white page in the app window: BodyPageHeader (a 64px bar with the
|
|
8
|
+
* title, the one save action and a full-width hairline), then the setting
|
|
9
|
+
* groups 32px apart.
|
|
10
|
+
* - Every group FILLS the panel's width between its 24px side insets — never a
|
|
11
|
+
* fixed reading-width column — so each row's control lines up on the panel's
|
|
12
|
+
* right edge under the save action.
|
|
13
|
+
* - A group is a 16px Medium title over a SettingList; each SettingRow reads
|
|
14
|
+
* bare glyph → label + one-line description → the control that changes it
|
|
15
|
+
* (Switch, a Button showing the current value, or a Badge).
|
|
16
|
+
*
|
|
17
|
+
* Copy it and replace GROUPS with your own settings.
|
|
18
|
+
*/
|
|
19
|
+
import * as React from "react";
|
|
20
|
+
import {
|
|
21
|
+
Badge,
|
|
22
|
+
BodyPageHeader,
|
|
23
|
+
Button,
|
|
24
|
+
SettingList,
|
|
25
|
+
SettingRow,
|
|
26
|
+
Switch,
|
|
27
|
+
} from "@actioneer/ads";
|
|
28
|
+
import { Call, CheckCircle, FileText, Info, Refresh } from "@actioneer/ads/lib/icons";
|
|
29
|
+
|
|
30
|
+
type Control =
|
|
31
|
+
| { kind: "switch"; on: boolean }
|
|
32
|
+
| { kind: "button"; label: string }
|
|
33
|
+
| { kind: "badge"; label: string };
|
|
34
|
+
|
|
35
|
+
interface Setting {
|
|
36
|
+
id: string;
|
|
37
|
+
icon: React.ReactNode;
|
|
38
|
+
label: string;
|
|
39
|
+
description: string;
|
|
40
|
+
control: Control;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const GROUPS: { title: string; settings: Setting[] }[] = [
|
|
44
|
+
{
|
|
45
|
+
title: "Calling window",
|
|
46
|
+
settings: [
|
|
47
|
+
{ id: "hours", icon: <Call />, label: "Calling hours", description: "Leads are dialled only inside this window", control: { kind: "button", label: "10:00 – 19:00" } },
|
|
48
|
+
{ id: "retry", icon: <Refresh />, label: "Retry unanswered calls", description: "Up to 3 attempts, 2 hours apart", control: { kind: "switch", on: true } },
|
|
49
|
+
{ id: "dnd", icon: <CheckCircle />, label: "Respect the DND registry", description: "Skip numbers on the national do-not-call list", control: { kind: "switch", on: true } },
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: "Compliance",
|
|
54
|
+
settings: [
|
|
55
|
+
{ id: "rates", icon: <Info />, label: "Block rate quotes", description: "The agent never quotes a rate outside the approved sheet", control: { kind: "switch", on: true } },
|
|
56
|
+
{ id: "disclosure", icon: <FileText />, label: "Disclosure script", description: "Read at the start of every call", control: { kind: "button", label: "Edit" } },
|
|
57
|
+
{ id: "talk-over", icon: <Info />, label: "Talk-over limit", description: "Flag calls where the agent talks over the lead for 2s or more", control: { kind: "badge", label: "2s" } },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
title: "Escalation",
|
|
62
|
+
settings: [
|
|
63
|
+
{ id: "handoff", icon: <Call />, label: "Hand off to a person", description: "When the lead asks for a person twice", control: { kind: "switch", on: false } },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
export function GuardrailsSettingsScreen() {
|
|
69
|
+
const [switches, setSwitches] = React.useState<Record<string, boolean>>(() =>
|
|
70
|
+
Object.fromEntries(
|
|
71
|
+
GROUPS.flatMap((group) => group.settings)
|
|
72
|
+
.filter((setting) => setting.control.kind === "switch")
|
|
73
|
+
.map((setting) => [setting.id, (setting.control as { on: boolean }).on]),
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const control = (setting: Setting) => {
|
|
78
|
+
switch (setting.control.kind) {
|
|
79
|
+
case "switch":
|
|
80
|
+
return (
|
|
81
|
+
<Switch
|
|
82
|
+
aria-label={setting.label}
|
|
83
|
+
checked={switches[setting.id]}
|
|
84
|
+
onCheckedChange={(on) => setSwitches((current) => ({ ...current, [setting.id]: on }))}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
case "button":
|
|
88
|
+
return <Button variant="outline">{setting.control.label}</Button>;
|
|
89
|
+
case "badge":
|
|
90
|
+
return <Badge color="success">{setting.control.label}</Badge>;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div className="flex h-screen bg-surface p-3 text-foreground">
|
|
96
|
+
{/* The app window: one rounded surface on the WG3 backdrop. */}
|
|
97
|
+
<div className="flex min-w-0 flex-1 overflow-hidden rounded-window border border-border bg-card shadow-window">
|
|
98
|
+
<section aria-label="Guardrails" className="flex min-w-0 flex-1 flex-col overflow-hidden">
|
|
99
|
+
<BodyPageHeader title="Guardrails" actions={<Button>Save changes</Button>} />
|
|
100
|
+
<div className="flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto px-6 pb-6">
|
|
101
|
+
{GROUPS.map((group) => (
|
|
102
|
+
// w-full: the group fills the panel — no max-width column.
|
|
103
|
+
<section key={group.title} aria-label={group.title} className="flex w-full flex-col gap-2">
|
|
104
|
+
<h2 className="m-0 text-l font-medium text-on-white-primary">{group.title}</h2>
|
|
105
|
+
<SettingList>
|
|
106
|
+
{group.settings.map((setting) => (
|
|
107
|
+
<SettingRow
|
|
108
|
+
key={setting.id}
|
|
109
|
+
icon={setting.icon}
|
|
110
|
+
label={setting.label}
|
|
111
|
+
description={setting.description}
|
|
112
|
+
action={control(setting)}
|
|
113
|
+
/>
|
|
114
|
+
))}
|
|
115
|
+
</SettingList>
|
|
116
|
+
</section>
|
|
117
|
+
))}
|
|
118
|
+
</div>
|
|
119
|
+
</section>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
Binary file
|
package/fonts.css
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
/* @actioneer/ads — generated by scripts/build-lib-styles.mjs. Do not edit. */
|
|
2
2
|
@import "@fontsource-variable/jetbrains-mono/wght.css";
|
|
3
3
|
|
|
4
|
-
/*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
src: url("./fonts/aribau-grotesk-regular.woff2") format("woff2");
|
|
14
|
-
font-weight: 100 499;
|
|
15
|
-
font-style: normal;
|
|
16
|
-
font-display: swap;
|
|
17
|
-
}
|
|
4
|
+
/* Geist — ADS body and UI typeface (SIL Open Font License, bundled).
|
|
5
|
+
One variable face covers every weight; ADS source uses only Regular (400)
|
|
6
|
+
and Medium (500). `font-synthesis-weight: none` (index.css) blocks faux
|
|
7
|
+
bolding.
|
|
8
|
+
|
|
9
|
+
Season Mix — ADS heading typeface (`--font-heading`). It is a licensed
|
|
10
|
+
font, so ADS does NOT bundle or redistribute it: each product declares its
|
|
11
|
+
own `@font-face { font-family: "Season Mix"; … }` from its licensed file.
|
|
12
|
+
Without it, headings fall back to the platform serif. */
|
|
18
13
|
@font-face {
|
|
19
|
-
font-family: "
|
|
20
|
-
src: url("./fonts/
|
|
21
|
-
font-weight:
|
|
14
|
+
font-family: "Geist";
|
|
15
|
+
src: url("./fonts/geist-variable.woff2") format("woff2");
|
|
16
|
+
font-weight: 100 900;
|
|
22
17
|
font-style: normal;
|
|
23
18
|
font-display: swap;
|
|
24
19
|
}
|
package/lib/icons.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as p, Fragment as d, jsx as a } from "react/jsx-runtime";
|
|
3
3
|
import * as r from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Info as $, Code as k, Check as S, Copy as f, FileText as P, UploadSimple as T, X as w, EyeSlash as L, Eye as A, MagnifyingGlass as m, Minus as x, Plus as B, CaretDown as I, FunnelSimple as y, WarningCircle as U, Warning as F, CheckCircle as M, CaretRight as D, CaretUp as O, ArrowsDownUp as b, ChatCircle as R, ArrowUpRight as v, Clock as H, Database as E, ArrowSquareOut as G, Table as W, CaretLeft as z, CornersOut as V, Magnet as N, Tray as j, ArrowLeft as X, DotsThree as Q, User as q, XCircle as _, CircleDashed as J, ArrowsClockwise as K, Paperclip as Y, Quotes as Z, At as ee, Lightning as oe, Sparkle as te, File as ne, DownloadSimple as se, Image as C, BracketsCurly as ae, MusicNotes as re, VideoCamera as ce, ImageBroken as ie, Pulse as le, Archive as he, ArrowDown as Ce, ArrowRight as ge, ArrowUp as ue, Scroll as pe, Bell as de, Stack as $e, BookOpen as ke, Brain as Se, CalendarBlank as fe, Phone as Pe, ListChecks as Te, Cube as we, DotsNine as Le, Folder as Ae, FolderOpen as me, Gauge as xe, GitBranch as Be, Hash as Ie, ClockCounterClockwise as ye, House as Ue, SquaresFour as Fe, Leaf as Me, Lightbulb as De, Link as Oe, CircleNotch as be, SignOut as Re, Envelope as ve, Microphone as He, MicrophoneSlash as Ee, DotsThreeVertical as Ge, Palette as We, SidebarSimple as ze, Pause as Ve, PencilSimple as Ne, PhoneIncoming as je, PhoneSlash as Xe, ChartPie as Qe, Play as qe, Plug as _e, Presentation as Je, Rocket as Ke, Gear as Ye, Shapes as Ze, ShareNetwork as eo, Star as oo, Stop as to, ArrowsLeftRight as no, Target as so, Binoculars as ao, TextB as ro, TextT as co, TextItalic as io, TextStrikethrough as lo, TextUnderline as ho, ToggleRight as Co, Trash as go, Users as uo, Wrench as po } from "@phosphor-icons/react";
|
|
5
5
|
const $o = r.createContext(!1), ko = /* @__PURE__ */ new Set(["Info"]), So = new Set(
|
|
6
6
|
[
|
|
7
7
|
"FunnelSimple",
|
|
@@ -58,10 +58,10 @@ function e(o, c) {
|
|
|
58
58
|
});
|
|
59
59
|
return i.displayName = c, i;
|
|
60
60
|
}
|
|
61
|
-
const wo = e(
|
|
61
|
+
const wo = e(Ce, "ArrowDown"), Lo = e(X, "ArrowLeft"), Ao = e(ge, "ArrowRight"), mo = e(ue, "ArrowUp"), xo = e(v, "ArrowUpRight"), Bo = e(I, "ChevronDown"), Io = e(z, "ChevronLeft"), yo = e(D, "ChevronRight"), Uo = e(O, "ChevronUp"), Fo = e(b, "SortIcon"), Mo = e(no, "SwapHorizontal"), Do = e(G, "ExternalLink"), Oo = e(ze, "PanelLeft"), bo = e(ee, "At"), Ro = e(Pe, "Call"), vo = e(je, "PhoneIncoming"), Ho = e(w, "Close"), Eo = e(_, "CloseCircle"), Go = e(f, "Copy"), Wo = e(se, "Download"), zo = e(Re, "LogOut"), Vo = e(He, "Mic"), No = e(Ee, "MicOff"), jo = e(Xe, "PhoneOff"), Xo = e(Ne, "Pencil"), Qo = e(Z, "Quote"), qo = e(A, "Eye"), _o = e(L, "EyeOff"), Jo = e(Ie, "Hash"), Ko = e(C, "ImageUpload"), Yo = e(T, "Upload"), Zo = e(co, "TextFont"), et = e(ro, "TextBold"), ot = e(io, "TextItalicStyle"), tt = e(lo, "TextStrike"), nt = e(
|
|
62
62
|
ho,
|
|
63
63
|
"TextUnderlineStyle"
|
|
64
|
-
), st = e(Co, "ToggleOn"), at = e(
|
|
64
|
+
), st = e(Co, "ToggleOn"), at = e(fe, "Calendar"), rt = e(H, "Clock"), ct = e(k, "Code"), it = e(to, "Stop"), lt = e(N, "Magnet"), ht = e(V, "Maximize"), Ct = e(x, "Minus"), gt = e(Q, "MoreHorizontal"), ut = e(Ge, "MoreVertical"), pt = e(Le, "DragHandle"), dt = e(Oe, "Link"), $t = e(B, "Plus"), kt = e(K, "Refresh"), St = e(pe, "AuditTrail"), ft = e(m, "Search"), Pt = e(eo, "Share"), Tt = e(go, "Trash"), wt = e(S, "Check"), Lt = e(be, "Loader"), At = e(M, "CheckCircle"), mt = e($, "Info"), xt = e(F, "Warning"), Bt = e(de, "Bell"), It = e(U, "WarningCircle"), yt = e(le, "Activity"), Ut = e(R, "AgentChat"), Ft = e(oe, "Bolt"), Mt = e(ke, "BookOpen"), Dt = e(Se, "Brain"), Ot = e(Te, "CheckList"), bt = e(we, "Component"), Rt = e(E, "Database"), vt = e(W, "Table"), Ht = e(y, "Filter"), Et = e(he, "Archive"), Gt = e(ne, "File"), Wt = e(P, "FileText"), zt = e(Ae, "Folder"), Vt = e(C, "Image"), Nt = e(ie, "ImageOff"), jt = e(re, "Music"), Xt = e(ce, "Video"), Qt = e(ae, "Braces"), qt = e(me, "FolderOpen"), _t = e(xe, "Gauge"), Jt = e(Be, "GitBranch"), Kt = e(ye, "HistoryClock"), Yt = e(Ue, "Home"), Zt = e($e, "Blocks"), en = e(j, "Inbox"), on = e(De, "Lightbulb"), tn = e(Me, "Leaf"), nn = e(Fe, "LayoutGrid"), sn = e(ve, "Mail"), an = e(We, "Palette"), rn = e(Qe, "PieChart"), cn = e(_e, "Plug"), ln = e(Ke, "Rocket"), hn = e(Ye, "Settings"), Cn = e(Ze, "Shapes"), gn = e(te, "Sparkles"), un = e(oo, "Star"), pn = e(ao, "Telescope"), dn = e(so, "Target"), $n = e(q, "User"), kn = e(uo, "Users"), Sn = e(qe, "Play"), fn = e(Je, "Presentation"), Pn = e(Ve, "Pause"), Tn = e(Y, "Paperclip"), wn = e(J, "CircleDashed"), Ln = e(po, "Wrench");
|
|
65
65
|
export {
|
|
66
66
|
yt as Activity,
|
|
67
67
|
Ut as AgentChat,
|