@saar-ai/web-widget 0.11.0 → 0.12.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.
@@ -1,4 +1,4 @@
1
- import { i as ConciergeWidget, v as detectPage } from "../chunks/host-widget-BZKCb7yR.js";
1
+ import { i as ConciergeWidget, v as detectPage } from "../chunks/host-widget-Cc0KjJwZ.js";
2
2
  import { useCallback, useEffect, useMemo, useRef } from "react";
3
3
  import { usePathname, useRouter } from "next/navigation";
4
4
  //#region src/next/use-next-bridge.ts
@@ -1,3 +1,4 @@
1
+ import type { WidgetLauncherSpec } from './widget-view.js';
1
2
  import { type WidgetAvatar } from '../avatar.js';
2
3
  import { alignOf, type ConciergePosition } from './position.js';
3
4
  /**
@@ -46,8 +47,22 @@ export interface ConciergeLauncherProps {
46
47
  readonly testId?: string;
47
48
  /** Which face renders inside the pill. Defaults to `'orb'` — see `avatar.ts`. */
48
49
  readonly avatar?: WidgetAvatar;
50
+ /**
51
+ * What the launcher has to say while the panel is closed —
52
+ * docs/CONCIERGE_GENERATIONS.md §4. The dock says these things in its row;
53
+ * the widget has no row, so they land here. Absent is the quiet launcher
54
+ * every caller had before phase 4.
55
+ */
56
+ readonly spec?: WidgetLauncherSpec;
57
+ /**
58
+ * `spec.initials` — the operator's, from the shared `handoffInitials`. An
59
+ * empty string is a real answer (a tenant who never turned
60
+ * `handoff.showOperatorName` on): the face falls back to the neutral mark
61
+ * rather than drawing an empty disc.
62
+ */
63
+ readonly initials?: string;
49
64
  }
50
- export declare function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChange, onOpen, hidden, id, testId, avatar, }: ConciergeLauncherProps): import("react").JSX.Element;
65
+ export declare function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChange, onOpen, hidden, id, testId, avatar, spec, initials, }: ConciergeLauncherProps): import("react").JSX.Element;
51
66
  /** Re-exported so a host can type its own stored value. */
52
67
  export { alignOf };
53
68
  //# sourceMappingURL=concierge-launcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"concierge-launcher.d.ts","sourceRoot":"","sources":["../../src/widget/concierge-launcher.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EACL,OAAO,EAIP,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,4EAA4E;IAC5E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;CAChC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,EAAE,EACF,MAAM,EACN,MAA8B,GAC/B,EAAE,sBAAsB,+BAuOxB;AAED,2DAA2D;AAC3D,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"concierge-launcher.d.ts","sourceRoot":"","sources":["../../src/widget/concierge-launcher.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,E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@@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
+ import type { CallerInterruptReason } from '@saar-ai/widget-protocol/telemetry';
3
+ import type { WidgetLauncherSpec } from './widget-view.js';
2
4
  import type { BotState } from '../bot-state.js';
3
5
  import { type WidgetAvatar } from '../avatar.js';
4
6
  import { type ConciergePosition } from './position.js';
@@ -96,6 +98,27 @@ export interface ConciergeShellVoice {
96
98
  readonly onEnd?: () => void;
97
99
  /** Ask the browser for the microphone again, after it was refused. */
98
100
  readonly onRetryMic?: () => void;
101
+ /**
102
+ * §4's `speaking` row — cut the agent off mid-reply. The dock puts this in
103
+ * its row; the widget puts it beside the microphone. Absent means the host
104
+ * cannot interrupt, and no control is drawn.
105
+ *
106
+ * The reason is `@saar-ai/widget-protocol/telemetry`'s vocabulary, narrowed
107
+ * exactly as `DockVoiceProps.onInterrupt` narrows it and for the same
108
+ * reason: this control is a TAP, and `'keyboard'` — "switched to text
109
+ * mid-reply" — fires from wherever a typed turn is submitted, never from
110
+ * here. The widget has no duck gesture, so `'tap'` is the only reason this
111
+ * chrome ever emits; the parameter stays because the two renderers report
112
+ * into one telemetry stream and a second spelling would split it.
113
+ */
114
+ readonly onInterrupt?: (reason: Exclude<CallerInterruptReason, 'keyboard'>) => void;
115
+ /**
116
+ * §4's `fix_browser` control. The browser refused the microphone and only
117
+ * the HOST knows how to help — a Shopify storefront and a bare page have
118
+ * different answers — so this is the host's callback, drawn only when it
119
+ * exists.
120
+ */
121
+ readonly onFixPermission?: () => void;
99
122
  readonly muted?: boolean;
100
123
  readonly onToggleMute?: () => void;
101
124
  /** True while the agent is talking, so the bar can offer the interrupt. */
@@ -118,6 +141,8 @@ export interface ConciergeShellVoice {
118
141
  readonly status?: string;
119
142
  /** Shown while the agent speaks: "go ahead and interrupt". */
120
143
  readonly interrupt?: string;
144
+ /** The `fix_browser` control's own label. */
145
+ readonly fixBrowser?: string;
121
146
  /** The retry button, offered only when the microphone was refused. */
122
147
  readonly retry?: string;
123
148
  /**
@@ -165,6 +190,25 @@ export interface ConciergeShellProps {
165
190
  readonly state: BotState;
166
191
  /** One-shot flourish when the visitor's own message lands. */
167
192
  readonly messageArrived?: boolean;
193
+ /**
194
+ * What the launcher says while the panel is closed —
195
+ * docs/CONCIERGE_GENERATIONS.md §4, forwarded verbatim to
196
+ * `ConciergeLauncher`. `ShellRenderer` derives it; a hand-made caller (the
197
+ * marketing preview, the console's frames) leaves it out and gets the quiet
198
+ * launcher it always had.
199
+ */
200
+ readonly launcher?: WidgetLauncherSpec;
201
+ /** `launcher.initials` — the operator's, already computed by the caller. */
202
+ readonly launcherInitials?: string;
203
+ /** `typing` — somebody on the other side is composing; drawn at the foot of the transcript. */
204
+ readonly typing?: boolean;
205
+ /**
206
+ * §4's `human` row: the person holding the conversation, named under the
207
+ * orb. The dock says this in its row; the widget says it in the panel's
208
+ * header, which is the only place in this chrome that is always visible
209
+ * while the panel is open.
210
+ */
211
+ readonly operatorName?: string;
168
212
  /** Which face — the 'orb' blob or the 'knot' rope line. Defaults to `'orb'`; see `avatar.ts`. */
169
213
  readonly avatar?: WidgetAvatar;
170
214
  readonly labels: ConciergeShellLabels;
@@ -251,5 +295,5 @@ export interface ConciergeShellProps {
251
295
  */
252
296
  readonly attribution?: WidgetAttribution;
253
297
  }
254
- export declare function ConciergeShell({ open, onOpenChange, state, messageArrived, avatar, labels, children, badge, draft, onDraftChange, onSubmit, composerDisabled, voice, announcement, skin, skinStyle, idPrefix, scrollKey, composerLeading, testIds, position, onPositionChange, attribution, }: ConciergeShellProps): import("react").JSX.Element;
298
+ export declare function ConciergeShell({ open, onOpenChange, state, messageArrived, launcher, launcherInitials, typing, operatorName, avatar, labels, children, badge, draft, onDraftChange, onSubmit, composerDisabled, voice, announcement, skin, skinStyle, idPrefix, scrollKey, composerLeading, testIds, position, onPositionChange, attribution, }: ConciergeShellProps): import("react").JSX.Element;
255
299
  //# sourceMappingURL=concierge-shell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"concierge-shell.d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hase, micOpen, onToggleMic, onEndCall, statusLine, escalated, humanTyping, draft, onDraftChange, submit, attaching, onAttach, attachInput, transcript, extras, messages, skinStyle, avatar, attribution, dock, }: ConversationView): import("react").JSX.Element;
2
+ export declare function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndCall, statusKind, statusLine, escalated, operatorName, humanTyping, composing, channel, draft, onDraftChange, submit, attaching, onAttach, attachInput, transcript, extras, messages, skinStyle, avatar, attribution, voice: derivedVoice, dock, }: ConversationView): import("react").JSX.Element;
3
3
  //# sourceMappingURL=shell-renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell-renderer.d.ts","sourceRoot":"","sources":["../../src/widget/shell-renderer.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQ3D,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,KAAK,EACL,aAAa,EACb,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,IAAI,GACL,EAAE,gBAAgB,+BAyHlB"}
1
+ {"version":3,"file":"shell-renderer.d.ts","sourceRoot":"","sources":["../../src/widget/shell-renderer.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQ3D,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,SAAS,EACT,OAAO,EACP,KAAK,EACL,aAAa,EACb,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,IAAI,GACL,EAAE,gBAAgB,+BAoPlB"}
@@ -33,6 +33,38 @@ import type { BotState } from '../bot-state.js';
33
33
  import type { ConciergeSnapshot, ConciergeState, ConciergeStateInput } from '../concierge-state.js';
34
34
  /** What the panel does in this state. `as-is` is the common answer: the shopper put it where it is. */
35
35
  export type WidgetPanelPolicy = 'as-is' | 'closed';
36
+ /**
37
+ * The launcher, per state — the widget's counterpart to everything the dock
38
+ * says with its ROW (docs/CONCIERGE_GENERATIONS.md §4).
39
+ *
40
+ * The dock can say things in the row because the row is always on screen.
41
+ * While the widget's panel is closed the launcher is all there is, so this is
42
+ * the whole of what it can say. Every field is `false` in the states with
43
+ * nothing to add, so a renderer reads one shape rather than fourteen.
44
+ */
45
+ export interface WidgetLauncherSpec {
46
+ /** `connecting` — working, and the keyboard is still available (§4). */
47
+ readonly busy: boolean;
48
+ /**
49
+ * `ducked` — the dock recedes its row behind glass; the widget has no row,
50
+ * so the LAUNCHER recedes instead. Deliberately not glass: §4 records glass
51
+ * as having no widget analogue.
52
+ */
53
+ readonly dimmed: boolean;
54
+ /** `offline` — there is nothing to open, and the tenant's message says why. */
55
+ readonly disabled: boolean;
56
+ /**
57
+ * Something landed behind a closed panel — `cards` (the dock's
58
+ * "{n} picks — see") and `reconnecting`. The renderer draws a dot; the count
59
+ * itself is `shelfCount`.
60
+ */
61
+ readonly badge: boolean;
62
+ /**
63
+ * `human` — the operator's initials replace the mark, the widget's
64
+ * counterpart to the dock's handoff disc (§4's surfaces table).
65
+ */
66
+ readonly initials: boolean;
67
+ }
36
68
  /**
37
69
  * The line the panel shows for this state, as data. `key` is a
38
70
  * `WidgetMessages` key resolved by the renderer against the tenant's
@@ -52,12 +84,44 @@ export interface WidgetView {
52
84
  readonly state: ConciergeState;
53
85
  /** The avatar's mood — the four `BotState`s the widget already draws. */
54
86
  readonly avatar: BotState;
55
- /** The launcher carries a notification badge — something landed while the panel was closed. */
56
- readonly badge: boolean;
87
+ /** What the launcher says while the panel is closed — see {@link WidgetLauncherSpec}. */
88
+ readonly launcher: WidgetLauncherSpec;
57
89
  readonly panel: WidgetPanelPolicy;
58
90
  readonly status: WidgetStatusSpec;
59
91
  /** The composer cannot be used in this state. */
60
92
  readonly composerDisabled: boolean;
93
+ /**
94
+ * The status belongs in an `aria-live` region as well as on screen.
95
+ *
96
+ * Not every state's does. A partial transcript rewrites itself on every word
97
+ * and a preamble is already being spoken aloud; announcing those talks over
98
+ * the shopper. What earns an announcement is a state they have to ACT on or
99
+ * would otherwise miss: the microphone closed, a permission refused, the
100
+ * connection dropped, an error, the shop closed, a human arriving.
101
+ */
102
+ readonly announce: boolean;
103
+ /**
104
+ * Somebody on the other side is composing; the panel shows dots.
105
+ *
106
+ * Read from the INPUT, not from the state, and the difference matters: the
107
+ * machine's `typing` state is "an engaged text session" — the dock's name
108
+ * for the row whose caption is the shopper's own field — and it is true for
109
+ * the whole of a text conversation. What the dots mean is `input.composing`,
110
+ * which is what `deriveDockView` draws its own dots from (`activity:
111
+ * 'dots'`). A widget keyed on the STATE would show dots for the entire
112
+ * session, which is the bug this comment exists to stop coming back.
113
+ *
114
+ * True only in the two states the dock draws dots in — `typing` and
115
+ * `human`. The voice states have their own activity (a waveform, a
116
+ * progress track), and dots under a live call would claim the wrong thing
117
+ * is happening.
118
+ */
119
+ readonly typing: boolean;
120
+ /**
121
+ * `speaking` — the agent is talking and the shopper may cut in. The dock
122
+ * offers this in its row; the widget offers it in the panel.
123
+ */
124
+ readonly interrupt: boolean;
61
125
  /** Shared with the dock, never recomputed — see `ConciergeSnapshot`. */
62
126
  readonly handoff: boolean;
63
127
  readonly callActive: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"widget-view.d.ts","sourceRoot":"","sources":["../../src/widget/widget-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAA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AK,EAAE,cAAc,CAAC;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,iDAAiD;IACjD,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,mBAAmB,GACzB,UAAU,CAmNZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saar-ai/web-widget",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "saar:distribution": "publishable",
5
5
  "description": "The concierge widget's React UI — ConciergeShell chrome plus the full end-user conversation (VoiceWidget, useChatSession, useVoiceSession) — de-Nexted for the merchant-site embed (docs/WIDGET_EMBED_PLAN.md §4 Phase 3). Publishes PUBLICLY to npmjs (docs/WIDGET_EMBED_PLAN.md §5.1) — every workspace and third-party runtime dependency is bundled into dist/ at build time, so \"dependencies\" is empty. React and react-dom are peer dependencies only; next is an optional peer, needed only by the ./next subpath (Phase 5).",
6
6
  "type": "module",
@@ -0,0 +1,51 @@
1
+ /*
2
+ * The concierge's brand aliases, and the utilities they register.
3
+ *
4
+ * Split out of `concierge.css` for docs/CONCIERGE_GENERATIONS.md §3: that file
5
+ * is the DOCK's decoration and the widget's entry deliberately does not import
6
+ * it, but these aliases are not the dock's — the shared transcript
7
+ * (`voice-widget.tsx`) colours the shopper's own bubble with
8
+ * `from-brand-plum`, so a generation without them draws that bubble with no
9
+ * rules at all. Which is exactly what shipped until phase 4's baselines showed
10
+ * the caller's line missing from the widget entirely.
11
+ *
12
+ * Both entries import this; neither owns it.
13
+ *
14
+ * `@theme inline` on purpose: the values track the mode-dependent aliases
15
+ * above rather than freezing the light-mode value at build time.
16
+ */
17
+ :root {
18
+ --brand-plum: var(--color-brand-plum-800);
19
+ --brand-rose: var(--color-brand-rose-500);
20
+ --brand-amber: var(--color-brand-amber-400);
21
+ /* Darkened amber for text gradients, so they clear WCAG AA large text. */
22
+ --brand-amber-deep: var(--color-brand-amber-500);
23
+ --brand-ink: var(--color-brand-ink);
24
+ --brand-surface: var(--background);
25
+ }
26
+
27
+ .dark {
28
+ /* Brand plum at 42% lightness on a 15% background is unreadable; the shared
29
+ theme lifts `--primary` to a lighter step for exactly this reason, and the
30
+ widget makes the same move. */
31
+ --brand-plum: var(--color-brand-plum-400);
32
+ --brand-rose: var(--color-brand-rose-400);
33
+ --brand-amber: var(--color-brand-amber-400);
34
+ --brand-amber-deep: var(--color-brand-amber-300);
35
+ --brand-ink: var(--foreground);
36
+ --brand-surface: var(--background);
37
+ }
38
+
39
+ /*
40
+ * Utility colours (`bg-brand-plum`, `text-brand-amber-deep`, …). Registered
41
+ * `inline` so they track the mode-dependent values above rather than freezing
42
+ * the light-mode value at build time.
43
+ */
44
+ @theme inline {
45
+ --color-brand-plum: var(--brand-plum);
46
+ --color-brand-rose: var(--brand-rose);
47
+ --color-brand-amber: var(--brand-amber);
48
+ --color-brand-amber-deep: var(--brand-amber-deep);
49
+ --color-brand-ink: var(--brand-ink);
50
+ --color-brand-surface: var(--brand-surface);
51
+ }
@@ -36,7 +36,20 @@
36
36
  @source '../avatar-face.tsx';
37
37
  @source '../rope-knot.tsx';
38
38
  @source '../morphing-loader.tsx';
39
+ /*
40
+ * The TRANSCRIPT and everything in it — `renderLog`, the turn bubbles, the
41
+ * transcript events, the delivery ticks, the attachment list, the typing dots
42
+ * and the opener chips all live in `voice-widget.tsx`, which builds the
43
+ * `ConversationView` BOTH renderers draw. It is shared chrome, not the dock's,
44
+ * and leaving it out of this scan shipped a widget whose shopper-side bubbles
45
+ * had no rules at all: `from-brand-plum`, `rounded-ee-md` and the rest existed
46
+ * only in the dock's sheet. Caught by phase 4's baselines, where the caller's
47
+ * own line was invisible.
48
+ */
49
+ @source '../voice-widget.tsx';
39
50
  @source '../widget-markdown.tsx';
40
51
  @source '../widget-cards.tsx';
41
52
  @source '../widget-cart-summary.tsx';
42
53
  @import './tokens.css';
54
+ /* The brand aliases the shared transcript colours itself with — see `brand.css`. */
55
+ @import './brand.css';
@@ -1,6 +1,12 @@
1
1
  /*
2
- * The concierge widget's own theme: the brand aliases it colours itself with,
3
- * and every animation its face and panel run on.
2
+ * The DOCK's decoration: every animation its face and panel run on.
3
+ *
4
+ * The brand aliases these rules read (`--brand-plum` and friends, and the
5
+ * `@theme inline` block that turns them into `bg-brand-plum` utilities) moved
6
+ * to `brand.css` in phase 4, because the WIDGET needs them and does not import
7
+ * this file. Imported back below, so every consumer that has only ever
8
+ * imported `concierge.css` — `apps/storybook`, `apps/marketing` — keeps the
9
+ * theme it always had. Importing it twice is free: Tailwind emits one copy.
4
10
  *
5
11
  * ## Why this is in the shared theme and not in one app
6
12
  *
@@ -22,6 +28,7 @@
22
28
  * widget announces its state through a live region, so `prefers-reduced-motion`
23
29
  * can stop all of it wholesale without a caller losing anything.
24
30
  */
31
+ @import './brand.css';
25
32
 
26
33
  /*
27
34
  * Single-name aliases onto the shared ramps in `color-tokens.css`.
@@ -31,42 +38,6 @@
31
38
  * whole widget without touching a class. Editing a colour still means editing
32
39
  * the ramp, once, for the product and the site together.
33
40
  */
34
- :root {
35
- --brand-plum: var(--color-brand-plum-800);
36
- --brand-rose: var(--color-brand-rose-500);
37
- --brand-amber: var(--color-brand-amber-400);
38
- /* Darkened amber for text gradients, so they clear WCAG AA large text. */
39
- --brand-amber-deep: var(--color-brand-amber-500);
40
- --brand-ink: var(--color-brand-ink);
41
- --brand-surface: var(--background);
42
- }
43
-
44
- .dark {
45
- /* Brand plum at 42% lightness on a 15% background is unreadable; the shared
46
- theme lifts `--primary` to a lighter step for exactly this reason, and the
47
- widget makes the same move. */
48
- --brand-plum: var(--color-brand-plum-400);
49
- --brand-rose: var(--color-brand-rose-400);
50
- --brand-amber: var(--color-brand-amber-400);
51
- --brand-amber-deep: var(--color-brand-amber-300);
52
- --brand-ink: var(--foreground);
53
- --brand-surface: var(--background);
54
- }
55
-
56
- /*
57
- * Utility colours (`bg-brand-plum`, `text-brand-amber-deep`, …). Registered
58
- * `inline` so they track the mode-dependent values above rather than freezing
59
- * the light-mode value at build time.
60
- */
61
- @theme inline {
62
- --color-brand-plum: var(--brand-plum);
63
- --color-brand-rose: var(--brand-rose);
64
- --color-brand-amber: var(--brand-amber);
65
- --color-brand-amber-deep: var(--brand-amber-deep);
66
- --color-brand-ink: var(--brand-ink);
67
- --color-brand-surface: var(--brand-surface);
68
- }
69
-
70
41
  /* Widget preview ------------------------------------------------------ */
71
42
  @keyframes scan {
72
43
  0% {