@dxc-technology/halstack-react 0.0.0-2dd4aed → 0.0.0-2ea264d
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 +131 -99
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/accordion/Accordion.js +72 -59
- package/dist/accordion-group/AccordionGroup.js +1 -3
- package/dist/alert/Alert.js +126 -111
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +3 -1
- package/dist/box/Box.js +1 -9
- package/dist/button/Button.js +30 -20
- package/dist/card/Card.js +2 -4
- package/dist/checkbox/Checkbox.js +30 -21
- package/dist/chip/Chip.js +30 -28
- package/dist/common/variables.js +997 -581
- package/dist/date/Date.js +23 -35
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +21 -39
- package/dist/dropdown/Dropdown.js +123 -71
- 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 +69 -53
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +89 -86
- package/dist/header/Icons.js +59 -0
- package/dist/heading/Heading.js +1 -5
- package/dist/input-text/InputText.js +96 -58
- package/dist/layout/ApplicationLayout.js +1 -1
- package/dist/link/Link.js +71 -46
- package/dist/main.d.ts +8 -0
- package/dist/main.js +62 -6
- 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/Paginator.js +10 -4
- package/dist/password-input/PasswordInput.js +198 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +63 -27
- package/dist/resultsetTable/ResultsetTable.js +5 -22
- package/dist/select/Select.js +189 -185
- package/dist/sidenav/Sidenav.js +11 -15
- package/dist/slider/Slider.js +145 -66
- package/dist/spinner/Spinner.js +226 -59
- package/dist/switch/Switch.js +3 -3
- package/dist/table/Table.js +15 -5
- package/dist/tabs/Tabs.js +4 -8
- package/dist/tag/Tag.js +38 -36
- package/dist/text-input/TextInput.js +971 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +233 -124
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle-group/ToggleGroup.js +130 -44
- package/dist/upload/Upload.js +3 -3
- package/dist/upload/buttons-upload/ButtonsUpload.js +8 -4
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +16 -12
- package/dist/upload/file-upload/FileToUpload.js +4 -4
- package/dist/upload/readme.md +2 -2
- package/dist/upload/transaction/Transaction.js +13 -9
- package/dist/upload/transactions/Transactions.js +11 -11
- package/dist/wizard/Wizard.js +84 -56
- package/dist/wizard/invalid_icon.svg +4 -5
- package/dist/wizard/valid_icon.svg +4 -5
- package/package.json +4 -2
- package/test/Date.test.js +48 -44
- 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 +24 -16
- 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/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/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/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
|
@@ -43,10 +43,10 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
43
43
|
|
|
44
44
|
var _error = _interopRequireDefault(require("./error.svg"));
|
|
45
45
|
|
|
46
|
-
var _BackgroundColorContext =
|
|
46
|
+
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext.js"));
|
|
47
47
|
|
|
48
48
|
function _templateObject10() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-block;\n position: relative;\n height: auto;\n width: ", ";\n\n .MuiTextField-root {\n width: 100%;\n font-family: ", ";\n\n .MuiFormHelperText-root {\n font-weight: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", " !important;\n margin-top: 6px;\n }\n\n .MuiFormLabel-root {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-left: ", ";\n\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n\n &.Mui-focused {\n color: ", ";\n &.MuiInputLabel-shrink {\n transform: ", ";\n }\n }\n\n &.MuiInputLabel-shrink {\n font-family: ", ";\n\n transform: ", ";\n }\n\n &.Mui-error {\n color: ", ";\n }\n\n &:not(.MuiInputLabel-shrink) {\n font-family: ", ";\n color: ", ";\n\n & + div,\n & + div + p {\n color: ", ";\n }\n }\n\n &.MuiInputLabel-shrink {\n & + div::before {\n border-color: ", ";\n }\n & + div + p {\n color: ", ";\n }\n }\n }\n\n .MuiInputBase-root.MuiInput-root.MuiInput-underline {\n font-family: ", ";\n\n &::before {\n border-bottom: ", ";\n }\n\n &:not(.Mui-error)::before,\n &:not(&.Mui-focused)::before {\n border-bottom: ", ";\n }\n\n &::after {\n border-bottom: ", ";\n }\n\n &.Mui-error {\n &::before {\n border-width: ", ";\n border-color: ", ";\n }\n &::after {\n transform: scaleX(0);\n }\n }\n\n &.Mui-focused {\n &::after {\n border-width: calc(", " + 1px);\n border-color: ", ";\n }\n &.Mui-error::after {\n border-color: ", ";\n }\n }\n\n &.Mui-disabled {\n cursor: not-allowed;\n\n &::before {\n border-bottom: ", ";\n border-bottom-style: solid;\n }\n }\n\n .MuiInputBase-input {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-left: ", ";\n text-overflow: ellipsis;\n\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n }\n\n .MuiInputAdornment-root {\n height: 20px;\n\n &.MuiInputAdornment-positionEnd {\n & > p {\n font-family: ", ";\n margin-right: 8px;\n margin-bottom: 1px;\n }\n }\n &.Mui-disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n }\n\n &:hover:not(.Mui-disabled):before &:hover:not(.Mui-error):before {\n border-bottom-color: ", ";\n }\n }\n\n & > p {\n &.Mui-error {\n color: ", " !important;\n }\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n }\n }\n"]);
|
|
50
50
|
|
|
51
51
|
_templateObject10 = function _templateObject10() {
|
|
52
52
|
return data;
|
|
@@ -116,7 +116,7 @@ function _templateObject4() {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
function _templateObject3() {
|
|
119
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n .MuiPaper-root {\n max-height: 250px;\n overflow: auto;\n ::-webkit-scrollbar {\n width: 3px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n
|
|
119
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n .MuiPaper-root {\n max-height: 250px;\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n border-color: ", ";\n border-width: ", ";\n border-style: ", ";\n overflow: auto;\n\n ::-webkit-scrollbar {\n width: 3px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n\n li {\n padding-bottom: ", ";\n padding-top: ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n }\n }\n"]);
|
|
120
120
|
|
|
121
121
|
_templateObject3 = function _templateObject3() {
|
|
122
122
|
return data;
|
|
@@ -166,7 +166,7 @@ var makeCancelable = function makeCancelable(promise) {
|
|
|
166
166
|
};
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
var
|
|
169
|
+
var V3DxcInputText = function V3DxcInputText(_ref) {
|
|
170
170
|
var _ref$label = _ref.label,
|
|
171
171
|
label = _ref$label === void 0 ? " " : _ref$label,
|
|
172
172
|
_ref$name = _ref.name,
|
|
@@ -333,6 +333,28 @@ var DxcInputText = function DxcInputText(_ref) {
|
|
|
333
333
|
}
|
|
334
334
|
};
|
|
335
335
|
|
|
336
|
+
var ThemedSuggestions = function ThemedSuggestions() {
|
|
337
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
338
|
+
return _react["default"].createElement(SuggestionsContainer, {
|
|
339
|
+
margin: margin,
|
|
340
|
+
size: size,
|
|
341
|
+
backgroundType: backgroundType
|
|
342
|
+
}, _react["default"].createElement(_Paper["default"], null, isOpen && !isSearching && !isError && filteredOptions.length === 0 && _react["default"].createElement(_MenuItem["default"], null, "No matches found."), isOpen && !isSearching && filteredOptions.length > 0 && filteredOptions.map(function (suggestion) {
|
|
343
|
+
return _react["default"].createElement(_MenuItem["default"], {
|
|
344
|
+
key: suggestion,
|
|
345
|
+
disableRipple: true,
|
|
346
|
+
onMouseDown: function onMouseDown(event) {
|
|
347
|
+
return event.preventDefault();
|
|
348
|
+
},
|
|
349
|
+
onClick: function onClick() {
|
|
350
|
+
return handlerSuggestionClicked(suggestion);
|
|
351
|
+
}
|
|
352
|
+
}, suggestion);
|
|
353
|
+
}), isSearching && _react["default"].createElement(_MenuItem["default"], null, "Searching..."), isError && _react["default"].createElement(_MenuItem["default"], null, "Error fetching data", _react["default"].createElement(ErrorIcon, {
|
|
354
|
+
src: _error["default"]
|
|
355
|
+
}))));
|
|
356
|
+
};
|
|
357
|
+
|
|
336
358
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
337
359
|
theme: colorsTheme.inputText
|
|
338
360
|
}, _react["default"].createElement(TextContainer, {
|
|
@@ -422,22 +444,9 @@ var DxcInputText = function DxcInputText(_ref) {
|
|
|
422
444
|
marginTop: "0px"
|
|
423
445
|
}
|
|
424
446
|
}
|
|
425
|
-
}, _react["default"].createElement(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}, _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_Paper["default"], null, isOpen && !isSearching && !isError && filteredOptions.length === 0 && _react["default"].createElement(_MenuItem["default"], null, "No matches found."), isOpen && !isSearching && filteredOptions.length > 0 && filteredOptions.map(function (suggestion) {
|
|
429
|
-
return _react["default"].createElement(_MenuItem["default"], {
|
|
430
|
-
key: suggestion,
|
|
431
|
-
onMouseDown: function onMouseDown(event) {
|
|
432
|
-
return event.preventDefault();
|
|
433
|
-
},
|
|
434
|
-
onClick: function onClick() {
|
|
435
|
-
return handlerSuggestionClicked(suggestion);
|
|
436
|
-
}
|
|
437
|
-
}, suggestion);
|
|
438
|
-
}), isSearching && _react["default"].createElement(_MenuItem["default"], null, "Searching..."), isError && _react["default"].createElement(_MenuItem["default"], null, "Error fetching data", _react["default"].createElement(ErrorIcon, {
|
|
439
|
-
src: _error["default"]
|
|
440
|
-
})))))));
|
|
447
|
+
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
448
|
+
color: colorsTheme.inputText.optionBackgroundColor
|
|
449
|
+
}, _react["default"].createElement(ThemedSuggestions, null))));
|
|
441
450
|
};
|
|
442
451
|
|
|
443
452
|
var sizes = {
|
|
@@ -473,14 +482,38 @@ var DxcSuggestions = (0, _styledComponents["default"])(_Popper["default"])(_temp
|
|
|
473
482
|
|
|
474
483
|
var SuggestionsContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
475
484
|
return calculateWidth(props.margin, props.size);
|
|
485
|
+
}, function (props) {
|
|
486
|
+
return props.theme.optionBackgroundColor;
|
|
487
|
+
}, function (props) {
|
|
488
|
+
return props.theme.fontFamily;
|
|
489
|
+
}, function (props) {
|
|
490
|
+
return props.theme.optionFontSize;
|
|
491
|
+
}, function (props) {
|
|
492
|
+
return props.theme.optionFontStyle;
|
|
493
|
+
}, function (props) {
|
|
494
|
+
return props.theme.optionFontWeight;
|
|
495
|
+
}, function (props) {
|
|
496
|
+
return props.backgroundType === "dark" ? props.theme.optionFontColorOnDark : props.theme.optionFontColor;
|
|
497
|
+
}, function (props) {
|
|
498
|
+
return props.theme.optionBorderColor;
|
|
499
|
+
}, function (props) {
|
|
500
|
+
return props.theme.optionBorderThickness;
|
|
501
|
+
}, function (props) {
|
|
502
|
+
return props.theme.optionBorderStyle;
|
|
476
503
|
}, function (props) {
|
|
477
504
|
return props.theme.scrollBarTrackColor;
|
|
478
505
|
}, function (props) {
|
|
479
506
|
return props.theme.scrollBarThumbColor;
|
|
507
|
+
}, function (props) {
|
|
508
|
+
return props.theme.optionPaddingBottom;
|
|
509
|
+
}, function (props) {
|
|
510
|
+
return props.theme.optionPaddingTop;
|
|
480
511
|
}, function (props) {
|
|
481
512
|
return props.theme.hoverOptionColor;
|
|
482
513
|
}, function (props) {
|
|
483
|
-
return props.theme.
|
|
514
|
+
return props.backgroundType === "dark" ? props.theme.hoverOptionBackgroundColorOnDark : props.theme.hoverOptionBackgroundColor;
|
|
515
|
+
}, function (props) {
|
|
516
|
+
return props.backgroundType === "dark" ? props.theme.selectedOptionBackgroundColorOnDark : props.theme.selectedOptionBackgroundColor;
|
|
484
517
|
});
|
|
485
518
|
|
|
486
519
|
var PrefixIcon = _styledComponents["default"].img(_templateObject4(), function (props) {
|
|
@@ -490,7 +523,7 @@ var PrefixIcon = _styledComponents["default"].img(_templateObject4(), function (
|
|
|
490
523
|
});
|
|
491
524
|
|
|
492
525
|
var PrefixIconContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
493
|
-
return props.backgroundType === "dark" ? props.theme.prefixIconColorOnDark
|
|
526
|
+
return props.backgroundType === "dark" ? props.theme.prefixIconColorOnDark : props.theme.prefixIconColor;
|
|
494
527
|
}, function (props) {
|
|
495
528
|
return props.disabled && 0.5 || 1;
|
|
496
529
|
}, function (props) {
|
|
@@ -500,13 +533,13 @@ var PrefixIconContainer = _styledComponents["default"].div(_templateObject5(), f
|
|
|
500
533
|
var PrefixLabel = _styledComponents["default"].span(_templateObject6(), function (props) {
|
|
501
534
|
return props.theme.prefixLabelFontWeight;
|
|
502
535
|
}, function (props) {
|
|
503
|
-
return props.theme.
|
|
536
|
+
return props.theme.fontFamily;
|
|
504
537
|
}, function (props) {
|
|
505
538
|
return props.theme.prefixLabelFontSize;
|
|
506
539
|
}, function (props) {
|
|
507
540
|
return props.theme.prefixLabelFontStyle;
|
|
508
541
|
}, function (props) {
|
|
509
|
-
return props.backgroundType === "dark" ? props.theme.prefixLabelFontColorOnDark
|
|
542
|
+
return props.backgroundType === "dark" ? props.theme.prefixLabelFontColorOnDark : props.theme.prefixLabelFontColor;
|
|
510
543
|
}, function (props) {
|
|
511
544
|
return props.disabled && 0.5 || 1;
|
|
512
545
|
}, function (props) {
|
|
@@ -520,7 +553,7 @@ var SuffixIcon = _styledComponents["default"].img(_templateObject7(), function (
|
|
|
520
553
|
});
|
|
521
554
|
|
|
522
555
|
var SuffixIconContainer = _styledComponents["default"].div(_templateObject8(), function (props) {
|
|
523
|
-
return props.backgroundType === "dark" ? props.theme.suffixIconColorOnDark
|
|
556
|
+
return props.backgroundType === "dark" ? props.theme.suffixIconColorOnDark : props.theme.suffixIconColor;
|
|
524
557
|
}, function (props) {
|
|
525
558
|
return props.disabled && 0.5 || 1;
|
|
526
559
|
}, function (props) {
|
|
@@ -532,18 +565,16 @@ var SuffixLabel = _styledComponents["default"].span(_templateObject9(), function
|
|
|
532
565
|
}, function (props) {
|
|
533
566
|
return props.theme.suffixLabelFontWeight;
|
|
534
567
|
}, function (props) {
|
|
535
|
-
return props.theme.
|
|
568
|
+
return props.theme.fontFamily;
|
|
536
569
|
}, function (props) {
|
|
537
570
|
return props.theme.suffixLabelFontSize;
|
|
538
571
|
}, function (props) {
|
|
539
572
|
return props.theme.suffixLabelFontStyle;
|
|
540
573
|
}, function (props) {
|
|
541
|
-
return props.backgroundType === "dark" ? props.theme.suffixLabelFontColorOnDark
|
|
574
|
+
return props.backgroundType === "dark" ? props.theme.suffixLabelFontColorOnDark : props.theme.suffixLabelFontColor;
|
|
542
575
|
});
|
|
543
576
|
|
|
544
577
|
var TextContainer = _styledComponents["default"].div(_templateObject10(), function (props) {
|
|
545
|
-
return props.theme.fontSizeBase;
|
|
546
|
-
}, function (props) {
|
|
547
578
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
548
579
|
}, function (props) {
|
|
549
580
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -556,88 +587,95 @@ var TextContainer = _styledComponents["default"].div(_templateObject10(), functi
|
|
|
556
587
|
}, function (props) {
|
|
557
588
|
return calculateWidth(props.margin, props.size);
|
|
558
589
|
}, function (props) {
|
|
559
|
-
return props.theme.
|
|
590
|
+
return props.theme.fontFamily;
|
|
560
591
|
}, function (props) {
|
|
561
592
|
return props.theme.assistiveTextFontWeight;
|
|
562
593
|
}, function (props) {
|
|
563
|
-
return props.theme.
|
|
594
|
+
return props.theme.fontFamily;
|
|
564
595
|
}, function (props) {
|
|
565
596
|
return props.theme.assistiveTextFontSize;
|
|
566
597
|
}, function (props) {
|
|
567
598
|
return props.theme.assistiveTextFontStyle;
|
|
568
599
|
}, function (props) {
|
|
569
|
-
return props.backgroundType === "dark" ? props.theme.assistiveTextFontColorOnDark
|
|
600
|
+
return props.backgroundType === "dark" ? props.theme.assistiveTextFontColorOnDark : props.theme.assistiveTextFontColor;
|
|
570
601
|
}, function (props) {
|
|
571
602
|
return props.theme.labelFontSize;
|
|
572
603
|
}, function (props) {
|
|
573
|
-
return props.
|
|
604
|
+
return props.theme.labelFontStyle;
|
|
605
|
+
}, function (props) {
|
|
606
|
+
return props.theme.labelFontWeight;
|
|
574
607
|
}, function (props) {
|
|
575
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
608
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
576
609
|
}, function (props) {
|
|
577
610
|
return (props.prefixIconSrc || props.prefix || props.prefixIcon) && "32px" || "inherit";
|
|
578
611
|
}, function (props) {
|
|
579
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
612
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
613
|
+
}, function (props) {
|
|
614
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
580
615
|
}, function (props) {
|
|
581
616
|
return props.prefixIconSrc || props.prefixIcon || (props.prefix || props.suffix) && "translate(8px, 1.5px) scale(0.75);" || "translate(0, 1.5px) scale(0.75);";
|
|
582
617
|
}, function (props) {
|
|
583
|
-
return props.theme.
|
|
618
|
+
return props.theme.fontFamily;
|
|
584
619
|
}, function (props) {
|
|
585
620
|
return props.prefixIcon && "translate(8px, 1.5px) scale(0.75);" || props.prefixIconSrc && "translate(8px, 1.5px) scale(0.75);" || props.prefix && "translate(8px, 1.5px) scale(0.75);" || "translate(0, 1.5px) scale(0.75);";
|
|
586
621
|
}, function (props) {
|
|
587
622
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
588
623
|
}, function (props) {
|
|
589
|
-
return props.theme.
|
|
624
|
+
return props.theme.fontFamily;
|
|
590
625
|
}, function (props) {
|
|
591
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
626
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
592
627
|
}, function (props) {
|
|
593
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
628
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
594
629
|
}, function (props) {
|
|
595
|
-
return props.backgroundType === "dark" ? props.theme.underlineColorOnDark
|
|
630
|
+
return props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor;
|
|
596
631
|
}, function (props) {
|
|
597
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
632
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
598
633
|
}, function (props) {
|
|
599
|
-
return props.theme.
|
|
634
|
+
return props.theme.fontFamily;
|
|
600
635
|
}, function (props) {
|
|
601
|
-
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark
|
|
636
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
602
637
|
}, function (props) {
|
|
603
|
-
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark
|
|
638
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
604
639
|
}, function (props) {
|
|
605
|
-
return "
|
|
640
|
+
return "calc(".concat(props.theme.underlineThickness, " + 1px) solid ").concat(props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor);
|
|
606
641
|
}, function (props) {
|
|
607
642
|
return props.theme.underlineThickness;
|
|
608
643
|
}, function (props) {
|
|
609
644
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
610
645
|
}, function (props) {
|
|
611
|
-
return props.
|
|
646
|
+
return props.theme.underlineThickness;
|
|
647
|
+
}, function (props) {
|
|
648
|
+
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
612
649
|
}, function (props) {
|
|
613
650
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
614
651
|
}, function (props) {
|
|
615
|
-
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.
|
|
652
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor, " !important");
|
|
616
653
|
}, function (props) {
|
|
617
|
-
return
|
|
654
|
+
return props.theme.valueFontSize;
|
|
655
|
+
}, function (props) {
|
|
656
|
+
return props.theme.valueFontStyle;
|
|
618
657
|
}, function (props) {
|
|
619
|
-
return props.
|
|
658
|
+
return props.theme.valueFontWeight;
|
|
620
659
|
}, function (props) {
|
|
621
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
660
|
+
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
622
661
|
}, function (props) {
|
|
623
|
-
return props.
|
|
662
|
+
return (props.prefixIconSrc || props.prefix || props.prefixIcon) && "32px" || "inherit";
|
|
624
663
|
}, function (props) {
|
|
625
|
-
return props.theme.
|
|
664
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
626
665
|
}, function (props) {
|
|
627
|
-
return props.
|
|
666
|
+
return props.theme.fontFamily;
|
|
628
667
|
}, function (props) {
|
|
629
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
668
|
+
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
630
669
|
}, function (props) {
|
|
631
670
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
632
671
|
}, function (props) {
|
|
633
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
672
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
634
673
|
});
|
|
635
674
|
|
|
636
|
-
|
|
675
|
+
V3DxcInputText.propTypes = {
|
|
637
676
|
label: _propTypes["default"].string,
|
|
638
677
|
name: _propTypes["default"].string,
|
|
639
678
|
value: _propTypes["default"].string,
|
|
640
|
-
theme: _propTypes["default"].oneOf(["light", "dark", ""]),
|
|
641
679
|
assistiveText: _propTypes["default"].string,
|
|
642
680
|
disabled: _propTypes["default"].bool,
|
|
643
681
|
prefix: _propTypes["default"].string,
|
|
@@ -665,5 +703,5 @@ DxcInputText.propTypes = {
|
|
|
665
703
|
autocompleteOptions: _propTypes["default"].any,
|
|
666
704
|
tabIndex: _propTypes["default"].number
|
|
667
705
|
};
|
|
668
|
-
var _default =
|
|
706
|
+
var _default = V3DxcInputText;
|
|
669
707
|
exports["default"] = _default;
|
|
@@ -124,7 +124,7 @@ function _templateObject2() {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
function _templateObject() {
|
|
127
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right:0;\n"]);
|
|
127
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n"]);
|
|
128
128
|
|
|
129
129
|
_templateObject = function _templateObject() {
|
|
130
130
|
return data;
|
package/dist/link/Link.js
CHANGED
|
@@ -25,8 +25,18 @@ var _variables = require("../common/variables.js");
|
|
|
25
25
|
|
|
26
26
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
27
27
|
|
|
28
|
+
function _templateObject6() {
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n overflow: hidden;\n \n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
30
|
+
|
|
31
|
+
_templateObject6 = function _templateObject6() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
function _templateObject5() {
|
|
29
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n"]);
|
|
30
40
|
|
|
31
41
|
_templateObject5 = function _templateObject5() {
|
|
32
42
|
return data;
|
|
@@ -36,7 +46,7 @@ function _templateObject5() {
|
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
function _templateObject4() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n display: inline-flex;\n flex-direction: ", ";\n justify-content: ", ";\n align-items: center;\n max-width: 100%;\n"]);
|
|
40
50
|
|
|
41
51
|
_templateObject4 = function _templateObject4() {
|
|
42
52
|
return data;
|
|
@@ -46,7 +56,7 @@ function _templateObject4() {
|
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
function _templateObject3() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n text-decoration-color: transparent;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:hover {\n ", "\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: 1px;\n ", "\n }\n &:active {\n ", "\n }\n"]);
|
|
50
60
|
|
|
51
61
|
_templateObject3 = function _templateObject3() {
|
|
52
62
|
return data;
|
|
@@ -56,7 +66,7 @@ function _templateObject3() {
|
|
|
56
66
|
}
|
|
57
67
|
|
|
58
68
|
function _templateObject2() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n\n text-decoration-color: transparent;\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n ", "\n }\n &:active {\n ", "\n }\n"]);
|
|
60
70
|
|
|
61
71
|
_templateObject2 = function _templateObject2() {
|
|
62
72
|
return data;
|
|
@@ -66,7 +76,7 @@ function _templateObject2() {
|
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
function _templateObject() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
79
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
70
80
|
|
|
71
81
|
_templateObject = function _templateObject() {
|
|
72
82
|
return data;
|
|
@@ -76,9 +86,7 @@ function _templateObject() {
|
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
var DxcLink = function DxcLink(_ref) {
|
|
79
|
-
var _ref$
|
|
80
|
-
underlined = _ref$underlined === void 0 ? true : _ref$underlined,
|
|
81
|
-
_ref$inheritColor = _ref.inheritColor,
|
|
89
|
+
var _ref$inheritColor = _ref.inheritColor,
|
|
82
90
|
inheritColor = _ref$inheritColor === void 0 ? false : _ref$inheritColor,
|
|
83
91
|
_ref$disabled = _ref.disabled,
|
|
84
92
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
@@ -99,10 +107,6 @@ var DxcLink = function DxcLink(_ref) {
|
|
|
99
107
|
var colorsTheme = (0, _useTheme["default"])();
|
|
100
108
|
|
|
101
109
|
var linkContent = _react["default"].createElement(LinkText, {
|
|
102
|
-
underlined: underlined,
|
|
103
|
-
inheritColor: inheritColor,
|
|
104
|
-
disabled: disabled,
|
|
105
|
-
margin: margin,
|
|
106
110
|
iconPosition: iconPosition
|
|
107
111
|
}, text, icon ? _react["default"].createElement(LinkIconContainer, {
|
|
108
112
|
iconPosition: iconPosition
|
|
@@ -113,27 +117,25 @@ var DxcLink = function DxcLink(_ref) {
|
|
|
113
117
|
|
|
114
118
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
115
119
|
theme: colorsTheme.link
|
|
120
|
+
}, _react["default"].createElement(DxcLinkContainer, {
|
|
121
|
+
margin: margin
|
|
116
122
|
}, onClick ? _react["default"].createElement(StyledButton, {
|
|
117
123
|
type: "button",
|
|
118
124
|
onClick: !disabled && onClick,
|
|
119
|
-
|
|
125
|
+
margin: margin,
|
|
126
|
+
disabled: disabled,
|
|
127
|
+
inheritColor: inheritColor
|
|
120
128
|
}, linkContent) : _react["default"].createElement(StyledLink, {
|
|
121
129
|
tabIndex: tabIndex,
|
|
122
130
|
href: !disabled && href,
|
|
123
131
|
target: newWindow ? "_blank" : "_self",
|
|
132
|
+
margin: margin,
|
|
133
|
+
disabled: disabled,
|
|
124
134
|
inheritColor: inheritColor
|
|
125
|
-
}, linkContent));
|
|
135
|
+
}, linkContent)));
|
|
126
136
|
};
|
|
127
137
|
|
|
128
|
-
var
|
|
129
|
-
return props.theme.fontSize;
|
|
130
|
-
}, function (props) {
|
|
131
|
-
return props.theme.fontWeight;
|
|
132
|
-
}, function (props) {
|
|
133
|
-
return props.theme.fontStyle;
|
|
134
|
-
}, function (props) {
|
|
135
|
-
return props.theme.fontFamily;
|
|
136
|
-
}, function (props) {
|
|
138
|
+
var DxcLinkContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
137
139
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
138
140
|
}, function (props) {
|
|
139
141
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -143,54 +145,77 @@ var LinkText = _styledComponents["default"].div(_templateObject(), function (pro
|
|
|
143
145
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
144
146
|
}, function (props) {
|
|
145
147
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
var StyledLink = _styledComponents["default"].a(_templateObject2(), function (props) {
|
|
151
|
+
return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
|
|
146
152
|
}, function (props) {
|
|
147
|
-
return props.
|
|
153
|
+
return props.disabled ? "pointer-events: none;" : "";
|
|
148
154
|
}, function (props) {
|
|
149
|
-
return props.
|
|
155
|
+
return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
|
|
150
156
|
}, function (props) {
|
|
151
|
-
return !props.
|
|
157
|
+
return !props.inheritColor ? props.theme.visitedFontColor : "";
|
|
152
158
|
}, function (props) {
|
|
153
|
-
return props.
|
|
159
|
+
return "color: ".concat(props.theme.visitedFontColor, ";\n border-bottom-color: ").concat(props.theme.visitedUnderlineColor, ";");
|
|
154
160
|
}, function (props) {
|
|
155
|
-
return props.
|
|
161
|
+
return "color: ".concat(props.theme.hoverFontColor, ";\n border-bottom-color: ").concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
|
|
156
162
|
}, function (props) {
|
|
157
|
-
return props.
|
|
163
|
+
return props.theme.focusColor;
|
|
158
164
|
}, function (props) {
|
|
159
|
-
return
|
|
165
|
+
return props.disabled && "outline: none";
|
|
160
166
|
}, function (props) {
|
|
161
|
-
return
|
|
167
|
+
return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
|
|
162
168
|
});
|
|
163
169
|
|
|
164
|
-
var
|
|
165
|
-
return props.theme.
|
|
170
|
+
var StyledButton = _styledComponents["default"].button(_templateObject3(), function (props) {
|
|
171
|
+
return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
|
|
166
172
|
}, function (props) {
|
|
167
|
-
return props.
|
|
173
|
+
return props.disabled && "cursor: default;";
|
|
174
|
+
}, function (props) {
|
|
175
|
+
return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
|
|
176
|
+
}, function (props) {
|
|
177
|
+
return props.disabled ? "pointer-events: none;" : "";
|
|
178
|
+
}, function (props) {
|
|
179
|
+
return "color: ".concat(props.theme.hoverFontColor, ";\n border-bottom-color: ").concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
|
|
168
180
|
}, function (props) {
|
|
169
|
-
return props.
|
|
181
|
+
return props.theme.focusColor;
|
|
170
182
|
}, function (props) {
|
|
171
|
-
return props.
|
|
183
|
+
return props.disabled && "outline: none";
|
|
184
|
+
}, function (props) {
|
|
185
|
+
return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
|
|
172
186
|
});
|
|
173
187
|
|
|
174
|
-
var
|
|
175
|
-
return props.theme.
|
|
188
|
+
var LinkText = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
189
|
+
return props.theme.fontSize;
|
|
176
190
|
}, function (props) {
|
|
177
|
-
return props.theme.
|
|
191
|
+
return props.theme.fontWeight;
|
|
178
192
|
}, function (props) {
|
|
179
|
-
return props.
|
|
193
|
+
return props.theme.fontStyle;
|
|
180
194
|
}, function (props) {
|
|
181
|
-
return props.theme.
|
|
195
|
+
return props.theme.fontFamily;
|
|
196
|
+
}, function (props) {
|
|
197
|
+
return props.iconPosition === "after" ? "row" : "row-reverse";
|
|
198
|
+
}, function (props) {
|
|
199
|
+
return props.iconPosition === "after" ? "flex-start" : "flex-end";
|
|
182
200
|
});
|
|
183
201
|
|
|
184
|
-
var
|
|
185
|
-
return props.
|
|
202
|
+
var LinkIcon = _styledComponents["default"].img(_templateObject5(), function (props) {
|
|
203
|
+
return props.theme.iconSize;
|
|
204
|
+
}, function (props) {
|
|
205
|
+
return props.theme.iconSize;
|
|
206
|
+
}, function (props) {
|
|
207
|
+
return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
|
|
186
208
|
});
|
|
187
209
|
|
|
188
|
-
var
|
|
189
|
-
return props.
|
|
210
|
+
var LinkIconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
211
|
+
return props.theme.iconSize;
|
|
212
|
+
}, function (props) {
|
|
213
|
+
return props.theme.iconSize;
|
|
214
|
+
}, function (props) {
|
|
215
|
+
return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
|
|
190
216
|
});
|
|
191
217
|
|
|
192
218
|
DxcLink.propTypes = {
|
|
193
|
-
underlined: _propTypes["default"].bool,
|
|
194
219
|
inheritColor: _propTypes["default"].bool,
|
|
195
220
|
disabled: _propTypes["default"].bool,
|
|
196
221
|
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as DxcAlert } from "./alert/index";
|
|
2
|
+
export { default as DxcNewSelect } from "./new-select/index";
|
|
3
|
+
export { default as DxcTextInput } from "./text-input/index";
|
|
4
|
+
export { default as DxcDateInput } from "./date-input/index";
|
|
5
|
+
export { default as DxcTextarea } from "./textarea/index";
|
|
6
|
+
export { default as DxcNumberInput } from "./number-input/index";
|
|
7
|
+
export { default as DxcPasswordInput } from "./password-input/index";
|
|
8
|
+
export { default as DxcFileInput } from "./file-input/index";
|