@buddhacognitivelab/theme-glassmorphic
Version:
Enhanced glassmorphic theme package with dual-mode support, advanced glass effects, interactive UI components, and gesture-based interactions
379 lines (378 loc) • 8.72 kB
TypeScript
/**
* @fileoverview Type definitions for Glassmorphic Theme
* Defines the complete theme structure and interfaces
*/
export interface EnhancedColorScale {
50: string;
100: string;
200: string;
300: string;
400: string;
500: string;
600: string;
700: string;
800: string;
900: string;
A100: string;
A200: string;
A400: string;
A700: string;
main: string;
light: string;
dark: string;
contrastText: string;
}
export interface ColorPalette {
primary: EnhancedColorScale;
secondary: EnhancedColorScale;
tertiary?: EnhancedColorScale;
background: {
default: string;
paper: string;
glass: string;
primary: string;
secondary: string;
tertiary: string;
hover: string;
active: string;
disabled: string;
};
surface: {
primary: string;
secondary: string;
tertiary: string;
};
text: {
primary: string;
secondary: string;
disabled: string;
hint: string;
placeholder: string;
};
error: EnhancedColorScale;
warning: EnhancedColorScale;
info: EnhancedColorScale;
success: EnhancedColorScale;
divider: string;
action: {
active: string;
hover: string;
selected: string;
disabled: string;
disabledBackground: string;
};
border: {
primary: string;
secondary: string;
glass: string;
hover: string;
default: string;
light: string;
};
}
export interface Typography {
fontFamily: {
primary: string;
secondary: string;
mono: string;
};
fontSize: {
xs: string;
sm: string;
base: string;
md: string;
lg: string;
xl: string;
'2xl': string;
'3xl': string;
'4xl': string;
'5xl': string;
};
fontWeight: {
light: number;
normal: number;
medium: number;
semibold: number;
bold: number;
};
lineHeight: {
tight: number;
normal: number;
relaxed: number;
};
letterSpacing: {
tight: string;
normal: string;
wide: string;
};
}
export interface GlassmorphismConfig {
light: {
backdropFilter: string;
backgroundColor: string;
border: string;
boxShadow: string;
};
medium: {
backdropFilter: string;
backgroundColor: string;
border: string;
boxShadow: string;
};
heavy: {
backdropFilter: string;
backgroundColor: string;
border: string;
boxShadow: string;
};
}
export interface Shadows {
none: string;
sm: string;
base: string;
md: string;
lg: string;
xl: string;
'2xl': string;
inner: string;
glass: {
light: string;
medium: string;
heavy: string;
};
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
}
export interface BorderRadius {
none: string;
sm: string;
base: string;
md: string;
lg: string;
xl: string;
'2xl': string;
'3xl': string;
full: string;
}
export interface Spacing {
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
6: string;
8: string;
10: string;
12: string;
16: string;
20: string;
24: string;
32: string;
40: string;
48: string;
56: string;
64: string;
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
'2xl': string;
}
export interface Breakpoints {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
'2xl': string;
}
export interface ZIndex {
hide: number;
auto: string;
base: number;
docked: number;
dropdown: number;
sticky: number;
banner: number;
overlay: number;
modal: number;
popover: number;
skipLink: number;
toast: number;
tooltip: number;
}
export interface Transitions {
duration: {
fastest: string;
faster: string;
fast: string;
normal: string;
slow: string;
slower: string;
slowest: string;
};
easing: {
easeInOut: string;
easeOut: string;
easeIn: string;
sharp: string;
};
property: {
common: string;
colors: string;
dimensions: string;
position: string;
background: string;
all: string;
};
}
export interface Animation {
duration: {
fastest: number;
faster: number;
fast: number;
normal: number;
slow: number;
slower: number;
slowest: number;
};
}
export interface Colors {
primary: EnhancedColorScale;
secondary: EnhancedColorScale;
tertiary?: EnhancedColorScale;
error: EnhancedColorScale;
warning: EnhancedColorScale;
info: EnhancedColorScale;
success: EnhancedColorScale;
}
export interface GradientSystem {
backgrounds: {
primary: any;
secondary: any;
accent: any;
neutral: any;
hero: any;
subtle: any;
};
overlays: {
glass: any;
shadow: any;
highlight: any;
backdrop: any;
};
borders: {
primary: any;
secondary: any;
accent: any;
glass: any;
};
animations: {
flowing: any;
pulsing: any;
shifting: any;
shimmer: any;
};
themeTransitions: {
duration: string;
easing: string;
properties: string[];
};
}
export type { GradientConfig, ThemeGradient, GradientStop } from '../theme/gradientSystem';
export interface GlassmorphicTheme {
mode: 'light' | 'dark';
palette: ColorPalette;
semanticColors: SemanticColors;
typography: Typography;
glassmorphism: GlassmorphismConfig;
gradients: GradientSystem;
shadows: Shadows;
borderRadius: BorderRadius;
spacing: Spacing;
breakpoints: Breakpoints;
zIndex: ZIndex;
transitions: Transitions;
animation: Animation;
colors: Colors;
colorUtils: ColorUtils;
colorAccessibility: ColorAccessibility;
}
export interface GlassmorphicSkin {
id: string;
name: string;
themeId: string;
glassIntensity: 'light' | 'medium' | 'heavy';
customColors?: Partial<ColorPalette>;
customGlass?: Partial<GlassmorphismConfig>;
}
export interface ThemeCreationOptions {
activeTheme: any;
activeSkin: any;
fallback?: Partial<GlassmorphicTheme>;
}
export interface SemanticColors {
brand: {
primary: string;
secondary: string;
tertiary: string;
};
feedback: {
success: string;
warning: string;
error: string;
info: string;
};
neutral: {
white: string;
gray: {
50: string;
100: string;
200: string;
300: string;
400: string;
500: string;
600: string;
700: string;
800: string;
900: string;
};
black: string;
};
interactive: {
default: string;
hover: string;
active: string;
focus: string;
disabled: string;
};
}
export interface ColorAccessibility {
contrastRatio: (foreground: string, background: string) => number;
isAccessible: (foreground: string, background: string, level?: 'AA' | 'AAA') => boolean;
getAccessibleText: (background: string) => string;
generateContrastText: (color: string) => string;
}
export interface ColorUtils {
lighten: (color: string, amount: number) => string;
darken: (color: string, amount: number) => string;
saturate: (color: string, amount: number) => string;
desaturate: (color: string, amount: number) => string;
alpha: (color: string, alpha: number) => string;
mix: (color1: string, color2: string, weight?: number) => string;
complement: (color: string) => string;
triadic: (color: string) => [string, string];
analogous: (color: string) => [string, string];
}
export type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
export type ComponentVariant = 'primary' | 'secondary' | 'tertiary' | 'outline' | 'ghost' | 'link';
export type ComponentState = 'default' | 'hover' | 'focus' | 'active' | 'disabled';
export type GlassIntensity = 'light' | 'medium' | 'heavy';
export type ColorScale = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
export type AccentScale = 'A100' | 'A200' | 'A400' | 'A700';