@dxc-technology/halstack-react 0.0.0-c4ba791 → 0.0.0-c7ec4d1
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/babel.config.js +6 -2
- package/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +218 -22
- package/dist/V3Select/V3Select.js +549 -0
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/accordion/Accordion.js +134 -54
- package/dist/accordion-group/AccordionGroup.js +36 -9
- package/dist/alert/Alert.js +183 -84
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +23 -18
- package/dist/box/Box.js +31 -23
- package/dist/button/Button.js +63 -27
- package/dist/card/Card.js +72 -35
- package/dist/checkbox/Checkbox.js +98 -39
- package/dist/chip/Chip.js +97 -40
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1428 -282
- package/dist/date/Date.js +74 -52
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +58 -37
- package/dist/dropdown/Dropdown.js +176 -81
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +287 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +90 -40
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +192 -95
- package/dist/header/Icons.js +59 -0
- package/dist/heading/Heading.js +93 -16
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +251 -116
- package/dist/layout/ApplicationLayout.js +18 -26
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +86 -41
- package/dist/main.d.ts +8 -0
- package/dist/main.js +74 -18
- 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 +116 -65
- package/dist/password-input/PasswordInput.js +203 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +95 -38
- package/dist/radio/Radio.js +31 -17
- package/dist/resultsetTable/ResultsetTable.js +82 -65
- package/dist/select/Select.js +896 -284
- package/dist/select/index.d.ts +53 -0
- package/dist/sidenav/Sidenav.js +66 -15
- package/dist/slider/Slider.js +211 -73
- package/dist/spinner/Spinner.js +247 -59
- package/dist/switch/Switch.js +50 -27
- package/dist/table/Table.js +51 -24
- package/dist/tabs/Tabs.js +88 -37
- package/dist/tag/Tag.js +68 -35
- package/dist/text-input/TextInput.js +974 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +248 -106
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle/Toggle.js +16 -19
- package/dist/toggle-group/ToggleGroup.js +142 -41
- package/dist/upload/Upload.js +16 -11
- package/dist/upload/buttons-upload/ButtonsUpload.js +32 -19
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +84 -34
- package/dist/upload/dragAndDropArea/Icons.js +39 -0
- package/dist/upload/file-upload/FileToUpload.js +64 -33
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/files-upload/FilesToUpload.js +16 -16
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +42 -49
- package/dist/upload/transactions/Transactions.js +38 -20
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +126 -52
- package/package.json +10 -9
- 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/Heading.test.js +60 -12
- 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 +40 -57
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +33 -8
- 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/{Select.test.js → V3Select.test.js} +56 -36
- 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/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- 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/link/readme.md +0 -51
- 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/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- 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/slider/readme.md +0 -64
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/readme.md +0 -82
- package/dist/upload/Upload.stories.js +0 -72
- 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/readme.md +0 -37
- 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 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/TabsForSections.test.js +0 -34
package/dist/table/Table.js
CHANGED
|
@@ -13,7 +13,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
13
13
|
|
|
14
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
|
|
16
|
-
var _react =
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
19
|
|
|
@@ -21,20 +21,12 @@ var _variables = require("../common/variables.js");
|
|
|
21
21
|
|
|
22
22
|
var _utils = require("../common/utils.js");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
28
|
-
|
|
29
|
-
_templateObject3 = function _templateObject3() {
|
|
30
|
-
return data;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
35
27
|
|
|
36
28
|
function _templateObject2() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n border-collapse: collapse;\n width: 100%;\n\n & tr {\n border-bottom:
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n border-collapse: collapse;\n width: 100%;\n\n & tr {\n border-bottom: ", ";\n }\n & td {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th:first-child {\n border-top-left-radius: ", ";\n }\n & th:last-child {\n border-top-right-radius: ", ";\n }\n"]);
|
|
38
30
|
|
|
39
31
|
_templateObject2 = function _templateObject2() {
|
|
40
32
|
return data;
|
|
@@ -44,7 +36,7 @@ function _templateObject2() {
|
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
function _templateObject() {
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n overflow: hidden auto;\n &::-webkit-scrollbar {\n width: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\n"]);
|
|
48
40
|
|
|
49
41
|
_templateObject = function _templateObject() {
|
|
50
42
|
return data;
|
|
@@ -56,15 +48,14 @@ function _templateObject() {
|
|
|
56
48
|
var DxcTable = function DxcTable(_ref) {
|
|
57
49
|
var children = _ref.children,
|
|
58
50
|
margin = _ref.margin;
|
|
59
|
-
var
|
|
60
|
-
var colorsTheme = (0, _react.useMemo)(function () {
|
|
61
|
-
return (0, _utils.getCustomTheme)(_variables.componentTokens, (0, _utils.getCustomTheme)(_variables.defaultTheme, customTheme));
|
|
62
|
-
}, [customTheme]);
|
|
51
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
63
52
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
64
53
|
theme: colorsTheme.table
|
|
65
54
|
}, _react["default"].createElement(DxcTableContainer, {
|
|
66
55
|
margin: margin
|
|
67
|
-
}, _react["default"].createElement(DxcTableContent, null, _react["default"].createElement(
|
|
56
|
+
}, _react["default"].createElement(DxcTableContent, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
57
|
+
color: colorsTheme.table.dataBackgroundColor
|
|
58
|
+
}, children))));
|
|
68
59
|
};
|
|
69
60
|
|
|
70
61
|
var calculateWidth = function calculateWidth(margin) {
|
|
@@ -84,22 +75,58 @@ var DxcTableContainer = _styledComponents["default"].div(_templateObject(), func
|
|
|
84
75
|
}, function (props) {
|
|
85
76
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
86
77
|
}, function (props) {
|
|
87
|
-
return props.theme.
|
|
78
|
+
return props.theme.scrollBarThumbColor;
|
|
88
79
|
}, function (props) {
|
|
89
|
-
return props.theme.
|
|
80
|
+
return props.theme.scrollBarTrackColor;
|
|
90
81
|
});
|
|
91
82
|
|
|
92
83
|
var DxcTableContent = _styledComponents["default"].table(_templateObject2(), function (props) {
|
|
93
|
-
return props.theme.
|
|
84
|
+
return "".concat(props.theme.rowSeparatorThickness, " ").concat(props.theme.rowSeparatorStyle, " ").concat(props.theme.rowSeparatorColor);
|
|
85
|
+
}, function (props) {
|
|
86
|
+
return props.theme.dataBackgroundColor;
|
|
87
|
+
}, function (props) {
|
|
88
|
+
return props.theme.dataFontFamily;
|
|
89
|
+
}, function (props) {
|
|
90
|
+
return props.theme.dataFontSize;
|
|
91
|
+
}, function (props) {
|
|
92
|
+
return props.theme.dataFontStyle;
|
|
93
|
+
}, function (props) {
|
|
94
|
+
return props.theme.dataFontWeight;
|
|
95
|
+
}, function (props) {
|
|
96
|
+
return props.theme.dataFontColor;
|
|
97
|
+
}, function (props) {
|
|
98
|
+
return props.theme.dataFontTextTransform;
|
|
94
99
|
}, function (props) {
|
|
95
|
-
return props.theme.
|
|
100
|
+
return props.theme.dataTextAlign;
|
|
101
|
+
}, function (props) {
|
|
102
|
+
return props.theme.dataTextLineHeight;
|
|
103
|
+
}, function (props) {
|
|
104
|
+
return "".concat(props.theme.dataPaddingTop, " ").concat(props.theme.dataPaddingRight, " ").concat(props.theme.dataPaddingBottom, " ").concat(props.theme.dataPaddingLeft);
|
|
96
105
|
}, function (props) {
|
|
97
106
|
return props.theme.headerBackgroundColor;
|
|
107
|
+
}, function (props) {
|
|
108
|
+
return props.theme.headerFontFamily;
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return props.theme.headerFontSize;
|
|
111
|
+
}, function (props) {
|
|
112
|
+
return props.theme.headerFontStyle;
|
|
113
|
+
}, function (props) {
|
|
114
|
+
return props.theme.headerFontWeight;
|
|
98
115
|
}, function (props) {
|
|
99
116
|
return props.theme.headerFontColor;
|
|
117
|
+
}, function (props) {
|
|
118
|
+
return props.theme.headerFontTextTransform;
|
|
119
|
+
}, function (props) {
|
|
120
|
+
return props.theme.headerTextAlign;
|
|
121
|
+
}, function (props) {
|
|
122
|
+
return props.theme.headerTextLineHeight;
|
|
123
|
+
}, function (props) {
|
|
124
|
+
return "".concat(props.theme.headerPaddingTop, " ").concat(props.theme.headerPaddingRight, " ").concat(props.theme.headerPaddingBottom, " ").concat(props.theme.headerPaddingLeft);
|
|
125
|
+
}, function (props) {
|
|
126
|
+
return props.theme.headerBorderRadius;
|
|
127
|
+
}, function (props) {
|
|
128
|
+
return props.theme.headerBorderRadius;
|
|
100
129
|
});
|
|
101
130
|
|
|
102
|
-
var DxcTableTBody = _styledComponents["default"].tbody(_templateObject3());
|
|
103
|
-
|
|
104
131
|
var _default = DxcTable;
|
|
105
132
|
exports["default"] = _default;
|
package/dist/tabs/Tabs.js
CHANGED
|
@@ -29,16 +29,24 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
29
29
|
|
|
30
30
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
31
|
|
|
32
|
-
require("../common/OpenSans.css");
|
|
33
|
-
|
|
34
32
|
var _variables = require("../common/variables.js");
|
|
35
33
|
|
|
36
34
|
var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
37
35
|
|
|
38
36
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
39
37
|
|
|
38
|
+
function _templateObject9() {
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n margin-bottom: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n align-items: center;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject9 = function _templateObject9() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
function _templateObject8() {
|
|
41
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n"]);
|
|
42
50
|
|
|
43
51
|
_templateObject8 = function _templateObject8() {
|
|
44
52
|
return data;
|
|
@@ -48,7 +56,7 @@ function _templateObject8() {
|
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
function _templateObject7() {
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height:
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n .MuiTabs-root {\n background: white;\n min-height: ", ";\n\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform: ", " !important;\n }\n .MuiButtonBase-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n\n padding: ", ";\n height: ", ";\n min-width: 90px;\n max-width: 360px;\n min-height: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n font-weight: ", ";\n }\n &:not(.Mui-selected) {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-selected {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-disabled {\n cursor: not-allowed !important;\n pointer-events: all;\n color: ", ";\n font-style: ", ";\n svg {\n color: ", ";\n }\n }\n &:focus {\n outline: ", " auto 1px;\n }\n }\n .MuiTabs-indicator {\n background-color: ", ";\n height: ", ";\n }\n .MuiTabs-scrollButtons {\n min-width: ", ";\n width: ", ";\n padding: 0;\n }\n @media (max-width: 599.95px) {\n .MuiTabs-scrollButtonsDesktop {\n display: flex;\n }\n }\n }\n"]);
|
|
52
60
|
|
|
53
61
|
_templateObject7 = function _templateObject7() {
|
|
54
62
|
return data;
|
|
@@ -58,7 +66,7 @@ function _templateObject7() {
|
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
function _templateObject6() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"]);
|
|
62
70
|
|
|
63
71
|
_templateObject6 = function _templateObject6() {
|
|
64
72
|
return data;
|
|
@@ -68,7 +76,7 @@ function _templateObject6() {
|
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
function _templateObject5() {
|
|
71
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
79
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
72
80
|
|
|
73
81
|
_templateObject5 = function _templateObject5() {
|
|
74
82
|
return data;
|
|
@@ -78,7 +86,7 @@ function _templateObject5() {
|
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
function _templateObject4() {
|
|
81
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
89
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width: 23px;\n height: 17px;\n"]);
|
|
82
90
|
|
|
83
91
|
_templateObject4 = function _templateObject4() {
|
|
84
92
|
return data;
|
|
@@ -88,7 +96,7 @@ function _templateObject4() {
|
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
function _templateObject3() {
|
|
91
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["
|
|
99
|
+
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
92
100
|
|
|
93
101
|
_templateObject3 = function _templateObject3() {
|
|
94
102
|
return data;
|
|
@@ -98,7 +106,7 @@ function _templateObject3() {
|
|
|
98
106
|
}
|
|
99
107
|
|
|
100
108
|
function _templateObject2() {
|
|
101
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
109
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n"]);
|
|
102
110
|
|
|
103
111
|
_templateObject2 = function _templateObject2() {
|
|
104
112
|
return data;
|
|
@@ -108,7 +116,7 @@ function _templateObject2() {
|
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
function _templateObject() {
|
|
111
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
119
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n"]);
|
|
112
120
|
|
|
113
121
|
_templateObject = function _templateObject() {
|
|
114
122
|
return data;
|
|
@@ -125,7 +133,9 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
125
133
|
onTabHover = _ref.onTabHover,
|
|
126
134
|
margin = _ref.margin,
|
|
127
135
|
_ref$iconPosition = _ref.iconPosition,
|
|
128
|
-
iconPosition = _ref$iconPosition === void 0 ? "left" : _ref$iconPosition
|
|
136
|
+
iconPosition = _ref$iconPosition === void 0 ? "left" : _ref$iconPosition,
|
|
137
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
138
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
129
139
|
|
|
130
140
|
var _React$useState = _react["default"].useState(0),
|
|
131
141
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -147,8 +157,12 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
147
157
|
}
|
|
148
158
|
};
|
|
149
159
|
|
|
160
|
+
var getTabIndex = function getTabIndex(index, disabled) {
|
|
161
|
+
return (activeTabIndex === index || innerActiveTabIndex === index) && !disabled ? tabIndex : -1;
|
|
162
|
+
};
|
|
163
|
+
|
|
150
164
|
var getLabelForTab = function getLabelForTab(tab) {
|
|
151
|
-
return _react["default"].createElement(MainLabelContainer, {
|
|
165
|
+
return _react["default"].createElement(ParentLabelSpan, null, _react["default"].createElement(MainLabelContainer, {
|
|
152
166
|
hasBadge: tab.notificationNumber
|
|
153
167
|
}, _react["default"].createElement(TabLabelContainer, {
|
|
154
168
|
hasLabelAndIcon: hasLabelAndIcon,
|
|
@@ -158,7 +172,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
158
172
|
iconPosition: iconPosition
|
|
159
173
|
}, (0, _typeof2["default"])(tab.icon) === "object" ? tab.icon : _react["default"].createElement(tab.icon)) : tab.iconSrc && _react["default"].createElement(TabIcon, {
|
|
160
174
|
src: tab.iconSrc
|
|
161
|
-
}), _react["default"].createElement(LabelTextContainer, null, tab.label)), tab.notificationNumber && tab.notificationNumber !== false && _react["default"].createElement(BadgeContainer, {
|
|
175
|
+
}), _react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && _react["default"].createElement(BadgeContainer, {
|
|
162
176
|
hasLabelAndIcon: hasLabelAndIcon,
|
|
163
177
|
iconPosition: iconPosition
|
|
164
178
|
}, _react["default"].createElement(_Badge["default"], {
|
|
@@ -175,7 +189,6 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
175
189
|
}, _react["default"].createElement(Underline, null), _react["default"].createElement(_Tabs["default"], {
|
|
176
190
|
value: activeTabIndex != null ? activeTabIndex : innerActiveTabIndex,
|
|
177
191
|
onChange: handleChange,
|
|
178
|
-
onMouseOver: onTabHover,
|
|
179
192
|
variant: "scrollable",
|
|
180
193
|
scrollButtons: "auto"
|
|
181
194
|
}, tabs.map(function (tab, i) {
|
|
@@ -188,35 +201,46 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
188
201
|
});
|
|
189
202
|
|
|
190
203
|
return _react["default"].createElement(_Tab["default"], {
|
|
204
|
+
tabIndex: (activeTabIndex === i || innerActiveTabIndex === i) && !tab.isDisabled ? tabIndex : -1,
|
|
191
205
|
key: "tab".concat(i).concat(tab.label),
|
|
192
206
|
label: getLabelForTab(tab),
|
|
193
207
|
disabled: tab.isDisabled,
|
|
194
|
-
disableRipple: true
|
|
208
|
+
disableRipple: true,
|
|
209
|
+
onMouseEnter: function onMouseEnter() {
|
|
210
|
+
onTabHover(i);
|
|
211
|
+
},
|
|
212
|
+
onMouseLeave: function onMouseLeave() {
|
|
213
|
+
onTabHover(null);
|
|
214
|
+
}
|
|
195
215
|
});
|
|
196
216
|
}))));
|
|
197
217
|
};
|
|
198
218
|
|
|
199
|
-
var
|
|
219
|
+
var ParentLabelSpan = _styledComponents["default"].div(_templateObject());
|
|
220
|
+
|
|
221
|
+
var TabLabelContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
200
222
|
return props.hasLabelAndIcon && props.iconPosition === "top" && "column" || "row";
|
|
201
223
|
});
|
|
202
224
|
|
|
203
|
-
var LabelTextContainer = _styledComponents["default"].div(
|
|
225
|
+
var LabelTextContainer = _styledComponents["default"].div(_templateObject3());
|
|
204
226
|
|
|
205
|
-
var BadgeContainer = _styledComponents["default"].div(
|
|
206
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "
|
|
227
|
+
var BadgeContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
228
|
+
return props.hasLabelAndIcon && props.iconPosition === "top" && "0" || "5px";
|
|
207
229
|
});
|
|
208
230
|
|
|
209
|
-
var MainLabelContainer = _styledComponents["default"].div(
|
|
210
|
-
return props.hasBadge && "
|
|
231
|
+
var MainLabelContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
232
|
+
return props.hasBadge && "35px" || "unset";
|
|
211
233
|
}, function (props) {
|
|
212
|
-
return props.hasBadge && "
|
|
234
|
+
return props.hasBadge && "35px" || "unset";
|
|
213
235
|
});
|
|
214
236
|
|
|
215
|
-
var Underline = _styledComponents["default"].div(
|
|
216
|
-
return props.theme.
|
|
237
|
+
var Underline = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
238
|
+
return props.theme.dividerThickness;
|
|
239
|
+
}, function (props) {
|
|
240
|
+
return props.theme.dividerColor;
|
|
217
241
|
});
|
|
218
242
|
|
|
219
|
-
var DxCTabs = _styledComponents["default"].div(
|
|
243
|
+
var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
220
244
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
221
245
|
}, function (props) {
|
|
222
246
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -226,37 +250,63 @@ var DxCTabs = _styledComponents["default"].div(_templateObject6(), function (pro
|
|
|
226
250
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
227
251
|
}, function (props) {
|
|
228
252
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
253
|
+
}, function (props) {
|
|
254
|
+
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
255
|
+
}, function (props) {
|
|
256
|
+
return props.theme.fontTextTransform;
|
|
257
|
+
}, function (props) {
|
|
258
|
+
return props.theme.fontFamily;
|
|
259
|
+
}, function (props) {
|
|
260
|
+
return props.theme.fontSize;
|
|
261
|
+
}, function (props) {
|
|
262
|
+
return props.theme.fontStyle;
|
|
263
|
+
}, function (props) {
|
|
264
|
+
return props.theme.fontWeight;
|
|
229
265
|
}, function (props) {
|
|
230
266
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
231
267
|
}, function (props) {
|
|
232
268
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
233
269
|
}, function (props) {
|
|
234
|
-
return props.
|
|
270
|
+
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
235
271
|
}, function (props) {
|
|
236
272
|
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
237
273
|
}, function (props) {
|
|
238
274
|
return "".concat(props.theme.pressedBackgroundColor, " !important");
|
|
239
275
|
}, function (props) {
|
|
240
|
-
return props.theme.
|
|
276
|
+
return "".concat(props.theme.pressedFontWeight, " !important");
|
|
277
|
+
}, function (props) {
|
|
278
|
+
return props.theme.unselectedBackgroundColor;
|
|
241
279
|
}, function (props) {
|
|
242
|
-
return props.theme.
|
|
280
|
+
return props.theme.unselectedFontColor;
|
|
243
281
|
}, function (props) {
|
|
244
|
-
return props.theme.
|
|
282
|
+
return props.theme.unselectedIconColor;
|
|
283
|
+
}, function (props) {
|
|
284
|
+
return props.theme.selectedBackgroundColor;
|
|
245
285
|
}, function (props) {
|
|
246
286
|
return props.theme.selectedFontColor;
|
|
247
287
|
}, function (props) {
|
|
248
|
-
return props.theme.
|
|
288
|
+
return props.theme.selectedIconColor;
|
|
249
289
|
}, function (props) {
|
|
250
290
|
return props.theme.disabledFontColor;
|
|
251
291
|
}, function (props) {
|
|
252
|
-
return props.theme.
|
|
292
|
+
return props.theme.disabledFontStyle;
|
|
253
293
|
}, function (props) {
|
|
254
|
-
return props.theme.
|
|
294
|
+
return props.theme.disabledIconColor;
|
|
295
|
+
}, function (props) {
|
|
296
|
+
return props.theme.focusOutline;
|
|
297
|
+
}, function (props) {
|
|
298
|
+
return props.theme.selectedUnderlineColor;
|
|
299
|
+
}, function (props) {
|
|
300
|
+
return props.theme.selectedUnderlineThickness;
|
|
301
|
+
}, function (props) {
|
|
302
|
+
return props.theme.scrollButtonsWidth;
|
|
303
|
+
}, function (props) {
|
|
304
|
+
return props.theme.scrollButtonsWidth;
|
|
255
305
|
});
|
|
256
306
|
|
|
257
|
-
var TabIcon = _styledComponents["default"].img(
|
|
307
|
+
var TabIcon = _styledComponents["default"].img(_templateObject8());
|
|
258
308
|
|
|
259
|
-
var TabIconContainer = _styledComponents["default"].div(
|
|
309
|
+
var TabIconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
260
310
|
return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
|
|
261
311
|
}, function (props) {
|
|
262
312
|
return props.hasLabelAndIcon && props.iconPosition === "left" && "12px" || "";
|
|
@@ -270,8 +320,8 @@ DxcTabs.propTypes = {
|
|
|
270
320
|
label: _propTypes["default"].string,
|
|
271
321
|
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
272
322
|
iconSrc: _propTypes["default"].string,
|
|
273
|
-
isDisabled: _propTypes["default"]
|
|
274
|
-
notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"]["
|
|
323
|
+
isDisabled: _propTypes["default"].bool,
|
|
324
|
+
notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string, _propTypes["default"].number])
|
|
275
325
|
})),
|
|
276
326
|
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
277
327
|
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
@@ -279,7 +329,8 @@ DxcTabs.propTypes = {
|
|
|
279
329
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
280
330
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
281
331
|
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
282
|
-
iconPosition: _propTypes["default"].oneOf(["top", "left"])
|
|
332
|
+
iconPosition: _propTypes["default"].oneOf(["top", "left"]),
|
|
333
|
+
tabIndex: _propTypes["default"].number
|
|
283
334
|
};
|
|
284
335
|
DxcTabs.defaultProps = {
|
|
285
336
|
activeTabIndex: null,
|
package/dist/tag/Tag.js
CHANGED
|
@@ -19,16 +19,18 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
|
22
|
-
var _styledComponents =
|
|
22
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
24
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
25
|
|
|
26
26
|
var _variables = require("../common/variables.js");
|
|
27
27
|
|
|
28
|
+
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
|
+
|
|
28
30
|
var _Box = _interopRequireDefault(require("../box/Box"));
|
|
29
31
|
|
|
30
32
|
function _templateObject8() {
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
33
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"]);
|
|
32
34
|
|
|
33
35
|
_templateObject8 = function _templateObject8() {
|
|
34
36
|
return data;
|
|
@@ -38,7 +40,7 @@ function _templateObject8() {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
function _templateObject7() {
|
|
41
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width:
|
|
43
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width: ", ";\n height: 100%;\n justify-content: center;\n align-items: center;\n color: ", ";\n"]);
|
|
42
44
|
|
|
43
45
|
_templateObject7 = function _templateObject7() {
|
|
44
46
|
return data;
|
|
@@ -48,7 +50,7 @@ function _templateObject7() {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
function _templateObject6() {
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
53
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n\n img,\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
|
|
52
54
|
|
|
53
55
|
_templateObject6 = function _templateObject6() {
|
|
54
56
|
return data;
|
|
@@ -58,7 +60,7 @@ function _templateObject6() {
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
function _templateObject5() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
63
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n width: ", ";\n height: ", ";\n"]);
|
|
62
64
|
|
|
63
65
|
_templateObject5 = function _templateObject5() {
|
|
64
66
|
return data;
|
|
@@ -68,7 +70,7 @@ function _templateObject5() {
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
function _templateObject4() {
|
|
71
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n
|
|
73
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border-radius: 4px;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n\n :focus {\n outline: 2px solid ", ";\n }\n"]);
|
|
72
74
|
|
|
73
75
|
_templateObject4 = function _templateObject4() {
|
|
74
76
|
return data;
|
|
@@ -78,7 +80,7 @@ function _templateObject4() {
|
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
function _templateObject3() {
|
|
81
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n"]);
|
|
83
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n border-radius: 4px;\n\n :focus {\n outline: 2px solid ", ";\n outline-offset: 0px;\n }\n"]);
|
|
82
84
|
|
|
83
85
|
_templateObject3 = function _templateObject3() {
|
|
84
86
|
return data;
|
|
@@ -88,7 +90,7 @@ function _templateObject3() {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
function _templateObject2() {
|
|
91
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n width: ", ";\n"]);
|
|
93
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n width: ", ";\n height: ", ";\n"]);
|
|
92
94
|
|
|
93
95
|
_templateObject2 = function _templateObject2() {
|
|
94
96
|
return data;
|
|
@@ -98,7 +100,7 @@ function _templateObject2() {
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
function _templateObject() {
|
|
101
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n
|
|
103
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
102
104
|
|
|
103
105
|
_templateObject = function _templateObject() {
|
|
104
106
|
return data;
|
|
@@ -115,13 +117,16 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
115
117
|
linkHref = _ref.linkHref,
|
|
116
118
|
onClick = _ref.onClick,
|
|
117
119
|
_ref$iconBgColor = _ref.iconBgColor,
|
|
118
|
-
iconBgColor = _ref$iconBgColor === void 0 ? "
|
|
120
|
+
iconBgColor = _ref$iconBgColor === void 0 ? "#5f249f" : _ref$iconBgColor,
|
|
119
121
|
_ref$labelPosition = _ref.labelPosition,
|
|
120
122
|
labelPosition = _ref$labelPosition === void 0 ? "after" : _ref$labelPosition,
|
|
121
123
|
_ref$newWindow = _ref.newWindow,
|
|
122
124
|
newWindow = _ref$newWindow === void 0 ? false : _ref$newWindow,
|
|
123
125
|
_ref$size = _ref.size,
|
|
124
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size
|
|
126
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
127
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
128
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
129
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
125
130
|
|
|
126
131
|
var _useState = (0, _react.useState)(false),
|
|
127
132
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -129,9 +134,7 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
129
134
|
changeIsHovered = _useState2[1];
|
|
130
135
|
|
|
131
136
|
var clickHandler = function clickHandler() {
|
|
132
|
-
|
|
133
|
-
onClick();
|
|
134
|
-
}
|
|
137
|
+
onClick && onClick();
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
var tagContent = _react["default"].createElement(_Box["default"], {
|
|
@@ -139,7 +142,6 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
139
142
|
shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
|
|
140
143
|
}, _react["default"].createElement(TagContent, {
|
|
141
144
|
labelPosition: labelPosition,
|
|
142
|
-
margin: margin,
|
|
143
145
|
size: size
|
|
144
146
|
}, _react["default"].createElement(IconContainer, {
|
|
145
147
|
iconBgColor: iconBgColor
|
|
@@ -147,7 +149,9 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
147
149
|
src: iconSrc
|
|
148
150
|
})), size !== "small" && _react["default"].createElement(TagLabel, null, label)));
|
|
149
151
|
|
|
150
|
-
return _react["default"].createElement(
|
|
152
|
+
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
153
|
+
theme: colorsTheme.tag
|
|
154
|
+
}, _react["default"].createElement(StyledDxcTag, {
|
|
151
155
|
margin: margin,
|
|
152
156
|
onMouseEnter: function onMouseEnter() {
|
|
153
157
|
return changeIsHovered(true);
|
|
@@ -157,10 +161,13 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
157
161
|
},
|
|
158
162
|
onClick: clickHandler,
|
|
159
163
|
hasAction: onClick || linkHref
|
|
160
|
-
}, onClick ? _react["default"].createElement(StyledButton,
|
|
164
|
+
}, onClick ? _react["default"].createElement(StyledButton, {
|
|
165
|
+
tabIndex: tabIndex
|
|
166
|
+
}, tagContent) : linkHref ? _react["default"].createElement(StyledLink, {
|
|
167
|
+
tabIndex: tabIndex,
|
|
161
168
|
href: linkHref,
|
|
162
169
|
target: newWindow ? "_blank" : "_self"
|
|
163
|
-
}, tagContent) : tagContent);
|
|
170
|
+
}, tagContent) : tagContent));
|
|
164
171
|
};
|
|
165
172
|
|
|
166
173
|
var sizes = {
|
|
@@ -200,22 +207,58 @@ var TagContent = _styledComponents["default"].div(_templateObject2(), function (
|
|
|
200
207
|
return labelPosition === "before" && "row-reverse" || "row";
|
|
201
208
|
}, function (props) {
|
|
202
209
|
return calculateWidth(props.size);
|
|
210
|
+
}, function (props) {
|
|
211
|
+
return props.theme.height;
|
|
203
212
|
});
|
|
204
213
|
|
|
205
|
-
var StyledLink = _styledComponents["default"].a(_templateObject3())
|
|
214
|
+
var StyledLink = _styledComponents["default"].a(_templateObject3(), function (props) {
|
|
215
|
+
return props.theme.focusColor;
|
|
216
|
+
});
|
|
206
217
|
|
|
207
|
-
var StyledButton = _styledComponents["default"].button(_templateObject4())
|
|
218
|
+
var StyledButton = _styledComponents["default"].button(_templateObject4(), function (props) {
|
|
219
|
+
return props.theme.focusColor;
|
|
220
|
+
});
|
|
208
221
|
|
|
209
|
-
var TagIcon = _styledComponents["default"].img(_templateObject5())
|
|
222
|
+
var TagIcon = _styledComponents["default"].img(_templateObject5(), function (props) {
|
|
223
|
+
return props.theme.iconWidth;
|
|
224
|
+
}, function (props) {
|
|
225
|
+
return props.theme.iconHeight;
|
|
226
|
+
});
|
|
210
227
|
|
|
211
|
-
var TagIconContainer = _styledComponents["default"].div(_templateObject6())
|
|
228
|
+
var TagIconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
229
|
+
return props.theme.iconWidth;
|
|
230
|
+
}, function (props) {
|
|
231
|
+
return props.theme.iconHeight;
|
|
232
|
+
});
|
|
212
233
|
|
|
213
234
|
var IconContainer = _styledComponents["default"].div(_templateObject7(), function (_ref9) {
|
|
214
235
|
var iconBgColor = _ref9.iconBgColor;
|
|
215
236
|
return iconBgColor;
|
|
237
|
+
}, function (props) {
|
|
238
|
+
return props.theme.iconSectionWidth;
|
|
239
|
+
}, function (props) {
|
|
240
|
+
return props.theme.iconColor;
|
|
216
241
|
});
|
|
217
242
|
|
|
218
|
-
var TagLabel = _styledComponents["default"].div(_templateObject8())
|
|
243
|
+
var TagLabel = _styledComponents["default"].div(_templateObject8(), function (props) {
|
|
244
|
+
return props.theme.fontFamily;
|
|
245
|
+
}, function (props) {
|
|
246
|
+
return props.theme.fontSize;
|
|
247
|
+
}, function (props) {
|
|
248
|
+
return props.theme.fontStyle;
|
|
249
|
+
}, function (props) {
|
|
250
|
+
return props.theme.fontWeight;
|
|
251
|
+
}, function (props) {
|
|
252
|
+
return props.theme.fontColor;
|
|
253
|
+
}, function (props) {
|
|
254
|
+
return props.theme.labelPaddingTop;
|
|
255
|
+
}, function (props) {
|
|
256
|
+
return props.theme.labelPaddingBottom;
|
|
257
|
+
}, function (props) {
|
|
258
|
+
return props.theme.labelPaddingLeft;
|
|
259
|
+
}, function (props) {
|
|
260
|
+
return props.theme.labelPaddingRight;
|
|
261
|
+
});
|
|
219
262
|
|
|
220
263
|
DxcTag.propTypes = {
|
|
221
264
|
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
@@ -232,18 +275,8 @@ DxcTag.propTypes = {
|
|
|
232
275
|
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
233
276
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
234
277
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
235
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
236
|
-
|
|
237
|
-
DxcTag.defaultProps = {
|
|
238
|
-
icon: null,
|
|
239
|
-
iconSrc: null,
|
|
240
|
-
label: null,
|
|
241
|
-
margin: null,
|
|
242
|
-
linkHref: null,
|
|
243
|
-
onClick: null,
|
|
244
|
-
iconBgColor: "black",
|
|
245
|
-
labelPosition: "after",
|
|
246
|
-
newWindow: false
|
|
278
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
279
|
+
tabIndex: _propTypes["default"].number
|
|
247
280
|
};
|
|
248
281
|
var _default = DxcTag;
|
|
249
282
|
exports["default"] = _default;
|