import type { ColorSwatchDiagnostics, ColorSwatchSelectionResult, DefaultSemanticStatusRole, GeneratedThemeModeColors, GeneratedThemeSwatches, HexColor, SemanticColorReferenceMap, ThemeColorMode, } from '@ankhorage/color-theory'; import type { ThemeConfig as ContractsThemeConfig } from '@ankhorage/contracts'; import type { ReactNode } from 'react'; export interface NeutralSemantics { bg: string; bgSubtle: string; surface: string; surfaceHover: string; surfaceActive: string; border: string; borderStrong: string; divider: string; text: string; textMuted: string; textSubtle: string; disabledBg: string; disabledText: string; } export interface RoleSemantics { base: string; hover: string; strong: string; softBg: string; softHover: string; softActive: string; outline: string; onSurfaceText: string; onSolidText: string; onHoverText: string; onStrongText: string; onSoftText: string; onSoftHoverText: string; onSoftActiveText: string; disabledBg: string; onDisabledText: string; } export interface SurfaceSemantics { default: string; subtle: string; raised: string; sunken: string; overlay: string; scrim: string; disabled: string; inverse: string; } export interface ContentSemantics { default: string; muted: string; subtle: string; disabled: string; icon: string; link: string; visited: string; inverse: string; } export interface BorderSemantics { default: string; subtle: string; strong: string; divider: string; focus: string; } export interface SelectionSemantics { background: string; content: string; border: string; } export interface ActionSemantics { primary: RoleSemantics; neutral: RoleSemantics; danger: RoleSemantics; } export interface ThemeSemantics { neutral: NeutralSemantics; brand: RoleSemantics; secondary: RoleSemantics; accent: RoleSemantics; highlight: RoleSemantics; danger: RoleSemantics; success: RoleSemantics; warning: RoleSemantics; error: RoleSemantics; info: RoleSemantics; surface: SurfaceSemantics; content: ContentSemantics; border: BorderSemantics; selection: SelectionSemantics; action: ActionSemantics; } export interface SurfaceContrastDiagnostic { id: string; foreground: HexColor; background: HexColor; contrast: number; minimumContrast: number; passes: boolean; } /** A Color Theory swatch selection together with its stable Surface purpose. */ export interface SurfaceColorSelectionDiagnostic { id: string; result: ColorSwatchSelectionResult; } /** Owner-produced color evidence used to explain a resolved Surface theme. */ export interface SurfaceColorDiagnostics { mode: ThemeColorMode; generated: GeneratedThemeModeColors; semanticReferences: SemanticColorReferenceMap; statusSwatches: Record; selections: readonly SurfaceColorSelectionDiagnostic[]; contrasts: readonly SurfaceContrastDiagnostic[]; surfaceSeparation: readonly SurfaceContrastDiagnostic[]; } export type FontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | 'bold' | 'normal'; export interface ThemeTokens { colors: { primary: string; secondary: string; accent: string; highlight: string; tertiary: string; quaternary: string; background: string; surface: string; text: string; textSecondary: string; border: string; error: string; success: string; warning: string; info: string; [key: string]: string; }; swatches: GeneratedThemeSwatches; semantics: ThemeSemantics; /** Generated owner evidence; this is runtime output and is not persisted in ThemeConfig. */ colorDiagnostics: SurfaceColorDiagnostics; spacing: { none: 0; xs: number; s: number; m: number; l: number; xl: number; xxl: number; [key: string]: number; }; radii: { none: 0; s: number; m: number; l: number; full: number; [key: string]: number; }; typography: { headings: Record< 1 | 2 | 3 | 4 | 5 | 6, { size: number; lineHeight: number; weight: 'regular' | 'medium' | 'semiBold' | 'bold'; } >; sizes: { xs: number; s: number; m: number; l: number; xl: number; xxl: number; '3xl': number; h1: number; h2: number; h3: number; h4: number; h5: number; h6: number; [key: string]: number; }; weights: { thin: FontWeight; extraLight: FontWeight; light: FontWeight; regular: FontWeight; medium: FontWeight; semiBold: FontWeight; bold: FontWeight; extraBold: FontWeight; black: FontWeight; }; fonts: { /** Map of weight -> fontFamily name for normal style */ normal: Record; /** Map of weight -> fontFamily name for italic style */ italic: Record; }; }; shadows: { soft: number; medium: number; hard: number; [key: string]: number; }; } export interface SurfaceTheme extends ThemeTokens { config: ContractsThemeConfig; inverted?: boolean; } export type ThemeMode = 'light' | 'dark'; export interface ThemeRuntime { theme: SurfaceTheme; mode: ThemeMode; inverted?: boolean; setThemeConfig: (config: Partial) => void; setMode: (mode: ThemeMode) => void; } export interface ThemeProviderProps { children: ReactNode; initialConfig?: Partial; initialMode?: ThemeMode; } export interface ThemeScopeProps { children: ReactNode; themeConfig?: Partial; mode?: ThemeMode; inverted?: boolean; }