@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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
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
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
};
|
|
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
|
-
|
|
153
|
+
return props.type === 'vertical' ? '0' : '5px';
|
|
141
154
|
});
|
|
142
155
|
|
|
143
156
|
BarGraph.propTypes = {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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('
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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('
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
});
|