@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,14 +1,14 @@
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 _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8
8
 
9
9
  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; }; }();
10
10
 
11
- var _templateObject = _taggedTemplateLiteral(['\n display: inline-block;\n vertical-align: middle;\n line-height: 1;\n border-radius: ', ';\n'], ['\n display: inline-block;\n vertical-align: middle;\n line-height: 1;\n border-radius: ', ';\n']);
11
+ var _templateObject = _taggedTemplateLiteral(['\n display: inline-block;\n vertical-align: middle;\n line-height: 1;\n border-radius: ', ';\n'], ['\n display: inline-block;\n vertical-align: middle;\n line-height: 1;\n border-radius: ', ';\n']);
12
12
 
13
13
  var _react = require('react');
14
14
 
@@ -35,148 +35,161 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
35
35
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
36
36
 
37
37
  var BarGraph = function (_React$Component) {
38
- _inherits(BarGraph, _React$Component);
39
-
40
- function BarGraph(props) {
41
- _classCallCheck(this, BarGraph);
42
-
43
- var _this = _possibleConstructorReturn(this, (BarGraph.__proto__ || Object.getPrototypeOf(BarGraph)).call(this, props));
44
-
45
- _initialiseProps.call(_this);
46
-
47
- _this.getFilteredData = _this.getFilteredData.bind(_this);
48
-
49
- return _this;
38
+ _inherits(BarGraph, _React$Component);
39
+
40
+ function BarGraph(props) {
41
+ _classCallCheck(this, BarGraph);
42
+
43
+ var _this = _possibleConstructorReturn(this, (BarGraph.__proto__ || Object.getPrototypeOf(BarGraph)).call(this, props));
44
+
45
+ _initialiseProps.call(_this);
46
+
47
+ _this.getFilteredData = _this.getFilteredData.bind(_this);
48
+ return _this;
49
+ }
50
+
51
+ _createClass(BarGraph, [{
52
+ key: 'componentDidMount',
53
+ value: function componentDidMount() {}
54
+ }, {
55
+ key: 'render',
56
+ value: function render() {
57
+ var _this2 = this;
58
+
59
+ var data = this.props.data;
60
+ var filteredData = this.getFilteredData(data);
61
+ return _react2.default.createElement(
62
+ _react2.default.Fragment,
63
+ null,
64
+ _react2.default.createElement(
65
+ GraphSVG,
66
+ _extends({}, this.props, {
67
+ width: this.props.width,
68
+ height: this.props.height
69
+ // viewBox={`0 0 ${this.props.width} ${this.props.height}`}
70
+ , preserveAspectRatio: 'none'
71
+ }),
72
+ this.props.colorType === 'gradient' ? _react2.default.createElement('defs', null) : null,
73
+ _react2.default.createElement(
74
+ 'g',
75
+ {
76
+ transform: this.props.type === 'vertical' ? 'scale(1,-1) translate(0,-' + this.props.height + ')' : 'scale(1)'
77
+ },
78
+ filteredData.map(function (data, index) {
79
+ var item = filteredData[filteredData.length - index - 1];
80
+ var attrName = _this2.props.type === 'vertical' ? 'height' : 'width';
81
+
82
+ return _react2.default.createElement(
83
+ 'rect',
84
+ {
85
+ x: '0',
86
+ y: '0',
87
+ fill: _tokens.colors[_this2.props.theme].graph[item.value],
88
+ width: item.width,
89
+ height: item.height,
90
+ key: index
91
+ },
92
+ _react2.default.createElement('animate', {
93
+ attributeName: attrName,
94
+ from: '0',
95
+ to: item.percentLength + '%',
96
+ dur: '0.5s',
97
+ fill: 'freeze'
98
+ })
99
+ );
100
+ })
101
+ )
102
+ )
103
+ );
50
104
  }
105
+ }]);
51
106
 
52
- _createClass(BarGraph, [{
53
- key: 'componentDidMount',
54
- value: function componentDidMount() {}
55
- }, {
56
- key: 'render',
57
- value: function render() {
58
- var _this2 = this;
59
-
60
- var data = this.props.data;
61
- var filteredData = this.getFilteredData(data);
62
- return _react2.default.createElement(
63
- _react2.default.Fragment,
64
- null,
65
- _react2.default.createElement(
66
- GraphSVG,
67
- _extends({}, this.props, {
68
- width: this.props.width,
69
- height: this.props.height
70
- // viewBox={`0 0 ${this.props.width} ${this.props.height}`}
71
- , preserveAspectRatio: 'none'
72
- }),
73
- this.props.colorType === 'gradient' ? _react2.default.createElement('defs', null) : null,
74
- _react2.default.createElement(
75
- 'g',
76
- { transform: this.props.type === 'vertical' ? 'scale(1,-1) translate(0,-' + this.props.height + ')' : "scale(1)" },
77
- filteredData.map(function (data, index) {
78
- var item = filteredData[filteredData.length - index - 1];
79
- var attrName = _this2.props.type === 'vertical' ? 'height' : 'width';
80
-
81
- return _react2.default.createElement(
82
- 'rect',
83
- { x: '0', y: '0', fill: _tokens.colors[_this2.props.theme].graph[item.value], width: item.width, height: item.height, key: index },
84
- _react2.default.createElement('animate', { attributeName: attrName, from: '0', to: item.percentLength + '%', dur: '0.5s', fill: 'freeze' })
85
- );
86
- })
87
- )
88
- )
89
- );
90
- }
91
- }]);
92
-
93
- return BarGraph;
107
+ return BarGraph;
94
108
  }(_react2.default.Component);
95
109
 
96
110
  var _initialiseProps = function _initialiseProps() {
97
- var _this3 = this;
98
-
99
- this.getFilteredData = function (dataObj) {
100
-
101
- var props = _this3.props;
102
- var total_val = dataObj.total;
103
- var total_length = props.type === 'vertical' ? props.height : props.width;
104
- var valueObjs = dataObj.values;
105
- valueObjs.sort(function (a, b) {
106
- var keyA = a.index,
107
- keyB = b.index;
108
-
109
- if (keyA < keyB) return -1;
110
- if (keyA > keyB) return 1;
111
- return 0;
112
- });
113
- var filteredData = [];
114
- var length_sum = 0;
115
- var percentSum = 0;
116
- valueObjs.forEach(function (valueObj) {
117
- var value = valueObj.data;
118
- var percent2 = value / total_val * 100 + percentSum;
119
- var percent = value / total_val;
120
- var length = (typeof total_length === 'string' ? 100 : total_length) * percent + length_sum;
121
-
122
- var data = {};
123
- data.name = valueObj.name;
124
- data.value = valueObj.value;
125
- data.width = props.type === 'vertical' ? props.width : length;
126
- data.height = props.type === 'vertical' ? length : props.height;
127
- data.length = length;
128
- data.percentLength = percent2;
129
- data.index = valueObj.index;
130
- filteredData.push(data);
131
- length_sum = length;
132
- percentSum = percent2;
133
- });
134
-
135
- return filteredData;
136
- };
111
+ var _this3 = this;
112
+
113
+ this.getFilteredData = function (dataObj) {
114
+ var props = _this3.props;
115
+ var total_val = dataObj.total;
116
+ var total_length = props.type === 'vertical' ? props.height : props.width;
117
+ var valueObjs = dataObj.values;
118
+ valueObjs.sort(function (a, b) {
119
+ var keyA = a.index,
120
+ keyB = b.index;
121
+
122
+ if (keyA < keyB) return -1;
123
+ if (keyA > keyB) return 1;
124
+ return 0;
125
+ });
126
+ var filteredData = [];
127
+ var length_sum = 0;
128
+ var percentSum = 0;
129
+ valueObjs.forEach(function (valueObj) {
130
+ var value = valueObj.data;
131
+ var percent2 = value / total_val * 100 + percentSum;
132
+ var percent = value / total_val;
133
+ var length = (typeof total_length === 'string' ? 100 : total_length) * percent + length_sum;
134
+
135
+ var data = {};
136
+ data.name = valueObj.name;
137
+ data.value = valueObj.value;
138
+ data.width = props.type === 'vertical' ? props.width : length;
139
+ data.height = props.type === 'vertical' ? length : props.height;
140
+ data.length = length;
141
+ data.percentLength = percent2;
142
+ data.index = valueObj.index;
143
+ filteredData.push(data);
144
+ length_sum = length;
145
+ percentSum = percent2;
146
+ });
147
+
148
+ return filteredData;
149
+ };
137
150
  };
138
151
 
139
152
  var GraphSVG = _styledComponents2.default.svg(_templateObject, function (props) {
140
- return props.type === 'vertical' ? '0' : '5px';
153
+ return props.type === 'vertical' ? '0' : '5px';
141
154
  });
142
155
 
143
156
  BarGraph.propTypes = {
144
- /** Graph Data */
145
- data: _propTypes2.default.object.isRequired,
146
- /** Graph size */
147
- //width: PropTypes.number || PropTypes.string,
148
- height: _propTypes2.default.number,
149
- colorType: _propTypes2.default.oneOf(['gradient', 'normal']),
150
- type: _propTypes2.default.oneOf(['vertical', 'horizontal']),
151
- theme: _propTypes2.default.oneOf(['light', 'dark'])
157
+ /** Graph Data */
158
+ data: _propTypes2.default.object.isRequired,
159
+ /** Graph size */
160
+ //width: PropTypes.number || PropTypes.string,
161
+ height: _propTypes2.default.number,
162
+ colorType: _propTypes2.default.oneOf(['gradient', 'normal']),
163
+ type: _propTypes2.default.oneOf(['vertical', 'horizontal']),
164
+ theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc'])
152
165
  };
153
166
 
154
167
  BarGraph.defaultProps = {
155
- data: {
156
- "name": "Archieve",
157
- "total": 223,
158
- "values": [{
159
- "name": "Completed",
160
- "value": "completed",
161
- "data": 120,
162
- "index": 1
163
- }, {
164
- "name": "Rejected",
165
- "value": "rejected",
166
- "data": 33,
167
- "index": 2
168
- }, {
169
- "name": "Pending",
170
- "value": "pending",
171
- "data": 70,
172
- "index": 3
173
- }]
174
- },
175
- width: '100%',
176
- height: 400,
177
- colorType: 'normal',
178
- type: 'vertical',
179
- theme: 'light'
168
+ data: {
169
+ name: 'Archieve',
170
+ total: 223,
171
+ values: [{
172
+ name: 'Completed',
173
+ value: 'completed',
174
+ data: 120,
175
+ index: 1
176
+ }, {
177
+ name: 'Rejected',
178
+ value: 'rejected',
179
+ data: 33,
180
+ index: 2
181
+ }, {
182
+ name: 'Pending',
183
+ value: 'pending',
184
+ data: 70,
185
+ index: 3
186
+ }]
187
+ },
188
+ width: '100%',
189
+ height: 400,
190
+ colorType: 'normal',
191
+ type: 'vertical',
192
+ theme: 'light'
180
193
  };
181
194
 
182
195
  exports.default = BarGraph;
@@ -12,46 +12,80 @@ var _components = require('../../../../components');
12
12
 
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
 
15
- (0, _react3.storiesOf)('BarGraph').add('BarGraph', function () {
16
- return _react2.default.createElement(
17
- _storyHelpers.Example,
18
- { title: 'Appearances' },
19
- _react2.default.createElement(
20
- _storyHelpers.Stack,
21
- null,
22
- _react2.default.createElement(_components.BarGraph, { width: 50, height: 235, type: 'vertical' })
23
- ),
24
- _react2.default.createElement(
25
- _storyHelpers.Stack,
26
- null,
27
- _react2.default.createElement(_components.BarGraph, { width: '50%', height: 12, type: 'horizontal' })
28
- ),
29
- _react2.default.createElement(
30
- _storyHelpers.Stack,
31
- null,
32
- _react2.default.createElement(_components.BarGraph, { width: 360, height: 12, type: 'horizontal', colorType: 'gradient' })
33
- )
34
- );
15
+ (0, _react3.storiesOf)('BarGraph').add('light theme', function () {
16
+ return _react2.default.createElement(
17
+ _storyHelpers.Example,
18
+ { title: 'Appearances' },
19
+ _react2.default.createElement(
20
+ _storyHelpers.Stack,
21
+ null,
22
+ _react2.default.createElement(_components.BarGraph, { width: 50, height: 235, type: 'vertical' })
23
+ ),
24
+ _react2.default.createElement(
25
+ _storyHelpers.Stack,
26
+ null,
27
+ _react2.default.createElement(_components.BarGraph, { width: '50%', height: 12, type: 'horizontal' })
28
+ ),
29
+ _react2.default.createElement(
30
+ _storyHelpers.Stack,
31
+ null,
32
+ _react2.default.createElement(_components.BarGraph, { width: 360, height: 12, type: 'horizontal', colorType: 'gradient' })
33
+ )
34
+ );
35
35
  });
36
36
 
37
- (0, _react3.storiesOf)('BarGraph').add('BarGraph dark theme', function () {
38
- return _react2.default.createElement(
39
- _storyHelpers.Example,
40
- { title: 'Tag', background: 'dark' },
41
- _react2.default.createElement(
42
- _storyHelpers.Stack,
43
- null,
44
- _react2.default.createElement(_components.BarGraph, { theme: 'dark', width: 50, height: 235, type: 'vertical' })
45
- ),
46
- _react2.default.createElement(
47
- _storyHelpers.Stack,
48
- null,
49
- _react2.default.createElement(_components.BarGraph, { theme: 'dark', width: '100%', height: 12, type: 'horizontal' })
50
- ),
51
- _react2.default.createElement(
52
- _storyHelpers.Stack,
53
- null,
54
- _react2.default.createElement(_components.BarGraph, { theme: 'dark', width: '360', height: 12, type: 'horizontal', colorType: 'gradient' })
55
- )
56
- );
37
+ (0, _react3.storiesOf)('BarGraph').add('dark theme', function () {
38
+ return _react2.default.createElement(
39
+ _storyHelpers.Example,
40
+ { title: 'Tag', background: 'dark' },
41
+ _react2.default.createElement(
42
+ _storyHelpers.Stack,
43
+ null,
44
+ _react2.default.createElement(_components.BarGraph, { theme: 'dark', width: 50, height: 235, type: 'vertical' })
45
+ ),
46
+ _react2.default.createElement(
47
+ _storyHelpers.Stack,
48
+ null,
49
+ _react2.default.createElement(_components.BarGraph, { theme: 'dark', width: '100%', height: 12, type: 'horizontal' })
50
+ ),
51
+ _react2.default.createElement(
52
+ _storyHelpers.Stack,
53
+ null,
54
+ _react2.default.createElement(_components.BarGraph, {
55
+ theme: 'dark',
56
+ width: '360',
57
+ height: 12,
58
+ type: 'horizontal',
59
+ colorType: 'gradient'
60
+ })
61
+ )
62
+ );
63
+ });
64
+
65
+ (0, _react3.storiesOf)('BarGraph').add('nexc theme', function () {
66
+ return _react2.default.createElement(
67
+ _storyHelpers.Example,
68
+ { title: 'Tag', background: 'dark' },
69
+ _react2.default.createElement(
70
+ _storyHelpers.Stack,
71
+ null,
72
+ _react2.default.createElement(_components.BarGraph, { theme: 'nexc', width: 50, height: 235, type: 'vertical' })
73
+ ),
74
+ _react2.default.createElement(
75
+ _storyHelpers.Stack,
76
+ null,
77
+ _react2.default.createElement(_components.BarGraph, { theme: 'nexc', width: '100%', height: 12, type: 'horizontal' })
78
+ ),
79
+ _react2.default.createElement(
80
+ _storyHelpers.Stack,
81
+ null,
82
+ _react2.default.createElement(_components.BarGraph, {
83
+ theme: 'nexc',
84
+ width: '360',
85
+ height: 12,
86
+ type: 'horizontal',
87
+ colorType: 'gradient'
88
+ })
89
+ )
90
+ );
57
91
  });