UNPKG

@aveonline/ui-react

Version:

Home base for Aveonline design system - ecosystem react

65 lines (64 loc) 1.85 kB
import { IClassName } from '../../../types'; import type { ReactNode, MouseEventHandler, ButtonHTMLAttributes } from 'react'; export declare type Variant = 'primary' | 'primary-active' | 'basic' | 'destructive' | 'plain' | 'plain-monochrome' | 'plain-destructive' | 'disabled' | 'primary-border' | 'destructive-border' | 'brand' | 'brand-border' | 'basic-border' | 'plain-brand'; declare type Size = 'md' | 'sm'; export declare type Align = 'start' | 'center' | 'end'; declare type IButtonCustom = IClassName & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'disabled' | 'onClick' | 'children' | 'className'>; interface IButton extends IButtonCustom { /** * Rounded corners style */ rounded?: 'all' | 'left' | 'right'; /** * Button type - default button */ type?: 'button' | 'submit' | 'reset'; /** * Is this the principal call to action on the page? */ variant?: Variant; /** * Button contents how label or label + icons */ children?: ReactNode; /** * Adjust size */ size?: Size; /** * How large should the button be? */ fullWidth?: boolean; /** * State load */ isLoading?: boolean; /** * State disabled */ isDisabled?: boolean; /** * Position align children elements */ align?: Align; /** * When only have one icon, not children string */ onlyOneIcon?: boolean; /** * fill background with default value true */ hasFill?: boolean; /** * Emit event handle click */ onClick?: MouseEventHandler<HTMLButtonElement | HTMLDivElement> | (() => void); isSingleLine?: boolean; _t?: (text: string) => string; useT?: boolean; } interface ILoading { variant?: Variant; size?: Size; } export type { IButton, ILoading };