import * as i0 from '@angular/core'; import { AfterContentInit, OnChanges, EventEmitter, SimpleChanges } from '@angular/core'; /** * Component that provides a toggleable icon button with accessibility support. * Functions as a switch control that can be toggled between on/off states, * displaying different icons based on the current state. * * This component handles keyboard navigation, focus management, and proper * ARIA attributes for accessibility compliance. * * @usageNotes * ### Basic toggle * ```typescript * isFavorite = false; * ``` * ```html * * * ``` * * ### With custom colors * ```html * * * ``` * * ### Accessibility * - Implements ARIA switch role with aria-checked state * - Keyboard accessible via Tab, Enter, and Space keys * - Provides keyboard shortcut via accesskey attribute * - Screen readers announce state changes * * ### Notes * - Use distinct icons for on/off states for clarity * - Set `isReadOnly` to prevent interaction while maintaining visual state * - Default colors: accent (on), neutral (off) * - Emits toggle event with boolean state on change */ declare class EuiIconToggleComponent implements AfterContentInit, OnChanges { get cssClasses(): string; role: string; /** * Keyboard shortcut key. * @default 'i' */ keyboardAccessKey: string; /** * Whether the toggle is in the checked/on state. * Bound to aria-checked attribute for accessibility. * @default false */ isChecked: boolean; /** * Whether the toggle is read-only (cannot be interacted with). * When true, tabindex is set to -1 and clicking will not change state. * @default undefined */ isReadOnly: boolean; /** * Data attribute for e2e testing. * @default 'eui-icon-toggle' */ e2eAttr: string; /** * Unique identifier for the component. * @default 'eui-icon-toggle-{uniqueId}' */ id: string; /** * Tab order value for keyboard navigation. * @default '0' */ tabindex: string; /** * Accessible label for screen readers. * @default 'Toggle icon' */ ariaLabel: string; /** * Size of the icon (s, m, l, xl). * @default 'm' */ iconSvgSize: string; /** * Icon to display when toggle is in the ON state. */ iconSvgNameOn: string; /** * Icon to display when toggle is in the OFF state. */ iconSvgNameOff: string; /** * Color of the icon when toggle is in the ON state. * @default 'accent' */ iconSvgFillColorOn: string; /** * Color of the icon when toggle is in the OFF state. * @default 'neutral' */ iconSvgFillColorOff: string; /** * Event emitted when the toggle state changes. * Emits the new state (true = checked, false = unchecked). */ toggle: EventEmitter; protected iconSvgName: string; protected iconSvgFillColor: string; /** * Handles changes to input properties. * Updates the tabindex when the component becomes read-only. * * @param {SimpleChanges} changes - Object containing changed properties */ ngOnChanges(changes: SimpleChanges): void; /** * Initializes the component after content has been set. * Sets the appropriate icon based on the current toggle state. * Sets the aria-label if none was provided. */ ngAfterContentInit(): void; /** * Host listener that handles click events on the component. * Triggers the toggle action if the component is not read-only. */ protected onClick(): void; /** * Host listener that handles keyboard events. * Triggers the toggle action on Enter or Space key press. * * @param {KeyboardEvent} event - The keyboard event */ protected onKeydown(event: KeyboardEvent): void; private _toggle; private _setIconClass; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_isChecked: unknown; static ngAcceptInputType_isReadOnly: unknown; } declare const EUI_ICON_TOGGLE: readonly [typeof EuiIconToggleComponent]; export { EUI_ICON_TOGGLE, EuiIconToggleComponent }; //# sourceMappingURL=eui-components-eui-icon-toggle.d.ts.map