@geezee/react-ui
Version:
Modern and minimalist React UI library.
37 lines (36 loc) • 1.21 kB
TypeScript
import React from 'react';
import RadioGroup from './radio-group';
import RadioDescription from './radio-description';
import { NormalSizes } from '../utils/prop-types';
interface RadioEventTarget {
checked: boolean;
}
export interface RadioEvent {
target: RadioEventTarget;
stopPropagation: () => void;
preventDefault: () => void;
nativeEvent: React.ChangeEvent;
}
interface Props {
checked?: boolean;
value?: string | number;
size?: NormalSizes;
className?: string;
disabled?: boolean;
onChange?: (e: RadioEvent) => void;
}
declare const defaultProps: {
size: "mini" | "small" | "medium" | "large";
disabled: boolean;
className: string;
};
declare type NativeAttrs = Omit<React.InputHTMLAttributes<any>, keyof Props>;
export declare type RadioProps = Props & typeof defaultProps & NativeAttrs;
declare type RadioComponent<P = {}> = React.FC<P> & {
Group: typeof RadioGroup;
Desc: typeof RadioDescription;
Description: typeof RadioDescription;
};
declare type ComponentProps = Partial<typeof defaultProps> & Omit<Props, keyof typeof defaultProps> & NativeAttrs;
declare const _default: RadioComponent<ComponentProps>;
export default _default;