@dxc-technology/halstack-react 0.0.0-f46d22a → 0.0.0-f4bae62
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/README.md +1 -1
- package/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +211 -150
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/accordion/Accordion.js +131 -46
- package/dist/accordion-group/AccordionGroup.js +36 -9
- 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 +1400 -191
- package/dist/date/Date.js +72 -50
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- 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 +89 -34
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +152 -86
- package/dist/header/Icons.js +59 -0
- package/dist/heading/Heading.js +81 -16
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +250 -104
- package/dist/layout/ApplicationLayout.js +15 -20
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +84 -34
- package/dist/main.d.ts +8 -0
- package/dist/main.js +71 -7
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/number-input/NumberInput.js +136 -0
- package/dist/number-input/NumberInputContext.js +16 -0
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +67 -35
- package/dist/password-input/PasswordInput.js +198 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +90 -34
- package/dist/radio/Radio.js +30 -11
- package/dist/resultsetTable/ResultsetTable.js +79 -48
- package/dist/select/Select.js +224 -147
- package/dist/sidenav/Sidenav.js +65 -11
- package/dist/slider/Slider.js +212 -65
- package/dist/spinner/Spinner.js +246 -57
- package/dist/switch/Switch.js +51 -19
- package/dist/table/Table.js +49 -21
- package/dist/tabs/Tabs.js +58 -17
- package/dist/tag/Tag.js +68 -35
- package/dist/text-input/TextInput.js +971 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +246 -101
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle/Toggle.js +16 -19
- package/dist/toggle-group/ToggleGroup.js +141 -37
- package/dist/upload/Upload.js +16 -11
- package/dist/upload/buttons-upload/ButtonsUpload.js +31 -14
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +78 -28
- package/dist/upload/file-upload/FileToUpload.js +50 -24
- package/dist/upload/files-upload/FilesToUpload.js +16 -16
- package/dist/upload/readme.md +2 -2
- package/dist/upload/transaction/Transaction.js +44 -24
- package/dist/upload/transactions/Transactions.js +38 -20
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +125 -48
- package/package.json +6 -4
- package/test/AccordionGroup.test.js +16 -0
- package/test/Date.test.js +49 -45
- package/test/DateInput.test.js +242 -0
- package/test/Dropdown.test.js +15 -0
- package/test/FileInput.test.js +201 -0
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/InputText.test.js +25 -17
- package/test/Link.test.js +3 -2
- package/test/NumberInput.test.js +259 -0
- package/test/Paginator.test.js +1 -1
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +1 -2
- package/test/Select.test.js +44 -24
- package/test/Slider.test.js +9 -17
- package/test/Spinner.test.js +5 -0
- package/test/TextInput.test.js +732 -0
- package/test/Textarea.test.js +193 -0
- package/test/ToggleGroup.test.js +5 -1
- package/test/Upload.test.js +5 -5
- package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
- 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/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- 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/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/toggle-group/readme.md +0 -82
- package/dist/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
package/dist/wizard/Wizard.js
CHANGED
|
@@ -25,16 +25,22 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
25
25
|
|
|
26
26
|
var _variables = require("../common/variables.js");
|
|
27
27
|
|
|
28
|
-
var _utils = require("../common/utils.js");
|
|
29
|
-
|
|
30
28
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _Icons = require("./Icons");
|
|
31
|
+
|
|
32
|
+
function _templateObject14() {
|
|
33
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"]);
|
|
34
|
+
|
|
35
|
+
_templateObject14 = function _templateObject14() {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
35
41
|
|
|
36
42
|
function _templateObject13() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
43
|
+
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"]);
|
|
38
44
|
|
|
39
45
|
_templateObject13 = function _templateObject13() {
|
|
40
46
|
return data;
|
|
@@ -44,7 +50,7 @@ function _templateObject13() {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
function _templateObject12() {
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-align:
|
|
53
|
+
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"]);
|
|
48
54
|
|
|
49
55
|
_templateObject12 = function _templateObject12() {
|
|
50
56
|
return data;
|
|
@@ -54,7 +60,7 @@ function _templateObject12() {
|
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
function _templateObject11() {
|
|
57
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
63
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"]);
|
|
58
64
|
|
|
59
65
|
_templateObject11 = function _templateObject11() {
|
|
60
66
|
return data;
|
|
@@ -64,7 +70,7 @@ function _templateObject11() {
|
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
function _templateObject10() {
|
|
67
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
73
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"]);
|
|
68
74
|
|
|
69
75
|
_templateObject10 = function _templateObject10() {
|
|
70
76
|
return data;
|
|
@@ -74,7 +80,7 @@ function _templateObject10() {
|
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
function _templateObject9() {
|
|
77
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
83
|
+
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"]);
|
|
78
84
|
|
|
79
85
|
_templateObject9 = function _templateObject9() {
|
|
80
86
|
return data;
|
|
@@ -84,7 +90,7 @@ function _templateObject9() {
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
function _templateObject8() {
|
|
87
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
93
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n mask: url(", ") no-repeat center;\n mask-size: ", ";\n height: ", ";\n width: ", ";\n"]);
|
|
88
94
|
|
|
89
95
|
_templateObject8 = function _templateObject8() {
|
|
90
96
|
return data;
|
|
@@ -94,7 +100,7 @@ function _templateObject8() {
|
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
function _templateObject7() {
|
|
97
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width:
|
|
103
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
98
104
|
|
|
99
105
|
_templateObject7 = function _templateObject7() {
|
|
100
106
|
return data;
|
|
@@ -104,7 +110,7 @@ function _templateObject7() {
|
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
function _templateObject6() {
|
|
107
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width:
|
|
113
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"]);
|
|
108
114
|
|
|
109
115
|
_templateObject6 = function _templateObject6() {
|
|
110
116
|
return data;
|
|
@@ -114,7 +120,7 @@ function _templateObject6() {
|
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
function _templateObject5() {
|
|
117
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n\n border-radius:
|
|
123
|
+
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"]);
|
|
118
124
|
|
|
119
125
|
_templateObject5 = function _templateObject5() {
|
|
120
126
|
return data;
|
|
@@ -124,7 +130,7 @@ function _templateObject5() {
|
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
function _templateObject4() {
|
|
127
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom:
|
|
133
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom: 4px;\n"]);
|
|
128
134
|
|
|
129
135
|
_templateObject4 = function _templateObject4() {
|
|
130
136
|
return data;
|
|
@@ -134,7 +140,7 @@ function _templateObject4() {
|
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
function _templateObject3() {
|
|
137
|
-
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 &:
|
|
143
|
+
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"]);
|
|
138
144
|
|
|
139
145
|
_templateObject3 = function _templateObject3() {
|
|
140
146
|
return data;
|
|
@@ -154,7 +160,7 @@ function _templateObject2() {
|
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
function _templateObject() {
|
|
157
|
-
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"]);
|
|
163
|
+
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"]);
|
|
158
164
|
|
|
159
165
|
_templateObject = function _templateObject() {
|
|
160
166
|
return data;
|
|
@@ -169,12 +175,14 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
169
175
|
currentStep = _ref.currentStep,
|
|
170
176
|
onStepClick = _ref.onStepClick,
|
|
171
177
|
steps = _ref.steps,
|
|
172
|
-
margin = _ref.margin
|
|
178
|
+
margin = _ref.margin,
|
|
179
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
180
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
173
181
|
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
innerCurrent =
|
|
177
|
-
setInnerCurrentStep =
|
|
182
|
+
var _useState = (0, _react.useState)(currentStep || 0),
|
|
183
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
184
|
+
innerCurrent = _useState2[0],
|
|
185
|
+
setInnerCurrentStep = _useState2[1];
|
|
178
186
|
|
|
179
187
|
var renderedCurrent = currentStep == null ? innerCurrent : currentStep;
|
|
180
188
|
var colorsTheme = (0, _useTheme["default"])();
|
|
@@ -190,7 +198,7 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
190
198
|
};
|
|
191
199
|
|
|
192
200
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
193
|
-
theme: colorsTheme
|
|
201
|
+
theme: colorsTheme.wizard
|
|
194
202
|
}, _react["default"].createElement(StepsContainer, {
|
|
195
203
|
mode: mode,
|
|
196
204
|
margin: margin
|
|
@@ -200,6 +208,7 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
200
208
|
mode: mode,
|
|
201
209
|
lastStep: i === steps.length - 1
|
|
202
210
|
}, _react["default"].createElement(Step, {
|
|
211
|
+
tabIndex: tabIndex,
|
|
203
212
|
onClick: function onClick() {
|
|
204
213
|
return handleStepClick(i);
|
|
205
214
|
},
|
|
@@ -213,19 +222,21 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
213
222
|
disabled: step.disabled
|
|
214
223
|
}, step.icon ? _react["default"].createElement(StepIconContainer, {
|
|
215
224
|
disabled: step.disabled
|
|
216
|
-
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon
|
|
225
|
+
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon.type === "img" ? _react["default"].createElement(ImgContainer, {
|
|
226
|
+
current: i === renderedCurrent,
|
|
227
|
+
img: step.icon.props.src
|
|
228
|
+
}) : step.icon : _react["default"].createElement(step.icon)) : step.iconSrc ? _react["default"].createElement(Icon, {
|
|
217
229
|
src: step.iconSrc
|
|
218
230
|
}) : _react["default"].createElement(Number, {
|
|
219
231
|
disabled: step.disabled,
|
|
220
232
|
current: i === renderedCurrent
|
|
221
|
-
}, i + 1)), step.valid !== undefined ? step.valid ? _react["default"].createElement(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}, step.label ? _react["default"].createElement(Label, null, step.label) : "", step.description ? _react["default"].createElement(Description, null, step.description) : "") : ""), i === steps.length - 1 ? "" : _react["default"].createElement(StepSeparator, {
|
|
233
|
+
}, i + 1)), step.valid !== undefined ? step.valid ? _react["default"].createElement(ValidityIconContainer, null, _Icons.validIcon) : _react["default"].createElement(ValidityIconContainer, null, _Icons.invalidIcon) : ""), step.label || step.description ? _react["default"].createElement(InfoContainer, null, step.label ? _react["default"].createElement(Label, {
|
|
234
|
+
disabled: step.disabled,
|
|
235
|
+
visited: i <= innerCurrent
|
|
236
|
+
}, step.label) : "", step.description ? _react["default"].createElement(Description, {
|
|
237
|
+
disabled: step.disabled,
|
|
238
|
+
visited: i <= innerCurrent
|
|
239
|
+
}, step.description) : "") : ""), i === steps.length - 1 ? "" : _react["default"].createElement(StepSeparator, {
|
|
229
240
|
mode: mode
|
|
230
241
|
}));
|
|
231
242
|
})));
|
|
@@ -235,6 +246,8 @@ var StepsContainer = _styledComponents["default"].div(_templateObject(), functio
|
|
|
235
246
|
return props.mode === "vertical" ? "column" : "row";
|
|
236
247
|
}, function (props) {
|
|
237
248
|
return props.mode === "vertical" ? "height: 500px" : "width: 100%";
|
|
249
|
+
}, function (props) {
|
|
250
|
+
return props.theme.fontFamily;
|
|
238
251
|
}, function (props) {
|
|
239
252
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
240
253
|
}, function (props) {
|
|
@@ -258,51 +271,114 @@ var StepContainer = _styledComponents["default"].div(_templateObject2(), functio
|
|
|
258
271
|
});
|
|
259
272
|
|
|
260
273
|
var Step = _styledComponents["default"].button(_templateObject3(), function (props) {
|
|
261
|
-
return props.first ? props.mode === "vertical" ? "0 0
|
|
274
|
+
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";
|
|
262
275
|
}, function (props) {
|
|
263
276
|
return props.disabled ? "cursor: not-allowed" : "";
|
|
264
277
|
}, function (props) {
|
|
265
278
|
return props.disabled ? "" : "cursor: pointer";
|
|
279
|
+
}, function (props) {
|
|
280
|
+
return props.theme.focusColor;
|
|
266
281
|
});
|
|
267
282
|
|
|
268
283
|
var StepHeader = _styledComponents["default"].div(_templateObject4());
|
|
269
284
|
|
|
270
285
|
var IconContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
271
|
-
return
|
|
286
|
+
return props.disabled ? props.theme.disabledCircleWidth : props.current ? props.theme.selectedCircleWidth : props.theme.circleWidth;
|
|
272
287
|
}, function (props) {
|
|
273
|
-
return
|
|
288
|
+
return props.disabled ? props.theme.disabledCircleHeight : props.current ? props.theme.selectedCircleHeight : props.theme.circleHeight;
|
|
274
289
|
}, function (props) {
|
|
275
|
-
return "\n ".concat(!props.current && !props.disabled ? "border:
|
|
290
|
+
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 ");
|
|
291
|
+
}, function (props) {
|
|
292
|
+
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor, ";");
|
|
293
|
+
}, function (props) {
|
|
294
|
+
return !props.current && !props.disabled ? props.theme.circleBorderRadius : props.current ? props.theme.selectedCircleBorderRadius : props.disabled ? props.theme.disabledCircleBorderRadius : "";
|
|
276
295
|
});
|
|
277
296
|
|
|
278
|
-
var Icon = _styledComponents["default"].img(_templateObject6())
|
|
297
|
+
var Icon = _styledComponents["default"].img(_templateObject6(), function (props) {
|
|
298
|
+
return props.theme.stepContainerIconSize;
|
|
299
|
+
}, function (props) {
|
|
300
|
+
return props.theme.stepContainerIconSize;
|
|
301
|
+
});
|
|
279
302
|
|
|
280
303
|
var StepIconContainer = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
281
|
-
return props.
|
|
304
|
+
return props.theme.stepContainerIconSize;
|
|
305
|
+
}, function (props) {
|
|
306
|
+
return props.theme.stepContainerIconSize;
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
var ImgContainer = _styledComponents["default"].div(_templateObject8(), function (props) {
|
|
310
|
+
return props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor;
|
|
311
|
+
}, function (_ref2) {
|
|
312
|
+
var img = _ref2.img;
|
|
313
|
+
return img;
|
|
314
|
+
}, function (props) {
|
|
315
|
+
return "".concat(props.theme.stepContainerIconSize, " ").concat(props.theme.stepContainerIconSize);
|
|
316
|
+
}, function (props) {
|
|
317
|
+
return props.theme.stepContainerIconSize;
|
|
318
|
+
}, function (props) {
|
|
319
|
+
return props.theme.stepContainerIconSize;
|
|
282
320
|
});
|
|
283
321
|
|
|
284
|
-
var Number = _styledComponents["default"].p(
|
|
285
|
-
return props.
|
|
322
|
+
var Number = _styledComponents["default"].p(_templateObject9(), function (props) {
|
|
323
|
+
return props.theme.stepContainerFontSize;
|
|
324
|
+
}, function (props) {
|
|
325
|
+
return props.theme.stepContainerFontFamily;
|
|
326
|
+
}, function (props) {
|
|
327
|
+
return props.theme.stepContainerFontStyle;
|
|
328
|
+
}, function (props) {
|
|
329
|
+
return props.theme.stepContainerFontWeight;
|
|
330
|
+
}, function (props) {
|
|
331
|
+
return props.theme.stepContainerLetterSpacing;
|
|
286
332
|
});
|
|
287
333
|
|
|
288
|
-
var
|
|
334
|
+
var ValidityIconContainer = _styledComponents["default"].div(_templateObject10());
|
|
289
335
|
|
|
290
|
-
var InfoContainer = _styledComponents["default"].div(
|
|
291
|
-
return props.disabled ? "".concat(props.theme.wizard.disabledFont) : "".concat(props.theme.wizard.fontColor);
|
|
292
|
-
});
|
|
336
|
+
var InfoContainer = _styledComponents["default"].div(_templateObject11());
|
|
293
337
|
|
|
294
|
-
var Label = _styledComponents["default"].p(
|
|
338
|
+
var Label = _styledComponents["default"].p(_templateObject12(), function (props) {
|
|
339
|
+
return props.theme.labelTextAlign;
|
|
340
|
+
}, function (props) {
|
|
341
|
+
return props.theme.labelFontFamily;
|
|
342
|
+
}, function (props) {
|
|
343
|
+
return props.theme.labelFontSize;
|
|
344
|
+
}, function (props) {
|
|
345
|
+
return props.theme.labelFontStyle;
|
|
346
|
+
}, function (props) {
|
|
347
|
+
return props.theme.labelFontWeight;
|
|
348
|
+
}, function (props) {
|
|
349
|
+
return props.theme.labelLetterSpacing;
|
|
350
|
+
}, function (props) {
|
|
351
|
+
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedLabelFontColor : props.theme.labelFontColor, ";");
|
|
352
|
+
}, function (props) {
|
|
353
|
+
return props.theme.labelFontTextTransform;
|
|
354
|
+
});
|
|
295
355
|
|
|
296
|
-
var Description = _styledComponents["default"].p(
|
|
356
|
+
var Description = _styledComponents["default"].p(_templateObject13(), function (props) {
|
|
357
|
+
return props.theme.descriptionTextAlign;
|
|
358
|
+
}, function (props) {
|
|
359
|
+
return props.theme.descriptionFontFamily;
|
|
360
|
+
}, function (props) {
|
|
361
|
+
return props.theme.descriptionFontSize;
|
|
362
|
+
}, function (props) {
|
|
363
|
+
return props.theme.descriptionFontStyle;
|
|
364
|
+
}, function (props) {
|
|
365
|
+
return props.theme.descriptionFontWeight;
|
|
366
|
+
}, function (props) {
|
|
367
|
+
return props.theme.descriptionLetterSpacing;
|
|
368
|
+
}, function (props) {
|
|
369
|
+
return props.theme.descriptionFontTextTransform;
|
|
370
|
+
}, function (props) {
|
|
371
|
+
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
|
|
372
|
+
});
|
|
297
373
|
|
|
298
|
-
var StepSeparator = _styledComponents["default"].div(
|
|
374
|
+
var StepSeparator = _styledComponents["default"].div(_templateObject14(), function (props) {
|
|
299
375
|
return props.mode === "horizontal" ? "" : "0";
|
|
300
376
|
}, function (props) {
|
|
301
377
|
return props.mode === "horizontal" ? "0" : "";
|
|
302
378
|
}, function (props) {
|
|
303
379
|
return props.mode === "vertical" ? "margin: 0 18px;" : "";
|
|
304
380
|
}, function (props) {
|
|
305
|
-
return "
|
|
381
|
+
return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
|
|
306
382
|
});
|
|
307
383
|
|
|
308
384
|
DxcWizard.propTypes = {
|
|
@@ -322,7 +398,8 @@ DxcWizard.propTypes = {
|
|
|
322
398
|
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
323
399
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
324
400
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
325
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
401
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
402
|
+
tabIndex: _propTypes["default"].number
|
|
326
403
|
};
|
|
327
404
|
var _default = DxcWizard;
|
|
328
405
|
exports["default"] = _default;
|
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-f4bae62",
|
|
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(
|