@dxc-technology/halstack-react 0.0.0-7d46b9f → 0.0.0-7da4003
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/ThemeContext.js +6 -6
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/alert/Alert.js +4 -4
- package/dist/button/Button.js +1 -1
- package/dist/common/variables.js +199 -74
- package/dist/date/Date.js +6 -6
- package/dist/{new-date/NewDate.js → date-input/DateInput.js} +36 -36
- package/dist/{new-date → date-input}/index.d.ts +3 -3
- package/dist/file-input/FileInput.js +2 -2
- package/dist/file-input/index.d.ts +1 -1
- package/dist/footer/Footer.js +44 -18
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +80 -49
- package/dist/header/Icons.js +59 -0
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +7 -9
- package/dist/layout/ApplicationLayout.js +4 -8
- package/dist/layout/Icons.js +55 -0
- package/dist/main.d.ts +6 -5
- package/dist/main.js +29 -21
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/{number/Number.js → number-input/NumberInput.js} +8 -8
- package/dist/{number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
- package/dist/{number → number-input}/index.d.ts +3 -3
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +5 -11
- package/dist/{password/Password.js → password-input/PasswordInput.js} +8 -10
- package/dist/{password → password-input}/index.d.ts +5 -5
- package/dist/slider/Slider.js +104 -19
- package/dist/{new-input-text/NewInputText.js → text-input/TextInput.js} +36 -32
- package/dist/{new-input-text → text-input}/index.d.ts +1 -1
- package/dist/textarea/Textarea.js +227 -122
- package/dist/{new-textarea → textarea}/index.d.ts +1 -1
- package/dist/toggle-group/ToggleGroup.js +132 -28
- package/dist/upload/Upload.js +3 -3
- package/dist/upload/buttons-upload/ButtonsUpload.js +7 -11
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +14 -14
- package/dist/upload/dragAndDropArea/Icons.js +39 -0
- package/dist/upload/file-upload/FileToUpload.js +26 -21
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/readme.md +2 -2
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +11 -38
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +3 -9
- package/package.json +1 -1
- package/test/Date.test.js +48 -44
- package/test/{NewDate.test.js → DateInput.test.js} +33 -23
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/InputText.test.js +24 -16
- package/test/{Number.test.js → NumberInput.test.js} +47 -45
- package/test/PasswordInput.test.js +83 -0
- package/test/Slider.test.js +9 -17
- package/test/{NewInputText.test.js → TextInput.test.js} +46 -48
- package/test/{NewTextarea.test.js → Textarea.test.js} +16 -18
- 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/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo.svg +0 -15
- 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.svg +0 -8
- 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/new-textarea/NewTextarea.js +0 -365
- 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/password/styles.css +0 -3
- 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/slider/Slider.stories.js +0 -241
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/wizard/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Password.test.js +0 -83
|
@@ -33,7 +33,7 @@ var _uuid = require("uuid");
|
|
|
33
33
|
|
|
34
34
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext.js"));
|
|
37
37
|
|
|
38
38
|
function _templateObject17() {
|
|
39
39
|
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n align-items: center;\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
|
|
@@ -166,7 +166,7 @@ function _templateObject5() {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
function _templateObject4() {
|
|
169
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height:
|
|
169
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
170
170
|
|
|
171
171
|
_templateObject4 = function _templateObject4() {
|
|
172
172
|
return data;
|
|
@@ -186,7 +186,7 @@ function _templateObject3() {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
function _templateObject2() {
|
|
189
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height:
|
|
189
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
190
190
|
|
|
191
191
|
_templateObject2 = function _templateObject2() {
|
|
192
192
|
return data;
|
|
@@ -242,7 +242,7 @@ var patternMatch = function patternMatch(pattern, value) {
|
|
|
242
242
|
return new RegExp(pattern).test(value);
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
var
|
|
245
|
+
var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
246
246
|
var _ref$label = _ref.label,
|
|
247
247
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
248
248
|
_ref$name = _ref.name,
|
|
@@ -329,7 +329,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
329
329
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
330
330
|
var autosuggestId = "".concat(inputId, "-listBox");
|
|
331
331
|
var errorId = "error-message-".concat(inputId);
|
|
332
|
-
var
|
|
332
|
+
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
333
333
|
|
|
334
334
|
var isNotOptional = function isNotOptional(value) {
|
|
335
335
|
return value === "" && !optional;
|
|
@@ -340,7 +340,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
340
340
|
};
|
|
341
341
|
|
|
342
342
|
var isNumberIncorrect = function isNumberIncorrect(value) {
|
|
343
|
-
return (
|
|
343
|
+
return (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
|
|
344
344
|
};
|
|
345
345
|
|
|
346
346
|
var isTextInputType = function isTextInputType() {
|
|
@@ -350,7 +350,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
350
350
|
};
|
|
351
351
|
|
|
352
352
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
353
|
-
if (
|
|
353
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return "Value must be greater than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, ".");else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return "Value must be less than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber, ".");
|
|
354
354
|
};
|
|
355
355
|
|
|
356
356
|
var hasInputSuggestions = function hasInputSuggestions() {
|
|
@@ -428,7 +428,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
428
428
|
switch (event.keyCode) {
|
|
429
429
|
case 40:
|
|
430
430
|
// Arrow Down
|
|
431
|
-
if (
|
|
431
|
+
if (numberInputContext) {
|
|
432
432
|
decrementNumber();
|
|
433
433
|
event.preventDefault();
|
|
434
434
|
} else {
|
|
@@ -448,7 +448,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
448
448
|
|
|
449
449
|
case 38:
|
|
450
450
|
// Arrow Up
|
|
451
|
-
if (
|
|
451
|
+
if (numberInputContext) {
|
|
452
452
|
incrementNumber();
|
|
453
453
|
event.preventDefault();
|
|
454
454
|
} else {
|
|
@@ -532,7 +532,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
532
532
|
changeVisualFocusedSuggIndex(-1);
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
-
|
|
535
|
+
numberInputContext && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
536
536
|
}, [value, innerValue, suggestions]);
|
|
537
537
|
var defaultClearAction = {
|
|
538
538
|
onClick: function onClick() {
|
|
@@ -567,16 +567,16 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
567
567
|
var decrementNumber = function decrementNumber() {
|
|
568
568
|
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
569
569
|
|
|
570
|
-
if (
|
|
570
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) {
|
|
571
571
|
changeValue(parseInt(numberValue));
|
|
572
|
-
} else if (
|
|
573
|
-
changeValue(
|
|
574
|
-
} else if (
|
|
575
|
-
changeValue(
|
|
576
|
-
} else if (
|
|
577
|
-
changeValue(parseInt(numberValue) - (
|
|
578
|
-
} else if (
|
|
579
|
-
changeValue(-(
|
|
572
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
|
|
573
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
|
|
574
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "" || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber))) {
|
|
575
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
|
|
576
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) >= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
|
|
577
|
+
changeValue(parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
|
|
578
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
|
|
579
|
+
changeValue(-(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
|
|
580
580
|
} else if (numberValue === "") {
|
|
581
581
|
changeValue(-1);
|
|
582
582
|
} else {
|
|
@@ -587,16 +587,16 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
587
587
|
var incrementNumber = function incrementNumber() {
|
|
588
588
|
var numberValue = value !== null && value !== void 0 ? value : innerValue;
|
|
589
589
|
|
|
590
|
-
if (
|
|
590
|
+
if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
|
|
591
591
|
changeValue(parseInt(numberValue));
|
|
592
|
-
} else if (
|
|
593
|
-
changeValue(
|
|
594
|
-
} else if (
|
|
595
|
-
changeValue(
|
|
596
|
-
} else if (
|
|
597
|
-
changeValue(parseInt(numberValue) + (
|
|
598
|
-
} else if (
|
|
599
|
-
changeValue(
|
|
592
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "")) {
|
|
593
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
|
|
594
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber))) {
|
|
595
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
|
|
596
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) <= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
|
|
597
|
+
changeValue(parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
|
|
598
|
+
} else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
|
|
599
|
+
changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber);
|
|
600
600
|
} else if (numberValue === "") {
|
|
601
601
|
changeValue(1);
|
|
602
602
|
} else {
|
|
@@ -673,7 +673,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
673
673
|
};
|
|
674
674
|
|
|
675
675
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
676
|
-
theme: colorsTheme.
|
|
676
|
+
theme: colorsTheme.textInput
|
|
677
677
|
}, _react["default"].createElement(DxcInput, {
|
|
678
678
|
margin: margin,
|
|
679
679
|
ref: ref,
|
|
@@ -727,7 +727,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
727
727
|
backgroundType: backgroundType,
|
|
728
728
|
tabIndex: tabIndex,
|
|
729
729
|
"aria-label": "Clear"
|
|
730
|
-
}, defaultClearAction.icon), (
|
|
730
|
+
}, defaultClearAction.icon), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(Action, {
|
|
731
731
|
ref: actionRef,
|
|
732
732
|
disabled: disabled,
|
|
733
733
|
onClick: decrementAction.onClick,
|
|
@@ -813,6 +813,8 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
813
813
|
return props.theme.labelFontStyle;
|
|
814
814
|
}, function (props) {
|
|
815
815
|
return props.theme.labelFontWeight;
|
|
816
|
+
}, function (props) {
|
|
817
|
+
return props.theme.labelLineHeight;
|
|
816
818
|
});
|
|
817
819
|
|
|
818
820
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
@@ -829,6 +831,8 @@ var HelperText = _styledComponents["default"].span(_templateObject4(), function
|
|
|
829
831
|
return props.theme.helperTextFontStyle;
|
|
830
832
|
}, function (props) {
|
|
831
833
|
return props.theme.helperTextFontWeight;
|
|
834
|
+
}, function (props) {
|
|
835
|
+
return props.theme.helperTextLineHeight;
|
|
832
836
|
});
|
|
833
837
|
|
|
834
838
|
var InputContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
@@ -927,7 +931,7 @@ var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject16()
|
|
|
927
931
|
|
|
928
932
|
var SuggestionsError = _styledComponents["default"].span(_templateObject17());
|
|
929
933
|
|
|
930
|
-
|
|
934
|
+
DxcTextInput.propTypes = {
|
|
931
935
|
label: _propTypes["default"].string,
|
|
932
936
|
name: _propTypes["default"].string,
|
|
933
937
|
value: _propTypes["default"].string,
|
|
@@ -963,5 +967,5 @@ DxcNewInputText.propTypes = {
|
|
|
963
967
|
}),
|
|
964
968
|
tabIndex: _propTypes["default"].number
|
|
965
969
|
};
|
|
966
|
-
var _default =
|
|
970
|
+
var _default = DxcTextInput;
|
|
967
971
|
exports["default"] = _default;
|