@yamada-ui/radio
Version:
Yamada UI radio component
37 lines (34 loc) • 1.73 kB
TypeScript
import * as react from 'react';
import { ChangeEvent } from 'react';
import { ThemeProps, CSSUIObject, PropGetter, HTMLUIProps } from '@yamada-ui/core';
import { FormControlOptions } from '@yamada-ui/form-control';
import { RadioCardProps } from './radio-card.js';
import './radio-card-addon.js';
import './radio-card-description.js';
import './radio-card-label.js';
import './use-radio.js';
import '@yamada-ui/utils';
interface RadioGroupSharedContext extends FormControlOptions {
name: string;
value: number | string;
onChange: (evOrValue: ChangeEvent<HTMLInputElement> | number | string) => void;
}
interface RadioGroupContext extends RadioGroupSharedContext, ThemeProps<"Radio"> {
}
declare const RadioGroupProvider: react.Provider<RadioGroupContext | undefined>;
declare const useRadioGroupContext: () => RadioGroupContext | undefined;
interface RadioCardGroupContext extends RadioGroupSharedContext, Pick<RadioCardProps, "addonProps" | "descriptionProps" | "labelProps" | "withIcon">, ThemeProps<"RadioCard"> {
}
declare const RadioCardGroupProvider: react.Provider<RadioCardGroupContext | undefined>;
declare const useRadioCardGroupContext: () => RadioCardGroupContext | undefined;
interface RadioCardContext {
styles: {
[key: string]: CSSUIObject | undefined;
};
withIcon: boolean;
getIconProps: PropGetter;
iconProps?: HTMLUIProps;
}
declare const RadioCardProvider: react.Provider<RadioCardContext>;
declare const useRadioCardContext: () => RadioCardContext;
export { type RadioCardContext, type RadioCardGroupContext, RadioCardGroupProvider, RadioCardProvider, type RadioGroupContext, RadioGroupProvider, useRadioCardContext, useRadioCardGroupContext, useRadioGroupContext };