tango-ui-cw
Version:
A lightweight ui library with ClayW
22 lines (18 loc) • 663 B
TypeScript
import type { PropsWithChildren } from "react";
export type ThemeMode = "light" | "dark";
export type ThemeTokens = Record<string, string>;
export interface ThemeContextValue {
theme: ThemeMode;
setTheme: (nextTheme: ThemeMode) => void;
toggleTheme: () => void;
themeTokens: ThemeTokens;
setThemeTokens: (
nextTokensOrUpdater:
| ThemeTokens
| ((previousTokens: ThemeTokens) => ThemeTokens)
) => void;
setThemeColor: (color: string, tokenList?: string[]) => void;
resetThemeTokens: () => void;
}
export declare function ThemeProvider(props: PropsWithChildren): JSX.Element;
export declare function useTheme(): ThemeContextValue;