UNPKG

stone-kit

Version:
38 lines (36 loc) 1.05 kB
import { ReactNode } from 'react'; export type btnWidth = 'auto' | 'full'; export declare const BUTTON_VARIANTS: { blue: string; gray: string; whiteStroke: string; sokolniki: string; black: string; whiteFilled: string; shade: string; volodiyaLight: string; lightBlue: string; transparent: string; }; export type btnVariant = keyof typeof BUTTON_VARIANTS; type btnSizes = 'large' | 'medium' | 'small' | 'tiny'; interface ButtonProps { size?: btnSizes; size_m?: btnSizes; size_l?: btnSizes; pre?: ReactNode; post?: ReactNode; children?: string | ReactNode; variant?: btnVariant; width?: btnWidth; additionalClass?: string; isLoading?: boolean; as: 'button' | 'link'; onCLick?: () => {}; } export type ComponentProps = ButtonProps & ((React.ButtonHTMLAttributes<HTMLButtonElement> & { as: 'button'; }) | (React.AnchorHTMLAttributes<HTMLAnchorElement> & { as: 'link'; } & Required<Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>>)); export {};