UNPKG

stone-kit

Version:
42 lines (41 loc) 1.26 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; transparentBg: string; }; export type btnVariant = keyof typeof BUTTON_VARIANTS; type btnSizes = 'large' | 'preMedium' | 'medium' | 'small' | 'tiny'; type TLoaderIconName = 'loader' | 'loaderStroke'; export 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; loaderIconName?: TLoaderIconName; as?: 'button' | 'link' | 'box'; onCLick?: () => any; } export type ComponentButtonProps = ButtonProps & ((React.ButtonHTMLAttributes<HTMLButtonElement> & { as?: 'button'; }) | (React.AnchorHTMLAttributes<HTMLAnchorElement> & { as?: 'link'; } & Required<Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>>) | (React.HTMLAttributes<HTMLDivElement> & { as?: 'box'; })); export {};