mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
feature(components): prop-type Button component
This commit is contained in:
parent
d9a7b27f0e
commit
3d910c2367
@ -1,10 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import ReactTooltip from 'react-tooltip';
|
import ReactTooltip from 'react-tooltip';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import styles from './Button.module.css';
|
import styles from './Button.module.css';
|
||||||
|
|
||||||
export default function Button({
|
function Button({
|
||||||
type = 'button',
|
type = 'button',
|
||||||
icon,
|
icon,
|
||||||
size,
|
size,
|
||||||
@ -43,3 +44,19 @@ export default function Button({
|
|||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Button.propTypes = {
|
||||||
|
type: PropTypes.oneOf(['button', 'submit', 'reset']),
|
||||||
|
icon: PropTypes.node,
|
||||||
|
size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small', 'xsmall']),
|
||||||
|
variant: PropTypes.oneOf(['action', 'danger', 'light']),
|
||||||
|
children: PropTypes.node,
|
||||||
|
className: PropTypes.string,
|
||||||
|
tooltip: PropTypes.node,
|
||||||
|
tooltipId: PropTypes.string,
|
||||||
|
disabled: PropTypes.bool,
|
||||||
|
iconRight: PropTypes.bool,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Button;
|
||||||
|
Loading…
Reference in New Issue
Block a user