@dxc-technology/halstack-react 0.0.0-5168fa4 → 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 (139) hide show
  1. package/README.md +1 -1
  2. package/babel.config.js +6 -2
  3. package/dist/BackgroundColorContext.js +46 -0
  4. package/dist/ThemeContext.js +235 -2
  5. package/dist/V3Textarea/V3Textarea.js +264 -0
  6. package/dist/accordion/Accordion.js +170 -81
  7. package/dist/accordion-group/AccordionGroup.js +186 -0
  8. package/dist/alert/Alert.js +184 -83
  9. package/dist/alert/index.d.ts +51 -0
  10. package/dist/badge/Badge.js +63 -0
  11. package/dist/box/Box.js +31 -23
  12. package/dist/button/Button.js +82 -27
  13. package/dist/card/Card.js +64 -56
  14. package/dist/checkbox/Checkbox.js +108 -32
  15. package/dist/chip/Chip.js +135 -40
  16. package/dist/common/RequiredComponent.js +2 -8
  17. package/dist/common/utils.js +2 -22
  18. package/dist/common/variables.js +1471 -134
  19. package/dist/date/Date.js +97 -62
  20. package/dist/date-input/DateInput.js +400 -0
  21. package/dist/date-input/index.d.ts +95 -0
  22. package/dist/dialog/Dialog.js +61 -36
  23. package/dist/dropdown/Dropdown.js +226 -94
  24. package/dist/file-input/FileInput.js +644 -0
  25. package/dist/file-input/FileItem.js +280 -0
  26. package/dist/file-input/index.d.ts +81 -0
  27. package/dist/footer/Footer.js +90 -36
  28. package/dist/footer/dxc_logo.svg +15 -0
  29. package/dist/footer/readme.md +1 -1
  30. package/dist/header/Header.js +173 -89
  31. package/dist/header/Icons.js +59 -0
  32. package/dist/heading/Heading.js +81 -22
  33. package/dist/input-text/InputText.js +292 -104
  34. package/dist/layout/ApplicationLayout.js +331 -0
  35. package/dist/layout/facebook.svg +45 -0
  36. package/dist/layout/linkedin.svg +50 -0
  37. package/dist/layout/twitter.svg +53 -0
  38. package/dist/link/Link.js +142 -34
  39. package/dist/main.d.ts +8 -0
  40. package/dist/main.js +111 -7
  41. package/dist/new-select/NewSelect.js +836 -0
  42. package/dist/new-select/index.d.ts +53 -0
  43. package/dist/number-input/NumberInput.js +136 -0
  44. package/dist/number-input/NumberInputContext.js +16 -0
  45. package/dist/number-input/index.d.ts +113 -0
  46. package/dist/paginator/Paginator.js +160 -49
  47. package/dist/password-input/PasswordInput.js +198 -0
  48. package/dist/password-input/index.d.ts +94 -0
  49. package/dist/progress-bar/ProgressBar.js +97 -44
  50. package/dist/radio/Radio.js +39 -21
  51. package/dist/resultsetTable/ResultsetTable.js +93 -69
  52. package/dist/select/Select.js +250 -143
  53. package/dist/sidenav/Sidenav.js +87 -125
  54. package/dist/slider/Slider.js +206 -70
  55. package/dist/spinner/Spinner.js +249 -64
  56. package/dist/switch/Switch.js +52 -25
  57. package/dist/table/Table.js +63 -15
  58. package/dist/tabs/Tabs.js +208 -35
  59. package/dist/tabs-for-sections/TabsForSections.js +1 -16
  60. package/dist/tag/Tag.js +100 -35
  61. package/dist/text-input/TextInput.js +971 -0
  62. package/dist/text-input/index.d.ts +135 -0
  63. package/dist/textarea/Textarea.js +250 -107
  64. package/dist/textarea/index.d.ts +117 -0
  65. package/dist/toggle/Toggle.js +16 -19
  66. package/dist/toggle-group/ToggleGroup.js +327 -0
  67. package/dist/upload/Upload.js +16 -11
  68. package/dist/upload/buttons-upload/ButtonsUpload.js +34 -20
  69. package/dist/upload/dragAndDropArea/DragAndDropArea.js +78 -31
  70. package/dist/upload/file-upload/FileToUpload.js +50 -24
  71. package/dist/upload/files-upload/FilesToUpload.js +16 -16
  72. package/dist/upload/readme.md +2 -2
  73. package/dist/upload/transaction/Transaction.js +44 -24
  74. package/dist/upload/transactions/Transactions.js +38 -20
  75. package/dist/useTheme.js +22 -0
  76. package/dist/wizard/Wizard.js +156 -55
  77. package/dist/wizard/invalid_icon.svg +4 -5
  78. package/dist/wizard/valid_icon.svg +4 -5
  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/Header.test.js +5 -10
  86. package/test/InputText.test.js +53 -41
  87. package/test/Link.test.js +25 -7
  88. package/test/NumberInput.test.js +259 -0
  89. package/test/Paginator.test.js +72 -60
  90. package/test/PasswordInput.test.js +83 -0
  91. package/test/ResultsetTable.test.js +66 -19
  92. package/test/Select.test.js +55 -34
  93. package/test/Sidenav.test.js +22 -64
  94. package/test/Slider.test.js +17 -0
  95. package/test/Spinner.test.js +5 -0
  96. package/test/Tabs.test.js +21 -0
  97. package/test/TextInput.test.js +732 -0
  98. package/test/Textarea.test.js +193 -0
  99. package/test/ToggleGroup.test.js +85 -0
  100. package/test/Upload.test.js +5 -5
  101. package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
  102. package/dist/accordion/Accordion.stories.js +0 -207
  103. package/dist/accordion/readme.md +0 -96
  104. package/dist/alert/Alert.stories.js +0 -158
  105. package/dist/alert/close.svg +0 -4
  106. package/dist/alert/error.svg +0 -4
  107. package/dist/alert/info.svg +0 -4
  108. package/dist/alert/readme.md +0 -43
  109. package/dist/alert/success.svg +0 -4
  110. package/dist/alert/warning.svg +0 -4
  111. package/dist/button/Button.stories.js +0 -224
  112. package/dist/button/readme.md +0 -93
  113. package/dist/common/services/example-service.js +0 -10
  114. package/dist/common/services/example-service.test.js +0 -12
  115. package/dist/date/calendar.svg +0 -1
  116. package/dist/date/calendar_dark.svg +0 -1
  117. package/dist/dialog/Dialog.stories.js +0 -217
  118. package/dist/dialog/readme.md +0 -32
  119. package/dist/dropdown/Dropdown.stories.js +0 -249
  120. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  121. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  122. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  123. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  124. package/dist/dropdown/readme.md +0 -69
  125. package/dist/footer/Footer.stories.js +0 -94
  126. package/dist/footer/dxc_logo_wht.png +0 -0
  127. package/dist/header/Header.stories.js +0 -176
  128. package/dist/header/close_icon.svg +0 -1
  129. package/dist/header/dxc_logo_black.png +0 -0
  130. package/dist/header/dxc_logo_white.png +0 -0
  131. package/dist/header/hamb_menu_black.svg +0 -1
  132. package/dist/header/hamb_menu_white.svg +0 -1
  133. package/dist/header/readme.md +0 -33
  134. package/dist/input-text/InputText.stories.js +0 -209
  135. package/dist/select/Select.stories.js +0 -235
  136. package/dist/select/readme.md +0 -72
  137. package/dist/sidenav/arrow_icon.svg +0 -3
  138. package/dist/slider/Slider.stories.js +0 -241
  139. 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({