import * as i0 from '@angular/core'; import { Signal, ElementRef, InputSignal, ModelSignal, OutputEmitterRef } from '@angular/core'; import { ControlValueAccessor, NgControl } from '@angular/forms'; /** Switch size variants. */ type SwitchSize = 'sm' | 'md' | 'lg'; /** Switch color variants. */ type SwitchVariant = 'primary' | 'accent' | 'warn'; /** * CVA variants for the switch track (pill-shaped container). * * Uses `peer` selectors to style based on native input state: * - `peer-checked:` for on state * - `peer-focus-visible:` for keyboard focus * - `peer-disabled:` for disabled state * * @tokens `--color-primary`, `--color-primary-hover`, * `--color-accent`, `--color-accent-hover`, * `--color-warn`, `--color-warn-hover`, * `--color-muted`, `--color-muted-hover`, * `--color-disabled`, `--color-ring`, `--radius-pill` */ declare const switchTrackVariants: (props?: { variant?: SwitchVariant; size?: SwitchSize; }) => string; /** Size-based classes for the sliding thumb. */ declare const SWITCH_THUMB_SIZES: Record; /** Size-based translate classes applied when the switch is checked. */ declare const SWITCH_THUMB_TRANSLATE: Record; /** Size-based classes for the label content. */ declare const SWITCH_LABEL_SIZES: Record; /** Event emitted when switch state changes. */ interface SwitchChange { checked: boolean; source: ComSwitch; } /** * Toggle switch component with full accessibility support. * * Uses a native `` for built-in keyboard * handling, `:checked` pseudo-class, and screen reader support. * * Implements `ControlValueAccessor` for Reactive Forms integration via * `NgControl` injection pattern (no `NG_VALUE_ACCESSOR` provider). * * @tokens `--color-primary`, `--color-primary-hover`, * `--color-accent`, `--color-accent-hover`, * `--color-warn`, `--color-warn-hover`, * `--color-muted`, `--color-muted-hover`, * `--color-background`, `--color-disabled`, `--color-disabled-foreground`, * `--color-ring`, `--radius-pill` * * @example Basic usage * ```html * Dark mode * ``` * * @example With reactive forms * ```html * Push notifications * ``` * * @example Variants and sizes * ```html * Large accent switch * Small warning switch * ``` */ declare class ComSwitch implements ControlValueAccessor { /** Optional NgControl for reactive forms integration. */ readonly ngControl: NgControl | null; /** Reference to the native input element. */ readonly inputRef: Signal | undefined>; /** Unique ID for this switch instance. */ private readonly uniqueId; readonly size: InputSignal; readonly variant: InputSignal; readonly checked: ModelSignal; readonly disabled: ModelSignal; readonly htmlValue: InputSignal; readonly name: InputSignal; readonly id: InputSignal; readonly ariaLabel: InputSignal; readonly ariaLabelledby: InputSignal; readonly ariaDescribedby: InputSignal; readonly touched: ModelSignal; readonly invalid: InputSignal; readonly sfErrors: InputSignal; readonly sfRequired: InputSignal; readonly changed: OutputEmitterRef; readonly inputId: Signal; protected readonly trackClasses: Signal; protected readonly thumbClasses: Signal; protected readonly labelClasses: Signal; private onChange; protected onTouched: () => void; constructor(); writeValue(value: boolean): void; registerOnChange(fn: (value: boolean) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; protected onBlur(): void; protected onInputChange(event: Event): void; /** Focuses this switch's input element. */ focus(): void; /** Toggles the switch state programmatically. */ toggle(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { ComSwitch, SWITCH_LABEL_SIZES, SWITCH_THUMB_SIZES, SWITCH_THUMB_TRANSLATE, switchTrackVariants }; export type { SwitchChange, SwitchSize, SwitchVariant };