@dxc-technology/halstack-react 0.0.0-3fa9e5c → 0.0.0-422fa7b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +181 -114
- package/dist/accordion/Accordion.js +131 -46
- package/dist/accordion-group/AccordionGroup.js +34 -4
- package/dist/alert/Alert.js +180 -80
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +28 -7
- package/dist/box/Box.js +29 -18
- package/dist/button/Button.js +60 -21
- package/dist/card/Card.js +72 -35
- package/dist/checkbox/Checkbox.js +97 -26
- package/dist/chip/Chip.js +92 -32
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1352 -185
- package/dist/date/Date.js +65 -38
- package/dist/dialog/Dialog.js +54 -31
- package/dist/dropdown/Dropdown.js +173 -75
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +73 -44
- package/dist/footer/dxc_logo.svg +15 -0
- package/dist/header/Header.js +91 -56
- package/dist/header/dxc_logo_black.svg +8 -0
- package/dist/heading/Heading.js +81 -16
- package/dist/input-text/InputText.js +245 -99
- package/dist/layout/ApplicationLayout.js +11 -10
- package/dist/link/Link.js +84 -34
- package/dist/main.d.ts +8 -0
- package/dist/main.js +65 -1
- package/dist/new-date/NewDate.js +400 -0
- package/dist/new-date/index.d.ts +95 -0
- package/dist/new-input-text/NewInputText.js +967 -0
- package/dist/new-input-text/index.d.ts +135 -0
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/new-textarea/NewTextarea.js +365 -0
- package/dist/new-textarea/index.d.ts +117 -0
- package/dist/number/Number.js +136 -0
- package/dist/number/NumberContext.js +16 -0
- package/dist/number/index.d.ts +113 -0
- package/dist/paginator/Paginator.js +60 -18
- package/dist/password/Password.js +200 -0
- package/dist/password/index.d.ts +94 -0
- package/dist/password/styles.css +3 -0
- package/dist/progress-bar/ProgressBar.js +91 -33
- package/dist/radio/Radio.js +30 -11
- package/dist/resultsetTable/ResultsetTable.js +76 -44
- package/dist/select/Select.js +221 -147
- package/dist/sidenav/Sidenav.js +64 -8
- package/dist/slider/Slider.js +117 -55
- package/dist/spinner/Spinner.js +247 -56
- package/dist/switch/Switch.js +51 -19
- package/dist/table/Table.js +47 -5
- package/dist/tabs/Tabs.js +50 -14
- package/dist/tag/Tag.js +68 -35
- package/dist/textarea/Textarea.js +77 -33
- package/dist/toggle/Toggle.js +3 -3
- package/dist/toggle-group/ToggleGroup.js +53 -39
- package/dist/upload/Upload.js +13 -8
- package/dist/upload/buttons-upload/ButtonsUpload.js +28 -8
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +70 -19
- package/dist/upload/file-upload/FileToUpload.js +46 -16
- package/dist/upload/files-upload/FilesToUpload.js +9 -6
- package/dist/upload/transaction/Transaction.js +41 -18
- package/dist/upload/transactions/Transactions.js +32 -10
- package/dist/wizard/Wizard.js +126 -40
- package/dist/wizard/invalid_icon.svg +4 -5
- package/dist/wizard/valid_icon.svg +4 -5
- package/package.json +6 -4
- package/test/AccordionGroup.test.js +16 -0
- package/test/Date.test.js +13 -13
- package/test/Dropdown.test.js +15 -0
- package/test/FileInput.test.js +201 -0
- package/test/Link.test.js +3 -2
- package/test/NewDate.test.js +232 -0
- package/test/NewInputText.test.js +734 -0
- package/test/NewTextarea.test.js +195 -0
- package/test/Number.test.js +257 -0
- package/test/Paginator.test.js +1 -1
- package/test/Password.test.js +83 -0
- package/test/ResultsetTable.test.js +1 -2
- package/test/Select.test.js +44 -24
- package/test/Spinner.test.js +5 -0
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/toggle-group/readme.md +0 -82
package/dist/tabs/Tabs.js
CHANGED
|
@@ -29,8 +29,6 @@ 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"));
|
|
@@ -58,7 +56,7 @@ function _templateObject8() {
|
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
function _templateObject7() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n .MuiTabs-root {\n background: white;\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform:
|
|
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"]);
|
|
62
60
|
|
|
63
61
|
_templateObject7 = function _templateObject7() {
|
|
64
62
|
return data;
|
|
@@ -68,7 +66,7 @@ function _templateObject7() {
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
function _templateObject6() {
|
|
71
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height:
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"]);
|
|
72
70
|
|
|
73
71
|
_templateObject6 = function _templateObject6() {
|
|
74
72
|
return data;
|
|
@@ -88,7 +86,7 @@ function _templateObject5() {
|
|
|
88
86
|
}
|
|
89
87
|
|
|
90
88
|
function _templateObject4() {
|
|
91
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width:23px;\n height: 17px;\n
|
|
89
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width: 23px;\n height: 17px;\n"]);
|
|
92
90
|
|
|
93
91
|
_templateObject4 = function _templateObject4() {
|
|
94
92
|
return data;
|
|
@@ -135,7 +133,9 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
135
133
|
onTabHover = _ref.onTabHover,
|
|
136
134
|
margin = _ref.margin,
|
|
137
135
|
_ref$iconPosition = _ref.iconPosition,
|
|
138
|
-
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;
|
|
139
139
|
|
|
140
140
|
var _React$useState = _react["default"].useState(0),
|
|
141
141
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -157,6 +157,10 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
|
|
160
|
+
var getTabIndex = function getTabIndex(index, disabled) {
|
|
161
|
+
return (activeTabIndex === index || innerActiveTabIndex === index) && !disabled ? tabIndex : -1;
|
|
162
|
+
};
|
|
163
|
+
|
|
160
164
|
var getLabelForTab = function getLabelForTab(tab) {
|
|
161
165
|
return _react["default"].createElement(ParentLabelSpan, null, _react["default"].createElement(MainLabelContainer, {
|
|
162
166
|
hasBadge: tab.notificationNumber
|
|
@@ -197,6 +201,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
197
201
|
});
|
|
198
202
|
|
|
199
203
|
return _react["default"].createElement(_Tab["default"], {
|
|
204
|
+
tabIndex: (activeTabIndex === i || innerActiveTabIndex === i) && !tab.isDisabled ? tabIndex : -1,
|
|
200
205
|
key: "tab".concat(i).concat(tab.label),
|
|
201
206
|
label: getLabelForTab(tab),
|
|
202
207
|
disabled: tab.isDisabled,
|
|
@@ -230,7 +235,9 @@ var MainLabelContainer = _styledComponents["default"].div(_templateObject5(), fu
|
|
|
230
235
|
});
|
|
231
236
|
|
|
232
237
|
var Underline = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
233
|
-
return props.theme.
|
|
238
|
+
return props.theme.dividerThickness;
|
|
239
|
+
}, function (props) {
|
|
240
|
+
return props.theme.dividerColor;
|
|
234
241
|
});
|
|
235
242
|
|
|
236
243
|
var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
@@ -243,30 +250,58 @@ var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (pro
|
|
|
243
250
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
244
251
|
}, function (props) {
|
|
245
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;
|
|
246
265
|
}, function (props) {
|
|
247
266
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
248
267
|
}, function (props) {
|
|
249
268
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
250
269
|
}, function (props) {
|
|
251
|
-
return props.
|
|
270
|
+
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
252
271
|
}, function (props) {
|
|
253
272
|
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
254
273
|
}, function (props) {
|
|
255
274
|
return "".concat(props.theme.pressedBackgroundColor, " !important");
|
|
256
275
|
}, function (props) {
|
|
257
|
-
return props.theme.
|
|
276
|
+
return "".concat(props.theme.pressedFontWeight, " !important");
|
|
277
|
+
}, function (props) {
|
|
278
|
+
return props.theme.unselectedBackgroundColor;
|
|
258
279
|
}, function (props) {
|
|
259
|
-
return props.theme.
|
|
280
|
+
return props.theme.unselectedFontColor;
|
|
260
281
|
}, function (props) {
|
|
261
|
-
return props.theme.
|
|
282
|
+
return props.theme.unselectedIconColor;
|
|
283
|
+
}, function (props) {
|
|
284
|
+
return props.theme.selectedBackgroundColor;
|
|
262
285
|
}, function (props) {
|
|
263
286
|
return props.theme.selectedFontColor;
|
|
287
|
+
}, function (props) {
|
|
288
|
+
return props.theme.selectedIconColor;
|
|
264
289
|
}, function (props) {
|
|
265
290
|
return props.theme.disabledFontColor;
|
|
291
|
+
}, function (props) {
|
|
292
|
+
return props.theme.disabledFontStyle;
|
|
293
|
+
}, function (props) {
|
|
294
|
+
return props.theme.disabledIconColor;
|
|
266
295
|
}, function (props) {
|
|
267
296
|
return props.theme.focusOutline;
|
|
268
297
|
}, function (props) {
|
|
269
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;
|
|
270
305
|
});
|
|
271
306
|
|
|
272
307
|
var TabIcon = _styledComponents["default"].img(_templateObject8());
|
|
@@ -285,8 +320,8 @@ DxcTabs.propTypes = {
|
|
|
285
320
|
label: _propTypes["default"].string,
|
|
286
321
|
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
287
322
|
iconSrc: _propTypes["default"].string,
|
|
288
|
-
isDisabled: _propTypes["default"]
|
|
289
|
-
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])
|
|
290
325
|
})),
|
|
291
326
|
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
292
327
|
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
@@ -294,7 +329,8 @@ DxcTabs.propTypes = {
|
|
|
294
329
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
295
330
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
296
331
|
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
297
|
-
iconPosition: _propTypes["default"].oneOf(["top", "left"])
|
|
332
|
+
iconPosition: _propTypes["default"].oneOf(["top", "left"]),
|
|
333
|
+
tabIndex: _propTypes["default"].number
|
|
298
334
|
};
|
|
299
335
|
DxcTabs.defaultProps = {
|
|
300
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;
|
|
@@ -25,8 +25,6 @@ var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
|
25
25
|
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
27
|
|
|
28
|
-
require("../common/OpenSans.css");
|
|
29
|
-
|
|
30
28
|
var _variables = require("../common/variables.js");
|
|
31
29
|
|
|
32
30
|
var _utils = require("../common/utils.js");
|
|
@@ -35,8 +33,10 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
35
33
|
|
|
36
34
|
var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
|
|
37
35
|
|
|
36
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
37
|
+
|
|
38
38
|
function _templateObject() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n
|
|
39
|
+
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\n .MuiFormHelperText-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin-top: 6px;\n }\n .MuiFormLabel-root {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n padding-left: \"inherit\";\n\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n\n &.Mui-focused {\n color: ", ";\n &.MuiInputLabel-shrink {\n transform: \"translate(0, 1.5px) scale(0.75);\";\n }\n }\n\n &.MuiInputLabel-shrink {\n font-family: ", ";\n transform: \"translate(0, 1.5px) scale(0.75)\";\n }\n\n &.Mui-error {\n color: ", ";\n }\n\n &:not(.MuiInputLabel-shrink) {\n font-family: ", ";\n color: ", ";\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 .MuiInputBase-root.MuiInput-root.MuiInput-underline {\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 .MuiInputBase-inputMultiline {\n overflow: auto !important;\n\n ::-webkit-scrollbar {\n width: 3px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\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-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n line-height: ", ";\n padding-left: \"inherit\";\n text-overflow: ellipsis;\n\n &.Mui-disabled {\n cursor: not-allowed;\n color: ", ";\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: ", ";\n }\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n }\n }\n"]);
|
|
40
40
|
|
|
41
41
|
_templateObject = function _templateObject() {
|
|
42
42
|
return data;
|
|
@@ -69,7 +69,9 @@ var DxcTextarea = function DxcTextarea(_ref) {
|
|
|
69
69
|
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
70
70
|
margin = _ref.margin,
|
|
71
71
|
_ref$size = _ref.size,
|
|
72
|
-
size = _ref$size === void 0 ? "medium" : _ref$size
|
|
72
|
+
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
73
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
74
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
73
75
|
|
|
74
76
|
var _useState = (0, _react.useState)(""),
|
|
75
77
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -77,6 +79,7 @@ var DxcTextarea = function DxcTextarea(_ref) {
|
|
|
77
79
|
setInnerValue = _useState2[1];
|
|
78
80
|
|
|
79
81
|
var colorsTheme = (0, _useTheme["default"])();
|
|
82
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
80
83
|
|
|
81
84
|
var handlerTextareaChange = function handlerTextareaChange(event) {
|
|
82
85
|
if (value === null || value === undefined) {
|
|
@@ -109,7 +112,8 @@ var DxcTextarea = function DxcTextarea(_ref) {
|
|
|
109
112
|
required: required,
|
|
110
113
|
assistiveText: assistiveText,
|
|
111
114
|
margin: margin,
|
|
112
|
-
size: size
|
|
115
|
+
size: size,
|
|
116
|
+
backgroundType: backgroundType
|
|
113
117
|
}, _react["default"].createElement(_TextField["default"], {
|
|
114
118
|
error: invalid,
|
|
115
119
|
value: value !== null ? value : innerValue,
|
|
@@ -121,7 +125,10 @@ var DxcTextarea = function DxcTextarea(_ref) {
|
|
|
121
125
|
onChange: handlerTextareaChange,
|
|
122
126
|
onBlur: onBlur && handlerTextareaBlur || null,
|
|
123
127
|
rows: numRows,
|
|
124
|
-
placeholder: placeholder
|
|
128
|
+
placeholder: placeholder,
|
|
129
|
+
inputProps: {
|
|
130
|
+
tabIndex: tabIndex
|
|
131
|
+
}
|
|
125
132
|
})));
|
|
126
133
|
};
|
|
127
134
|
|
|
@@ -133,11 +140,7 @@ var sizes = {
|
|
|
133
140
|
};
|
|
134
141
|
|
|
135
142
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
136
|
-
|
|
137
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return sizes[size];
|
|
143
|
+
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
141
144
|
};
|
|
142
145
|
|
|
143
146
|
var TextContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
@@ -153,47 +156,87 @@ var TextContainer = _styledComponents["default"].div(_templateObject(), function
|
|
|
153
156
|
}, function (props) {
|
|
154
157
|
return calculateWidth(props.margin, props.size);
|
|
155
158
|
}, function (props) {
|
|
156
|
-
return props.theme.
|
|
159
|
+
return props.theme.fontFamily;
|
|
160
|
+
}, function (props) {
|
|
161
|
+
return props.theme.assistiveTextFontSize;
|
|
162
|
+
}, function (props) {
|
|
163
|
+
return props.theme.assistiveTextFontStyle;
|
|
164
|
+
}, function (props) {
|
|
165
|
+
return props.theme.assistiveTextFontWeight;
|
|
166
|
+
}, function (props) {
|
|
167
|
+
return props.theme.assistiveTextLetterSpacing;
|
|
168
|
+
}, function (props) {
|
|
169
|
+
return props.theme.labelFontSize;
|
|
170
|
+
}, function (props) {
|
|
171
|
+
return props.theme.labelFontStyle;
|
|
172
|
+
}, function (props) {
|
|
173
|
+
return props.theme.labelFontWeight;
|
|
174
|
+
}, function (props) {
|
|
175
|
+
return props.theme.labelLetterSpacing;
|
|
176
|
+
}, function (props) {
|
|
177
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
178
|
+
}, function (props) {
|
|
179
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
180
|
+
}, function (props) {
|
|
181
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
182
|
+
}, function (props) {
|
|
183
|
+
return props.theme.fontFamily;
|
|
184
|
+
}, function (props) {
|
|
185
|
+
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
186
|
+
}, function (props) {
|
|
187
|
+
return props.theme.fontFamily;
|
|
188
|
+
}, function (props) {
|
|
189
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
190
|
+
}, function (props) {
|
|
191
|
+
return props.backgroundType === "dark" ? props.theme.assistiveTextFontColorOnDark : props.theme.assistiveTextFontColor;
|
|
192
|
+
}, function (props) {
|
|
193
|
+
return props.backgroundType ? props.theme.underlineColorOnDark : props.theme.underlineColor;
|
|
194
|
+
}, function (props) {
|
|
195
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
196
|
+
}, function (props) {
|
|
197
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
198
|
+
}, function (props) {
|
|
199
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
157
200
|
}, function (props) {
|
|
158
|
-
return props.theme.
|
|
201
|
+
return "calc(".concat(props.theme.underlineThickness, " + 1px) solid ").concat(props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor);
|
|
159
202
|
}, function (props) {
|
|
160
|
-
return props.theme.
|
|
203
|
+
return props.backgroundType === "dark" ? props.theme.scrollBarTrackColorOnDark : props.theme.scrollBarTrackColor;
|
|
161
204
|
}, function (props) {
|
|
162
|
-
return props.theme.
|
|
205
|
+
return props.backgroundType === "dark" ? props.theme.scrollBarThumbColorOnDark : props.theme.scrollBarThumbColor;
|
|
163
206
|
}, function (props) {
|
|
164
|
-
return props.theme.
|
|
207
|
+
return props.theme.underlineThickness;
|
|
165
208
|
}, function (props) {
|
|
166
|
-
return props.theme.
|
|
209
|
+
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
167
210
|
}, function (props) {
|
|
168
|
-
return props.theme.
|
|
211
|
+
return props.theme.underlineThickness;
|
|
169
212
|
}, function (props) {
|
|
170
|
-
return props.theme.
|
|
213
|
+
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
171
214
|
}, function (props) {
|
|
172
|
-
return "
|
|
215
|
+
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
173
216
|
}, function (props) {
|
|
174
|
-
return "
|
|
217
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor, " !important");
|
|
175
218
|
}, function (props) {
|
|
176
|
-
return
|
|
219
|
+
return props.theme.fontFamily;
|
|
177
220
|
}, function (props) {
|
|
178
|
-
return props.theme.
|
|
221
|
+
return props.theme.valueFontSize;
|
|
179
222
|
}, function (props) {
|
|
180
|
-
return props.theme.
|
|
223
|
+
return props.theme.valueFontStyle;
|
|
181
224
|
}, function (props) {
|
|
182
|
-
return props.theme.
|
|
225
|
+
return props.theme.valueFontWeight;
|
|
183
226
|
}, function (props) {
|
|
184
|
-
return props.theme.
|
|
227
|
+
return props.theme.valueLetterSpacing;
|
|
185
228
|
}, function (props) {
|
|
186
|
-
return props.theme.
|
|
229
|
+
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
187
230
|
}, function (props) {
|
|
188
|
-
return
|
|
231
|
+
return props.theme.valueLineHeight;
|
|
189
232
|
}, function (props) {
|
|
190
|
-
return props.theme.
|
|
233
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
191
234
|
}, function (props) {
|
|
192
|
-
return props.theme.
|
|
235
|
+
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
193
236
|
}, function (props) {
|
|
194
|
-
return "".concat(props.theme.
|
|
237
|
+
return "".concat(props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor, " !important");
|
|
195
238
|
}, function (props) {
|
|
196
|
-
return props.theme.
|
|
239
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
197
240
|
});
|
|
198
241
|
|
|
199
242
|
DxcTextarea.propTypes = {
|
|
@@ -214,7 +257,8 @@ DxcTextarea.propTypes = {
|
|
|
214
257
|
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
215
258
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
216
259
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
217
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
260
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
261
|
+
tabIndex: _propTypes["default"].number
|
|
218
262
|
};
|
|
219
263
|
var _default = DxcTextarea;
|
|
220
264
|
exports["default"] = _default;
|
package/dist/toggle/Toggle.js
CHANGED
|
@@ -23,8 +23,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
23
23
|
|
|
24
24
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
25
|
|
|
26
|
-
require("../common/OpenSans.css");
|
|
27
|
-
|
|
28
26
|
var _utils = require("../common/utils.js");
|
|
29
27
|
|
|
30
28
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
@@ -60,7 +58,7 @@ function _templateObject2() {
|
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
function _templateObject() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n & {\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n opacity: ", ";\n cursor: ", ";\n display: inline-block;\n width: ", ";\n }\n\n .MuiToggleButton-label {\n font-size: 14px;\n font-family:
|
|
61
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n & {\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n opacity: ", ";\n cursor: ", ";\n display: inline-block;\n width: ", ";\n }\n\n .MuiToggleButton-label {\n font-size: 14px;\n font-family: ", ";\n color: ", ";\n }\n .MuiButtonBase-root {\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n &:hover {\n background-color: ", ";\n .MuiToggleButton-label {\n color: ", ";\n }\n }\n }\n\n .MuiToggleButton-root {\n min-width: 42px;\n height: 43px;\n border: ", ";\n\n border-radius: 4px !important;\n }\n\n .MuiToggleButton-root.Mui-selected {\n background-color: ", ";\n &:hover {\n background-color: ", ";\n .MuiToggleButton-label {\n color: ", ";\n }\n }\n }\n\n .MuiToggleButton-root:last-child,\n .MuiToggleButton-root:first-child,\n .MuiToggleButton-root:not(:first-child) {\n padding: ", ";\n }\n\n .MuiTouchRipple-child {\n background-color: ", ";\n }\n"]);
|
|
64
62
|
|
|
65
63
|
_templateObject = function _templateObject() {
|
|
66
64
|
return data;
|
|
@@ -161,6 +159,8 @@ var DxcToggleContainer = _styledComponents["default"].div(_templateObject(), fun
|
|
|
161
159
|
return props.disabled ? "not-allowed" : "pointer";
|
|
162
160
|
}, function (props) {
|
|
163
161
|
return calculateWidth(props.margin, props.size);
|
|
162
|
+
}, function (props) {
|
|
163
|
+
return props.theme.fontFamily;
|
|
164
164
|
}, function (props) {
|
|
165
165
|
return props.brightness === "dark" && props.mode === "outlined" ? props.theme.white : props.theme.black;
|
|
166
166
|
}, function (props) {
|