@dxc-technology/halstack-react 0.0.0-c24450b → 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.
Files changed (129) hide show
  1. package/babel.config.js +6 -2
  2. package/dist/BackgroundColorContext.js +46 -0
  3. package/dist/ThemeContext.js +235 -2
  4. package/dist/accordion/Accordion.js +170 -81
  5. package/dist/accordion-group/AccordionGroup.js +186 -0
  6. package/dist/alert/Alert.js +184 -83
  7. package/dist/alert/index.d.ts +51 -0
  8. package/dist/badge/Badge.js +63 -0
  9. package/dist/box/Box.js +31 -23
  10. package/dist/button/Button.js +82 -27
  11. package/dist/card/Card.js +72 -35
  12. package/dist/checkbox/Checkbox.js +108 -32
  13. package/dist/chip/Chip.js +129 -35
  14. package/dist/common/RequiredComponent.js +2 -8
  15. package/dist/common/utils.js +2 -22
  16. package/dist/common/variables.js +1457 -210
  17. package/dist/date/Date.js +81 -59
  18. package/dist/dialog/Dialog.js +58 -37
  19. package/dist/dropdown/Dropdown.js +229 -68
  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 +87 -38
  24. package/dist/footer/dxc_logo.svg +15 -0
  25. package/dist/footer/readme.md +1 -1
  26. package/dist/header/Header.js +121 -72
  27. package/dist/header/dxc_logo_black.svg +8 -0
  28. package/dist/header/readme.md +1 -1
  29. package/dist/heading/Heading.js +81 -22
  30. package/dist/input-text/InputText.js +289 -101
  31. package/dist/layout/ApplicationLayout.js +331 -0
  32. package/dist/layout/facebook.svg +45 -0
  33. package/dist/layout/linkedin.svg +50 -0
  34. package/dist/layout/twitter.svg +53 -0
  35. package/dist/link/Link.js +136 -35
  36. package/dist/main.d.ts +8 -0
  37. package/dist/main.js +105 -1
  38. package/dist/new-date/NewDate.js +400 -0
  39. package/dist/new-date/index.d.ts +95 -0
  40. package/dist/new-select/NewSelect.js +836 -0
  41. package/dist/new-select/index.d.ts +53 -0
  42. package/dist/new-textarea/NewTextarea.js +369 -0
  43. package/dist/new-textarea/index.d.ts +117 -0
  44. package/dist/number/Number.js +136 -0
  45. package/dist/number/NumberContext.js +16 -0
  46. package/dist/number/index.d.ts +113 -0
  47. package/dist/paginator/Paginator.js +160 -49
  48. package/dist/password-input/PasswordInput.js +198 -0
  49. package/dist/password-input/index.d.ts +94 -0
  50. package/dist/progress-bar/ProgressBar.js +97 -44
  51. package/dist/radio/Radio.js +39 -21
  52. package/dist/resultsetTable/ResultsetTable.js +93 -69
  53. package/dist/select/Select.js +250 -143
  54. package/dist/sidenav/Sidenav.js +85 -143
  55. package/dist/slider/Slider.js +206 -70
  56. package/dist/spinner/Spinner.js +249 -64
  57. package/dist/switch/Switch.js +51 -26
  58. package/dist/table/Table.js +63 -15
  59. package/dist/tabs/Tabs.js +208 -35
  60. package/dist/tabs-for-sections/TabsForSections.js +1 -16
  61. package/dist/tag/Tag.js +100 -35
  62. package/dist/text-input/TextInput.js +971 -0
  63. package/dist/text-input/index.d.ts +135 -0
  64. package/dist/textarea/Textarea.js +81 -43
  65. package/dist/toggle/Toggle.js +16 -19
  66. package/dist/toggle-group/ToggleGroup.js +327 -0
  67. package/dist/upload/Upload.js +13 -8
  68. package/dist/upload/buttons-upload/ButtonsUpload.js +34 -20
  69. package/dist/upload/dragAndDropArea/DragAndDropArea.js +78 -31
  70. package/dist/upload/file-upload/FileToUpload.js +50 -24
  71. package/dist/upload/files-upload/FilesToUpload.js +16 -16
  72. package/dist/upload/transaction/Transaction.js +44 -24
  73. package/dist/upload/transactions/Transactions.js +38 -20
  74. package/dist/useTheme.js +22 -0
  75. package/dist/wizard/Wizard.js +142 -51
  76. package/dist/wizard/invalid_icon.svg +4 -5
  77. package/dist/wizard/valid_icon.svg +4 -5
  78. package/package.json +14 -6
  79. package/test/AccordionGroup.test.js +125 -0
  80. package/test/Date.test.js +13 -13
  81. package/test/Dropdown.test.js +19 -4
  82. package/test/FileInput.test.js +201 -0
  83. package/test/InputText.test.js +30 -26
  84. package/test/Link.test.js +25 -7
  85. package/test/NewDate.test.js +232 -0
  86. package/test/NewTextarea.test.js +195 -0
  87. package/test/Number.test.js +257 -0
  88. package/test/Paginator.test.js +72 -60
  89. package/test/PasswordInput.test.js +83 -0
  90. package/test/ResultsetTable.test.js +66 -19
  91. package/test/Select.test.js +55 -34
  92. package/test/Sidenav.test.js +22 -64
  93. package/test/Slider.test.js +17 -0
  94. package/test/Spinner.test.js +5 -0
  95. package/test/Tabs.test.js +21 -0
  96. package/test/TextInput.test.js +732 -0
  97. package/test/ToggleGroup.test.js +85 -0
  98. package/dist/accordion/Accordion.stories.js +0 -207
  99. package/dist/accordion/readme.md +0 -96
  100. package/dist/alert/Alert.stories.js +0 -158
  101. package/dist/alert/close.svg +0 -4
  102. package/dist/alert/error.svg +0 -4
  103. package/dist/alert/info.svg +0 -4
  104. package/dist/alert/readme.md +0 -43
  105. package/dist/alert/success.svg +0 -4
  106. package/dist/alert/warning.svg +0 -4
  107. package/dist/button/Button.stories.js +0 -224
  108. package/dist/button/readme.md +0 -93
  109. package/dist/common/services/example-service.js +0 -10
  110. package/dist/common/services/example-service.test.js +0 -12
  111. package/dist/date/calendar.svg +0 -1
  112. package/dist/date/calendar_dark.svg +0 -1
  113. package/dist/dialog/Dialog.stories.js +0 -217
  114. package/dist/dialog/readme.md +0 -32
  115. package/dist/dropdown/Dropdown.stories.js +0 -249
  116. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  117. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  118. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  119. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  120. package/dist/dropdown/readme.md +0 -69
  121. package/dist/footer/Footer.stories.js +0 -94
  122. package/dist/footer/dxc_logo_wht.png +0 -0
  123. package/dist/header/dxc_logo_black.png +0 -0
  124. package/dist/header/dxc_logo_white.png +0 -0
  125. package/dist/input-text/InputText.stories.js +0 -209
  126. package/dist/select/Select.stories.js +0 -235
  127. package/dist/select/readme.md +0 -72
  128. package/dist/sidenav/arrow_icon.svg +0 -3
  129. package/test/Toggle.test.js +0 -43
package/dist/date/Date.js CHANGED
@@ -37,22 +37,14 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
37
37
 
38
38
  var _InputText = _interopRequireDefault(require("../input-text/InputText"));
39
39
 
40
- require("../common/OpenSans.css");
41
-
42
40
  var _variables = require("../common/variables.js");
43
41
 
44
- var _utils = require("../common/utils.js");
45
-
46
- var _calendar = _interopRequireDefault(require("./calendar.svg"));
47
-
48
- var _calendar_dark = _interopRequireDefault(require("./calendar_dark.svg"));
49
-
50
- var _ThemeContext = _interopRequireDefault(require("../ThemeContext.js"));
42
+ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
51
43
 
52
44
  var _DxcDate$propTypes;
53
45
 
54
46
  function _templateObject() {
55
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: \"#FABADA\";\n"]);
47
+ var data = (0, _taggedTemplateLiteral2["default"])([""]);
56
48
 
57
49
  _templateObject = function _templateObject() {
58
50
  return data;
@@ -83,7 +75,9 @@ var DxcDate = function DxcDate(_ref) {
83
75
  onBlur = _ref$onBlur === void 0 ? "" : _ref$onBlur,
84
76
  margin = _ref.margin,
85
77
  _ref$size = _ref.size,
86
- size = _ref$size === void 0 ? "medium" : _ref$size;
78
+ size = _ref$size === void 0 ? "medium" : _ref$size,
79
+ _ref$tabIndex = _ref.tabIndex,
80
+ tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
87
81
 
88
82
  var _useState = (0, _react.useState)(""),
89
83
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -100,26 +94,16 @@ var DxcDate = function DxcDate(_ref) {
100
94
  anchorEl = _useState6[0],
101
95
  setAnchorEl = _useState6[1];
102
96
 
103
- var customTheme = (0, _react.useContext)(_ThemeContext["default"]);
104
- var colorsTheme = (0, _react.useMemo)(function () {
105
- return (0, _utils.getCustomTheme)(_variables.theme, (0, _utils.getCustomTheme)(_variables.defaultTheme, customTheme));
106
- }, [customTheme]);
97
+ var colorsTheme = (0, _useTheme["default"])();
107
98
 
108
- function handleMenuItemClick(date) {
99
+ var handleMenuItemClick = function handleMenuItemClick(date) {
109
100
  var stringValue = (0, _moment["default"])(date).format(format.toUpperCase());
110
- setIsOpen(false);
111
-
112
- if (value == null) {
113
- setInnerValue(stringValue);
114
- }
115
-
116
- if (typeof onChange === "function") {
117
- onChange({
118
- stringValue: stringValue,
119
- dateValue: date && date.toJSON() ? date : null
120
- });
121
- }
122
- }
101
+ if (value == null) setInnerValue(stringValue);
102
+ if (typeof onChange === "function") onChange({
103
+ stringValue: stringValue,
104
+ dateValue: date && date.toJSON() ? date : null
105
+ });
106
+ };
123
107
 
124
108
  var onChangeInput = function onChangeInput(string) {
125
109
  var momentDate = (0, _moment["default"])(string, format.toUpperCase(), true);
@@ -138,10 +122,7 @@ var DxcDate = function DxcDate(_ref) {
138
122
 
139
123
  var handlerInputBlur = function handlerInputBlur(inputString) {
140
124
  setInnerValue(inputString);
141
-
142
- if (onBlur) {
143
- onBlur(inputString);
144
- }
125
+ if (onBlur) onBlur(inputString);
145
126
  };
146
127
 
147
128
  var getValueForPicker = function getValueForPicker() {
@@ -155,19 +136,46 @@ var DxcDate = function DxcDate(_ref) {
155
136
  }
156
137
  };
157
138
 
139
+ var handlerPickerClose = function handlerPickerClose() {
140
+ setIsOpen(false);
141
+ handlerInputBlur(value == null ? innerValue : value);
142
+ };
143
+
144
+ var calendarSVG = function calendarSVG() {
145
+ return _react["default"].createElement("svg", {
146
+ xmlns: "http://www.w3.org/2000/svg",
147
+ height: "24",
148
+ viewBox: "0 0 24 24",
149
+ width: "24",
150
+ fill: "currentColor"
151
+ }, _react["default"].createElement("path", {
152
+ "data-testid": "calendarIcon",
153
+ d: "M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"
154
+ }), _react["default"].createElement("path", {
155
+ d: "M0 0h24v24H0z",
156
+ fill: "none"
157
+ }));
158
+ };
159
+
158
160
  var dateTheme = (0, _core.createMuiTheme)({
159
161
  overrides: {
162
+ MuiTypography: {
163
+ root: {
164
+ fontFamily: "".concat(colorsTheme.date.fontFamily, " !important")
165
+ }
166
+ },
160
167
  MuiPickersYearSelection: {
161
168
  container: {
169
+ color: colorsTheme.date.pickerYearColor,
162
170
  "&::-webkit-scrollbar": {
163
171
  width: "3px"
164
172
  },
165
173
  "&::-webkit-scrollbar-track": {
166
- backgroundColor: colorsTheme.date.scrollBarTrackColor,
174
+ backgroundColor: "#D9D9D9",
167
175
  borderRadius: "3px"
168
176
  },
169
177
  "&::-webkit-scrollbar-thumb": {
170
- backgroundColor: colorsTheme.date.scrollBarThumbColor,
178
+ backgroundColor: "#666666",
171
179
  borderRadius: "3px"
172
180
  }
173
181
  }
@@ -175,7 +183,7 @@ var DxcDate = function DxcDate(_ref) {
175
183
  MuiPickersToolbar: {
176
184
  toolbar: {
177
185
  backgroundColor: colorsTheme.date.pickerBackgroundColor,
178
- color: colorsTheme.date.pickerTextColor
186
+ color: colorsTheme.date.pickerFontColor
179
187
  }
180
188
  },
181
189
  MuiIconButton: {
@@ -193,7 +201,7 @@ var DxcDate = function DxcDate(_ref) {
193
201
  MuiButtonBase: {
194
202
  root: {
195
203
  "&:focus": {
196
- outline: colorsTheme.date.focusColor + " 2px solid"
204
+ outline: colorsTheme.date.focusColor + " solid 2px"
197
205
  }
198
206
  }
199
207
  },
@@ -203,21 +211,39 @@ var DxcDate = function DxcDate(_ref) {
203
211
  maxWidth: "unset",
204
212
  minHeight: "unset",
205
213
  padding: "0px 10px",
206
- height: "316px"
214
+ height: colorsTheme.date.pickerHeight,
215
+ width: colorsTheme.date.pickerWidth,
216
+ backgroundColor: colorsTheme.date.pickerBackgroundColor,
217
+ fontFamily: colorsTheme.date.fontFamily
207
218
  }
208
219
  },
209
220
  MuiPickersToolbarText: {
210
221
  toolbarTxt: {
211
- color: colorsTheme.date.pickerTextColor
222
+ color: colorsTheme.date.pickerActualDateColor,
223
+ fontFamily: colorsTheme.date.fontFamily,
224
+ fontSize: "2rem"
212
225
  },
213
226
  toolbarBtnSelected: {
214
- color: colorsTheme.date.pickerTextColor
227
+ color: colorsTheme.date.pickerActualDateColor
215
228
  }
216
229
  },
217
230
  MuiPickersCalendarHeader: {
231
+ transitionContainer: {
232
+ color: colorsTheme.date.pickerMonthColor
233
+ },
234
+ dayLabel: {
235
+ color: colorsTheme.date.pickerWeekLabelColor,
236
+ fontFamily: colorsTheme.date.fontFamily
237
+ },
218
238
  switchHeader: {
219
239
  backgroundColor: colorsTheme.white,
220
- color: colorsTheme.date.pickerTextColor
240
+ color: colorsTheme.date.pickerFontColor
241
+ },
242
+ iconButton: {
243
+ backgroundColor: colorsTheme.date.pickerBackgroundColorMonthArrows,
244
+ "&:hover": {
245
+ backgroundColor: colorsTheme.date.pickerBackgroundColorMonthArrows
246
+ }
221
247
  }
222
248
  },
223
249
  MuiPickersCalendar: {
@@ -227,14 +253,15 @@ var DxcDate = function DxcDate(_ref) {
227
253
  },
228
254
  MuiPickersDay: {
229
255
  current: {
230
- border: colorsTheme.date.pickerActualDate + " 2px solid",
231
- color: colorsTheme.date.pickerTextColor
256
+ border: colorsTheme.date.pickerActualDateColor + " 2px solid",
257
+ color: colorsTheme.date.pickerFontColor
232
258
  },
233
259
  day: {
234
- color: colorsTheme.date.pickerTextColor,
260
+ fontFamily: colorsTheme.date.fontFamily,
261
+ color: colorsTheme.date.pickerFontColor,
235
262
  "&:hover": {
236
- backgroundColor: colorsTheme.date.pickerSelectedDateBackgroundColor + colorsTheme.date.pickerHoverDateBackgroundColor,
237
- color: colorsTheme.date.pickerHoverDateTextColor
263
+ backgroundColor: colorsTheme.date.pickerHoverDateBackgroundColor,
264
+ color: colorsTheme.date.pickerHoverDateFontColor
238
265
  }
239
266
  },
240
267
  daySelected: {
@@ -252,13 +279,12 @@ var DxcDate = function DxcDate(_ref) {
252
279
  color: colorsTheme.date.pickerSelectedDateColor,
253
280
  backgroundColor: colorsTheme.date.pickerSelectedDateBackgroundColor,
254
281
  margin: "0px 100px",
255
- borderRadius: "20px",
256
- fontSize: "16px"
282
+ borderRadius: "20px"
257
283
  },
258
284
  root: {
259
285
  "&:focus": {
260
- color: colorsTheme.date.pickerHoverDateTextColor,
261
- backgroundColor: colorsTheme.date.pickerSelectedDateBackgroundColor + colorsTheme.date.pickerHoverDateBackgroundColor
286
+ color: colorsTheme.date.pickerHoverDateFontColor,
287
+ backgroundColor: colorsTheme.date.pickerHoverDateBackgroundColor
262
288
  }
263
289
  }
264
290
  },
@@ -267,9 +293,6 @@ var DxcDate = function DxcDate(_ref) {
267
293
  color: "pink"
268
294
  }
269
295
  }
270
- },
271
- typography: {
272
- fontFamily: '"Open Sans", sans-serif'
273
296
  }
274
297
  });
275
298
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
@@ -283,7 +306,7 @@ var DxcDate = function DxcDate(_ref) {
283
306
  }, _react["default"].createElement(_InputText["default"], {
284
307
  label: label,
285
308
  name: name,
286
- suffixIconSrc: _calendar["default"],
309
+ suffixIcon: calendarSVG,
287
310
  required: required,
288
311
  invalid: invalid,
289
312
  disabled: disabled,
@@ -294,7 +317,8 @@ var DxcDate = function DxcDate(_ref) {
294
317
  value: value == null ? innerValue : value,
295
318
  onClickSuffix: openCalendar,
296
319
  onChange: onChangeInput,
297
- onBlur: onBlur && handlerInputBlur || null
320
+ onBlur: onBlur && handlerInputBlur || null,
321
+ tabIndex: tabIndex
298
322
  }), _react["default"].createElement(_Popover["default"], {
299
323
  open: isOpen,
300
324
  anchorEl: anchorEl,
@@ -312,9 +336,7 @@ var DxcDate = function DxcDate(_ref) {
312
336
  }
313
337
  }
314
338
  }, _react["default"].createElement(_ClickAwayListener["default"], {
315
- onClickAway: function onClickAway() {
316
- return setIsOpen(false);
317
- }
339
+ onClickAway: handlerPickerClose
318
340
  }, _react["default"].createElement(_core.Paper, null, _react["default"].createElement(_pickers.DatePicker, {
319
341
  variant: "static",
320
342
  value: getValueForPicker(),
@@ -352,6 +374,6 @@ DxcDate.propTypes = (_DxcDate$propTypes = {
352
374
  bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
353
375
  left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
354
376
  right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
355
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])), _DxcDate$propTypes);
377
+ }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])), (0, _defineProperty2["default"])(_DxcDate$propTypes, "tabIndex", _propTypes["default"].number), _DxcDate$propTypes);
356
378
  var _default = DxcDate;
357
379
  exports["default"] = _default;
@@ -27,12 +27,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
27
27
 
28
28
  var _variables = require("../common/variables.js");
29
29
 
30
- var _utils = require("../common/utils.js");
30
+ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
31
31
 
32
- var _ThemeContext = _interopRequireDefault(require("../ThemeContext.js"));
32
+ var _BackgroundColorContext = require("../BackgroundColorContext.js");
33
33
 
34
34
  function _templateObject4() {
35
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 34px;\n height: 34px;\n"]);
35
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n"]);
36
36
 
37
37
  _templateObject4 = function _templateObject4() {
38
38
  return data;
@@ -42,7 +42,7 @@ function _templateObject4() {
42
42
  }
43
43
 
44
44
  function _templateObject3() {
45
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-end;\n position: absolute;\n top: 20px;\n right: 20px;\n cursor: pointer;\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n width: 34px;\n height: 34px;\n"]);
45
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-end;\n position: absolute;\n top: ", ";\n right: ", ";\n cursor: pointer;\n padding: 0;\n margin: 0;\n background: none;\n color: ", ";\n width: ", ";\n height: ", ";\n border: none;\n"]);
46
46
 
47
47
  _templateObject3 = function _templateObject3() {
48
48
  return data;
@@ -52,7 +52,7 @@ function _templateObject3() {
52
52
  }
53
53
 
54
54
  function _templateObject2() {
55
- var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow-y: auto;\n\n ::-webkit-scrollbar {\n width: 3px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n\n & * {\n ::-webkit-scrollbar {\n width: 3px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n }\n"]);
55
+ var data = (0, _taggedTemplateLiteral2["default"])([""]);
56
56
 
57
57
  _templateObject2 = function _templateObject2() {
58
58
  return data;
@@ -62,7 +62,7 @@ function _templateObject2() {
62
62
  }
63
63
 
64
64
  function _templateObject() {
65
- var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: unset;\n\n .MuiBackdrop-root {\n background-color: ", ";\n }\n .MuiDialog-paperWidthSm {\n background-color: ", ";\n max-width: ", ";\n min-width: ", ";\n box-sizing: border-box;\n min-height: ", ";\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n }\n"]);
65
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: unset;\n font-family: ", ";\n\n .MuiBackdrop-root {\n background-color: ", ";\n opacity: ", " !important;\n }\n .MuiDialog-paperWidthSm {\n background-color: ", ";\n max-width: ", ";\n min-width: ", ";\n box-sizing: border-box;\n min-height: ", ";\n box-shadow: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n }\n"]);
66
66
 
67
67
  _templateObject = function _templateObject() {
68
68
  return data;
@@ -79,33 +79,27 @@ var DxcDialog = function DxcDialog(_ref) {
79
79
  _ref$overlay = _ref.overlay,
80
80
  overlay = _ref$overlay === void 0 ? true : _ref$overlay,
81
81
  onBackgroundClick = _ref.onBackgroundClick,
82
- padding = _ref.padding;
83
- var customTheme = (0, _react.useContext)(_ThemeContext["default"]);
84
- var colorsTheme = (0, _react.useMemo)(function () {
85
- return (0, _utils.getCustomTheme)(_variables.theme, (0, _utils.getCustomTheme)(_variables.defaultTheme, customTheme));
86
- }, [customTheme]);
82
+ padding = _ref.padding,
83
+ _ref$tabIndex = _ref.tabIndex,
84
+ tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
87
85
 
88
86
  var _useState = (0, _react.useState)(),
89
87
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
90
88
  isResponsive = _useState2[0],
91
89
  setIsResponsive = _useState2[1];
92
90
 
91
+ var colorsTheme = (0, _useTheme["default"])();
92
+
93
93
  var handleClose = function handleClose() {
94
- if (typeof onCloseClick === "function") {
95
- onCloseClick();
96
- }
94
+ typeof onCloseClick === "function" && onCloseClick();
97
95
  };
98
96
 
99
97
  var handleOverlayClick = function handleOverlayClick() {
100
- if (typeof onBackgroundClick === "function") {
101
- onBackgroundClick();
102
- }
98
+ typeof onBackgroundClick === "function" && onBackgroundClick();
103
99
  };
104
100
 
105
101
  var handleResize = function handleResize(width) {
106
- if (width) {
107
- if (width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false)) ;
108
- }
102
+ width && width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false);
109
103
  };
110
104
 
111
105
  var handleEventListener = function handleEventListener() {
@@ -129,22 +123,30 @@ var DxcDialog = function DxcDialog(_ref) {
129
123
  padding: padding,
130
124
  isResponsive: isResponsive
131
125
  }, isCloseVisible && _react["default"].createElement(CloseIconContainer, {
132
- onClick: handleClose
126
+ onClick: handleClose,
127
+ tabIndex: tabIndex
133
128
  }, _react["default"].createElement(CloseIcon, {
134
129
  xmlns: "http://www.w3.org/2000/svg",
135
130
  width: "24",
136
131
  height: "24",
137
- viewBox: "0 0 24 24"
132
+ viewBox: "0 0 24 24",
133
+ fill: "currentColor"
138
134
  }, _react["default"].createElement("path", {
139
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
140
- }), _react["default"].createElement("path", {
141
- d: "M0 0h24v24H0z",
135
+ d: "M0 0h24v24H0V0z",
142
136
  fill: "none"
143
- }))), _react["default"].createElement(Children, null, children)));
137
+ }), _react["default"].createElement("path", {
138
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
139
+ }))), _react["default"].createElement(Children, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
140
+ color: colorsTheme.dialog.backgroundColor
141
+ }, children))));
144
142
  };
145
143
 
146
144
  var DialogContainer = (0, _styledComponents["default"])(_Dialog["default"])(_templateObject(), function (props) {
147
- return props.overlay === true ? props.theme.overlayColor + props.theme.overlayOpacity : "transparent";
145
+ return props.theme.fontFamily;
146
+ }, function (props) {
147
+ return props.overlay === true ? props.theme.overlayColor : "transparent";
148
+ }, function (props) {
149
+ return props.overlay === true && props.theme.overlayOpacity;
148
150
  }, function (props) {
149
151
  return props.theme.backgroundColor;
150
152
  }, function (props) {
@@ -154,7 +156,9 @@ var DialogContainer = (0, _styledComponents["default"])(_Dialog["default"])(_tem
154
156
  }, function (props) {
155
157
  return props.isCloseVisible ? "72px" : "";
156
158
  }, function (props) {
157
- return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
159
+ return "".concat(props.theme.boxShadowOffsetX, " ").concat(props.theme.boxShadowOffsetY, " ").concat(props.theme.boxShadowBlur, " ").concat(props.theme.boxShadowColor);
160
+ }, function (props) {
161
+ return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : _variables.spaces["small"];
158
162
  }, function (props) {
159
163
  return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
160
164
  }, function (props) {
@@ -165,19 +169,35 @@ var DialogContainer = (0, _styledComponents["default"])(_Dialog["default"])(_tem
165
169
  return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
166
170
  });
167
171
 
168
- var Children = _styledComponents["default"].div(_templateObject2(), function (props) {
169
- return props.theme.scrollBarTrackColor;
172
+ var Children = _styledComponents["default"].div(_templateObject2());
173
+
174
+ var CloseIconContainer = _styledComponents["default"].button(_templateObject3(), function (props) {
175
+ return props.theme.closeIconTopPosition;
176
+ }, function (props) {
177
+ return props.theme.closeIconRightPosition;
170
178
  }, function (props) {
171
- return props.theme.scrollBarThumbColor;
179
+ return props.theme.closeIconColor;
172
180
  }, function (props) {
173
- return props.theme.scrollBarTrackColor;
181
+ return props.theme.closeIconWidth;
174
182
  }, function (props) {
175
- return props.theme.scrollBarThumbColor;
183
+ return props.theme.closeIconHeight;
176
184
  });
177
185
 
178
- var CloseIconContainer = _styledComponents["default"].button(_templateObject3());
179
-
180
- var CloseIcon = _styledComponents["default"].svg(_templateObject4());
186
+ var CloseIcon = _styledComponents["default"].svg(_templateObject4(), function (props) {
187
+ return props.theme.closeIconBackgroundColor;
188
+ }, function (props) {
189
+ return props.theme.closeIconWidth;
190
+ }, function (props) {
191
+ return props.theme.closeIconHeight;
192
+ }, function (props) {
193
+ return props.theme.closeIconBorderRadius;
194
+ }, function (props) {
195
+ return props.theme.closeIconBorderThickness;
196
+ }, function (props) {
197
+ return props.theme.closeIconBorderStyle;
198
+ }, function (props) {
199
+ return props.theme.closeIconBorderColor;
200
+ });
181
201
 
182
202
  DxcDialog.propTypes = {
183
203
  padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
@@ -191,7 +211,8 @@ DxcDialog.propTypes = {
191
211
  onClose: _propTypes["default"].func,
192
212
  onCloseClick: _propTypes["default"].func,
193
213
  onBackgroundClick: _propTypes["default"].func,
194
- overlay: _propTypes["default"].bool
214
+ overlay: _propTypes["default"].bool,
215
+ tabIndex: _propTypes["default"].number
195
216
  };
196
217
  var _default = DxcDialog;
197
218
  exports["default"] = _default;