forked from react-toolbox/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCheck.js
More file actions
49 lines (38 loc) · 1.34 KB
/
Check.js
File metadata and controls
49 lines (38 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _classnames2 = require('classnames');
var _classnames3 = _interopRequireDefault(_classnames2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var factory = function factory(ripple) {
var Check = function Check(_ref) {
var checked = _ref.checked;
var children = _ref.children;
var onMouseDown = _ref.onMouseDown;
var theme = _ref.theme;
return _react2.default.createElement(
'div',
{
'data-react-toolbox': 'check',
className: (0, _classnames3.default)(theme.check, _defineProperty({}, theme.checked, checked)),
onMouseDown: onMouseDown
},
children
);
};
Check.propTypes = {
checked: _react.PropTypes.bool,
children: _react.PropTypes.any,
onMouseDown: _react.PropTypes.func,
theme: _react.PropTypes.shape({
check: _react.PropTypes.string,
checked: _react.PropTypes.string
})
};
return ripple(Check);
};
exports.default = factory;