UNPKG

@wonderflow/react-components

Version:

UI components from Wonderflow's Wanda design system

55 lines 1.79 kB
import { MouseEvent } from 'react'; import { Polymorphic, SymbolProps } from '../..'; export declare type ButtonProps = { /** * Set the style of the button. * When `disabled` this property is overwritten. */ kind?: 'primary' | 'secondary' | 'flat'; /** * Set the size of the button. */ dimension?: 'regular' | 'small' | 'big'; /** * Make the button full width, filling the available space. */ fullWidth?: boolean; /** * Define the icon to use. */ icon?: SymbolProps['source']; /** * Set the position of the icon. Used only when icon is defined. */ iconPosition?: 'left' | 'right'; /** * Override the color of the icon. Used only when icon is defined. */ iconColor?: string; /** * Set disabled state. The button is not interactive and grayed out. */ disabled?: boolean; /** * Pass the HTML attribute `type` to the button. * If not specified, the type is always 'button' when rendered as `<button>. */ type?: 'submit' | 'reset' | 'button'; /** * Set the loading state and show a spinner. */ busy?: boolean; /** * Set the pressed state and add required aria attributes. */ pressed?: boolean; /** * Callback function to be called when the button is pressed. */ onClick?: (event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void; }; export declare type PolymorphicButton = Polymorphic.ForwardRefComponent<'button', ButtonProps>; export declare const Button: PolymorphicButton; export declare type ButtonsGroupProps = PropsWithClass & Pick<ButtonProps, 'dimension' | 'kind'>; export declare const ButtonsGroup: FCChildren<ButtonsGroupProps>; //# sourceMappingURL=button.d.ts.map