import * as _angular_core from '@angular/core'; import { InjectionToken, Signal } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; /** * Single-choice option. Must be a child of ``. * * @example * ```html * * Small * Medium * Large * * ``` * * @see https://ngwr.dev/components/radio */ type WrRadioSize = 'sm' | 'md' | 'lg'; declare class WrRadio { /** Stable id used to associate the native input with its label. */ readonly id: _angular_core.InputSignal; /** Value selected when this radio is checked. */ readonly value: _angular_core.InputSignal; /** * Optional icon name rendered inside the dot when checked, in place of the * default solid circle. Use any registered NGWR icon. */ readonly icon: _angular_core.InputSignal; /** Control size — shares the `--wr-control-*` contract. @default 'md' */ readonly size: _angular_core.InputSignal; /** * Disable just this option. The group can also be disabled as a whole via * ``; either source disables this radio. * * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; private readonly group; constructor(); protected readonly name: _angular_core.Signal; protected readonly checked: _angular_core.Signal; /** Effective disabled — this option's own `disabled` or the group's. */ protected readonly isDisabled: _angular_core.Signal; protected readonly classes: _angular_core.Signal; protected onSelect(): void; protected onBlur(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** * Contract a radio uses to talk to its parent ``. * * @internal */ interface WrRadioGroupContext { /** Shared `name` attribute applied to every native input in the group. */ readonly name: Signal; /** Currently selected value. */ readonly value: Signal; /** Whether the entire group is disabled. */ readonly isDisabled: Signal; /** Select the given value. */ select(value: unknown): void; /** Mark the group as touched (called on blur from any child). */ touch(): void; } /** * Token a `` injects to participate in its parent `` * — reads the selected value, shares the `name` attribute, and signals * selection / blur back up. * * @internal */ declare const WR_RADIO_GROUP: InjectionToken; /** * Hosts a group of `` children as a single-value selection. * * Implements `ControlValueAccessor` — the group's `value` is the * currently selected radio's `value`. * * @example * ```html * * Small * Medium * Large * * ``` * * @see https://ngwr.dev/components/radio */ declare class WrRadioGroup implements ControlValueAccessor, WrRadioGroupContext { /** * Shared `name` attribute. Defaults to a random id so multiple groups * on the same page don't collide. */ readonly name: _angular_core.InputSignal; /** * Disable the whole group. Also set by Angular forms via `setDisabledState`. * * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; readonly value: _angular_core.WritableSignal; private readonly disabledFromCva; /** Effective disabled state — true if either source disables. */ readonly isDisabled: _angular_core.Signal; private onChange; private onTouched; select(value: unknown): void; touch(): void; writeValue(value: unknown): void; registerOnChange(fn: (value: unknown) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { WR_RADIO_GROUP, WrRadio, WrRadioGroup }; export type { WrRadioGroupContext, WrRadioSize };