import { AriaRadioGroupProps, AriaRadioProps } from 'react-aria/useRadioGroup'; import { ClassNameOrFunction, ContextValue, RACValidation, RenderProps, SlotProps } from './utils'; import { GlobalDOMAttributes, RefObject } from '@react-types/shared'; import { HoverEvents, Orientation } from '@react-types/shared'; import { RadioGroupState } from 'react-stately/useRadioGroupState'; import React from 'react'; export interface RadioGroupProps extends Omit, RACValidation, RenderProps, SlotProps, GlobalDOMAttributes { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the * element. A function may be provided to compute the class based on component state. * * @default 'react-aria-RadioGroup' */ className?: ClassNameOrFunction; } export interface RadioProps extends Omit, HoverEvents, RenderProps, SlotProps, Omit, 'onClick'> { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the * element. A function may be provided to compute the class based on component state. * * @default 'react-aria-Radio' */ className?: ClassNameOrFunction; /** * A ref for the HTML input element. */ inputRef?: RefObject; } export interface RadioFieldProps extends Omit, RenderProps, SlotProps, Omit, 'onClick'> { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the * element. A function may be provided to compute the class based on component state. * * @default 'react-aria-RadioField' */ className?: ClassNameOrFunction; /** * A ref for the HTML input element. */ inputRef?: RefObject; } export interface RadioButtonProps extends HoverEvents, RenderProps, SlotProps, Omit, 'onClick'> { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the * element. A function may be provided to compute the class based on component state. * * @default 'react-aria-RadioButton' */ className?: ClassNameOrFunction; } export interface RadioGroupRenderProps { /** * The orientation of the radio group. * * @selector [data-orientation="horizontal | vertical"] */ orientation: Orientation; /** * Whether the radio group is disabled. * * @selector [data-disabled] */ isDisabled: boolean; /** * Whether the radio group is read only. * * @selector [data-readonly] */ isReadOnly: boolean; /** * Whether the radio group is required. * * @selector [data-required] */ isRequired: boolean; /** * Whether the radio group is invalid. * * @selector [data-invalid] */ isInvalid: boolean; /** * State of the radio group. */ state: RadioGroupState; } export interface RadioRenderProps { /** * Whether the radio is selected. * * @selector [data-selected] */ isSelected: boolean; /** * Whether the radio is currently hovered with a mouse. * * @selector [data-hovered] */ isHovered: boolean; /** * Whether the radio is currently in a pressed state. * * @selector [data-pressed] */ isPressed: boolean; /** * Whether the radio is focused, either via a mouse or keyboard. * * @selector [data-focused] */ isFocused: boolean; /** * Whether the radio is keyboard focused. * * @selector [data-focus-visible] */ isFocusVisible: boolean; /** * Whether the radio is disabled. * * @selector [data-disabled] */ isDisabled: boolean; /** * Whether the radio is read only. * * @selector [data-readonly] */ isReadOnly: boolean; /** * Whether the radio is invalid. * * @selector [data-invalid] */ isInvalid: boolean; /** * Whether the checkbox is required. * * @selector [data-required] */ isRequired: boolean; } export interface RadioFieldRenderProps { /** * Whether the radio is selected. * * @selector [data-selected] */ isSelected: boolean; /** * Whether the radio is disabled. * * @selector [data-disabled] */ isDisabled: boolean; /** * Whether the radio is read only. * * @selector [data-readonly] */ isReadOnly: boolean; /** * Whether the radio is invalid. * * @selector [data-invalid] */ isInvalid: boolean; /** * Whether the checkbox is required. * * @selector [data-required] */ isRequired: boolean; } export interface RadioButtonRenderProps extends RadioRenderProps { } export declare const RadioGroupContext: React.Context>; export declare const RadioContext: React.Context, HTMLLabelElement>>; export declare const RadioFieldContext: React.Context, HTMLDivElement>>; export declare const RadioGroupStateContext: React.Context; /** * A radio group allows a user to select a single item from a list of mutually exclusive options. */ export declare const RadioGroup: (props: RadioGroupProps & React.RefAttributes) => React.ReactElement> | null; /** * A radio represents an individual option within a radio group. * * @deprecated Use RadioField + RadioButton instead. */ export declare const Radio: (props: RadioProps & React.RefAttributes) => React.ReactElement> | null; /** * A RadioField represents an individual option within a radio group, containing a RadioButton and * optional description. */ export declare const RadioField: (props: RadioFieldProps & React.RefAttributes) => React.ReactElement> | null; /** * A RadioButton is the clickable area of a radio, including the indicator and label. */ export declare const RadioButton: (props: RadioButtonProps & React.RefAttributes) => React.ReactElement> | null;