@dxc-technology/halstack-react 0.0.0-a0543ea → 0.0.0-a062293

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 (491) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +47 -0
  3. package/HalstackContext.d.ts +12 -0
  4. package/HalstackContext.js +294 -0
  5. package/accordion/Accordion.d.ts +4 -0
  6. package/accordion/Accordion.js +239 -0
  7. package/accordion/Accordion.stories.tsx +346 -0
  8. package/accordion/Accordion.test.js +71 -0
  9. package/accordion/types.d.ts +69 -0
  10. package/accordion/types.js +5 -0
  11. package/accordion-group/AccordionGroup.d.ts +7 -0
  12. package/accordion-group/AccordionGroup.js +149 -0
  13. package/accordion-group/AccordionGroup.stories.tsx +251 -0
  14. package/accordion-group/AccordionGroup.test.js +126 -0
  15. package/accordion-group/types.d.ts +79 -0
  16. package/accordion-group/types.js +5 -0
  17. package/alert/Alert.d.ts +4 -0
  18. package/{dist/alert → alert}/Alert.js +44 -154
  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 +61 -0
  25. package/badge/types.d.ts +5 -0
  26. package/badge/types.js +5 -0
  27. package/bleed/Bleed.d.ts +3 -0
  28. package/bleed/Bleed.js +51 -0
  29. package/bleed/Bleed.stories.tsx +341 -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/box/Box.js +116 -0
  34. package/box/Box.stories.tsx +132 -0
  35. package/box/Box.test.js +18 -0
  36. package/box/types.d.ts +44 -0
  37. package/box/types.js +5 -0
  38. package/bulleted-list/BulletedList.d.ts +7 -0
  39. package/bulleted-list/BulletedList.js +123 -0
  40. package/bulleted-list/BulletedList.stories.tsx +200 -0
  41. package/bulleted-list/types.d.ts +11 -0
  42. package/bulleted-list/types.js +5 -0
  43. package/button/Button.d.ts +4 -0
  44. package/button/Button.js +154 -0
  45. package/button/Button.stories.tsx +334 -0
  46. package/button/Button.test.js +35 -0
  47. package/button/types.d.ts +53 -0
  48. package/button/types.js +5 -0
  49. package/card/Card.d.ts +4 -0
  50. package/card/Card.js +161 -0
  51. package/card/Card.stories.tsx +201 -0
  52. package/card/Card.test.js +50 -0
  53. package/card/ice-cream.jpg +0 -0
  54. package/card/types.d.ts +68 -0
  55. package/card/types.js +5 -0
  56. package/checkbox/Checkbox.d.ts +4 -0
  57. package/checkbox/Checkbox.js +250 -0
  58. package/checkbox/Checkbox.stories.tsx +208 -0
  59. package/checkbox/Checkbox.test.js +155 -0
  60. package/checkbox/types.d.ts +68 -0
  61. package/checkbox/types.js +5 -0
  62. package/chip/Chip.d.ts +4 -0
  63. package/chip/Chip.js +149 -0
  64. package/chip/Chip.stories.tsx +151 -0
  65. package/chip/Chip.test.js +56 -0
  66. package/chip/types.d.ts +45 -0
  67. package/chip/types.js +5 -0
  68. package/{dist/common → common}/OpenSans.css +0 -0
  69. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  70. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  71. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  72. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  73. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  74. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  75. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  76. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  77. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  78. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  79. package/{dist/common → common}/utils.js +0 -0
  80. package/{dist/common → common}/variables.js +477 -534
  81. package/date-input/Calendar.d.ts +4 -0
  82. package/date-input/Calendar.js +246 -0
  83. package/date-input/DateInput.d.ts +4 -0
  84. package/date-input/DateInput.js +269 -0
  85. package/date-input/DateInput.stories.tsx +237 -0
  86. package/date-input/DateInput.test.js +835 -0
  87. package/date-input/DatePicker.d.ts +4 -0
  88. package/date-input/DatePicker.js +132 -0
  89. package/date-input/Icons.d.ts +6 -0
  90. package/date-input/Icons.js +75 -0
  91. package/date-input/YearPicker.d.ts +4 -0
  92. package/date-input/YearPicker.js +116 -0
  93. package/date-input/types.d.ts +158 -0
  94. package/date-input/types.js +5 -0
  95. package/dialog/Dialog.d.ts +4 -0
  96. package/dialog/Dialog.js +162 -0
  97. package/dialog/Dialog.stories.tsx +267 -0
  98. package/dialog/Dialog.test.js +70 -0
  99. package/dialog/types.d.ts +44 -0
  100. package/dialog/types.js +5 -0
  101. package/dropdown/Dropdown.d.ts +4 -0
  102. package/dropdown/Dropdown.js +389 -0
  103. package/dropdown/Dropdown.stories.tsx +320 -0
  104. package/dropdown/Dropdown.test.js +585 -0
  105. package/dropdown/DropdownMenu.d.ts +4 -0
  106. package/dropdown/DropdownMenu.js +80 -0
  107. package/dropdown/DropdownMenuItem.d.ts +4 -0
  108. package/dropdown/DropdownMenuItem.js +92 -0
  109. package/dropdown/types.d.ts +100 -0
  110. package/dropdown/types.js +5 -0
  111. package/file-input/FileInput.d.ts +4 -0
  112. package/file-input/FileInput.js +551 -0
  113. package/file-input/FileInput.stories.tsx +535 -0
  114. package/file-input/FileInput.test.js +498 -0
  115. package/file-input/FileItem.d.ts +4 -0
  116. package/file-input/FileItem.js +161 -0
  117. package/file-input/types.d.ts +129 -0
  118. package/file-input/types.js +5 -0
  119. package/flex/Flex.d.ts +4 -0
  120. package/flex/Flex.js +69 -0
  121. package/flex/Flex.stories.tsx +103 -0
  122. package/flex/types.d.ts +32 -0
  123. package/flex/types.js +5 -0
  124. package/footer/Footer.d.ts +4 -0
  125. package/footer/Footer.js +185 -0
  126. package/footer/Footer.stories.tsx +137 -0
  127. package/footer/Footer.test.js +109 -0
  128. package/footer/Icons.d.ts +2 -0
  129. package/footer/Icons.js +77 -0
  130. package/footer/types.d.ts +66 -0
  131. package/footer/types.js +5 -0
  132. package/header/Header.d.ts +7 -0
  133. package/header/Header.js +305 -0
  134. package/header/Header.stories.tsx +172 -0
  135. package/header/Header.test.js +79 -0
  136. package/header/Icons.d.ts +2 -0
  137. package/header/Icons.js +34 -0
  138. package/header/types.d.ts +48 -0
  139. package/header/types.js +5 -0
  140. package/heading/Heading.d.ts +4 -0
  141. package/{dist/heading → heading}/Heading.js +31 -90
  142. package/heading/Heading.stories.tsx +54 -0
  143. package/heading/Heading.test.js +186 -0
  144. package/heading/types.d.ts +33 -0
  145. package/heading/types.js +5 -0
  146. package/inset/Inset.d.ts +3 -0
  147. package/inset/Inset.js +51 -0
  148. package/inset/Inset.stories.tsx +229 -0
  149. package/inset/types.d.ts +37 -0
  150. package/inset/types.js +5 -0
  151. package/layout/ApplicationLayout.d.ts +20 -0
  152. package/layout/ApplicationLayout.js +171 -0
  153. package/layout/ApplicationLayout.stories.tsx +162 -0
  154. package/layout/Icons.d.ts +5 -0
  155. package/layout/Icons.js +66 -0
  156. package/layout/SidenavContext.d.ts +5 -0
  157. package/layout/SidenavContext.js +19 -0
  158. package/layout/types.d.ts +42 -0
  159. package/layout/types.js +5 -0
  160. package/link/Link.d.ts +4 -0
  161. package/link/Link.js +136 -0
  162. package/link/Link.stories.tsx +193 -0
  163. package/link/Link.test.js +83 -0
  164. package/link/types.d.ts +54 -0
  165. package/link/types.js +5 -0
  166. package/main.d.ts +44 -0
  167. package/{dist/main.js → main.js} +116 -114
  168. package/number-input/NumberInput.d.ts +4 -0
  169. package/number-input/NumberInput.js +76 -0
  170. package/number-input/NumberInput.stories.tsx +115 -0
  171. package/number-input/NumberInput.test.js +542 -0
  172. package/number-input/NumberInputContext.d.ts +4 -0
  173. package/{dist/number/NumberContext.js → number-input/NumberInputContext.js} +6 -3
  174. package/number-input/numberInputContextTypes.d.ts +19 -0
  175. package/number-input/numberInputContextTypes.js +5 -0
  176. package/number-input/types.d.ts +124 -0
  177. package/number-input/types.js +5 -0
  178. package/package.json +46 -40
  179. package/paginator/Icons.d.ts +5 -0
  180. package/paginator/Icons.js +54 -0
  181. package/paginator/Paginator.d.ts +4 -0
  182. package/paginator/Paginator.js +165 -0
  183. package/paginator/Paginator.stories.tsx +63 -0
  184. package/paginator/Paginator.test.js +315 -0
  185. package/paginator/types.d.ts +38 -0
  186. package/paginator/types.js +5 -0
  187. package/paragraph/Paragraph.d.ts +6 -0
  188. package/paragraph/Paragraph.js +38 -0
  189. package/paragraph/Paragraph.stories.tsx +44 -0
  190. package/password-input/PasswordInput.d.ts +4 -0
  191. package/{dist/password/Password.js → password-input/PasswordInput.js} +47 -81
  192. package/password-input/PasswordInput.stories.tsx +131 -0
  193. package/password-input/PasswordInput.test.js +181 -0
  194. package/password-input/types.d.ts +110 -0
  195. package/password-input/types.js +5 -0
  196. package/progress-bar/ProgressBar.d.ts +4 -0
  197. package/progress-bar/ProgressBar.js +176 -0
  198. package/progress-bar/ProgressBar.stories.jsx +60 -0
  199. package/progress-bar/ProgressBar.test.js +110 -0
  200. package/progress-bar/types.d.ts +36 -0
  201. package/progress-bar/types.js +5 -0
  202. package/quick-nav/QuickNav.d.ts +4 -0
  203. package/quick-nav/QuickNav.js +117 -0
  204. package/quick-nav/QuickNav.stories.tsx +342 -0
  205. package/quick-nav/types.d.ts +21 -0
  206. package/quick-nav/types.js +5 -0
  207. package/radio-group/Radio.d.ts +4 -0
  208. package/radio-group/Radio.js +156 -0
  209. package/radio-group/RadioGroup.d.ts +4 -0
  210. package/radio-group/RadioGroup.js +283 -0
  211. package/radio-group/RadioGroup.stories.tsx +101 -0
  212. package/radio-group/RadioGroup.test.js +722 -0
  213. package/radio-group/types.d.ts +114 -0
  214. package/radio-group/types.js +5 -0
  215. package/resultsetTable/Icons.d.ts +7 -0
  216. package/resultsetTable/Icons.js +51 -0
  217. package/resultsetTable/ResultsetTable.d.ts +4 -0
  218. package/resultsetTable/ResultsetTable.js +195 -0
  219. package/resultsetTable/ResultsetTable.stories.tsx +300 -0
  220. package/resultsetTable/ResultsetTable.test.js +325 -0
  221. package/resultsetTable/types.d.ts +67 -0
  222. package/resultsetTable/types.js +5 -0
  223. package/select/Icons.d.ts +10 -0
  224. package/select/Icons.js +93 -0
  225. package/select/Listbox.d.ts +4 -0
  226. package/select/Listbox.js +169 -0
  227. package/select/Option.d.ts +4 -0
  228. package/select/Option.js +97 -0
  229. package/select/Select.d.ts +4 -0
  230. package/select/Select.js +664 -0
  231. package/select/Select.stories.tsx +670 -0
  232. package/select/Select.test.js +2228 -0
  233. package/select/types.d.ts +210 -0
  234. package/select/types.js +5 -0
  235. package/sidenav/Sidenav.d.ts +10 -0
  236. package/sidenav/Sidenav.js +266 -0
  237. package/sidenav/Sidenav.stories.tsx +189 -0
  238. package/sidenav/Sidenav.test.js +44 -0
  239. package/sidenav/types.d.ts +73 -0
  240. package/sidenav/types.js +5 -0
  241. package/slider/Slider.d.ts +4 -0
  242. package/slider/Slider.js +343 -0
  243. package/slider/Slider.stories.tsx +183 -0
  244. package/slider/Slider.test.js +250 -0
  245. package/slider/types.d.ts +86 -0
  246. package/slider/types.js +5 -0
  247. package/spinner/Spinner.d.ts +4 -0
  248. package/spinner/Spinner.js +250 -0
  249. package/spinner/Spinner.stories.jsx +103 -0
  250. package/spinner/Spinner.test.js +64 -0
  251. package/spinner/types.d.ts +32 -0
  252. package/spinner/types.js +5 -0
  253. package/switch/Switch.d.ts +4 -0
  254. package/switch/Switch.js +262 -0
  255. package/switch/Switch.stories.tsx +138 -0
  256. package/switch/Switch.test.js +225 -0
  257. package/switch/types.d.ts +66 -0
  258. package/switch/types.js +5 -0
  259. package/table/Table.d.ts +4 -0
  260. package/{dist/table → table}/Table.js +12 -26
  261. package/table/Table.stories.jsx +277 -0
  262. package/table/Table.test.js +26 -0
  263. package/table/types.d.ts +21 -0
  264. package/table/types.js +5 -0
  265. package/tabs/Tab.d.ts +4 -0
  266. package/tabs/Tab.js +133 -0
  267. package/tabs/Tabs.d.ts +4 -0
  268. package/tabs/Tabs.js +467 -0
  269. package/tabs/Tabs.stories.tsx +188 -0
  270. package/tabs/Tabs.test.js +351 -0
  271. package/tabs/types.d.ts +92 -0
  272. package/tabs/types.js +5 -0
  273. package/tabs-nav/NavTabs.d.ts +8 -0
  274. package/tabs-nav/NavTabs.js +125 -0
  275. package/tabs-nav/NavTabs.stories.tsx +172 -0
  276. package/tabs-nav/NavTabs.test.js +82 -0
  277. package/tabs-nav/Tab.d.ts +4 -0
  278. package/tabs-nav/Tab.js +128 -0
  279. package/tabs-nav/types.d.ts +53 -0
  280. package/tabs-nav/types.js +5 -0
  281. package/tag/Tag.d.ts +4 -0
  282. package/tag/Tag.js +183 -0
  283. package/tag/Tag.stories.tsx +142 -0
  284. package/tag/Tag.test.js +60 -0
  285. package/tag/types.d.ts +69 -0
  286. package/tag/types.js +5 -0
  287. package/text-input/Icons.d.ts +8 -0
  288. package/text-input/Icons.js +60 -0
  289. package/text-input/Suggestion.d.ts +4 -0
  290. package/text-input/Suggestion.js +84 -0
  291. package/text-input/Suggestions.d.ts +4 -0
  292. package/text-input/Suggestions.js +134 -0
  293. package/text-input/TextInput.d.ts +4 -0
  294. package/text-input/TextInput.js +673 -0
  295. package/text-input/TextInput.stories.tsx +501 -0
  296. package/text-input/TextInput.test.js +1724 -0
  297. package/text-input/types.d.ts +197 -0
  298. package/text-input/types.js +5 -0
  299. package/textarea/Textarea.d.ts +4 -0
  300. package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +52 -144
  301. package/textarea/Textarea.stories.jsx +157 -0
  302. package/textarea/Textarea.test.js +437 -0
  303. package/textarea/types.d.ts +137 -0
  304. package/textarea/types.js +5 -0
  305. package/toggle-group/ToggleGroup.d.ts +4 -0
  306. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +36 -148
  307. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  308. package/toggle-group/ToggleGroup.test.js +156 -0
  309. package/toggle-group/types.d.ts +105 -0
  310. package/toggle-group/types.js +5 -0
  311. package/typography/Typography.d.ts +4 -0
  312. package/typography/Typography.js +131 -0
  313. package/typography/Typography.stories.tsx +198 -0
  314. package/typography/types.d.ts +18 -0
  315. package/typography/types.js +5 -0
  316. package/useTheme.d.ts +2 -0
  317. package/{dist/useTheme.js → useTheme.js} +2 -2
  318. package/useTranslatedLabels.d.ts +2 -0
  319. package/useTranslatedLabels.js +20 -0
  320. package/wizard/Wizard.d.ts +4 -0
  321. package/wizard/Wizard.js +285 -0
  322. package/wizard/Wizard.stories.tsx +233 -0
  323. package/wizard/Wizard.test.js +141 -0
  324. package/wizard/types.d.ts +65 -0
  325. package/wizard/types.js +5 -0
  326. package/README.md +0 -66
  327. package/babel.config.js +0 -8
  328. package/dist/BackgroundColorContext.js +0 -46
  329. package/dist/ThemeContext.js +0 -248
  330. package/dist/accordion/Accordion.js +0 -353
  331. package/dist/accordion-group/AccordionGroup.js +0 -186
  332. package/dist/alert/index.d.ts +0 -51
  333. package/dist/badge/Badge.js +0 -63
  334. package/dist/box/Box.js +0 -156
  335. package/dist/button/Button.js +0 -238
  336. package/dist/card/Card.js +0 -254
  337. package/dist/checkbox/Checkbox.js +0 -300
  338. package/dist/checkbox/Checkbox.stories.js +0 -144
  339. package/dist/checkbox/readme.md +0 -116
  340. package/dist/chip/Chip.js +0 -265
  341. package/dist/common/RequiredComponent.js +0 -40
  342. package/dist/date/Date.js +0 -379
  343. package/dist/date/Date.stories.js +0 -205
  344. package/dist/date/readme.md +0 -73
  345. package/dist/dialog/Dialog.js +0 -218
  346. package/dist/dropdown/Dropdown.js +0 -544
  347. package/dist/file-input/FileInput.js +0 -644
  348. package/dist/file-input/FileItem.js +0 -280
  349. package/dist/file-input/index.d.ts +0 -81
  350. package/dist/footer/Footer.js +0 -395
  351. package/dist/footer/Footer.stories.js +0 -94
  352. package/dist/footer/dxc_logo.svg +0 -15
  353. package/dist/footer/readme.md +0 -41
  354. package/dist/header/Header.js +0 -403
  355. package/dist/header/Header.stories.js +0 -176
  356. package/dist/header/close_icon.svg +0 -1
  357. package/dist/header/dxc_logo_black.svg +0 -8
  358. package/dist/header/hamb_menu_black.svg +0 -1
  359. package/dist/header/hamb_menu_white.svg +0 -1
  360. package/dist/header/readme.md +0 -33
  361. package/dist/input-text/InputText.js +0 -707
  362. package/dist/input-text/InputText.stories.js +0 -209
  363. package/dist/input-text/error.svg +0 -1
  364. package/dist/input-text/readme.md +0 -91
  365. package/dist/layout/ApplicationLayout.js +0 -331
  366. package/dist/layout/facebook.svg +0 -45
  367. package/dist/layout/linkedin.svg +0 -50
  368. package/dist/layout/twitter.svg +0 -53
  369. package/dist/link/Link.js +0 -237
  370. package/dist/link/readme.md +0 -51
  371. package/dist/main.d.ts +0 -8
  372. package/dist/new-date/NewDate.js +0 -400
  373. package/dist/new-date/index.d.ts +0 -95
  374. package/dist/new-input-text/NewInputText.js +0 -971
  375. package/dist/new-input-text/index.d.ts +0 -135
  376. package/dist/new-select/NewSelect.js +0 -836
  377. package/dist/new-select/index.d.ts +0 -53
  378. package/dist/new-textarea/index.d.ts +0 -117
  379. package/dist/number/Number.js +0 -136
  380. package/dist/number/index.d.ts +0 -113
  381. package/dist/paginator/Paginator.js +0 -289
  382. package/dist/paginator/images/next.svg +0 -3
  383. package/dist/paginator/images/nextPage.svg +0 -3
  384. package/dist/paginator/images/previous.svg +0 -3
  385. package/dist/paginator/images/previousPage.svg +0 -3
  386. package/dist/paginator/readme.md +0 -50
  387. package/dist/password/index.d.ts +0 -94
  388. package/dist/password/styles.css +0 -3
  389. package/dist/progress-bar/ProgressBar.js +0 -242
  390. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  391. package/dist/progress-bar/readme.md +0 -63
  392. package/dist/radio/Radio.js +0 -209
  393. package/dist/radio/Radio.stories.js +0 -166
  394. package/dist/radio/readme.md +0 -70
  395. package/dist/resultsetTable/ResultsetTable.js +0 -358
  396. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  397. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  398. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  399. package/dist/select/Select.js +0 -549
  400. package/dist/sidenav/Sidenav.js +0 -179
  401. package/dist/slider/Slider.js +0 -394
  402. package/dist/slider/Slider.stories.js +0 -241
  403. package/dist/slider/readme.md +0 -64
  404. package/dist/spinner/Spinner.js +0 -381
  405. package/dist/spinner/Spinner.stories.js +0 -183
  406. package/dist/spinner/readme.md +0 -65
  407. package/dist/switch/Switch.js +0 -222
  408. package/dist/switch/Switch.stories.js +0 -134
  409. package/dist/switch/readme.md +0 -133
  410. package/dist/tabs/Tabs.js +0 -343
  411. package/dist/tabs/Tabs.stories.js +0 -130
  412. package/dist/tabs/readme.md +0 -78
  413. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  414. package/dist/tabs-for-sections/readme.md +0 -78
  415. package/dist/tag/Tag.js +0 -282
  416. package/dist/textarea/Textarea.js +0 -264
  417. package/dist/toggle/Toggle.js +0 -220
  418. package/dist/toggle/Toggle.stories.js +0 -297
  419. package/dist/toggle/readme.md +0 -80
  420. package/dist/upload/Upload.js +0 -205
  421. package/dist/upload/Upload.stories.js +0 -72
  422. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -139
  423. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  424. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  425. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  426. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  427. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  428. package/dist/upload/file-upload/FileToUpload.js +0 -184
  429. package/dist/upload/file-upload/audio-icon.svg +0 -4
  430. package/dist/upload/file-upload/close.svg +0 -4
  431. package/dist/upload/file-upload/file-icon.svg +0 -4
  432. package/dist/upload/file-upload/video-icon.svg +0 -4
  433. package/dist/upload/files-upload/FilesToUpload.js +0 -123
  434. package/dist/upload/readme.md +0 -37
  435. package/dist/upload/transaction/Transaction.js +0 -175
  436. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  437. package/dist/upload/transaction/audio-icon.svg +0 -4
  438. package/dist/upload/transaction/error-icon.svg +0 -4
  439. package/dist/upload/transaction/file-icon-err.svg +0 -4
  440. package/dist/upload/transaction/file-icon.svg +0 -4
  441. package/dist/upload/transaction/image-icon-err.svg +0 -4
  442. package/dist/upload/transaction/image-icon.svg +0 -4
  443. package/dist/upload/transaction/success-icon.svg +0 -4
  444. package/dist/upload/transaction/video-icon-err.svg +0 -4
  445. package/dist/upload/transaction/video-icon.svg +0 -4
  446. package/dist/upload/transactions/Transactions.js +0 -138
  447. package/dist/wizard/Wizard.js +0 -411
  448. package/dist/wizard/invalid_icon.svg +0 -5
  449. package/dist/wizard/valid_icon.svg +0 -5
  450. package/dist/wizard/validation-wrong.svg +0 -6
  451. package/test/Accordion.test.js +0 -33
  452. package/test/AccordionGroup.test.js +0 -125
  453. package/test/Alert.test.js +0 -53
  454. package/test/Box.test.js +0 -10
  455. package/test/Button.test.js +0 -18
  456. package/test/Card.test.js +0 -30
  457. package/test/Checkbox.test.js +0 -45
  458. package/test/Chip.test.js +0 -25
  459. package/test/Date.test.js +0 -393
  460. package/test/Dialog.test.js +0 -23
  461. package/test/Dropdown.test.js +0 -145
  462. package/test/FileInput.test.js +0 -201
  463. package/test/Footer.test.js +0 -99
  464. package/test/Header.test.js +0 -39
  465. package/test/Heading.test.js +0 -35
  466. package/test/InputText.test.js +0 -240
  467. package/test/Link.test.js +0 -43
  468. package/test/NewDate.test.js +0 -232
  469. package/test/NewInputText.test.js +0 -734
  470. package/test/NewTextarea.test.js +0 -195
  471. package/test/Number.test.js +0 -257
  472. package/test/Paginator.test.js +0 -177
  473. package/test/Password.test.js +0 -83
  474. package/test/ProgressBar.test.js +0 -35
  475. package/test/Radio.test.js +0 -37
  476. package/test/ResultsetTable.test.js +0 -329
  477. package/test/Select.test.js +0 -212
  478. package/test/Sidenav.test.js +0 -45
  479. package/test/Slider.test.js +0 -82
  480. package/test/Spinner.test.js +0 -32
  481. package/test/Switch.test.js +0 -45
  482. package/test/Table.test.js +0 -36
  483. package/test/Tabs.test.js +0 -109
  484. package/test/TabsForSections.test.js +0 -34
  485. package/test/Tag.test.js +0 -32
  486. package/test/TextArea.test.js +0 -52
  487. package/test/ToggleGroup.test.js +0 -85
  488. package/test/Upload.test.js +0 -60
  489. package/test/Wizard.test.js +0 -130
  490. package/test/mocks/pngMock.js +0 -1
  491. package/test/mocks/svgMock.js +0 -1
@@ -0,0 +1,189 @@
1
+ import React from "react";
2
+ import DxcSidenav from "./Sidenav";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+ import { userEvent, within } from "@storybook/testing-library";
6
+
7
+ export default {
8
+ title: "Sidenav",
9
+ component: DxcSidenav,
10
+ };
11
+
12
+ const iconSVG = (
13
+ <svg
14
+ version="1.1"
15
+ id="Capa_1"
16
+ x="0px"
17
+ y="0px"
18
+ width="438.536px"
19
+ height="438.536px"
20
+ viewBox="0 0 438.536 438.536"
21
+ fill="currentColor"
22
+ >
23
+ <g>
24
+ <path
25
+ d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
26
+ C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
27
+ h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
28
+ C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
29
+ c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
30
+ c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
31
+ />
32
+ </g>
33
+ </svg>
34
+ );
35
+
36
+ export const Chromatic = () => (
37
+ <>
38
+ <ExampleContainer>
39
+ <Title title="Default sidenav" theme="light" level={4} />
40
+ <DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
41
+ <DxcSidenav.Section>
42
+ <p>
43
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
44
+ vitae lacinia libero.
45
+ </p>
46
+ </DxcSidenav.Section>
47
+ <DxcSidenav.Section>
48
+ <DxcSidenav.Link>Single Link</DxcSidenav.Link>
49
+ <DxcSidenav.Group collapsable={false} title="Single Group" icon={iconSVG}>
50
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
51
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
52
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
53
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
54
+ </DxcSidenav.Group>
55
+ </DxcSidenav.Section>
56
+ <DxcSidenav.Section>
57
+ <DxcSidenav.Group
58
+ collapsable={true}
59
+ title="Section Group"
60
+ icon="https://cdn-icons-png.flaticon.com/512/5039/5039041.png"
61
+ >
62
+ <DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
63
+ <DxcSidenav.Link icon={iconSVG}>Group Link</DxcSidenav.Link>
64
+ </DxcSidenav.Group>
65
+ <DxcSidenav.Link icon="https://upload.wikimedia.org/wikipedia/commons/7/73/Flat_tick_icon.svg" newWindow>
66
+ Single Link
67
+ </DxcSidenav.Link>
68
+ <DxcSidenav.Link newWindow>Single Link</DxcSidenav.Link>
69
+ <DxcSidenav.Group collapsable={false} title="Section Group">
70
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
71
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
72
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
73
+ </DxcSidenav.Group>
74
+ </DxcSidenav.Section>
75
+ </DxcSidenav>
76
+ </ExampleContainer>
77
+ <ExampleContainer pseudoState="pseudo-focus">
78
+ <Title title="Focused options sidenav" theme="light" level={4} />
79
+ <DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
80
+ <DxcSidenav.Section>
81
+ <p>
82
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
83
+ vitae lacinia libero.
84
+ </p>
85
+ </DxcSidenav.Section>
86
+ <DxcSidenav.Section>
87
+ <DxcSidenav.Link>Single Link</DxcSidenav.Link>
88
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group">
89
+ <DxcSidenav.Link icon="https://cdn-icons-png.flaticon.com/512/5039/5039041.png">Group Link</DxcSidenav.Link>
90
+ </DxcSidenav.Group>
91
+ </DxcSidenav.Section>
92
+ <DxcSidenav.Section>
93
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group">
94
+ <DxcSidenav.Link selected icon={iconSVG}>
95
+ Group Link
96
+ </DxcSidenav.Link>
97
+ </DxcSidenav.Group>
98
+ <DxcSidenav.Group collapsable={false} title="Section Group">
99
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
100
+ </DxcSidenav.Group>
101
+ </DxcSidenav.Section>
102
+ </DxcSidenav>
103
+ </ExampleContainer>
104
+ </>
105
+ );
106
+
107
+ const CollapsedGroup = () => (
108
+ <>
109
+ <ExampleContainer>
110
+ <Title title="Default sidenav" theme="light" level={4} />
111
+ <DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
112
+ <DxcSidenav.Section>
113
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group" icon={iconSVG}>
114
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
115
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
116
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
117
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
118
+ </DxcSidenav.Group>
119
+ </DxcSidenav.Section>
120
+ <DxcSidenav.Section>
121
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group">
122
+ <DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
123
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
124
+ </DxcSidenav.Group>
125
+ <DxcSidenav.Group collapsable={false} title="Section Group">
126
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
127
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
128
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
129
+ </DxcSidenav.Group>
130
+ </DxcSidenav.Section>
131
+ </DxcSidenav>
132
+ </ExampleContainer>
133
+ </>
134
+ );
135
+
136
+ const HoverSidenav = () => (
137
+ <ExampleContainer pseudoState="pseudo-hover">
138
+ <Title title="Default sidenav" theme="light" level={4} />
139
+ <DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
140
+ <DxcSidenav.Section>
141
+ <DxcSidenav.Link>Single Link</DxcSidenav.Link>
142
+ <DxcSidenav.Link>Single Link</DxcSidenav.Link>
143
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group">
144
+ <DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
145
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
146
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
147
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
148
+ </DxcSidenav.Group>
149
+ </DxcSidenav.Section>
150
+ <DxcSidenav.Section>
151
+ <DxcSidenav.Group collapsable={true} title="Not Collapsed Group">
152
+ <DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
153
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
154
+ </DxcSidenav.Group>
155
+ <DxcSidenav.Link>Single Link</DxcSidenav.Link>
156
+ <DxcSidenav.Link>Single Link</DxcSidenav.Link>
157
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group">
158
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
159
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
160
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
161
+ </DxcSidenav.Group>
162
+
163
+ <DxcSidenav.Group collapsable={true} title="Collapsable Group">
164
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
165
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
166
+ <DxcSidenav.Link>Group Link</DxcSidenav.Link>
167
+ </DxcSidenav.Group>
168
+ </DxcSidenav.Section>
169
+ </DxcSidenav>
170
+ </ExampleContainer>
171
+ );
172
+
173
+ export const CollapseGroup = CollapsedGroup.bind({});
174
+ CollapseGroup.play = async ({ canvasElement }) => {
175
+ const canvas = within(canvasElement);
176
+ const collapsableGroups = canvas.getAllByText("Collapsable Group");
177
+ collapsableGroups.forEach((group) => {
178
+ userEvent.click(group);
179
+ });
180
+ };
181
+
182
+ export const CollapseHoverGroup = HoverSidenav.bind({});
183
+ CollapseHoverGroup.play = async ({ canvasElement }) => {
184
+ const canvas = within(canvasElement);
185
+ const collapsableGroups = canvas.getAllByText("Collapsable Group");
186
+ collapsableGroups.forEach((group) => {
187
+ userEvent.click(group);
188
+ });
189
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _react2 = require("@testing-library/react");
8
+
9
+ var _Sidenav = _interopRequireDefault(require("./Sidenav.tsx"));
10
+
11
+ describe("Sidenav component tests", function () {
12
+ test("Sidenav renders anchors and Section correctly", function () {
13
+ var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Section, null, /*#__PURE__*/_react["default"].createElement("p", null, "nav-content-test"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
14
+ href: "#"
15
+ }, "Link")))),
16
+ getByText = _render.getByText;
17
+
18
+ expect(getByText("nav-content-test")).toBeTruthy();
19
+ var link = getByText("Link");
20
+ expect(link.closest("a").getAttribute("href")).toBe("#");
21
+ });
22
+ test("Sidenav renders groups correctly", function () {
23
+ var sidenav = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Section, null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Group, {
24
+ title: "Collapsable",
25
+ collapsable: true
26
+ }, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
27
+ href: "#"
28
+ }, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
29
+ href: "#"
30
+ }, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
31
+ href: "#"
32
+ }, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
33
+ href: "#"
34
+ }, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
35
+ href: "#"
36
+ }, "Lorem ipsum")))));
37
+ expect(sidenav.getByText("Collapsable")).toBeTruthy();
38
+ expect(sidenav.getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("true");
39
+
40
+ _react2.fireEvent.click(sidenav.getByText("Collapsable"));
41
+
42
+ expect(sidenav.getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("false");
43
+ });
44
+ });
@@ -0,0 +1,73 @@
1
+ /// <reference types="react" />
2
+ declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
3
+ declare type SidenavPropsType = {
4
+ /**
5
+ * The area inside the sidenav. This area can be used to render the content inside the sidenav.
6
+ */
7
+ children: React.ReactNode;
8
+ /**
9
+ * The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
10
+ */
11
+ title?: React.ReactNode;
12
+ };
13
+ export declare type SidenavTitlePropsType = {
14
+ /**
15
+ * The area inside the sidenav title. This area can be used to render custom content.
16
+ */
17
+ children: React.ReactNode;
18
+ };
19
+ export declare type SidenavSectionPropsType = {
20
+ /**
21
+ * The area inside the sidenav section. This area can be used to render sidenav groups, links and custom content.
22
+ */
23
+ children: React.ReactNode;
24
+ };
25
+ export declare type SidenavGroupPropsType = {
26
+ /**
27
+ * The area inside the sidenav group. This area can be used to render sidenav links.
28
+ */
29
+ children: React.ReactNode;
30
+ /**
31
+ * The title of the sidenav group.
32
+ */
33
+ title?: string;
34
+ /**
35
+ * If true the sidenav group title will be considered a button and the group will be collapsable.
36
+ */
37
+ collapsable?: boolean;
38
+ /**
39
+ * The icon to be displayed next to the title of the group.
40
+ */
41
+ icon?: string | SVG;
42
+ };
43
+ export declare type SidenavLinkPropsType = {
44
+ /**
45
+ * Value of the tabindex.
46
+ */
47
+ tabIndex?: number;
48
+ /**
49
+ * Page to be opened when the user clicks on the link.
50
+ */
51
+ href?: string;
52
+ /**
53
+ * If true, the page is opened in a new browser tab.
54
+ */
55
+ newWindow?: boolean;
56
+ /**
57
+ * Element or path used as the icon that will be placed to the left of the link text.
58
+ */
59
+ icon?: string | SVG;
60
+ /**
61
+ * If true, the link will be marked as selected. This can also affect the group if it is closed to indicate that one of its links is selected.
62
+ */
63
+ selected?: boolean;
64
+ /**
65
+ * The area inside the sidenav link.
66
+ */
67
+ children: string;
68
+ /**
69
+ * This function will be called when the user clicks the link.
70
+ */
71
+ onClick?: ($event: any) => void;
72
+ };
73
+ export default SidenavPropsType;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import SliderPropsType from "./types";
3
+ declare const DxcSlider: React.ForwardRefExoticComponent<SliderPropsType & React.RefAttributes<HTMLDivElement>>;
4
+ export default DxcSlider;
@@ -0,0 +1,343 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof3 = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports["default"] = void 0;
11
+
12
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
+
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
+
18
+ var _react = _interopRequireWildcard(require("react"));
19
+
20
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
+
22
+ var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
23
+
24
+ var _variables = require("../common/variables.js");
25
+
26
+ var _utils = require("../common/utils.js");
27
+
28
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
29
+
30
+ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
31
+
32
+ var _uuid = require("uuid");
33
+
34
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
35
+
36
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
+
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
+
40
+ var DxcSlider = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
41
+ var _ref$label = _ref.label,
42
+ label = _ref$label === void 0 ? "" : _ref$label,
43
+ _ref$name = _ref.name,
44
+ name = _ref$name === void 0 ? "" : _ref$name,
45
+ defaultValue = _ref.defaultValue,
46
+ value = _ref.value,
47
+ _ref$helperText = _ref.helperText,
48
+ helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
49
+ _ref$minValue = _ref.minValue,
50
+ minValue = _ref$minValue === void 0 ? 0 : _ref$minValue,
51
+ _ref$maxValue = _ref.maxValue,
52
+ maxValue = _ref$maxValue === void 0 ? 100 : _ref$maxValue,
53
+ _ref$step = _ref.step,
54
+ step = _ref$step === void 0 ? 1 : _ref$step,
55
+ _ref$showLimitsValues = _ref.showLimitsValues,
56
+ showLimitsValues = _ref$showLimitsValues === void 0 ? false : _ref$showLimitsValues,
57
+ _ref$showInput = _ref.showInput,
58
+ showInput = _ref$showInput === void 0 ? false : _ref$showInput,
59
+ _ref$disabled = _ref.disabled,
60
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
61
+ _ref$marks = _ref.marks,
62
+ marks = _ref$marks === void 0 ? false : _ref$marks,
63
+ onChange = _ref.onChange,
64
+ onDragEnd = _ref.onDragEnd,
65
+ labelFormatCallback = _ref.labelFormatCallback,
66
+ margin = _ref.margin,
67
+ _ref$size = _ref.size,
68
+ size = _ref$size === void 0 ? "fillParent" : _ref$size;
69
+
70
+ var _useState = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0),
71
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
72
+ innerValue = _useState2[0],
73
+ setInnerValue = _useState2[1];
74
+
75
+ var _useState3 = (0, _react.useState)(false),
76
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
77
+ dragging = _useState4[0],
78
+ setDragging = _useState4[1];
79
+
80
+ var colorsTheme = (0, _useTheme["default"])();
81
+ var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
82
+
83
+ var _useState5 = (0, _react.useState)("label-".concat((0, _uuid.v4)())),
84
+ _useState6 = (0, _slicedToArray2["default"])(_useState5, 1),
85
+ labelId = _useState6[0];
86
+
87
+ var minLabel = (0, _react.useMemo)(function () {
88
+ return labelFormatCallback ? labelFormatCallback(minValue) : minValue;
89
+ }, [labelFormatCallback, minValue]);
90
+ var maxLabel = (0, _react.useMemo)(function () {
91
+ return labelFormatCallback ? labelFormatCallback(maxValue) : maxValue;
92
+ }, [labelFormatCallback, maxValue]);
93
+ var tickMarks = (0, _react.useMemo)(function () {
94
+ var ticks = [];
95
+ var numberOfMarks = Math.floor(maxValue / step - minValue / step);
96
+ var index = 0;
97
+ var range = maxValue - minValue;
98
+
99
+ if (marks) {
100
+ while (index <= numberOfMarks) {
101
+ ticks.push( /*#__PURE__*/_react["default"].createElement(TickMark, {
102
+ disabled: disabled,
103
+ stepPosition: step * index / range,
104
+ backgroundType: backgroundType,
105
+ stepValue: (value !== null && value !== void 0 ? value : innerValue) / maxValue
106
+ }));
107
+ index++;
108
+ }
109
+
110
+ return ticks;
111
+ } else {
112
+ return null;
113
+ }
114
+ }, [minValue, maxValue, step, value, innerValue]);
115
+
116
+ var handleSliderChange = function handleSliderChange(event) {
117
+ var valueToCheck = event.target.value;
118
+ (valueToCheck !== value || valueToCheck !== innerValue) && setInnerValue(valueToCheck);
119
+ onChange === null || onChange === void 0 ? void 0 : onChange(valueToCheck);
120
+ };
121
+
122
+ var handleSliderDragging = function handleSliderDragging() {
123
+ setDragging(true);
124
+ };
125
+
126
+ var handleSliderOnChangeCommited = function handleSliderOnChangeCommited(event) {
127
+ if (dragging) {
128
+ setDragging(false);
129
+ onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event.target.value);
130
+ }
131
+ };
132
+
133
+ var handlerInputChange = function handlerInputChange(event) {
134
+ var intValue = parseInt(event.value, 10);
135
+
136
+ if (value == null) {
137
+ if (!Number.isNaN(intValue)) setInnerValue(intValue > maxValue ? maxValue : intValue);
138
+ }
139
+
140
+ if (!Number.isNaN(intValue)) {
141
+ onChange === null || onChange === void 0 ? void 0 : onChange(intValue > maxValue ? maxValue : intValue);
142
+ }
143
+ };
144
+
145
+ var isFirefox = navigator.userAgent.indexOf("Firefox") !== -1;
146
+ return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
147
+ theme: colorsTheme.slider
148
+ }, /*#__PURE__*/_react["default"].createElement(Container, {
149
+ margin: margin,
150
+ size: size,
151
+ ref: ref
152
+ }, /*#__PURE__*/_react["default"].createElement(Label, {
153
+ id: labelId,
154
+ disabled: disabled,
155
+ backgroundType: backgroundType
156
+ }, label), /*#__PURE__*/_react["default"].createElement(HelperText, {
157
+ disabled: disabled,
158
+ backgroundType: backgroundType
159
+ }, helperText), /*#__PURE__*/_react["default"].createElement(SliderContainer, null, showLimitsValues && /*#__PURE__*/_react["default"].createElement(MinLabelContainer, {
160
+ backgroundType: backgroundType,
161
+ disabled: disabled
162
+ }, minLabel), /*#__PURE__*/_react["default"].createElement(SliderInputContainer, null, /*#__PURE__*/_react["default"].createElement(SliderInput, {
163
+ role: "slider",
164
+ type: "range",
165
+ value: value != null && value >= 0 ? value : innerValue,
166
+ min: minValue,
167
+ max: maxValue,
168
+ step: step,
169
+ marks: marks,
170
+ disabled: disabled,
171
+ "aria-labelledby": labelId,
172
+ "aria-orientation": "horizontal",
173
+ "aria-valuemax": maxValue,
174
+ "aria-valuemin": minValue,
175
+ "aria-valuenow": value != null && value >= 0 ? value : innerValue,
176
+ onChange: handleSliderChange,
177
+ onMouseUp: handleSliderOnChangeCommited,
178
+ onMouseDown: handleSliderDragging,
179
+ backgroundType: backgroundType
180
+ }), marks && /*#__PURE__*/_react["default"].createElement(MarksContainer, {
181
+ isFirefox: isFirefox
182
+ }, tickMarks)), showLimitsValues && /*#__PURE__*/_react["default"].createElement(MaxLabelContainer, {
183
+ backgroundType: backgroundType,
184
+ disabled: disabled,
185
+ step: step
186
+ }, maxLabel), showInput && /*#__PURE__*/_react["default"].createElement(StyledTextInput, null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
187
+ name: name,
188
+ value: value != null && value >= 0 ? value.toString() : innerValue.toString(),
189
+ disabled: disabled,
190
+ onChange: handlerInputChange,
191
+ size: "fillParent"
192
+ })))));
193
+ });
194
+
195
+ var sizes = {
196
+ medium: "360px",
197
+ large: "480px",
198
+ fillParent: "100%"
199
+ };
200
+
201
+ var calculateWidth = function calculateWidth(margin, size) {
202
+ return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
203
+ };
204
+
205
+ var getChromeStyles = function getChromeStyles() {
206
+ return "\n width: 100%;\n margin-right: 4px;";
207
+ };
208
+
209
+ var getFireFoxStyles = function getFireFoxStyles() {
210
+ return "\n width: calc(100% - 16px);\n margin-right: 3px;";
211
+ };
212
+
213
+ var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n"])), function (props) {
214
+ return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
215
+ }, function (props) {
216
+ return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
217
+ }, function (props) {
218
+ return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
219
+ }, function (props) {
220
+ return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
221
+ }, function (props) {
222
+ return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
223
+ }, function (props) {
224
+ return calculateWidth(props.margin, props.size);
225
+ });
226
+
227
+ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
228
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
229
+ }, function (props) {
230
+ return props.theme.fontFamily;
231
+ }, function (props) {
232
+ return props.theme.labelFontSize;
233
+ }, function (props) {
234
+ return props.theme.labelFontStyle;
235
+ }, function (props) {
236
+ return props.theme.labelFontWeight;
237
+ }, function (props) {
238
+ return props.theme.labelLineHeight;
239
+ });
240
+
241
+ var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
242
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
243
+ }, function (props) {
244
+ return props.theme.fontFamily;
245
+ }, function (props) {
246
+ return props.theme.helperTextFontSize;
247
+ }, function (props) {
248
+ return props.theme.helperTextFontStyle;
249
+ }, function (props) {
250
+ return props.theme.helperTextFontWeight;
251
+ }, function (props) {
252
+ return props.theme.helperTextLineHeight;
253
+ });
254
+
255
+ var SliderInput = _styledComponents["default"].input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n min-width: 240px;\n height: ", ";\n display: inline-block;\n vertical-align: middle;\n -webkit-appearance: none;\n background-color: ", ";\n background-image: ", ";\n background-repeat: no-repeat;\n background-size: ", ";\n border-radius: 5px;\n cursor: ", ";\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n margin: 0px -8px;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n border: none;\n height: ", ";\n width: ", ";\n border-radius: 25px;\n background: ", ";\n &:active {\n ", "\n }\n &:hover {\n ", "\n }\n }\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n }\n &::-moz-range-thumb {\n -webkit-appearance: none;\n border: none;\n height: ", ";\n width: ", ";\n border-radius: 25px;\n background: ", ";\n &:active {\n background: ", ";\n transform: scale(1.16667);\n }\n &:hover {\n ", "\n }\n }\n &:focus {\n outline: none;\n &::-webkit-slider-thumb {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n }\n &::-moz-range-thumb {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n }\n }\n"])), function (props) {
256
+ return props.theme.trackLineThickness;
257
+ }, function (props) {
258
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledTotalLineColorOnDark + "61" : props.theme.disabledTotalLineColor + "61" : props.backgroundType === "dark" ? props.theme.totalLineColorOnDark + "61" : props.theme.totalLineColor;
259
+ }, function (props) {
260
+ return props.disabled ? props.backgroundType === "dark" ? "linear-gradient(".concat(props.theme.disabledTrackLineColorOnDark, ", ").concat(props.theme.disabledTrackLineColorOnDark, ")") : "linear-gradient(".concat(props.theme.disabledTrackLineColor, ", ").concat(props.theme.disabledTrackLineColor, ")") : props.backgroundType === "dark" ? "linear-gradient(".concat(props.theme.trackLineColorOnDark, ", ").concat(props.theme.trackLineColorOnDark, ")") : "linear-gradient(".concat(props.theme.trackLineColor, ", ").concat(props.theme.trackLineColor, ")");
261
+ }, function (props) {
262
+ return (props.value - props.min) * 100 / (props.max - props.min) + "% 100%";
263
+ }, function (props) {
264
+ return props.disabled ? "not-allowed" : "pointer";
265
+ }, function (props) {
266
+ return props.theme.thumbHeight;
267
+ }, function (props) {
268
+ return props.theme.thumbWidth;
269
+ }, function (props) {
270
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor : props.backgroundType === "dark" ? props.theme.thumbBackgroundColorOnDark : props.theme.thumbBackgroundColor;
271
+ }, function (props) {
272
+ if (!props.disabled) {
273
+ return "\n background: ".concat(props.backgroundType === "dark" ? props.theme.activeThumbBackgroundColorOnDark : props.theme.activeThumbBackgroundColor, ";\n transform: scale(1.16667);");
274
+ }
275
+ }, function (props) {
276
+ if (!props.disabled) {
277
+ return "height: ".concat(props.theme.hoverThumbHeight, ";\n width: ").concat(props.theme.hoverThumbWidth, ";\n transform: scale(1.16667);\n transform-origin: center center;\n background: ").concat(props.backgroundType === "dark" ? props.theme.hoverThumbBackgroundColorOnDark : props.theme.hoverThumbBackgroundColor, ";");
278
+ }
279
+ }, function (props) {
280
+ return props.theme.thumbHeight;
281
+ }, function (props) {
282
+ return props.theme.thumbWidth;
283
+ }, function (props) {
284
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor : props.backgroundType === "dark" ? props.theme.thumbBackgroundColorOnDark : props.theme.thumbBackgroundColor;
285
+ }, function (props) {
286
+ return props.backgroundType === "dark" ? props.theme.activeThumbBackgroundColorOnDark : props.theme.activeThumbBackgroundColor;
287
+ }, function (props) {
288
+ if (!props.disabled) {
289
+ return "height: ".concat(props.theme.hoverThumbHeight, ";\n width: ").concat(props.theme.hoverThumbWidth, ";\n transform: scale(1.16667);\n transform-origin: center center;\n background: ").concat(props.backgroundType === "dark" ? props.theme.hoverThumbBackgroundColorOnDark : props.theme.hoverThumbBackgroundColor, ";");
290
+ }
291
+ }, function (props) {
292
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledFocusColorOnDark : props.theme.disabledFocusColor : props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
293
+ }, function (props) {
294
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledFocusColorOnDark : props.theme.disabledFocusColor : props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
295
+ });
296
+
297
+ var SliderContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 48px;\n align-items: center;\n"])));
298
+
299
+ var LimitLabelContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n white-space: nowrap;\n"])), function (props) {
300
+ return props.disabled ? props.theme.disabledLimitValuesFontColor : props.backgroundType === "dark" ? props.theme.limitValuesFontColorOnDark : props.theme.limitValuesFontColor;
301
+ }, function (props) {
302
+ return props.theme.fontFamily;
303
+ }, function (props) {
304
+ return props.theme.limitValuesFontSize;
305
+ }, function (props) {
306
+ return props.theme.limitValuesFontStyle;
307
+ }, function (props) {
308
+ return props.theme.limitValuesFontWeight;
309
+ }, function (props) {
310
+ return props.theme.limitValuesFontLetterSpacing;
311
+ });
312
+
313
+ var MinLabelContainer = (0, _styledComponents["default"])(LimitLabelContainer)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n"])), function (props) {
314
+ return props.theme.floorLabelMarginRight;
315
+ });
316
+ var MaxLabelContainer = (0, _styledComponents["default"])(LimitLabelContainer)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n"])), function (props) {
317
+ return props.step === 1 ? props.theme.ceilLabelMarginLeft : "1.25rem";
318
+ });
319
+
320
+ var SliderInputContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n width: 100%;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: -2px;\n padding-top: 1px;\n z-index: 0;\n"])));
321
+
322
+ var MarksContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n position: absolute;\n pointer-events: none;\n height: 100%;\n display: flex;\n align-items: center;\n"])), function (props) {
323
+ return props.isFirefox ? getFireFoxStyles() : getChromeStyles();
324
+ });
325
+
326
+ var TickMark = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n background: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n left: ", ";\n z-index: ", ";\n"])), function (props) {
327
+ return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledTickBackgroundColorOnDark : props.theme.disabledTickBackgroundColor : props.backgroundType === "dark" ? props.theme.tickBackgroundColorOnDark : props.theme.tickBackgroundColor;
328
+ }, function (props) {
329
+ return props.theme.tickHeight;
330
+ }, function (props) {
331
+ return props.theme.tickWidth;
332
+ }, function (props) {
333
+ return "calc(".concat(props.stepPosition, " * 100%)");
334
+ }, function (props) {
335
+ return "".concat(props.stepPosition <= props.stepValue ? "-1" : "0");
336
+ });
337
+
338
+ var StyledTextInput = _styledComponents["default"].div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n max-width: 70px;\n"])), function (props) {
339
+ return props.theme.inputMarginLeft;
340
+ });
341
+
342
+ var _default = DxcSlider;
343
+ exports["default"] = _default;