@dxc-technology/halstack-react 0.0.0-c5f6a2f → 0.0.0-c6243ef
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 +130 -98
- package/dist/accordion/Accordion.js +80 -83
- package/dist/accordion-group/AccordionGroup.js +1 -3
- package/dist/alert/Alert.js +168 -83
- 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 +15 -8
- package/dist/checkbox/Checkbox.js +88 -21
- package/dist/chip/Chip.js +63 -21
- package/dist/common/variables.js +1105 -418
- package/dist/date/Date.js +60 -40
- package/dist/dialog/Dialog.js +44 -29
- package/dist/dropdown/Dropdown.js +162 -74
- 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 +25 -35
- package/dist/footer/dxc_logo.svg +15 -0
- package/dist/header/Header.js +14 -42
- package/dist/header/dxc_logo_black.svg +8 -0
- package/dist/heading/Heading.js +1 -5
- package/dist/input-text/InputText.js +132 -56
- package/dist/layout/ApplicationLayout.js +3 -3
- package/dist/link/Link.js +71 -46
- package/dist/main.d.ts +8 -0
- package/dist/main.js +56 -0
- package/dist/new-date/NewDate.js +400 -0
- package/dist/new-date/index.d.ts +95 -0
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/new-textarea/NewTextarea.js +369 -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 +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/radio/Radio.js +28 -9
- package/dist/resultsetTable/ResultsetTable.js +64 -38
- package/dist/select/Select.js +207 -148
- package/dist/sidenav/Sidenav.js +11 -15
- package/dist/slider/Slider.js +190 -63
- package/dist/spinner/Spinner.js +226 -59
- package/dist/switch/Switch.js +3 -3
- package/dist/table/Table.js +19 -5
- package/dist/tabs/Tabs.js +6 -10
- package/dist/tag/Tag.js +50 -36
- package/dist/text-input/TextInput.js +971 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +59 -33
- package/dist/toggle-group/ToggleGroup.js +130 -44
- package/dist/upload/Upload.js +1 -5
- package/dist/upload/buttons-upload/ButtonsUpload.js +27 -11
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +54 -18
- package/dist/upload/file-upload/FileToUpload.js +37 -15
- package/dist/upload/files-upload/FilesToUpload.js +3 -3
- package/dist/upload/transaction/Transaction.js +39 -16
- package/dist/upload/transactions/Transactions.js +24 -8
- 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 +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/NewTextarea.test.js +195 -0
- package/test/Number.test.js +257 -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/ToggleGroup.test.js +5 -1
- 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/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/input-text/InputText.stories.js +0 -209
- 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/select/Select.js
CHANGED
|
@@ -15,8 +15,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
15
15
|
|
|
16
16
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
17
|
|
|
18
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
-
|
|
20
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
19
|
|
|
22
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -27,12 +25,12 @@ var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel")
|
|
|
27
25
|
|
|
28
26
|
var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
|
|
29
27
|
|
|
28
|
+
var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
|
|
29
|
+
|
|
30
30
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
31
31
|
|
|
32
32
|
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
33
33
|
|
|
34
|
-
var _styles = require("@material-ui/core/styles");
|
|
35
|
-
|
|
36
34
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
37
35
|
|
|
38
36
|
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
@@ -45,8 +43,30 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
45
43
|
|
|
46
44
|
var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
|
|
47
45
|
|
|
46
|
+
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext.js"));
|
|
47
|
+
|
|
48
|
+
function _templateObject10() {
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-block;\n\n .MuiFormControl-root {\n width: 100%;\n }\n\n .MuiFormHelperText-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: 6px;\n\n &.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n }\n\n .MuiFormLabel-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: -3px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n height: 22px;\n display: flex;\n align-items: center;\n\n &.Mui-disabled {\n color: ", ";\n }\n &.Mui-focused {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n }\n }\n\n .MuiSelect-select.MuiSelect-select {\n padding-right: unset;\n }\n\n .MuiSelect-select {\n width: 100%;\n height: 20px;\n display: flex;\n padding-right: 10px;\n align-items: center;\n\n :focus {\n background-color: transparent;\n outline: ", "\n auto 2px;\n }\n & > *:last-child::after {\n content: unset;\n }\n & > *:last-child::before {\n content: unset;\n }\n &.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n &:focus {\n outline: none;\n }\n }\n }\n .MuiInputBase-input {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n }\n .MuiInput-underline {\n &.Mui-focused {\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n }\n &.Mui-disabled:before {\n border-bottom-style: solid;\n }\n }\n .MuiInput-underline:hover:not(.Mui-disabled):before {\n border-bottom: ", " solid;\n border-bottom-color: ", ";\n }\n .MuiInput-underline:after {\n border-bottom: ", " solid;\n border-bottom-color: ", ";\n }\n .MuiInput-underline:before {\n border-bottom: ", " solid;\n border-bottom-color: ", ";\n }\n .MuiSelect-icon {\n color: ", " !important;\n }\n & label {\n text-overflow: ellipsis;\n overflow: hidden;\n width: calc(100% - 24px);\n }\n\n .MuiMenu-paper {\n background-color: ", ";\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.3);\n min-width: auto;\n width: auto;\n max-height: 250px;\n border-color: ", ";\n border-width: ", ";\n border-style: ", ";\n\n &::-webkit-scrollbar {\n width: 3px;\n margin: 5px;\n }\n &::-webkit-scrollbar-track {\n border-radius: 3px;\n background-color: ", ";\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background-color: ", ";\n }\n }\n .MuiList-root {\n width: auto !important;\n padding-right: 0 !important;\n }\n .MuiList-padding {\n padding-bottom: 0px;\n padding-top: 0px;\n }\n .MuiMenuItem-root {\n padding-bottom: ", ";\n padding-top: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: ", "\n auto 2px;\n outline-offset: -1px;\n }\n &.MuiListItem-root.Mui-selected {\n background-color: ", ";\n }\n & span.MuiButtonBase-root {\n // multiple checkbox\n padding: 0px;\n margin: 5px 0px;\n }\n }\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject10 = function _templateObject10() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject9() {
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject9 = function _templateObject9() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
48
68
|
function _templateObject8() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
50
70
|
|
|
51
71
|
_templateObject8 = function _templateObject8() {
|
|
52
72
|
return data;
|
|
@@ -56,7 +76,7 @@ function _templateObject8() {
|
|
|
56
76
|
}
|
|
57
77
|
|
|
58
78
|
function _templateObject7() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
79
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"]);
|
|
60
80
|
|
|
61
81
|
_templateObject7 = function _templateObject7() {
|
|
62
82
|
return data;
|
|
@@ -66,7 +86,7 @@ function _templateObject7() {
|
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
function _templateObject6() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
89
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: ", ";\n margin-right: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n width: ", ";\n\n &::before {\n margin: 0 4px;\n ", ";\n }\n &::after {\n margin: 0 4px;\n ", ";\n }\n"]);
|
|
70
90
|
|
|
71
91
|
_templateObject6 = function _templateObject6() {
|
|
72
92
|
return data;
|
|
@@ -76,7 +96,7 @@ function _templateObject6() {
|
|
|
76
96
|
}
|
|
77
97
|
|
|
78
98
|
function _templateObject5() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
99
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
|
|
80
100
|
|
|
81
101
|
_templateObject5 = function _templateObject5() {
|
|
82
102
|
return data;
|
|
@@ -86,7 +106,7 @@ function _templateObject5() {
|
|
|
86
106
|
}
|
|
87
107
|
|
|
88
108
|
function _templateObject4() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
109
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
90
110
|
|
|
91
111
|
_templateObject4 = function _templateObject4() {
|
|
92
112
|
return data;
|
|
@@ -96,7 +116,7 @@ function _templateObject4() {
|
|
|
96
116
|
}
|
|
97
117
|
|
|
98
118
|
function _templateObject3() {
|
|
99
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
119
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
100
120
|
|
|
101
121
|
_templateObject3 = function _templateObject3() {
|
|
102
122
|
return data;
|
|
@@ -106,7 +126,7 @@ function _templateObject3() {
|
|
|
106
126
|
}
|
|
107
127
|
|
|
108
128
|
function _templateObject2() {
|
|
109
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n"]);
|
|
129
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n display: flex;\n align-items: center;\n flex-direction: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n ", "\n"]);
|
|
110
130
|
|
|
111
131
|
_templateObject2 = function _templateObject2() {
|
|
112
132
|
return data;
|
|
@@ -125,73 +145,12 @@ function _templateObject() {
|
|
|
125
145
|
return data;
|
|
126
146
|
}
|
|
127
147
|
|
|
128
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
129
|
-
|
|
130
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
131
|
-
|
|
132
|
-
var useStyles = (0, _styles.makeStyles)(function () {
|
|
133
|
-
return {
|
|
134
|
-
root: function root(props) {
|
|
135
|
-
return {
|
|
136
|
-
minWidth: props.width
|
|
137
|
-
};
|
|
138
|
-
},
|
|
139
|
-
dropdownStyle: function dropdownStyle(props) {
|
|
140
|
-
return {
|
|
141
|
-
boxShadow: "0px 2px 10px 0px rgba(0, 0, 0, 0.3)",
|
|
142
|
-
minWidth: props.width,
|
|
143
|
-
width: props.width,
|
|
144
|
-
maxHeight: "250px",
|
|
145
|
-
"&::-webkit-scrollbar": {
|
|
146
|
-
width: "3px",
|
|
147
|
-
margin: "5px"
|
|
148
|
-
},
|
|
149
|
-
"&::-webkit-scrollbar-track": {
|
|
150
|
-
borderRadius: "3px",
|
|
151
|
-
backgroundColor: props.scrollBarTrackColor
|
|
152
|
-
},
|
|
153
|
-
"&::-webkit-scrollbar-thumb": {
|
|
154
|
-
borderRadius: "3px",
|
|
155
|
-
backgroundColor: props.scrollBarThumbColor
|
|
156
|
-
},
|
|
157
|
-
"& .MuiList-root": {
|
|
158
|
-
width: "auto !important",
|
|
159
|
-
paddingRight: "0 !important"
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
},
|
|
163
|
-
itemList: function itemList(props) {
|
|
164
|
-
return {
|
|
165
|
-
color: props.color,
|
|
166
|
-
"&.MuiList-padding": {
|
|
167
|
-
paddingBottom: "0px",
|
|
168
|
-
paddingTop: "0px"
|
|
169
|
-
},
|
|
170
|
-
"& li": {
|
|
171
|
-
fontSize: "16px",
|
|
172
|
-
"&:hover": {
|
|
173
|
-
backgroundColor: props.hoveredOptionBackgroundColor,
|
|
174
|
-
color: props.color
|
|
175
|
-
},
|
|
176
|
-
"&:active": {
|
|
177
|
-
backgroundColor: props.selectedOptionBackgroundColor + props.hoverOptionBackgroundColor,
|
|
178
|
-
color: props.color
|
|
179
|
-
},
|
|
180
|
-
"&.MuiListItem-root.Mui-selected": {
|
|
181
|
-
backgroundColor: props.selectedOptionBackgroundColor,
|
|
182
|
-
color: props.color
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
});
|
|
189
|
-
|
|
190
148
|
var DxcSelect = function DxcSelect(_ref) {
|
|
191
149
|
var value = _ref.value,
|
|
192
150
|
name = _ref.name,
|
|
193
151
|
onChange = _ref.onChange,
|
|
194
152
|
label = _ref.label,
|
|
153
|
+
assistiveText = _ref.assistiveText,
|
|
195
154
|
_ref$required = _ref.required,
|
|
196
155
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
197
156
|
_ref$disabled = _ref.disabled,
|
|
@@ -210,18 +169,13 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
210
169
|
_ref$tabIndex = _ref.tabIndex,
|
|
211
170
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
212
171
|
var colorsTheme = (0, _useTheme["default"])();
|
|
172
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
213
173
|
|
|
214
174
|
var _useState = (0, _react.useState)(multiple && [] || ""),
|
|
215
175
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
216
176
|
selectedValue = _useState2[0],
|
|
217
177
|
setSelectedValue = _useState2[1];
|
|
218
178
|
|
|
219
|
-
var selectValues = _objectSpread({
|
|
220
|
-
width: "auto"
|
|
221
|
-
}, colorsTheme.select);
|
|
222
|
-
|
|
223
|
-
var classes = useStyles(selectValues);
|
|
224
|
-
|
|
225
179
|
var handleSelectChange = function handleSelectChange(selectedOption) {
|
|
226
180
|
if (multiple) {
|
|
227
181
|
setSelectedValue(selectedOption.target.value);
|
|
@@ -242,16 +196,21 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
242
196
|
var selectedItem = options.filter(function (option) {
|
|
243
197
|
return option.value === selected;
|
|
244
198
|
})[0];
|
|
245
|
-
return _react["default"].createElement(
|
|
199
|
+
return _react["default"].createElement(SelectedOptionContainer, {
|
|
246
200
|
iconPosition: iconPosition,
|
|
247
201
|
multiple: multiple,
|
|
248
202
|
label: selectedItem && selectedItem.label,
|
|
249
203
|
key: selectedItem && selectedItem.label
|
|
250
|
-
}, selectedItem && selectedItem.icon ? _react["default"].createElement(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
204
|
+
}, selectedItem && selectedItem.icon ? _react["default"].createElement(SelectedOptionIconContainer, {
|
|
205
|
+
backgroundType: backgroundType,
|
|
206
|
+
disabled: disabled,
|
|
207
|
+
label: selectedItem.label,
|
|
208
|
+
iconPosition: iconPosition
|
|
209
|
+
}, (0, _typeof2["default"])(selectedItem.icon) === "object" ? selectedItem.icon : _react["default"].createElement(selectedItem.icon)) : selectedItem && selectedItem.iconSrc && _react["default"].createElement(SelectedOptionIcon, {
|
|
210
|
+
src: selectedItem && selectedItem.iconSrc,
|
|
211
|
+
label: selectedItem.label,
|
|
212
|
+
iconPosition: iconPosition
|
|
213
|
+
}), selectedItem && selectedItem.label && _react["default"].createElement(SelectedOptionLabelContainer, {
|
|
255
214
|
iconSrc: selectedItem && selectedItem.iconSrc && selectedItem.icon,
|
|
256
215
|
iconPosition: iconPosition,
|
|
257
216
|
disabled: disabled
|
|
@@ -267,7 +226,7 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
267
226
|
};
|
|
268
227
|
|
|
269
228
|
var getSelectedValuesWithIcons = function getSelectedValuesWithIcons(optionsList, selected) {
|
|
270
|
-
return
|
|
229
|
+
return optionsList.filter(function (x) {
|
|
271
230
|
return selected.includes(x.value);
|
|
272
231
|
}).map(function (optionToRender) {
|
|
273
232
|
return getLabelForSingleSelect(optionToRender.value);
|
|
@@ -300,13 +259,37 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
300
259
|
}
|
|
301
260
|
};
|
|
302
261
|
|
|
262
|
+
var ThemedOption = function ThemedOption(_ref2) {
|
|
263
|
+
var option = _ref2.option;
|
|
264
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
265
|
+
return _react["default"].createElement(_react["default"].Fragment, null, multiple && _react["default"].createElement(_Checkbox["default"], {
|
|
266
|
+
size: "fitContent",
|
|
267
|
+
checked: isChecked(selectedValue, value, option)
|
|
268
|
+
}), _react["default"].createElement(OptionListContainer, {
|
|
269
|
+
iconPosition: iconPosition,
|
|
270
|
+
multiple: multiple
|
|
271
|
+
}, option.icon ? _react["default"].createElement(OptionListIconContainer, {
|
|
272
|
+
backgroundType: backgroundType,
|
|
273
|
+
disabled: disabled,
|
|
274
|
+
label: option.label,
|
|
275
|
+
iconPosition: iconPosition
|
|
276
|
+
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)) : option.iconSrc && _react["default"].createElement(OptionListIcon, {
|
|
277
|
+
src: option.iconSrc,
|
|
278
|
+
label: option.label,
|
|
279
|
+
iconPosition: iconPosition
|
|
280
|
+
}), " ", _react["default"].createElement(OptionListLabelContainer, {
|
|
281
|
+
backgroundType: backgroundType
|
|
282
|
+
}, option.label)));
|
|
283
|
+
};
|
|
284
|
+
|
|
303
285
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
304
286
|
theme: colorsTheme.select
|
|
305
287
|
}, _react["default"].createElement(SelectContainer, {
|
|
306
288
|
margin: margin,
|
|
307
289
|
size: size,
|
|
308
290
|
invalid: invalid,
|
|
309
|
-
disabled: disabled
|
|
291
|
+
disabled: disabled,
|
|
292
|
+
backgroundType: backgroundType
|
|
310
293
|
}, _react["default"].createElement(_FormControl["default"], null, _react["default"].createElement(_InputLabel["default"], {
|
|
311
294
|
disabled: disabled
|
|
312
295
|
}, required && _react["default"].createElement(_RequiredComponent["default"], null), label), _react["default"].createElement(_Select["default"], {
|
|
@@ -317,15 +300,12 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
317
300
|
value: value !== undefined ? value : selectedValue,
|
|
318
301
|
disabled: disabled,
|
|
319
302
|
MenuProps: {
|
|
320
|
-
classes: {
|
|
321
|
-
paper: classes.dropdownStyle,
|
|
322
|
-
list: classes.itemList
|
|
323
|
-
},
|
|
324
303
|
getContentAnchorEl: null,
|
|
325
304
|
anchorOrigin: {
|
|
326
305
|
vertical: "bottom",
|
|
327
306
|
horizontal: "left"
|
|
328
|
-
}
|
|
307
|
+
},
|
|
308
|
+
disablePortal: true
|
|
329
309
|
},
|
|
330
310
|
inputProps: {
|
|
331
311
|
tabIndex: disabled ? -1 : tabIndex
|
|
@@ -336,20 +316,14 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
336
316
|
value: option.value,
|
|
337
317
|
disableRipple: true,
|
|
338
318
|
key: option.value
|
|
339
|
-
},
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)) : option.iconSrc && _react["default"].createElement(ListIcon, {
|
|
348
|
-
src: option.iconSrc,
|
|
349
|
-
label: option.label,
|
|
350
|
-
iconPosition: iconPosition
|
|
351
|
-
}), " ", _react["default"].createElement(LabelCont, null, option.label)));
|
|
352
|
-
})))));
|
|
319
|
+
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
320
|
+
color: colorsTheme.select.optionBackgroundColor
|
|
321
|
+
}, _react["default"].createElement(ThemedOption, {
|
|
322
|
+
option: option
|
|
323
|
+
})));
|
|
324
|
+
})), assistiveText && _react["default"].createElement(_FormHelperText["default"], {
|
|
325
|
+
disabled: disabled
|
|
326
|
+
}, assistiveText))));
|
|
353
327
|
};
|
|
354
328
|
|
|
355
329
|
var sizes = {
|
|
@@ -360,18 +334,52 @@ var sizes = {
|
|
|
360
334
|
};
|
|
361
335
|
|
|
362
336
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
363
|
-
|
|
364
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return sizes[size];
|
|
337
|
+
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
368
338
|
};
|
|
369
339
|
|
|
370
340
|
var MultipleLabelSelected = _styledComponents["default"].div(_templateObject());
|
|
371
341
|
|
|
372
|
-
var
|
|
342
|
+
var OptionListContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
343
|
+
return props.theme.fontFamily;
|
|
344
|
+
}, function (props) {
|
|
345
|
+
return props.iconPosition === "before" && "row" || "row-reverse";
|
|
346
|
+
}, function (props) {
|
|
347
|
+
return props.multiple && "margin-left: ".concat(props.theme.optionCheckboxSpacing, ";");
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
var OptionListIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
351
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor : props.backgroundType === "dark" ? props.theme.optionIconColorOnDark : props.theme.optionIconColor;
|
|
352
|
+
}, function (props) {
|
|
353
|
+
return props.theme.optionIconSize;
|
|
354
|
+
}, function (props) {
|
|
355
|
+
return props.theme.optionIconSize;
|
|
356
|
+
}, function (props) {
|
|
357
|
+
return props.iconPosition === "after" && props.label && props.theme.optionIconSpacing || "0px";
|
|
358
|
+
}, function (props) {
|
|
359
|
+
return props.iconPosition === "before" && props.label && props.theme.optionIconSpacing || "0px";
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
var OptionListIcon = _styledComponents["default"].img(_templateObject4(), function (props) {
|
|
363
|
+
return props.theme.optionIconSize;
|
|
364
|
+
}, function (props) {
|
|
365
|
+
return props.theme.optionIconSize;
|
|
366
|
+
}, function (props) {
|
|
367
|
+
return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
|
|
368
|
+
}, function (props) {
|
|
369
|
+
return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
var OptionListLabelContainer = _styledComponents["default"].span(_templateObject5(), function (props) {
|
|
373
|
+
return props.theme.optionFontSize;
|
|
374
|
+
}, function (props) {
|
|
375
|
+
return props.theme.optionFontStyle;
|
|
376
|
+
}, function (props) {
|
|
377
|
+
return props.theme.optionFontWeight;
|
|
378
|
+
}, function (props) {
|
|
379
|
+
return props.backgroundType === "dark" ? props.theme.optionFontColorOnDark : props.theme.optionFontColor;
|
|
380
|
+
});
|
|
373
381
|
|
|
374
|
-
var
|
|
382
|
+
var SelectedOptionContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
375
383
|
return props.iconPosition === "before" && "row" || "row-reverse";
|
|
376
384
|
}, function (props) {
|
|
377
385
|
return props.iconPosition === "before" && "flex-start" || "flex-end";
|
|
@@ -385,37 +393,33 @@ var SelectedIconContainer = _styledComponents["default"].div(_templateObject3(),
|
|
|
385
393
|
return props.iconPosition === "before" && (props.label !== "" || props.label === undefined) && "content:','";
|
|
386
394
|
});
|
|
387
395
|
|
|
388
|
-
var
|
|
396
|
+
var SelectedOptionLabelContainer = _styledComponents["default"].span(_templateObject7(), function (props) {
|
|
389
397
|
return props.theme.fontFamily;
|
|
390
|
-
}, function (props) {
|
|
391
|
-
return (props.iconPosition === "after" || !props.iconSrc) && "0px" || "10px";
|
|
392
|
-
}, function (props) {
|
|
393
|
-
return (props.iconPosition === "before" || !props.iconSrc) && "0px" || "10px";
|
|
394
398
|
});
|
|
395
399
|
|
|
396
|
-
var
|
|
397
|
-
return props.theme.
|
|
400
|
+
var SelectedOptionIcon = _styledComponents["default"].img(_templateObject8(), function (props) {
|
|
401
|
+
return props.theme.valueIconSize;
|
|
398
402
|
}, function (props) {
|
|
399
|
-
return props.
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
var ListIcon = _styledComponents["default"].img(_templateObject6(), function (props) {
|
|
403
|
-
return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
|
|
403
|
+
return props.theme.valueIconSize;
|
|
404
404
|
}, function (props) {
|
|
405
|
-
return props.iconPosition === "
|
|
405
|
+
return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
406
|
+
}, function (props) {
|
|
407
|
+
return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
406
408
|
});
|
|
407
409
|
|
|
408
|
-
var
|
|
409
|
-
return props.
|
|
410
|
+
var SelectedOptionIconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
411
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor : props.backgroundType === "dark" ? props.theme.valueIconColorOnDark : props.theme.valueIconColor;
|
|
412
|
+
}, function (props) {
|
|
413
|
+
return props.theme.valueIconSize;
|
|
414
|
+
}, function (props) {
|
|
415
|
+
return props.theme.valueIconSize;
|
|
410
416
|
}, function (props) {
|
|
411
|
-
return props.iconPosition === "
|
|
417
|
+
return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
412
418
|
}, function (props) {
|
|
413
|
-
return props.
|
|
419
|
+
return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
414
420
|
});
|
|
415
421
|
|
|
416
|
-
var SelectContainer = _styledComponents["default"].div(
|
|
417
|
-
return props.theme.fontSizeBase;
|
|
418
|
-
}, function (props) {
|
|
422
|
+
var SelectContainer = _styledComponents["default"].div(_templateObject10(), function (props) {
|
|
419
423
|
return calculateWidth(props.margin, props.size);
|
|
420
424
|
}, function (props) {
|
|
421
425
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -428,42 +432,97 @@ var SelectContainer = _styledComponents["default"].div(_templateObject8(), funct
|
|
|
428
432
|
}, function (props) {
|
|
429
433
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
430
434
|
}, function (props) {
|
|
431
|
-
return props.theme.
|
|
435
|
+
return props.theme.fontFamily;
|
|
436
|
+
}, function (props) {
|
|
437
|
+
return props.theme.assistiveTextFontSize;
|
|
438
|
+
}, function (props) {
|
|
439
|
+
return props.theme.assistiveTextFontStyle;
|
|
440
|
+
}, function (props) {
|
|
441
|
+
return props.theme.assistiveTextFontWeight;
|
|
442
|
+
}, function (props) {
|
|
443
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.assistiveTextFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.assistiveTextFontColor;
|
|
444
|
+
}, function (props) {
|
|
445
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
432
446
|
}, function (props) {
|
|
433
447
|
return props.theme.fontFamily;
|
|
434
448
|
}, function (props) {
|
|
435
|
-
return props.
|
|
449
|
+
return props.theme.labelFontSize;
|
|
450
|
+
}, function (props) {
|
|
451
|
+
return props.theme.labelFontStyle;
|
|
452
|
+
}, function (props) {
|
|
453
|
+
return props.theme.labelFontWeight;
|
|
454
|
+
}, function (props) {
|
|
455
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.labelFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.labelFontColor;
|
|
456
|
+
}, function (props) {
|
|
457
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
458
|
+
}, function (props) {
|
|
459
|
+
return props.theme.labelFontSize;
|
|
460
|
+
}, function (props) {
|
|
461
|
+
return props.theme.labelFontStyle;
|
|
462
|
+
}, function (props) {
|
|
463
|
+
return props.theme.labelFontWeight;
|
|
464
|
+
}, function (props) {
|
|
465
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.labelFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.labelFontColor;
|
|
466
|
+
}, function (props) {
|
|
467
|
+
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
468
|
+
}, function (props) {
|
|
469
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
470
|
+
}, function (props) {
|
|
471
|
+
return props.theme.valueFontSize;
|
|
472
|
+
}, function (props) {
|
|
473
|
+
return props.theme.valueFontStyle;
|
|
474
|
+
}, function (props) {
|
|
475
|
+
return props.theme.valueFontWeight;
|
|
476
|
+
}, function (props) {
|
|
477
|
+
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
478
|
+
}, function (props) {
|
|
479
|
+
return props.theme.underlineThickness;
|
|
480
|
+
}, function (props) {
|
|
481
|
+
return props.backgroundType === "dark" ? props.invalid === true && props.theme.errorColorOnDark || props.disabled && props.theme.disabledColorOnDark || props.theme.underlineFocusColorOnDark : props.invalid === true && props.theme.errorColor || props.disabled && props.theme.disabledColor || props.theme.underlineFocusColor;
|
|
482
|
+
}, function (props) {
|
|
483
|
+
return props.theme.underlineThickness;
|
|
484
|
+
}, function (props) {
|
|
485
|
+
return props.backgroundType === "dark" ? props.invalid === true && props.theme.errorColorOnDark || props.disabled && props.theme.disabledColorOnDark || props.theme.underlineColorOnDark : props.invalid === true && props.theme.errorColor || props.disabled && props.theme.disabledColor || props.theme.underlineColor;
|
|
486
|
+
}, function (props) {
|
|
487
|
+
return props.theme.underlineThickness;
|
|
488
|
+
}, function (props) {
|
|
489
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.underlineFocusColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.underlineFocusColor;
|
|
490
|
+
}, function (props) {
|
|
491
|
+
return props.theme.underlineThickness;
|
|
492
|
+
}, function (props) {
|
|
493
|
+
return props.backgroundType === "dark" ? props.invalid === true && props.theme.errorColorOnDark || props.disabled && props.theme.disabledColorOnDark || props.theme.underlineColorOnDark : props.invalid === true && props.theme.errorColor || props.disabled && props.theme.disabledColor || props.theme.underlineColor;
|
|
436
494
|
}, function (props) {
|
|
437
|
-
return props.theme.disabledColor;
|
|
495
|
+
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.arrowColorOnDark : props.disabled && props.theme.disabledColor || props.theme.arrowColor;
|
|
438
496
|
}, function (props) {
|
|
439
|
-
return props.theme.
|
|
497
|
+
return props.theme.optionBackgroundColor;
|
|
440
498
|
}, function (props) {
|
|
441
|
-
return props.
|
|
499
|
+
return props.theme.optionBorderColor;
|
|
442
500
|
}, function (props) {
|
|
443
|
-
return props.theme.
|
|
501
|
+
return props.theme.optionBorderThickness;
|
|
444
502
|
}, function (props) {
|
|
445
|
-
return props.theme.
|
|
503
|
+
return props.theme.optionBorderStyle;
|
|
446
504
|
}, function (props) {
|
|
447
|
-
return props.theme.
|
|
505
|
+
return props.theme.scrollBarTrackColor;
|
|
448
506
|
}, function (props) {
|
|
449
|
-
return props.theme.
|
|
507
|
+
return props.theme.scrollBarThumbColor;
|
|
450
508
|
}, function (props) {
|
|
451
|
-
return props.
|
|
509
|
+
return props.theme.optionPaddingBottom;
|
|
452
510
|
}, function (props) {
|
|
453
|
-
return props.
|
|
511
|
+
return props.theme.optionPaddingTop;
|
|
454
512
|
}, function (props) {
|
|
455
|
-
return props.
|
|
513
|
+
return props.backgroundType === "dark" ? props.theme.hoverOptionBackgroundColorOnDark : props.theme.hoverOptionBackgroundColor;
|
|
456
514
|
}, function (props) {
|
|
457
|
-
return props.
|
|
515
|
+
return props.backgroundType === "dark" ? props.theme.activeOptionBackgroundColorOnDark : props.theme.activeOptionBackgroundColor;
|
|
458
516
|
}, function (props) {
|
|
459
|
-
return props.
|
|
517
|
+
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
460
518
|
}, function (props) {
|
|
461
|
-
return props.theme.
|
|
519
|
+
return props.backgroundType === "dark" ? props.theme.selectedOptionBackgroundColorOnDark : props.theme.selectedOptionBackgroundColor;
|
|
462
520
|
});
|
|
463
521
|
|
|
464
522
|
DxcSelect.propTypes = {
|
|
465
523
|
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
466
524
|
label: _propTypes["default"].string,
|
|
525
|
+
assistiveText: _propTypes["default"].string,
|
|
467
526
|
name: _propTypes["default"].string,
|
|
468
527
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]))]),
|
|
469
528
|
disabled: _propTypes["default"].bool,
|
package/dist/sidenav/Sidenav.js
CHANGED
|
@@ -23,8 +23,10 @@ var _variables = require("../common/variables.js");
|
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
25
25
|
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
27
|
+
|
|
26
28
|
function _templateObject4() {
|
|
27
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n"]);
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n\n :focus-visible {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n"]);
|
|
28
30
|
|
|
29
31
|
_templateObject4 = function _templateObject4() {
|
|
30
32
|
return data;
|
|
@@ -34,7 +36,7 @@ function _templateObject4() {
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
function _templateObject3() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 4px;\n"]);
|
|
38
40
|
|
|
39
41
|
_templateObject3 = function _templateObject3() {
|
|
40
42
|
return data;
|
|
@@ -44,7 +46,7 @@ function _templateObject3() {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
function _templateObject2() {
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin:
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 16px;\n"]);
|
|
48
50
|
|
|
49
51
|
_templateObject2 = function _templateObject2() {
|
|
50
52
|
return data;
|
|
@@ -54,7 +56,7 @@ function _templateObject2() {
|
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
function _templateObject() {
|
|
57
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n max-width: 300px;\n width: ", ";\n padding: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n ::-webkit-scrollbar {\n width: 2px;\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"]);
|
|
58
60
|
|
|
59
61
|
_templateObject = function _templateObject() {
|
|
60
62
|
return data;
|
|
@@ -71,7 +73,9 @@ var DxcSidenav = function DxcSidenav(_ref) {
|
|
|
71
73
|
theme: colorsTheme.sidenav
|
|
72
74
|
}, _react["default"].createElement(SideNavContainer, {
|
|
73
75
|
padding: padding
|
|
74
|
-
},
|
|
76
|
+
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
77
|
+
color: colorsTheme.sidenav.backgroundColor
|
|
78
|
+
}, children)));
|
|
75
79
|
};
|
|
76
80
|
|
|
77
81
|
var Title = function Title(_ref2) {
|
|
@@ -96,16 +100,6 @@ var Link = function Link(_ref4) {
|
|
|
96
100
|
|
|
97
101
|
var SideNavContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
98
102
|
return props.theme.backgroundColor;
|
|
99
|
-
}, function (props) {
|
|
100
|
-
return props.theme.customContentFontFamily;
|
|
101
|
-
}, function (props) {
|
|
102
|
-
return props.theme.customContentFontSize;
|
|
103
|
-
}, function (props) {
|
|
104
|
-
return props.theme.customContentFontStyle;
|
|
105
|
-
}, function (props) {
|
|
106
|
-
return props.theme.customContentFontWeight;
|
|
107
|
-
}, function (props) {
|
|
108
|
-
return props.theme.customContentFontColor;
|
|
109
103
|
}, function (props) {
|
|
110
104
|
return props.padding ? "calc(300px - ".concat(_variables.spaces[props.padding], " - ").concat(_variables.spaces[props.padding], ")") : "300px";
|
|
111
105
|
}, function (props) {
|
|
@@ -166,6 +160,8 @@ var SideNavMenuLink = _styledComponents["default"].a(_templateObject4(), functio
|
|
|
166
160
|
return props.theme.linkTextDecoration;
|
|
167
161
|
}, function (props) {
|
|
168
162
|
return "".concat(props.theme.linkMarginTop, " ").concat(props.theme.linkMarginRight, " ").concat(props.theme.linkMarginBottom, " ").concat(props.theme.linkMarginLeft);
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.theme.linkFocusColor;
|
|
169
165
|
});
|
|
170
166
|
|
|
171
167
|
DxcSidenav.propTypes = {
|