UNPKG

aura-glass

Version:

A comprehensive glassmorphism design system for React applications with 142+ production-ready components

87 lines 4.71 kB
/** * AuraGlass Utility Functions * Production-ready utility functions for the AuraGlass design system */ import { type ClassValue } from 'clsx'; export declare function cn(...inputs: ClassValue[]): string; export declare function hexToRgba(hex: string, alpha?: number): string; export declare function rgbaToHex(rgba: string): string; export declare function adjustOpacity(color: string, opacity: number): string; export declare function clamp(value: number, min: number, max: number): number; export declare function lerp(start: number, end: number, progress: number): number; export declare function roundToDecimal(value: number, decimals: number): number; export declare function capitalize(str: string): string; export declare function kebabCase(str: string): string; export declare function camelCase(str: string): string; export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T; export declare function isObject(item: any): item is Record<string, any>; export declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>; export declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>; export declare function unique<T>(array: T[]): T[]; export declare function groupBy<T, K extends keyof T>(array: T[], key: K): Record<string, T[]>; export declare function sortBy<T>(array: T[], key: keyof T, direction?: 'asc' | 'desc'): T[]; export declare function getElementRect(element: HTMLElement): DOMRect; export declare function isElementInViewport(element: HTMLElement): boolean; export declare function scrollToElement(element: HTMLElement, options?: ScrollIntoViewOptions): void; export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void; export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void; export declare function isValidEmail(email: string): boolean; export declare function isValidUrl(url: string): boolean; export declare function isValidHexColor(color: string): boolean; export declare function formatNumber(value: number, options?: Intl.NumberFormatOptions): string; export declare function formatCurrency(value: number, currency?: string, locale?: string): string; export declare function formatPercentage(value: number, decimals?: number): string; export declare function formatDate(date: Date | string, options?: Intl.DateTimeFormatOptions): string; export declare function createAnimationPromise(element: HTMLElement, animationName: string, duration?: number): Promise<void>; export declare function getOptimalAnimationDuration(element: HTMLElement): number; export declare const storage: { get: <T>(key: string, defaultValue?: T) => T | null; set: <T>(key: string, value: T) => void; remove: (key: string) => void; clear: () => void; }; export declare function safeExecute<T>(fn: () => T, fallback?: T, onError?: (error: Error) => void): T | undefined; export declare function safeExecuteAsync<T>(fn: () => Promise<T>, fallback?: T, onError?: (error: Error) => void): Promise<T | undefined>; declare const _default: { cn: typeof cn; hexToRgba: typeof hexToRgba; rgbaToHex: typeof rgbaToHex; adjustOpacity: typeof adjustOpacity; clamp: typeof clamp; lerp: typeof lerp; roundToDecimal: typeof roundToDecimal; capitalize: typeof capitalize; kebabCase: typeof kebabCase; camelCase: typeof camelCase; deepMerge: typeof deepMerge; isObject: typeof isObject; omit: typeof omit; pick: typeof pick; unique: typeof unique; groupBy: typeof groupBy; sortBy: typeof sortBy; getElementRect: typeof getElementRect; isElementInViewport: typeof isElementInViewport; scrollToElement: typeof scrollToElement; debounce: typeof debounce; throttle: typeof throttle; isValidEmail: typeof isValidEmail; isValidUrl: typeof isValidUrl; isValidHexColor: typeof isValidHexColor; formatNumber: typeof formatNumber; formatCurrency: typeof formatCurrency; formatPercentage: typeof formatPercentage; formatDate: typeof formatDate; createAnimationPromise: typeof createAnimationPromise; getOptimalAnimationDuration: typeof getOptimalAnimationDuration; storage: { get: <T>(key: string, defaultValue?: T) => T | null; set: <T>(key: string, value: T) => void; remove: (key: string) => void; clear: () => void; }; safeExecute: typeof safeExecute; safeExecuteAsync: typeof safeExecuteAsync; }; export default _default; //# sourceMappingURL=utilsComprehensive.d.ts.map