@dxc-technology/halstack-react 0.0.0-c7d5596 → 0.0.0-c7ec4d1

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 (199) 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 +237 -2
  5. package/dist/V3Select/V3Select.js +549 -0
  6. package/dist/V3Textarea/V3Textarea.js +264 -0
  7. package/dist/accordion/Accordion.js +152 -67
  8. package/dist/accordion-group/AccordionGroup.js +186 -0
  9. package/dist/alert/Alert.js +183 -84
  10. package/dist/alert/index.d.ts +51 -0
  11. package/dist/badge/Badge.js +63 -0
  12. package/dist/box/Box.js +31 -23
  13. package/dist/button/Button.js +63 -27
  14. package/dist/card/Card.js +72 -35
  15. package/dist/checkbox/Checkbox.js +99 -40
  16. package/dist/chip/Chip.js +97 -40
  17. package/dist/common/RequiredComponent.js +2 -8
  18. package/dist/common/utils.js +2 -22
  19. package/dist/common/variables.js +1452 -304
  20. package/dist/date/Date.js +80 -57
  21. package/dist/date-input/DateInput.js +400 -0
  22. package/dist/date-input/index.d.ts +95 -0
  23. package/dist/dialog/Dialog.js +58 -37
  24. package/dist/dropdown/Dropdown.js +177 -82
  25. package/dist/file-input/FileInput.js +644 -0
  26. package/dist/file-input/FileItem.js +287 -0
  27. package/dist/file-input/index.d.ts +81 -0
  28. package/dist/footer/Footer.js +90 -40
  29. package/dist/footer/Icons.js +77 -0
  30. package/dist/header/Header.js +192 -95
  31. package/dist/header/Icons.js +59 -0
  32. package/dist/heading/Heading.js +93 -16
  33. package/dist/input-text/Icons.js +22 -0
  34. package/dist/input-text/InputText.js +251 -116
  35. package/dist/layout/ApplicationLayout.js +18 -26
  36. package/dist/layout/Icons.js +55 -0
  37. package/dist/link/Link.js +89 -41
  38. package/dist/main.d.ts +8 -0
  39. package/dist/main.js +98 -18
  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 +122 -66
  45. package/dist/password-input/PasswordInput.js +203 -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 +31 -17
  49. package/dist/resultsetTable/ResultsetTable.js +82 -65
  50. package/dist/select/Select.js +896 -284
  51. package/dist/select/index.d.ts +53 -0
  52. package/dist/sidenav/Sidenav.js +66 -15
  53. package/dist/slider/Slider.js +211 -73
  54. package/dist/spinner/Spinner.js +247 -59
  55. package/dist/switch/Switch.js +50 -27
  56. package/dist/table/Table.js +51 -24
  57. package/dist/tabs/Tabs.js +193 -35
  58. package/dist/tag/Tag.js +68 -35
  59. package/dist/text-input/TextInput.js +974 -0
  60. package/dist/text-input/index.d.ts +135 -0
  61. package/dist/textarea/Textarea.js +248 -106
  62. package/dist/textarea/index.d.ts +117 -0
  63. package/dist/toggle/Toggle.js +16 -19
  64. package/dist/toggle-group/ToggleGroup.js +142 -41
  65. package/dist/upload/Upload.js +16 -11
  66. package/dist/upload/buttons-upload/ButtonsUpload.js +32 -19
  67. package/dist/upload/buttons-upload/Icons.js +40 -0
  68. package/dist/upload/dragAndDropArea/DragAndDropArea.js +84 -34
  69. package/dist/upload/dragAndDropArea/Icons.js +39 -0
  70. package/dist/upload/file-upload/FileToUpload.js +64 -33
  71. package/dist/upload/file-upload/Icons.js +66 -0
  72. package/dist/upload/files-upload/FilesToUpload.js +16 -16
  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 +125 -60
  79. package/package.json +14 -11
  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 +15 -0
  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/Heading.test.js +60 -12
  88. package/test/InputText.test.js +53 -41
  89. package/test/Link.test.js +12 -2
  90. package/test/NumberInput.test.js +259 -0
  91. package/test/Paginator.test.js +50 -77
  92. package/test/PasswordInput.test.js +83 -0
  93. package/test/ResultsetTable.test.js +61 -25
  94. package/test/Slider.test.js +9 -17
  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 +5 -1
  100. package/test/Upload.test.js +5 -5
  101. package/test/{Select.test.js → V3Select.test.js} +67 -46
  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_blk_rgb.svg +0 -6
  137. package/dist/header/dxc_logo_white.png +0 -0
  138. package/dist/header/hamb_menu_black.svg +0 -1
  139. package/dist/header/hamb_menu_white.svg +0 -1
  140. package/dist/header/readme.md +0 -33
  141. package/dist/input-text/InputText.stories.js +0 -209
  142. package/dist/input-text/error.svg +0 -1
  143. package/dist/input-text/readme.md +0 -91
  144. package/dist/layout/facebook.svg +0 -45
  145. package/dist/layout/linkedin.svg +0 -50
  146. package/dist/layout/twitter.svg +0 -53
  147. package/dist/link/readme.md +0 -51
  148. package/dist/paginator/images/next.svg +0 -3
  149. package/dist/paginator/images/nextPage.svg +0 -3
  150. package/dist/paginator/images/previous.svg +0 -3
  151. package/dist/paginator/images/previousPage.svg +0 -3
  152. package/dist/paginator/readme.md +0 -50
  153. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  154. package/dist/progress-bar/readme.md +0 -63
  155. package/dist/radio/Radio.stories.js +0 -166
  156. package/dist/radio/readme.md +0 -70
  157. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  158. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  159. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  160. package/dist/select/Select.stories.js +0 -235
  161. package/dist/select/readme.md +0 -72
  162. package/dist/slider/Slider.stories.js +0 -241
  163. package/dist/slider/readme.md +0 -64
  164. package/dist/spinner/Spinner.stories.js +0 -183
  165. package/dist/spinner/readme.md +0 -65
  166. package/dist/switch/Switch.stories.js +0 -134
  167. package/dist/switch/readme.md +0 -133
  168. package/dist/tabs/Tabs.stories.js +0 -130
  169. package/dist/tabs/readme.md +0 -78
  170. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  171. package/dist/tabs-for-sections/readme.md +0 -78
  172. package/dist/toggle/Toggle.stories.js +0 -297
  173. package/dist/toggle/readme.md +0 -80
  174. package/dist/toggle-group/readme.md +0 -82
  175. package/dist/upload/Upload.stories.js +0 -72
  176. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  177. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  178. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  179. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  180. package/dist/upload/file-upload/audio-icon.svg +0 -4
  181. package/dist/upload/file-upload/close.svg +0 -4
  182. package/dist/upload/file-upload/file-icon.svg +0 -4
  183. package/dist/upload/file-upload/video-icon.svg +0 -4
  184. package/dist/upload/readme.md +0 -37
  185. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  186. package/dist/upload/transaction/audio-icon.svg +0 -4
  187. package/dist/upload/transaction/error-icon.svg +0 -4
  188. package/dist/upload/transaction/file-icon-err.svg +0 -4
  189. package/dist/upload/transaction/file-icon.svg +0 -4
  190. package/dist/upload/transaction/image-icon-err.svg +0 -4
  191. package/dist/upload/transaction/image-icon.svg +0 -4
  192. package/dist/upload/transaction/success-icon.svg +0 -4
  193. package/dist/upload/transaction/video-icon-err.svg +0 -4
  194. package/dist/upload/transaction/video-icon.svg +0 -4
  195. package/dist/wizard/invalid_icon.svg +0 -6
  196. package/dist/wizard/valid_icon.svg +0 -6
  197. package/dist/wizard/validation-wrong.svg +0 -6
  198. package/test/TabsForSections.test.js +0 -34
  199. package/test/Toggle.test.js +0 -43
@@ -1,82 +0,0 @@
1
- # DXC Toggle Group Component
2
-
3
- ## Props
4
-
5
- <table>
6
- <tr style="background-color: grey">
7
- <td>Name</td>
8
- <td>Default</td>
9
- <td>Description</td>
10
- </tr>
11
- <tr>
12
- <td>value: any | any[]</td>
13
- <td></td>
14
- <td>
15
- The key(s) of the selected value(s). If the toggle group component
16
- doesn't allow multiple selection, it must be one unique value. If the
17
- component allows multiple selection, value must be an array. If
18
- undefined, the component will be uncontrolled and the value will be
19
- managed internally by the component.
20
- </td>
21
- </tr>
22
- <tr>
23
- <td>onChange: function</td>
24
- <td></td>
25
- <td>
26
- This function will be called every time the selection changes. The
27
- number with the key of the selected value will be passed as a
28
- parameter to this function. If multiple selection is allowed, an array
29
- of keys will be passed
30
- </td>
31
- </tr>
32
- <tr>
33
- <td>disabled: boolean</td>
34
- <td>
35
- <code>false</code>
36
- </td>
37
- <td>If true, the component will be disabled.</td>
38
- </tr>
39
- <tr>
40
- <td>multiple: boolean</td>
41
- <td>
42
- <code>false</code>
43
- </td>
44
- <td>
45
- If true, the toggle group will support multiple selection. In that
46
- case, value must be an array of numbers with the keys of the selected
47
- values.
48
- </td>
49
- </tr>
50
- <tr>
51
- <td>options: object[]</td>
52
- <td>
53
- <code>[]</code>
54
- </td>
55
- <td>
56
- An array of objects representing the selectable options. Each object
57
- has the following properties:
58
- <ul>
59
- <li>
60
- <b>value</b>: Number with the option inner value.
61
- </li>
62
- <li>
63
- <b>label</b>: String with the option display value.
64
- </li>
65
- <li>
66
- <b>iconSrc</b>: URL of the icon that will be placed. IconSrc and
67
- label can't be used at same time.
68
- </li>
69
- </ul>
70
- </td>
71
- </tr>
72
- <tr>
73
- <td>margin: string | object</td>
74
- <td></td>
75
- <td>
76
- Size of the margin to be applied to the component ('xxsmall' |
77
- 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). You
78
- can pass an object with 'top', 'bottom', 'left' and 'right' properties
79
- in order to specify different margin sizes.
80
- </td>
81
- </tr>
82
- </table>
@@ -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
- });