@dxc-technology/halstack-react 0.0.0-92f4a00 → 0.0.0-9427b76

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.
@@ -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"));
@@ -33,8 +31,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
33
31
 
34
32
  var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
35
33
 
36
- var _styles = require("@material-ui/core/styles");
37
-
38
34
  var _propTypes = _interopRequireDefault(require("prop-types"));
39
35
 
40
36
  var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
@@ -49,8 +45,28 @@ var _RequiredComponent = _interopRequireDefault(require("../common/RequiredCompo
49
45
 
50
46
  var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext.js"));
51
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
+
52
68
  function _templateObject8() {
53
- 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 :focus {\n background-color: transparent;\n outline: ", "\n auto 1px;\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 svg {\n color: ", ";\n }\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"]);
69
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
54
70
 
55
71
  _templateObject8 = function _templateObject8() {
56
72
  return data;
@@ -60,7 +76,7 @@ function _templateObject8() {
60
76
  }
61
77
 
62
78
  function _templateObject7() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n opacity: ", ";\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
79
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"]);
64
80
 
65
81
  _templateObject7 = function _templateObject7() {
66
82
  return data;
@@ -70,7 +86,7 @@ function _templateObject7() {
70
86
  }
71
87
 
72
88
  function _templateObject6() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\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"]);
74
90
 
75
91
  _templateObject6 = function _templateObject6() {
76
92
  return data;
@@ -80,7 +96,7 @@ function _templateObject6() {
80
96
  }
81
97
 
82
98
  function _templateObject5() {
83
- 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"]);
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"]);
84
100
 
85
101
  _templateObject5 = function _templateObject5() {
86
102
  return data;
@@ -90,7 +106,7 @@ function _templateObject5() {
90
106
  }
91
107
 
92
108
  function _templateObject4() {
93
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"]);
109
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
94
110
 
95
111
  _templateObject4 = function _templateObject4() {
96
112
  return data;
@@ -100,7 +116,7 @@ function _templateObject4() {
100
116
  }
101
117
 
102
118
  function _templateObject3() {
103
- 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"]);
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"]);
104
120
 
105
121
  _templateObject3 = function _templateObject3() {
106
122
  return data;
@@ -110,7 +126,7 @@ function _templateObject3() {
110
126
  }
111
127
 
112
128
  function _templateObject2() {
113
- var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n color: ", ";\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"]);
114
130
 
115
131
  _templateObject2 = function _templateObject2() {
116
132
  return data;
@@ -129,84 +145,6 @@ function _templateObject() {
129
145
  return data;
130
146
  }
131
147
 
132
- 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; }
133
-
134
- 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; }
135
-
136
- var useStyles = (0, _styles.makeStyles)(function () {
137
- return {
138
- root: function root(props) {
139
- return {
140
- minWidth: props.width
141
- };
142
- },
143
- dropdownStyle: function dropdownStyle(props) {
144
- return {
145
- backgroundColor: props.optionBackgroundColor,
146
- boxShadow: "0px 2px 10px 0px rgba(0, 0, 0, 0.3)",
147
- minWidth: props.width,
148
- width: props.width,
149
- maxHeight: "250px",
150
- borderColor: props.optionBorderColor,
151
- borderWidth: props.optionBorderThickness,
152
- borderStyle: props.optionBorderStyle,
153
- "&::-webkit-scrollbar": {
154
- width: "3px",
155
- margin: "5px"
156
- },
157
- "&::-webkit-scrollbar-track": {
158
- borderRadius: "3px",
159
- backgroundColor: props.scrollBarTrackColor
160
- },
161
- "&::-webkit-scrollbar-thumb": {
162
- borderRadius: "3px",
163
- backgroundColor: props.scrollBarThumbColor
164
- },
165
- "& .MuiList-root": {
166
- width: "auto !important",
167
- paddingRight: "0 !important"
168
- }
169
- };
170
- },
171
- itemList: function itemList(props) {
172
- return {
173
- "&.MuiList-padding": {
174
- paddingBottom: "0px",
175
- paddingTop: "0px"
176
- },
177
- "& li": {
178
- fontSize: props.optionFontSize,
179
- fontStyle: props.optionFontStyle,
180
- fontWeight: props.optionFontWeight,
181
- paddingBottom: props.optionPaddingBottom,
182
- paddingTop: props.optionPaddingTop,
183
- "&:hover": {
184
- backgroundColor: "".concat(props.backgroundType === "dark" ? props.hoverOptionBackgroundColorOnDark : props.hoverOptionBackgroundColor, " !important"),
185
- color: "".concat(props.optionFontColor)
186
- },
187
- "&:active": {
188
- backgroundColor: "".concat(props.backgroundType === "dark" ? props.activeOptionBackgroundColorOnDark : props.activeOptionBackgroundColor, " !important")
189
- },
190
- "&:focus": {
191
- outline: "".concat(props.backgroundType === "dark" ? props.focusColorOnDark : props.focusColor, " auto 2px")
192
- },
193
- "&.MuiListItem-root.Mui-selected": {
194
- backgroundColor: "".concat(props.backgroundType === "dark" ? props.selectedOptionBackgroundColorOnDark : props.selectedOptionBackgroundColor, " !important")
195
- },
196
- "& span.MuiButtonBase-root": {
197
- padding: "0px",
198
- margin: "5px 0px",
199
- "& span.MuiIconButton-label > svg": {
200
- width: "26px",
201
- height: "26px"
202
- }
203
- }
204
- }
205
- };
206
- }
207
- };
208
- });
209
-
210
148
  var DxcSelect = function DxcSelect(_ref) {
211
149
  var value = _ref.value,
212
150
  name = _ref.name,
@@ -238,14 +176,6 @@ var DxcSelect = function DxcSelect(_ref) {
238
176
  selectedValue = _useState2[0],
239
177
  setSelectedValue = _useState2[1];
240
178
 
241
- var selectValues = _objectSpread({
242
- width: "auto"
243
- }, colorsTheme.select, {}, colorsTheme.checkbox, {
244
- backgroundType: backgroundType
245
- });
246
-
247
- var classes = useStyles(selectValues);
248
-
249
179
  var handleSelectChange = function handleSelectChange(selectedOption) {
250
180
  if (multiple) {
251
181
  setSelectedValue(selectedOption.target.value);
@@ -266,16 +196,21 @@ var DxcSelect = function DxcSelect(_ref) {
266
196
  var selectedItem = options.filter(function (option) {
267
197
  return option.value === selected;
268
198
  })[0];
269
- return _react["default"].createElement(SelectedIconContainer, {
199
+ return _react["default"].createElement(SelectedOptionContainer, {
270
200
  iconPosition: iconPosition,
271
201
  multiple: multiple,
272
202
  label: selectedItem && selectedItem.label,
273
203
  key: selectedItem && selectedItem.label
274
- }, selectedItem && selectedItem.icon ? _react["default"].createElement(ListIconContainer, {
275
- disabled: disabled
276
- }, (0, _typeof2["default"])(selectedItem.icon) === "object" ? selectedItem.icon : _react["default"].createElement(selectedItem.icon)) : selectedItem && selectedItem.iconSrc && _react["default"].createElement(ListIcon, {
277
- src: selectedItem && selectedItem.iconSrc
278
- }), selectedItem && selectedItem.label && _react["default"].createElement(SelectedLabelContainer, {
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, {
279
214
  iconSrc: selectedItem && selectedItem.iconSrc && selectedItem.icon,
280
215
  iconPosition: iconPosition,
281
216
  disabled: disabled
@@ -291,7 +226,7 @@ var DxcSelect = function DxcSelect(_ref) {
291
226
  };
292
227
 
293
228
  var getSelectedValuesWithIcons = function getSelectedValuesWithIcons(optionsList, selected) {
294
- return options.filter(function (x) {
229
+ return optionsList.filter(function (x) {
295
230
  return selected.includes(x.value);
296
231
  }).map(function (optionToRender) {
297
232
  return getLabelForSingleSelect(optionToRender.value);
@@ -330,18 +265,19 @@ var DxcSelect = function DxcSelect(_ref) {
330
265
  return _react["default"].createElement(_react["default"].Fragment, null, multiple && _react["default"].createElement(_Checkbox["default"], {
331
266
  size: "fitContent",
332
267
  checked: isChecked(selectedValue, value, option)
333
- }), _react["default"].createElement(OptionContainer, {
268
+ }), _react["default"].createElement(OptionListContainer, {
334
269
  iconPosition: iconPosition,
335
270
  multiple: multiple
336
- }, option.icon ? _react["default"].createElement(ListIconContainer, {
271
+ }, option.icon ? _react["default"].createElement(OptionListIconContainer, {
337
272
  backgroundType: backgroundType,
273
+ disabled: disabled,
338
274
  label: option.label,
339
275
  iconPosition: iconPosition
340
- }, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)) : option.iconSrc && _react["default"].createElement(ListIcon, {
276
+ }, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)) : option.iconSrc && _react["default"].createElement(OptionListIcon, {
341
277
  src: option.iconSrc,
342
278
  label: option.label,
343
279
  iconPosition: iconPosition
344
- }), " ", _react["default"].createElement(LabelContainer, {
280
+ }), " ", _react["default"].createElement(OptionListLabelContainer, {
345
281
  backgroundType: backgroundType
346
282
  }, option.label)));
347
283
  };
@@ -364,15 +300,12 @@ var DxcSelect = function DxcSelect(_ref) {
364
300
  value: value !== undefined ? value : selectedValue,
365
301
  disabled: disabled,
366
302
  MenuProps: {
367
- classes: {
368
- paper: classes.dropdownStyle,
369
- list: classes.itemList
370
- },
371
303
  getContentAnchorEl: null,
372
304
  anchorOrigin: {
373
305
  vertical: "bottom",
374
306
  horizontal: "left"
375
- }
307
+ },
308
+ disablePortal: true
376
309
  },
377
310
  inputProps: {
378
311
  tabIndex: disabled ? -1 : tabIndex
@@ -401,20 +334,52 @@ var sizes = {
401
334
  };
402
335
 
403
336
  var calculateWidth = function calculateWidth(margin, size) {
404
- if (size === "fillParent") {
405
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
406
- }
407
-
408
- 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];
409
338
  };
410
339
 
411
340
  var MultipleLabelSelected = _styledComponents["default"].div(_templateObject());
412
341
 
413
- var LabelContainer = _styledComponents["default"].span(_templateObject2(), function (props) {
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) {
414
379
  return props.backgroundType === "dark" ? props.theme.optionFontColorOnDark : props.theme.optionFontColor;
415
380
  });
416
381
 
417
- var SelectedIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
382
+ var SelectedOptionContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
418
383
  return props.iconPosition === "before" && "row" || "row-reverse";
419
384
  }, function (props) {
420
385
  return props.iconPosition === "before" && "flex-start" || "flex-end";
@@ -428,47 +393,33 @@ var SelectedIconContainer = _styledComponents["default"].div(_templateObject3(),
428
393
  return props.iconPosition === "before" && (props.label !== "" || props.label === undefined) && "content:','";
429
394
  });
430
395
 
431
- var SelectedLabelContainer = _styledComponents["default"].span(_templateObject4(), function (props) {
432
- return props.theme.fontFamily;
433
- }, function (props) {
434
- return (props.iconPosition === "after" || !props.iconSrc) && "0px" || "10px";
435
- }, function (props) {
436
- return (props.iconPosition === "before" || !props.iconSrc) && "0px" || "10px";
437
- });
438
-
439
- var OptionContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
396
+ var SelectedOptionLabelContainer = _styledComponents["default"].span(_templateObject7(), function (props) {
440
397
  return props.theme.fontFamily;
441
- }, function (props) {
442
- return props.iconPosition === "before" && "row" || "row-reverse";
443
- }, function (props) {
444
- return props.multiple && "margin-left: ".concat(props.theme.optionCheckboxSpacing, ";");
445
398
  });
446
399
 
447
- var ListIcon = _styledComponents["default"].img(_templateObject6(), function (props) {
448
- return props.theme.iconSize;
400
+ var SelectedOptionIcon = _styledComponents["default"].img(_templateObject8(), function (props) {
401
+ return props.theme.valueIconSize;
449
402
  }, function (props) {
450
- return props.theme.iconSize;
403
+ return props.theme.valueIconSize;
451
404
  }, function (props) {
452
- return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
405
+ return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
453
406
  }, function (props) {
454
- return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
407
+ return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
455
408
  });
456
409
 
457
- var ListIconContainer = _styledComponents["default"].div(_templateObject7(), function (props) {
458
- return props.backgroundType === "dark" ? props.theme.optionIconColorOnDark : props.theme.optionIconColor;
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;
459
412
  }, function (props) {
460
- return props.theme.optionIconSize;
413
+ return props.theme.valueIconSize;
461
414
  }, function (props) {
462
- return props.theme.optionIconSize;
463
- }, function (props) {
464
- return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
415
+ return props.theme.valueIconSize;
465
416
  }, function (props) {
466
- return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
417
+ return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
467
418
  }, function (props) {
468
- return props.disabled && "0.34";
419
+ return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
469
420
  });
470
421
 
471
- var SelectContainer = _styledComponents["default"].div(_templateObject8(), function (props) {
422
+ var SelectContainer = _styledComponents["default"].div(_templateObject10(), function (props) {
472
423
  return calculateWidth(props.margin, props.size);
473
424
  }, function (props) {
474
425
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
@@ -524,8 +475,6 @@ var SelectContainer = _styledComponents["default"].div(_templateObject8(), funct
524
475
  return props.theme.valueFontWeight;
525
476
  }, function (props) {
526
477
  return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
527
- }, function (props) {
528
- return props.backgroundType === "dark" ? props.theme.optionIconColorOnDark : props.theme.optionIconColor;
529
478
  }, function (props) {
530
479
  return props.theme.underlineThickness;
531
480
  }, function (props) {
@@ -544,6 +493,30 @@ var SelectContainer = _styledComponents["default"].div(_templateObject8(), funct
544
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;
545
494
  }, function (props) {
546
495
  return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.arrowColorOnDark : props.disabled && props.theme.disabledColor || props.theme.arrowColor;
496
+ }, function (props) {
497
+ return props.theme.optionBackgroundColor;
498
+ }, function (props) {
499
+ return props.theme.optionBorderColor;
500
+ }, function (props) {
501
+ return props.theme.optionBorderThickness;
502
+ }, function (props) {
503
+ return props.theme.optionBorderStyle;
504
+ }, function (props) {
505
+ return props.theme.scrollBarTrackColor;
506
+ }, function (props) {
507
+ return props.theme.scrollBarThumbColor;
508
+ }, function (props) {
509
+ return props.theme.optionPaddingBottom;
510
+ }, function (props) {
511
+ return props.theme.optionPaddingTop;
512
+ }, function (props) {
513
+ return props.backgroundType === "dark" ? props.theme.hoverOptionBackgroundColorOnDark : props.theme.hoverOptionBackgroundColor;
514
+ }, function (props) {
515
+ return props.backgroundType === "dark" ? props.theme.activeOptionBackgroundColorOnDark : props.theme.activeOptionBackgroundColor;
516
+ }, function (props) {
517
+ return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
518
+ }, function (props) {
519
+ return props.backgroundType === "dark" ? props.theme.selectedOptionBackgroundColorOnDark : props.theme.selectedOptionBackgroundColor;
547
520
  });
548
521
 
549
522
  DxcSelect.propTypes = {
@@ -26,7 +26,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
26
26
  var _BackgroundColorContext = require("../BackgroundColorContext.js");
27
27
 
28
28
  function _templateObject4() {
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"]);
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"]);
30
30
 
31
31
  _templateObject4 = function _templateObject4() {
32
32
  return data;
@@ -36,7 +36,7 @@ function _templateObject4() {
36
36
  }
37
37
 
38
38
  function _templateObject3() {
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-top: 15px;\n"]);
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"]);
40
40
 
41
41
  _templateObject3 = function _templateObject3() {
42
42
  return data;
@@ -46,7 +46,7 @@ function _templateObject3() {
46
46
  }
47
47
 
48
48
  function _templateObject2() {
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: 15px 0;\n"]);
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"]);
50
50
 
51
51
  _templateObject2 = function _templateObject2() {
52
52
  return data;
@@ -56,7 +56,7 @@ function _templateObject2() {
56
56
  }
57
57
 
58
58
  function _templateObject() {
59
- var data = (0, _taggedTemplateLiteral2["default"])(["\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 display: flex;\n flex-direction: column;\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"]);
60
60
 
61
61
  _templateObject = function _templateObject() {
62
62
  return data;
@@ -160,6 +160,8 @@ var SideNavMenuLink = _styledComponents["default"].a(_templateObject4(), functio
160
160
  return props.theme.linkTextDecoration;
161
161
  }, function (props) {
162
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;
163
165
  });
164
166
 
165
167
  DxcSidenav.propTypes = {
package/dist/tag/Tag.js CHANGED
@@ -30,7 +30,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
30
30
  var _Box = _interopRequireDefault(require("../box/Box"));
31
31
 
32
32
  function _templateObject8() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n padding: 0px 30px;\n letter-spacing: 0.025em;\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\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"]);
34
34
 
35
35
  _templateObject8 = function _templateObject8() {
36
36
  return data;
@@ -40,7 +40,7 @@ function _templateObject8() {
40
40
  }
41
41
 
42
42
  function _templateObject7() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width: ", ";\n justify-content: center;\n align-items: center;\n color: ", ";\n height: ", ";\n"]);
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"]);
44
44
 
45
45
  _templateObject7 = function _templateObject7() {
46
46
  return data;
@@ -50,7 +50,7 @@ function _templateObject7() {
50
50
  }
51
51
 
52
52
  function _templateObject6() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 43px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n img,\n svg {\n height: ", ";\n width: ", ";\n }\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"]);
54
54
 
55
55
  _templateObject6 = function _templateObject6() {
56
56
  return data;
@@ -60,7 +60,7 @@ function _templateObject6() {
60
60
  }
61
61
 
62
62
  function _templateObject5() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: 10px 12px;\n height: ", ";\n width: ", ";\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"]);
64
64
 
65
65
  _templateObject5 = function _templateObject5() {
66
66
  return data;
@@ -70,7 +70,7 @@ function _templateObject5() {
70
70
  }
71
71
 
72
72
  function _templateObject4() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n outline: 0;\n font-family: inherit;\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"]);
74
74
 
75
75
  _templateObject4 = function _templateObject4() {
76
76
  return data;
@@ -80,7 +80,7 @@ function _templateObject4() {
80
80
  }
81
81
 
82
82
  function _templateObject3() {
83
- 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"]);
84
84
 
85
85
  _templateObject3 = function _templateObject3() {
86
86
  return data;
@@ -125,7 +125,7 @@ var DxcTag = function DxcTag(_ref) {
125
125
  _ref$size = _ref.size,
126
126
  size = _ref$size === void 0 ? "fitContent" : _ref$size,
127
127
  _ref$tabIndex = _ref.tabIndex,
128
- tabIndex = _ref$tabIndex === void 0 ? 1 : _ref$tabIndex;
128
+ tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
129
129
  var colorsTheme = (0, _useTheme["default"])();
130
130
 
131
131
  var _useState = (0, _react.useState)(false),
@@ -134,9 +134,7 @@ var DxcTag = function DxcTag(_ref) {
134
134
  changeIsHovered = _useState2[1];
135
135
 
136
136
  var clickHandler = function clickHandler() {
137
- if (onClick) {
138
- onClick();
139
- }
137
+ onClick && onClick();
140
138
  };
141
139
 
142
140
  var tagContent = _react["default"].createElement(_Box["default"], {
@@ -144,7 +142,6 @@ var DxcTag = function DxcTag(_ref) {
144
142
  shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
145
143
  }, _react["default"].createElement(TagContent, {
146
144
  labelPosition: labelPosition,
147
- margin: margin,
148
145
  size: size
149
146
  }, _react["default"].createElement(IconContainer, {
150
147
  iconBgColor: iconBgColor
@@ -214,20 +211,24 @@ var TagContent = _styledComponents["default"].div(_templateObject2(), function (
214
211
  return props.theme.height;
215
212
  });
216
213
 
217
- var StyledLink = _styledComponents["default"].a(_templateObject3());
214
+ var StyledLink = _styledComponents["default"].a(_templateObject3(), function (props) {
215
+ return props.theme.focusColor;
216
+ });
218
217
 
219
- var StyledButton = _styledComponents["default"].button(_templateObject4());
218
+ var StyledButton = _styledComponents["default"].button(_templateObject4(), function (props) {
219
+ return props.theme.focusColor;
220
+ });
220
221
 
221
222
  var TagIcon = _styledComponents["default"].img(_templateObject5(), function (props) {
222
- return props.theme.iconHeight;
223
- }, function (props) {
224
223
  return props.theme.iconWidth;
224
+ }, function (props) {
225
+ return props.theme.iconHeight;
225
226
  });
226
227
 
227
228
  var TagIconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
228
- return props.theme.iconHeight;
229
- }, function (props) {
230
229
  return props.theme.iconWidth;
230
+ }, function (props) {
231
+ return props.theme.iconHeight;
231
232
  });
232
233
 
233
234
  var IconContainer = _styledComponents["default"].div(_templateObject7(), function (_ref9) {
@@ -237,8 +238,6 @@ var IconContainer = _styledComponents["default"].div(_templateObject7(), functio
237
238
  return props.theme.iconSectionWidth;
238
239
  }, function (props) {
239
240
  return props.theme.iconColor;
240
- }, function (props) {
241
- return props.theme.height;
242
241
  });
243
242
 
244
243
  var TagLabel = _styledComponents["default"].div(_templateObject8(), function (props) {
@@ -249,10 +248,16 @@ var TagLabel = _styledComponents["default"].div(_templateObject8(), function (pr
249
248
  return props.theme.fontStyle;
250
249
  }, function (props) {
251
250
  return props.theme.fontWeight;
252
- }, function (props) {
253
- return props.theme.fontTextTransform;
254
251
  }, function (props) {
255
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;
256
261
  });
257
262
 
258
263
  DxcTag.propTypes = {
@@ -273,16 +278,5 @@ DxcTag.propTypes = {
273
278
  }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
274
279
  tabIndex: _propTypes["default"].number
275
280
  };
276
- DxcTag.defaultProps = {
277
- icon: null,
278
- iconSrc: null,
279
- label: null,
280
- margin: null,
281
- linkHref: null,
282
- onClick: null,
283
- iconBgColor: "#5f249f",
284
- labelPosition: "after",
285
- newWindow: false
286
- };
287
281
  var _default = DxcTag;
288
282
  exports["default"] = _default;