UNPKG

@sb1/ffe-buttons-react

Version:
31 lines (30 loc) 1.23 kB
import React, { ElementType, ForwardedRef, ReactElement } from 'react'; import { ComponentAsPropParams } from './types'; export type BaseButtonProps<As extends ElementType = 'button'> = ComponentAsPropParams<As> & { ariaLoadingMessage?: string; buttonType: 'action' | 'primary' | 'secondary' | 'shortcut' | 'task'; isDisabled?: boolean; isLoading?: boolean; leftIcon?: ReactElement; rightIcon?: ReactElement; /** Size of the button, default md. */ size?: 'sm' | 'md' | 'lg'; /** Using only an icon, no label */ iconOnly?: boolean; }; export declare const BaseButton: <As extends ElementType>(props: { as?: As | undefined; } & import("./types").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "button" : As>, "as" & { ref: ForwardedRef<any>; }> & { ariaLoadingMessage?: string; buttonType: "action" | "primary" | "secondary" | "shortcut" | "task"; isDisabled?: boolean; isLoading?: boolean; leftIcon?: ReactElement; rightIcon?: ReactElement; /** Size of the button, default md. */ size?: "sm" | "md" | "lg"; /** Using only an icon, no label */ iconOnly?: boolean; } & React.RefAttributes<any>) => React.JSX.Element;