@dxc-technology/halstack-react 0.0.0-b3de035 → 0.0.0-b50ba80

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 (421) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +47 -0
  3. package/HalstackContext.d.ts +10 -0
  4. package/HalstackContext.js +243 -0
  5. package/accordion/Accordion.d.ts +4 -0
  6. package/accordion/Accordion.js +226 -0
  7. package/accordion/Accordion.stories.tsx +307 -0
  8. package/accordion/Accordion.test.js +72 -0
  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 +168 -0
  13. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  14. package/accordion-group/AccordionGroup.test.js +151 -0
  15. package/accordion-group/types.d.ts +72 -0
  16. package/accordion-group/types.js +5 -0
  17. package/alert/Alert.d.ts +4 -0
  18. package/{dist/alert → alert}/Alert.js +40 -153
  19. package/alert/Alert.stories.tsx +170 -0
  20. package/alert/Alert.test.js +92 -0
  21. package/alert/types.d.ts +49 -0
  22. package/alert/types.js +5 -0
  23. package/badge/Badge.d.ts +4 -0
  24. package/badge/Badge.js +59 -0
  25. package/badge/types.d.ts +4 -0
  26. package/badge/types.js +5 -0
  27. package/bleed/Bleed.d.ts +3 -0
  28. package/bleed/Bleed.js +84 -0
  29. package/bleed/Bleed.stories.tsx +342 -0
  30. package/bleed/types.d.ts +37 -0
  31. package/bleed/types.js +5 -0
  32. package/box/Box.d.ts +4 -0
  33. package/{dist/box → box}/Box.js +15 -45
  34. package/box/Box.stories.tsx +132 -0
  35. package/box/Box.test.js +18 -0
  36. package/box/types.d.ts +43 -0
  37. package/box/types.js +5 -0
  38. package/button/Button.d.ts +4 -0
  39. package/{dist/button → button}/Button.js +33 -97
  40. package/button/Button.stories.tsx +274 -0
  41. package/button/Button.test.js +35 -0
  42. package/button/types.d.ts +53 -0
  43. package/button/types.js +5 -0
  44. package/card/Card.d.ts +4 -0
  45. package/card/Card.js +163 -0
  46. package/card/Card.stories.tsx +201 -0
  47. package/card/Card.test.js +50 -0
  48. package/card/ice-cream.jpg +0 -0
  49. package/card/types.d.ts +67 -0
  50. package/card/types.js +5 -0
  51. package/checkbox/Checkbox.d.ts +4 -0
  52. package/{dist/checkbox → checkbox}/Checkbox.js +50 -95
  53. package/checkbox/Checkbox.stories.tsx +188 -0
  54. package/checkbox/Checkbox.test.js +78 -0
  55. package/checkbox/types.d.ts +64 -0
  56. package/checkbox/types.js +5 -0
  57. package/chip/Chip.d.ts +4 -0
  58. package/chip/Chip.js +161 -0
  59. package/chip/Chip.stories.tsx +119 -0
  60. package/chip/Chip.test.js +56 -0
  61. package/chip/types.d.ts +45 -0
  62. package/chip/types.js +5 -0
  63. package/{dist/common → common}/OpenSans.css +0 -0
  64. package/{dist/common → common}/RequiredComponent.js +3 -11
  65. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  66. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  67. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  68. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  69. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  70. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  71. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  72. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  73. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  74. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  75. package/{dist/common → common}/utils.js +0 -0
  76. package/{dist/common → common}/variables.js +141 -339
  77. package/date-input/DateInput.d.ts +4 -0
  78. package/{dist/date-input → date-input}/DateInput.js +77 -108
  79. package/date-input/DateInput.stories.tsx +138 -0
  80. package/date-input/DateInput.test.js +479 -0
  81. package/date-input/types.d.ts +107 -0
  82. package/date-input/types.js +5 -0
  83. package/dialog/Dialog.d.ts +4 -0
  84. package/dialog/Dialog.js +138 -0
  85. package/dialog/Dialog.stories.tsx +212 -0
  86. package/dialog/Dialog.test.js +40 -0
  87. package/dialog/types.d.ts +43 -0
  88. package/dialog/types.js +5 -0
  89. package/dropdown/Dropdown.d.ts +4 -0
  90. package/{dist/dropdown → dropdown}/Dropdown.js +54 -207
  91. package/dropdown/Dropdown.stories.tsx +249 -0
  92. package/dropdown/Dropdown.test.js +189 -0
  93. package/dropdown/types.d.ts +80 -0
  94. package/dropdown/types.js +5 -0
  95. package/file-input/FileInput.d.ts +4 -0
  96. package/file-input/FileInput.js +590 -0
  97. package/file-input/FileInput.stories.tsx +507 -0
  98. package/file-input/FileInput.test.js +457 -0
  99. package/file-input/FileItem.d.ts +14 -0
  100. package/file-input/FileItem.js +186 -0
  101. package/file-input/types.d.ts +112 -0
  102. package/file-input/types.js +5 -0
  103. package/footer/Footer.d.ts +4 -0
  104. package/footer/Footer.js +183 -0
  105. package/footer/Footer.stories.tsx +130 -0
  106. package/footer/Footer.test.js +109 -0
  107. package/footer/Icons.d.ts +2 -0
  108. package/{dist/footer → footer}/Icons.js +15 -15
  109. package/footer/types.d.ts +65 -0
  110. package/footer/types.js +5 -0
  111. package/header/Header.d.ts +7 -0
  112. package/header/Header.js +300 -0
  113. package/header/Header.stories.tsx +172 -0
  114. package/header/Header.test.js +79 -0
  115. package/header/Icons.d.ts +2 -0
  116. package/{dist/header → header}/Icons.js +7 -32
  117. package/header/types.d.ts +47 -0
  118. package/header/types.js +5 -0
  119. package/heading/Heading.d.ts +4 -0
  120. package/{dist/heading → heading}/Heading.js +25 -96
  121. package/heading/Heading.stories.tsx +54 -0
  122. package/heading/Heading.test.js +186 -0
  123. package/heading/types.d.ts +33 -0
  124. package/heading/types.js +5 -0
  125. package/inset/Inset.d.ts +3 -0
  126. package/inset/Inset.js +84 -0
  127. package/inset/Inset.stories.tsx +229 -0
  128. package/inset/types.d.ts +37 -0
  129. package/inset/types.js +5 -0
  130. package/layout/ApplicationLayout.d.ts +10 -0
  131. package/layout/ApplicationLayout.js +218 -0
  132. package/layout/ApplicationLayout.stories.tsx +171 -0
  133. package/{dist/layout → layout}/Icons.js +7 -7
  134. package/layout/types.d.ts +57 -0
  135. package/layout/types.js +5 -0
  136. package/link/Link.d.ts +4 -0
  137. package/link/Link.js +162 -0
  138. package/link/Link.stories.tsx +186 -0
  139. package/link/Link.test.js +83 -0
  140. package/link/types.d.ts +55 -0
  141. package/link/types.js +5 -0
  142. package/list/List.d.ts +4 -0
  143. package/list/List.js +47 -0
  144. package/list/List.stories.tsx +95 -0
  145. package/list/types.d.ts +7 -0
  146. package/list/types.js +5 -0
  147. package/main.d.ts +47 -0
  148. package/{dist/main.js → main.js} +124 -96
  149. package/number-input/NumberInput.d.ts +4 -0
  150. package/number-input/NumberInput.js +76 -0
  151. package/number-input/NumberInput.stories.tsx +115 -0
  152. package/number-input/NumberInput.test.js +506 -0
  153. package/number-input/NumberInputContext.d.ts +4 -0
  154. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  155. package/number-input/numberInputContextTypes.d.ts +19 -0
  156. package/number-input/numberInputContextTypes.js +5 -0
  157. package/number-input/types.d.ts +124 -0
  158. package/number-input/types.js +5 -0
  159. package/package.json +34 -20
  160. package/{dist/paginator → paginator}/Icons.js +9 -9
  161. package/paginator/Paginator.d.ts +4 -0
  162. package/paginator/Paginator.js +192 -0
  163. package/paginator/Paginator.stories.tsx +63 -0
  164. package/paginator/Paginator.test.js +266 -0
  165. package/paginator/types.d.ts +38 -0
  166. package/paginator/types.js +5 -0
  167. package/password-input/PasswordInput.d.ts +4 -0
  168. package/{dist/password-input → password-input}/PasswordInput.js +37 -77
  169. package/password-input/PasswordInput.stories.tsx +131 -0
  170. package/password-input/PasswordInput.test.js +181 -0
  171. package/password-input/types.d.ts +110 -0
  172. package/password-input/types.js +5 -0
  173. package/progress-bar/ProgressBar.d.ts +4 -0
  174. package/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
  175. package/progress-bar/ProgressBar.stories.jsx +58 -0
  176. package/progress-bar/ProgressBar.test.js +65 -0
  177. package/progress-bar/types.d.ts +37 -0
  178. package/progress-bar/types.js +5 -0
  179. package/quick-nav/QuickNav.d.ts +4 -0
  180. package/quick-nav/QuickNav.js +67 -0
  181. package/quick-nav/QuickNav.stories.tsx +237 -0
  182. package/quick-nav/types.d.ts +21 -0
  183. package/quick-nav/types.js +5 -0
  184. package/radio/Radio.d.ts +4 -0
  185. package/{dist/radio → radio}/Radio.js +23 -59
  186. package/radio/Radio.stories.tsx +192 -0
  187. package/radio/Radio.test.js +71 -0
  188. package/radio/types.d.ts +54 -0
  189. package/radio/types.js +5 -0
  190. package/radio-group/Radio.d.ts +4 -0
  191. package/radio-group/Radio.js +141 -0
  192. package/radio-group/RadioGroup.d.ts +4 -0
  193. package/radio-group/RadioGroup.js +280 -0
  194. package/radio-group/RadioGroup.stories.tsx +100 -0
  195. package/radio-group/RadioGroup.test.js +695 -0
  196. package/radio-group/types.d.ts +114 -0
  197. package/radio-group/types.js +5 -0
  198. package/resultsetTable/ResultsetTable.d.ts +4 -0
  199. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +43 -147
  200. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  201. package/resultsetTable/ResultsetTable.test.js +306 -0
  202. package/resultsetTable/types.d.ts +67 -0
  203. package/resultsetTable/types.js +5 -0
  204. package/row/Row.d.ts +3 -0
  205. package/row/Row.js +127 -0
  206. package/row/Row.stories.tsx +237 -0
  207. package/row/types.d.ts +28 -0
  208. package/row/types.js +5 -0
  209. package/select/Icons.d.ts +10 -0
  210. package/select/Icons.js +93 -0
  211. package/select/Listbox.d.ts +4 -0
  212. package/select/Listbox.js +149 -0
  213. package/select/Option.d.ts +4 -0
  214. package/select/Option.js +110 -0
  215. package/select/Select.d.ts +4 -0
  216. package/select/Select.js +655 -0
  217. package/select/Select.stories.tsx +582 -0
  218. package/select/Select.test.js +2057 -0
  219. package/select/types.d.ts +213 -0
  220. package/select/types.js +5 -0
  221. package/sidenav/Sidenav.d.ts +9 -0
  222. package/{dist/sidenav → sidenav}/Sidenav.js +21 -64
  223. package/sidenav/Sidenav.stories.tsx +182 -0
  224. package/sidenav/Sidenav.test.js +56 -0
  225. package/sidenav/types.d.ts +50 -0
  226. package/sidenav/types.js +5 -0
  227. package/slider/Slider.d.ts +4 -0
  228. package/{dist/slider → slider}/Slider.js +76 -162
  229. package/slider/Slider.stories.tsx +177 -0
  230. package/slider/Slider.test.js +150 -0
  231. package/slider/types.d.ts +82 -0
  232. package/slider/types.js +5 -0
  233. package/spinner/Spinner.d.ts +4 -0
  234. package/spinner/Spinner.js +250 -0
  235. package/spinner/Spinner.stories.jsx +103 -0
  236. package/spinner/Spinner.test.js +64 -0
  237. package/spinner/types.d.ts +32 -0
  238. package/spinner/types.js +5 -0
  239. package/stack/Stack.d.ts +3 -0
  240. package/stack/Stack.js +97 -0
  241. package/stack/Stack.stories.tsx +164 -0
  242. package/stack/types.d.ts +24 -0
  243. package/stack/types.js +5 -0
  244. package/switch/Switch.d.ts +4 -0
  245. package/switch/Switch.js +192 -0
  246. package/switch/Switch.stories.tsx +160 -0
  247. package/switch/Switch.test.js +98 -0
  248. package/switch/types.d.ts +62 -0
  249. package/switch/types.js +5 -0
  250. package/table/Table.d.ts +4 -0
  251. package/{dist/table → table}/Table.js +12 -26
  252. package/table/Table.stories.jsx +277 -0
  253. package/table/Table.test.js +26 -0
  254. package/table/types.d.ts +21 -0
  255. package/table/types.js +5 -0
  256. package/tabs/Tabs.d.ts +4 -0
  257. package/tabs/Tabs.js +211 -0
  258. package/tabs/Tabs.stories.tsx +112 -0
  259. package/tabs/Tabs.test.js +140 -0
  260. package/tabs/types.d.ts +82 -0
  261. package/tabs/types.js +5 -0
  262. package/tag/Tag.d.ts +4 -0
  263. package/tag/Tag.js +183 -0
  264. package/tag/Tag.stories.tsx +142 -0
  265. package/tag/Tag.test.js +60 -0
  266. package/tag/types.d.ts +69 -0
  267. package/tag/types.js +5 -0
  268. package/text/Text.d.ts +7 -0
  269. package/text/Text.js +30 -0
  270. package/text/Text.stories.tsx +19 -0
  271. package/text-input/Suggestion.d.ts +4 -0
  272. package/text-input/Suggestion.js +55 -0
  273. package/text-input/TextInput.d.ts +4 -0
  274. package/{dist/text-input → text-input}/TextInput.js +280 -483
  275. package/text-input/TextInput.stories.tsx +474 -0
  276. package/text-input/TextInput.test.js +1712 -0
  277. package/text-input/types.d.ts +178 -0
  278. package/text-input/types.js +5 -0
  279. package/textarea/Textarea.d.ts +4 -0
  280. package/{dist/textarea → textarea}/Textarea.js +48 -131
  281. package/textarea/Textarea.stories.jsx +157 -0
  282. package/textarea/Textarea.test.js +437 -0
  283. package/textarea/types.d.ts +137 -0
  284. package/textarea/types.js +5 -0
  285. package/toggle-group/ToggleGroup.d.ts +4 -0
  286. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +36 -148
  287. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  288. package/toggle-group/ToggleGroup.test.js +156 -0
  289. package/toggle-group/types.d.ts +105 -0
  290. package/toggle-group/types.js +5 -0
  291. package/useTheme.d.ts +2 -0
  292. package/{dist/useTheme.js → useTheme.js} +2 -2
  293. package/wizard/Wizard.d.ts +4 -0
  294. package/wizard/Wizard.js +290 -0
  295. package/wizard/Wizard.stories.tsx +214 -0
  296. package/wizard/Wizard.test.js +141 -0
  297. package/wizard/types.d.ts +64 -0
  298. package/wizard/types.js +5 -0
  299. package/README.md +0 -66
  300. package/babel.config.js +0 -8
  301. package/dist/BackgroundColorContext.js +0 -46
  302. package/dist/ThemeContext.js +0 -250
  303. package/dist/V3Select/V3Select.js +0 -549
  304. package/dist/V3Select/index.d.ts +0 -27
  305. package/dist/V3Textarea/V3Textarea.js +0 -264
  306. package/dist/V3Textarea/index.d.ts +0 -27
  307. package/dist/accordion/Accordion.js +0 -353
  308. package/dist/accordion/index.d.ts +0 -28
  309. package/dist/accordion-group/AccordionGroup.js +0 -186
  310. package/dist/accordion-group/index.d.ts +0 -16
  311. package/dist/alert/index.d.ts +0 -51
  312. package/dist/badge/Badge.js +0 -63
  313. package/dist/box/index.d.ts +0 -25
  314. package/dist/button/index.d.ts +0 -24
  315. package/dist/card/Card.js +0 -254
  316. package/dist/card/index.d.ts +0 -22
  317. package/dist/checkbox/index.d.ts +0 -24
  318. package/dist/chip/Chip.js +0 -265
  319. package/dist/chip/index.d.ts +0 -22
  320. package/dist/date/Date.js +0 -379
  321. package/dist/date/index.d.ts +0 -27
  322. package/dist/date-input/index.d.ts +0 -95
  323. package/dist/dialog/Dialog.js +0 -218
  324. package/dist/dialog/index.d.ts +0 -18
  325. package/dist/dropdown/index.d.ts +0 -26
  326. package/dist/file-input/FileInput.js +0 -644
  327. package/dist/file-input/FileItem.js +0 -287
  328. package/dist/file-input/index.d.ts +0 -81
  329. package/dist/footer/Footer.js +0 -421
  330. package/dist/footer/index.d.ts +0 -25
  331. package/dist/header/Header.js +0 -470
  332. package/dist/header/index.d.ts +0 -25
  333. package/dist/heading/index.d.ts +0 -17
  334. package/dist/input-text/Icons.js +0 -22
  335. package/dist/input-text/InputText.js +0 -705
  336. package/dist/input-text/index.d.ts +0 -36
  337. package/dist/layout/ApplicationLayout.js +0 -327
  338. package/dist/link/Link.js +0 -237
  339. package/dist/link/index.d.ts +0 -23
  340. package/dist/main.d.ts +0 -40
  341. package/dist/number-input/NumberInput.js +0 -136
  342. package/dist/number-input/index.d.ts +0 -113
  343. package/dist/paginator/Paginator.js +0 -283
  344. package/dist/paginator/index.d.ts +0 -20
  345. package/dist/password-input/index.d.ts +0 -94
  346. package/dist/progress-bar/index.d.ts +0 -18
  347. package/dist/radio/index.d.ts +0 -23
  348. package/dist/resultsetTable/index.d.ts +0 -19
  349. package/dist/select/Select.js +0 -1069
  350. package/dist/select/index.d.ts +0 -53
  351. package/dist/sidenav/index.d.ts +0 -13
  352. package/dist/slider/index.d.ts +0 -29
  353. package/dist/spinner/Spinner.js +0 -381
  354. package/dist/spinner/index.d.ts +0 -17
  355. package/dist/switch/Switch.js +0 -222
  356. package/dist/switch/index.d.ts +0 -24
  357. package/dist/table/index.d.ts +0 -13
  358. package/dist/tabs/Tabs.js +0 -343
  359. package/dist/tabs/index.d.ts +0 -19
  360. package/dist/tag/Tag.js +0 -282
  361. package/dist/tag/index.d.ts +0 -24
  362. package/dist/text-input/index.d.ts +0 -135
  363. package/dist/textarea/index.d.ts +0 -117
  364. package/dist/toggle/Toggle.js +0 -220
  365. package/dist/toggle/index.d.ts +0 -21
  366. package/dist/toggle-group/index.d.ts +0 -21
  367. package/dist/upload/Upload.js +0 -205
  368. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
  369. package/dist/upload/buttons-upload/Icons.js +0 -40
  370. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  371. package/dist/upload/dragAndDropArea/Icons.js +0 -39
  372. package/dist/upload/file-upload/FileToUpload.js +0 -189
  373. package/dist/upload/file-upload/Icons.js +0 -66
  374. package/dist/upload/files-upload/FilesToUpload.js +0 -123
  375. package/dist/upload/index.d.ts +0 -15
  376. package/dist/upload/transaction/Icons.js +0 -160
  377. package/dist/upload/transaction/Transaction.js +0 -148
  378. package/dist/upload/transactions/Transactions.js +0 -138
  379. package/dist/wizard/Icons.js +0 -65
  380. package/dist/wizard/Wizard.js +0 -405
  381. package/dist/wizard/index.d.ts +0 -18
  382. package/test/Accordion.test.js +0 -33
  383. package/test/AccordionGroup.test.js +0 -125
  384. package/test/Alert.test.js +0 -53
  385. package/test/Box.test.js +0 -10
  386. package/test/Button.test.js +0 -18
  387. package/test/Card.test.js +0 -30
  388. package/test/Checkbox.test.js +0 -45
  389. package/test/Chip.test.js +0 -25
  390. package/test/Date.test.js +0 -395
  391. package/test/DateInput.test.js +0 -242
  392. package/test/Dialog.test.js +0 -23
  393. package/test/Dropdown.test.js +0 -145
  394. package/test/FileInput.test.js +0 -201
  395. package/test/Footer.test.js +0 -94
  396. package/test/Header.test.js +0 -34
  397. package/test/Heading.test.js +0 -83
  398. package/test/InputText.test.js +0 -248
  399. package/test/Link.test.js +0 -43
  400. package/test/NumberInput.test.js +0 -259
  401. package/test/Paginator.test.js +0 -177
  402. package/test/PasswordInput.test.js +0 -83
  403. package/test/ProgressBar.test.js +0 -35
  404. package/test/Radio.test.js +0 -37
  405. package/test/ResultsetTable.test.js +0 -329
  406. package/test/Sidenav.test.js +0 -45
  407. package/test/Slider.test.js +0 -74
  408. package/test/Spinner.test.js +0 -32
  409. package/test/Switch.test.js +0 -45
  410. package/test/Table.test.js +0 -36
  411. package/test/Tabs.test.js +0 -109
  412. package/test/Tag.test.js +0 -32
  413. package/test/TextInput.test.js +0 -732
  414. package/test/Textarea.test.js +0 -193
  415. package/test/ToggleGroup.test.js +0 -85
  416. package/test/Upload.test.js +0 -60
  417. package/test/V3Select.test.js +0 -212
  418. package/test/V3TextArea.test.js +0 -51
  419. package/test/Wizard.test.js +0 -130
  420. package/test/mocks/pngMock.js +0 -1
  421. package/test/mocks/svgMock.js +0 -1
package/dist/tag/Tag.js DELETED
@@ -1,282 +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 _Box = _interopRequireDefault(require("../box/Box"));
31
-
32
- function _templateObject8() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"]);
34
-
35
- _templateObject8 = function _templateObject8() {
36
- return data;
37
- };
38
-
39
- return data;
40
- }
41
-
42
- function _templateObject7() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width: ", ";\n height: 100%;\n justify-content: center;\n align-items: center;\n color: ", ";\n"]);
44
-
45
- _templateObject7 = function _templateObject7() {
46
- return data;
47
- };
48
-
49
- return data;
50
- }
51
-
52
- function _templateObject6() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n\n img,\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
54
-
55
- _templateObject6 = function _templateObject6() {
56
- return data;
57
- };
58
-
59
- return data;
60
- }
61
-
62
- function _templateObject5() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n width: ", ";\n height: ", ";\n"]);
64
-
65
- _templateObject5 = function _templateObject5() {
66
- return data;
67
- };
68
-
69
- return data;
70
- }
71
-
72
- function _templateObject4() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border-radius: 4px;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n\n :focus {\n outline: 2px solid ", ";\n }\n"]);
74
-
75
- _templateObject4 = function _templateObject4() {
76
- return data;
77
- };
78
-
79
- return data;
80
- }
81
-
82
- function _templateObject3() {
83
- var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n border-radius: 4px;\n\n :focus {\n outline: 2px solid ", ";\n outline-offset: 0px;\n }\n"]);
84
-
85
- _templateObject3 = function _templateObject3() {
86
- return data;
87
- };
88
-
89
- return data;
90
- }
91
-
92
- function _templateObject2() {
93
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n width: ", ";\n height: ", ";\n"]);
94
-
95
- _templateObject2 = function _templateObject2() {
96
- return data;
97
- };
98
-
99
- return data;
100
- }
101
-
102
- function _templateObject() {
103
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
104
-
105
- _templateObject = function _templateObject() {
106
- return data;
107
- };
108
-
109
- return data;
110
- }
111
-
112
- var DxcTag = function DxcTag(_ref) {
113
- var icon = _ref.icon,
114
- iconSrc = _ref.iconSrc,
115
- label = _ref.label,
116
- margin = _ref.margin,
117
- linkHref = _ref.linkHref,
118
- onClick = _ref.onClick,
119
- _ref$iconBgColor = _ref.iconBgColor,
120
- iconBgColor = _ref$iconBgColor === void 0 ? "#5f249f" : _ref$iconBgColor,
121
- _ref$labelPosition = _ref.labelPosition,
122
- labelPosition = _ref$labelPosition === void 0 ? "after" : _ref$labelPosition,
123
- _ref$newWindow = _ref.newWindow,
124
- newWindow = _ref$newWindow === void 0 ? false : _ref$newWindow,
125
- _ref$size = _ref.size,
126
- size = _ref$size === void 0 ? "fitContent" : _ref$size,
127
- _ref$tabIndex = _ref.tabIndex,
128
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
129
- var colorsTheme = (0, _useTheme["default"])();
130
-
131
- var _useState = (0, _react.useState)(false),
132
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
133
- isHovered = _useState2[0],
134
- changeIsHovered = _useState2[1];
135
-
136
- var clickHandler = function clickHandler() {
137
- onClick && onClick();
138
- };
139
-
140
- var tagContent = _react["default"].createElement(_Box["default"], {
141
- size: size,
142
- shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
143
- }, _react["default"].createElement(TagContent, {
144
- labelPosition: labelPosition,
145
- size: size
146
- }, _react["default"].createElement(IconContainer, {
147
- iconBgColor: iconBgColor
148
- }, icon ? _react["default"].createElement(TagIconContainer, null, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : _react["default"].createElement(TagIcon, {
149
- src: iconSrc
150
- })), size !== "small" && _react["default"].createElement(TagLabel, null, label)));
151
-
152
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
153
- theme: colorsTheme.tag
154
- }, _react["default"].createElement(StyledDxcTag, {
155
- margin: margin,
156
- onMouseEnter: function onMouseEnter() {
157
- return changeIsHovered(true);
158
- },
159
- onMouseLeave: function onMouseLeave() {
160
- return changeIsHovered(false);
161
- },
162
- onClick: clickHandler,
163
- hasAction: onClick || linkHref
164
- }, onClick ? _react["default"].createElement(StyledButton, {
165
- tabIndex: tabIndex
166
- }, tagContent) : linkHref ? _react["default"].createElement(StyledLink, {
167
- tabIndex: tabIndex,
168
- href: linkHref,
169
- target: newWindow ? "_blank" : "_self"
170
- }, tagContent) : tagContent));
171
- };
172
-
173
- var sizes = {
174
- small: "42px",
175
- medium: "240px",
176
- large: "480px",
177
- fillParent: "100%",
178
- fitContent: "unset"
179
- };
180
-
181
- var calculateWidth = function calculateWidth(size) {
182
- return sizes[size];
183
- };
184
-
185
- var StyledDxcTag = _styledComponents["default"].div(_templateObject(), function (_ref2) {
186
- var hasAction = _ref2.hasAction;
187
- return hasAction && "pointer" || "unset";
188
- }, function (_ref3) {
189
- var margin = _ref3.margin;
190
- return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
191
- }, function (_ref4) {
192
- var margin = _ref4.margin;
193
- return margin && margin.top ? _variables.spaces[margin.top] : "";
194
- }, function (_ref5) {
195
- var margin = _ref5.margin;
196
- return margin && margin.right ? _variables.spaces[margin.right] : "";
197
- }, function (_ref6) {
198
- var margin = _ref6.margin;
199
- return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
200
- }, function (_ref7) {
201
- var margin = _ref7.margin;
202
- return margin && margin.left ? _variables.spaces[margin.left] : "";
203
- });
204
-
205
- var TagContent = _styledComponents["default"].div(_templateObject2(), function (_ref8) {
206
- var labelPosition = _ref8.labelPosition;
207
- return labelPosition === "before" && "row-reverse" || "row";
208
- }, function (props) {
209
- return calculateWidth(props.size);
210
- }, function (props) {
211
- return props.theme.height;
212
- });
213
-
214
- var StyledLink = _styledComponents["default"].a(_templateObject3(), function (props) {
215
- return props.theme.focusColor;
216
- });
217
-
218
- var StyledButton = _styledComponents["default"].button(_templateObject4(), function (props) {
219
- return props.theme.focusColor;
220
- });
221
-
222
- var TagIcon = _styledComponents["default"].img(_templateObject5(), function (props) {
223
- return props.theme.iconWidth;
224
- }, function (props) {
225
- return props.theme.iconHeight;
226
- });
227
-
228
- var TagIconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
229
- return props.theme.iconWidth;
230
- }, function (props) {
231
- return props.theme.iconHeight;
232
- });
233
-
234
- var IconContainer = _styledComponents["default"].div(_templateObject7(), function (_ref9) {
235
- var iconBgColor = _ref9.iconBgColor;
236
- return iconBgColor;
237
- }, function (props) {
238
- return props.theme.iconSectionWidth;
239
- }, function (props) {
240
- return props.theme.iconColor;
241
- });
242
-
243
- var TagLabel = _styledComponents["default"].div(_templateObject8(), function (props) {
244
- return props.theme.fontFamily;
245
- }, function (props) {
246
- return props.theme.fontSize;
247
- }, function (props) {
248
- return props.theme.fontStyle;
249
- }, function (props) {
250
- return props.theme.fontWeight;
251
- }, function (props) {
252
- return props.theme.fontColor;
253
- }, function (props) {
254
- return props.theme.labelPaddingTop;
255
- }, function (props) {
256
- return props.theme.labelPaddingBottom;
257
- }, function (props) {
258
- return props.theme.labelPaddingLeft;
259
- }, function (props) {
260
- return props.theme.labelPaddingRight;
261
- });
262
-
263
- DxcTag.propTypes = {
264
- size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
265
- icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
266
- iconSrc: _propTypes["default"].string,
267
- iconBgColor: _propTypes["default"].string,
268
- label: _propTypes["default"].string,
269
- labelPosition: _propTypes["default"].oneOf(["before", "after"]),
270
- linkHref: _propTypes["default"].string,
271
- onClick: _propTypes["default"].func,
272
- newWindow: _propTypes["default"].bool,
273
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
274
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
275
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
276
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
277
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
278
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
279
- tabIndex: _propTypes["default"].number
280
- };
281
- var _default = DxcTag;
282
- exports["default"] = _default;
@@ -1,24 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
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
- icon?: any;
12
- iconSrc?: string;
13
- label?: string;
14
- linkHref?: string;
15
- onClick?: void,
16
- iconBgColor?: string;
17
- labelPosition?: "before" | "after";
18
- newWindow?: boolean;
19
- margin?: Space | Margin;
20
- size?: Size;
21
- tabIndex?: number;
22
- };
23
-
24
- export default function DxcTag(props: Props): JSX.Element;
@@ -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;