@youwen/ai-design-system
Version:
Enterprise AI-driven design system with comprehensive design tokens
46 lines (45 loc) • 1.48 kB
TypeScript
/**
* 主题系统核心文件
* 支持动态主题切换、本地存储持久化和系统主题检测
*/
export type ThemeMode = 'light' | 'dark' | 'system';
export type ThemeVariant = 'default' | 'figma' | 'v2' | 'enterprise';
export interface ThemeConfig {
mode: ThemeMode;
variant: ThemeVariant;
customColors?: Record<string, string>;
}
export interface ThemeColors {
background: string;
foreground: string;
primary: string;
primaryForeground: string;
secondary: string;
secondaryForeground: string;
success: string;
successForeground: string;
warning: string;
warningForeground: string;
error: string;
errorForeground: string;
info: string;
infoForeground: string;
border: string;
input: string;
ring: string;
brandPrimary: string;
brandSecondary: string;
v2Primary: string;
v2Secondary: string;
v2Accent: string;
}
export declare const themes: Record<ThemeVariant, {
light: ThemeColors;
dark: ThemeColors;
}>;
export declare const getSystemTheme: () => 'light' | 'dark';
export declare const resolveThemeMode: (mode: ThemeMode) => 'light' | 'dark';
export declare const applyTheme: (variant: ThemeVariant, mode: ThemeMode, customColors?: Record<string, string>) => void;
export declare const saveThemeConfig: (config: ThemeConfig) => void;
export declare const loadThemeConfig: () => ThemeConfig | null;
export declare const getDefaultThemeConfig: () => ThemeConfig;