@weasel-js/theme 1.4.4 → 1.5.1

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/react.d.ts CHANGED
@@ -1,17 +1,19 @@
1
1
  import React from 'react';
2
- import { T as Theme, a as ResolvedTheme } from './resolveTheme-CFentlRY.js';
2
+ import { T as Theme, S as Selection } from './theme-BtpBHcUg.js';
3
+ import { R as ResolvedTheme } from './resolveTheme-CHnPdh8W.js';
3
4
 
4
- /** What `<ThemeProvider>` publishes: the theme, the mode in force, and the
5
+ /** What `<ThemeProvider>` publishes: the theme, the full selection in force, and the
5
6
  * fully resolved token record for that pair. */
6
7
  interface ThemeContextValue {
7
8
  readonly theme: Theme;
8
- readonly mode: string;
9
+ readonly selection: Selection;
9
10
  readonly resolved: ResolvedTheme;
10
11
  }
11
12
  /** Props for `<ThemeProvider>`. */
12
13
  interface ThemeProviderProps {
13
14
  readonly theme?: Theme;
14
- readonly mode?: string;
15
+ /** Axis values, e.g. `{ mode: 'light' }`. A missing axis takes its default. */
16
+ readonly selection?: Selection;
15
17
  /** Applied to the wrapper element, so it can be the layout element too. */
16
18
  readonly className?: string;
17
19
  readonly style?: React.CSSProperties;
@@ -27,7 +29,7 @@ interface ThemeProviderProps {
27
29
  * nesting your own div inside — an anonymous div between a flex parent and
28
30
  * its child breaks percentage heights.
29
31
  */
30
- declare function ThemeProvider({ theme, mode, className, style, children, }: ThemeProviderProps): React.ReactElement;
32
+ declare function ThemeProvider({ theme, selection, className, style, children, }: ThemeProviderProps): React.ReactElement;
31
33
  /** The theme in force. Throws outside a `<ThemeProvider>`; use
32
34
  * `useThemeOptional` where the provider is not guaranteed. */
33
35
  declare function useTheme(): ThemeContextValue;
package/dist/react.js CHANGED
@@ -1,35 +1,30 @@
1
- import { weaselTheme, resolveTheme, applyTheme } from './chunk-D6AFL2JW.js';
1
+ import { weaselTheme, applyTheme } from './chunk-YBHW5LZM.js';
2
+ import { themeAxes, fullSelection, selectionKey, resolveTheme } from './chunk-LL2ERJPZ.js';
2
3
  import { createContext, useRef, useMemo, useLayoutEffect, useContext } from 'react';
3
4
  import { jsx } from 'react/jsx-runtime';
4
5
 
5
6
  var ThemeContext = createContext(null);
6
7
  function ThemeProvider({
7
8
  theme = weaselTheme,
8
- mode,
9
+ selection,
9
10
  className,
10
11
  style,
11
12
  children
12
13
  }) {
13
14
  const ref = useRef(null);
14
- const effectiveMode = mode ?? theme.defaultMode;
15
+ const axes = themeAxes(theme);
16
+ const full = fullSelection(axes, selection);
17
+ const key = selectionKey(axes, full);
15
18
  const value = useMemo(
16
- () => ({ theme, mode: effectiveMode, resolved: resolveTheme(theme, effectiveMode) }),
17
- [theme, effectiveMode]
19
+ () => ({ theme, selection: full, resolved: resolveTheme(theme, full) }),
20
+ // eslint-disable-next-line react-hooks/exhaustive-deps
21
+ [theme, key]
18
22
  );
19
23
  useLayoutEffect(() => {
20
- if (ref.current) applyTheme(ref.current, theme, effectiveMode);
21
- }, [theme, effectiveMode]);
22
- return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children: /* @__PURE__ */ jsx(
23
- "div",
24
- {
25
- ref,
26
- className,
27
- style,
28
- "data-wzl-theme": theme.name,
29
- "data-wzl-mode": effectiveMode,
30
- children
31
- }
32
- ) });
24
+ if (ref.current) applyTheme(ref.current, theme, value.selection);
25
+ }, [theme, value]);
26
+ const attrs = Object.fromEntries(Object.keys(axes).map((a) => [`data-wzl-${a}`, full[a]]));
27
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className, style, "data-wzl-theme": theme.name, ...attrs, children }) });
33
28
  }
34
29
  function useTheme() {
35
30
  const ctx = useContext(ThemeContext);
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react.tsx"],"names":[],"mappings":";;;;AAaA,IAAM,YAAA,GAAe,cAAwC,IAAI,CAAA;AAsB1D,SAAS,aAAA,CAAc;AAAA,EAC5B,KAAA,GAAQ,WAAA;AAAA,EACR,IAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,MAAM,GAAA,GAAM,OAAuB,IAAI,CAAA;AACvC,EAAA,MAAM,aAAA,GAAgB,QAAQ,KAAA,CAAM,WAAA;AAEpC,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,OAAO,EAAE,KAAA,EAAO,IAAA,EAAM,eAAe,QAAA,EAAU,YAAA,CAAa,KAAA,EAAO,aAAa,CAAA,EAAE,CAAA;AAAA,IAClF,CAAC,OAAO,aAAa;AAAA,GACvB;AAEA,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,IAAI,OAAA,EAAS,UAAA,CAAW,GAAA,CAAI,OAAA,EAAS,OAAO,aAAa,CAAA;AAAA,EAC/D,CAAA,EAAG,CAAC,KAAA,EAAO,aAAa,CAAC,CAAA;AAEzB,EAAA,uBACE,GAAA,CAAC,YAAA,CAAa,QAAA,EAAb,EAAsB,KAAA,EACrB,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA;AAAA,MACA,kBAAgB,KAAA,CAAM,IAAA;AAAA,MACtB,eAAA,EAAe,aAAA;AAAA,MAEd;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;AAIO,SAAS,QAAA,GAA8B;AAC5C,EAAA,MAAM,GAAA,GAAM,WAAW,YAAY,CAAA;AACnC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,gDAAgD,CAAA;AAC1E,EAAA,OAAO,GAAA;AACT;AASO,SAAS,gBAAA,GAA6C;AAC3D,EAAA,OAAO,WAAW,YAAY,CAAA;AAChC","file":"react.js","sourcesContent":["import React, { createContext, useContext, useMemo, useRef, useLayoutEffect } from 'react';\nimport { applyTheme } from './applyTheme';\nimport { resolveTheme, type ResolvedTheme } from './resolveTheme';\nimport { weaselTheme, type Theme } from './theme';\n\n/** What `<ThemeProvider>` publishes: the theme, the mode in force, and the\n * fully resolved token record for that pair. */\nexport interface ThemeContextValue {\n readonly theme: Theme;\n readonly mode: string;\n readonly resolved: ResolvedTheme;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\n/** Props for `<ThemeProvider>`. */\nexport interface ThemeProviderProps {\n readonly theme?: Theme;\n readonly mode?: string;\n /** Applied to the wrapper element, so it can be the layout element too. */\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly children: React.ReactNode;\n}\n\n/**\n * Applies a theme to a wrapper element and publishes the resolved record.\n *\n * Consumers that draw outside the DOM (the WebGL HUD) read `resolved` and\n * never touch `getComputedStyle`.\n *\n * The wrapper is a real element in the layout. Pass `className` rather than\n * nesting your own div inside — an anonymous div between a flex parent and\n * its child breaks percentage heights.\n */\nexport function ThemeProvider({\n theme = weaselTheme,\n mode,\n className,\n style,\n children,\n}: ThemeProviderProps): React.ReactElement {\n const ref = useRef<HTMLDivElement>(null);\n const effectiveMode = mode ?? theme.defaultMode;\n\n const value = useMemo<ThemeContextValue>(\n () => ({ theme, mode: effectiveMode, resolved: resolveTheme(theme, effectiveMode) }),\n [theme, effectiveMode],\n );\n\n useLayoutEffect(() => {\n if (ref.current) applyTheme(ref.current, theme, effectiveMode);\n }, [theme, effectiveMode]);\n\n return (\n <ThemeContext.Provider value={value}>\n <div\n ref={ref}\n className={className}\n style={style}\n data-wzl-theme={theme.name}\n data-wzl-mode={effectiveMode}\n >\n {children}\n </div>\n </ThemeContext.Provider>\n );\n}\n\n/** The theme in force. Throws outside a `<ThemeProvider>`; use\n * `useThemeOptional` where the provider is not guaranteed. */\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) throw new Error('useTheme must be used inside a <ThemeProvider>');\n return ctx;\n}\n\n/**\n * The theme if one is provided, `null` otherwise.\n *\n * For kit internals that should follow a theme when the app supplies one but\n * must still work in an app that never mounted a provider — `useHud` is the\n * motivating case.\n */\nexport function useThemeOptional(): ThemeContextValue | null {\n return useContext(ThemeContext);\n}\n"]}
1
+ {"version":3,"sources":["../src/react.tsx"],"names":[],"mappings":";;;;;AAcA,IAAM,YAAA,GAAe,cAAwC,IAAI,CAAA;AAuB1D,SAAS,aAAA,CAAc;AAAA,EAC5B,KAAA,GAAQ,WAAA;AAAA,EACR,SAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,MAAM,GAAA,GAAM,OAAuB,IAAI,CAAA;AACvC,EAAA,MAAM,IAAA,GAAO,UAAU,KAAK,CAAA;AAC5B,EAAA,MAAM,IAAA,GAAO,aAAA,CAAc,IAAA,EAAM,SAAS,CAAA;AAE1C,EAAA,MAAM,GAAA,GAAM,YAAA,CAAa,IAAA,EAAM,IAAI,CAAA;AAEnC,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,MAAM,QAAA,EAAU,YAAA,CAAa,KAAA,EAAO,IAAI,CAAA,EAAE,CAAA;AAAA;AAAA,IAErE,CAAC,OAAO,GAAG;AAAA,GACb;AAEA,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,IAAI,OAAA,EAAS,UAAA,CAAW,IAAI,OAAA,EAAS,KAAA,EAAO,MAAM,SAAS,CAAA;AAAA,EACjE,CAAA,EAAG,CAAC,KAAA,EAAO,KAAK,CAAC,CAAA;AAEjB,EAAA,MAAM,QAAQ,MAAA,CAAO,WAAA,CAAY,OAAO,IAAA,CAAK,IAAI,EAAE,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,YAAY,CAAC,CAAA,CAAA,EAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACzF,EAAA,2BACG,YAAA,CAAa,QAAA,EAAb,EAAsB,KAAA,EACrB,8BAAC,KAAA,EAAA,EAAI,GAAA,EAAU,SAAA,EAAsB,KAAA,EAAc,kBAAgB,KAAA,CAAM,IAAA,EAAO,GAAG,KAAA,EAChF,UACH,CAAA,EACF,CAAA;AAEJ;AAIO,SAAS,QAAA,GAA8B;AAC5C,EAAA,MAAM,GAAA,GAAM,WAAW,YAAY,CAAA;AACnC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,gDAAgD,CAAA;AAC1E,EAAA,OAAO,GAAA;AACT;AASO,SAAS,gBAAA,GAA6C;AAC3D,EAAA,OAAO,WAAW,YAAY,CAAA;AAChC","file":"react.js","sourcesContent":["import React, { createContext, useContext, useMemo, useRef, useLayoutEffect } from 'react';\nimport { applyTheme } from './applyTheme';\nimport { fullSelection, selectionKey, type Selection } from './axes';\nimport { resolveTheme, themeAxes, type ResolvedTheme } from './resolveTheme';\nimport { weaselTheme, type Theme } from './theme';\n\n/** What `<ThemeProvider>` publishes: the theme, the full selection in force, and the\n * fully resolved token record for that pair. */\nexport interface ThemeContextValue {\n readonly theme: Theme;\n readonly selection: Selection;\n readonly resolved: ResolvedTheme;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\n/** Props for `<ThemeProvider>`. */\nexport interface ThemeProviderProps {\n readonly theme?: Theme;\n /** Axis values, e.g. `{ mode: 'light' }`. A missing axis takes its default. */\n readonly selection?: Selection;\n /** Applied to the wrapper element, so it can be the layout element too. */\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly children: React.ReactNode;\n}\n\n/**\n * Applies a theme to a wrapper element and publishes the resolved record.\n *\n * Consumers that draw outside the DOM (the WebGL HUD) read `resolved` and\n * never touch `getComputedStyle`.\n *\n * The wrapper is a real element in the layout. Pass `className` rather than\n * nesting your own div inside — an anonymous div between a flex parent and\n * its child breaks percentage heights.\n */\nexport function ThemeProvider({\n theme = weaselTheme,\n selection,\n className,\n style,\n children,\n}: ThemeProviderProps): React.ReactElement {\n const ref = useRef<HTMLDivElement>(null);\n const axes = themeAxes(theme);\n const full = fullSelection(axes, selection);\n // Keyed on the selection's content: callers pass a fresh object every render.\n const key = selectionKey(axes, full);\n\n const value = useMemo<ThemeContextValue>(\n () => ({ theme, selection: full, resolved: resolveTheme(theme, full) }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [theme, key],\n );\n\n useLayoutEffect(() => {\n if (ref.current) applyTheme(ref.current, theme, value.selection);\n }, [theme, value]);\n\n const attrs = Object.fromEntries(Object.keys(axes).map((a) => [`data-wzl-${a}`, full[a]]));\n return (\n <ThemeContext.Provider value={value}>\n <div ref={ref} className={className} style={style} data-wzl-theme={theme.name} {...attrs}>\n {children}\n </div>\n </ThemeContext.Provider>\n );\n}\n\n/** The theme in force. Throws outside a `<ThemeProvider>`; use\n * `useThemeOptional` where the provider is not guaranteed. */\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) throw new Error('useTheme must be used inside a <ThemeProvider>');\n return ctx;\n}\n\n/**\n * The theme if one is provided, `null` otherwise.\n *\n * For kit internals that should follow a theme when the app supplies one but\n * must still work in an app that never mounted a provider — `useHud` is the\n * motivating case.\n */\nexport function useThemeOptional(): ThemeContextValue | null {\n return useContext(ThemeContext);\n}\n"]}
@@ -1,37 +1,36 @@
1
- type TokenValue = string | number | readonly (string | number)[];
2
- /**
3
- * A single design token as authored, before aliases are resolved: a DTCG-shaped
4
- * `{ type, value }` pair where `value` may still be a `{ref}` to another token.
5
- */
6
- interface RawToken {
7
- readonly type: string;
8
- readonly value: TokenValue;
9
- /** Render the referenced color at this alpha, 0–1. */
10
- readonly alpha?: number | undefined;
11
- readonly description?: string | undefined;
12
- }
13
- /** A token graph flattened to one level, keyed by token name (no `--wzl-`
14
- * prefix). Still unresolved — see `ResolvedTokenMap` for the output side. */
15
- type FlatTokens = Record<string, RawToken>;
1
+ import { B as BakedTheme, b as AxisDefs, f as ThemeDefinition, T as Theme, S as Selection } from './theme-BtpBHcUg.js';
16
2
 
17
3
  /** Every design token the built-in themes declare, spelled as the CSS
18
4
  * custom property it becomes. */
19
- type TokenName = '--wzl-accent' | '--wzl-accent-base' | '--wzl-accent-fg' | '--wzl-accent-hover' | '--wzl-accent-soft' | '--wzl-accent-strong' | '--wzl-backdrop' | '--wzl-border' | '--wzl-border-raised' | '--wzl-border-strong' | '--wzl-border-w' | '--wzl-control-h' | '--wzl-curve-color' | '--wzl-curve-width' | '--wzl-danger' | '--wzl-danger-base' | '--wzl-ease-in-cubic' | '--wzl-ease-in-out-cubic' | '--wzl-ease-out-back' | '--wzl-ease-out-cubic' | '--wzl-fg' | '--wzl-fg-inverse' | '--wzl-fg-muted' | '--wzl-fg-on-accent' | '--wzl-fg-subtle' | '--wzl-field-pad-x' | '--wzl-focus-ring' | '--wzl-font-body' | '--wzl-font-display' | '--wzl-font-mono' | '--wzl-font-size' | '--wzl-font-size-2xs' | '--wzl-font-size-lg' | '--wzl-font-size-sm' | '--wzl-font-size-xl' | '--wzl-font-size-xs' | '--wzl-font-ui' | '--wzl-font-weight-bold' | '--wzl-font-weight-light' | '--wzl-font-weight-medium' | '--wzl-font-weight-normal' | '--wzl-glass-blur' | '--wzl-glass-tint' | '--wzl-gray-100' | '--wzl-gray-200' | '--wzl-gray-300' | '--wzl-gray-400' | '--wzl-gray-50' | '--wzl-gray-500' | '--wzl-gray-600' | '--wzl-gray-700' | '--wzl-gray-800' | '--wzl-gray-900' | '--wzl-leading' | '--wzl-leading-snug' | '--wzl-leading-tight' | '--wzl-line' | '--wzl-line-strong' | '--wzl-line-subtle' | '--wzl-line-width' | '--wzl-motion-fast' | '--wzl-motion-medium' | '--wzl-radius-lg' | '--wzl-radius-md' | '--wzl-radius-pill' | '--wzl-radius-sm' | '--wzl-shadow' | '--wzl-slider-thumb-mix' | '--wzl-slider-thumb-size' | '--wzl-slider-track-h' | '--wzl-slider-track-mix' | '--wzl-space-lg' | '--wzl-space-md' | '--wzl-space-sm' | '--wzl-space-xs' | '--wzl-success' | '--wzl-success-base' | '--wzl-surface' | '--wzl-surface-hover' | '--wzl-surface-pressed' | '--wzl-surface-raised' | '--wzl-surface-sunken' | '--wzl-swatch-amber' | '--wzl-swatch-cyan' | '--wzl-swatch-gold' | '--wzl-swatch-green' | '--wzl-swatch-magenta' | '--wzl-swatch-mint' | '--wzl-swatch-orange' | '--wzl-swatch-pink' | '--wzl-swatch-sky' | '--wzl-swatch-violet' | '--wzl-tb-height' | '--wzl-tracking-none' | '--wzl-tracking-wide' | '--wzl-tracking-wider' | '--wzl-warning' | '--wzl-warning-base' | '--wzl-z-modal' | '--wzl-z-overlay' | '--wzl-z-toolbar';
20
- /** A built-in theme with its aliases already collapsed: every mode maps
21
- * every token name to a final CSS value. */
5
+ type TokenName = '--wzl-accent' | '--wzl-accent-base' | '--wzl-accent-fg' | '--wzl-accent-hover' | '--wzl-accent-soft' | '--wzl-accent-strong' | '--wzl-backdrop' | '--wzl-border' | '--wzl-border-strong' | '--wzl-border-w' | '--wzl-control-h' | '--wzl-curve-color' | '--wzl-curve-width' | '--wzl-danger' | '--wzl-danger-base' | '--wzl-ease-in-cubic' | '--wzl-ease-in-out-cubic' | '--wzl-ease-out-back' | '--wzl-ease-out-cubic' | '--wzl-fg' | '--wzl-fg-inverse' | '--wzl-fg-muted' | '--wzl-fg-on-accent' | '--wzl-fg-subtle' | '--wzl-field-pad-x' | '--wzl-focus-ring' | '--wzl-font-body' | '--wzl-font-display' | '--wzl-font-mono' | '--wzl-font-size' | '--wzl-font-size-2xs' | '--wzl-font-size-lg' | '--wzl-font-size-sm' | '--wzl-font-size-xl' | '--wzl-font-size-xs' | '--wzl-font-ui' | '--wzl-font-weight-bold' | '--wzl-font-weight-light' | '--wzl-font-weight-medium' | '--wzl-font-weight-normal' | '--wzl-glass-blur' | '--wzl-glass-tint' | '--wzl-gray-100' | '--wzl-gray-200' | '--wzl-gray-300' | '--wzl-gray-400' | '--wzl-gray-50' | '--wzl-gray-500' | '--wzl-gray-600' | '--wzl-gray-700' | '--wzl-gray-800' | '--wzl-gray-900' | '--wzl-handle-size' | '--wzl-handle-size-lg' | '--wzl-handle-size-sm' | '--wzl-leading' | '--wzl-leading-snug' | '--wzl-leading-tight' | '--wzl-line' | '--wzl-line-strong' | '--wzl-line-subtle' | '--wzl-line-width' | '--wzl-motion-fast' | '--wzl-motion-medium' | '--wzl-radius-lg' | '--wzl-radius-md' | '--wzl-radius-pill' | '--wzl-radius-sm' | '--wzl-shadow' | '--wzl-slider-thumb-mix' | '--wzl-slider-thumb-size' | '--wzl-slider-track-h' | '--wzl-slider-track-mix' | '--wzl-space-lg' | '--wzl-space-md' | '--wzl-space-sm' | '--wzl-space-xs' | '--wzl-success' | '--wzl-success-base' | '--wzl-surface' | '--wzl-surface-hover' | '--wzl-surface-pressed' | '--wzl-surface-raised' | '--wzl-surface-sunken' | '--wzl-swatch-amber' | '--wzl-swatch-blue' | '--wzl-swatch-citron' | '--wzl-swatch-fuchsia' | '--wzl-swatch-green' | '--wzl-swatch-red' | '--wzl-swatch-rose' | '--wzl-swatch-sky' | '--wzl-swatch-teal' | '--wzl-swatch-violet' | '--wzl-tb-height' | '--wzl-tracking-none' | '--wzl-tracking-wide' | '--wzl-tracking-wider' | '--wzl-warning' | '--wzl-warning-base' | '--wzl-z-modal' | '--wzl-z-overlay' | '--wzl-z-toolbar';
6
+ /** A built-in theme with its aliases already collapsed: every selection
7
+ * (keyed `mode=dark`, axes in declaration order) maps every token name to
8
+ * a final CSS value. */
22
9
  interface GeneratedTheme {
23
10
  readonly name: string;
24
- readonly defaultMode: string;
25
- readonly modes: Readonly<Record<string, Readonly<Record<TokenName, string>>>>;
11
+ readonly axes: AxisDefs;
12
+ readonly selections: Readonly<Record<string, Readonly<Record<TokenName, string>>>>;
26
13
  }
27
14
  /** The built-in themes, resolved, keyed by theme name. Read this to list
28
15
  * or preview themes without resolving a token graph yourself. */
29
16
  declare const THEMES: {
30
17
  readonly weasel: {
31
18
  readonly name: "weasel";
32
- readonly defaultMode: "dark";
33
- readonly modes: {
34
- readonly dark: {
19
+ readonly axes: {
20
+ readonly mode: {
21
+ readonly default: "dark";
22
+ readonly values: {
23
+ readonly dark: {
24
+ readonly scheme: "dark";
25
+ };
26
+ readonly light: {
27
+ readonly scheme: "light";
28
+ };
29
+ };
30
+ };
31
+ };
32
+ readonly selections: {
33
+ readonly 'mode=dark': {
35
34
  readonly '--wzl-gray-50': "#f5f5f6";
36
35
  readonly '--wzl-gray-100': "#e6e7e9";
37
36
  readonly '--wzl-gray-200': "#c9cbcf";
@@ -45,11 +44,31 @@ declare const THEMES: {
45
44
  readonly '--wzl-accent-soft': "#1d1454";
46
45
  readonly '--wzl-accent-base': "#2e1f7a";
47
46
  readonly '--wzl-accent-strong': "#5841b8";
47
+ readonly '--wzl-swatch-fuchsia': "#f641f7";
48
+ readonly '--wzl-swatch-green': "#48e628";
49
+ readonly '--wzl-swatch-sky': "#36bff2";
50
+ readonly '--wzl-swatch-amber': "#e69628";
51
+ readonly '--wzl-swatch-teal': "#3ee1cb";
52
+ readonly '--wzl-swatch-red': "#f75034";
53
+ readonly '--wzl-swatch-blue': "#407ef7";
54
+ readonly '--wzl-swatch-citron': "#d5d23a";
55
+ readonly '--wzl-swatch-rose': "#fa4590";
56
+ readonly '--wzl-swatch-violet': "#955cf9";
57
+ readonly '--wzl-surface': "#181a1e";
58
+ readonly '--wzl-surface-raised': "#25272c";
59
+ readonly '--wzl-surface-sunken': "#0e0f12";
60
+ readonly '--wzl-fg': "#e6e7e9";
61
+ readonly '--wzl-fg-muted': "#9ea1a8";
62
+ readonly '--wzl-fg-subtle': "#6f737b";
63
+ readonly '--wzl-border': "#25272c";
64
+ readonly '--wzl-border-strong': "#6f737b";
65
+ readonly '--wzl-accent-fg': "#5841b8";
66
+ readonly '--wzl-fg-inverse': "#0e0f12";
67
+ readonly '--wzl-shadow': "rgba(0, 0, 0, 0.6)";
48
68
  readonly '--wzl-danger-base': "#d94a3f";
49
69
  readonly '--wzl-warning-base': "#d99a3f";
50
70
  readonly '--wzl-success-base': "#2ec27e";
51
71
  readonly '--wzl-fg-on-accent': "#f5f5f6";
52
- readonly '--wzl-fg': "#e6e7e9";
53
72
  readonly '--wzl-line-subtle': "rgba(230, 231, 233, 0.1)";
54
73
  readonly '--wzl-line': "rgba(230, 231, 233, 0.2)";
55
74
  readonly '--wzl-line-strong': "rgba(230, 231, 233, 0.4)";
@@ -63,16 +82,6 @@ declare const THEMES: {
63
82
  readonly '--wzl-glass-tint': "#2e1f7a";
64
83
  readonly '--wzl-surface-hover': "rgba(230, 231, 233, 0.1)";
65
84
  readonly '--wzl-surface-pressed': "rgba(230, 231, 233, 0.18)";
66
- readonly '--wzl-swatch-green': "#2fdd18";
67
- readonly '--wzl-swatch-pink': "#ff5885";
68
- readonly '--wzl-swatch-cyan': "#00dfff";
69
- readonly '--wzl-swatch-gold': "#dcb700";
70
- readonly '--wzl-swatch-amber': "#ff8c00";
71
- readonly '--wzl-swatch-violet': "#a497ff";
72
- readonly '--wzl-swatch-mint': "#00e7af";
73
- readonly '--wzl-swatch-sky': "#00b8ff";
74
- readonly '--wzl-swatch-orange': "#ff6b00";
75
- readonly '--wzl-swatch-magenta': "#ff6eff";
76
85
  readonly '--wzl-radius-sm': "3px";
77
86
  readonly '--wzl-radius-md': "5px";
78
87
  readonly '--wzl-radius-lg': "14px";
@@ -86,6 +95,9 @@ declare const THEMES: {
86
95
  readonly '--wzl-slider-thumb-size': "8px";
87
96
  readonly '--wzl-slider-track-mix': "18%";
88
97
  readonly '--wzl-slider-thumb-mix': "70%";
98
+ readonly '--wzl-handle-size': "9px";
99
+ readonly '--wzl-handle-size-sm': "7px";
100
+ readonly '--wzl-handle-size-lg': "10px";
89
101
  readonly '--wzl-field-pad-x': "8px";
90
102
  readonly '--wzl-glass-blur': "3px";
91
103
  readonly '--wzl-font-size-2xs': "9px";
@@ -122,19 +134,8 @@ declare const THEMES: {
122
134
  readonly '--wzl-font-weight-normal': "300";
123
135
  readonly '--wzl-font-weight-medium': "350";
124
136
  readonly '--wzl-font-weight-bold': "400";
125
- readonly '--wzl-surface': "#181a1e";
126
- readonly '--wzl-surface-raised': "#25272c";
127
- readonly '--wzl-surface-sunken': "#0e0f12";
128
- readonly '--wzl-fg-muted': "#9ea1a8";
129
- readonly '--wzl-fg-subtle': "#6f737b";
130
- readonly '--wzl-border': "#25272c";
131
- readonly '--wzl-border-strong': "#383b42";
132
- readonly '--wzl-accent-fg': "#5841b8";
133
- readonly '--wzl-fg-inverse': "#0e0f12";
134
- readonly '--wzl-shadow': "rgba(0, 0, 0, 0.6)";
135
- readonly '--wzl-border-raised': "#6f737b";
136
137
  };
137
- readonly light: {
138
+ readonly 'mode=light': {
138
139
  readonly '--wzl-gray-50': "#f5f5f6";
139
140
  readonly '--wzl-gray-100': "#e6e7e9";
140
141
  readonly '--wzl-gray-200': "#c9cbcf";
@@ -148,11 +149,31 @@ declare const THEMES: {
148
149
  readonly '--wzl-accent-soft': "#1d1454";
149
150
  readonly '--wzl-accent-base': "#2e1f7a";
150
151
  readonly '--wzl-accent-strong': "#5841b8";
152
+ readonly '--wzl-swatch-fuchsia': "#f641f7";
153
+ readonly '--wzl-swatch-green': "#48e628";
154
+ readonly '--wzl-swatch-sky': "#36bff2";
155
+ readonly '--wzl-swatch-amber': "#e69628";
156
+ readonly '--wzl-swatch-teal': "#3ee1cb";
157
+ readonly '--wzl-swatch-red': "#f75034";
158
+ readonly '--wzl-swatch-blue': "#407ef7";
159
+ readonly '--wzl-swatch-citron': "#d5d23a";
160
+ readonly '--wzl-swatch-rose': "#fa4590";
161
+ readonly '--wzl-swatch-violet': "#955cf9";
162
+ readonly '--wzl-surface': "#f5f5f6";
163
+ readonly '--wzl-surface-raised': "#e6e7e9";
164
+ readonly '--wzl-surface-sunken': "#c9cbcf";
165
+ readonly '--wzl-fg': "#0e0f12";
166
+ readonly '--wzl-fg-muted': "#383b42";
167
+ readonly '--wzl-fg-subtle': "#4d5058";
168
+ readonly '--wzl-border': "#c9cbcf";
169
+ readonly '--wzl-border-strong': "#4d5058";
170
+ readonly '--wzl-accent-fg': "#2e1f7a";
171
+ readonly '--wzl-fg-inverse': "#f5f5f6";
172
+ readonly '--wzl-shadow': "rgba(0, 0, 0, 0.18)";
151
173
  readonly '--wzl-danger-base': "#d94a3f";
152
174
  readonly '--wzl-warning-base': "#d99a3f";
153
175
  readonly '--wzl-success-base': "#2ec27e";
154
176
  readonly '--wzl-fg-on-accent': "#f5f5f6";
155
- readonly '--wzl-fg': "#0e0f12";
156
177
  readonly '--wzl-line-subtle': "rgba(14, 15, 18, 0.1)";
157
178
  readonly '--wzl-line': "rgba(14, 15, 18, 0.2)";
158
179
  readonly '--wzl-line-strong': "rgba(14, 15, 18, 0.4)";
@@ -166,16 +187,6 @@ declare const THEMES: {
166
187
  readonly '--wzl-glass-tint': "#2e1f7a";
167
188
  readonly '--wzl-surface-hover': "rgba(14, 15, 18, 0.1)";
168
189
  readonly '--wzl-surface-pressed': "rgba(14, 15, 18, 0.18)";
169
- readonly '--wzl-swatch-green': "#2fdd18";
170
- readonly '--wzl-swatch-pink': "#ff5885";
171
- readonly '--wzl-swatch-cyan': "#00dfff";
172
- readonly '--wzl-swatch-gold': "#dcb700";
173
- readonly '--wzl-swatch-amber': "#ff8c00";
174
- readonly '--wzl-swatch-violet': "#a497ff";
175
- readonly '--wzl-swatch-mint': "#00e7af";
176
- readonly '--wzl-swatch-sky': "#00b8ff";
177
- readonly '--wzl-swatch-orange': "#ff6b00";
178
- readonly '--wzl-swatch-magenta': "#ff6eff";
179
190
  readonly '--wzl-radius-sm': "3px";
180
191
  readonly '--wzl-radius-md': "5px";
181
192
  readonly '--wzl-radius-lg': "14px";
@@ -189,6 +200,9 @@ declare const THEMES: {
189
200
  readonly '--wzl-slider-thumb-size': "8px";
190
201
  readonly '--wzl-slider-track-mix': "18%";
191
202
  readonly '--wzl-slider-thumb-mix': "70%";
203
+ readonly '--wzl-handle-size': "9px";
204
+ readonly '--wzl-handle-size-sm': "7px";
205
+ readonly '--wzl-handle-size-lg': "10px";
192
206
  readonly '--wzl-field-pad-x': "8px";
193
207
  readonly '--wzl-glass-blur': "3px";
194
208
  readonly '--wzl-font-size-2xs': "9px";
@@ -225,74 +239,28 @@ declare const THEMES: {
225
239
  readonly '--wzl-font-weight-normal': "300";
226
240
  readonly '--wzl-font-weight-medium': "350";
227
241
  readonly '--wzl-font-weight-bold': "400";
228
- readonly '--wzl-surface': "#f5f5f6";
229
- readonly '--wzl-surface-raised': "#e6e7e9";
230
- readonly '--wzl-surface-sunken': "#c9cbcf";
231
- readonly '--wzl-fg-muted': "#383b42";
232
- readonly '--wzl-fg-subtle': "#4d5058";
233
- readonly '--wzl-border': "#c9cbcf";
234
- readonly '--wzl-border-strong': "#9ea1a8";
235
- readonly '--wzl-accent-fg': "#2e1f7a";
236
- readonly '--wzl-fg-inverse': "#f5f5f6";
237
- readonly '--wzl-shadow': "rgba(0, 0, 0, 0.18)";
238
- readonly '--wzl-border-raised': "#6f737b";
239
242
  };
240
243
  };
241
244
  };
242
245
  };
243
- /** Unresolved token graph. `extends` needs the aliases intact so an override
244
- * of a base primitive still reaches everything referencing it. */
245
- interface ThemeSource {
246
- readonly primitives: Readonly<Record<string, RawToken>>;
247
- readonly modes: Readonly<Record<string, Readonly<Record<string, RawToken>>>>;
248
- }
249
- /** The same built-in themes as `THEMES`, unresolved. This is what
250
- * `defineTheme` layers onto. */
251
- declare const THEME_SOURCES: Readonly<Record<string, ThemeSource>>;
252
-
253
- /** Authoring shorthand: a bare string is a literal or a `{ref}`. */
254
- type TokenInput = string | number | RawToken;
255
- /** What `defineTheme` accepts: a name, the base theme to layer onto, and the
256
- * token overrides, split into mode-invariant and per-mode. */
257
- interface ThemeInput {
258
- readonly name: string;
259
- /** Base to layer onto. Defaults to `weaselTheme`; `null` opts out. */
260
- readonly extends?: Theme | null;
261
- readonly defaultMode?: string;
262
- /** Mode-invariant overrides. */
263
- readonly tokens?: Readonly<Record<string, TokenInput>>;
264
- readonly modes: Readonly<Record<string, Readonly<Record<string, TokenInput>>>>;
265
- }
266
- /**
267
- * A theme: a named set of design tokens, organized into a mode-invariant layer
268
- * plus one layer per mode (light, dark, …), optionally extending another theme.
269
- * Tokens are held unresolved — aliases between them are collapsed later by
270
- * `resolveTheme`, so an override of a base primitive still reaches everything
271
- * that references it.
272
- */
273
- interface Theme {
274
- readonly name: string;
275
- readonly extends: Theme | null;
276
- readonly defaultMode: string;
277
- readonly tokens: FlatTokens;
278
- readonly modes: Readonly<Record<string, FlatTokens>>;
279
- }
280
- /** The built-in theme, materialized from the generated source. */
281
- declare const weaselTheme: Theme;
282
- /** Build a theme from authoring shorthand. Unless `extends` says otherwise the
283
- * result layers onto `weaselTheme`, so a theme only needs to name what it
284
- * changes. */
285
- declare function defineTheme(input: ThemeInput): Theme;
246
+ /** The built-in themes as authored: their unbaked definitions. */
247
+ declare const THEME_SOURCES: Readonly<Record<string, ThemeDefinition>>;
248
+ /** The built-in themes with every rule run and references intact. This is
249
+ * what `weaselTheme` is built from, so the runtime entry bundles no generator. */
250
+ declare const BAKED_THEMES: Readonly<Record<string, BakedTheme>>;
286
251
 
287
- /** The output of `resolveTheme`: every token of a theme, for one mode, keyed
252
+ /** The output of `resolveTheme`: every token of a theme, for one selection, keyed
288
253
  * by CSS custom-property name and flattened to a final CSS value. */
289
254
  type ResolvedTheme = Readonly<Record<TokenName, string>>;
255
+ /** Every axis the chain declares. An axis declared more than once keeps every value; a descendant's value entries and default win. */
256
+ declare function themeAxes(theme: Theme): AxisDefs;
290
257
  /**
291
- * Merge the extends chain, layer the mode over it, resolve every alias, and
292
- * key the result by CSS custom-property name.
258
+ * Merge the extends chain at a selection, resolve every alias, and key the
259
+ * result by CSS custom-property name. A missing or unknown axis value takes the
260
+ * axis default.
293
261
  *
294
262
  * Pure — no DOM. An unresolvable reference throws rather than falling back.
295
263
  */
296
- declare function resolveTheme(theme: Theme, mode: string): ResolvedTheme;
264
+ declare function resolveTheme(theme: Theme, selection?: Selection): ResolvedTheme;
297
265
 
298
- export { type FlatTokens as F, type GeneratedTheme as G, type RawToken as R, type Theme as T, type ResolvedTheme as a, THEMES as b, THEME_SOURCES as c, type ThemeInput as d, type ThemeSource as e, type TokenInput as f, type TokenName as g, defineTheme as h, resolveTheme as r, weaselTheme as w };
266
+ export { BAKED_THEMES as B, type GeneratedTheme as G, type ResolvedTheme as R, type TokenName as T, THEMES as a, THEME_SOURCES as b, resolveTheme as r, themeAxes as t };
@@ -0,0 +1,189 @@
1
+ /** One value of an axis. `scheme` becomes `color-scheme` in that value's CSS blocks. */
2
+ interface AxisValue {
3
+ readonly scheme?: 'dark' | 'light';
4
+ }
5
+ interface AxisDef {
6
+ readonly default: string;
7
+ readonly values: Readonly<Record<string, AxisValue>>;
8
+ }
9
+ /** Key order is declaration order, which selectors and selection keys follow. */
10
+ type AxisDefs = Readonly<Record<string, AxisDef>>;
11
+ /** A partial choice of axis values, e.g. `{ mode: 'light' }`. */
12
+ type Selection = Readonly<Record<string, string>>;
13
+ /** `{ by: 'mode', dark: …, light: … }`: a value that differs per axis value. */
14
+ interface ByAxis<T> {
15
+ readonly by: string;
16
+ readonly [axisValue: string]: Varying<T> | string;
17
+ }
18
+ type Varying<T> = T | ByAxis<T>;
19
+ declare function isByAxis(v: unknown): v is ByAxis<unknown>;
20
+ /** Every axis given a known value; anything missing or unknown takes its default. */
21
+ declare function fullSelection(axes: AxisDefs, selection?: Selection): Selection;
22
+ declare function enumerateSelections(axes: AxisDefs): Selection[];
23
+ /** `mode=dark,density=compact`, axes in declaration order. */
24
+ declare function selectionKey(axes: AxisDefs, selection: Selection): string;
25
+
26
+ type TokenValue = string | number | readonly (string | number)[];
27
+ /**
28
+ * A single design token as authored, before aliases are resolved: a DTCG-shaped
29
+ * `{ type, value }` pair where `value` may still be a `{ref}` to another token.
30
+ */
31
+ interface RawToken {
32
+ readonly type: string;
33
+ readonly value: TokenValue;
34
+ /** Render the referenced color at this alpha, 0–1. */
35
+ readonly alpha?: number | undefined;
36
+ readonly description?: string | undefined;
37
+ }
38
+ /** A token graph flattened to one level, keyed by token name (no `--wzl-`
39
+ * prefix). Still unresolved — see `ResolvedTokenMap` for the output side. */
40
+ type FlatTokens = Record<string, RawToken>;
41
+
42
+ /** A number, or `{seeds.name}`. */
43
+ type NumberParam = Varying<number | string>;
44
+ interface PinObject {
45
+ readonly value: TokenValue;
46
+ readonly type?: string;
47
+ readonly description?: string;
48
+ readonly alpha?: number;
49
+ }
50
+ /** A bare value or `{ value, type?, description?, alpha? }`. The value may be a `{token}` reference. */
51
+ type PinValue = TokenValue | PinObject;
52
+ interface LightnessRampDef {
53
+ readonly kind: 'lightness';
54
+ readonly steps: Varying<readonly string[]>;
55
+ /** First and last step's OKLCH lightness. */
56
+ readonly lightness: Varying<readonly [NumberParam, NumberParam]>;
57
+ /** 0 walks evenly; 1 follows a smoothstep S. */
58
+ readonly curve?: NumberParam;
59
+ /** Degrees. Ignored when an anchor is given. */
60
+ readonly hue?: NumberParam;
61
+ readonly chroma?: Varying<{
62
+ readonly peak: NumberParam;
63
+ readonly lightBias?: NumberParam;
64
+ readonly darkBias?: NumberParam;
65
+ }>;
66
+ /** Step name → exact hex (or `{seeds.name}`). The first anchor supplies hue and chroma. */
67
+ readonly anchor?: Varying<Readonly<Record<string, Varying<string>>>>;
68
+ readonly description?: string;
69
+ readonly describe?: Readonly<Record<string, string>>;
70
+ }
71
+ interface CategoricalRampDef {
72
+ readonly kind: 'categorical';
73
+ readonly steps: Varying<readonly string[]>;
74
+ /** Any of the palette generator's `Constraints` except `count` and `anchors`. */
75
+ readonly gates?: Varying<Readonly<Record<string, Varying<number | string>>>>;
76
+ readonly anchors?: readonly {
77
+ readonly name: string;
78
+ readonly hue: number;
79
+ readonly lightness: number;
80
+ readonly chroma?: number;
81
+ }[];
82
+ readonly description?: string;
83
+ readonly describe?: Readonly<Record<string, string>>;
84
+ }
85
+ type RampDef = LightnessRampDef | CategoricalRampDef;
86
+ interface ScaleDef {
87
+ readonly steps: Varying<readonly string[]>;
88
+ readonly base: NumberParam;
89
+ /** Linear: `base + step × i`. */
90
+ readonly step?: NumberParam;
91
+ /** Geometric: `base × ratio^i`. */
92
+ readonly ratio?: NumberParam;
93
+ readonly description?: string;
94
+ readonly describe?: Readonly<Record<string, string>>;
95
+ }
96
+ interface SemanticCommon {
97
+ readonly type?: string;
98
+ readonly description?: string;
99
+ /** Audited, never applied. */
100
+ readonly check?: {
101
+ readonly contrast: number;
102
+ readonly against: readonly string[];
103
+ };
104
+ }
105
+ type StepRule = SemanticCommon & {
106
+ readonly ramp: string;
107
+ readonly step: Varying<string>;
108
+ };
109
+ type OffsetRule = SemanticCommon & {
110
+ readonly from: string;
111
+ readonly offset: number;
112
+ readonly dir: 'lighter' | 'darker' | 'away';
113
+ };
114
+ type ContrastRule = SemanticCommon & {
115
+ readonly ramp: string;
116
+ readonly contrast: {
117
+ readonly min: number;
118
+ readonly against: readonly string[];
119
+ };
120
+ };
121
+ type RefRule = SemanticCommon & {
122
+ readonly ref: string;
123
+ readonly alpha?: number;
124
+ };
125
+ type LiteralRule = SemanticCommon & {
126
+ readonly value: TokenValue;
127
+ };
128
+ type SemanticRule = StepRule | OffsetRule | ContrastRule | RefRule | LiteralRule;
129
+ interface ThemeDefinition {
130
+ readonly name: string;
131
+ /** Another definition's name. Absent or null: extends nothing. */
132
+ readonly extends?: string | null;
133
+ readonly description?: string;
134
+ readonly axes?: AxisDefs;
135
+ readonly seeds?: Readonly<Record<string, Varying<number | string>>>;
136
+ readonly ramps?: Readonly<Record<string, RampDef>>;
137
+ readonly scales?: Readonly<Record<string, ScaleDef>>;
138
+ readonly semantics?: Readonly<Record<string, Varying<SemanticRule>>>;
139
+ readonly components?: Readonly<Record<string, Varying<PinValue>>>;
140
+ readonly pins?: Readonly<Record<string, Varying<PinValue>>>;
141
+ }
142
+
143
+ type Lookup = (name: string) => ThemeDefinition | undefined;
144
+ /** The definition with its whole `extends` chain folded in, child entries winning. */
145
+ declare function mergeChain(def: ThemeDefinition, lookup?: Lookup, seen?: ReadonlySet<string>): ThemeDefinition;
146
+
147
+ /**
148
+ * A definition with every rule run: plain or `by`-varying tokens, references intact.
149
+ * A branch `derive` could not produce is left out, so at runtime it falls through to the parent; definitions with
150
+ * issues still bake, because the editor bakes mid-edit and the build refuses them before baking. Cycles and dangling
151
+ * references still throw, as they do in `derive`.
152
+ */
153
+ interface BakedTheme {
154
+ readonly name: string;
155
+ readonly extends: string | null;
156
+ readonly axes: AxisDefs;
157
+ /** In layer order, then definition order. */
158
+ readonly tokens: Readonly<Record<string, Varying<RawToken>>>;
159
+ }
160
+ /** Derive `definition` at every selection and fold the results into one record of tokens with no rules left. */
161
+ declare function bake(definition: ThemeDefinition, lookup?: Lookup): BakedTheme;
162
+ /** `definition` and every theme it extends, baked, root first. */
163
+ declare function bakeChain(definition: ThemeDefinition, lookup?: Lookup): BakedTheme[];
164
+
165
+ /**
166
+ * A theme ready to resolve: its axes and its tokens, each plain or varying by
167
+ * axis, references intact. A `by` that leaves a value out contributes nothing
168
+ * for that selection, so the theme it extends supplies it.
169
+ */
170
+ interface Theme {
171
+ readonly name: string;
172
+ readonly extends: Theme | null;
173
+ readonly axes: AxisDefs;
174
+ readonly tokens: Readonly<Record<string, Varying<RawToken>>>;
175
+ }
176
+ /** What `defineTheme` accepts: a definition whose `extends` is a `Theme`, holding pins and components only. */
177
+ type ThemeInput = Omit<ThemeDefinition, 'extends'> & {
178
+ readonly extends?: Theme | null;
179
+ };
180
+ /** The built-in theme, from the baked output of themes/weasel.json. */
181
+ declare const weaselTheme: Theme;
182
+ /**
183
+ * Build a theme from pins. Unless `extends` says otherwise the result layers
184
+ * onto `weaselTheme`, so a theme only names what it changes. A definition with
185
+ * seeds, ramps, scales or semantics needs deriving first.
186
+ */
187
+ declare function defineTheme(input: ThemeInput): Theme;
188
+
189
+ export { type AxisDef as A, type BakedTheme as B, type CategoricalRampDef as C, type FlatTokens as F, type Lookup as L, type NumberParam as N, type OffsetRule as O, type PinObject as P, type RawToken as R, type Selection as S, type Theme as T, type Varying as V, type TokenValue as a, type AxisDefs as b, type AxisValue as c, type ByAxis as d, type PinValue as e, type ThemeDefinition as f, type ThemeInput as g, defineTheme as h, enumerateSelections as i, fullSelection as j, isByAxis as k, type ContrastRule as l, type LightnessRampDef as m, type LiteralRule as n, type RampDef as o, type RefRule as p, type ScaleDef as q, type SemanticRule as r, selectionKey as s, type StepRule as t, bake as u, bakeChain as v, weaselTheme as w, mergeChain as x };