@dxc-technology/halstack-react 0.0.0-b146e44 → 0.0.0-b3da1a9

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 (195) hide show
  1. package/babel.config.js +6 -2
  2. package/dist/BackgroundColorContext.js +46 -0
  3. package/dist/ThemeContext.js +237 -2
  4. package/dist/V3Textarea/V3Textarea.js +264 -0
  5. package/dist/accordion/Accordion.js +174 -63
  6. package/dist/accordion-group/AccordionGroup.js +186 -0
  7. package/dist/alert/Alert.js +183 -84
  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 +85 -28
  12. package/dist/card/Card.js +72 -35
  13. package/dist/checkbox/Checkbox.js +107 -32
  14. package/dist/chip/Chip.js +128 -36
  15. package/dist/common/RequiredComponent.js +2 -8
  16. package/dist/common/utils.js +2 -22
  17. package/dist/common/variables.js +1455 -276
  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 +205 -85
  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 +200 -102
  29. package/dist/header/Icons.js +59 -0
  30. package/dist/heading/Heading.js +93 -16
  31. package/dist/input-text/Icons.js +22 -0
  32. package/dist/input-text/InputText.js +292 -106
  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 -15
  38. package/dist/new-select/NewSelect.js +1085 -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 +150 -63
  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 +95 -38
  48. package/dist/radio/Radio.js +39 -17
  49. package/dist/resultsetTable/ResultsetTable.js +93 -68
  50. package/dist/select/Select.js +249 -145
  51. package/dist/sidenav/Sidenav.js +84 -141
  52. package/dist/slider/Slider.js +219 -73
  53. package/dist/spinner/Spinner.js +247 -59
  54. package/dist/switch/Switch.js +50 -27
  55. package/dist/table/Table.js +58 -13
  56. package/dist/tabs/Tabs.js +208 -35
  57. package/dist/tag/Tag.js +100 -35
  58. package/dist/text-input/TextInput.js +971 -0
  59. package/dist/text-input/index.d.ts +135 -0
  60. package/dist/textarea/Textarea.js +248 -106
  61. package/dist/textarea/index.d.ts +117 -0
  62. package/dist/toggle/Toggle.js +16 -19
  63. package/dist/toggle-group/ToggleGroup.js +327 -0
  64. package/dist/upload/Upload.js +16 -11
  65. package/dist/upload/buttons-upload/ButtonsUpload.js +32 -19
  66. package/dist/upload/buttons-upload/Icons.js +40 -0
  67. package/dist/upload/dragAndDropArea/DragAndDropArea.js +84 -34
  68. package/dist/upload/dragAndDropArea/Icons.js +39 -0
  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/transaction/Icons.js +160 -0
  73. package/dist/upload/transaction/Transaction.js +42 -49
  74. package/dist/upload/transactions/Transactions.js +38 -20
  75. package/dist/useTheme.js +22 -0
  76. package/dist/wizard/Icons.js +65 -0
  77. package/dist/wizard/Wizard.js +138 -60
  78. package/package.json +17 -13
  79. package/test/AccordionGroup.test.js +125 -0
  80. package/test/Date.test.js +49 -45
  81. package/test/DateInput.test.js +242 -0
  82. package/test/Dropdown.test.js +15 -0
  83. package/test/FileInput.test.js +201 -0
  84. package/test/Footer.test.js +2 -7
  85. package/test/Header.test.js +5 -10
  86. package/test/Heading.test.js +60 -12
  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/checkbox/Checkbox.stories.js +0 -144
  115. package/dist/checkbox/readme.md +0 -116
  116. package/dist/common/services/example-service.js +0 -10
  117. package/dist/common/services/example-service.test.js +0 -12
  118. package/dist/date/Date.stories.js +0 -205
  119. package/dist/date/calendar.svg +0 -1
  120. package/dist/date/calendar_dark.svg +0 -1
  121. package/dist/date/readme.md +0 -73
  122. package/dist/dialog/Dialog.stories.js +0 -217
  123. package/dist/dialog/readme.md +0 -32
  124. package/dist/dropdown/Dropdown.stories.js +0 -249
  125. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  126. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  127. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  128. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  129. package/dist/dropdown/readme.md +0 -69
  130. package/dist/footer/Footer.stories.js +0 -94
  131. package/dist/footer/dxc_logo_wht.png +0 -0
  132. package/dist/footer/readme.md +0 -41
  133. package/dist/header/Header.stories.js +0 -176
  134. package/dist/header/close_icon.svg +0 -1
  135. package/dist/header/dxc_logo_black.png +0 -0
  136. package/dist/header/dxc_logo_white.png +0 -0
  137. package/dist/header/hamb_menu_black.svg +0 -1
  138. package/dist/header/hamb_menu_white.svg +0 -1
  139. package/dist/header/readme.md +0 -33
  140. package/dist/input-text/InputText.stories.js +0 -209
  141. package/dist/input-text/error.svg +0 -1
  142. package/dist/input-text/readme.md +0 -91
  143. package/dist/link/readme.md +0 -51
  144. package/dist/paginator/images/next.svg +0 -3
  145. package/dist/paginator/images/nextPage.svg +0 -3
  146. package/dist/paginator/images/previous.svg +0 -3
  147. package/dist/paginator/images/previousPage.svg +0 -3
  148. package/dist/paginator/readme.md +0 -50
  149. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  150. package/dist/progress-bar/readme.md +0 -63
  151. package/dist/radio/Radio.stories.js +0 -166
  152. package/dist/radio/readme.md +0 -70
  153. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  154. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  155. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  156. package/dist/select/Select.stories.js +0 -235
  157. package/dist/select/readme.md +0 -72
  158. package/dist/sidenav/arrow_icon.svg +0 -3
  159. package/dist/slider/Slider.stories.js +0 -241
  160. package/dist/slider/readme.md +0 -64
  161. package/dist/spinner/Spinner.stories.js +0 -183
  162. package/dist/spinner/readme.md +0 -65
  163. package/dist/switch/Switch.stories.js +0 -134
  164. package/dist/switch/readme.md +0 -133
  165. package/dist/tabs/Tabs.stories.js +0 -130
  166. package/dist/tabs/readme.md +0 -78
  167. package/dist/tabs-for-sections/TabsForSections.js +0 -107
  168. package/dist/tabs-for-sections/readme.md +0 -78
  169. package/dist/toggle/Toggle.stories.js +0 -297
  170. package/dist/toggle/readme.md +0 -80
  171. package/dist/upload/Upload.stories.js +0 -72
  172. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  173. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  174. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  175. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  176. package/dist/upload/file-upload/audio-icon.svg +0 -4
  177. package/dist/upload/file-upload/close.svg +0 -4
  178. package/dist/upload/file-upload/file-icon.svg +0 -4
  179. package/dist/upload/file-upload/video-icon.svg +0 -4
  180. package/dist/upload/readme.md +0 -37
  181. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  182. package/dist/upload/transaction/audio-icon.svg +0 -4
  183. package/dist/upload/transaction/error-icon.svg +0 -4
  184. package/dist/upload/transaction/file-icon-err.svg +0 -4
  185. package/dist/upload/transaction/file-icon.svg +0 -4
  186. package/dist/upload/transaction/image-icon-err.svg +0 -4
  187. package/dist/upload/transaction/image-icon.svg +0 -4
  188. package/dist/upload/transaction/success-icon.svg +0 -4
  189. package/dist/upload/transaction/video-icon-err.svg +0 -4
  190. package/dist/upload/transaction/video-icon.svg +0 -4
  191. package/dist/wizard/invalid_icon.svg +0 -6
  192. package/dist/wizard/valid_icon.svg +0 -6
  193. package/dist/wizard/validation-wrong.svg +0 -6
  194. package/test/TabsForSections.test.js +0 -34
  195. package/test/Toggle.test.js +0 -43
@@ -1,80 +0,0 @@
1
- # DXC Toggle Component
2
-
3
- ## Usage
4
-
5
- ```js
6
- import { DxcToggle } from "@dxc-technology/halstack-react";
7
-
8
- <DxcToggle onClick={handleClick} label="Test Button" />;
9
- ```
10
-
11
- ## Props
12
-
13
- <table>
14
- <tr style="background-color: grey">
15
- <td>Name</td>
16
- <td>Default</td>
17
- <td>Description</td>
18
- </tr>
19
- <tr>
20
- <td>selected: boolean</td>
21
- <td><code>false</code></td>
22
- <td>If true, the component is selected.</td>
23
- </tr>
24
- <tr>
25
- <td>mode: 'basic' | 'outlined'</td>
26
- <td><code>'basic'</code></td>
27
- <td>Uses on of the available toggle modes.</td>
28
- </tr>
29
- <tr>
30
- <td>iconPosition: 'before' | 'after'</td>
31
- <td><code>'before'</code></td>
32
- <td>Changes the position of the icon.</td>
33
- </tr>
34
- <tr>
35
- <td>theme: 'light' |'dark'</td>
36
- <td><code>'light'</code></td>
37
- <td>Uses one of the available component themes.</td>
38
- </tr>
39
- <tr>
40
- <td>label: string</td>
41
- <td><code>'basic'</code></td>
42
- <td>Text to be placed on the toggle.</td>
43
- </tr>
44
- <tr>
45
- <td>iconSrc: string</td>
46
- <td></td>
47
- <td>URL of the icon that will be placed on the toggle.</td>
48
- </tr>
49
- <tr>
50
- <td>disabled: boolean</td>
51
- <td><code>false</code></td>
52
- <td>If true, the component will be disabled.</td>
53
- </tr>
54
- <tr>
55
- <td>disableRipple: boolean</td>
56
- <td><code>false</code></td>
57
- <td>If true, the ripple effect will be disabled.</td>
58
- </tr>
59
- <tr>
60
- <td>onClick: function</td>
61
- <td></td>
62
- <td>This function will be called when the user clicks the button. The new state will be passed as a parameter.</td>
63
- </tr>
64
-
65
- </table>
66
-
67
- ## Examples
68
-
69
- ```js
70
- import { DxcToggle } from "@dxc-technology/halstack-react";
71
- <DxcToggle
72
- label="Disabled Ripple"
73
- disableRipple={true}
74
- theme="dark"
75
- iconSrc={amazon}
76
- mode="outlined"
77
- selected={selected}
78
- onClick={click}
79
- ></DxcToggle>;
80
- ```
@@ -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
- });