react-toolbox/components/checkbox/Check.js

31 lines
685 B
JavaScript
Raw Normal View History

2016-04-09 21:34:34 +03:00
import React, { PropTypes } from 'react';
2016-05-21 19:42:22 +03:00
import classnames from 'classnames';
2016-05-29 13:38:20 +03:00
const factory = (ripple) => {
const Check = ({checked, children, onMouseDown, theme, style}) => (
2016-05-29 13:38:20 +03:00
<div
data-react-toolbox='check'
className={classnames(theme.check, { [theme.checked]: checked })}
onMouseDown={onMouseDown}
style={style}
2016-05-29 13:38:20 +03:00
>
{children}
</div>
);
2016-05-29 13:38:20 +03:00
Check.propTypes = {
checked: PropTypes.bool,
children: PropTypes.any,
onMouseDown: PropTypes.func,
2016-10-06 21:29:36 +03:00
style: PropTypes.object,
theme: PropTypes.shape({
check: PropTypes.string,
checked: PropTypes.string
2016-10-06 21:29:36 +03:00
})
2016-05-29 13:38:20 +03:00
};
2016-04-09 21:34:34 +03:00
2016-05-29 13:38:20 +03:00
return ripple(Check);
};
2016-05-21 19:42:22 +03:00
2016-05-29 13:38:20 +03:00
export default factory;