@dxc-technology/halstack-react 0.0.0-e792e0c → 0.0.0-e832ef8

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 (170) 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/V3Textarea/V3Textarea.js +264 -0
  5. package/dist/accordion/Accordion.js +170 -81
  6. package/dist/accordion-group/AccordionGroup.js +186 -0
  7. package/dist/alert/Alert.js +184 -83
  8. package/dist/alert/index.d.ts +51 -0
  9. package/dist/badge/Badge.js +63 -0
  10. package/dist/box/Box.js +31 -23
  11. package/dist/button/Button.js +82 -27
  12. package/dist/card/Card.js +72 -35
  13. package/dist/checkbox/Checkbox.js +108 -32
  14. package/dist/chip/Chip.js +129 -35
  15. package/dist/common/RequiredComponent.js +2 -8
  16. package/dist/common/utils.js +2 -22
  17. package/dist/common/variables.js +1459 -197
  18. package/dist/date/Date.js +86 -64
  19. package/dist/date-input/DateInput.js +400 -0
  20. package/dist/date-input/index.d.ts +95 -0
  21. package/dist/dialog/Dialog.js +58 -37
  22. package/dist/dropdown/Dropdown.js +226 -94
  23. package/dist/file-input/FileInput.js +644 -0
  24. package/dist/file-input/FileItem.js +280 -0
  25. package/dist/file-input/index.d.ts +81 -0
  26. package/dist/footer/Footer.js +122 -47
  27. package/dist/footer/Icons.js +77 -0
  28. package/dist/header/Header.js +171 -91
  29. package/dist/header/Icons.js +59 -0
  30. package/dist/heading/Heading.js +81 -22
  31. package/dist/input-text/Icons.js +22 -0
  32. package/dist/input-text/InputText.js +293 -107
  33. package/dist/layout/ApplicationLayout.js +327 -0
  34. package/dist/layout/Icons.js +55 -0
  35. package/dist/link/Link.js +136 -35
  36. package/dist/main.d.ts +8 -0
  37. package/dist/main.js +111 -7
  38. package/dist/new-select/NewSelect.js +836 -0
  39. package/dist/new-select/index.d.ts +53 -0
  40. package/dist/number-input/NumberInput.js +136 -0
  41. package/dist/number-input/NumberInputContext.js +16 -0
  42. package/dist/number-input/index.d.ts +113 -0
  43. package/dist/paginator/Icons.js +66 -0
  44. package/dist/paginator/Paginator.js +162 -57
  45. package/dist/password-input/PasswordInput.js +198 -0
  46. package/dist/password-input/index.d.ts +94 -0
  47. package/dist/progress-bar/ProgressBar.js +97 -44
  48. package/dist/radio/Radio.js +39 -21
  49. package/dist/resultsetTable/ResultsetTable.js +93 -69
  50. package/dist/select/Select.js +250 -143
  51. package/dist/sidenav/Sidenav.js +85 -143
  52. package/dist/slider/Slider.js +219 -73
  53. package/dist/spinner/Spinner.js +249 -64
  54. package/dist/switch/Switch.js +51 -26
  55. package/dist/table/Table.js +63 -15
  56. package/dist/tabs/Tabs.js +208 -35
  57. package/dist/tabs-for-sections/TabsForSections.js +1 -16
  58. package/dist/tag/Tag.js +100 -35
  59. package/dist/text-input/TextInput.js +971 -0
  60. package/dist/text-input/index.d.ts +135 -0
  61. package/dist/textarea/Textarea.js +250 -107
  62. package/dist/textarea/index.d.ts +117 -0
  63. package/dist/toggle/Toggle.js +16 -19
  64. package/dist/toggle-group/ToggleGroup.js +327 -0
  65. package/dist/upload/Upload.js +16 -11
  66. package/dist/upload/buttons-upload/ButtonsUpload.js +35 -25
  67. package/dist/upload/buttons-upload/Icons.js +40 -0
  68. package/dist/upload/dragAndDropArea/DragAndDropArea.js +78 -31
  69. package/dist/upload/file-upload/FileToUpload.js +64 -33
  70. package/dist/upload/file-upload/Icons.js +66 -0
  71. package/dist/upload/files-upload/FilesToUpload.js +16 -16
  72. package/dist/upload/readme.md +2 -2
  73. package/dist/upload/transaction/Icons.js +160 -0
  74. package/dist/upload/transaction/Transaction.js +42 -49
  75. package/dist/upload/transactions/Transactions.js +38 -20
  76. package/dist/useTheme.js +22 -0
  77. package/dist/wizard/Icons.js +65 -0
  78. package/dist/wizard/Wizard.js +141 -56
  79. package/package.json +14 -6
  80. package/test/AccordionGroup.test.js +125 -0
  81. package/test/Date.test.js +49 -45
  82. package/test/DateInput.test.js +242 -0
  83. package/test/Dropdown.test.js +19 -4
  84. package/test/FileInput.test.js +201 -0
  85. package/test/Footer.test.js +2 -7
  86. package/test/Header.test.js +5 -10
  87. package/test/InputText.test.js +53 -41
  88. package/test/Link.test.js +25 -7
  89. package/test/NumberInput.test.js +259 -0
  90. package/test/Paginator.test.js +72 -60
  91. package/test/PasswordInput.test.js +83 -0
  92. package/test/ResultsetTable.test.js +66 -19
  93. package/test/Select.test.js +55 -34
  94. package/test/Sidenav.test.js +22 -64
  95. package/test/Slider.test.js +24 -15
  96. package/test/Spinner.test.js +5 -0
  97. package/test/Tabs.test.js +21 -0
  98. package/test/TextInput.test.js +732 -0
  99. package/test/Textarea.test.js +193 -0
  100. package/test/ToggleGroup.test.js +85 -0
  101. package/test/Upload.test.js +5 -5
  102. package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
  103. package/dist/accordion/Accordion.stories.js +0 -207
  104. package/dist/accordion/readme.md +0 -96
  105. package/dist/alert/Alert.stories.js +0 -158
  106. package/dist/alert/close.svg +0 -4
  107. package/dist/alert/error.svg +0 -4
  108. package/dist/alert/info.svg +0 -4
  109. package/dist/alert/readme.md +0 -43
  110. package/dist/alert/success.svg +0 -4
  111. package/dist/alert/warning.svg +0 -4
  112. package/dist/button/Button.stories.js +0 -224
  113. package/dist/button/readme.md +0 -93
  114. package/dist/common/services/example-service.js +0 -10
  115. package/dist/common/services/example-service.test.js +0 -12
  116. package/dist/date/calendar.svg +0 -1
  117. package/dist/date/calendar_dark.svg +0 -1
  118. package/dist/dialog/Dialog.stories.js +0 -217
  119. package/dist/dialog/readme.md +0 -32
  120. package/dist/dropdown/Dropdown.stories.js +0 -249
  121. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  122. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  123. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  124. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  125. package/dist/dropdown/readme.md +0 -69
  126. package/dist/footer/Footer.stories.js +0 -94
  127. package/dist/footer/dxc_logo_wht.png +0 -0
  128. package/dist/footer/readme.md +0 -41
  129. package/dist/header/Header.stories.js +0 -176
  130. package/dist/header/close_icon.svg +0 -1
  131. package/dist/header/dxc_logo_black.png +0 -0
  132. package/dist/header/dxc_logo_white.png +0 -0
  133. package/dist/header/hamb_menu_black.svg +0 -1
  134. package/dist/header/hamb_menu_white.svg +0 -1
  135. package/dist/header/readme.md +0 -33
  136. package/dist/input-text/InputText.stories.js +0 -209
  137. package/dist/input-text/error.svg +0 -1
  138. package/dist/input-text/readme.md +0 -91
  139. package/dist/paginator/images/next.svg +0 -3
  140. package/dist/paginator/images/nextPage.svg +0 -3
  141. package/dist/paginator/images/previous.svg +0 -3
  142. package/dist/paginator/images/previousPage.svg +0 -3
  143. package/dist/paginator/readme.md +0 -50
  144. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  145. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  146. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  147. package/dist/select/Select.stories.js +0 -235
  148. package/dist/select/readme.md +0 -72
  149. package/dist/sidenav/arrow_icon.svg +0 -3
  150. package/dist/slider/Slider.stories.js +0 -241
  151. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  152. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  153. package/dist/upload/file-upload/audio-icon.svg +0 -4
  154. package/dist/upload/file-upload/close.svg +0 -4
  155. package/dist/upload/file-upload/file-icon.svg +0 -4
  156. package/dist/upload/file-upload/video-icon.svg +0 -4
  157. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  158. package/dist/upload/transaction/audio-icon.svg +0 -4
  159. package/dist/upload/transaction/error-icon.svg +0 -4
  160. package/dist/upload/transaction/file-icon-err.svg +0 -4
  161. package/dist/upload/transaction/file-icon.svg +0 -4
  162. package/dist/upload/transaction/image-icon-err.svg +0 -4
  163. package/dist/upload/transaction/image-icon.svg +0 -4
  164. package/dist/upload/transaction/success-icon.svg +0 -4
  165. package/dist/upload/transaction/video-icon-err.svg +0 -4
  166. package/dist/upload/transaction/video-icon.svg +0 -4
  167. package/dist/wizard/invalid_icon.svg +0 -6
  168. package/dist/wizard/valid_icon.svg +0 -6
  169. package/dist/wizard/validation-wrong.svg +0 -6
  170. package/test/Toggle.test.js +0 -43
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
+
3
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
6
 
5
7
  Object.defineProperty(exports, "__esModule", {
@@ -15,16 +17,16 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
15
17
 
16
18
  var _react = _interopRequireDefault(require("react"));
17
19
 
18
- var _styledComponents = _interopRequireDefault(require("styled-components"));
20
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
21
 
20
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
21
23
 
22
- require("../common/OpenSans.css");
23
-
24
24
  var _variables = require("../common/variables.js");
25
25
 
26
+ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
27
+
26
28
  function _templateObject6() {
27
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 20px;\n line-height: 27px;\n font-weight: ", ";\n letter-spacing: 0.26px;\n margin: 0;\n"]);
29
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
28
30
 
29
31
  _templateObject6 = function _templateObject6() {
30
32
  return data;
@@ -34,7 +36,7 @@ function _templateObject6() {
34
36
  }
35
37
 
36
38
  function _templateObject5() {
37
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 24px;\n line-height: 33px;\n font-weight: ", ";\n letter-spacing: 0px;\n margin: 0;\n"]);
39
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
38
40
 
39
41
  _templateObject5 = function _templateObject5() {
40
42
  return data;
@@ -44,7 +46,7 @@ function _templateObject5() {
44
46
  }
45
47
 
46
48
  function _templateObject4() {
47
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 34px;\n line-height: 46px;\n font-weight: ", ";\n letter-spacing: 0.24px;\n margin: 0;\n"]);
49
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
48
50
 
49
51
  _templateObject4 = function _templateObject4() {
50
52
  return data;
@@ -54,7 +56,7 @@ function _templateObject4() {
54
56
  }
55
57
 
56
58
  function _templateObject3() {
57
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 48px;\n line-height: 65px;\n font-weight: ", ";\n letter-spacing: 0px;\n margin: 0;\n"]);
59
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
58
60
 
59
61
  _templateObject3 = function _templateObject3() {
60
62
  return data;
@@ -64,7 +66,7 @@ function _templateObject3() {
64
66
  }
65
67
 
66
68
  function _templateObject2() {
67
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 60px;\n line-height: 82px;\n font-weight: ", ";\n letter-spacing: -0.53px;\n margin: 0;\n"]);
69
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
68
70
 
69
71
  _templateObject2 = function _templateObject2() {
70
72
  return data;
@@ -74,7 +76,7 @@ function _templateObject2() {
74
76
  }
75
77
 
76
78
  function _templateObject() {
77
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n font-family: \"Open Sans\", sans-serif;\n color: ", ";\n"]);
79
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
78
80
 
79
81
  _templateObject = function _templateObject() {
80
82
  return data;
@@ -86,15 +88,15 @@ function _templateObject() {
86
88
  var DxcHeading = function DxcHeading(_ref) {
87
89
  var _ref$level = _ref.level,
88
90
  level = _ref$level === void 0 ? 1 : _ref$level,
89
- _ref$theme = _ref.theme,
90
- theme = _ref$theme === void 0 ? "light" : _ref$theme,
91
91
  _ref$text = _ref.text,
92
92
  text = _ref$text === void 0 ? "" : _ref$text,
93
93
  _ref$weight = _ref.weight,
94
94
  weight = _ref$weight === void 0 ? "" : _ref$weight,
95
95
  margin = _ref.margin;
96
- return _react["default"].createElement(HeadingContainer, {
97
- brightness: theme,
96
+ var colorsTheme = (0, _useTheme["default"])();
97
+ return _react["default"].createElement(_styledComponents.ThemeProvider, {
98
+ theme: colorsTheme.heading
99
+ }, _react["default"].createElement(HeadingContainer, {
98
100
  margin: margin
99
101
  }, level === 1 ? _react["default"].createElement(HeadingLevel1, {
100
102
  weight: weight
@@ -106,7 +108,7 @@ var DxcHeading = function DxcHeading(_ref) {
106
108
  weight: weight
107
109
  }, text) : _react["default"].createElement(HeadingLevel5, {
108
110
  weight: weight
109
- }, text));
111
+ }, text)));
110
112
  };
111
113
 
112
114
  var HeadingContainer = _styledComponents["default"].div(_templateObject(), function (props) {
@@ -119,33 +121,90 @@ var HeadingContainer = _styledComponents["default"].div(_templateObject(), funct
119
121
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
120
122
  }, function (props) {
121
123
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
122
- }, function (props) {
123
- return props.brightness === "light" ? "#000000DE" : "#FFFFFF";
124
124
  });
125
125
 
126
126
  var HeadingLevel1 = _styledComponents["default"].h1(_templateObject2(), function (props) {
127
- return props.weight === "light" || props.weight === "" ? 200 : props.weight === "normal" ? 400 : 600;
127
+ return props.theme.level1FontFamily;
128
+ }, function (props) {
129
+ return props.theme.level1FontStyle;
130
+ }, function (props) {
131
+ return props.theme.level1FontSize;
132
+ }, function (props) {
133
+ return props.theme.level1LineHeight;
134
+ }, function (props) {
135
+ return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level1FontWeight;
136
+ }, function (props) {
137
+ return props.theme.level1LetterSpacing;
138
+ }, function (props) {
139
+ return props.theme.level1FontColor;
128
140
  });
129
141
 
130
142
  var HeadingLevel2 = _styledComponents["default"].h2(_templateObject3(), function (props) {
131
- return props.weight === "normal" || props.weight === "" ? 400 : props.weight === "light" ? 200 : 600;
143
+ return props.theme.level2FontFamily;
144
+ }, function (props) {
145
+ return props.theme.level2FontStyle;
146
+ }, function (props) {
147
+ return props.theme.level2FontSize;
148
+ }, function (props) {
149
+ return props.theme.level2LineHeight;
150
+ }, function (props) {
151
+ return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level2FontWeight;
152
+ }, function (props) {
153
+ return props.theme.level2LetterSpacing;
154
+ }, function (props) {
155
+ return props.theme.level2FontColor;
132
156
  });
133
157
 
134
158
  var HeadingLevel3 = _styledComponents["default"].h3(_templateObject4(), function (props) {
135
- return props.weight === "normal" || props.weight === "" ? 400 : props.weight === "light" ? 200 : 600;
159
+ return props.theme.level3FontFamily;
160
+ }, function (props) {
161
+ return props.theme.level3FontStyle;
162
+ }, function (props) {
163
+ return props.theme.level3FontSize;
164
+ }, function (props) {
165
+ return props.theme.level3LineHeight;
166
+ }, function (props) {
167
+ return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level3FontWeight;
168
+ }, function (props) {
169
+ return props.theme.level3LetterSpacing;
170
+ }, function (props) {
171
+ return props.theme.level3FontColor;
136
172
  });
137
173
 
138
174
  var HeadingLevel4 = _styledComponents["default"].h4(_templateObject5(), function (props) {
139
- return props.weight === "normal" || props.weight === "" ? 400 : props.weight === "light" ? 200 : 600;
175
+ return props.theme.level4FontFamily;
176
+ }, function (props) {
177
+ return props.theme.level4FontStyle;
178
+ }, function (props) {
179
+ return props.theme.level4FontSize;
180
+ }, function (props) {
181
+ return props.theme.level4LineHeight;
182
+ }, function (props) {
183
+ return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level4FontWeight;
184
+ }, function (props) {
185
+ return props.theme.level4LetterSpacing;
186
+ }, function (props) {
187
+ return props.theme.level4FontColor;
140
188
  });
141
189
 
142
190
  var HeadingLevel5 = _styledComponents["default"].h5(_templateObject6(), function (props) {
143
- return props.weight === "normal" || props.weight === "" ? 400 : props.weight === "light" ? 200 : 600;
191
+ return props.theme.level5FontFamily;
192
+ }, function (props) {
193
+ return props.theme.level5FontStyle;
194
+ }, function (props) {
195
+ return props.theme.level5FontSize;
196
+ }, function (props) {
197
+ return props.theme.level5LineHeight;
198
+ }, function (props) {
199
+ return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level5FontWeight;
200
+ }, function (props) {
201
+ return props.theme.level5LetterSpacing;
202
+ }, function (props) {
203
+ return props.theme.level5FontColor;
144
204
  });
145
205
 
146
206
  DxcHeading.propTypes = {
147
207
  level: _propTypes["default"].number,
148
- theme: _propTypes["default"].oneOf(["light", "dark", ""]),
149
208
  text: _propTypes["default"].string,
150
209
  weight: _propTypes["default"].oneOf(["light", "normal", "bold", ""]),
151
210
  margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _default = _react["default"].createElement("svg", {
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ height: "24px",
15
+ viewBox: "0 0 24 24",
16
+ width: "24px",
17
+ fill: "currentColor"
18
+ }, _react["default"].createElement("path", {
19
+ 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-2h2v2zm0-4h-2V7h2v6z"
20
+ }));
21
+
22
+ exports["default"] = _default;