This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
2022-02-18 08:20:47 +00:00
|
|
|
import PropTypes from "prop-types";
|
2022-02-17 11:53:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Primary UI component for user interaction
|
|
|
|
*/
|
|
|
|
export const Button = ({ primary, label, ...props }) => {
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
className={`min-w-button min-h-button rounded-full font-sans uppercase tracking-wide text-button
|
2022-02-18 08:20:47 +00:00
|
|
|
${primary ? "bg-primary" : "bg-white border-2 border-black"}`}
|
2022-02-17 11:53:32 +00:00
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{label}
|
|
|
|
</button>
|
2022-02-18 08:20:47 +00:00
|
|
|
);
|
|
|
|
};
|
2022-02-17 11:53:32 +00:00
|
|
|
|
|
|
|
Button.propTypes = {
|
|
|
|
/**
|
|
|
|
* Is this the principal call to action on the page?
|
|
|
|
*/
|
|
|
|
primary: PropTypes.bool,
|
|
|
|
/**
|
|
|
|
* What background color to use
|
|
|
|
*/
|
|
|
|
backgroundColor: PropTypes.string,
|
|
|
|
/**
|
|
|
|
* Button contents
|
|
|
|
*/
|
|
|
|
label: PropTypes.string.isRequired,
|
|
|
|
/**
|
|
|
|
* Optional click handler
|
|
|
|
*/
|
|
|
|
onClick: PropTypes.func,
|
2022-02-18 08:20:47 +00:00
|
|
|
};
|
2022-02-17 11:53:32 +00:00
|
|
|
|
|
|
|
Button.defaultProps = {
|
|
|
|
primary: false,
|
|
|
|
onClick: undefined,
|
2022-02-18 08:20:47 +00:00
|
|
|
};
|