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.
skynet-webportal/packages/dashboard-v2/src/components/Button/Button.js

36 lines
1.0 KiB
JavaScript
Raw Normal View History

2022-02-18 08:20:47 +00:00
import PropTypes from "prop-types";
import styled from "styled-components";
/**
* Primary UI component for user interaction
*/
2022-03-17 12:15:55 +00:00
export const Button = styled.button.attrs(({ disabled, $primary }) => ({
type: "button",
className: `px-6 py-2.5 rounded-full font-sans uppercase text-xs tracking-wide transition-[filter]
${
$primary
? `bg-primary ${disabled ? "" : "text-palette-600"}`
: `bg-white border-2 ${disabled ? "border-palette-300" : "border-black text-palette-600"}`
}
${
disabled
? `${$primary ? "saturate-50 brightness-125 text-palette-400" : "text-palette-300"} cursor-default`
: "hover:brightness-90"
}`,
}))``;
Button.propTypes = {
/**
* Is this the principal call to action on the page?
*/
$primary: PropTypes.bool,
2022-03-17 12:15:55 +00:00
/**
* Prevent interaction on the button
*/
disabled: PropTypes.bool,
2022-02-18 08:20:47 +00:00
};
Button.defaultProps = {
$primary: false,
2022-03-17 12:15:55 +00:00
disabled: false,
2022-02-18 08:20:47 +00:00
};