@dxc-technology/halstack-react 0.0.0-011babe → 0.0.0-0355f44

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.
Files changed (122) hide show
  1. package/dist/BackgroundColorContext.js +46 -0
  2. package/dist/ThemeContext.js +168 -105
  3. package/dist/accordion/Accordion.js +127 -48
  4. package/dist/accordion-group/AccordionGroup.js +34 -4
  5. package/dist/alert/Alert.js +178 -82
  6. package/dist/alert/index.d.ts +51 -0
  7. package/dist/badge/Badge.js +28 -7
  8. package/dist/box/Box.js +28 -19
  9. package/dist/button/Button.js +50 -21
  10. package/dist/card/Card.js +72 -35
  11. package/dist/checkbox/Checkbox.js +95 -26
  12. package/dist/chip/Chip.js +88 -32
  13. package/dist/common/utils.js +2 -22
  14. package/dist/common/variables.js +1376 -238
  15. package/dist/date/Date.js +70 -43
  16. package/dist/date-input/DateInput.js +400 -0
  17. package/dist/date-input/index.d.ts +95 -0
  18. package/dist/dialog/Dialog.js +51 -34
  19. package/dist/dropdown/Dropdown.js +169 -79
  20. package/dist/file-input/FileInput.js +644 -0
  21. package/dist/file-input/FileItem.js +280 -0
  22. package/dist/file-input/index.d.ts +81 -0
  23. package/dist/footer/Footer.js +70 -47
  24. package/dist/footer/dxc_logo.svg +15 -0
  25. package/dist/header/Header.js +89 -58
  26. package/dist/header/dxc_logo_black.svg +8 -0
  27. package/dist/heading/Heading.js +86 -23
  28. package/dist/input-text/InputText.js +234 -104
  29. package/dist/layout/ApplicationLayout.js +11 -10
  30. package/dist/link/Link.js +84 -36
  31. package/dist/main.d.ts +8 -0
  32. package/dist/main.js +68 -4
  33. package/dist/new-select/NewSelect.js +836 -0
  34. package/dist/new-select/index.d.ts +53 -0
  35. package/dist/new-textarea/NewTextarea.js +369 -0
  36. package/dist/new-textarea/index.d.ts +117 -0
  37. package/dist/number-input/NumberInput.js +136 -0
  38. package/dist/number-input/NumberInputContext.js +16 -0
  39. package/dist/number-input/index.d.ts +113 -0
  40. package/dist/paginator/Paginator.js +56 -18
  41. package/dist/password-input/PasswordInput.js +198 -0
  42. package/dist/password-input/index.d.ts +94 -0
  43. package/dist/progress-bar/ProgressBar.js +89 -37
  44. package/dist/radio/Radio.js +28 -11
  45. package/dist/resultsetTable/ResultsetTable.js +76 -44
  46. package/dist/select/Select.js +215 -151
  47. package/dist/sidenav/Sidenav.js +64 -12
  48. package/dist/slider/Slider.js +190 -63
  49. package/dist/spinner/Spinner.js +245 -60
  50. package/dist/switch/Switch.js +50 -20
  51. package/dist/table/Table.js +46 -10
  52. package/dist/tabs/Tabs.js +47 -15
  53. package/dist/tag/Tag.js +64 -33
  54. package/dist/text-input/TextInput.js +971 -0
  55. package/dist/text-input/index.d.ts +135 -0
  56. package/dist/textarea/Textarea.js +68 -36
  57. package/dist/toggle/Toggle.js +0 -2
  58. package/dist/toggle-group/ToggleGroup.js +148 -34
  59. package/dist/upload/Upload.js +16 -13
  60. package/dist/upload/buttons-upload/ButtonsUpload.js +28 -12
  61. package/dist/upload/dragAndDropArea/DragAndDropArea.js +63 -20
  62. package/dist/upload/file-upload/FileToUpload.js +43 -19
  63. package/dist/upload/files-upload/FilesToUpload.js +9 -8
  64. package/dist/upload/readme.md +2 -2
  65. package/dist/upload/transaction/Transaction.js +39 -18
  66. package/dist/upload/transactions/Transactions.js +27 -11
  67. package/dist/wizard/Wizard.js +120 -48
  68. package/dist/wizard/invalid_icon.svg +4 -5
  69. package/dist/wizard/valid_icon.svg +4 -5
  70. package/package.json +6 -4
  71. package/test/AccordionGroup.test.js +16 -0
  72. package/test/Date.test.js +49 -45
  73. package/test/DateInput.test.js +242 -0
  74. package/test/Dropdown.test.js +15 -0
  75. package/test/FileInput.test.js +201 -0
  76. package/test/InputText.test.js +24 -16
  77. package/test/Link.test.js +3 -2
  78. package/test/NewTextarea.test.js +195 -0
  79. package/test/NumberInput.test.js +259 -0
  80. package/test/Paginator.test.js +1 -1
  81. package/test/PasswordInput.test.js +83 -0
  82. package/test/ResultsetTable.test.js +1 -2
  83. package/test/Select.test.js +44 -24
  84. package/test/Spinner.test.js +5 -0
  85. package/test/TextInput.test.js +732 -0
  86. package/test/ToggleGroup.test.js +5 -1
  87. package/test/Upload.test.js +5 -5
  88. package/dist/accordion/Accordion.stories.js +0 -207
  89. package/dist/accordion/readme.md +0 -96
  90. package/dist/accordion-group/AccordionGroup.stories.js +0 -207
  91. package/dist/accordion-group/readme.md +0 -70
  92. package/dist/alert/Alert.stories.js +0 -158
  93. package/dist/alert/close.svg +0 -4
  94. package/dist/alert/error.svg +0 -4
  95. package/dist/alert/info.svg +0 -4
  96. package/dist/alert/readme.md +0 -43
  97. package/dist/alert/success.svg +0 -4
  98. package/dist/alert/warning.svg +0 -4
  99. package/dist/button/Button.stories.js +0 -224
  100. package/dist/button/readme.md +0 -93
  101. package/dist/common/services/example-service.js +0 -10
  102. package/dist/common/services/example-service.test.js +0 -12
  103. package/dist/date/calendar.svg +0 -1
  104. package/dist/date/calendar_dark.svg +0 -1
  105. package/dist/dialog/Dialog.stories.js +0 -217
  106. package/dist/dialog/readme.md +0 -32
  107. package/dist/dropdown/Dropdown.stories.js +0 -249
  108. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  109. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  110. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  111. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  112. package/dist/dropdown/readme.md +0 -69
  113. package/dist/footer/Footer.stories.js +0 -94
  114. package/dist/footer/dxc_logo_wht.png +0 -0
  115. package/dist/header/dxc_logo_black.png +0 -0
  116. package/dist/header/dxc_logo_blk_rgb.svg +0 -6
  117. package/dist/header/dxc_logo_white.png +0 -0
  118. package/dist/input-text/InputText.stories.js +0 -209
  119. package/dist/select/Select.stories.js +0 -235
  120. package/dist/select/readme.md +0 -72
  121. package/dist/slider/Slider.stories.js +0 -241
  122. package/dist/toggle-group/readme.md +0 -82
@@ -27,16 +27,16 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
27
27
 
28
28
  var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
29
29
 
30
- require("../common/OpenSans.css");
31
-
32
30
  var _variables = require("../common/variables.js");
33
31
 
34
32
  var _utils = require("../common/utils.js");
35
33
 
36
34
  var _useTheme = _interopRequireDefault(require("../useTheme.js"));
37
35
 
36
+ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
37
+
38
38
  function _templateObject3() {
39
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n width: 17px;\n height: 17px;\n position: absolute;\n left: ", ";\n right: ", ";\n z-index: 0;\n padding-left: ", ";\n padding-right: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
39
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n width: 16px;\n height: 16px;\n position: absolute;\n left: ", ";\n right: ", ";\n z-index: 0;\n margin-left: ", ";\n margin-right: ", ";\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 margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n display: inline-flex;\n align-items: center;\n cursor: ", ";\n position: relative;\n flex-direction: ", ";\n .MuiCheckbox-colorSecondary {\n &.Mui-checked {\n color: ", ";\n &:hover {\n background-color: transparent;\n }\n }\n }\n .MuiIconButton-colorSecondary {\n &:hover {\n background-color: transparent;\n }\n }\n .MuiButtonBase-root {\n &.Mui-focusVisible {\n .MuiIconButton-label {\n outline: ", " auto 1px;\n }\n }\n z-index: 1;\n padding: 10px;\n padding-left: ", ";\n padding-right: ", ";\n margin: 2px;\n margin-left: ", ";\n margin-right: ", ";\n color: ", " !important;\n }\n .MuiSvgIcon-root {\n width: 26.6px;\n height: 26.6px;\n }\n"]);
49
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n display: inline-flex;\n align-items: center;\n cursor: ", ";\n position: relative;\n flex-direction: ", ";\n .MuiCheckbox-colorSecondary {\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n }\n }\n &.Mui-disabled {\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n opacity: 0.34;\n }\n }\n }\n &.Mui-checked {\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n }\n }\n\n &:hover {\n background-color: transparent;\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n background-color: transparent;\n color: ", ";\n }\n }\n }\n }\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n width: 24px;\n height: 24px;\n }\n }\n }\n\n .MuiIconButton-colorSecondary {\n &:hover {\n background-color: transparent;\n }\n }\n .MuiButtonBase-root {\n &:hover {\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n }\n }\n }\n\n &.Mui-focusVisible {\n .MuiIconButton-label {\n box-shadow: 0 0 0 2px\n ", ";\n }\n }\n z-index: 1;\n margin: ", ";\n margin-left: ", ";\n margin-right: ", ";\n padding: 0px;\n left: ", ";\n right: ", ";\n }\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 color: ", ";\n opacity: ", ";\n cursor: ", ";\n font-family: ", ";\n"]);
59
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"]);
60
60
 
61
61
  _templateObject = function _templateObject() {
62
62
  return data;
@@ -81,14 +81,22 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
81
81
  required = _ref$required === void 0 ? false : _ref$required,
82
82
  margin = _ref.margin,
83
83
  _ref$size = _ref.size,
84
- size = _ref$size === void 0 ? "fitContent" : _ref$size;
84
+ size = _ref$size === void 0 ? "fitContent" : _ref$size,
85
+ _ref$tabIndex = _ref.tabIndex,
86
+ tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
85
87
 
86
88
  var _useState = (0, _react.useState)(false),
87
89
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
88
90
  innerChecked = _useState2[0],
89
91
  setInnerChecked = _useState2[1];
90
92
 
93
+ var _useState3 = (0, _react.useState)(false),
94
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
95
+ isLabelHovered = _useState4[0],
96
+ setIsLabelHovered = _useState4[1];
97
+
91
98
  var colorsTheme = (0, _useTheme["default"])();
99
+ var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
92
100
 
93
101
  var handlerCheckboxChange = function handlerCheckboxChange(checkboxValue) {
94
102
  if (checked === undefined) {
@@ -105,6 +113,10 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
105
113
  }
106
114
  };
107
115
 
116
+ var handleLabelHover = function handleLabelHover() {
117
+ setIsLabelHovered(!isLabelHovered);
118
+ };
119
+
108
120
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
109
121
  theme: colorsTheme.checkbox
110
122
  }, _react["default"].createElement(CheckboxContainer, {
@@ -113,26 +125,36 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
113
125
  labelPosition: labelPosition,
114
126
  disabled: disabled,
115
127
  margin: margin,
116
- size: size
128
+ size: size,
129
+ backgroundType: backgroundType,
130
+ isLabelHovered: isLabelHovered
117
131
  }, _react["default"].createElement(_Checkbox["default"], {
118
132
  checked: checked != undefined ? checked : innerChecked,
119
- inputProps: name = {
120
- name: name
133
+ inputProps: {
134
+ name: name,
135
+ "aria-label": label,
136
+ role: "checkbox",
137
+ "aria-checked": checked != undefined ? checked : innerChecked
121
138
  },
122
139
  onChange: handlerCheckboxChange,
123
140
  value: value,
124
141
  disabled: disabled,
125
142
  disableRipple: true,
126
- className: "test"
143
+ className: "test",
144
+ tabIndex: tabIndex
127
145
  }), _react["default"].createElement(CheckboxBlackBack, {
128
146
  labelPosition: labelPosition,
129
147
  disabled: disabled,
130
- checked: checked != undefined ? checked : innerChecked
148
+ checked: checked != undefined ? checked : innerChecked,
149
+ backgroundType: backgroundType
131
150
  }), required && _react["default"].createElement(_RequiredComponent["default"], null), label && _react["default"].createElement(LabelContainer, {
132
151
  labelPosition: labelPosition,
133
152
  onClick: disabled === true ? function (e) {} : handlerCheckboxChange,
134
153
  disabled: disabled,
135
- className: "labelContainer"
154
+ className: "labelContainer",
155
+ backgroundType: backgroundType,
156
+ onMouseOver: handleLabelHover,
157
+ onMouseOut: handleLabelHover
136
158
  }, label)));
137
159
  };
138
160
 
@@ -152,14 +174,56 @@ var calculateWidth = function calculateWidth(margin, size) {
152
174
  return sizes[size];
153
175
  };
154
176
 
177
+ var getDisabledColor = function getDisabledColor(props, element) {
178
+ switch (element) {
179
+ case "check":
180
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.disabledCheckColorOnDark : props.theme.disabledCheckColor;
181
+ break;
182
+
183
+ case "background":
184
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.disabledBackgroundColorCheckedOnDark : props.theme.disabledBackgroundColorChecked;
185
+ break;
186
+
187
+ case "border":
188
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;
189
+ break;
190
+
191
+ case "label":
192
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.disabledFontColorOnDark : props.theme.disabledFontColor;
193
+ break;
194
+ }
195
+ };
196
+
197
+ var getNotDisabledColor = function getNotDisabledColor(props, element) {
198
+ switch (element) {
199
+ case "check":
200
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.checkColorOnDark : props.theme.checkColor;
201
+ break;
202
+
203
+ case "background":
204
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.backgroundColorCheckedOnDark : props.theme.backgroundColorChecked;
205
+ break;
206
+
207
+ case "border":
208
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.borderColorOnDark : props.theme.borderColor;
209
+ break;
210
+
211
+ case "label":
212
+ return props.backgroundType && props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
213
+ break;
214
+ }
215
+ };
216
+
155
217
  var LabelContainer = _styledComponents["default"].span(_templateObject(), function (props) {
156
- return props.theme.fontColor;
157
- }, function (props) {
158
- return props.disabled && "0.34";
218
+ return props.disabled ? getDisabledColor(props, "label") : getNotDisabledColor(props, "label");
159
219
  }, function (props) {
160
220
  return props.disabled ? "not-allowed" : "pointer";
161
221
  }, function (props) {
162
222
  return props.theme.fontFamily;
223
+ }, function (props) {
224
+ return props.theme.fontSize;
225
+ }, function (props) {
226
+ return props.theme.fontWeight;
163
227
  });
164
228
 
165
229
  var CheckboxContainer = _styledComponents["default"].span(_templateObject2(), function (props) {
@@ -179,23 +243,31 @@ var CheckboxContainer = _styledComponents["default"].span(_templateObject2(), fu
179
243
  }, function (props) {
180
244
  return props.labelPosition === "before" ? "row-reverse" : "row";
181
245
  }, function (props) {
182
- return props.disabled && props.theme.disabledBackgroundColorChecked || props.theme.backgroundColorChecked;
246
+ return props.isLabelHovered ? props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor : getNotDisabledColor(props, "border");
183
247
  }, function (props) {
184
- return props.theme.focusColor;
248
+ return getDisabledColor(props, "border");
185
249
  }, function (props) {
186
- return props.labelPosition === "after" ? "0px" : "";
250
+ return props.disabled ? getDisabledColor(props, "background") : getNotDisabledColor(props, "background");
187
251
  }, function (props) {
188
- return props.labelPosition === "before" ? "0px" : "";
252
+ return props.backgroundType === "dark" ? props.theme.hoverBackgroundColorCheckedOnDark : props.theme.hoverBackgroundColorChecked;
253
+ }, function (props) {
254
+ return props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor;
255
+ }, function (props) {
256
+ return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
257
+ }, function (props) {
258
+ return props.theme.checkLabelSpacing;
189
259
  }, function (props) {
190
260
  return props.labelPosition === "after" ? "0px" : "";
191
261
  }, function (props) {
192
262
  return props.labelPosition === "before" ? "0px" : "";
193
263
  }, function (props) {
194
- return props.disabled && props.theme.disabledBorderColor || props.theme.borderColor;
264
+ return props.labelPosition === "before" ? "unset" : "1px";
265
+ }, function (props) {
266
+ return props.labelPosition === "before" ? "1px" : "unset";
195
267
  });
196
268
 
197
269
  var CheckboxBlackBack = _styledComponents["default"].span(_templateObject3(), function (props) {
198
- return props.checked !== true && "transparent" || props.disabled && props.theme.disabledCheckColor || props.theme.checkColor;
270
+ return !props.checked ? "transparent" : props.disabled ? getDisabledColor(props, "check") : getNotDisabledColor(props, "check");
199
271
  }, function (props) {
200
272
  return props.labelPosition === "before" ? "unset" : "5px";
201
273
  }, function (props) {
@@ -204,10 +276,6 @@ var CheckboxBlackBack = _styledComponents["default"].span(_templateObject3(), fu
204
276
  return props.labelPosition === "after" ? "0px" : "";
205
277
  }, function (props) {
206
278
  return props.labelPosition === "before" ? "0px" : "";
207
- }, function (props) {
208
- return props.labelPosition === "after" ? "0px" : "";
209
- }, function (props) {
210
- return props.labelPosition === "before" ? "0px" : "";
211
279
  });
212
280
 
213
281
  DxcCheckbox.propTypes = {
@@ -225,7 +293,8 @@ DxcCheckbox.propTypes = {
225
293
  bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
226
294
  left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
227
295
  right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
228
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
296
+ }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
297
+ tabIndex: _propTypes["default"].number
229
298
  };
230
299
  var _default = DxcCheckbox;
231
300
  exports["default"] = _default;
package/dist/chip/Chip.js CHANGED
@@ -23,14 +23,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
 
24
24
  var _variables = require("../common/variables.js");
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"));
31
29
 
32
30
  function _templateObject5() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n opacity: ", ";\n cursor: ", ";\n ", "\n max-width: 24px;\n max-height: 24px;\n overflow: hidden;\n"]);
31
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n ", "\n width: ", ";\n height: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n ", "\n }\n"]);
34
32
 
35
33
  _templateObject5 = function _templateObject5() {
36
34
  return data;
@@ -40,7 +38,7 @@ function _templateObject5() {
40
38
  }
41
39
 
42
40
  function _templateObject4() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n cursor: ", ";\n margin-right: ", ";\n max-width: 24px;\n max-height: 24px;\n"]);
41
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n margin-right: ", ";\n width: ", ";\n height: ", ";\n"]);
44
42
 
45
43
  _templateObject4 = function _templateObject4() {
46
44
  return data;
@@ -50,7 +48,7 @@ function _templateObject4() {
50
48
  }
51
49
 
52
50
  function _templateObject3() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n cursor: ", ";\n margin-left: ", ";\n max-width: 24px;\n max-height: 24px;\n"]);
51
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n margin-left: ", ";\n width: ", ";\n height: ", ";\n"]);
54
52
 
55
53
  _templateObject3 = function _templateObject3() {
56
54
  return data;
@@ -60,7 +58,7 @@ function _templateObject3() {
60
58
  }
61
59
 
62
60
  function _templateObject2() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n line-height: 24px;\n color: ", ";\n cursor: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"]);
61
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-style: ", ";\n color: ", ";\n cursor: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"]);
64
62
 
65
63
  _templateObject2 = function _templateObject2() {
66
64
  return data;
@@ -70,7 +68,7 @@ function _templateObject2() {
70
68
  }
71
69
 
72
70
  function _templateObject() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n border-radius: 50px;\n margin: 2px;\n max-width: ", ";\n background-color: ", ";\n ", ";\n height: ", ";\n padding: 10px 20px;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
71
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n min-height: 40px;\n max-width: ", ";\n background-color: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n cursor: ", ";\n"]);
74
72
 
75
73
  _templateObject = function _templateObject() {
76
74
  return data;
@@ -88,7 +86,9 @@ var DxcChip = function DxcChip(_ref) {
88
86
  prefixIconSrc = _ref.prefixIconSrc,
89
87
  onClickPrefix = _ref.onClickPrefix,
90
88
  disabled = _ref.disabled,
91
- margin = _ref.margin;
89
+ margin = _ref.margin,
90
+ _ref$tabIndex = _ref.tabIndex,
91
+ tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
92
92
  var colorsTheme = (0, _useTheme["default"])();
93
93
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
94
94
  theme: colorsTheme.chip
@@ -99,16 +99,21 @@ var DxcChip = function DxcChip(_ref) {
99
99
  disabled: disabled,
100
100
  prefixIcon: true,
101
101
  label: label,
102
+ mode: "prefix",
103
+ tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
102
104
  onClick: function onClick() {
103
105
  return onClickPrefix && !disabled && onClickPrefix(label);
104
- }
106
+ },
107
+ interactuable: typeof onClickPrefix === "function" && !disabled
105
108
  }, (0, _typeof2["default"])(prefixIcon) === "object" ? prefixIcon : _react["default"].createElement(prefixIcon)) : prefixIconSrc && _react["default"].createElement(PrefixIconContainer, {
106
109
  disabled: disabled,
107
110
  src: prefixIconSrc,
108
111
  label: label,
112
+ tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
109
113
  onClick: function onClick() {
110
114
  return onClickPrefix && !disabled && onClickPrefix(label);
111
- }
115
+ },
116
+ interactuable: typeof onClickPrefix === "function" && !disabled
112
117
  }), label && _react["default"].createElement(ChipTextContainer, {
113
118
  disabled: disabled,
114
119
  prefixIconSrc: prefixIconSrc,
@@ -116,32 +121,58 @@ var DxcChip = function DxcChip(_ref) {
116
121
  }, label), suffixIcon ? _react["default"].createElement(IconContainer, {
117
122
  disabled: disabled,
118
123
  suffixIcon: true,
124
+ mode: "suffix",
119
125
  label: label,
126
+ tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
120
127
  onClick: function onClick() {
121
128
  return onClickSuffix && !disabled && onClickSuffix(label);
122
- }
129
+ },
130
+ interactuable: typeof onClickSuffix === "function" && !disabled
123
131
  }, (0, _typeof2["default"])(suffixIcon) === "object" ? suffixIcon : _react["default"].createElement(suffixIcon)) : suffixIconSrc && _react["default"].createElement(SuffixIconContainer, {
124
132
  disabled: disabled,
125
133
  src: suffixIconSrc,
126
134
  label: label,
135
+ tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
127
136
  onClick: function onClick() {
128
137
  return onClickSuffix && !disabled && onClickSuffix(label);
129
- }
138
+ },
139
+ interactuable: typeof onClickSuffix === "function" && !disabled
130
140
  })));
131
141
  };
132
142
 
143
+ var getCursor = function getCursor(interactuable, disabled) {
144
+ if (disabled) {
145
+ return "cursor:not-allowed;";
146
+ }
147
+
148
+ if (interactuable) {
149
+ return "cursor:pointer;";
150
+ }
151
+
152
+ return "cursor:default; outline:none;";
153
+ };
154
+
133
155
  var StyledDxcChip = _styledComponents["default"].div(_templateObject(), function (_ref2) {
134
156
  var margin = _ref2.margin;
135
157
  return "calc(100% - 40px - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
136
158
  }, function (props) {
137
159
  return props.disabled && props.theme.disabledBackgroundColor || props.theme.backgroundColor;
138
160
  }, function (props) {
139
- return props.theme.outlinedColor !== "" ? "border: 2px solid ".concat(props.theme.outlinedColor) : "";
161
+ return props.theme.borderRadius;
140
162
  }, function (props) {
141
- return props.theme.outlinedColor !== "" ? "18px" : "22px";
142
- }, function (_ref3) {
143
- var disabled = _ref3.disabled;
144
- return disabled && "not-allowed";
163
+ return props.theme.borderThickness;
164
+ }, function (props) {
165
+ return props.theme.borderStyle;
166
+ }, function (props) {
167
+ return props.theme.borderColor;
168
+ }, function (props) {
169
+ return props.theme.contentPaddingTop;
170
+ }, function (props) {
171
+ return props.theme.contentPaddingBottom;
172
+ }, function (props) {
173
+ return props.theme.contentPaddingLeft;
174
+ }, function (props) {
175
+ return props.theme.contentPaddingRight;
145
176
  }, function (props) {
146
177
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
147
178
  }, function (props) {
@@ -152,6 +183,9 @@ var StyledDxcChip = _styledComponents["default"].div(_templateObject(), function
152
183
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
153
184
  }, function (props) {
154
185
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
186
+ }, function (_ref3) {
187
+ var disabled = _ref3.disabled;
188
+ return disabled && "not-allowed";
155
189
  });
156
190
 
157
191
  var ChipTextContainer = _styledComponents["default"].span(_templateObject2(), function (props) {
@@ -159,33 +193,54 @@ var ChipTextContainer = _styledComponents["default"].span(_templateObject2(), fu
159
193
  }, function (props) {
160
194
  return props.theme.fontFamily;
161
195
  }, function (props) {
162
- return props.disabled && props.theme.disabledFontColor || props.theme.fontColor;
196
+ return props.theme.fontWeight;
197
+ }, function (props) {
198
+ return props.theme.fontStyle;
199
+ }, function (props) {
200
+ return props.disabled ? props.theme.disabledFontColor : props.theme.fontColor;
163
201
  }, function (_ref4) {
164
202
  var disabled = _ref4.disabled;
165
203
  return disabled && "not-allowed" || "default";
166
204
  });
167
205
 
168
- var SuffixIconContainer = _styledComponents["default"].img(_templateObject3(), function (_ref5) {
169
- var disabled = _ref5.disabled;
170
- return disabled && "not-allowed" || "pointer";
206
+ var SuffixIconContainer = _styledComponents["default"].img(_templateObject3(), function (props) {
207
+ return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
171
208
  }, function (props) {
172
- return (props.label || props.suffixIconSrc) && "10px" || props.prefixIconSrc && "5px";
209
+ return getCursor(props.interactuable, props.disabled);
210
+ }, function (props) {
211
+ return (props.label || props.suffixIconSrc) && props.theme.iconSpacing || props.prefixIconSrc && "5px";
212
+ }, function (props) {
213
+ return props.theme.iconSize;
214
+ }, function (props) {
215
+ return props.theme.iconSize;
173
216
  });
174
217
 
175
- var PrefixIconContainer = _styledComponents["default"].img(_templateObject4(), function (_ref6) {
176
- var disabled = _ref6.disabled;
177
- return disabled && "not-allowed" || "pointer";
218
+ var PrefixIconContainer = _styledComponents["default"].img(_templateObject4(), function (props) {
219
+ return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
220
+ }, function (props) {
221
+ return getCursor(props.interactuable, props.disabled);
178
222
  }, function (props) {
179
- return (props.label || props.suffixIconSrc) && "10px" || props.prefixIconSrc && "5px";
223
+ return (props.label || props.suffixIconSrc) && props.theme.iconSpacing || props.prefixIconSrc && "5px";
224
+ }, function (props) {
225
+ return props.theme.iconSize;
226
+ }, function (props) {
227
+ return props.theme.iconSize;
180
228
  });
181
229
 
182
230
  var IconContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
183
- return props.disabled && 0.34;
184
- }, function (_ref7) {
185
- var disabled = _ref7.disabled;
186
- return disabled && "not-allowed" || "pointer";
231
+ return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
232
+ }, function (props) {
233
+ return props.prefixIcon ? "margin-right: ".concat((props.label || props.suffixIcon || props.suffixIconSrc) && props.theme.iconSpacing || (props.prefixIcon || props.prefixIconSrc) && "0", ";") : "margin-left: ".concat((props.label || props.prefixIcon || props.prefixIconSrc) && props.theme.iconSpacing || (props.prefixIcon || props.prefixIconSrc) && "0", ";");
234
+ }, function (props) {
235
+ return getCursor(props.interactuable, props.disabled);
236
+ }, function (props) {
237
+ return props.theme.iconSize;
238
+ }, function (props) {
239
+ return props.theme.iconSize;
240
+ }, function (props) {
241
+ return props.theme.focusColor;
187
242
  }, function (props) {
188
- return props.prefixIcon ? "margin-right: ".concat((props.label || props.suffixIcon || props.suffixIconSrc) && "10px" || (props.prefixIcon || props.prefixIconSrc) && "0", ";") : "margin-left: ".concat((props.label || props.prefixIcon || props.prefixIconSrc) && "10px" || (props.prefixIcon || props.prefixIconSrc) && "0", ";");
243
+ return props.disabled && "outline: none;";
189
244
  });
190
245
 
191
246
  DxcChip.propTypes = {
@@ -203,7 +258,8 @@ DxcChip.propTypes = {
203
258
  bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
204
259
  left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
205
260
  right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
206
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
261
+ }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
262
+ tabIndex: _propTypes["default"].number
207
263
  };
208
264
  var _default = DxcChip;
209
265
  exports["default"] = _default;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.getCustomTheme = exports.getMargin = void 0;
8
+ exports.getMargin = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
@@ -19,24 +19,4 @@ var getMargin = function getMargin(marginProp, side) {
19
19
  }
20
20
  };
21
21
 
22
- exports.getMargin = getMargin;
23
-
24
- var getCustomTheme = function getCustomTheme(defaultTheme, customTheme) {
25
- var newTheme = JSON.parse(JSON.stringify(defaultTheme));
26
-
27
- if (customTheme) {
28
- Object.keys(newTheme).map(function (component) {
29
- if (customTheme[component]) {
30
- Object.keys(newTheme[component]).map(function (objectKey) {
31
- if (customTheme[component][objectKey]) {
32
- newTheme[component][objectKey] = customTheme[component][objectKey];
33
- }
34
- });
35
- }
36
- });
37
- }
38
-
39
- return newTheme;
40
- };
41
-
42
- exports.getCustomTheme = getCustomTheme;
22
+ exports.getMargin = getMargin;