import * as i0 from '@angular/core'; import { InputSignal, Signal, InjectionToken, Provider } from '@angular/core'; import { VariantProps } from 'class-variance-authority'; /** A single SVG element: [tagName, attributes]. */ type ComIconNode = readonly [string, Readonly>]; /** Icon data: array of SVG child elements rendered inside the `` wrapper. */ type ComIconData = readonly ComIconNode[]; /** Map of PascalCase icon names to their SVG data. */ type ComIconMap = Record; type IconColor = 'current' | 'primary' | 'accent' | 'warn' | 'success' | 'muted' | 'disabled'; type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; declare const iconVariants: (props?: { color?: IconColor; size?: IconSize; }) => string; /** Pixel values matching the CSS tokens — passed to Lucide's numeric [size] prop */ declare const ICON_SIZE_PX: Record; type IconVariants = VariantProps; /** * Icon component — renders SVG icons with CVA-powered color and size variants. * * Icons inherit `currentColor` by default, making them automatically match * surrounding text. Use the `color` input for semantic color variants that * respond to theme changes. * * Icon data is vendor-agnostic — register icons via `provideComIcons` (raw SVG data) * or `provideComLucideIcons` from `ngx-com/components/icon/lucide` (Lucide adapter). * * @tokens `--color-primary`, `--color-accent`, `--color-warn`, `--color-success`, * `--color-muted-foreground`, `--color-disabled-foreground`, * `--size-icon-xs`, `--size-icon-sm`, `--size-icon-md`, * `--size-icon-lg`, `--size-icon-xl`, `--size-icon-2xl` * * @example Basic usage (requires icon registration via provideComLucideIcons) * ```html * * * * ``` * * @example Direct icon data (no provider needed) * ```html * * ``` * * @example Accessible icon (not decorative) * ```html * * ``` * * @example Inline with text (inherits parent color) * ```html * * Favorite * * ``` */ declare class ComIcon { private readonly doc; private readonly rd; private readonly elRef; private readonly registry; private readonly _registrar; /** Icon name in kebab-case (e.g. 'chevron-right'). Requires icon registration. */ readonly name: InputSignal; /** Direct icon data (SVG element tuples). Takes precedence over `name`. */ readonly img: InputSignal; /** Semantic color variant. Defaults to 'current' (inherits from parent). */ readonly color: InputSignal; /** Size variant. Defaults to 'lg' (24px). */ readonly size: InputSignal; /** Stroke width. Defaults to 2. */ readonly strokeWidth: InputSignal; /** When true, stroke width doesn't scale with icon size. */ readonly absoluteStrokeWidth: InputSignal; /** Applies aria-label and removes aria-hidden. Use for meaningful icons. */ readonly ariaLabel: InputSignal; /** Resolves icon data from either `img` (direct ref) or `name` (registry lookup). */ protected readonly resolvedIcon: Signal; protected readonly sizeInPx: Signal; protected readonly effectiveStrokeWidth: Signal; protected readonly hostClasses: Signal; constructor(); /** Builds and inserts the SVG element, or clears the host if no icon data is available. */ private renderSvg; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Singleton registry for icons used by `com-icon`. * * Stores generic `ComIconData` (SVG element tuples) rather than any * vendor-specific format. Use the Lucide adapter (`ngx-com/components/icon/lucide`) * or register raw SVG data directly via `provideComIcons`. */ declare class ComIconRegistry { private readonly icons; /** Merges the given icons into the registry. */ register(icons: ComIconMap): void; /** Returns the icon data for the given PascalCase name, or `null` if not registered. */ get(name: string): ComIconData | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Token injected by `ComIcon` to trigger icon registration factories. * * Each `provideComIcons()` call adds a `multi` provider whose factory * registers icons into the singleton `ComIconRegistry`. The token itself * is never read — its purpose is to force Angular's DI to run the factories. */ declare const COM_ICON_REGISTRAR: InjectionToken; /** * Provides icons for use with `com-icon`. * * Accepts generic `ComIconData` (SVG element tuples). For Lucide icons, * use `provideComLucideIcons` from `ngx-com/components/icon/lucide` instead. * * Works at **all** injector levels: app root, lazy route, and component. * Icons are merged into the root-level `ComIconRegistry`, so multiple calls * accumulate rather than shadow. * * @example Root-level with raw SVG data * ```ts * import { provideComIcons } from 'ngx-com/components/icon'; * * const myIcons = { * Star: [['polygon', { points: '12 2 15.09 6.26 ...' }]], * }; * * export const appConfig = { * providers: [provideComIcons(myIcons)] * }; * ``` * * @example With Lucide adapter (recommended) * ```ts * import { provideComLucideIcons } from 'ngx-com/components/icon/lucide'; * import { Star, Check } from 'lucide-angular'; * * export const appConfig = { * providers: [provideComLucideIcons({ Star, Check })] * }; * ``` */ declare function provideComIcons(icons: ComIconMap): Provider; export { COM_ICON_REGISTRAR, ComIcon, ComIconRegistry, ICON_SIZE_PX, iconVariants, provideComIcons }; export type { ComIconData, ComIconMap, ComIconNode, IconColor, IconSize, IconVariants };