@dxc-technology/halstack-react 0.0.0-bd24f1d → 0.0.0-beebecd

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 (71) hide show
  1. package/dist/ThemeContext.js +131 -99
  2. package/dist/accordion/Accordion.js +44 -39
  3. package/dist/accordion-group/AccordionGroup.js +1 -3
  4. package/dist/alert/Alert.js +5 -5
  5. package/dist/alert/index.d.ts +51 -0
  6. package/dist/button/Button.js +29 -22
  7. package/dist/common/variables.js +419 -280
  8. package/dist/date/Date.js +5 -7
  9. package/dist/{new-date/NewDate.js → date-input/DateInput.js} +69 -72
  10. package/dist/date-input/index.d.ts +95 -0
  11. package/dist/dropdown/Dropdown.js +108 -68
  12. package/dist/file-input/FileInput.js +644 -0
  13. package/dist/file-input/FileItem.js +280 -0
  14. package/dist/file-input/index.d.ts +81 -0
  15. package/dist/header/Header.js +3 -23
  16. package/dist/input-text/InputText.js +3 -3
  17. package/dist/layout/ApplicationLayout.js +1 -1
  18. package/dist/link/Link.js +4 -8
  19. package/dist/main.d.ts +8 -0
  20. package/dist/main.js +29 -13
  21. package/dist/new-select/NewSelect.js +836 -0
  22. package/dist/new-select/index.d.ts +53 -0
  23. package/dist/new-textarea/NewTextarea.js +62 -39
  24. package/dist/new-textarea/index.d.ts +117 -0
  25. package/dist/{number/Number.js → number-input/NumberInput.js} +9 -11
  26. package/dist/{number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
  27. package/dist/number-input/index.d.ts +113 -0
  28. package/dist/{password/Password.js → password-input/PasswordInput.js} +11 -13
  29. package/dist/password-input/index.d.ts +94 -0
  30. package/dist/progress-bar/ProgressBar.js +62 -26
  31. package/dist/select/Select.js +122 -158
  32. package/dist/sidenav/Sidenav.js +6 -4
  33. package/dist/slider/Slider.js +89 -14
  34. package/dist/spinner/Spinner.js +217 -54
  35. package/dist/tag/Tag.js +26 -32
  36. package/dist/{new-input-text/NewInputText.js → text-input/TextInput.js} +180 -170
  37. package/dist/text-input/index.d.ts +135 -0
  38. package/dist/toggle-group/ToggleGroup.js +132 -28
  39. package/dist/upload/transaction/Transaction.js +2 -2
  40. package/package.json +2 -1
  41. package/test/{NewDate.test.js → DateInput.test.js} +66 -27
  42. package/test/FileInput.test.js +201 -0
  43. package/test/InputText.test.js +24 -16
  44. package/test/NewTextarea.test.js +95 -101
  45. package/test/{Number.test.js → NumberInput.test.js} +84 -66
  46. package/test/Paginator.test.js +1 -1
  47. package/test/PasswordInput.test.js +83 -0
  48. package/test/ResultsetTable.test.js +1 -2
  49. package/test/Select.test.js +40 -17
  50. package/test/Spinner.test.js +5 -0
  51. package/test/{NewInputText.test.js → TextInput.test.js} +146 -231
  52. package/test/ToggleGroup.test.js +5 -1
  53. package/dist/accordion/Accordion.stories.js +0 -207
  54. package/dist/accordion/readme.md +0 -96
  55. package/dist/accordion-group/AccordionGroup.stories.js +0 -207
  56. package/dist/accordion-group/readme.md +0 -70
  57. package/dist/button/Button.stories.js +0 -224
  58. package/dist/button/readme.md +0 -93
  59. package/dist/dropdown/Dropdown.stories.js +0 -249
  60. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  61. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  62. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  63. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  64. package/dist/dropdown/readme.md +0 -69
  65. package/dist/footer/Footer.stories.js +0 -94
  66. package/dist/input-text/InputText.stories.js +0 -209
  67. package/dist/password/styles.css +0 -3
  68. package/dist/select/Select.stories.js +0 -235
  69. package/dist/select/readme.md +0 -72
  70. package/dist/slider/Slider.stories.js +0 -241
  71. package/test/Password.test.js +0 -76
@@ -35,9 +35,39 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
35
35
 
36
36
  var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
37
37
 
38
- function _templateObject4() {
38
+ function _templateObject7() {
39
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n"]);
40
+
41
+ _templateObject7 = function _templateObject7() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _templateObject6() {
39
49
  var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-left: ", ";\n"]);
40
50
 
51
+ _templateObject6 = function _templateObject6() {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ function _templateObject5() {
59
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-right: ", ";\n"]);
60
+
61
+ _templateObject5 = function _templateObject5() {
62
+ return data;
63
+ };
64
+
65
+ return data;
66
+ }
67
+
68
+ function _templateObject4() {
69
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 48px;\n align-items: center;\n\n .MultiSlider-root {\n display: flex;\n align-items: center;\n }\n .MuiSlider-container {\n padding: 30px 24px;\n }\n .MuiSlider-root.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n .Mui-disabled {\n & .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n }\n & .MuiSlider-track {\n background-color: ", ";\n }\n & .MuiSlider-rail {\n background-color: ", ";\n }\n & > .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", " !important;\n }\n & > .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n }\n .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n border-radius: 9999px;\n\n :hover,\n &.Mui-focusVisible {\n box-shadow: none;\n }\n &.MuiSlider-active {\n box-shadow: none;\n }\n :focus {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n height: ", ";\n width: ", ";\n top: ", ";\n }\n :active {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n }\n }\n .MuiSlider-track {\n background-color: ", ";\n height: ", ";\n top: ", ";\n border-radius: 9999px;\n }\n .MuiSlider-track.MuiSlider-trackAfter {\n background-color: ", ";\n }\n .MuiSlider-rail {\n background-color: ", ";\n height: ", ";\n top: ", ";\n }\n .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", ";\n }\n .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n"]);
70
+
41
71
  _templateObject4 = function _templateObject4() {
42
72
  return data;
43
73
  };
@@ -46,7 +76,7 @@ function _templateObject4() {
46
76
  }
47
77
 
48
78
  function _templateObject3() {
49
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-right: 16px;\n"]);
79
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
50
80
 
51
81
  _templateObject3 = function _templateObject3() {
52
82
  return data;
@@ -56,7 +86,7 @@ function _templateObject3() {
56
86
  }
57
87
 
58
88
  function _templateObject2() {
59
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n\n .MultiSlider-root {\n display: flex;\n align-items: center;\n }\n .MuiSlider-container {\n padding: 30px 24px;\n }\n .MuiSlider-root.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n .Mui-disabled {\n & .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n }\n & .MuiSlider-track {\n background-color: ", ";\n }\n & .MuiSlider-rail {\n background-color: ", ";\n }\n & > .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", " !important;\n }\n & > .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n }\n .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n border-radius: 9999px;\n\n :hover,\n &.Mui-focusVisible {\n box-shadow: none;\n }\n &.MuiSlider-active {\n box-shadow: none;\n }\n :focus {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n }\n :active {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n }\n }\n .MuiSlider-track {\n background-color: ", ";\n height: ", ";\n top: ", ";\n border-radius: 9999px;\n }\n .MuiSlider-track.MuiSlider-trackAfter {\n background-color: ", ";\n }\n .MuiSlider-rail {\n background-color: ", ";\n height: ", ";\n top: ", ";\n }\n .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", ";\n }\n .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n"]);
89
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
60
90
 
61
91
  _templateObject2 = function _templateObject2() {
62
92
  return data;
@@ -66,7 +96,7 @@ function _templateObject2() {
66
96
  }
67
97
 
68
98
  function _templateObject() {
69
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 32px;\n\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n"]);
99
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n"]);
70
100
 
71
101
  _templateObject = function _templateObject() {
72
102
  return data;
@@ -76,7 +106,9 @@ function _templateObject() {
76
106
  }
77
107
 
78
108
  var DxcSlider = function DxcSlider(_ref) {
79
- var _ref$minValue = _ref.minValue,
109
+ var label = _ref.label,
110
+ helperText = _ref.helperText,
111
+ _ref$minValue = _ref.minValue,
80
112
  minValue = _ref$minValue === void 0 ? 0 : _ref$minValue,
81
113
  _ref$maxValue = _ref.maxValue,
82
114
  maxValue = _ref$maxValue === void 0 ? 100 : _ref$maxValue,
@@ -139,9 +171,10 @@ var DxcSlider = function DxcSlider(_ref) {
139
171
 
140
172
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
141
173
  theme: colorsTheme.slider
142
- }, _react["default"].createElement(SliderContainer, {
174
+ }, _react["default"].createElement(Container, {
143
175
  margin: margin,
144
- size: size,
176
+ size: size
177
+ }, _react["default"].createElement(Label, null, label), _react["default"].createElement(HelperText, null, helperText), _react["default"].createElement(SliderContainer, {
145
178
  backgroundType: backgroundType
146
179
  }, showLimitsValues && _react["default"].createElement(MinLabelContainer, {
147
180
  backgroundType: backgroundType,
@@ -167,7 +200,7 @@ var DxcSlider = function DxcSlider(_ref) {
167
200
  disabled: disabled,
168
201
  onChange: handlerInputChange,
169
202
  size: "small"
170
- }))));
203
+ })))));
171
204
  };
172
205
 
173
206
  var sizes = {
@@ -180,9 +213,7 @@ var calculateWidth = function calculateWidth(margin, size) {
180
213
  return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
181
214
  };
182
215
 
183
- var StyledTextInput = _styledComponents["default"].div(_templateObject());
184
-
185
- var SliderContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
216
+ var Container = _styledComponents["default"].div(_templateObject(), function (props) {
186
217
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
187
218
  }, function (props) {
188
219
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -194,7 +225,37 @@ var SliderContainer = _styledComponents["default"].div(_templateObject2(), funct
194
225
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
195
226
  }, function (props) {
196
227
  return calculateWidth(props.margin, props.size);
228
+ });
229
+
230
+ var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
231
+ return props.theme.labelFontColor;
232
+ }, function (props) {
233
+ return props.theme.labelFontFamily;
234
+ }, function (props) {
235
+ return props.theme.labelFontSize;
236
+ }, function (props) {
237
+ return props.theme.labelFontStyle;
238
+ }, function (props) {
239
+ return props.theme.labelFontWeight;
240
+ }, function (props) {
241
+ return props.theme.labelLineHeight;
242
+ });
243
+
244
+ var HelperText = _styledComponents["default"].span(_templateObject3(), function (props) {
245
+ return props.theme.helperTextFontColor;
246
+ }, function (props) {
247
+ return props.theme.helperTextFontFamily;
197
248
  }, function (props) {
249
+ return props.theme.helperTextFontSize;
250
+ }, function (props) {
251
+ return props.theme.helperTextFontstyle;
252
+ }, function (props) {
253
+ return props.theme.helperTextFontWeight;
254
+ }, function (props) {
255
+ return props.theme.helperTextLineHeight;
256
+ });
257
+
258
+ var SliderContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
198
259
  return props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor;
199
260
  }, function (props) {
200
261
  return props.theme.thumbHeight;
@@ -234,6 +295,12 @@ var SliderContainer = _styledComponents["default"].div(_templateObject2(), funct
234
295
  return props.backgroundType === "dark" ? props.theme.hoverThumbBackgroundColorOnDark : props.theme.hoverThumbBackgroundColor;
235
296
  }, function (props) {
236
297
  return props.theme.hoverThumbScale;
298
+ }, function (props) {
299
+ return props.theme.hoverThumbHeight;
300
+ }, function (props) {
301
+ return props.theme.hoverThumbWidth;
302
+ }, function (props) {
303
+ return props.theme.hoverThumbVerticalPosition;
237
304
  }, function (props) {
238
305
  return props.backgroundType === "dark" ? props.theme.activeThumbBackgroundColorOnDark : props.theme.activeThumbBackgroundColor;
239
306
  }, function (props) {
@@ -264,7 +331,7 @@ var SliderContainer = _styledComponents["default"].div(_templateObject2(), funct
264
331
  return props.theme.tickVerticalPosition;
265
332
  });
266
333
 
267
- var MinLabelContainer = _styledComponents["default"].span(_templateObject3(), function (props) {
334
+ var MinLabelContainer = _styledComponents["default"].span(_templateObject5(), function (props) {
268
335
  return props.theme.fontFamily;
269
336
  }, function (props) {
270
337
  return props.theme.fontSize;
@@ -276,9 +343,11 @@ var MinLabelContainer = _styledComponents["default"].span(_templateObject3(), fu
276
343
  return props.disabled ? props.theme.disabledFontColor : props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
277
344
  }, function (props) {
278
345
  return props.theme.fontLetterSpacing;
346
+ }, function (props) {
347
+ return props.theme.floorLabelMarginRight;
279
348
  });
280
349
 
281
- var MaxLabelContainer = _styledComponents["default"].span(_templateObject4(), function (props) {
350
+ var MaxLabelContainer = _styledComponents["default"].span(_templateObject6(), function (props) {
282
351
  return props.theme.fontFamily;
283
352
  }, function (props) {
284
353
  return props.theme.fontSize;
@@ -291,10 +360,16 @@ var MaxLabelContainer = _styledComponents["default"].span(_templateObject4(), fu
291
360
  }, function (props) {
292
361
  return props.theme.fontLetterSpacing;
293
362
  }, function (props) {
294
- return props.step === 1 ? "16px" : "20px";
363
+ return props.step === 1 ? props.theme.ceilLabelMarginLeft : "1.25rem";
364
+ });
365
+
366
+ var StyledTextInput = _styledComponents["default"].div(_templateObject7(), function (props) {
367
+ return props.theme.inputMarginLeft;
295
368
  });
296
369
 
297
370
  DxcSlider.propTypes = {
371
+ label: _propTypes["default"].string,
372
+ helperText: _propTypes["default"].string,
298
373
  size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
299
374
  minValue: _propTypes["default"].number,
300
375
  maxValue: _propTypes["default"].number,
@@ -19,8 +19,6 @@ var _react = _interopRequireWildcard(require("react"));
19
19
 
20
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
21
 
22
- var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
23
-
24
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
25
23
 
26
24
  var _variables = require("../common/variables.js");
@@ -29,8 +27,88 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
29
27
 
30
28
  var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
31
29
 
30
+ function _templateObject12() {
31
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"]);
32
+
33
+ _templateObject12 = function _templateObject12() {
34
+ return data;
35
+ };
36
+
37
+ return data;
38
+ }
39
+
40
+ function _templateObject11() {
41
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"]);
42
+
43
+ _templateObject11 = function _templateObject11() {
44
+ return data;
45
+ };
46
+
47
+ return data;
48
+ }
49
+
50
+ function _templateObject10() {
51
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: block;\n margin: 0 auto;\n position: absolute;\n text-align: center;\n width: 110px;\n"]);
52
+
53
+ _templateObject10 = function _templateObject10() {
54
+ return data;
55
+ };
56
+
57
+ return data;
58
+ }
59
+
60
+ function _templateObject9() {
61
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n fill: transparent;\n stroke-linecap: initial;\n vector-effect: non-scaling-stroke;\n animation: ", ";\n stroke: ", ";\n transform-origin: ", ";\n stroke-dasharray: ", ";\n stroke-width: ", ";\n stroke-dashoffset: ", ";\n"]);
62
+
63
+ _templateObject9 = function _templateObject9() {
64
+ return data;
65
+ };
66
+
67
+ return data;
68
+ }
69
+
70
+ function _templateObject8() {
71
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n transform: rotate(-90deg);\n top: 0;\n left: 0;\n transform-origin: center;\n overflow: visible;\n animation: ", ";\n"]);
72
+
73
+ _templateObject8 = function _templateObject8() {
74
+ return data;
75
+ };
76
+
77
+ return data;
78
+ }
79
+
80
+ function _templateObject7() {
81
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: relative;\n z-index: 2;\n"]);
82
+
83
+ _templateObject7 = function _templateObject7() {
84
+ return data;
85
+ };
86
+
87
+ return data;
88
+ }
89
+
90
+ function _templateObject6() {
91
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n animation: none;\n fill: transparent;\n stroke: ", ";\n stroke-dasharray: ", ";\n stroke-linecap: initial;\n stroke-width: ", ";\n transform-origin: 50% 50%;\n vector-effect: non-scaling-stroke;\n"]);
92
+
93
+ _templateObject6 = function _templateObject6() {
94
+ return data;
95
+ };
96
+
97
+ return data;
98
+ }
99
+
100
+ function _templateObject5() {
101
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n"]);
102
+
103
+ _templateObject5 = function _templateObject5() {
104
+ return data;
105
+ };
106
+
107
+ return data;
108
+ }
109
+
32
110
  function _templateObject4() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n margin-top: ", ";\n display: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"]);
111
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: absolute;\n z-index: 1;\n"]);
34
112
 
35
113
  _templateObject4 = function _templateObject4() {
36
114
  return data;
@@ -40,7 +118,7 @@ function _templateObject4() {
40
118
  }
41
119
 
42
120
  function _templateObject3() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n margin-top: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"]);
121
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 100vw;\n height: 100vh;\n opacity: 1;\n transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n position: fixed;\n top: 0;\n left: 0;\n background-color: ", ";\n opacity: ", ";\n"]);
44
122
 
45
123
  _templateObject3 = function _templateObject3() {
46
124
  return data;
@@ -50,7 +128,7 @@ function _templateObject3() {
50
128
  }
51
129
 
52
130
  function _templateObject2() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: unset;\n border-radius: 80px;\n border: ", ";\n width: ", ";\n height: ", ";\n z-index: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n .MuiCircularProgress-colorPrimary {\n color: ", ";\n width: ", ";\n height: ", ";\n margin-top: ", ";\n margin-left: ", ";\n }\n\n .MuiCircularProgress-circle {\n stroke-width: ", ";\n r: ", ";\n }\n"]);
131
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n align-items: center;\n display: flex;\n height: ", ";\n width: ", ";\n justify-content: center;\n position: relative;\n background-color: transparent;\n\n @keyframes spinner-svg {\n 0% {\n transform: rotateZ(0deg);\n }\n 100% {\n transform: rotateZ(360deg);\n }\n }\n @keyframes svg-circle-large {\n 0% {\n stroke-dashoffset: 400;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 75;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 400;\n transform: rotate(360deg);\n }\n }\n @keyframes svg-circle-small {\n 0% {\n stroke-dashoffset: 35;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 8;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 35;\n transform: rotate(360deg);\n }\n }\n"]);
54
132
 
55
133
  _templateObject2 = function _templateObject2() {
56
134
  return data;
@@ -60,7 +138,7 @@ function _templateObject2() {
60
138
  }
61
139
 
62
140
  function _templateObject() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n opacity: ", ";\n display: flex;\n flex-wrap: wrap;\n justify-content: ", ";\n align-items: ", ";\n position: ", ";\n top: ", ";\n left: ", ";\n right: ", ";\n bottom: ", ";\n z-index: ", ";\n"]);
141
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n display: ", ";\n position: ", ";\n top: ", ";\n left: ", ";\n justify-content: ", ";\n align-items: ", ";\n z-index: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
64
142
 
65
143
  _templateObject = function _templateObject() {
66
144
  return data;
@@ -82,29 +160,98 @@ var DxcSpinner = function DxcSpinner(_ref) {
82
160
  var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
83
161
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
84
162
  theme: colorsTheme.spinner
85
- }, _react["default"].createElement(BackgroundSpinner, {
86
- mode: mode
87
163
  }, _react["default"].createElement(DXCSpinner, {
88
- backgroundType: backgroundType,
89
164
  margin: margin,
90
- showValue: showValue,
91
- label: label,
92
165
  mode: mode
93
- }, label && mode !== "small" && _react["default"].createElement(SpinnerLabel, {
166
+ }, _react["default"].createElement(SpinnerContainer, {
94
167
  backgroundType: backgroundType,
95
- showValue: showValue,
96
168
  mode: mode
97
- }, label), value && mode !== "small" && _react["default"].createElement(SpinnerProgress, {
169
+ }, mode === "overlay" && _react["default"].createElement(BackOverlay, null), _react["default"].createElement(BackgroundSpinner, {
170
+ mode: mode
171
+ }, mode !== "small" && _react["default"].createElement(SVGBackground, {
172
+ viewBox: "0 0 140 140"
173
+ }, _react["default"].createElement(CircleBackground, {
174
+ cx: "70",
175
+ cy: "70",
176
+ r: "65",
177
+ mode: mode
178
+ })), mode === "small" && _react["default"].createElement(SVGBackground, {
179
+ viewBox: "0 0 16 16"
180
+ }, _react["default"].createElement(CircleBackground, {
181
+ cx: "8",
182
+ cy: "8",
183
+ r: "6",
184
+ mode: mode
185
+ }))), value >= 0 && value <= 100 ? _react["default"].createElement(Spinner, {
186
+ role: "progressbar",
187
+ mode: mode
188
+ }, mode !== "small" && _react["default"].createElement(SVGSpinner, {
189
+ viewBox: "0 0 140 140",
190
+ isDeterminated: true
191
+ }, _react["default"].createElement(CircleSpinner, {
192
+ cx: "70",
193
+ cy: "70",
194
+ r: "65",
98
195
  backgroundType: backgroundType,
99
196
  mode: mode,
100
- showValue: showValue,
101
- label: label
102
- }, value === "" ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100, "%"), _react["default"].createElement(_CircularProgress["default"], {
103
- variant: showValue ? "static" : "indeterminate",
104
- value: value === "" ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100,
197
+ isDeterminated: true,
198
+ value: value
199
+ })), mode === "small" && _react["default"].createElement(SVGSpinner, {
200
+ viewBox: "0 0 16 16",
201
+ isDeterminated: true
202
+ }, _react["default"].createElement(CircleSpinner, {
203
+ cx: "8",
204
+ cy: "8",
205
+ r: "6",
206
+ backgroundType: backgroundType,
105
207
  mode: mode,
106
- label: label
107
- }))));
208
+ isDeterminated: true,
209
+ value: value
210
+ }))) : _react["default"].createElement(Spinner, {
211
+ role: "progressbar",
212
+ mode: mode
213
+ }, mode !== "small" && _react["default"].createElement(SVGSpinner, {
214
+ viewBox: "0 0 140 140",
215
+ isDeterminated: false
216
+ }, _react["default"].createElement(CircleSpinner, {
217
+ cx: "70",
218
+ cy: "70",
219
+ r: "65",
220
+ backgroundType: backgroundType,
221
+ mode: mode,
222
+ isDeterminated: false
223
+ })), mode === "small" && _react["default"].createElement(SVGSpinner, {
224
+ viewBox: "0 0 16 16",
225
+ isDeterminated: false
226
+ }, _react["default"].createElement(CircleSpinner, {
227
+ cx: "8",
228
+ cy: "8",
229
+ r: "6",
230
+ backgroundType: backgroundType,
231
+ mode: mode,
232
+ isDeterminated: false
233
+ }))), mode !== "small" && _react["default"].createElement(LabelsContainer, {
234
+ label: label,
235
+ value: value,
236
+ showValue: showValue
237
+ }, _react["default"].createElement(SpinnerLabel, {
238
+ backgroundType: backgroundType,
239
+ mode: mode
240
+ }, label), (value || value === 0) && showValue && _react["default"].createElement(SpinnerProgress, {
241
+ backgroundType: backgroundType,
242
+ mode: mode,
243
+ showValue: showValue
244
+ }, value, "%")))));
245
+ };
246
+
247
+ var determinatedValue = function determinatedValue(props, strokeDashArray) {
248
+ var val = 0;
249
+
250
+ if (props.value >= 0 && props.value <= 100) {
251
+ val = strokeDashArray * (1 - props.value / 100);
252
+ }
253
+
254
+ return val;
108
255
  };
109
256
 
110
257
  DxcSpinner.propTypes = {
@@ -120,14 +267,12 @@ DxcSpinner.propTypes = {
120
267
  }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
121
268
  };
122
269
 
123
- var BackgroundSpinner = _styledComponents["default"].div(_templateObject(), function (props) {
124
- return props.mode === "overlay" ? "".concat(props.theme.overlayBackgroundColor) : "transparent";
125
- }, function (props) {
126
- return props.mode === "overlay" && "".concat(props.theme.overlayOpacity);
270
+ var DXCSpinner = _styledComponents["default"].div(_templateObject(), function (props) {
271
+ return props.mode === "overlay" ? "100vh" : "";
127
272
  }, function (props) {
128
- return props.mode === "overlay" ? "center" : "";
273
+ return props.mode === "overlay" ? "100vw" : "";
129
274
  }, function (props) {
130
- return props.mode === "overlay" ? "center" : "";
275
+ return props.mode === "overlay" ? "flex" : "";
131
276
  }, function (props) {
132
277
  return props.mode === "overlay" ? "fixed" : "";
133
278
  }, function (props) {
@@ -135,21 +280,11 @@ var BackgroundSpinner = _styledComponents["default"].div(_templateObject(), func
135
280
  }, function (props) {
136
281
  return props.mode === "overlay" ? 0 : "";
137
282
  }, function (props) {
138
- return props.mode === "overlay" ? 0 : "";
283
+ return props.mode === "overlay" ? "center" : "";
139
284
  }, function (props) {
140
- return props.mode === "overlay" ? 0 : "";
285
+ return props.mode === "overlay" ? "center" : "";
141
286
  }, function (props) {
142
287
  return props.mode === "overlay" ? 1300 : "";
143
- });
144
-
145
- var DXCSpinner = _styledComponents["default"].div(_templateObject2(), function (props) {
146
- return props.mode === "small" && "2px solid ".concat(props.theme.totalCircleColor) || "8.5px solid ".concat(props.theme.totalCircleColor);
147
- }, function (props) {
148
- return props.mode === "small" && "16px" || "120px";
149
- }, function (props) {
150
- return props.mode === "small" && "16px" || "120px";
151
- }, function (props) {
152
- return props.mode === "overlay" ? "100" : "";
153
288
  }, function (props) {
154
289
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
155
290
  }, function (props) {
@@ -160,23 +295,55 @@ var DXCSpinner = _styledComponents["default"].div(_templateObject2(), function (
160
295
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
161
296
  }, function (props) {
162
297
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
298
+ });
299
+
300
+ var SpinnerContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
301
+ return props.mode === "small" ? "16px" : "140px";
163
302
  }, function (props) {
164
- return props.backgroundType === "dark" ? props.theme.trackCircleColorOnDark : props.theme.trackCircleColor;
303
+ return props.mode === "small" ? "16px" : "140px";
304
+ });
305
+
306
+ var BackOverlay = _styledComponents["default"].div(_templateObject3(), function (props) {
307
+ return "".concat(props.theme.overlayBackgroundColor);
308
+ }, function (props) {
309
+ return "".concat(props.theme.overlayOpacity);
310
+ });
311
+
312
+ var BackgroundSpinner = _styledComponents["default"].div(_templateObject4());
313
+
314
+ var SVGBackground = _styledComponents["default"].svg(_templateObject5());
315
+
316
+ var CircleBackground = _styledComponents["default"].circle(_templateObject6(), function (props) {
317
+ return "".concat(props.theme.totalCircleColor);
165
318
  }, function (props) {
166
- return props.mode === "small" && "22px !important" || "140px !important";
319
+ return props.mode !== "small" ? "409" : "38";
167
320
  }, function (props) {
168
- return props.mode === "small" && "22px !important" || "140px !important";
321
+ return props.mode !== "small" ? "8.5px" : "2px";
322
+ });
323
+
324
+ var Spinner = _styledComponents["default"].div(_templateObject7());
325
+
326
+ var SVGSpinner = _styledComponents["default"].svg(_templateObject8(), function (props) {
327
+ return !props.isDeterminated ? "1.4s linear infinite both spinner-svg" : "";
328
+ });
329
+
330
+ var CircleSpinner = _styledComponents["default"].circle(_templateObject9(), function (props) {
331
+ return props.isDeterminated ? "none" : props.mode !== "small" ? "1.4s ease-in-out infinite both svg-circle-large" : "1.4s ease-in-out infinite both svg-circle-small";
332
+ }, function (props) {
333
+ return props.backgroundType === "dark" ? props.theme.trackCircleColorOnDark : props.theme.trackCircleColor;
169
334
  }, function (props) {
170
- return props.label === "" && props.showValue === false && props.mode === "large" ? "-10px" : props.mode === "small" ? "-3px" : props.label !== "" && props.showValue === false ? "-81px" : props.label === "" && props.showValue === true && props.mode === "overlay" ? "-10.75px" : props.label === "" && props.showValue === true && props.mode !== "overlay" ? "-79.75px" : props.label !== "" && props.showValue === true && props.mode === "overlay" ? "-72.5px" : "-90.5px";
335
+ return !props.isDeterminated ? "50% 50%" : "";
171
336
  }, function (props) {
172
- return props.mode === "small" && "-3px !important" || "-10px !important";
337
+ return props.mode !== "small" ? "409" : "38";
173
338
  }, function (props) {
174
- return props.mode === "small" && "5px" || "2.9px";
339
+ return props.mode !== "small" ? "8.5px" : "2px";
175
340
  }, function (props) {
176
- return props.mode === "small" && "18.5" || "20.2";
341
+ return props.isDeterminated ? props.mode !== "small" ? determinatedValue(props, 409) : determinatedValue(props, 38) : "";
177
342
  });
178
343
 
179
- var SpinnerLabel = _styledComponents["default"].div(_templateObject3(), function (props) {
344
+ var LabelsContainer = _styledComponents["default"].div(_templateObject10());
345
+
346
+ var SpinnerLabel = _styledComponents["default"].p(_templateObject11(), function (props) {
180
347
  return props.mode === "overlay" ? props.theme.overlayLabelFontFamily : props.theme.labelFontFamily;
181
348
  }, function (props) {
182
349
  return props.mode === "overlay" ? props.theme.overlayLabelFontWeight : props.theme.labelFontWeight;
@@ -184,8 +351,6 @@ var SpinnerLabel = _styledComponents["default"].div(_templateObject3(), function
184
351
  return props.mode === "overlay" ? props.theme.overlayLabelFontSize : props.theme.labelFontSize;
185
352
  }, function (props) {
186
353
  return props.mode === "overlay" ? props.theme.overlayLabelFontStyle : props.theme.labelFontStyle;
187
- }, function (props) {
188
- return props.showValue === false && "52px" || "45px";
189
354
  }, function (props) {
190
355
  return props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
191
356
  }, function (props) {
@@ -194,7 +359,9 @@ var SpinnerLabel = _styledComponents["default"].div(_templateObject3(), function
194
359
  return props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing;
195
360
  });
196
361
 
197
- var SpinnerProgress = _styledComponents["default"].div(_templateObject4(), function (props) {
362
+ var SpinnerProgress = _styledComponents["default"].p(_templateObject12(), function (props) {
363
+ return props.value !== "" && props.showValue === true && "block" || "none";
364
+ }, function (props) {
198
365
  return props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily;
199
366
  }, function (props) {
200
367
  return props.mode === "overlay" ? props.theme.overlayProgressValueFontWeight : props.theme.progressValueFontWeight;
@@ -202,10 +369,6 @@ var SpinnerProgress = _styledComponents["default"].div(_templateObject4(), funct
202
369
  return props.mode === "overlay" ? props.theme.overlayProgressValueFontSize : props.theme.progressValueFontSize;
203
370
  }, function (props) {
204
371
  return props.mode === "overlay" ? props.theme.overlayProgressValueFontStyle : props.theme.progressValueFontStyle;
205
- }, function (props) {
206
- return props.label === "" && "52px" || "";
207
- }, function (props) {
208
- return props.value !== "" && props.showValue === true && "block" || "none";
209
372
  }, function (props) {
210
373
  return props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.backgroundType === "dark" ? props.theme.progressValueFontColorOnDark : props.theme.progressValueFontColor;
211
374
  }, function (props) {