@weasel-js/theme 1.9.3 → 1.9.4

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/README.md CHANGED
@@ -48,6 +48,13 @@ const acme = defineTheme({
48
48
  applyTheme(document.documentElement, acme, { mode: 'light' });
49
49
  ```
50
50
 
51
+ `applyTheme` returns a release. Applying to the same element again replaces
52
+ what it held, so a page restyling its root never calls it; call it when a
53
+ themed subtree goes away, and its rule leaves the stylesheet once nothing
54
+ else holds it. The rule goes into the document or shadow root the element
55
+ lives in, so a popout window and a shadow tree are themed like any other.
56
+
57
+
51
58
  `extends` defaults to the built-in theme, so a partial theme can never be
52
59
  accidentally incomplete. Overriding a primitive rebases every alias that
53
60
  references it — set `accent-base` and `--wzl-accent`, `--wzl-accent-hover`,
@@ -1,8 +1,9 @@
1
- import { hexToOklchDeg, oklchDegToHex, srgbU8ToOklab } from '@weasel-js/paint';
1
+ import { isPlainObject } from '@weasel-js/registry';
2
+ import { hexToOklchDeg, oklchDegToHex, hexToRgbBytes, parseHexBytes, srgbU8ToOklab } from '@weasel-js/paint';
2
3
 
3
4
  // src/axes.ts
4
5
  function isByAxis(v) {
5
- return typeof v === "object" && v !== null && !Array.isArray(v) && typeof v.by === "string";
6
+ return isPlainObject(v) && typeof v.by === "string";
6
7
  }
7
8
  function fullSelection(axes, selection = {}) {
8
9
  const out = {};
@@ -76,13 +77,44 @@ function parseTokenValue(type, text) {
76
77
  return raw;
77
78
  }
78
79
 
79
- // src/dtcg/color.ts
80
+ // src/chainTokens.ts
81
+ function localSelections(chain, selection) {
82
+ let axes = {};
83
+ return chain.map((link) => {
84
+ axes = mergeAxes(axes, link.axes);
85
+ return { ...selection, ...fullSelection(axes, selection) };
86
+ });
87
+ }
88
+ function tokenAt(chain, name, selection) {
89
+ const local = localSelections(chain, selection);
90
+ for (let i = chain.length - 1; i >= 0; i--) {
91
+ const { tokens } = chain[i];
92
+ if (!Object.hasOwn(tokens, name)) continue;
93
+ const picked = pick(tokens[name], local[i]);
94
+ if (picked.ok) return picked.value;
95
+ }
96
+ return void 0;
97
+ }
98
+ function tokensAt(chain, selection) {
99
+ const local = localSelections(chain, selection);
100
+ const out = {};
101
+ chain.forEach((link, i) => {
102
+ for (const [name, v] of Object.entries(link.tokens)) {
103
+ const picked = pick(v, local[i]);
104
+ if (picked.ok) out[name] = picked.value;
105
+ }
106
+ });
107
+ return out;
108
+ }
80
109
  function withAlpha(color, alpha) {
81
110
  const rgba = parseRgba(color.trim());
82
- if (!rgba) return `color-mix(in srgb, ${color.trim()} ${round(alpha * 100, 4)}%, transparent)`;
111
+ if (!rgba) return mixAlpha(color.trim(), alpha);
83
112
  const [r, g, b, a] = rgba;
84
113
  return `rgba(${r}, ${g}, ${b}, ${round(a * alpha, 3)})`;
85
114
  }
115
+ function mixAlpha(color, alpha) {
116
+ return `color-mix(in srgb, ${color} ${round(alpha * 100, 4)}%, transparent)`;
117
+ }
86
118
  function atAlpha(color, alpha) {
87
119
  const rgba = parseRgba(color.trim());
88
120
  if (!rgba) return `rgb(from ${color.trim()} r g b / ${alpha})`;
@@ -97,12 +129,8 @@ function parseRgba(s) {
97
129
  return parseHex(s) ?? parseRgbFn(s);
98
130
  }
99
131
  function parseHex(s) {
100
- const m = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(s);
101
- if (!m) return null;
102
- const body = m[1];
103
- const full = body.length <= 4 ? body.replace(/./g, (c) => c + c) : body;
104
- const byte = (i) => Number.parseInt(full.slice(i, i + 2), 16);
105
- return [byte(0), byte(2), byte(4), full.length === 8 ? byte(6) / 255 : 1];
132
+ const bytes = parseHexBytes(s);
133
+ return bytes && [bytes[0], bytes[1], bytes[2], bytes[3] / 255];
106
134
  }
107
135
  function parseRgbFn(s) {
108
136
  const m = /^rgba?\(([^()]*)\)$/i.exec(s);
@@ -171,16 +199,11 @@ function themeAxes(theme) {
171
199
  }
172
200
  function resolveTheme(theme, selection = {}) {
173
201
  const sel = fullSelection(themeAxes(theme), selection);
174
- let merged = {};
175
- for (const t of themeChain(theme)) merged = { ...merged, ...pickAll(t.tokens, sel) };
176
202
  const out = {};
177
- for (const [name, value] of Object.entries(resolveTokens(merged))) out[`--wzl-${name}`] = value;
203
+ for (const [name, value] of Object.entries(resolveTokens(tokensAt(themeChain(theme), sel)))) out[`--wzl-${name}`] = value;
178
204
  return out;
179
205
  }
180
- function hexToRgb(hex) {
181
- const n = Number.parseInt(hex.slice(1), 16);
182
- return [n >> 16 & 255, n >> 8 & 255, n & 255];
183
- }
206
+ var hexToRgb = hexToRgbBytes;
184
207
  var toHex = oklchDegToHex;
185
208
  var toLch = hexToOklchDeg;
186
209
  function chromaCap(L, H) {
@@ -558,6 +581,6 @@ function anchorFromHex(hex, name) {
558
581
  };
559
582
  }
560
583
 
561
- export { CHROMA_WEIGHT, DEFAULT_CONSTRAINTS, anchorFromHex, atAlpha, chromaCap, contrast, deltaE, enumerateSelections, floorDegrees, fullSelection, generate, hexToRgb, hueGap, hueName, isByAxis, luminance, mergeAxes, parseTokenValue, pick, pickAll, resolveTheme, resolveTokens, selectionKey, serializeTokenValue, themeAxes, themeChain, toHex, toHexPreview, toLab, toLch, vividAt, withAlpha };
562
- //# sourceMappingURL=chunk-NUILKH2Z.js.map
563
- //# sourceMappingURL=chunk-NUILKH2Z.js.map
584
+ export { CHROMA_WEIGHT, DEFAULT_CONSTRAINTS, anchorFromHex, atAlpha, chromaCap, contrast, deltaE, enumerateSelections, floorDegrees, fullSelection, generate, hexToRgb, hueGap, hueName, isByAxis, luminance, mergeAxes, mixAlpha, parseTokenValue, pick, pickAll, resolveTheme, resolveTokens, selectionKey, serializeTokenValue, themeAxes, themeChain, toHex, toHexPreview, toLab, toLch, tokenAt, tokensAt, vividAt, withAlpha };
585
+ //# sourceMappingURL=chunk-7LCRXZDY.js.map
586
+ //# sourceMappingURL=chunk-7LCRXZDY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/axes.ts","../src/dtcg/value.ts","../src/chainTokens.ts","../src/dtcg/color.ts","../src/dtcg/resolve.ts","../src/resolveTheme.ts","../src/engine/color/oklch.ts","../src/engine/color/generate.ts"],"names":[],"mappings":";;;;AA+BO,SAAS,SAAS,CAAA,EAAkC;AACzD,EAAA,OAAO,aAAA,CAAc,CAAC,CAAA,IAAK,OAAO,EAAE,EAAA,KAAO,QAAA;AAC7C;AAGO,SAAS,aAAA,CAAc,IAAA,EAAgB,SAAA,GAAuB,EAAC,EAAc;AAClF,EAAA,MAAM,MAA8B,EAAC;AACrC,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,KAAK,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAA,EAAG;AAC9C,IAAA,MAAM,CAAA,GAAI,UAAU,IAAI,CAAA;AACxB,IAAA,GAAA,CAAI,IAAI,IAAI,CAAA,KAAM,MAAA,IAAa,KAAK,GAAA,CAAI,MAAA,GAAS,IAAI,GAAA,CAAI,OAAA;AAAA,EAC3D;AACA,EAAA,OAAO,GAAA;AACT;AAGO,SAAS,SAAA,CAAU,QAAkB,KAAA,EAA2B;AACrE,EAAA,MAAM,GAAA,GAA+B,EAAE,GAAG,MAAA,EAAO;AACjD,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAC/C,IAAA,GAAA,CAAI,IAAI,CAAA,GAAI,EAAE,GAAG,KAAK,MAAA,EAAQ,EAAE,GAAG,MAAA,CAAO,IAAI,CAAA,EAAG,MAAA,EAAQ,GAAG,GAAA,CAAI,QAAO,EAAE;AAAA,EAC3E;AACA,EAAA,OAAO,GAAA;AACT;AAGO,SAAS,oBAAoB,IAAA,EAA6B;AAC/D,EAAA,IAAI,GAAA,GAAgC,CAAC,EAAE,CAAA;AACvC,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,KAAK,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAA,EAAG;A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AAS,aAAA,CAAc,KAAa,IAAA,EAAuB;AAChE,EAAA,MAAM,EAAE,CAAA,EAAG,CAAA,EAAG,CAAA,EAAE,GAAI,MAAM,GAAG,CAAA;AAC7B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA,IAAQ,OAAA,CAAQ,CAAC,CAAA;AAAA,IACvB,GAAA,EAAK,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA;AAAA,IACjB,SAAA,EAAW,MAAA,CAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAC,CAAA;AAAA,IAC9B,MAAA,EAAQ,MAAA,CAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAC;AAAA,GAC7B;AACF","file":"chunk-7LCRXZDY.js","sourcesContent":["import { isPlainObject } from '@weasel-js/registry';\n\n/** One value of an axis. `scheme` becomes `color-scheme` in that value's CSS blocks. */\nexport interface AxisValue {\n readonly scheme?: 'dark' | 'light';\n}\n\n/** One variant dimension of a theme, such as `mode` or `density`. `default` must name one of `values`. */\nexport interface AxisDef {\n readonly default: string;\n readonly values: Readonly<Record<string, AxisValue>>;\n}\n\n/** Key order is declaration order, which selectors and selection keys follow. */\nexport type AxisDefs = Readonly<Record<string, AxisDef>>;\n\n/** A partial choice of axis values, e.g. `{ mode: 'light' }`. */\nexport type Selection = Readonly<Record<string, string>>;\n\n/** `{ by: 'mode', dark: …, light: … }`: a value that differs per axis value. */\nexport interface ByAxis<T> {\n readonly by: string;\n readonly [axisValue: string]: Varying<T> | string;\n}\n\n/** A value that is either the same everywhere or chosen per axis value. */\nexport type Varying<T> = T | ByAxis<T>;\n\nexport type Picked<T> = { ok: true; value: T } | { ok: false; axis: string; value: string };\n\n/** Whether `v` is a {@link ByAxis} value. */\nexport function isByAxis(v: unknown): v is ByAxis<unknown> {\n return isPlainObject(v) && typeof v.by === 'string';\n}\n\n/** Every axis given a known value; anything missing or unknown takes its default. */\nexport function fullSelection(axes: AxisDefs, selection: Selection = {}): Selection {\n const out: Record<string, string> = {};\n for (const [name, def] of Object.entries(axes)) {\n const v = selection[name];\n out[name] = v !== undefined && v in def.values ? v : def.default;\n }\n return out;\n}\n\n/** A child's axes over its parent's: an axis both declare keeps both sets of values, the child's entries and default winning. */\nexport function mergeAxes(parent: AxisDefs, child: AxisDefs): AxisDefs {\n const out: Record<string, AxisDef> = { ...parent };\n for (const [name, def] of Object.entries(child)) {\n out[name] = { ...def, values: { ...parent[name]?.values, ...def.values } };\n }\n return out;\n}\n\n/** Every full combination of axis values, the first axis varying slowest. */\nexport function enumerateSelections(axes: AxisDefs): Selection[] {\n let out: Record<string, string>[] = [{}];\n for (const [name, def] of Object.entries(axes)) {\n out = out.flatMap((s) => Object.keys(def.values).map((v) => ({ ...s, [name]: v })));\n }\n return out;\n}\n\n/** `mode=dark,density=compact`, axes in declaration order. */\nexport function selectionKey(axes: AxisDefs, selection: Selection): string {\n const full = fullSelection(axes, selection);\n return Object.keys(axes).map((a) => `${a}=${full[a]}`).join(',');\n}\n\nexport function pick<T>(v: Varying<T>, selection: Selection): Picked<T> {\n let cur: unknown = v;\n while (isByAxis(cur)) {\n const axis = cur.by;\n const value = selection[axis];\n if (value === undefined || value === 'by' || !(value in cur)) return { ok: false, axis, value: value ?? '' };\n cur = cur[value];\n }\n return { ok: true, value: cur as T };\n}\n\n/** Every entry of a varying record that has a value for this selection, in record order. */\nexport function pickAll<T>(record: Readonly<Record<string, Varying<T>>>, selection: Selection): Record<string, T> {\n const out: Record<string, T> = {};\n for (const [name, v] of Object.entries(record)) {\n const picked = pick(v, selection);\n if (picked.ok) out[name] = picked.value;\n }\n return out;\n}\n","import type { TokenValue } from './types.ts';\n\n/**\n * Quote family names containing whitespace; leave everything else bare.\n * Generic keywords (`sans-serif`) and hyphen-prefixed identifiers\n * (`-apple-system`) break if quoted, and neither contains a space.\n */\nfunction fontStack(value: readonly (string | number)[]): string {\n return value.map((f) => (typeof f === 'string' && /\\s/.test(f) ? `'${f}'` : String(f))).join(', ');\n}\n\n/**\n * A token's value as CSS renders it. A DTCG value is not always a string: a\n * `fontFamily` is a list of names and a `cubicBezier` is four numbers, and both\n * have a spelling that belongs in a stylesheet rather than in JSON.\n */\nexport function serializeTokenValue(type: string, value: TokenValue): string {\n if (Array.isArray(value)) {\n if (type === 'cubicBezier') return `cubic-bezier(${value.join(', ')})`;\n if (type === 'fontFamily') return fontStack(value);\n return value.join(', ');\n }\n return String(value);\n}\n\nconst BEZIER = /^cubic-bezier\\(\\s*([^)]*)\\)$/i;\n\n/**\n * The inverse of {@link serializeTokenValue}: text a person edited, back in the\n * shape a definition stores. Text that does not parse for its type is kept as\n * text rather than thrown away, so a half-typed value stays editable.\n */\nexport function parseTokenValue(type: string, text: string): TokenValue {\n const raw = text.trim();\n if (type === 'cubicBezier') {\n const inner = BEZIER.exec(raw)?.[1] ?? raw;\n const parts = inner.split(',').map((p) => Number(p.trim()));\n return parts.length === 4 && parts.every((n) => Number.isFinite(n)) ? parts : raw;\n }\n if (type === 'fontFamily') {\n const families = raw\n .split(',')\n .map((f) => f.trim().replace(/^['\"]|['\"]$/g, '').trim())\n .filter((f) => f !== '');\n return families.length > 0 ? families : raw;\n }\n return raw;\n}\n","import { fullSelection, mergeAxes, pick, type AxisDefs, type Selection, type Varying } from './axes.ts';\nimport type { FlatTokens, RawToken } from './dtcg/types.ts';\n\n/** One theme of an `extends` chain, as far as choosing its tokens goes. */\nexport interface ChainLink {\n readonly axes: AxisDefs;\n readonly tokens: Readonly<Record<string, Varying<RawToken>>>;\n}\n\n/**\n * The selection each theme of a root-first chain reads its own tokens at. An axis value a theme and\n * everything it extends never declared (one a descendant added) becomes that theme's default for the\n * axis, which is what the stylesheet's cascade gives it: no block of the ancestor matches the new\n * value, so its default declarations show through.\n */\nfunction localSelections(chain: readonly ChainLink[], selection: Selection): Selection[] {\n let axes: AxisDefs = {};\n return chain.map((link) => {\n axes = mergeAxes(axes, link.axes);\n return { ...selection, ...fullSelection(axes, selection) };\n });\n}\n\n/** `name` from the nearest theme of a root-first chain that has it at `selection`. */\nexport function tokenAt(chain: readonly ChainLink[], name: string, selection: Selection): RawToken | undefined {\n const local = localSelections(chain, selection);\n for (let i = chain.length - 1; i >= 0; i--) {\n const { tokens } = chain[i];\n if (!Object.hasOwn(tokens, name)) continue;\n const picked = pick(tokens[name], local[i]);\n if (picked.ok) return picked.value;\n }\n return undefined;\n}\n\n/** Every token of a root-first chain at `selection`, each from the nearest theme that has it there. */\nexport function tokensAt(chain: readonly ChainLink[], selection: Selection): FlatTokens {\n const local = localSelections(chain, selection);\n const out: Record<string, RawToken> = {};\n chain.forEach((link, i) => {\n for (const [name, v] of Object.entries(link.tokens)) {\n const picked = pick(v, local[i]);\n if (picked.ok) out[name] = picked.value;\n }\n });\n return out;\n}\n","import { parseHexBytes } from '@weasel-js/paint';\n\n/**\n * A resolved color at `alpha`, multiplied into any alpha it already carries. The\n * JS side of the alpha extension; the CSS side emits `color-mix()` instead so DOM\n * chrome keeps tracking a downstream override of the referenced token.\n *\n * Hex and `rgb()`/`rgba()` become an `rgba()` literal. Anything else — a named\n * color, `hsl()`, `oklch()`, a `var()` — becomes the same `color-mix()` the CSS\n * side writes, which the browser resolves.\n */\nexport function withAlpha(color: string, alpha: number): string {\n const rgba = parseRgba(color.trim());\n if (!rgba) return mixAlpha(color.trim(), alpha);\n const [r, g, b, a] = rgba;\n return `rgba(${r}, ${g}, ${b}, ${round(a * alpha, 3)})`;\n}\n\n/** `color` at `alpha` as a `color-mix()` with transparent, for a color only the browser can resolve. */\nexport function mixAlpha(color: string, alpha: number): string {\n return `color-mix(in srgb, ${color} ${round(alpha * 100, 4)}%, transparent)`;\n}\n\n/** A resolved color with its alpha replaced by `alpha`, as `rgb(from c r g b / alpha)` computes it. */\nexport function atAlpha(color: string, alpha: number): string {\n const rgba = parseRgba(color.trim());\n if (!rgba) return `rgb(from ${color.trim()} r g b / ${alpha})`;\n const [r, g, b] = rgba;\n return `rgba(${r}, ${g}, ${b}, ${round(alpha, 3)})`;\n}\n\ntype Rgba = [number, number, number, number];\n\nfunction round(n: number, places: number): number {\n return Number(n.toFixed(places));\n}\n\nfunction parseRgba(s: string): Rgba | null {\n if (s.toLowerCase() === 'transparent') return [0, 0, 0, 0];\n return parseHex(s) ?? parseRgbFn(s);\n}\n\nfunction parseHex(s: string): Rgba | null {\n const bytes = parseHexBytes(s);\n return bytes && [bytes[0], bytes[1], bytes[2], bytes[3] / 255];\n}\n\nfunction parseRgbFn(s: string): Rgba | null {\n const m = /^rgba?\\(([^()]*)\\)$/i.exec(s);\n if (!m) return null;\n const [channels, alphaPart, extra] = m[1].split('/');\n if (extra !== undefined) return null;\n const parts = channels.trim().split(/\\s*,\\s*|\\s+/);\n if (alphaPart !== undefined) parts.push(alphaPart.trim());\n if (parts.length !== 3 && parts.length !== 4) return null;\n\n const channel = (p: string) => (p.endsWith('%') ? (Number.parseFloat(p) / 100) * 255 : Number(p));\n const alpha = (p: string) => (p.endsWith('%') ? Number.parseFloat(p) / 100 : Number(p));\n const [r, g, b] = parts.slice(0, 3).map(channel);\n const a = parts[3] === undefined ? 1 : alpha(parts[3]);\n if (![r, g, b, a].every(Number.isFinite)) return null;\n return [Math.round(r), Math.round(g), Math.round(b), a];\n}\n","import { withAlpha } from './color.ts';\nimport type { FlatTokens, ResolvedTokenMap, TokenValue } from './types.ts';\nimport { serializeTokenValue } from './value.ts';\n\n/** `{color.gray-100}` → `gray-100`. The type group is dropped, per the naming rule. */\nconst REF = /^\\{([^}]+)\\}$/;\n\nfunction refTarget(value: TokenValue): string | null {\n if (typeof value !== 'string') return null;\n const m = REF.exec(value.trim());\n if (!m) return null;\n const path = m[1];\n const dot = path.indexOf('.');\n return dot === -1 ? path : path.slice(dot + 1);\n}\n\n/**\n * Resolve flat tokens to final CSS-ready strings.\n *\n * Merge modes before calling: this function has no notion of modes, only of a\n * complete token set.\n */\nexport function resolveTokens(tokens: FlatTokens): ResolvedTokenMap {\n const out: ResolvedTokenMap = {};\n const inProgress = new Set<string>();\n\n const resolveOne = (name: string): string => {\n const cached = out[name];\n if (cached !== undefined) return cached;\n\n const token = tokens[name];\n if (!token) throw new Error(`Unknown token \"${name}\"`);\n\n if (inProgress.has(name)) {\n throw new Error(`Reference cycle at token \"${name}\" (${[...inProgress].join(' → ')})`);\n }\n inProgress.add(name);\n\n const target = refTarget(token.value);\n let value: string;\n if (target === null) {\n value = serializeTokenValue(token.type, token.value);\n } else if (!tokens[target]) {\n throw new Error(`Token \"${name}\" references \"${target}\", which is not defined`);\n } else {\n value = resolveOne(target);\n }\n\n if (token.alpha !== undefined) value = withAlpha(value, token.alpha);\n\n inProgress.delete(name);\n out[name] = value;\n return value;\n };\n\n for (const name of Object.keys(tokens)) resolveOne(name);\n return out;\n}\n\n/** Merge a mode's tokens over the mode-invariant set. Later wins. */\nexport function mergeTokens(base: FlatTokens, mode: FlatTokens): FlatTokens {\n return { ...base, ...mode };\n}\n","import { fullSelection, mergeAxes, type AxisDefs, type Selection } from './axes.ts';\nimport { tokensAt } from './chainTokens.ts';\nimport { resolveTokens } from './dtcg/resolve.ts';\nimport type { TokenName } from './generated/themes.ts';\nimport type { Theme } from './theme.ts';\n\n/** The output of `resolveTheme`: every token of a theme, for one selection, keyed\n * by CSS custom-property name and flattened to a final CSS value. */\nexport type ResolvedTheme = Readonly<Record<TokenName, string>>;\n\n/** Root-first, so the leaf theme's tokens land last. */\nexport function themeChain(theme: Theme): Theme[] {\n const out: Theme[] = [];\n for (let t: Theme | null = theme; t; t = t.extends) out.unshift(t);\n return out;\n}\n\n/** Every axis the chain declares. An axis declared more than once keeps every value; a descendant's value entries and default win. */\nexport function themeAxes(theme: Theme): AxisDefs {\n return themeChain(theme).reduce<AxisDefs>((axes, t) => mergeAxes(axes, t.axes), {});\n}\n\n/**\n * Merge the extends chain at a selection, resolve every alias, and key the\n * result by CSS custom-property name. A missing or unknown axis value takes the\n * axis default, and a theme in the chain reads a value it never declared at its\n * own default for that axis.\n *\n * Pure — no DOM. An unresolvable reference throws rather than falling back.\n */\nexport function resolveTheme(theme: Theme, selection: Selection = {}): ResolvedTheme {\n const sel = fullSelection(themeAxes(theme), selection);\n const out: Record<string, string> = {};\n for (const [name, value] of Object.entries(resolveTokens(tokensAt(themeChain(theme), sel)))) out[`--wzl-${name}`] = value;\n return out as ResolvedTheme;\n}\n","import { hexToOklchDeg, hexToRgbBytes, oklchDegToHex, srgbU8ToOklab, type OklchDeg } from '@weasel-js/paint';\n\n/** A color in OKLCH: lightness 0–1, chroma, hue in degrees. paint's own type,\n * under the name this engine has always called it. */\nexport type Lch = OklchDeg;\n\n/** A hex color to 0–255 channels, its alpha dropped. Throws on anything else. */\nexport const hexToRgb: (hex: string) => [number, number, number] = hexToRgbBytes;\n\n/** OKLCH (lightness 0–1, chroma, hue in degrees) to `#rrggbb`. Chroma past the gamut is clipped at constant lightness. */\nexport const toHex = oklchDegToHex;\n/** `#rrggbb` to OKLCH, hue in 0–360. */\nexport const toLch: (hex: string) => Lch = hexToOklchDeg;\n\n/** The most chroma this hue can carry at this lightness, inside sRGB. */\nexport function chromaCap(L: number, H: number): number {\n return toLch(toHex(L, 0.5, H)).C;\n}\n\n/** WCAG relative luminance. */\nexport function luminance(hex: string): number {\n const [r, g, b] = hexToRgb(hex).map((v) => v / 255);\n const f = (u: number) => (u <= 0.04045 ? u / 12.92 : ((u + 0.055) / 1.055) ** 2.4);\n return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);\n}\n\n/** WCAG contrast ratio between two hex colors, 1–21, in either order. */\nexport function contrast(a: string, b: string): number {\n const [hi, lo] = [luminance(a), luminance(b)].sort((p, q) => q - p);\n return (hi + 0.05) / (lo + 0.05);\n}\n\n/** Shortest angular distance between two hues, in degrees. */\nexport function hueGap(a: number, b: number): number {\n const d = Math.abs(a - b) % 360;\n return Math.min(d, 360 - d);\n}\n\n/** OKLab coordinates, for distance work. */\nexport function toLab(hex: string): [number, number, number] {\n const [r, g, b] = hexToRgb(hex);\n return srgbU8ToOklab(r, g, b);\n}\n\n/**\n * How far apart two colors look, with chroma weighted up.\n *\n * Two things this is not. It is not WCAG contrast, which reads lightness only\n * and so scores a vivid yellow on white at 1.2:1 and calls it illegible when\n * what separates them is chroma. And it is not plain euclidean OKLab distance:\n * OKLab's chroma range is small beside its lightness range, so an unweighted\n * distance is almost all lightness, and it ranks a mid-gray as further from\n * white than a pale blue is. Measured against CIELAB dE on the same colors,\n * unweighted OKLab put `#c1c1c1` at 0.160 and `#abd9ff` at 0.126 while CIELAB\n * put them at 21.9 and 28.5 — opposite orders.\n *\n * `CHROMA_WEIGHT` restores CIELAB's ordering. It is a weight, not a unit\n * conversion, so these numbers do not transfer to or from CIELAB dE.\n *\n * Rough calibration in the weighted space: 0.17 is a pale wash against paper,\n * 0.25 is a real color, 0.5 is unmistakable.\n */\nexport const CHROMA_WEIGHT = 3;\n\n/** Perceptual distance between two hex colors: OKLab with chroma weighted by {@link CHROMA_WEIGHT}. */\nexport function deltaE(a: string, b: string): number {\n const [l1, a1, b1] = toLab(a);\n const [l2, a2, b2] = toLab(b);\n return Math.hypot(l1 - l2, CHROMA_WEIGHT * (a1 - a2), CHROMA_WEIGHT * (b1 - b2));\n}\n\n/** The most chroma this hue can carry at this lightness, as a hex. */\nexport function vividAt(L: number, H: number): string {\n return toHex(L, chromaCap(L, H), H);\n}\n","import {\n chromaCap,\n contrast,\n CHROMA_WEIGHT,\n deltaE,\n hueGap,\n toHex,\n toLab,\n toLch,\n type Lch,\n} from './oklch.ts';\n\n/**\n * A hue pinned into the palette with its own lightness.\n *\n * Anchors exist because the lightness law excludes some colors entirely. Yellow\n * is the case that forces it: its chroma peaks at L 0.95 — higher than any other\n * hue — so a law that picks lightness for legibility silently yields gold, then\n * olive, and never reports that yellow was dropped.\n */\nexport interface Anchor {\n readonly name: string;\n readonly hue: number;\n readonly lightness: number;\n /**\n * Absolute chroma. Omitted means \"as much as the gamut allows here\", which is\n * what a bright color wants. A muted color has to say so: hue and lightness\n * alone can only describe vivid colors, so a tan asked for at max chroma\n * comes back as an amber.\n */\n readonly chroma?: number;\n}\n\n/** Every constraint the generator honors. A zero disables the ones that gate. */\nexport interface Constraints {\n readonly count: number;\n /**\n * Minimum hue separation, as a share of the even `360 / count` spacing an\n * ideal set would have. 0 disables the check.\n *\n * A share rather than degrees, because absolute degrees mean different things\n * at different cardinalities: 30 degrees is generous for 8 colors and\n * impossible for 16, so a floor in degrees silently becomes unsatisfiable as\n * the set grows.\n */\n readonly hueFloor: number;\n /** Minimum WCAG contrast every swatch must clear against `surface`. 0 disables. */\n readonly minContrast: number;\n /**\n * Minimum perceptual distance from `surface`. 0 disables.\n *\n * The gate WCAG contrast cannot express. Contrast reads only lightness, so it\n * scores a vivid yellow on white at 1.2:1 and calls it illegible, when what\n * separates them is chroma. Gate on this instead of on lightness and a yellow\n * can be a yellow; gate on contrast alone and the search quietly returns gold.\n */\n readonly minSurfaceDistance: number;\n /** Minimum perceptual distance between any two swatches. 0 disables. */\n readonly minDistance: number;\n readonly surface: string;\n /** Where `lightnessPull` drags each hue, away from its own chroma peak. */\n readonly lightnessTarget: number;\n /** 0 leaves every hue at its chroma peak; 1 puts them all at the target. */\n readonly lightnessPull: number;\n /** Fraction of the in-gamut chroma ceiling to take. */\n readonly chromaFraction: number;\n /** 0 leaves chroma alone; 1 pulls every hue to the set mean. */\n readonly equalize: number;\n readonly anchors: readonly Anchor[];\n readonly order: 'hue' | 'farthest';\n}\n\n/** One color of a generated {@link Palette}. */\nexport interface Swatch {\n readonly name: string;\n readonly hex: string;\n readonly lch: Lch;\n /** Came from one of the constraints' anchors. */\n readonly anchored: boolean;\n /** WCAG contrast against the constraints' `surface`. */\n readonly contrast: number;\n}\n\n/** Measurements of a generated palette as a whole: the minimums are over every swatch, or every pair. */\nexport interface Stats {\n readonly meanChroma: number;\n readonly chromaSpread: number;\n readonly lightnessSpread: number;\n readonly minHueGap: number;\n /** The realized floor as a share of even spacing, comparable across sizes. */\n readonly hueFloorShare: number;\n readonly minContrast: number;\n readonly minSurfaceDistance: number;\n readonly minDistance: number;\n}\n\n/** What {@link generate} returns. */\nexport interface Palette {\n readonly swatches: readonly Swatch[];\n readonly stats: Stats;\n /** False when no hue arrangement satisfied the gates; `swatches` is then the\n * best unconstrained attempt, so the lab still has something to draw. */\n readonly feasible: boolean;\n}\n\n/** Lightness at which a hue reaches its highest chroma. */\nfunction peakLightness(H: number): number {\n let bestL = 0.5;\n let bestC = -1;\n for (let L = 0.32; L <= 0.96; L += 0.01) {\n const c = chromaCap(L, H);\n if (c > bestC) {\n bestC = c;\n bestL = L;\n }\n }\n return bestL;\n}\n\nconst PEAK: number[] = [];\nfor (let H = 0; H < 360; H += 1) PEAK.push(peakLightness(H));\nconst peakAt = (H: number) => PEAK[((Math.round(H) % 360) + 360) % 360];\n\n/** The default law: sit near this hue's chroma peak, pulled toward the target. */\nfunction place(H: number, c: Constraints): string {\n const L = peakAt(H) + (c.lightnessTarget - peakAt(H)) * c.lightnessPull;\n return toHex(L, chromaCap(L, H) * c.chromaFraction, H);\n}\n\nconst HUE_NAMES: readonly (readonly [number, string])[] = [\n [15, 'rose'], [45, 'red'], [62, 'orange'], [85, 'amber'], [100, 'gold'],\n [122, 'yellow'], [138, 'lime'], [165, 'green'], [195, 'teal'], [218, 'cyan'],\n [245, 'sky'], [275, 'blue'], [310, 'violet'], [345, 'fuchsia'],\n];\n/** A plain color name for a hue in degrees: `red`, `teal`, `violet`. */\nexport function hueName(H: number): string {\n for (const [ceil, name] of HUE_NAMES) if (H < ceil) return name;\n return 'rose';\n}\n\n/** Disambiguate repeats: two hues can land in one name's band. */\nfunction uniqueNames(hues: number[]): string[] {\n const seen = new Map<string, number>();\n return hues.map((h) => {\n const base = hueName(h);\n const n = (seen.get(base) ?? 0) + 1;\n seen.set(base, n);\n return n === 1 ? base : `${base}-${n}`;\n });\n}\n\n/**\n * Pull each chroma toward the set mean.\n *\n * Raising a chroma is not always possible in place — the weak hues sit on the\n * gamut ceiling already — so this walks lightness to where the target chroma\n * exists, choosing the nearest such lightness. Anchors keep theirs and are\n * only ever desaturated. That asymmetry is why equalizing moves the lightness\n * spread as well.\n */\nfunction equalizeChroma(hexes: string[], k: number, anchored: boolean[]): string[] {\n if (k <= 0) return hexes;\n const lch = hexes.map(toLch);\n const target = lch.reduce((sum, x) => sum + x.C, 0) / lch.length;\n\n return lch.map((x, i) => {\n const wanted = x.C + (target - x.C) * k;\n if (anchored[i]) return toHex(x.L, Math.min(wanted, chromaCap(x.L, x.H)), x.H);\n if (chromaCap(x.L, x.H) >= wanted) return toHex(x.L, wanted, x.H);\n\n let bestL = x.L;\n let bestDistance = Infinity;\n for (let L = 0.30; L <= 0.96; L += 0.005) {\n if (chromaCap(L, x.H) >= wanted) {\n const d = Math.abs(L - x.L);\n if (d < bestDistance) {\n bestDistance = d;\n bestL = L;\n }\n }\n }\n if (bestDistance === Infinity) {\n const pk = peakAt(x.H);\n return toHex(pk, chromaCap(pk, x.H), x.H);\n }\n return toHex(bestL, wanted, x.H);\n });\n}\n\n/**\n * Reorder so every prefix stays as separated as a set that size can be.\n * A consumer taking the first three of ten should get three colors 87° apart,\n * not three neighbors.\n */\nfunction farthestFirst(hues: number[]): number[] {\n const order = [0];\n while (order.length < hues.length) {\n let best = -1;\n let bestGap = -1;\n for (let i = 0; i < hues.length; i += 1) {\n if (order.includes(i)) continue;\n const gap = Math.min(...order.map((j) => hueGap(hues[i], hues[j])));\n if (gap > bestGap) {\n bestGap = gap;\n best = i;\n }\n }\n order.push(best);\n }\n return order;\n}\n\n/**\n * Search hue positions that maximize mean chroma subject to the gates.\n *\n * Seeds matter: a uniform 360/n ring can never open a `2 * minHueGap` hole\n * around a pinned hue, so with anchors the seeds spread across the arc the\n * anchors leave free instead.\n */\n/** The share-of-even floor, in degrees, for a set of this size. */\nexport function floorDegrees(c: Pick<Constraints, 'hueFloor' | 'count'>): number {\n return c.hueFloor <= 0 ? 0 : (c.hueFloor * 360) / Math.max(1, c.count);\n}\n\nfunction searchHues(c: Constraints): number[] | null {\n const minGapDeg = floorDegrees(c);\n const anchorHues = c.anchors.map((a) => a.hue);\n const anchorHexes = c.anchors.map(toHexPreview);\n const freeCount = c.count - c.anchors.length;\n if (freeCount < 0) return null;\n if (freeCount === 0) return [];\n\n // Hue is an integer 0-359 and the constraints are fixed for one call, so the\n // placed color, its realized hue and its contrast are each computed once.\n interface Placed {\n hex: string;\n hue: number;\n contrast: number;\n chroma: number;\n surfaceDistance: number;\n /** OKLab coordinates, chroma pre-weighted, so a pairwise distance in the\n * search is three subtractions rather than two color conversions. */\n lab: readonly [number, number, number];\n }\n const weighted = (hex: string): readonly [number, number, number] => {\n const [L, a, b] = toLab(hex);\n return [L, CHROMA_WEIGHT * a, CHROMA_WEIGHT * b];\n };\n const between = (p: readonly [number, number, number], q: readonly [number, number, number]) =>\n Math.hypot(p[0] - q[0], p[1] - q[1], p[2] - q[2]);\n const placed = new Map<number, Placed>();\n const at = (H: number) => {\n const key = ((Math.round(H) % 360) + 360) % 360;\n let v = placed.get(key);\n if (!v) {\n const hex = place(key, c);\n const lch = toLch(hex);\n v = {\n hex,\n hue: lch.H,\n contrast: contrast(hex, c.surface),\n chroma: lch.C,\n surfaceDistance: deltaE(hex, c.surface),\n lab: weighted(hex),\n };\n placed.set(key, v);\n }\n return v;\n };\n const anchorMeta = anchorHexes.map((hex) => {\n const lch = toLch(hex);\n return {\n hex,\n hue: lch.H,\n contrast: contrast(hex, c.surface),\n chroma: lch.C,\n surfaceDistance: deltaE(hex, c.surface),\n lab: weighted(hex),\n };\n });\n const metaFor = (free: number[]) => [...anchorMeta, ...free.map(at)];\n\n /**\n * How far a set is from legal, in one number: degrees of hue crowding plus\n * contrast shortfall. Zero means feasible. The search descends this first and\n * only then maximizes chroma, because a seed ring is often illegal and the\n * legal region may not be reachable by chroma-improving moves alone.\n */\n const penalty = (free: number[]): number => {\n const m = metaFor(free);\n let p = 0;\n if (minGapDeg > 0) {\n for (let i = 0; i < m.length; i += 1) {\n for (let j = i + 1; j < m.length; j += 1) {\n const short = minGapDeg - hueGap(m[i].hue, m[j].hue);\n if (short > 0) p += short;\n }\n }\n }\n if (c.minContrast > 0) {\n for (const x of m) {\n const short = c.minContrast - x.contrast;\n if (short > 0) p += short * 40;\n }\n }\n // Distances are small numbers in OKLab (0.10 already reads as two colors),\n // so they are weighted up to sit on the same scale as degrees of crowding.\n if (c.minSurfaceDistance > 0) {\n for (const x of m) {\n const short = c.minSurfaceDistance - x.surfaceDistance;\n if (short > 0) p += short * 400;\n }\n }\n if (c.minDistance > 0) {\n for (let i = 0; i < m.length; i += 1) {\n for (let j = i + 1; j < m.length; j += 1) {\n const short = c.minDistance - between(m[i].lab, m[j].lab);\n if (short > 0) p += short * 400;\n }\n }\n }\n return p;\n };\n const score = (free: number[]) => {\n const m = metaFor(free);\n return m.reduce((sum, x) => sum + x.chroma, 0) / m.length;\n };\n\n const seeds: number[][] = [];\n const seedStep = Math.max(6, Math.round(freeCount * 1.6));\n for (let start = 0; start < 360; start += seedStep) {\n seeds.push(Array.from({ length: freeCount }, (_, i) => Math.round((start + (i * 360) / freeCount) % 360)));\n }\n if (anchorHues.length > 0) {\n // A uniform ring can never open a 2 * minHueGap hole around a pinned hue,\n // so also seed across the arc the anchors leave free.\n const base = anchorHues[0];\n const span = 360 - 2 * Math.max(minGapDeg, 1);\n for (let jitter = -8; jitter <= 8; jitter += 2) {\n for (const divisor of [Math.max(1, freeCount - 1), freeCount]) {\n seeds.push(\n Array.from({ length: freeCount }, (_, i) =>\n Math.round((((base + minGapDeg + jitter + (i * span) / divisor) % 360) + 360) % 360),\n ),\n );\n }\n }\n }\n\n const STEPS = [-16, -8, -4, -2, -1, 1, 2, 4, 8, 16];\n\n /**\n * Everything one position contributes to the penalty: its own shortfalls plus\n * the pairs it takes part in.\n *\n * `descend` moves exactly one hue at a time, so recomputing the whole set for\n * each candidate costs O(n^2) to learn about O(n) changed terms. Scoring the\n * moved position alone is what keeps the count slider live at 16 colors.\n */\n const penaltyAt = (m: readonly Placed[], i: number): number => {\n let p = 0;\n const x = m[i];\n if (c.minContrast > 0) {\n const short = c.minContrast - x.contrast;\n if (short > 0) p += short * 40;\n }\n if (c.minSurfaceDistance > 0) {\n const short = c.minSurfaceDistance - x.surfaceDistance;\n if (short > 0) p += short * 400;\n }\n for (let j = 0; j < m.length; j += 1) {\n if (j === i) continue;\n if (minGapDeg > 0) {\n const short = minGapDeg - hueGap(x.hue, m[j].hue);\n if (short > 0) p += short;\n }\n if (c.minDistance > 0) {\n const short = c.minDistance - between(x.lab, m[j].lab);\n if (short > 0) p += short * 400;\n }\n }\n return p;\n };\n\n const descend = (hues: number[], useChroma: boolean, keepLegal: boolean) => {\n const current = [...hues];\n let meta = metaFor(current);\n const offset = anchorMeta.length;\n for (let iteration = 0; iteration < 120; iteration += 1) {\n let improved = false;\n for (let i = 0; i < freeCount; i += 1) {\n const slot = offset + i;\n const beforeP = penaltyAt(meta, slot);\n const beforeC = meta[slot].chroma;\n for (const delta of STEPS) {\n const next = (((current[i] + delta) % 360) + 360) % 360;\n if (next === current[i]) continue;\n const candidate = at(next);\n const trialMeta = meta.slice();\n trialMeta[slot] = candidate;\n const afterP = penaltyAt(trialMeta, slot);\n const better = useChroma\n ? (keepLegal ? afterP <= beforeP : true) && candidate.chroma > beforeC\n : afterP < beforeP;\n if (!better) continue;\n if (keepLegal && afterP > beforeP) continue;\n current[i] = next;\n meta = trialMeta;\n improved = true;\n break;\n }\n }\n if (!improved) break;\n }\n return current;\n };\n\n let best: number[] | null = null;\n let bestScore = -1;\n for (const seed of seeds) {\n const repaired = penalty(seed) > 0 ? descend(seed, false, false) : seed;\n if (penalty(repaired) > 0) continue;\n const tuned = descend(repaired, true, true);\n if (penalty(tuned) > 0) continue;\n const s = score(tuned);\n if (s > bestScore) {\n bestScore = s;\n best = tuned;\n }\n }\n return best;\n}\n\n/** Closest any two colors in the set look. */\nfunction pairwiseMin(hexes: string[]): number {\n if (hexes.length < 2) return 1;\n let min = Infinity;\n for (let i = 0; i < hexes.length; i += 1) {\n for (let j = i + 1; j < hexes.length; j += 1) min = Math.min(min, deltaE(hexes[i], hexes[j]));\n }\n return min;\n}\n\nfunction summarize(swatches: Swatch[], surface: string): Stats {\n const cs = swatches.map((s) => s.lch.C);\n const ls = swatches.map((s) => s.lch.L);\n let gap = 360;\n for (let i = 0; i < swatches.length; i += 1) {\n for (let j = i + 1; j < swatches.length; j += 1) {\n gap = Math.min(gap, hueGap(swatches[i].lch.H, swatches[j].lch.H));\n }\n }\n return {\n meanChroma: cs.reduce((a, b) => a + b, 0) / (cs.length || 1),\n chromaSpread: Math.max(...cs) - Math.min(...cs),\n lightnessSpread: Math.max(...ls) - Math.min(...ls),\n minHueGap: swatches.length > 1 ? gap : 360,\n hueFloorShare: swatches.length > 1 ? (gap * swatches.length) / 360 : 1,\n minContrast: Math.min(...swatches.map((s) => contrast(s.hex, surface))),\n minSurfaceDistance: Math.min(...swatches.map((s) => deltaE(s.hex, surface))),\n minDistance: pairwiseMin(swatches.map((s) => s.hex)),\n };\n}\n\n/**\n * A categorical palette of `count` swatches, anchors included, satisfying the gates. When no hue arrangement\n * satisfies them the result is still a full palette, with `feasible` false.\n */\nexport function generate(c: Constraints): Palette {\n const found = searchHues(c);\n const feasible = found !== null;\n // An infeasible gate still has to draw something, so fall back to an even ring.\n const free =\n found ??\n Array.from({ length: Math.max(0, c.count - c.anchors.length) }, (_, i) =>\n Math.round((i * 360) / Math.max(1, c.count - c.anchors.length)),\n );\n\n const hues = [...c.anchors.map((a) => a.hue), ...free];\n const anchoredFlags = [...c.anchors.map(() => true), ...free.map(() => false)];\n const raw = [\n ...c.anchors.map(toHexPreview),\n ...free.map((h) => place(h, c)),\n ];\n const hexes = equalizeChroma(raw, c.equalize, anchoredFlags);\n\n const order =\n c.order === 'farthest'\n ? farthestFirst(hues)\n : [...hues.keys()].sort((a, b) => hues[a] - hues[b]);\n\n const names = uniqueNames(order.map((i) => toLch(hexes[i]).H));\n const swatches: Swatch[] = order.map((i, position) => ({\n name: c.anchors[i]?.name ?? names[position],\n hex: hexes[i],\n lch: toLch(hexes[i]),\n anchored: anchoredFlags[i],\n contrast: contrast(hexes[i], c.surface),\n }));\n\n return { swatches, stats: summarize(swatches, c.surface), feasible };\n}\n\n/** What the lab opens with: the set this palette work landed on. */\nexport const DEFAULT_CONSTRAINTS: Constraints = {\n count: 10,\n hueFloor: 0.9,\n minContrast: 4,\n surface: '#181a1e',\n lightnessTarget: 0.72,\n lightnessPull: 0.4,\n chromaFraction: 0.95,\n equalize: 0,\n minSurfaceDistance: 0.25,\n minDistance: 0.22,\n anchors: [],\n order: 'farthest',\n};\n\n/** The color an anchor will actually contribute, for a swatch beside its controls. */\nexport function toHexPreview(a: Pick<Anchor, 'hue' | 'lightness' | 'chroma'>): string {\n const cap = chromaCap(a.lightness, a.hue);\n return toHex(a.lightness, a.chroma === undefined ? cap : Math.min(a.chroma, cap), a.hue);\n}\n\n/**\n * An anchor taken from an existing color — a brand hex, or a color lifted from\n * somewhere else in the theme. Lightness comes along with the hue, which is the\n * point: the reason to pin a color is usually that the lightness law would not\n * have chosen its lightness. `name` defaults to the hue's {@link hueName}.\n */\nexport function anchorFromHex(hex: string, name?: string): Anchor {\n const { L, C, H } = toLch(hex);\n return {\n name: name ?? hueName(H),\n hue: Math.round(H),\n lightness: Number(L.toFixed(3)),\n chroma: Number(C.toFixed(4)),\n };\n}\n\n"]}
@@ -1,4 +1,5 @@
1
- import { themeAxes, fullSelection, selectionKey, resolveTheme, themeChain, isByAxis, generate, DEFAULT_CONSTRAINTS } from './chunk-NUILKH2Z.js';
1
+ import { themeAxes, fullSelection, resolveTheme, themeChain, isByAxis, generate, DEFAULT_CONSTRAINTS } from './chunk-7LCRXZDY.js';
2
+ import { isPlainObject } from '@weasel-js/registry';
2
3
 
3
4
  // src/generated/themes.ts
4
5
  var THEMES = {
@@ -145,8 +146,8 @@ var THEMES = {
145
146
  "--wzl-slider-thumb-size": "8px",
146
147
  "--wzl-slider-track-slop": "6px",
147
148
  "--wzl-slider-thumb-slop": "6px",
148
- "--wzl-slider-track-mix": "18%",
149
- "--wzl-slider-thumb-mix": "70%",
149
+ "--wzl-slider-track-mix": "40%",
150
+ "--wzl-slider-thumb-mix": "100%",
150
151
  "--wzl-handle-size": "9px",
151
152
  "--wzl-handle-size-sm": "7px",
152
153
  "--wzl-handle-size-lg": "10px",
@@ -323,8 +324,8 @@ var THEMES = {
323
324
  "--wzl-slider-thumb-size": "8px",
324
325
  "--wzl-slider-track-slop": "6px",
325
326
  "--wzl-slider-thumb-slop": "6px",
326
- "--wzl-slider-track-mix": "18%",
327
- "--wzl-slider-thumb-mix": "70%",
327
+ "--wzl-slider-track-mix": "40%",
328
+ "--wzl-slider-thumb-mix": "100%",
328
329
  "--wzl-handle-size": "9px",
329
330
  "--wzl-handle-size-sm": "7px",
330
331
  "--wzl-handle-size-lg": "10px",
@@ -501,8 +502,8 @@ var THEMES = {
501
502
  "--wzl-slider-thumb-size": "8px",
502
503
  "--wzl-slider-track-slop": "6px",
503
504
  "--wzl-slider-thumb-slop": "6px",
504
- "--wzl-slider-track-mix": "18%",
505
- "--wzl-slider-thumb-mix": "70%",
505
+ "--wzl-slider-track-mix": "40%",
506
+ "--wzl-slider-thumb-mix": "100%",
506
507
  "--wzl-handle-size": "9px",
507
508
  "--wzl-handle-size-sm": "7px",
508
509
  "--wzl-handle-size-lg": "10px",
@@ -2012,14 +2013,30 @@ var THEME_SOURCES = {
2012
2013
  "description": "How far past a range thumb's edge a press still grabs the thumb rather than landing on the track. Sits over the track's own slop."
2013
2014
  },
2014
2015
  "slider-track-mix": {
2015
- "value": "18%",
2016
- "type": "dimension",
2017
- "description": "Accent proportion in a range track, as a color-mix percentage \u2014 not a color. Mixed into a real property, never into another custom property."
2016
+ "by": "mode",
2017
+ "dark": {
2018
+ "value": "40%",
2019
+ "type": "dimension",
2020
+ "description": "Proportion of accent-fg in a range track, as a color-mix percentage \u2014 not a color. Mixed into a real property, never into another custom property. Higher in dark mode, where a light tint of the accent sinks into the surface."
2021
+ },
2022
+ "light": {
2023
+ "value": "18%",
2024
+ "type": "dimension",
2025
+ "description": "Proportion of accent-fg in a range track, as a color-mix percentage \u2014 not a color."
2026
+ }
2018
2027
  },
2019
2028
  "slider-thumb-mix": {
2020
- "value": "70%",
2021
- "type": "dimension",
2022
- "description": "Accent proportion in a range thumb, as a color-mix percentage \u2014 not a color."
2029
+ "by": "mode",
2030
+ "dark": {
2031
+ "value": "100%",
2032
+ "type": "dimension",
2033
+ "description": "Proportion of accent-fg in a range thumb, as a color-mix percentage \u2014 not a color. Solid in dark mode."
2034
+ },
2035
+ "light": {
2036
+ "value": "70%",
2037
+ "type": "dimension",
2038
+ "description": "Proportion of accent-fg in a range thumb, as a color-mix percentage \u2014 not a color."
2039
+ }
2023
2040
  },
2024
2041
  "handle-size": {
2025
2042
  "value": "9px",
@@ -3212,14 +3229,30 @@ var BAKED_THEMES = {
3212
3229
  "description": "How far past a range thumb's edge a press still grabs the thumb rather than landing on the track. Sits over the track's own slop."
3213
3230
  },
3214
3231
  "slider-track-mix": {
3215
- "type": "dimension",
3216
- "value": "18%",
3217
- "description": "Accent proportion in a range track, as a color-mix percentage \u2014 not a color. Mixed into a real property, never into another custom property."
3232
+ "by": "mode",
3233
+ "dark": {
3234
+ "type": "dimension",
3235
+ "value": "40%",
3236
+ "description": "Proportion of accent-fg in a range track, as a color-mix percentage \u2014 not a color. Mixed into a real property, never into another custom property. Higher in dark mode, where a light tint of the accent sinks into the surface."
3237
+ },
3238
+ "light": {
3239
+ "type": "dimension",
3240
+ "value": "18%",
3241
+ "description": "Proportion of accent-fg in a range track, as a color-mix percentage \u2014 not a color."
3242
+ }
3218
3243
  },
3219
3244
  "slider-thumb-mix": {
3220
- "type": "dimension",
3221
- "value": "70%",
3222
- "description": "Accent proportion in a range thumb, as a color-mix percentage \u2014 not a color."
3245
+ "by": "mode",
3246
+ "dark": {
3247
+ "type": "dimension",
3248
+ "value": "100%",
3249
+ "description": "Proportion of accent-fg in a range thumb, as a color-mix percentage \u2014 not a color. Solid in dark mode."
3250
+ },
3251
+ "light": {
3252
+ "type": "dimension",
3253
+ "value": "70%",
3254
+ "description": "Proportion of accent-fg in a range thumb, as a color-mix percentage \u2014 not a color."
3255
+ }
3223
3256
  },
3224
3257
  "handle-size": {
3225
3258
  "type": "dimension",
@@ -3492,9 +3525,7 @@ var BAKED_THEMES = {
3492
3525
  }
3493
3526
  }
3494
3527
  };
3495
-
3496
- // src/theme.ts
3497
- var isPinObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v) && "value" in v;
3528
+ var isPinObject = (v) => isPlainObject(v) && "value" in v;
3498
3529
  function toRaw(v) {
3499
3530
  if (isByAxis(v)) {
3500
3531
  const out = { by: v.by };
@@ -3535,45 +3566,94 @@ function defineTheme(input) {
3535
3566
  };
3536
3567
  }
3537
3568
 
3538
- // src/applyTheme.ts
3569
+ // src/themeSheet.ts
3539
3570
  var STYLE_ID = "wzl-themes";
3540
- var emitted = /* @__PURE__ */ new Map();
3541
- var sheet = null;
3542
- var styleEl = null;
3543
- function canAdopt() {
3544
- return typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype && Array.isArray(document.adoptedStyleSheets);
3571
+ var sheets = /* @__PURE__ */ new WeakMap();
3572
+ function styleRootOf(el) {
3573
+ const root = el.getRootNode();
3574
+ return root instanceof (el.ownerDocument.defaultView?.ShadowRoot ?? ShadowRoot) ? root : el.ownerDocument;
3545
3575
  }
3546
- function flushRules() {
3547
- const css = [...emitted.values()].join("\n");
3548
- if (canAdopt()) {
3549
- if (!sheet) {
3550
- sheet = new CSSStyleSheet();
3551
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
3576
+ var documentOf = (root) => "host" in root ? root.ownerDocument : root;
3577
+ var only = (id) => id === 0 ? "" : `:where([data-wzl-variant='${id}'])`;
3578
+ function write(root, held) {
3579
+ const css = [...held.rules].flatMap(([selector, variants]) => (
3580
+ // The bare rule first: it matches a variant's elements too, and the variant's has to win the tie.
3581
+ [...variants].sort((a, b) => a.id - b.id).map((v) => `${selector}${only(v.id)} { ${v.body} }`)
3582
+ )).join("\n");
3583
+ const win = documentOf(root).defaultView;
3584
+ const Sheet = win?.CSSStyleSheet;
3585
+ if (Sheet && "replaceSync" in Sheet.prototype && Array.isArray(root.adoptedStyleSheets)) {
3586
+ if (!held.sheet) {
3587
+ held.sheet = new Sheet();
3588
+ root.adoptedStyleSheets = [...root.adoptedStyleSheets, held.sheet];
3552
3589
  }
3553
- sheet.replaceSync(css);
3590
+ held.sheet.replaceSync(css);
3554
3591
  return;
3555
3592
  }
3556
- if (!styleEl) {
3557
- styleEl = document.createElement("style");
3558
- styleEl.id = STYLE_ID;
3559
- document.head.appendChild(styleEl);
3593
+ if (!held.styleEl) {
3594
+ held.styleEl = documentOf(root).createElement("style");
3595
+ held.styleEl.id = STYLE_ID;
3596
+ ("host" in root ? root : root.head).appendChild(held.styleEl);
3597
+ }
3598
+ held.styleEl.textContent = css;
3599
+ }
3600
+ function holdRule(root, selector, body) {
3601
+ let held = sheets.get(root);
3602
+ if (!held) sheets.set(root, held = { rules: /* @__PURE__ */ new Map(), sheet: null, styleEl: null });
3603
+ const variants = held.rules.get(selector) ?? [];
3604
+ let variant = variants.find((v) => v.body === body);
3605
+ if (variant) {
3606
+ variant.holds++;
3607
+ } else {
3608
+ let id = 0;
3609
+ while (variants.some((v) => v.id === id)) id++;
3610
+ variant = { id, body, holds: 1 };
3611
+ held.rules.set(selector, [...variants, variant]);
3612
+ write(root, held);
3560
3613
  }
3561
- styleEl.textContent = css;
3614
+ const mine = variant;
3615
+ const sheet = held;
3616
+ let released = false;
3617
+ return {
3618
+ variant: mine.id,
3619
+ release: () => {
3620
+ if (released) return;
3621
+ released = true;
3622
+ if (--mine.holds > 0) return;
3623
+ const left = (sheet.rules.get(selector) ?? []).filter((v) => v !== mine);
3624
+ if (left.length > 0) sheet.rules.set(selector, left);
3625
+ else sheet.rules.delete(selector);
3626
+ write(root, sheet);
3627
+ }
3628
+ };
3562
3629
  }
3630
+
3631
+ // src/applyTheme.ts
3632
+ var holds = /* @__PURE__ */ new WeakMap();
3563
3633
  function applyTheme(el, theme, selection = {}) {
3564
- if (typeof document === "undefined") return;
3634
+ if (typeof document === "undefined") return () => {
3635
+ };
3565
3636
  const axes = themeAxes(theme);
3566
3637
  const sel = fullSelection(axes, selection);
3567
- const key = `${theme.name}::${selectionKey(axes, sel)}`;
3568
3638
  const body = Object.entries(resolveTheme(theme, sel)).map(([name, value]) => `${name}: ${value};`).join(" ");
3569
- const attrs = Object.keys(axes).map((a) => `[data-wzl-${a}='${sel[a]}']`).join("");
3570
- const rule = `[data-wzl-theme='${theme.name}']${attrs} { ${body} }`;
3571
- if (emitted.get(key) !== rule) {
3572
- emitted.set(key, rule);
3573
- flushRules();
3574
- }
3639
+ const names = Object.keys(axes);
3640
+ const selector = `[data-wzl-theme='${theme.name}']${names.map((a) => `[data-wzl-${a}='${sel[a]}']`).join("")}`;
3641
+ const { variant, release: releaseRule } = holdRule(styleRootOf(el), selector, body);
3642
+ holds.get(el)?.();
3575
3643
  el.setAttribute("data-wzl-theme", theme.name);
3576
- for (const a of Object.keys(axes)) el.setAttribute(`data-wzl-${a}`, sel[a]);
3644
+ for (const a of names) el.setAttribute(`data-wzl-${a}`, sel[a]);
3645
+ if (variant === 0) el.removeAttribute("data-wzl-variant");
3646
+ else el.setAttribute("data-wzl-variant", String(variant));
3647
+ const letGo = () => {
3648
+ holds.delete(el);
3649
+ releaseRule();
3650
+ };
3651
+ holds.set(el, letGo);
3652
+ return () => {
3653
+ if (holds.get(el) !== letGo) return;
3654
+ letGo();
3655
+ for (const a of ["theme", "variant", ...names]) el.removeAttribute(`data-wzl-${a}`);
3656
+ };
3577
3657
  }
3578
3658
 
3579
3659
  // src/colorMode.ts
@@ -3629,5 +3709,5 @@ function colorCount(list, ctx = defaultContext()) {
3629
3709
  }
3630
3710
 
3631
3711
  export { BAKED_THEMES, THEMES, THEME_SOURCES, applyTheme, colorAt, colorCount, colorCssAt, defineTheme, isColorModePreference, rampSteps, themeTones, weaselTheme };
3632
- //# sourceMappingURL=chunk-7FYXA7TA.js.map
3633
- //# sourceMappingURL=chunk-7FYXA7TA.js.map
3712
+ //# sourceMappingURL=chunk-EFGZ56CE.js.map
3713
+ //# sourceMappingURL=chunk-EFGZ56CE.js.map