@buddhacognitivelab/theme-glassmorphic
Version:
Enhanced glassmorphic theme package with dual-mode support, advanced glass effects, interactive UI components, and gesture-based interactions
54 lines (53 loc) • 1.9 kB
TypeScript
/**
* @fileoverview Toggle component with glassmorphic styling
*/
import React from 'react';
import type { GlassIntensity } from '../../types/theme';
export interface ToggleProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange'> {
/** Whether the toggle is checked */
checked?: boolean;
/** Default checked state (uncontrolled) */
defaultChecked?: boolean;
/** Callback when toggle state changes */
onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
/** Size variant */
size?: 'small' | 'medium' | 'large';
/** Visual variant */
variant?: 'default' | 'filled' | 'outlined';
/** Color variant */
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';
/** Glass effect intensity */
glassIntensity?: GlassIntensity;
/** Label for the toggle */
label?: string;
/** Description text */
description?: string;
/** Position of the label */
labelPosition?: 'start' | 'end';
/** Whether the toggle is disabled */
disabled?: boolean;
/** Whether the toggle is in loading state */
loading?: boolean;
/** Custom class name */
className?: string;
/** Icon to show when checked */
checkedIcon?: React.ReactNode;
/** Icon to show when unchecked */
uncheckedIcon?: React.ReactNode;
/** Whether to show icons */
showIcons?: boolean;
/** Custom checked color */
checkedColor?: string;
/** Custom unchecked color */
uncheckedColor?: string;
/** Whether the toggle is required */
required?: boolean;
/** Error message */
error?: string;
/** Whether the toggle has an error */
hasError?: boolean;
}
/**
* Toggle component with glassmorphic styling
*/
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;