@skodaflow/web-library 5.0.0 → 6.0.0

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 (325) hide show
  1. package/cjs/components/accordion/accordion.js +1 -1
  2. package/cjs/components/accordion/accordion.js.map +1 -1
  3. package/cjs/components/banner/banner.d.ts +13 -51
  4. package/cjs/components/banner/banner.js +1 -1
  5. package/cjs/components/banner/banner.js.map +1 -1
  6. package/cjs/components/button/button.d.ts +2 -1
  7. package/cjs/components/button/button.js +1 -1
  8. package/cjs/components/button/button.js.map +1 -1
  9. package/cjs/components/card/Card.d.ts +92 -0
  10. package/cjs/components/card/Card.js +2 -0
  11. package/cjs/components/card/Card.js.map +1 -0
  12. package/cjs/components/card/FlippingCard.d.ts +3 -0
  13. package/cjs/components/card/FlippingCard.js +2 -0
  14. package/cjs/components/card/FlippingCard.js.map +1 -0
  15. package/cjs/components/card/LinkCard.d.ts +3 -0
  16. package/cjs/components/card/LinkCard.js +2 -0
  17. package/cjs/components/card/LinkCard.js.map +1 -0
  18. package/cjs/components/card/SelectableCard.d.ts +3 -0
  19. package/cjs/components/card/SelectableCard.js +2 -0
  20. package/cjs/components/card/SelectableCard.js.map +1 -0
  21. package/cjs/components/card/SimpleCard.d.ts +3 -0
  22. package/cjs/components/card/SimpleCard.js +2 -0
  23. package/cjs/components/card/SimpleCard.js.map +1 -0
  24. package/cjs/components/card/index.d.ts +1 -0
  25. package/cjs/components/cardContainer/cardContainer.d.ts +1 -0
  26. package/cjs/components/cardContainer/cardContainer.js.map +1 -1
  27. package/cjs/components/cardMenu/cardMenu.d.ts +2 -1
  28. package/cjs/components/cardMenu/cardMenu.js +1 -1
  29. package/cjs/components/cardMenu/cardMenu.js.map +1 -1
  30. package/cjs/components/chip/chipDropdownChildren/chipDropdownChildren.js +1 -1
  31. package/cjs/components/chip/chipDropdownChildren/chipDropdownChildren.js.map +1 -1
  32. package/cjs/components/chip/chipMultiselect/multiSelectChip.d.ts +2 -1
  33. package/cjs/components/chip/chipMultiselect/multiSelectChip.js +1 -1
  34. package/cjs/components/chip/chipMultiselect/multiSelectChip.js.map +1 -1
  35. package/cjs/components/chip/regular/chip.d.ts +2 -1
  36. package/cjs/components/chip/regular/chip.js +1 -1
  37. package/cjs/components/chip/regular/chip.js.map +1 -1
  38. package/cjs/components/closeDialogButton/index.js +1 -1
  39. package/cjs/components/closeDialogButton/index.js.map +1 -1
  40. package/cjs/components/common/interface/textInputInterface.d.ts +2 -1
  41. package/cjs/components/controls/controls.d.ts +2 -1
  42. package/cjs/components/controls/controls.js +1 -1
  43. package/cjs/components/controls/controls.js.map +1 -1
  44. package/cjs/components/icon/icon.d.ts +11 -2
  45. package/cjs/components/icon/icon.definitions.d.ts +847 -0
  46. package/cjs/components/icon/icon.definitions.js +2 -0
  47. package/cjs/components/icon/icon.definitions.js.map +1 -0
  48. package/cjs/components/icon/icon.js +1 -1
  49. package/cjs/components/icon/icon.js.map +1 -1
  50. package/cjs/components/icon/index.d.ts +1 -1
  51. package/cjs/components/index.d.ts +1 -0
  52. package/cjs/components/indicator/indicator.d.ts +9 -3
  53. package/cjs/components/indicator/indicator.js +1 -18
  54. package/cjs/components/indicator/indicator.js.map +1 -1
  55. package/cjs/components/labelStatus/labelStatus.d.ts +1 -0
  56. package/cjs/components/labelStatus/labelStatus.js.map +1 -1
  57. package/cjs/components/menu/menu.js +1 -1
  58. package/cjs/components/menu/menu.js.map +1 -1
  59. package/cjs/components/mobileStepper/mobileStepperButton.js +1 -1
  60. package/cjs/components/mobileStepper/mobileStepperButton.js.map +1 -1
  61. package/cjs/components/modal/modal.js +1 -1
  62. package/cjs/components/modal/modal.js.map +1 -1
  63. package/cjs/components/pagination/pagination.js +1 -1
  64. package/cjs/components/pagination/pagination.js.map +1 -1
  65. package/cjs/components/progressBar/components/loader.js +1 -1
  66. package/cjs/components/progressBar/components/loader.js.map +1 -1
  67. package/cjs/components/progressBar/components/spinner.js +1 -1
  68. package/cjs/components/progressBar/components/spinner.js.map +1 -1
  69. package/cjs/components/selectInput/selectInput.d.ts +2 -1
  70. package/cjs/components/selectInput/selectInput.js +1 -1
  71. package/cjs/components/selectInput/selectInput.js.map +1 -1
  72. package/cjs/components/snackbar/snackbarMessage.js +1 -1
  73. package/cjs/components/snackbar/snackbarMessage.js.map +1 -1
  74. package/cjs/components/tab/hook/useTabs.d.ts +1 -0
  75. package/cjs/components/tab/hook/useTabs.js.map +1 -1
  76. package/cjs/components/tab/menuTab.d.ts +1 -0
  77. package/cjs/components/tab/menuTab.js +1 -1
  78. package/cjs/components/tab/menuTab.js.map +1 -1
  79. package/cjs/components/tab/secondaryNavigation/secondaryNavigationTabs.js +1 -1
  80. package/cjs/components/tab/secondaryNavigation/secondaryNavigationTabs.js.map +1 -1
  81. package/cjs/components/tab/tab.d.ts +1 -0
  82. package/cjs/components/tab/tab.js.map +1 -1
  83. package/cjs/components/tab/tabPanel.d.ts +1 -0
  84. package/cjs/components/tab/tabPanel.js.map +1 -1
  85. package/cjs/components/tab/tabStyled.d.ts +1 -0
  86. package/cjs/components/tab/tabStyled.js.map +1 -1
  87. package/cjs/components/tab/tabs.d.ts +1 -0
  88. package/cjs/components/tab/tabs.js.map +1 -1
  89. package/cjs/components/textInput/textInput.js +1 -1
  90. package/cjs/components/textInput/textInput.js.map +1 -1
  91. package/cjs/components/upload/UploadField.d.ts +2 -2
  92. package/cjs/components/upload/UploadField.js +1 -1
  93. package/cjs/components/upload/UploadField.js.map +1 -1
  94. package/cjs/components/upload/UploadPreview.d.ts +1 -1
  95. package/cjs/components/upload/UploadPreviewList.d.ts +1 -1
  96. package/cjs/components/upload/UploadPreviewList.js +1 -1
  97. package/cjs/components/upload/UploadPreviewList.js.map +1 -1
  98. package/cjs/design/skoda/components/accordion/accordionSummary.theme.js +1 -1
  99. package/cjs/design/skoda/components/accordion/accordionSummary.theme.js.map +1 -1
  100. package/cjs/design/skoda/components/autocomplete.theme.js +1 -1
  101. package/cjs/design/skoda/components/autocomplete.theme.js.map +1 -1
  102. package/cjs/design/skoda/components/dialog/dialog.theme.js +1 -1
  103. package/cjs/design/skoda/components/dialog/dialog.theme.js.map +1 -1
  104. package/cjs/design/skoda/components/form/select.theme.js +1 -1
  105. package/cjs/design/skoda/components/form/select.theme.js.map +1 -1
  106. package/cjs/design/skoda/components/tabs/tabs.theme.js +1 -1
  107. package/cjs/design/skoda/components/tabs/tabs.theme.js.map +1 -1
  108. package/cjs/index.js +1 -1
  109. package/cjs/layout/Footer/FooterAccordion.js +1 -1
  110. package/cjs/layout/Footer/FooterAccordion.js.map +1 -1
  111. package/cjs/layout/Footer/FooterIconButton.d.ts +2 -2
  112. package/cjs/layout/Footer/FooterIconButton.js +1 -1
  113. package/cjs/layout/Footer/FooterIconButton.js.map +1 -1
  114. package/cjs/layout/Footer/FooterLink.d.ts +2 -2
  115. package/cjs/layout/Footer/FooterLink.js +1 -1
  116. package/cjs/layout/Footer/FooterLink.js.map +1 -1
  117. package/cjs/layout/Footer/FooterMenu.js +1 -1
  118. package/cjs/layout/Footer/FooterMenu.js.map +1 -1
  119. package/cjs/layout/Header/HeaderButton.d.ts +3 -3
  120. package/cjs/layout/Header/HeaderButton.js +1 -1
  121. package/cjs/layout/Header/HeaderButton.js.map +1 -1
  122. package/cjs/layout/Header/PredefinedHeaderButtons.js +1 -1
  123. package/cjs/layout/Header/PredefinedHeaderButtons.js.map +1 -1
  124. package/cjs/layout/SideMenu/SideMenu.js +1 -1
  125. package/cjs/layout/SideMenu/SideMenu.js.map +1 -1
  126. package/cjs/layout/cookieModal/CookieModal.d.ts +69 -0
  127. package/cjs/layout/cookieModal/CookieModal.js +2 -0
  128. package/cjs/layout/cookieModal/CookieModal.js.map +1 -0
  129. package/cjs/layout/cookieModal/CookieModalItem.d.ts +37 -0
  130. package/cjs/layout/cookieModal/CookieModalItem.js +2 -0
  131. package/cjs/layout/cookieModal/CookieModalItem.js.map +1 -0
  132. package/cjs/layout/cookieModal/index.d.ts +2 -0
  133. package/cjs/layout/index.d.ts +1 -0
  134. package/cjs/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js +1 -1
  135. package/cjs/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js.map +1 -1
  136. package/cjs/organisms/carousel/carousel.d.ts +3 -2
  137. package/cjs/organisms/carousel/carouselTemplate.d.ts +2 -1
  138. package/cjs/organisms/carousel2/carousel2.d.ts +3 -2
  139. package/cjs/organisms/carousel2/components/NavButton.js +1 -1
  140. package/cjs/organisms/carousel2/components/NavButton.js.map +1 -1
  141. package/cjs/organisms/common/menuCardComponent/menuCardComponent.js +1 -1
  142. package/cjs/organisms/common/menuCardComponent/menuCardComponent.js.map +1 -1
  143. package/cjs/organisms/gallery/Gallery.js +1 -1
  144. package/cjs/organisms/gallery/Gallery.js.map +1 -1
  145. package/cjs/organisms/gallery/GalleryTrigger.js +1 -1
  146. package/cjs/organisms/gallery/GalleryTrigger.js.map +1 -1
  147. package/cjs/organisms/heroImageCard/videoCardController.js +1 -1
  148. package/cjs/organisms/heroImageCard/videoCardController.js.map +1 -1
  149. package/cjs/organisms/notification/Notification.js +1 -1
  150. package/cjs/organisms/notification/Notification.js.map +1 -1
  151. package/cjs/organisms/notification/NotificationCenterHeaderButton.d.ts +1 -1
  152. package/cjs/organisms/shortcutLink/shortcutLink.d.ts +2 -1
  153. package/cjs/organisms/shortcutLink/shortcutLink.js +1 -1
  154. package/cjs/organisms/shortcutLink/shortcutLink.js.map +1 -1
  155. package/cjs/organisms/textCta/textCta.d.ts +2 -1
  156. package/cjs/organisms/textCta/textCta.js +1 -1
  157. package/cjs/organisms/textCta/textCta.js.map +1 -1
  158. package/components/accordion/accordion.js +1 -1
  159. package/components/accordion/accordion.js.map +1 -1
  160. package/components/banner/banner.d.ts +13 -51
  161. package/components/banner/banner.js +1 -1
  162. package/components/banner/banner.js.map +1 -1
  163. package/components/button/button.d.ts +2 -1
  164. package/components/button/button.js +1 -1
  165. package/components/button/button.js.map +1 -1
  166. package/components/card/Card.d.ts +92 -0
  167. package/components/card/Card.js +2 -0
  168. package/components/card/Card.js.map +1 -0
  169. package/components/card/FlippingCard.d.ts +3 -0
  170. package/components/card/FlippingCard.js +2 -0
  171. package/components/card/FlippingCard.js.map +1 -0
  172. package/components/card/LinkCard.d.ts +3 -0
  173. package/components/card/LinkCard.js +2 -0
  174. package/components/card/LinkCard.js.map +1 -0
  175. package/components/card/SelectableCard.d.ts +3 -0
  176. package/components/card/SelectableCard.js +2 -0
  177. package/components/card/SelectableCard.js.map +1 -0
  178. package/components/card/SimpleCard.d.ts +3 -0
  179. package/components/card/SimpleCard.js +2 -0
  180. package/components/card/SimpleCard.js.map +1 -0
  181. package/components/card/index.d.ts +1 -0
  182. package/components/cardContainer/cardContainer.d.ts +1 -0
  183. package/components/cardContainer/cardContainer.js.map +1 -1
  184. package/components/cardMenu/cardMenu.d.ts +2 -1
  185. package/components/cardMenu/cardMenu.js +1 -1
  186. package/components/cardMenu/cardMenu.js.map +1 -1
  187. package/components/chip/chipDropdownChildren/chipDropdownChildren.js +1 -1
  188. package/components/chip/chipDropdownChildren/chipDropdownChildren.js.map +1 -1
  189. package/components/chip/chipMultiselect/multiSelectChip.d.ts +2 -1
  190. package/components/chip/chipMultiselect/multiSelectChip.js +1 -1
  191. package/components/chip/chipMultiselect/multiSelectChip.js.map +1 -1
  192. package/components/chip/regular/chip.d.ts +2 -1
  193. package/components/chip/regular/chip.js +1 -1
  194. package/components/chip/regular/chip.js.map +1 -1
  195. package/components/closeDialogButton/index.js +1 -1
  196. package/components/closeDialogButton/index.js.map +1 -1
  197. package/components/common/interface/textInputInterface.d.ts +2 -1
  198. package/components/controls/controls.d.ts +2 -1
  199. package/components/controls/controls.js +1 -1
  200. package/components/controls/controls.js.map +1 -1
  201. package/components/icon/icon.d.ts +11 -2
  202. package/components/icon/icon.definitions.d.ts +847 -0
  203. package/components/icon/icon.definitions.js +2 -0
  204. package/components/icon/icon.definitions.js.map +1 -0
  205. package/components/icon/icon.js +1 -1
  206. package/components/icon/icon.js.map +1 -1
  207. package/components/icon/index.d.ts +1 -1
  208. package/components/index.d.ts +1 -0
  209. package/components/indicator/indicator.d.ts +9 -3
  210. package/components/indicator/indicator.js +1 -18
  211. package/components/indicator/indicator.js.map +1 -1
  212. package/components/labelStatus/labelStatus.d.ts +1 -0
  213. package/components/labelStatus/labelStatus.js.map +1 -1
  214. package/components/menu/menu.js +1 -1
  215. package/components/menu/menu.js.map +1 -1
  216. package/components/mobileStepper/mobileStepperButton.js +1 -1
  217. package/components/mobileStepper/mobileStepperButton.js.map +1 -1
  218. package/components/modal/modal.js +1 -1
  219. package/components/modal/modal.js.map +1 -1
  220. package/components/pagination/pagination.js +1 -1
  221. package/components/pagination/pagination.js.map +1 -1
  222. package/components/progressBar/components/loader.js +1 -1
  223. package/components/progressBar/components/loader.js.map +1 -1
  224. package/components/progressBar/components/spinner.js +1 -1
  225. package/components/progressBar/components/spinner.js.map +1 -1
  226. package/components/selectInput/selectInput.d.ts +2 -1
  227. package/components/selectInput/selectInput.js +1 -1
  228. package/components/selectInput/selectInput.js.map +1 -1
  229. package/components/snackbar/snackbarMessage.js +1 -1
  230. package/components/snackbar/snackbarMessage.js.map +1 -1
  231. package/components/tab/hook/useTabs.d.ts +1 -0
  232. package/components/tab/hook/useTabs.js.map +1 -1
  233. package/components/tab/menuTab.d.ts +1 -0
  234. package/components/tab/menuTab.js +1 -1
  235. package/components/tab/menuTab.js.map +1 -1
  236. package/components/tab/secondaryNavigation/secondaryNavigationTabs.js +1 -1
  237. package/components/tab/secondaryNavigation/secondaryNavigationTabs.js.map +1 -1
  238. package/components/tab/tab.d.ts +1 -0
  239. package/components/tab/tab.js.map +1 -1
  240. package/components/tab/tabPanel.d.ts +1 -0
  241. package/components/tab/tabPanel.js.map +1 -1
  242. package/components/tab/tabStyled.d.ts +1 -0
  243. package/components/tab/tabStyled.js.map +1 -1
  244. package/components/tab/tabs.d.ts +1 -0
  245. package/components/tab/tabs.js.map +1 -1
  246. package/components/textInput/textInput.js +1 -1
  247. package/components/textInput/textInput.js.map +1 -1
  248. package/components/upload/UploadField.d.ts +2 -2
  249. package/components/upload/UploadField.js +1 -1
  250. package/components/upload/UploadField.js.map +1 -1
  251. package/components/upload/UploadPreview.d.ts +1 -1
  252. package/components/upload/UploadPreviewList.d.ts +1 -1
  253. package/components/upload/UploadPreviewList.js +1 -1
  254. package/components/upload/UploadPreviewList.js.map +1 -1
  255. package/design/skoda/components/accordion/accordionSummary.theme.js +1 -1
  256. package/design/skoda/components/accordion/accordionSummary.theme.js.map +1 -1
  257. package/design/skoda/components/autocomplete.theme.js +1 -1
  258. package/design/skoda/components/autocomplete.theme.js.map +1 -1
  259. package/design/skoda/components/dialog/dialog.theme.js +1 -1
  260. package/design/skoda/components/dialog/dialog.theme.js.map +1 -1
  261. package/design/skoda/components/form/select.theme.js +1 -1
  262. package/design/skoda/components/form/select.theme.js.map +1 -1
  263. package/design/skoda/components/tabs/tabs.theme.js +1 -1
  264. package/design/skoda/components/tabs/tabs.theme.js.map +1 -1
  265. package/eula.txt +40 -0
  266. package/index.js +1 -1
  267. package/layout/Footer/FooterAccordion.js +1 -1
  268. package/layout/Footer/FooterAccordion.js.map +1 -1
  269. package/layout/Footer/FooterIconButton.d.ts +2 -2
  270. package/layout/Footer/FooterIconButton.js +1 -1
  271. package/layout/Footer/FooterIconButton.js.map +1 -1
  272. package/layout/Footer/FooterLink.d.ts +2 -2
  273. package/layout/Footer/FooterLink.js +1 -1
  274. package/layout/Footer/FooterLink.js.map +1 -1
  275. package/layout/Footer/FooterMenu.js +1 -1
  276. package/layout/Footer/FooterMenu.js.map +1 -1
  277. package/layout/Header/HeaderButton.d.ts +3 -3
  278. package/layout/Header/HeaderButton.js +1 -1
  279. package/layout/Header/HeaderButton.js.map +1 -1
  280. package/layout/Header/PredefinedHeaderButtons.js +1 -1
  281. package/layout/Header/PredefinedHeaderButtons.js.map +1 -1
  282. package/layout/SideMenu/SideMenu.js +1 -1
  283. package/layout/SideMenu/SideMenu.js.map +1 -1
  284. package/layout/cookieModal/CookieModal.d.ts +69 -0
  285. package/layout/cookieModal/CookieModal.js +2 -0
  286. package/layout/cookieModal/CookieModal.js.map +1 -0
  287. package/layout/cookieModal/CookieModalItem.d.ts +37 -0
  288. package/layout/cookieModal/CookieModalItem.js +2 -0
  289. package/layout/cookieModal/CookieModalItem.js.map +1 -0
  290. package/layout/cookieModal/index.d.ts +2 -0
  291. package/layout/index.d.ts +1 -0
  292. package/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js +1 -1
  293. package/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js.map +1 -1
  294. package/organisms/carousel/carousel.d.ts +3 -2
  295. package/organisms/carousel/carouselTemplate.d.ts +2 -1
  296. package/organisms/carousel2/carousel2.d.ts +3 -2
  297. package/organisms/carousel2/components/NavButton.js +1 -1
  298. package/organisms/carousel2/components/NavButton.js.map +1 -1
  299. package/organisms/common/menuCardComponent/menuCardComponent.js +1 -1
  300. package/organisms/common/menuCardComponent/menuCardComponent.js.map +1 -1
  301. package/organisms/gallery/Gallery.js +1 -1
  302. package/organisms/gallery/Gallery.js.map +1 -1
  303. package/organisms/gallery/GalleryTrigger.js +1 -1
  304. package/organisms/gallery/GalleryTrigger.js.map +1 -1
  305. package/organisms/heroImageCard/videoCardController.js +1 -1
  306. package/organisms/heroImageCard/videoCardController.js.map +1 -1
  307. package/organisms/notification/Notification.js +1 -1
  308. package/organisms/notification/Notification.js.map +1 -1
  309. package/organisms/notification/NotificationCenterHeaderButton.d.ts +1 -1
  310. package/organisms/shortcutLink/shortcutLink.d.ts +2 -1
  311. package/organisms/shortcutLink/shortcutLink.js +1 -1
  312. package/organisms/shortcutLink/shortcutLink.js.map +1 -1
  313. package/organisms/textCta/textCta.d.ts +2 -1
  314. package/organisms/textCta/textCta.js +1 -1
  315. package/organisms/textCta/textCta.js.map +1 -1
  316. package/package.json +1 -1
  317. package/theme/skoda/icons.css +1 -1
  318. package/cjs/components/icon/availableIcons.d.ts +0 -1
  319. package/cjs/components/icon/availableIcons.js +0 -2
  320. package/cjs/components/icon/availableIcons.js.map +0 -1
  321. package/cjs/components/tab/examples.d.ts +0 -3
  322. package/components/icon/availableIcons.d.ts +0 -1
  323. package/components/icon/availableIcons.js +0 -2
  324. package/components/icon/availableIcons.js.map +0 -1
  325. package/components/tab/examples.d.ts +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","sources":["../../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport MuiPagination from '@mui/material/Pagination';\nimport MuiPaginationItem from '@mui/material/PaginationItem';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { flowColors } from '../../design/skoda/palette.theme';\nimport { ternaryCondition } from '../../utils/utilities';\nimport { IconButton } from '../iconButton';\nimport { Icon } from '../icon';\n/**\n * @description SkodaFlow Pagination component.\n * Properties are inherited from HTML div Attribetes element.\n * @param props PaginationProps\n * @returns React Functional Component\n */\nconst isPageNumberValid = (pageNumber, count) => {\n return (pageNumber === '' ||\n (typeof pageNumber === 'number' && pageNumber - 1 > 0 && pageNumber + 1 <= count) ||\n (typeof parseInt(pageNumber) === 'number' && parseInt(pageNumber) > 0 && parseInt(pageNumber) <= count));\n};\nconst mobileIconButton = (muiIcon, onClick, disabled, direction, hideLabel, label) => (_jsxs(IconButton, { variant: \"standard\", onClick: onClick, disabled: disabled, children: [direction === 'forward' && !hideLabel && label, _jsx(Icon, { className: muiIcon }), direction === 'back' && !hideLabel && label] }));\nexport const Pagination = forwardRef((_a, ref) => {\n var { count, isDisabled, page, prevButtonLabel, nextButtonLabel, defaultPage, hideNextButton, hidePrevButton, hideFirstButton, hideLastButton, hideLabels, onValueChange } = _a, props = __rest(_a, [\"count\", \"isDisabled\", \"page\", \"prevButtonLabel\", \"nextButtonLabel\", \"defaultPage\", \"hideNextButton\", \"hidePrevButton\", \"hideFirstButton\", \"hideLastButton\", \"hideLabels\", \"onValueChange\"]);\n const initialPage = defaultPage || 1;\n const [currentPageNumber, setCurrentPageNumber] = useState(initialPage);\n const [isFirstMount, setIsFirstMount] = useState(true);\n const [prevStatePageNumber, setPrevStatePageNumber] = useState();\n useEffect(() => {\n currentPageNumber && onValueChange && onValueChange(currentPageNumber);\n }, [currentPageNumber, onValueChange]);\n useEffect(() => {\n isFirstMount ? setIsFirstMount(false) : page && !isDisabled && setCurrentPageNumber(page);\n }, [isDisabled, isFirstMount, page]);\n const handleChange = useCallback((event, pageNumber) => {\n setCurrentPageNumber(pageNumber);\n }, []);\n const handleValueChange = (payload) => {\n if (payload === '') {\n setPrevStatePageNumber(currentPageNumber);\n setCurrentPageNumber(payload);\n }\n const castToNum = parseInt(payload);\n if (typeof castToNum === 'number' && isPageNumberValid(castToNum, count)) {\n setPrevStatePageNumber(castToNum);\n setCurrentPageNumber(castToNum);\n }\n };\n const mobilePagination = () => (_jsx(\"div\", { style: { display: 'flex', flexDirection: 'column' }, className: `mobileView ${isDisabled ? 'paginationDisabled' : ''}`, children: _jsxs(\"div\", { className: \"mobileContainer\", children: [mobileIconButton('chevron-previous', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(1), !isPageNumberValid(currentPageNumber - 1, count)), mobileIconButton('cehvron-left', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(currentPageNumber - 1), !isPageNumberValid(currentPageNumber - 1, count), 'back', hideLabels, prevButtonLabel), _jsx(TextField, { className: \"textFieldContainer\", value: currentPageNumber, inputProps: { inputMode: 'numeric', pattern: `[1-${count}]*` }, onChange: (val) => handleValueChange(val.target.value), onBlur: () => currentPageNumber === '' && setCurrentPageNumber(prevStatePageNumber) }), mobileIconButton('chevron-right', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(currentPageNumber + 1), !isPageNumberValid(currentPageNumber + 1, count), 'forward', hideLabels, nextButtonLabel), mobileIconButton('chevron-next', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(count), !isPageNumberValid(currentPageNumber + 1, count))] }) }));\n const desktopPagination = () => (_jsx(MuiPagination, Object.assign({ className: \"desktopView\" }, props, { shape: \"rounded\", count: count, disabled: isDisabled, page: currentPageNumber, hideNextButton: hideNextButton, hidePrevButton: hidePrevButton, showFirstButton: !hideFirstButton, showLastButton: !hideLastButton, ref: ref, onChange: handleChange, renderItem: (item) => (_jsx(MuiPaginationItem, Object.assign({ className: ternaryCondition(hidePrevButton, false, 'MuiPagination-prev', ''), components: {\n first: () => _jsx(Icon, { className: 'play-previous', fontSize: \"small\" }),\n last: () => _jsx(Icon, { className: 'play-next', fontSize: \"small\" }),\n previous: () => (_jsxs(_Fragment, { children: [_jsx(Icon, { className: 'cehvron-left', fontSize: \"small\" }), _jsx(_Fragment, { children: prevButtonLabel })] })),\n next: () => (_jsxs(_Fragment, { children: [_jsx(_Fragment, { children: nextButtonLabel }), _jsx(Icon, { className: 'chevron-right', fontSize: \"small\" })] })),\n } }, item))) })));\n return (_jsxs(PaginationStyled, { \"data-testid\": \"Pagination-wrapper\", children: [desktopPagination(), \" \", mobilePagination()] }));\n});\n/**\n * @description Pagination styling definition based on props\n */\nconst PaginationStyled = styled('div')(({ theme }) => {\n let style = {};\n const flexStyle = {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n width: '100%',\n };\n style = {\n [theme.breakpoints.up('md')]: {\n '& .mobileView': {\n display: 'none!important',\n },\n },\n [theme.breakpoints.down('md')]: {\n '& .desktopView': {\n display: 'none!important',\n },\n },\n '& .desktopView': {\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n },\n '& .mobileView': Object.assign(Object.assign({}, flexStyle), { flexDirection: 'column', flexWrap: 'nowrap', '& .mobileContainer': Object.assign(Object.assign({}, flexStyle), { flexWrap: 'nowrap' }), '& .textFieldContainer': {\n height: '36px',\n margin: '0 34px',\n '& input, fieldset': {\n backgroundColor: flowColors.transparent.primary,\n border: 0,\n borderRadius: '4px',\n fontSize: '16px',\n fontWeight: '400',\n height: '36px',\n lineHeight: '36px',\n minWidth: '44px',\n maxWidth: '50px',\n padding: '0 4px',\n textAlign: 'center',\n color: flowColors.text.primary,\n },\n '& fieldset': {\n visibility: 'hidden',\n },\n '& div': {\n '&::before': {\n borderBottom: 0,\n },\n '&::after': {\n borderBottom: 0,\n },\n },\n }, '& .controllerContainer': {\n '& .arrowLabel': {\n color: flowColors.text.primary,\n fontSize: '16px',\n fontWeight: '400',\n lineHeight: '16px',\n },\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n '& .MuiIcon-root': {\n fontSize: '16px',\n width: '20px',\n height: '20px',\n },\n }, '& .counter_label': {\n color: flowColors.text.primary,\n fontSize: '12px',\n fontWeight: '400',\n lineHeight: '24px',\n marginTop: '4px',\n }, '&.paginationDisabled': {\n pointerEvents: 'none',\n '& .counter_label, .MuiIcon-root,.arrowLabel, input, fieldset': {\n color: flowColors.disabled.primary,\n },\n } }),\n };\n return style;\n});\n//# sourceMappingURL=pagination.js.map"],"names":["isPageNumberValid","pageNumber","count","parseInt","mobileIconButton","muiIcon","onClick","disabled","direction","hideLabel","label","_jsxs","IconButton","variant","children","_jsx","Icon","className","Pagination","forwardRef","_a","ref","isDisabled","page","prevButtonLabel","nextButtonLabel","defaultPage","hideNextButton","hidePrevButton","hideFirstButton","hideLastButton","hideLabels","onValueChange","props","__rest","initialPage","currentPageNumber","setCurrentPageNumber","useState","isFirstMount","setIsFirstMount","prevStatePageNumber","setPrevStatePageNumber","useEffect","handleChange","useCallback","event","PaginationStyled","MuiPagination","Object","assign","shape","showFirstButton","showLastButton","onChange","renderItem","item","MuiPaginationItem","ternaryCondition","components","first","fontSize","last","previous","_Fragment","next","style","display","flexDirection","TextField","value","inputProps","inputMode","pattern","val","payload","castToNum","handleValueChange","target","onBlur","styled","theme","flexStyle","alignItems","justifyContent","width","breakpoints","up","down","marginRight","marginLeft","flexWrap","height","margin","backgroundColor","flowColors","transparent","primary","border","borderRadius","fontWeight","lineHeight","minWidth","maxWidth","padding","textAlign","color","text","visibility","borderBottom","marginTop","pointerEvents"],"mappings":"ijBAiBA,MAAMA,EAAoB,CAACC,EAAYC,IACZ,KAAfD,GACmB,iBAAfA,GAA2BA,EAAa,EAAI,GAAKA,EAAa,GAAKC,GAC1C,iBAAzBC,SAASF,IAA4BE,SAASF,GAAc,GAAKE,SAASF,IAAeC,EAEnGE,EAAmB,CAACC,EAASC,EAASC,EAAUC,EAAWC,EAAWC,IAAWC,EAAMC,EAAY,CAAEC,QAAS,WAAYP,QAASA,EAASC,SAAUA,EAAUO,SAAU,CAAe,YAAdN,IAA4BC,GAAaC,EAAOK,EAAKC,EAAM,CAAEC,UAAWZ,IAA0B,SAAdG,IAAyBC,GAAaC,KAC9RQ,EAAaC,GAAW,CAACC,EAAIC,KACtC,IAAInB,MAAEA,EAAKoB,WAAEA,EAAUC,KAAEA,EAAIC,gBAAEA,EAAeC,gBAAEA,EAAeC,YAAEA,EAAWC,eAAEA,EAAcC,eAAEA,EAAcC,gBAAEA,EAAeC,eAAEA,EAAcC,WAAEA,EAAUC,cAAEA,GAAkBZ,EAAIa,EAAQC,EAAOd,EAAI,CAAC,QAAS,aAAc,OAAQ,kBAAmB,kBAAmB,cAAe,iBAAkB,iBAAkB,kBAAmB,iBAAkB,aAAc,kBAChX,MAAMe,EAAcT,GAAe,GAC5BU,EAAmBC,GAAwBC,EAASH,IACpDI,EAAcC,GAAmBF,GAAS,IAC1CG,EAAqBC,GAA0BJ,IACtDK,GAAU,KACNP,GAAqBJ,GAAiBA,EAAcI,EAAkB,GACvE,CAACA,EAAmBJ,IACvBW,GAAU,KACNJ,EAAeC,GAAgB,GAASjB,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SAAUuB,SAAU,SAAU,qBAAsB1C,OAAOC,OAAOD,OAAOC,OAAO,CAAE,EAAEgC,GAAY,CAAES,SAAU,WAAa,wBAAyB,CACxNC,OAAQ,OACRC,OAAQ,SACR,oBAAqB,CACjBC,gBAAiBC,EAAWC,YAAYC,QACxCC,OAAQ,EACRC,aAAc,MACdtC,SAAU,OACVuC,WAAY,MACZR,OAAQ,OACRS,WAAY,OACZC,SAAU,OACVC,SAAU,OACVC,QAAS,QACTC,UAAW,SACXC,MAAOX,EAAWY,KAAKV,SAE3B,aAAc,CACVW,WAAY,UAEhB,QAAS,CACL,YAAa,CACTC,aAAc,GAElB,WAAY,CACRA,aAAc,KAGvB,yBAA0B,CACzB,gBAAiB,CACbH,MAAOX,EAAWY,KAAKV,QACvBpC,SAAU,OACVuC,WAAY,MACZC,WAAY,QAEhB,yBAA0B,CACtBZ,YAAa,MACbtB,QAAS,eAEb,uBAAwB,CACpBuB,WAAY,MACZvB,QAAS,eAEb,kBAAmB,CACfN,SAAU,OACVwB,MAAO,OACPO,OAAQ,SAEb,mBAAoB,CACnBc,MAAOX,EAAWY,KAAKV,QACvBpC,SAAU,OACVuC,WAAY,MACZC,WAAY,OACZS,UAAW,OACZ,uBAAwB,CACvBC,cAAe,OACf,+DAAgE,CAC5DL,MAAOX,EAAWxF,SAAS0F,aAIpC/B,CAAK"}
1
+ {"version":3,"file":"pagination.js","sources":["../../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport MuiPagination from '@mui/material/Pagination';\nimport MuiPaginationItem from '@mui/material/PaginationItem';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { flowColors } from '../../design/skoda/palette.theme';\nimport { ternaryCondition } from '../../utils/utilities';\nimport { IconButton } from '../iconButton';\nimport { Icon } from '../icon';\n/**\n * @description SkodaFlow Pagination component.\n * Properties are inherited from HTML div Attribetes element.\n * @param props PaginationProps\n * @returns React Functional Component\n */\nconst isPageNumberValid = (pageNumber, count) => {\n return (pageNumber === '' ||\n (typeof pageNumber === 'number' && pageNumber - 1 > 0 && pageNumber + 1 <= count) ||\n (typeof parseInt(pageNumber) === 'number' && parseInt(pageNumber) > 0 && parseInt(pageNumber) <= count));\n};\nconst mobileIconButton = (muiIcon, onClick, disabled, direction, hideLabel, label) => (_jsxs(IconButton, { variant: \"standard\", onClick: onClick, disabled: disabled, children: [direction === 'forward' && !hideLabel && label, _jsx(Icon, { name: muiIcon }), direction === 'back' && !hideLabel && label] }));\nexport const Pagination = forwardRef((_a, ref) => {\n var { count, isDisabled, page, prevButtonLabel, nextButtonLabel, defaultPage, hideNextButton, hidePrevButton, hideFirstButton, hideLastButton, hideLabels, onValueChange } = _a, props = __rest(_a, [\"count\", \"isDisabled\", \"page\", \"prevButtonLabel\", \"nextButtonLabel\", \"defaultPage\", \"hideNextButton\", \"hidePrevButton\", \"hideFirstButton\", \"hideLastButton\", \"hideLabels\", \"onValueChange\"]);\n const initialPage = defaultPage || 1;\n const [currentPageNumber, setCurrentPageNumber] = useState(initialPage);\n const [isFirstMount, setIsFirstMount] = useState(true);\n const [prevStatePageNumber, setPrevStatePageNumber] = useState();\n useEffect(() => {\n currentPageNumber && onValueChange && onValueChange(currentPageNumber);\n }, [currentPageNumber, onValueChange]);\n useEffect(() => {\n isFirstMount ? setIsFirstMount(false) : page && !isDisabled && setCurrentPageNumber(page);\n }, [isDisabled, isFirstMount, page]);\n const handleChange = useCallback((event, pageNumber) => {\n setCurrentPageNumber(pageNumber);\n }, []);\n const handleValueChange = (payload) => {\n if (payload === '') {\n setPrevStatePageNumber(currentPageNumber);\n setCurrentPageNumber(payload);\n }\n const castToNum = parseInt(payload);\n if (typeof castToNum === 'number' && isPageNumberValid(castToNum, count)) {\n setPrevStatePageNumber(castToNum);\n setCurrentPageNumber(castToNum);\n }\n };\n const mobilePagination = () => (_jsx(\"div\", { style: { display: 'flex', flexDirection: 'column' }, className: `mobileView ${isDisabled ? 'paginationDisabled' : ''}`, children: _jsxs(\"div\", { className: \"mobileContainer\", children: [mobileIconButton('chevron-previous', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(1), !isPageNumberValid(currentPageNumber - 1, count)), mobileIconButton('chevron-left', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(currentPageNumber - 1), !isPageNumberValid(currentPageNumber - 1, count), 'back', hideLabels, prevButtonLabel), _jsx(TextField, { className: \"textFieldContainer\", value: currentPageNumber, inputProps: { inputMode: 'numeric', pattern: `[1-${count}]*` }, onChange: (val) => handleValueChange(val.target.value), onBlur: () => currentPageNumber === '' && setCurrentPageNumber(prevStatePageNumber) }), mobileIconButton('chevron-right', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(currentPageNumber + 1), !isPageNumberValid(currentPageNumber + 1, count), 'forward', hideLabels, nextButtonLabel), mobileIconButton('chevron-next', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(count), !isPageNumberValid(currentPageNumber + 1, count))] }) }));\n const desktopPagination = () => (_jsx(MuiPagination, Object.assign({ className: \"desktopView\" }, props, { shape: \"rounded\", count: count, disabled: isDisabled, page: currentPageNumber, hideNextButton: hideNextButton, hidePrevButton: hidePrevButton, showFirstButton: !hideFirstButton, showLastButton: !hideLastButton, ref: ref, onChange: handleChange, renderItem: (item) => (_jsx(MuiPaginationItem, Object.assign({ className: ternaryCondition(hidePrevButton, false, 'MuiPagination-prev', ''), components: {\n first: () => _jsx(Icon, { name: \"previous\", fontSize: \"small\" }),\n last: () => _jsx(Icon, { name: \"next\", fontSize: \"small\" }),\n previous: () => (_jsxs(_Fragment, { children: [_jsx(Icon, { name: \"chevron-left\", fontSize: \"small\" }), _jsx(_Fragment, { children: prevButtonLabel })] })),\n next: () => (_jsxs(_Fragment, { children: [_jsx(_Fragment, { children: nextButtonLabel }), _jsx(Icon, { name: \"chevron-right\", fontSize: \"small\" })] })),\n } }, item))) })));\n return (_jsxs(PaginationStyled, { \"data-testid\": \"Pagination-wrapper\", children: [desktopPagination(), \" \", mobilePagination()] }));\n});\n/**\n * @description Pagination styling definition based on props\n */\nconst PaginationStyled = styled('div')(({ theme }) => {\n let style = {};\n const flexStyle = {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n width: '100%',\n };\n style = {\n [theme.breakpoints.up('md')]: {\n '& .mobileView': {\n display: 'none!important',\n },\n },\n [theme.breakpoints.down('md')]: {\n '& .desktopView': {\n display: 'none!important',\n },\n },\n '& .desktopView': {\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n },\n '& .mobileView': Object.assign(Object.assign({}, flexStyle), { flexDirection: 'column', flexWrap: 'nowrap', '& .mobileContainer': Object.assign(Object.assign({}, flexStyle), { flexWrap: 'nowrap' }), '& .textFieldContainer': {\n height: '36px',\n margin: '0 34px',\n '& input, fieldset': {\n backgroundColor: flowColors.transparent.primary,\n border: 0,\n borderRadius: '4px',\n fontSize: '16px',\n fontWeight: '400',\n height: '36px',\n lineHeight: '36px',\n minWidth: '44px',\n maxWidth: '50px',\n padding: '0 4px',\n textAlign: 'center',\n color: flowColors.text.primary,\n },\n '& fieldset': {\n visibility: 'hidden',\n },\n '& div': {\n '&::before': {\n borderBottom: 0,\n },\n '&::after': {\n borderBottom: 0,\n },\n },\n }, '& .controllerContainer': {\n '& .arrowLabel': {\n color: flowColors.text.primary,\n fontSize: '16px',\n fontWeight: '400',\n lineHeight: '16px',\n },\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n '& .MuiIcon-root': {\n fontSize: '16px',\n width: '20px',\n height: '20px',\n },\n }, '& .counter_label': {\n color: flowColors.text.primary,\n fontSize: '12px',\n fontWeight: '400',\n lineHeight: '24px',\n marginTop: '4px',\n }, '&.paginationDisabled': {\n pointerEvents: 'none',\n '& .counter_label, .MuiIcon-root,.arrowLabel, input, fieldset': {\n color: flowColors.disabled.primary,\n },\n } }),\n };\n return style;\n});\n//# sourceMappingURL=pagination.js.map"],"names":["isPageNumberValid","pageNumber","count","parseInt","mobileIconButton","muiIcon","onClick","disabled","direction","hideLabel","label","_jsxs","IconButton","variant","children","_jsx","Icon","name","Pagination","forwardRef","_a","ref","isDisabled","page","prevButtonLabel","nextButtonLabel","defaultPage","hideNextButton","hidePrevButton","hideFirstButton","hideLastButton","hideLabels","onValueChange","props","__rest","initialPage","currentPageNumber","setCurrentPageNumber","useState","isFirstMount","setIsFirstMount","prevStatePageNumber","setPrevStatePageNumber","useEffect","handleChange","useCallback","event","PaginationStyled","MuiPagination","Object","assign","className","shape","showFirstButton","showLastButton","onChange","renderItem","item","MuiPaginationItem","ternaryCondition","components","first","fontSize","last","previous","_Fragment","next","style","display","flexDirection","TextField","value","inputProps","inputMode","pattern","val","payload","castToNum","handleValueChange","target","onBlur","styled","theme","flexStyle","alignItems","justifyContent","width","breakpoints","up","down","marginRight","marginLeft","flexWrap","height","margin","backgroundColor","flowColors","transparent","primary","border","borderRadius","fontWeight","lineHeight","minWidth","maxWidth","padding","textAlign","color","text","visibility","borderBottom","marginTop","pointerEvents"],"mappings":"qlBAiBA,MAAMA,EAAoB,CAACC,EAAYC,IACZ,KAAfD,GACmB,iBAAfA,GAA2BA,EAAa,EAAI,GAAKA,EAAa,GAAKC,GAC1C,iBAAzBC,SAASF,IAA4BE,SAASF,GAAc,GAAKE,SAASF,IAAeC,EAEnGE,EAAmB,CAACC,EAASC,EAASC,EAAUC,EAAWC,EAAWC,IAAWC,EAAMC,EAAY,CAAEC,QAAS,WAAYP,QAASA,EAASC,SAAUA,EAAUO,SAAU,CAAe,YAAdN,IAA4BC,GAAaC,EAAOK,EAAKC,EAAM,CAAEC,KAAMZ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OACVwB,MAAO,OACPO,OAAQ,SAEb,mBAAoB,CACnBc,MAAOX,EAAWY,KAAKV,QACvBpC,SAAU,OACVuC,WAAY,MACZC,WAAY,OACZS,UAAW,OACZ,uBAAwB,CACvBC,cAAe,OACf,+DAAgE,CAC5DL,MAAOX,EAAWzF,SAAS2F,aAIpC/B,CAAK"}
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"tslib";import{jsxs as a,jsx as t}from"react/jsx-runtime";import{styled as i}from"@mui/material";import{forwardRef as r}from"react";import{Icon as n}from"../../icon/icon.js";import{StyledProgressBarMessage as o}from"./styledProgressBarMessage.js";const s=r(((i,r)=>{var{state:s,errorMessage:d,successMessage:c,loaderSize:m,loadingPercentage:g,loadingPercentageDescribeText:h}=i,p=e(i,["state","errorMessage","successMessage","loaderSize","loadingPercentage","loadingPercentageDescribeText"]);return"error"===s?a(o,{state:s,hasJustifyContent:!0,"data-testid":"Loader",children:[t(n,{className:"circle-multiply",fontSize:"medium",iconStyle:"filled"}),t("span",{className:"message",children:d})]}):"success"===s?a(o,{state:s,hasJustifyContent:!0,"data-testid":"Loader",children:[t(n,{className:"circle-check",fontSize:"medium",iconStyle:"filled",color:"primary"}),t("span",{className:"message",children:c})]}):a(l,Object.assign({loaderSize:m,loadingPercentage:g},p,{ref:r,"data-testid":"Loader",children:[(Boolean(g)||0===g)&&t("span",{className:"loading-text","data-testid":"Loader.percentage",children:h?`${h} ${g} %`:`${g} %`}),t("div",{className:"bar",children:t("div",{className:"mainBar"})})]}))})),l=i("div",{shouldForwardProp:e=>"loaderSize"!==e&&"loadingPercentage"!==e})((a=>{var{theme:t}=a,i=e(a,["theme"]);const r="small"===i.loaderSize?"4px":"8px",n={width:"100%",maxWidth:"0",height:r,background:t.palette.brand.primary,animation:"animate 8s infinite",transition:null};(i.loadingPercentage||0===i.loadingPercentage)&&(n.maxWidth=`${i.loadingPercentage}%`,n.animation=null,n.transition="max-width 1s");let o={};return o={fontSize:"14px",lineHeight:"20px",color:t.palette.onSurface.os900,display:"flex",flexDirection:"column",fontWeight:500,"& .loading-text":{alignSelf:"flex-end",marginBottom:"4px",fontSize:"14px",lineHeight:"20px",color:t.palette.onSurface.os900},"@keyframes animate":{" 0%":{maxWidth:"0%"},"20%":{maxWidth:"20%"},"50%":{maxWidth:"50%"},"100%":{maxWidth:"100%"}},"& .bar":{width:" 100%",height:r,overflow:"hidden",background:t.palette.onSurface.os100,display:"inline-block","& > .mainBar":n}},o}));export{s as Loader};
1
+ import{__rest as e}from"tslib";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{styled as t}from"@mui/material";import{forwardRef as r}from"react";import{Icon as n}from"../../icon/icon.js";import"../../icon/icon.definitions.js";import{StyledProgressBarMessage as o}from"./styledProgressBarMessage.js";const s=r(((t,r)=>{var{state:s,errorMessage:d,successMessage:c,loaderSize:m,loadingPercentage:g,loadingPercentageDescribeText:h}=t,p=e(t,["state","errorMessage","successMessage","loaderSize","loadingPercentage","loadingPercentageDescribeText"]);return"error"===s?a(o,{state:s,hasJustifyContent:!0,"data-testid":"Loader",children:[i(n,{name:"circle-close",fontSize:"medium",iconStyle:"filled"}),i("span",{className:"message",children:d})]}):"success"===s?a(o,{state:s,hasJustifyContent:!0,"data-testid":"Loader",children:[i(n,{name:"circle-check",fontSize:"medium",iconStyle:"filled",color:"primary"}),i("span",{className:"message",children:c})]}):a(l,Object.assign({loaderSize:m,loadingPercentage:g},p,{ref:r,"data-testid":"Loader",children:[(Boolean(g)||0===g)&&i("span",{className:"loading-text","data-testid":"Loader.percentage",children:h?`${h} ${g} %`:`${g} %`}),i("div",{className:"bar",children:i("div",{className:"mainBar"})})]}))})),l=t("div",{shouldForwardProp:e=>"loaderSize"!==e&&"loadingPercentage"!==e})((a=>{var{theme:i}=a,t=e(a,["theme"]);const r="small"===t.loaderSize?"4px":"8px",n={width:"100%",maxWidth:"0",height:r,background:i.palette.brand.primary,animation:"animate 8s infinite",transition:null};(t.loadingPercentage||0===t.loadingPercentage)&&(n.maxWidth=`${t.loadingPercentage}%`,n.animation=null,n.transition="max-width 1s");let o={};return o={fontSize:"14px",lineHeight:"20px",color:i.palette.onSurface.os900,display:"flex",flexDirection:"column",fontWeight:500,"& .loading-text":{alignSelf:"flex-end",marginBottom:"4px",fontSize:"14px",lineHeight:"20px",color:i.palette.onSurface.os900},"@keyframes animate":{" 0%":{maxWidth:"0%"},"20%":{maxWidth:"20%"},"50%":{maxWidth:"50%"},"100%":{maxWidth:"100%"}},"& .bar":{width:" 100%",height:r,overflow:"hidden",background:i.palette.onSurface.os100,display:"inline-block","& > .mainBar":n}},o}));export{s as Loader};
2
2
  //# sourceMappingURL=loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sources":["../../../../src/components/progressBar/components/loader.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { styled } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Loader = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loaderSize, loadingPercentage, loadingPercentageDescribeText } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loaderSize\", \"loadingPercentage\", \"loadingPercentageDescribeText\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, { className: \"circle-multiply\", fontSize: \"medium\", iconStyle: \"filled\" }), _jsx(\"span\", { className: \"message\", children: errorMessage })] }));\n if (state === 'success')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, { className: \"circle-check\", fontSize: \"medium\", iconStyle: \"filled\", color: \"primary\" }), _jsx(\"span\", { className: \"message\", children: successMessage })] }));\n return (_jsxs(StyledLoader, Object.assign({ loaderSize: loaderSize, loadingPercentage: loadingPercentage }, props, { ref: ref, \"data-testid\": \"Loader\", children: [(Boolean(loadingPercentage) || loadingPercentage === 0) && (_jsx(\"span\", { className: \"loading-text\", \"data-testid\": \"Loader.percentage\", children: loadingPercentageDescribeText\n ? `${loadingPercentageDescribeText} ${loadingPercentage} %`\n : `${loadingPercentage} %` })), _jsx(\"div\", { className: \"bar\", children: _jsx(\"div\", { className: \"mainBar\" }) })] })));\n});\nconst StyledLoader = styled('div', {\n shouldForwardProp: (prop) => prop !== 'loaderSize' && prop !== 'loadingPercentage',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n const height = args.loaderSize === 'small' ? '4px' : '8px';\n const mainBarStyles = {\n width: '100%',\n maxWidth: '0',\n height: height,\n background: theme.palette.brand.primary,\n animation: 'animate 8s infinite',\n transition: null,\n };\n if (args.loadingPercentage || args.loadingPercentage === 0) {\n mainBarStyles.maxWidth = `${args.loadingPercentage}%`;\n mainBarStyles.animation = null;\n mainBarStyles.transition = 'max-width 1s';\n }\n let styles = {};\n styles = {\n fontSize: '14px',\n lineHeight: '20px',\n color: theme.palette.onSurface.os900,\n display: 'flex',\n flexDirection: 'column',\n fontWeight: 500,\n '& .loading-text': {\n alignSelf: 'flex-end',\n marginBottom: '4px',\n fontSize: '14px',\n lineHeight: '20px',\n color: theme.palette.onSurface.os900,\n },\n '@keyframes animate': {\n ' 0%': {\n maxWidth: '0%',\n },\n '20%': {\n maxWidth: '20%',\n },\n '50%': {\n maxWidth: '50%',\n },\n '100%': {\n maxWidth: '100%',\n },\n },\n '& .bar': {\n width: ' 100%',\n height: height,\n overflow: 'hidden',\n background: theme.palette.onSurface.os100,\n display: 'inline-block',\n '& > .mainBar': mainBarStyles,\n },\n };\n return styles;\n});\n//# sourceMappingURL=loader.js.map"],"names":["Loader","forwardRef","_a","ref","state","errorMessage","successMessage","loaderSize","loadingPercentage","loadingPercentageDescribeText","props","__rest","_jsxs","StyledProgressBarMessage","hasJustifyContent","children","_jsx","Icon","className","fontSize","iconStyle","color","StyledLoader","Object","assign","Boolean","styled","shouldForwardProp","prop","theme","args","height","mainBarStyles","width","maxWidth","background","palette","brand","primary","animation","transition","styles","lineHeight","onSurface","os900","display","flexDirection","fontWeight","alignSelf","marginBottom","overflow","os100"],"mappings":"8QAMY,MAACA,EAASC,GAAW,CAACC,EAAIC,KAClC,IAAIC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,WAAEA,EAAUC,kBAAEA,EAAiBC,8BAAEA,GAAkCP,EAAIQ,EAAQC,EAAOT,EAAI,CAAC,QAAS,eAAgB,iBAAkB,aAAc,oBAAqB,kCAClN,MAAc,UAAVE,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAOU,mBAAmB,EAAM,cAAe,SAAUC,SAAU,CAACC,EAAKC,EAAM,CAAEC,UAAW,kBAAmBC,SAAU,SAAUC,UAAW,WAAaJ,EAAK,OAAQ,CAAEE,UAAW,UAAWH,SAAUV,OACjP,YAAVD,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAOU,mBAAmB,EAAM,cAAe,SAAUC,SAAU,CAACC,EAAKC,EAAM,CAAEC,UAAW,eAAgBC,SAAU,SAAUC,UAAW,SAAUC,MAAO,YAAcL,EAAK,OAAQ,CAAEE,UAAW,UAAWH,SAAUT,OACtQM,EAAMU,EAAcC,OAAOC,OAAO,CAAEjB,WAAYA,EAAYC,kBAAmBA,GAAqBE,EAAO,CAAEP,IAAKA,EAAK,cAAe,SAAUY,SAAU,EAAEU,QAAQjB,IAA4C,IAAtBA,IAA6BQ,EAAK,OAAQ,CAAEE,UAAW,eAAgB,cAAe,oBAAqBH,SAAUN,EACrS,GAAGA,KAAiCD,MACpC,GAAGA,QAA2BQ,EAAK,MAAO,CAAEE,UAAW,MAAOH,SAAUC,EAAK,MAAO,CAAEE,UAAW,iBAAsB,IAEvII,EAAeI,EAAO,MAAO,CAC/BC,kBAAoBC,GAAkB,eAATA,GAAkC,sBAATA,GADrCF,EAEjBxB,IACA,IAAI2B,MAAEA,GAAU3B,EAAI4B,EAAOnB,EAAOT,EAAI,CAAC,UACvC,MAAM6B,EAA6B,UAApBD,EAAKvB,WAAyB,MAAQ,MAC/CyB,EAAgB,CAClBC,MAAO,OACPC,SAAU,IACVH,OAAQA,EACRI,WAAYN,EAAMO,QAAQC,MAAMC,QAChCC,UAAW,sBACXC,WAAY,OAEZV,EAAKtB,mBAAgD,IAA3BsB,EAAKtB,qBAC/BwB,EAAcE,SAAW,GAAGJ,EAAKtB,qBACjCwB,EAAcO,UAAY,KAC1BP,EAAcQ,WAAa,gBAE/B,IAAIC,EAAS,CAAA,EAsCb,OArCAA,EAAS,CACLtB,SAAU,OACVuB,WAAY,OACZrB,MAAOQ,EAAMO,QAAQO,UAAUC,MAC/BC,QAAS,OACTC,cAAe,SACfC,WAAY,IACZ,kBAAmB,CACfC,UAAW,WACXC,aAAc,MACd9B,SAAU,OACVuB,WAAY,OACZrB,MAAOQ,EAAMO,QAAQO,UAAUC,OAEnC,qBAAsB,CAClB,MAAO,CACHV,SAAU,MAEd,MAAO,CACHA,SAAU,OAEd,MAAO,CACHA,SAAU,OAEd,OAAQ,CACJA,SAAU,SAGlB,SAAU,CACND,MAAO,QACPF,OAAQA,EACRmB,SAAU,SACVf,WAAYN,EAAMO,QAAQO,UAAUQ,MACpCN,QAAS,eACT,eAAgBb,IAGjBS,CAAM"}
1
+ {"version":3,"file":"loader.js","sources":["../../../../src/components/progressBar/components/loader.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { styled } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Loader = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loaderSize, loadingPercentage, loadingPercentageDescribeText } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loaderSize\", \"loadingPercentage\", \"loadingPercentageDescribeText\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, { name: \"circle-close\", fontSize: \"medium\", iconStyle: \"filled\" }), _jsx(\"span\", { className: \"message\", children: errorMessage })] }));\n if (state === 'success')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, { name: \"circle-check\", fontSize: \"medium\", iconStyle: \"filled\", color: \"primary\" }), _jsx(\"span\", { className: \"message\", children: successMessage })] }));\n return (_jsxs(StyledLoader, Object.assign({ loaderSize: loaderSize, loadingPercentage: loadingPercentage }, props, { ref: ref, \"data-testid\": \"Loader\", children: [(Boolean(loadingPercentage) || loadingPercentage === 0) && (_jsx(\"span\", { className: \"loading-text\", \"data-testid\": \"Loader.percentage\", children: loadingPercentageDescribeText\n ? `${loadingPercentageDescribeText} ${loadingPercentage} %`\n : `${loadingPercentage} %` })), _jsx(\"div\", { className: \"bar\", children: _jsx(\"div\", { className: \"mainBar\" }) })] })));\n});\nconst StyledLoader = styled('div', {\n shouldForwardProp: (prop) => prop !== 'loaderSize' && prop !== 'loadingPercentage',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n const height = args.loaderSize === 'small' ? '4px' : '8px';\n const mainBarStyles = {\n width: '100%',\n maxWidth: '0',\n height: height,\n background: theme.palette.brand.primary,\n animation: 'animate 8s infinite',\n transition: null,\n };\n if (args.loadingPercentage || args.loadingPercentage === 0) {\n mainBarStyles.maxWidth = `${args.loadingPercentage}%`;\n mainBarStyles.animation = null;\n mainBarStyles.transition = 'max-width 1s';\n }\n let styles = {};\n styles = {\n fontSize: '14px',\n lineHeight: '20px',\n color: theme.palette.onSurface.os900,\n display: 'flex',\n flexDirection: 'column',\n fontWeight: 500,\n '& .loading-text': {\n alignSelf: 'flex-end',\n marginBottom: '4px',\n fontSize: '14px',\n lineHeight: '20px',\n color: theme.palette.onSurface.os900,\n },\n '@keyframes animate': {\n ' 0%': {\n maxWidth: '0%',\n },\n '20%': {\n maxWidth: '20%',\n },\n '50%': {\n maxWidth: '50%',\n },\n '100%': {\n maxWidth: '100%',\n },\n },\n '& .bar': {\n width: ' 100%',\n height: height,\n overflow: 'hidden',\n background: theme.palette.onSurface.os100,\n display: 'inline-block',\n '& > .mainBar': mainBarStyles,\n },\n };\n return styles;\n});\n//# sourceMappingURL=loader.js.map"],"names":["Loader","forwardRef","_a","ref","state","errorMessage","successMessage","loaderSize","loadingPercentage","loadingPercentageDescribeText","props","__rest","_jsxs","StyledProgressBarMessage","hasJustifyContent","children","_jsx","Icon","name","fontSize","iconStyle","className","color","StyledLoader","Object","assign","Boolean","styled","shouldForwardProp","prop","theme","args","height","mainBarStyles","width","maxWidth","background","palette","brand","primary","animation","transition","styles","lineHeight","onSurface","os900","display","flexDirection","fontWeight","alignSelf","marginBottom","overflow","os100"],"mappings":"qTAMY,MAACA,EAASC,GAAW,CAACC,EAAIC,KAClC,IAAIC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,WAAEA,EAAUC,kBAAEA,EAAiBC,8BAAEA,GAAkCP,EAAIQ,EAAQC,EAAOT,EAAI,CAAC,QAAS,eAAgB,iBAAkB,aAAc,oBAAqB,kCAClN,MAAc,UAAVE,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAOU,mBAAmB,EAAM,cAAe,SAAUC,SAAU,CAACC,EAAKC,EAAM,CAAEC,KAAM,eAAgBC,SAAU,SAAUC,UAAW,WAAaJ,EAAK,OAAQ,CAAEK,UAAW,UAAWN,SAAUV,OACzO,YAAVD,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAOU,mBAAmB,EAAM,cAAe,SAAUC,SAAU,CAACC,EAAKC,EAAM,CAAEC,KAAM,eAAgBC,SAAU,SAAUC,UAAW,SAAUE,MAAO,YAAcN,EAAK,OAAQ,CAAEK,UAAW,UAAWN,SAAUT,OACjQM,EAAMW,EAAcC,OAAOC,OAAO,CAA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BS,CAAM"}
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import{styled as i}from"@mui/material";import{Icon as a}from"../../icon/icon.js";import{StyledProgressBarMessage as o}from"./styledProgressBarMessage.js";const s=r(((r,i)=>{var{state:s,errorMessage:c,successMessage:m,loadingPercentage:p,loadingPercentageDescribeText:d,spinnerControlledAnimation:f}=r,g=e(r,["state","errorMessage","successMessage","loadingPercentage","loadingPercentageDescribeText","spinnerControlledAnimation"]);return"error"===s?n(o,{state:s,"data-testid":"Spinner",children:[t(a,{className:"circle-multiply",fontSize:"medium",iconStyle:"filled"}),t("span",{className:"message",children:c})]}):"success"===s?n(o,{state:s,"data-testid":"Spinner",children:[t(a,{className:"circle-check",fontSize:"medium",iconStyle:"filled",color:"primary"}),t("span",{className:"message",children:m})]}):n(l,Object.assign({},g,{ref:i,spinnerControlledAnimation:f,loadingPercentage:p,"data-testid":"Spinner",children:[t("svg",{viewBox:"0 0 50 50",width:"24",height:"24",children:t("circle",{cx:"25",cy:"25",r:"22.5"})}),(Boolean(p)||0===p)&&t("span",{className:"loading-text","data-testid":"Spinner.percentage",children:d?`${d} ${p} %`:`${p} %`})]}))})),l=i("div",{shouldForwardProp:e=>"spinnerControlledAnimation"!==e&&"loaderSize"!==e&&"loadingPercentage"!==e})((n=>{var{theme:t}=n,r=e(n,["theme"]);const i="137.130521355",a=141.3716715,o=r.spinnerControlledAnimation&&"infinite"!==r.spinnerControlledAnimation?{animationCircle:null,animationSpinner:null,strokeDashoffset:a-1.4137167149999998*r.loadingPercentage,strokeLinecap:null}:{animationCircle:"2s ease-in-out infinite both spinner-circle",animationSpinner:"2s linear infinite spinner",strokeLinecap:"square",strokeDashoffset:null};let s={};return s={transitionProperty:"opacity",transitionDuration:"0.3s",transitionTimingFunction:"ease-in-out",backgroundColor:"transparent",fontSize:"14px",lineHeight:"20px",width:"100%",display:"flex",color:t.palette.onSurface.os900,alignItems:"center",fontWeight:400,"& .loading-text":{marginLeft:"8px"},"& circle":{animation:o.animationCircle,display:"block",fill:"transparent",stroke:t.palette.brand.primary,strokeLinecap:o.strokeLinecap,strokeDasharray:a,strokeDashoffset:o.strokeDashoffset,strokeWidth:"10px",transformOrigin:"50% 50%"},"& svg":{background:`radial-gradient(ellipse at center, transparent 0%,transparent 48%,${t.palette.onSurface.os100} 49%,${t.palette.onSurface.os100} 100%)`,borderRadius:"50%",animation:o.animationSpinner},"& .initial-spinner.-done":{opacity:"0",pointerEvents:"none"},"@keyframes spinner":{"0%":{transform:"rotateZ(0)"},"100%":{transform:"rotateZ(360deg)"}},"@keyframes spinner-circle":{"0%":{strokeDashoffset:i,transform:"rotate(0)"},"25%":{strokeDashoffset:i,transform:"rotate(0)"},"50%":{},"75%":{strokeDashoffset:"35.342917875",transform:"rotate(45deg)"},"100%":{strokeDashoffset:i,transform:"rotate(360deg)"}}},s}));export{s as Spinner};
1
+ import{__rest as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import{styled as i}from"@mui/material";import{Icon as a}from"../../icon/icon.js";import"../../icon/icon.definitions.js";import{StyledProgressBarMessage as o}from"./styledProgressBarMessage.js";const s=r(((r,i)=>{var{state:s,errorMessage:c,successMessage:m,loadingPercentage:d,loadingPercentageDescribeText:p,spinnerControlledAnimation:f}=r,g=e(r,["state","errorMessage","successMessage","loadingPercentage","loadingPercentageDescribeText","spinnerControlledAnimation"]);return"error"===s?n(o,{state:s,"data-testid":"Spinner",children:[t(a,{name:"circle-close",fontSize:"medium",iconStyle:"filled"}),t("span",{className:"message",children:c})]}):"success"===s?n(o,{state:s,"data-testid":"Spinner",children:[t(a,{name:"circle-check",fontSize:"medium",iconStyle:"filled",color:"primary"}),t("span",{className:"message",children:m})]}):n(l,Object.assign({},g,{ref:i,spinnerControlledAnimation:f,loadingPercentage:d,"data-testid":"Spinner",children:[t("svg",{viewBox:"0 0 50 50",width:"24",height:"24",children:t("circle",{cx:"25",cy:"25",r:"22.5"})}),(Boolean(d)||0===d)&&t("span",{className:"loading-text","data-testid":"Spinner.percentage",children:p?`${p} ${d} %`:`${d} %`})]}))})),l=i("div",{shouldForwardProp:e=>"spinnerControlledAnimation"!==e&&"loaderSize"!==e&&"loadingPercentage"!==e})((n=>{var{theme:t}=n,r=e(n,["theme"]);const i="137.130521355",a=141.3716715,o=r.spinnerControlledAnimation&&"infinite"!==r.spinnerControlledAnimation?{animationCircle:null,animationSpinner:null,strokeDashoffset:a-1.4137167149999998*r.loadingPercentage,strokeLinecap:null}:{animationCircle:"2s ease-in-out infinite both spinner-circle",animationSpinner:"2s linear infinite spinner",strokeLinecap:"square",strokeDashoffset:null};let s={};return s={transitionProperty:"opacity",transitionDuration:"0.3s",transitionTimingFunction:"ease-in-out",backgroundColor:"transparent",fontSize:"14px",lineHeight:"20px",width:"100%",display:"flex",color:t.palette.onSurface.os900,alignItems:"center",fontWeight:400,"& .loading-text":{marginLeft:"8px"},"& circle":{animation:o.animationCircle,display:"block",fill:"transparent",stroke:t.palette.brand.primary,strokeLinecap:o.strokeLinecap,strokeDasharray:a,strokeDashoffset:o.strokeDashoffset,strokeWidth:"10px",transformOrigin:"50% 50%"},"& svg":{background:`radial-gradient(ellipse at center, transparent 0%,transparent 48%,${t.palette.onSurface.os100} 49%,${t.palette.onSurface.os100} 100%)`,borderRadius:"50%",animation:o.animationSpinner},"& .initial-spinner.-done":{opacity:"0",pointerEvents:"none"},"@keyframes spinner":{"0%":{transform:"rotateZ(0)"},"100%":{transform:"rotateZ(360deg)"}},"@keyframes spinner-circle":{"0%":{strokeDashoffset:i,transform:"rotate(0)"},"25%":{strokeDashoffset:i,transform:"rotate(0)"},"50%":{},"75%":{strokeDashoffset:"35.342917875",transform:"rotate(45deg)"},"100%":{strokeDashoffset:i,transform:"rotate(360deg)"}}},s}));export{s as Spinner};
2
2
  //# sourceMappingURL=spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sources":["../../../../src/components/progressBar/components/spinner.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport { styled } from '@mui/material';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Spinner = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loadingPercentage, loadingPercentageDescribeText, spinnerControlledAnimation } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loadingPercentage\", \"loadingPercentageDescribeText\", \"spinnerControlledAnimation\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, { className: \"circle-multiply\", fontSize: \"medium\", iconStyle: \"filled\" }), _jsx(\"span\", { className: \"message\", children: errorMessage })] }));\n if (state === 'success')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, { className: \"circle-check\", fontSize: \"medium\", iconStyle: \"filled\", color: \"primary\" }), _jsx(\"span\", { className: \"message\", children: successMessage })] }));\n return (_jsxs(StyledSpinner, Object.assign({}, props, { ref: ref, spinnerControlledAnimation: spinnerControlledAnimation, loadingPercentage: loadingPercentage, \"data-testid\": \"Spinner\", children: [_jsx(\"svg\", { viewBox: \"0 0 50 50\", width: \"24\", height: \"24\", children: _jsx(\"circle\", { cx: \"25\", cy: \"25\", r: \"22.5\" }) }), (Boolean(loadingPercentage) || loadingPercentage === 0) && (_jsx(\"span\", { className: \"loading-text\", \"data-testid\": \"Spinner.percentage\", children: loadingPercentageDescribeText\n ? `${loadingPercentageDescribeText} ${loadingPercentage} %`\n : `${loadingPercentage} %` }))] })));\n});\nconst StyledSpinner = styled('div', {\n shouldForwardProp: (prop) => prop !== 'spinnerControlledAnimation' && prop !== 'loaderSize' && prop !== 'loadingPercentage',\n})((_a) => {\n var { theme } = _a, props = __rest(_a, [\"theme\"]);\n const strokeDashOffset = '137.130521355';\n const strokeDashArray = 141.3716715;\n const animationStyles = !props.spinnerControlledAnimation || props.spinnerControlledAnimation === 'infinite'\n ? {\n animationCircle: '2s ease-in-out infinite both spinner-circle',\n animationSpinner: '2s linear infinite spinner',\n strokeLinecap: 'square',\n strokeDashoffset: null,\n }\n : {\n animationCircle: null,\n animationSpinner: null,\n strokeDashoffset: strokeDashArray - (strokeDashArray / 100) * props.loadingPercentage,\n strokeLinecap: null,\n };\n let styles = {};\n styles = {\n transitionProperty: 'opacity',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease-in-out',\n backgroundColor: 'transparent',\n fontSize: '14px',\n lineHeight: '20px',\n width: '100%',\n display: 'flex',\n color: theme.palette.onSurface.os900,\n alignItems: 'center',\n fontWeight: 400,\n '& .loading-text': {\n marginLeft: '8px',\n },\n '& circle': {\n animation: animationStyles.animationCircle,\n display: 'block',\n fill: 'transparent',\n stroke: theme.palette.brand.primary,\n strokeLinecap: animationStyles.strokeLinecap,\n strokeDasharray: strokeDashArray,\n strokeDashoffset: animationStyles.strokeDashoffset,\n strokeWidth: '10px',\n transformOrigin: '50% 50%',\n },\n '& svg': {\n background: `radial-gradient(ellipse at center, transparent 0%,transparent 48%,${theme.palette.onSurface.os100} 49%,${theme.palette.onSurface.os100} 100%)`,\n borderRadius: '50%',\n animation: animationStyles.animationSpinner,\n },\n '& .initial-spinner.-done': {\n opacity: '0',\n pointerEvents: 'none',\n },\n '@keyframes spinner': {\n '0%': { transform: 'rotateZ(0)' },\n '100%': { transform: 'rotateZ(360deg)' },\n },\n '@keyframes spinner-circle': {\n '0%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(0)',\n },\n '25%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(0)',\n },\n '50%': {},\n '75%': {\n strokeDashoffset: '35.342917875',\n transform: 'rotate(45deg)',\n },\n '100%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(360deg)',\n },\n },\n };\n return styles;\n});\n//# sourceMappingURL=spinner.js.map"],"names":["Spinner","forwardRef","_a","ref","state","errorMessage","successMessage","loadingPercentage","loadingPercentageDescribeText","spinnerControlledAnimation","props","__rest","_jsxs","StyledProgressBarMessage","children","_jsx","Icon","className","fontSize","iconStyle","color","StyledSpinner","Object","assign","viewBox","width","height","cx","cy","r","Boolean","styled","shouldForwardProp","prop","theme","strokeDashOffset","strokeDashArray","animationStyles","animationCircle","animationSpinner","strokeDashoffset","strokeLinecap","styles","transitionProperty","transitionDuration","transitionTimingFunction","backgroundColor","lineHeight","display","palette","onSurface","os900","alignItems","fontWeight","marginLeft","animation","fill","stroke","brand","primary","strokeDasharray","strokeWidth","transformOrigin","background","os100","borderRadius","opacity","pointerEvents","transform"],"mappings":"8QAMY,MAACA,EAAUC,GAAW,CAACC,EAAIC,KACnC,IAAIC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,kBAAEA,EAAiBC,8BAAEA,EAA6BC,2BAAEA,GAA+BP,EAAIQ,EAAQC,EAAOT,EAAI,CAAC,QAAS,eAAgB,iBAAkB,oBAAqB,gCAAiC,+BACrP,MAAc,UAAVE,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAO,cAAe,UAAWU,SAAU,CAACC,EAAKC,EAAM,CAAEC,UAAW,kBAAmBC,SAAU,SAAUC,UAAW,WAAaJ,EAAK,OAAQ,CAAEE,UAAW,UAAWH,SAAUT,OACzN,YAAVD,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAO,cAAe,UAAWU,SAAU,CAACC,EAAKC,EAAM,CAAEC,UAAW,eAAgBC,SAAU,SAAUC,UAAW,SAAUC,MAAO,YAAcL,EAAK,OAAQ,CAAEE,UAAW,UAAWH,SAAUR,OAC9OM,EAAMS,EAAeC,OAAOC,OAAO,CAAA,EAAIb,EAAO,CAAEP,IAAKA,EAAKM,2BAA4BA,EAA4BF,kBAAmBA,EAAmB,cAAe,UAAWO,SAAU,CAACC,EAAK,MAAO,CAAES,QAA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AgBE,kBAE/B,2BAA4B,CACxB2B,QAAS,IACTC,cAAe,QAEnB,qBAAsB,CAClB,KAAM,CAAEC,UAAW,cACnB,OAAQ,CAAEA,UAAW,oBAEzB,4BAA6B,CACzB,KAAM,CACF5B,iBAAkBL,EAClBiC,UAAW,aAEf,MAAO,CACH5B,iBAAkBL,EAClBiC,UAAW,aAEf,MAAO,CAAE,EACT,MAAO,CACH5B,iBAAkB,eAClB4B,UAAW,iBAEf,OAAQ,CACJ5B,iBAAkBL,EAClBiC,UAAW,oBAIhB1B,CAAM"}
1
+ {"version":3,"file":"spinner.js","sources":["../../../../src/components/progressBar/components/spinner.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport { styled } from '@mui/material';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Spinner = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loadingPercentage, loadingPercentageDescribeText, spinnerControlledAnimation } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loadingPercentage\", \"loadingPercentageDescribeText\", \"spinnerControlledAnimation\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, { name: \"circle-close\", fontSize: \"medium\", iconStyle: \"filled\" }), _jsx(\"span\", { className: \"message\", children: errorMessage })] }));\n if (state === 'success')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, { name: \"circle-check\", fontSize: \"medium\", iconStyle: \"filled\", color: \"primary\" }), _jsx(\"span\", { className: \"message\", children: successMessage })] }));\n return (_jsxs(StyledSpinner, Object.assign({}, props, { ref: ref, spinnerControlledAnimation: spinnerControlledAnimation, loadingPercentage: loadingPercentage, \"data-testid\": \"Spinner\", children: [_jsx(\"svg\", { viewBox: \"0 0 50 50\", width: \"24\", height: \"24\", children: _jsx(\"circle\", { cx: \"25\", cy: \"25\", r: \"22.5\" }) }), (Boolean(loadingPercentage) || loadingPercentage === 0) && (_jsx(\"span\", { className: \"loading-text\", \"data-testid\": \"Spinner.percentage\", children: loadingPercentageDescribeText\n ? `${loadingPercentageDescribeText} ${loadingPercentage} %`\n : `${loadingPercentage} %` }))] })));\n});\nconst StyledSpinner = styled('div', {\n shouldForwardProp: (prop) => prop !== 'spinnerControlledAnimation' && prop !== 'loaderSize' && prop !== 'loadingPercentage',\n})((_a) => {\n var { theme } = _a, props = __rest(_a, [\"theme\"]);\n const strokeDashOffset = '137.130521355';\n const strokeDashArray = 141.3716715;\n const animationStyles = !props.spinnerControlledAnimation || props.spinnerControlledAnimation === 'infinite'\n ? {\n animationCircle: '2s ease-in-out infinite both spinner-circle',\n animationSpinner: '2s linear infinite spinner',\n strokeLinecap: 'square',\n strokeDashoffset: null,\n }\n : {\n animationCircle: null,\n animationSpinner: null,\n strokeDashoffset: strokeDashArray - (strokeDashArray / 100) * props.loadingPercentage,\n strokeLinecap: null,\n };\n let styles = {};\n styles = {\n transitionProperty: 'opacity',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease-in-out',\n backgroundColor: 'transparent',\n fontSize: '14px',\n lineHeight: '20px',\n width: '100%',\n display: 'flex',\n color: theme.palette.onSurface.os900,\n alignItems: 'center',\n fontWeight: 400,\n '& .loading-text': {\n marginLeft: '8px',\n },\n '& circle': {\n animation: animationStyles.animationCircle,\n display: 'block',\n fill: 'transparent',\n stroke: theme.palette.brand.primary,\n strokeLinecap: animationStyles.strokeLinecap,\n strokeDasharray: strokeDashArray,\n strokeDashoffset: animationStyles.strokeDashoffset,\n strokeWidth: '10px',\n transformOrigin: '50% 50%',\n },\n '& svg': {\n background: `radial-gradient(ellipse at center, transparent 0%,transparent 48%,${theme.palette.onSurface.os100} 49%,${theme.palette.onSurface.os100} 100%)`,\n borderRadius: '50%',\n animation: animationStyles.animationSpinner,\n },\n '& .initial-spinner.-done': {\n opacity: '0',\n pointerEvents: 'none',\n },\n '@keyframes spinner': {\n '0%': { transform: 'rotateZ(0)' },\n '100%': { transform: 'rotateZ(360deg)' },\n },\n '@keyframes spinner-circle': {\n '0%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(0)',\n },\n '25%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(0)',\n },\n '50%': {},\n '75%': {\n strokeDashoffset: '35.342917875',\n transform: 'rotate(45deg)',\n },\n '100%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(360deg)',\n },\n },\n };\n return styles;\n});\n//# sourceMappingURL=spinner.js.map"],"names":["Spinner","forwardRef","_a","ref","state","errorMessage","successMessage","loadingPercentage","loadingPercentageDescribeText","spinnerControlledAnimation","props","__rest","_jsxs","StyledProgressBarMessage","children","_jsx","Icon","name","fontSize","iconStyle","className","color","StyledSpinner","Object","assign","viewBox","width","height","cx","cy","r","Boolean","styled","shouldForwardProp","prop","theme","strokeDashOffset","strokeDashArray","animationStyles","animationCircle","animationSpinner","strokeDashoffset","strokeLinecap","styles","transitionProperty","transitionDuration","transitionTimingFunction","backgroundColor","lineHeight","display","palette","onSurface","os900","alignItems","fontWeight","marginLeft","animation","fill","stroke","brand","primary","strokeDasharray","strokeWidth","transformOrigin","background","os100","borderRadius","opacity","pointerEvents","transform"],"mappings":"qTAMY,MAACA,EAAUC,GAAW,CAACC,EAAIC,KACnC,IAAIC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,kBAAEA,EAAiBC,8BAAEA,EAA6BC,2BAAEA,GAA+BP,EAAIQ,EAAQC,EAAOT,EAAI,CAAC,QAAS,eAAgB,iBAAkB,oBAAqB,gCAAiC,+BACrP,MAAc,UAAVE,EACQQ,EAAMC,EAA0B,CAAET,MAAOA,EAAO,cAAe,UAAWU,SAAU,CAACC,EAAKC,EAAM,CAAEC,KAAM,eAAgBC,SAAU,SAAUC,UAAW,WAAaJ,EAAK,OAAQ,CAAEK,U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/BC,WAAY,SACZC,WAAY,IACZ,kBAAmB,CACfC,WAAY,OAEhB,WAAY,CACRC,UAAWlB,EAAgBC,gBAC3BU,QAAS,QACTQ,KAAM,cACNC,OAAQvB,EAAMe,QAAQS,MAAMC,QAC5BlB,cAAeJ,EAAgBI,cAC/BmB,gBAAiBxB,EACjBI,iBAAkBH,EAAgBG,iBAClCqB,YAAa,OACbC,gBAAiB,WAErB,QAAS,CACLC,WAAY,qEAAqE7B,EAAMe,QAAQC,UAAUc,aAAa9B,EAAMe,QAAQC,UAAUc,cAC9IC,aAAc,MACdV,UAAWlB,EAAgBE,kBAE/B,2BAA4B,CACxB2B,QAAS,IACTC,cAAe,QAEnB,qBAAsB,CAClB,KAAM,CAAEC,UAAW,cACnB,OAAQ,CAAEA,UAAW,oBAEzB,4BAA6B,CACzB,KAAM,CACF5B,iBAAkBL,EAClBiC,UAAW,aAEf,MAAO,CACH5B,iBAAkBL,EAClBiC,UAAW,aAEf,MAAO,CAAE,EACT,MAAO,CACH5B,iBAAkB,eAClB4B,UAAW,iBAEf,OAAQ,CACJ5B,iBAAkBL,EAClBiC,UAAW,oBAIhB1B,CAAM"}
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { SelectChangeEvent } from '@mui/material/Select';
3
+ import { IconNameProp } from '../icon';
3
4
  /**
4
5
  * @interface SelectInputProps
5
6
  * @description Base definition of SkodaFlow SelectInput independent on core implementation.
@@ -36,7 +37,7 @@ export interface SelectInputProps {
36
37
  /**
37
38
  * Icon name. For example "check". If no prefix is defined, default SKODA icon font is used
38
39
  */
39
- icon?: string;
40
+ icon?: IconNameProp;
40
41
  /**
41
42
  *Boolean to check if the input returns an error or not
42
43
  */
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"tslib";import{jsx as o,Fragment as r,jsxs as l}from"react/jsx-runtime";import{useState as t,useRef as n}from"react";import{FormControlSelectStyled as a}from"./formControlSelectStyled.js";import i from"@mui/material/Select";import{Icon as u}from"../icon/icon.js";import{useSelectInput as c}from"./hook/useSelectInput.js";import{styled as s}from"@mui/material/styles";import d from"./inputLabelSelect.js";import{FormHelperText as m}from"@mui/material";import p from"../common/helperText.js";import h from"lodash/noop";const f=i=>{var{label:s=null,onChange:f,onBlur:x,onFocus:v,value:M,children:g,staticLabel:W,InputProps:B,fullWidth:C=!0,removeSelectMenuMaxWidth:I}=i,S=e(i,["label","onChange","onBlur","onFocus","value","children","staticLabel","InputProps","fullWidth","removeSelectMenuMaxWidth"]);const[j,k]=t(""),[F,L]=t(!1),[w,O]=t(!1),[T,P]=t(!1),[N,q]=t(!1),[y,E]=t(null),{handleOnBlur:V,handleOnChange:D,handleOnFocus:z}=c(F,h,h,C,S.helpText,M,k,S.required,P),A=n(null),G=n(null),H={sx:y?{maxWidth:I?"unset":y,"& .MuiBackdrop-root":{background:"transparent",backdropFilter:"blur(0px)"}}:{"& .MuiBackdrop-root":{background:"transparent",backdropFilter:"blur(0px)"}}};return o(r,{children:l(a,Object.assign({},S,{ref:G,staticLabel:W,sx:C?{}:{width:"200px"},disabled:S.disabled,error:S.hasError,value:j,hideBg:S.hideBg,onMouseEnter:()=>{!w&&!N&&O(!0)},onMouseLeave:()=>{w&&!N&&O(!1)},onMouseDown:e=>{const o=e.currentTarget.offsetWidth;E(o)},icon:S.icon,hovered:w,focused:F,variant:"filled",fullWidth:C,children:[S.icon&&o(u,{color:S.disabled?"disabled":"inherit",className:S.icon}),o(d,{staticLabel:W,label:s,opened:N,currentValue:j}),o(b,{MenuProps:H,required:T,onOpen:()=>{q(!0)},onClose:()=>{L(!1),O(!1),q(!1)},onBlur:()=>V(L,x),onFocus:()=>z(L,v),IconComponent:()=>o(u,N?{className:"chevron-up"}:{className:"chevron-down"}),labelId:s,id:S.id,name:S.name,value:j,onChange:e=>D(e,f,k),ref:A,hasIcon:!!S.icon,fullWidth:C,children:g}),o(m,{children:o(p,{maxChars:0,currentValue:j,helpText:S.helpText})})]}))})},b=s(i,{shouldForwardProp:e=>"hasIcon"!==e&&"fullWidth"!==e})((o=>{var r=e(o,["theme"]);if(!r.fullWidth)return null;return{"& > .MuiSelect-filled":{position:"absolute",left:0,top:0,width:r.hasIcon?"calc(100% - 102px) !important":"calc(100% - 62px) !important"}}}));export{f as SelectInput};
1
+ import{__rest as e}from"tslib";import{jsx as o,Fragment as r,jsxs as n}from"react/jsx-runtime";import{useState as t,useRef as l}from"react";import{FormControlSelectStyled as i}from"./formControlSelectStyled.js";import a from"@mui/material/Select";import{Icon as u}from"../icon/icon.js";import"../icon/icon.definitions.js";import{useSelectInput as c}from"./hook/useSelectInput.js";import{styled as d}from"@mui/material/styles";import s from"./inputLabelSelect.js";import{FormHelperText as m}from"@mui/material";import p from"../common/helperText.js";import h from"lodash/noop";const f=a=>{var{label:d=null,onChange:f,onBlur:x,onFocus:v,value:M,children:g,staticLabel:W,InputProps:j,fullWidth:B=!0,removeSelectMenuMaxWidth:C}=a,I=e(a,["label","onChange","onBlur","onFocus","value","children","staticLabel","InputProps","fullWidth","removeSelectMenuMaxWidth"]);const[S,k]=t(""),[F,L]=t(!1),[w,O]=t(!1),[T,P]=t(!1),[q,y]=t(!1),[E,V]=t(null),{handleOnBlur:D,handleOnChange:z,handleOnFocus:A}=c(F,h,h,B,I.helpText,M,k,I.required,P),G=l(null),H=l(null),J={sx:E?{maxWidth:C?"unset":E,"& .MuiBackdrop-root":{background:"transparent",backdropFilter:"blur(0px)"}}:{"& .MuiBackdrop-root":{background:"transparent",backdropFilter:"blur(0px)"}}};return o(r,{children:n(i,Object.assign({},I,{ref:H,staticLabel:W,sx:B?{}:{width:"200px"},disabled:I.disabled,error:I.hasError,value:S,hideBg:I.hideBg,onMouseEnter:()=>{!w&&!q&&O(!0)},onMouseLeave:()=>{w&&!q&&O(!1)},onMouseDown:e=>{const o=e.currentTarget.offsetWidth;V(o)},icon:I.icon,hovered:w,focused:F,variant:"filled",fullWidth:B,children:[I.icon&&o(u,{color:I.disabled?"disabled":"inherit",name:I.icon}),o(s,{staticLabel:W,label:d,opened:q,currentValue:S}),o(b,{MenuProps:J,required:T,onOpen:()=>{y(!0)},onClose:()=>{L(!1),O(!1),y(!1)},onBlur:()=>D(L,x),onFocus:()=>A(L,v),IconComponent:()=>o(u,q?{name:"chevron-up"}:{name:"chevron-down"}),labelId:d,id:I.id,name:I.name,value:S,onChange:e=>z(e,f,k),ref:G,hasIcon:!!I.icon,fullWidth:B,children:g}),o(m,{children:o(p,{maxChars:0,currentValue:S,helpText:I.helpText})})]}))})},b=d(a,{shouldForwardProp:e=>"hasIcon"!==e&&"fullWidth"!==e})((o=>{var r=e(o,["theme"]);if(!r.fullWidth)return null;return{"& > .MuiSelect-filled":{position:"absolute",left:0,top:0,width:r.hasIcon?"calc(100% - 102px) !important":"calc(100% - 62px) !important"}}}));export{f as SelectInput};
2
2
  //# sourceMappingURL=selectInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectInput.js","sources":["../../../src/components/selectInput/selectInput.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useRef, useState } from 'react';\nimport { FormControlSelectStyled } from './formControlSelectStyled';\nimport MuiSelect from '@mui/material/Select';\nimport { Icon } from '../icon';\nimport { useSelectInput } from './hook/useSelectInput';\nimport { styled } from '@mui/material/styles';\nimport InputLabelSelect from './inputLabelSelect';\nimport { FormHelperText } from '@mui/material';\nimport HelperText from '../common/helperText';\nimport noop from 'lodash/noop';\n/**\n * @description SkodaFlow SelectInput component.\n * Properties are inherited from HTML input element.\n * @param props SelectInputProps\n * @returns React Functional Component\n * @deprecated This component is deprecated. Use themed Select component from @mui/material instead.\n */\nexport const SelectInput = (_a) => {\n var { label = null, onChange, onBlur, onFocus, value, children, staticLabel, InputProps, fullWidth = true, removeSelectMenuMaxWidth } = _a, props = __rest(_a, [\"label\", \"onChange\", \"onBlur\", \"onFocus\", \"value\", \"children\", \"staticLabel\", \"InputProps\", \"fullWidth\", \"removeSelectMenuMaxWidth\"]);\n const [currentValue, setCurrentValue] = useState('');\n const [isFocused, setIsFocused] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [isRequired, setIsRequired] = useState(false);\n const [opened, setOpened] = useState(false);\n const [inputWidth, setInputWidth] = useState(null);\n const { handleOnBlur, handleOnChange, handleOnFocus } = useSelectInput(isFocused, noop, noop, fullWidth, props.helpText, value, setCurrentValue, props.required, setIsRequired);\n const inputRef = useRef(null);\n const formControlSelectRef = useRef(null);\n const menuProps = {\n sx: inputWidth\n ? {\n maxWidth: removeSelectMenuMaxWidth ? 'unset' : inputWidth,\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n }\n : {\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n },\n };\n return (_jsx(_Fragment, { children: _jsxs(FormControlSelectStyled, Object.assign({}, props, { ref: formControlSelectRef, staticLabel: staticLabel, sx: !fullWidth ? { width: '200px' } : {}, disabled: props.disabled, error: props.hasError, value: currentValue, hideBg: props.hideBg, onMouseEnter: () => {\n !hovered && !opened && setHovered(true);\n }, onMouseLeave: () => {\n hovered && !opened && setHovered(false);\n }, onMouseDown: (e) => {\n const elemWidth = e.currentTarget.offsetWidth;\n setInputWidth(elemWidth);\n }, icon: props.icon, hovered: hovered, focused: isFocused, variant: \"filled\", fullWidth: fullWidth, children: [props.icon && _jsx(Icon, { color: props.disabled ? 'disabled' : 'inherit', className: props.icon }), _jsx(InputLabelSelect, { staticLabel: staticLabel, label: label, opened: opened, currentValue: currentValue }), _jsx(SelectInputStyled, { MenuProps: menuProps, required: isRequired, onOpen: () => {\n setOpened(true);\n }, onClose: () => {\n setIsFocused(false);\n setHovered(false);\n setOpened(false);\n }, onBlur: () => handleOnBlur(setIsFocused, onBlur), onFocus: () => handleOnFocus(setIsFocused, onFocus), IconComponent: () => (opened ? _jsx(Icon, { className: \"chevron-up\" }) : _jsx(Icon, { className: \"chevron-down\" })), labelId: label, id: props.id, name: props.name, value: currentValue, onChange: (e) => handleOnChange(e, onChange, setCurrentValue), ref: inputRef, hasIcon: !!props.icon, fullWidth: fullWidth, children: children }), _jsx(FormHelperText, { children: _jsx(HelperText, { maxChars: 0, currentValue: currentValue, helpText: props.helpText }) })] })) }));\n};\n/**\n * @description Button styling defintion based on props\n */\nconst SelectInputStyled = styled(MuiSelect, {\n shouldForwardProp: (prop) => prop !== 'hasIcon' && prop !== 'fullWidth',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n if (!args.fullWidth)\n return null;\n const width = args.hasIcon ? 'calc(100% - 102px) !important' : 'calc(100% - 62px) !important';\n return {\n '& > .MuiSelect-filled': {\n position: 'absolute',\n left: 0,\n top: 0,\n width: width,\n },\n };\n});\n//# sourceMappingURL=selectInput.js.map"],"names":["SelectInput","_a","label","onChange","onBlur","onFocus","value","children","staticLabel","InputProps","fullWidth","removeSelectMenuMaxWidth","props","__rest","currentValue","setCurrentValue","useState","isFocused","setIsFocused","hovered","setHovered","isRequired","setIsRequired","opened","setOpened","inputWidth","setInputWidth","handleOnBlur","handleOnChange","handleOnFocus","useSelectInput","noop","helpText","required","inputRef","useRef","formControlSelectRef","menuProps","sx","maxWidth","background","backdropFilter","_jsx","_Fragment","_jsxs","FormControlSelectStyled","Object","assign","ref","width","disabled","error","hasError","hideBg","onMouseEnter","onMouseLeave","onMouseDown","e","elemWidth","currentTarget","offsetWidth","icon","focused","variant","Icon","color","className","InputLabelSelect","SelectInputStyled","MenuProps","onOpen","onClose","IconComponent","labelId","id","name","hasIcon","FormHelperText","HelperText","maxChars","styled","MuiSelect","shouldForwardProp","prop","args","position","left","top"],"mappings":"4hBAmBY,MAACA,EAAeC,IACxB,IAAIC,MAAEA,EAAQ,KAAIC,SAAEA,EAAQC,OAAEA,EAAMC,QAAEA,EAAOC,MAAEA,EAAKC,SAAEA,EAAQC,YAAEA,EAAWC,WAAEA,EAAUC,UAAEA,GAAY,EAAIC,yBAAEA,G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D,EAAMiD,OAASnB,EAAKyB,EAAkB,CAAE3D,YAAaA,EAAaN,MAAOA,EAAOqB,OAAQA,EAAQT,aAAcA,IAAiB4B,EAAK0B,EAAmB,CAAEC,UAAWhC,EAAWJ,SAAUZ,EAAYiD,OAAQ,KACtY9C,GAAU,EAAK,EAChB+C,QAAS,KACRrD,GAAa,GACbE,GAAW,GACXI,GAAU,EAAM,EACjBpB,OAAQ,IAAMuB,EAAaT,EAAcd,GAASC,QAAS,IAAMwB,EAAcX,EAAcb,GAAUmE,cAAe,IAAgB9B,EAAKsB,EAAdzC,EAAoB,CAAE2C,UAAW,cAA6B,CAAEA,UAAW,iBAAoBO,QAASvE,EAAOwE,GAAI9D,EAAM8D,GAAIC,KAAM/D,EAAM+D,KAAMrE,MAAOQ,EAAcX,SAAWsD,GAAM7B,EAAe6B,EAAGtD,EAAUY,GAAkBiC,IAAKd,EAAU0C,UAAWhE,EAAMiD,KAAMnD,UAAWA,EAAWH,SAAUA,IAAamC,EAAKmC,EAAgB,CAAEtE,SAAUmC,EAAKoC,EAAY,CAAEC,SAAU,EAAGjE,aAAcA,EAAckB,SAAUpB,EAAMoB,kBAAwB,EAKzkBoC,EAAoBY,EAAOC,EAAW,CACxCC,kBAAoBC,GAAkB,YAATA,GAA+B,cAATA,GAD7BH,EAEtB/E,IACG,IAAiBmF,EAAOvE,EAAOZ,EAAI,CAAC,UACvC,IAAKmF,EAAK1E,UACN,OAAO,KAEX,MAAO,CACH,wBAAyB,CACrB2E,SAAU,WACVC,KAAM,EACNC,IAAK,EACLtC,MANMmC,EAAKR,QAAU,gCAAkC,gCAQ9D"}
1
+ {"version":3,"file":"selectInput.js","sources":["../../../src/components/selectInput/selectInput.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useRef, useState } from 'react';\nimport { FormControlSelectStyled } from './formControlSelectStyled';\nimport MuiSelect from '@mui/material/Select';\nimport { Icon } from '../icon';\nimport { useSelectInput } from './hook/useSelectInput';\nimport { styled } from '@mui/material/styles';\nimport InputLabelSelect from './inputLabelSelect';\nimport { FormHelperText } from '@mui/material';\nimport HelperText from '../common/helperText';\nimport noop from 'lodash/noop';\n/**\n * @description SkodaFlow SelectInput component.\n * Properties are inherited from HTML input element.\n * @param props SelectInputProps\n * @returns React Functional Component\n * @deprecated This component is deprecated. Use themed Select component from @mui/material instead.\n */\nexport const SelectInput = (_a) => {\n var { label = null, onChange, onBlur, onFocus, value, children, staticLabel, InputProps, fullWidth = true, removeSelectMenuMaxWidth } = _a, props = __rest(_a, [\"label\", \"onChange\", \"onBlur\", \"onFocus\", \"value\", \"children\", \"staticLabel\", \"InputProps\", \"fullWidth\", \"removeSelectMenuMaxWidth\"]);\n const [currentValue, setCurrentValue] = useState('');\n const [isFocused, setIsFocused] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [isRequired, setIsRequired] = useState(false);\n const [opened, setOpened] = useState(false);\n const [inputWidth, setInputWidth] = useState(null);\n const { handleOnBlur, handleOnChange, handleOnFocus } = useSelectInput(isFocused, noop, noop, fullWidth, props.helpText, value, setCurrentValue, props.required, setIsRequired);\n const inputRef = useRef(null);\n const formControlSelectRef = useRef(null);\n const menuProps = {\n sx: inputWidth\n ? {\n maxWidth: removeSelectMenuMaxWidth ? 'unset' : inputWidth,\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n }\n : {\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n },\n };\n return (_jsx(_Fragment, { children: _jsxs(FormControlSelectStyled, Object.assign({}, props, { ref: formControlSelectRef, staticLabel: staticLabel, sx: !fullWidth ? { width: '200px' } : {}, disabled: props.disabled, error: props.hasError, value: currentValue, hideBg: props.hideBg, onMouseEnter: () => {\n !hovered && !opened && setHovered(true);\n }, onMouseLeave: () => {\n hovered && !opened && setHovered(false);\n }, onMouseDown: (e) => {\n const elemWidth = e.currentTarget.offsetWidth;\n setInputWidth(elemWidth);\n }, icon: props.icon, hovered: hovered, focused: isFocused, variant: \"filled\", fullWidth: fullWidth, children: [props.icon && _jsx(Icon, { color: props.disabled ? 'disabled' : 'inherit', name: props.icon }), _jsx(InputLabelSelect, { staticLabel: staticLabel, label: label, opened: opened, currentValue: currentValue }), _jsx(SelectInputStyled, { MenuProps: menuProps, required: isRequired, onOpen: () => {\n setOpened(true);\n }, onClose: () => {\n setIsFocused(false);\n setHovered(false);\n setOpened(false);\n }, onBlur: () => handleOnBlur(setIsFocused, onBlur), onFocus: () => handleOnFocus(setIsFocused, onFocus), IconComponent: () => (opened ? _jsx(Icon, { name: \"chevron-up\" }) : _jsx(Icon, { name: \"chevron-down\" })), labelId: label, id: props.id, name: props.name, value: currentValue, onChange: (e) => handleOnChange(e, onChange, setCurrentValue), ref: inputRef, hasIcon: !!props.icon, fullWidth: fullWidth, children: children }), _jsx(FormHelperText, { children: _jsx(HelperText, { maxChars: 0, currentValue: currentValue, helpText: props.helpText }) })] })) }));\n};\n/**\n * @description Button styling defintion based on props\n */\nconst SelectInputStyled = styled(MuiSelect, {\n shouldForwardProp: (prop) => prop !== 'hasIcon' && prop !== 'fullWidth',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n if (!args.fullWidth)\n return null;\n const width = args.hasIcon ? 'calc(100% - 102px) !important' : 'calc(100% - 62px) !important';\n return {\n '& > .MuiSelect-filled': {\n position: 'absolute',\n left: 0,\n top: 0,\n width: width,\n },\n };\n});\n//# sourceMappingURL=selectInput.js.map"],"names":["SelectInput","_a","label","onChange","onBlur","onFocus","value","children","staticLabel","InputProps","fullWidth","removeSelectMenuMaxWidth","props","__rest","currentValue","setCurrentValue","useState","isFocused","setIsFocused","hovered","setHovered","isRequired","setIsRequired","opened","setOpened","inputWidth","setInputWidth","handleOnBlur","handleOnChange","handleOnFocus","useSelectInput","noop","helpText","required","inputRef","useRef","formControlSelectRef","menuProps","sx","maxWidth","background","backdropFilter","_jsx","_Fragment","_jsxs","FormControlSelectStyled","Object","assign","ref","width","disabled","error","hasError","hideBg","onMouseEnter","onMouseLeave","onMouseDown","e","elemWidth","currentTarget","offsetWidth","icon","focused","variant","Icon","color","name","InputLabelSelect","SelectInputStyled","MenuProps","onOpen","onClose","IconComponent","labelId","id","hasIcon","FormHelperText","HelperText","maxChars","styled","MuiSelect","shouldForwardProp","prop","args","position","left","top"],"mappings":"gkBAmBY,MAACA,EAAeC,IACxB,IAAIC,MAAEA,EAAQ,KAAIC,SAAEA,EAAQC,OAAEA,EAAMC,QAAEA,EAAOC,MAAEA,EAAKC,SAAEA,EAAQC,YAAEA,EAAWC,WAAEA,EAAUC,UAAEA,GAAY,EAAIC,yBAAEA,GAA6BV,EAAIW,EAAQC,EAAOZ,EAAI,CAAC,QAAS,WAAY,SAAU,UAAW,QAAS,WAAY,cAAe,aAAc,YAAa,6BACzQ,MAAOa,EAAcC,GAAmBC,EAAS,KAC1CC,EAAWC,GAAgBF,GAAS,IACpCG,EAASC,GAAcJ,GAAS,IAChCK,EAAYC,GAAiBN,GAAS,IACtCO,EAAQC,GAAaR,GAAS,IAC9BS,EAAYC,GAAiBV,EAAS,OACvCW,aAAEA,EAAYC,eAAEA,EAAcC,cAAEA,GAAkBC,EAAeb,EAAWc,EAAMA,EAAMrB,EAAWE,EAAMoB,SAAU1B,EAAOS,EAAiBH,EAAMqB,SAAUX,GAC3JY,EAAWC,EAAO,MAClBC,EAAuBD,EAAO,MAC9BE,EAAY,CACdC,GAAIb,EACE,CACEc,SAAU5B,EAA2B,QAAUc,EAC/C,sBAAuB,CACnBe,WAAY,cACZC,eAAgB,cAGtB,CACE,sBAAuB,CACnBD,WAAY,cACZC,eAAgB,eAIhC,OAAQC,EAAKC,EAAW,CAAEpC,SAAUqC,EAAMC,EAAyBC,OAAOC,OAAO,CAAA,EAAInC,EAAO,CAAEoC,IAAKZ,EAAsB5B,YAAaA,EAAa8B,GAAK5B,EAAiC,CAAA,E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C,GAAkB,YAATA,GAA+B,cAATA,GAD7BH,EAEtB9E,IACG,IAAiBkF,EAAOtE,EAAOZ,EAAI,CAAC,UACvC,IAAKkF,EAAKzE,UACN,OAAO,KAEX,MAAO,CACH,wBAAyB,CACrB0E,SAAU,WACVC,KAAM,EACNC,IAAK,EACLrC,MANMkC,EAAKR,QAAU,gCAAkC,gCAQ9D"}
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"tslib";import{jsxs as i,jsx as a}from"react/jsx-runtime";import{Icon as r}from"../icon/icon.js";import{styled as c}from"@mui/material/styles";import{checkForIcon as n}from"./snackbar.js";const s=({header:e,icon:r,message:c})=>i(t,{header:e,icon:r,children:[r&&a(l,{icon:r}),i("div",{className:"styled-message-header-message-container",children:[e&&i("h3",{children:[" ",e]}),i("p",{children:[" ",c," "]})]}),a("div",{className:"custom-snackbar-divider",children:a("div",{})})]}),t=c("div")((i=>{var a=e(i,[]);return{"& .styled-message-header-message-container":{display:a.header?"block":"flex"},"& p":{display:a.header?"block":"inline",paddingBottom:a.header?"0px":"2px"},"& .snackbar-icon-wrapper":{"& span":{lineHeight:a.header?"20px":"unset"}},"& .custom-snackbar-divider":{paddingLeft:n(a.icon)?"24px":"56px","& > div":{borderLeft:`1px solid ${a.theme.palette.onSurface.os600}`,height:a.header?"48px":"32px"}}}})),l=({icon:e})=>{let i=null;switch(e){case"alert":i=a(r,{className:"triangle-up-exclamation",fontSize:"inherit",iconStyle:"filled"});break;case"success":i=a(r,{className:"circle-check",fontSize:"inherit",iconStyle:"filled"});break;case"warning":i=a(r,{className:"circle-exclamation",fontSize:"inherit",iconStyle:"filled"})}return i?a("span",{className:"snackbar-icon-wrapper",children:i}):i};export{s as SnackbarMessage,t as SnackbarMessageStyled};
1
+ import{__rest as e}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{Icon as a}from"../icon/icon.js";import"../icon/icon.definitions.js";import{styled as n}from"@mui/material/styles";import{checkForIcon as c}from"./snackbar.js";const s=({header:e,icon:a,message:n})=>i(t,{header:e,icon:a,children:[a&&r(o,{icon:a}),i("div",{className:"styled-message-header-message-container",children:[e&&i("h3",{children:[" ",e]}),i("p",{children:[" ",n," "]})]}),r("div",{className:"custom-snackbar-divider",children:r("div",{})})]}),t=n("div")((i=>{var r=e(i,[]);return{"& .styled-message-header-message-container":{display:r.header?"block":"flex"},"& p":{display:r.header?"block":"inline",paddingBottom:r.header?"0px":"2px"},"& .snackbar-icon-wrapper":{"& span":{lineHeight:r.header?"20px":"unset"}},"& .custom-snackbar-divider":{paddingLeft:c(r.icon)?"24px":"56px","& > div":{borderLeft:`1px solid ${r.theme.palette.onSurface.os600}`,height:r.header?"48px":"32px"}}}})),o=({icon:e})=>{let i=null;switch(e){case"alert":i=r(a,{name:"warning",fontSize:"inherit",iconStyle:"filled"});break;case"success":i=r(a,{name:"circle-check",fontSize:"inherit",iconStyle:"filled"});break;case"warning":i=r(a,{name:"circle-exclamation",fontSize:"inherit",iconStyle:"filled"})}return i?r("span",{className:"snackbar-icon-wrapper",children:i}):i};export{s as SnackbarMessage,t as SnackbarMessageStyled};
2
2
  //# sourceMappingURL=snackbarMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snackbarMessage.js","sources":["../../../src/components/snackbar/snackbarMessage.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from '../icon';\nimport { styled } from '@mui/material/styles';\nimport { checkForIcon } from './snackbar';\nexport const SnackbarMessage = ({ header, icon, message }) => {\n return (_jsxs(SnackbarMessageStyled, { header: header, icon: icon, children: [icon && _jsx(IconComponent, { icon: icon }), _jsxs(\"div\", { className: \"styled-message-header-message-container\", children: [header && _jsxs(\"h3\", { children: [\" \", header] }), _jsxs(\"p\", { children: [\" \", message, \" \"] })] }), _jsx(\"div\", { className: \"custom-snackbar-divider\", children: _jsx(\"div\", {}) })] }));\n};\n/**\n * @description SnackbarMessageStyled styling defintion based on props\n */\nexport const SnackbarMessageStyled = styled('div')((_a) => {\n var args = __rest(_a, []);\n return {\n '& .styled-message-header-message-container': {\n display: args.header ? 'block' : 'flex',\n },\n '& p': {\n display: args.header ? 'block' : 'inline',\n paddingBottom: args.header ? '0px' : '2px',\n },\n '& .snackbar-icon-wrapper': {\n '& span': {\n lineHeight: args.header ? '20px' : 'unset',\n },\n },\n '& .custom-snackbar-divider': {\n paddingLeft: checkForIcon(args.icon) ? '24px' : '56px',\n '& > div': {\n borderLeft: `1px solid ${args.theme.palette.onSurface.os600}`,\n height: args.header ? '48px' : '32px',\n },\n },\n };\n});\nconst IconComponent = ({ icon }) => {\n let iconToReturn = null;\n switch (icon) {\n case 'alert':\n iconToReturn = _jsx(Icon, { className: \"triangle-up-exclamation\", fontSize: \"inherit\", iconStyle: \"filled\" });\n break;\n case 'success':\n iconToReturn = _jsx(Icon, { className: \"circle-check\", fontSize: \"inherit\", iconStyle: \"filled\" });\n break;\n case 'warning':\n iconToReturn = _jsx(Icon, { className: \"circle-exclamation\", fontSize: \"inherit\", iconStyle: \"filled\" });\n break;\n }\n return iconToReturn ? _jsx(\"span\", { className: \"snackbar-icon-wrapper\", children: iconToReturn }) : iconToReturn;\n};\n//# sourceMappingURL=snackbarMessage.js.map"],"names":["SnackbarMessage","header","icon","message","_jsxs","SnackbarMessageStyled","children","_jsx","IconComponent","className","styled","_a","args","__rest","display","paddingBottom","lineHeight","paddingLeft","checkForIcon","borderLeft","theme","palette","onSurface","os600","height","iconToReturn","Icon","fontSize","iconStyle"],"mappings":"mNAKY,MAACA,EAAkB,EAAGC,SAAQC,OAAMC,aACpCC,EAAMC,EAAuB,CAAEJ,OAAQA,EAAQC,KAAMA,EAAMI,SAAU,CAACJ,GAAQK,EAAKC,EAAe,CAAEN,KAAMA,IAASE,EAAM,MAAO,CAAEK,UAAW,0CAA2CH,SAAU,CAACL,GAAUG,EAAM,KAAM,CAAEE,SAAU,CAAC,IAAKL,KAAYG,EAAM,IAAK,CAAEE,SAAU,CAAC,IAAKH,EAAS,UAAaI,EAAK,MAAO,CAAEE,UAAW,0BAA2BH,SAAUC,EAAK,MAAO,CAAE,QAKrXF,EAAwBK,EAAO,MAAPA,EAAeC,IAChD,IAAIC,EAAOC,EAAOF,EAAI,IACtB,MAAO,CACH,6CAA8C,CAC1CG,QAASF,EAAKX,OAAS,QAAU,QAErC,MAAO,CACHa,QAASF,EAAKX,OAAS,QAAU,SACjCc,cAAeH,EAAKX,OAAS,MAAQ,OAEzC,2BAA4B,CACxB,SAAU,CACNe,WAAYJ,EAAKX,OAAS,OAAS,UAG3C,6BAA8B,CAC1BgB,YAAaC,EAAaN,EAAKV,MAAQ,OAAS,OAChD,UAAW,CACPiB,WAAY,aAAaP,EAAKQ,MAAMC,QAAQC,UAAUC,QACtDC,OAAQZ,EAAKX,OAAS,OAAS,SAG1C,IAECO,EAAgB,EAAGN,WACrB,IAAIuB,EAAe,KACnB,OAAQvB,GACJ,IAAK,QACDuB,EAAelB,EAAKmB,EAAM,CAAEjB,UAAW,0BAA2BkB,SAAU,UAAWC,UAAW,WAClG,MACJ,IAAK,UACDH,EAAelB,EAAKmB,EAAM,CAAEjB,UAAW,eAAgBkB,SAAU,UAAWC,UAAW,WACvF,MACJ,IAAK,UACDH,EAAelB,EAAKmB,EAAM,CAAEjB,UAAW,qBAAsBkB,SAAU,UAAWC,UAAW,WAGrG,OAAOH,EAAelB,EAAK,OAAQ,CAAEE,UAAW,wBAAyBH,SAAUmB,IAAkBA,CAAY"}
1
+ {"version":3,"file":"snackbarMessage.js","sources":["../../../src/components/snackbar/snackbarMessage.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from '../icon';\nimport { styled } from '@mui/material/styles';\nimport { checkForIcon } from './snackbar';\nexport const SnackbarMessage = ({ header, icon, message }) => {\n return (_jsxs(SnackbarMessageStyled, { header: header, icon: icon, children: [icon && _jsx(IconComponent, { icon: icon }), _jsxs(\"div\", { className: \"styled-message-header-message-container\", children: [header && _jsxs(\"h3\", { children: [\" \", header] }), _jsxs(\"p\", { children: [\" \", message, \" \"] })] }), _jsx(\"div\", { className: \"custom-snackbar-divider\", children: _jsx(\"div\", {}) })] }));\n};\n/**\n * @description SnackbarMessageStyled styling defintion based on props\n */\nexport const SnackbarMessageStyled = styled('div')((_a) => {\n var args = __rest(_a, []);\n return {\n '& .styled-message-header-message-container': {\n display: args.header ? 'block' : 'flex',\n },\n '& p': {\n display: args.header ? 'block' : 'inline',\n paddingBottom: args.header ? '0px' : '2px',\n },\n '& .snackbar-icon-wrapper': {\n '& span': {\n lineHeight: args.header ? '20px' : 'unset',\n },\n },\n '& .custom-snackbar-divider': {\n paddingLeft: checkForIcon(args.icon) ? '24px' : '56px',\n '& > div': {\n borderLeft: `1px solid ${args.theme.palette.onSurface.os600}`,\n height: args.header ? '48px' : '32px',\n },\n },\n };\n});\nconst IconComponent = ({ icon }) => {\n let iconToReturn = null;\n switch (icon) {\n case 'alert':\n iconToReturn = _jsx(Icon, { name: \"warning\", fontSize: \"inherit\", iconStyle: \"filled\" });\n break;\n case 'success':\n iconToReturn = _jsx(Icon, { name: \"circle-check\", fontSize: \"inherit\", iconStyle: \"filled\" });\n break;\n case 'warning':\n iconToReturn = _jsx(Icon, { name: \"circle-exclamation\", fontSize: \"inherit\", iconStyle: \"filled\" });\n break;\n }\n return iconToReturn ? _jsx(\"span\", { className: \"snackbar-icon-wrapper\", children: iconToReturn }) : iconToReturn;\n};\n//# sourceMappingURL=snackbarMessage.js.map"],"names":["SnackbarMessage","header","icon","message","_jsxs","SnackbarMessageStyled","children","_jsx","IconComponent","className","styled","_a","args","__rest","display","paddingBottom","lineHeight","paddingLeft","checkForIcon","borderLeft","theme","palette","onSurface","os600","height","iconToReturn","Icon","name","fontSize","iconStyle"],"mappings":"uPAKY,MAACA,EAAkB,EAAGC,SAAQC,OAAMC,aACpCC,EAAMC,EAAuB,CAAEJ,OAAQA,EAAQC,KAAMA,EAAMI,SAAU,CAACJ,GAAQK,EAAKC,EAAe,CAAEN,KAAMA,IAASE,EAAM,MAAO,CAAEK,UAAW,0CAA2CH,SAAU,CAACL,GAAUG,EAAM,KAAM,CAAEE,SAAU,CAAC,IAAKL,KAAYG,EAAM,IAAK,CAAEE,SAAU,CAAC,IAAKH,EAAS,UAAaI,EAAK,MAAO,CAAEE,UAAW,0BAA2BH,SAAUC,EAAK,MAAO,CAAE,QAKrXF,EAAwBK,EAAO,MAAPA,EAAeC,IAChD,IAAIC,EAAOC,EAAOF,EAAI,IACtB,MAAO,CACH,6CAA8C,CAC1CG,QAASF,EAAKX,OAAS,QAAU,QAErC,MAAO,CACHa,QAASF,EAAKX,OAAS,QAAU,SACjCc,cAAeH,EAAKX,OAAS,MAAQ,OAEzC,2BAA4B,CACxB,SAAU,CACNe,WAAYJ,EAAKX,OAAS,OAAS,UAG3C,6BAA8B,CAC1BgB,YAAaC,EAAaN,EAAKV,MAAQ,OAAS,OAChD,UAAW,CACPiB,WAAY,aAAaP,EAAKQ,MAAMC,QAAQC,UAAUC,QACtDC,OAAQZ,EAAKX,OAAS,OAAS,SAG1C,IAECO,EAAgB,EAAGN,WACrB,IAAIuB,EAAe,KACnB,OAAQvB,GACJ,IAAK,QACDuB,EAAelB,EAAKmB,EAAM,CAAEC,KAAM,UAAWC,SAAU,UAAWC,UAAW,WAC7E,MACJ,IAAK,UACDJ,EAAelB,EAAKmB,EAAM,CAAEC,KAAM,eAAgBC,SAAU,UAAWC,UAAW,WAClF,MACJ,IAAK,UACDJ,EAAelB,EAAKmB,EAAM,CAAEC,KAAM,qBAAsBC,SAAU,UAAWC,UAAW,WAGhG,OAAOJ,EAAelB,EAAK,OAAQ,CAAEE,UAAW,wBAAyBH,SAAUmB,IAAkBA,CAAY"}
@@ -1,3 +1,4 @@
1
+ /** @deprecated use Tab component from @mui/material instead */
1
2
  declare const useTabs: () => {
2
3
  handleOverflowingTabs: (tabsRef: any, windowWidth: any, children: any, setMenuChildren: any) => void;
3
4
  handleIsMobileView: (variantSecondaryNavigation: any, isMobileView: any, setIsMobileView: any, setWindowWidth: any) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useTabs.js","sources":["../../../../src/components/tab/hook/useTabs.ts"],"sourcesContent":["import { useTheme } from '@mui/material';\nimport React, { useCallback } from 'react';\nconst useTabs = () => {\n const theme = useTheme();\n //HANDLE THE RENDER OF THE MORE BTN TABS AND THE OVERFLOWING TABS THAT MUST BE SHOWN INSIDE THE DROPDOWN\n const handleOverflowingTabs = useCallback((tabsRef, windowWidth, children, setMenuChildren) => {\n const tabsListParent = tabsRef.current.closest('div');\n const tabsListContainer = tabsListParent.querySelectorAll('div')[1];\n const tabsList = tabsListContainer.querySelectorAll('.MuiTab-root');\n const moreBtn = [...tabsList].find((item) => item.id === 'simple-tab-more');\n tabsList.forEach((item) => {\n item.style.display = 'inline-flex';\n });\n //if the screen size is desktop view, handle more btn, else hide more btn\n const hiddenItems = [];\n const primaryWidth = tabsListContainer.offsetWidth;\n const primaryItems = [...tabsList].filter((item) => item.id !== 'simple-tab-more');\n const moreBtnWidth = moreBtn.offsetWidth + 58;\n //we are hiding tabs if the overflow the tabs container\n primaryItems.forEach((item) => {\n if (primaryWidth <= item.offsetLeft + (item.offsetWidth + moreBtnWidth)) {\n item.style.display = 'none';\n hiddenItems.push(item.id);\n }\n });\n // if there are hidden elements (overflowing) show the more tabs and add hidden elements inisde the menu list\n //else hide more button\n if (!hiddenItems.length) {\n moreBtn.style.display = 'none';\n }\n else {\n const arr = [];\n hiddenItems.forEach((item) => {\n const filteredChildren = React.Children.toArray(children).find((child) => item === 'simple-tab-' + child.props.value);\n if (filteredChildren) {\n arr.push(filteredChildren);\n }\n });\n setMenuChildren(arr);\n }\n }, [theme.breakpoints.values.lg]);\n const handleIsMobileView = useCallback((variantSecondaryNavigation, isMobileView, setIsMobileView, setWindowWidth) => {\n setWindowWidth(window.innerWidth);\n if (variantSecondaryNavigation) {\n if (window.innerWidth <= theme.breakpoints.values.md && !isMobileView) {\n setIsMobileView(true);\n }\n else if (window.innerWidth > theme.breakpoints.values.md) {\n setIsMobileView(false);\n }\n }\n }, [theme.breakpoints.values.md]);\n //Returns the id and the aria controls for the tab component\n const a11yProps = useCallback((index) => {\n return {\n id: `simple-tab-${index}`,\n 'aria-controls': `simple-tabpanel-${index}`,\n };\n }, []);\n return {\n handleOverflowingTabs,\n handleIsMobileView,\n a11yProps,\n };\n};\nexport default useTabs;\n//# sourceMappingURL=useTabs.js.map"],"names":["useTabs","theme","useTheme","handleOverflowingTabs","useCallback","tabsRef","windowWidth","children","setMenuChildren","tabsListContainer","current","closest","querySelectorAll","tabsList","moreBtn","find","item","id","forEach","style","display","hiddenItems","primaryWidth","offsetWidth","primaryItems","filter","moreBtnWidth","offsetLeft","push","length","arr","filteredChildren","React","Children","toArray","child","props","value","breakpoints","values","lg","handleIsMobileView","variantSecondaryNavigation","isMobileView","setIsMobileView","setWindowWidth","window","innerWidth","md","a11yProps","index"],"mappings":"gFAEK,MAACA,EAAU,KACZ,MAAMC,EAAQC,IAwDd,MAAO,CACHC,sBAvD0BC,GAAY,CAACC,EAASC,EAAaC,EAAUC,KACvE,MACMC,EADiBJ,EAAQK,QAAQC,QAAQ,OACNC,iBAAiB,OAAO,GAC3DC,EAAWJ,EAAkBG,iBAAiB,gBAC9CE,EAAU,IAAID,GAAUE,MAAMC,GAAqB,oBAAZA,EAAKC,KAClDJ,EAASK,SAASF,IACdA,EAAKG,MAAMC,QAAU,aAAa,IAGtC,MAAMC,EAAc,GACdC,EAAeb,EAAkBc,YACjCC,EAAe,IAAIX,GAAUY,QAAQT,GAAqB,oBAAZA,EAAKC,KACnDS,EAAeZ,EAAQS,YAAc,GAU3C,GARAC,EAAaN,SAASF,IACdM,GAAgBN,EAAKW,YAAcX,EAAKO,YAAcG,KACtDV,EAAKG,MAAMC,QAAU,OACrBC,EAAYO,KAAKZ,EAAKC,IACzB,IAIAI,EAAYQ,OAGZ,CACD,MAAMC,EAAM,GACZT,EAAYH,SAASF,IACjB,MAAMe,EAAmBC,EAAMC,SAASC,QAAQ3B,GAAUQ,MAAMoB,GAAUnB,IAAS,cAAgBmB,EAAMC,MAAMC,QAC3GN,GACAD,EAAIF,KAAKG,EACZ,IAELvB,EAAgBsB,EACnB,MAXGhB,EAAQK,MAAMC,QAAU,MAW3B,GACF,CAACnB,EAAMqC,YAAYC,OAAOC,KAqBzBC,mBApBuBrC,GAAY,CAACsC,EAA4BC,EAAcC,EAAiBC,KAC/FA,EAAeC,OAAOC,YAClBL,IACII,OAAOC,YAAc9C,EAAMqC,YAAYC,OAAOS,KAAOL,EACrDC,GAAgB,GAEXE,OAAOC,WAAa9C,EAAMqC,YAAYC,OAAOS,IAClDJ,GAAgB,GAEvB,GACF,CAAC3C,EAAMqC,YAAYC,OAAOS,KAWzBC,UATc7C,GAAa8C,IACpB,CACHjC,GAAI,cAAciC,IAClB,gBAAiB,mBAAmBA,OAEzC,IAKF"}
1
+ {"version":3,"file":"useTabs.js","sources":["../../../../src/components/tab/hook/useTabs.ts"],"sourcesContent":["import { useTheme } from '@mui/material';\nimport React, { useCallback } from 'react';\n/** @deprecated use Tab component from @mui/material instead */\nconst useTabs = () => {\n const theme = useTheme();\n //HANDLE THE RENDER OF THE MORE BTN TABS AND THE OVERFLOWING TABS THAT MUST BE SHOWN INSIDE THE DROPDOWN\n const handleOverflowingTabs = useCallback((tabsRef, windowWidth, children, setMenuChildren) => {\n const tabsListParent = tabsRef.current.closest('div');\n const tabsListContainer = tabsListParent.querySelectorAll('div')[1];\n const tabsList = tabsListContainer.querySelectorAll('.MuiTab-root');\n const moreBtn = [...tabsList].find((item) => item.id === 'simple-tab-more');\n tabsList.forEach((item) => {\n item.style.display = 'inline-flex';\n });\n //if the screen size is desktop view, handle more btn, else hide more btn\n const hiddenItems = [];\n const primaryWidth = tabsListContainer.offsetWidth;\n const primaryItems = [...tabsList].filter((item) => item.id !== 'simple-tab-more');\n const moreBtnWidth = moreBtn.offsetWidth + 58;\n //we are hiding tabs if the overflow the tabs container\n primaryItems.forEach((item) => {\n if (primaryWidth <= item.offsetLeft + (item.offsetWidth + moreBtnWidth)) {\n item.style.display = 'none';\n hiddenItems.push(item.id);\n }\n });\n // if there are hidden elements (overflowing) show the more tabs and add hidden elements inisde the menu list\n //else hide more button\n if (!hiddenItems.length) {\n moreBtn.style.display = 'none';\n }\n else {\n const arr = [];\n hiddenItems.forEach((item) => {\n const filteredChildren = React.Children.toArray(children).find((child) => item === 'simple-tab-' + child.props.value);\n if (filteredChildren) {\n arr.push(filteredChildren);\n }\n });\n setMenuChildren(arr);\n }\n }, [theme.breakpoints.values.lg]);\n const handleIsMobileView = useCallback((variantSecondaryNavigation, isMobileView, setIsMobileView, setWindowWidth) => {\n setWindowWidth(window.innerWidth);\n if (variantSecondaryNavigation) {\n if (window.innerWidth <= theme.breakpoints.values.md && !isMobileView) {\n setIsMobileView(true);\n }\n else if (window.innerWidth > theme.breakpoints.values.md) {\n setIsMobileView(false);\n }\n }\n }, [theme.breakpoints.values.md]);\n //Returns the id and the aria controls for the tab component\n const a11yProps = useCallback((index) => {\n return {\n id: `simple-tab-${index}`,\n 'aria-controls': `simple-tabpanel-${index}`,\n };\n }, []);\n return {\n handleOverflowingTabs,\n handleIsMobileView,\n a11yProps,\n };\n};\nexport default useTabs;\n//# sourceMappingURL=useTabs.js.map"],"names":["useTabs","theme","useTheme","handleOverflowingTabs","useCallback","tabsRef","windowWidth","children","setMenuChildren","tabsListContainer","current","closest","querySelectorAll","tabsList","moreBtn","find","item","id","forEach","style","display","hiddenItems","primaryWidth","offsetWidth","primaryItems","filter","moreBtnWidth","offsetLeft","push","length","arr","filteredChildren","React","Children","toArray","child","props","value","breakpoints","values","lg","handleIsMobileView","variantSecondaryNavigation","isMobileView","setIsMobileView","setWindowWidth","window","innerWidth","md","a11yProps","index"],"mappings":"gFAGK,MAACA,EAAU,KACZ,MAAMC,EAAQC,IAwDd,MAAO,CACHC,sBAvD0BC,GAAY,CAACC,EAASC,EAAaC,EAAUC,KACvE,MACMC,EADiBJ,EAAQK,QAAQC,QAAQ,OACNC,iBAAiB,OAAO,GAC3DC,EAAWJ,EAAkBG,iBAAiB,gBAC9CE,EAAU,IAAID,GAAUE,MAAMC,GAAqB,oBAAZA,EAAKC,KAClDJ,EAASK,SAASF,IACdA,EAAKG,MAAMC,QAAU,aAAa,IAGtC,MAAMC,EAAc,GACdC,EAAeb,EAAkBc,YACjCC,EAAe,IAAIX,GAAUY,QAAQT,GAAqB,oBAAZA,EAAKC,KACnDS,EAAeZ,EAAQS,YAAc,GAU3C,GARAC,EAAaN,SAASF,IACdM,GAAgBN,EAAKW,YAAcX,EAAKO,YAAcG,KACtDV,EAAKG,MAAMC,QAAU,OACrBC,EAAYO,KAAKZ,EAAKC,IACzB,IAIAI,EAAYQ,OAGZ,CACD,MAAMC,EAAM,GACZT,EAAYH,SAASF,IACjB,MAAMe,EAAmBC,EAAMC,SAASC,QAAQ3B,GAAUQ,MAAMoB,GAAUnB,IAAS,cAAgBmB,EAAMC,MAAMC,QAC3GN,GACAD,EAAIF,KAAKG,EACZ,IAELvB,EAAgBsB,EACnB,MAXGhB,EAAQK,MAAMC,QAAU,MAW3B,GACF,CAACnB,EAAMqC,YAAYC,OAAOC,KAqBzBC,mBApBuBrC,GAAY,CAACsC,EAA4BC,EAAcC,EAAiBC,KAC/FA,EAAeC,OAAOC,YAClBL,IACII,OAAOC,YAAc9C,EAAMqC,YAAYC,OAAOS,KAAOL,EACrDC,GAAgB,GAEXE,OAAOC,WAAa9C,EAAMqC,YAAYC,OAAOS,IAClDJ,GAAgB,GAEvB,GACF,CAAC3C,EAAMqC,YAAYC,OAAOS,KAWzBC,UATc7C,GAAa8C,IACpB,CACHjC,GAAI,cAAciC,IAClB,gBAAiB,mBAAmBA,OAEzC,IAKF"}
@@ -32,5 +32,6 @@ export interface TabProps {
32
32
  * @description SkodaFlow Tab component.
33
33
  * @param props TabProps
34
34
  * @returns React Functional Component
35
+ * @deprecated use Tab component from @mui/material instead
35
36
  */
36
37
  export declare const MenuTab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import r,{forwardRef as i,useContext as l,useState as t,useCallback as n,useEffect as c}from"react";import{TabsContext as p}from"./tabs.js";import{MenuItem as s,Popper as m,ClickAwayListener as d,Fade as b,styled as u,MenuList as h}from"@mui/material";import{Icon as x}from"../icon/icon.js";import f from"./tabStyled.js";import v from"./hook/useTabs.js";const k=i((({label:i,value:u,children:h},k)=>{const{activeTab:C,updateActiveTab:g,smallSize:j}=l(p),[y,T]=t(!1),[S,z]=t(!1),[A,P]=t(null),[N,O]=t(null),{a11yProps:E}=v(),H=n((e=>{e.href?window.open(e.href,e.target):g(e.value,!0),z(!1),e.onClick&&e.onClick(e.value),e.analyticsCallback&&e.analyticsCallback(e.value),O(e.label)}),[g]),I=n((e=>{z(!S),P(e.currentTarget)}),[S]),M=n((()=>r.Children.map(h,(o=>e(s,{style:{fontSize:"16px"},onClick:()=>H(o.props),children:o.props.label})))),[h,H]);return c((()=>{T(C===u)}),[C,y,u]),o(a,{children:[e(f,Object.assign({ref:k,wrapped:!0,onClick:I,smallSize:j,isActive:y,value:u,tabIndex:1,label:N||i},E(u),{icon:e(x,{className:S?"chevron-up":"chevron-down"}),iconPosition:"end",className:"MuiTab-more"})),e(m,{open:S,anchorEl:A,placement:"bottom",transition:!0,children:({TransitionProps:o})=>e(d,{onClickAway:()=>z(!1),children:e(b,Object.assign({},o,{timeout:350,children:e(w,{id:"more-tabs-menu",children:M()})}))})})]})})),w=u(h)((()=>({top:"13px",left:"27px",boxShadow:"rgb(0 0 0 / 15%) 0px 3px 8px",borderRadius:"4px",padding:"0px",width:"131px",maxHeight:"240px",overflow:"overlay"})));export{k as MenuTab};
1
+ import{jsx as e,jsxs as o,Fragment as i}from"react/jsx-runtime";import r,{forwardRef as a,useContext as n,useState as l,useCallback as t,useEffect as c}from"react";import{TabsContext as p}from"./tabs.js";import{MenuItem as s,Popper as m,ClickAwayListener as d,Fade as b,styled as u,MenuList as h}from"@mui/material";import{Icon as x}from"../icon/icon.js";import"../icon/icon.definitions.js";import f from"./tabStyled.js";import v from"./hook/useTabs.js";const j=a((({label:a,value:u,children:h},j)=>{const{activeTab:w,updateActiveTab:C,smallSize:g}=n(p),[y,T]=l(!1),[S,z]=l(!1),[A,P]=l(null),[O,E]=l(null),{a11yProps:H}=v(),I=t((e=>{e.href?window.open(e.href,e.target):C(e.value,!0),z(!1),e.onClick&&e.onClick(e.value),e.analyticsCallback&&e.analyticsCallback(e.value),E(e.label)}),[C]),M=t((e=>{z(!S),P(e.currentTarget)}),[S]),N=t((()=>r.Children.map(h,(o=>e(s,{style:{fontSize:"16px"},onClick:()=>I(o.props),children:o.props.label})))),[h,I]);return c((()=>{T(w===u)}),[w,y,u]),o(i,{children:[e(f,Object.assign({ref:j,wrapped:!0,onClick:M,smallSize:g,isActive:y,value:u,tabIndex:1,label:O||a},H(u),{icon:e(x,{name:S?"chevron-up":"chevron-down"}),iconPosition:"end",className:"MuiTab-more"})),e(m,{open:S,anchorEl:A,placement:"bottom",transition:!0,children:({TransitionProps:o})=>e(d,{onClickAway:()=>z(!1),children:e(b,Object.assign({},o,{timeout:350,children:e(k,{id:"more-tabs-menu",children:N()})}))})})]})})),k=u(h)((()=>({top:"13px",left:"27px",boxShadow:"rgb(0 0 0 / 15%) 0px 3px 8px",borderRadius:"4px",padding:"0px",width:"131px",maxHeight:"240px",overflow:"overlay"})));export{j as MenuTab};
2
2
  //# sourceMappingURL=menuTab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menuTab.js","sources":["../../../src/components/tab/menuTab.tsx"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { useState, useContext, useEffect, useCallback, forwardRef } from 'react';\nimport { TabsContext } from './tabs';\nimport { ClickAwayListener, Fade, MenuItem, MenuList, Popper, styled } from '@mui/material';\nimport { Icon } from '../icon';\nimport TabStyled from './tabStyled';\nimport useTabs from './hook/useTabs';\n/**\n * @description SkodaFlow Tab component.\n * @param props TabProps\n * @returns React Functional Component\n */\nexport const MenuTab = forwardRef(({ label, value, children }, ref) => {\n const { activeTab, updateActiveTab, smallSize } = useContext(TabsContext);\n const [isActive, setIsActive] = useState(false);\n const [open, setOpen] = useState(false);\n const [anchorEl, setAnchorEl] = useState(null);\n const [selectedLabel, setSelectedLabel] = useState(null);\n const { a11yProps } = useTabs();\n //On tab clicked: set the new activeTab selected\n //if is a menu tab: set the anchor element for the menu and set the width of the menu equal to the tab component\n //then call the onClick from outside\n const handleOnClick = useCallback((_props) => {\n if (!_props.href) {\n updateActiveTab(_props.value, true);\n }\n else {\n window.open(_props.href, _props.target);\n }\n setOpen(false);\n _props.onClick && _props.onClick(_props.value);\n _props.analyticsCallback && _props.analyticsCallback(_props.value);\n setSelectedLabel(_props.label);\n }, [updateActiveTab]);\n const handleOpenMenu = useCallback((e) => {\n setOpen(!open);\n setAnchorEl(e.currentTarget);\n }, [open]);\n //RETURNS ALL THE TABS OVERFLOWING AS MENU ITEMS\n const handleMenuItems = useCallback(() => {\n return React.Children.map(children, (child) => {\n return (_jsx(MenuItem, { style: { fontSize: '16px' }, onClick: () => handleOnClick(child.props), children: child.props.label }));\n });\n }, [children, handleOnClick]);\n //If the activeTab is equal to the current tab, set active\n useEffect(() => {\n if (activeTab === value) {\n setIsActive(true);\n }\n else {\n setIsActive(false);\n }\n }, [activeTab, isActive, value]);\n return (_jsxs(_Fragment, { children: [_jsx(TabStyled, Object.assign({ ref: ref, wrapped: true, onClick: handleOpenMenu, smallSize: smallSize, isActive: isActive, value: value, tabIndex: 1, label: selectedLabel || label }, a11yProps(value), { icon: _jsx(Icon, { className: open ? 'chevron-up' : 'chevron-down' }), iconPosition: \"end\", className: \"MuiTab-more\" })), _jsx(Popper, { open: open, anchorEl: anchorEl, placement: \"bottom\", transition: true, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: () => setOpen(false), children: _jsx(Fade, Object.assign({}, TransitionProps, { timeout: 350, children: _jsx(MenuStyled, { id: \"more-tabs-menu\", children: handleMenuItems() }) })) })) })] }));\n});\nconst MenuStyled = styled(MenuList)(() => {\n return {\n top: '13px',\n left: '27px',\n boxShadow: 'rgb(0 0 0 / 15%) 0px 3px 8px',\n borderRadius: '4px',\n padding: '0px',\n width: '131px',\n maxHeight: '240px',\n overflow: 'overlay',\n };\n});\n//# sourceMappingURL=menuTab.js.map"],"names":["MenuTab","forwardRef","label","value","children","ref","activeTab","updateActiveTab","smallSize","useContext","TabsContext","isActive","setIsActive","useState","open","setOpen","anchorEl","setAnchorEl","selectedLabel","setSelectedLabel","a11yProps","useTabs","handleOnClick","useCallback","_props","href","window","target","onClick","analyticsCallback","handleOpenMenu","e","currentTarget","handleMenuItems","React","Children","map","child","_jsx","MenuItem","style","fontSize","props","useEffect","_jsxs","_Fragment","TabStyled","Object","assign","wrapped","tabIndex","icon","Icon","className","iconPosition","Popper","placement","transition","TransitionProps","ClickAwayListener","onClickAway","Fade","timeout","MenuStyled","id","styled","MenuList","top","left","boxShadow","borderRadius","padding","width","maxHeight","overflow"],"mappings":"kaAYY,MAACA,EAAUC,GAAW,EAAGC,QAAOC,QAAOC,YAAYC,KAC3D,MAAMC,UAAEA,EAASC,gBAAEA,EAAeC,UAAEA,GAAcC,EAAWC,IACtDC,EAAUC,GAAeC,GAAS,IAClCC,EAAMC,GAAWF,GAAS,IAC1BG,EAAUC,GAAeJ,EAAS,OAClCK,EAAeC,GAAoBN,EAAS,OAC7CO,UAAEA,GAAcC,IAIhBC,EAAgBC,GAAaC,IAC1BA,EAAOC,KAIRC,OAAOZ,KAAKU,EAAOC,KAAMD,EAAOG,QAHhCpB,EAAgBiB,EAAOrB,OAAO,GAKlCY,GAAQ,GACRS,EAAOI,SAAWJ,EAAOI,QAAQJ,EAAOrB,OACxC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":["../../../src/components/tab/menuTab.tsx"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { useState, useContext, useEffect, useCallback, forwardRef } from 'react';\nimport { TabsContext } from './tabs';\nimport { ClickAwayListener, Fade, MenuItem, MenuList, Popper, styled } from '@mui/material';\nimport { Icon } from '../icon';\nimport TabStyled from './tabStyled';\nimport useTabs from './hook/useTabs';\n/**\n * @description SkodaFlow Tab component.\n * @param props TabProps\n * @returns React Functional Component\n * @deprecated use Tab component from @mui/material instead\n */\nexport const MenuTab = forwardRef(({ label, value, children }, ref) => {\n const { activeTab, updateActiveTab, smallSize } = useContext(TabsContext);\n const [isActive, setIsActive] = useState(false);\n const [open, setOpen] = useState(false);\n const [anchorEl, setAnchorEl] = useState(null);\n const [selectedLabel, setSelectedLabel] = useState(null);\n const { a11yProps } = useTabs();\n //On tab clicked: set the new activeTab selected\n //if is a menu tab: set the anchor element for the menu and set the width of the menu equal to the tab component\n //then call the onClick from outside\n const handleOnClick = useCallback((_props) => {\n if (!_props.href) {\n updateActiveTab(_props.value, true);\n }\n else {\n window.open(_props.href, _props.target);\n }\n setOpen(false);\n _props.onClick && _props.onClick(_props.value);\n _props.analyticsCallback && _props.analyticsCallback(_props.value);\n setSelectedLabel(_props.label);\n }, [updateActiveTab]);\n const handleOpenMenu = useCallback((e) => {\n setOpen(!open);\n setAnchorEl(e.currentTarget);\n }, [open]);\n //RETURNS ALL THE TABS OVERFLOWING AS MENU ITEMS\n const handleMenuItems = useCallback(() => {\n return React.Children.map(children, (child) => {\n return (_jsx(MenuItem, { style: { fontSize: '16px' }, onClick: () => handleOnClick(child.props), children: child.props.label }));\n });\n }, [children, handleOnClick]);\n //If the activeTab is equal to the current tab, set active\n useEffect(() => {\n if (activeTab === value) {\n setIsActive(true);\n }\n else {\n setIsActive(false);\n }\n }, [activeTab, isActive, value]);\n return (_jsxs(_Fragment, { children: [_jsx(TabStyled, Object.assign({ ref: ref, wrapped: true, onClick: handleOpenMenu, smallSize: smallSize, isActive: isActive, value: value, tabIndex: 1, label: selectedLabel || label }, a11yProps(value), { icon: _jsx(Icon, { name: open ? 'chevron-up' : 'chevron-down' }), iconPosition: \"end\", className: \"MuiTab-more\" })), _jsx(Popper, { open: open, anchorEl: anchorEl, placement: \"bottom\", transition: true, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: () => setOpen(false), children: _jsx(Fade, Object.assign({}, TransitionProps, { timeout: 350, children: _jsx(MenuStyled, { id: \"more-tabs-menu\", children: handleMenuItems() }) })) })) })] }));\n});\nconst MenuStyled = styled(MenuList)(() => {\n return {\n top: '13px',\n left: '27px',\n boxShadow: 'rgb(0 0 0 / 15%) 0px 3px 8px',\n borderRadius: '4px',\n padding: '0px',\n width: '131px',\n maxHeight: '240px',\n overflow: 'overlay',\n };\n});\n//# sourceMappingURL=menuTab.js.map"],"names":["MenuTab","forwardRef","label","value","children","ref","activeTab","updateActiveTab","smallSize","useContext","TabsContext","isActive","setIsActive","useState","open","setOpen","anchorEl","setAnchorEl","selectedLabel","setSelectedLabel","a11yProps","useTabs","handleOnClick","useCallback","_props","href","window","target","onClick","analyticsCallback","handleOpenMenu","e","currentTarget","handleMenuItems","React","Children","map","child","_jsx","MenuItem","style","fontSize","props","useEffect","_jsxs","_Fragment","TabStyled","Object","assign","wrapped","tabIndex","icon","Icon","name","iconPosition","className","Popper","placement","transition","TransitionProps","ClickAwayListener","onClickAway","Fade","timeout","MenuStyled","id","styled","MenuList","top","left","boxShadow","borderRadius","padding","width","maxHeight","overflow"],"mappings":"scAaY,MAACA,EAAUC,GAAW,EAAGC,QAAOC,QAAOC,YAAYC,KAC3D,MAAMC,UAAEA,EAASC,gBAAEA,EAAeC,UAAEA,GAAcC,EAAWC,IACtDC,EAAUC,GAAeC,GAAS,IAClCC,EAAMC,GAAWF,GAAS,IAC1BG,EAAUC,GAAeJ,EAAS,OAClCK,EAAeC,GAAoBN,EAAS,OAC7CO,UAAEA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B7D,SAAU6B,eAAqC,IAEtsB+B,EAAaE,EAAOC,EAAPD,EAAiB,KACzB,CACHE,IAAK,OACLC,KAAM,OACNC,UAAW,+BACXC,aAAc,MACdC,QAAS,MACTC,MAAO,QACPC,UAAW,QACXC,SAAU"}
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as r,Fragment as e}from"react/jsx-runtime";import i,{useState as t,useCallback as n,useEffect as a}from"react";import p from"@mui/material/AppBar";import l from"@mui/material/Toolbar";import{Icon as s}from"../../icon/icon.js";import c from"./secondaryTabStyled.js";import{styled as d,Backdrop as m,Popper as h,MenuList as b,MenuItem as x,Divider as u,Box as g,ClickAwayListener as f,Fade as v}from"@mui/material";import{flowColors as k}from"../../../design/skoda/palette.theme.js";const y=({currentActiveTab:p,setCurrentActiveTab:d,children:m})=>{const[h,b]=t(null),[k,y]=t(null),[w,z]=t(!1),[R,S]=t(null),O=n((o=>{d(o.value),o.onClick&&o.onClick()}),[d]),B=n((o=>{z(!w),y(o.currentTarget)}),[w]),I=n((i=>i.href?o("a",{href:i.href,target:i.target||null,children:[r(s,{color:"inherit",className:i.icon||"more-horizontal"}),i.label]}):o(e,{children:[r(s,{color:"inherit",className:i.icon||"more-horizontal"}),i.label]})),[]),L=n((o=>{S(o.label),o.href?window.open(o.href,o.target):d(o.value),z(!1),o.onClick&&o.onClick(o.value)}),[d]),M=n((()=>h.slice(3).map(((e,i)=>o("div",{children:[r(x,{onClick:()=>L(e.props),children:e.props.label},i),r(u,{orientation:"horizontal",textAlign:"center",variant:"middle"})]},e.props.label)))),[h,L]);return a((()=>{b(i.Children.toArray(m))}),[m]),r(j,{position:"fixed",color:"transparent",children:r(l,{children:r(g,{sx:{display:"flex"},children:h&&o(e,{children:[r(c,Object.assign({},h[0].props,{isActive:p===h[0].props.value,onClick:()=>{O(h[0].props)},children:I(h[0].props)}),"secondary-tab-0"),r(c,Object.assign({},h[1].props,{isActive:p===h[1].props.value,onClick:()=>{O(h[1].props)},children:I(h[1].props)}),"secondary-tab-1"),r(c,Object.assign({},h[2].props,{isActive:p===h[2].props.value,onClick:()=>{O(h[2].props)},children:I(h[2].props)}),"secondary-tab-2"),h.length>4&&o(e,{children:[o(c,{isActive:w,moreTab:!0,selectedMenuLabel:R,onClick:B,children:[r(s,{color:"inherit",className:"more-vertical"}),R]},"secondary-tab-more"),r(T,{open:w,anchorEl:k,placement:"top",transition:!0,disablePortal:!1,children:({TransitionProps:o})=>r(f,{onClickAway:()=>z(!1),children:r(C,{open:w,onClick:()=>z(!1),children:r(v,Object.assign({},o,{timeout:350,children:r(A,{id:"more-tabs-menu",children:M()})}))})})})]}),h.length<=4&&r(c,Object.assign({},h[3].props,{isActive:p===h[3].props.value,onClick:()=>{O(h[3].props)},children:I(h[3].props)}),"secondary-tab-3")]})})})})},C=d(m)((()=>({zIndex:2e3}))),T=d(h)((()=>({transform:"unset !important",position:"static !important",zIndex:2e3}))),A=d(b)((({theme:o})=>({position:"absolute",bottom:"0",left:0,width:"100%",padding:"26px 0px 27px 0px",background:"white",boxSizing:"border-box",borderTopLeftRadius:"16px",borderTopRightRadius:"16px",zIndex:2e3,boxShadow:"rgb(0 0 0 / 15%) 0px 3px 8px","& .MuiDivider-root":{display:"block",marginTop:"0px !important",marginBottom:"0px !important"},"& div:first-of-type":{"& > li":{borderTopLeftRadius:"16px",borderTopRightRadius:"16px"}},"& > div > li":{fontSize:"16px",fontWeight:"400",color:o.palette.onSurface.os900,paddingTop:"11px",paddingBottom:"11px"}}))),j=d(p)((()=>({maxHeigth:"56px",padding:"0px",top:"auto",bottom:0,boxShadow:"none",borderTop:`1px solid ${k.transparent.secondary}`,backgroundColor:k.background.primary,"& > div.MuiToolbar-root":{maxHeight:"56px",padding:"0px","& > div":{width:"100%",justifyContent:"space-evenly","& > div":{"&> a":{padding:0,textDecoration:"none"}}}}})));export{y as SecondaryNavigationTabs};
1
+ import{jsxs as o,jsx as r,Fragment as e}from"react/jsx-runtime";import i,{useState as t,useCallback as n,useEffect as a}from"react";import p from"@mui/material/AppBar";import l from"@mui/material/Toolbar";import{Icon as c}from"../../icon/icon.js";import"../../icon/icon.definitions.js";import d from"./secondaryTabStyled.js";import{styled as s,Backdrop as m,Popper as h,MenuList as b,MenuItem as x,Divider as u,Box as g,ClickAwayListener as f,Fade as v}from"@mui/material";import{flowColors as k}from"../../../design/skoda/palette.theme.js";const y=({currentActiveTab:p,setCurrentActiveTab:s,children:m})=>{const[h,b]=t(null),[k,y]=t(null),[w,z]=t(!1),[R,S]=t(null),O=n((o=>{s(o.value),o.onClick&&o.onClick()}),[s]),B=n((o=>{z(!w),y(o.currentTarget)}),[w]),I=n((i=>i.href?o("a",{href:i.href,target:i.target||null,children:[r(c,{color:"inherit",name:i.icon||"more-horizontal"}),i.label]}):o(e,{children:[r(c,{color:"inherit",name:i.icon||"more-horizontal"}),i.label]})),[]),L=n((o=>{S(o.label),o.href?window.open(o.href,o.target):s(o.value),z(!1),o.onClick&&o.onClick(o.value)}),[s]),M=n((()=>h.slice(3).map(((e,i)=>o("div",{children:[r(x,{onClick:()=>L(e.props),children:e.props.label},i),r(u,{orientation:"horizontal",textAlign:"center",variant:"middle"})]},e.props.label)))),[h,L]);return a((()=>{b(i.Children.toArray(m))}),[m]),r(A,{position:"fixed",color:"transparent",children:r(l,{children:r(g,{sx:{display:"flex"},children:h&&o(e,{children:[r(d,Object.assign({},h[0].props,{isActive:p===h[0].props.value,onClick:()=>{O(h[0].props)},children:I(h[0].props)}),"secondary-tab-0"),r(d,Object.assign({},h[1].props,{isActive:p===h[1].props.value,onClick:()=>{O(h[1].props)},children:I(h[1].props)}),"secondary-tab-1"),r(d,Object.assign({},h[2].props,{isActive:p===h[2].props.value,onClick:()=>{O(h[2].props)},children:I(h[2].props)}),"secondary-tab-2"),h.length>4&&o(e,{children:[o(d,{isActive:w,moreTab:!0,selectedMenuLabel:R,onClick:B,children:[r(c,{color:"inherit",name:"vertical"}),R]},"secondary-tab-more"),r(T,{open:w,anchorEl:k,placement:"top",transition:!0,disablePortal:!1,children:({TransitionProps:o})=>r(f,{onClickAway:()=>z(!1),children:r(C,{open:w,onClick:()=>z(!1),children:r(v,Object.assign({},o,{timeout:350,children:r(j,{id:"more-tabs-menu",children:M()})}))})})})]}),h.length<=4&&r(d,Object.assign({},h[3].props,{isActive:p===h[3].props.value,onClick:()=>{O(h[3].props)},children:I(h[3].props)}),"secondary-tab-3")]})})})})},C=s(m)((()=>({zIndex:2e3}))),T=s(h)((()=>({transform:"unset !important",position:"static !important",zIndex:2e3}))),j=s(b)((({theme:o})=>({position:"absolute",bottom:"0",left:0,width:"100%",padding:"26px 0px 27px 0px",background:"white",boxSizing:"border-box",borderTopLeftRadius:"16px",borderTopRightRadius:"16px",zIndex:2e3,boxShadow:"rgb(0 0 0 / 15%) 0px 3px 8px","& .MuiDivider-root":{display:"block",marginTop:"0px !important",marginBottom:"0px !important"},"& div:first-of-type":{"& > li":{borderTopLeftRadius:"16px",borderTopRightRadius:"16px"}},"& > div > li":{fontSize:"16px",fontWeight:"400",color:o.palette.onSurface.os900,paddingTop:"11px",paddingBottom:"11px"}}))),A=s(p)((()=>({maxHeigth:"56px",padding:"0px",top:"auto",bottom:0,boxShadow:"none",borderTop:`1px solid ${k.transparent.secondary}`,backgroundColor:k.background.primary,"& > div.MuiToolbar-root":{maxHeight:"56px",padding:"0px","& > div":{width:"100%",justifyContent:"space-evenly","& > div":{"&> a":{padding:0,textDecoration:"none"}}}}})));export{y as SecondaryNavigationTabs};
2
2
  //# sourceMappingURL=secondaryNavigationTabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"secondaryNavigationTabs.js","sources":["../../../../src/components/tab/secondaryNavigation/secondaryNavigationTabs.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { useCallback, useEffect, useState } from 'react';\nimport MuiAppBar from '@mui/material/AppBar';\nimport Toolbar from '@mui/material/Toolbar';\nimport { Icon } from '../../icon';\nimport SecondaryTabStyled from './secondaryTabStyled';\nimport { MenuItem, ClickAwayListener, Fade, MenuList, Popper, styled, Box, Backdrop, Divider } from '@mui/material';\nimport { flowColors } from '../../../design/skoda/palette.theme';\n/**\n * @description SkodaFlow Checkbox component.\n * Properties are inherited from HTML Button element.\n * @param props AppBarProps\n * @returns React Functional Component\n */\nexport const SecondaryNavigationTabs = ({ currentActiveTab, setCurrentActiveTab, children }) => {\n const [childrenArr, setChildrenArr] = useState(null);\n const [anchorEl, setAnchorEl] = useState(null);\n const [open, setOpen] = useState(false);\n const [selectedMenuLabel, setSelectedMenuLabel] = useState(null);\n //handle the active tab selected\n const handleActiveTab = useCallback((_props) => {\n setCurrentActiveTab(_props.value);\n _props.onClick && _props.onClick();\n }, [setCurrentActiveTab]);\n //handle the click on tab of type menu\n const handleMenuTabClick = useCallback((e) => {\n setOpen(!open);\n setAnchorEl(e.currentTarget);\n }, [open]);\n //render a link tab or not based on type\n const handleRenderTabType = useCallback((_props) => {\n if (_props.href) {\n return (_jsxs(\"a\", { href: _props.href, target: _props.target || null, children: [_jsx(Icon, { color: \"inherit\", className: _props.icon || 'more-horizontal' }), _props.label] }));\n }\n else {\n return (_jsxs(_Fragment, { children: [_jsx(Icon, { color: \"inherit\", className: _props.icon || 'more-horizontal' }), _props.label] }));\n }\n }, []);\n //handle the event triggered on onclick based on tab type (link or tab)\n const onClickMenuItem = useCallback((_props) => {\n setSelectedMenuLabel(_props.label);\n if (!_props.href) {\n setCurrentActiveTab(_props.value);\n }\n else {\n window.open(_props.href, _props.target);\n }\n setOpen(false);\n _props.onClick && _props.onClick(_props.value);\n }, [setCurrentActiveTab]);\n //returns the list of menu items\n const handleMenuItems = useCallback(() => {\n const menuItems = childrenArr.slice(3);\n return menuItems.map((item, i) => {\n return (_jsxs(\"div\", { children: [_jsx(MenuItem, { onClick: () => onClickMenuItem(item.props), children: item.props.label }, i), _jsx(Divider, { orientation: \"horizontal\", textAlign: \"center\", variant: \"middle\" })] }, item.props.label));\n });\n }, [childrenArr, onClickMenuItem]);\n useEffect(() => {\n setChildrenArr(React.Children.toArray(children));\n }, [children]);\n return (_jsx(AppBarStyled, { position: \"fixed\", color: \"transparent\", children: _jsx(Toolbar, { children: _jsx(Box, { sx: { display: 'flex' }, children: childrenArr && (_jsxs(_Fragment, { children: [_jsx(SecondaryTabStyled, Object.assign({}, childrenArr[0].props, { isActive: currentActiveTab === childrenArr[0].props.value, onClick: () => {\n handleActiveTab(childrenArr[0].props);\n }, children: handleRenderTabType(childrenArr[0].props) }), `secondary-tab-0`), _jsx(SecondaryTabStyled, Object.assign({}, childrenArr[1].props, { isActive: currentActiveTab === childrenArr[1].props.value, onClick: () => {\n handleActiveTab(childrenArr[1].props);\n }, children: handleRenderTabType(childrenArr[1].props) }), `secondary-tab-1`), _jsx(SecondaryTabStyled, Object.assign({}, childrenArr[2].props, { isActive: currentActiveTab === childrenArr[2].props.value, onClick: () => {\n handleActiveTab(childrenArr[2].props);\n }, children: handleRenderTabType(childrenArr[2].props) }), `secondary-tab-2`), childrenArr.length > 4 && (_jsxs(_Fragment, { children: [_jsxs(SecondaryTabStyled, { isActive: open, moreTab: true, selectedMenuLabel: selectedMenuLabel, onClick: handleMenuTabClick, children: [_jsx(Icon, { color: \"inherit\", className: 'more-vertical' }), selectedMenuLabel] }, `secondary-tab-more`), _jsx(PopperStyled, { open: open, anchorEl: anchorEl, placement: \"top\", transition: true, disablePortal: false, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: () => setOpen(false), children: _jsx(BackdropStyled, { open: open, onClick: () => setOpen(false), children: _jsx(Fade, Object.assign({}, TransitionProps, { timeout: 350, children: _jsx(MenuStyled, { id: \"more-tabs-menu\", children: handleMenuItems() }) })) }) })) })] })), childrenArr.length <= 4 && (_jsx(SecondaryTabStyled, Object.assign({}, childrenArr[3].props, { isActive: currentActiveTab === childrenArr[3].props.value, onClick: () => {\n handleActiveTab(childrenArr[3].props);\n }, children: handleRenderTabType(childrenArr[3].props) }), `secondary-tab-3`))] })) }) }) }));\n};\nconst BackdropStyled = styled(Backdrop)(() => {\n return {\n zIndex: 2000,\n };\n});\nconst PopperStyled = styled(Popper)(() => {\n const style = {\n transform: 'unset !important',\n position: 'static !important',\n zIndex: 2000,\n };\n return style;\n});\nconst MenuStyled = styled(MenuList)(({ theme }) => {\n return {\n position: 'absolute',\n bottom: '0',\n left: 0,\n width: '100%',\n padding: '26px 0px 27px 0px',\n background: 'white',\n boxSizing: 'border-box',\n borderTopLeftRadius: '16px',\n borderTopRightRadius: '16px',\n zIndex: 2000,\n boxShadow: 'rgb(0 0 0 / 15%) 0px 3px 8px',\n '& .MuiDivider-root': {\n display: 'block',\n marginTop: '0px !important',\n marginBottom: '0px !important',\n },\n '& div:first-of-type': {\n '& > li': {\n borderTopLeftRadius: '16px',\n borderTopRightRadius: '16px',\n },\n },\n '& > div > li': {\n fontSize: '16px',\n fontWeight: '400',\n color: theme.palette.onSurface.os900,\n paddingTop: '11px',\n paddingBottom: '11px',\n },\n };\n});\n/**\n * @description Tabs styling definition based on props\n */\nconst AppBarStyled = styled(MuiAppBar)(() => {\n return {\n maxHeigth: '56px',\n padding: '0px',\n top: 'auto',\n bottom: 0,\n boxShadow: 'none',\n borderTop: `1px solid ${flowColors.transparent.secondary}`,\n backgroundColor: flowColors.background.primary,\n '& > div.MuiToolbar-root': {\n maxHeight: '56px',\n padding: '0px',\n '& > div': {\n width: '100%',\n justifyContent: 'space-evenly',\n '& > div': {\n '&> a': {\n padding: 0,\n textDecoration: 'none',\n },\n },\n },\n },\n };\n});\n//# sourceMappingURL=secondaryNavigationTabs.js.map"],"names":["SecondaryNavigationTabs","currentActiveTab","setCurrentActiveTab","children","childrenArr","setChildrenArr","useState","anchorEl","setAnchorEl","open","setOpen","selectedMenuLabel","setSelectedMenuLabel","handleActiveTab","useCallback","_props","value","onClick","handleMenuTabClick","e","currentTarget","handleRenderTabType","href","_jsxs","target","_jsx","Icon","color","className","icon","label","_Fragment","onClickMenuItem","window","handleMenuItems","slice","map","item","i","MenuItem","props","Divider","orientation","textAlign","variant","useEffect","React","Children","toArray","AppBarStyled","position","Toolbar","Box","sx","display","SecondaryTabStyled","Object","assign","isActive","length","moreTab","PopperStyled","placement","transition","disablePortal","TransitionProps","ClickAwayListener","onClickAway","BackdropStyled","Fade","timeout","MenuStyled","id","styled","Backdrop","zIndex","Popper","transform","MenuList","theme","bottom","left","width","padding","background","boxSizing","borderTopLeftRadius","borderTopRightRadius","boxShadow","marginTop","marginBottom","fontSize","fontWeight","palette","onSurface","os900","paddingTop","paddingBottom","MuiAppBar","maxHeigth","top","borderTop","flowColors","transparent","secondary","backgroundColor","primary","maxHeight","justifyContent","textDecoration"],"mappings":"sfAcY,MAACA,EAA0B,EAAGC,mBAAkBC,sBAAqBC,eAC7E,MAAOC,EAAaC,GAAkBC,EAAS,OACxCC,EAAUC,GAAeF,EAAS,OAClCG,EAAMC,GAAWJ,GAAS,IAC1BK,EAAmBC,GAAwBN,EAAS,MAErDO,EAAkBC,GAAaC,IACjCb,EAAoBa,EAAOC,OAC3BD,EAAOE,SAAWF,EAAOE,SAAS,GACnC,CAACf,IAEEgB,EAAqBJ,GAAaK,IACpCT,GAASD,GACTD,EAAYW,EAAEC,cAAc,GAC7B,CAACX,IAEEY,EAAsBP,GAAaC,GACjCA,EAAOO,KACCC,EAAM,IAAK,CAAED,KAAMP,EAAOO,KAAME,OAAQT,EAAOS,QAAU,KAAMrB,SAAU,CAACsB,EAAKC,EAAM,CAAEC,MAAO,UAAWC,UAAWb,EAAOc,MAAQ,oBAAsBd,EAAOe,SAGhKP,EAAMQ,EAAW,CAAE5B,SAAU,CAACsB,EAAKC,EAAM,CAAEC,MAAO,UAAWC,UAAWb,EAAOc,MAAQ,oBAAsBd,EAAOe,UAEjI,IAEGE,EAAkBlB,GAAaC,IACjCH,EAAqBG,EAAOe,OACvBf,EAAOO,KAIRW,OAAOxB,KAAKM,EAAOO,KAAMP,EAAOS,QAHhCtB,EAAoBa,EAAOC,OAK/BN,GAA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AqB,OACrBC,qBAAsB,OACtBZ,OAAQ,IACRa,UAAW,+BACX,qBAAsB,CAClBlC,QAAS,QACTmC,UAAW,iBACXC,aAAc,kBAElB,sBAAuB,CACnB,SAAU,CACNJ,oBAAqB,OACrBC,qBAAsB,SAG9B,eAAgB,CACZI,SAAU,OACVC,WAAY,MACZjE,MAAOoD,EAAMc,QAAQC,UAAUC,MAC/BC,WAAY,OACZC,cAAe,YAOrBhD,EAAewB,EAAOyB,EAAPzB,EAAkB,KAC5B,CACH0B,UAAW,OACXhB,QAAS,MACTiB,IAAK,OACLpB,OAAQ,EACRQ,UAAW,OACXa,UAAW,aAAaC,EAAWC,YAAYC,YAC/CC,gBAAiBH,EAAWlB,WAAWsB,QACvC,0BAA2B,CACvBC,UAAW,OACXxB,QAAS,MACT,UAAW,CACPD,MAAO,OACP0B,eAAgB,eAChB,UAAW,CACP,OAAQ,CACJzB,QAAS,EACT0B,eAAgB"}
1
+ {"version":3,"file":"secondaryNavigationTabs.js","sources":["../../../../src/components/tab/secondaryNavigation/secondaryNavigationTabs.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { useCallback, useEffect, useState } from 'react';\nimport MuiAppBar from '@mui/material/AppBar';\nimport Toolbar from '@mui/material/Toolbar';\nimport { Icon } from '../../icon';\nimport SecondaryTabStyled from './secondaryTabStyled';\nimport { MenuItem, ClickAwayListener, Fade, MenuList, Popper, styled, Box, Backdrop, Divider } from '@mui/material';\nimport { flowColors } from '../../../design/skoda/palette.theme';\n/**\n * @description SkodaFlow Checkbox component.\n * Properties are inherited from HTML Button element.\n * @param props AppBarProps\n * @returns React Functional Component\n */\nexport const SecondaryNavigationTabs = ({ currentActiveTab, setCurrentActiveTab, children }) => {\n const [childrenArr, setChildrenArr] = useState(null);\n const [anchorEl, setAnchorEl] = useState(null);\n const [open, setOpen] = useState(false);\n const [selectedMenuLabel, setSelectedMenuLabel] = useState(null);\n //handle the active tab selected\n const handleActiveTab = useCallback((_props) => {\n setCurrentActiveTab(_props.value);\n _props.onClick && _props.onClick();\n }, [setCurrentActiveTab]);\n //handle the click on tab of type menu\n const handleMenuTabClick = useCallback((e) => {\n setOpen(!open);\n setAnchorEl(e.currentTarget);\n }, [open]);\n //render a link tab or not based on type\n const handleRenderTabType = useCallback((_props) => {\n if (_props.href) {\n return (_jsxs(\"a\", { href: _props.href, target: _props.target || null, children: [_jsx(Icon, { color: \"inherit\", name: _props.icon || 'more-horizontal' }), _props.label] }));\n }\n else {\n return (_jsxs(_Fragment, { children: [_jsx(Icon, { color: \"inherit\", name: _props.icon || 'more-horizontal' }), _props.label] }));\n }\n }, []);\n //handle the event triggered on onclick based on tab type (link or tab)\n const onClickMenuItem = useCallback((_props) => {\n setSelectedMenuLabel(_props.label);\n if (!_props.href) {\n setCurrentActiveTab(_props.value);\n }\n else {\n window.open(_props.href, _props.target);\n }\n setOpen(false);\n _props.onClick && _props.onClick(_props.value);\n }, [setCurrentActiveTab]);\n //returns the list of menu items\n const handleMenuItems = useCallback(() => {\n const menuItems = childrenArr.slice(3);\n return menuItems.map((item, i) => {\n return (_jsxs(\"div\", { children: [_jsx(MenuItem, { onClick: () => onClickMenuItem(item.props), children: item.props.label }, i), _jsx(Divider, { orientation: \"horizontal\", textAlign: \"center\", variant: \"middle\" })] }, item.props.label));\n });\n }, [childrenArr, onClickMenuItem]);\n useEffect(() => {\n setChildrenArr(React.Children.toArray(children));\n }, [children]);\n return (_jsx(AppBarStyled, { position: \"fixed\", color: \"transparent\", children: _jsx(Toolbar, { children: _jsx(Box, { sx: { display: 'flex' }, children: childrenArr && (_jsxs(_Fragment, { children: [_jsx(SecondaryTabStyled, Object.assign({}, childrenArr[0].props, { isActive: currentActiveTab === childrenArr[0].props.value, onClick: () => {\n handleActiveTab(childrenArr[0].props);\n }, children: handleRenderTabType(childrenArr[0].props) }), `secondary-tab-0`), _jsx(SecondaryTabStyled, Object.assign({}, childrenArr[1].props, { isActive: currentActiveTab === childrenArr[1].props.value, onClick: () => {\n handleActiveTab(childrenArr[1].props);\n }, children: handleRenderTabType(childrenArr[1].props) }), `secondary-tab-1`), _jsx(SecondaryTabStyled, Object.assign({}, childrenArr[2].props, { isActive: currentActiveTab === childrenArr[2].props.value, onClick: () => {\n handleActiveTab(childrenArr[2].props);\n }, children: handleRenderTabType(childrenArr[2].props) }), `secondary-tab-2`), childrenArr.length > 4 && (_jsxs(_Fragment, { children: [_jsxs(SecondaryTabStyled, { isActive: open, moreTab: true, selectedMenuLabel: selectedMenuLabel, onClick: handleMenuTabClick, children: [_jsx(Icon, { color: \"inherit\", name: \"vertical\" }), selectedMenuLabel] }, `secondary-tab-more`), _jsx(PopperStyled, { open: open, anchorEl: anchorEl, placement: \"top\", transition: true, disablePortal: false, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: () => setOpen(false), children: _jsx(BackdropStyled, { open: open, onClick: () => setOpen(false), children: _jsx(Fade, Object.assign({}, TransitionProps, { timeout: 350, children: _jsx(MenuStyled, { id: \"more-tabs-menu\", children: handleMenuItems() }) })) }) })) })] })), childrenArr.length <= 4 && (_jsx(SecondaryTabStyled, Object.assign({}, childrenArr[3].props, { isActive: currentActiveTab === childrenArr[3].props.value, onClick: () => {\n handleActiveTab(childrenArr[3].props);\n }, children: handleRenderTabType(childrenArr[3].props) }), `secondary-tab-3`))] })) }) }) }));\n};\nconst BackdropStyled = styled(Backdrop)(() => {\n return {\n zIndex: 2000,\n };\n});\nconst PopperStyled = styled(Popper)(() => {\n const style = {\n transform: 'unset !important',\n position: 'static !important',\n zIndex: 2000,\n };\n return style;\n});\nconst MenuStyled = styled(MenuList)(({ theme }) => {\n return {\n position: 'absolute',\n bottom: '0',\n left: 0,\n width: '100%',\n padding: '26px 0px 27px 0px',\n background: 'white',\n boxSizing: 'border-box',\n borderTopLeftRadius: '16px',\n borderTopRightRadius: '16px',\n zIndex: 2000,\n boxShadow: 'rgb(0 0 0 / 15%) 0px 3px 8px',\n '& .MuiDivider-root': {\n display: 'block',\n marginTop: '0px !important',\n marginBottom: '0px !important',\n },\n '& div:first-of-type': {\n '& > li': {\n borderTopLeftRadius: '16px',\n borderTopRightRadius: '16px',\n },\n },\n '& > div > li': {\n fontSize: '16px',\n fontWeight: '400',\n color: theme.palette.onSurface.os900,\n paddingTop: '11px',\n paddingBottom: '11px',\n },\n };\n});\n/**\n * @description Tabs styling definition based on props\n */\nconst AppBarStyled = styled(MuiAppBar)(() => {\n return {\n maxHeigth: '56px',\n padding: '0px',\n top: 'auto',\n bottom: 0,\n boxShadow: 'none',\n borderTop: `1px solid ${flowColors.transparent.secondary}`,\n backgroundColor: flowColors.background.primary,\n '& > div.MuiToolbar-root': {\n maxHeight: '56px',\n padding: '0px',\n '& > div': {\n width: '100%',\n justifyContent: 'space-evenly',\n '& > div': {\n '&> a': {\n padding: 0,\n textDecoration: 'none',\n },\n },\n },\n },\n };\n});\n//# sourceMappingURL=secondaryNavigationTabs.js.map"],"names":["SecondaryNavigationTabs","currentActiveTab","setCurrentActiveTab","children","childrenArr","setChildrenArr","useState","anchorEl","setAnchorEl","open","setOpen","selectedMenuLabel","setSelectedMenuLabel","handleActiveTab","useCallback","_props","value","onClick","handleMenuTabClick","e","currentTarget","handleRenderTabType","href","_jsxs","target","_jsx","Icon","color","name","icon","label","_Fragment","onClickMenuItem","window","handleMenuItems","slice","map","item","i","MenuItem","props","Divider","orientation","textAlign","variant","useEffect","React","Children","toArray","AppBarStyled","position","Toolbar","Box","sx","display","SecondaryTabStyled","Object","assign","isActive","length","moreTab","PopperStyled","placement","transition","disablePortal","TransitionProps","ClickAwayListener","onClickAway","BackdropStyled","Fade","timeout","MenuStyled","id","styled","Backdrop","zIndex","Popper","transform","MenuList","theme","bottom","left","width","padding","background","boxSizing","borderTopLeftRadius","borderTopRightRadius","boxShadow","marginTop","marginBottom","fontSize","fontWeight","palette","onSurface","os900","paddingTop","paddingBottom","MuiAppBar","maxHeigth","top","borderTop","flowColors","transparent","sec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Xa,UAAW,aAAaC,EAAWC,YAAYC,YAC/CC,gBAAiBH,EAAWlB,WAAWsB,QACvC,0BAA2B,CACvBC,UAAW,OACXxB,QAAS,MACT,UAAW,CACPD,MAAO,OACP0B,eAAgB,eAChB,UAAW,CACP,OAAQ,CACJzB,QAAS,EACT0B,eAAgB"}
@@ -45,5 +45,6 @@ export interface TabProps {
45
45
  * @description SkodaFlow Tab component.
46
46
  * @param props TabProps
47
47
  * @returns React Functional Component
48
+ * @deprecated use Tab component from @mui/material instead
48
49
  */
49
50
  export declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"tab.js","sources":["../../../src/components/tab/tab.tsx"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useState, useContext, useEffect, useCallback, forwardRef } from 'react';\nimport useTabs from './hook/useTabs';\nimport { TabsContext } from './tabs';\nimport TabStyled from './tabStyled';\n/**\n * @description SkodaFlow Tab component.\n * @param props TabProps\n * @returns React Functional Component\n */\nexport const Tab = forwardRef(({ label, value, onClick, analyticsCallback, href, target, ariaLabel }, ref) => {\n const { activeTab, updateActiveTab, smallSize } = useContext(TabsContext);\n const [isActive, setIsActive] = useState(false);\n const { a11yProps } = useTabs();\n //On tab clicked: set the new activeTab selected\n //if is a menu tab: set the anchor element for the menu and set the width of the menu equal to the tab component\n //then call the onClick from outside\n const handleOnClick = useCallback((e) => {\n updateActiveTab(value, false);\n analyticsCallback && analyticsCallback(e);\n onClick && onClick(e);\n }, [value, onClick, updateActiveTab, analyticsCallback]);\n //IF href prop is present: render the Link Tab\n //Otherwise render the default tab\n const handleTabType = useCallback(() => {\n if (href) {\n return (_jsx(TabStyled, Object.assign({ wrapped: true, ref: ref, smallSize: smallSize, isActive: isActive, \"aria-label\": ariaLabel, value: value, label: label, tabIndex: isActive ? 0 : -1 }, a11yProps(value), { component: 'a', href: href, target: target, onClick: (e) => handleOnClick(e) })));\n }\n else {\n return (_jsx(TabStyled, Object.assign({ wrapped: true, ref: ref, \"aria-label\": ariaLabel, tabIndex: isActive ? 0 : -1, smallSize: smallSize, isActive: isActive, onClick: (e) => handleOnClick(e), value: value, label: label }, a11yProps(value))));\n }\n }, [href, smallSize, isActive, target, value, label, a11yProps, ariaLabel, handleOnClick, ref]);\n //If the activeTab is equal to the current tab, set active\n useEffect(() => {\n if (activeTab === value) {\n setIsActive(true);\n }\n else {\n setIsActive(false);\n }\n }, [activeTab, value]);\n return _jsx(_Fragment, { children: handleTabType() });\n});\n//# sourceMappingURL=tab.js.map"],"names":["Tab","forwardRef","label","value","onClick","analyticsCallback","href","target","ariaLabel","ref","activeTab","updateActiveTab","smallSize","useContext","TabsContext","isActive","setIsActive","useState","a11yProps","useTabs","handleOnClick","useCallback","e","handleTabType","_jsx","TabStyled","Object","assign","wrapped","tabIndex","component","useEffect","_Fragment","children"],"mappings":"8PAUY,MAACA,EAAMC,GAAW,EAAGC,QAAOC,QAAOC,UAASC,oBAAmBC,OAAMC,SAAQC,aAAaC,KAClG,MAAMC,UAAEA,EAASC,gBAAEA,EAAeC,UAAEA,GAAcC,EAAWC,IACtDC,EAAUC,GAAeC,GAAS,IACnCC,UAAEA,GAAcC,IAIhBC,EAAgBC,GAAaC,IAC/BX,EAAgBR,GAAO,GACvBE,GAAqBA,EAAkBiB,GACvClB,GAAWA,EAAQkB,EAAE,GACtB,CAACnB,EAAOC,EAASO,EAAiBN,IAG/BkB,EAAgBF,GAAY,IAElBG,EAAKC,EADbnB,EACwBoB,OAAOC,OAAO,CAAEC,SAAS,EAAMnB,IAAKA,EAAKG,UAAWA,EAAWG,SAAUA,EAAU,aAAcP,EAAWL,MAAOA,EAAOD,MAAOA,EAAO2B,SAAUd,EAAW,GAAK,GAAKG,EAAUf,GAAQ,CAAE2B,UAAW,IAAKxB,KAAMA,EAAMC,OAAQA,EAAQH,QAAUkB,GAAMF,EAAcE,KAGrQI,OAAOC,OAAO,CAAEC,SAAS,EAAMnB,IAAKA,EAAK,aAAcD,EAAWqB,SAAUd,EAAW,GAAK,EAAGH,UAAWA,EAAWG,SAAUA,EAAUX,QAAUkB,GAAMF,EAAcE,GAAInB,MAAOA,EAAOD,MAAOA,GAASgB,EAAUf,MAEhP,CAACG,EAAMM,EAAWG,EAAUR,EAAQJ,EAAOD,EAAOgB,EAAWV,EAAWY,EAAeX,IAU1F,OARAsB,GAAU,KAEFf,EADAN,IAAcP,EAKjB,GACF,CAACO,EAAWP,IACRqB,EAAKQ,EAAW,CAAEC,SAAUV,KAAkB"}
1
+ {"version":3,"file":"tab.js","sources":["../../../src/components/tab/tab.tsx"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useState, useContext, useEffect, useCallback, forwardRef } from 'react';\nimport useTabs from './hook/useTabs';\nimport { TabsContext } from './tabs';\nimport TabStyled from './tabStyled';\n/**\n * @description SkodaFlow Tab component.\n * @param props TabProps\n * @returns React Functional Component\n * @deprecated use Tab component from @mui/material instead\n */\nexport const Tab = forwardRef(({ label, value, onClick, analyticsCallback, href, target, ariaLabel }, ref) => {\n const { activeTab, updateActiveTab, smallSize } = useContext(TabsContext);\n const [isActive, setIsActive] = useState(false);\n const { a11yProps } = useTabs();\n //On tab clicked: set the new activeTab selected\n //if is a menu tab: set the anchor element for the menu and set the width of the menu equal to the tab component\n //then call the onClick from outside\n const handleOnClick = useCallback((e) => {\n updateActiveTab(value, false);\n analyticsCallback && analyticsCallback(e);\n onClick && onClick(e);\n }, [value, onClick, updateActiveTab, analyticsCallback]);\n //IF href prop is present: render the Link Tab\n //Otherwise render the default tab\n const handleTabType = useCallback(() => {\n if (href) {\n return (_jsx(TabStyled, Object.assign({ wrapped: true, ref: ref, smallSize: smallSize, isActive: isActive, \"aria-label\": ariaLabel, value: value, label: label, tabIndex: isActive ? 0 : -1 }, a11yProps(value), { component: 'a', href: href, target: target, onClick: (e) => handleOnClick(e) })));\n }\n else {\n return (_jsx(TabStyled, Object.assign({ wrapped: true, ref: ref, \"aria-label\": ariaLabel, tabIndex: isActive ? 0 : -1, smallSize: smallSize, isActive: isActive, onClick: (e) => handleOnClick(e), value: value, label: label }, a11yProps(value))));\n }\n }, [href, smallSize, isActive, target, value, label, a11yProps, ariaLabel, handleOnClick, ref]);\n //If the activeTab is equal to the current tab, set active\n useEffect(() => {\n if (activeTab === value) {\n setIsActive(true);\n }\n else {\n setIsActive(false);\n }\n }, [activeTab, value]);\n return _jsx(_Fragment, { children: handleTabType() });\n});\n//# sourceMappingURL=tab.js.map"],"names":["Tab","forwardRef","label","value","onClick","analyticsCallback","href","target","ariaLabel","ref","activeTab","updateActiveTab","smallSize","useContext","TabsContext","isActive","setIsActive","useState","a11yProps","useTabs","handleOnClick","useCallback","e","handleTabType","_jsx","TabStyled","Object","assign","wrapped","tabIndex","component","useEffect","_Fragment","children"],"mappings":"8PAWY,MAACA,EAAMC,GAAW,EAAGC,QAAOC,QAAOC,UAASC,oBAAmBC,OAAMC,SAAQC,aAAaC,KAClG,MAAMC,UAAEA,EAASC,gBAAEA,EAAeC,UAAEA,GAAcC,EAAWC,IACtDC,EAAUC,GAAeC,GAAS,IACnCC,UAAEA,GAAcC,IAIhBC,EAAgBC,GAAaC,IAC/BX,EAAgBR,GAAO,GACvBE,GAAqBA,EAAkBiB,GACvClB,GAAWA,EAAQkB,EAAE,GACtB,CAACnB,EAAOC,EAASO,EAAiBN,IAG/BkB,EAAgBF,GAAY,IAElBG,EAAKC,EADbnB,EACwBoB,OAAOC,OAAO,CAAEC,SAAS,EAAMnB,IAAKA,EAAKG,UAAWA,EAAWG,SAAUA,EAAU,aAAcP,EAAWL,MAAOA,EAAOD,MAAOA,EAAO2B,SAAUd,EAAW,GAAK,GAAKG,EAAUf,GAAQ,CAAE2B,UAAW,IAAKxB,KAAMA,EAAMC,OAAQA,EAAQH,QAAUkB,GAAMF,EAAcE,KAGrQI,OAAOC,OAAO,CAAEC,SAAS,EAAMnB,IAAKA,EAAK,aAAcD,EAAWqB,SAAUd,EAAW,GAAK,EAAGH,UAAWA,EAAWG,SAAUA,EAAUX,QAAUkB,GAAMF,EAAcE,GAAInB,MAAOA,EAAOD,MAAOA,GAASgB,EAAUf,MAEhP,CAACG,EAAMM,EAAWG,EAAUR,EAAQJ,EAAOD,EAAOgB,EAAWV,EAAWY,EAAeX,IAU1F,OARAsB,GAAU,KAEFf,EADAN,IAAcP,EAKjB,GACF,CAACO,EAAWP,IACRqB,EAAKQ,EAAW,CAAEC,SAAUV,KAAkB"}
@@ -17,4 +17,5 @@ export interface TabPanelProps {
17
17
  */
18
18
  index?: number | string;
19
19
  }
20
+ /** @deprecated use Tab component from @mui/material instead */
20
21
  export declare const TabPanel: React.FC<TabPanelProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"tabPanel.js","sources":["../../../src/components/tab/tabPanel.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TabPanel = (props) => {\n const { children, value, index } = props, other = __rest(props, [\"children\", \"value\", \"index\"]);\n return (_jsx(\"div\", Object.assign({ role: \"tabpanel\", hidden: value !== index, id: `simple-tabpanel-${index}`, \"aria-labelledby\": `simple-tab-${index}` }, other, { children: value === index && children })));\n};\n//# sourceMappingURL=tabPanel.js.map"],"names":["TabPanel","props","children","value","index","other","__rest","_jsx","Object","assign","role","hidden","id"],"mappings":"uEAEY,MAACA,EAAYC,IACrB,MAAMC,SAAEA,EAAQC,MAAEA,EAAKC,MAAEA,GAAUH,EAAOI,EAAQC,EAAOL,EAAO,CAAC,WAAY,QAAS,UACtF,OAAQM,EAAK,MAAOC,OAAOC,OAAO,CAAEC,KAAM,WAAYC,OAAQR,IAAUC,EAAOQ,GAAI,mBAAmBR,IAAS,kBAAmB,cAAcA,KAAWC,EAAO,CAAEH,SAAUC,IAAUC,GAASF,IAAc"}
1
+ {"version":3,"file":"tabPanel.js","sources":["../../../src/components/tab/tabPanel.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/** @deprecated use Tab component from @mui/material instead */\nexport const TabPanel = (props) => {\n const { children, value, index } = props, other = __rest(props, [\"children\", \"value\", \"index\"]);\n return (_jsx(\"div\", Object.assign({ role: \"tabpanel\", hidden: value !== index, id: `simple-tabpanel-${index}`, \"aria-labelledby\": `simple-tab-${index}` }, other, { children: value === index && children })));\n};\n//# sourceMappingURL=tabPanel.js.map"],"names":["TabPanel","props","children","value","index","other","__rest","_jsx","Object","assign","role","hidden","id"],"mappings":"uEAGY,MAACA,EAAYC,IACrB,MAAMC,SAAEA,EAAQC,MAAEA,EAAKC,MAAEA,GAAUH,EAAOI,EAAQC,EAAOL,EAAO,CAAC,WAAY,QAAS,UACtF,OAAQM,EAAK,MAAOC,OAAOC,OAAO,CAAEC,KAAM,WAAYC,OAAQR,IAAUC,EAAOQ,GAAI,mBAAmBR,IAAS,kBAAmB,cAAcA,KAAWC,EAAO,CAAEH,SAAUC,IAAUC,GAASF,IAAc"}