/** * AgnosticUI v2 IconButton - Canonical Implementation * * 🔒 IMMUTABLE CANONICAL VERSION 🔒 * * This file contains the canonical, upgrade-safe implementation of the IconButton component. * It should NEVER be modified directly by users or AI assistants. * * Version: 2.0.0-dev * Last Updated: 2025-09-23 * API Compatibility: 2.x * * Stability Guarantees: * - All public APIs remain backward compatible within major versions * - All ARIA attributes and accessibility features are preserved * - All CSS functional styling remains consistent * - Component behavior is identical across patch and minor updates * * For customization, use: * - IconButton.ts: Experimental/AI-modifiable version * - styled/: Production styling tiers * - experiments/: Experimental styling variations * - extensions/: AI-safe behavioral extensions */ import { LitElement, html, css } from 'lit'; import { property } from 'lit/decorators.js'; import { ifDefined } from 'lit/directives/if-defined.js'; // Event detail interfaces export interface IconButtonClickEventDetail { originalEvent: MouseEvent; label: string; pressed: boolean; } export interface IconButtonActivateEventDetail { originalEvent: KeyboardEvent; label: string; pressed: boolean; } // Event type definitions export type IconButtonClickEvent = CustomEvent; export type IconButtonActivateEvent = CustomEvent; // Props interface following INTERFACE_STANDARDS.md export interface IconButtonProps { label?: string; icon?: string; unicode?: string; size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; variant?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'ghost' | 'monochrome'; type?: 'button' | 'submit' | 'reset'; disabled?: boolean; pressed?: boolean; loading?: boolean; onIconButtonClick?: (event: IconButtonClickEvent) => void; onIconButtonActivate?: (event: IconButtonActivateEvent) => void; } /** * AgIconButton - Accessible icon-only button component * * A semantic button element that displays only an icon with proper * accessibility labeling following Sara Soueidan's guidelines and * WAI-ARIA APG button patterns. * * Features: * - Semantic `; } } declare global { interface HTMLElementTagNameMap { 'ag-icon-button': AgIconButton; } }