@dxc-technology/halstack-react 0.0.0-4fd9593 → 0.0.0-51a5c42

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 (99) hide show
  1. package/dist/ThemeContext.js +131 -99
  2. package/dist/V3Textarea/V3Textarea.js +264 -0
  3. package/dist/accordion/Accordion.js +44 -39
  4. package/dist/accordion-group/AccordionGroup.js +1 -3
  5. package/dist/alert/Alert.js +124 -113
  6. package/dist/alert/index.d.ts +51 -0
  7. package/dist/button/Button.js +31 -25
  8. package/dist/checkbox/Checkbox.js +19 -13
  9. package/dist/common/variables.js +590 -386
  10. package/dist/date/Date.js +11 -13
  11. package/dist/{new-date/NewDate.js → date-input/DateInput.js} +77 -72
  12. package/dist/date-input/index.d.ts +95 -0
  13. package/dist/dialog/Dialog.js +8 -30
  14. package/dist/dropdown/Dropdown.js +108 -68
  15. package/dist/file-input/FileInput.js +644 -0
  16. package/dist/file-input/FileItem.js +280 -0
  17. package/dist/file-input/index.d.ts +81 -0
  18. package/dist/header/Header.js +78 -67
  19. package/dist/header/Icons.js +59 -0
  20. package/dist/input-text/InputText.js +3 -3
  21. package/dist/layout/ApplicationLayout.js +1 -1
  22. package/dist/link/Link.js +4 -8
  23. package/dist/main.d.ts +8 -0
  24. package/dist/main.js +37 -21
  25. package/dist/new-select/NewSelect.js +836 -0
  26. package/dist/new-select/index.d.ts +53 -0
  27. package/dist/{number/Number.js → number-input/NumberInput.js} +13 -11
  28. package/dist/{number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
  29. package/dist/number-input/index.d.ts +113 -0
  30. package/dist/{password/Password.js → password-input/PasswordInput.js} +15 -13
  31. package/dist/password-input/index.d.ts +94 -0
  32. package/dist/progress-bar/ProgressBar.js +62 -26
  33. package/dist/select/Select.js +122 -158
  34. package/dist/sidenav/Sidenav.js +6 -4
  35. package/dist/slider/Slider.js +141 -62
  36. package/dist/spinner/Spinner.js +217 -54
  37. package/dist/tag/Tag.js +26 -32
  38. package/dist/{new-input-text/NewInputText.js → text-input/TextInput.js} +185 -171
  39. package/dist/text-input/index.d.ts +135 -0
  40. package/dist/textarea/Textarea.js +227 -122
  41. package/dist/textarea/index.d.ts +117 -0
  42. package/dist/toggle-group/ToggleGroup.js +130 -44
  43. package/dist/upload/Upload.js +3 -3
  44. package/dist/upload/readme.md +2 -2
  45. package/dist/upload/transaction/Transaction.js +2 -2
  46. package/package.json +2 -1
  47. package/test/Date.test.js +48 -44
  48. package/test/{NewDate.test.js → DateInput.test.js} +71 -29
  49. package/test/FileInput.test.js +201 -0
  50. package/test/Header.test.js +5 -10
  51. package/test/InputText.test.js +24 -16
  52. package/test/{Number.test.js → NumberInput.test.js} +85 -67
  53. package/test/Paginator.test.js +1 -1
  54. package/test/PasswordInput.test.js +83 -0
  55. package/test/ResultsetTable.test.js +1 -2
  56. package/test/Select.test.js +40 -17
  57. package/test/Spinner.test.js +5 -0
  58. package/test/{NewInputText.test.js → TextInput.test.js} +147 -232
  59. package/test/Textarea.test.js +193 -0
  60. package/test/ToggleGroup.test.js +5 -1
  61. package/test/Upload.test.js +5 -5
  62. package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
  63. package/dist/accordion/Accordion.stories.js +0 -207
  64. package/dist/accordion/readme.md +0 -96
  65. package/dist/accordion-group/AccordionGroup.stories.js +0 -207
  66. package/dist/accordion-group/readme.md +0 -70
  67. package/dist/alert/Alert.stories.js +0 -158
  68. package/dist/alert/close.svg +0 -4
  69. package/dist/alert/error.svg +0 -4
  70. package/dist/alert/info.svg +0 -4
  71. package/dist/alert/readme.md +0 -43
  72. package/dist/alert/success.svg +0 -4
  73. package/dist/alert/warning.svg +0 -4
  74. package/dist/button/Button.stories.js +0 -224
  75. package/dist/button/readme.md +0 -93
  76. package/dist/dialog/Dialog.stories.js +0 -217
  77. package/dist/dialog/readme.md +0 -32
  78. package/dist/dropdown/Dropdown.stories.js +0 -249
  79. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  80. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  81. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  82. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  83. package/dist/dropdown/readme.md +0 -69
  84. package/dist/footer/Footer.stories.js +0 -94
  85. package/dist/header/Header.stories.js +0 -176
  86. package/dist/header/close_icon.svg +0 -1
  87. package/dist/header/dxc_logo_black.svg +0 -8
  88. package/dist/header/hamb_menu_black.svg +0 -1
  89. package/dist/header/hamb_menu_white.svg +0 -1
  90. package/dist/header/readme.md +0 -33
  91. package/dist/input-text/InputText.stories.js +0 -209
  92. package/dist/new-textarea/NewTextarea.js +0 -342
  93. package/dist/password/styles.css +0 -3
  94. package/dist/select/Select.stories.js +0 -235
  95. package/dist/select/readme.md +0 -72
  96. package/dist/slider/Slider.stories.js +0 -241
  97. package/dist/toggle-group/readme.md +0 -82
  98. package/test/NewTextarea.test.js +0 -201
  99. package/test/Password.test.js +0 -76
@@ -9,12 +9,12 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
+
12
14
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
15
 
14
16
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
17
 
16
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
-
18
18
  var _react = _interopRequireDefault(require("react"));
19
19
 
20
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
@@ -23,34 +23,14 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
 
24
24
  var _variables = require("../common/variables.js");
25
25
 
26
- var _close = _interopRequireDefault(require("./close.svg"));
27
-
28
- var _error = _interopRequireDefault(require("./error.svg"));
29
-
30
- var _info = _interopRequireDefault(require("./info.svg"));
31
-
32
- var _success = _interopRequireDefault(require("./success.svg"));
33
-
34
- var _warning = _interopRequireDefault(require("./warning.svg"));
35
-
36
26
  var _utils = require("../common/utils.js");
37
27
 
38
28
  var _useTheme = _interopRequireDefault(require("../useTheme.js"));
39
29
 
40
30
  var _BackgroundColorContext = require("../BackgroundColorContext.js");
41
31
 
42
- function _templateObject11() {
43
- var data = (0, _taggedTemplateLiteral2["default"])([""]);
44
-
45
- _templateObject11 = function _templateObject11() {
46
- return data;
47
- };
48
-
49
- return data;
50
- }
51
-
52
32
  function _templateObject10() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n height: 20px;\n width: 20px;\n display: inline-flex;\n"]);
33
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n border: 1px solid transparent;\n border-radius: 4px;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n margin-left: 12px;\n background-color: transparent;\n color: #000000;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"]);
54
34
 
55
35
  _templateObject10 = function _templateObject10() {
56
36
  return data;
@@ -60,7 +40,7 @@ function _templateObject10() {
60
40
  }
61
41
 
62
42
  function _templateObject9() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n padding: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n overflow-y: auto;\n"]);
43
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n padding: ", ";\n overflow-y: auto;\n"]);
64
44
 
65
45
  _templateObject9 = function _templateObject9() {
66
46
  return data;
@@ -70,7 +50,7 @@ function _templateObject9() {
70
50
  }
71
51
 
72
52
  function _templateObject8() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n overflow: hidden;\n flex-grow: 1;\n align-items: center;\n"]);
53
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n align-items: center;\n overflow: hidden;\n"]);
74
54
 
75
55
  _templateObject8 = function _templateObject8() {
76
56
  return data;
@@ -80,7 +60,7 @@ function _templateObject8() {
80
60
  }
81
61
 
82
62
  function _templateObject7() {
83
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n padding-right: ", ";\n padding-left: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n"]);
63
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 12px;\n padding-right: ", ";\n padding-left: ", ";\n\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
84
64
 
85
65
  _templateObject7 = function _templateObject7() {
86
66
  return data;
@@ -90,7 +70,7 @@ function _templateObject7() {
90
70
  }
91
71
 
92
72
  function _templateObject6() {
93
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding-right: ", ";\n padding-left: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
73
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 8px;\n padding-right: ", ";\n padding-left: ", ";\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
94
74
 
95
75
  _templateObject6 = function _templateObject6() {
96
76
  return data;
@@ -100,7 +80,7 @@ function _templateObject6() {
100
80
  }
101
81
 
102
82
  function _templateObject5() {
103
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding-right: ", ";\n padding-left: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n font-style: ", ";\n text-transform: ", ";\n"]);
83
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 8px;\n padding-right: ", ";\n padding-left: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n"]);
104
84
 
105
85
  _templateObject5 = function _templateObject5() {
106
86
  return data;
@@ -110,7 +90,7 @@ function _templateObject5() {
110
90
  }
111
91
 
112
92
  function _templateObject4() {
113
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n height: ", ";\n align-items: center;\n width: 100%;\n"]);
93
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n height: calc(48px - calc(", " * 2));\n align-items: center;\n width: 100%;\n"]);
114
94
 
115
95
  _templateObject4 = function _templateObject4() {
116
96
  return data;
@@ -120,7 +100,7 @@ function _templateObject4() {
120
100
  }
121
101
 
122
102
  function _templateObject3() {
123
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: ", ";\n overflow: hidden;\n box-shadow: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n justify-content: ", ";\n align-items: ", ";\n max-width: ", ";\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n z-index: ", ";\n cursor: default;\n"]);
103
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: ", ";\n overflow: hidden;\n box-sizing: border-box;\n\n background-color: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n\n padding-left: 12px;\n padding-right: 12px;\n justify-content: ", ";\n align-items: ", ";\n max-width: ", ";\n width: ", ";\n z-index: ", ";\n"]);
124
104
 
125
105
  _templateObject3 = function _templateObject3() {
126
106
  return data;
@@ -130,7 +110,7 @@ function _templateObject3() {
130
110
  }
131
111
 
132
112
  function _templateObject2() {
133
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n opacity: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n"]);
113
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n"]);
134
114
 
135
115
  _templateObject2 = function _templateObject2() {
136
116
  return data;
@@ -149,6 +129,70 @@ function _templateObject() {
149
129
  return data;
150
130
  }
151
131
 
132
+ var alertIcons = {
133
+ close: _react["default"].createElement("svg", {
134
+ xmlns: "http://www.w3.org/2000/svg",
135
+ width: "20",
136
+ height: "20",
137
+ viewBox: "0 0 24 24",
138
+ fill: "currentColor"
139
+ }, _react["default"].createElement("path", {
140
+ 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"
141
+ }), _react["default"].createElement("path", {
142
+ d: "M0 0h24v24H0z",
143
+ fill: "none"
144
+ })),
145
+ info: _react["default"].createElement("svg", {
146
+ xmlns: "http://www.w3.org/2000/svg",
147
+ width: "23",
148
+ height: "23",
149
+ viewBox: "0 0 24 24",
150
+ fill: "currentColor"
151
+ }, _react["default"].createElement("path", {
152
+ d: "M0 0h24v24H0z",
153
+ fill: "none"
154
+ }), _react["default"].createElement("path", {
155
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"
156
+ })),
157
+ success: _react["default"].createElement("svg", {
158
+ xmlns: "http://www.w3.org/2000/svg",
159
+ width: "23",
160
+ height: "23",
161
+ viewBox: "0 0 24 24",
162
+ fill: "currentColor"
163
+ }, _react["default"].createElement("path", {
164
+ d: "M0 0h24v24H0z",
165
+ fill: "none"
166
+ }), _react["default"].createElement("path", {
167
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
168
+ })),
169
+ warning: _react["default"].createElement("svg", {
170
+ xmlns: "http://www.w3.org/2000/svg",
171
+ width: "23",
172
+ height: "23",
173
+ viewBox: "0 0 24 24",
174
+ fill: "currentColor"
175
+ }, _react["default"].createElement("path", {
176
+ d: "M0 0h24v24H0z",
177
+ fill: "none"
178
+ }), _react["default"].createElement("path", {
179
+ d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
180
+ })),
181
+ error: _react["default"].createElement("svg", {
182
+ xmlns: "http://www.w3.org/2000/svg",
183
+ width: "23",
184
+ height: "23",
185
+ viewBox: "0 0 24 24",
186
+ fill: "currentColor"
187
+ }, _react["default"].createElement("path", {
188
+ d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",
189
+ fill: "currentColor"
190
+ }), _react["default"].createElement("path", {
191
+ d: "M0 0h24v24H0z",
192
+ fill: "none"
193
+ }))
194
+ };
195
+
152
196
  var DxcAlert = function DxcAlert(_ref) {
153
197
  var _ref$type = _ref.type,
154
198
  type = _ref$type === void 0 ? "info" : _ref$type,
@@ -181,16 +225,14 @@ var DxcAlert = function DxcAlert(_ref) {
181
225
  margin: margin,
182
226
  size: size
183
227
  }, _react["default"].createElement(AlertInfo, null, _react["default"].createElement(AlertIcon, {
184
- src: type === "info" && _info["default"] || type === "confirm" && _success["default"] || type === "warning" && _warning["default"] || type === "error" && _error["default"] || _error["default"]
185
- }), _react["default"].createElement(AlertInfoText, null, _react["default"].createElement(AlertType, {
186
228
  type: type
187
- }, getTypeText(type)), inlineText && inlineText !== "" && "-", _react["default"].createElement(AlertText, null, inlineText), onClose && _react["default"].createElement(CloseAlertIcon, {
229
+ }, type === "info" && alertIcons.info || type === "confirm" && alertIcons.success || type === "warning" && alertIcons.warning || type === "error" && alertIcons.error), _react["default"].createElement(AlertText, null, _react["default"].createElement(AlertTitle, {
230
+ type: type
231
+ }, getTypeText(type)), inlineText && inlineText !== "" && "-", _react["default"].createElement(AlertInlineText, null, inlineText)), onClose && _react["default"].createElement(AlertCloseAction, {
188
232
  onClick: onClose,
189
233
  tabIndex: tabIndex
190
- }, _react["default"].createElement(CloseImg, {
191
- src: _close["default"]
192
- })))), children && _react["default"].createElement(AlertContent, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
193
- color: type === "info" && colorsTheme.alert.infoColor || type === "confirm" && colorsTheme.alert.successColor || type === "warning" && colorsTheme.alert.warningColor || type === "error" && colorsTheme.alert.errorColor
234
+ }, alertIcons.close)), children && _react["default"].createElement(AlertContent, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
235
+ color: type === "info" && colorsTheme.alert.infoBackgroundColor || type === "confirm" && colorsTheme.alert.successBackgroundColor || type === "warning" && colorsTheme.alert.warningBackgroundColor || type === "error" && colorsTheme.alert.errorBackgroundColor
194
236
  }, children)))));
195
237
  };
196
238
 
@@ -203,27 +245,7 @@ var sizes = {
203
245
  };
204
246
 
205
247
  var calculateWidth = function calculateWidth(margin, size) {
206
- if (size === "fillParent") {
207
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
208
- }
209
-
210
- return sizes[size];
211
- };
212
-
213
- DxcAlert.propTypes = {
214
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
215
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
216
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
217
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
218
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
219
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
220
- type: _propTypes["default"].oneOf(["info", "confirm", "warning", "error"]),
221
- mode: _propTypes["default"].oneOf(["inline", "modal"]),
222
- inlineText: _propTypes["default"].string,
223
- onClose: _propTypes["default"].func,
224
- children: _propTypes["default"].element,
225
- size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
226
- tabIndex: _propTypes["default"].number
248
+ return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
227
249
  };
228
250
 
229
251
  var AlertModal = _styledComponents["default"].div(_templateObject(), function (props) {
@@ -250,8 +272,6 @@ var AlertModal = _styledComponents["default"].div(_templateObject(), function (p
250
272
 
251
273
  var OverlayContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
252
274
  return props.mode === "modal" ? "".concat(props.theme.overlayColor) : "transparent";
253
- }, function (props) {
254
- return props.mode === "modal" && props.theme.overlayOpacity;
255
275
  }, function (props) {
256
276
  return props.mode === "modal" ? "fixed" : "";
257
277
  }, function (props) {
@@ -275,9 +295,9 @@ var AlertContainer = _styledComponents["default"].div(_templateObject3(), functi
275
295
  }, function (props) {
276
296
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
277
297
  }, function (props) {
278
- return props.children && "inline-block" || "inline-flex";
298
+ return props.size === "fitContent" ? "inline-block" : "block";
279
299
  }, function (props) {
280
- return "".concat(props.theme.boxShadowOffsetX, " ").concat(props.theme.boxShadowOffsetY, " ").concat(props.theme.boxShadowBlur, " ").concat(props.theme.boxShadowColor);
300
+ return props.type === "info" && props.theme.infoBackgroundColor || props.type === "confirm" && props.theme.successBackgroundColor || props.type === "warning" && props.theme.warningBackgroundColor || props.type === "error" && props.theme.errorBackgroundColor;
281
301
  }, function (props) {
282
302
  return props.theme.borderRadius;
283
303
  }, function (props) {
@@ -285,108 +305,99 @@ var AlertContainer = _styledComponents["default"].div(_templateObject3(), functi
285
305
  }, function (props) {
286
306
  return props.theme.borderStyle;
287
307
  }, function (props) {
288
- return props.theme.borderColor;
308
+ return props.type === "info" && props.theme.infoBorderColor || props.type === "confirm" && props.theme.successBorderColor || props.type === "warning" && props.theme.warningBorderColor || props.type === "error" && props.theme.errorBorderColor;
289
309
  }, function (props) {
290
310
  return props.mode === "modal" ? "center" : "";
291
311
  }, function (props) {
292
312
  return props.mode === "modal" ? "center" : "";
293
313
  }, function (props) {
294
- return props.size === "fitContent" ? calculateWidth(props.margin, "fillParent") : calculateWidth(props.margin, props.size);
295
- }, function (props) {
296
- return calculateWidth(props.margin, props.size);
297
- }, function (props) {
298
- return props.children && props.children.filter(function (child) {
299
- return child === undefined;
300
- }).length === 0 && "92px" || "48px";
314
+ return props.size !== "fillParent" && calculateWidth(props.margin, "fillParent");
301
315
  }, function (props) {
302
- return props.type === "info" && props.theme.infoColor || props.type === "confirm" && props.theme.successColor || props.type === "warning" && props.theme.warningColor || props.type === "error" && props.theme.errorColor || props.theme.lightPink;
316
+ return props.size !== "fillParent" && calculateWidth(props.margin, props.size);
303
317
  }, function (props) {
304
318
  return props.mode === "modal" ? "1300" : "";
305
319
  });
306
320
 
307
321
  var AlertInfo = _styledComponents["default"].div(_templateObject4(), function (props) {
308
- return props.theme.height;
322
+ return props.theme.borderThickness;
309
323
  });
310
324
 
311
- var AlertType = _styledComponents["default"].div(_templateObject5(), function (props) {
325
+ var AlertTitle = _styledComponents["default"].div(_templateObject5(), function (props) {
312
326
  return props.theme.titlePaddingRight;
313
327
  }, function (props) {
314
328
  return props.theme.titlePaddingLeft;
315
- }, function (props) {
316
- return props.theme.titlePaddingTop;
317
- }, function (props) {
318
- return props.theme.titlePaddingBottom;
319
329
  }, function (props) {
320
330
  return props.theme.titleFontFamily;
321
331
  }, function (props) {
322
332
  return props.theme.titleFontSize;
333
+ }, function (props) {
334
+ return props.theme.titleFontStyle;
323
335
  }, function (props) {
324
336
  return props.theme.titleFontWeight;
325
337
  }, function (props) {
326
338
  return props.theme.titleFontColor;
327
- }, function (props) {
328
- return props.theme.titleFontStyle;
329
339
  }, function (props) {
330
340
  return props.theme.titleTextTransform;
331
341
  });
332
342
 
333
- var AlertText = _styledComponents["default"].div(_templateObject6(), function (props) {
343
+ var AlertInlineText = _styledComponents["default"].div(_templateObject6(), function (props) {
334
344
  return props.theme.inlineTextPaddingRight;
335
345
  }, function (props) {
336
346
  return props.theme.inlineTextPaddingLeft;
337
347
  }, function (props) {
338
- return props.theme.inlineTextPaddingTop;
339
- }, function (props) {
340
- return props.theme.inlineTextPaddingBottom;
348
+ return props.theme.inlineTextFontFamily;
341
349
  }, function (props) {
342
- return props.theme.contentFontFamily;
350
+ return props.theme.inlineTextFontSize;
343
351
  }, function (props) {
344
- return props.theme.contentFontSize;
352
+ return props.theme.inlineTextFontStyle;
345
353
  }, function (props) {
346
- return props.theme.contentFontWeight;
354
+ return props.theme.inlineTextFontWeight;
347
355
  }, function (props) {
348
- return props.theme.contentFontColor;
356
+ return props.theme.inlineTextFontColor;
349
357
  });
350
358
 
351
- var AlertIcon = _styledComponents["default"].img(_templateObject7(), function (props) {
352
- return props.theme.iconSize;
353
- }, function (props) {
354
- return props.theme.iconSize;
355
- }, function (props) {
359
+ var AlertIcon = _styledComponents["default"].span(_templateObject7(), function (props) {
356
360
  return props.theme.iconPaddingRight;
357
361
  }, function (props) {
358
362
  return props.theme.iconPaddingLeft;
359
363
  }, function (props) {
360
- return props.theme.iconPaddingTop;
361
- }, function (props) {
362
- return props.theme.iconPaddingBottom;
363
- });
364
-
365
- var AlertInfoText = _styledComponents["default"].div(_templateObject8(), function (props) {
366
- return props.theme.textPaddingLeft;
367
- }, function (props) {
368
- return props.theme.textPaddingRight;
364
+ return props.type === "info" && props.theme.infoIconColor || props.type === "confirm" && props.theme.successIconColor || props.type === "warning" && props.theme.warningIconColor || props.type === "error" && props.theme.errorIconColor;
369
365
  }, function (props) {
370
- return props.theme.textPaddingTop;
366
+ return props.theme.iconSize;
371
367
  }, function (props) {
372
- return props.theme.textPaddingBottom;
368
+ return props.theme.iconSize;
373
369
  });
374
370
 
371
+ var AlertText = _styledComponents["default"].div(_templateObject8());
372
+
375
373
  var AlertContent = _styledComponents["default"].div(_templateObject9(), function (props) {
376
374
  return "".concat(props.theme.contentPaddingTop, " ").concat(props.theme.contentPaddingRight, " ").concat(props.theme.contentPaddingBottom, " ").concat(props.theme.contentPaddingLeft);
375
+ });
376
+
377
+ var AlertCloseAction = _styledComponents["default"].button(_templateObject10(), function (props) {
378
+ return props.theme.hoverActionBackgroundColor;
377
379
  }, function (props) {
378
- return props.theme.contentFontFamily;
379
- }, function (props) {
380
- return props.theme.contentFontSize;
380
+ return props.theme.focusActionBorderColor;
381
381
  }, function (props) {
382
- return props.theme.contentFontWeight;
382
+ return props.theme.focusActionBorderColor;
383
383
  }, function (props) {
384
- return props.theme.contentFontColor;
384
+ return props.theme.activeActionBackgroundColor;
385
385
  });
386
386
 
387
- var CloseAlertIcon = _styledComponents["default"].button(_templateObject10());
388
-
389
- var CloseImg = _styledComponents["default"].img(_templateObject11());
390
-
387
+ DxcAlert.propTypes = {
388
+ margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
389
+ top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
390
+ bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
391
+ left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
392
+ right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
393
+ }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
394
+ type: _propTypes["default"].oneOf(["info", "confirm", "warning", "error"]),
395
+ mode: _propTypes["default"].oneOf(["inline", "modal"]),
396
+ inlineText: _propTypes["default"].string,
397
+ onClose: _propTypes["default"].func,
398
+ children: _propTypes["default"].element,
399
+ size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
400
+ tabIndex: _propTypes["default"].number
401
+ };
391
402
  var _default = DxcAlert;
392
403
  exports["default"] = _default;
@@ -0,0 +1,51 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ /**
12
+ * Uses on of the available alert types.
13
+ */
14
+ type?: "info" | "confirm" | "warning" | "error";
15
+ /**
16
+ * Uses on of the available alert modes:
17
+ * 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
18
+ * There is no overlay layer. Position should be decided by the user.
19
+ * 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
20
+ * The onClose function will be executed when the X button or the overlay is clicked. d
21
+ * The user has the responsibility of hidding the modal in the onClose function, otherwise the modal will remain visible.
22
+ */
23
+ mode?: "inline" | "modal";
24
+ /**
25
+ * Text to display after icon and alert type and before content.
26
+ */
27
+ inlineText?: string;
28
+ /**
29
+ * This function will be called when the user clicks the close button. If there is no function we should close the alert by default.
30
+ */
31
+ onClose?: () => void;
32
+ /**
33
+ * The details section of the alert. Can be used to render custom content in this area.
34
+ */
35
+ children?: React.ReactNode;
36
+ /**
37
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
38
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
39
+ */
40
+ margin?: Space | Margin;
41
+ /**
42
+ * Size of the component ('small' | 'medium' | 'large' | 'fillParent' | 'fitContent').
43
+ */
44
+ size?: Size;
45
+ /**
46
+ * Tabindex value given to the close button.
47
+ */
48
+ tabIndex?: number;
49
+ };
50
+
51
+ export default function Alert(props: Props): JSX.Element;
@@ -32,7 +32,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
32
32
  var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
33
33
 
34
34
  function _templateObject4() {
35
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n letter-spacing: ", ";\n\n box-shadow: none;\n font-size: ", ";\n font-weight: ", ";\n min-width: ", ";\n\n width: 100%;\n height: ", ";\n font-family: ", ";\n &:focus {\n outline: ", " auto 1px;\n }\n transition: color 0.16s ease-in-out, background-color 0.16s ease-in-out;\n transition: color 0.16s ease-in-out, border-color 0.16s ease-in-out;\n &:hover {\n transition: color 0.16s ease-in-out, background-color 0.16s ease-in-out;\n transition: color 0.16s ease-in-out, border-color 0.16s ease-in-out;\n }\n ", "\n }\n"]);
35
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\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 max-height: ", ";\n max-width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
45
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\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 max-height: ", ";\n max-width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
55
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
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 line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n"]);
65
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n margin-right: ", ";\n margin-left: ", ";\n"]);
66
66
 
67
67
  _templateObject = function _templateObject() {
68
68
  return data;
@@ -103,7 +103,8 @@ var DxcButton = function DxcButton(_ref) {
103
103
  disabled: disabled,
104
104
  iconPosition: iconPosition,
105
105
  size: size,
106
- backgroundType: backgroundType
106
+ backgroundType: backgroundType,
107
+ icon: icon
107
108
  }, _react["default"].createElement(_core.Button, {
108
109
  disabled: disabled,
109
110
  type: type,
@@ -115,7 +116,10 @@ var DxcButton = function DxcButton(_ref) {
115
116
  _onClick();
116
117
  }
117
118
  }
118
- }, _react["default"].createElement(LabelContainer, null, label), icon ? _react["default"].createElement(IconContainer, {
119
+ }, label && _react["default"].createElement(LabelContainer, {
120
+ icon: icon,
121
+ iconPosition: iconPosition
122
+ }, label), icon ? _react["default"].createElement(IconContainer, {
119
123
  label: label,
120
124
  iconPosition: iconPosition
121
125
  }, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : iconSrc && _react["default"].createElement(ButtonIcon, {
@@ -145,23 +149,19 @@ var LabelContainer = _styledComponents["default"].span(_templateObject(), functi
145
149
  return props.theme.labelFontLineHeight;
146
150
  }, function (props) {
147
151
  return props.theme.fontSize;
152
+ }, function (props) {
153
+ return !props.icon || props.iconPosition === "before" ? "8px" : "0px";
154
+ }, function (props) {
155
+ return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
148
156
  });
149
157
 
150
158
  var IconContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
151
- return props.theme.iconSize;
152
- }, function (props) {
153
- return props.theme.iconSize;
154
- }, function (props) {
155
- return props.iconPosition === "after" && props.label !== "" && "8px" || "0px";
159
+ return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
156
160
  }, function (props) {
157
- return props.iconPosition === "before" && props.label !== "" && "8px" || "0px";
161
+ return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
158
162
  });
159
163
 
160
164
  var ButtonIcon = _styledComponents["default"].img(_templateObject3(), function (props) {
161
- return props.theme.iconSize;
162
- }, function (props) {
163
- return props.theme.iconSize;
164
- }, function (props) {
165
165
  return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
166
166
  }, function (props) {
167
167
  return props.iconPosition === "before" && props.label !== "" && "10px" || "0px";
@@ -181,32 +181,38 @@ var DxCButton = _styledComponents["default"].div(_templateObject4(), function (p
181
181
  return calculateWidth(props.margin, props.size);
182
182
  }, function (props) {
183
183
  return props.disabled && "not-allowed" || "pointer";
184
+ }, function (props) {
185
+ return props.theme.paddingLeft;
186
+ }, function (props) {
187
+ return props.theme.paddingRight;
188
+ }, function (props) {
189
+ return props.theme.paddingTop;
190
+ }, function (props) {
191
+ return props.theme.paddingBottom;
184
192
  }, function (props) {
185
193
  return props.iconPosition === "after" && "row" || "row-reverse";
186
194
  }, function (props) {
187
- return props.theme.labelLetterSpacing;
195
+ return props.theme.fontFamily;
188
196
  }, function (props) {
189
197
  return props.theme.fontSize;
190
198
  }, function (props) {
191
199
  return props.theme.fontWeight;
192
200
  }, function (props) {
193
- return props.size === "small" && "calc(100% - 22px)" || "unset";
194
- }, function (props) {
195
- return props.theme.height;
201
+ return props.theme.labelLetterSpacing;
196
202
  }, function (props) {
197
- return props.theme.fontFamily;
203
+ return props.size === "small" && "calc(100% - 22px)" || "unset";
198
204
  }, function (props) {
199
- return props.theme.focusColor;
205
+ return props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor;
200
206
  }, function (props) {
201
207
  var mode = props.mode,
202
208
  backgroundType = props.backgroundType;
203
209
 
204
210
  if (mode === "primary") {
205
- return "\n border-radius: ".concat(props.theme.primaryBorderRadius, ";\n border-width: ").concat(props.theme.primaryBorderThickness, ";\n border-style: ").concat(props.theme.primaryBorderStyle, ";\n border-color: ").concat(backgroundType === "dark" ? props.theme.primaryBorderColorOnDark : props.theme.primaryBorderColor, ";\n font-family: ").concat(props.theme.primaryFontFamily, ";\n font-size: ").concat(props.theme.primaryFontSize, ";\n font-weight: ").concat(props.theme.primaryFontWeight, ";\n\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType && backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor, " !important;\n padding-right:").concat(props.size === "small" && "11px" || "24px", ";\n padding-left:").concat(props.size === "small" && "11px" || "24px", ";\n padding-top:").concat(props.theme.primaryPaddingTop, ";\n padding-bottom:").concat(props.theme.primaryPaddingBottom, ";\n &:hover{\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverFontColorOnDark : props.theme.primaryHoverFontColor, " !important; \n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor, " !important;\n \n }\n &:focus {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverFontColorOnDark : props.theme.primaryHoverFontColor, " !important;\n }\n &:disabled{ \n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor, "!important; \n }\n .MuiButton-label {\n z-index: 5\n }\n ");
211
+ return "\n border-radius: ".concat(props.theme.primaryBorderRadius, ";\n border-width: ").concat(props.theme.primaryBorderThickness, ";\n border-style: ").concat(props.theme.primaryBorderStyle, ";\n font-family: ").concat(props.theme.primaryFontFamily, ";\n font-size: ").concat(props.theme.primaryFontSize, ";\n font-weight: ").concat(props.theme.primaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType && backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled { \n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor, "!important; \n }\n .MuiButton-label {\n z-index: 5;\n }\n ");
206
212
  } else if (mode === "secondary") {
207
- return "\n border-radius: ".concat(props.theme.secondaryBorderRadius, ";\n border-width:").concat(props.theme.secondaryBorderThickness, ";\n border-style:").concat(props.theme.secondaryBorderStyle, ";\n font-family: ").concat(props.theme.secondaryFontFamily, ";\n font-size: ").concat(props.theme.secondaryFontSize, ";\n font-weight: ").concat(props.theme.secondaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n padding-right:").concat(props.size === "small" && "9px" || "28px", ";\n padding-left:").concat(props.size === "small" && "9px" || "28px", ";\n padding-top:").concat(props.theme.secondaryPaddingTop, ";\n padding-bottom:").concat(props.theme.secondaryPaddingBottom, ";\n \n color: ").concat(backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor, " !important;\n \n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryOutlinedColorOnDark : props.theme.secondaryOutlinedColor, ";\n &:hover{\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverOutlinedColorOnDark : props.theme.secondaryHoverOutlinedColor, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important; \n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n }\n &:focus {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important; \n }\n &:disabled{\n cursor: not-allowed;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledOutlinedColorOnDark : props.theme.secondaryDisabledOutlinedColor, ";\n }\n .MuiButton-label {\n z-index: 5\n }\n\n ");
213
+ return "\n border-radius: ".concat(props.theme.secondaryBorderRadius, ";\n border-width: ").concat(props.theme.secondaryBorderThickness, ";\n border-style: ").concat(props.theme.secondaryBorderStyle, ";\n font-family: ").concat(props.theme.secondaryFontFamily, ";\n font-size: ").concat(props.theme.secondaryFontSize, ";\n font-weight: ").concat(props.theme.secondaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor, ";\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor, ";\n }\n .MuiButton-label {\n z-index: 5;\n }\n ");
208
214
  } else if (mode === "text") {
209
- return "\n border-radius: ".concat(props.theme.textBorderRadius, ";\n border-width:").concat(props.theme.textBorderThickness, ";\n border-style:").concat(props.theme.textBorderStyle, ";\n border-color:").concat(backgroundType === "dark" ? props.theme.textBorderColorOnDark : props.theme.textBorderColor, ";\n font-family: ").concat(props.theme.textFontFamily, ";\n font-size: ").concat(props.theme.textFontSize, ";\n font-weight: ").concat(props.theme.textFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, " !important;\n padding-right:").concat(props.size === "small" && "11px" || "30px", ";\n padding-left:").concat(props.size === "small" && "11px" || "30px", ";\n padding-top:").concat(props.theme.textPaddingTop, ";\n padding-bottom:").concat(props.theme.textPaddingBottom, ";\n\n &:hover{\n background-color: ").concat(backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textHoverFontColorOnDark : props.theme.textHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.textHoverFontColorOnDark : props.theme.textHoverFontColor, " !important;\n }\n &:focus {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, " !important; \n }\n &:disabled{\n cursor:not-allowed;\n color: ").concat(backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, " !important;\n background-color: ").concat(backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n \n }\n ");
215
+ return "\n border-radius: ".concat(props.theme.textBorderRadius, ";\n border-width: ").concat(props.theme.textBorderThickness, ";\n border-style: ").concat(props.theme.textBorderStyle, ";\n font-family: ").concat(props.theme.textFontFamily, ";\n font-size: ").concat(props.theme.textFontSize, ";\n font-weight: ").concat(props.theme.textFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor:not-allowed;\n color: ").concat(backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, " !important;\n background-color: ").concat(backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n }\n ");
210
216
  }
211
217
  });
212
218