@dxc-technology/halstack-react 0.0.0-3fa9e5c → 0.0.0-422fa7b
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/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +181 -114
- package/dist/accordion/Accordion.js +131 -46
- package/dist/accordion-group/AccordionGroup.js +34 -4
- package/dist/alert/Alert.js +180 -80
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +28 -7
- package/dist/box/Box.js +29 -18
- package/dist/button/Button.js +60 -21
- package/dist/card/Card.js +72 -35
- package/dist/checkbox/Checkbox.js +97 -26
- package/dist/chip/Chip.js +92 -32
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1352 -185
- package/dist/date/Date.js +65 -38
- package/dist/dialog/Dialog.js +54 -31
- package/dist/dropdown/Dropdown.js +173 -75
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +73 -44
- package/dist/footer/dxc_logo.svg +15 -0
- package/dist/header/Header.js +91 -56
- package/dist/header/dxc_logo_black.svg +8 -0
- package/dist/heading/Heading.js +81 -16
- package/dist/input-text/InputText.js +245 -99
- package/dist/layout/ApplicationLayout.js +11 -10
- package/dist/link/Link.js +84 -34
- package/dist/main.d.ts +8 -0
- package/dist/main.js +65 -1
- package/dist/new-date/NewDate.js +400 -0
- package/dist/new-date/index.d.ts +95 -0
- package/dist/new-input-text/NewInputText.js +967 -0
- package/dist/new-input-text/index.d.ts +135 -0
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/new-textarea/NewTextarea.js +365 -0
- package/dist/new-textarea/index.d.ts +117 -0
- package/dist/number/Number.js +136 -0
- package/dist/number/NumberContext.js +16 -0
- package/dist/number/index.d.ts +113 -0
- package/dist/paginator/Paginator.js +60 -18
- package/dist/password/Password.js +200 -0
- package/dist/password/index.d.ts +94 -0
- package/dist/password/styles.css +3 -0
- package/dist/progress-bar/ProgressBar.js +91 -33
- package/dist/radio/Radio.js +30 -11
- package/dist/resultsetTable/ResultsetTable.js +76 -44
- package/dist/select/Select.js +221 -147
- package/dist/sidenav/Sidenav.js +64 -8
- package/dist/slider/Slider.js +117 -55
- package/dist/spinner/Spinner.js +247 -56
- package/dist/switch/Switch.js +51 -19
- package/dist/table/Table.js +47 -5
- package/dist/tabs/Tabs.js +50 -14
- package/dist/tag/Tag.js +68 -35
- package/dist/textarea/Textarea.js +77 -33
- package/dist/toggle/Toggle.js +3 -3
- package/dist/toggle-group/ToggleGroup.js +53 -39
- package/dist/upload/Upload.js +13 -8
- package/dist/upload/buttons-upload/ButtonsUpload.js +28 -8
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +70 -19
- package/dist/upload/file-upload/FileToUpload.js +46 -16
- package/dist/upload/files-upload/FilesToUpload.js +9 -6
- package/dist/upload/transaction/Transaction.js +41 -18
- package/dist/upload/transactions/Transactions.js +32 -10
- package/dist/wizard/Wizard.js +126 -40
- package/dist/wizard/invalid_icon.svg +4 -5
- package/dist/wizard/valid_icon.svg +4 -5
- package/package.json +6 -4
- package/test/AccordionGroup.test.js +16 -0
- package/test/Date.test.js +13 -13
- package/test/Dropdown.test.js +15 -0
- package/test/FileInput.test.js +201 -0
- package/test/Link.test.js +3 -2
- package/test/NewDate.test.js +232 -0
- package/test/NewInputText.test.js +734 -0
- package/test/NewTextarea.test.js +195 -0
- package/test/Number.test.js +257 -0
- package/test/Paginator.test.js +1 -1
- package/test/Password.test.js +83 -0
- package/test/ResultsetTable.test.js +1 -2
- package/test/Select.test.js +44 -24
- package/test/Spinner.test.js +5 -0
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/toggle-group/readme.md +0 -82
package/dist/wizard/Wizard.js
CHANGED
|
@@ -17,7 +17,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
17
17
|
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
19
|
|
|
20
|
-
var _react =
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
@@ -31,9 +31,19 @@ var _valid_icon = _interopRequireDefault(require("./valid_icon.svg"));
|
|
|
31
31
|
|
|
32
32
|
var _invalid_icon = _interopRequireDefault(require("./invalid_icon.svg"));
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function _templateObject14() {
|
|
35
35
|
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"]);
|
|
36
36
|
|
|
37
|
+
_templateObject14 = function _templateObject14() {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _templateObject13() {
|
|
45
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n ", ";\n margin: 0;\n"]);
|
|
46
|
+
|
|
37
47
|
_templateObject13 = function _templateObject13() {
|
|
38
48
|
return data;
|
|
39
49
|
};
|
|
@@ -42,7 +52,7 @@ function _templateObject13() {
|
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
function _templateObject12() {
|
|
45
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-align:
|
|
55
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n ", ";\n text-transform: ", ";\n margin: 0;\n"]);
|
|
46
56
|
|
|
47
57
|
_templateObject12 = function _templateObject12() {
|
|
48
58
|
return data;
|
|
@@ -52,7 +62,7 @@ function _templateObject12() {
|
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
function _templateObject11() {
|
|
55
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
65
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"]);
|
|
56
66
|
|
|
57
67
|
_templateObject11 = function _templateObject11() {
|
|
58
68
|
return data;
|
|
@@ -62,7 +72,7 @@ function _templateObject11() {
|
|
|
62
72
|
}
|
|
63
73
|
|
|
64
74
|
function _templateObject10() {
|
|
65
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
75
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"]);
|
|
66
76
|
|
|
67
77
|
_templateObject10 = function _templateObject10() {
|
|
68
78
|
return data;
|
|
@@ -72,7 +82,7 @@ function _templateObject10() {
|
|
|
72
82
|
}
|
|
73
83
|
|
|
74
84
|
function _templateObject9() {
|
|
75
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
85
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"]);
|
|
76
86
|
|
|
77
87
|
_templateObject9 = function _templateObject9() {
|
|
78
88
|
return data;
|
|
@@ -82,7 +92,7 @@ function _templateObject9() {
|
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
function _templateObject8() {
|
|
85
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
95
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n mask: url(", ") no-repeat center;\n mask-size: ", ";\n height: ", ";\n width: ", ";\n"]);
|
|
86
96
|
|
|
87
97
|
_templateObject8 = function _templateObject8() {
|
|
88
98
|
return data;
|
|
@@ -92,7 +102,7 @@ function _templateObject8() {
|
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
function _templateObject7() {
|
|
95
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width:
|
|
105
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
96
106
|
|
|
97
107
|
_templateObject7 = function _templateObject7() {
|
|
98
108
|
return data;
|
|
@@ -102,7 +112,7 @@ function _templateObject7() {
|
|
|
102
112
|
}
|
|
103
113
|
|
|
104
114
|
function _templateObject6() {
|
|
105
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width:
|
|
115
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"]);
|
|
106
116
|
|
|
107
117
|
_templateObject6 = function _templateObject6() {
|
|
108
118
|
return data;
|
|
@@ -112,7 +122,7 @@ function _templateObject6() {
|
|
|
112
122
|
}
|
|
113
123
|
|
|
114
124
|
function _templateObject5() {
|
|
115
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n\n border-radius:
|
|
125
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n"]);
|
|
116
126
|
|
|
117
127
|
_templateObject5 = function _templateObject5() {
|
|
118
128
|
return data;
|
|
@@ -122,7 +132,7 @@ function _templateObject5() {
|
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
function _templateObject4() {
|
|
125
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom:
|
|
135
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom: 4px;\n"]);
|
|
126
136
|
|
|
127
137
|
_templateObject4 = function _templateObject4() {
|
|
128
138
|
return data;
|
|
@@ -132,7 +142,7 @@ function _templateObject4() {
|
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
function _templateObject3() {
|
|
135
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n border: none;\n background: inherit;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:
|
|
145
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n border: none;\n background: inherit;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:hover {\n ", ";\n }\n &:focus {\n outline: ", " auto 1px;\n }\n"]);
|
|
136
146
|
|
|
137
147
|
_templateObject3 = function _templateObject3() {
|
|
138
148
|
return data;
|
|
@@ -152,7 +162,7 @@ function _templateObject2() {
|
|
|
152
162
|
}
|
|
153
163
|
|
|
154
164
|
function _templateObject() {
|
|
155
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n justify-content: \"center\";\n ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
165
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n justify-content: \"center\";\n ", ";\n font-family: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
156
166
|
|
|
157
167
|
_templateObject = function _templateObject() {
|
|
158
168
|
return data;
|
|
@@ -167,12 +177,14 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
167
177
|
currentStep = _ref.currentStep,
|
|
168
178
|
onStepClick = _ref.onStepClick,
|
|
169
179
|
steps = _ref.steps,
|
|
170
|
-
margin = _ref.margin
|
|
180
|
+
margin = _ref.margin,
|
|
181
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
182
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
171
183
|
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
innerCurrent =
|
|
175
|
-
setInnerCurrentStep =
|
|
184
|
+
var _useState = (0, _react.useState)(currentStep || 0),
|
|
185
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
186
|
+
innerCurrent = _useState2[0],
|
|
187
|
+
setInnerCurrentStep = _useState2[1];
|
|
176
188
|
|
|
177
189
|
var renderedCurrent = currentStep == null ? innerCurrent : currentStep;
|
|
178
190
|
var colorsTheme = (0, _useTheme["default"])();
|
|
@@ -188,7 +200,7 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
188
200
|
};
|
|
189
201
|
|
|
190
202
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
191
|
-
theme: colorsTheme
|
|
203
|
+
theme: colorsTheme.wizard
|
|
192
204
|
}, _react["default"].createElement(StepsContainer, {
|
|
193
205
|
mode: mode,
|
|
194
206
|
margin: margin
|
|
@@ -198,6 +210,7 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
198
210
|
mode: mode,
|
|
199
211
|
lastStep: i === steps.length - 1
|
|
200
212
|
}, _react["default"].createElement(Step, {
|
|
213
|
+
tabIndex: tabIndex,
|
|
201
214
|
onClick: function onClick() {
|
|
202
215
|
return handleStepClick(i);
|
|
203
216
|
},
|
|
@@ -211,7 +224,10 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
211
224
|
disabled: step.disabled
|
|
212
225
|
}, step.icon ? _react["default"].createElement(StepIconContainer, {
|
|
213
226
|
disabled: step.disabled
|
|
214
|
-
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon
|
|
227
|
+
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon.type === "img" ? _react["default"].createElement(ImgContainer, {
|
|
228
|
+
current: i === renderedCurrent,
|
|
229
|
+
img: step.icon.props.src
|
|
230
|
+
}) : step.icon : _react["default"].createElement(step.icon)) : step.iconSrc ? _react["default"].createElement(Icon, {
|
|
215
231
|
src: step.iconSrc
|
|
216
232
|
}) : _react["default"].createElement(Number, {
|
|
217
233
|
disabled: step.disabled,
|
|
@@ -220,9 +236,13 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
220
236
|
src: _valid_icon["default"]
|
|
221
237
|
}) : _react["default"].createElement(ValidityIcon, {
|
|
222
238
|
src: _invalid_icon["default"]
|
|
223
|
-
}) : ""), step.label || step.description ? _react["default"].createElement(InfoContainer, {
|
|
224
|
-
|
|
225
|
-
|
|
239
|
+
}) : ""), step.label || step.description ? _react["default"].createElement(InfoContainer, null, step.label ? _react["default"].createElement(Label, {
|
|
240
|
+
disabled: step.disabled,
|
|
241
|
+
visited: i <= innerCurrent
|
|
242
|
+
}, step.label) : "", step.description ? _react["default"].createElement(Description, {
|
|
243
|
+
disabled: step.disabled,
|
|
244
|
+
visited: i <= innerCurrent
|
|
245
|
+
}, step.description) : "") : ""), i === steps.length - 1 ? "" : _react["default"].createElement(StepSeparator, {
|
|
226
246
|
mode: mode
|
|
227
247
|
}));
|
|
228
248
|
})));
|
|
@@ -232,6 +252,8 @@ var StepsContainer = _styledComponents["default"].div(_templateObject(), functio
|
|
|
232
252
|
return props.mode === "vertical" ? "column" : "row";
|
|
233
253
|
}, function (props) {
|
|
234
254
|
return props.mode === "vertical" ? "height: 500px" : "width: 100%";
|
|
255
|
+
}, function (props) {
|
|
256
|
+
return props.theme.fontFamily;
|
|
235
257
|
}, function (props) {
|
|
236
258
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
237
259
|
}, function (props) {
|
|
@@ -255,51 +277,114 @@ var StepContainer = _styledComponents["default"].div(_templateObject2(), functio
|
|
|
255
277
|
});
|
|
256
278
|
|
|
257
279
|
var Step = _styledComponents["default"].button(_templateObject3(), function (props) {
|
|
258
|
-
return props.first ? props.mode === "vertical" ? "0 0
|
|
280
|
+
return props.first ? props.mode === "vertical" ? "0 0 24px 0" : "0 24px 0 0" : props.last ? props.mode === "vertical" ? "24px 0 0 0" : "0 0 0 24px" : props.mode === "vertical" ? "24px 0" : "0 24px";
|
|
259
281
|
}, function (props) {
|
|
260
282
|
return props.disabled ? "cursor: not-allowed" : "";
|
|
261
283
|
}, function (props) {
|
|
262
284
|
return props.disabled ? "" : "cursor: pointer";
|
|
285
|
+
}, function (props) {
|
|
286
|
+
return props.theme.focusColor;
|
|
263
287
|
});
|
|
264
288
|
|
|
265
289
|
var StepHeader = _styledComponents["default"].div(_templateObject4());
|
|
266
290
|
|
|
267
291
|
var IconContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
268
|
-
return
|
|
292
|
+
return props.disabled ? props.theme.disabledCircleWidth : props.current ? props.theme.selectedCircleWidth : props.theme.circleWidth;
|
|
293
|
+
}, function (props) {
|
|
294
|
+
return props.disabled ? props.theme.disabledCircleHeight : props.current ? props.theme.selectedCircleHeight : props.theme.circleHeight;
|
|
269
295
|
}, function (props) {
|
|
270
|
-
return !props.current && !props.disabled ? "
|
|
296
|
+
return "\n ".concat(!props.current && !props.disabled ? "border: ".concat(props.theme.circleBorderThickness, " ").concat(props.theme.circleBorderStyle, " ").concat(props.theme.circleBorderColor, ";") : props.current ? "border: ".concat(props.theme.selectedCircleBorderThickness, " ").concat(props.theme.selectedCircleBorderStyle, " ").concat(props.theme.selectedCircleBorderColor, ";") : props.disabled ? "border: ".concat(props.theme.disabledCircleBorderThickness, " ").concat(props.theme.disabledCircleBorderStyle, " ").concat(props.theme.disabledCircleBorderColor, ";") : "", "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledBackgroundColor) : props.current ? "".concat(props.theme.stepContainerSelectedBackgroundColor) : "".concat(props.theme.stepContainerBackgroundColor), ";\n ");
|
|
271
297
|
}, function (props) {
|
|
272
|
-
return
|
|
298
|
+
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor, ";");
|
|
299
|
+
}, function (props) {
|
|
300
|
+
return !props.current && !props.disabled ? props.theme.circleBorderRadius : props.current ? props.theme.selectedCircleBorderRadius : props.disabled ? props.theme.disabledCircleBorderRadius : "";
|
|
273
301
|
});
|
|
274
302
|
|
|
275
|
-
var Icon = _styledComponents["default"].img(_templateObject6())
|
|
303
|
+
var Icon = _styledComponents["default"].img(_templateObject6(), function (props) {
|
|
304
|
+
return props.theme.stepContainerIconSize;
|
|
305
|
+
}, function (props) {
|
|
306
|
+
return props.theme.stepContainerIconSize;
|
|
307
|
+
});
|
|
276
308
|
|
|
277
309
|
var StepIconContainer = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
278
|
-
return props.
|
|
310
|
+
return props.theme.stepContainerIconSize;
|
|
311
|
+
}, function (props) {
|
|
312
|
+
return props.theme.stepContainerIconSize;
|
|
279
313
|
});
|
|
280
314
|
|
|
281
|
-
var
|
|
282
|
-
return props.
|
|
315
|
+
var ImgContainer = _styledComponents["default"].div(_templateObject8(), function (props) {
|
|
316
|
+
return props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor;
|
|
317
|
+
}, function (_ref2) {
|
|
318
|
+
var img = _ref2.img;
|
|
319
|
+
return img;
|
|
320
|
+
}, function (props) {
|
|
321
|
+
return "".concat(props.theme.stepContainerIconSize, " ").concat(props.theme.stepContainerIconSize);
|
|
322
|
+
}, function (props) {
|
|
323
|
+
return props.theme.stepContainerIconSize;
|
|
324
|
+
}, function (props) {
|
|
325
|
+
return props.theme.stepContainerIconSize;
|
|
283
326
|
});
|
|
284
327
|
|
|
285
|
-
var
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return props.
|
|
328
|
+
var Number = _styledComponents["default"].p(_templateObject9(), function (props) {
|
|
329
|
+
return props.theme.stepContainerFontSize;
|
|
330
|
+
}, function (props) {
|
|
331
|
+
return props.theme.stepContainerFontFamily;
|
|
332
|
+
}, function (props) {
|
|
333
|
+
return props.theme.stepContainerFontStyle;
|
|
334
|
+
}, function (props) {
|
|
335
|
+
return props.theme.stepContainerFontWeight;
|
|
336
|
+
}, function (props) {
|
|
337
|
+
return props.theme.stepContainerLetterSpacing;
|
|
289
338
|
});
|
|
290
339
|
|
|
291
|
-
var
|
|
340
|
+
var ValidityIcon = _styledComponents["default"].img(_templateObject10());
|
|
341
|
+
|
|
342
|
+
var InfoContainer = _styledComponents["default"].div(_templateObject11());
|
|
343
|
+
|
|
344
|
+
var Label = _styledComponents["default"].p(_templateObject12(), function (props) {
|
|
345
|
+
return props.theme.labelTextAlign;
|
|
346
|
+
}, function (props) {
|
|
347
|
+
return props.theme.labelFontFamily;
|
|
348
|
+
}, function (props) {
|
|
349
|
+
return props.theme.labelFontSize;
|
|
350
|
+
}, function (props) {
|
|
351
|
+
return props.theme.labelFontStyle;
|
|
352
|
+
}, function (props) {
|
|
353
|
+
return props.theme.labelFontWeight;
|
|
354
|
+
}, function (props) {
|
|
355
|
+
return props.theme.labelLetterSpacing;
|
|
356
|
+
}, function (props) {
|
|
357
|
+
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedLabelFontColor : props.theme.labelFontColor, ";");
|
|
358
|
+
}, function (props) {
|
|
359
|
+
return props.theme.labelFontTextTransform;
|
|
360
|
+
});
|
|
292
361
|
|
|
293
|
-
var Description = _styledComponents["default"].p(
|
|
362
|
+
var Description = _styledComponents["default"].p(_templateObject13(), function (props) {
|
|
363
|
+
return props.theme.descriptionTextAlign;
|
|
364
|
+
}, function (props) {
|
|
365
|
+
return props.theme.descriptionFontFamily;
|
|
366
|
+
}, function (props) {
|
|
367
|
+
return props.theme.descriptionFontSize;
|
|
368
|
+
}, function (props) {
|
|
369
|
+
return props.theme.descriptionFontStyle;
|
|
370
|
+
}, function (props) {
|
|
371
|
+
return props.theme.descriptionFontWeight;
|
|
372
|
+
}, function (props) {
|
|
373
|
+
return props.theme.descriptionLetterSpacing;
|
|
374
|
+
}, function (props) {
|
|
375
|
+
return props.theme.descriptionFontTextTransform;
|
|
376
|
+
}, function (props) {
|
|
377
|
+
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
|
|
378
|
+
});
|
|
294
379
|
|
|
295
|
-
var StepSeparator = _styledComponents["default"].div(
|
|
380
|
+
var StepSeparator = _styledComponents["default"].div(_templateObject14(), function (props) {
|
|
296
381
|
return props.mode === "horizontal" ? "" : "0";
|
|
297
382
|
}, function (props) {
|
|
298
383
|
return props.mode === "horizontal" ? "0" : "";
|
|
299
384
|
}, function (props) {
|
|
300
385
|
return props.mode === "vertical" ? "margin: 0 18px;" : "";
|
|
301
386
|
}, function (props) {
|
|
302
|
-
return "
|
|
387
|
+
return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
|
|
303
388
|
});
|
|
304
389
|
|
|
305
390
|
DxcWizard.propTypes = {
|
|
@@ -319,7 +404,8 @@ DxcWizard.propTypes = {
|
|
|
319
404
|
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
320
405
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
321
406
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
322
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
407
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
408
|
+
tabIndex: _propTypes["default"].number
|
|
323
409
|
};
|
|
324
410
|
var _default = DxcWizard;
|
|
325
411
|
exports["default"] = _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</g>
|
|
1
|
+
<svg id="highlight_off_black_18dp" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
|
|
2
|
+
<path id="Path_2943" data-name="Path 2943" d="M0,0H18V18H0Z" fill="none"/>
|
|
3
|
+
<path id="Path_2944" data-name="Path 2944" d="M10,4a6,6,0,1,0,6,6A6.01,6.01,0,0,0,10,4Zm3,7.945L11.945,13,10,11.06,8.059,13,7,11.945,8.944,10,7,8.059,8.059,7,10,8.944,11.945,7,13,8.059,11.06,10Z" transform="translate(-1.002 -1.002)" fill="#ffe6e9"/>
|
|
4
|
+
<path id="Path_2945" data-name="Path 2945" d="M11.444,6.5,9.5,8.443,7.558,6.5,6.5,7.558,8.443,9.5,6.5,11.444,7.558,12.5,9.5,10.558,11.444,12.5,12.5,11.444,10.558,9.5,12.5,7.558ZM9.5,2A7.5,7.5,0,1,0,17,9.5,7.494,7.494,0,0,0,9.5,2Zm0,13.5a6,6,0,1,1,6-6A6.009,6.009,0,0,1,9.5,15.5Z" transform="translate(-0.501 -0.501)" fill="#d0011b"/>
|
|
6
5
|
</svg>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</g>
|
|
1
|
+
<svg id="check_circle_black_18dp" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
|
|
2
|
+
<path id="Path_2946" data-name="Path 2946" d="M0,0H18V18H0Z" fill="none"/>
|
|
3
|
+
<path id="Path_2947" data-name="Path 2947" d="M9.986,4a5.986,5.986,0,1,0,5.986,5.986A5.994,5.994,0,0,0,9.986,4Zm-1.5,9.727L5.5,10.734,6.551,9.679l1.938,1.93L13.42,6.679l1.055,1.063Z" transform="translate(-0.986 -0.986)" fill="#eafaef" opacity="0.999"/>
|
|
4
|
+
<path id="Path_2948" data-name="Path 2948" d="M9.493,2a7.493,7.493,0,1,0,7.493,7.493A7.5,7.5,0,0,0,9.493,2Zm0,13.487a5.994,5.994,0,1,1,5.994-5.994A6,6,0,0,1,9.493,15.487Zm3.439-9.306L7.994,11.119,6.054,9.186,5,10.242l3,3,5.994-5.994Z" transform="translate(-0.493 -0.493)" fill="#24a148"/>
|
|
6
5
|
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxc-technology/halstack-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-422fa7b",
|
|
4
4
|
"description": "DXC Halstack React components library",
|
|
5
5
|
"repository": "dxc-technology/halstack-react",
|
|
6
6
|
"homepage": "http://developer.dxc.com/tools/react",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"url": "https://dxc.com"
|
|
12
12
|
},
|
|
13
13
|
"main": "./dist/main.js",
|
|
14
|
+
"types": "./dist/main.d.ts",
|
|
14
15
|
"peerDependencies": {
|
|
15
16
|
"react": "^16.8.6",
|
|
16
17
|
"react-dom": "^16.8.6",
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
"moment": "2.24.0",
|
|
30
31
|
"prop-types": "^15.7.2",
|
|
31
32
|
"react-use-scrollspy": "^2.0.0",
|
|
32
|
-
"rgb-hex": "^3.0.0"
|
|
33
|
+
"rgb-hex": "^3.0.0",
|
|
34
|
+
"uuid": "^8.3.2"
|
|
33
35
|
},
|
|
34
36
|
"scripts": {
|
|
35
37
|
"test": "jest",
|
|
@@ -41,8 +43,8 @@
|
|
|
41
43
|
"@babel/cli": "^7.6.2",
|
|
42
44
|
"@babel/core": "^7.6.2",
|
|
43
45
|
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
|
44
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "
|
|
45
|
-
"@babel/plugin-proposal-optional-chaining": "
|
|
46
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.13.8",
|
|
47
|
+
"@babel/plugin-proposal-optional-chaining": "7.13.8",
|
|
46
48
|
"@babel/plugin-transform-runtime": "^7.10.1",
|
|
47
49
|
"@babel/preset-env": "^7.6.2",
|
|
48
50
|
"@babel/preset-react": "^7.0.0",
|
|
@@ -27,6 +27,22 @@ describe("Accordion component tests", () => {
|
|
|
27
27
|
expect(getAllByRole("button")[1].getAttribute("aria-expanded")).toBe("false");
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
test("Uncontrolled accordion group renders with only one children", () => {
|
|
31
|
+
const { getByText, getAllByRole } = render(
|
|
32
|
+
<DxcAccordionGroup>
|
|
33
|
+
<DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
|
|
34
|
+
<div>
|
|
35
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
|
|
36
|
+
leo lobortis eget.
|
|
37
|
+
</div>
|
|
38
|
+
</DxcAccordionGroup.Accordion>
|
|
39
|
+
</DxcAccordionGroup>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
expect(getByText("Accordion1")).toBeTruthy();
|
|
43
|
+
expect(getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("false");
|
|
44
|
+
});
|
|
45
|
+
|
|
30
46
|
test("Uncontrolled accordion group calls correct function on click", () => {
|
|
31
47
|
const onActiveChange = jest.fn();
|
|
32
48
|
const { getByText, getAllByRole } = render(
|
package/test/Date.test.js
CHANGED
|
@@ -50,13 +50,13 @@ describe("Controlled Date Component", () => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
test("Calendar´s value is the same as the input´s date if it´s right (Depending on the format)", () => {
|
|
53
|
-
const { getByRole, getByText } = render(<DxcDate label="Birthdate" value="16-10-2020" />);
|
|
54
|
-
fireEvent.click(
|
|
53
|
+
const { getByRole, getByText, getByTestId } = render(<DxcDate label="Birthdate" value="16-10-2020" />);
|
|
54
|
+
fireEvent.click(getByTestId('calendarIcon'));
|
|
55
55
|
expect(getByText("Fri, Oct 16")).toBeTruthy();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
test("Calendar´s value is the same as the input´s date if it´s right after changing the input value", () => {
|
|
59
|
-
const { getByRole, getByText, rerender, getByPlaceholderText } = render(
|
|
59
|
+
const { getByRole, getByText, rerender, getByPlaceholderText, getByTestId } = render(
|
|
60
60
|
<DxcDate label="Birthdate" value="30-03-1981" placeholder />
|
|
61
61
|
);
|
|
62
62
|
// const input = getByRole("textbox");
|
|
@@ -64,7 +64,7 @@ describe("Controlled Date Component", () => {
|
|
|
64
64
|
fireEvent.change(input, { target: { value: "10-02-2020" } });
|
|
65
65
|
|
|
66
66
|
rerender(<DxcDate label="Birthdate" value="10-02-2020" />);
|
|
67
|
-
const calendarButton =
|
|
67
|
+
const calendarButton = getByTestId('calendarIcon');
|
|
68
68
|
fireEvent.click(calendarButton);
|
|
69
69
|
expect(getByText("Mon, Feb 10")).toBeTruthy();
|
|
70
70
|
});
|
|
@@ -152,7 +152,7 @@ describe("Controlled Date Component", () => {
|
|
|
152
152
|
const onChange = jest.fn();
|
|
153
153
|
|
|
154
154
|
const component = render(<DxcDate label="Birthdate" value="01-02-2020" onChange={onChange} />);
|
|
155
|
-
const calendarButton = component.
|
|
155
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
156
156
|
fireEvent.click(calendarButton);
|
|
157
157
|
const dayButton = component.getByRole("button", { name: "10" });
|
|
158
158
|
fireEvent.click(dayButton);
|
|
@@ -166,7 +166,7 @@ describe("Controlled Date Component", () => {
|
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
const component = render(<DxcDate label="Birthdate" value="30-10-2020" onChange={onChange} />);
|
|
169
|
-
const calendarButton = component.
|
|
169
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
170
170
|
fireEvent.click(calendarButton);
|
|
171
171
|
const dayButton = component.getByRole("button", { name: "16" });
|
|
172
172
|
fireEvent.click(dayButton);
|
|
@@ -179,7 +179,7 @@ describe("Controlled Date Component", () => {
|
|
|
179
179
|
});
|
|
180
180
|
|
|
181
181
|
const component = render(<DxcDate label="Birthdate" value="01-10-2020" onChange={onChange} />);
|
|
182
|
-
const calendarButton = component.
|
|
182
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
183
183
|
fireEvent.click(calendarButton);
|
|
184
184
|
const dayButton = component.getByRole("button", { name: "16" });
|
|
185
185
|
fireEvent.click(dayButton);
|
|
@@ -192,7 +192,7 @@ describe("Controlled Date Component", () => {
|
|
|
192
192
|
});
|
|
193
193
|
|
|
194
194
|
const component = render(<DxcDate label="Birthdate" format="yyyy/MM/dd" value="2020/10/01" onChange={onChange} />);
|
|
195
|
-
const calendarButton = component.
|
|
195
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
196
196
|
fireEvent.click(calendarButton);
|
|
197
197
|
const dayButton = component.getByRole("button", { name: "16" });
|
|
198
198
|
fireEvent.click(dayButton);
|
|
@@ -201,7 +201,7 @@ describe("Controlled Date Component", () => {
|
|
|
201
201
|
|
|
202
202
|
test("Check selected date on calendar is the same date as the one on the input", () => {
|
|
203
203
|
const component = render(<DxcDate label="Birthdate" value="01-10-2020" />);
|
|
204
|
-
const calendarButton = component.
|
|
204
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
205
205
|
fireEvent.click(calendarButton);
|
|
206
206
|
const dayButton = component.getByRole("button", { name: "1" });
|
|
207
207
|
expect(dayButton.classList.contains("MuiPickersDay-daySelected")).toBe(true);
|
|
@@ -249,14 +249,14 @@ describe("Uncontrolled Date Component", () => {
|
|
|
249
249
|
const date = new Date("2020-10-16 00:00:00");
|
|
250
250
|
|
|
251
251
|
test("Calendar´s value is the same as the input´s date if it´s right after changing the input value", () => {
|
|
252
|
-
const { getByRole, getByText, rerender, getByPlaceholderText } = render(<DxcDate label="Birthdate" placeholder />);
|
|
252
|
+
const { getByRole, getByText, rerender, getByPlaceholderText, getByTestId } = render(<DxcDate label="Birthdate" placeholder />);
|
|
253
253
|
// const input = getByRole("textbox");
|
|
254
254
|
const input = getByPlaceholderText(defaultFormat);
|
|
255
255
|
|
|
256
256
|
fireEvent.change(input, { target: { value: "10-02-2020" } });
|
|
257
257
|
|
|
258
258
|
rerender(<DxcDate label="Birthdate" value="10-02-2020" />);
|
|
259
|
-
const calendarButton =
|
|
259
|
+
const calendarButton = getByTestId('calendarIcon');
|
|
260
260
|
fireEvent.click(calendarButton);
|
|
261
261
|
expect(getByText("Mon, Feb 10")).toBeTruthy();
|
|
262
262
|
});
|
|
@@ -336,7 +336,7 @@ describe("Uncontrolled Date Component", () => {
|
|
|
336
336
|
const onChange = jest.fn();
|
|
337
337
|
|
|
338
338
|
const component = render(<DxcDate label="Birthdate" onChange={onChange} />);
|
|
339
|
-
const calendarButton = component.
|
|
339
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
340
340
|
fireEvent.click(calendarButton);
|
|
341
341
|
const dayButton = component.getByRole("button", { name: "10" });
|
|
342
342
|
fireEvent.click(dayButton);
|
|
@@ -350,7 +350,7 @@ describe("Uncontrolled Date Component", () => {
|
|
|
350
350
|
const input = component.getByPlaceholderText(defaultFormat);
|
|
351
351
|
|
|
352
352
|
fireEvent.change(input, { target: { value: "10-02-2020" } });
|
|
353
|
-
const calendarButton = component.
|
|
353
|
+
const calendarButton = component.getByTestId('calendarIcon');
|
|
354
354
|
fireEvent.click(calendarButton);
|
|
355
355
|
const dayButton = component.getByRole("button", { name: "10" });
|
|
356
356
|
expect(dayButton.classList.contains("MuiPickersDay-daySelected")).toBe(true);
|
package/test/Dropdown.test.js
CHANGED
|
@@ -47,6 +47,21 @@ describe("Dropdown component tests", () => {
|
|
|
47
47
|
});
|
|
48
48
|
expect(queryByText("option-test")).toBeTruthy();
|
|
49
49
|
});
|
|
50
|
+
test("Disabled dropdown is not clickable", () => {
|
|
51
|
+
const options = [
|
|
52
|
+
{
|
|
53
|
+
value: 1,
|
|
54
|
+
label: "option-test",
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
const { queryByText } = render(<DxcDropdown options={options} disabled label="dropdown-test"></DxcDropdown>);
|
|
58
|
+
const dropdown = queryByText("dropdown-test");
|
|
59
|
+
expect(queryByText("option-test")).toBeFalsy();
|
|
60
|
+
act(() => {
|
|
61
|
+
fireEvent.click(dropdown);
|
|
62
|
+
});
|
|
63
|
+
expect(queryByText("option-test")).toBeFalsy();
|
|
64
|
+
});
|
|
50
65
|
|
|
51
66
|
test("Dropdown renders with correct icon before option", () => {
|
|
52
67
|
const options = [
|