UNPKG

@senka-ai/ui

Version:

A modern, type-safe Svelte 5 UI component library with full theme support, accessibility standards, and robust state management patterns

68 lines 1.96 kB
/** * Unified icon rendering utilities * Provides consistent patterns for icon handling across components */ export type IconType = any; export interface IconRenderOptions { icon?: IconType; size?: number; className?: string; defaultSize?: number; } /** * Determines if an icon should be rendered */ export declare function shouldRenderIcon(icon: IconType, showIcon?: boolean): boolean; /** * Gets the appropriate icon size */ export declare function getIconSize(size?: number, defaultSize?: number): number; /** * Gets standard icon container classes */ export declare function getIconContainerClasses(position?: 'left' | 'right' | 'center'): string; /** * Gets positioning classes for icons within inputs */ export declare function getInputIconClasses(position: 'left' | 'right'): string; /** * Gets padding classes for inputs with icons */ export declare function getInputPadding(hasLeftIcon: boolean, hasRightIcon: boolean): string; /** * Standard icon sizes used across the application */ export declare const ICON_SIZES: { readonly xs: 12; readonly small: 14; readonly medium: 16; readonly large: 18; readonly xl: 20; readonly '2xl': 24; readonly '3xl': 32; }; export type IconSize = keyof typeof ICON_SIZES; /** * Gets icon size from size key */ export declare function getIconSizeValue(size: IconSize): number; /** * Type guard to check if an icon is a string (emoji or text) */ export declare function isStringIcon(icon: IconType): icon is string; /** * Type guard to check if an icon is a component/snippet */ export declare function isComponentIcon(icon: IconType): boolean; /** * Creates consistent icon rendering logic */ export declare function createIconRenderer(icon: IconType, options?: IconRenderOptions): { shouldRender: boolean; isString: boolean; isComponent: boolean; size: number; className: string; icon: any; }; //# sourceMappingURL=icons.d.ts.map