/** * @hiai-gg/hiai-ui — Multi-theme registry + applyTheme * * Mirrors the design tokens declared in `src/styles/tokens.css` (HiAi canon) * and `src/styles/theme-webs.css` (Webs "Laser Grid" palette). Components * that read `var(--background)`, `var(--primary)`, `var(--ring)`, `var(--card)`, * `var(--border)`, `var(--font-heading)`, `var(--font-body)` re-skin * automatically — same DOM, same components, only the palette swaps. * * Two themes ship in v0.1.0: * - hiai: HiAi canon (oklch / shadcn-svelte new-york on slate). * Light primary `#20b2aa` (teal), dark primary `#9932cc` (purple). * - webs: Webs Laser Grid (hot-pink / lime / pure-black). * Light primary `#cc007a`, dark primary `#ff0099`. * * Dark variants use the flat `--dark-` prefix convention so a single * `Record` can carry both. `applyTheme` resolves the prefix * at runtime based on the `dark` boolean. */ export interface ThemeDefinition { /** Stable theme id used as the registry key. Lowercase, kebab-case. */ id: string; /** Human-readable name (shown in ThemeSwitcher UI). */ name: string; /** Optional one-liner shown in tooltips / docs. */ description?: string; /** * CSS custom properties. Light variants use the canonical `--name` form; * dark variants are prefixed `--dark-` (e.g. `--dark-background`). * `applyTheme` resolves the prefix based on the `dark` flag. */ variables: Record; /** Font stacks applied to `--font-heading` and `--font-body`. */ fonts?: { heading?: string; body?: string; }; } export declare const THEME_HIAI: ThemeDefinition; export declare const THEME_WEBS: ThemeDefinition; /** * All built-in themes keyed by id. Consumers can extend by spreading: * const registry = { ...THEME_REGISTRY, acme: THEME_ACME }; */ export declare const THEME_REGISTRY: Record; /** * Apply a theme's CSS custom properties to `document.documentElement`. * * Resolution rules: * - For each `theme.variables` entry: * - If `dark === true` and the key starts with `--dark-`, strip the * prefix and set the resulting base key (e.g. `--dark-background` * → set `--background`). * - If `dark === false` and the key does NOT start with `--dark-`, * set the key as-is. * - Otherwise skip (e.g. a light-mode call never writes `--dark-*`). * - Fonts from `theme.fonts` are written to `--font-heading` / `--font-body`. * - `color-scheme` is set to `'dark'` or `'light'` so native form controls * and scrollbars match. * - The `.dark` class on `` is toggled so frameworks that branch on * it (Tailwind `dark:` variant, shadcn-svelte `.dark` selectors) still work. * * Unknown theme ids are a no-op. SSR-safe (guarded by `typeof document`). */ export declare function applyTheme(id: string, dark: boolean): void;