@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/timer/timer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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; }; }();
|
|
8
8
|
|
|
9
|
-
var _templateObject = _taggedTemplateLiteral(['\n
|
|
9
|
+
var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n justify-content: space-between;\n\n .timer-holder {\n text-align: center;\n margin-right: 20px;\n\n .time {\n font-size: 40px;\n font-family: SFUIText-Medium;\n line-height: 30px;\n margin-bottom: 5px;\n min-width: 55px;\n }\n\n .time-tag {\n font-size: 10px;\n font-family: SFUIText-Medium;\n color: #000;\n line-height: 10px;\n }\n }\n'], ['\n display: flex;\n justify-content: space-between;\n\n .timer-holder {\n text-align: center;\n margin-right: 20px;\n\n .time {\n font-size: 40px;\n font-family: SFUIText-Medium;\n line-height: 30px;\n margin-bottom: 5px;\n min-width: 55px;\n }\n\n .time-tag {\n font-size: 10px;\n font-family: SFUIText-Medium;\n color: #000;\n line-height: 10px;\n }\n }\n']);
|
|
10
10
|
|
|
11
11
|
var _react = require('react');
|
|
12
12
|
|
|
@@ -20,6 +20,8 @@ var _styledComponents = require('styled-components');
|
|
|
20
20
|
|
|
21
21
|
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
22
22
|
|
|
23
|
+
var _tokens = require('@desynova-digital/tokens');
|
|
24
|
+
|
|
23
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
26
|
|
|
25
27
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -30,138 +32,137 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
30
32
|
|
|
31
33
|
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
32
34
|
|
|
33
|
-
// import { colors } from '@desynova-digital/tokens'
|
|
34
35
|
// import {colors} from '../../../tokens';
|
|
35
36
|
|
|
36
37
|
var TimerWrapper = _styledComponents2.default.span(_templateObject);
|
|
37
38
|
|
|
38
39
|
var Timer = function (_Component) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
40
|
+
_inherits(Timer, _Component);
|
|
41
|
+
|
|
42
|
+
function Timer(props) {
|
|
43
|
+
_classCallCheck(this, Timer);
|
|
44
|
+
|
|
45
|
+
var _this = _possibleConstructorReturn(this, (Timer.__proto__ || Object.getPrototypeOf(Timer)).call(this, props));
|
|
46
|
+
|
|
47
|
+
_this.componentDidMount = function () {
|
|
48
|
+
var timeObj = _this.getTimeLeft();
|
|
49
|
+
_this.setState({
|
|
50
|
+
time: {
|
|
51
|
+
hours: timeObj.hours,
|
|
52
|
+
minutes: timeObj.minutes,
|
|
53
|
+
seconds: timeObj.seconds
|
|
54
|
+
}
|
|
55
|
+
}, function () {
|
|
56
|
+
_this.startCountdown();
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
_this.getTimeLeft = function () {
|
|
61
|
+
var endTime = _this.props.endTime;
|
|
62
|
+
|
|
63
|
+
var presentTime = new Date().getTime();
|
|
64
|
+
var timeLeft = endTime - presentTime;
|
|
65
|
+
var hours = Math.floor(timeLeft % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
|
|
66
|
+
var minutes = Math.floor(timeLeft % (1000 * 60 * 60) / (1000 * 60));
|
|
67
|
+
var seconds = Math.floor(timeLeft % (1000 * 60) / 1000);
|
|
68
|
+
return {
|
|
69
|
+
hours: hours,
|
|
70
|
+
minutes: minutes,
|
|
71
|
+
seconds: seconds
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
_this.startCountdown = function () {
|
|
76
|
+
if (!_this.countdownInterval) {
|
|
77
|
+
var self = _this;
|
|
78
|
+
_this.countdownInterval = setInterval(function () {
|
|
79
|
+
var timeObj = self.getTimeLeft();
|
|
80
|
+
self.setState({
|
|
81
|
+
time: {
|
|
82
|
+
hours: timeObj.hours,
|
|
83
|
+
minutes: timeObj.minutes,
|
|
84
|
+
seconds: timeObj.seconds
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}, 1000);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
_this.componentWillUnmount = function () {
|
|
92
|
+
clearInterval(_this.countdownInterval);
|
|
93
|
+
_this.countdownInterval = null;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
_this.state = {
|
|
97
|
+
time: {
|
|
98
|
+
hours: 0,
|
|
99
|
+
minutes: 0,
|
|
100
|
+
seconds: 0
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
_this.countdownInterval = null;
|
|
104
|
+
return _this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
_createClass(Timer, [{
|
|
108
|
+
key: 'render',
|
|
109
|
+
value: function render() {
|
|
110
|
+
var time = this.state.time;
|
|
111
|
+
|
|
112
|
+
return _react2.default.createElement(
|
|
113
|
+
TimerWrapper,
|
|
114
|
+
null,
|
|
115
|
+
_react2.default.createElement(
|
|
116
|
+
'span',
|
|
117
|
+
{ className: 'timer-holder' },
|
|
118
|
+
_react2.default.createElement(
|
|
119
|
+
'p',
|
|
120
|
+
{ className: 'time' },
|
|
121
|
+
time.hours > 9 ? time.hours : '0' + time.hours
|
|
122
|
+
),
|
|
123
|
+
_react2.default.createElement(
|
|
124
|
+
'p',
|
|
125
|
+
{ className: 'time-tag' },
|
|
126
|
+
'Hr'
|
|
127
|
+
)
|
|
128
|
+
),
|
|
129
|
+
_react2.default.createElement(
|
|
130
|
+
'span',
|
|
131
|
+
{ className: 'timer-holder' },
|
|
132
|
+
_react2.default.createElement(
|
|
133
|
+
'p',
|
|
134
|
+
{ className: 'time' },
|
|
135
|
+
time.minutes > 9 ? time.minutes : '0' + time.minutes
|
|
136
|
+
),
|
|
137
|
+
_react2.default.createElement(
|
|
138
|
+
'p',
|
|
139
|
+
{ className: 'time-tag' },
|
|
140
|
+
'Min'
|
|
141
|
+
)
|
|
142
|
+
),
|
|
143
|
+
_react2.default.createElement(
|
|
144
|
+
'span',
|
|
145
|
+
{ className: 'timer-holder' },
|
|
146
|
+
_react2.default.createElement(
|
|
147
|
+
'p',
|
|
148
|
+
{ className: 'time' },
|
|
149
|
+
time.seconds > 9 ? time.seconds : '0' + time.seconds
|
|
150
|
+
),
|
|
151
|
+
_react2.default.createElement(
|
|
152
|
+
'p',
|
|
153
|
+
{ className: 'time-tag' },
|
|
154
|
+
'Sec'
|
|
155
|
+
)
|
|
156
|
+
)
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}]);
|
|
160
|
+
|
|
161
|
+
return Timer;
|
|
161
162
|
}(_react.Component);
|
|
162
163
|
|
|
163
164
|
Timer.propTypes = {
|
|
164
|
-
|
|
165
|
+
endTime: _propTypes2.default.number
|
|
165
166
|
};
|
|
166
167
|
|
|
167
168
|
exports.default = Timer;
|
package/atoms/toast/toast.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
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; }; }();
|
|
8
8
|
|
|
9
|
-
var _templateObject = _taggedTemplateLiteral(['\n position: fixed;\n width: 100%;\n right: 0px;\n top: 0px;\n z-index: 1000;\n text-align: center;\n height: 1px
|
|
10
|
-
_templateObject2 = _taggedTemplateLiteral(['\n
|
|
9
|
+
var _templateObject = _taggedTemplateLiteral(['\n position: fixed;\n width: 100%;\n right: 0px;\n top: 0px;\n z-index: 1000;\n text-align: center;\n height: 1px;\n'], ['\n position: fixed;\n width: 100%;\n right: 0px;\n top: 0px;\n z-index: 1000;\n text-align: center;\n height: 1px;\n']),
|
|
10
|
+
_templateObject2 = _taggedTemplateLiteral(['\n &.toast-box {\n background: #fff;\n padding: 10px;\n margin-bottom: 10px;\n border-radius: 5px;\n text-align: left;\n text-transform: capitalize;\n font-family: SFUIText-Regular;\n color: #333;\n box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n cursor: default;\n\n width: 260px;\n height: 80px;\n border-radius: 2px;\n background-image: linear-gradient(to right, #00c8e7, #00e6b9);\n\n animation-name: ', ';\n animation-duration: 7s;\n\n position: absolute;\n\n .icon-box {\n margin-right: 10px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.1411764705882353);\n padding: 5px;\n }\n .head {\n font-family: SFUIText-Medium;\n font-size: 14px;\n padding: 3px 0px;\n }\n .body {\n font-family: SFUIText-Regular;\n font-size: 12px;\n padding: 3px 0px;\n }\n\n &.right {\n top: 0px;\n right: -260px;\n }\n &.left {\n top: 0px;\n left: -260px;\n }\n &.top {\n top: -85px;\n }\n\n &.success {\n background: ', ';\n background-image: linear-gradient(to right, #00c8e7, #00e6b9);\n color: #fff;\n }\n &.error {\n background: ', ';\n background-image: linear-gradient(to right, #de564a, #cc5b30);\n color: #fff;\n }\n }\n\n /* Standard syntax */\n @keyframes toast-top {\n 0% {\n top: -85px;\n }\n 15% {\n top: 20px;\n }\n 85% {\n top: 20px;\n }\n 100% {\n top: -85px;\n }\n }\n @keyframes toast-right {\n 0% {\n right: -260px;\n }\n 15% {\n right: 0px;\n }\n 85% {\n right: 0px;\n }\n 100% {\n right: -260px;\n }\n }\n @keyframes toast-left {\n 0% {\n left: -260px;\n }\n 15% {\n left: 0px;\n }\n 85% {\n left: 0px;\n }\n 100% {\n left: -260px;\n }\n }\n'], ['\n &.toast-box {\n background: #fff;\n padding: 10px;\n margin-bottom: 10px;\n border-radius: 5px;\n text-align: left;\n text-transform: capitalize;\n font-family: SFUIText-Regular;\n color: #333;\n box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n cursor: default;\n\n width: 260px;\n height: 80px;\n border-radius: 2px;\n background-image: linear-gradient(to right, #00c8e7, #00e6b9);\n\n animation-name: ', ';\n animation-duration: 7s;\n\n position: absolute;\n\n .icon-box {\n margin-right: 10px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.1411764705882353);\n padding: 5px;\n }\n .head {\n font-family: SFUIText-Medium;\n font-size: 14px;\n padding: 3px 0px;\n }\n .body {\n font-family: SFUIText-Regular;\n font-size: 12px;\n padding: 3px 0px;\n }\n\n &.right {\n top: 0px;\n right: -260px;\n }\n &.left {\n top: 0px;\n left: -260px;\n }\n &.top {\n top: -85px;\n }\n\n &.success {\n background: ', ';\n background-image: linear-gradient(to right, #00c8e7, #00e6b9);\n color: #fff;\n }\n &.error {\n background: ', ';\n background-image: linear-gradient(to right, #de564a, #cc5b30);\n color: #fff;\n }\n }\n\n /* Standard syntax */\n @keyframes toast-top {\n 0% {\n top: -85px;\n }\n 15% {\n top: 20px;\n }\n 85% {\n top: 20px;\n }\n 100% {\n top: -85px;\n }\n }\n @keyframes toast-right {\n 0% {\n right: -260px;\n }\n 15% {\n right: 0px;\n }\n 85% {\n right: 0px;\n }\n 100% {\n right: -260px;\n }\n }\n @keyframes toast-left {\n 0% {\n left: -260px;\n }\n 15% {\n left: 0px;\n }\n 85% {\n left: 0px;\n }\n 100% {\n left: -260px;\n }\n }\n']);
|
|
11
11
|
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
|
|
@@ -25,6 +25,8 @@ var _icon = require('../icon');
|
|
|
25
25
|
|
|
26
26
|
var _icon2 = _interopRequireDefault(_icon);
|
|
27
27
|
|
|
28
|
+
var _tokens = require('../../../tokens');
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -47,6 +49,10 @@ var ToastGroupEle = _styledComponents2.default.div(_templateObject);
|
|
|
47
49
|
|
|
48
50
|
var ToastEle = _styledComponents2.default.div(_templateObject2, function (props) {
|
|
49
51
|
return 'toast-' + props.toastDirection;
|
|
52
|
+
}, function (props) {
|
|
53
|
+
return _tokens.colors[props.theme].toast.themeColor;
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return _tokens.colors[props.theme].toast.themeColor;
|
|
50
56
|
});
|
|
51
57
|
|
|
52
58
|
var Toast = function (_Component) {
|
|
@@ -71,7 +77,8 @@ var Toast = function (_Component) {
|
|
|
71
77
|
type = _props.type,
|
|
72
78
|
text = _props.text,
|
|
73
79
|
direction = _props.direction,
|
|
74
|
-
icon = _props.icon
|
|
80
|
+
icon = _props.icon,
|
|
81
|
+
theme = _props.theme;
|
|
75
82
|
|
|
76
83
|
var self = this;
|
|
77
84
|
if (showToast && (text.head || text.body)) {
|
|
@@ -148,24 +155,21 @@ var Toast = function (_Component) {
|
|
|
148
155
|
toastIcon = _state.toastIcon,
|
|
149
156
|
toastDirection = _state.toastDirection;
|
|
150
157
|
|
|
151
|
-
|
|
158
|
+
console.log(this.props.theme, 'HELLO');
|
|
152
159
|
return show ? _react2.default.createElement(
|
|
153
160
|
ToastEle,
|
|
154
161
|
{
|
|
162
|
+
theme: this.props.theme,
|
|
155
163
|
onClick: function onClick() {
|
|
156
|
-
document.querySelector('.toast-box').style.display =
|
|
164
|
+
document.querySelector('.toast-box').style.display = 'none';
|
|
157
165
|
},
|
|
158
|
-
className: 'toast-box ' + type + ' ' + toastDirection,
|
|
166
|
+
className: 'toast-box ' + type + ' ' + toastDirection,
|
|
167
|
+
toastDirection: toastDirection
|
|
159
168
|
},
|
|
160
169
|
_react2.default.createElement(
|
|
161
170
|
'div',
|
|
162
171
|
{ className: 'icon-box' },
|
|
163
|
-
toastIcon ? _react2.default.createElement(_icon2.default, { name: toastIcon, width: 18, height: 18, color: '#fff' }) : this.iconFor(type) ? _react2.default.createElement(_icon2.default, {
|
|
164
|
-
name: this.iconFor(type),
|
|
165
|
-
width: 18,
|
|
166
|
-
height: 18,
|
|
167
|
-
color: '#fff'
|
|
168
|
-
}) : null
|
|
172
|
+
toastIcon ? _react2.default.createElement(_icon2.default, { name: toastIcon, width: 18, height: 18, color: '#fff' }) : this.iconFor(type) ? _react2.default.createElement(_icon2.default, { name: this.iconFor(type), width: 18, height: 18, color: '#fff' }) : null
|
|
169
173
|
),
|
|
170
174
|
_react2.default.createElement(
|
|
171
175
|
'div',
|
|
@@ -188,7 +192,13 @@ var Toast = function (_Component) {
|
|
|
188
192
|
return Toast;
|
|
189
193
|
}(_react.Component);
|
|
190
194
|
|
|
191
|
-
|
|
195
|
+
//Toast.propTypes = propTypes;
|
|
192
196
|
|
|
197
|
+
exports.default = Toast;
|
|
198
|
+
Toast.propTypes = {
|
|
199
|
+
theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc'])
|
|
200
|
+
};
|
|
193
201
|
|
|
194
|
-
Toast.
|
|
202
|
+
Toast.defaultProps = {
|
|
203
|
+
theme: 'light'
|
|
204
|
+
};
|
|
@@ -54,4 +54,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
54
54
|
})
|
|
55
55
|
)
|
|
56
56
|
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
(0, _react3.storiesOf)('Toast').add('left-success nexc', function () {
|
|
60
|
+
return _react2.default.createElement(
|
|
61
|
+
_storyHelpers.Example,
|
|
62
|
+
{ title: 'appearance-dark', background: 'dark' },
|
|
63
|
+
_react2.default.createElement(
|
|
64
|
+
_storyHelpers.Stack,
|
|
65
|
+
null,
|
|
66
|
+
_react2.default.createElement(_toast2.default, {
|
|
67
|
+
theme: 'nexc',
|
|
68
|
+
showToast: true,
|
|
69
|
+
type: 'success',
|
|
70
|
+
text: {
|
|
71
|
+
head: 'Access Request Sent',
|
|
72
|
+
body: 'Please check your email for details'
|
|
73
|
+
},
|
|
74
|
+
direction: 'left',
|
|
75
|
+
icon: 'dashboard'
|
|
76
|
+
})
|
|
77
|
+
)
|
|
78
|
+
);
|
|
57
79
|
});
|