@dxc-technology/halstack-react 0.0.0-dbd540d → 0.0.0-dfcca07

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 (324) 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/AccordionGroup.stories.tsx +225 -0
  14. package/accordion-group/types.d.ts +72 -0
  15. package/accordion-group/types.js +5 -0
  16. package/alert/Alert.d.ts +4 -0
  17. package/{dist/alert → alert}/Alert.js +38 -151
  18. package/alert/Alert.stories.tsx +170 -0
  19. package/alert/types.d.ts +49 -0
  20. package/alert/types.js +5 -0
  21. package/badge/Badge.js +59 -0
  22. package/box/Box.d.ts +4 -0
  23. package/{dist/box → box}/Box.js +13 -43
  24. package/box/Box.stories.tsx +132 -0
  25. package/box/types.d.ts +43 -0
  26. package/box/types.js +5 -0
  27. package/button/Button.d.ts +4 -0
  28. package/{dist/button → button}/Button.js +22 -81
  29. package/button/Button.stories.tsx +276 -0
  30. package/button/types.d.ts +57 -0
  31. package/button/types.js +5 -0
  32. package/card/Card.d.ts +4 -0
  33. package/{dist/card → card}/Card.js +33 -123
  34. package/card/Card.stories.tsx +201 -0
  35. package/card/ice-cream.jpg +0 -0
  36. package/card/types.d.ts +67 -0
  37. package/card/types.js +5 -0
  38. package/checkbox/Checkbox.d.ts +4 -0
  39. package/{dist/checkbox → checkbox}/Checkbox.js +13 -59
  40. package/checkbox/Checkbox.stories.tsx +192 -0
  41. package/checkbox/types.d.ts +60 -0
  42. package/checkbox/types.js +5 -0
  43. package/{dist/chip → chip}/Chip.js +17 -61
  44. package/chip/Chip.stories.tsx +121 -0
  45. package/{dist/chip → chip}/index.d.ts +0 -0
  46. package/{dist/common → common}/OpenSans.css +0 -0
  47. package/{dist/common → common}/RequiredComponent.js +3 -11
  48. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  49. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  50. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  51. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  52. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  53. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  54. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  55. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  56. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  57. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  58. package/{dist/common → common}/utils.js +0 -0
  59. package/{dist/common → common}/variables.js +72 -68
  60. package/{dist/date → date}/Date.js +16 -22
  61. package/{dist/date → date}/index.d.ts +0 -0
  62. package/date-input/DateInput.d.ts +4 -0
  63. package/{dist/date-input → date-input}/DateInput.js +22 -61
  64. package/date-input/DateInput.stories.tsx +138 -0
  65. package/date-input/types.d.ts +100 -0
  66. package/date-input/types.js +5 -0
  67. package/dialog/Dialog.d.ts +4 -0
  68. package/{dist/dialog → dialog}/Dialog.js +20 -73
  69. package/dialog/Dialog.stories.tsx +212 -0
  70. package/dialog/types.d.ts +43 -0
  71. package/dialog/types.js +5 -0
  72. package/dropdown/Dropdown.d.ts +4 -0
  73. package/{dist/dropdown → dropdown}/Dropdown.js +44 -171
  74. package/dropdown/types.d.ts +89 -0
  75. package/dropdown/types.js +5 -0
  76. package/file-input/FileInput.d.ts +4 -0
  77. package/{dist/file-input → file-input}/FileInput.js +69 -202
  78. package/file-input/FileItem.d.ts +14 -0
  79. package/file-input/FileItem.js +184 -0
  80. package/file-input/types.d.ts +87 -0
  81. package/file-input/types.js +5 -0
  82. package/footer/Footer.d.ts +4 -0
  83. package/{dist/footer → footer}/Footer.js +38 -193
  84. package/footer/Footer.stories.jsx +151 -0
  85. package/{dist/footer → footer}/Icons.js +13 -13
  86. package/footer/types.d.ts +69 -0
  87. package/footer/types.js +5 -0
  88. package/header/Header.d.ts +7 -0
  89. package/{dist/header → header}/Header.js +60 -206
  90. package/header/Header.stories.tsx +162 -0
  91. package/{dist/header → header}/Icons.js +7 -32
  92. package/header/types.d.ts +47 -0
  93. package/header/types.js +5 -0
  94. package/heading/Heading.d.ts +4 -0
  95. package/{dist/heading → heading}/Heading.js +24 -95
  96. package/heading/Heading.stories.tsx +53 -0
  97. package/heading/types.d.ts +33 -0
  98. package/heading/types.js +5 -0
  99. package/{dist/input-text → input-text}/Icons.js +2 -2
  100. package/{dist/input-text → input-text}/InputText.js +36 -130
  101. package/{dist/input-text → input-text}/index.d.ts +1 -1
  102. package/{dist/layout → layout}/ApplicationLayout.js +31 -123
  103. package/{dist/layout → layout}/Icons.js +7 -7
  104. package/link/Link.d.ts +3 -0
  105. package/{dist/link → link}/Link.js +18 -94
  106. package/link/Link.stories.tsx +146 -0
  107. package/link/types.d.ts +74 -0
  108. package/link/types.js +5 -0
  109. package/main.d.ts +44 -0
  110. package/{dist/main.js → main.js} +91 -87
  111. package/number-input/NumberInput.d.ts +4 -0
  112. package/number-input/NumberInput.js +86 -0
  113. package/number-input/NumberInput.stories.tsx +115 -0
  114. package/number-input/NumberInputContext.d.ts +4 -0
  115. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  116. package/number-input/numberInputContextTypes.d.ts +19 -0
  117. package/number-input/numberInputContextTypes.js +5 -0
  118. package/number-input/types.d.ts +117 -0
  119. package/number-input/types.js +5 -0
  120. package/package.json +20 -17
  121. package/{dist/paginator → paginator}/Icons.js +9 -9
  122. package/paginator/Paginator.d.ts +4 -0
  123. package/{dist/paginator → paginator}/Paginator.js +24 -131
  124. package/paginator/Paginator.stories.tsx +63 -0
  125. package/paginator/types.d.ts +38 -0
  126. package/paginator/types.js +5 -0
  127. package/password-input/PasswordInput.d.ts +4 -0
  128. package/{dist/password-input → password-input}/PasswordInput.js +22 -61
  129. package/password-input/PasswordInput.stories.tsx +131 -0
  130. package/password-input/types.d.ts +107 -0
  131. package/password-input/types.js +5 -0
  132. package/progress-bar/ProgressBar.d.ts +4 -0
  133. package/{dist/progress-bar → progress-bar}/ProgressBar.js +20 -92
  134. package/progress-bar/ProgressBar.stories.jsx +58 -0
  135. package/progress-bar/types.d.ts +37 -0
  136. package/progress-bar/types.js +5 -0
  137. package/radio/Radio.d.ts +4 -0
  138. package/{dist/radio → radio}/Radio.js +15 -50
  139. package/radio/Radio.stories.tsx +192 -0
  140. package/radio/types.d.ts +54 -0
  141. package/radio/types.js +5 -0
  142. package/resultsetTable/ResultsetTable.d.ts +4 -0
  143. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +38 -145
  144. package/resultsetTable/types.d.ts +67 -0
  145. package/resultsetTable/types.js +5 -0
  146. package/{dist/select → select}/Select.js +248 -479
  147. package/select/Select.stories.tsx +572 -0
  148. package/select/index.d.ts +131 -0
  149. package/sidenav/Sidenav.d.ts +9 -0
  150. package/{dist/sidenav → sidenav}/Sidenav.js +19 -62
  151. package/sidenav/Sidenav.stories.tsx +165 -0
  152. package/sidenav/types.d.ts +50 -0
  153. package/sidenav/types.js +5 -0
  154. package/slider/Slider.d.ts +4 -0
  155. package/{dist/slider → slider}/Slider.js +72 -159
  156. package/slider/Slider.stories.tsx +177 -0
  157. package/slider/types.d.ts +78 -0
  158. package/slider/types.js +5 -0
  159. package/spinner/Spinner.d.ts +4 -0
  160. package/spinner/Spinner.js +250 -0
  161. package/spinner/Spinner.stories.jsx +102 -0
  162. package/spinner/types.d.ts +32 -0
  163. package/spinner/types.js +5 -0
  164. package/switch/Switch.d.ts +4 -0
  165. package/{dist/switch → switch}/Switch.js +26 -69
  166. package/switch/Switch.stories.tsx +160 -0
  167. package/switch/types.d.ts +58 -0
  168. package/switch/types.js +5 -0
  169. package/table/Table.d.ts +4 -0
  170. package/{dist/table → table}/Table.js +10 -24
  171. package/table/Table.stories.jsx +276 -0
  172. package/table/types.d.ts +21 -0
  173. package/table/types.js +5 -0
  174. package/tabs/Tabs.d.ts +4 -0
  175. package/tabs/Tabs.js +213 -0
  176. package/tabs/Tabs.stories.tsx +121 -0
  177. package/tabs/types.d.ts +70 -0
  178. package/tabs/types.js +5 -0
  179. package/tag/Tag.d.ts +4 -0
  180. package/tag/Tag.js +193 -0
  181. package/tag/Tag.stories.tsx +145 -0
  182. package/tag/types.d.ts +60 -0
  183. package/tag/types.js +5 -0
  184. package/text-input/TextInput.d.ts +4 -0
  185. package/{dist/text-input → text-input}/TextInput.js +255 -443
  186. package/text-input/TextInput.stories.tsx +456 -0
  187. package/text-input/types.d.ts +159 -0
  188. package/text-input/types.js +5 -0
  189. package/{dist/textarea → textarea}/Textarea.js +33 -86
  190. package/textarea/Textarea.stories.jsx +135 -0
  191. package/{dist/textarea → textarea}/index.d.ts +18 -8
  192. package/{dist/toggle → toggle}/Toggle.js +15 -49
  193. package/{dist/toggle → toggle}/index.d.ts +0 -0
  194. package/toggle-group/ToggleGroup.d.ts +4 -0
  195. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +28 -138
  196. package/toggle-group/ToggleGroup.stories.tsx +178 -0
  197. package/toggle-group/types.d.ts +84 -0
  198. package/toggle-group/types.js +5 -0
  199. package/{dist/upload → upload}/Upload.js +11 -15
  200. package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +13 -37
  201. package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
  202. package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
  203. package/{dist/upload → upload}/dragAndDropArea/Icons.js +6 -6
  204. package/upload/file-upload/FileToUpload.js +115 -0
  205. package/{dist/upload → upload}/file-upload/Icons.js +13 -13
  206. package/{dist/upload → upload}/files-upload/FilesToUpload.js +12 -26
  207. package/{dist/upload → upload}/index.d.ts +0 -0
  208. package/{dist/upload → upload}/transaction/Icons.js +31 -31
  209. package/upload/transaction/Transaction.js +104 -0
  210. package/upload/transactions/Transactions.js +94 -0
  211. package/{dist/useTheme.js → useTheme.js} +0 -0
  212. package/{dist/wizard → wizard}/Icons.js +8 -8
  213. package/wizard/Wizard.d.ts +4 -0
  214. package/{dist/wizard → wizard}/Wizard.js +32 -206
  215. package/wizard/Wizard.stories.jsx +224 -0
  216. package/wizard/types.d.ts +64 -0
  217. package/wizard/types.js +5 -0
  218. package/README.md +0 -66
  219. package/babel.config.js +0 -7
  220. package/dist/BackgroundColorContext.js +0 -46
  221. package/dist/ThemeContext.js +0 -250
  222. package/dist/accordion/index.d.ts +0 -28
  223. package/dist/accordion-group/AccordionGroup.js +0 -186
  224. package/dist/accordion-group/index.d.ts +0 -16
  225. package/dist/alert/index.d.ts +0 -51
  226. package/dist/badge/Badge.js +0 -63
  227. package/dist/box/index.d.ts +0 -25
  228. package/dist/button/index.d.ts +0 -24
  229. package/dist/card/index.d.ts +0 -22
  230. package/dist/checkbox/index.d.ts +0 -24
  231. package/dist/date-input/index.d.ts +0 -95
  232. package/dist/dialog/index.d.ts +0 -18
  233. package/dist/dropdown/index.d.ts +0 -26
  234. package/dist/file-input/FileItem.js +0 -287
  235. package/dist/file-input/index.d.ts +0 -81
  236. package/dist/footer/index.d.ts +0 -25
  237. package/dist/header/index.d.ts +0 -25
  238. package/dist/heading/index.d.ts +0 -17
  239. package/dist/link/index.d.ts +0 -23
  240. package/dist/main.d.ts +0 -40
  241. package/dist/number-input/NumberInput.js +0 -136
  242. package/dist/number-input/index.d.ts +0 -113
  243. package/dist/paginator/index.d.ts +0 -20
  244. package/dist/password-input/index.d.ts +0 -94
  245. package/dist/progress-bar/index.d.ts +0 -18
  246. package/dist/radio/index.d.ts +0 -23
  247. package/dist/resultsetTable/index.d.ts +0 -19
  248. package/dist/select/index.d.ts +0 -53
  249. package/dist/sidenav/index.d.ts +0 -13
  250. package/dist/slider/index.d.ts +0 -29
  251. package/dist/spinner/Spinner.js +0 -381
  252. package/dist/spinner/index.d.ts +0 -17
  253. package/dist/stories/Button.js +0 -71
  254. package/dist/stories/Button.stories.js +0 -55
  255. package/dist/stories/Header.js +0 -67
  256. package/dist/stories/Header.stories.js +0 -31
  257. package/dist/stories/Introduction.stories.mdx +0 -211
  258. package/dist/stories/Page.js +0 -68
  259. package/dist/stories/Page.stories.js +0 -39
  260. package/dist/stories/assets/code-brackets.svg +0 -1
  261. package/dist/stories/assets/colors.svg +0 -1
  262. package/dist/stories/assets/comments.svg +0 -1
  263. package/dist/stories/assets/direction.svg +0 -1
  264. package/dist/stories/assets/flow.svg +0 -1
  265. package/dist/stories/assets/plugin.svg +0 -1
  266. package/dist/stories/assets/repo.svg +0 -1
  267. package/dist/stories/assets/stackalt.svg +0 -1
  268. package/dist/stories/button.css +0 -30
  269. package/dist/stories/header.css +0 -26
  270. package/dist/stories/page.css +0 -69
  271. package/dist/switch/index.d.ts +0 -24
  272. package/dist/table/index.d.ts +0 -13
  273. package/dist/tabs/Tabs.js +0 -343
  274. package/dist/tabs/index.d.ts +0 -19
  275. package/dist/tag/Tag.js +0 -282
  276. package/dist/tag/index.d.ts +0 -24
  277. package/dist/text-input/index.d.ts +0 -135
  278. package/dist/toggle-group/index.d.ts +0 -21
  279. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  280. package/dist/upload/file-upload/FileToUpload.js +0 -189
  281. package/dist/upload/transaction/Transaction.js +0 -148
  282. package/dist/upload/transactions/Transactions.js +0 -138
  283. package/dist/wizard/index.d.ts +0 -18
  284. package/test/Accordion.test.js +0 -33
  285. package/test/AccordionGroup.test.js +0 -125
  286. package/test/Alert.test.js +0 -53
  287. package/test/Box.test.js +0 -10
  288. package/test/Button.test.js +0 -18
  289. package/test/Card.test.js +0 -30
  290. package/test/Checkbox.test.js +0 -45
  291. package/test/Chip.test.js +0 -25
  292. package/test/Date.test.js +0 -395
  293. package/test/DateInput.test.js +0 -242
  294. package/test/Dialog.test.js +0 -23
  295. package/test/Dropdown.test.js +0 -145
  296. package/test/FileInput.test.js +0 -201
  297. package/test/Footer.test.js +0 -94
  298. package/test/Header.test.js +0 -34
  299. package/test/Heading.test.js +0 -83
  300. package/test/InputText.test.js +0 -239
  301. package/test/Link.test.js +0 -43
  302. package/test/NumberInput.test.js +0 -259
  303. package/test/Paginator.test.js +0 -181
  304. package/test/PasswordInput.test.js +0 -83
  305. package/test/ProgressBar.test.js +0 -35
  306. package/test/Radio.test.js +0 -37
  307. package/test/ResultsetTable.test.js +0 -330
  308. package/test/Select.test.js +0 -415
  309. package/test/Sidenav.test.js +0 -45
  310. package/test/Slider.test.js +0 -74
  311. package/test/Spinner.test.js +0 -32
  312. package/test/Switch.test.js +0 -45
  313. package/test/Table.test.js +0 -36
  314. package/test/Tabs.test.js +0 -109
  315. package/test/Tag.test.js +0 -32
  316. package/test/TextInput.test.js +0 -732
  317. package/test/Textarea.test.js +0 -193
  318. package/test/ToggleGroup.test.js +0 -85
  319. package/test/Upload.test.js +0 -60
  320. package/test/V3Select.test.js +0 -212
  321. package/test/V3TextArea.test.js +0 -51
  322. package/test/Wizard.test.js +0 -130
  323. package/test/mocks/pngMock.js +0 -1
  324. package/test/mocks/svgMock.js +0 -1
@@ -1,135 +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 SVG = string | (HTMLElement & SVGElement);
10
- type Action = {
11
- onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
12
- icon: SVG;
13
- };
14
-
15
- type Props = {
16
- /**
17
- * Text to be placed above the input. This label will be used as the aria-label attribute of the list of suggestions.
18
- */
19
- label?: string;
20
- /**
21
- * Name attribute of the input element.
22
- */
23
- name?: string;
24
- /**
25
- * Value of the input. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
26
- */
27
- value?: string;
28
- /**
29
- * Helper text to be placed above the input.
30
- */
31
- helperText?: string;
32
- /**
33
- * Text to be put as placeholder of the input.
34
- */
35
- placeholder?: string;
36
- /**
37
- * Action to be shown in the input. This is an object composed of an onClick function and an icon,
38
- * being the latter either an inline svg or a URL to the image.
39
- */
40
- action?: Action;
41
- /**
42
- * If true, the input will have an action to clear the entered value.
43
- */
44
- clearable?: boolean;
45
- /**
46
- * If true, the component will be disabled.
47
- */
48
- disabled?: boolean;
49
- /**
50
- * If true, the input will be optional, showing '(Optional)'
51
- * next to the label. Otherwise, the field will be considered required and an error will be
52
- * passed as a parameter to the OnBlur and onChange functions when it has
53
- * not been filled.
54
- */
55
- optional?: boolean;
56
- /**
57
- * Prefix to be placed before the input value.
58
- */
59
- prefix?: string;
60
- /**
61
- * Suffix to be placed after the input value.
62
- */
63
- suffix?: string;
64
- /**
65
- * This function will be called when the user types within the input
66
- * element of the component. An object including the current value and
67
- * the error (if the value entered is not valid) will be passed to this
68
- * function. If there is no error, error will be null.
69
- */
70
- onChange?: (val: { value: string; error: string }) => void;
71
- /**
72
- * This function will be called when the input element loses the focus.
73
- * An object including the input value and the error (if the value
74
- * entered is not valid) will be passed to this function. If there is no error,
75
- * error will be null.
76
- */
77
- onBlur?: (obj: { value: string; error: string }) => void;
78
- /**
79
- * If it is defined, the component will change its appearance, showing
80
- * the error below the input component. If it is not defined, the error
81
- * messages will be managed internally, but never displayed on its own.
82
- */
83
- error?: string;
84
- /**
85
- * These are the options to be displayed as suggestions. It can be either an array or a function:
86
- * - Array: Array of options that will be filtered by the component.
87
- * - Function: This function will be called when the user changes the value, we will send as a parameter the new value;
88
- * apart from that this function should return one promise on which we should make 'then' to get the suggestions filtered.
89
- */
90
- suggestions?: string[] | (() => void);
91
- /**
92
- * Regular expression that defines the valid format allowed by the input.
93
- * This will be checked both when the input element loses the focus and
94
- * while typing within it. If the string entered does not match the
95
- * pattern, the onBlur and onChange functions will be called with the
96
- * current value and an internal error informing that this value does not
97
- * match the pattern. If the pattern is met, the error parameter of both
98
- * events will be null.
99
- */
100
- pattern?: string;
101
- /**
102
- * Specifies the minimun and maximum length allowed by the input.
103
- * This will be checked both when the input element loses the
104
- * focus and while typing within it. If the string entered does not
105
- * comply the length, the onBlur and onChange functions will be called
106
- * with the current value and an internal error informing that the value
107
- * length does not comply the specified range. If a valid length is
108
- * reached, the error parameter of both events will be null.
109
- */
110
- length?: { min?: number; max?: number };
111
- /**
112
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
113
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
114
- */
115
- autocomplete?: string;
116
- /**
117
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
118
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
119
- */
120
- margin?: Space | Margin;
121
- /**
122
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
123
- */
124
- size?: Size;
125
- /**
126
- * Value of the tabindex attribute.
127
- */
128
- tabIndex?: number;
129
- /**
130
- * Reference to the component.
131
- */
132
- ref?: React.RefObject<HTMLDivElement>;
133
- };
134
-
135
- export default function DxcTextInput(props: Props): JSX.Element;
@@ -1,21 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- label?: string;
11
- helperText?: string;
12
- value?: any;
13
- onChange?: void;
14
- disabled?: boolean;
15
- options?: any;
16
- multiple?: boolean;
17
- margin?: Space | Margin;
18
- tabIndex?: number;
19
- };
20
-
21
- export default function DxcToggleGroup(props: Props): JSX.Element;
@@ -1,329 +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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
-
16
- var _react = _interopRequireDefault(require("react"));
17
-
18
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _propTypes = _interopRequireDefault(require("prop-types"));
21
-
22
- var _Icons = require("./Icons");
23
-
24
- var _Button = _interopRequireDefault(require("../../button/Button"));
25
-
26
- var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
27
-
28
- var _BackgroundColorContext = require("../../BackgroundColorContext.js");
29
-
30
- function _templateObject11() {
31
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-bottom: 10px;\n"]);
32
-
33
- _templateObject11 = function _templateObject11() {
34
- return data;
35
- };
36
-
37
- return data;
38
- }
39
-
40
- function _templateObject10() {
41
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n & svg {\n fill: ", ";\n height: ", ";\n width: ", ";\n }\n"]);
42
-
43
- _templateObject10 = function _templateObject10() {
44
- return data;
45
- };
46
-
47
- return data;
48
- }
49
-
50
- function _templateObject9() {
51
- var data = (0, _taggedTemplateLiteral2["default"])(["\n --border-color: #666666;\n --border-weight: 1px;\n --dash-size: 8px;\n --gap-size: 8px;\n background: linear-gradient(90deg, var(--border-color) 100%, transparent 100%) top left no-repeat,\n linear-gradient(\n 90deg,\n transparent calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2 + var(--dash-size)),\n transparent calc(var(--gap-size) / 2 + var(--dash-size))\n )\n top center repeat-x,\n linear-gradient(90deg, var(--border-color) 100%, transparent 100%) top right no-repeat,\n linear-gradient(0deg, var(--border-color) 100%, transparent 100%) top left no-repeat,\n linear-gradient(\n 0deg,\n transparent calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2 + var(--dash-size)),\n transparent calc(var(--gap-size) / 2 + var(--dash-size))\n )\n center left repeat-y,\n linear-gradient(0deg, var(--border-color) 100%, transparent 100%) bottom left no-repeat,\n linear-gradient(90deg, var(--border-color) 100%, transparent 100%) bottom left no-repeat,\n linear-gradient(\n 90deg,\n transparent calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2 + var(--dash-size)),\n transparent calc(var(--gap-size) / 2 + var(--dash-size))\n )\n bottom center repeat-x,\n linear-gradient(90deg, var(--border-color) 100%, transparent 100%) bottom right no-repeat,\n linear-gradient(0deg, var(--border-color) 100%, transparent 100%) top right no-repeat,\n linear-gradient(\n 0deg,\n transparent calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2),\n var(--border-color) calc(var(--gap-size) / 2 + var(--dash-size)),\n transparent calc(var(--gap-size) / 2 + var(--dash-size))\n )\n center right repeat-y,\n linear-gradient(0deg, var(--border-color) 100%, transparent 100%) bottom right no-repeat;\n background-size: var(--dash-size) var(--border-weight), calc(var(--dash-size) + var(--gap-size)) var(--border-weight),\n var(--dash-size) var(--border-weight), var(--border-weight) var(--dash-size),\n var(--border-weight) calc(var(--dash-size) + var(--gap-size)), var(--border-weight) var(--dash-size);\n background-color: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"]);
52
-
53
- _templateObject9 = function _templateObject9() {
54
- return data;
55
- };
56
-
57
- return data;
58
- }
59
-
60
- function _templateObject8() {
61
- var data = (0, _taggedTemplateLiteral2["default"])([""]);
62
-
63
- _templateObject8 = function _templateObject8() {
64
- return data;
65
- };
66
-
67
- return data;
68
- }
69
-
70
- function _templateObject7() {
71
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-bottom: 40px;\n"]);
72
-
73
- _templateObject7 = function _templateObject7() {
74
- return data;
75
- };
76
-
77
- return data;
78
- }
79
-
80
- function _templateObject6() {
81
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-bottom: 10px;\n"]);
82
-
83
- _templateObject6 = function _templateObject6() {
84
- return data;
85
- };
86
-
87
- return data;
88
- }
89
-
90
- function _templateObject5() {
91
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]);
92
-
93
- _templateObject5 = function _templateObject5() {
94
- return data;
95
- };
96
-
97
- return data;
98
- }
99
-
100
- function _templateObject4() {
101
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-bottom: 20px;\n & svg {\n fill: ", ";\n height: ", ";\n width: ", ";\n }\n"]);
102
-
103
- _templateObject4 = function _templateObject4() {
104
- return data;
105
- };
106
-
107
- return data;
108
- }
109
-
110
- function _templateObject3() {
111
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"]);
112
-
113
- _templateObject3 = function _templateObject3() {
114
- return data;
115
- };
116
-
117
- return data;
118
- }
119
-
120
- function _templateObject2() {
121
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 3px 6px ", ";\n"]);
122
-
123
- _templateObject2 = function _templateObject2() {
124
- return data;
125
- };
126
-
127
- return data;
128
- }
129
-
130
- function _templateObject() {
131
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n background-color: ", ";\n width: 100%;\n height: 100%;\n"]);
132
-
133
- _templateObject = function _templateObject() {
134
- return data;
135
- };
136
-
137
- return data;
138
- }
139
-
140
- var DxcDragAndDropArea = function DxcDragAndDropArea(_ref) {
141
- var _ref$dashed = _ref.dashed,
142
- dashed = _ref$dashed === void 0 ? false : _ref$dashed,
143
- addFile = _ref.addFile,
144
- tabIndexValue = _ref.tabIndexValue;
145
-
146
- var _React$useState = _react["default"].useState(false),
147
- _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
148
- dragging = _React$useState2[0],
149
- setDragging = _React$useState2[1];
150
-
151
- var colorsTheme = (0, _useTheme["default"])();
152
- var text = "There are no files to upload";
153
- var description = "Drag and drop your files here or choose one from your computer";
154
- var textHover = "Drag your file here";
155
-
156
- var handleDrag = function handleDrag(e) {
157
- e.preventDefault();
158
- e.stopPropagation();
159
- };
160
-
161
- var handleDragIn = function handleDragIn(e) {
162
- e.preventDefault();
163
- e.stopPropagation();
164
-
165
- if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
166
- setDragging(true);
167
- }
168
- };
169
-
170
- var handleDragOut = function handleDragOut(e) {
171
- e.preventDefault();
172
- e.stopPropagation();
173
- setDragging(false);
174
- };
175
-
176
- var handleDrop = function handleDrop(e) {
177
- e.preventDefault();
178
- e.stopPropagation();
179
- var filesObject = e.dataTransfer.files;
180
-
181
- if (filesObject && filesObject.length > 0) {
182
- var filesArray = Object.keys(filesObject).map(function (key) {
183
- return filesObject[key];
184
- });
185
- addFile(filesArray);
186
- e.dataTransfer.clearData();
187
- }
188
- };
189
-
190
- var selectFile = function selectFile(e) {
191
- var filesObject = e.target.files;
192
-
193
- if (filesObject && filesObject.length > 0) {
194
- var filesArray = Object.keys(filesObject).map(function (key) {
195
- return filesObject[key];
196
- });
197
- addFile(filesArray);
198
- }
199
- };
200
-
201
- var handleClick = function handleClick() {
202
- document.getElementById("chooseFiles").click();
203
- };
204
-
205
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
206
- theme: colorsTheme.upload
207
- }, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
208
- color: colorsTheme.upload.backgroundColor
209
- }, _react["default"].createElement(DXCDragAndDrop, {
210
- onDrop: handleDrop,
211
- onDragEnter: handleDragIn,
212
- onDragOver: handleDrag,
213
- onDragLeave: handleDragOut,
214
- dashed: dashed
215
- }, !dragging && !dashed && _react["default"].createElement(DXCDragAndDropArea, null, _react["default"].createElement(DragAndDropContent, null, _react["default"].createElement(DragAndDropIcon, null, _Icons.uploadFileIcon), _react["default"].createElement(DragAndDropText, null, _react["default"].createElement(DragAndDropTitle, null, text), _react["default"].createElement(DragAndDropDescription, null, description)), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
216
- label: "CHOOSE FILES",
217
- onClick: handleClick,
218
- tabIndex: tabIndexValue
219
- }), _react["default"].createElement("input", {
220
- id: "chooseFiles",
221
- type: "file",
222
- multiple: true,
223
- onChange: selectFile,
224
- style: {
225
- display: "none"
226
- }
227
- })))), !dragging && dashed && _react["default"].createElement(DragAndDropContentHover, null, _react["default"].createElement(DragAndDropContent, null, _react["default"].createElement(DragAndDropIcon, null, _Icons.uploadFileIcon), _react["default"].createElement(DragAndDropText, null, _react["default"].createElement(DragAndDropTitle, null, text), _react["default"].createElement(DragAndDropDescription, null, description)), _react["default"].createElement(ButtonChooseFiles, null, _react["default"].createElement(_Button["default"], {
228
- theme: "light",
229
- label: "CHOOSE FILES",
230
- onClick: handleClick,
231
- tabIndex: tabIndexValue
232
- }), _react["default"].createElement("input", {
233
- id: "chooseFiles",
234
- type: "file",
235
- multiple: true,
236
- onChange: selectFile,
237
- style: {
238
- display: "none"
239
- }
240
- })))), dragging && _react["default"].createElement(DragAndDropContentHover, null, _react["default"].createElement(DragAndDropTextHover, null, textHover), _react["default"].createElement(DragAndDropIconHover, null, _Icons.dropFileIcon)))));
241
- };
242
-
243
- DxcDragAndDropArea.propTypes = {
244
- dashed: _propTypes["default"].bool,
245
- addFile: _propTypes["default"].func
246
- };
247
-
248
- var DXCDragAndDrop = _styledComponents["default"].div(_templateObject(), function (props) {
249
- return props.theme.fontFamily;
250
- }, function (props) {
251
- return props.theme.backgroundColor;
252
- });
253
-
254
- var DXCDragAndDropArea = _styledComponents["default"].div(_templateObject2(), function (props) {
255
- return props.theme.shadowColor;
256
- });
257
-
258
- var DragAndDropContent = _styledComponents["default"].div(_templateObject3());
259
-
260
- var DragAndDropIcon = _styledComponents["default"].div(_templateObject4(), function (props) {
261
- return props.theme.dragAndDropIconSize;
262
- }, function (props) {
263
- return props.theme.dragAndDropIconSize;
264
- }, function (props) {
265
- return props.theme.dragAndDropIconColor;
266
- }, function (props) {
267
- return props.theme.dragAndDropIconSize;
268
- }, function (props) {
269
- return props.theme.dragAndDropIconSize;
270
- });
271
-
272
- var DragAndDropText = _styledComponents["default"].div(_templateObject5());
273
-
274
- var DragAndDropTitle = _styledComponents["default"].div(_templateObject6(), function (props) {
275
- return props.theme.dragAndDropTitleFontSize;
276
- }, function (props) {
277
- return props.theme.dragAndDropTitleFontStyle;
278
- }, function (props) {
279
- return props.theme.dragAndDropTitleFontWeight;
280
- }, function (props) {
281
- return props.theme.dragAndDropTitleFontTextTransform;
282
- }, function (props) {
283
- return props.theme.dragAndDropTitleFontColor;
284
- });
285
-
286
- var DragAndDropDescription = _styledComponents["default"].div(_templateObject7(), function (props) {
287
- return props.theme.dragAndDropDescriptionFontSize;
288
- }, function (props) {
289
- return props.theme.dragAndDropDescriptionFontStyle;
290
- }, function (props) {
291
- return props.theme.dragAndDropDescriptionFontWeight;
292
- }, function (props) {
293
- return props.theme.dragAndDropDescriptionFontTextTransform;
294
- }, function (props) {
295
- return props.theme.dragAndDropDescriptionFontColor;
296
- });
297
-
298
- var ButtonChooseFiles = _styledComponents["default"].div(_templateObject8());
299
-
300
- var DragAndDropContentHover = _styledComponents["default"].div(_templateObject9(), function (props) {
301
- return props.theme.draggingStateBackgroundColor;
302
- });
303
-
304
- var DragAndDropIconHover = _styledComponents["default"].div(_templateObject10(), function (props) {
305
- return props.theme.dragAndDropDraggingStateIconSize;
306
- }, function (props) {
307
- return props.theme.dragAndDropDraggingStateIconSize;
308
- }, function (props) {
309
- return props.theme.dragAndDropDraggingStateIconColor;
310
- }, function (props) {
311
- return props.theme.dragAndDropDraggingStateIconSize;
312
- }, function (props) {
313
- return props.theme.dragAndDropDraggingStateIconSize;
314
- });
315
-
316
- var DragAndDropTextHover = _styledComponents["default"].div(_templateObject11(), function (props) {
317
- return props.theme.dragAndDropDraggingStateFontSize;
318
- }, function (props) {
319
- return props.theme.dragAndDropDraggingStateFontStyle;
320
- }, function (props) {
321
- return props.theme.dragAndDropDraggingStateFontWeight;
322
- }, function (props) {
323
- return props.theme.dragAndDropDraggingStateFontTextTransform;
324
- }, function (props) {
325
- return props.theme.dragAndDropDraggingStateFontColor;
326
- });
327
-
328
- var _default = DxcDragAndDropArea;
329
- exports["default"] = _default;
@@ -1,189 +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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _Icons = require("./Icons");
21
-
22
- var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
23
-
24
- function _templateObject8() {
25
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n border: none;\n display: flex;\n margin-right: 30px;\n margin-top: 11px;\n padding: 0px;\n background: none;\n &:focus {\n visibility: visible;\n }\n & svg {\n fill: ", ";\n height: ", ";\n width: ", ";\n }\n"]);
26
-
27
- _templateObject8 = function _templateObject8() {
28
- return data;
29
- };
30
-
31
- return data;
32
- }
33
-
34
- function _templateObject7() {
35
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n"]);
36
-
37
- _templateObject7 = function _templateObject7() {
38
- return data;
39
- };
40
-
41
- return data;
42
- }
43
-
44
- function _templateObject6() {
45
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-bottom: 12px;\n"]);
46
-
47
- _templateObject6 = function _templateObject6() {
48
- return data;
49
- };
50
-
51
- return data;
52
- }
53
-
54
- function _templateObject5() {
55
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n"]);
56
-
57
- _templateObject5 = function _templateObject5() {
58
- return data;
59
- };
60
-
61
- return data;
62
- }
63
-
64
- function _templateObject4() {
65
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 30px;\n width: 70px;\n height: 52px;\n & svg {\n width: 70px;\n height: 52px;\n }\n"]);
66
-
67
- _templateObject4 = function _templateObject4() {
68
- return data;
69
- };
70
-
71
- return data;
72
- }
73
-
74
- function _templateObject3() {
75
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 30px;\n width: 70px;\n height: 52px;\n object-fit: contain;\n"]);
76
-
77
- _templateObject3 = function _templateObject3() {
78
- return data;
79
- };
80
-
81
- return data;
82
- }
83
-
84
- function _templateObject2() {
85
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n margin-bottom: 25px;\n margin-left: 40px;\n"]);
86
-
87
- _templateObject2 = function _templateObject2() {
88
- return data;
89
- };
90
-
91
- return data;
92
- }
93
-
94
- function _templateObject() {
95
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n max-width: 100%;\n height: 52px;\n display: flex;\n flex-direction: column;\n padding-bottom: 25px;\n padding-top: 25px;\n border-bottom: ", " solid ", ";\n :hover {\n background: ", ";\n &:hover {\n cursor: pointer;\n }\n }\n"]);
96
-
97
- _templateObject = function _templateObject() {
98
- return data;
99
- };
100
-
101
- return data;
102
- }
103
-
104
- var DxcFileToUpload = function DxcFileToUpload(_ref) {
105
- var _ref$name = _ref.name,
106
- name = _ref$name === void 0 ? "" : _ref$name,
107
- _ref$type = _ref.type,
108
- type = _ref$type === void 0 ? "" : _ref$type,
109
- image = _ref.image,
110
- onDelete = _ref.onDelete,
111
- tabIndexValue = _ref.tabIndexValue;
112
-
113
- var icon = type.includes("video") && _Icons.videoIcon || type.includes("audio") && _Icons.audioIcon || _Icons.defaultIcon;
114
-
115
- var hasImage = image && image.includes("image");
116
- var colorsTheme = (0, _useTheme["default"])();
117
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
118
- theme: colorsTheme.upload
119
- }, _react["default"].createElement(DXCFileToUpload, null, _react["default"].createElement(FileContent, null, hasImage && _react["default"].createElement(FileImage, {
120
- src: image
121
- }) || _react["default"].createElement(FileIconContainer, null, icon), _react["default"].createElement(FileInfo, null, _react["default"].createElement(FileName, null, name), _react["default"].createElement(FileType, null, type)), _react["default"].createElement(DeleteFile, {
122
- onClick: onDelete,
123
- tabIndex: tabIndexValue
124
- }, _Icons.closeIcon))));
125
- };
126
-
127
- DxcFileToUpload.propTypes = {
128
- name: _propTypes["default"].string,
129
- type: _propTypes["default"].string,
130
- image: _propTypes["default"].string,
131
- onDelete: _propTypes["default"].func
132
- };
133
-
134
- var DXCFileToUpload = _styledComponents["default"].div(_templateObject(), function (props) {
135
- return props.theme.fontFamily;
136
- }, function (props) {
137
- return props.theme.fileUnderlineThickness;
138
- }, function (props) {
139
- return props.theme.fileUnderlineColor;
140
- }, function (props) {
141
- return props.theme.hoverFileColor;
142
- });
143
-
144
- var FileContent = _styledComponents["default"].div(_templateObject2());
145
-
146
- var FileImage = _styledComponents["default"].img(_templateObject3());
147
-
148
- var FileIconContainer = _styledComponents["default"].div(_templateObject4());
149
-
150
- var FileInfo = _styledComponents["default"].div(_templateObject5());
151
-
152
- var FileName = _styledComponents["default"].div(_templateObject6(), function (props) {
153
- return props.theme.fileNameFontSize;
154
- }, function (props) {
155
- return props.theme.fileNameFontStyle;
156
- }, function (props) {
157
- return props.theme.fileNameFontWeight;
158
- }, function (props) {
159
- return props.theme.fileNameFontTextTransform;
160
- }, function (props) {
161
- return props.theme.fileNameFontColor;
162
- });
163
-
164
- var FileType = _styledComponents["default"].div(_templateObject7(), function (props) {
165
- return props.theme.fileTypeFontSize;
166
- }, function (props) {
167
- return props.theme.fileTypeFontStyle;
168
- }, function (props) {
169
- return props.theme.fileTypeFontWeight;
170
- }, function (props) {
171
- return props.theme.fileTypeFontTextTransform;
172
- }, function (props) {
173
- return props.theme.fileTypeFontColor;
174
- });
175
-
176
- var DeleteFile = _styledComponents["default"].button(_templateObject8(), function (props) {
177
- return props.theme.fileDeleteIconSize;
178
- }, function (props) {
179
- return props.theme.fileDeleteIconSize;
180
- }, function (props) {
181
- return props.theme.fileDeleteIconColor;
182
- }, function (props) {
183
- return props.theme.fileDeleteIconSize;
184
- }, function (props) {
185
- return props.theme.fileDeleteIconSize;
186
- });
187
-
188
- var _default = DxcFileToUpload;
189
- exports["default"] = _default;