diff --git a/src/CloseButton.js b/src/CloseButton.js new file mode 100644 index 000000000..e9e22b6b7 --- /dev/null +++ b/src/CloseButton.js @@ -0,0 +1,45 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import classNames from 'classnames'; +import { mapToCssModules } from './utils'; + +const propTypes = { + active: PropTypes.bool, + 'aria-label': PropTypes.string, + onClick: PropTypes.func, + variant: PropTypes.oneOf(['white', 'black']) +} + +const defaultProps = { + variant: 'black', + 'aria-label': 'close' +} + +const CloseButton = (props) => { + const { + className, + cssModule, + variant, + innerRef, + ...attributes + } = props; + + const classes = mapToCssModules(classNames( + className, + 'btn-close', + variant && `btn-close-${variant}` + )) + + return ( +