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';
|
2015-12-06 16:35:10 +03:00
|
|
|
|
2016-05-29 13:38:20 +03:00
|
|
|
const factory = (ripple) => {
|
|
|
|
const Check = ({checked, children, onMouseDown, theme}) => (
|
|
|
|
<div
|
|
|
|
data-react-toolbox='check'
|
|
|
|
className={classnames(theme.check, { [theme.checked]: checked })}
|
|
|
|
onMouseDown={onMouseDown}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
2015-12-06 16:35:10 +03:00
|
|
|
|
2016-05-29 13:38:20 +03:00
|
|
|
Check.propTypes = {
|
|
|
|
checked: PropTypes.bool,
|
|
|
|
children: PropTypes.any,
|
|
|
|
onMouseDown: PropTypes.func,
|
|
|
|
theme: React.PropTypes.shape({
|
|
|
|
check: React.PropTypes.string.isRequired,
|
|
|
|
checked: React.PropTypes.string.isRequired
|
|
|
|
})
|
|
|
|
};
|
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;
|