@buddhacognitivelab/theme-glassmorphic
Version:
Enhanced glassmorphic theme package with dual-mode support, advanced glass effects, interactive UI components, and gesture-based interactions
132 lines (131 loc) • 3.83 kB
TypeScript
/**
* @fileoverview Theme utilities for Glassmorphic Theme
* Provides helper functions for working with theme data
*/
import type { GlassmorphicTheme, GlassIntensity, ComponentSize, ComponentVariant } from '../types/theme';
/**
* Gets a color value from the theme palette
*/
export declare const getColor: (theme: GlassmorphicTheme, path: string) => string;
/**
* Gets a spacing value from the theme
*/
export declare const getSpacing: (theme: GlassmorphicTheme, size: keyof GlassmorphicTheme["spacing"]) => string;
/**
* Gets a border radius value from the theme
*/
export declare const getBorderRadius: (theme: GlassmorphicTheme, size: keyof GlassmorphicTheme["borderRadius"]) => string;
/**
* Gets a shadow value from the theme
*/
export declare const getShadow: (theme: GlassmorphicTheme, size: keyof GlassmorphicTheme["shadows"]) => string;
/**
* Gets a glassmorphism effect configuration
*/
export declare const getGlassEffect: (theme: GlassmorphicTheme, intensity?: GlassIntensity) => {
backdropFilter: string;
backgroundColor: string;
border: string;
boxShadow: string;
} | {
backdropFilter: string;
backgroundColor: string;
border: string;
boxShadow: string;
} | {
backdropFilter: string;
backgroundColor: string;
border: string;
boxShadow: string;
};
/**
* Creates a color with opacity
*/
export declare const withOpacity: (color: string, opacity: number) => string;
/**
* Lightens a color by a percentage
*/
export declare const lighten: (color: string, amount: number) => string;
/**
* Darkens a color by a percentage
*/
export declare const darken: (color: string, amount: number) => string;
/**
* Gets component size configuration
*/
export declare const getComponentSize: (size: ComponentSize) => {
readonly padding: "2";
readonly fontSize: "xs";
readonly height: "6";
readonly minWidth: "16";
} | {
readonly padding: "3";
readonly fontSize: "sm";
readonly height: "8";
readonly minWidth: "20";
} | {
readonly padding: "4";
readonly fontSize: "base";
readonly height: "10";
readonly minWidth: "24";
} | {
readonly padding: "5";
readonly fontSize: "lg";
readonly height: "12";
readonly minWidth: "32";
} | {
readonly padding: "6";
readonly fontSize: "xl";
readonly height: "16";
readonly minWidth: "40";
};
/**
* Gets component variant colors
*/
export declare const getVariantColors: (theme: GlassmorphicTheme, variant: ComponentVariant) => {
background: string;
color: string;
border: string;
};
/**
* Checks if the current theme is dark mode
*/
export declare const isDarkMode: (theme: GlassmorphicTheme) => boolean;
/**
* Gets the appropriate text color for a background
*/
export declare const getContrastText: (theme: GlassmorphicTheme, backgroundColor: string) => string;
/**
* Creates a responsive value object
*/
export declare const responsive: <T>(values: {
xs?: T;
sm?: T;
md?: T;
lg?: T;
xl?: T;
"2xl"?: T;
}) => {
xs?: T;
sm?: T;
md?: T;
lg?: T;
xl?: T;
'2xl'?: T;
};
/**
* Gets a responsive value for the current breakpoint
*/
export declare const getResponsiveValue: <T>(values: ReturnType<typeof responsive<T>>, breakpoint: keyof GlassmorphicTheme["breakpoints"]) => T | undefined;
/**
* Creates a CSS media query string
*/
export declare const mediaQuery: (theme: GlassmorphicTheme, breakpoint: keyof GlassmorphicTheme["breakpoints"]) => string;
/**
* Validates if a theme object is a valid glassmorphic theme
*/
export declare const isValidGlassmorphicTheme: (theme: any) => theme is GlassmorphicTheme;
/**
* Merges two theme objects deeply
*/
export declare const mergeThemes: (baseTheme: GlassmorphicTheme, overrideTheme: Partial<GlassmorphicTheme>) => GlassmorphicTheme;