@dxc-technology/halstack-react 0.0.0-acb1a24 → 0.0.0-adde6ce

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 (351) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +47 -0
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +243 -0
  5. package/{dist/V3Select → V3Select}/V3Select.js +35 -129
  6. package/{dist/V3Select → V3Select}/index.d.ts +0 -0
  7. package/{dist/V3Textarea → V3Textarea}/V3Textarea.js +12 -16
  8. package/{dist/V3Textarea → V3Textarea}/index.d.ts +0 -0
  9. package/accordion/Accordion.d.ts +4 -0
  10. package/{dist/accordion → accordion}/Accordion.js +37 -132
  11. package/accordion/Accordion.stories.tsx +307 -0
  12. package/accordion/types.d.ts +68 -0
  13. package/accordion/types.js +5 -0
  14. package/accordion-group/AccordionGroup.d.ts +7 -0
  15. package/accordion-group/AccordionGroup.js +170 -0
  16. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  17. package/accordion-group/types.d.ts +72 -0
  18. package/accordion-group/types.js +5 -0
  19. package/alert/Alert.d.ts +4 -0
  20. package/{dist/alert → alert}/Alert.js +40 -153
  21. package/alert/Alert.stories.tsx +170 -0
  22. package/alert/types.d.ts +49 -0
  23. package/alert/types.js +5 -0
  24. package/badge/Badge.js +59 -0
  25. package/box/Box.d.ts +4 -0
  26. package/{dist/box → box}/Box.js +15 -45
  27. package/box/Box.stories.tsx +132 -0
  28. package/box/types.d.ts +43 -0
  29. package/box/types.js +5 -0
  30. package/button/Button.d.ts +4 -0
  31. package/{dist/button → button}/Button.js +24 -83
  32. package/button/Button.stories.tsx +276 -0
  33. package/button/types.d.ts +57 -0
  34. package/button/types.js +5 -0
  35. package/card/Card.d.ts +4 -0
  36. package/{dist/card → card}/Card.js +34 -124
  37. package/card/Card.stories.tsx +201 -0
  38. package/card/ice-cream.jpg +0 -0
  39. package/card/types.d.ts +67 -0
  40. package/card/types.js +5 -0
  41. package/checkbox/Checkbox.d.ts +4 -0
  42. package/{dist/checkbox → checkbox}/Checkbox.js +15 -61
  43. package/checkbox/Checkbox.stories.tsx +192 -0
  44. package/checkbox/types.d.ts +60 -0
  45. package/checkbox/types.js +5 -0
  46. package/chip/Chip.d.ts +4 -0
  47. package/{dist/chip → chip}/Chip.js +22 -88
  48. package/chip/Chip.stories.tsx +121 -0
  49. package/chip/types.d.ts +53 -0
  50. package/chip/types.js +5 -0
  51. package/{dist/common → common}/OpenSans.css +0 -0
  52. package/{dist/common → common}/RequiredComponent.js +3 -11
  53. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  54. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  55. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  56. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  57. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  58. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  59. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  60. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  61. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  62. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  63. package/{dist/common → common}/utils.js +0 -0
  64. package/{dist/common → common}/variables.js +126 -88
  65. package/{dist/date → date}/Date.js +17 -23
  66. package/{dist/date → date}/index.d.ts +0 -0
  67. package/date-input/DateInput.d.ts +4 -0
  68. package/{dist/date-input → date-input}/DateInput.js +26 -68
  69. package/date-input/DateInput.stories.tsx +138 -0
  70. package/date-input/types.d.ts +100 -0
  71. package/date-input/types.js +5 -0
  72. package/dialog/Dialog.d.ts +4 -0
  73. package/{dist/dialog → dialog}/Dialog.js +24 -76
  74. package/dialog/Dialog.stories.tsx +212 -0
  75. package/dialog/types.d.ts +43 -0
  76. package/dialog/types.js +5 -0
  77. package/dropdown/Dropdown.d.ts +4 -0
  78. package/{dist/dropdown → dropdown}/Dropdown.js +45 -172
  79. package/dropdown/Dropdown.stories.tsx +247 -0
  80. package/dropdown/types.d.ts +89 -0
  81. package/dropdown/types.js +5 -0
  82. package/file-input/FileInput.d.ts +4 -0
  83. package/file-input/FileInput.js +590 -0
  84. package/file-input/FileInput.stories.tsx +507 -0
  85. package/file-input/FileItem.d.ts +14 -0
  86. package/file-input/FileItem.js +184 -0
  87. package/file-input/types.d.ts +112 -0
  88. package/file-input/types.js +5 -0
  89. package/footer/Footer.d.ts +4 -0
  90. package/footer/Footer.js +260 -0
  91. package/footer/Footer.stories.tsx +130 -0
  92. package/footer/Icons.d.ts +2 -0
  93. package/{dist/footer → footer}/Icons.js +15 -15
  94. package/footer/types.d.ts +65 -0
  95. package/footer/types.js +5 -0
  96. package/header/Header.d.ts +7 -0
  97. package/{dist/header → header}/Header.js +58 -204
  98. package/header/Header.stories.tsx +162 -0
  99. package/header/Icons.d.ts +2 -0
  100. package/{dist/header → header}/Icons.js +7 -32
  101. package/header/types.d.ts +47 -0
  102. package/header/types.js +5 -0
  103. package/heading/Heading.d.ts +4 -0
  104. package/{dist/heading → heading}/Heading.js +25 -96
  105. package/heading/Heading.stories.tsx +54 -0
  106. package/heading/types.d.ts +33 -0
  107. package/heading/types.js +5 -0
  108. package/{dist/input-text → input-text}/Icons.js +2 -2
  109. package/{dist/input-text → input-text}/InputText.js +38 -132
  110. package/{dist/input-text → input-text}/index.d.ts +1 -1
  111. package/layout/ApplicationLayout.d.ts +10 -0
  112. package/{dist/layout → layout}/ApplicationLayout.js +39 -141
  113. package/layout/ApplicationLayout.stories.tsx +171 -0
  114. package/{dist/layout → layout}/Icons.js +7 -7
  115. package/layout/types.d.ts +57 -0
  116. package/layout/types.js +5 -0
  117. package/link/Link.d.ts +3 -0
  118. package/{dist/link → link}/Link.js +19 -95
  119. package/link/Link.stories.tsx +146 -0
  120. package/link/types.d.ts +74 -0
  121. package/link/types.js +5 -0
  122. package/list/List.d.ts +8 -0
  123. package/list/List.js +47 -0
  124. package/list/List.stories.tsx +95 -0
  125. package/main.d.ts +48 -0
  126. package/{dist/main.js → main.js} +118 -82
  127. package/number-input/NumberInput.d.ts +4 -0
  128. package/number-input/NumberInput.js +83 -0
  129. package/number-input/NumberInput.stories.tsx +115 -0
  130. package/number-input/NumberInputContext.d.ts +4 -0
  131. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  132. package/number-input/numberInputContextTypes.d.ts +19 -0
  133. package/number-input/numberInputContextTypes.js +5 -0
  134. package/number-input/types.d.ts +117 -0
  135. package/number-input/types.js +5 -0
  136. package/package.json +31 -18
  137. package/{dist/paginator → paginator}/Icons.js +9 -9
  138. package/paginator/Paginator.d.ts +4 -0
  139. package/paginator/Paginator.js +192 -0
  140. package/paginator/Paginator.stories.tsx +63 -0
  141. package/paginator/types.d.ts +38 -0
  142. package/paginator/types.js +5 -0
  143. package/password-input/PasswordInput.d.ts +4 -0
  144. package/{dist/password-input → password-input}/PasswordInput.js +37 -77
  145. package/password-input/PasswordInput.stories.tsx +131 -0
  146. package/password-input/types.d.ts +107 -0
  147. package/password-input/types.js +5 -0
  148. package/progress-bar/ProgressBar.d.ts +4 -0
  149. package/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
  150. package/progress-bar/ProgressBar.stories.jsx +58 -0
  151. package/progress-bar/types.d.ts +37 -0
  152. package/progress-bar/types.js +5 -0
  153. package/radio/Radio.d.ts +4 -0
  154. package/{dist/radio → radio}/Radio.js +17 -52
  155. package/radio/Radio.stories.tsx +192 -0
  156. package/radio/types.d.ts +54 -0
  157. package/radio/types.js +5 -0
  158. package/radio-group/Radio.d.ts +4 -0
  159. package/radio-group/Radio.js +130 -0
  160. package/radio-group/RadioGroup.d.ts +4 -0
  161. package/radio-group/RadioGroup.js +268 -0
  162. package/radio-group/RadioGroup.stories.tsx +79 -0
  163. package/radio-group/types.d.ts +36 -0
  164. package/radio-group/types.js +5 -0
  165. package/resultsetTable/ResultsetTable.d.ts +4 -0
  166. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +39 -146
  167. package/resultsetTable/ResultsetTable.stories.tsx +277 -0
  168. package/resultsetTable/types.d.ts +67 -0
  169. package/resultsetTable/types.js +5 -0
  170. package/row/Row.d.ts +11 -0
  171. package/row/Row.js +127 -0
  172. package/row/Row.stories.tsx +239 -0
  173. package/select/Select.d.ts +4 -0
  174. package/{dist/select → select}/Select.js +258 -491
  175. package/select/Select.stories.tsx +572 -0
  176. package/select/types.d.ts +170 -0
  177. package/select/types.js +5 -0
  178. package/sidenav/Sidenav.d.ts +9 -0
  179. package/{dist/sidenav → sidenav}/Sidenav.js +21 -64
  180. package/sidenav/Sidenav.stories.tsx +182 -0
  181. package/sidenav/types.d.ts +50 -0
  182. package/sidenav/types.js +5 -0
  183. package/slider/Slider.d.ts +4 -0
  184. package/{dist/slider → slider}/Slider.js +74 -161
  185. package/slider/Slider.stories.tsx +177 -0
  186. package/slider/types.d.ts +78 -0
  187. package/slider/types.js +5 -0
  188. package/spinner/Spinner.d.ts +4 -0
  189. package/spinner/Spinner.js +250 -0
  190. package/spinner/Spinner.stories.jsx +103 -0
  191. package/spinner/types.d.ts +32 -0
  192. package/spinner/types.js +5 -0
  193. package/stack/Stack.d.ts +10 -0
  194. package/stack/Stack.js +97 -0
  195. package/stack/Stack.stories.tsx +166 -0
  196. package/switch/Switch.d.ts +4 -0
  197. package/{dist/switch → switch}/Switch.js +28 -71
  198. package/switch/Switch.stories.tsx +160 -0
  199. package/switch/types.d.ts +58 -0
  200. package/switch/types.js +5 -0
  201. package/table/Table.d.ts +4 -0
  202. package/{dist/table → table}/Table.js +12 -26
  203. package/table/Table.stories.jsx +277 -0
  204. package/table/types.d.ts +21 -0
  205. package/table/types.js +5 -0
  206. package/tabs/Tabs.d.ts +4 -0
  207. package/tabs/Tabs.js +213 -0
  208. package/tabs/Tabs.stories.tsx +122 -0
  209. package/tabs/types.d.ts +70 -0
  210. package/tabs/types.js +5 -0
  211. package/tag/Tag.d.ts +4 -0
  212. package/tag/Tag.js +193 -0
  213. package/tag/Tag.stories.tsx +145 -0
  214. package/tag/types.d.ts +60 -0
  215. package/tag/types.js +5 -0
  216. package/text/Text.d.ts +7 -0
  217. package/text/Text.js +30 -0
  218. package/text/Text.stories.tsx +19 -0
  219. package/text-input/TextInput.d.ts +4 -0
  220. package/{dist/text-input → text-input}/TextInput.js +269 -457
  221. package/text-input/TextInput.stories.tsx +456 -0
  222. package/text-input/types.d.ts +159 -0
  223. package/text-input/types.js +5 -0
  224. package/textarea/Textarea.d.ts +4 -0
  225. package/{dist/textarea → textarea}/Textarea.js +38 -123
  226. package/textarea/Textarea.stories.jsx +136 -0
  227. package/textarea/types.d.ts +130 -0
  228. package/textarea/types.js +5 -0
  229. package/{dist/toggle → toggle}/Toggle.js +16 -50
  230. package/{dist/toggle → toggle}/index.d.ts +0 -0
  231. package/toggle-group/ToggleGroup.d.ts +4 -0
  232. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +35 -148
  233. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  234. package/toggle-group/types.d.ts +97 -0
  235. package/toggle-group/types.js +5 -0
  236. package/{dist/upload → upload}/Upload.js +11 -15
  237. package/upload/buttons-upload/ButtonsUpload.js +111 -0
  238. package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
  239. package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
  240. package/{dist/upload → upload}/dragAndDropArea/Icons.js +6 -6
  241. package/upload/file-upload/FileToUpload.js +115 -0
  242. package/{dist/upload → upload}/file-upload/Icons.js +13 -13
  243. package/{dist/upload → upload}/files-upload/FilesToUpload.js +13 -27
  244. package/{dist/upload → upload}/index.d.ts +0 -0
  245. package/{dist/upload → upload}/transaction/Icons.js +31 -31
  246. package/upload/transaction/Transaction.js +104 -0
  247. package/upload/transactions/Transactions.js +94 -0
  248. package/useTheme.d.ts +2 -0
  249. package/{dist/useTheme.js → useTheme.js} +1 -1
  250. package/wizard/Wizard.d.ts +4 -0
  251. package/wizard/Wizard.js +281 -0
  252. package/wizard/Wizard.stories.tsx +224 -0
  253. package/wizard/types.d.ts +60 -0
  254. package/wizard/types.js +5 -0
  255. package/README.md +0 -66
  256. package/babel.config.js +0 -8
  257. package/dist/BackgroundColorContext.js +0 -46
  258. package/dist/ThemeContext.js +0 -250
  259. package/dist/accordion/index.d.ts +0 -28
  260. package/dist/accordion-group/AccordionGroup.js +0 -186
  261. package/dist/accordion-group/index.d.ts +0 -16
  262. package/dist/alert/index.d.ts +0 -51
  263. package/dist/badge/Badge.js +0 -63
  264. package/dist/box/index.d.ts +0 -25
  265. package/dist/button/index.d.ts +0 -24
  266. package/dist/card/index.d.ts +0 -22
  267. package/dist/checkbox/index.d.ts +0 -24
  268. package/dist/chip/index.d.ts +0 -22
  269. package/dist/date-input/index.d.ts +0 -95
  270. package/dist/dialog/index.d.ts +0 -18
  271. package/dist/dropdown/index.d.ts +0 -26
  272. package/dist/file-input/FileInput.js +0 -644
  273. package/dist/file-input/FileItem.js +0 -287
  274. package/dist/file-input/index.d.ts +0 -81
  275. package/dist/footer/Footer.js +0 -421
  276. package/dist/footer/index.d.ts +0 -25
  277. package/dist/header/index.d.ts +0 -25
  278. package/dist/heading/index.d.ts +0 -17
  279. package/dist/link/index.d.ts +0 -23
  280. package/dist/main.d.ts +0 -40
  281. package/dist/number-input/NumberInput.js +0 -136
  282. package/dist/number-input/index.d.ts +0 -113
  283. package/dist/paginator/Paginator.js +0 -305
  284. package/dist/paginator/index.d.ts +0 -20
  285. package/dist/password-input/index.d.ts +0 -94
  286. package/dist/progress-bar/index.d.ts +0 -18
  287. package/dist/radio/index.d.ts +0 -23
  288. package/dist/resultsetTable/index.d.ts +0 -19
  289. package/dist/select/index.d.ts +0 -53
  290. package/dist/sidenav/index.d.ts +0 -13
  291. package/dist/slider/index.d.ts +0 -29
  292. package/dist/spinner/Spinner.js +0 -381
  293. package/dist/spinner/index.d.ts +0 -17
  294. package/dist/switch/index.d.ts +0 -24
  295. package/dist/table/index.d.ts +0 -13
  296. package/dist/tabs/Tabs.js +0 -343
  297. package/dist/tabs/index.d.ts +0 -19
  298. package/dist/tag/Tag.js +0 -282
  299. package/dist/tag/index.d.ts +0 -24
  300. package/dist/text-input/index.d.ts +0 -135
  301. package/dist/textarea/index.d.ts +0 -117
  302. package/dist/toggle-group/index.d.ts +0 -21
  303. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
  304. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  305. package/dist/upload/file-upload/FileToUpload.js +0 -189
  306. package/dist/upload/transaction/Transaction.js +0 -148
  307. package/dist/upload/transactions/Transactions.js +0 -138
  308. package/dist/wizard/Icons.js +0 -65
  309. package/dist/wizard/Wizard.js +0 -405
  310. package/dist/wizard/index.d.ts +0 -18
  311. package/test/Accordion.test.js +0 -33
  312. package/test/AccordionGroup.test.js +0 -125
  313. package/test/Alert.test.js +0 -53
  314. package/test/Box.test.js +0 -10
  315. package/test/Button.test.js +0 -18
  316. package/test/Card.test.js +0 -30
  317. package/test/Checkbox.test.js +0 -45
  318. package/test/Chip.test.js +0 -25
  319. package/test/Date.test.js +0 -395
  320. package/test/DateInput.test.js +0 -242
  321. package/test/Dialog.test.js +0 -23
  322. package/test/Dropdown.test.js +0 -145
  323. package/test/FileInput.test.js +0 -201
  324. package/test/Footer.test.js +0 -94
  325. package/test/Header.test.js +0 -34
  326. package/test/Heading.test.js +0 -83
  327. package/test/InputText.test.js +0 -240
  328. package/test/Link.test.js +0 -43
  329. package/test/NumberInput.test.js +0 -259
  330. package/test/Paginator.test.js +0 -181
  331. package/test/PasswordInput.test.js +0 -83
  332. package/test/ProgressBar.test.js +0 -35
  333. package/test/Radio.test.js +0 -37
  334. package/test/ResultsetTable.test.js +0 -330
  335. package/test/Select.test.js +0 -415
  336. package/test/Sidenav.test.js +0 -45
  337. package/test/Slider.test.js +0 -74
  338. package/test/Spinner.test.js +0 -32
  339. package/test/Switch.test.js +0 -45
  340. package/test/Table.test.js +0 -36
  341. package/test/Tabs.test.js +0 -109
  342. package/test/Tag.test.js +0 -32
  343. package/test/TextInput.test.js +0 -732
  344. package/test/Textarea.test.js +0 -193
  345. package/test/ToggleGroup.test.js +0 -85
  346. package/test/Upload.test.js +0 -60
  347. package/test/V3Select.test.js +0 -212
  348. package/test/V3TextArea.test.js +0 -51
  349. package/test/Wizard.test.js +0 -130
  350. package/test/mocks/pngMock.js +0 -1
  351. 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,117 +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
-
10
- type Props = {
11
- /**
12
- * Text to be placed above the textarea.
13
- */
14
- label?: string;
15
- /**
16
- * Name attribute of the textarea element.
17
- */
18
- name?: string;
19
- /**
20
- * Value of the textarea. If undefined, the component will be uncontrolled and the value will be managed internally.
21
- */
22
- value?: string;
23
- /**
24
- * Helper text to be placed above the textarea.
25
- */
26
- helperText?: string;
27
- /**
28
- * Text to be put as placeholder of the textarea.
29
- */
30
- placeholder?: string;
31
- /**
32
- * If true, the component will be disabled.
33
- */
34
- disabled?: boolean;
35
- /**
36
- * If true, the textarea will be optional, showing '(Optional)'
37
- * next to the label. Otherwise, the field will be considered required
38
- * and an error will be passed as a parameter to the OnBlur and onChange functions
39
- * when it has not been filled.
40
- */
41
- optional?: boolean;
42
- /**
43
- * Defines the textarea's ability to resize vertically. It can be:
44
- * - 'auto': The textarea grows or shrinks automatically in order to fit the content.
45
- * - 'manual': The height of the textarea is enabled to be manually modified.
46
- * - 'none': The textarea has a fixed height and can't be modified.
47
- */
48
- verticalGrow?: "auto" | "manual" | "none";
49
- /**
50
- * Number of rows of the textarea.
51
- */
52
- rows?: number;
53
- /**
54
- * This function will be called when the user types within the textarea.
55
- * An object including the current value and the error (if the value
56
- * entered is not valid) will be passed to this function.
57
- * If there is no error, error will be null.
58
- */
59
- onChange?: (val: { value: string; error: string }) => void;
60
- /**
61
- * This function will be called when the textarea loses the focus. An
62
- * object including the textarea value and the error (if the value entered
63
- * is not valid) will be passed to this function. If there is no error,
64
- * error will be null.
65
- */
66
- onBlur?: (val: { value: string; error: string }) => void;
67
- /**
68
- * If it is defined, the component will change its appearance, showing
69
- * the error below the textarea. If it is not defined, the error
70
- * messages will be managed internally, but never displayed on its own.
71
- */
72
- error?: string;
73
- /**
74
- * Regular expression that defines the valid format allowed by the
75
- * textarea. This will be checked both when the textarea loses the focus
76
- * and while typing within it. If the string entered does not match the
77
- * pattern, the onBlur and onChange functions will be called with the
78
- * current value and an internal error informing that this value does not
79
- * match the pattern. If the pattern is met, the error parameter of both
80
- * events will be null.
81
- */
82
- pattern?: string;
83
- /**
84
- * Specifies the minimun and maximum length allowed by the textarea.
85
- * This will be checked both when the textarea loses the
86
- * focus and while typing within it. If the string entered does not
87
- * comply the length, the onBlur and onChange functions will be called
88
- * with the current value and an internal error informing that the value
89
- * length does not comply the specified range. If a valid length is
90
- * reached, the error parameter of both events will be null.
91
- */
92
- length?: { min: number; max: number };
93
- /**
94
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the textarea value.
95
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
96
- */
97
- autocomplete?: string;
98
- /**
99
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
100
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
101
- */
102
- margin?: Space | Margin;
103
- /**
104
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
105
- */
106
- size?: Size;
107
- /**
108
- * Value of the tabindex attribute.
109
- */
110
- tabIndex?: number;
111
- /**
112
- * Reference to the component.
113
- */
114
- ref?: React.RefObject<HTMLDivElement>;
115
- };
116
-
117
- export default function DxcTextarea(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,135 +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 _Button = _interopRequireDefault(require("../../button/Button"));
21
-
22
- var _Icons = require("./Icons");
23
-
24
- var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
25
-
26
- var _BackgroundColorContext = require("../../BackgroundColorContext.js");
27
-
28
- function _templateObject3() {
29
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-right: 5px;\n & svg {\n fill: ", ";\n }\n"]);
30
-
31
- _templateObject3 = function _templateObject3() {
32
- return data;
33
- };
34
-
35
- return data;
36
- }
37
-
38
- function _templateObject2() {
39
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-right: 50px;\n"]);
40
-
41
- _templateObject2 = function _templateObject2() {
42
- return data;
43
- };
44
-
45
- return data;
46
- }
47
-
48
- function _templateObject() {
49
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 80px;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n"]);
50
-
51
- _templateObject = function _templateObject() {
52
- return data;
53
- };
54
-
55
- return data;
56
- }
57
-
58
- var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
59
- var addFile = _ref.addFile,
60
- onUpload = _ref.onUpload;
61
- var colorsTheme = (0, _useTheme["default"])();
62
-
63
- var selectFile = function selectFile(e) {
64
- var filesObject = e.target.files;
65
-
66
- if (filesObject && filesObject.length > 0) {
67
- var filesArray = Object.keys(filesObject).map(function (key) {
68
- return filesObject[key];
69
- });
70
- addFile(filesArray);
71
- }
72
- };
73
-
74
- var handleClick = function handleClick() {
75
- document.getElementById("chooseFiles").click();
76
- };
77
-
78
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
79
- theme: colorsTheme.upload
80
- }, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
81
- color: colorsTheme.upload.backgroundColor
82
- }, _react["default"].createElement(DXCButtonsUpload, null, _react["default"].createElement(DragAndDropLabel, null, _react["default"].createElement(DragAndDropIconContainer, null, _Icons.dragAndDropIcon), "Drag and Drop area"), _react["default"].createElement(_Button["default"], {
83
- margin: {
84
- right: "small"
85
- },
86
- mode: "text",
87
- label: "CHOOSE FILES",
88
- onClick: handleClick
89
- }), _react["default"].createElement("input", {
90
- id: "chooseFiles",
91
- type: "file",
92
- multiple: true,
93
- onChange: selectFile,
94
- style: {
95
- display: "none"
96
- }
97
- }), _react["default"].createElement(_Button["default"], {
98
- label: "UPLOAD",
99
- iconPosition: "after",
100
- icon: _Icons.uploadIcon,
101
- onClick: onUpload
102
- }))));
103
- };
104
-
105
- DxcButtonsUpload.propTypes = {
106
- addFile: _propTypes["default"].func,
107
- onUpload: _propTypes["default"].func
108
- };
109
-
110
- var DXCButtonsUpload = _styledComponents["default"].div(_templateObject());
111
-
112
- var DragAndDropLabel = _styledComponents["default"].div(_templateObject2(), function (props) {
113
- return props.theme.fontFamily;
114
- }, function (props) {
115
- return props.theme.dragAndDropAreaTextFontSize;
116
- }, function (props) {
117
- return props.theme.dragAndDropAreaTextFontStyle;
118
- }, function (props) {
119
- return props.theme.dragAndDropAreaTextFontWeight;
120
- }, function (props) {
121
- return props.theme.dragAndDropAreaTextFontTextTransform;
122
- }, function (props) {
123
- return props.theme.dragAndDropAreaTextFontColor;
124
- });
125
-
126
- var DragAndDropIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
127
- return props.theme.dragAndDropAreaIconSize;
128
- }, function (props) {
129
- return props.theme.dragAndDropAreaIconSize;
130
- }, function (props) {
131
- return props.theme.dragAndDropAreaIconColor;
132
- });
133
-
134
- var _default = DxcButtonsUpload;
135
- exports["default"] = _default;