import { ComponentPropsWithoutRef, ChangeEvent, ReactElement } from 'react'; import { LayoutUtilProps, Svg } from '../../types'; import { HelperProps } from '../../internal/components'; /** * State object returned by the onChange callback */ export type RadioState = { /** * Whether the radio is checked */ checked: boolean; /** * The value of the radio */ value?: string | number | readonly string[]; }; /** * Props for the Radio component * @extends Omit, "onChange"> * @extends LayoutUtilProps */ export type RadioProps = Omit, "onChange"> & LayoutUtilProps & { /** * Controlled state * @default false */ checked?: boolean; /** * Uncontrolled state * @default false */ defaultChecked?: boolean; /** * Callback when radio is changed */ onChange?: (e?: ChangeEvent, state?: RadioState) => void; /** * Label for Radio * @remarks This should either be a string or have text content inside for accessibility */ label?: ReactElement | string; /** * Error state for the radio * @default false */ error?: boolean; /** * Icon overrides for checked and unchecked states */ icons?: { /** * Icon to display when radio is checked */ checked?: Svg; /** * Icon to display when radio is unchecked */ unchecked?: Svg; }; /** * Description text to display below the radio */ description?: HelperProps["description"]; /** * When true, hides the radio for visual users * @default false */ hideRadio?: boolean; }; /** * Radio component for single selection from a group of options. * * Features: * - Supports both controlled and uncontrolled modes * - Customizable icons for checked and unchecked states * - Error state with visual indicators * - Description text support * - Accessibility support with proper ARIA attributes * - Layout utility props for positioning and spacing * - Optional radio hiding for visual users * - Flexible labeling options * - Group support via Radio.Group * * @example * setSelectedValue(state?.value)} * /> * * @example * * * @example * * * * * */ export declare const Radio: import('react').ForwardRefExoticComponent, HTMLInputElement>, "ref">, "onChange"> & LayoutUtilProps & { /** * Controlled state * @default false */ checked?: boolean; /** * Uncontrolled state * @default false */ defaultChecked?: boolean; /** * Callback when radio is changed */ onChange?: (e?: ChangeEvent, state?: RadioState) => void; /** * Label for Radio * @remarks This should either be a string or have text content inside for accessibility */ label?: ReactElement | string; /** * Error state for the radio * @default false */ error?: boolean; /** * Icon overrides for checked and unchecked states */ icons?: { /** * Icon to display when radio is checked */ checked?: Svg; /** * Icon to display when radio is unchecked */ unchecked?: Svg; }; /** * Description text to display below the radio */ description?: HelperProps["description"]; /** * When true, hides the radio for visual users * @default false */ hideRadio?: boolean; } & import('react').RefAttributes> & { /** * RadioGroup component for grouping related radio options. * * Features: * - Groups multiple radio options together * - Legend support for group labeling * - Required field indication * - Accessibility support with proper fieldset semantics * - Layout utility props for positioning and spacing * - Focus and blur event handling * - More info support for additional context * * @example * * * * * */ Group: import('react').ForwardRefExoticComponent, HTMLFieldSetElement>, "ref"> & LayoutUtilProps & Omit & { required?: boolean; legend?: string | ReactElement; } & import('react').RefAttributes>; };