UNPKG

@cimpress/react-components

Version:
71 lines 2.02 kB
import React, { ReactNode } from 'react'; import { PublicComponentProps } from './types'; type Size = 'default' | 'sm' | 'lg'; type Variant = 'default' | 'secondary' | 'primary' | 'link' | 'anchor'; export interface ButtonProps extends PublicComponentProps { /** * The ability to make the button fill the content block. */ blockLevel?: boolean; /** * The inner contents of the button. */ children?: ReactNode; /** * The ability to disable the button. */ disabled?: boolean; /** * The ability to make the button navigate to a url. */ href?: string; /** * Specify navigation behavior */ target?: '_blank' | '_parent' | '_self' | '_top'; /** * Icon to display as the button content. */ icon?: ReactNode; /** * The callback function used when the onMouseEnter event occurs. */ onMouseEnter?: (e: any) => void; /** * The callback function used when the onMouseLeave event occurs. */ onMouseLeave?: (e: any) => void; /** * The callback function used when a button is clicked. */ onClick?: (e: any) => void; /** * The size of the button you are creating. */ size?: Size; /** * The variant of button you are creating. */ variant?: Variant; } export interface ATagProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> { children?: ReactNode; icon?: ReactNode; href?: string; target?: string; disabled?: boolean; size?: string; onClick?: any; className?: string; } export interface ButtonTagProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { children?: ReactNode; icon?: ReactNode; disabled?: boolean; size?: string; onClick?: any; className?: string; } export declare const Button: ({ blockLevel, className, disabled, href, icon: originalIcon, onClick, size, variant, target, ...rest }: ButtonProps) => JSX.Element; export {}; //# sourceMappingURL=Button.d.ts.map