@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.
Files changed (80) hide show
  1. package/atoms/avatar/avatar.js +1 -1
  2. package/atoms/avatar/avatar.story.js +46 -14
  3. package/atoms/badge/badge.js +13 -13
  4. package/atoms/badge/badge.story.js +91 -29
  5. package/atoms/button/button.js +81 -85
  6. package/atoms/button/button.story.js +342 -2
  7. package/atoms/card/card.js +43 -39
  8. package/atoms/card/card.story.js +74 -48
  9. package/atoms/cardStack/cardStack.js +182 -155
  10. package/atoms/cardStack/cardStack.story.js +131 -18
  11. package/atoms/cardV2/cardV2.js +23 -23
  12. package/atoms/cardV2/cardV2.story.js +196 -45
  13. package/atoms/cardV2/content.js +109 -87
  14. package/atoms/cardV2/thumbnail.js +85 -72
  15. package/atoms/cardV2/timeline.js +119 -107
  16. package/atoms/checkbox/checkbox.js +41 -32
  17. package/atoms/checkbox/checkbox.story.js +220 -99
  18. package/atoms/customSelect/customSelect.story.js +820 -582
  19. package/atoms/datePicker/datePicker.js +77 -83
  20. package/atoms/datePicker/datePicker.story.js +167 -1
  21. package/atoms/dateTime/dateTime.story.js +26 -1
  22. package/atoms/draftInputText/draftInputText.js +358 -0
  23. package/atoms/draftInputText/draftInputText.story.js +251 -0
  24. package/atoms/draftInputText/index.js +13 -0
  25. package/atoms/dropdown/dropdown.story.js +146 -18
  26. package/atoms/dropdownList/dropdownList.story.js +1598 -1091
  27. package/atoms/graphs/barGraph/barGraph.js +143 -130
  28. package/atoms/graphs/barGraph/barGraph.story.js +74 -40
  29. package/atoms/graphs/circleDonut/circleDonut.story.js +374 -220
  30. package/atoms/graphs/circleGraph/circleGraph.js +84 -80
  31. package/atoms/graphs/circleGraph/circleGraph.story.js +38 -26
  32. package/atoms/graphs/circleNested/circleNested.story.js +98 -103
  33. package/atoms/graphs/pieChart/pieChart.story.js +160 -81
  34. package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +30 -28
  35. package/atoms/icon/icon.story.js +220 -163
  36. package/atoms/inputText/inputText.js +52 -49
  37. package/atoms/label/label.js +29 -29
  38. package/atoms/label/label.story.js +42 -30
  39. package/atoms/loader/CircleLoader.js +13 -4
  40. package/atoms/loader/CircleLoader.jsx +10 -4
  41. package/atoms/loader/ThreeDotLoader.js +8 -4
  42. package/atoms/loader/ThreeDotLoader.jsx +4 -4
  43. package/atoms/loader/loader.js +29 -30
  44. package/atoms/loader/loader.story.js +38 -23
  45. package/atoms/loader/spinningLoader.js +7 -4
  46. package/atoms/loader/spinningLoader.jsx +5 -5
  47. package/atoms/popup/popup.js +11 -11
  48. package/atoms/popup/popup.story.js +36 -4
  49. package/atoms/radio/radio.story.js +140 -2
  50. package/atoms/sideBar/sidebar.js +19 -5
  51. package/atoms/sideBar/sidebar.jsx +13 -8
  52. package/atoms/switch/switch.js +72 -66
  53. package/atoms/switch/switch.story.js +323 -78
  54. package/atoms/tag/tag.js +39 -39
  55. package/atoms/tag/tag.story.js +83 -2
  56. package/atoms/textarea/textarea.js +36 -34
  57. package/atoms/timeCodeInput/timCodeInput.story.js +10 -9
  58. package/atoms/timeCodeInput/timeCodeInput.js +108 -100
  59. package/atoms/timer/timer.js +127 -126
  60. package/atoms/toast/toast.js +24 -14
  61. package/atoms/toast/toast.story.js +22 -0
  62. package/atoms/videoCard/videoCard.js +226 -203
  63. package/atoms/videoCard/videoCard.story.js +547 -186
  64. package/components.js +69 -66
  65. package/index.js +5 -4
  66. package/molecules/carousel/carousel.js +55 -67
  67. package/molecules/filter/filter.js +133 -106
  68. package/molecules/filter/filter.story.js +215 -173
  69. package/molecules/graphCard/graphCard.js +34 -24
  70. package/molecules/graphCard/graphCard.story.js +169 -82
  71. package/molecules/graphDetailCard/graphDetailCard.js +207 -182
  72. package/molecules/pageHeader/pageHeader.js +3 -2
  73. package/molecules/pageHeader/pageHeader.story.js +40 -18
  74. package/molecules/pagination/pagination.js +66 -14
  75. package/molecules/pagination/pagination.story.js +24 -2
  76. package/molecules/table/table.js +368 -316
  77. package/molecules/table/table.story.js +404 -208
  78. package/molecules/tabs/tabs.js +15 -6
  79. package/molecules/tabs/tabs.story.js +26 -0
  80. package/package.json +2 -2
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
- value: true
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\tdisplay: flex;\n\tjustify-content: space-between;\n\n\t.timer-holder {\n text-align: center;\n margin-right: 20px;\n\t\t\n\t\t.time {\n\t\t\tfont-size: 40px;\n\t\t\tfont-family: SFUIText-Medium;\n\t\t\tline-height: 30px;\n\t\t\tmargin-bottom: 5px;\n\t\t\tmin-width: 55px;\n\t\t}\n\n\t\t.time-tag {\n\t\t\tfont-size: 10px;\n\t\t\tfont-family: SFUIText-Medium;\n\t\t\tcolor: #000;\n\t\t\tline-height: 10px;\n\t\t}\n\t}\n'], ['\n\tdisplay: flex;\n\tjustify-content: space-between;\n\n\t.timer-holder {\n text-align: center;\n margin-right: 20px;\n\t\t\n\t\t.time {\n\t\t\tfont-size: 40px;\n\t\t\tfont-family: SFUIText-Medium;\n\t\t\tline-height: 30px;\n\t\t\tmargin-bottom: 5px;\n\t\t\tmin-width: 55px;\n\t\t}\n\n\t\t.time-tag {\n\t\t\tfont-size: 10px;\n\t\t\tfont-family: SFUIText-Medium;\n\t\t\tcolor: #000;\n\t\t\tline-height: 10px;\n\t\t}\n\t}\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
- _inherits(Timer, _Component);
40
-
41
- function Timer(props) {
42
- _classCallCheck(this, Timer);
43
-
44
- var _this = _possibleConstructorReturn(this, (Timer.__proto__ || Object.getPrototypeOf(Timer)).call(this, props));
45
-
46
- _this.componentDidMount = function () {
47
- var timeObj = _this.getTimeLeft();
48
- _this.setState({
49
- time: {
50
- hours: timeObj.hours,
51
- minutes: timeObj.minutes,
52
- seconds: timeObj.seconds
53
- }
54
- }, function () {
55
- _this.startCountdown();
56
- });
57
- };
58
-
59
- _this.getTimeLeft = function () {
60
- var endTime = _this.props.endTime;
61
-
62
- var presentTime = new Date().getTime();
63
- var timeLeft = endTime - presentTime;
64
- var hours = Math.floor(timeLeft % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
65
- var minutes = Math.floor(timeLeft % (1000 * 60 * 60) / (1000 * 60));
66
- var seconds = Math.floor(timeLeft % (1000 * 60) / 1000);
67
- return {
68
- hours: hours,
69
- minutes: minutes,
70
- seconds: seconds
71
- };
72
- };
73
-
74
- _this.startCountdown = function () {
75
- if (!_this.countdownInterval) {
76
- var self = _this;
77
- _this.countdownInterval = setInterval(function () {
78
- var timeObj = self.getTimeLeft();
79
- self.setState({
80
- time: {
81
- hours: timeObj.hours,
82
- minutes: timeObj.minutes,
83
- seconds: timeObj.seconds
84
- }
85
- });
86
- }, 1000);
87
- }
88
- };
89
-
90
- _this.componentWillUnmount = function () {
91
- clearInterval(_this.countdownInterval);
92
- _this.countdownInterval = null;
93
- };
94
-
95
- _this.state = {
96
- time: {
97
- hours: 0,
98
- minutes: 0,
99
- seconds: 0
100
- }
101
- };
102
- _this.countdownInterval = null;
103
- return _this;
104
- }
105
-
106
- _createClass(Timer, [{
107
- key: 'render',
108
- value: function render() {
109
- var time = this.state.time;
110
-
111
- return _react2.default.createElement(
112
- TimerWrapper,
113
- null,
114
- _react2.default.createElement(
115
- 'span',
116
- { className: 'timer-holder' },
117
- _react2.default.createElement(
118
- 'p',
119
- { className: 'time' },
120
- time.hours > 9 ? time.hours : '0' + time.hours
121
- ),
122
- _react2.default.createElement(
123
- 'p',
124
- { className: 'time-tag' },
125
- 'Hr'
126
- )
127
- ),
128
- _react2.default.createElement(
129
- 'span',
130
- { className: 'timer-holder' },
131
- _react2.default.createElement(
132
- 'p',
133
- { className: 'time' },
134
- time.minutes > 9 ? time.minutes : '0' + time.minutes
135
- ),
136
- _react2.default.createElement(
137
- 'p',
138
- { className: 'time-tag' },
139
- 'Min'
140
- )
141
- ),
142
- _react2.default.createElement(
143
- 'span',
144
- { className: 'timer-holder' },
145
- _react2.default.createElement(
146
- 'p',
147
- { className: 'time' },
148
- time.seconds > 9 ? time.seconds : '0' + time.seconds
149
- ),
150
- _react2.default.createElement(
151
- 'p',
152
- { className: 'time-tag' },
153
- 'Sec'
154
- )
155
- )
156
- );
157
- }
158
- }]);
159
-
160
- return Timer;
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
- endTime: _propTypes2.default.number
165
+ endTime: _propTypes2.default.number
165
166
  };
166
167
 
167
168
  exports.default = Timer;
@@ -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; \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\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: #00cec6;\n background-image: linear-gradient(to right, #00c8e7, #00e6b9);\n color: #fff;\n }\n &.error {\n background: #00cec6;\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\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: #00cec6;\n background-image: linear-gradient(to right, #00c8e7, #00e6b9);\n color: #fff;\n }\n &.error {\n background: #00cec6;\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']);
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 = "none";
164
+ document.querySelector('.toast-box').style.display = 'none';
157
165
  },
158
- className: 'toast-box ' + type + ' ' + toastDirection, toastDirection: 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
- exports.default = Toast;
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.propTypes = propTypes;
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
  });