@desynova-digital/components 8.19.63 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atoms/avatar/avatar.js +1 -1
- package/atoms/avatar/avatar.story.js +46 -14
- package/atoms/badge/badge.js +13 -13
- package/atoms/badge/badge.story.js +91 -29
- package/atoms/button/button.js +81 -85
- package/atoms/button/button.story.js +342 -2
- package/atoms/card/card.js +43 -39
- package/atoms/card/card.story.js +74 -48
- package/atoms/cardStack/cardStack.js +182 -155
- package/atoms/cardStack/cardStack.story.js +131 -18
- package/atoms/cardV2/cardV2.js +23 -23
- package/atoms/cardV2/cardV2.story.js +196 -45
- package/atoms/cardV2/content.js +109 -87
- package/atoms/cardV2/thumbnail.js +85 -72
- package/atoms/cardV2/timeline.js +119 -107
- package/atoms/checkbox/checkbox.js +41 -32
- package/atoms/checkbox/checkbox.story.js +220 -99
- package/atoms/customSelect/customSelect.story.js +820 -582
- package/atoms/datePicker/datePicker.js +77 -83
- package/atoms/datePicker/datePicker.story.js +167 -1
- package/atoms/dateTime/dateTime.story.js +26 -1
- package/atoms/draftInputText/draftInputText.js +358 -0
- package/atoms/draftInputText/draftInputText.story.js +251 -0
- package/atoms/draftInputText/index.js +13 -0
- package/atoms/dropdown/dropdown.story.js +146 -18
- package/atoms/dropdownList/dropdownList.story.js +1598 -1091
- package/atoms/graphs/barGraph/barGraph.js +143 -130
- package/atoms/graphs/barGraph/barGraph.story.js +74 -40
- package/atoms/graphs/circleDonut/circleDonut.story.js +374 -220
- package/atoms/graphs/circleGraph/circleGraph.js +84 -80
- package/atoms/graphs/circleGraph/circleGraph.story.js +38 -26
- package/atoms/graphs/circleNested/circleNested.story.js +98 -103
- package/atoms/graphs/pieChart/pieChart.story.js +160 -81
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +30 -28
- package/atoms/icon/icon.story.js +220 -163
- package/atoms/inputText/inputText.js +52 -49
- package/atoms/label/label.js +29 -29
- package/atoms/label/label.story.js +42 -30
- package/atoms/loader/CircleLoader.js +13 -4
- package/atoms/loader/CircleLoader.jsx +10 -4
- package/atoms/loader/ThreeDotLoader.js +8 -4
- package/atoms/loader/ThreeDotLoader.jsx +4 -4
- package/atoms/loader/loader.js +29 -30
- package/atoms/loader/loader.story.js +38 -23
- package/atoms/loader/spinningLoader.js +7 -4
- package/atoms/loader/spinningLoader.jsx +5 -5
- package/atoms/popup/popup.js +11 -11
- package/atoms/popup/popup.story.js +36 -4
- package/atoms/radio/radio.story.js +140 -2
- package/atoms/sideBar/sidebar.js +19 -5
- package/atoms/sideBar/sidebar.jsx +13 -8
- package/atoms/switch/switch.js +72 -66
- package/atoms/switch/switch.story.js +323 -78
- package/atoms/tag/tag.js +39 -39
- package/atoms/tag/tag.story.js +83 -2
- package/atoms/textarea/textarea.js +36 -34
- package/atoms/timeCodeInput/timCodeInput.story.js +10 -9
- package/atoms/timeCodeInput/timeCodeInput.js +108 -100
- package/atoms/timer/timer.js +127 -126
- package/atoms/toast/toast.js +24 -14
- package/atoms/toast/toast.story.js +22 -0
- package/atoms/videoCard/videoCard.js +226 -203
- package/atoms/videoCard/videoCard.story.js +547 -186
- package/components.js +69 -66
- package/index.js +5 -4
- package/molecules/carousel/carousel.js +55 -67
- package/molecules/filter/filter.js +133 -106
- package/molecules/filter/filter.story.js +215 -173
- package/molecules/graphCard/graphCard.js +34 -24
- package/molecules/graphCard/graphCard.story.js +169 -82
- package/molecules/graphDetailCard/graphDetailCard.js +207 -182
- package/molecules/pageHeader/pageHeader.js +3 -2
- package/molecules/pageHeader/pageHeader.story.js +40 -18
- package/molecules/pagination/pagination.js +66 -14
- package/molecules/pagination/pagination.story.js +24 -2
- package/molecules/table/table.js +368 -316
- package/molecules/table/table.story.js +404 -208
- package/molecules/tabs/tabs.js +15 -6
- package/molecules/tabs/tabs.story.js +26 -0
- package/package.json +2 -2
package/atoms/sideBar/sidebar.js
CHANGED
|
@@ -10,7 +10,7 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
|
10
10
|
|
|
11
11
|
var _templateObject = _taggedTemplateLiteral(['\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n background: rgba(0,0,0,0.5);\n z-index: 100;\n visibility: ', ';\n'], ['\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n background: rgba(0,0,0,0.5);\n z-index: 100;\n visibility: ', ';\n']),
|
|
12
12
|
_templateObject2 = _taggedTemplateLiteral(['\n height: 100%;\n position: fixed;\n z-index: 101;\n top: 0;\n right: 0px;\n background-color: #121D29;\n box-shadow: 0px 2px 44px rgba(0, 0, 0, 0.5);\n overflow: hidden;\n width:0px;\n\n transition: width 250ms ease-in-out;\n\n .ball{\n background-color:#151717\n }\n\n .circle{\n border:4px solid #1d2020;\n height:10px;\n width:10px\n }\n\n div.loader-holder > div{\n height:20px;\n margin-left:5px;\n }\n\n .parentBox{\n width:18px;\n height:18px;\n }\n\n &.open{\n width:400px;\n .sidebar-header, .bodyContainer, .button-container {\n opacity: 1;\n }\n }\n\n .sidebar-header {\n transition: opacity 50ms ease-in-out 250ms;\n opacity:0;\n padding:20px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n \n .header-title {\n font-family: SFUIText-Light;\n line-height: 14px;\n font-size: 16px;\n line-height: 14px;\n color: #FFFFFF;\n }\n ', ' {\n margin: 0;\n background: transparent;\n border-color: transparent;\n padding: 0;\n &:hover {\n background: transparent;\n border-color: transparent;\n }\n }\n }\n\n .bodyContainer {\n opacity:0;\n transition: opacity 50ms ease-in-out 250ms;\n color:white;\n font-family: SFUIText-Regular;\n overflow-y: scroll;\n overflow-x: hidden;\n height: calc(100% - 110px);\n padding:0px 20px 0px 20px;\n overflow-x: hidden;\n }\n\n .bodyContainer-without-footer {\n height: calc(100% - 70px) !important;\n }\n\n'], ['\n height: 100%;\n position: fixed;\n z-index: 101;\n top: 0;\n right: 0px;\n background-color: #121D29;\n box-shadow: 0px 2px 44px rgba(0, 0, 0, 0.5);\n overflow: hidden;\n width:0px;\n\n transition: width 250ms ease-in-out;\n\n .ball{\n background-color:#151717\n }\n\n .circle{\n border:4px solid #1d2020;\n height:10px;\n width:10px\n }\n\n div.loader-holder > div{\n height:20px;\n margin-left:5px;\n }\n\n .parentBox{\n width:18px;\n height:18px;\n }\n\n &.open{\n width:400px;\n .sidebar-header, .bodyContainer, .button-container {\n opacity: 1;\n }\n }\n\n .sidebar-header {\n transition: opacity 50ms ease-in-out 250ms;\n opacity:0;\n padding:20px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n \n .header-title {\n font-family: SFUIText-Light;\n line-height: 14px;\n font-size: 16px;\n line-height: 14px;\n color: #FFFFFF;\n }\n ', ' {\n margin: 0;\n background: transparent;\n border-color: transparent;\n padding: 0;\n &:hover {\n background: transparent;\n border-color: transparent;\n }\n }\n }\n\n .bodyContainer {\n opacity:0;\n transition: opacity 50ms ease-in-out 250ms;\n color:white;\n font-family: SFUIText-Regular;\n overflow-y: scroll;\n overflow-x: hidden;\n height: calc(100% - 110px);\n padding:0px 20px 0px 20px;\n overflow-x: hidden;\n }\n\n .bodyContainer-without-footer {\n height: calc(100% - 70px) !important;\n }\n\n']),
|
|
13
|
-
_templateObject3 = _taggedTemplateLiteral(['\n font-family: SFUIText-Regular;\n display: flex;\n justify-content:center;\n padding: 10px 0;\n background: #182738;\n box-shadow: 0px -12px 24px rgb(0 0 0 / 20%);\n width: 100%;\n bottom:0;\n position: absolute;\n opacity:0;\n transition: opacity 50ms ease-in-out 250ms;\n \n .btn{\n border-radius: 22px;\n color: #FFFFFF;\n font-size: 12px;\n line-height: 12px;\n text-align: center;\n min-width: 150px;\n text-transform: uppercase;\n padding: 10px 0;\n margin: 0 10px;\n max-width: 150px;\n cursor: pointer;\n display:flex;\n justify-content:center;\n align-items:center;\n \n :hover{\n color:
|
|
13
|
+
_templateObject3 = _taggedTemplateLiteral(['\n font-family: SFUIText-Regular;\n display: flex;\n justify-content:center;\n padding: 10px 0;\n background: #182738;\n box-shadow: 0px -12px 24px rgb(0 0 0 / 20%);\n width: 100%;\n bottom:0;\n position: absolute;\n opacity:0;\n transition: opacity 50ms ease-in-out 250ms;\n \n .btn{\n border-radius: 22px;\n color: #FFFFFF;\n font-size: 12px;\n line-height: 12px;\n text-align: center;\n min-width: 150px;\n text-transform: uppercase;\n padding: 10px 0;\n margin: 0 10px;\n max-width: 150px;\n cursor: pointer;\n display:flex;\n justify-content:center;\n align-items:center;\n \n :hover{\n color: ', ';\n }\n }\n\n .default{\n background: #303F51;\n\n :hover{\n color:', ';\n }\n }\n \n .primary {\n color: rgb(12, 20, 29);\n background: ', ';\n\n :hover{\n color: rgb(12, 20, 29);\n transition: all 0.2s ease-in-out 0s;\n box-shadow: rgb(7 213 205 / 20%) 0px 12px 24px 0px;\n }\n }\n'], ['\n font-family: SFUIText-Regular;\n display: flex;\n justify-content:center;\n padding: 10px 0;\n background: #182738;\n box-shadow: 0px -12px 24px rgb(0 0 0 / 20%);\n width: 100%;\n bottom:0;\n position: absolute;\n opacity:0;\n transition: opacity 50ms ease-in-out 250ms;\n \n .btn{\n border-radius: 22px;\n color: #FFFFFF;\n font-size: 12px;\n line-height: 12px;\n text-align: center;\n min-width: 150px;\n text-transform: uppercase;\n padding: 10px 0;\n margin: 0 10px;\n max-width: 150px;\n cursor: pointer;\n display:flex;\n justify-content:center;\n align-items:center;\n \n :hover{\n color: ', ';\n }\n }\n\n .default{\n background: #303F51;\n\n :hover{\n color:', ';\n }\n }\n \n .primary {\n color: rgb(12, 20, 29);\n background: ', ';\n\n :hover{\n color: rgb(12, 20, 29);\n transition: all 0.2s ease-in-out 0s;\n box-shadow: rgb(7 213 205 / 20%) 0px 12px 24px 0px;\n }\n }\n']);
|
|
14
14
|
|
|
15
15
|
var _react = require('react');
|
|
16
16
|
|
|
@@ -30,6 +30,8 @@ var _index2 = _interopRequireDefault(_index);
|
|
|
30
30
|
|
|
31
31
|
var _components = require('../../components');
|
|
32
32
|
|
|
33
|
+
var _tokens = require('@desynova-digital/tokens');
|
|
34
|
+
|
|
33
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
36
|
|
|
35
37
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -46,7 +48,13 @@ var SideBarOverlay = _styledComponents2.default.div(_templateObject, function (p
|
|
|
46
48
|
|
|
47
49
|
var SideBarBlock = _styledComponents2.default.div(_templateObject2, _index2.default.Element);
|
|
48
50
|
|
|
49
|
-
var ButtonContainer = _styledComponents2.default.div(_templateObject3)
|
|
51
|
+
var ButtonContainer = _styledComponents2.default.div(_templateObject3, function (props) {
|
|
52
|
+
return _tokens.colors[props.theme].sideBar.themeColor;
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return _tokens.colors[props.theme].sideBar.lightthemeColor;
|
|
55
|
+
}, function (props) {
|
|
56
|
+
return _tokens.colors[props.theme].sideBar.themeColor;
|
|
57
|
+
});
|
|
50
58
|
|
|
51
59
|
/**
|
|
52
60
|
* @component
|
|
@@ -99,7 +107,8 @@ var SideBar = function (_Component) {
|
|
|
99
107
|
content = _props.content,
|
|
100
108
|
sideBarButtonObject = _props.sideBarButtonObject,
|
|
101
109
|
showSideBar = _props.showSideBar,
|
|
102
|
-
loadingBtn = _props.loadingBtn
|
|
110
|
+
loadingBtn = _props.loadingBtn,
|
|
111
|
+
theme = _props.theme;
|
|
103
112
|
|
|
104
113
|
|
|
105
114
|
return _react2.default.createElement(
|
|
@@ -108,7 +117,7 @@ var SideBar = function (_Component) {
|
|
|
108
117
|
_react2.default.createElement(SideBarOverlay, { open: showSideBar }),
|
|
109
118
|
_react2.default.createElement(
|
|
110
119
|
SideBarBlock,
|
|
111
|
-
{ className: showSideBar ? 'open' : 'close' },
|
|
120
|
+
{ theme: this.props.theme, className: showSideBar ? 'open' : 'close' },
|
|
112
121
|
_react2.default.createElement(
|
|
113
122
|
'div',
|
|
114
123
|
{ className: 'sidebar-header' },
|
|
@@ -135,7 +144,7 @@ var SideBar = function (_Component) {
|
|
|
135
144
|
),
|
|
136
145
|
sideBarButtonObject && sideBarButtonObject.length ? _react2.default.createElement(
|
|
137
146
|
ButtonContainer,
|
|
138
|
-
{ className: 'button-container' },
|
|
147
|
+
{ theme: this.props.theme, className: 'button-container' },
|
|
139
148
|
sideBarButtonObject.map(function (object) {
|
|
140
149
|
return _react2.default.createElement(
|
|
141
150
|
'div',
|
|
@@ -163,10 +172,15 @@ exports.default = SideBar;
|
|
|
163
172
|
|
|
164
173
|
|
|
165
174
|
SideBar.propTypes = {
|
|
175
|
+
theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc']),
|
|
166
176
|
showSideBar: _propTypes2.default.bool,
|
|
167
177
|
title: _propTypes2.default.string,
|
|
168
178
|
content: _propTypes2.default.object,
|
|
169
179
|
sideBarButtonObject: _propTypes2.default.object,
|
|
170
180
|
onCancelClick: _propTypes2.default.func,
|
|
171
181
|
onButtonClick: _propTypes2.default.func
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
SideBar.defaultProps = {
|
|
185
|
+
theme: 'light'
|
|
172
186
|
};
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import Button from '../button/index';
|
|
5
5
|
import { Loader } from '../../components'
|
|
6
|
-
|
|
6
|
+
import { colors } from '@desynova-digital/tokens';
|
|
7
7
|
const SideBarOverlay = styled.div`
|
|
8
8
|
position: fixed;
|
|
9
9
|
width: 100%;
|
|
@@ -131,7 +131,7 @@ const ButtonContainer = styled.div`
|
|
|
131
131
|
align-items:center;
|
|
132
132
|
|
|
133
133
|
:hover{
|
|
134
|
-
color:
|
|
134
|
+
color: ${props => colors[props.theme].sideBar.themeColor};
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -139,13 +139,13 @@ const ButtonContainer = styled.div`
|
|
|
139
139
|
background: #303F51;
|
|
140
140
|
|
|
141
141
|
:hover{
|
|
142
|
-
color
|
|
142
|
+
color:${props => colors[props.theme].sideBar.lightthemeColor};
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
.primary {
|
|
147
147
|
color: rgb(12, 20, 29);
|
|
148
|
-
background:
|
|
148
|
+
background: ${props => colors[props.theme].sideBar.themeColor};
|
|
149
149
|
|
|
150
150
|
:hover{
|
|
151
151
|
color: rgb(12, 20, 29);
|
|
@@ -187,12 +187,12 @@ export default class SideBar extends Component {
|
|
|
187
187
|
})
|
|
188
188
|
}
|
|
189
189
|
render() {
|
|
190
|
-
const { title, content, sideBarButtonObject, showSideBar, loadingBtn } = this.props;
|
|
190
|
+
const { title, content, sideBarButtonObject, showSideBar, loadingBtn,theme } = this.props;
|
|
191
191
|
|
|
192
192
|
return (
|
|
193
193
|
<React.Fragment>
|
|
194
194
|
<SideBarOverlay open={showSideBar} />
|
|
195
|
-
<SideBarBlock className={showSideBar ? 'open' : 'close'}>
|
|
195
|
+
<SideBarBlock theme={this.props.theme} className={showSideBar ? 'open' : 'close'}>
|
|
196
196
|
<div className="sidebar-header">
|
|
197
197
|
<p className="header-title">{title}</p>
|
|
198
198
|
<Button
|
|
@@ -209,7 +209,7 @@ export default class SideBar extends Component {
|
|
|
209
209
|
<div className={`bodyContainer ${!sideBarButtonObject.length && 'bodyContainer-without-footer'}`}>
|
|
210
210
|
{content}
|
|
211
211
|
</div>
|
|
212
|
-
{sideBarButtonObject && sideBarButtonObject.length ? <ButtonContainer className="button-container" >
|
|
212
|
+
{sideBarButtonObject && sideBarButtonObject.length ? <ButtonContainer theme={this.props.theme} className="button-container" >
|
|
213
213
|
{
|
|
214
214
|
sideBarButtonObject.map((object) => {
|
|
215
215
|
return (
|
|
@@ -235,10 +235,15 @@ export default class SideBar extends Component {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
SideBar.propTypes = {
|
|
238
|
+
theme: PropTypes.oneOf(['light', 'dark', 'nexc']),
|
|
238
239
|
showSideBar: PropTypes.bool,
|
|
239
240
|
title: PropTypes.string,
|
|
240
241
|
content: PropTypes.object,
|
|
241
242
|
sideBarButtonObject: PropTypes.object,
|
|
242
243
|
onCancelClick: PropTypes.func,
|
|
243
244
|
onButtonClick: PropTypes.func
|
|
244
|
-
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
SideBar.defaultProps = {
|
|
248
|
+
theme: 'light'
|
|
249
|
+
};
|
package/atoms/switch/switch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -16,7 +16,7 @@ var _styledComponents = require('styled-components');
|
|
|
16
16
|
|
|
17
17
|
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
18
18
|
|
|
19
|
-
var _tokens = require('
|
|
19
|
+
var _tokens = require('@desynova-digital/tokens');
|
|
20
20
|
|
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
22
|
|
|
@@ -31,91 +31,97 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
31
31
|
//import './switch.css'
|
|
32
32
|
|
|
33
33
|
var Switch = function (_React$Component) {
|
|
34
|
-
|
|
34
|
+
_inherits(Switch, _React$Component);
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
function Switch(props) {
|
|
37
|
+
_classCallCheck(this, Switch);
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
var _this = _possibleConstructorReturn(this, (Switch.__proto__ || Object.getPrototypeOf(Switch)).call(this, props));
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
_this.state = {
|
|
42
|
+
isChecked: props.checked ? true : false
|
|
43
|
+
};
|
|
44
|
+
_this._handleChange = _this._handleChange.bind(_this);
|
|
45
|
+
return _this;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_createClass(Switch, [{
|
|
49
|
+
key: 'componentWillMount',
|
|
50
|
+
value: function componentWillMount() {
|
|
51
|
+
//this.setState( { isChecked: this.props.isChecked } );
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: 'render',
|
|
55
|
+
value: function render() {
|
|
56
|
+
return _react2.default.createElement(
|
|
57
|
+
SwitchContainer,
|
|
58
|
+
{ theme: this.props.theme },
|
|
59
|
+
_react2.default.createElement(
|
|
60
|
+
'label',
|
|
61
|
+
null,
|
|
62
|
+
_react2.default.createElement('input', {
|
|
63
|
+
disabled: this.props.disabled ? 'disabled' : '',
|
|
64
|
+
ref: 'switch',
|
|
65
|
+
checked: this.props.checked ? true : false,
|
|
66
|
+
onChange: this._handleChange,
|
|
67
|
+
className: 'switch',
|
|
68
|
+
type: 'checkbox'
|
|
69
|
+
}),
|
|
70
|
+
this.props.label ? _react2.default.createElement(
|
|
71
|
+
'span',
|
|
72
|
+
{ className: 'label-text' },
|
|
73
|
+
this.props.label
|
|
74
|
+
) : null,
|
|
75
|
+
_react2.default.createElement(
|
|
76
|
+
'div',
|
|
77
|
+
{ className: 'switch-box' },
|
|
78
|
+
_react2.default.createElement('div', null)
|
|
79
|
+
)
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: '_handleChange',
|
|
85
|
+
value: function _handleChange() {
|
|
86
|
+
// this.setState( { isChecked: !this.state.isChecked },
|
|
87
|
+
// ()=>{
|
|
88
|
+
this.props.onChangeCheck(this.props.checked);
|
|
89
|
+
//} );
|
|
46
90
|
}
|
|
91
|
+
}]);
|
|
47
92
|
|
|
48
|
-
|
|
49
|
-
key: 'componentWillMount',
|
|
50
|
-
value: function componentWillMount() {
|
|
51
|
-
//this.setState( { isChecked: this.props.isChecked } );
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: 'render',
|
|
55
|
-
value: function render() {
|
|
56
|
-
|
|
57
|
-
return _react2.default.createElement(
|
|
58
|
-
SwitchContainer,
|
|
59
|
-
{ theme: this.props.theme },
|
|
60
|
-
_react2.default.createElement(
|
|
61
|
-
'label',
|
|
62
|
-
null,
|
|
63
|
-
_react2.default.createElement('input', { disabled: this.props.disabled ? 'disabled' : '', ref: 'switch', checked: this.props.checked ? true : false, onChange: this._handleChange, className: 'switch', type: 'checkbox' }),
|
|
64
|
-
this.props.label ? _react2.default.createElement(
|
|
65
|
-
'span',
|
|
66
|
-
{ className: 'label-text' },
|
|
67
|
-
this.props.label
|
|
68
|
-
) : null,
|
|
69
|
-
_react2.default.createElement(
|
|
70
|
-
'div',
|
|
71
|
-
{ className: 'switch-box' },
|
|
72
|
-
_react2.default.createElement('div', null)
|
|
73
|
-
)
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
key: '_handleChange',
|
|
79
|
-
value: function _handleChange() {
|
|
80
|
-
// this.setState( { isChecked: !this.state.isChecked },
|
|
81
|
-
// ()=>{
|
|
82
|
-
this.props.onChangeCheck(this.props.checked);
|
|
83
|
-
//} );
|
|
84
|
-
}
|
|
85
|
-
}]);
|
|
86
|
-
|
|
87
|
-
return Switch;
|
|
93
|
+
return Switch;
|
|
88
94
|
}(_react2.default.Component);
|
|
89
95
|
|
|
90
96
|
var SwitchContainer = _styledComponents2.default.div(_templateObject, function (props) {
|
|
91
|
-
|
|
97
|
+
return _tokens.colors[props.theme].switch.label;
|
|
92
98
|
}, function (props) {
|
|
93
|
-
|
|
99
|
+
return _tokens.colors[props.theme].switch.background;
|
|
94
100
|
}, function (props) {
|
|
95
|
-
|
|
101
|
+
return _tokens.colors[props.theme].switch.border;
|
|
96
102
|
}, function (props) {
|
|
97
|
-
|
|
103
|
+
return _tokens.colors[props.theme].switch.checkedLabel;
|
|
98
104
|
}, function (props) {
|
|
99
|
-
|
|
105
|
+
return _tokens.colors[props.theme].switch.checkedBorder;
|
|
100
106
|
}, function (props) {
|
|
101
|
-
|
|
107
|
+
return _tokens.colors[props.theme].switch.circleBackground;
|
|
102
108
|
}, function (props) {
|
|
103
|
-
|
|
109
|
+
return _tokens.colors[props.theme].switch.circleBorder;
|
|
104
110
|
}, function (props) {
|
|
105
|
-
|
|
111
|
+
return _tokens.colors[props.theme].switch.checkedCircleBackground;
|
|
106
112
|
}, function (props) {
|
|
107
|
-
|
|
113
|
+
return _tokens.colors[props.theme].switch.checkedCircleBorder;
|
|
108
114
|
}, function (props) {
|
|
109
|
-
|
|
115
|
+
return _tokens.colors[props.theme].switch.backgroundDisabled;
|
|
110
116
|
}, function (props) {
|
|
111
|
-
|
|
117
|
+
return _tokens.colors[props.theme].switch.borderDisabled;
|
|
112
118
|
}, function (props) {
|
|
113
|
-
|
|
119
|
+
return _tokens.colors[props.theme].switch.checkedBorderDisabled;
|
|
114
120
|
}, function (props) {
|
|
115
|
-
|
|
121
|
+
return _tokens.colors[props.theme].switch.borderDisabled;
|
|
116
122
|
}, function (props) {
|
|
117
|
-
|
|
123
|
+
return _tokens.colors[props.theme].switch.checkedBorderDisabled;
|
|
118
124
|
}, function (props) {
|
|
119
|
-
|
|
125
|
+
return _tokens.colors[props.theme].switch.checkedBorderDisabled;
|
|
120
126
|
});
|
|
121
127
|
exports.default = Switch;
|