/**
* Available theme options
* @typedef {'dark' | 'light' | 'system'} Theme
*/
type Theme = 'dark' | 'light' | 'system';
/**
* Props for the ThemeProvider component
* @interface ThemeProviderProps
* @property {React.ReactNode} children - Child components that will have access to the theme context
* @property {Theme} [defaultTheme='system'] - Initial theme to use if none is stored
* @property {string} [storageKey='sqlrooms-ui-theme'] - Local storage key to persist theme preference
*/
type ThemeProviderProps = {
children: React.ReactNode;
defaultTheme?: Theme;
storageKey?: string;
};
/**
* Theme context state
* @interface ThemeProviderState
* @property {Theme} theme - Current active theme
* @property {(theme: Theme) => void} setTheme - Function to update the current theme
*/
type ThemeProviderState = {
theme: Theme;
setTheme: (theme: Theme) => void;
};
/**
* ThemeProvider component that manages and provides theme context to its children.
* Handles system theme detection and persistence of theme preference.
*
* @example
* ```tsx
* // Basic usage with default settings
* function App() {
* return (
*
*
*
* );
* }
*
* // Custom default theme and storage key
* function App() {
* return (
*
*
*
* );
* }
* ```
*/
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
/**
* Hook to access the current theme and theme setter function.
* Must be used within a ThemeProvider component.
*
* @example
* ```tsx
* import { Button } from '@sqlrooms/ui';
*
* function ThemeToggle() {
* const { theme, setTheme } = useTheme();
* const isDark = theme === 'dark';
*
* return (
*
* );
* }
* ```
*
* @example
* ```tsx
* import { ThemeSwitch } from '@sqlrooms/ui';
*
* function AppHeader() {
* return (
*
* );
* }
* ```
*
* @returns {ThemeProviderState} Object containing current theme and setTheme function
* @throws {Error} If used outside of a ThemeProvider
*/
export declare const useTheme: () => ThemeProviderState;
export {};
//# sourceMappingURL=theme-provider.d.ts.map