@gravity-ui/uikit
Version:
Gravity UI base styling and components
17 lines (16 loc) • 909 B
TypeScript
import type { ControlGroupOption, ControlGroupProps } from "../../../components/types.js";
interface OptionsProps<ValueType extends string = string> extends Omit<ControlGroupProps<ValueType>, 'options' | 'defaultValue' | 'aria-label' | 'aria-labelledby' | 'onUpdate' | 'value'> {
value: ValueType;
checked: boolean;
content: ControlGroupOption['content'];
}
export type UseRadioGroupProps<ValueType extends string = string> = ControlGroupProps<ValueType>;
export type UseRadioGroupResult<ValueType extends string = string> = {
containerProps: Pick<ControlGroupProps, 'aria-label' | 'aria-labelledby'> & {
role: string;
'aria-disabled': ControlGroupProps['disabled'];
};
optionsProps: OptionsProps<ValueType>[];
};
export declare function useRadioGroup<ValueType extends string = string>(props: UseRadioGroupProps<ValueType>): UseRadioGroupResult<ValueType>;
export {};