//#region src/theme.d.ts /** Built-in bundle to start from before applying overrides. */ type ThemePreset = "modern" | "editorial" | "mono" | "vivid" | "print" | "eink"; /** Dark-mode strategy: derive twins (`"auto"`), override some, or omit (`false`). */ type DarkSpec = Partial | "auto" | false; /** The intent you describe; every field is optional and maps to one `--mc-*`. */ interface ThemeSpec { /** Start from a preset bundle, then override. Folded into `vars` — no attribute needed. */ extends?: ThemePreset; /** Brand emphasis colour. Seeds the derived palette + dark twins. */ accent?: string; /** Primary data ink. */ stroke?: string; /** Good-direction valence (kept on a CVD-safe bluish-green unless you set it). */ positive?: string; /** Bad-direction valence (kept on a CVD-safe vermillion unless you set it). */ negative?: string; /** No-valence marks and baselines. */ neutral?: string; /** Normal-range / area shading. */ band?: string; /** MoonPhase lit area. */ moon?: string; /** * Categorical series palette. An array is used verbatim; a number derives that * many harmonized tones from `accent`. Omitted with an `accent` present (and * `derive` not `false`) derives six. */ cat?: readonly string[] | number; /** Base font shorthand for chart text. */ font?: string; /** Face for tabular figures + labels (defaults to `font`). */ fontNumeric?: string; /** Label size (a CSS length, e.g. `"0.8em"`) — `--mc-label-size`. It reaches * the readout chip and any chart text the library did not size itself. A * chart that reserves a gutter for its label computes that size in geometry * and pins it, so raise the floor there with the chart's `labelSize` PROP (a * number, in viewBox units); this token cannot move a gutter. */ labelSize?: string; /** Label weight. */ labelWeight?: number | string; /** Base data stroke weight (maps to `--mc-stroke-width`). */ strokeWidth?: number | string; /** Uniform density scalar — compact (`< 1`) vs comfortable (`> 1`). */ density?: number; /** Small-multiple gap (a CSS length). */ gap?: string; /** Motion duration (a CSS time). */ duration?: string; /** Motion easing. */ easing?: string; /** Readout-chip surface, ink, and edge. */ surface?: string; surfaceInk?: string; surfaceEdge?: string; /** Ink for labels painted on top of saturated data fills. */ onFill?: string; /** * Ink for labels painted on top of a CATEGORICAL fill (PartitionStrip). A * separate token from `onFill` because the categorical family is mid-tone by * construction where the semantic fills are deep, so the two want opposite * inks — see `--mc-on-cat` in styles.css. * * Left unset with a derived palette, the better of the two default inks is * chosen from the derived cats' own lightness. Set it explicitly if your * palette sits near the middle of the lightness range, where NEITHER ink * clears 4.5:1 on a label-bearing fill and the honest fix is a lighter or * darker categorical family rather than a different ink. */ onCat?: string; /** Turn accent-seeded derivation on/off (defaults on when `accent` is set). */ derive?: boolean; /** Dark-mode overrides. Defaults to `"auto"` — derived twins of every hex token. */ dark?: DarkSpec; } type Vars = Record; /** The compiled theme: token maps plus ways to apply them. */ interface Theme { /** Light-mode `--mc-*` properties. */ readonly vars: Readonly; /** Dark-mode `--mc-*` properties (empty when `dark` is `false`). */ readonly darkVars: Readonly; /** Alias of `vars`, ready for `style={theme.style}` or ``. */ readonly style: Readonly; /** Serialize to CSS: `selector { … }` plus a `prefers-color-scheme: dark` twin. */ css(selector?: string): string; /** Derive a new theme from this one with further overrides. */ extend(spec: ThemeSpec): Theme; /** Same as `css(":root")`. */ toString(): string; } /** * Compile a `ThemeSpec` into a {@link Theme}. Called with no accent it simply * echoes the fields you set; called with one it derives a full palette. */ declare function defineTheme(spec?: ThemeSpec): Theme; //#endregion export { DarkSpec, Theme, ThemePreset, ThemeSpec, defineTheme };