39 lines
722 B
JavaScript
39 lines
722 B
JavaScript
![]() |
import React from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
|
||
|
import './button.css';
|
||
|
|
||
|
/**
|
||
|
* Primary UI component for user interaction
|
||
|
*/
|
||
|
export const Button = ({
|
||
|
primary = false,
|
||
|
size = 'medium',
|
||
|
backgroundColor,
|
||
|
label,
|
||
|
...props
|
||
|
}) => {
|
||
|
const mode = primary
|
||
|
? 'storybook-button--primary'
|
||
|
: 'storybook-button--secondary';
|
||
|
return (
|
||
|
<button
|
||
|
className={['storybook-button', `storybook-button--${size}`, mode].join(
|
||
|
' '
|
||
|
)}
|
||
|
style={{ backgroundColor }}
|
||
|
type='button'
|
||
|
{...props}
|
||
|
>
|
||
|
{label}
|
||
|
</button>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
Button.propTypes = {
|
||
|
backgroundColor: PropTypes.string,
|
||
|
label: PropTypes.string,
|
||
|
primary: PropTypes.bool,
|
||
|
size: PropTypes.string
|
||
|
};
|