@spark-web/radio
Version:
--- title: Radio storybookPath: forms-radio--default isExperimentalPackage: true ---
25 lines (24 loc) • 951 B
TypeScript
import type { ChangeEvent } from 'react';
import type { RadioGroupProps, RadioProps } from './types';
declare type StateHookProps<T extends string> = Omit<RadioGroupProps<T>, 'children'>;
export declare function useRadioGroupState<Value extends string>(props: StateHookProps<Value>): {
disabled: boolean | undefined;
name: string;
onChange(event: ChangeEvent<HTMLInputElement>): void;
size: import("./types").RadioSize | undefined;
value: Value;
'aria-describedby': string | undefined;
};
export declare function useRadioGroupItem({ props, state, }: {
props: Omit<RadioProps, 'children'>;
state?: ReturnType<typeof useRadioGroupState>;
}): {
checked: boolean;
disabled: boolean | undefined;
name: string;
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
size: import("./types").RadioSize | undefined;
value: string;
'aria-describedby': string | undefined;
} | undefined;
export {};