@dxc-technology/halstack-react 0.0.0-b915415 → 0.0.0-b92e300

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 (213) hide show
  1. package/BackgroundColorContext.js +50 -0
  2. package/ThemeContext.js +246 -0
  3. package/{dist/V3Select → V3Select}/V3Select.js +33 -127
  4. package/{dist/V3Select → V3Select}/index.d.ts +0 -0
  5. package/{dist/V3Textarea → V3Textarea}/V3Textarea.js +10 -14
  6. package/{dist/V3Textarea → V3Textarea}/index.d.ts +0 -0
  7. package/accordion/Accordion.d.ts +4 -0
  8. package/{dist/accordion → accordion}/Accordion.js +35 -130
  9. package/accordion/types.d.ts +68 -0
  10. package/accordion/types.js +5 -0
  11. package/accordion-group/AccordionGroup.d.ts +7 -0
  12. package/accordion-group/AccordionGroup.js +170 -0
  13. package/accordion-group/types.d.ts +72 -0
  14. package/accordion-group/types.js +5 -0
  15. package/alert/Alert.d.ts +4 -0
  16. package/{dist/alert → alert}/Alert.js +38 -151
  17. package/alert/types.d.ts +49 -0
  18. package/alert/types.js +5 -0
  19. package/badge/Badge.js +59 -0
  20. package/{dist/box → box}/Box.js +9 -13
  21. package/{dist/box → box}/index.d.ts +0 -0
  22. package/button/Button.d.ts +4 -0
  23. package/{dist/button → button}/Button.js +15 -71
  24. package/button/Button.stories.tsx +293 -0
  25. package/button/types.d.ts +57 -0
  26. package/button/types.js +5 -0
  27. package/card/Card.d.ts +4 -0
  28. package/{dist/card → card}/Card.js +32 -121
  29. package/card/types.d.ts +69 -0
  30. package/card/types.js +5 -0
  31. package/checkbox/Checkbox.d.ts +4 -0
  32. package/{dist/checkbox → checkbox}/Checkbox.js +13 -59
  33. package/checkbox/types.d.ts +60 -0
  34. package/checkbox/types.js +5 -0
  35. package/{dist/chip → chip}/Chip.js +17 -61
  36. package/{dist/chip → chip}/index.d.ts +0 -0
  37. package/{dist/common → common}/OpenSans.css +0 -0
  38. package/{dist/common → common}/RequiredComponent.js +3 -11
  39. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  40. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  41. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  42. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  43. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  44. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  45. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  46. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  47. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  48. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  49. package/{dist/common → common}/utils.js +0 -0
  50. package/{dist/common → common}/variables.js +40 -45
  51. package/{dist/date → date}/Date.js +16 -22
  52. package/{dist/date → date}/index.d.ts +0 -0
  53. package/date-input/DateInput.d.ts +4 -0
  54. package/{dist/date-input → date-input}/DateInput.js +22 -61
  55. package/date-input/types.d.ts +100 -0
  56. package/date-input/types.js +5 -0
  57. package/{dist/dialog → dialog}/Dialog.js +16 -50
  58. package/{dist/dialog → dialog}/index.d.ts +0 -0
  59. package/{dist/dropdown → dropdown}/Dropdown.js +37 -131
  60. package/{dist/dropdown → dropdown}/index.d.ts +0 -0
  61. package/{dist/file-input → file-input}/FileInput.js +49 -161
  62. package/{dist/file-input → file-input}/FileItem.js +29 -123
  63. package/{dist/file-input → file-input}/index.d.ts +0 -0
  64. package/{dist/footer → footer}/Footer.js +34 -158
  65. package/{dist/footer → footer}/Icons.js +13 -13
  66. package/{dist/footer → footer}/index.d.ts +0 -0
  67. package/{dist/header → header}/Header.js +35 -179
  68. package/{dist/header → header}/Icons.js +11 -11
  69. package/{dist/header → header}/index.d.ts +0 -0
  70. package/{dist/heading → heading}/Heading.js +18 -72
  71. package/{dist/heading → heading}/index.d.ts +0 -0
  72. package/{dist/input-text → input-text}/Icons.js +2 -2
  73. package/{dist/input-text → input-text}/InputText.js +36 -130
  74. package/{dist/input-text → input-text}/index.d.ts +1 -1
  75. package/{dist/layout → layout}/ApplicationLayout.js +31 -123
  76. package/{dist/layout → layout}/Icons.js +7 -7
  77. package/{dist/link → link}/Link.js +18 -72
  78. package/{dist/link → link}/index.d.ts +0 -0
  79. package/main.d.ts +44 -0
  80. package/{dist/main.js → main.js} +91 -87
  81. package/{dist/number-input → number-input}/NumberInput.js +5 -13
  82. package/{dist/number-input → number-input}/NumberInputContext.js +1 -1
  83. package/{dist/number-input → number-input}/index.d.ts +0 -0
  84. package/package.json +20 -17
  85. package/{dist/paginator → paginator}/Icons.js +9 -9
  86. package/paginator/Paginator.d.ts +4 -0
  87. package/{dist/paginator → paginator}/Paginator.js +24 -131
  88. package/paginator/types.d.ts +38 -0
  89. package/paginator/types.js +5 -0
  90. package/{dist/password-input → password-input}/PasswordInput.js +17 -21
  91. package/password-input/PasswordInput.stories.jsx +131 -0
  92. package/{dist/password-input → password-input}/index.d.ts +0 -0
  93. package/progress-bar/ProgressBar.d.ts +4 -0
  94. package/{dist/progress-bar → progress-bar}/ProgressBar.js +19 -91
  95. package/progress-bar/types.d.ts +37 -0
  96. package/progress-bar/types.js +5 -0
  97. package/radio/Radio.d.ts +4 -0
  98. package/{dist/radio → radio}/Radio.js +15 -50
  99. package/radio/types.d.ts +54 -0
  100. package/radio/types.js +5 -0
  101. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +35 -119
  102. package/{dist/resultsetTable → resultsetTable}/index.d.ts +0 -0
  103. package/{dist/select → select}/Select.js +248 -479
  104. package/select/index.d.ts +131 -0
  105. package/{dist/sidenav → sidenav}/Sidenav.js +15 -49
  106. package/{dist/sidenav → sidenav}/index.d.ts +0 -0
  107. package/slider/Slider.d.ts +4 -0
  108. package/{dist/slider → slider}/Slider.js +45 -143
  109. package/slider/types.d.ts +83 -0
  110. package/slider/types.js +5 -0
  111. package/{dist/spinner → spinner}/Spinner.js +38 -152
  112. package/{dist/spinner → spinner}/index.d.ts +0 -0
  113. package/switch/Switch.d.ts +4 -0
  114. package/{dist/switch → switch}/Switch.js +26 -69
  115. package/switch/types.d.ts +58 -0
  116. package/switch/types.js +5 -0
  117. package/{dist/table → table}/Table.js +10 -24
  118. package/{dist/table → table}/index.d.ts +0 -0
  119. package/{dist/tabs → tabs}/Tabs.js +26 -110
  120. package/{dist/tabs → tabs}/index.d.ts +0 -0
  121. package/{dist/tag → tag}/Tag.js +22 -96
  122. package/{dist/tag → tag}/index.d.ts +0 -0
  123. package/{dist/text-input → text-input}/TextInput.js +241 -390
  124. package/{dist/text-input → text-input}/index.d.ts +0 -0
  125. package/{dist/textarea → textarea}/Textarea.js +20 -72
  126. package/textarea/Textarea.stories.jsx +135 -0
  127. package/{dist/textarea → textarea}/index.d.ts +0 -0
  128. package/{dist/toggle → toggle}/Toggle.js +15 -49
  129. package/{dist/toggle → toggle}/index.d.ts +0 -0
  130. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +23 -107
  131. package/{dist/toggle-group → toggle-group}/index.d.ts +0 -0
  132. package/{dist/upload → upload}/Upload.js +11 -15
  133. package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +13 -37
  134. package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
  135. package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
  136. package/{dist/upload → upload}/dragAndDropArea/Icons.js +6 -6
  137. package/upload/file-upload/FileToUpload.js +115 -0
  138. package/{dist/upload → upload}/file-upload/Icons.js +13 -13
  139. package/{dist/upload → upload}/files-upload/FilesToUpload.js +12 -26
  140. package/{dist/upload → upload}/index.d.ts +0 -0
  141. package/{dist/upload → upload}/transaction/Icons.js +31 -31
  142. package/upload/transaction/Transaction.js +104 -0
  143. package/upload/transactions/Transactions.js +94 -0
  144. package/{dist/useTheme.js → useTheme.js} +0 -0
  145. package/{dist/wizard → wizard}/Icons.js +8 -8
  146. package/{dist/wizard → wizard}/Wizard.js +31 -165
  147. package/{dist/wizard → wizard}/index.d.ts +0 -0
  148. package/README.md +0 -66
  149. package/babel.config.js +0 -7
  150. package/dist/BackgroundColorContext.js +0 -46
  151. package/dist/ThemeContext.js +0 -250
  152. package/dist/accordion/index.d.ts +0 -28
  153. package/dist/accordion-group/AccordionGroup.js +0 -186
  154. package/dist/accordion-group/index.d.ts +0 -16
  155. package/dist/alert/index.d.ts +0 -51
  156. package/dist/badge/Badge.js +0 -63
  157. package/dist/button/Button.stories.js +0 -27
  158. package/dist/button/index.d.ts +0 -24
  159. package/dist/card/index.d.ts +0 -22
  160. package/dist/checkbox/index.d.ts +0 -24
  161. package/dist/date-input/index.d.ts +0 -95
  162. package/dist/main.d.ts +0 -40
  163. package/dist/paginator/index.d.ts +0 -20
  164. package/dist/progress-bar/index.d.ts +0 -18
  165. package/dist/radio/index.d.ts +0 -23
  166. package/dist/select/index.d.ts +0 -53
  167. package/dist/slider/index.d.ts +0 -29
  168. package/dist/switch/index.d.ts +0 -24
  169. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  170. package/dist/upload/file-upload/FileToUpload.js +0 -189
  171. package/dist/upload/transaction/Transaction.js +0 -148
  172. package/dist/upload/transactions/Transactions.js +0 -138
  173. package/test/Accordion.test.js +0 -33
  174. package/test/AccordionGroup.test.js +0 -125
  175. package/test/Alert.test.js +0 -53
  176. package/test/Box.test.js +0 -10
  177. package/test/Button.test.js +0 -18
  178. package/test/Card.test.js +0 -30
  179. package/test/Checkbox.test.js +0 -45
  180. package/test/Chip.test.js +0 -25
  181. package/test/Date.test.js +0 -395
  182. package/test/DateInput.test.js +0 -242
  183. package/test/Dialog.test.js +0 -23
  184. package/test/Dropdown.test.js +0 -145
  185. package/test/FileInput.test.js +0 -201
  186. package/test/Footer.test.js +0 -94
  187. package/test/Header.test.js +0 -34
  188. package/test/Heading.test.js +0 -83
  189. package/test/InputText.test.js +0 -239
  190. package/test/Link.test.js +0 -43
  191. package/test/NumberInput.test.js +0 -259
  192. package/test/Paginator.test.js +0 -181
  193. package/test/PasswordInput.test.js +0 -83
  194. package/test/ProgressBar.test.js +0 -35
  195. package/test/Radio.test.js +0 -37
  196. package/test/ResultsetTable.test.js +0 -330
  197. package/test/Select.test.js +0 -415
  198. package/test/Sidenav.test.js +0 -45
  199. package/test/Slider.test.js +0 -74
  200. package/test/Spinner.test.js +0 -32
  201. package/test/Switch.test.js +0 -45
  202. package/test/Table.test.js +0 -36
  203. package/test/Tabs.test.js +0 -109
  204. package/test/Tag.test.js +0 -32
  205. package/test/TextInput.test.js +0 -732
  206. package/test/Textarea.test.js +0 -193
  207. package/test/ToggleGroup.test.js +0 -85
  208. package/test/Upload.test.js +0 -60
  209. package/test/V3Select.test.js +0 -212
  210. package/test/V3TextArea.test.js +0 -51
  211. package/test/Wizard.test.js +0 -130
  212. package/test/mocks/pngMock.js +0 -1
  213. package/test/mocks/svgMock.js +0 -1
@@ -1,130 +0,0 @@
1
- import React from "react";
2
- import { render, fireEvent } from "@testing-library/react";
3
- import DxcWizard from "../src/wizard/Wizard";
4
-
5
- describe("Wizard components tests", () => {
6
- test("Wizard renders with correct steps", () => {
7
- const { getByText } = render(
8
- <DxcWizard
9
- steps={[
10
- {
11
- label: "first-step",
12
- },
13
- {
14
- label: "second-step",
15
- },
16
- ]}
17
- ></DxcWizard>
18
- );
19
-
20
- expect(getByText("first-step")).toBeTruthy();
21
- expect(getByText("second-step")).toBeTruthy();
22
- });
23
-
24
- test("Click on step text", () => {
25
- const onClick = jest.fn();
26
- const { getByText } = render(
27
- <DxcWizard
28
- onStepClick={onClick}
29
- steps={[
30
- {
31
- label: "first-step",
32
- },
33
- ]}
34
- ></DxcWizard>
35
- );
36
-
37
- const step = getByText("first-step");
38
- fireEvent.click(step);
39
- expect(onClick).toHaveBeenCalled();
40
- });
41
-
42
- test("Click on step description", () => {
43
- const onClick = jest.fn();
44
- const { getByText } = render(
45
- <DxcWizard
46
- onStepClick={onClick}
47
- steps={[
48
- {
49
- label: "first-step",
50
- description: "step-description",
51
- },
52
- ]}
53
- ></DxcWizard>
54
- );
55
-
56
- const step = getByText("step-description");
57
- fireEvent.click(step);
58
- expect(onClick).toHaveBeenCalled();
59
- });
60
-
61
- test("Click on step number", () => {
62
- const onClick = jest.fn();
63
- const { getByText } = render(
64
- <DxcWizard
65
- onStepClick={onClick}
66
- steps={[
67
- {
68
- label: "first-step",
69
- },
70
- ]}
71
- ></DxcWizard>
72
- );
73
-
74
- const step = getByText("1");
75
- fireEvent.click(step);
76
- expect(onClick).toHaveBeenCalled();
77
- });
78
-
79
- test("Click on disable step", () => {
80
- const onClick = jest.fn();
81
- const { getByText } = render(
82
- <DxcWizard
83
- onStepClick={onClick}
84
- steps={[
85
- {
86
- label: "first-step",
87
- },
88
- {
89
- label: "second-step",
90
- disabled: true,
91
- },
92
- ]}
93
- ></DxcWizard>
94
- );
95
-
96
- const step = getByText("second-step");
97
- fireEvent.click(step);
98
- expect(onClick).toHaveBeenCalledTimes(0);
99
- });
100
-
101
- test("Controlled wizard function is called", () => {
102
- const onClick = jest.fn((i) => i);
103
- const { getByText } = render(
104
- <DxcWizard
105
- currentStep={1}
106
- onStepClick={onClick}
107
- steps={[
108
- {
109
- label: "first-step",
110
- },
111
- {
112
- label: "second-step",
113
- },
114
- ]}
115
- ></DxcWizard>
116
- );
117
-
118
- const step1 = getByText("first-step");
119
- const step2 = getByText("second-step");
120
- fireEvent.click(step1);
121
- fireEvent.click(step2);
122
- fireEvent.click(step1);
123
-
124
- expect(onClick).toHaveBeenCalledTimes(3);
125
- //Test the received value in the onClick function
126
- expect(onClick).toHaveBeenNthCalledWith(1, 0);
127
- expect(onClick).toHaveBeenNthCalledWith(2, 1);
128
- expect(onClick).toHaveBeenNthCalledWith(3, 0);
129
- });
130
- });
@@ -1 +0,0 @@
1
- module.exports = 'ImageMock';
@@ -1 +0,0 @@
1
- module.exports = 'IconMock';