@lunit/oui
Version:
Lunit Oncology UI components
25 lines (24 loc) • 927 B
TypeScript
/// <reference types="react" />
import type { ButtonProps as MuiButtonProps } from '@mui/material';
type ButtonVariant = 'contained' | 'ghost' | 'outlined';
type ButtonColor = 'primary' | 'secondary' | 'error';
type ButtonSize = 'small' | 'medium' | 'large';
interface BaseButtonProps extends Omit<MuiButtonProps, 'variant' | 'color'> {
variant?: ButtonVariant;
color?: ButtonColor;
size?: ButtonSize;
disabled?: boolean;
focusOutline?: boolean;
isIconOnly: boolean;
loading?: boolean;
label?: string;
}
interface IconButtonProps extends Omit<BaseButtonProps, 'isIconOnly'> {
icon: React.ReactNode;
}
interface NormalButtonProps extends Omit<BaseButtonProps, 'isIconOnly'> {
label: string;
icon?: React.ReactNode;
}
type ButtonProps = IconButtonProps | NormalButtonProps;
export type { ButtonVariant, ButtonColor, BaseButtonProps, IconButtonProps, NormalButtonProps, ButtonProps, };