import { LitElement } from 'lit'; export type RadioSize = 'small' | 'medium' | 'large'; export type RadioTheme = 'default' | 'primary' | 'success' | 'monochrome'; export interface RadioChangeEventDetail { checked: boolean; value: string; name: string; } export type RadioChangeEvent = CustomEvent; /** * @csspart ag-radio-wrapper - The outer wrapper label element * @csspart ag-radio-input - The native radio input element * @csspart ag-radio-indicator - The custom visual radio indicator * @csspart ag-radio-label - The label text span */ export interface RadioProps { /** * Name attribute for the radio input (required for grouping) */ name?: string; /** * Value of the radio input */ value?: string; /** * Whether the radio is checked */ checked?: boolean; /** * Whether the radio is disabled */ disabled?: boolean; /** * Size of the radio button */ size?: RadioSize; /** * Color theme variant */ theme?: RadioTheme; /** * Label text for the radio button (internal label that wraps the radio) */ labelText?: string; /** * Position of labelText relative to radio (end = after radio, start = before radio) */ labelPosition?: 'end' | 'start'; /** * Optional external label displayed above the radio (useful for groups or standalone with context) */ label?: string; /** * Visually hides the external label while keeping it accessible to screen readers */ labelHidden?: boolean; /** * Completely removes the external label element */ noLabel?: boolean; /** * Marks the radio as required. Displays an asterisk (*) after the external label */ required?: boolean; /** * Marks the radio as invalid. Sets aria-invalid and can display error message */ invalid?: boolean; /** * Error message displayed when invalid. Linked via aria-describedby */ errorMessage?: string; /** * Helper text displayed below the radio. Linked via aria-describedby */ helpText?: string; /** * Callback for native click events */ onClick?: (event: MouseEvent) => void; /** * Callback for change events (fired when radio selection changes) */ onChange?: (event: RadioChangeEvent) => void; } declare const AgRadio_base: (new (...args: any[]) => import('../../../shared/face-mixin').FaceMixinInterface) & typeof LitElement; export declare class AgRadio extends AgRadio_base implements RadioProps { static styles: import('lit').CSSResult[]; value: string; checked: boolean; disabled: boolean; size: RadioSize; theme: RadioTheme; labelText: string; labelPosition: 'end' | 'start'; label: string; labelHidden: boolean; noLabel: boolean; required: boolean; invalid: boolean; errorMessage: string; helpText: string; private _ids; private inputRef?; onClick?: (event: MouseEvent) => void; onChange?: (event: RadioChangeEvent) => void; /** * Sync the form value to ElementInternals. * Submits this radio's value when checked, or null when unchecked. * Each radio in the group reports independently; only the checked one * contributes a value, matching native radio behavior. */ private _syncFormValue; /** * Returns true if any ag-radio in this named group is checked. * Uses the same DOM-traversal logic as uncheckOtherRadiosInGroup so it * works whether the radios are in the document or nested inside a shadow root. */ private _isGroupChecked; /** * Sync validity to ElementInternals. * * Shadow DOM isolation prevents the inner from seeing * sibling ag-radio elements in separate shadow trees, so native delegation * would report each unchecked required radio as invalid individually. * Instead we query the DOM directly: a required radio group is valid when * ANY radio with the same name is checked. */ private _syncValidity; /** * FACE lifecycle: called when the parent form is reset. * Restores checked to false and clears the form value. */ formResetCallback(): void; /** * FACE lifecycle: called on session restore or browser autofill. * Restores checked state: checked when the saved state matches this radio's value. */ formStateRestoreCallback(state: File | string | FormData | null, _mode: 'restore' | 'autocomplete'): void; /** * Sync CustomStateSet states so :state() pseudo-classes work from external CSS. * * Must be called AFTER _syncValidity() so that :state(invalid) reads the * freshly-updated _internals.validity.valid value. * * Exposed states: * :state(checked) — this radio is selected * :state(disabled) — radio is disabled * :state(required) — radio is required * :state(invalid) — FACE constraint validation is failing */ private _syncStates; firstUpdated(): void; updated(changedProperties: Map): void; private handleClick; private handleKeyDown; private getRadiosInGroup; private handleChange; private uncheckOtherRadiosInGroup; /** * Render optional external label (for groups or above radio) */ private _renderExternalLabel; /** * Render helper text */ private _renderHelper; /** * Render error text */ private _renderError; /** * Build ARIA describedby attribute */ private _getAriaDescribedBy; render(): import('lit').TemplateResult<1>; } export {}; //# sourceMappingURL=_Radio.d.ts.map