@dxc-technology/halstack-react 0.0.0-0355f44 → 0.0.0-03ecaeb

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 (348) hide show
  1. package/BackgroundColorContext.js +50 -0
  2. package/ThemeContext.js +246 -0
  3. package/{dist/select/Select.js → V3Select/V3Select.js} +38 -132
  4. package/V3Select/index.d.ts +27 -0
  5. package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +14 -18
  6. package/V3Textarea/index.d.ts +27 -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/Alert.stories.tsx +170 -0
  18. package/alert/types.d.ts +49 -0
  19. package/alert/types.js +5 -0
  20. package/badge/Badge.js +59 -0
  21. package/box/Box.d.ts +4 -0
  22. package/{dist/box → box}/Box.js +13 -43
  23. package/box/Box.stories.tsx +132 -0
  24. package/box/types.d.ts +43 -0
  25. package/box/types.js +5 -0
  26. package/button/Button.d.ts +4 -0
  27. package/{dist/button → button}/Button.js +23 -82
  28. package/button/Button.stories.tsx +276 -0
  29. package/button/types.d.ts +57 -0
  30. package/button/types.js +5 -0
  31. package/card/Card.d.ts +4 -0
  32. package/{dist/card → card}/Card.js +33 -123
  33. package/card/Card.stories.tsx +201 -0
  34. package/card/ice-cream.jpg +0 -0
  35. package/card/types.d.ts +67 -0
  36. package/card/types.js +5 -0
  37. package/checkbox/Checkbox.d.ts +4 -0
  38. package/{dist/checkbox → checkbox}/Checkbox.js +16 -63
  39. package/checkbox/Checkbox.stories.tsx +192 -0
  40. package/checkbox/types.d.ts +60 -0
  41. package/checkbox/types.js +5 -0
  42. package/{dist/chip → chip}/Chip.js +17 -61
  43. package/chip/Chip.stories.tsx +121 -0
  44. package/chip/index.d.ts +22 -0
  45. package/{dist/common → common}/OpenSans.css +0 -0
  46. package/{dist/common → common}/RequiredComponent.js +3 -11
  47. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  48. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  49. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  50. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  51. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  52. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  53. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  54. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  55. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  56. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  57. package/{dist/common → common}/utils.js +0 -0
  58. package/{dist/common → common}/variables.js +165 -157
  59. package/{dist/date → date}/Date.js +21 -27
  60. package/date/index.d.ts +27 -0
  61. package/date-input/DateInput.d.ts +4 -0
  62. package/{dist/date-input → date-input}/DateInput.js +22 -61
  63. package/date-input/DateInput.stories.tsx +138 -0
  64. package/date-input/types.d.ts +100 -0
  65. package/date-input/types.js +5 -0
  66. package/dialog/Dialog.d.ts +4 -0
  67. package/{dist/dialog → dialog}/Dialog.js +20 -73
  68. package/dialog/Dialog.stories.tsx +212 -0
  69. package/dialog/types.d.ts +43 -0
  70. package/dialog/types.js +5 -0
  71. package/dropdown/Dropdown.d.ts +4 -0
  72. package/{dist/dropdown → dropdown}/Dropdown.js +44 -171
  73. package/dropdown/types.d.ts +89 -0
  74. package/dropdown/types.js +5 -0
  75. package/file-input/FileInput.d.ts +4 -0
  76. package/{dist/file-input → file-input}/FileInput.js +56 -189
  77. package/file-input/FileItem.d.ts +14 -0
  78. package/file-input/FileItem.js +182 -0
  79. package/file-input/types.d.ts +87 -0
  80. package/file-input/types.js +5 -0
  81. package/footer/Footer.d.ts +4 -0
  82. package/footer/Footer.js +266 -0
  83. package/footer/Footer.stories.jsx +151 -0
  84. package/footer/Icons.js +77 -0
  85. package/footer/types.d.ts +61 -0
  86. package/footer/types.js +5 -0
  87. package/header/Header.d.ts +7 -0
  88. package/header/Header.js +324 -0
  89. package/header/Header.stories.tsx +162 -0
  90. package/header/Icons.js +34 -0
  91. package/header/types.d.ts +47 -0
  92. package/header/types.js +5 -0
  93. package/heading/Heading.d.ts +4 -0
  94. package/{dist/heading → heading}/Heading.js +30 -89
  95. package/heading/Heading.stories.tsx +53 -0
  96. package/heading/types.d.ts +33 -0
  97. package/heading/types.js +5 -0
  98. package/input-text/Icons.js +22 -0
  99. package/{dist/input-text → input-text}/InputText.js +37 -133
  100. package/input-text/index.d.ts +36 -0
  101. package/{dist/layout → layout}/ApplicationLayout.js +35 -131
  102. package/layout/Icons.js +55 -0
  103. package/link/Link.d.ts +3 -0
  104. package/{dist/link → link}/Link.js +18 -94
  105. package/link/Link.stories.tsx +146 -0
  106. package/link/types.d.ts +74 -0
  107. package/link/types.js +5 -0
  108. package/main.d.ts +44 -0
  109. package/{dist/main.js → main.js} +95 -99
  110. package/number-input/NumberInput.d.ts +4 -0
  111. package/number-input/NumberInput.js +86 -0
  112. package/number-input/NumberInput.stories.tsx +115 -0
  113. package/number-input/NumberInputContext.d.ts +4 -0
  114. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  115. package/number-input/numberInputContextTypes.d.ts +19 -0
  116. package/number-input/numberInputContextTypes.js +5 -0
  117. package/number-input/types.d.ts +117 -0
  118. package/number-input/types.js +5 -0
  119. package/package.json +32 -25
  120. package/paginator/Icons.js +66 -0
  121. package/paginator/Paginator.d.ts +4 -0
  122. package/paginator/Paginator.js +198 -0
  123. package/paginator/Paginator.stories.tsx +63 -0
  124. package/paginator/types.d.ts +38 -0
  125. package/paginator/types.js +5 -0
  126. package/password-input/PasswordInput.d.ts +4 -0
  127. package/{dist/password-input → password-input}/PasswordInput.js +28 -62
  128. package/password-input/PasswordInput.stories.tsx +131 -0
  129. package/password-input/types.d.ts +107 -0
  130. package/password-input/types.js +5 -0
  131. package/progress-bar/ProgressBar.d.ts +4 -0
  132. package/{dist/progress-bar → progress-bar}/ProgressBar.js +20 -92
  133. package/progress-bar/ProgressBar.stories.jsx +58 -0
  134. package/progress-bar/types.d.ts +37 -0
  135. package/progress-bar/types.js +5 -0
  136. package/radio/Radio.d.ts +4 -0
  137. package/{dist/radio → radio}/Radio.js +15 -50
  138. package/radio/Radio.stories.tsx +192 -0
  139. package/radio/types.d.ts +54 -0
  140. package/radio/types.js +5 -0
  141. package/resultsetTable/ResultsetTable.d.ts +4 -0
  142. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +38 -145
  143. package/resultsetTable/types.d.ts +67 -0
  144. package/resultsetTable/types.js +5 -0
  145. package/select/Select.js +865 -0
  146. package/select/Select.stories.tsx +572 -0
  147. package/select/index.d.ts +131 -0
  148. package/sidenav/Sidenav.d.ts +9 -0
  149. package/{dist/sidenav → sidenav}/Sidenav.js +19 -62
  150. package/sidenav/Sidenav.stories.tsx +165 -0
  151. package/sidenav/types.d.ts +50 -0
  152. package/sidenav/types.js +5 -0
  153. package/slider/Slider.d.ts +4 -0
  154. package/{dist/slider → slider}/Slider.js +76 -153
  155. package/slider/Slider.stories.tsx +177 -0
  156. package/slider/types.d.ts +78 -0
  157. package/slider/types.js +5 -0
  158. package/spinner/Spinner.d.ts +4 -0
  159. package/spinner/Spinner.js +250 -0
  160. package/spinner/Spinner.stories.jsx +102 -0
  161. package/spinner/types.d.ts +32 -0
  162. package/spinner/types.js +5 -0
  163. package/switch/Switch.d.ts +4 -0
  164. package/{dist/switch → switch}/Switch.js +26 -69
  165. package/switch/Switch.stories.tsx +160 -0
  166. package/switch/types.d.ts +58 -0
  167. package/switch/types.js +5 -0
  168. package/table/Table.d.ts +4 -0
  169. package/{dist/table → table}/Table.js +10 -24
  170. package/table/Table.stories.jsx +276 -0
  171. package/table/types.d.ts +21 -0
  172. package/table/types.js +5 -0
  173. package/tabs/Tabs.d.ts +4 -0
  174. package/tabs/Tabs.js +213 -0
  175. package/tabs/Tabs.stories.tsx +121 -0
  176. package/tabs/types.d.ts +70 -0
  177. package/tabs/types.js +5 -0
  178. package/tag/Tag.d.ts +4 -0
  179. package/tag/Tag.js +193 -0
  180. package/tag/Tag.stories.tsx +145 -0
  181. package/tag/types.d.ts +60 -0
  182. package/tag/types.js +5 -0
  183. package/text-input/TextInput.d.ts +4 -0
  184. package/{dist/text-input → text-input}/TextInput.js +258 -443
  185. package/text-input/types.d.ts +159 -0
  186. package/text-input/types.js +5 -0
  187. package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +36 -89
  188. package/textarea/Textarea.stories.jsx +135 -0
  189. package/{dist/new-textarea → textarea}/index.d.ts +19 -9
  190. package/{dist/toggle → toggle}/Toggle.js +15 -49
  191. package/toggle/index.d.ts +21 -0
  192. package/toggle-group/ToggleGroup.d.ts +4 -0
  193. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +28 -138
  194. package/toggle-group/ToggleGroup.stories.tsx +178 -0
  195. package/toggle-group/types.d.ts +84 -0
  196. package/toggle-group/types.js +5 -0
  197. package/{dist/upload → upload}/Upload.js +14 -18
  198. package/upload/buttons-upload/ButtonsUpload.js +111 -0
  199. package/upload/buttons-upload/Icons.js +40 -0
  200. package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
  201. package/upload/dragAndDropArea/Icons.js +39 -0
  202. package/upload/file-upload/FileToUpload.js +115 -0
  203. package/upload/file-upload/Icons.js +66 -0
  204. package/{dist/upload → upload}/files-upload/FilesToUpload.js +12 -26
  205. package/upload/index.d.ts +15 -0
  206. package/upload/transaction/Icons.js +160 -0
  207. package/upload/transaction/Transaction.js +104 -0
  208. package/upload/transactions/Transactions.js +94 -0
  209. package/{dist/useTheme.js → useTheme.js} +0 -0
  210. package/wizard/Icons.js +65 -0
  211. package/wizard/Wizard.d.ts +4 -0
  212. package/{dist/wizard → wizard}/Wizard.js +33 -213
  213. package/wizard/Wizard.stories.jsx +224 -0
  214. package/wizard/types.d.ts +64 -0
  215. package/wizard/types.js +5 -0
  216. package/README.md +0 -66
  217. package/babel.config.js +0 -8
  218. package/dist/BackgroundColorContext.js +0 -46
  219. package/dist/ThemeContext.js +0 -248
  220. package/dist/accordion-group/AccordionGroup.js +0 -186
  221. package/dist/alert/index.d.ts +0 -51
  222. package/dist/badge/Badge.js +0 -63
  223. package/dist/checkbox/Checkbox.stories.js +0 -144
  224. package/dist/checkbox/readme.md +0 -116
  225. package/dist/date/Date.stories.js +0 -205
  226. package/dist/date/readme.md +0 -73
  227. package/dist/date-input/index.d.ts +0 -95
  228. package/dist/file-input/FileItem.js +0 -280
  229. package/dist/file-input/index.d.ts +0 -81
  230. package/dist/footer/Footer.js +0 -395
  231. package/dist/footer/dxc_logo.svg +0 -15
  232. package/dist/footer/readme.md +0 -41
  233. package/dist/header/Header.js +0 -403
  234. package/dist/header/Header.stories.js +0 -176
  235. package/dist/header/close_icon.svg +0 -1
  236. package/dist/header/dxc_logo_black.svg +0 -8
  237. package/dist/header/hamb_menu_black.svg +0 -1
  238. package/dist/header/hamb_menu_white.svg +0 -1
  239. package/dist/header/readme.md +0 -33
  240. package/dist/input-text/error.svg +0 -1
  241. package/dist/input-text/readme.md +0 -91
  242. package/dist/layout/facebook.svg +0 -45
  243. package/dist/layout/linkedin.svg +0 -50
  244. package/dist/layout/twitter.svg +0 -53
  245. package/dist/link/readme.md +0 -51
  246. package/dist/main.d.ts +0 -8
  247. package/dist/new-select/NewSelect.js +0 -836
  248. package/dist/new-select/index.d.ts +0 -53
  249. package/dist/number-input/NumberInput.js +0 -136
  250. package/dist/number-input/index.d.ts +0 -113
  251. package/dist/paginator/Paginator.js +0 -289
  252. package/dist/paginator/images/next.svg +0 -3
  253. package/dist/paginator/images/nextPage.svg +0 -3
  254. package/dist/paginator/images/previous.svg +0 -3
  255. package/dist/paginator/images/previousPage.svg +0 -3
  256. package/dist/paginator/readme.md +0 -50
  257. package/dist/password-input/index.d.ts +0 -94
  258. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  259. package/dist/progress-bar/readme.md +0 -63
  260. package/dist/radio/Radio.stories.js +0 -166
  261. package/dist/radio/readme.md +0 -70
  262. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  263. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  264. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  265. package/dist/slider/readme.md +0 -64
  266. package/dist/spinner/Spinner.js +0 -381
  267. package/dist/spinner/Spinner.stories.js +0 -183
  268. package/dist/spinner/readme.md +0 -65
  269. package/dist/switch/Switch.stories.js +0 -134
  270. package/dist/switch/readme.md +0 -133
  271. package/dist/tabs/Tabs.js +0 -343
  272. package/dist/tabs/Tabs.stories.js +0 -130
  273. package/dist/tabs/readme.md +0 -78
  274. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  275. package/dist/tabs-for-sections/readme.md +0 -78
  276. package/dist/tag/Tag.js +0 -282
  277. package/dist/text-input/index.d.ts +0 -135
  278. package/dist/toggle/Toggle.stories.js +0 -297
  279. package/dist/toggle/readme.md +0 -80
  280. package/dist/upload/Upload.stories.js +0 -72
  281. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -139
  282. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  283. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  284. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  285. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  286. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  287. package/dist/upload/file-upload/FileToUpload.js +0 -184
  288. package/dist/upload/file-upload/audio-icon.svg +0 -4
  289. package/dist/upload/file-upload/close.svg +0 -4
  290. package/dist/upload/file-upload/file-icon.svg +0 -4
  291. package/dist/upload/file-upload/video-icon.svg +0 -4
  292. package/dist/upload/readme.md +0 -37
  293. package/dist/upload/transaction/Transaction.js +0 -175
  294. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  295. package/dist/upload/transaction/audio-icon.svg +0 -4
  296. package/dist/upload/transaction/error-icon.svg +0 -4
  297. package/dist/upload/transaction/file-icon-err.svg +0 -4
  298. package/dist/upload/transaction/file-icon.svg +0 -4
  299. package/dist/upload/transaction/image-icon-err.svg +0 -4
  300. package/dist/upload/transaction/image-icon.svg +0 -4
  301. package/dist/upload/transaction/success-icon.svg +0 -4
  302. package/dist/upload/transaction/video-icon-err.svg +0 -4
  303. package/dist/upload/transaction/video-icon.svg +0 -4
  304. package/dist/upload/transactions/Transactions.js +0 -138
  305. package/dist/wizard/invalid_icon.svg +0 -5
  306. package/dist/wizard/valid_icon.svg +0 -5
  307. package/dist/wizard/validation-wrong.svg +0 -6
  308. package/test/Accordion.test.js +0 -33
  309. package/test/AccordionGroup.test.js +0 -125
  310. package/test/Alert.test.js +0 -53
  311. package/test/Box.test.js +0 -10
  312. package/test/Button.test.js +0 -18
  313. package/test/Card.test.js +0 -30
  314. package/test/Checkbox.test.js +0 -45
  315. package/test/Chip.test.js +0 -25
  316. package/test/Date.test.js +0 -397
  317. package/test/DateInput.test.js +0 -242
  318. package/test/Dialog.test.js +0 -23
  319. package/test/Dropdown.test.js +0 -145
  320. package/test/FileInput.test.js +0 -201
  321. package/test/Footer.test.js +0 -99
  322. package/test/Header.test.js +0 -39
  323. package/test/Heading.test.js +0 -35
  324. package/test/InputText.test.js +0 -248
  325. package/test/Link.test.js +0 -43
  326. package/test/NewTextarea.test.js +0 -195
  327. package/test/NumberInput.test.js +0 -259
  328. package/test/Paginator.test.js +0 -177
  329. package/test/PasswordInput.test.js +0 -83
  330. package/test/ProgressBar.test.js +0 -35
  331. package/test/Radio.test.js +0 -37
  332. package/test/ResultsetTable.test.js +0 -329
  333. package/test/Select.test.js +0 -212
  334. package/test/Sidenav.test.js +0 -45
  335. package/test/Slider.test.js +0 -82
  336. package/test/Spinner.test.js +0 -32
  337. package/test/Switch.test.js +0 -45
  338. package/test/Table.test.js +0 -36
  339. package/test/Tabs.test.js +0 -109
  340. package/test/TabsForSections.test.js +0 -34
  341. package/test/Tag.test.js +0 -32
  342. package/test/TextArea.test.js +0 -52
  343. package/test/TextInput.test.js +0 -732
  344. package/test/ToggleGroup.test.js +0 -85
  345. package/test/Upload.test.js +0 -60
  346. package/test/Wizard.test.js +0 -130
  347. package/test/mocks/pngMock.js +0 -1
  348. package/test/mocks/svgMock.js +0 -1
@@ -1,81 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type FileData = {
10
- error?: string;
11
- file?: File;
12
- preview?: string;
13
- };
14
-
15
- type Props = {
16
- /**
17
- * Name attribute of the file input element.
18
- */
19
- name?: string;
20
- /**
21
- * Text to be placed above the file input.
22
- */
23
- label?: string;
24
- /**
25
- * Uses one of the available file input modes:
26
- * 'file': Files are selected by clicking the button and selecting it through the file explorer.
27
- * 'filedrop': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
28
- * 'dropzone': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
29
- * The drag and drop area of this mode is bigger than the one of the filedrop mode.
30
- */
31
- mode?: "file" | "filedrop" | "dropzone";
32
- /**
33
- * Helper text to be placed above the file input.
34
- */
35
- helperText?: string;
36
- /**
37
- * Defines the file types accepted by the component. It is not possible to select a file with a non valid type.
38
- */
39
- accept?: string;
40
- /**
41
- * An array of FileData representing the selected files.
42
- */
43
- value?: FileData[];
44
- /**
45
- * Minimum file size allowed (in bytes). If the file size does not comply the minSize, an error will be passed to the FileData.
46
- */
47
- minSize?: number;
48
- /**
49
- * Maximum file size allowed (in bytes). If the file size does not comply the maxSize, an error will be passed to the FileData.
50
- */
51
- maxSize?: number;
52
- /**
53
- * If true and if the file is an image, a preview of it will be shown. If it is not an image, an icon refering to the file's type will be shown.
54
- * If mode is not multiple and there is one file already selected, the file will be replaced by the last selected one.
55
- */
56
- showPreview?: boolean;
57
- /**
58
- * If true, more than one file can be selected. If false, only one file can be selected.
59
- */
60
- multiple?: boolean;
61
- /**
62
- * If true, the component will be disabled.
63
- */
64
- disabled?: boolean;
65
- /**
66
- * This function will be called when the user selects or drops a file. The list of files will be sent as a parameter.
67
- * In this function, the files can be updated or returned as they come. These files must be passed to the value in order to be shown.
68
- */
69
- callbackFile?: (files: FileData[]) => void;
70
- /**
71
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
72
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
73
- */
74
- margin?: Space | Margin;
75
- /**
76
- * Value of the tabindex attribute.
77
- */
78
- tabIndex?: number;
79
- };
80
-
81
- export default function DxcTextInput(props: Props): JSX.Element;
@@ -1,395 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
17
-
18
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
-
20
- var _react = _interopRequireWildcard(require("react"));
21
-
22
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
-
24
- var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
- var _variables = require("../common/variables.js");
27
-
28
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
29
-
30
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
31
-
32
- function _templateObject12() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
34
-
35
- _templateObject12 = function _templateObject12() {
36
- return data;
37
- };
38
-
39
- return data;
40
- }
41
-
42
- function _templateObject11() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px 10px;\n color: ", ";\n"]);
44
-
45
- _templateObject11 = function _templateObject11() {
46
- return data;
47
- };
48
-
49
- return data;
50
- }
51
-
52
- function _templateObject10() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n height: ", ";\n width: ", ";\n color: ", ";\n }\n\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
54
-
55
- _templateObject10 = function _templateObject10() {
56
- return data;
57
- };
58
-
59
- return data;
60
- }
61
-
62
- function _templateObject9() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n height: ", ";\n width: ", ";\n fill: ", ";\n }\n"]);
64
-
65
- _templateObject9 = function _templateObject9() {
66
- return data;
67
- };
68
-
69
- return data;
70
- }
71
-
72
- function _templateObject8() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n margin-left: ", ";\n }\n"]);
74
-
75
- _templateObject8 = function _templateObject8() {
76
- return data;
77
- };
78
-
79
- return data;
80
- }
81
-
82
- function _templateObject7() {
83
- var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: ", ";\n width: ", ";\n"]);
84
-
85
- _templateObject7 = function _templateObject7() {
86
- return data;
87
- };
88
-
89
- return data;
90
- }
91
-
92
- function _templateObject6() {
93
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n max-width: ", ";\n width: ", ";\n text-align: ", ";\n padding-top: ", ";\n"]);
94
-
95
- _templateObject6 = function _templateObject6() {
96
- return data;
97
- };
98
-
99
- return data;
100
- }
101
-
102
- function _templateObject5() {
103
- var data = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 15px;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"]);
104
-
105
- _templateObject5 = function _templateObject5() {
106
- return data;
107
- };
108
-
109
- return data;
110
- }
111
-
112
- function _templateObject4() {
113
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n display: inline-flex;\n flex-wrap: wrap;\n max-width: ", ";\n width: ", ";\n & > span:last-child span {\n display: none;\n }\n margin: ", ";\n"]);
114
-
115
- _templateObject4 = function _templateObject4() {
116
- return data;
117
- };
118
-
119
- return data;
120
- }
121
-
122
- function _templateObject3() {
123
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n flex-direction: ", ";\n align-items: ", ";\n border-top: ", ";\n"]);
124
-
125
- _templateObject3 = function _templateObject3() {
126
- return data;
127
- };
128
-
129
- return data;
130
- }
131
-
132
- function _templateObject2() {
133
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n"]);
134
-
135
- _templateObject2 = function _templateObject2() {
136
- return data;
137
- };
138
-
139
- return data;
140
- }
141
-
142
- function _templateObject() {
143
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n background-color: ", ";\n margin-top: ", ";\n width: 100%;\n box-sizing: border-box;\n min-height: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"]);
144
-
145
- _templateObject = function _templateObject() {
146
- return data;
147
- };
148
-
149
- return data;
150
- }
151
-
152
- var DxcFooter = function DxcFooter(_ref) {
153
- var _ref$socialLinks = _ref.socialLinks,
154
- socialLinks = _ref$socialLinks === void 0 ? [] : _ref$socialLinks,
155
- _ref$bottomLinks = _ref.bottomLinks,
156
- bottomLinks = _ref$bottomLinks === void 0 ? [] : _ref$bottomLinks,
157
- _ref$copyright = _ref.copyright,
158
- copyright = _ref$copyright === void 0 ? "" : _ref$copyright,
159
- _ref$logoSrc = _ref.logoSrc,
160
- logoSrc = _ref$logoSrc === void 0 ? "default" : _ref$logoSrc,
161
- children = _ref.children,
162
- padding = _ref.padding,
163
- margin = _ref.margin,
164
- _ref$tabIndex = _ref.tabIndex,
165
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
166
- var ref = (0, _react.useRef)(null);
167
-
168
- var _useState = (0, _react.useState)(),
169
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
170
- refSize = _useState2[0],
171
- setRefSize = _useState2[1];
172
-
173
- var _useState3 = (0, _react.useState)(false),
174
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
175
- isResponsiveTablet = _useState4[0],
176
- setIsResponsiveTablet = _useState4[1];
177
-
178
- var _useState5 = (0, _react.useState)(false),
179
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
180
- isResponsivePhone = _useState6[0],
181
- setIsResponsivePhone = _useState6[1];
182
-
183
- var colorsTheme = (0, _useTheme["default"])();
184
-
185
- var handleResize = function handleResize(refWidth) {
186
- if (ref.current) {
187
- setRefSize(refWidth);
188
-
189
- if (refWidth <= _variables.responsiveSizes.tablet && refWidth > _variables.responsiveSizes.mobileLarge) {
190
- setIsResponsiveTablet(true);
191
- setIsResponsivePhone(false);
192
- } else if (refWidth <= _variables.responsiveSizes.tablet && refWidth <= _variables.responsiveSizes.mobileLarge) {
193
- setIsResponsivePhone(true);
194
- setIsResponsiveTablet(false);
195
- } else {
196
- setIsResponsiveTablet(false);
197
- setIsResponsivePhone(false);
198
- }
199
- }
200
- };
201
-
202
- var handleEventListener = function handleEventListener() {
203
- handleResize(ref.current.offsetWidth);
204
- };
205
-
206
- (0, _react.useEffect)(function () {
207
- window.addEventListener("resize", handleEventListener);
208
- handleResize(ref.current.offsetWidth);
209
- return function () {
210
- window.removeEventListener("resize", handleEventListener);
211
- };
212
- }, []);
213
- var socialLink = socialLinks.map(function (link, index) {
214
- return _react["default"].createElement(SocialAnchor, {
215
- tabIndex: tabIndex,
216
- key: "social".concat(index).concat(link.href),
217
- index: index,
218
- href: link && link.href ? link.href : ""
219
- }, link.logo ? _react["default"].createElement(SocialIconContainer, null, (0, _typeof2["default"])(link.logo) === "object" ? link.logo : _react["default"].createElement(link.logo)) : link && link.logoSrc && _react["default"].createElement(SocialIcon, {
220
- src: link.logoSrc
221
- }));
222
- });
223
- var bottomLink = bottomLinks.map(function (link, index) {
224
- return _react["default"].createElement("span", {
225
- key: "bottom".concat(index).concat(link.text)
226
- }, _react["default"].createElement(BottomLink, {
227
- tabIndex: tabIndex,
228
- href: link && link.href ? link.href : ""
229
- }, link && link.text ? link.text : ""), _react["default"].createElement(Point, {
230
- index: index
231
- }, "\xB7"));
232
- });
233
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
234
- theme: colorsTheme.footer
235
- }, _react["default"].createElement(FooterContainer, {
236
- margin: margin,
237
- refSize: refSize,
238
- ref: ref
239
- }, _react["default"].createElement(FooterHeader, null, _react["default"].createElement(LogoIcon, {
240
- logoSrc: logoSrc,
241
- src: logoSrc === "default" ? colorsTheme.footer.logo : logoSrc
242
- }), _react["default"].createElement("div", null, socialLink)), isResponsivePhone && _react["default"].createElement("div", null, _react["default"].createElement(FooterFooter, {
243
- className: "footerFooter",
244
- refSize: refSize
245
- }, _react["default"].createElement(BottomLinks, {
246
- refSize: refSize
247
- }, bottomLink), _react["default"].createElement(Copyright, {
248
- refSize: refSize
249
- }, copyright))), (!isResponsiveTablet && !isResponsivePhone || isResponsiveTablet) && _react["default"].createElement("div", null, _react["default"].createElement(ChildComponents, {
250
- padding: padding
251
- }, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
252
- color: colorsTheme.footer.backgroundColor
253
- }, children)), _react["default"].createElement(FooterFooter, {
254
- className: "footerFooter"
255
- }, _react["default"].createElement(BottomLinks, {
256
- refSize: refSize
257
- }, bottomLink), _react["default"].createElement(Copyright, {
258
- refSize: refSize
259
- }, copyright)))));
260
- };
261
-
262
- var FooterContainer = _styledComponents["default"].footer(_templateObject(), function (props) {
263
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "20px 20px 20px 20px" : "24px 36px 24px 36px";
264
- }, function (props) {
265
- return props.theme.backgroundColor;
266
- }, function (props) {
267
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
268
- }, function (props) {
269
- return props.theme.height;
270
- });
271
-
272
- var FooterHeader = _styledComponents["default"].div(_templateObject2());
273
-
274
- var FooterFooter = _styledComponents["default"].div(_templateObject3(), function (props) {
275
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "column" : "row";
276
- }, function (props) {
277
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "";
278
- }, function (props) {
279
- return "".concat(props.theme.bottomLinksDividerThickness, " ").concat(props.theme.bottomLinksDividerStyle, " ").concat(props.theme.bottomLinksDividerColor);
280
- });
281
-
282
- var BottomLinks = _styledComponents["default"].div(_templateObject4(), function (props) {
283
- return props.theme.bottomLinksDividerSpacing;
284
- }, function (props) {
285
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "60%";
286
- }, function (props) {
287
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
288
- }, function (props) {
289
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "40px 0 40px 0" : "";
290
- });
291
-
292
- var ChildComponents = _styledComponents["default"].div(_templateObject5(), function (props) {
293
- return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
294
- }, function (props) {
295
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
296
- }, function (props) {
297
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
298
- }, function (props) {
299
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
300
- }, function (props) {
301
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
302
- });
303
-
304
- var Copyright = _styledComponents["default"].div(_templateObject6(), function (props) {
305
- return props.theme.copyrightFontFamily;
306
- }, function (props) {
307
- return props.theme.copyrightFontSize;
308
- }, function (props) {
309
- return props.theme.copyrightFontStyle;
310
- }, function (props) {
311
- return props.theme.copyrightFontWeight;
312
- }, function (props) {
313
- return props.theme.copyrightFontColor;
314
- }, function (props) {
315
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "40%";
316
- }, function (props) {
317
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
318
- }, function (props) {
319
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "right";
320
- }, function (props) {
321
- return props.theme.bottomLinksDividerSpacing;
322
- });
323
-
324
- var LogoIcon = _styledComponents["default"].img(_templateObject7(), function (props) {
325
- return props.theme.logoHeight;
326
- }, function (props) {
327
- return props.theme.logoWidth;
328
- });
329
-
330
- var SocialAnchor = _styledComponents["default"].a(_templateObject8(), function (props) {
331
- return props.index === 0 ? "0px" : props.theme.socialLinksGutter;
332
- });
333
-
334
- var SocialIcon = _styledComponents["default"].img(_templateObject9(), function (props) {
335
- return props.theme.socialLinksSize;
336
- }, function (props) {
337
- return props.theme.socialLinksSize;
338
- }, function (props) {
339
- return props.theme.socialLinksColor;
340
- });
341
-
342
- var SocialIconContainer = _styledComponents["default"].div(_templateObject10(), function (props) {
343
- return props.theme.socialLinksSize;
344
- }, function (props) {
345
- return props.theme.socialLinksSize;
346
- }, function (props) {
347
- return props.theme.socialLinksColor;
348
- });
349
-
350
- var Point = _styledComponents["default"].span(_templateObject11(), function (props) {
351
- return props.theme.bottomLinksFontColor;
352
- });
353
-
354
- var BottomLink = _styledComponents["default"].a(_templateObject12(), function (props) {
355
- return props.theme.bottomLinksTextDecoration;
356
- }, function (props) {
357
- return props.theme.bottomLinksFontColor;
358
- }, function (props) {
359
- return props.theme.bottomLinksFontFamily;
360
- }, function (props) {
361
- return props.theme.bottomLinksFontSize;
362
- }, function (props) {
363
- return props.theme.bottomLinksFontStyle;
364
- }, function (props) {
365
- return props.theme.bottomLinksFontWeight;
366
- });
367
-
368
- DxcFooter.propTypes = {
369
- logoSrc: _propTypes["default"].string,
370
- socialLinks: _propTypes["default"].arrayOf(_propTypes["default"].shape({
371
- logo: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
372
- logoSrc: _propTypes["default"].string.isRequired,
373
- href: _propTypes["default"].string
374
- })),
375
- bottomLinks: _propTypes["default"].arrayOf(_propTypes["default"].shape({
376
- text: _propTypes["default"].string.isRequired,
377
- href: _propTypes["default"].string
378
- })),
379
- copyright: _propTypes["default"].string,
380
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
381
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
382
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
383
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
384
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
385
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
386
- padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
387
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
388
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
389
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
390
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
391
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
392
- tabIndex: _propTypes["default"].number
393
- };
394
- var _default = DxcFooter;
395
- exports["default"] = _default;
@@ -1,15 +0,0 @@
1
- <svg id="g10" xmlns="http://www.w3.org/2000/svg" width="280.781" height="32" viewBox="0 0 280.781 32">
2
- <g id="g12">
3
- <path id="path14" d="M171.5-54.124v12.539h-3.6V-54.124h-4.973v-3.191h13.54v3.191H171.5" transform="translate(-68.528 65.45)" fill="#fff"/>
4
- <path id="path16" d="M189.96-41.585V-57.315h12.326v3.079h-8.753v3.191h7.7v3.078h-7.7v3.3h8.87v3.078H189.96" transform="translate(-77.56 65.45)" fill="#fff"/>
5
- <path id="path18" d="M223.558-41.438a8.1,8.1,0,0,1-8.382-8.1v-.045a8.161,8.161,0,0,1,8.522-8.146,8.6,8.6,0,0,1,6.444,2.431l-2.289,2.543a6.133,6.133,0,0,0-4.178-1.778,4.743,4.743,0,0,0-4.738,4.905v.045a4.752,4.752,0,0,0,4.738,4.95,6,6,0,0,0,4.295-1.845l2.288,2.228a8.491,8.491,0,0,1-6.7,2.813" transform="translate(-86.019 65.583)" fill="#fff"/>
6
- <path id="path20" d="M254.988-41.585V-47.9h-6.63v6.315h-3.6V-57.315h3.6v6.225h6.63v-6.225h3.594v15.731h-3.594" transform="translate(-95.903 65.45)" fill="#fff"/>
7
- <path id="path22" d="M285.991-41.585l-7.914-10v10h-3.549V-57.315h3.316l7.657,9.685v-9.685h3.549v15.731h-3.058" transform="translate(-105.869 65.45)" fill="#fff"/>
8
- <path id="path24" d="M317.2-49.583a4.869,4.869,0,0,0-4.949-4.95,4.793,4.793,0,0,0-4.9,4.905v.045a4.869,4.869,0,0,0,4.949,4.95,4.793,4.793,0,0,0,4.9-4.905Zm-4.949,8.145c-5.043,0-8.661-3.623-8.661-8.1v-.045c0-4.478,3.666-8.146,8.708-8.146s8.66,3.623,8.66,8.1v.045c0,4.477-3.664,8.145-8.708,8.145" transform="translate(-115.631 65.583)" fill="#fff"/>
9
- <path id="path26" d="M336.786-41.585V-57.315h3.6v12.584h8.148v3.146H336.786" transform="translate(-126.654 65.45)" fill="#fff"/>
10
- <path id="path28" d="M372.78-49.583a4.87,4.87,0,0,0-4.949-4.95,4.794,4.794,0,0,0-4.9,4.905v.045a4.869,4.869,0,0,0,4.949,4.95,4.794,4.794,0,0,0,4.9-4.905Zm-4.949,8.145c-5.043,0-8.662-3.623-8.662-8.1v-.045c0-4.478,3.666-8.146,8.708-8.146s8.661,3.623,8.661,8.1v.045c0,4.477-3.666,8.145-8.708,8.145" transform="translate(-135.016 65.583)" fill="#fff"/>
11
- <path id="path30" d="M399.735-41.438c-5.09,0-8.592-3.443-8.592-8.1v-.045a8.243,8.243,0,0,1,8.568-8.146,9.18,9.18,0,0,1,6.42,2.16l-2.265,2.634a6.141,6.141,0,0,0-4.272-1.6,4.807,4.807,0,0,0-4.692,4.905v.045a4.8,4.8,0,0,0,4.949,4.995,5.89,5.89,0,0,0,3.384-.945v-2.25h-3.618v-2.992h7.1v6.841a10.837,10.837,0,0,1-6.98,2.5" transform="translate(-145.284 65.583)" fill="#fff"/>
12
- <path id="path32" d="M428.664-47.855v6.27h-3.6v-6.2l-6.28-9.528h4.2L426.89-51l3.968-6.315h4.085l-6.28,9.46" transform="translate(-154.162 65.45)" fill="#fff"/>
13
- <path id="path34" d="M84.218-55.737a10.063,10.063,0,0,1,2.589-4.4,9.792,9.792,0,0,1,6.985-2.77h11.328V-69.3H93.792a17.041,17.041,0,0,0-11.8,4.759,16.344,16.344,0,0,0-3.547,5.115,13.247,13.247,0,0,0-1.122,3.688Zm0,4.877a10.065,10.065,0,0,0,2.589,4.4,9.793,9.793,0,0,0,6.985,2.77h11.328V-37.3H93.792a17.042,17.042,0,0,1-11.8-4.759,16.339,16.339,0,0,1-3.547-5.114,13.251,13.251,0,0,1-1.122-3.688ZM63.1-47.98,54.45-37.3H45.873l12.957-16-12.957-16H54.45L63.1-58.619l8.65-10.68h8.578l-12.957,16,12.957,16H71.749ZM48.875-55.737a13.212,13.212,0,0,0-1.122-3.688,16.359,16.359,0,0,0-3.546-5.115,17.043,17.043,0,0,0-11.8-4.759H21.08v6.393H32.408a9.79,9.79,0,0,1,6.985,2.77,10.072,10.072,0,0,1,2.59,4.4Zm0,4.877a13.215,13.215,0,0,1-1.122,3.688,16.353,16.353,0,0,1-3.546,5.114,17.044,17.044,0,0,1-11.8,4.759H21.08v-6.393H32.408a9.791,9.791,0,0,0,6.985-2.77,10.074,10.074,0,0,0,2.59-4.4h6.892" transform="translate(-21.08 69.298)" fill="#fff"/>
14
- </g>
15
- </svg>
@@ -1,41 +0,0 @@
1
- # DXC Footer 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>logoSrc: string</td>
13
- <td></td>
14
- <td>The path of an icon to replace the theme logo.</td>
15
- </tr>
16
- <tr>
17
- <td>socialLinks: object[]</td>
18
- <td><code>[]</code></td>
19
- <td>An array of objects representing the links that will be rendered at the bottom part of the footer. Each object has the following properties:
20
- <ul>
21
- <li><b>logoSrc</b>: The path of an icon for the link</li>
22
- <li><b>href</b>: URL of the page the link goes to</li>
23
- </ul>
24
- </td>
25
- </tr>
26
- <tr>
27
- <td>bottomLinks: object[]</td>
28
- <td><code>[]</code></td>
29
- <td>An array of objects representing the incon links that will be rendered at the top-right side of the footer. Each object has the following properties:
30
- <ul>
31
- <li><b>text</b>: Text for the link</li>
32
- <li><b>href</b>: URL of the page the link goes to</li>
33
- </ul>
34
- </td>
35
- </tr>
36
- <tr>
37
- <td>copyright: string</td>
38
- <td></td>
39
- <td>The text that will be displayed as copyright disclaimer.</td>
40
- </tr>
41
- </table>