@dxc-technology/halstack-react 0.0.0-e904570 → 0.0.0-e961efe

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 (247) hide show
  1. package/README.md +2 -2
  2. package/babel.config.js +5 -2
  3. package/dist/BackgroundColorContext.js +46 -0
  4. package/dist/ThemeContext.js +237 -2
  5. package/dist/V3Select/V3Select.js +549 -0
  6. package/dist/V3Select/index.d.ts +27 -0
  7. package/dist/V3Textarea/V3Textarea.js +264 -0
  8. package/dist/V3Textarea/index.d.ts +27 -0
  9. package/dist/accordion/Accordion.js +170 -81
  10. package/dist/accordion/index.d.ts +28 -0
  11. package/dist/accordion-group/AccordionGroup.js +186 -0
  12. package/dist/accordion-group/index.d.ts +16 -0
  13. package/dist/alert/Alert.js +184 -83
  14. package/dist/alert/index.d.ts +51 -0
  15. package/dist/badge/Badge.js +63 -0
  16. package/dist/box/Box.js +39 -19
  17. package/dist/box/index.d.ts +25 -0
  18. package/dist/button/Button.js +84 -29
  19. package/dist/button/index.d.ts +24 -0
  20. package/dist/card/Card.js +64 -56
  21. package/dist/card/index.d.ts +22 -0
  22. package/dist/checkbox/Checkbox.js +107 -32
  23. package/dist/checkbox/index.d.ts +24 -0
  24. package/dist/chip/Chip.js +135 -40
  25. package/dist/chip/index.d.ts +22 -0
  26. package/dist/common/RequiredComponent.js +2 -8
  27. package/dist/common/utils.js +2 -22
  28. package/dist/common/variables.js +1482 -105
  29. package/dist/date/Date.js +110 -73
  30. package/dist/date/index.d.ts +27 -0
  31. package/dist/date-input/DateInput.js +400 -0
  32. package/dist/date-input/index.d.ts +95 -0
  33. package/dist/dialog/Dialog.js +61 -36
  34. package/dist/dialog/index.d.ts +18 -0
  35. package/dist/dropdown/Dropdown.js +226 -94
  36. package/dist/dropdown/index.d.ts +26 -0
  37. package/dist/file-input/FileInput.js +644 -0
  38. package/dist/file-input/FileItem.js +287 -0
  39. package/dist/file-input/index.d.ts +81 -0
  40. package/dist/footer/Footer.js +125 -45
  41. package/dist/footer/Icons.js +77 -0
  42. package/dist/footer/index.d.ts +25 -0
  43. package/dist/header/Header.js +211 -91
  44. package/dist/header/Icons.js +59 -0
  45. package/dist/header/index.d.ts +25 -0
  46. package/dist/heading/Heading.js +93 -22
  47. package/dist/heading/index.d.ts +17 -0
  48. package/dist/input-text/Icons.js +22 -0
  49. package/dist/input-text/InputText.js +292 -106
  50. package/dist/input-text/index.d.ts +36 -0
  51. package/dist/layout/ApplicationLayout.js +327 -0
  52. package/dist/layout/Icons.js +55 -0
  53. package/dist/link/Link.js +142 -34
  54. package/dist/link/index.d.ts +23 -0
  55. package/dist/main.d.ts +40 -0
  56. package/dist/main.js +112 -16
  57. package/dist/number-input/NumberInput.js +136 -0
  58. package/dist/number-input/NumberInputContext.js +16 -0
  59. package/dist/number-input/index.d.ts +113 -0
  60. package/dist/paginator/Icons.js +66 -0
  61. package/dist/paginator/Paginator.js +184 -57
  62. package/dist/paginator/index.d.ts +20 -0
  63. package/dist/password-input/PasswordInput.js +203 -0
  64. package/dist/password-input/index.d.ts +94 -0
  65. package/dist/progress-bar/ProgressBar.js +97 -44
  66. package/dist/progress-bar/index.d.ts +18 -0
  67. package/dist/radio/Radio.js +39 -21
  68. package/dist/radio/index.d.ts +23 -0
  69. package/dist/resultsetTable/ResultsetTable.js +93 -69
  70. package/dist/resultsetTable/index.d.ts +19 -0
  71. package/dist/select/Select.js +917 -263
  72. package/dist/select/index.d.ts +53 -0
  73. package/dist/sidenav/Sidenav.js +87 -125
  74. package/dist/sidenav/index.d.ts +13 -0
  75. package/dist/slider/Slider.js +219 -73
  76. package/dist/slider/index.d.ts +29 -0
  77. package/dist/spinner/Spinner.js +249 -64
  78. package/dist/spinner/index.d.ts +17 -0
  79. package/dist/stories/Button.js +71 -0
  80. package/dist/stories/Button.stories.js +55 -0
  81. package/dist/stories/Header.js +67 -0
  82. package/dist/stories/Header.stories.js +31 -0
  83. package/dist/stories/Introduction.stories.mdx +211 -0
  84. package/dist/stories/Page.js +68 -0
  85. package/dist/stories/Page.stories.js +39 -0
  86. package/dist/stories/assets/code-brackets.svg +1 -0
  87. package/dist/stories/assets/colors.svg +1 -0
  88. package/dist/stories/assets/comments.svg +1 -0
  89. package/dist/stories/assets/direction.svg +1 -0
  90. package/dist/stories/assets/flow.svg +1 -0
  91. package/dist/stories/assets/plugin.svg +1 -0
  92. package/dist/stories/assets/repo.svg +1 -0
  93. package/dist/stories/assets/stackalt.svg +1 -0
  94. package/dist/stories/button.css +30 -0
  95. package/dist/stories/header.css +26 -0
  96. package/dist/stories/page.css +69 -0
  97. package/dist/switch/Switch.js +52 -25
  98. package/dist/switch/index.d.ts +24 -0
  99. package/dist/table/Table.js +63 -15
  100. package/dist/table/index.d.ts +13 -0
  101. package/dist/tabs/Tabs.js +210 -50
  102. package/dist/tabs/index.d.ts +19 -0
  103. package/dist/tag/Tag.js +100 -35
  104. package/dist/tag/index.d.ts +24 -0
  105. package/dist/text-input/TextInput.js +974 -0
  106. package/dist/text-input/index.d.ts +135 -0
  107. package/dist/textarea/Textarea.js +250 -107
  108. package/dist/textarea/index.d.ts +117 -0
  109. package/dist/toggle/Toggle.js +16 -19
  110. package/dist/toggle/index.d.ts +21 -0
  111. package/dist/toggle-group/ToggleGroup.js +327 -0
  112. package/dist/toggle-group/index.d.ts +21 -0
  113. package/dist/upload/Upload.js +13 -8
  114. package/dist/upload/buttons-upload/ButtonsUpload.js +35 -25
  115. package/dist/upload/buttons-upload/Icons.js +40 -0
  116. package/dist/upload/dragAndDropArea/DragAndDropArea.js +84 -37
  117. package/dist/upload/dragAndDropArea/Icons.js +39 -0
  118. package/dist/upload/file-upload/FileToUpload.js +64 -33
  119. package/dist/upload/file-upload/Icons.js +66 -0
  120. package/dist/upload/files-upload/FilesToUpload.js +16 -16
  121. package/dist/upload/index.d.ts +15 -0
  122. package/dist/upload/transaction/Icons.js +160 -0
  123. package/dist/upload/transaction/Transaction.js +42 -49
  124. package/dist/upload/transactions/Transactions.js +38 -20
  125. package/dist/useTheme.js +22 -0
  126. package/dist/wizard/Icons.js +65 -0
  127. package/dist/wizard/Wizard.js +156 -61
  128. package/dist/wizard/index.d.ts +18 -0
  129. package/package.json +26 -14
  130. package/test/AccordionGroup.test.js +125 -0
  131. package/test/Date.test.js +15 -13
  132. package/test/DateInput.test.js +242 -0
  133. package/test/Dropdown.test.js +19 -4
  134. package/test/FileInput.test.js +201 -0
  135. package/test/Footer.test.js +2 -7
  136. package/test/Header.test.js +5 -10
  137. package/test/Heading.test.js +60 -12
  138. package/test/InputText.test.js +31 -28
  139. package/test/Link.test.js +25 -7
  140. package/test/NumberInput.test.js +259 -0
  141. package/test/Paginator.test.js +76 -60
  142. package/test/PasswordInput.test.js +83 -0
  143. package/test/ResultsetTable.test.js +65 -17
  144. package/test/Select.test.js +371 -147
  145. package/test/Sidenav.test.js +22 -64
  146. package/test/Slider.test.js +24 -15
  147. package/test/Spinner.test.js +5 -0
  148. package/test/Tabs.test.js +21 -0
  149. package/test/TextInput.test.js +732 -0
  150. package/test/Textarea.test.js +193 -0
  151. package/test/ToggleGroup.test.js +85 -0
  152. package/test/Upload.test.js +1 -1
  153. package/test/V3Select.test.js +212 -0
  154. package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
  155. package/dist/accordion/Accordion.stories.js +0 -207
  156. package/dist/accordion/readme.md +0 -96
  157. package/dist/alert/Alert.stories.js +0 -158
  158. package/dist/alert/close.svg +0 -4
  159. package/dist/alert/error.svg +0 -4
  160. package/dist/alert/info.svg +0 -4
  161. package/dist/alert/readme.md +0 -43
  162. package/dist/alert/success.svg +0 -4
  163. package/dist/alert/warning.svg +0 -4
  164. package/dist/button/Button.stories.js +0 -224
  165. package/dist/button/readme.md +0 -93
  166. package/dist/checkbox/Checkbox.stories.js +0 -144
  167. package/dist/checkbox/readme.md +0 -116
  168. package/dist/common/services/example-service.js +0 -10
  169. package/dist/common/services/example-service.test.js +0 -12
  170. package/dist/date/Date.stories.js +0 -205
  171. package/dist/date/calendar.svg +0 -1
  172. package/dist/date/calendar_dark.svg +0 -1
  173. package/dist/date/readme.md +0 -73
  174. package/dist/dialog/Dialog.stories.js +0 -217
  175. package/dist/dialog/readme.md +0 -32
  176. package/dist/dropdown/Dropdown.stories.js +0 -249
  177. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  178. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  179. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  180. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  181. package/dist/dropdown/readme.md +0 -69
  182. package/dist/footer/Footer.stories.js +0 -94
  183. package/dist/footer/dxc_logo_wht.png +0 -0
  184. package/dist/footer/readme.md +0 -41
  185. package/dist/header/Header.stories.js +0 -176
  186. package/dist/header/close_icon.svg +0 -1
  187. package/dist/header/dxc_logo_black.png +0 -0
  188. package/dist/header/dxc_logo_white.png +0 -0
  189. package/dist/header/hamb_menu_black.svg +0 -1
  190. package/dist/header/hamb_menu_white.svg +0 -1
  191. package/dist/header/readme.md +0 -33
  192. package/dist/input-text/InputText.stories.js +0 -209
  193. package/dist/input-text/error.svg +0 -1
  194. package/dist/input-text/readme.md +0 -91
  195. package/dist/link/readme.md +0 -51
  196. package/dist/paginator/images/next.svg +0 -3
  197. package/dist/paginator/images/nextPage.svg +0 -3
  198. package/dist/paginator/images/previous.svg +0 -3
  199. package/dist/paginator/images/previousPage.svg +0 -3
  200. package/dist/paginator/readme.md +0 -50
  201. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  202. package/dist/progress-bar/readme.md +0 -63
  203. package/dist/radio/Radio.stories.js +0 -166
  204. package/dist/radio/readme.md +0 -70
  205. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  206. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  207. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  208. package/dist/select/Select.stories.js +0 -235
  209. package/dist/select/readme.md +0 -72
  210. package/dist/sidenav/arrow_icon.svg +0 -3
  211. package/dist/slider/Slider.stories.js +0 -241
  212. package/dist/slider/readme.md +0 -64
  213. package/dist/spinner/Spinner.stories.js +0 -183
  214. package/dist/spinner/readme.md +0 -65
  215. package/dist/switch/Switch.stories.js +0 -134
  216. package/dist/switch/readme.md +0 -133
  217. package/dist/tabs/Tabs.stories.js +0 -130
  218. package/dist/tabs/readme.md +0 -78
  219. package/dist/tabs-for-sections/TabsForSections.js +0 -107
  220. package/dist/tabs-for-sections/readme.md +0 -78
  221. package/dist/toggle/Toggle.stories.js +0 -297
  222. package/dist/toggle/readme.md +0 -80
  223. package/dist/upload/Upload.stories.js +0 -72
  224. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  225. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  226. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  227. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  228. package/dist/upload/file-upload/audio-icon.svg +0 -4
  229. package/dist/upload/file-upload/close.svg +0 -4
  230. package/dist/upload/file-upload/file-icon.svg +0 -4
  231. package/dist/upload/file-upload/video-icon.svg +0 -4
  232. package/dist/upload/readme.md +0 -37
  233. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  234. package/dist/upload/transaction/audio-icon.svg +0 -4
  235. package/dist/upload/transaction/error-icon.svg +0 -4
  236. package/dist/upload/transaction/file-icon-err.svg +0 -4
  237. package/dist/upload/transaction/file-icon.svg +0 -4
  238. package/dist/upload/transaction/image-icon-err.svg +0 -4
  239. package/dist/upload/transaction/image-icon.svg +0 -4
  240. package/dist/upload/transaction/success-icon.svg +0 -4
  241. package/dist/upload/transaction/video-icon-err.svg +0 -4
  242. package/dist/upload/transaction/video-icon.svg +0 -4
  243. package/dist/wizard/invalid_icon.svg +0 -6
  244. package/dist/wizard/valid_icon.svg +0 -6
  245. package/dist/wizard/validation-wrong.svg +0 -6
  246. package/test/TabsForSections.test.js +0 -34
  247. package/test/Toggle.test.js +0 -43
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
-
7
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
-
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
-
11
- var _react = _interopRequireDefault(require("react"));
12
-
13
- var _react2 = require("@storybook/react");
14
-
15
- var _readme = _interopRequireDefault(require("./readme.md"));
16
-
17
- var _Upload = _interopRequireDefault(require("./Upload"));
18
-
19
- function callbackFunc() {
20
- return _callbackFunc.apply(this, arguments);
21
- }
22
-
23
- function _callbackFunc() {
24
- _callbackFunc = (0, _asyncToGenerator2["default"])(
25
- /*#__PURE__*/
26
- _regenerator["default"].mark(function _callee() {
27
- return _regenerator["default"].wrap(function _callee$(_context) {
28
- while (1) {
29
- switch (_context.prev = _context.next) {
30
- case 0:
31
- return _context.abrupt("return", new Promise(function (resolve) {
32
- return setTimeout(resolve, 1000);
33
- }));
34
-
35
- case 1:
36
- case "end":
37
- return _context.stop();
38
- }
39
- }
40
- }, _callee);
41
- }));
42
- return _callbackFunc.apply(this, arguments);
43
- }
44
-
45
- (0, _react2.storiesOf)("Form Components|Upload", module).add("Component", function () {
46
- return _react["default"].createElement("div", {
47
- style: {
48
- marginTop: "80px"
49
- }
50
- }, _react["default"].createElement(_Upload["default"], {
51
- callbackUpload: callbackFunc
52
- }));
53
- }, {
54
- notes: {
55
- markdown: _readme["default"]
56
- }
57
- });
58
-
59
- var knobProps = function knobProps() {
60
- return {};
61
- };
62
-
63
- (0, _react2.storiesOf)("Form Components|Upload", module).add("Knobs example", function () {
64
- var props = knobProps();
65
- return _react["default"].createElement(_Upload["default"], (0, _extends2["default"])({}, props, {
66
- callbackUpload: callbackFunc
67
- }));
68
- }, {
69
- notes: {
70
- markdown: _readme["default"]
71
- }
72
- });
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#666666">
2
- <path fill="none" d="M0 0h24v24H0V0z"/>
3
- <path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"/>
4
- </svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="74.5" height="74.5" viewBox="0 0 24 24" fill="#666666">
2
- <path fill="none" d="M0 0h24v24H0z"/>
3
- <path d="M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5h-2zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4H6z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="43.5" height="43.5" viewBox="0 0 24 24">
2
- <path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
- <path fill="none" d="M0 0h24v24H0V0z"/>
3
- <path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24">
2
- <path 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"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
- <path fill="none" d="M0 0h24v24H0V0z"/>
3
- <path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
- <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,37 +0,0 @@
1
- # DXC Upload Component
2
-
3
- ## Usage
4
-
5
- ```js
6
- import { DxcUpload } from "@dxc-technology/halstack-react";
7
- ```
8
-
9
- ## Props
10
-
11
- <table>
12
- <tr style="background-color: grey">
13
- <td>Name</td>
14
- <td>Default</td>
15
- <td>Description</td>
16
- </tr>
17
- <tr>
18
- <td>onUpload: function</td>
19
- <td></td>
20
- <td>This function will be called when the user clicks the 'Upload' button for every file to be uploaded, we will send as a parameter the File object; apart from that this function should return one promise on which we should make 'then'(here we should show a Success alert) or 'catch' (in this case we would receive the error message as a string)</td>
21
- </tr>
22
-
23
- </table>
24
-
25
- ## Examples
26
-
27
- ```js
28
- import React from "react";
29
-
30
- import { DxcUpload } from "@dxc-technology/halstack-react";
31
-
32
- function App() {
33
- return <Upload callbackUpload={callbackFunc} />;
34
- }
35
-
36
- export default App;
37
- ```
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
2
- <path fill="none" d="M0 0h24v24H0V0z"/>
3
- <path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D9D9D9">
2
- <path fill="none" d="M0 0h24v24H0V0z"/>
3
- <path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
2
- <path 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"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
2
- <path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D9D9D9">
2
- <path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
2
- <path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D9D9D9">
2
- <path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#50B50F">
2
- <path fill="none" d="M0 0h24v24H0z"/>
3
- <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
2
- <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D9D9D9">
2
- <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="496" height="496" viewBox="0 0 496 496">
2
- <g id="Group_2913" data-name="Group 2913" transform="translate(5286 3925)">
3
- <path id="Path_2821" data-name="Path 2821" d="M240,0C372.548,0,480,107.452,480,240S372.548,480,240,480,0,372.548,0,240,107.452,0,240,0Z" transform="translate(-5278 -3917)" fill="#f9cfcf"/>
4
- <path id="times-circle-regular" d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm0,448A200,200,0,1,1,456,256,199.945,199.945,0,0,1,256,456ZM357.8,193.8,295.6,256l62.2,62.2a12.011,12.011,0,0,1,0,17l-22.6,22.6a12.011,12.011,0,0,1-17,0L256,295.6l-62.2,62.2a12.011,12.011,0,0,1-17,0l-22.6-22.6a12.011,12.011,0,0,1,0-17L216.4,256l-62.2-62.2a12.011,12.011,0,0,1,0-17l22.6-22.6a12.011,12.011,0,0,1,17,0L256,216.4l62.2-62.2a12.011,12.011,0,0,1,17,0l22.6,22.6a12.011,12.011,0,0,1,0,17Z" transform="translate(-5294 -3933)" fill="#e22"/>
5
- </g>
6
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="496" height="496" viewBox="0 0 496 496">
2
- <g id="Group_2914" data-name="Group 2914" transform="translate(4677 3925)">
3
- <path id="Path_2822" data-name="Path 2822" d="M240,0C372.548,0,480,107.452,480,240S372.548,480,240,480,0,372.548,0,240,107.452,0,240,0Z" transform="translate(-4669 -3917)" fill="#dbf1c4"/>
4
- <path id="check-circle-regular" d="M256,8C119.033,8,8,119.033,8,256S119.033,504,256,504,504,392.967,504,256,392.967,8,256,8Zm0,48A200,200,0,1,1,56,256,199.893,199.893,0,0,1,256,56M396.2,186.267l-22.536-22.718a12,12,0,0,0-16.97-.068L215.346,303.7,155.554,243.42a12,12,0,0,0-16.97-.069l-22.719,22.536a12,12,0,0,0-.068,16.971l90.781,91.516a12,12,0,0,0,16.97.068l172.589-171.2a12,12,0,0,0,.067-16.971Z" transform="translate(-4685 -3933)" fill="#7ed321"/>
5
- </g>
6
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="496" height="496" viewBox="0 0 496 496">
2
- <g id="Group_2913" data-name="Group 2913" transform="translate(5286 3925)">
3
- <path id="Path_2821" data-name="Path 2821" d="M240,0C372.548,0,480,107.452,480,240S372.548,480,240,480,0,372.548,0,240,107.452,0,240,0Z" transform="translate(-5278 -3917)" fill="#f9cfcf"/>
4
- <path id="times-circle-regular" d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm0,448A200,200,0,1,1,456,256,199.945,199.945,0,0,1,256,456ZM357.8,193.8,295.6,256l62.2,62.2a12.011,12.011,0,0,1,0,17l-22.6,22.6a12.011,12.011,0,0,1-17,0L256,295.6l-62.2,62.2a12.011,12.011,0,0,1-17,0l-22.6-22.6a12.011,12.011,0,0,1,0-17L216.4,256l-62.2-62.2a12.011,12.011,0,0,1,0-17l22.6-22.6a12.011,12.011,0,0,1,17,0L256,216.4l62.2-62.2a12.011,12.011,0,0,1,17,0l22.6,22.6a12.011,12.011,0,0,1,0,17Z" transform="translate(-5294 -3933)" fill="#e22"/>
5
- </g>
6
- </svg>
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- import { render } from "@testing-library/react";
3
- import DxcTabsForSections from "../src/tabs-for-sections/TabsForSections";
4
-
5
- const sections = [
6
- {
7
- tabLabel: "S1",
8
- section: () => <div>test-section-1</div>,
9
- },
10
- {
11
- tabLabel: "S2",
12
- section: () => <div>test-section-2</div>,
13
- },
14
- {
15
- tabLabel: "S3",
16
- section: () => <div>test-section-3</div>,
17
- },
18
- ];
19
-
20
- describe("TabsForSections component tests", () => {
21
- test("TabsForSections renders with correct sections label", () => {
22
- const { getByText } = render(<DxcTabsForSections sections={sections}></DxcTabsForSections>);
23
- expect(getByText("S1")).toBeTruthy();
24
- expect(getByText("S2")).toBeTruthy();
25
- expect(getByText("S3")).toBeTruthy();
26
- });
27
-
28
- test("TabsForSections renders with correct sections content", () => {
29
- const { getByText } = render(<DxcTabsForSections sections={sections}></DxcTabsForSections>);
30
- expect(getByText("test-section-1")).toBeTruthy();
31
- expect(getByText("test-section-2")).toBeTruthy();
32
- expect(getByText("test-section-3")).toBeTruthy();
33
- });
34
- });
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import { render, fireEvent } from "@testing-library/react";
3
- import DxcToggle from "../src/toggle/Toggle";
4
-
5
- describe("Toggle component tests", () => {
6
- test("Toggle renders with correct text", () => {
7
- const { getByText } = render(<DxcToggle label="Toggle" />);
8
- expect(getByText("Toggle")).toBeTruthy();
9
- });
10
-
11
- test("Calls correct function on click", () => {
12
- const onClick = jest.fn();
13
- const { getByText} = render(<DxcToggle label="ToggleTest" onClick={onClick} />);
14
- fireEvent.click(getByText("ToggleTest"));
15
- expect(onClick).toHaveBeenCalled();
16
- });
17
-
18
- test("Calls correct function on click with the correct value.", () => {
19
- const onClick = jest.fn();
20
- const { getByText, rerender } = render(<DxcToggle label="ToggleTest" onClick={onClick} />);
21
-
22
- fireEvent.click(getByText("ToggleTest"));
23
- rerender(<DxcToggle label="ToggleTest" onClick={onClick} selected={true} />);
24
- fireEvent.click(getByText("ToggleTest"));
25
- expect(onClick.mock.calls[0][0]).toBe(true);
26
- expect(onClick.mock.calls[1][0]).toBe(false);
27
- });
28
-
29
-
30
- test("Calls correct function on click with the correct value, if it´s controlled and the user doesn´t change the value the function always receives the same", () => {
31
- const onClick = jest.fn();
32
- const { getByText } = render(<DxcToggle label="ToggleTest" selected={true} onClick={onClick} />);
33
-
34
- fireEvent.click(getByText("ToggleTest"));
35
- fireEvent.click(getByText("ToggleTest"));
36
- fireEvent.click(getByText("ToggleTest"));
37
- expect(onClick).toHaveBeenCalledTimes(3);
38
- expect(onClick.mock.calls[0][0]).toBe(false);
39
- expect(onClick.mock.calls[1][0]).toBe(false);
40
- expect(onClick.mock.calls[2][0]).toBe(false);
41
- });
42
-
43
- });