2017-04-17 17:14:17 +03:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2015-12-07 03:40:59 +03:00
|
|
|
|
2016-05-29 23:09:02 +03:00
|
|
|
const factory = (ripple) => {
|
2017-01-26 20:05:32 +03:00
|
|
|
const Radio = ({ checked, onMouseDown, theme, ...other }) => (
|
2016-05-29 23:09:02 +03:00
|
|
|
<div
|
2017-01-26 20:05:32 +03:00
|
|
|
data-react-toolbox="radio"
|
2016-05-29 23:09:02 +03:00
|
|
|
className={theme[checked ? 'radioChecked' : 'radio']}
|
|
|
|
onMouseDown={onMouseDown}
|
|
|
|
{...other}
|
|
|
|
/>
|
|
|
|
);
|
2015-12-07 03:40:59 +03:00
|
|
|
|
2016-05-29 23:09:02 +03:00
|
|
|
Radio.propTypes = {
|
|
|
|
checked: PropTypes.bool,
|
2017-01-26 20:05:32 +03:00
|
|
|
children: PropTypes.node,
|
2016-05-29 23:09:02 +03:00
|
|
|
onMouseDown: PropTypes.func,
|
|
|
|
theme: PropTypes.shape({
|
2016-06-04 00:44:33 +03:00
|
|
|
radio: PropTypes.string,
|
|
|
|
radioChecked: PropTypes.string,
|
2017-01-26 20:05:32 +03:00
|
|
|
ripple: PropTypes.string,
|
|
|
|
}),
|
2016-05-29 23:09:02 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
return ripple(Radio);
|
2016-04-09 21:34:34 +03:00
|
|
|
};
|
|
|
|
|
2016-05-29 23:09:02 +03:00
|
|
|
export default factory;
|