UNPKG

@buddhacognitivelab/theme-glassmorphic

Version:

Enhanced glassmorphic theme package with dual-mode support, advanced glass effects, interactive UI components, and gesture-based interactions

137 lines (136 loc) 4.15 kB
import React, { ReactNode } from 'react'; import { GlassmorphicTheme } from '../types/theme'; /** * Theme mode type */ export type ThemeMode = 'light' | 'dark' | 'system'; /** * Enhanced theme context interface */ interface EnhancedThemeContextType { /** Current theme object */ theme: GlassmorphicTheme; /** Current theme mode */ mode: ThemeMode; /** Actual resolved mode (light/dark) */ resolvedMode: 'light' | 'dark'; /** Toggle between light and dark modes */ toggleMode: () => void; /** Set specific theme mode */ setMode: (mode: ThemeMode) => void; /** Light theme instance */ lightTheme: GlassmorphicTheme; /** Dark theme instance */ darkTheme: GlassmorphicTheme; /** Check if system prefers dark mode */ systemPrefersDark: boolean; } /** * Enhanced theme provider props */ interface EnhancedThemeProviderProps { /** Child components */ children: ReactNode; /** Initial theme mode */ initialMode?: ThemeMode; /** Custom light theme */ lightTheme?: GlassmorphicTheme; /** Custom dark theme */ darkTheme?: GlassmorphicTheme; /** Enable theme persistence in localStorage */ enablePersistence?: boolean; /** localStorage key for theme persistence */ storageKey?: string; /** Disable system theme detection */ disableSystemTheme?: boolean; } /** * Enhanced theme context */ declare const EnhancedThemeContext: React.Context<EnhancedThemeContextType | undefined>; /** * Enhanced Theme Provider Component * * Provides comprehensive theme management with dual-mode support, * system theme detection, and enhanced color utilities. */ export declare function EnhancedThemeProvider({ children, initialMode, lightTheme, darkTheme, enablePersistence, storageKey, disableSystemTheme, }: EnhancedThemeProviderProps): import("react/jsx-runtime").JSX.Element; /** * Hook to use the enhanced theme context */ export declare function useEnhancedTheme(): EnhancedThemeContextType; /** * Hook to get the current theme */ export declare function useTheme(): GlassmorphicTheme; /** * Hook to get theme mode controls */ export declare function useThemeMode(): { mode: ThemeMode; resolvedMode: "light" | "dark"; toggleMode: () => void; setMode: (mode: ThemeMode) => void; systemPrefersDark: boolean; isDark: boolean; isLight: boolean; isSystem: boolean; }; /** * Hook to get color utilities from the current theme */ export declare function useColorUtils(): import("../types/theme").ColorUtils; /** * Hook to get color accessibility utilities from the current theme */ export declare function useColorAccessibility(): import("../types/theme").ColorAccessibility; /** * Hook to get semantic colors from the current theme */ export declare function useSemanticColors(): import("../types/theme").SemanticColors; /** * Hook to get both light and dark themes */ export declare function useDualThemes(): { lightTheme: GlassmorphicTheme; darkTheme: GlassmorphicTheme; }; /** * Higher-order component to inject theme props */ export declare function withEnhancedTheme<P extends object>(Component: React.ComponentType<P & { theme: GlassmorphicTheme; }>): { (props: P): import("react/jsx-runtime").JSX.Element; displayName: string; }; /** * Theme mode toggle component */ export interface ThemeToggleProps { /** Custom class name */ className?: string; /** Show system option */ showSystemOption?: boolean; /** Custom labels */ labels?: { light?: string; dark?: string; system?: string; }; /** Render prop for custom toggle UI */ children?: (props: { mode: ThemeMode; resolvedMode: 'light' | 'dark'; toggleMode: () => void; setMode: (mode: ThemeMode) => void; isDark: boolean; isLight: boolean; isSystem: boolean; }) => React.ReactNode; } /** * Theme toggle component */ export declare function ThemeToggle({ className, showSystemOption, labels, children, }: ThemeToggleProps): import("react/jsx-runtime").JSX.Element; export { EnhancedThemeContext };