@desynova-digital/components 8.19.63 → 9.0.0
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 +107 -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 +367 -315
- 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,37 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.StyledCheckboxOption = exports.StyledCheckbox = undefined;
|
|
7
7
|
|
|
8
|
-
var _templateObject = _taggedTemplateLiteral([
|
|
9
|
-
_templateObject2 = _taggedTemplateLiteral([
|
|
10
|
-
_templateObject3 = _taggedTemplateLiteral([
|
|
8
|
+
var _templateObject = _taggedTemplateLiteral([''], ['']),
|
|
9
|
+
_templateObject2 = _taggedTemplateLiteral(['\n position: relative;\n cursor: pointer;\n padding: ', ';\n ', ';\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n vertical-align: middle;\n pointer-events: ', ';\n input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n ', ' {\n opacity: ', ';\n font-family: \'SFUIText-Regular\';\n color: ', ';\n margin-left: 25px;\n }\n ', ' {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 22px;\n width: 22px;\n background-color: ', ';\n border: 1px solid\n ', ';\n box-shadow: inset 0 1px 2px 0\n ', ';\n border-radius: ', ';\n cursor: pointer;\n transition: all 250ms cubic-bezier(0.4, 0, 0.23, 1);\n }\n &:hover input ~ ', ' {\n box-shadow: inset 0 1px 4px 0 ', ';\n }\n input ~ ', ' {\n &.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n &:hover {\n background: ', ';\n color: ', ';\n }\n }\n }\n input:checked ~ ', ' {\n &.disabled {\n &:hover {\n background: ', ';\n }\n }\n }\n\n input:readonly ~ ', ', input:readonly:checked ~ ', ' {\n cursor: text;\n opacity: 5;\n }\n\n input:checked ~ ', ' {\n background-color: ', ';\n border: 1px solid ', ';\n opacity: ', ';\n }\n input:checked ~ ', ' {\n background-color: ', ';\n color: ', ';\n }\n ', ':after {\n content: \'\';\n position: absolute;\n display: none;\n }\n input:checked ~ ', ':after {\n display: block;\n }\n ', ':after {\n top: 55%;\n left: 35%;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent;\n transform: rotate(45deg) translate(-50%, -50%);\n animation: checkbox-check 125ms 250ms cubic-bezier(0.4, 0, 0.23, 1) forwards;\n }\n\n @keyframes checkbox-check {\n 0% {\n width: 0;\n height: 0;\n border-color: #fff;\n transform: translate3d(0, 0, 0) rotate(45deg);\n }\n 33% {\n width: 4px;\n height: 0;\n transform: translate3d(0, 0, 0) rotate(45deg);\n }\n 100% {\n width: 4px;\n height: 9px;\n border-color: #fff;\n transform: translate3d(0, -0.5em, 0) rotate(45deg);\n }\n }\n\n &.switch {\n display: flex;\n width: 100px;\n }\n'], ['\n position: relative;\n cursor: pointer;\n padding: ', ';\n ', ';\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n vertical-align: middle;\n pointer-events: ', ';\n input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n ', ' {\n opacity: ', ';\n font-family: \'SFUIText-Regular\';\n color: ', ';\n margin-left: 25px;\n }\n ', ' {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 22px;\n width: 22px;\n background-color: ', ';\n border: 1px solid\n ', ';\n box-shadow: inset 0 1px 2px 0\n ', ';\n border-radius: ', ';\n cursor: pointer;\n transition: all 250ms cubic-bezier(0.4, 0, 0.23, 1);\n }\n &:hover input ~ ', ' {\n box-shadow: inset 0 1px 4px 0 ', ';\n }\n input ~ ', ' {\n &.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n &:hover {\n background: ', ';\n color: ', ';\n }\n }\n }\n input:checked ~ ', ' {\n &.disabled {\n &:hover {\n background: ', ';\n }\n }\n }\n\n input:readonly ~ ', ', input:readonly:checked ~ ', ' {\n cursor: text;\n opacity: 5;\n }\n\n input:checked ~ ', ' {\n background-color: ', ';\n border: 1px solid ', ';\n opacity: ', ';\n }\n input:checked ~ ', ' {\n background-color: ', ';\n color: ', ';\n }\n ', ':after {\n content: \'\';\n position: absolute;\n display: none;\n }\n input:checked ~ ', ':after {\n display: block;\n }\n ', ':after {\n top: 55%;\n left: 35%;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent;\n transform: rotate(45deg) translate(-50%, -50%);\n animation: checkbox-check 125ms 250ms cubic-bezier(0.4, 0, 0.23, 1) forwards;\n }\n\n @keyframes checkbox-check {\n 0% {\n width: 0;\n height: 0;\n border-color: #fff;\n transform: translate3d(0, 0, 0) rotate(45deg);\n }\n 33% {\n width: 4px;\n height: 0;\n transform: translate3d(0, 0, 0) rotate(45deg);\n }\n 100% {\n width: 4px;\n height: 9px;\n border-color: #fff;\n transform: translate3d(0, -0.5em, 0) rotate(45deg);\n }\n }\n\n &.switch {\n display: flex;\n width: 100px;\n }\n']),
|
|
10
|
+
_templateObject3 = _taggedTemplateLiteral(['\n ', ' {\n display: ', ';\n ', ';\n &:last-child {\n margin: 0;\n }\n }\n'], ['\n ', ' {\n display: ', ';\n ', ';\n &:last-child {\n margin: 0;\n }\n }\n']);
|
|
11
11
|
|
|
12
|
-
var _react = require(
|
|
12
|
+
var _react = require('react');
|
|
13
13
|
|
|
14
14
|
var _react2 = _interopRequireDefault(_react);
|
|
15
15
|
|
|
16
|
-
var _propTypes = require(
|
|
16
|
+
var _propTypes = require('prop-types');
|
|
17
17
|
|
|
18
18
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
19
19
|
|
|
20
|
-
var _styledComponents = require(
|
|
20
|
+
var _styledComponents = require('styled-components');
|
|
21
21
|
|
|
22
22
|
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
23
23
|
|
|
24
|
-
var _tokens = require(
|
|
24
|
+
var _tokens = require('@desynova-digital/tokens');
|
|
25
25
|
|
|
26
|
-
var _tag = require(
|
|
26
|
+
var _tag = require('../tag');
|
|
27
27
|
|
|
28
28
|
var _tag2 = _interopRequireDefault(_tag);
|
|
29
29
|
|
|
30
|
-
var _switch = require(
|
|
30
|
+
var _switch = require('../switch');
|
|
31
31
|
|
|
32
32
|
var _switch2 = _interopRequireDefault(_switch);
|
|
33
33
|
|
|
34
|
-
var _icon = require(
|
|
34
|
+
var _icon = require('../icon');
|
|
35
35
|
|
|
36
36
|
var _icon2 = _interopRequireDefault(_icon);
|
|
37
37
|
|
|
@@ -47,21 +47,22 @@ var StyledTag = (0, _styledComponents2.default)(_tag2.default)(_templateObject);
|
|
|
47
47
|
var StyledCheckboxOption = _styledComponents2.default.label(_templateObject2, function (props) {
|
|
48
48
|
return props.seperationType === 'line' ? '15px' : '5px';
|
|
49
49
|
}, function (props) {
|
|
50
|
-
return props.seperationType === 'line' &&
|
|
50
|
+
return props.seperationType === 'line' && '\n width: 100%;\n border-bottom: 1px solid #303F51;\n ';
|
|
51
51
|
}, function (props) {
|
|
52
|
-
return props.readOnly ?
|
|
52
|
+
return props.readOnly ? 'none' : null;
|
|
53
53
|
}, Label, function (props) {
|
|
54
54
|
return props.readOnly ? 0.5 : null;
|
|
55
55
|
}, function (props) {
|
|
56
56
|
return _tokens.colors[props.theme].radio.color;
|
|
57
57
|
}, CheckMark, function (props) {
|
|
58
|
+
// return "red"
|
|
58
59
|
return props.readOnly && props.checked ? _tokens.colors[props.theme].radio.backgroundDisabled : _tokens.colors[props.theme].radio.background;
|
|
59
60
|
}, function (props) {
|
|
60
61
|
return props.readOnly ? _tokens.colors[props.theme].radio.borderDisabled : _tokens.colors[props.theme].radio.border;
|
|
61
62
|
}, function (props) {
|
|
62
63
|
return props.readOnly ? _tokens.colors[props.theme].radio.shadowDisabled : _tokens.colors[props.theme].radio.shadow;
|
|
63
64
|
}, function (props) {
|
|
64
|
-
return props.shape === 'square' ?
|
|
65
|
+
return props.shape === 'square' ? '3px' : '100%';
|
|
65
66
|
}, CheckMark, function (props) {
|
|
66
67
|
return _tokens.colors[props.theme].radio.shadow;
|
|
67
68
|
}, StyledTag, function (props) {
|
|
@@ -83,12 +84,12 @@ var StyledCheckboxOption = _styledComponents2.default.label(_templateObject2, fu
|
|
|
83
84
|
}, CheckMark, CheckMark, CheckMark);
|
|
84
85
|
|
|
85
86
|
var justifyContent = {
|
|
86
|
-
horizontal:
|
|
87
|
-
vertical:
|
|
87
|
+
horizontal: 'margin-right: 5px;',
|
|
88
|
+
vertical: 'margin-bottom: 5px;'
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
var StyledCheckbox = _styledComponents2.default.div(_templateObject3, StyledCheckboxOption, function (props) {
|
|
91
|
-
return props.align ===
|
|
92
|
+
return props.align === 'horizontal' ? 'inline-block' : 'table';
|
|
92
93
|
}, function (props) {
|
|
93
94
|
return justifyContent[props.align];
|
|
94
95
|
});
|
|
@@ -103,8 +104,8 @@ var Checkbox = function Checkbox(props) {
|
|
|
103
104
|
shape: props.shape,
|
|
104
105
|
seperationType: props.seperationType
|
|
105
106
|
},
|
|
106
|
-
_react2.default.createElement(
|
|
107
|
-
type:
|
|
107
|
+
_react2.default.createElement('input', {
|
|
108
|
+
type: 'checkbox',
|
|
108
109
|
name: props.name,
|
|
109
110
|
value: props.value,
|
|
110
111
|
checked: props.checked,
|
|
@@ -117,16 +118,16 @@ var Checkbox = function Checkbox(props) {
|
|
|
117
118
|
readOnly: props.readOnly,
|
|
118
119
|
disabled: props.isDisabled ? true : false
|
|
119
120
|
}),
|
|
120
|
-
props.type ===
|
|
121
|
+
props.type === 'label' ? _react2.default.createElement(
|
|
121
122
|
StyledTag,
|
|
122
123
|
{
|
|
123
124
|
theme: props.theme,
|
|
124
125
|
selected: props.defaultChecked,
|
|
125
|
-
className: props.isDisabled && props.access !== 'read' ?
|
|
126
|
+
className: props.isDisabled && props.access !== 'read' ? 'disabled' : ''
|
|
126
127
|
},
|
|
127
128
|
props.children
|
|
128
129
|
) : null,
|
|
129
|
-
props.type ===
|
|
130
|
+
props.type === 'default' ? _react2.default.createElement(
|
|
130
131
|
_react2.default.Fragment,
|
|
131
132
|
null,
|
|
132
133
|
_react2.default.createElement(CheckMark, null),
|
|
@@ -136,7 +137,7 @@ var Checkbox = function Checkbox(props) {
|
|
|
136
137
|
props.children
|
|
137
138
|
)
|
|
138
139
|
) : null,
|
|
139
|
-
props.type ===
|
|
140
|
+
props.type === 'switch' ? _react2.default.createElement(
|
|
140
141
|
_react2.default.Fragment,
|
|
141
142
|
null,
|
|
142
143
|
_react2.default.createElement(
|
|
@@ -156,7 +157,9 @@ var Checkbox = function Checkbox(props) {
|
|
|
156
157
|
name: props.value,
|
|
157
158
|
value: props.value,
|
|
158
159
|
fillRule: props.fillRule,
|
|
159
|
-
color: props.checked ?
|
|
160
|
+
color: props.checked ? _tokens.colors[props.theme].radio.backgroundSelected : '#AFB2BA'
|
|
161
|
+
// color={props.checked ? (props.theme=="nexc" ? "#60BEF8" : "#00CEC6") : "#AFB2BA"}
|
|
162
|
+
})
|
|
160
163
|
);
|
|
161
164
|
};
|
|
162
165
|
|
|
@@ -185,7 +188,7 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
185
188
|
|
|
186
189
|
Checkbox.propTypes = {
|
|
187
190
|
/** The direction in which the options should be laid out */
|
|
188
|
-
align: _propTypes2.default.oneOf([
|
|
191
|
+
align: _propTypes2.default.oneOf(['horizontal', 'vertical']),
|
|
189
192
|
/** The name of the checkbox */
|
|
190
193
|
name: _propTypes2.default.string,
|
|
191
194
|
/** The value of the currently-selected option */
|
|
@@ -194,20 +197,26 @@ Checkbox.propTypes = {
|
|
|
194
197
|
readOnly: _propTypes2.default.bool,
|
|
195
198
|
/** Callback function which is called when the user selects an option */
|
|
196
199
|
onChange: _propTypes2.default.func,
|
|
197
|
-
type: _propTypes2.default.oneOf([
|
|
200
|
+
type: _propTypes2.default.oneOf(['default', 'label', 'switch']),
|
|
198
201
|
fillRule: _propTypes2.default.string,
|
|
199
|
-
access: _propTypes2.default.string
|
|
202
|
+
access: _propTypes2.default.string,
|
|
203
|
+
theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc'])
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
CheckboxGroup.propTypes = {
|
|
207
|
+
theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc'])
|
|
200
208
|
};
|
|
201
209
|
|
|
202
210
|
Checkbox.defaultProps = {
|
|
203
|
-
align:
|
|
204
|
-
type:
|
|
211
|
+
align: 'vertical',
|
|
212
|
+
type: 'default',
|
|
213
|
+
theme: 'light'
|
|
205
214
|
};
|
|
206
215
|
|
|
207
216
|
CheckboxGroup.defaultProps = {
|
|
208
|
-
theme:
|
|
209
|
-
shape: _propTypes2.default.oneOf([
|
|
210
|
-
seperationType: _propTypes2.default.oneOf([
|
|
217
|
+
theme: 'light',
|
|
218
|
+
shape: _propTypes2.default.oneOf(['square', 'default']),
|
|
219
|
+
seperationType: _propTypes2.default.oneOf(['line', 'default'])
|
|
211
220
|
};
|
|
212
221
|
|
|
213
222
|
Checkbox.Group = CheckboxGroup;
|