@massds/mayflower-react
Version:
React versions of Mayflower design system UI components
44 lines (43 loc) • 1.34 kB
TypeScript
/**
* Button module.
* @module @massds/mayflower-react/Button
*/
import React from 'react';
export interface ButtonProps {
/** Custom click handler function. */
onClick?(...args: unknown[]): unknown;
/** When populated with a url, this component renders an `<a>` vs a `<button>` */
href?: string;
/** The text which renders in the standard browser tooltip on hover */
info?: string;
/** Aria-label of the button */
label?: string;
/** Button or link text */
text?: string;
/** HTML button 'type' attribute */
type?: "submit" | "reset" | "button" | "";
/** Create a smaller button */
size?: "" | "small" | "large";
/** Themes correspond to site color scheme i.e. sass variables */
theme?: "" | "c-primary-alt" | "c-highlight" | "c-gray-dark";
/** Button usage */
usage?: "" | "secondary" | "tertiary" | "quaternary";
/** Set `<button>` to disabled */
disabled?: boolean;
/** Custom classnames appending to the button */
classes?: string[];
children?: React.ReactNode;
}
declare const Button: {
(button: ButtonProps): any;
defaultProps: {
href: string;
type: string;
size: string;
theme: string;
usage: string;
disabled: boolean;
classes: string[];
};
};
export default Button;