UNPKG

@youwen/ai-design-system

Version:

Enterprise AI-driven design system with comprehensive design tokens

27 lines (26 loc) 937 B
/** * 主题提供者组件 * 提供主题上下文和动态切换功能 */ import * as React from "react"; import { ThemeConfig, ThemeMode, ThemeVariant } from "../lib/theme"; interface ThemeContextType { config: ThemeConfig; mode: ThemeMode; variant: ThemeVariant; resolvedMode: 'light' | 'dark'; setMode: (mode: ThemeMode) => void; setVariant: (variant: ThemeVariant) => void; setCustomColors: (colors: Record<string, string>) => void; toggleMode: () => void; } export interface ThemeProviderProps { children: React.ReactNode; defaultConfig?: Partial<ThemeConfig>; storageKey?: string; enableSystem?: boolean; disableTransitionOnChange?: boolean; } export declare function ThemeProvider({ children, defaultConfig, storageKey, enableSystem, disableTransitionOnChange, ...props }: ThemeProviderProps): JSX.Element; export declare const useTheme: () => ThemeContextType; export {};