/** * Design-token registry — the single source of truth for what CSS custom * properties CommonPub recognizes, what category each belongs to, and what * input control the theme editor should render for it. * * Adding a new token: * 1. Add the CSS variable to `theme/base.css` (and any family overrides). * 2. Add a `TokenSpec` entry below. * 3. (Optional) If it's a new category, add to `TokenGroup`, * `TOKEN_GROUP_LABELS`, and `TOKEN_GROUP_ORDER`. * * The editor reads this file via `tokensByGroup()` and renders one * `` per entry — no editor-side changes needed. */ export interface TokenSpec { /** Token name without the leading `--`. */ key: string; /** Group it appears under in the editor. */ group: TokenGroup; /** Input control to render. */ kind: TokenKind; /** Optional one-line description shown in the editor. */ description?: string; /** Default value (matches base.css). Used as the "reset" target + the * baseline against which the discovery diff is computed. */ default: string; } export type TokenGroup = 'surfaces' | 'text' | 'borders' | 'accent' | 'semantic' | 'code' | 'typography' | 'spacing' | 'shape' | 'shadow' | 'treatment' | 'motion' | 'layout' | 'chrome' | 'z-index'; export type TokenKind = 'color' | 'length' | 'number' | 'font-family' | 'font-weight' | 'shadow' | 'transition' | 'string'; export declare const TOKEN_SPECS: TokenSpec[]; /** * Tokens that exist in `theme/base.css` for legacy reasons but aren't * surfaced in the editor UI. `validateTokenOverrides` still accepts them * so existing saved overrides keep working. */ export declare const ALIAS_TOKEN_NAMES: readonly string[]; /** Flat list of canonical token names — TOKEN_SPECS keys plus the alias set. */ export declare const TOKEN_NAMES: string[]; /** Display labels for token groups, used in the editor UI. */ export declare const TOKEN_GROUP_LABELS: Record; export declare const TOKEN_GROUP_ORDER: TokenGroup[]; /** Get a token spec by key (for editor input selection). */ export declare function getTokenSpec(key: string): TokenSpec | undefined; /** Group all known tokens by category for editor rendering. */ export declare function tokensByGroup(): Record; /** Partition a token-name list into `valid` (canonical or alias) and `invalid`. */ export declare function validateTokenOverrides(overrides: Record): { valid: Record; invalid: string[]; }; //# sourceMappingURL=tokens.d.ts.map