@bluepic/embed 0.4.0-next.110 → 0.4.0-next.112
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/dist/bluepic-embed.iife.js +117 -117
- package/dist/bluepic-embed.umd.js +114 -114
- package/dist/embed/embed.d.ts +89 -1
- package/dist/main.cjs +106 -106
- package/dist/main.d.ts +1 -0
- package/dist/main.mjs +25051 -23510
- package/dist/style.css +1 -1
- package/dist/theme/bridge.d.ts +14 -0
- package/dist/theme/color.d.ts +80 -0
- package/dist/theme/css.d.ts +8 -0
- package/dist/theme/index.d.ts +19 -0
- package/dist/theme/legacy.d.ts +3 -0
- package/dist/theme/resolve.d.ts +10 -0
- package/dist/theme/tokens.d.ts +124 -0
- package/dist/theme/types-contract.d.ts +13 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.mjs +1299 -0
- package/dist/util/useTheme.d.ts +30 -431
- package/package.json +9 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy variable name (without leading `--`) → CSS value expression.
|
|
3
|
+
* May use `var(--bx-<semantic>)` and plain CSS (px, calc, shorthands).
|
|
4
|
+
*/
|
|
5
|
+
export declare const LEGACY_BRIDGE: Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Legacy keys whose CSS custom property IS a semantic token (`--<key>` === `--bx-<semantic>`),
|
|
8
|
+
* e.g. `bx-focus-ring-width` ↔ `--bx-focus-ring-width`. Their bridge value would reference itself.
|
|
9
|
+
* They are listed in `LEGACY_BRIDGE` for coverage only — emitters MUST skip them (the resolver
|
|
10
|
+
* already emits the semantic token with the same name).
|
|
11
|
+
*/
|
|
12
|
+
export declare const LEGACY_BRIDGE_IDENTITY_KEYS: ReadonlySet<string>;
|
|
13
|
+
/** `LEGACY_BRIDGE` minus the identity keys — the entries an emitter should actually write out. */
|
|
14
|
+
export declare const LEGACY_BRIDGE_ENTRIES: ReadonlyArray<readonly [legacyName: string, value: string]>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bluepic theme system v2 — colour utilities.
|
|
3
|
+
*
|
|
4
|
+
* Pure, dependency-free, SSR-safe (no Vue, no DOM). Everything the theme engine needs to
|
|
5
|
+
* turn "any CSS colour string" into numbers, reason about it perceptually (OKLab / OKLCH,
|
|
6
|
+
* Björn Ottosson 2020) and for accessibility (WCAG 2.x relative luminance / contrast), and
|
|
7
|
+
* serialise it back into CSS.
|
|
8
|
+
*
|
|
9
|
+
* Conventions
|
|
10
|
+
* RGB — r,g,b in 0..255 (floats allowed internally, rounded on format), a in 0..1
|
|
11
|
+
* OKLCH — l in 0..1, c ≥ 0, h in degrees 0..360
|
|
12
|
+
*/
|
|
13
|
+
export type RGB = {
|
|
14
|
+
r: number;
|
|
15
|
+
g: number;
|
|
16
|
+
b: number;
|
|
17
|
+
a: number;
|
|
18
|
+
};
|
|
19
|
+
export type OKLCH = {
|
|
20
|
+
l: number;
|
|
21
|
+
c: number;
|
|
22
|
+
h: number;
|
|
23
|
+
a: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const WHITE: RGB;
|
|
26
|
+
export declare const BLACK: RGB;
|
|
27
|
+
/**
|
|
28
|
+
* Parse any CSS colour: `#rgb` / `#rgba` / `#rrggbb` / `#rrggbbaa`, `rgb()` / `rgba()` (comma AND modern space
|
|
29
|
+
* syntax, `%`, `none`, alpha as 0..1 or `%`), `hsl()` / `hsla()` (`deg` / `turn` / `rad` / `grad`, `%`), all CSS
|
|
30
|
+
* named colours, `transparent`, and a bare legacy triplet `"r, g, b"` (→ a = 1).
|
|
31
|
+
* Case-insensitive, trims whitespace. Returns `null` for anything else (e.g. values containing `var()`).
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseColor(input: string | null | undefined): RGB | null;
|
|
34
|
+
/** sRGB → linear → OKLab → OKLCH. */
|
|
35
|
+
export declare function toOklch(c: RGB): OKLCH;
|
|
36
|
+
/** OKLCH → sRGB with gamut mapping (see `oklchToRgbMapped`). */
|
|
37
|
+
export declare function fromOklch(c: OKLCH): RGB;
|
|
38
|
+
/** `#rrggbb`, or `#rrggbbaa` when a < 1. */
|
|
39
|
+
export declare function formatHex(c: RGB): string;
|
|
40
|
+
/** Legacy comma syntax: `rgb(r, g, b)` when a ≥ 1, else `rgba(r, g, b, a)` (ints for rgb, alpha ≤ 3 decimals). */
|
|
41
|
+
export declare function formatRgb(c: RGB): string;
|
|
42
|
+
/** `r, g, b` (ints) — the legacy `*-rgb` triplet for `rgba(var(--x), α)` usage. Alpha is dropped. */
|
|
43
|
+
export declare function formatTriplet(c: RGB): string;
|
|
44
|
+
/** WCAG 2.x relative luminance (0..1). Alpha is ignored. */
|
|
45
|
+
export declare function relativeLuminance(c: RGB): number;
|
|
46
|
+
/**
|
|
47
|
+
* WCAG 2.x contrast ratio (1..21).
|
|
48
|
+
* If `fg.a < 1` the foreground is composited over `bg` first. `bg` is ALWAYS treated as opaque — its alpha is
|
|
49
|
+
* ignored (what it would actually sit on is unknown here; callers that know should composite it themselves).
|
|
50
|
+
*/
|
|
51
|
+
export declare function contrastRatio(fg: RGB, bg: RGB): number;
|
|
52
|
+
/** Alpha-over (`fg` over `bg`). Result alpha = fg.a + bg.a·(1 − fg.a). Fully transparent result → {0,0,0,0}. */
|
|
53
|
+
export declare function composite(fg: RGB, bg: RGB): RGB;
|
|
54
|
+
/**
|
|
55
|
+
* Perceptual mix in OKLab (t 0..1; 0 → a, 1 → b). Alpha interpolates linearly; the colour channels are
|
|
56
|
+
* interpolated alpha-premultiplied (as CSS `color-mix()` does) so fading towards a transparent colour keeps
|
|
57
|
+
* the hue of the opaque one. The result is gamut-mapped back into sRGB.
|
|
58
|
+
*/
|
|
59
|
+
export declare function mix(a: RGB, b: RGB, t: number): RGB;
|
|
60
|
+
export declare function withAlpha(c: RGB, a: number): RGB;
|
|
61
|
+
/** OKLCH lightness (0..1). */
|
|
62
|
+
export declare function lightness(c: RGB): number;
|
|
63
|
+
/** Shift OKLCH lightness by `dl` (clamped to 0..1), hue/chroma kept, gamut-mapped. */
|
|
64
|
+
export declare function adjustL(c: RGB, dl: number): RGB;
|
|
65
|
+
/** Set OKLCH lightness to `l` (clamped to 0..1), hue/chroma kept, gamut-mapped. */
|
|
66
|
+
export declare function setL(c: RGB, l: number): RGB;
|
|
67
|
+
/**
|
|
68
|
+
* Move `fg`'s OKLCH lightness away from `bg` until `contrastRatio(fg, bg) >= min`, keeping hue/chroma as far as
|
|
69
|
+
* possible (chroma is reduced progressively only if the target can't be reached at the extremes).
|
|
70
|
+
* `direction: 'auto'` picks whichever side (lighter or darker than `bg`) can reach the higher contrast.
|
|
71
|
+
* If `fg` already satisfies `min` it is returned unchanged. If `min` is unreachable the best achievable colour is
|
|
72
|
+
* returned. `fg`'s alpha is preserved (and taken into account through `contrastRatio`'s compositing).
|
|
73
|
+
* The result satisfies `min` both as returned (floats) and after 8-bit rounding (`formatHex` / `formatRgb`).
|
|
74
|
+
* Bounded: ≤ 5 chroma levels × (1 + 24) lightness probes per direction.
|
|
75
|
+
*/
|
|
76
|
+
export declare function ensureContrast(fg: RGB, bg: RGB, min: number, direction?: 'auto' | 'lighter' | 'darker'): RGB;
|
|
77
|
+
/** True when white contrasts at least as well against `c` as black does (i.e. `c` wants light ink). */
|
|
78
|
+
export declare function isDarkSurface(c: RGB): boolean;
|
|
79
|
+
/** The candidate with the highest contrast on `bg`. Default candidates: white and #111111. */
|
|
80
|
+
export declare function bestOn(bg: RGB, candidates?: RGB[]): RGB;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResolvedTheme } from './resolve';
|
|
2
|
+
/** All custom properties (keys include the leading `--`). */
|
|
3
|
+
export declare function themeToCssVars(theme: ResolvedTheme): Record<string, string>;
|
|
4
|
+
/**
|
|
5
|
+
* CSS text for one or more selectors. Also sets `color-scheme` so UA-painted controls,
|
|
6
|
+
* scrollbars and form elements follow the theme.
|
|
7
|
+
*/
|
|
8
|
+
export declare function themeToCssText(theme: ResolvedTheme, selectors: string | string[]): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @bluepic/embed — theme system v2 (pure, SSR-safe).
|
|
3
|
+
*
|
|
4
|
+
* import { resolveTheme, themeToCssText, themeColor } from '@bluepic/embed';
|
|
5
|
+
* const theme = resolveTheme({ version: 2, surface: '#000', primary: '#ffd400' });
|
|
6
|
+
* theme.tokens['on-primary'] // → contrast-corrected foreground
|
|
7
|
+
* theme.report.checks // → WCAG pairs with pass/fail
|
|
8
|
+
* themeToCssText(theme, '.my-root');
|
|
9
|
+
* themeColor.contrastRatio(themeColor.parseColor('#fff')!, themeColor.parseColor('#000')!); // 21
|
|
10
|
+
*
|
|
11
|
+
* The DOM-binding (useThemeV2 / applyTheme / legacy useTheme) lives in ../util/useTheme.ts.
|
|
12
|
+
*/
|
|
13
|
+
export * from './tokens';
|
|
14
|
+
export * from './resolve';
|
|
15
|
+
export * from './css';
|
|
16
|
+
export * from './legacy';
|
|
17
|
+
export { LEGACY_BRIDGE } from './bridge';
|
|
18
|
+
export * as themeColor from './color';
|
|
19
|
+
export type { RGB as ThemeRGB, OKLCH as ThemeOKLCH } from './color';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SemanticTokens, type ThemeInput, type ThemeReport } from './tokens';
|
|
2
|
+
export type ResolvedTheme = {
|
|
3
|
+
input: ThemeInput;
|
|
4
|
+
mode: 'dark' | 'light';
|
|
5
|
+
tokens: SemanticTokens;
|
|
6
|
+
report: ThemeReport;
|
|
7
|
+
/** Stylesheet URLs the runtime must @import for the chosen fonts (deduplicated). */
|
|
8
|
+
fontUrls: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveTheme(rawInput: ThemeInput | undefined | null): ResolvedTheme;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bluepic theme system v2 — token vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* Three tiers:
|
|
5
|
+
* 0. ThemeInput — what a user/host actually chooses (a handful of values).
|
|
6
|
+
* 1. Semantic tokens — `--bx-*`, ~60 role tokens derived from the input by `resolveTheme()`.
|
|
7
|
+
* Dark and light differ ONLY here.
|
|
8
|
+
* 2. Component tokens — the historical `--button-*`, `--input-*`, … variables that the
|
|
9
|
+
* components read today. They are defined ONCE, mode-agnostic, as
|
|
10
|
+
* references to semantic tokens (see ./bridge.ts). No more
|
|
11
|
+
* darkmode.scss / lightmode.scss forks.
|
|
12
|
+
*
|
|
13
|
+
* Everything in this file is pure data/types: no Vue, no DOM, SSR-safe.
|
|
14
|
+
*/
|
|
15
|
+
export type ThemePresetName = 'light' | 'dark';
|
|
16
|
+
export type ThemeContrast = 'normal' | 'high';
|
|
17
|
+
/** Same shape as a template font (`Template.Font`): CSS family name + stylesheet URL. */
|
|
18
|
+
export type ThemeFont = {
|
|
19
|
+
name: string;
|
|
20
|
+
src?: string;
|
|
21
|
+
};
|
|
22
|
+
export type ThemeRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
23
|
+
/**
|
|
24
|
+
* What a campaign (or any host) persists. Small, human-readable, forward-compatible:
|
|
25
|
+
* the library derives everything else, so campaigns automatically pick up design fixes.
|
|
26
|
+
*/
|
|
27
|
+
export type ThemeInput = {
|
|
28
|
+
/** Schema marker so legacy `customStyle` records can never be mistaken for this. */
|
|
29
|
+
version: 2;
|
|
30
|
+
/**
|
|
31
|
+
* Base preset. Only decides the defaults of `surface` / `primary` when those are absent.
|
|
32
|
+
* Mode (dark vs light) is ALWAYS derived from the resolved `surface`, never from this.
|
|
33
|
+
*/
|
|
34
|
+
preset?: ThemePresetName;
|
|
35
|
+
/** Page / editor background. Any CSS colour. */
|
|
36
|
+
surface?: string;
|
|
37
|
+
/** Brand colour used for primary actions, selection, focus, links. Any CSS colour. */
|
|
38
|
+
primary?: string;
|
|
39
|
+
/** High-contrast modifier (replaces the separate *-wcag presets). */
|
|
40
|
+
contrast?: ThemeContrast;
|
|
41
|
+
/** Corner radius scale. */
|
|
42
|
+
radius?: ThemeRadius;
|
|
43
|
+
/** Base font size in px (default 14). */
|
|
44
|
+
font?: {
|
|
45
|
+
size?: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Optional fonts from the user's font library (Bluepic font cloud / Google fonts via fontdelivery).
|
|
49
|
+
* `ui` → controls: buttons, inputs, selects, menus, tags, labels (`--bx-font-family`)
|
|
50
|
+
* `heading` → all "real text": titles, card names/descriptions, field titles, popup & export copy,
|
|
51
|
+
* landing-page texts (`--bx-font-family-heading`)
|
|
52
|
+
* Each is `{ name, src }` like a template font: `name` = CSS family, `src` = stylesheet URL that is
|
|
53
|
+
* @imported by the runtime. Unset → Inter.
|
|
54
|
+
*/
|
|
55
|
+
fonts?: {
|
|
56
|
+
ui?: ThemeFont;
|
|
57
|
+
heading?: ThemeFont;
|
|
58
|
+
};
|
|
59
|
+
/** 0..1 — how strongly neutral surfaces/borders are tinted with the primary hue. Default 0. */
|
|
60
|
+
tint?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Detailed tier: pin individual semantic tokens. Keys are semantic token names without the
|
|
63
|
+
* `--bx-` prefix (e.g. `"surface-1"`, `"on-primary"`). Anything not listed stays "auto".
|
|
64
|
+
*/
|
|
65
|
+
overrides?: Partial<Record<SemanticTokenName, string>>;
|
|
66
|
+
/**
|
|
67
|
+
* Escape hatch for hosts/API users: raw component-tier variables (legacy names without `--`),
|
|
68
|
+
* applied LAST. Prefer `overrides`.
|
|
69
|
+
*/
|
|
70
|
+
customStyle?: Record<string, string>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Semantic token names (without the `--bx-` prefix). Grouped by role. Every one of these is
|
|
74
|
+
* emitted as a concrete CSS value by `resolveTheme()`; colour tokens are full CSS colours
|
|
75
|
+
* (`rgb()`/`rgba()`), `*-rgb` tokens are bare `r, g, b` triplets for `rgba(var(--x), a)` use.
|
|
76
|
+
*/
|
|
77
|
+
export declare const SEMANTIC_TOKEN_NAMES: readonly ["color-scheme", "surface", "surface-rgb", "surface-1", "surface-1-rgb", "surface-2", "surface-2-rgb", "surface-3", "surface-inverse", "scrim", "ink", "ink-rgb", "text", "text-muted", "text-faint", "text-inverse", "text-on-surface-rgb", "text-on-inverse-rgb", "border", "border-strong", "divider", "border-rgb", "fill", "fill-hover", "fill-active", "field", "field-hover", "field-focus", "hover", "pressed", "primary", "primary-rgb", "primary-hover", "primary-active", "on-primary", "primary-text", "primary-border", "primary-soft", "primary-soft-hover", "focus-ring", "focus-ring-width", "focus-ring-offset", "primary-dark", "primary-dark-rgb", "primary-light", "primary-light-rgb", "primary-bright", "primary-bright-rgb", "success", "success-rgb", "on-success", "success-text", "success-soft", "success-border", "success-dark-rgb", "success-light-rgb", "success-darker-rgb", "warning", "warning-rgb", "on-warning", "warning-text", "warning-soft", "warning-border", "warning-dark-rgb", "warning-light-rgb", "warning-darker-rgb", "error", "error-rgb", "on-error", "error-text", "error-soft", "error-border", "error-dark-rgb", "error-light-rgb", "error-darker-rgb", "info", "info-rgb", "on-info", "info-text", "info-soft", "info-border", "info-dark-rgb", "info-light-rgb", "info-bright-rgb", "shadow-1", "shadow-2", "shadow-3", "radius-sm", "radius-md", "radius-lg", "radius-full", "font-family", "font-family-heading", "font-size", "root-font-size", "canvas", "canvas-image", "canvas-control", "canvas-control-hover", "on-canvas-control", "disabled-opacity"];
|
|
78
|
+
export type SemanticTokenName = (typeof SEMANTIC_TOKEN_NAMES)[number];
|
|
79
|
+
export type SemanticTokens = Record<SemanticTokenName, string>;
|
|
80
|
+
export declare const SEMANTIC_PREFIX = "--bx-";
|
|
81
|
+
/** Human-facing groups — used by the Studio "Advanced" panel and the playground Theme Lab. */
|
|
82
|
+
export declare const SEMANTIC_TOKEN_GROUPS: {
|
|
83
|
+
label: string;
|
|
84
|
+
tokens: SemanticTokenName[];
|
|
85
|
+
}[];
|
|
86
|
+
export declare const THEME_PRESETS: Record<ThemePresetName, Required<Pick<ThemeInput, 'surface' | 'primary'>>>;
|
|
87
|
+
/**
|
|
88
|
+
* House presets — curated, named ThemeInputs offered in the Studio theme step next to Light/Dark.
|
|
89
|
+
* They live here (not in the Studio) so the studio cards, the playground Theme Lab and the runtime
|
|
90
|
+
* can never drift. Mode is derived from `surface` like for any other input.
|
|
91
|
+
*/
|
|
92
|
+
export type ThemeHousePreset = {
|
|
93
|
+
key: string;
|
|
94
|
+
label: string;
|
|
95
|
+
description: string;
|
|
96
|
+
input: ThemeInput;
|
|
97
|
+
};
|
|
98
|
+
export declare const THEME_HOUSE_PRESETS: ThemeHousePreset[];
|
|
99
|
+
/** Default status hues (mode-independent bases; the resolver adapts them per surface). */
|
|
100
|
+
export declare const STATUS_BASES: {
|
|
101
|
+
readonly success: "#28a552";
|
|
102
|
+
readonly warning: "#d9a400";
|
|
103
|
+
readonly error: "#dc2f2f";
|
|
104
|
+
readonly info: "#3b82f6";
|
|
105
|
+
};
|
|
106
|
+
export type ContrastCheck = {
|
|
107
|
+
/** Human label, e.g. "Text on surface". */
|
|
108
|
+
label: string;
|
|
109
|
+
fg: SemanticTokenName;
|
|
110
|
+
bg: SemanticTokenName;
|
|
111
|
+
ratio: number;
|
|
112
|
+
/** WCAG threshold applied (4.5 text, 3 non-text; 7 / 4.5 in high-contrast). */
|
|
113
|
+
min: number;
|
|
114
|
+
pass: boolean;
|
|
115
|
+
};
|
|
116
|
+
export type ThemeReport = {
|
|
117
|
+
mode: 'dark' | 'light';
|
|
118
|
+
checks: ContrastCheck[];
|
|
119
|
+
/** Tokens that the resolver had to nudge away from the user's literal choice to stay readable. */
|
|
120
|
+
adjustments: {
|
|
121
|
+
token: SemanticTokenName;
|
|
122
|
+
reason: string;
|
|
123
|
+
}[];
|
|
124
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time contract: the engine's `ThemeInput` and the persisted schema
|
|
3
|
+
* `Studio.campaignThemeSchema` in @bluepic/types (the single source of truth for stored shapes)
|
|
4
|
+
* must describe the same object — in BOTH directions. If either side changes, this file fails to
|
|
5
|
+
* type-check, which is the point.
|
|
6
|
+
*
|
|
7
|
+
* Not imported at runtime by anything; `src/theme/index.ts` re-exports nothing from here on
|
|
8
|
+
* purpose so the pure theme bundle stays free of @bluepic/types.
|
|
9
|
+
*/
|
|
10
|
+
import type { z } from '@hono/zod-openapi';
|
|
11
|
+
import type { Studio } from '@bluepic/types';
|
|
12
|
+
type Persisted = z.infer<typeof Studio.campaignThemeSchema>;
|
|
13
|
+
export type { Persisted as PersistedCampaignTheme };
|
package/dist/theme.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=["color-scheme","surface","surface-rgb","surface-1","surface-1-rgb","surface-2","surface-2-rgb","surface-3","surface-inverse","scrim","ink","ink-rgb","text","text-muted","text-faint","text-inverse","text-on-surface-rgb","text-on-inverse-rgb","border","border-strong","divider","border-rgb","fill","fill-hover","fill-active","field","field-hover","field-focus","hover","pressed","primary","primary-rgb","primary-hover","primary-active","on-primary","primary-text","primary-border","primary-soft","primary-soft-hover","focus-ring","focus-ring-width","focus-ring-offset","primary-dark","primary-dark-rgb","primary-light","primary-light-rgb","primary-bright","primary-bright-rgb","success","success-rgb","on-success","success-text","success-soft","success-border","success-dark-rgb","success-light-rgb","success-darker-rgb","warning","warning-rgb","on-warning","warning-text","warning-soft","warning-border","warning-dark-rgb","warning-light-rgb","warning-darker-rgb","error","error-rgb","on-error","error-text","error-soft","error-border","error-dark-rgb","error-light-rgb","error-darker-rgb","info","info-rgb","on-info","info-text","info-soft","info-border","info-dark-rgb","info-light-rgb","info-bright-rgb","shadow-1","shadow-2","shadow-3","radius-sm","radius-md","radius-lg","radius-full","font-family","font-family-heading","font-size","root-font-size","canvas","canvas-image","canvas-control","canvas-control-hover","on-canvas-control","disabled-opacity"],X="--bx-",so=[{label:"Surfaces",tokens:["surface","surface-1","surface-2","surface-3","surface-inverse","scrim"]},{label:"Text",tokens:["text","text-muted","text-faint","text-inverse"]},{label:"Borders",tokens:["border","border-strong","divider"]},{label:"Neutral fills",tokens:["fill","fill-hover","fill-active","field","field-hover","field-focus","hover","pressed"]},{label:"Primary",tokens:["primary","primary-hover","primary-active","on-primary","primary-text","primary-border","primary-soft","primary-soft-hover","focus-ring"]},{label:"Success",tokens:["success","on-success","success-text","success-soft","success-border"]},{label:"Warning",tokens:["warning","on-warning","warning-text","warning-soft","warning-border"]},{label:"Error",tokens:["error","on-error","error-text","error-soft","error-border"]},{label:"Info",tokens:["info","on-info","info-text","info-soft","info-border"]},{label:"Shape & type",tokens:["radius-sm","radius-md","radius-lg","radius-full","font-family","font-family-heading","font-size"]},{label:"Canvas",tokens:["canvas","canvas-control","on-canvas-control"]}],Or={dark:{surface:"#27262e",primary:"#4472c7"},light:{surface:"#f2f2f2",primary:"#124bba"}},io=[{key:"light",label:"Light",description:"Neutral light surfaces, Bluepic blue.",input:{version:2,preset:"light"}},{key:"dark",label:"Dark",description:"Neutral dark surfaces, Bluepic blue.",input:{version:2,preset:"dark"}},{key:"midnight",label:"Midnight",description:"Near-black with cool, slightly tinted surfaces.",input:{version:2,surface:"#0f1117",primary:"#7da8f7",tint:.35}},{key:"paper",label:"Paper",description:"Warm off-white, ink-black actions, crisp corners.",input:{version:2,surface:"#fbf8f1",primary:"#1f1f1f",radius:"sm"}},{key:"slate",label:"Slate",description:"Blue-grey dark surfaces with a teal accent.",input:{version:2,surface:"#1e2530",primary:"#4fd1c5",tint:.4}},{key:"sand",label:"Sand",description:"Soft sand surfaces with a terracotta accent, rounded.",input:{version:2,surface:"#f3ede3",primary:"#b5562c",radius:"lg"}},{key:"forest",label:"Forest",description:"Deep green surfaces with a mint accent.",input:{version:2,surface:"#0e1f17",primary:"#7ad39a",tint:.5}},{key:"ocean",label:"Ocean",description:"Cool light surfaces with a deep blue accent, pill shapes.",input:{version:2,surface:"#eef4fb",primary:"#0b5cad",tint:.3,radius:"full"}}],Br={success:"#28a552",warning:"#d9a400",error:"#dc2f2f",info:"#3b82f6"},I=Object.freeze({r:255,g:255,b:255,a:1}),Z=Object.freeze({r:0,g:0,b:0,a:1}),Pr=[I,Object.freeze({r:17,g:17,b:17,a:1})],dr=(o,e,t)=>o<e?e:o>t?t:o,w=o=>dr(o,0,1),m=(o,e=0)=>Number.isFinite(o)?o:e,k=(o,e,t,a=1)=>({r:o,g:e,b:t,a}),O=o=>Math.round(dr(m(o),0,255)),ir=o=>O(o).toString(16).padStart(2,"0"),lo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Fr=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/,uo=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/,bo=/^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;function mr(o){if(o==="none")return{value:0,percent:!1};const e=o.endsWith("%"),t=e?o.slice(0,-1):o;if(!Fr.test(t))return null;const a=Number(t);return Number.isFinite(a)?{value:a,percent:e}:null}function gr(o){const e=mr(o);return e?dr(e.percent?e.value*255/100:e.value,0,255):null}function go(o){const e=mr(o);return e?w(e.percent?e.value/100:e.value):null}function Dr(o){const e=mr(o);return e?w(e.value/100):null}function fo(o){if(o==="none")return 0;const e=uo.exec(o);if(!e)return null;let t=Number(e[1]);if(!Number.isFinite(t))return null;switch(e[2]){case"turn":t*=360;break;case"rad":t*=180/Math.PI;break;case"grad":t*=.9;break}return t%=360,t<0&&(t+=360),t}function po(o){if(o.includes(",")){if(o.includes("/"))return null;const n=o.split(",").map(c=>c.trim());return n.length!==3&&n.length!==4||n.some(c=>c===""||/\s/.test(c))?null:{ch:[n[0],n[1],n[2]],alpha:n[3]}}const e=o.split("/");if(e.length>2)return null;const t=e[0].trim().split(/\s+/);if(t.length!==3)return null;let a;return e.length===2&&(a=e[1].trim(),a===""||/\s/.test(a))?null:{ch:[t[0],t[1],t[2]],alpha:a}}function ho(o,e,t){const a=n=>{const c=(n+o/30)%12,s=e*Math.min(t,1-t);return t-s*Math.max(-1,Math.min(c-3,9-c,1))};return[a(0)*255,a(8)*255,a(4)*255]}function H(o){if(typeof o!="string")return null;const e=o.trim().toLowerCase();if(!e)return null;if(e==="transparent")return k(0,0,0,0);const t=lo[e];if(t!==void 0)return k(t>>16,t>>8&255,t&255,1);if(e[0]==="#"){const n=e.slice(1);if(!/^[0-9a-f]+$/.test(n))return null;const c=i=>parseInt(n[i],16),s=i=>parseInt(n.slice(i,i+2),16);switch(n.length){case 3:return k(c(0)*17,c(1)*17,c(2)*17,1);case 4:return k(c(0)*17,c(1)*17,c(2)*17,c(3)*17/255);case 6:return k(s(0),s(2),s(4),1);case 8:return k(s(0),s(2),s(4),s(6)/255);default:return null}}const a=bo.exec(e);if(a){const n=po(a[2]);if(!n)return null;const c=n.alpha===void 0?1:go(n.alpha);if(c===null)return null;if(a[1]==="rgb"||a[1]==="rgba"){const v=gr(n.ch[0]),D=gr(n.ch[1]),p=gr(n.ch[2]);return v===null||D===null||p===null?null:k(v,D,p,c)}const s=fo(n.ch[0]),i=Dr(n.ch[1]),d=Dr(n.ch[2]);if(s===null||i===null||d===null)return null;const[b,N,g]=ho(s,i,d);return k(b,N,g,c)}if(e.includes(",")){const n=e.split(",").map(d=>d.trim());if(n.length!==3||!n.every(d=>Fr.test(d)))return null;const[c,s,i]=n.map(d=>dr(Number(d),0,255));return k(c,s,i,1)}return null}function q(o){const e=w(o);return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function fr(o){const e=w(o);return e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055}function mo(o,e,t){const a=.4122214708*o+.5363325363*e+.0514459929*t,n=.2119034982*o+.6806995451*e+.1073969566*t,c=.0883024619*o+.2817188376*e+.6299787005*t,s=Math.cbrt(a),i=Math.cbrt(n),d=Math.cbrt(c);return{L:.2104542553*s+.793617785*i-.0040720468*d,a:1.9779984951*s-2.428592205*i+.4505937099*d,b:.0259040371*s+.7827717662*i-.808675766*d}}function pr(o,e,t){const a=o+.3963377774*e+.2158037573*t,n=o-.1055613458*e-.0638541728*t,c=o-.0894841775*e-1.291485548*t,s=a*a*a,i=n*n*n,d=c*c*c;return[4.0767416621*s-3.3077115913*i+.2309699292*d,-1.2684380046*s+2.6097574011*i-.3413193965*d,-.0041960863*s-.7034186147*i+1.707614701*d]}function lr(o){return mo(q(o.r/255),q(o.g/255),q(o.b/255))}const vo=1e-6;function Gr(o){const e=Math.hypot(o.a,o.b);let t=e<vo?0:Math.atan2(o.b,o.a)*180/Math.PI;return t<0&&(t+=360),t>=360&&(t-=360),{l:o.L,c:e,h:t}}function hr(o,e,t){const a=t*Math.PI/180;return{L:o,a:e*Math.cos(a),b:e*Math.sin(a)}}const G=1e-6,Rr=o=>o[0]>=-G&&o[0]<=1+G&&o[1]>=-G&&o[1]<=1+G&&o[2]>=-G&&o[2]<=1+G;function er(o,e,t,a){const n=w(m(o));let c=Math.max(0,m(e));const s=m(t);let i=hr(n,c,s),d=pr(i.L,i.a,i.b);if(!Rr(d)){let b=0,N=c;for(let g=0;g<24;g++){const v=(b+N)/2,D=hr(n,v,s);Rr(pr(D.L,D.a,D.b))?b=v:N=v}c=b,i=hr(n,c,s),d=pr(i.L,i.a,i.b)}return k(fr(d[0])*255,fr(d[1])*255,fr(d[2])*255,w(m(a,1)))}function J(o){const e=Gr(lr(o));return{l:e.l,c:e.c,h:e.h,a:w(m(o.a,1))}}function ur(o){return er(o.l,o.c,o.h,o.a)}function yo(o){const e=w(m(o.a,1)),t=`#${ir(o.r)}${ir(o.g)}${ir(o.b)}`;return e<1?`${t}${ir(e*255)}`:t}function vr(o){const e=w(m(o.a,1)),t=O(o.r),a=O(o.g),n=O(o.b);return e>=1?`rgb(${t}, ${a}, ${n})`:`rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`}function Wr(o){return`${O(o.r)}, ${O(o.g)}, ${O(o.b)}`}function rr(o){return .2126*q(m(o.r)/255)+.7152*q(m(o.g)/255)+.0722*q(m(o.b)/255)}function y(o,e){const t=e.a>=1?e:k(e.r,e.g,e.b,1),a=o.a<1?br(o,t):o,n=rr(a),c=rr(t),s=Math.max(n,c),i=Math.min(n,c);return(s+.05)/(i+.05)}function br(o,e){const t=w(m(o.a,1)),a=w(m(e.a,1)),n=t+a*(1-t);if(n<=0)return k(0,0,0,0);const c=a*(1-t)/n,s=t/n;return k(o.r*s+e.r*c,o.g*s+e.g*c,o.b*s+e.b*c,n)}function or(o,e,t){const a=w(m(t));if(a<=0)return k(o.r,o.g,o.b,w(m(o.a,1)));if(a>=1)return k(e.r,e.g,e.b,w(m(e.a,1)));const n=w(m(o.a,1)),c=w(m(e.a,1)),s=lr(o),i=lr(e),d=n+(c-n)*a,b=d>0?n*(1-a)/d:1-a,N=d>0?c*a/d:a,g={L:s.L*b+i.L*N,a:s.a*b+i.a*N,b:s.b*b+i.b*N},v=Gr(g);return er(v.l,v.c,v.h,d)}function P(o,e){return k(o.r,o.g,o.b,w(m(e,1)))}function xo(o){return lr(o).L}function C(o,e){const t=J(o);return er(w(t.l+m(e)),t.c,t.h,t.a)}function ko(o,e){const t=J(o);return er(w(m(e)),t.c,t.h,t.a)}const wo=[1,.75,.5,.25,0],Io=24;function z(o,e,t,a="auto"){const n=m(t,1);if(y(o,e)>=n)return o;const c=J(o),s=k(e.r,e.g,e.b,1),i=rr(s),d=(f,$)=>er(f,$,c.h,c.a),b=f=>y(f,s),N=f=>rr(f.a<1?br(f,s):f),g=f=>k(Math.round(f.r),Math.round(f.g),Math.round(f.b),f.a),v=f=>{const $=f==="lighter"?1:0,R=_=>f==="lighter"?N(_)>=i:N(_)<=i,L=_=>R(_)&&b(_)>=n,K=_=>L(_)&&L(g(_));let U=null;for(const _ of wo){const j=c.c*_,Y=d($,j),tr=b(Y);if((!U||tr>U.ratio)&&(U={color:Y,ratio:tr}),!K(Y))continue;let nr=c.l,V=$;for(let cr=0;cr<Io;cr++){const B=(nr+V)/2;K(d(B,j))?V=B:nr=B}const ar=d(V,j);return{color:ar,ratio:b(ar)}}return U};if(a==="lighter"||a==="darker")return v(a).color;const D=b(d(1,0)),p=b(d(0,0));return v(D>=p?"lighter":"darker").color}function zr(o){return y(I,o)>=y(Z,o)}function Zr(o,e=Pr){const t=e.length?e:Pr;let a=t[0],n=-1;for(const c of t){const s=y(c,o);s>n&&(n=s,a=c)}return k(a.r,a.g,a.b,a.a)}const So=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Z,WHITE:I,adjustL:C,bestOn:Zr,composite:br,contrastRatio:y,ensureContrast:z,formatHex:yo,formatRgb:vr,formatTriplet:Wr,fromOklch:ur,isDarkSurface:zr,lightness:xo,mix:or,parseColor:H,relativeLuminance:rr,setL:ko,toOklch:J,withAlpha:P},Symbol.toStringTag,{value:"Module"})),Mo={none:["0px","0px","0px","0px"],sm:["3px","4px","6px","9999px"],md:["4px","6px","10px","9999px"],lg:["6px","10px","16px","9999px"],full:["10px","16px","24px","9999px"]},To="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMik7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iMCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjIpOyIgLz4KICA8cmVjdCB4PSIwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgo8L3N2Zz4=')",$o="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMSk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMCwgMCwgMCwgMC4xKTsiIC8+Cjwvc3ZnPg==')";function Ao(o,e){const t=o==="dark",a=e?.06:0;return{text:e?1:t?.92:.88,textMuted:e?.85:t?.66:.62,textFaint:e?.68:t?.46:.42,border:(t?.12:.1)+(e?.18:0),borderStrong:(t?.28:.22)+(e?.25:0),divider:(t?.1:.08)+(e?.15:0),fill:(t?.09:.06)+a,fillHover:(t?.14:.1)+a,fillActive:(t?.2:.15)+a,field:(t?.07:.04)+a,fieldHover:(t?.1:.06)+a,fieldFocus:(t?.1:.05)+a,hover:(t?.07:.05)+a,pressed:(t?.12:.09)+a,soft:(t?.18:.12)+(e?.08:0),softHover:(t?.26:.2)+(e?.08:0),elevationMin:e?1.3:t?1.18:1.06}}const h=o=>vr(o),S=o=>Wr(o),T=(o,e)=>vr(P(o,e)),Ur=o=>({r:Math.round(o.r),g:Math.round(o.g),b:Math.round(o.b),a:o.a});function W(o,e,t,a,n=c=>c){let c=t,s=Ur(n(or(o,e,c))),i=0;for(;y(s,o)<a&&c<1&&i++<40;)c=Math.min(1,c+.02),s=Ur(n(or(o,e,c)));return P(s,1)}function jr(o,e,t){if(t<=0)return o;const a=J(o),n=J(e);return ur({l:a.l,c:Math.min(.03,.03*t)+a.c*(1-t),h:n.h,a:a.a})}function Eo(o){var Tr,$r,Ar,Er,Nr,Cr,_r;const e={version:2,...o??{}},t=Or[e.preset??"dark"],a=[];let n=H(e.surface)??null;n||(e.surface&&a.push({token:"surface",reason:`unparsable surface "${e.surface}", using preset`}),n=H(t.surface)),n=P(n,1);let c=H(e.primary)??null;c||(e.primary&&a.push({token:"primary",reason:`unparsable primary "${e.primary}", using preset`}),c=H(t.primary)),c=P(c,1);const s=zr(n)?"dark":"light",i=s==="dark",d=e.contrast==="high",b=Ao(s,d),N=Math.max(0,Math.min(1,e.tint??0)),g=d?7:4.5,v=d?4.5:3,p=jr(i?I:{r:17,g:17,b:17,a:1},c,N);let f,$,R;const L=l=>jr(l,c,N);if(i){const l=y(I,n)>=6?I:Z;f=W(n,l,.07,b.elevationMin,L),$=W(f,l,.05,1.12,L),R=W($,l,.05,1.12,L)}else{const l=y(I,n);if(l>=b.elevationMin*1.01){const u=l>=1.149995?1.1:b.elevationMin;f=W(n,I,.5,u,L),$=y(I,f)>=1.03?W(f,I,.6,1.03,L):P(I,1),R=L(or($,Z,.035))}(!f||y(f,n)<b.elevationMin)&&(f=W(n,Z,.03,b.elevationMin,L),$=P(I,1),R=L(or($,Z,.05)))}if(!f||!$||!R)throw new Error("theme: elevation ladder not resolved");const K=ur(i?{l:.94,c:0,h:0,a:1}:{l:.28,c:0,h:0,a:1}),U=Zr(K),_=l=>[n,f,$,R].reduce((u,E)=>y(l,E)<y(l,u)?E:u,n),j=(l,u,E)=>{let M=l,F=0;for(;y(P(p,M),_(P(p,M)))<u&&M<1&&F++<25;)M=Math.min(1,M+.04);return M!==l&&a.push({token:E,reason:`raised opacity ${l}→${M.toFixed(2)} to reach ${u}:1 on surfaces`}),M},Y=j(b.text,g,"text"),tr=j(b.textMuted,g,"text-muted"),nr=j(b.textFaint,v,"text-faint"),V=(()=>{const l=y(I,c),u=y({r:17,g:17,b:17,a:1},c);if(l>=g)return I;const E=u>l?{r:17,g:17,b:17,a:1}:I;return Math.max(l,u)<g&&a.push({token:"on-primary",reason:`neither white nor black reaches ${g}:1 on primary (best ${Math.max(l,u).toFixed(2)}:1)`}),E})(),ar=C(c,i?.06:-.06),cr=C(c,i?.1:-.1),B=z(c,n,g,"auto");y(B,n)>y(c,n)+.01&&a.push({token:"primary-text",reason:`primary lightened/darkened to reach ${g}:1 as text on surface`});const Jr=z(c,n,v,"auto"),Kr=z(c,n,v,"auto"),sr=l=>{const u=H(Br[l]),E=y(I,u),M=y({r:17,g:17,b:17,a:1},u),F=E>=g?I:M>E?{r:17,g:17,b:17,a:1}:I;return{base:u,on:F,text:z(u,n,g,"auto"),soft:P(u,b.soft),border:z(u,n,v,"auto"),dark:C(u,-.1),light:C(u,.12),darker:C(u,-.18),bright:C(u,.22)}},Yr=sr("success"),Vr=sr("warning"),Qr=sr("error"),Xr=sr("info"),[ro,oo,eo,to]=Mo[e.radius??"md"],xr="'Inter', sans-serif",kr=l=>{var u;return(u=l==null?void 0:l.name)!=null&&u.trim()?`'${l.name.trim().replace(/'/g,"\\'")}', ${xr}`:xr},wr=kr((Tr=e.fonts)==null?void 0:Tr.ui),no=($r=e.fonts)!=null&&$r.heading?kr(e.fonts.heading):wr,ao=Array.from(new Set([(Er=(Ar=e.fonts)==null?void 0:Ar.ui)==null?void 0:Er.src,(Cr=(Nr=e.fonts)==null?void 0:Nr.heading)==null?void 0:Cr.src].filter(l=>!!l&&/^https?:\/\//.test(l)))),Ir=(_r=e.font)!=null&&_r.size&&e.font.size>0?e.font.size:14,A={"color-scheme":s,surface:h(n),"surface-rgb":S(n),"surface-1":h(f),"surface-1-rgb":S(f),"surface-2":h($),"surface-2-rgb":S($),"surface-3":h(R),"surface-inverse":h(K),scrim:"rgba(0, 0, 0, 0.5)",ink:h(p),"ink-rgb":S(p),text:T(p,Y),"text-muted":T(p,tr),"text-faint":T(p,nr),"text-inverse":h(U),"text-on-surface-rgb":S(p),"text-on-inverse-rgb":S(U),border:T(p,b.border),"border-strong":T(p,b.borderStrong),divider:T(p,b.divider),"border-rgb":S(p),fill:T(p,b.fill),"fill-hover":T(p,b.fillHover),"fill-active":T(p,b.fillActive),field:T(p,b.field),"field-hover":T(p,b.fieldHover),"field-focus":T(p,b.fieldFocus),hover:T(p,b.hover),pressed:T(p,b.pressed),primary:h(c),"primary-rgb":S(c),"primary-hover":h(ar),"primary-active":h(cr),"on-primary":h(V),"primary-text":h(B),"primary-border":h(Jr),"primary-soft":T(c,b.soft),"primary-soft-hover":T(c,b.softHover),"focus-ring":h(Kr),"focus-ring-width":d?"3px":"2px","focus-ring-offset":"2px","primary-dark":h(C(c,-.1)),"primary-dark-rgb":S(C(c,-.1)),"primary-light":h(C(c,.1)),"primary-light-rgb":S(C(c,.1)),"primary-bright":h(C(c,.2)),"primary-bright-rgb":S(C(c,.2)),"shadow-1":i?"0 1px 2px rgba(0, 0, 0, 0.4)":"0 1px 2px rgba(0, 0, 0, 0.08)","shadow-2":i?"0 6px 20px rgba(0, 0, 0, 0.45)":"0 6px 20px rgba(0, 0, 0, 0.12)","shadow-3":i?"0 12px 40px rgba(0, 0, 0, 0.5)":"0 12px 40px rgba(0, 0, 0, 0.16)","radius-sm":ro,"radius-md":oo,"radius-lg":eo,"radius-full":to,"font-family":wr,"font-family-heading":no,"font-size":`${Ir}px`,"root-font-size":String(Ir),canvas:i?"rgba(0, 0, 0, 0.25)":"rgba(0, 0, 0, 0.04)","canvas-image":i?To:$o,"canvas-control":"rgba(0, 0, 0, 0.45)","canvas-control-hover":"rgba(0, 0, 0, 0.6)","on-canvas-control":"#ffffff","disabled-opacity":"0.55"};for(const[l,u]of[["success",Yr],["warning",Vr],["error",Qr],["info",Xr]])A[l]=h(u.base),A[`${l}-rgb`]=S(u.base),A[`on-${l}`]=h(u.on),A[`${l}-text`]=h(u.text),A[`${l}-soft`]=h(u.soft),A[`${l}-border`]=h(u.border),A[`${l}-dark-rgb`]=S(u.dark),A[`${l}-light-rgb`]=S(u.light),l==="info"?A["info-bright-rgb"]=S(u.bright):A[`${l}-darker-rgb`]=S(u.darker);if(e.overrides)for(const[l,u]of Object.entries(e.overrides)){if(!u||!Q.includes(l))continue;A[l]=u;const E=`${l}-rgb`;if(Q.includes(E)){const M=H(u);M&&(A[E]=S(M))}}for(const l of Q)A[l]===void 0&&(A[l]="");const Sr=A,Mr=l=>H(Sr[l]),x=(l,u,E,M)=>{const F=Mr(u),Lr=Mr(E),Hr=F&&Lr?y(F,br(Lr,n)):0;return{label:l,fg:u,bg:E,ratio:Math.round(Hr*100)/100,min:M,pass:Hr>=M}},co=[x("Text on surface","text","surface",g),x("Muted text on surface","text-muted","surface",g),x("Faint text on surface","text-faint","surface",v),x("Text on cards (surface-1)","text","surface-1",g),x("Text on popovers (surface-2)","text","surface-2",g),x("Cards distinguishable from surface","surface-1","surface",b.elevationMin),x("Popovers distinguishable from cards","surface-2","surface-1",i?1.12:1),x("Strong border on surface","border-strong","surface",d?3:1.5),x("Text on primary","on-primary","primary",g),x("Primary as text on surface","primary-text","surface",g),x("Primary border on surface","primary-border","surface",v),x("Focus ring on surface","focus-ring","surface",v),x("Success text on surface","success-text","surface",g),x("Warning text on surface","warning-text","surface",g),x("Error text on surface","error-text","surface",g),x("Info text on surface","info-text","surface",g),x("Text on success","on-success","success",g),x("Text on warning","on-warning","warning",g),x("Text on error","on-error","error",g),x("Text on tooltip","text-inverse","surface-inverse",g)];return{input:e,mode:s,tokens:Sr,report:{mode:s,checks:co,adjustments:a},fontUrls:ao}}const r=o=>`var(${X}${o})`,yr={"root-font-size":r("root-font-size"),"font-family":r("font-family"),"bx-focus-ring-color":r("focus-ring"),"bx-focus-ring-width":r("focus-ring-width"),"bx-focus-ring-offset":r("focus-ring-offset"),"app-background-color":r("surface"),"app-background-color-rgb":r("surface-rgb"),"app-divider-color":r("divider"),"secondary-color-rgb":r("surface-2-rgb"),"editor-view-background-color":r("surface"),"fields-view-background-color":"transparent","live-view-background-color":"transparent","popup-background-color":r("surface-1"),"bluepic-embed-editor-border":`1px solid ${r("border")}`,"bluepic-embed-editor-border-radius":r("radius-lg"),"primary-color-base":r("primary-rgb"),"primary-color-dark":r("primary-dark-rgb"),"primary-color-light":r("primary-light-rgb"),"primary-color-bright":r("primary-bright-rgb"),"info-color-base":r("info-rgb"),"info-color-dark":r("info-dark-rgb"),"info-color-light":r("info-light-rgb"),"info-color-bright":r("info-bright-rgb"),"success-color-base":r("success-rgb"),"success-color-light":r("success-light-rgb"),"success-color-dark":r("success-dark-rgb"),"success-color-darker":r("success-darker-rgb"),"error-color-base":r("error-rgb"),"error-color-light":r("error-light-rgb"),"error-color-dark":r("error-dark-rgb"),"error-color-darker":r("error-darker-rgb"),"warning-color-base":r("warning-rgb"),"warning-color-light":r("warning-light-rgb"),"warning-color-dark":r("warning-dark-rgb"),"warning-color-darker":r("warning-darker-rgb"),"text-color-base":r("text-on-surface-rgb"),"text-color-alt":r("text-on-inverse-rgb"),"border-color-base":r("border-rgb"),"background-color-base":r("surface-rgb"),"priinfomary-color-base":r("info-rgb"),"primainfory-color-bright":r("primary-bright-rgb"),"primary-color":r("primary"),"info-color":r("info"),"bx-primary-color":r("primary"),"bx-text-color":r("text"),"bx-modal-color":r("surface-1"),"bx-card-color":r("surface-1"),"upload-background-color":r("field"),"upload-text-color-title":r("text"),"upload-text-color-description":r("text-muted"),"input-background-color":r("field"),"input-background-color-hover":r("field-hover"),"input-background-color-focus":r("field-focus"),"input-border-color":"transparent","input-border-color-hover":"transparent","input-border-color-focus":r("primary-border"),"input-shadow-focus-color":r("focus-ring"),"input-bordered-border-color":r("border-strong"),"input-bordered-border-color-hover":r("border-strong"),"input-bordered-border-color-focus":r("primary-border"),"input-outline-color-focus":r("focus-ring"),"input-border-color-disabled":r("border"),"input-opacity-disabled":r("disabled-opacity"),"input-ghost-border-color-hover":r("border"),"input-ghost-border-color-focus":r("primary-border"),"input-number-ctrl-separator-color":r("divider"),"input-number-ctrl-color":r("text-muted"),"input-number-ctrl-color-hover":r("text"),"input-number-ctrl-background-color-hover":r("hover"),"input-state-active-background-color":r("primary-soft"),"input-state-active-background-color-hover":r("primary-soft"),"input-state-active-background-color-focus":r("primary-soft"),"input-state-active-border-color":r("primary-border"),"input-state-active-border-color-hover":r("primary-border"),"input-state-active-border-color-focus":r("primary-border"),"input-state-success-background-color":r("success-soft"),"input-state-success-background-color-hover":r("success-soft"),"input-state-success-background-color-focus":r("success-soft"),"input-state-success-border-color":r("success-border"),"input-state-success-border-color-hover":r("success-border"),"input-state-success-border-color-focus":r("success-border"),"input-state-error-background-color":r("error-soft"),"input-state-error-background-color-hover":r("error-soft"),"input-state-error-background-color-focus":r("error-soft"),"input-state-error-border-color":r("error-border"),"input-state-error-border-color-hover":r("error-border"),"input-state-error-border-color-focus":r("error-border"),"input-state-warning-background-color":r("warning-soft"),"input-state-warning-background-color-hover":r("warning-soft"),"input-state-warning-background-color-focus":r("warning-soft"),"input-state-warning-border-color":r("warning-border"),"input-state-warning-border-color-hover":r("warning-border"),"input-state-warning-border-color-focus":r("warning-border"),"card-background-color":r("surface-1"),"card-background-color-hover":r("surface-2"),"card-border-color":r("border"),"card-header-divider-color":r("divider"),"card-footer-divider-color":r("divider"),"card-footer-background-color":r("hover"),"select-background-color":r("field"),"select-background-color-hover":r("field-hover"),"select-background-color-focus":r("field-focus"),"select-border":"1px solid transparent","select-border-hover":"1px solid transparent","select-border-focus":`1px solid ${r("primary-border")}`,"select-color":r("text"),"select-color-hover":r("text"),"select-color-focus":r("text"),"select-button-background-color":r("fill"),"select-button-background-color-hover":r("fill-hover"),"select-item-border":`2px solid ${r("primary-border")}`,"checkbox-background-color":r("field"),"checkbox-border-color":r("border-strong"),"checkbox-border-color-hover":r("primary-border"),"checkbox-outline-color-focus":r("focus-ring"),"checkbox-border-color-focus":r("primary-border"),"checkbox-background-color-checked":r("primary"),"checkbox-border-color-checked":"transparent","checkbox-background-color-checked-hover":r("primary-hover"),"checkbox-border-color-checked-hover":"transparent","checkbox-symbol-color":r("text-faint"),"checkbox-symbol-color-checked":r("on-primary"),"checkbox-secondary-background-color":r("fill"),"checkbox-secondary-background-color-hover":r("fill-hover"),"checkbox-secondary-background-color-checked":r("fill-active"),"checkbox-secondary-border":`1px solid ${r("border")}`,"checkbox-secondary-border-hover":`1px solid ${r("border-strong")}`,"checkbox-secondary-border-checked":`1px solid ${r("border-strong")}`,"checkbox-secondary-symbol-color":r("text-muted"),"checkbox-secondary-symbol-color-checked":r("primary-text"),"popover-background-color":r("surface-2"),"popover-border-color":r("border"),"popover-border":`1px solid ${r("border")}`,"popover-arrow-border-color":r("border"),"popover-without-darkened-bg-background-color":r("surface-2-rgb"),"popover-without-darkened-bg-box-shadow":r("shadow-2"),"tooltip-background-color":r("surface-inverse"),"tooltip-text-color":r("text-inverse"),"tooltip-border-color":"transparent","menu-item-color":r("text"),"menu-item-color-active":r("primary-text"),"menu-item-background-color":"transparent","menu-item-background-color-active":r("primary-soft"),"menu-item-background-color-hover":r("hover"),"menu-item-background-color-active-hover":r("primary-soft-hover"),"menu-divider":`1px solid ${r("divider")}`,"labeled-text-color":r("text-muted"),"label-background-color":r("fill"),"list-divider":`1px solid ${r("divider")}`,"list-item-background-color-hover":r("hover"),"empty-text-color":r("text-faint"),"tag-background-color":r("fill"),"tag-color":r("text"),"tag-border-color":r("border"),"tag-error-background-color":r("error-soft"),"tag-error-color":r("error-text"),"tag-error-border-color":r("error-border"),"tag-success-background-color":r("success-soft"),"tag-success-color":r("success-text"),"tag-success-border-color":r("success-border"),"tag-warning-background-color":r("warning-soft"),"tag-warning-color":r("warning-text"),"tag-warning-border-color":r("warning-border"),"tag-info-background-color":r("info-soft"),"tag-info-color":r("info-text"),"tag-info-border-color":r("info-border"),"alert-background-color":r("fill"),"alert-color":r("text"),"alert-border-color":r("border"),"alert-icon-color":r("text-muted"),"alert-info-background-color":r("info-soft"),"alert-info-color":r("info-text"),"alert-info-icon-color":r("info-text"),"alert-info-border-color":r("info-border"),"alert-success-background-color":r("success-soft"),"alert-success-color":r("success-text"),"alert-success-icon-color":r("success-text"),"alert-success-border-color":r("success-border"),"alert-warning-background-color":r("warning-soft"),"alert-warning-color":r("warning-text"),"alert-warning-icon-color":r("warning-text"),"alert-warning-border-color":r("warning-border"),"alert-error-background-color":r("error-soft"),"alert-error-color":r("error-text"),"alert-error-icon-color":r("error-text"),"alert-error-border-color":r("error-border"),"slider-body-background-color":r("fill-active"),"slider-body-background-color-hover":r("fill-active"),"slider-body-background-color-focus":r("fill-active"),"slider-thumb-background-color":r("primary"),"slider-thumb-background-color-hover":r("primary-hover"),"slider-thumb-background-color-focus":r("primary-hover"),"slider-thumb-box-shadow":r("shadow-1"),"slider-value-background-color":r("primary"),"slider-value-background-color-hover":r("primary"),"slider-value-background-color-focus":r("primary"),"progress-background-color":r("fill"),"progress-value-color":r("primary"),"tab-color":r("text-muted"),"tab-color-active":r("primary-text"),"tab-segment-background-color":r("fill"),"tab-segment-background-color-active":r("surface-2"),"tab-segment-color":r("text-muted"),"tab-segment-color-active":r("text"),"tab-inline-item-background-color-hover":r("hover"),"tab-item-active-box-shadow":r("shadow-1"),"switch-background-color":r("fill-active"),"switch-border":"none","switch-thumb-background-color":r("surface-3"),"switch-thumb-border":"none","switch-thumb-shadow":r("shadow-1"),"switch-border-hover":"none","switch-background-color-hover":r("fill-active"),"switch-thumb-background-color-hover":r("surface-3"),"switch-thumb-border-hover":"none","switch-active-background-color":r("primary"),"switch-active-border":"none","switch-active-thumb-background-color":r("on-primary"),"switch-active-thumb-border":"none","switch-active-thumb-shadow":r("shadow-1"),"switch-active-background-color-hover":r("primary-hover"),"switch-active-border-hover":"none","switch-active-thumb-background-color-hover":r("on-primary"),"switch-active-thumb-border-hover":"none","radio-background-color":"transparent","radio-background-color-active":r("primary"),"radio-background-color-hover":"transparent","radio-border":`1px solid ${r("border-strong")}`,"radio-border-active":`1px solid ${r("primary")}`,"radio-border-color-hover":r("primary-border"),"radio-symbol-color":r("on-primary"),"radio-label-color":r("text"),"radio-label-color-active":r("text"),"button-background-color":"transparent","button-background-color-hover":r("hover"),"button-background-color-focus":r("hover"),"button-border":"none","button-border-hover":"none","button-border-focus":"none","button-text-color":r("text"),"button-text-color-hover":r("text"),"button-text-color-focus":r("text"),"button-box-shadow":"none","button-box-shadow-hover":"none","button-border-radius":r("radius-md"),"button-active-background-color":r("primary"),"button-active-text-color":r("on-primary"),"button-active-border":"none","button-active-box-shadow":"none","button-active-background-color-hover":r("primary-hover"),"button-active-text-color-hover":r("on-primary"),"button-active-border-hover":"none","button-active-box-shadow-hover":"none","button-secondary-background-color":r("fill"),"button-secondary-background-color-hover":r("fill-hover"),"button-secondary-background-color-focus":r("fill-hover"),"button-secondary-border":"1px solid transparent","button-secondary-border-hover":"1px solid transparent","button-secondary-border-focus":"1px solid transparent","button-secondary-text-color":r("text"),"button-secondary-text-color-hover":r("text"),"button-secondary-text-color-focus":r("text"),"button-secondary-box-shadow":"none","button-secondary-box-shadow-hover":"none","button-secondary-active-background-color":r("fill-active"),"button-secondary-active-background-color-hover":r("fill-active"),"button-secondary-active-background-color-focus":r("fill-active"),"button-secondary-active-border":"1px solid transparent","button-secondary-active-border-hover":"1px solid transparent","button-secondary-active-border-focus":"1px solid transparent","button-secondary-active-text-color":r("text"),"button-secondary-active-text-color-hover":r("text"),"button-secondary-active-text-color-focus":r("text"),"button-secondary-active-box-shadow":"none","button-secondary-active-box-shadow-hover":"none","button-tertiary-background-color":"transparent","button-tertiary-background-color-hover":r("hover"),"button-tertiary-background-color-focus":r("hover"),"button-tertiary-border":`1px solid ${r("border-strong")}`,"button-tertiary-border-hover":`1px solid ${r("border-strong")}`,"button-tertiary-border-focus":`1px solid ${r("border-strong")}`,"button-tertiary-text-color":r("text"),"button-tertiary-text-color-hover":r("text"),"button-tertiary-text-color-focus":r("text"),"button-tertiary-box-shadow":"none","button-tertiary-box-shadow-hover":"none","button-tertiary-box-shadow-focus":"none","button-tertiary-active-background-color":r("primary"),"button-tertiary-active-background-color-hover":r("primary-hover"),"button-tertiary-active-background-color-focus":r("primary-hover"),"button-tertiary-active-border":`1px solid ${r("primary")}`,"button-tertiary-active-border-hover":`1px solid ${r("primary")}`,"button-tertiary-active-border-focus":`1px solid ${r("primary")}`,"button-tertiary-active-text-color":r("on-primary"),"button-tertiary-active-text-color-hover":r("on-primary"),"button-tertiary-active-text-color-focus":r("on-primary"),"button-tertiary-active-box-shadow":"none","button-tertiary-active-box-shadow-hover":"none","button-tertiary-active-box-shadow-focus":"none","button-quaternary-background-color":"transparent","button-quaternary-background-color-hover":"transparent","button-quaternary-text-color":r("text-muted"),"button-quaternary-text-color-hover":r("text"),"button-quaternary-active-background-color":"transparent","button-quaternary-active-background-color-hover":"transparent","button-quaternary-active-text-color":r("text"),"button-quaternary-active-text-color-hover":r("text"),"button-state-active-background-color":r("primary-soft"),"button-state-active-background-color-hover":r("primary-soft-hover"),"button-state-active-background-color-active":r("primary-soft"),"button-state-active-background-color-active-hover":r("primary-soft-hover"),"button-state-active-background-color-solid":r("primary"),"button-state-active-background-color-solid-hover":r("primary-hover"),"button-state-active-border-color":r("primary-border"),"button-state-active-border-color-hover":r("primary-border"),"button-state-active-text-color":r("primary-text"),"button-state-active-text-color-tertiary":r("primary-text"),"button-state-success-background-color":r("success-soft"),"button-state-success-background-color-hover":r("success-soft"),"button-state-success-background-color-active":r("success-soft"),"button-state-success-background-color-active-hover":r("success-soft"),"button-state-success-background-color-solid":r("success"),"button-state-success-background-color-solid-hover":r("success"),"button-state-success-border-color":r("success-border"),"button-state-success-border-color-hover":r("success-border"),"button-state-success-text-color":r("success-text"),"button-state-success-text-color-tertiary":r("success-text"),"button-state-error-background-color":r("error-soft"),"button-state-error-background-color-hover":r("error-soft"),"button-state-error-background-color-active":r("error-soft"),"button-state-error-background-color-active-hover":r("error-soft"),"button-state-error-background-color-solid":r("error"),"button-state-error-background-color-solid-hover":r("error"),"button-state-error-border-color":r("error-border"),"button-state-error-border-color-hover":r("error-border"),"button-state-error-text-color":r("error-text"),"button-state-error-text-color-tertiary":r("error-text"),"button-state-warning-background-color":r("warning-soft"),"button-state-warning-background-color-hover":r("warning-soft"),"button-state-warning-background-color-active":r("warning-soft"),"button-state-warning-background-color-active-hover":r("warning-soft"),"button-state-warning-background-color-solid":r("warning"),"button-state-warning-background-color-solid-hover":r("warning"),"button-state-warning-border-color":r("warning-border"),"button-state-warning-border-color-hover":r("warning-border"),"button-state-warning-text-color":r("warning-text"),"button-state-warning-text-color-tertiary":r("warning-text"),"message-body-background-color":r("surface-2"),"message-body-text-color":r("text"),"message-body-border":`1px solid ${r("border")}`,"canvas-background-color":r("canvas"),"canvas-background-image":r("canvas-image"),"canvas-btn-background-color":r("canvas-control"),"canvas-btn-background-color-hover":r("canvas-control-hover"),"canvas-btn-color":r("on-canvas-control"),"btn-color":r("on-canvas-control"),"gallery-card-background-color":r("surface-1"),"gallery-card-background-color-hover":r("surface-2"),"gallery-card-border":`1px solid ${r("border")}`,"gallery-action-btn-background-color":r("scrim"),"gallery-action-btn-color":"#ffffff","gallery-card-name-text-color":r("text"),"gallery-card-description-text-color":r("text-muted"),"spinner-color":r("text")},No=new Set(Object.keys(yr).filter(o=>`--${o}`.startsWith(X)&&Q.includes(`--${o}`.slice(X.length)))),Co=Object.entries(yr).filter(([o])=>!No.has(o));function qr(o){const e={};for(const[t,a]of Object.entries(o.tokens))a!==""&&(e[`${X}${t}`]=a);for(const[t,a]of Co)e[`--${t}`]=a;if(o.input.customStyle)for(const[t,a]of Object.entries(o.input.customStyle))t==="key"||a==null||a===""||(e[t.startsWith("--")?t:`--${t}`]=String(a));return e}function _o(o,e){const t=Array.isArray(e)?e.join(", "):e,a=qr(o),n=Object.entries(a).map(([c,s])=>`${c}: ${s};`).join(" ");return`${t} { color-scheme: ${o.mode}; ${n} }`}function Lo(o){return!!o&&typeof o=="object"&&o.version===2}function Ho(o){const e=o??{},t=e["editor-view-background-color"]||(e["app-background-color-rgb"]?`rgb(${e["app-background-color-rgb"]})`:void 0)||e["popup-background-color"],a=e["primary-color-base"]?`rgb(${e["primary-color-base"]})`:void 0,n=H(t)?t:void 0,c=H(a)?a:void 0,s=typeof e.key=="string"&&e.key.endsWith("-wcag"),i={version:2};return n&&(i.surface=n),c&&(i.primary=c),s&&(i.contrast="high"),typeof e.key=="string"&&(i.preset=e.key.startsWith("light")?"light":"dark"),i}exports.LEGACY_BRIDGE=yr;exports.SEMANTIC_PREFIX=X;exports.SEMANTIC_TOKEN_GROUPS=so;exports.SEMANTIC_TOKEN_NAMES=Q;exports.STATUS_BASES=Br;exports.THEME_HOUSE_PRESETS=io;exports.THEME_PRESETS=Or;exports.looksLikeThemeInput=Lo;exports.resolveTheme=Eo;exports.themeColor=So;exports.themeInputFromLegacyCustomStyle=Ho;exports.themeToCssText=_o;exports.themeToCssVars=qr;
|