import { type ChangeEvent, type ComponentProps } from 'react';
/**
* Unstyled Carbon `RadioButtonGroup`: a `role="radiogroup"` around native ` `
* items sharing one `name`, so the browser gives the single Tab stop, the arrow keys and form
* submission (as Carbon React). Hide each input over a circle you draw beside it and wrap both in a
* ``. `readOnly` keeps the value: clicks and arrow keys change nothing (the arrows still move
* focus, to read the options, as Carbon React's native radios). The group's
* `aria-describedby` (its message) describes every item too.
*
* State shows as data attributes to style on: `data-orientation`, `data-disabled`, `data-readonly`
* and `data-invalid` on `Root`; `data-checked`, `data-disabled`, `data-readonly` and `data-invalid`
* on an `Item`.
*
* ```tsx
*
* Small
* Medium
*
* ```
*/
export type RadioGroupOrientation = 'vertical' | 'horizontal';
export interface RootProps extends Omit, 'defaultValue' | 'role'> {
/** Submitted name; generated when absent. */
name?: string;
/** The checked item's value (controlled); `''` checks none. */
value?: string;
defaultValue?: string;
/** After the user checks another item. */
onValueChange?: (value: string, event: ChangeEvent) => void;
/** Only `data-orientation`: the browser's arrow keys go both ways. */
orientation?: RadioGroupOrientation;
/** Every item disabled (`aria-disabled` on the group). */
disabled?: boolean;
/** Keeps the value: clicks and arrow keys change nothing, the arrows still move focus (`aria-readonly`). */
readOnly?: boolean;
/** `aria-required` on the group. */
required?: boolean;
/** `aria-invalid` on the group, `data-invalid` on it and its items. */
invalid?: boolean;
}
interface RadioGroupContextValue {
name: string;
value: string;
disabled: boolean;
readOnly: boolean;
invalid: boolean;
/** The group's `aria-describedby`, given to every item. */
describedBy?: string;
select: (value: string, event: ChangeEvent) => void;
}
/** The state of the enclosing `RadioGroup.Root` (name, value, disabled, readOnly …), for other kinds of item. */
export declare function useRadioGroupContext(part?: string): RadioGroupContextValue;
export declare function Root({ name, value, defaultValue, onValueChange, orientation, disabled, readOnly, required, invalid, children, ...rest }: Readonly): import("react").JSX.Element;
export interface ItemProps extends Omit, 'type' | 'value' | 'name' | 'checked' | 'defaultChecked'> {
value: string;
/** This item alone; a disabled group disables every item. */
disabled?: boolean;
}
/** One option: the native radio, checked when its `value` is the group's. */
export declare function Item({ value, disabled: ownDisabled, ...rest }: Readonly): import("react").JSX.Element;
export {};