@skodaflow/web-library 8.2.0 → 8.3.1

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 (285) hide show
  1. package/cjs/components/advancedTable/agGrid.d.ts +15 -0
  2. package/cjs/components/advancedTable/agGrid.js +1 -1
  3. package/cjs/components/advancedTable/agGrid.js.map +1 -1
  4. package/cjs/components/advancedTable/agGridIcons.d.ts +8 -2
  5. package/cjs/components/advancedTable/agGridIcons.js +1 -1
  6. package/cjs/components/advancedTable/agGridIcons.js.map +1 -1
  7. package/cjs/components/advancedTable/agGridSkodaTheme.js +1 -1
  8. package/cjs/components/advancedTable/agGridSkodaTheme.js.map +1 -1
  9. package/cjs/components/bottomSheet/BottomSheet.d.ts +3 -0
  10. package/cjs/components/bottomSheet/BottomSheet.js.map +1 -1
  11. package/cjs/components/carousel/Autoplay.d.ts +10 -5
  12. package/cjs/components/carousel/Autoplay.js +1 -1
  13. package/cjs/components/carousel/Autoplay.js.map +1 -1
  14. package/cjs/components/carousel/Navigation.d.ts +2 -2
  15. package/cjs/components/carousel/Navigation.js +1 -1
  16. package/cjs/components/carousel/Navigation.js.map +1 -1
  17. package/cjs/components/carousel/hooks.js +1 -1
  18. package/cjs/components/carousel/hooks.js.map +1 -1
  19. package/cjs/components/code/Code.d.ts +8 -0
  20. package/cjs/components/code/Code.js +2 -0
  21. package/cjs/components/code/Code.js.map +1 -0
  22. package/cjs/components/code/index.d.ts +1 -0
  23. package/cjs/components/errorContent/ErrorContent.js +1 -1
  24. package/cjs/components/errorContent/ErrorContent.js.map +1 -1
  25. package/cjs/components/footer/FooterIconButton.d.ts +1 -1
  26. package/cjs/components/footer/FooterIconButton.js.map +1 -1
  27. package/cjs/components/footer/FooterMenu.js +1 -1
  28. package/cjs/components/footer/FooterMenu.js.map +1 -1
  29. package/cjs/components/footer/FooterMenuCollapse.d.ts +25 -0
  30. package/cjs/components/footer/FooterMenuCollapse.js +2 -0
  31. package/cjs/components/footer/FooterMenuCollapse.js.map +1 -0
  32. package/cjs/components/header/Header.js +1 -1
  33. package/cjs/components/header/Header.js.map +1 -1
  34. package/cjs/components/header/HeaderLogo.d.ts +1 -1
  35. package/cjs/components/header/HeaderNavigationHero.d.ts +1 -1
  36. package/cjs/components/header/HeaderNavigationHero.js.map +1 -1
  37. package/cjs/components/header/HeaderNavigationLink.js +1 -1
  38. package/cjs/components/header/HeaderNavigationLink.js.map +1 -1
  39. package/cjs/components/icon/filled/CarChargingFilledIcon.d.ts +6 -0
  40. package/cjs/components/icon/filled/CarChargingFilledIcon.js +2 -0
  41. package/cjs/components/icon/filled/CarChargingFilledIcon.js.map +1 -0
  42. package/cjs/components/icon/filled/EmissionLabelFilledIcon.d.ts +6 -0
  43. package/cjs/components/icon/filled/EmissionLabelFilledIcon.js +2 -0
  44. package/cjs/components/icon/filled/EmissionLabelFilledIcon.js.map +1 -0
  45. package/cjs/components/icon/filled/PictureErrorFilledIcon.d.ts +6 -0
  46. package/cjs/components/icon/filled/PictureErrorFilledIcon.js +2 -0
  47. package/cjs/components/icon/filled/PictureErrorFilledIcon.js.map +1 -0
  48. package/cjs/components/icon/filled/PowerpassFilledIcon.d.ts +6 -0
  49. package/cjs/components/icon/filled/PowerpassFilledIcon.js +2 -0
  50. package/cjs/components/icon/filled/PowerpassFilledIcon.js.map +1 -0
  51. package/cjs/components/icon/filled/index.d.ts +4 -0
  52. package/cjs/components/icon/icon.definitions.js +1 -1
  53. package/cjs/components/icon/icon.definitions.js.map +1 -1
  54. package/cjs/components/icon/stroke/CarChargingIcon.d.ts +6 -0
  55. package/cjs/components/icon/stroke/CarChargingIcon.js +2 -0
  56. package/cjs/components/icon/stroke/CarChargingIcon.js.map +1 -0
  57. package/cjs/components/icon/stroke/EmissionLabelIcon.d.ts +6 -0
  58. package/cjs/components/icon/stroke/EmissionLabelIcon.js +2 -0
  59. package/cjs/components/icon/stroke/EmissionLabelIcon.js.map +1 -0
  60. package/cjs/components/icon/stroke/PictureErrorIcon.d.ts +6 -0
  61. package/cjs/components/icon/stroke/PictureErrorIcon.js +2 -0
  62. package/cjs/components/icon/stroke/PictureErrorIcon.js.map +1 -0
  63. package/cjs/components/icon/stroke/PowerpassIcon.d.ts +6 -0
  64. package/cjs/components/icon/stroke/PowerpassIcon.js +2 -0
  65. package/cjs/components/icon/stroke/PowerpassIcon.js.map +1 -0
  66. package/cjs/components/icon/stroke/index.d.ts +4 -0
  67. package/cjs/components/index.d.ts +1 -0
  68. package/cjs/components/label/Label.js +1 -1
  69. package/cjs/components/label/Label.js.map +1 -1
  70. package/cjs/components/notification/NotificationCenterHeaderButton.d.ts +1 -1
  71. package/cjs/components/playPauseButton/PlayPauseButton.d.ts +1 -1
  72. package/cjs/components/promptBar/PromptAttachments.js +1 -1
  73. package/cjs/components/promptBar/PromptAttachments.js.map +1 -1
  74. package/cjs/components/promptBar/PromptSubmitIconButton.d.ts +1 -1
  75. package/cjs/components/promptBar/PromptSubmitIconButton.js +1 -1
  76. package/cjs/components/promptBar/PromptSubmitIconButton.js.map +1 -1
  77. package/cjs/components/quickLink/QuickLink.js +1 -1
  78. package/cjs/components/quickLink/QuickLink.js.map +1 -1
  79. package/cjs/components/search/Search.js +1 -1
  80. package/cjs/components/search/Search.js.map +1 -1
  81. package/cjs/components/skodaThemeProvider/SkodaThemeProvider.js +1 -1
  82. package/cjs/components/skodaThemeProvider/SkodaThemeProvider.js.map +1 -1
  83. package/cjs/components/skodaThemeProvider/plugins/stylisContainerPlugin.d.ts +1 -2
  84. package/cjs/components/skodaThemeProvider/plugins/stylisContainerPlugin.js +1 -1
  85. package/cjs/components/skodaThemeProvider/plugins/stylisContainerPlugin.js.map +1 -1
  86. package/cjs/components/textAndCta/AppStoreButton.js +1 -1
  87. package/cjs/components/textAndCta/AppStoreButton.js.map +1 -1
  88. package/cjs/components/textAndCta/TextAndCta.d.ts +1 -1
  89. package/cjs/components/tooltipHeader/TooltipHeader.d.ts +2 -1
  90. package/cjs/components/upload/Upload.d.ts +1 -1
  91. package/cjs/components/upload/components/uploadList/UploadListItem.d.ts +1 -1
  92. package/cjs/components/upload/components/uploadPreview/UploadPreviewImage.d.ts +1 -1
  93. package/cjs/components/upload/components/uploadWrapper/UploadContent.d.ts +2 -2
  94. package/cjs/components/upload/components/uploadWrapper/UploadWrapper.d.ts +1 -1
  95. package/cjs/index.js +1 -1
  96. package/cjs/materialui/autocomplete/autocomplete.theme.js +1 -1
  97. package/cjs/materialui/autocomplete/autocomplete.theme.js.map +1 -1
  98. package/cjs/materialui/badge/badge.theme.js +1 -1
  99. package/cjs/materialui/badge/badge.theme.js.map +1 -1
  100. package/cjs/materialui/button/buttonBase.theme.js +1 -1
  101. package/cjs/materialui/button/buttonBase.theme.js.map +1 -1
  102. package/cjs/materialui/card/Card.js +1 -1
  103. package/cjs/materialui/card/Card.js.map +1 -1
  104. package/cjs/materialui/card/card.theme.js +1 -1
  105. package/cjs/materialui/card/card.theme.js.map +1 -1
  106. package/cjs/materialui/datepicker/datecalendar.theme.d.ts +1178 -1178
  107. package/cjs/materialui/datepicker/digitalclock.theme.d.ts +1176 -1176
  108. package/cjs/materialui/dialog/DialogTitle.js +1 -1
  109. package/cjs/materialui/dialog/DialogTitle.js.map +1 -1
  110. package/cjs/materialui/slider/SliderValues.d.ts +5 -0
  111. package/cjs/materialui/slider/SliderValues.js +1 -1
  112. package/cjs/materialui/slider/SliderValues.js.map +1 -1
  113. package/cjs/materialui/stepper/StepLabelIcon.d.ts +1 -1
  114. package/cjs/materialui/stepper/StepLabelIcon.js +1 -1
  115. package/cjs/materialui/stepper/StepLabelIcon.js.map +1 -1
  116. package/cjs/materialui/switch/switch.theme.js +1 -1
  117. package/cjs/materialui/switch/switch.theme.js.map +1 -1
  118. package/cjs/materialui/table/stories/actions.d.ts +1 -1
  119. package/cjs/materialui/table/stories/basic.d.ts +1 -1
  120. package/cjs/materialui/table/stories/interactive.d.ts +1 -1
  121. package/cjs/materialui/table/stories/pagination.d.ts +3 -3
  122. package/cjs/materialui/table/stories/scrollbar.d.ts +1 -1
  123. package/cjs/materialui/table/stories/selectSort.d.ts +1 -1
  124. package/cjs/materialui/table/stories/small.d.ts +1 -1
  125. package/cjs/materialui/table/tablePagination.theme.js +1 -1
  126. package/cjs/materialui/table/tablePagination.theme.js.map +1 -1
  127. package/cjs/materialui/tabs/TabPanel.d.ts +2 -2
  128. package/cjs/materialui/tabs/TabsScrollButton.d.ts +1 -1
  129. package/cjs/materialui/tabs/tabs.theme.js +1 -1
  130. package/cjs/materialui/tabs/tabs.theme.js.map +1 -1
  131. package/cjs/materialui/textfield/inputBase.theme.js +1 -1
  132. package/cjs/materialui/textfield/inputBase.theme.js.map +1 -1
  133. package/cjs/materialui/textfield/inputLabel.theme.js +1 -1
  134. package/cjs/materialui/textfield/inputLabel.theme.js.map +1 -1
  135. package/cjs/materialui/theme/paletteDark.theme.js +1 -1
  136. package/cjs/materialui/theme/paletteDark.theme.js.map +1 -1
  137. package/cjs/materialui/theme/theme.extensions.d.ts +10 -0
  138. package/cjs/materialui/themeProvider/baseline.theme.js +1 -1
  139. package/cjs/materialui/themeProvider/baseline.theme.js.map +1 -1
  140. package/cjs/materialui/typography/typography.theme.d.ts +4 -0
  141. package/cjs/materialui/typography/typography.theme.js +1 -1
  142. package/cjs/materialui/typography/typography.theme.js.map +1 -1
  143. package/components/advancedTable/agGrid.d.ts +15 -0
  144. package/components/advancedTable/agGrid.js +1 -1
  145. package/components/advancedTable/agGrid.js.map +1 -1
  146. package/components/advancedTable/agGridIcons.d.ts +8 -2
  147. package/components/advancedTable/agGridIcons.js +1 -1
  148. package/components/advancedTable/agGridIcons.js.map +1 -1
  149. package/components/advancedTable/agGridSkodaTheme.js +1 -1
  150. package/components/advancedTable/agGridSkodaTheme.js.map +1 -1
  151. package/components/bottomSheet/BottomSheet.d.ts +3 -0
  152. package/components/bottomSheet/BottomSheet.js.map +1 -1
  153. package/components/carousel/Autoplay.d.ts +10 -5
  154. package/components/carousel/Autoplay.js +1 -1
  155. package/components/carousel/Autoplay.js.map +1 -1
  156. package/components/carousel/Navigation.d.ts +2 -2
  157. package/components/carousel/Navigation.js +1 -1
  158. package/components/carousel/Navigation.js.map +1 -1
  159. package/components/carousel/hooks.js +1 -1
  160. package/components/carousel/hooks.js.map +1 -1
  161. package/components/code/Code.d.ts +8 -0
  162. package/components/code/Code.js +2 -0
  163. package/components/code/Code.js.map +1 -0
  164. package/components/code/index.d.ts +1 -0
  165. package/components/errorContent/ErrorContent.js +1 -1
  166. package/components/errorContent/ErrorContent.js.map +1 -1
  167. package/components/footer/FooterIconButton.d.ts +1 -1
  168. package/components/footer/FooterIconButton.js.map +1 -1
  169. package/components/footer/FooterMenu.js +1 -1
  170. package/components/footer/FooterMenu.js.map +1 -1
  171. package/components/footer/FooterMenuCollapse.d.ts +25 -0
  172. package/components/footer/FooterMenuCollapse.js +2 -0
  173. package/components/footer/FooterMenuCollapse.js.map +1 -0
  174. package/components/header/Header.js +1 -1
  175. package/components/header/Header.js.map +1 -1
  176. package/components/header/HeaderLogo.d.ts +1 -1
  177. package/components/header/HeaderNavigationHero.d.ts +1 -1
  178. package/components/header/HeaderNavigationHero.js.map +1 -1
  179. package/components/header/HeaderNavigationLink.js +1 -1
  180. package/components/header/HeaderNavigationLink.js.map +1 -1
  181. package/components/icon/filled/CarChargingFilledIcon.d.ts +6 -0
  182. package/components/icon/filled/CarChargingFilledIcon.js +2 -0
  183. package/components/icon/filled/CarChargingFilledIcon.js.map +1 -0
  184. package/components/icon/filled/EmissionLabelFilledIcon.d.ts +6 -0
  185. package/components/icon/filled/EmissionLabelFilledIcon.js +2 -0
  186. package/components/icon/filled/EmissionLabelFilledIcon.js.map +1 -0
  187. package/components/icon/filled/PictureErrorFilledIcon.d.ts +6 -0
  188. package/components/icon/filled/PictureErrorFilledIcon.js +2 -0
  189. package/components/icon/filled/PictureErrorFilledIcon.js.map +1 -0
  190. package/components/icon/filled/PowerpassFilledIcon.d.ts +6 -0
  191. package/components/icon/filled/PowerpassFilledIcon.js +2 -0
  192. package/components/icon/filled/PowerpassFilledIcon.js.map +1 -0
  193. package/components/icon/filled/index.d.ts +4 -0
  194. package/components/icon/icon.definitions.js +1 -1
  195. package/components/icon/icon.definitions.js.map +1 -1
  196. package/components/icon/stroke/CarChargingIcon.d.ts +6 -0
  197. package/components/icon/stroke/CarChargingIcon.js +2 -0
  198. package/components/icon/stroke/CarChargingIcon.js.map +1 -0
  199. package/components/icon/stroke/EmissionLabelIcon.d.ts +6 -0
  200. package/components/icon/stroke/EmissionLabelIcon.js +2 -0
  201. package/components/icon/stroke/EmissionLabelIcon.js.map +1 -0
  202. package/components/icon/stroke/PictureErrorIcon.d.ts +6 -0
  203. package/components/icon/stroke/PictureErrorIcon.js +2 -0
  204. package/components/icon/stroke/PictureErrorIcon.js.map +1 -0
  205. package/components/icon/stroke/PowerpassIcon.d.ts +6 -0
  206. package/components/icon/stroke/PowerpassIcon.js +2 -0
  207. package/components/icon/stroke/PowerpassIcon.js.map +1 -0
  208. package/components/icon/stroke/index.d.ts +4 -0
  209. package/components/index.d.ts +1 -0
  210. package/components/label/Label.js +1 -1
  211. package/components/label/Label.js.map +1 -1
  212. package/components/notification/NotificationCenterHeaderButton.d.ts +1 -1
  213. package/components/playPauseButton/PlayPauseButton.d.ts +1 -1
  214. package/components/promptBar/PromptAttachments.js +1 -1
  215. package/components/promptBar/PromptAttachments.js.map +1 -1
  216. package/components/promptBar/PromptSubmitIconButton.d.ts +1 -1
  217. package/components/promptBar/PromptSubmitIconButton.js +1 -1
  218. package/components/promptBar/PromptSubmitIconButton.js.map +1 -1
  219. package/components/quickLink/QuickLink.js +1 -1
  220. package/components/quickLink/QuickLink.js.map +1 -1
  221. package/components/search/Search.js +1 -1
  222. package/components/search/Search.js.map +1 -1
  223. package/components/skodaThemeProvider/SkodaThemeProvider.js +1 -1
  224. package/components/skodaThemeProvider/SkodaThemeProvider.js.map +1 -1
  225. package/components/skodaThemeProvider/plugins/stylisContainerPlugin.d.ts +1 -2
  226. package/components/skodaThemeProvider/plugins/stylisContainerPlugin.js +1 -1
  227. package/components/skodaThemeProvider/plugins/stylisContainerPlugin.js.map +1 -1
  228. package/components/textAndCta/AppStoreButton.js +1 -1
  229. package/components/textAndCta/AppStoreButton.js.map +1 -1
  230. package/components/textAndCta/TextAndCta.d.ts +1 -1
  231. package/components/tooltipHeader/TooltipHeader.d.ts +2 -1
  232. package/components/upload/Upload.d.ts +1 -1
  233. package/components/upload/components/uploadList/UploadListItem.d.ts +1 -1
  234. package/components/upload/components/uploadPreview/UploadPreviewImage.d.ts +1 -1
  235. package/components/upload/components/uploadWrapper/UploadContent.d.ts +2 -2
  236. package/components/upload/components/uploadWrapper/UploadWrapper.d.ts +1 -1
  237. package/index.js +1 -1
  238. package/materialui/autocomplete/autocomplete.theme.js +1 -1
  239. package/materialui/autocomplete/autocomplete.theme.js.map +1 -1
  240. package/materialui/badge/badge.theme.js +1 -1
  241. package/materialui/badge/badge.theme.js.map +1 -1
  242. package/materialui/button/buttonBase.theme.js +1 -1
  243. package/materialui/button/buttonBase.theme.js.map +1 -1
  244. package/materialui/card/Card.js +1 -1
  245. package/materialui/card/Card.js.map +1 -1
  246. package/materialui/card/card.theme.js +1 -1
  247. package/materialui/card/card.theme.js.map +1 -1
  248. package/materialui/datepicker/datecalendar.theme.d.ts +1178 -1178
  249. package/materialui/datepicker/digitalclock.theme.d.ts +1176 -1176
  250. package/materialui/dialog/DialogTitle.js +1 -1
  251. package/materialui/dialog/DialogTitle.js.map +1 -1
  252. package/materialui/slider/SliderValues.d.ts +5 -0
  253. package/materialui/slider/SliderValues.js +1 -1
  254. package/materialui/slider/SliderValues.js.map +1 -1
  255. package/materialui/stepper/StepLabelIcon.d.ts +1 -1
  256. package/materialui/stepper/StepLabelIcon.js +1 -1
  257. package/materialui/stepper/StepLabelIcon.js.map +1 -1
  258. package/materialui/switch/switch.theme.js +1 -1
  259. package/materialui/switch/switch.theme.js.map +1 -1
  260. package/materialui/table/stories/actions.d.ts +1 -1
  261. package/materialui/table/stories/basic.d.ts +1 -1
  262. package/materialui/table/stories/interactive.d.ts +1 -1
  263. package/materialui/table/stories/pagination.d.ts +3 -3
  264. package/materialui/table/stories/scrollbar.d.ts +1 -1
  265. package/materialui/table/stories/selectSort.d.ts +1 -1
  266. package/materialui/table/stories/small.d.ts +1 -1
  267. package/materialui/table/tablePagination.theme.js +1 -1
  268. package/materialui/table/tablePagination.theme.js.map +1 -1
  269. package/materialui/tabs/TabPanel.d.ts +2 -2
  270. package/materialui/tabs/TabsScrollButton.d.ts +1 -1
  271. package/materialui/tabs/tabs.theme.js +1 -1
  272. package/materialui/tabs/tabs.theme.js.map +1 -1
  273. package/materialui/textfield/inputBase.theme.js +1 -1
  274. package/materialui/textfield/inputBase.theme.js.map +1 -1
  275. package/materialui/textfield/inputLabel.theme.js +1 -1
  276. package/materialui/textfield/inputLabel.theme.js.map +1 -1
  277. package/materialui/theme/paletteDark.theme.js +1 -1
  278. package/materialui/theme/paletteDark.theme.js.map +1 -1
  279. package/materialui/theme/theme.extensions.d.ts +10 -0
  280. package/materialui/themeProvider/baseline.theme.js +1 -1
  281. package/materialui/themeProvider/baseline.theme.js.map +1 -1
  282. package/materialui/typography/typography.theme.d.ts +4 -0
  283. package/materialui/typography/typography.theme.js +1 -1
  284. package/materialui/typography/typography.theme.js.map +1 -1
  285. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Autoplay.js","sources":["../../../src/components/carousel/Autoplay.tsx"],"sourcesContent":["import { Box, BoxProps } from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { useCarousel } from './hooks';\nimport { Swiper as CarouselInstance } from 'swiper';\nimport { useSwiper } from 'swiper/react';\nimport { useEffect, useState } from 'react';\nimport { PlayPauseButton, PlayPauseButtonProps } from '@/src/components/playPauseButton/PlayPauseButton';\nimport { Spinner, SpinnerProps } from '@/src/components/progress/Spinner';\n\nexport interface CarouselAutoplayProgressProps extends Omit<BoxProps, 'children' | 'position'> {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Progress Props\n */\n spinnerProps?: Omit<SpinnerProps, 'value'>;\n /**\n * Append style to wrapper box to change position of component\n */\n position?: 'outside' | 'inside';\n}\n\n/**\n * Spinner with autoplay progress value\n */\nexport const CarouselAutoplayProgress = ({\n carousel: carouselProp,\n sx,\n spinnerProps,\n position = 'outside',\n ...rest\n}: CarouselAutoplayProgressProps) => {\n const [value, setValue] = useState<number>(0);\n const carouselHook = useSwiper();\n const carousel = carouselProp || carouselHook;\n\n useEffect(() => {\n // attach listener that controls progress value based on swiper special event\n if (carousel?.autoplay) {\n carousel.on('autoplayTimeLeft', (instance, _timeLeft, percentage) => {\n setValue(instance.autoplay.paused ? 0 : Math.round(100 - percentage * 100));\n });\n }\n }, [!!carousel]);\n\n return (\n <Box\n sx={sxOverride(\n {\n position: 'relative',\n display: 'flex',\n m: 2,\n ...(position === 'inside' && {\n position: 'absolute',\n zIndex: '90',\n bottom: '0',\n left: '0',\n right: '0',\n m: 2,\n }),\n },\n sx,\n )}\n data-testid=\"CarouselAutoplayProgress\"\n {...rest}\n >\n <Spinner value={value} {...spinnerProps} />\n </Box>\n );\n};\n\nexport interface CarouselAutoplayIconButtonProps extends Partial<PlayPauseButtonProps> {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n}\n\n/**\n * IconButton controlling play/paused state of the autoplay\n */\nexport function CarouselAutoplayIconButton({ carousel: carouselProp, ...rest }: CarouselAutoplayIconButtonProps) {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n const [value, setValue] = useState<number>(0);\n\n useEffect(() => {\n // attach listener that controls progress value based on swiper special event\n if (carousel?.autoplay) {\n carousel.on('autoplayTimeLeft', (instance, _timeLeft, percentage) => {\n setValue(instance.autoplay.paused ? 0 : Math.round(100 - percentage * 100));\n });\n }\n }, [!!carousel]);\n\n return (\n <PlayPauseButton\n aria-label={carousel?.autoplay?.running ? 'Pause carousel autoplay' : 'Play carousel autoplay'}\n isPlaying={!!carousel?.autoplay?.running}\n progress={value}\n onClick={() => {\n carousel?.autoplay?.[carousel?.autoplay?.running ? 'stop' : 'start']();\n }}\n {...rest}\n />\n );\n}\n"],"names":["CarouselAutoplayProgress","carousel","carouselProp","sx","spinnerProps","position","rest","value","setValue","useState","carouselHook","useSwiper","useEffect","autoplay","on","instance","_timeLeft","percentage","paused","Math","round","_jsx","Box","sxOverride","display","m","zIndex","bottom","left","right","Spinner","CarouselAutoplayIconButton","useCarousel","PlayPauseButton","running","isPlaying","progress","onClick"],"mappings":"+YA2BaA,EAA2B,EACtCC,SAAUC,EACVC,KACAC,eACAC,WAAW,aACRC,MAEH,MAAOC,EAAOC,GAAYC,EAAiB,GACrCC,EAAeC,IACfV,EAAWC,GAAgBQ,EAWjC,OATAE,EAAU,KAEJX,GAAUY,UACZZ,EAASa,GAAG,mBAAoB,CAACC,EAAUC,EAAWC,KACpDT,EAASO,EAASF,SAASK,OAAS,EAAIC,KAAKC,MAAM,IAAmB,IAAbH,OAG5D,GAAGhB,IAGJoB,EAACC,GACCnB,GAAIoB,EACF,CACElB,SAAU,WACVmB,QAAS,OACTC,EAAG,KACc,WAAbpB,GAAyB,CAC3BA,SAAU,WACVqB,OAAQ,KACRC,OAAQ,IACRC,KAAM,IACNC,MAAO,IACPJ,EAAG,IAGPtB,GACD,cACW,8BACRG,WAEJe,EAACS,EAAO,CAACvB,MAAOA,KAAWH,OAe3B,SAAU2B,GAA6B9B,SAAUC,KAAiBI,IACtE,MAAMI,EAAesB,IACf/B,EAAWC,GAAgBQ,GAC1BH,EAAOC,GAAYC,EAAiB,GAW3C,OATAG,EAAU,KAEJX,GAAUY,UACZZ,EAASa,GAAG,mBAAoB,CAACC,EAAUC,EAAWC,KACpDT,EAASO,EAASF,SAASK,OAAS,EAAIC,KAAKC,MAAM,IAAmB,IAAbH,OAG5D,GAAGhB,IAGJoB,EAACY,EAAe,CAAA,aACFhC,GAAUY,UAAUqB,QAAU,0BAA4B,yBACtEC,YAAalC,GAAUY,UAAUqB,QACjCE,SAAU7B,EACV8B,QAAS,KACPpC,GAAUY,WAAWZ,GAAUY,UAAUqB,QAAU,OAAS,eAE1D5B,GAGV"}
1
+ {"version":3,"file":"Autoplay.js","sources":["../../../src/components/carousel/Autoplay.tsx"],"sourcesContent":["import { Box, BoxProps } from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { useCarousel } from './hooks';\nimport { Swiper as CarouselInstance } from 'swiper';\nimport { useSwiper } from 'swiper/react';\nimport { useEffect, useState } from 'react';\nimport { PlayPauseButton, PlayPauseButtonProps } from '@/src/components/playPauseButton/PlayPauseButton';\nimport { Spinner, SpinnerProps } from '@/src/components/progress/Spinner';\n\nexport interface CarouselAutoplayProgressProps extends Omit<BoxProps, 'children' | 'position'> {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Progress Props\n */\n spinnerProps?: Omit<SpinnerProps, 'value'>;\n /**\n * Append style to wrapper box to change position of component\n */\n position?: 'outside' | 'inside';\n}\n\n/**\n * Spinner with autoplay progress value\n */\nexport const CarouselAutoplayProgress = ({\n carousel: carouselProp,\n sx,\n spinnerProps,\n position = 'outside',\n ...rest\n}: CarouselAutoplayProgressProps) => {\n const [value, setValue] = useState<number>(0);\n const carouselHook = useSwiper();\n const carousel = carouselProp || carouselHook;\n\n useEffect(() => {\n // attach listener that controls progress value based on swiper special event\n if (carousel?.autoplay) {\n carousel.on('autoplayTimeLeft', (instance, _timeLeft, percentage) => {\n setValue(instance.autoplay.paused ? 0 : Math.round(100 - percentage * 100));\n });\n }\n }, [!!carousel]);\n\n return (\n <Box\n sx={sxOverride(\n {\n position: 'relative',\n display: 'flex',\n m: 2,\n ...(position === 'inside' && {\n position: 'absolute',\n zIndex: '90',\n bottom: '0',\n left: '0',\n right: '0',\n m: 2,\n }),\n },\n sx,\n )}\n data-testid=\"CarouselAutoplayProgress\"\n {...rest}\n >\n <Spinner value={value} {...spinnerProps} />\n </Box>\n );\n};\n\nexport interface CarouselAutoplayIconButtonProps extends Omit<Partial<PlayPauseButtonProps>, 'aria-label'> {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Accessible label for the button. Accepts a plain string or a function called with the current playing state.\n * @default (isPlaying) => isPlaying ? 'Pause carousel autoplay' : 'Play carousel autoplay'\n */\n 'aria-label'?: string | ((isPlaying: boolean) => string);\n}\n\n/**\n * IconButton controlling play/paused state of the autoplay\n */\nexport function CarouselAutoplayIconButton({\n carousel: carouselProp,\n 'aria-label': ariaLabel = (isPlaying) => isPlaying ? 'Pause carousel autoplay' : 'Play carousel autoplay',\n ...rest\n}: CarouselAutoplayIconButtonProps) {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n const [value, setValue] = useState<number>(0);\n const isPlaying = !!carousel?.autoplay?.running;\n\n useEffect(() => {\n // attach listener that controls progress value based on swiper special event\n if (carousel?.autoplay) {\n carousel.on('autoplayTimeLeft', (instance, _timeLeft, percentage) => {\n setValue(instance.autoplay.paused ? 0 : Math.round(100 - percentage * 100));\n });\n }\n }, [!!carousel]);\n\n return (\n <PlayPauseButton\n aria-label={typeof ariaLabel === 'function' ? ariaLabel(isPlaying) : ariaLabel}\n isPlaying={isPlaying}\n progress={value}\n onClick={() => {\n carousel?.autoplay?.[carousel?.autoplay?.running ? 'stop' : 'start']();\n }}\n {...rest}\n />\n );\n}\n"],"names":["CarouselAutoplayProgress","carousel","carouselProp","sx","spinnerProps","position","rest","value","setValue","useState","carouselHook","useSwiper","useEffect","autoplay","on","instance","_timeLeft","percentage","paused","Math","round","_jsx","Box","sxOverride","display","m","zIndex","bottom","left","right","Spinner","CarouselAutoplayIconButton","ariaLabel","isPlaying","useCarousel","running","PlayPauseButton","progress","onClick"],"mappings":"+YA2BaA,EAA2B,EACtCC,SAAUC,EACVC,KACAC,eACAC,WAAW,aACRC,MAEH,MAAOC,EAAOC,GAAYC,EAAiB,GACrCC,EAAeC,IACfV,EAAWC,GAAgBQ,EAWjC,OATAE,EAAU,KAEJX,GAAUY,UACZZ,EAASa,GAAG,mBAAoB,CAACC,EAAUC,EAAWC,KACpDT,EAASO,EAASF,SAASK,OAAS,EAAIC,KAAKC,MAAM,IAAmB,IAAbH,OAG5D,GAAGhB,IAGJoB,EAACC,GACCnB,GAAIoB,EACF,CACElB,SAAU,WACVmB,QAAS,OACTC,EAAG,KACc,WAAbpB,GAAyB,CAC3BA,SAAU,WACVqB,OAAQ,KACRC,OAAQ,IACRC,KAAM,IACNC,MAAO,IACPJ,EAAG,IAGPtB,GACD,cACW,8BACRG,WAEJe,EAACS,EAAO,CAACvB,MAAOA,KAAWH,OAoB3B,SAAU2B,GACd9B,SAAUC,EACV,aAAc8B,EAAaC,GAAcA,EAAY,0BAA4B,4BAC9E3B,IAEH,MAAMI,EAAewB,IACfjC,EAAWC,GAAgBQ,GAC1BH,EAAOC,GAAYC,EAAiB,GACrCwB,IAAchC,GAAUY,UAAUsB,QAWxC,OATAvB,EAAU,KAEJX,GAAUY,UACZZ,EAASa,GAAG,mBAAoB,CAACC,EAAUC,EAAWC,KACpDT,EAASO,EAASF,SAASK,OAAS,EAAIC,KAAKC,MAAM,IAAmB,IAAbH,OAG5D,GAAGhB,IAGJoB,EAACe,EAAe,CAAA,aACmB,mBAAdJ,EAA2BA,EAAUC,GAAaD,EACrEC,UAAWA,EACXI,SAAU9B,EACV+B,QAAS,KACPrC,GAAUY,WAAWZ,GAAUY,UAAUsB,QAAU,OAAS,eAE1D7B,GAGV"}
@@ -1,4 +1,4 @@
1
- import { ComponentType } from 'react';
1
+ import React, { ComponentType } from 'react';
2
2
  import { IconButtonProps, SvgIconProps } from '@mui/material';
3
3
  import type { Swiper as CarouselInstance } from 'swiper';
4
4
  export interface CarouselNavigationProps {
@@ -54,4 +54,4 @@ export interface CarouselNavigationProps {
54
54
  /**
55
55
  * Left & Right navigation arrows
56
56
  */
57
- export declare function CarouselNavigation({ carousel: carouselProp, peekEffect: propPeekEffect, prevButtonProps, prevIconProps, PrevIconComponent, nextButtonProps, nextIconProps, NextIconComponent, arrows, onBackground, autoHideNavigation, }: CarouselNavigationProps): import("react/jsx-runtime").JSX.Element;
57
+ export declare function CarouselNavigation({ carousel: carouselProp, peekEffect: propPeekEffect, prevButtonProps, prevIconProps, PrevIconComponent, nextButtonProps, nextIconProps, NextIconComponent, arrows, onBackground, autoHideNavigation, }: CarouselNavigationProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import{jsxs as r,Fragment as o,jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{useCarousel as n,useCarouselPeekEffect as s}from"./hooks.js";import{useTheme as i,useMediaQuery as a,IconButton as p}from"@mui/material";import{ChevronLeftIcon as c}from"../icon/stroke/ChevronLeftIcon.js";import{ChevronRightIcon as l}from"../icon/stroke/ChevronRightIcon.js";import{ArrowLeftIcon as d}from"../icon/stroke/ArrowLeftIcon.js";import{ArrowRightIcon as m}from"../icon/stroke/ArrowRightIcon.js";import{getInteractiveStyle as x}from"../../materialui/button/interactive.js";import{sxOverride as u}from"../../utils/sxOverride/sxOverride.js";function f({carousel:f,peekEffect:b=!1,prevButtonProps:v,prevIconProps:k,PrevIconComponent:I,nextButtonProps:g,nextIconProps:h,NextIconComponent:C,arrows:j=!0,onBackground:P=!1,autoHideNavigation:y=!1}){const M=n(),E=f||M,L="fade"!==E?.params?.effect&&b,w=i(),B=a(w.breakpoints.up("md")),{sx:N,...S}=v||{},{sx:z,...A}=g||{},[O,R]=s(E),H=I||(j?d:c),q=C||(j?m:l),D=t(()=>({position:"absolute",zIndex:"100",top:"50%",width:{xs:"32px",md:"40px",xl:"44px"},height:{xs:"32px",md:"40px",xl:"44px"},mt:{xs:"-16px",md:"-20px",xl:"-22px"},"& .MuiSvgIcon-root":{fontSize:{xs:"17px",xl:"20px"}},...x({color:"text.primary",borderColor:P?"transparent.transparent":"onSurface.os100",backgroundColor:P?"transparent.transparent":"surface.primary"},{backgroundColor:"surface.secondary"}),"&.Mui-disabled":{color:"disabled.tertiary",borderColor:P?"transparent.transparent":"disabled.secondary",backgroundColor:P?"transparent.transparent":"disabled.secondary"}}),[]);return y&&E?.isLocked?null:r(o,{children:[e(p,{disabled:E&&!E.params?.loop&&E.isBeginning,onClick:()=>{E?.slidePrev(),L&&O&&R("reset")},onMouseEnter:()=>B&&L&&R("prev"),onMouseLeave:()=>L&&O&&R("reset"),sx:u({...D,insetInlineStart:"16px"},N),"aria-label":"Previous slide","aria-controls":"carousel",color:"surface",size:"medium",...S,children:"rtl"===w.direction?e(q,{...k}):e(H,{...k})}),e(p,{disabled:E&&!E.params?.loop&&E.isEnd,onClick:()=>{E?.slideNext(),L&&O&&R("reset")},onMouseEnter:()=>B&&L&&R("next"),onMouseLeave:()=>L&&O&&R("reset"),sx:u({...D,insetInlineEnd:"16px"},z),"aria-label":"Next slide","aria-controls":"carousel",color:"surface",...A,children:"rtl"===w.direction?e(H,{...h}):e(q,{...h})})]})}export{f as CarouselNavigation};
1
+ import{jsxs as o,Fragment as r,jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{useCarousel as n,useCarouselPeekEffect as s}from"./hooks.js";import{useTheme as i,useMediaQuery as a,IconButton as c}from"@mui/material";import{ChevronLeftIcon as l}from"../icon/stroke/ChevronLeftIcon.js";import{ChevronRightIcon as p}from"../icon/stroke/ChevronRightIcon.js";import{ArrowLeftIcon as d}from"../icon/stroke/ArrowLeftIcon.js";import{ArrowRightIcon as m}from"../icon/stroke/ArrowRightIcon.js";import{getInteractiveStyle as x}from"../../materialui/button/interactive.js";import{sxOverride as u}from"../../utils/sxOverride/sxOverride.js";function f({carousel:f,peekEffect:b=!1,prevButtonProps:v,prevIconProps:k,PrevIconComponent:I,nextButtonProps:g,nextIconProps:h,NextIconComponent:C,arrows:j=!0,onBackground:P=!1,autoHideNavigation:y=!1}){const M=n(),E=f||M,L="fade"!==E?.params?.effect&&b,w=i(),B=a(w.breakpoints.up("md")),{sx:N,...S}=v||{},{sx:z,...A}=g||{},[O,R]=s(E),H=I||(j?d:l),q=C||(j?m:p),D=t(()=>({position:"absolute",zIndex:"100",top:"50%",width:{xs:"32px",md:"40px",xl:"44px"},height:{xs:"32px",md:"40px",xl:"44px"},mt:{xs:"-16px",md:"-20px",xl:"-22px"},"& .MuiSvgIcon-root":{fontSize:{xs:"17px",xl:"20px"}},...x({color:"text.primary",borderColor:P?"transparent":"onSurface.os100",backgroundColor:P?"transparent":"surface.primary"},{backgroundColor:"surface.secondary"}),"&.Mui-disabled":{color:"disabled.tertiary",borderColor:P?"transparent":"disabled.secondary",backgroundColor:P?"transparent":"disabled.secondary"}}),[]);return y&&E?.isLocked?null:o(r,{children:[e(c,{disabled:E&&!E.params?.loop&&E.isBeginning,onClick:()=>{E?.slidePrev(),L&&O&&R("reset")},onMouseEnter:()=>B&&L&&R("prev"),onMouseLeave:()=>L&&O&&R("reset"),sx:u({...D,insetInlineStart:"16px"},N),"aria-label":"Previous slide","aria-controls":"carousel",color:"surface",size:"medium",...S,children:"rtl"===w.direction?e(q,{...k}):e(H,{...k})}),e(c,{disabled:E&&!E.params?.loop&&E.isEnd,onClick:()=>{E?.slideNext(),L&&O&&R("reset")},onMouseEnter:()=>B&&L&&R("next"),onMouseLeave:()=>L&&O&&R("reset"),sx:u({...D,insetInlineEnd:"16px"},z),"aria-label":"Next slide","aria-controls":"carousel",color:"surface",...A,children:"rtl"===w.direction?e(H,{...h}):e(q,{...h})})]})}export{f as CarouselNavigation};
2
2
  //# sourceMappingURL=Navigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.js","sources":["../../../src/components/carousel/Navigation.tsx"],"sourcesContent":["import React, { useMemo, ComponentType } from 'react';\nimport { useCarousel, useCarouselPeekEffect } from './hooks';\nimport { useTheme, IconButton, IconButtonProps, SvgIconProps, useMediaQuery } from '@mui/material';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { ChevronLeftIcon } from '@/src/components/icon/stroke/ChevronLeftIcon';\nimport { ChevronRightIcon } from '@/src/components/icon/stroke/ChevronRightIcon';\nimport { ArrowLeftIcon } from '@/src/components/icon/stroke/ArrowLeftIcon';\nimport { ArrowRightIcon } from '@/src/components/icon/stroke/ArrowRightIcon';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface CarouselNavigationProps {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Enable/disable peek effect on hover\n * @default: false\n */\n peekEffect?: boolean;\n /**\n * Previous Slide IconButton\n */\n prevButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n prevIconProps?: SvgIconProps;\n /**\n * Previous icon node\n */\n PrevIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Next Slide IconButton\n */\n nextButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n nextIconProps?: SvgIconProps;\n /**\n * Next icon node\n */\n NextIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Replaces Chevrons with Arrows\n * @default true\n */\n arrows?: boolean;\n /**\n * Enable if placing on a plain background (not on top of an image/video)\n * @default false\n */\n onBackground?: boolean;\n /**\n * Hide navigation buttons on case there are not enough slides for sliding\n * @default false\n */\n autoHideNavigation?: boolean;\n}\n\n/**\n * Left & Right navigation arrows\n */\nexport function CarouselNavigation({\n carousel: carouselProp,\n peekEffect: propPeekEffect = false,\n prevButtonProps,\n prevIconProps,\n PrevIconComponent,\n nextButtonProps,\n nextIconProps,\n NextIconComponent,\n arrows = true,\n onBackground = false,\n autoHideNavigation = false,\n}: CarouselNavigationProps) {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n const peekEffect = carousel?.params?.effect !== 'fade' && propPeekEffect;\n const theme = useTheme();\n const upMD = useMediaQuery(theme.breakpoints.up('md'));\n const { sx: prevSx, ...restPrev } = prevButtonProps || {};\n const { sx: nextSx, ...restNext } = nextButtonProps || {};\n const [peek, setPeek] = useCarouselPeekEffect(carousel);\n const PrevIcon = PrevIconComponent || (arrows ? ArrowLeftIcon : ChevronLeftIcon);\n const NextIcon = NextIconComponent || (arrows ? ArrowRightIcon : ChevronRightIcon);\n\n // shared style between buttons\n const sharedSx = useMemo(\n () => ({\n // absolute inside the carousel position\n position: 'absolute',\n zIndex: '100',\n top: '50%',\n // responsive\n width: { xs: '32px', md: '40px', xl: '44px' },\n height: { xs: '32px', md: '40px', xl: '44px' },\n // manual v-align, half the icon size\n mt: { xs: '-16px', md: '-20px', xl: '-22px' },\n '& .MuiSvgIcon-root': {\n fontSize: { xs: '17px', xl: '20px' },\n },\n // highlight border\n ...getInteractiveStyle(\n {\n color: 'text.primary',\n borderColor: onBackground ? 'transparent.transparent' : 'onSurface.os100',\n backgroundColor: onBackground ? 'transparent.transparent' : 'surface.primary',\n },\n {\n backgroundColor: 'surface.secondary',\n },\n ),\n // disabled state\n '&.Mui-disabled': {\n color: 'disabled.tertiary',\n borderColor: onBackground ? 'transparent.transparent' : 'disabled.secondary',\n backgroundColor: onBackground ? 'transparent.transparent' : 'disabled.secondary',\n },\n }),\n [],\n );\n\n // hide navigation when not needed\n if (autoHideNavigation && carousel?.isLocked) {\n return null;\n }\n return (\n <>\n <IconButton\n disabled={carousel && !carousel.params?.loop && carousel.isBeginning}\n onClick={() => {\n carousel?.slidePrev();\n peekEffect && peek && setPeek('reset');\n }}\n onMouseEnter={() => upMD && peekEffect && setPeek('prev')}\n onMouseLeave={() => peekEffect && peek && setPeek('reset')}\n sx={sxOverride(\n {\n ...sharedSx,\n insetInlineStart: '16px',\n },\n prevSx,\n )}\n aria-label=\"Previous slide\"\n aria-controls=\"carousel\"\n color=\"surface\"\n size=\"medium\"\n {...restPrev}\n >\n {theme.direction === 'rtl' ? <NextIcon {...prevIconProps} /> : <PrevIcon {...prevIconProps} />}\n </IconButton>\n <IconButton\n disabled={carousel && !carousel.params?.loop && carousel.isEnd}\n onClick={() => {\n carousel?.slideNext();\n peekEffect && peek && setPeek('reset');\n }}\n onMouseEnter={() => upMD && peekEffect && setPeek('next')}\n onMouseLeave={() => peekEffect && peek && setPeek('reset')}\n sx={sxOverride(\n {\n ...sharedSx,\n insetInlineEnd: '16px',\n },\n nextSx,\n )}\n aria-label=\"Next slide\"\n aria-controls=\"carousel\"\n color=\"surface\"\n {...restNext}\n >\n {theme.direction === 'rtl' ? <PrevIcon {...nextIconProps} /> : <NextIcon {...nextIconProps} />}\n </IconButton>\n </>\n );\n}\n"],"names":["CarouselNavigation","carousel","carouselProp","peekEffect","propPeekEffect","prevButtonProps","prevIconProps","PrevIconComponent","nextButtonProps","nextIconProps","NextIconComponent","arrows","onBackground","autoHideNavigation","carouselHook","useCarousel","params","effect","theme","useTheme","upMD","useMediaQuery","breakpoints","up","sx","prevSx","restPrev","nextSx","restNext","peek","setPeek","useCarouselPeekEffect","PrevIcon","ArrowLeftIcon","ChevronLeftIcon","NextIcon","ArrowRightIcon","ChevronRightIcon","sharedSx","useMemo","position","zIndex","top","width","xs","md","xl","height","mt","fontSize","getInteractiveStyle","color","borderColor","backgroundColor","isLocked","_jsxs","_jsx","IconButton","disabled","loop","isBeginning","onClick","slidePrev","onMouseEnter","onMouseLeave","sxOverride","insetInlineStart","size","children","direction","isEnd","slideNext","insetInlineEnd"],"mappings":"opBAiEgBA,GACdC,SAAUC,EACVC,WAAYC,GAAiB,EAAKC,gBAClCA,EAAeC,cACfA,EAAaC,kBACbA,EAAiBC,gBACjBA,EAAeC,cACfA,EAAaC,kBACbA,EAAiBC,OACjBA,GAAS,EAAIC,aACbA,GAAe,EAAKC,mBACpBA,GAAqB,IAErB,MAAMC,EAAeC,IACfd,EAAWC,GAAgBY,EAC3BX,EAA0C,SAA7BF,GAAUe,QAAQC,QAAqBb,EACpDc,EAAQC,IACRC,EAAOC,EAAcH,EAAMI,YAAYC,GAAG,QACxCC,GAAIC,KAAWC,GAAarB,GAAmB,CAAA,GAC/CmB,GAAIG,KAAWC,GAAapB,GAAmB,CAAA,GAChDqB,EAAMC,GAAWC,EAAsB9B,GACxC+B,EAAWzB,IAAsBI,EAASsB,EAAgBC,GAC1DC,EAAWzB,IAAsBC,EAASyB,EAAiBC,GAG3DC,EAAWC,EACf,KAAA,CAEEC,SAAU,WACVC,OAAQ,MACRC,IAAK,MAELC,MAAO,CAAEC,GAAI,OAAQC,GAAI,OAAQC,GAAI,QACrCC,OAAQ,CAAEH,GAAI,OAAQC,GAAI,OAAQC,GAAI,QAEtCE,GAAI,CAAEJ,GAAI,QAASC,GAAI,QAASC,GAAI,SACpC,qBAAsB,CACpBG,SAAU,CAAEL,GAAI,OAAQE,GAAI,YAG3BI,EACD,CACEC,MAAO,eACPC,YAAaxC,EAAe,0BAA4B,kBACxDyC,gBAAiBzC,EAAe,0BAA4B,mBAE9D,CACEyC,gBAAiB,sBAIrB,iBAAkB,CAChBF,MAAO,oBACPC,YAAaxC,EAAe,0BAA4B,qBACxDyC,gBAAiBzC,EAAe,0BAA4B,wBAGhE,IAIF,OAAIC,GAAsBZ,GAAUqD,SAC3B,KAGPC,eACEC,EAACC,GACCC,SAAUzD,IAAaA,EAASe,QAAQ2C,MAAQ1D,EAAS2D,YACzDC,QAAS,KACP5D,GAAU6D,YACV3D,GAAc0B,GAAQC,EAAQ,UAEhCiC,aAAc,IAAM3C,GAAQjB,GAAc2B,EAAQ,QAClDkC,aAAc,IAAM7D,GAAc0B,GAAQC,EAAQ,SAClDN,GAAIyC,EACF,IACK3B,EACH4B,iBAAkB,QAEpBzC,GACD,aACU,iBAAgB,gBACb,WACd0B,MAAM,UACNgB,KAAK,YACDzC,EAAQ0C,SAES,QAApBlD,EAAMmD,UAAsBb,EAACrB,EAAQ,IAAK7B,IAAoBkD,EAACxB,EAAQ,IAAK1B,MAE/EkD,EAACC,EAAU,CACTC,SAAUzD,IAAaA,EAASe,QAAQ2C,MAAQ1D,EAASqE,MACzDT,QAAS,KACP5D,GAAUsE,YACVpE,GAAc0B,GAAQC,EAAQ,UAEhCiC,aAAc,IAAM3C,GAAQjB,GAAc2B,EAAQ,QAClDkC,aAAc,IAAM7D,GAAc0B,GAAQC,EAAQ,SAClDN,GAAIyC,EACF,IACK3B,EACHkC,eAAgB,QAElB7C,GACD,aACU,aAAY,gBACT,WACdwB,MAAM,aACFvB,EAAQwC,SAES,QAApBlD,EAAMmD,UAAsBb,EAACxB,EAAQ,IAAKvB,IAAoB+C,EAACrB,EAAQ,IAAK1B,QAIrF"}
1
+ {"version":3,"file":"Navigation.js","sources":["../../../src/components/carousel/Navigation.tsx"],"sourcesContent":["import React, { useMemo, ComponentType } from 'react';\nimport { useCarousel, useCarouselPeekEffect } from './hooks';\nimport { useTheme, IconButton, IconButtonProps, SvgIconProps, useMediaQuery } from '@mui/material';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { ChevronLeftIcon } from '@/src/components/icon/stroke/ChevronLeftIcon';\nimport { ChevronRightIcon } from '@/src/components/icon/stroke/ChevronRightIcon';\nimport { ArrowLeftIcon } from '@/src/components/icon/stroke/ArrowLeftIcon';\nimport { ArrowRightIcon } from '@/src/components/icon/stroke/ArrowRightIcon';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface CarouselNavigationProps {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Enable/disable peek effect on hover\n * @default: false\n */\n peekEffect?: boolean;\n /**\n * Previous Slide IconButton\n */\n prevButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n prevIconProps?: SvgIconProps;\n /**\n * Previous icon node\n */\n PrevIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Next Slide IconButton\n */\n nextButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n nextIconProps?: SvgIconProps;\n /**\n * Next icon node\n */\n NextIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Replaces Chevrons with Arrows\n * @default true\n */\n arrows?: boolean;\n /**\n * Enable if placing on a plain background (not on top of an image/video)\n * @default false\n */\n onBackground?: boolean;\n /**\n * Hide navigation buttons on case there are not enough slides for sliding\n * @default false\n */\n autoHideNavigation?: boolean;\n}\n\n/**\n * Left & Right navigation arrows\n */\nexport function CarouselNavigation({\n carousel: carouselProp,\n peekEffect: propPeekEffect = false,\n prevButtonProps,\n prevIconProps,\n PrevIconComponent,\n nextButtonProps,\n nextIconProps,\n NextIconComponent,\n arrows = true,\n onBackground = false,\n autoHideNavigation = false,\n}: CarouselNavigationProps) {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n const peekEffect = carousel?.params?.effect !== 'fade' && propPeekEffect;\n const theme = useTheme();\n const upMD = useMediaQuery(theme.breakpoints.up('md'));\n const { sx: prevSx, ...restPrev } = prevButtonProps || {};\n const { sx: nextSx, ...restNext } = nextButtonProps || {};\n const [peek, setPeek] = useCarouselPeekEffect(carousel);\n const PrevIcon = PrevIconComponent || (arrows ? ArrowLeftIcon : ChevronLeftIcon);\n const NextIcon = NextIconComponent || (arrows ? ArrowRightIcon : ChevronRightIcon);\n\n // shared style between buttons\n const sharedSx = useMemo(\n () => ({\n // absolute inside the carousel position\n position: 'absolute',\n zIndex: '100',\n top: '50%',\n // responsive\n width: { xs: '32px', md: '40px', xl: '44px' },\n height: { xs: '32px', md: '40px', xl: '44px' },\n // manual v-align, half the icon size\n mt: { xs: '-16px', md: '-20px', xl: '-22px' },\n '& .MuiSvgIcon-root': {\n fontSize: { xs: '17px', xl: '20px' },\n },\n // highlight border\n ...getInteractiveStyle(\n {\n color: 'text.primary',\n borderColor: onBackground ? 'transparent' : 'onSurface.os100',\n backgroundColor: onBackground ? 'transparent' : 'surface.primary',\n },\n {\n backgroundColor: 'surface.secondary',\n },\n ),\n // disabled state\n '&.Mui-disabled': {\n color: 'disabled.tertiary',\n borderColor: onBackground ? 'transparent' : 'disabled.secondary',\n backgroundColor: onBackground ? 'transparent' : 'disabled.secondary',\n },\n }),\n [],\n );\n\n // hide navigation when not needed\n if (autoHideNavigation && carousel?.isLocked) {\n return null;\n }\n return (\n <>\n <IconButton\n disabled={carousel && !carousel.params?.loop && carousel.isBeginning}\n onClick={() => {\n carousel?.slidePrev();\n peekEffect && peek && setPeek('reset');\n }}\n onMouseEnter={() => upMD && peekEffect && setPeek('prev')}\n onMouseLeave={() => peekEffect && peek && setPeek('reset')}\n sx={sxOverride(\n {\n ...sharedSx,\n insetInlineStart: '16px',\n },\n prevSx,\n )}\n aria-label=\"Previous slide\"\n aria-controls=\"carousel\"\n color=\"surface\"\n size=\"medium\"\n {...restPrev}\n >\n {theme.direction === 'rtl' ? <NextIcon {...prevIconProps} /> : <PrevIcon {...prevIconProps} />}\n </IconButton>\n <IconButton\n disabled={carousel && !carousel.params?.loop && carousel.isEnd}\n onClick={() => {\n carousel?.slideNext();\n peekEffect && peek && setPeek('reset');\n }}\n onMouseEnter={() => upMD && peekEffect && setPeek('next')}\n onMouseLeave={() => peekEffect && peek && setPeek('reset')}\n sx={sxOverride(\n {\n ...sharedSx,\n insetInlineEnd: '16px',\n },\n nextSx,\n )}\n aria-label=\"Next slide\"\n aria-controls=\"carousel\"\n color=\"surface\"\n {...restNext}\n >\n {theme.direction === 'rtl' ? <PrevIcon {...nextIconProps} /> : <NextIcon {...nextIconProps} />}\n </IconButton>\n </>\n );\n}\n"],"names":["CarouselNavigation","carousel","carouselProp","peekEffect","propPeekEffect","prevButtonProps","prevIconProps","PrevIconComponent","nextButtonProps","nextIconProps","NextIconComponent","arrows","onBackground","autoHideNavigation","carouselHook","useCarousel","params","effect","theme","useTheme","upMD","useMediaQuery","breakpoints","up","sx","prevSx","restPrev","nextSx","restNext","peek","setPeek","useCarouselPeekEffect","PrevIcon","ArrowLeftIcon","ChevronLeftIcon","NextIcon","ArrowRightIcon","ChevronRightIcon","sharedSx","useMemo","position","zIndex","top","width","xs","md","xl","height","mt","fontSize","getInteractiveStyle","color","borderColor","backgroundColor","isLocked","_jsxs","_jsx","IconButton","disabled","loop","isBeginning","onClick","slidePrev","onMouseEnter","onMouseLeave","sxOverride","insetInlineStart","size","children","direction","isEnd","slideNext","insetInlineEnd"],"mappings":"opBAiEgBA,GACdC,SAAUC,EACVC,WAAYC,GAAiB,EAAKC,gBAClCA,EAAeC,cACfA,EAAaC,kBACbA,EAAiBC,gBACjBA,EAAeC,cACfA,EAAaC,kBACbA,EAAiBC,OACjBA,GAAS,EAAIC,aACbA,GAAe,EAAKC,mBACpBA,GAAqB,IAErB,MAAMC,EAAeC,IACfd,EAAWC,GAAgBY,EAC3BX,EAA0C,SAA7BF,GAAUe,QAAQC,QAAqBb,EACpDc,EAAQC,IACRC,EAAOC,EAAcH,EAAMI,YAAYC,GAAG,QACxCC,GAAIC,KAAWC,GAAarB,GAAmB,CAAA,GAC/CmB,GAAIG,KAAWC,GAAapB,GAAmB,CAAA,GAChDqB,EAAMC,GAAWC,EAAsB9B,GACxC+B,EAAWzB,IAAsBI,EAASsB,EAAgBC,GAC1DC,EAAWzB,IAAsBC,EAASyB,EAAiBC,GAG3DC,EAAWC,EACf,KAAA,CAEEC,SAAU,WACVC,OAAQ,MACRC,IAAK,MAELC,MAAO,CAAEC,GAAI,OAAQC,GAAI,OAAQC,GAAI,QACrCC,OAAQ,CAAEH,GAAI,OAAQC,GAAI,OAAQC,GAAI,QAEtCE,GAAI,CAAEJ,GAAI,QAASC,GAAI,QAASC,GAAI,SACpC,qBAAsB,CACpBG,SAAU,CAAEL,GAAI,OAAQE,GAAI,YAG3BI,EACD,CACEC,MAAO,eACPC,YAAaxC,EAAe,cAAgB,kBAC5CyC,gBAAiBzC,EAAe,cAAgB,mBAElD,CACEyC,gBAAiB,sBAIrB,iBAAkB,CAChBF,MAAO,oBACPC,YAAaxC,EAAe,cAAgB,qBAC5CyC,gBAAiBzC,EAAe,cAAgB,wBAGpD,IAIF,OAAIC,GAAsBZ,GAAUqD,SAC3B,KAGPC,eACEC,EAACC,GACCC,SAAUzD,IAAaA,EAASe,QAAQ2C,MAAQ1D,EAAS2D,YACzDC,QAAS,KACP5D,GAAU6D,YACV3D,GAAc0B,GAAQC,EAAQ,UAEhCiC,aAAc,IAAM3C,GAAQjB,GAAc2B,EAAQ,QAClDkC,aAAc,IAAM7D,GAAc0B,GAAQC,EAAQ,SAClDN,GAAIyC,EACF,IACK3B,EACH4B,iBAAkB,QAEpBzC,GACD,aACU,iBAAgB,gBACb,WACd0B,MAAM,UACNgB,KAAK,YACDzC,EAAQ0C,SAES,QAApBlD,EAAMmD,UAAsBb,EAACrB,EAAQ,IAAK7B,IAAoBkD,EAACxB,EAAQ,IAAK1B,MAE/EkD,EAACC,EAAU,CACTC,SAAUzD,IAAaA,EAASe,QAAQ2C,MAAQ1D,EAASqE,MACzDT,QAAS,KACP5D,GAAUsE,YACVpE,GAAc0B,GAAQC,EAAQ,UAEhCiC,aAAc,IAAM3C,GAAQjB,GAAc2B,EAAQ,QAClDkC,aAAc,IAAM7D,GAAc0B,GAAQC,EAAQ,SAClDN,GAAIyC,EACF,IACK3B,EACHkC,eAAgB,QAElB7C,GACD,aACU,aAAY,gBACT,WACdwB,MAAM,aACFvB,EAAQwC,SAES,QAApBlD,EAAMmD,UAAsBb,EAACxB,EAAQ,IAAKvB,IAAoB+C,EAACrB,EAAQ,IAAK1B,QAIrF"}
@@ -1,2 +1,2 @@
1
- import{useState as e,useEffect as t,useLayoutEffect as r,useRef as s}from"react";import{useSwiper as n}from"swiper/react";function l(t){const[r,s]=e(null);return c(r,t),[r,s]}function o(e){const t=n();return c(t,e),t}function c(s,n){const[,l]=e({});t(()=>{s&&(n??["slideChange","afterInit","reachBeginning","reachEnd","autoplayStart","autoplayStop","lock","unlock"]).forEach(e=>{s.on(e,()=>{l({})})})},[s]),r(()=>{l({})},[])}function i(r){const[n,l]=e(null),o=s(null),[c,i]=e(!1);return t(()=>("reset"===n?(r?.el?.classList.remove("peek-prev"),r?.el?.classList.remove("peek-next"),o.current=setTimeout(()=>{l(null)},+(r?.el?.dataset?.peekspeed??150))):n?c||(r?.slideReset(0),"prev"===n?(r?.slidePrev(0),r?.slideNext(0)):(r?.slideNext(0),r?.slidePrev(0)),r?.el?.classList.add("peeking"),r?.el?.classList.add(`peek-${n}`)):(r?.el?.classList.remove("peeking"),r?.el?.classList.remove("peek-prev"),r?.el?.classList.remove("peek-next")),()=>{o.current&&clearTimeout(o.current)}),[n]),t(()=>{r?.on("touchStart",()=>{l("reset"),i(!0)}),r?.on("touchEnd",()=>{l("reset"),i(!1)})},[!!r]),[n,l]}export{o as useCarousel,l as useCarouselInstance,i as useCarouselPeekEffect};
1
+ import{useMemo as e,useState as t,useEffect as r,useLayoutEffect as n,useRef as s}from"react";import{useSwiper as l}from"swiper/react";function o(r){const[n,s]=t(null),l=i(n,r);return[e(()=>n?new Proxy(n,{_t:l}):n,[n,l]),s]}function c(t){const r=l(),n=i(r,t);return e(()=>r?new Proxy(r,{_t:n}):r,[r,n])}function i(e,s){const[l,o]=t(0);return r(()=>{e&&(s??["slideChange","afterInit","reachBeginning","reachEnd","fromEdge","autoplayStart","autoplayStop","lock","unlock"]).forEach(t=>{e.on(t,()=>{o(e=>e+1)})})},[e]),n(()=>{o(e=>e+1)},[]),l}function a(e){const[n,l]=t(null),o=s(null),[c,i]=t(!1);return r(()=>("reset"===n?(e?.el?.classList.remove("peek-prev"),e?.el?.classList.remove("peek-next"),o.current=setTimeout(()=>{l(null)},+(e?.el?.dataset?.peekspeed??150))):n?c||(e?.slideReset(0),"prev"===n?(e?.slidePrev(0),e?.slideNext(0)):(e?.slideNext(0),e?.slidePrev(0)),e?.el?.classList.add("peeking"),e?.el?.classList.add(`peek-${n}`)):(e?.el?.classList.remove("peeking"),e?.el?.classList.remove("peek-prev"),e?.el?.classList.remove("peek-next")),()=>{o.current&&clearTimeout(o.current)}),[n]),r(()=>{e?.on("touchStart",()=>{l("reset"),i(!0)}),e?.on("touchEnd",()=>{l("reset"),i(!1)})},[!!e]),[n,l]}export{c as useCarousel,o as useCarouselInstance,a as useCarouselPeekEffect};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sources":["../../../src/components/carousel/hooks.ts"],"sourcesContent":["import { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { useSwiper } from 'swiper/react';\nimport { SwiperEvents } from 'swiper/types';\n\n/**\n * Hook to obtain and manage CarouselInstance\n * */\nexport function useCarouselInstance(events?: (keyof SwiperEvents)[]) {\n const [carousel, setCarousel] = useState<CarouselInstance | null>(null);\n useRefreshInstance(carousel, events);\n\n return [carousel, setCarousel] as const;\n}\n\n/**\n * Hook to obtain CarouselInstance inside the Carousel component\n */\nexport function useCarousel(events?: (keyof SwiperEvents)[]) {\n const carousel = useSwiper();\n useRefreshInstance(carousel, events);\n\n return carousel;\n}\n\n/**\n * Internal hook that forces re-renders on events like slideChange, so the carousel.realIndex is correct\n * https://github.com/nolimits4web/swiper/issues/5577\n */\nfunction useRefreshInstance(carousel: CarouselInstance, events?: (keyof SwiperEvents)[]) {\n // force re-render\n const [, setRerender] = useState({});\n useEffect(() => {\n if (carousel) {\n // subscribe to carousel events to trigger re-render\n (\n events ?? [\n 'slideChange',\n 'afterInit',\n 'reachBeginning',\n 'reachEnd',\n 'autoplayStart',\n 'autoplayStop',\n 'lock',\n 'unlock',\n ]\n ).forEach((evt: keyof SwiperEvents) => {\n carousel.on(evt, () => {\n setRerender({});\n });\n });\n }\n }, [carousel]);\n // once everything is rendered, make sure to re-render to have proper data (initialization)\n useLayoutEffect(() => {\n setRerender({});\n }, []);\n}\n\n/**\n * Manage peek effect in the Carousel by adding classes to the Carousel instance\n */\nexport function useCarouselPeekEffect(carousel: CarouselInstance) {\n const [peek, setPeek] = useState<'prev' | 'next' | 'reset' | null>(null);\n const peekTimeout = useRef<NodeJS.Timeout | null>(null);\n const [disabled, setDisabled] = useState<boolean>(false);\n\n useEffect(() => {\n if (peek === 'reset') {\n carousel?.el?.classList.remove('peek-prev');\n carousel?.el?.classList.remove('peek-next');\n peekTimeout.current = setTimeout(\n () => {\n setPeek(null);\n },\n +(carousel?.el?.dataset?.peekspeed ?? 150),\n ); // matches transitionDuration in the Carousel\n } else if (peek) {\n if (!disabled) {\n // make sure prev/next slide is visible (loop)\n carousel?.slideReset(0);\n if (peek === 'prev') {\n carousel?.slidePrev(0);\n carousel?.slideNext(0);\n } else {\n carousel?.slideNext(0);\n carousel?.slidePrev(0);\n }\n carousel?.el?.classList.add('peeking');\n carousel?.el?.classList.add(`peek-${peek}`);\n }\n } else {\n carousel?.el?.classList.remove('peeking');\n carousel?.el?.classList.remove('peek-prev');\n carousel?.el?.classList.remove('peek-next');\n }\n\n return () => {\n if (peekTimeout.current) {\n clearTimeout(peekTimeout.current);\n }\n };\n }, [peek]);\n\n /**\n * Watch carousel instance\n */\n useEffect(() => {\n // once carousel is being dragged, reset and disable peek effect\n carousel?.on('touchStart', () => {\n setPeek('reset');\n setDisabled(true);\n });\n carousel?.on('touchEnd', () => {\n setPeek('reset');\n setDisabled(false);\n });\n }, [!!carousel]);\n\n return [peek, setPeek] as const;\n}\n"],"names":["useCarouselInstance","events","carousel","setCarousel","useState","useRefreshInstance","useCarousel","useSwiper","setRerender","useEffect","forEach","evt","on","useLayoutEffect","useCarouselPeekEffect","peek","setPeek","peekTimeout","useRef","disabled","setDisabled","el","classList","remove","current","setTimeout","dataset","peekspeed","slideReset","slidePrev","slideNext","add","clearTimeout"],"mappings":"0HAQM,SAAUA,EAAoBC,GAClC,MAAOC,EAAUC,GAAeC,EAAkC,MAGlE,OAFAC,EAAmBH,EAAUD,GAEtB,CAACC,EAAUC,EACpB,CAKM,SAAUG,EAAYL,GAC1B,MAAMC,EAAWK,IAGjB,OAFAF,EAAmBH,EAAUD,GAEtBC,CACT,CAMA,SAASG,EAAmBH,EAA4BD,GAEtD,OAASO,GAAeJ,EAAS,IACjCK,EAAU,KACJP,IAGAD,GAAU,CACR,cACA,YACA,iBACA,WACA,gBACA,eACA,OACA,WAEFS,QAASC,IACTT,EAASU,GAAGD,EAAK,KACfH,EAAY,CAAA,QAIjB,CAACN,IAEJW,EAAgB,KACdL,EAAY,CAAA,IACX,GACL,CAKM,SAAUM,EAAsBZ,GACpC,MAAOa,EAAMC,GAAWZ,EAA2C,MAC7Da,EAAcC,EAA8B,OAC3CC,EAAUC,GAAehB,GAAkB,GAsDlD,OApDAK,EAAU,KACK,UAATM,GACFb,GAAUmB,IAAIC,UAAUC,OAAO,aAC/BrB,GAAUmB,IAAIC,UAAUC,OAAO,aAC/BN,EAAYO,QAAUC,WACpB,KACET,EAAQ,SAERd,GAAUmB,IAAIK,SAASC,WAAa,OAE/BZ,EACJI,IAEHjB,GAAU0B,WAAW,GACR,SAATb,GACFb,GAAU2B,UAAU,GACpB3B,GAAU4B,UAAU,KAEpB5B,GAAU4B,UAAU,GACpB5B,GAAU2B,UAAU,IAEtB3B,GAAUmB,IAAIC,UAAUS,IAAI,WAC5B7B,GAAUmB,IAAIC,UAAUS,IAAI,QAAQhB,OAGtCb,GAAUmB,IAAIC,UAAUC,OAAO,WAC/BrB,GAAUmB,IAAIC,UAAUC,OAAO,aAC/BrB,GAAUmB,IAAIC,UAAUC,OAAO,cAG1B,KACDN,EAAYO,SACdQ,aAAaf,EAAYO,WAG5B,CAACT,IAKJN,EAAU,KAERP,GAAUU,GAAG,aAAc,KACzBI,EAAQ,SACRI,GAAY,KAEdlB,GAAUU,GAAG,WAAY,KACvBI,EAAQ,SACRI,GAAY,MAEb,GAAGlB,IAEC,CAACa,EAAMC,EAChB"}
1
+ {"version":3,"file":"hooks.js","sources":["../../../src/components/carousel/hooks.ts"],"sourcesContent":["import { useState, useEffect, useLayoutEffect, useMemo, useRef } from 'react';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { useSwiper } from 'swiper/react';\nimport { SwiperEvents } from 'swiper/types';\n\n/**\n * Hook to obtain and manage CarouselInstance\n * */\nexport function useCarouselInstance(events?: (keyof SwiperEvents)[]) {\n const [carousel, setCarousel] = useState<CarouselInstance | null>(null);\n const renderCount = useRefreshInstance(carousel, events);\n\n const proxiedCarousel = useMemo(\n () => (carousel ? new Proxy(carousel, { _t: renderCount } as unknown as ProxyHandler<CarouselInstance>) : carousel),\n [carousel, renderCount],\n );\n\n return [proxiedCarousel, setCarousel] as const;\n}\n\n/**\n * Hook to obtain CarouselInstance inside the Carousel component\n */\nexport function useCarousel(events?: (keyof SwiperEvents)[]) {\n const carousel = useSwiper();\n const renderCount = useRefreshInstance(carousel, events);\n\n return useMemo(\n () =>\n carousel\n ? (new Proxy(carousel, { _t: renderCount } as unknown as ProxyHandler<CarouselInstance>) as CarouselInstance)\n : carousel,\n [carousel, renderCount],\n );\n}\n\n/**\n * Internal hook that forces re-renders on events like slideChange, so the carousel.realIndex is correct\n * https://github.com/nolimits4web/swiper/issues/5577\n */\nfunction useRefreshInstance(carousel: CarouselInstance, events?: (keyof SwiperEvents)[]): number {\n // force re-render\n const [renderCount, setRerender] = useState(0);\n useEffect(() => {\n if (carousel) {\n // subscribe to carousel events to trigger re-render\n // https://swiperjs.com/swiper-api#events\n (\n events ?? [\n 'slideChange',\n 'afterInit',\n 'reachBeginning',\n 'reachEnd',\n 'fromEdge',\n 'autoplayStart',\n 'autoplayStop',\n 'lock',\n 'unlock',\n ]\n ).forEach((evt: keyof SwiperEvents) => {\n carousel.on(evt, () => {\n setRerender((t) => t + 1);\n });\n });\n }\n }, [carousel]);\n // once everything is rendered, make sure to re-render to have proper data (initialization)\n useLayoutEffect(() => {\n setRerender((t) => t + 1);\n }, []);\n\n return renderCount;\n}\n\n/**\n * Manage peek effect in the Carousel by adding classes to the Carousel instance\n */\nexport function useCarouselPeekEffect(carousel: CarouselInstance) {\n const [peek, setPeek] = useState<'prev' | 'next' | 'reset' | null>(null);\n const peekTimeout = useRef<NodeJS.Timeout | null>(null);\n const [disabled, setDisabled] = useState<boolean>(false);\n\n useEffect(() => {\n if (peek === 'reset') {\n carousel?.el?.classList.remove('peek-prev');\n carousel?.el?.classList.remove('peek-next');\n peekTimeout.current = setTimeout(\n () => {\n setPeek(null);\n },\n +(carousel?.el?.dataset?.peekspeed ?? 150),\n ); // matches transitionDuration in the Carousel\n } else if (peek) {\n if (!disabled) {\n // make sure prev/next slide is visible (loop)\n carousel?.slideReset(0);\n if (peek === 'prev') {\n carousel?.slidePrev(0);\n carousel?.slideNext(0);\n } else {\n carousel?.slideNext(0);\n carousel?.slidePrev(0);\n }\n carousel?.el?.classList.add('peeking');\n carousel?.el?.classList.add(`peek-${peek}`);\n }\n } else {\n carousel?.el?.classList.remove('peeking');\n carousel?.el?.classList.remove('peek-prev');\n carousel?.el?.classList.remove('peek-next');\n }\n\n return () => {\n if (peekTimeout.current) {\n clearTimeout(peekTimeout.current);\n }\n };\n }, [peek]);\n\n /**\n * Watch carousel instance\n */\n useEffect(() => {\n // once carousel is being dragged, reset and disable peek effect\n carousel?.on('touchStart', () => {\n setPeek('reset');\n setDisabled(true);\n });\n carousel?.on('touchEnd', () => {\n setPeek('reset');\n setDisabled(false);\n });\n }, [!!carousel]);\n\n return [peek, setPeek] as const;\n}\n"],"names":["useCarouselInstance","events","carousel","setCarousel","useState","renderCount","useRefreshInstance","useMemo","Proxy","_t","useCarousel","useSwiper","setRerender","useEffect","forEach","evt","on","t","useLayoutEffect","useCarouselPeekEffect","peek","setPeek","peekTimeout","useRef","disabled","setDisabled","el","classList","remove","current","setTimeout","dataset","peekspeed","slideReset","slidePrev","slideNext","add","clearTimeout"],"mappings":"uIAQM,SAAUA,EAAoBC,GAClC,MAAOC,EAAUC,GAAeC,EAAkC,MAC5DC,EAAcC,EAAmBJ,EAAUD,GAOjD,MAAO,CALiBM,EACtB,IAAOL,EAAW,IAAIM,MAAMN,EAAU,CAAEO,GAAIJ,IAA8DH,EAC1G,CAACA,EAAUG,IAGYF,EAC3B,CAKM,SAAUO,EAAYT,GAC1B,MAAMC,EAAWS,IACXN,EAAcC,EAAmBJ,EAAUD,GAEjD,OAAOM,EACL,IACEL,EACK,IAAIM,MAAMN,EAAU,CAAEO,GAAIJ,IAC3BH,EACN,CAACA,EAAUG,GAEf,CAMA,SAASC,EAAmBJ,EAA4BD,GAEtD,MAAOI,EAAaO,GAAeR,EAAS,GA6B5C,OA5BAS,EAAU,KACJX,IAIAD,GAAU,CACR,cACA,YACA,iBACA,WACA,WACA,gBACA,eACA,OACA,WAEFa,QAASC,IACTb,EAASc,GAAGD,EAAK,KACfH,EAAaK,GAAMA,EAAI,QAI5B,CAACf,IAEJgB,EAAgB,KACdN,EAAaK,GAAMA,EAAI,IACtB,IAEIZ,CACT,CAKM,SAAUc,EAAsBjB,GACpC,MAAOkB,EAAMC,GAAWjB,EAA2C,MAC7DkB,EAAcC,EAA8B,OAC3CC,EAAUC,GAAerB,GAAkB,GAsDlD,OApDAS,EAAU,KACK,UAATO,GACFlB,GAAUwB,IAAIC,UAAUC,OAAO,aAC/B1B,GAAUwB,IAAIC,UAAUC,OAAO,aAC/BN,EAAYO,QAAUC,WACpB,KACET,EAAQ,SAERnB,GAAUwB,IAAIK,SAASC,WAAa,OAE/BZ,EACJI,IAEHtB,GAAU+B,WAAW,GACR,SAATb,GACFlB,GAAUgC,UAAU,GACpBhC,GAAUiC,UAAU,KAEpBjC,GAAUiC,UAAU,GACpBjC,GAAUgC,UAAU,IAEtBhC,GAAUwB,IAAIC,UAAUS,IAAI,WAC5BlC,GAAUwB,IAAIC,UAAUS,IAAI,QAAQhB,OAGtClB,GAAUwB,IAAIC,UAAUC,OAAO,WAC/B1B,GAAUwB,IAAIC,UAAUC,OAAO,aAC/B1B,GAAUwB,IAAIC,UAAUC,OAAO,cAG1B,KACDN,EAAYO,SACdQ,aAAaf,EAAYO,WAG5B,CAACT,IAKJP,EAAU,KAERX,GAAUc,GAAG,aAAc,KACzBK,EAAQ,SACRI,GAAY,KAEdvB,GAAUc,GAAG,WAAY,KACvBK,EAAQ,SACRI,GAAY,MAEb,GAAGvB,IAEC,CAACkB,EAAMC,EAChB"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { BoxProps } from '@mui/material';
3
+ export interface CodeProps extends BoxProps<'code'> {
4
+ }
5
+ /**
6
+ * Inline or block code rendered as a styled `<code>` element
7
+ */
8
+ export declare const Code: React.FC<CodeProps>;
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{forwardRef as o}from"react";import{Box as m}from"@mui/material";const t=o((o,t)=>r(m,{ref:t,component:"code",...o}));export{t as Code};
2
+ //# sourceMappingURL=Code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Code.js","sources":["../../../src/components/code/Code.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Box, BoxProps } from '@mui/material';\n\nexport interface CodeProps extends BoxProps<'code'> {}\n\n/**\n * Inline or block code rendered as a styled `<code>` element\n */\nexport const Code: React.FC<CodeProps> = forwardRef((props, ref) => <Box ref={ref} component=\"code\" {...props} />);\n"],"names":["Code","forwardRef","props","ref","_jsx","Box","component"],"mappings":"+GAQO,MAAMA,EAA4BC,EAAW,CAACC,EAAOC,IAAQC,EAACC,EAAG,CAACF,IAAKA,EAAKG,UAAU,UAAWJ"}
@@ -0,0 +1 @@
1
+ export * from './Code';
@@ -1,2 +1,2 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Box as r,Typography as o}from"@mui/material";import{forwardRef as i}from"react";import{sxOverride as s}from"../../utils/sxOverride/sxOverride.js";const n=i(({sx:i,children:n,status:a,message:c,actions:d,description:p,stacktrace:l,statusProps:m,messageProps:x,descriptionProps:f,actionsProps:h,stacktraceProps:u,...g},y)=>{const{sx:C,...v}=h??{},{sx:E,...P}=u??{};return t(r,{sx:s({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:{xs:2,md:4},textAlign:"center",margin:"0 auto",width:"600px",maxWidth:"100%",p:2},i),ref:y,...g,children:[a&&e(o,{component:"h1",variant:"display","data-testid":"ErrorContent.status",...m,children:a}),c&&e(o,{component:"h2",variant:"h3","data-testid":"ErrorContent.message",...x,children:c}),p&&e(o,{"data-testid":"ErrorContent.description",...f,children:p}),n,d&&e(r,{sx:s({display:"flex",gap:1,flexDirection:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"center"},C),"data-testid":"ErrorContent.actions",...v,children:d}),l&&e(r,{component:"code",sx:s({display:"block",border:1,borderColor:"divider",whiteSpace:"pre",overflow:"auto",py:1,px:2,borderRadius:"8px",fontFamily:"monospace",fontSize:"11px",lineHeight:"18px",textAlign:"left",alignSelf:"stretch"},E),"data-testid":"ErrorContent.stacktrace",...P,children:l})]})});export{n as ErrorContent};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Box as r,Typography as s}from"@mui/material";import{forwardRef as o}from"react";import{sxOverride as i}from"../../utils/sxOverride/sxOverride.js";const n=o(({sx:o,children:n,status:a,message:c,actions:d,description:l,stacktrace:p,statusProps:m,messageProps:x,descriptionProps:f,actionsProps:h,stacktraceProps:u,...g},C)=>{const{sx:y,...v}=h??{},{sx:E,...P}=u??{};return t(r,{sx:i({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:{xs:2,md:4},textAlign:"center",margin:"0 auto",width:"600px",maxWidth:"100%",p:2},o),ref:C,...g,children:[a&&e(s,{component:"h1",variant:"display","data-testid":"ErrorContent.status",...m,children:a}),c&&e(s,{component:"h2",variant:"h3","data-testid":"ErrorContent.message",...x,children:c}),l&&e(s,{"data-testid":"ErrorContent.description",...f,children:l}),n,d&&e(r,{sx:i({display:"flex",gap:1,flexDirection:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"center"},y),"data-testid":"ErrorContent.actions",...v,children:d}),p&&e(r,{component:"code",sx:i({display:"block",border:1,borderColor:"divider",overflow:"auto",py:1,px:2,borderRadius:"8px",textAlign:"left",alignSelf:"stretch"},E),"data-testid":"ErrorContent.stacktrace",...P,children:p})]})});export{n as ErrorContent};
2
2
  //# sourceMappingURL=ErrorContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorContent.js","sources":["../../../src/components/errorContent/ErrorContent.tsx"],"sourcesContent":["import { Box, BoxProps, Typography, TypographyProps } from '@mui/material';\nimport React, { ElementType, FC, forwardRef, ReactNode } from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface ErrorContentProps extends BoxProps<ElementType> {\n /**\n * Error Status code, eg. 404 or 500\n */\n status?: ReactNode;\n /**\n * Short message describing the error\n */\n message?: ReactNode;\n /**\n * Longer description of the error\n */\n description?: ReactNode;\n /**\n * Actions that user can interact with\n */\n actions?: ReactNode;\n /**\n * Stacktrace of an error\n */\n stacktrace?: ReactNode;\n /**\n * Properties passed to status code\n */\n statusProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to message\n */\n messageProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to description\n */\n descriptionProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to wrapper of actions\n */\n actionsProps?: BoxProps<ElementType>;\n /**\n * Properties passed to code stacktrace\n */\n stacktraceProps?: BoxProps<ElementType>;\n}\n\n/**\n * Component that renders an information about error\n */\nexport const ErrorContent: FC<ErrorContentProps> = forwardRef(\n (\n {\n sx,\n children,\n status,\n message,\n actions,\n description,\n stacktrace,\n statusProps,\n messageProps,\n descriptionProps,\n actionsProps,\n stacktraceProps,\n ...rest\n },\n ref,\n ) => {\n const { sx: actionsSx, ...restActions } = actionsProps ?? {};\n const { sx: stacktraceSx, ...restStacktrace } = stacktraceProps ?? {};\n\n return (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: { xs: 2, md: 4 },\n textAlign: 'center',\n margin: '0 auto',\n width: '600px',\n maxWidth: '100%',\n p: 2,\n },\n sx,\n )}\n ref={ref}\n {...rest}\n >\n {status && (\n <Typography component=\"h1\" variant=\"display\" data-testid=\"ErrorContent.status\" {...statusProps}>\n {status}\n </Typography>\n )}\n {message && (\n <Typography component=\"h2\" variant=\"h3\" data-testid=\"ErrorContent.message\" {...messageProps}>\n {message}\n </Typography>\n )}\n {description && (\n <Typography data-testid=\"ErrorContent.description\" {...descriptionProps}>\n {description}\n </Typography>\n )}\n {children}\n {actions && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n gap: 1,\n flexDirection: { xs: 'column', md: 'row' },\n alignItems: { xs: 'stretch', md: 'center' },\n justifyContent: 'center',\n },\n actionsSx,\n )}\n data-testid=\"ErrorContent.actions\"\n {...restActions}\n >\n {actions}\n </Box>\n )}\n {stacktrace && (\n <Box\n component=\"code\"\n sx={sxOverride(\n {\n display: 'block',\n border: 1,\n borderColor: 'divider',\n whiteSpace: 'pre',\n overflow: 'auto',\n py: 1,\n px: 2,\n borderRadius: '8px',\n fontFamily: 'monospace',\n fontSize: '11px',\n lineHeight: '18px',\n textAlign: 'left',\n alignSelf: 'stretch',\n },\n stacktraceSx,\n )}\n data-testid=\"ErrorContent.stacktrace\"\n {...restStacktrace}\n >\n {stacktrace}\n </Box>\n )}\n </Box>\n );\n },\n);\n"],"names":["ErrorContent","forwardRef","sx","children","status","message","actions","description","stacktrace","statusProps","messageProps","descriptionProps","actionsProps","stacktraceProps","rest","ref","actionsSx","restActions","stacktraceSx","restStacktrace","_jsxs","Box","sxOverride","display","flexDirection","alignItems","justifyContent","gap","xs","md","textAlign","margin","width","maxWidth","p","_jsx","Typography","component","variant","border","borderColor","whiteSpace","overflow","py","px","borderRadius","fontFamily","fontSize","lineHeight","alignSelf"],"mappings":"2MAkDO,MAAMA,EAAsCC,EACjD,EAEIC,KACAC,WACAC,SACAC,UACAC,UACAC,cACAC,aACAC,cACAC,eACAC,mBACAC,eACAC,qBACGC,GAELC,KAEA,MAAQb,GAAIc,KAAcC,GAAgBL,GAAgB,CAAA,GAClDV,GAAIgB,KAAiBC,GAAmBN,GAAmB,CAAA,EAEnE,OACEO,EAACC,GACCnB,GAAIoB,EACF,CACEC,QAAS,OACTC,cAAe,SACfC,WAAY,SACZC,eAAgB,SAChBC,IAAK,CAAEC,GAAI,EAAGC,GAAI,GAClBC,UAAW,SACXC,OAAQ,SACRC,MAAO,QACPC,SAAU,OACVC,EAAG,GAELhC,GAEFa,IAAKA,KACDD,EAAIX,SAAA,CAEPC,GACC+B,EAACC,EAAU,CAACC,UAAU,KAAKC,QAAQ,UAAS,cAAa,yBAA0B7B,EAAWN,SAC3FC,IAGJC,GACC8B,EAACC,GAAWC,UAAU,KAAKC,QAAQ,KAAI,cAAa,0BAA2B5B,EAAYP,SACxFE,IAGJE,GACC4B,EAACC,EAAU,CAAA,cAAa,8BAA+BzB,EAAgBR,SACpEI,IAGJJ,EACAG,GACC6B,EAACd,GACCnB,GAAIoB,EACF,CACEC,QAAS,OACTI,IAAK,EACLH,cAAe,CAAEI,GAAI,SAAUC,GAAI,OACnCJ,WAAY,CAAEG,GAAI,UAAWC,GAAI,UACjCH,eAAgB,UAElBV,GACD,cACW,0BACRC,EAAWd,SAEdG,IAGJE,GACC2B,EAACd,EAAG,CACFgB,UAAU,OACVnC,GAAIoB,EACF,CACEC,QAAS,QACTgB,OAAQ,EACRC,YAAa,UACbC,WAAY,MACZC,SAAU,OACVC,GAAI,EACJC,GAAI,EACJC,aAAc,MACdC,WAAY,YACZC,SAAU,OACVC,WAAY,OACZlB,UAAW,OACXmB,UAAW,WAEb/B,GACD,cACW,6BACRC,EAAchB,SAEjBK"}
1
+ {"version":3,"file":"ErrorContent.js","sources":["../../../src/components/errorContent/ErrorContent.tsx"],"sourcesContent":["import { Box, BoxProps, Typography, TypographyProps } from '@mui/material';\nimport React, { ElementType, FC, forwardRef, ReactNode } from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface ErrorContentProps extends BoxProps<ElementType> {\n /**\n * Error Status code, eg. 404 or 500\n */\n status?: ReactNode;\n /**\n * Short message describing the error\n */\n message?: ReactNode;\n /**\n * Longer description of the error\n */\n description?: ReactNode;\n /**\n * Actions that user can interact with\n */\n actions?: ReactNode;\n /**\n * Stacktrace of an error\n */\n stacktrace?: ReactNode;\n /**\n * Properties passed to status code\n */\n statusProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to message\n */\n messageProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to description\n */\n descriptionProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to wrapper of actions\n */\n actionsProps?: BoxProps<ElementType>;\n /**\n * Properties passed to code stacktrace\n */\n stacktraceProps?: BoxProps<ElementType>;\n}\n\n/**\n * Component that renders an information about error\n */\nexport const ErrorContent: FC<ErrorContentProps> = forwardRef(\n (\n {\n sx,\n children,\n status,\n message,\n actions,\n description,\n stacktrace,\n statusProps,\n messageProps,\n descriptionProps,\n actionsProps,\n stacktraceProps,\n ...rest\n },\n ref,\n ) => {\n const { sx: actionsSx, ...restActions } = actionsProps ?? {};\n const { sx: stacktraceSx, ...restStacktrace } = stacktraceProps ?? {};\n\n return (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: { xs: 2, md: 4 },\n textAlign: 'center',\n margin: '0 auto',\n width: '600px',\n maxWidth: '100%',\n p: 2,\n },\n sx,\n )}\n ref={ref}\n {...rest}\n >\n {status && (\n <Typography component=\"h1\" variant=\"display\" data-testid=\"ErrorContent.status\" {...statusProps}>\n {status}\n </Typography>\n )}\n {message && (\n <Typography component=\"h2\" variant=\"h3\" data-testid=\"ErrorContent.message\" {...messageProps}>\n {message}\n </Typography>\n )}\n {description && (\n <Typography data-testid=\"ErrorContent.description\" {...descriptionProps}>\n {description}\n </Typography>\n )}\n {children}\n {actions && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n gap: 1,\n flexDirection: { xs: 'column', md: 'row' },\n alignItems: { xs: 'stretch', md: 'center' },\n justifyContent: 'center',\n },\n actionsSx,\n )}\n data-testid=\"ErrorContent.actions\"\n {...restActions}\n >\n {actions}\n </Box>\n )}\n {stacktrace && (\n <Box\n component=\"code\"\n sx={sxOverride(\n {\n display: 'block',\n border: 1,\n borderColor: 'divider',\n overflow: 'auto',\n py: 1,\n px: 2,\n borderRadius: '8px',\n textAlign: 'left',\n alignSelf: 'stretch',\n },\n stacktraceSx,\n )}\n data-testid=\"ErrorContent.stacktrace\"\n {...restStacktrace}\n >\n {stacktrace}\n </Box>\n )}\n </Box>\n );\n },\n);\n"],"names":["ErrorContent","forwardRef","sx","children","status","message","actions","description","stacktrace","statusProps","messageProps","descriptionProps","actionsProps","stacktraceProps","rest","ref","actionsSx","restActions","stacktraceSx","restStacktrace","_jsxs","Box","sxOverride","display","flexDirection","alignItems","justifyContent","gap","xs","md","textAlign","margin","width","maxWidth","p","_jsx","Typography","component","variant","border","borderColor","overflow","py","px","borderRadius","alignSelf"],"mappings":"2MAkDO,MAAMA,EAAsCC,EACjD,EAEIC,KACAC,WACAC,SACAC,UACAC,UACAC,cACAC,aACAC,cACAC,eACAC,mBACAC,eACAC,qBACGC,GAELC,KAEA,MAAQb,GAAIc,KAAcC,GAAgBL,GAAgB,CAAA,GAClDV,GAAIgB,KAAiBC,GAAmBN,GAAmB,CAAA,EAEnE,OACEO,EAACC,GACCnB,GAAIoB,EACF,CACEC,QAAS,OACTC,cAAe,SACfC,WAAY,SACZC,eAAgB,SAChBC,IAAK,CAAEC,GAAI,EAAGC,GAAI,GAClBC,UAAW,SACXC,OAAQ,SACRC,MAAO,QACPC,SAAU,OACVC,EAAG,GAELhC,GAEFa,IAAKA,KACDD,EAAIX,SAAA,CAEPC,GACC+B,EAACC,EAAU,CAACC,UAAU,KAAKC,QAAQ,UAAS,cAAa,yBAA0B7B,EAAWN,SAC3FC,IAGJC,GACC8B,EAACC,GAAWC,UAAU,KAAKC,QAAQ,KAAI,cAAa,0BAA2B5B,EAAYP,SACxFE,IAGJE,GACC4B,EAACC,EAAU,CAAA,cAAa,8BAA+BzB,EAAgBR,SACpEI,IAGJJ,EACAG,GACC6B,EAACd,GACCnB,GAAIoB,EACF,CACEC,QAAS,OACTI,IAAK,EACLH,cAAe,CAAEI,GAAI,SAAUC,GAAI,OACnCJ,WAAY,CAAEG,GAAI,UAAWC,GAAI,UACjCH,eAAgB,UAElBV,GACD,cACW,0BACRC,EAAWd,SAEdG,IAGJE,GACC2B,EAACd,EAAG,CACFgB,UAAU,OACVnC,GAAIoB,EACF,CACEC,QAAS,QACTgB,OAAQ,EACRC,YAAa,UACbC,SAAU,OACVC,GAAI,EACJC,GAAI,EACJC,aAAc,MACdd,UAAW,OACXe,UAAW,WAEb3B,GACD,cACW,6BACRC,EAAchB,SAEjBK"}
@@ -3,6 +3,6 @@ import { IconButtonProps } from '@mui/material';
3
3
  export interface FooterIconButtonProps extends IconButtonProps<ElementType> {
4
4
  }
5
5
  /**
6
- * Section for the main links
6
+ * IconButton for the footer, can be used for social media
7
7
  */
8
8
  export declare const FooterIconButton: FC<FooterIconButtonProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"FooterIconButton.js","sources":["../../../src/components/footer/FooterIconButton.tsx"],"sourcesContent":["import React, { ElementType, FC, ForwardedRef, forwardRef } from 'react';\nimport { IconButton, IconButtonProps } from '@mui/material';\n\nexport interface FooterIconButtonProps extends IconButtonProps<ElementType> {}\n\n/**\n * Section for the main links\n */\nexport const FooterIconButton: FC<FooterIconButtonProps> = forwardRef(({ children, ...rest }, ref) => {\n return (\n <IconButton\n size=\"medium\"\n color=\"white\"\n ref={ref as ForwardedRef<HTMLButtonElement>}\n data-testid=\"FooterIconButton\"\n {...rest}\n >\n {children}\n </IconButton>\n );\n});\n"],"names":["FooterIconButton","forwardRef","children","rest","ref","_jsx","IconButton","size","color"],"mappings":"sHAQO,MAAMA,EAA8CC,EAAW,EAAGC,cAAaC,GAAQC,IAE1FC,EAACC,EAAU,CACTC,KAAK,SACLC,MAAM,QACNJ,IAAKA,EAAsC,cAC/B,sBACRD,EAAID,SAEPA"}
1
+ {"version":3,"file":"FooterIconButton.js","sources":["../../../src/components/footer/FooterIconButton.tsx"],"sourcesContent":["import React, { ElementType, FC, ForwardedRef, forwardRef } from 'react';\nimport { IconButton, IconButtonProps } from '@mui/material';\n\nexport interface FooterIconButtonProps extends IconButtonProps<ElementType> {}\n\n/**\n * IconButton for the footer, can be used for social media\n */\nexport const FooterIconButton: FC<FooterIconButtonProps> = forwardRef(({ children, ...rest }, ref) => {\n return (\n <IconButton\n size=\"medium\"\n color=\"white\"\n ref={ref as ForwardedRef<HTMLButtonElement>}\n data-testid=\"FooterIconButton\"\n {...rest}\n >\n {children}\n </IconButton>\n );\n});\n"],"names":["FooterIconButton","forwardRef","children","rest","ref","_jsx","IconButton","size","color"],"mappings":"sHAQO,MAAMA,EAA8CC,EAAW,EAAGC,cAAaC,GAAQC,IAE1FC,EAACC,EAAU,CACTC,KAAK,SACLC,MAAM,QACNJ,IAAKA,EAAsC,cAC/B,sBACRD,EAAID,SAEPA"}
@@ -1,2 +1,2 @@
1
- import{jsx as o}from"react/jsx-runtime";import{forwardRef as r,useState as e}from"react";import{useTheme as t,useMediaQuery as n}from"@mui/material";import{FooterAccordion as a}from"./FooterAccordion.js";import{sxOverride as i}from"../../utils/sxOverride/sxOverride.js";const s=r(({sx:r,children:s,label:d,accordionSummaryProps:c,contentProps:p,variant:l="auto",...m},u)=>{const{sx:x,...f}=p??{},{sx:y,...b}=c??{},g=t(),h=n(g.breakpoints.down("lg")),v="auto"===l?h:"accordion"===l,[M,S]=e(!1);return o(a,{ref:u,"data-testid":"FooterMenu",expanded:!v||M,onChange:(o,r)=>S(r),variant:"standard",sx:i({flexBasis:{lg:"20%"},borderColor:"onSurface.os700",...!v&&{border:"none"}},r),accordionSummaryProps:{"data-testid":"FooterMenu.label",sx:i({padding:"14px 0","& .MuiLink-root":{...g.typography.subheadline,p:0,"&, &:hover":{textDecoration:"none",color:"common.white"}},...!v&&{padding:"18px 0 8px",overflow:"visible","&&:not(.Mui-disabled)":{cursor:"unset"},"& .MuiAccordionSummary-expandIconWrapper":{display:"none"}}},y),...b},label:d,contentProps:{component:"div","data-testid":"FooterMenu.content",sx:i({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",flexDirection:"column",gap:1.5,"& .MuiLink-root":{...g.typography.caption2,p:0,"&, &:hover":{textDecoration:"none",color:"onSurface.os200"}}},x),...f},...m,children:s},`${v}`)});export{s as FooterMenu};
1
+ import{jsx as o}from"react/jsx-runtime";import{forwardRef as r,useState as t}from"react";import{FooterAccordion as e}from"./FooterAccordion.js";import{FooterMenuCollapse as n}from"./FooterMenuCollapse.js";import{sxOverride as a}from"../../utils/sxOverride/sxOverride.js";const i=r(({sx:r,children:i,label:s,accordionSummaryProps:c,contentProps:d,variant:p="auto",...l},u)=>{const{sx:m,...x}=d??{},{sx:f,...y}=c??{},b=o=>"list"===p?"&":o.breakpoints.up("lg"),[g,h]=t(!1);return o(e,{ref:u,"data-testid":"FooterMenu",expanded:"list"===p||g,onChange:(o,r)=>h(r),variant:"standard",..."auto"===p&&{slots:{transition:n}},sx:a(o=>({flexBasis:{lg:"20%"},borderColor:"onSurface.os700",..."accordion"!==p&&{[b(o)]:{border:"none"}}}),r),accordionSummaryProps:{"data-testid":"FooterMenu.label",sx:a(o=>({padding:"14px 0","& .MuiLink-root":{...o.typography.subheadline,p:0,"&, &:hover":{textDecoration:"none",color:"common.white"}},..."accordion"!==p&&{[b(o)]:{padding:"18px 0 8px",overflow:"visible","&&:not(.Mui-disabled)":{cursor:"unset"},"& .MuiAccordionSummary-expandIconWrapper":{display:"none"}}}}),f),...y},label:s,contentProps:{component:"div","data-testid":"FooterMenu.content",sx:a(o=>({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",flexDirection:"column",gap:1.5,"& .MuiLink-root":{...o.typography.caption2,p:0,"&, &:hover":{textDecoration:"none",color:"onSurface.os200"}}}),m),...x},...l,children:i})});export{i as FooterMenu};
2
2
  //# sourceMappingURL=FooterMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FooterMenu.js","sources":["../../../src/components/footer/FooterMenu.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState } from 'react';\nimport { Theme, useMediaQuery, useTheme } from '@mui/material';\nimport { FooterAccordion, FooterAccordionProps } from './FooterAccordion';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface FooterMenuProps extends Omit<FooterAccordionProps, 'variant' | 'children'> {\n /**\n * Items in the menu\n */\n children?: React.ReactNode;\n /**\n * Variant of the menu\n * - auto: renders on large resolution as list and on mobile as accordion\n * - list: renders as list with title\n * - accordion: renders as collapsible accordion\n * @default auto\n */\n variant?: 'auto' | 'list' | 'accordion';\n}\n\n/**\n * Section for the secondary links, copyright and optional button\n */\nexport const FooterMenu: FC<FooterMenuProps> = forwardRef(\n ({ sx, children, label, accordionSummaryProps, contentProps, variant = 'auto', ...rest }, ref) => {\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: accSummarySx, ...restAccSummary } = accordionSummaryProps ?? {};\n const theme = useTheme();\n const downLg = useMediaQuery<Theme>(theme.breakpoints.down('lg'));\n const isAccordion = variant === 'auto' ? downLg : variant === 'accordion';\n const [expanded, setExpanded] = useState(false);\n\n return (\n <FooterAccordion\n key={`${isAccordion}`}\n ref={ref}\n data-testid=\"FooterMenu\"\n expanded={isAccordion ? expanded : true}\n onChange={(_, v) => setExpanded(v)}\n variant=\"standard\"\n sx={sxOverride(\n {\n // spacing in the FooterSectionMenu, take max 1/5 of space\n flexBasis: { lg: '20%' },\n borderColor: 'onSurface.os700',\n ...(!isAccordion && {\n border: 'none',\n }),\n },\n sx,\n )}\n accordionSummaryProps={{\n ['data-testid']: 'FooterMenu.label',\n sx: sxOverride(\n {\n // adjust proportions\n padding: '14px 0',\n // manipulates style of links inside\n '& .MuiLink-root': {\n ...theme.typography.subheadline,\n p: 0,\n '&, &:hover': {\n textDecoration: 'none',\n color: 'common.white',\n },\n },\n ...(!isAccordion && {\n // adjust proportions to be closer to menu\n padding: '18px 0 8px',\n // allow overflow of focus ring\n overflow: 'visible',\n // no longer clickable\n '&&:not(.Mui-disabled)': {\n cursor: 'unset',\n },\n // hide icon\n '& .MuiAccordionSummary-expandIconWrapper': {\n display: 'none',\n },\n }),\n },\n accSummarySx,\n ),\n ...restAccSummary,\n }}\n label={label}\n contentProps={{\n component: 'div',\n ['data-testid']: 'FooterMenu.content',\n sx: sxOverride(\n {\n display: 'flex',\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n flexDirection: 'column',\n gap: 1.5,\n // manipulates style of links inside\n '& .MuiLink-root': {\n ...theme.typography.caption2,\n p: 0,\n '&, &:hover': {\n textDecoration: 'none',\n color: 'onSurface.os200',\n },\n },\n },\n contentSx,\n ),\n ...restContent,\n }}\n {...rest}\n >\n {children}\n </FooterAccordion>\n );\n },\n);\n"],"names":["FooterMenu","forwardRef","sx","children","label","accordionSummaryProps","contentProps","variant","rest","ref","contentSx","restContent","accSummarySx","restAccSummary","theme","useTheme","downLg","useMediaQuery","breakpoints","down","isAccordion","expanded","setExpanded","useState","_jsx","FooterAccordion","onChange","_","v","sxOverride","flexBasis","lg","borderColor","border","padding","typography","subheadline","p","textDecoration","color","overflow","cursor","display","component","alignItems","justifyContent","flexDirection","gap","caption2"],"mappings":"8QAuBO,MAAMA,EAAkCC,EAC7C,EAAGC,KAAIC,WAAUC,QAAOC,wBAAuBC,eAAcC,UAAU,UAAWC,GAAQC,KACxF,MAAQP,GAAIQ,KAAcC,GAAgBL,GAAgB,CAAA,GAClDJ,GAAIU,KAAiBC,GAAmBR,GAAyB,CAAA,EACnES,EAAQC,IACRC,EAASC,EAAqBH,EAAMI,YAAYC,KAAK,OACrDC,EAA0B,SAAZb,EAAqBS,EAAqB,cAAZT,GAC3Cc,EAAUC,GAAeC,GAAS,GAEzC,OACEC,EAACC,GAEChB,IAAKA,EAAG,cACI,aACZY,UAAUD,GAAcC,EACxBK,SAAU,CAACC,EAAGC,IAAMN,EAAYM,GAChCrB,QAAQ,WACRL,GAAI2B,EACF,CAEEC,UAAW,CAAEC,GAAI,OACjBC,YAAa,sBACRZ,GAAe,CAClBa,OAAQ,SAGZ/B,GAEFG,sBAAuB,CACrB,cAAiB,mBACjBH,GAAI2B,EACF,CAEEK,QAAS,SAET,kBAAmB,IACdpB,EAAMqB,WAAWC,YACpBC,EAAG,EACH,aAAc,CACZC,eAAgB,OAChBC,MAAO,qBAGNnB,GAAe,CAElBc,QAAS,aAETM,SAAU,UAEV,wBAAyB,CACvBC,OAAQ,SAGV,2CAA4C,CAC1CC,QAAS,UAIf9B,MAECC,GAELT,MAAOA,EACPE,aAAc,CACZqC,UAAW,MACX,cAAiB,qBACjBzC,GAAI2B,EACF,CACEa,QAAS,OACTE,WAAY,aACZC,eAAgB,aAChBC,cAAe,SACfC,IAAK,IAEL,kBAAmB,IACdjC,EAAMqB,WAAWa,SACpBX,EAAG,EACH,aAAc,CACZC,eAAgB,OAChBC,MAAO,qBAIb7B,MAECC,MAEDH,WAEHL,GA9EI,GAAGiB"}
1
+ {"version":3,"file":"FooterMenu.js","sources":["../../../src/components/footer/FooterMenu.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState } from 'react';\nimport { Theme } from '@mui/material';\nimport { FooterAccordion, FooterAccordionProps } from './FooterAccordion';\nimport { FooterMenuCollapse } from './FooterMenuCollapse';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface FooterMenuProps extends Omit<FooterAccordionProps, 'variant' | 'children'> {\n /**\n * Items in the menu\n */\n children?: React.ReactNode;\n /**\n * Variant of the menu\n * - auto: renders on large resolution as list and on mobile as accordion\n * - list: renders as list with title\n * - accordion: renders as collapsible accordion\n * @default auto\n */\n variant?: 'auto' | 'list' | 'accordion';\n}\n\n/**\n * Section for the secondary links, copyright and optional button\n */\nexport const FooterMenu: FC<FooterMenuProps> = forwardRef(\n ({ sx, children, label, accordionSummaryProps, contentProps, variant = 'auto', ...rest }, ref) => {\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: accSummarySx, ...restAccSummary } = accordionSummaryProps ?? {};\n // variant is static, so no media query is needed (renders correctly during pre-render);\n // for auto, the desktop \"list\" look is applied from the lg breakpoint up, always for list\n const listLookSelector = (theme: Theme) => (variant === 'list' ? '&' : theme.breakpoints.up('lg'));\n const [expanded, setExpanded] = useState(false);\n\n return (\n <FooterAccordion\n ref={ref}\n data-testid=\"FooterMenu\"\n expanded={variant === 'list' ? true : expanded}\n onChange={(_, v) => setExpanded(v)}\n variant=\"standard\"\n {...(variant === 'auto' && { slots: { transition: FooterMenuCollapse } })}\n sx={sxOverride(\n (theme) => ({\n // spacing in the FooterSectionMenu, take max 1/5 of space\n flexBasis: { lg: '20%' },\n borderColor: 'onSurface.os700',\n ...(variant !== 'accordion' && {\n [listLookSelector(theme)]: { border: 'none' },\n }),\n }),\n sx,\n )}\n accordionSummaryProps={{\n ['data-testid']: 'FooterMenu.label',\n sx: sxOverride(\n (theme) => ({\n // adjust proportions\n padding: '14px 0',\n // manipulates style of links inside\n '& .MuiLink-root': {\n ...theme.typography.subheadline,\n p: 0,\n '&, &:hover': {\n textDecoration: 'none',\n color: 'common.white',\n },\n },\n // non-collapsible \"list\" appearance (always for list, desktop+ for auto)\n ...(variant !== 'accordion' && {\n [listLookSelector(theme)]: {\n // adjust proportions to be closer to menu\n padding: '18px 0 8px',\n // allow overflow of focus ring\n overflow: 'visible',\n // no longer clickable\n '&&:not(.Mui-disabled)': {\n cursor: 'unset',\n },\n // hide icon\n '& .MuiAccordionSummary-expandIconWrapper': {\n display: 'none',\n },\n },\n }),\n }),\n accSummarySx,\n ),\n ...restAccSummary,\n }}\n label={label}\n contentProps={{\n component: 'div',\n ['data-testid']: 'FooterMenu.content',\n sx: sxOverride(\n (theme) => ({\n display: 'flex',\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n flexDirection: 'column',\n gap: 1.5,\n // manipulates style of links inside\n '& .MuiLink-root': {\n ...theme.typography.caption2,\n p: 0,\n '&, &:hover': {\n textDecoration: 'none',\n color: 'onSurface.os200',\n },\n },\n }),\n contentSx,\n ),\n ...restContent,\n }}\n {...rest}\n >\n {children}\n </FooterAccordion>\n );\n },\n);\n"],"names":["FooterMenu","forwardRef","sx","children","label","accordionSummaryProps","contentProps","variant","rest","ref","contentSx","restContent","accSummarySx","restAccSummary","listLookSelector","theme","breakpoints","up","expanded","setExpanded","useState","_jsx","FooterAccordion","onChange","_","v","slots","transition","FooterMenuCollapse","sxOverride","flexBasis","lg","borderColor","border","padding","typography","subheadline","p","textDecoration","color","overflow","cursor","display","component","alignItems","justifyContent","flexDirection","gap","caption2"],"mappings":"+QAwBO,MAAMA,EAAkCC,EAC7C,EAAGC,KAAIC,WAAUC,QAAOC,wBAAuBC,eAAcC,UAAU,UAAWC,GAAQC,KACxF,MAAQP,GAAIQ,KAAcC,GAAgBL,GAAgB,CAAA,GAClDJ,GAAIU,KAAiBC,GAAmBR,GAAyB,CAAA,EAGnES,EAAoBC,GAA8B,SAAZR,EAAqB,IAAMQ,EAAMC,YAAYC,GAAG,OACrFC,EAAUC,GAAeC,GAAS,GAEzC,OACEC,EAACC,EAAe,CACdb,IAAKA,EAAG,cACI,aACZS,SAAsB,SAAZX,GAA4BW,EACtCK,SAAU,CAACC,EAAGC,IAAMN,EAAYM,GAChClB,QAAQ,cACS,SAAZA,GAAsB,CAAEmB,MAAO,CAAEC,WAAYC,IAClD1B,GAAI2B,EACDd,IAAK,CAEJe,UAAW,CAAEC,GAAI,OACjBC,YAAa,qBACG,cAAZzB,GAA2B,CAC7B,CAACO,EAAiBC,IAAS,CAAEkB,OAAQ,WAGzC/B,GAEFG,sBAAuB,CACrB,cAAiB,mBACjBH,GAAI2B,EACDd,IAAK,CAEJmB,QAAS,SAET,kBAAmB,IACdnB,EAAMoB,WAAWC,YACpBC,EAAG,EACH,aAAc,CACZC,eAAgB,OAChBC,MAAO,oBAIK,cAAZhC,GAA2B,CAC7B,CAACO,EAAiBC,IAAS,CAEzBmB,QAAS,aAETM,SAAU,UAEV,wBAAyB,CACvBC,OAAQ,SAGV,2CAA4C,CAC1CC,QAAS,YAKjB9B,MAECC,GAELT,MAAOA,EACPE,aAAc,CACZqC,UAAW,MACX,cAAiB,qBACjBzC,GAAI2B,EACDd,IAAK,CACJ2B,QAAS,OACTE,WAAY,aACZC,eAAgB,aAChBC,cAAe,SACfC,IAAK,IAEL,kBAAmB,IACdhC,EAAMoB,WAAWa,SACpBX,EAAG,EACH,aAAc,CACZC,eAAgB,OAChBC,MAAO,sBAIb7B,MAECC,MAEDH,EAAIL,SAEPA"}
@@ -0,0 +1,25 @@
1
+ import { ElementType, FC, ReactNode } from 'react';
2
+ import { BoxProps } from '@mui/material';
3
+ export interface FooterMenuCollapseProps extends BoxProps<ElementType> {
4
+ /**
5
+ * Expanded state, provided by the Accordion transition slot
6
+ */
7
+ in?: boolean;
8
+ /**
9
+ * Transition duration in ms, 0 disables the animation (provided by the transition slot)
10
+ */
11
+ timeout?: number;
12
+ /**
13
+ * Ignored owner state forwarded by the transition slot
14
+ */
15
+ ownerState?: unknown;
16
+ /**
17
+ * Collapsible content
18
+ */
19
+ children?: ReactNode;
20
+ }
21
+ /**
22
+ * CSS-only collapse used as the Accordion transition slot, so auto footer menus render
23
+ * expanded from desktop up without a JS media query (renders correctly during pre-render)
24
+ */
25
+ export declare const FooterMenuCollapse: FC<FooterMenuCollapseProps>;
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Box as t}from"@mui/material";import{sxOverride as i}from"../../utils/sxOverride/sxOverride.js";const a=e(({in:e,timeout:a,sx:o,children:d,ownerState:n,...s},m)=>r(t,{ref:m,"data-expanded":`${!!e}`,sx:i(r=>({display:"grid",gridTemplateRows:"0fr",transition:r.transitions.create("grid-template-rows",{duration:"number"==typeof a?a:r.transitions.duration.standard}),'&[data-expanded="true"]':{gridTemplateRows:"1fr"},"& > *":{minHeight:"0",overflow:"hidden"},[r.breakpoints.up("lg")]:{gridTemplateRows:"1fr"}}),o),...s,children:d}));export{a as FooterMenuCollapse};
2
+ //# sourceMappingURL=FooterMenuCollapse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FooterMenuCollapse.js","sources":["../../../src/components/footer/FooterMenuCollapse.tsx"],"sourcesContent":["import React, { ElementType, FC, forwardRef, ReactNode } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface FooterMenuCollapseProps extends BoxProps<ElementType> {\n /**\n * Expanded state, provided by the Accordion transition slot\n */\n in?: boolean;\n /**\n * Transition duration in ms, 0 disables the animation (provided by the transition slot)\n */\n timeout?: number;\n /**\n * Ignored owner state forwarded by the transition slot\n */\n ownerState?: unknown;\n /**\n * Collapsible content\n */\n children?: ReactNode;\n}\n\n/**\n * CSS-only collapse used as the Accordion transition slot, so auto footer menus render\n * expanded from desktop up without a JS media query (renders correctly during pre-render)\n */\nexport const FooterMenuCollapse: FC<FooterMenuCollapseProps> = forwardRef(\n ({ in: expanded, timeout, sx, children, ownerState: _ownerState, ...rest }, ref) => (\n <Box\n ref={ref}\n data-expanded={`${!!expanded}`}\n sx={sxOverride(\n (theme) => ({\n display: 'grid',\n // collapsed on mobile, the row track animates open/closed\n gridTemplateRows: '0fr',\n transition: theme.transitions.create('grid-template-rows', {\n duration: typeof timeout === 'number' ? timeout : theme.transitions.duration.standard,\n }),\n '&[data-expanded=\"true\"]': {\n gridTemplateRows: '1fr',\n },\n // clip the content while the track is collapsed\n '& > *': {\n minHeight: '0',\n overflow: 'hidden',\n },\n // always open from desktop up, replaces the removed media query\n [theme.breakpoints.up('lg')]: {\n gridTemplateRows: '1fr',\n },\n }),\n sx,\n )}\n {...rest}\n >\n {children}\n </Box>\n ),\n);\n"],"names":["FooterMenuCollapse","forwardRef","in","expanded","timeout","sx","children","ownerState","_ownerState","rest","ref","_jsx","Box","sxOverride","theme","display","gridTemplateRows","transition","transitions","create","duration","standard","minHeight","overflow","breakpoints","up"],"mappings":"iLA2BO,MAAMA,EAAkDC,EAC7D,EAAGC,GAAIC,EAAUC,UAASC,KAAIC,WAAUC,WAAYC,KAAgBC,GAAQC,IAC1EC,EAACC,GACCF,IAAKA,EAAG,gBACO,KAAKP,IACpBE,GAAIQ,EACDC,IAAK,CACJC,QAAS,OAETC,iBAAkB,MAClBC,WAAYH,EAAMI,YAAYC,OAAO,qBAAsB,CACzDC,SAA6B,iBAAZhB,EAAuBA,EAAUU,EAAMI,YAAYE,SAASC,WAE/E,0BAA2B,CACzBL,iBAAkB,OAGpB,QAAS,CACPM,UAAW,IACXC,SAAU,UAGZ,CAACT,EAAMU,YAAYC,GAAG,OAAQ,CAC5BT,iBAAkB,SAGtBX,MAEEI,WAEHH"}
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useState as i,useMemo as s,Children as n,Fragment as a,isValidElement as l,cloneElement as d}from"react";import{sxOverride as p}from"../../utils/sxOverride/sxOverride.js";import{useTheme as c,useMediaQuery as m,AppBar as u,Toolbar as x,Box as f,Drawer as h}from"@mui/material";import{MenuIcon as b}from"../icon/stroke/MenuIcon.js";import{CloseIcon as g}from"../icon/stroke/CloseIcon.js";import{getFocusRingStyle as y}from"../focusring/focusring.js";import{HeaderButton as v}from"./HeaderButton.js";import{HeaderLanguageSelect as k}from"./HeaderLanguageSelect.js";import{HeaderNavigationLink as j}from"./HeaderNavigationLink.js";import{HeaderNavigationHero as H}from"./HeaderNavigationHero.js";import{HeaderNavigationMenu as I}from"./HeaderNavigationMenu.js";const C=r(({children:r,logo:C,buttons:P,visibleButtons:w,mobile:B,open:M,setOpen:S,inContainer:$=!1,toolbarProps:F,logoProps:L,contentProps:N,mobileContentProps:O,buttonsProps:T,menuButtonProps:z,menuIcon:E,closeMenuIcon:G,drawerProps:A,...D},R)=>{const V=c(),W=m(V.breakpoints.down("lg")),q=void 0===B?W:B,{sx:J,...K}=L??{},{sx:Q,...U}=N??{},{sx:X,...Y}=O??{},{sx:Z,..._}=T??{},{sx:ee,slotProps:oe,...te}=A??{},{paper:re,backdrop:ie,...se}=oe??{},{sx:ne,...ae}=re??{},{sx:le,...de}=ie??{},[pe,ce]=i(!1),me=M??pe,ue=S??ce,[xe,fe,he]=s(()=>{function e(o,t,r){const i=[];return n.forEach(o,(o,s)=>{o?.type===a?i.push(...e(o.props.children,t,`${r}-n`)):l(o)&&[v,k,j,H,I].includes(o?.type)&&t?i.push(d(o,{extend:!0,key:`${r}-${s}`})):"string"==typeof o?i.push(o):i.push(d(o,{key:`${r}-${s}`}))}),i?.length?i:void 0}const o=e(r,q,"children");if(w){const t=!0===w?void 0:e(w,!1,"visibleButtons"),r=e(P,q,"restButton");return q?[o,t,r]:[o,[...t||[],...r||[]],void 0]}return[o,e(P,!1,"buttons"),void 0]},[r,w,P,q]);return e(o,{children:[t(u,{ref:R,"data-testid":"Header",...D,children:e(x,{disableGutters:!$,...F,children:[C&&t(f,{"data-testid":"Header.logo",sx:p({color:"dark"===V.palette.mode?"brand.secondary":"brand.tertiary",flexShrink:"0",display:"flex",alignItems:"center",justifyContent:"flex-start","& .MuiLink-root":{display:"block",position:"relative",py:1,...y(V),"&.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSvgIcon-root":{display:"block"}},J),...K,children:C}),t(f,{sx:p({minWidth:"0",flexGrow:"1",alignSelf:"stretch",display:"flex",alignItems:"stretch",justifyContent:"flex-start",gap:{lg:2,xl:4},...!q&&C&&{pl:4},mb:"-1px"},Q),"data-testid":"Header.nav",...U,children:!q&&xe}),(fe||q&&(xe||he))&&e(f,{sx:p({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mr:{xs:-1,lg:0}},Z),"data-testid":"Header.btns",..._,children:[fe,q&&(xe||he)&&t(v,{"aria-label":"Toggle menu",extend:!1,onClick:()=>ue(e=>!e),...z,children:me?G||t(g,{}):E||t(b,{})},"menu")]})]})}),q&&(xe||he)&&e(h,{disablePortal:!0,disableEnforceFocus:!0,disableAutoFocus:!0,anchor:"top",open:me,onClose:()=>ue(!1),sx:p({zIndex:V.zIndex.appBar-10,top:V.mixins.toolbar.minHeight,bottom:"auto",height:`calc(100vh - ${V.mixins.toolbar.minHeight})`,position:"absolute"},ee),slotProps:{backdrop:{sx:p({position:"absolute"},le),...de},paper:{sx:p({position:"absolute",height:"100%",display:"grid",gridTemplateRows:"auto max-content"},ne),...ae},...se},...te,children:[t(f,{sx:p({p:2,overflow:"auto"},X),"data-testid":"Header.mobilenav",...Y,children:xe}),he&&t(f,{sx:{p:2,pt:0},children:t(f,{sx:{pt:.75,display:"flex",flexDirection:"column-reverse",alignItems:"stretch",justifyContent:"flex-start",borderTop:1,borderColor:"dark"===V.palette.mode?"onSurface.os700":"surface.secondary"},children:he})})]})]})});export{C as Header};
1
+ import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useState as i,useMemo as s,Children as n,Fragment as a,isValidElement as l,cloneElement as d}from"react";import{sxOverride as p}from"../../utils/sxOverride/sxOverride.js";import{useTheme as c,useMediaQuery as m,AppBar as u,Toolbar as x,Box as f,Drawer as h}from"@mui/material";import{MenuIcon as b}from"../icon/stroke/MenuIcon.js";import{CloseIcon as g}from"../icon/stroke/CloseIcon.js";import{getFocusRingStyle as y}from"../focusring/focusring.js";import{HeaderButton as v}from"./HeaderButton.js";import{HeaderLanguageSelect as k}from"./HeaderLanguageSelect.js";import{HeaderNavigationLink as j}from"./HeaderNavigationLink.js";import{HeaderNavigationHero as H}from"./HeaderNavigationHero.js";import{HeaderNavigationMenu as I}from"./HeaderNavigationMenu.js";const C=r(({children:r,logo:C,buttons:P,visibleButtons:w,mobile:B,open:M,setOpen:S,inContainer:$=!1,toolbarProps:F,logoProps:L,contentProps:N,mobileContentProps:O,buttonsProps:T,menuButtonProps:z,menuIcon:E,closeMenuIcon:G,drawerProps:A,...D},R)=>{const V=c(),W=m(V.breakpoints.down("lg")),q=void 0===B?W:B,{sx:J,...K}=L??{},{sx:Q,...U}=N??{},{sx:X,...Y}=O??{},{sx:Z,..._}=T??{},{sx:ee,slotProps:oe,...te}=A??{},{paper:re,backdrop:ie,...se}=oe??{},{sx:ne,...ae}=re??{},{sx:le,...de}=ie??{},[pe,ce]=i(!1),me=M??pe,ue=S??ce,[xe,fe,he]=s(()=>{function e(o,t,r){const i=[];return n.forEach(o,(o,s)=>{o?.type===a?i.push(...e(o.props.children,t,`${r}-n`)):l(o)&&[v,k,j,H,I].includes(o?.type)&&t?i.push(d(o,{extend:!0,key:`${r}-${s}`})):"string"==typeof o?i.push(o):l(o)&&i.push(d(o,{key:`${r}-${s}`}))}),i?.length?i:void 0}const o=e(r,q,"children");if(w){const t=!0===w?void 0:e(w,!1,"visibleButtons"),r=e(P,q,"restButton");return q?[o,t,r]:[o,[...t||[],...r||[]],void 0]}return[o,e(P,!1,"buttons"),void 0]},[r,w,P,q]);return e(o,{children:[t(u,{ref:R,"data-testid":"Header",...D,children:e(x,{disableGutters:!$,...F,children:[C&&t(f,{"data-testid":"Header.logo",sx:p({color:"dark"===V.palette.mode?"brand.secondary":"brand.tertiary",flexShrink:"0",display:"flex",alignItems:"center",justifyContent:"flex-start","& .MuiLink-root":{display:"block",position:"relative",py:1,...y(V),"&.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSvgIcon-root":{display:"block"}},J),...K,children:C}),t(f,{sx:p({minWidth:"0",flexGrow:"1",alignSelf:"stretch",display:"flex",alignItems:"stretch",justifyContent:"flex-start",gap:{lg:2,xl:4},...!q&&C&&{pl:4},mb:"-1px"},Q),"data-testid":"Header.nav",...U,children:!q&&xe}),(fe||q&&(xe||he))&&e(f,{sx:p({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mr:{xs:-1,lg:0}},Z),"data-testid":"Header.btns",..._,children:[fe,q&&(xe||he)&&t(v,{"aria-label":"Toggle menu",extend:!1,onClick:()=>ue(e=>!e),...z,children:me?G||t(g,{}):E||t(b,{})},"menu")]})]})}),q&&(xe||he)&&e(h,{disablePortal:!0,disableEnforceFocus:!0,disableAutoFocus:!0,anchor:"top",open:me,onClose:()=>ue(!1),sx:p({zIndex:V.zIndex.appBar-10,top:V.mixins.toolbar.minHeight,bottom:"auto",height:`calc(100vh - ${V.mixins.toolbar.minHeight})`,position:"absolute"},ee),slotProps:{backdrop:{sx:p({position:"absolute"},le),...de},paper:{sx:p({position:"absolute",height:"100%",display:"grid",gridTemplateRows:"auto max-content"},ne),...ae},...se},...te,children:[t(f,{sx:p({p:2,overflow:"auto"},X),"data-testid":"Header.mobilenav",...Y,children:xe}),he&&t(f,{sx:{p:2,pt:0},children:t(f,{sx:{pt:.75,display:"flex",flexDirection:"column-reverse",alignItems:"stretch",justifyContent:"flex-start",borderTop:1,borderColor:"dark"===V.palette.mode?"onSurface.os700":"surface.secondary"},children:he})})]})]})});export{C as Header};
2
2
  //# sourceMappingURL=Header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sources":["../../../src/components/header/Header.tsx"],"sourcesContent":["import React, {\n FC,\n useState,\n forwardRef,\n ReactNode,\n ElementType,\n Children,\n cloneElement,\n useMemo,\n Fragment,\n isValidElement,\n} from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport {\n AppBar,\n AppBarProps,\n BackdropProps,\n Box,\n BoxProps,\n Drawer,\n DrawerProps,\n PaperProps,\n Toolbar,\n ToolbarProps,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\nimport { MenuIcon } from '@/src/components/icon/stroke/MenuIcon';\nimport { CloseIcon } from '@/src/components/icon/stroke/CloseIcon';\nimport { getFocusRingStyle } from '@/src/components/focusring/focusring';\nimport { HeaderButton, HeaderButtonProps } from './HeaderButton';\nimport { HeaderLanguageSelect } from './HeaderLanguageSelect';\nimport { HeaderNavigationLink } from './HeaderNavigationLink';\nimport { HeaderNavigationHero } from './HeaderNavigationHero';\nimport { HeaderNavigationMenu } from './HeaderNavigationMenu';\n\nexport interface HeaderProps extends Omit<AppBarProps, 'color'> {\n /**\n * Logo component\n */\n logo?: ReactNode;\n /**\n * Wrap the navigation into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * ActionButtons on the right side\n */\n buttons?: ReactNode;\n /**\n * ActionButtons on the right side that stays visible even on mobile\n */\n visibleButtons?: ReactNode | true;\n /**\n * Controls if mobile version of Header should be shown, this collapses children into mobile menu\n *\n * @default undefined, leads to usage useMediaQuery(theme.breakpoints.down('lg'))\n */\n mobile?: boolean;\n /**\n * Controls open/close state of mobile menu\n */\n open?: boolean;\n /**\n * Function to toggle open state of menu\n */\n setOpen?: (open: boolean) => void;\n /**\n * Properties applied to toolbar container\n */\n toolbarProps?: ToolbarProps<ElementType>;\n /**\n * Properties applied to logo wrapper\n */\n logoProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper in drawer\n */\n mobileContentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to button wrapper\n */\n buttonsProps?: BoxProps<ElementType>;\n /**\n * Properties applied to hamburger menu\n */\n menuButtonProps?: HeaderButtonProps;\n /**\n * Icon of the hamburger menu\n */\n menuIcon?: ReactNode;\n /**\n * Icon of the close hamburger menu\n */\n closeMenuIcon?: ReactNode;\n /**\n * Props applied to mobile drawer\n */\n drawerProps?: DrawerProps;\n}\n\n/**\n * Component to render Header with navigation and action buttons at the top of the page\n */\nexport const Header: FC<HeaderProps> = forwardRef(\n (\n {\n children,\n logo,\n buttons,\n visibleButtons,\n mobile: propMobile,\n open: propOpen,\n setOpen: propSetOpen,\n inContainer = false,\n toolbarProps,\n logoProps,\n contentProps,\n mobileContentProps,\n buttonsProps,\n menuButtonProps,\n menuIcon,\n closeMenuIcon,\n drawerProps,\n ...rest\n },\n ref,\n ) => {\n const theme = useTheme();\n const downLg = useMediaQuery(theme.breakpoints.down('lg'));\n // determine if mobile condition is controlled or default downLg\n const mobile = propMobile === undefined ? downLg : propMobile;\n const { sx: logoSx, ...restLogo } = logoProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: mobileContentSx, ...restMobileContent } = mobileContentProps ?? {};\n const { sx: buttonsSx, ...restButtons } = buttonsProps ?? {};\n const { sx: drawerSx, slotProps: drawerSlotProps, ...restDrawer } = drawerProps ?? {};\n const { paper: drawerPaperProps, backdrop: drawerBackdropProps, ...restDrawerSlotProps } = drawerSlotProps ?? {};\n const { sx: drawerPaperSx, ...restDrawerPaper } = (drawerPaperProps as PaperProps) ?? {};\n const { sx: drawerBackdropSx, ...restDrawerBackdrop } = (drawerBackdropProps as BackdropProps) ?? {};\n const [rawOpen, rawSetOpen] = useState(false);\n const open = propOpen ?? rawOpen;\n const setOpen: React.Dispatch<React.SetStateAction<boolean>> = propSetOpen ?? rawSetOpen;\n\n /**\n * Process child nodes\n */\n const [processedChildren, processedButtons, drawerButtons] = useMemo(() => {\n function flatten(nodes, extend, keyid) {\n const result = [];\n Children.forEach(nodes, (child, idx) => {\n if (child?.type === Fragment) {\n result.push(...flatten(child.props.children, extend, `${keyid}-n`));\n } else if (\n isValidElement(child) &&\n [\n HeaderButton,\n HeaderLanguageSelect,\n HeaderNavigationLink,\n HeaderNavigationHero,\n HeaderNavigationMenu,\n ].includes(child?.type as FC) &&\n extend\n ) {\n result.push(\n cloneElement(child, {\n extend: true,\n key: `${keyid}-${idx}`,\n } as HeaderButtonProps),\n );\n } else {\n if (typeof child === 'string') {\n result.push(child);\n } else {\n result.push(cloneElement(child, { key: `${keyid}-${idx}` }));\n }\n }\n });\n return result?.length ? result : undefined;\n }\n\n const flattenedChildren = flatten(children, mobile, 'children');\n // check if we have visibleButtons property\n if (visibleButtons) {\n const flattenedVisibleButtons =\n visibleButtons === true ? undefined : flatten(visibleButtons, false, 'visibleButtons');\n const flattenedRestButtons = flatten(buttons, mobile, 'restButton');\n // mobile\n if (mobile) {\n // split visible buttons and put buttons in drawer\n return [flattenedChildren, flattenedVisibleButtons, flattenedRestButtons];\n } else {\n // on PC, all buttons are visible\n return [flattenedChildren, [...(flattenedVisibleButtons || []), ...(flattenedRestButtons || [])], undefined];\n }\n } else {\n // in case visibleButtons property is not provided, do not put buttons into drawer at all\n return [flattenedChildren, flatten(buttons, false, 'buttons'), undefined];\n }\n }, [children, visibleButtons, buttons, mobile]);\n\n return (\n <>\n <AppBar ref={ref} data-testid=\"Header\" {...rest}>\n <Toolbar disableGutters={!inContainer} {...toolbarProps}>\n {logo && (\n <Box\n data-testid=\"Header.logo\"\n sx={sxOverride(\n {\n color: theme.palette.mode === 'dark' ? 'brand.secondary' : 'brand.tertiary',\n flexShrink: '0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n // restyle wrapper link, same style is applied in HeaderLogo\n '& .MuiLink-root': {\n display: 'block',\n position: 'relative',\n py: 1,\n // add proper focus ring\n ...getFocusRingStyle(theme),\n // remove default link box shadow\n '&.Mui-focusVisible': {\n boxShadow: 'none',\n },\n },\n '& .MuiSvgIcon-root': {\n display: 'block',\n },\n },\n logoSx,\n )}\n {...restLogo}\n >\n {logo}\n </Box>\n )}\n <Box\n sx={sxOverride(\n {\n minWidth: '0',\n flexGrow: '1',\n alignSelf: 'stretch',\n display: 'flex',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: { lg: 2, xl: 4 },\n ...(!mobile &&\n logo && {\n // increase size between logo and nav\n pl: 4,\n }),\n // move directly into border\n mb: '-1px',\n },\n contentSx,\n )}\n data-testid=\"Header.nav\"\n {...restContent}\n >\n {!mobile && processedChildren}\n </Box>\n {(processedButtons || (mobile && (processedChildren || drawerButtons))) && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 0.25,\n mr: { xs: -1, lg: 0 },\n },\n buttonsSx,\n )}\n data-testid=\"Header.btns\"\n {...restButtons}\n >\n {processedButtons}\n {mobile && (processedChildren || drawerButtons) && (\n <HeaderButton\n key=\"menu\"\n aria-label=\"Toggle menu\"\n extend={false}\n onClick={() => setOpen((prev: boolean) => !prev)}\n {...menuButtonProps}\n >\n {open ? closeMenuIcon || <CloseIcon /> : menuIcon || <MenuIcon />}\n </HeaderButton>\n )}\n </Box>\n )}\n </Toolbar>\n </AppBar>\n {mobile && (processedChildren || drawerButtons) && (\n <Drawer\n disablePortal\n disableEnforceFocus\n disableAutoFocus\n anchor=\"top\"\n open={open}\n onClose={() => setOpen(false)}\n sx={sxOverride(\n {\n // bellow Header, above SecondaryNavigation\n zIndex: theme.zIndex.appBar - 10,\n // header offset\n top: theme.mixins.toolbar.minHeight,\n bottom: 'auto',\n height: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n // adjust position\n position: 'absolute',\n },\n drawerSx,\n )}\n slotProps={{\n backdrop: {\n sx: sxOverride(\n {\n position: 'absolute',\n },\n drawerBackdropSx,\n ),\n ...restDrawerBackdrop,\n },\n paper: {\n sx: sxOverride(\n {\n position: 'absolute',\n height: '100%',\n display: 'grid',\n gridTemplateRows: 'auto max-content',\n },\n drawerPaperSx,\n ),\n ...restDrawerPaper,\n },\n ...restDrawerSlotProps,\n }}\n {...restDrawer}\n >\n <Box\n sx={sxOverride(\n {\n p: 2,\n overflow: 'auto',\n },\n mobileContentSx,\n )}\n data-testid=\"Header.mobilenav\"\n {...restMobileContent}\n >\n {processedChildren}\n </Box>\n {drawerButtons && (\n <Box sx={{ p: 2, pt: 0 }}>\n <Box\n sx={{\n pt: 0.75,\n display: 'flex',\n flexDirection: 'column-reverse',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n // border from appbar.theme.ts\n borderTop: 1,\n borderColor: theme.palette.mode === 'dark' ? 'onSurface.os700' : 'surface.secondary',\n }}\n >\n {drawerButtons}\n </Box>\n </Box>\n )}\n </Drawer>\n )}\n </>\n );\n },\n);\n"],"names":["Header","forwardRef","children","logo","buttons","visibleButtons","mobile","propMobile","open","propOpen","setOpen","propSetOpen","inContainer","toolbarProps","logoProps","contentProps","mobileContentProps","buttonsProps","menuButtonProps","menuIcon","closeMenuIcon","drawerProps","rest","ref","theme","useTheme","downLg","useMediaQuery","breakpoints","down","undefined","sx","logoSx","restLogo","contentSx","restContent","mobileContentSx","restMobileContent","buttonsSx","restButtons","drawerSx","slotProps","drawerSlotProps","restDrawer","paper","drawerPaperProps","backdrop","drawerBackdropProps","restDrawerSlotProps","drawerPaperSx","restDrawerPaper","drawerBackdropSx","restDrawerBackdrop","rawOpen","rawSetOpen","useState","processedChildren","processedButtons","drawerButtons","useMemo","flatten","nodes","extend","keyid","result","Children","forEach","child","idx","type","Fragment","push","props","isValidElement","HeaderButton","HeaderLanguageSelect","HeaderNavigationLink","HeaderNavigationHero","HeaderNavigationMenu","includes","cloneElement","key","length","flattenedChildren","flattenedVisibleButtons","flattenedRestButtons","_jsxs","_Fragment","_jsx","AppBar","Toolbar","disableGutters","Box","sxOverride","color","palette","mode","flexShrink","display","alignItems","justifyContent","position","py","getFocusRingStyle","boxShadow","minWidth","flexGrow","alignSelf","gap","lg","xl","pl","mb","mr","xs","onClick","prev","CloseIcon","MenuIcon","Drawer","disablePortal","disableEnforceFocus","disableAutoFocus","anchor","onClose","zIndex","appBar","top","mixins","toolbar","minHeight","bottom","height","gridTemplateRows","p","overflow","pt","flexDirection","borderTop","borderColor"],"mappings":"60BA6GO,MAAMA,EAA0BC,EACrC,EAEIC,WACAC,OACAC,UACAC,iBACAC,OAAQC,EACRC,KAAMC,EACNC,QAASC,EACTC,eAAc,EACdC,eACAC,YACAC,eACAC,qBACAC,eACAC,kBACAC,WACAC,gBACAC,iBACGC,GAELC,KAEA,MAAMC,EAAQC,IACRC,EAASC,EAAcH,EAAMI,YAAYC,KAAK,OAE9CvB,OAAwBwB,IAAfvB,EAA2BmB,EAASnB,GAC3CwB,GAAIC,KAAWC,GAAanB,GAAa,CAAA,GACzCiB,GAAIG,KAAcC,GAAgBpB,GAAgB,CAAA,GAClDgB,GAAIK,KAAoBC,GAAsBrB,GAAsB,CAAA,GACpEe,GAAIO,KAAcC,GAAgBtB,GAAgB,CAAA,GAClDc,GAAIS,GAAUC,UAAWC,MAAoBC,IAAetB,GAAe,CAAA,GAC3EuB,MAAOC,GAAkBC,SAAUC,MAAwBC,IAAwBN,IAAmB,CAAA,GACtGX,GAAIkB,MAAkBC,IAAqBL,IAAmC,CAAA,GAC9Ed,GAAIoB,MAAqBC,IAAwBL,IAAyC,CAAA,GAC3FM,GAASC,IAAcC,GAAS,GACjC/C,GAAOC,GAAY4C,GACnB3C,GAAyDC,GAAe2C,IAKvEE,GAAmBC,GAAkBC,IAAiBC,EAAQ,KACnE,SAASC,EAAQC,EAAOC,EAAQC,GAC9B,MAAMC,EAAS,GA6Bf,OA5BAC,EAASC,QAAQL,EAAO,CAACM,EAAOC,KAC1BD,GAAOE,OAASC,EAClBN,EAAOO,QAAQX,EAAQO,EAAMK,MAAMtE,SAAU4D,EAAQ,GAAGC,QAExDU,EAAeN,IACf,CACEO,EACAC,EACAC,EACAC,EACAC,GACAC,SAASZ,GAAOE,OAClBP,EAEAE,EAAOO,KACLS,EAAab,EAAO,CAClBL,QAAQ,EACRmB,IAAK,GAAGlB,KAASK,OAIA,iBAAVD,EACTH,EAAOO,KAAKJ,GAEZH,EAAOO,KAAKS,EAAab,EAAO,CAAEc,IAAK,GAAGlB,KAASK,SAIlDJ,GAAQkB,OAASlB,OAASlC,CACnC,CAEA,MAAMqD,EAAoBvB,EAAQ1D,EAAUI,EAAQ,YAEpD,GAAID,EAAgB,CAClB,MAAM+E,GACe,IAAnB/E,OAA0ByB,EAAY8B,EAAQvD,GAAgB,EAAO,kBACjEgF,EAAuBzB,EAAQxD,EAASE,EAAQ,cAEtD,OAAIA,EAEK,CAAC6E,EAAmBC,EAAyBC,GAG7C,CAACF,EAAmB,IAAKC,GAA2B,MAASC,GAAwB,SAAMvD,EAEtG,CAEE,MAAO,CAACqD,EAAmBvB,EAAQxD,GAAS,EAAO,gBAAY0B,IAEhE,CAAC5B,EAAUG,EAAgBD,EAASE,IAEvC,OACEgF,EAAAC,EAAA,CAAArF,SAAA,CACEsF,EAACC,GAAOlE,IAAKA,EAAG,cAAc,YAAaD,EAAIpB,SAC7CoF,EAACI,EAAO,CAACC,gBAAiB/E,KAAiBC,EAAYX,SAAA,CACpDC,GACCqF,EAACI,iBACa,cACZ7D,GAAI8D,EACF,CACEC,MAA8B,SAAvBtE,EAAMuE,QAAQC,KAAkB,kBAAoB,iBAC3DC,WAAY,IACZC,QAAS,OACTC,WAAY,SACZC,eAAgB,aAEhB,kBAAmB,CACjBF,QAAS,QACTG,SAAU,WACVC,GAAI,KAEDC,EAAkB/E,GAErB,qBAAsB,CACpBgF,UAAW,SAGf,qBAAsB,CACpBN,QAAS,UAGblE,MAEEC,WAEH9B,IAGLqF,EAACI,EAAG,CACF7D,GAAI8D,EACF,CACEY,SAAU,IACVC,SAAU,IACVC,UAAW,UACXT,QAAS,OACTC,WAAY,UACZC,eAAgB,aAChBQ,IAAK,CAAEC,GAAI,EAAGC,GAAI,OACbxG,GACHH,GAAQ,CAEN4G,GAAI,GAGRC,GAAI,QAEN9E,GACD,cACW,gBACRC,EAAWjC,UAEbI,GAAUkD,MAEZC,IAAqBnD,IAAWkD,IAAqBE,MACrD4B,EAACM,EAAG,CACF7D,GAAI8D,EACF,CACEK,QAAS,OACTC,WAAY,SACZC,eAAgB,WAChBQ,IAAK,IACLK,GAAI,CAAEC,MAAQL,GAAI,IAEpBvE,GACD,cACW,iBACRC,EAAWrC,SAAA,CAEduD,GACAnD,IAAWkD,IAAqBE,KAC/B8B,EAACd,EAAY,CAAA,aAEA,cACXZ,QAAQ,EACRqD,QAAS,IAAMzG,GAAS0G,IAAmBA,MACvClG,EAAehB,SAElBM,GAAOY,GAAiBoE,EAAC6B,EAAS,CAAA,GAAMlG,GAAYqE,EAAC8B,EAAQ,CAAA,IAN1D,gBAafhH,IAAWkD,IAAqBE,KAC/B4B,EAACiC,EAAM,CACLC,eAAa,EACbC,qBAAmB,EACnBC,kBAAgB,EAChBC,OAAO,MACPnH,KAAMA,GACNoH,QAAS,IAAMlH,IAAQ,GACvBqB,GAAI8D,EACF,CAEEgC,OAAQrG,EAAMqG,OAAOC,OAAS,GAE9BC,IAAKvG,EAAMwG,OAAOC,QAAQC,UAC1BC,OAAQ,OACRC,OAAQ,gBAAgB5G,EAAMwG,OAAOC,QAAQC,aAE7C7B,SAAU,YAEZ7D,IAEFC,UAAW,CACTK,SAAU,CACRf,GAAI8D,EACF,CACEQ,SAAU,YAEZlD,OAECC,IAELR,MAAO,CACLb,GAAI8D,EACF,CACEQ,SAAU,WACV+B,OAAQ,OACRlC,QAAS,OACTmC,iBAAkB,oBAEpBpF,OAECC,OAEFF,OAEDL,aAEJ6C,EAACI,GACC7D,GAAI8D,EACF,CACEyC,EAAG,EACHC,SAAU,QAEZnG,GACD,cACW,sBACRC,EAAiBnC,SAEpBsD,KAEFE,IACC8B,EAACI,EAAG,CAAC7D,GAAI,CAAEuG,EAAG,EAAGE,GAAI,GAAGtI,SACtBsF,EAACI,EAAG,CACF7D,GAAI,CACFyG,GAAI,IACJtC,QAAS,OACTuC,cAAe,iBACftC,WAAY,UACZC,eAAgB,aAEhBsC,UAAW,EACXC,YAAoC,SAAvBnH,EAAMuE,QAAQC,KAAkB,kBAAoB,qBAClE9F,SAEAwD"}
1
+ {"version":3,"file":"Header.js","sources":["../../../src/components/header/Header.tsx"],"sourcesContent":["import React, {\n FC,\n useState,\n forwardRef,\n ReactNode,\n ElementType,\n Children,\n cloneElement,\n useMemo,\n Fragment,\n isValidElement,\n} from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport {\n AppBar,\n AppBarProps,\n BackdropProps,\n Box,\n BoxProps,\n Drawer,\n DrawerProps,\n PaperProps,\n Toolbar,\n ToolbarProps,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\nimport { MenuIcon } from '@/src/components/icon/stroke/MenuIcon';\nimport { CloseIcon } from '@/src/components/icon/stroke/CloseIcon';\nimport { getFocusRingStyle } from '@/src/components/focusring/focusring';\nimport { HeaderButton, HeaderButtonProps } from './HeaderButton';\nimport { HeaderLanguageSelect } from './HeaderLanguageSelect';\nimport { HeaderNavigationLink } from './HeaderNavigationLink';\nimport { HeaderNavigationHero } from './HeaderNavigationHero';\nimport { HeaderNavigationMenu } from './HeaderNavigationMenu';\n\nexport interface HeaderProps extends Omit<AppBarProps, 'color'> {\n /**\n * Logo component\n */\n logo?: ReactNode;\n /**\n * Wrap the navigation into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * ActionButtons on the right side\n */\n buttons?: ReactNode;\n /**\n * ActionButtons on the right side that stays visible even on mobile\n */\n visibleButtons?: ReactNode | true;\n /**\n * Controls if mobile version of Header should be shown, this collapses children into mobile menu\n *\n * @default undefined, leads to usage useMediaQuery(theme.breakpoints.down('lg'))\n */\n mobile?: boolean;\n /**\n * Controls open/close state of mobile menu\n */\n open?: boolean;\n /**\n * Function to toggle open state of menu\n */\n setOpen?: (open: boolean) => void;\n /**\n * Properties applied to toolbar container\n */\n toolbarProps?: ToolbarProps<ElementType>;\n /**\n * Properties applied to logo wrapper\n */\n logoProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper in drawer\n */\n mobileContentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to button wrapper\n */\n buttonsProps?: BoxProps<ElementType>;\n /**\n * Properties applied to hamburger menu\n */\n menuButtonProps?: HeaderButtonProps;\n /**\n * Icon of the hamburger menu\n */\n menuIcon?: ReactNode;\n /**\n * Icon of the close hamburger menu\n */\n closeMenuIcon?: ReactNode;\n /**\n * Props applied to mobile drawer\n */\n drawerProps?: DrawerProps;\n}\n\n/**\n * Component to render Header with navigation and action buttons at the top of the page\n */\nexport const Header: FC<HeaderProps> = forwardRef(\n (\n {\n children,\n logo,\n buttons,\n visibleButtons,\n mobile: propMobile,\n open: propOpen,\n setOpen: propSetOpen,\n inContainer = false,\n toolbarProps,\n logoProps,\n contentProps,\n mobileContentProps,\n buttonsProps,\n menuButtonProps,\n menuIcon,\n closeMenuIcon,\n drawerProps,\n ...rest\n },\n ref,\n ) => {\n const theme = useTheme();\n const downLg = useMediaQuery(theme.breakpoints.down('lg'));\n // determine if mobile condition is controlled or default downLg\n const mobile = propMobile === undefined ? downLg : propMobile;\n const { sx: logoSx, ...restLogo } = logoProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: mobileContentSx, ...restMobileContent } = mobileContentProps ?? {};\n const { sx: buttonsSx, ...restButtons } = buttonsProps ?? {};\n const { sx: drawerSx, slotProps: drawerSlotProps, ...restDrawer } = drawerProps ?? {};\n const { paper: drawerPaperProps, backdrop: drawerBackdropProps, ...restDrawerSlotProps } = drawerSlotProps ?? {};\n const { sx: drawerPaperSx, ...restDrawerPaper } = (drawerPaperProps as PaperProps) ?? {};\n const { sx: drawerBackdropSx, ...restDrawerBackdrop } = (drawerBackdropProps as BackdropProps) ?? {};\n const [rawOpen, rawSetOpen] = useState(false);\n const open = propOpen ?? rawOpen;\n const setOpen: React.Dispatch<React.SetStateAction<boolean>> = propSetOpen ?? rawSetOpen;\n\n /**\n * Process child nodes\n */\n const [processedChildren, processedButtons, drawerButtons] = useMemo(() => {\n function flatten(nodes, extend, keyid) {\n const result = [];\n Children.forEach(nodes, (child, idx) => {\n if (child?.type === Fragment) {\n result.push(...flatten(child.props.children, extend, `${keyid}-n`));\n } else if (\n isValidElement(child) &&\n [\n HeaderButton,\n HeaderLanguageSelect,\n HeaderNavigationLink,\n HeaderNavigationHero,\n HeaderNavigationMenu,\n ].includes(child?.type as FC) &&\n extend\n ) {\n result.push(\n cloneElement(child, {\n extend: true,\n key: `${keyid}-${idx}`,\n } as HeaderButtonProps),\n );\n } else {\n if (typeof child === 'string') {\n result.push(child);\n } else if (isValidElement(child)) {\n result.push(cloneElement(child, { key: `${keyid}-${idx}` }));\n }\n }\n });\n return result?.length ? result : undefined;\n }\n\n const flattenedChildren = flatten(children, mobile, 'children');\n // check if we have visibleButtons property\n if (visibleButtons) {\n const flattenedVisibleButtons =\n visibleButtons === true ? undefined : flatten(visibleButtons, false, 'visibleButtons');\n const flattenedRestButtons = flatten(buttons, mobile, 'restButton');\n // mobile\n if (mobile) {\n // split visible buttons and put buttons in drawer\n return [flattenedChildren, flattenedVisibleButtons, flattenedRestButtons];\n } else {\n // on PC, all buttons are visible\n return [flattenedChildren, [...(flattenedVisibleButtons || []), ...(flattenedRestButtons || [])], undefined];\n }\n } else {\n // in case visibleButtons property is not provided, do not put buttons into drawer at all\n return [flattenedChildren, flatten(buttons, false, 'buttons'), undefined];\n }\n }, [children, visibleButtons, buttons, mobile]);\n\n return (\n <>\n <AppBar ref={ref} data-testid=\"Header\" {...rest}>\n <Toolbar disableGutters={!inContainer} {...toolbarProps}>\n {logo && (\n <Box\n data-testid=\"Header.logo\"\n sx={sxOverride(\n {\n color: theme.palette.mode === 'dark' ? 'brand.secondary' : 'brand.tertiary',\n flexShrink: '0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n // restyle wrapper link, same style is applied in HeaderLogo\n '& .MuiLink-root': {\n display: 'block',\n position: 'relative',\n py: 1,\n // add proper focus ring\n ...getFocusRingStyle(theme),\n // remove default link box shadow\n '&.Mui-focusVisible': {\n boxShadow: 'none',\n },\n },\n '& .MuiSvgIcon-root': {\n display: 'block',\n },\n },\n logoSx,\n )}\n {...restLogo}\n >\n {logo}\n </Box>\n )}\n <Box\n sx={sxOverride(\n {\n minWidth: '0',\n flexGrow: '1',\n alignSelf: 'stretch',\n display: 'flex',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: { lg: 2, xl: 4 },\n ...(!mobile &&\n logo && {\n // increase size between logo and nav\n pl: 4,\n }),\n // move directly into border\n mb: '-1px',\n },\n contentSx,\n )}\n data-testid=\"Header.nav\"\n {...restContent}\n >\n {!mobile && processedChildren}\n </Box>\n {(processedButtons || (mobile && (processedChildren || drawerButtons))) && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 0.25,\n mr: { xs: -1, lg: 0 },\n },\n buttonsSx,\n )}\n data-testid=\"Header.btns\"\n {...restButtons}\n >\n {processedButtons}\n {mobile && (processedChildren || drawerButtons) && (\n <HeaderButton\n key=\"menu\"\n aria-label=\"Toggle menu\"\n extend={false}\n onClick={() => setOpen((prev: boolean) => !prev)}\n {...menuButtonProps}\n >\n {open ? closeMenuIcon || <CloseIcon /> : menuIcon || <MenuIcon />}\n </HeaderButton>\n )}\n </Box>\n )}\n </Toolbar>\n </AppBar>\n {mobile && (processedChildren || drawerButtons) && (\n <Drawer\n disablePortal\n disableEnforceFocus\n disableAutoFocus\n anchor=\"top\"\n open={open}\n onClose={() => setOpen(false)}\n sx={sxOverride(\n {\n // bellow Header, above SecondaryNavigation\n zIndex: theme.zIndex.appBar - 10,\n // header offset\n top: theme.mixins.toolbar.minHeight,\n bottom: 'auto',\n height: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n // adjust position\n position: 'absolute',\n },\n drawerSx,\n )}\n slotProps={{\n backdrop: {\n sx: sxOverride(\n {\n position: 'absolute',\n },\n drawerBackdropSx,\n ),\n ...restDrawerBackdrop,\n },\n paper: {\n sx: sxOverride(\n {\n position: 'absolute',\n height: '100%',\n display: 'grid',\n gridTemplateRows: 'auto max-content',\n },\n drawerPaperSx,\n ),\n ...restDrawerPaper,\n },\n ...restDrawerSlotProps,\n }}\n {...restDrawer}\n >\n <Box\n sx={sxOverride(\n {\n p: 2,\n overflow: 'auto',\n },\n mobileContentSx,\n )}\n data-testid=\"Header.mobilenav\"\n {...restMobileContent}\n >\n {processedChildren}\n </Box>\n {drawerButtons && (\n <Box sx={{ p: 2, pt: 0 }}>\n <Box\n sx={{\n pt: 0.75,\n display: 'flex',\n flexDirection: 'column-reverse',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n // border from appbar.theme.ts\n borderTop: 1,\n borderColor: theme.palette.mode === 'dark' ? 'onSurface.os700' : 'surface.secondary',\n }}\n >\n {drawerButtons}\n </Box>\n </Box>\n )}\n </Drawer>\n )}\n </>\n );\n },\n);\n"],"names":["Header","forwardRef","children","logo","buttons","visibleButtons","mobile","propMobile","open","propOpen","setOpen","propSetOpen","inContainer","toolbarProps","logoProps","contentProps","mobileContentProps","buttonsProps","menuButtonProps","menuIcon","closeMenuIcon","drawerProps","rest","ref","theme","useTheme","downLg","useMediaQuery","breakpoints","down","undefined","sx","logoSx","restLogo","contentSx","restContent","mobileContentSx","restMobileContent","buttonsSx","restButtons","drawerSx","slotProps","drawerSlotProps","restDrawer","paper","drawerPaperProps","backdrop","drawerBackdropProps","restDrawerSlotProps","drawerPaperSx","restDrawerPaper","drawerBackdropSx","restDrawerBackdrop","rawOpen","rawSetOpen","useState","processedChildren","processedButtons","drawerButtons","useMemo","flatten","nodes","extend","keyid","result","Children","forEach","child","idx","type","Fragment","push","props","isValidElement","HeaderButton","HeaderLanguageSelect","HeaderNavigationLink","HeaderNavigationHero","HeaderNavigationMenu","includes","cloneElement","key","length","flattenedChildren","flattenedVisibleButtons","flattenedRestButtons","_jsxs","_Fragment","_jsx","AppBar","Toolbar","disableGutters","Box","sxOverride","color","palette","mode","flexShrink","display","alignItems","justifyContent","position","py","getFocusRingStyle","boxShadow","minWidth","flexGrow","alignSelf","gap","lg","xl","pl","mb","mr","xs","onClick","prev","CloseIcon","MenuIcon","Drawer","disablePortal","disableEnforceFocus","disableAutoFocus","anchor","onClose","zIndex","appBar","top","mixins","toolbar","minHeight","bottom","height","gridTemplateRows","p","overflow","pt","flexDirection","borderTop","borderColor"],"mappings":"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"}
@@ -1,6 +1,6 @@
1
1
  import { FC, ElementType } from 'react';
2
2
  import { LinkProps } from '@mui/material';
3
- import { LogoProps } from '@/src/components/logo/Logo';
3
+ import { LogoProps } from '../logo/Logo';
4
4
  export interface HeaderLogoProps extends LinkProps<ElementType> {
5
5
  /**
6
6
  * Properties applied to Logo component
@@ -31,7 +31,7 @@ export interface HeaderNavigationHeroProps extends HeaderNavigationLinkProps {
31
31
  /**
32
32
  * Props applied to Collapse component
33
33
  */
34
- collapseProp?: CollapseProps;
34
+ collapseProps?: CollapseProps;
35
35
  /**
36
36
  * Props applied to Portal if disableBackdrop property is not provided
37
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderNavigationHero.js","sources":["../../../src/components/header/HeaderNavigationHero.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState, ElementType, useRef } from 'react';\nimport {\n Collapse,\n Backdrop,\n ClickAwayListener,\n Box,\n BoxProps,\n Portal,\n Container,\n ClickAwayListenerProps,\n ContainerProps,\n PortalProps,\n BackdropProps,\n CollapseProps,\n useMediaQuery,\n Theme,\n useTheme,\n} from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { ChevronDownIcon } from '@/src/components/icon/stroke/ChevronDownIcon';\nimport { HeaderNavigationLink, HeaderNavigationLinkProps } from './HeaderNavigationLink';\n\nexport interface HeaderNavigationHeroProps extends HeaderNavigationLinkProps {\n /**\n * Wrap the content into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * Controls appearance of backdrop when content opens\n * @default false\n */\n disableBackdrop?: boolean;\n /**\n * Props applied to ClickAwayListener\n */\n clickAwayListenerProps?: Omit<ClickAwayListenerProps, 'children'>;\n /**\n * Props applied to main wrapper of content\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Props applied to main wrapper before collapsible\n */\n wrapperProps?: BoxProps<ElementType>;\n /**\n * Props applied to Container if inContainer property is provided\n */\n containerProps?: ContainerProps;\n /**\n * Props applied to Collapse component\n */\n collapseProp?: CollapseProps;\n /**\n * Props applied to Portal if disableBackdrop property is not provided\n */\n portalProps?: PortalProps;\n /**\n * Props applied to Backdrop if disableBackdrop property is not provided\n */\n backdropProps?: BackdropProps;\n}\n\n/**\n * HeaderNavigationLink with the integration of the complex hero menu\n */\nexport const HeaderNavigationHero: FC<HeaderNavigationHeroProps> = forwardRef(\n (\n {\n children,\n sx,\n label,\n icon,\n extend,\n inContainer = false,\n disableBackdrop = false,\n onClick,\n clickAwayListenerProps,\n contentProps,\n wrapperProps,\n containerProps,\n collapseProps,\n portalProps,\n backdropProps,\n ...rest\n },\n ref,\n ) => {\n const buttonRef = useRef(null);\n const [open, setOpen] = useState(false);\n const theme = useTheme();\n const downLg = useMediaQuery<Theme>(theme.breakpoints.down('lg'));\n const mobile = extend === undefined ? downLg : extend;\n const { sx: backdropSx, ...restBackdrop } = backdropProps ?? {};\n const { sx: wrapperSx, ...restWrapper } = wrapperProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n\n return (\n <>\n <HeaderNavigationLink\n active={open}\n extend={extend}\n icon={\n icon || (\n <ChevronDownIcon\n sx={{\n '&&&': {\n fontSize: extend === undefined ? { xs: '20px', lg: '14px' } : ['20px', '14px'][+!extend],\n },\n color:\n extend === undefined\n ? {\n xs: theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700',\n lg: 'currentColor',\n }\n : [theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700', 'currentColor'][\n +!extend\n ],\n transform: `rotate(${open ? '180' : '0'}deg)`,\n transition:\n extend === undefined\n ? {\n xs: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n lg: 'none',\n }\n : [\n theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n 'none',\n ][+!extend],\n }}\n />\n )\n }\n onClick={(e) => {\n onClick?.(e);\n setOpen((prev) => !prev);\n }}\n sx={sxOverride(\n {\n justifyContent:\n extend === undefined\n ? { xs: 'space-between', lg: 'flex-start' }\n : ['space-between', 'flex-start'][+!extend],\n },\n sx,\n )}\n ref={ref ?? buttonRef}\n data-testid=\"HeaderNavigationHero\"\n {...rest}\n >\n {label}\n </HeaderNavigationLink>\n <ClickAwayListener\n onClickAway={(e) =>\n !((ref as React.RefObject<HTMLButtonElement>) ?? buttonRef)?.current?.contains(e?.target as Node) &&\n setOpen(false)\n }\n {...clickAwayListenerProps}\n >\n <Box\n sx={sxOverride(\n {\n position: extend === undefined ? { xs: 'static', lg: 'absolute' } : ['static', 'absolute'][+!extend],\n zIndex: '10',\n left: '0',\n right: '0',\n top: theme.mixins.toolbar.minHeight,\n maxHeight: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n overflow: 'auto',\n },\n wrapperSx,\n )}\n {...restWrapper}\n >\n <Collapse in={open} {...collapseProps}>\n <Box\n sx={sxOverride(\n {\n backgroundColor:\n extend === undefined\n ? {\n xs: 'unset',\n lg: theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary',\n }\n : ['unset', theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary'][+!extend],\n py: extend === undefined ? { xs: 0, lg: 2 } : [0, 2][+!extend],\n px: extend === undefined ? { xs: 1, lg: 2 } : [1, 2][+!extend],\n ...(inContainer && {\n px: 0,\n }),\n },\n contentSx,\n )}\n {...restContent}\n >\n {inContainer ? (\n <Container maxWidth=\"xl\" {...containerProps}>\n {children}\n </Container>\n ) : (\n children\n )}\n </Box>\n </Collapse>\n </Box>\n </ClickAwayListener>\n {!disableBackdrop && !mobile && (\n <Portal {...portalProps}>\n <Backdrop open={open} sx={sxOverride({ zIndex: theme.zIndex.appBar - 50 }, backdropSx)} {...restBackdrop} />\n </Portal>\n )}\n </>\n );\n },\n);\n"],"names":["HeaderNavigationHero","forwardRef","children","sx","label","icon","extend","inContainer","disableBackdrop","onClick","clickAwayListenerProps","contentProps","wrapperProps","containerProps","collapseProps","portalProps","backdropProps","rest","ref","buttonRef","useRef","open","setOpen","useState","theme","useTheme","downLg","useMediaQuery","breakpoints","down","mobile","undefined","backdropSx","restBackdrop","wrapperSx","restWrapper","contentSx","restContent","_jsxs","_jsx","HeaderNavigationLink","active","ChevronDownIcon","fontSize","xs","lg","color","palette","mode","transform","transition","transitions","create","duration","shortest","e","prev","sxOverride","justifyContent","ClickAwayListener","onClickAway","current","contains","target","Box","position","zIndex","left","right","top","mixins","toolbar","minHeight","maxHeight","overflow","Collapse","in","backgroundColor","py","px","Container","maxWidth","Portal","Backdrop","appBar"],"mappings":"6dAkEaA,EAAsDC,EACjE,EAEIC,WACAC,KACAC,QACAC,OACAC,SACAC,eAAc,EACdC,mBAAkB,EAClBC,UACAC,yBACAC,eACAC,eACAC,iBACAC,gBACAC,cACAC,mBACGC,GAELC,KAEA,MAAMC,EAAYC,EAAO,OAClBC,EAAMC,GAAWC,GAAS,GAC3BC,EAAQC,IACRC,EAASC,EAAqBH,EAAMI,YAAYC,KAAK,OACrDC,OAAoBC,IAAXzB,EAAuBoB,EAASpB,GACvCH,GAAI6B,KAAeC,GAAiBjB,GAAiB,CAAA,GACrDb,GAAI+B,KAAcC,GAAgBvB,GAAgB,CAAA,GAClDT,GAAIiC,KAAcC,GAAgB1B,GAAgB,CAAA,EAE1D,OACE2B,eACEC,EAACC,GACCC,OAAQpB,EACRf,OAAQA,EACRD,KACEA,GACEkC,EAACG,EAAe,CACdvC,GAAI,CACF,MAAO,CACLwC,cAAqBZ,IAAXzB,EAAuB,CAAEsC,GAAI,OAAQC,GAAI,QAAW,CAAC,OAAQ,UAAUvC,IAEnFwC,WACaf,IAAXzB,EACI,CACEsC,GAA2B,SAAvBpB,EAAMuB,QAAQC,KAAkB,kBAAoB,kBACxDH,GAAI,gBAEN,CAAwB,SAAvBrB,EAAMuB,QAAQC,KAAkB,kBAAoB,kBAAmB,kBACpE1C,GAEV2C,UAAW,UAAU5B,EAAO,MAAQ,UACpC6B,gBACanB,IAAXzB,EACI,CACEsC,GAAIpB,EAAM2B,YAAYC,OAAO,YAAa,CACxCC,SAAU7B,EAAM2B,YAAYE,SAASC,WAEvCT,GAAI,QAEN,CACErB,EAAM2B,YAAYC,OAAO,YAAa,CACpCC,SAAU7B,EAAM2B,YAAYE,SAASC,WAEvC,UACEhD,MAKlBG,QAAU8C,IACR9C,IAAU8C,GACVjC,EAASkC,IAAUA,IAErBrD,GAAIsD,EACF,CACEC,oBACa3B,IAAXzB,EACI,CAAEsC,GAAI,gBAAiBC,GAAI,cAC3B,CAAC,gBAAiB,gBAAgBvC,IAE1CH,GAEFe,IAAKA,GAAOC,EAAS,cACT,0BACRF,EAAIf,SAEPE,IAEHmC,EAACoB,EAAiB,CAChBC,YAAcL,KACTrC,GAA8CC,IAAY0C,SAASC,SAASP,GAAGQ,SAClFzC,GAAQ,MAENZ,EAAsBR,SAE1BqC,EAACyB,EAAG,CACF7D,GAAIsD,EACF,CACEQ,cAAqBlC,IAAXzB,EAAuB,CAAEsC,GAAI,SAAUC,GAAI,YAAe,CAAC,SAAU,cAAcvC,GAC7F4D,OAAQ,KACRC,KAAM,IACNC,MAAO,IACPC,IAAK7C,EAAM8C,OAAOC,QAAQC,UAC1BC,UAAW,gBAAgBjD,EAAM8C,OAAOC,QAAQC,aAChDE,SAAU,QAEZxC,MAEEC,WAEJI,EAACoC,GAASC,GAAIvD,KAAUP,WACtByB,EAACyB,GACC7D,GAAIsD,EACF,CACEoB,qBACa9C,IAAXzB,EACI,CACEsC,GAAI,QACJC,GAA2B,SAAvBrB,EAAMuB,QAAQC,KAAkB,kBAAoB,sBAE1D,CAAC,QAAgC,SAAvBxB,EAAMuB,QAAQC,KAAkB,kBAAoB,wBAAwB1C,GAC5FwE,QAAe/C,IAAXzB,EAAuB,CAAEsC,GAAI,EAAGC,GAAI,GAAM,CAAC,EAAG,KAAKvC,GACvDyE,QAAehD,IAAXzB,EAAuB,CAAEsC,GAAI,EAAGC,GAAI,GAAM,CAAC,EAAG,KAAKvC,MACnDC,GAAe,CACjBwE,GAAI,IAGR3C,MAEEC,EAAWnC,SAEdK,EACCgC,EAACyC,EAAS,CAACC,SAAS,QAASpE,EAAcX,SACxCA,eASXM,IAAoBsB,GACpBS,EAAC2C,EAAM,IAAKnE,EAAWb,SACrBqC,EAAC4C,EAAQ,CAAC9D,KAAMA,EAAMlB,GAAIsD,EAAW,CAAES,OAAQ1C,EAAM0C,OAAOkB,OAAS,IAAMpD,MAAiBC"}
1
+ {"version":3,"file":"HeaderNavigationHero.js","sources":["../../../src/components/header/HeaderNavigationHero.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState, ElementType, useRef } from 'react';\nimport {\n Collapse,\n Backdrop,\n ClickAwayListener,\n Box,\n BoxProps,\n Portal,\n Container,\n ClickAwayListenerProps,\n ContainerProps,\n PortalProps,\n BackdropProps,\n CollapseProps,\n useMediaQuery,\n Theme,\n useTheme,\n} from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { ChevronDownIcon } from '@/src/components/icon/stroke/ChevronDownIcon';\nimport { HeaderNavigationLink, HeaderNavigationLinkProps } from './HeaderNavigationLink';\n\nexport interface HeaderNavigationHeroProps extends HeaderNavigationLinkProps {\n /**\n * Wrap the content into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * Controls appearance of backdrop when content opens\n * @default false\n */\n disableBackdrop?: boolean;\n /**\n * Props applied to ClickAwayListener\n */\n clickAwayListenerProps?: Omit<ClickAwayListenerProps, 'children'>;\n /**\n * Props applied to main wrapper of content\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Props applied to main wrapper before collapsible\n */\n wrapperProps?: BoxProps<ElementType>;\n /**\n * Props applied to Container if inContainer property is provided\n */\n containerProps?: ContainerProps;\n /**\n * Props applied to Collapse component\n */\n collapseProps?: CollapseProps;\n /**\n * Props applied to Portal if disableBackdrop property is not provided\n */\n portalProps?: PortalProps;\n /**\n * Props applied to Backdrop if disableBackdrop property is not provided\n */\n backdropProps?: BackdropProps;\n}\n\n/**\n * HeaderNavigationLink with the integration of the complex hero menu\n */\nexport const HeaderNavigationHero: FC<HeaderNavigationHeroProps> = forwardRef(\n (\n {\n children,\n sx,\n label,\n icon,\n extend,\n inContainer = false,\n disableBackdrop = false,\n onClick,\n clickAwayListenerProps,\n contentProps,\n wrapperProps,\n containerProps,\n collapseProps,\n portalProps,\n backdropProps,\n ...rest\n },\n ref,\n ) => {\n const buttonRef = useRef(null);\n const [open, setOpen] = useState(false);\n const theme = useTheme();\n const downLg = useMediaQuery<Theme>(theme.breakpoints.down('lg'));\n const mobile = extend === undefined ? downLg : extend;\n const { sx: backdropSx, ...restBackdrop } = backdropProps ?? {};\n const { sx: wrapperSx, ...restWrapper } = wrapperProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n\n return (\n <>\n <HeaderNavigationLink\n active={open}\n extend={extend}\n icon={\n icon || (\n <ChevronDownIcon\n sx={{\n '&&&': {\n fontSize: extend === undefined ? { xs: '20px', lg: '14px' } : ['20px', '14px'][+!extend],\n },\n color:\n extend === undefined\n ? {\n xs: theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700',\n lg: 'currentColor',\n }\n : [theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700', 'currentColor'][\n +!extend\n ],\n transform: `rotate(${open ? '180' : '0'}deg)`,\n transition:\n extend === undefined\n ? {\n xs: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n lg: 'none',\n }\n : [\n theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n 'none',\n ][+!extend],\n }}\n />\n )\n }\n onClick={(e) => {\n onClick?.(e);\n setOpen((prev) => !prev);\n }}\n sx={sxOverride(\n {\n justifyContent:\n extend === undefined\n ? { xs: 'space-between', lg: 'flex-start' }\n : ['space-between', 'flex-start'][+!extend],\n },\n sx,\n )}\n ref={ref ?? buttonRef}\n data-testid=\"HeaderNavigationHero\"\n {...rest}\n >\n {label}\n </HeaderNavigationLink>\n <ClickAwayListener\n onClickAway={(e) =>\n !((ref as React.RefObject<HTMLButtonElement>) ?? buttonRef)?.current?.contains(e?.target as Node) &&\n setOpen(false)\n }\n {...clickAwayListenerProps}\n >\n <Box\n sx={sxOverride(\n {\n position: extend === undefined ? { xs: 'static', lg: 'absolute' } : ['static', 'absolute'][+!extend],\n zIndex: '10',\n left: '0',\n right: '0',\n top: theme.mixins.toolbar.minHeight,\n maxHeight: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n overflow: 'auto',\n },\n wrapperSx,\n )}\n {...restWrapper}\n >\n <Collapse in={open} {...collapseProps}>\n <Box\n sx={sxOverride(\n {\n backgroundColor:\n extend === undefined\n ? {\n xs: 'unset',\n lg: theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary',\n }\n : ['unset', theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary'][+!extend],\n py: extend === undefined ? { xs: 0, lg: 2 } : [0, 2][+!extend],\n px: extend === undefined ? { xs: 1, lg: 2 } : [1, 2][+!extend],\n ...(inContainer && {\n px: 0,\n }),\n },\n contentSx,\n )}\n {...restContent}\n >\n {inContainer ? (\n <Container maxWidth=\"xl\" {...containerProps}>\n {children}\n </Container>\n ) : (\n children\n )}\n </Box>\n </Collapse>\n </Box>\n </ClickAwayListener>\n {!disableBackdrop && !mobile && (\n <Portal {...portalProps}>\n <Backdrop open={open} sx={sxOverride({ zIndex: theme.zIndex.appBar - 50 }, backdropSx)} {...restBackdrop} />\n </Portal>\n )}\n </>\n );\n },\n);\n"],"names":["HeaderNavigationHero","forwardRef","children","sx","label","icon","extend","inContainer","disableBackdrop","onClick","clickAwayListenerProps","contentProps","wrapperProps","containerProps","collapseProps","portalProps","backdropProps","rest","ref","buttonRef","useRef","open","setOpen","useState","theme","useTheme","downLg","useMediaQuery","breakpoints","down","mobile","undefined","backdropSx","restBackdrop","wrapperSx","restWrapper","contentSx","restContent","_jsxs","_jsx","HeaderNavigationLink","active","ChevronDownIcon","fontSize","xs","lg","color","palette","mode","transform","transition","transitions","create","duration","shortest","e","prev","sxOverride","justifyContent","ClickAwayListener","onClickAway","current","contains","target","Box","position","zIndex","left","right","top","mixins","toolbar","minHeight","maxHeight","overflow","Collapse","in","backgroundColor","py","px","Container","maxWidth","Portal","Backdrop","appBar"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as t,useMemo as a}from"react";import{useTheme as r,ButtonBase as i,Box as l}from"@mui/material";import{sxOverride as n}from"../../utils/sxOverride/sxOverride.js";import{ArrowTopRightIcon as s}from"../icon/stroke/ArrowTopRightIcon.js";import{getFocusRingStyle as d}from"../focusring/focusring.js";import{getInteractiveStyle as p}from"../../materialui/button/interactive.js";import{getTypography as c}from"../../materialui/typography/typography.theme.js";const x=t(({sx:t,children:x,label:g,icon:m,active:u=!1,external:b=!1,extend:f,labelWrapperProps:v,labelProps:y,selectedLabelProps:h,...k},L)=>{const w=r(),{sx:N,...H}=v??{},{sx:F,...j}=y??{},{sx:C,...I}=h??{},S=a(()=>b?e(s,{}):m,[m,b]);return o(i,{sx:n({...w.typography.list,...void 0===f?{[w.breakpoints.down("lg")]:{...c("body","rtl"===w.direction,"large")}}:[{"&&":{...c("body","rtl"===w.direction,"large")}},{}][+!f],position:"relative",zIndex:"100",display:void 0===f?{xs:"flex",lg:"inline-flex"}:["flex","inline-flex"][+!f],width:void 0===f?{xs:"100%",lg:"auto"}:["100%","auto"][+!f],gap:.5,alignItems:"center",justifyContent:"flex-start",py:void 0===f?{xs:2,lg:1}:[2,1][+!f],px:void 0===f?{xs:1,lg:.5}:[1,.5][+!f],transition:"transform 0.3s ease-out, color 0.3s ease-out, background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out","& .MuiSvgIcon-root":{fontSize:"14px"},"&:after":{content:void 0===f?{xs:"none",lg:'""'}:["none",'""'][+!f],position:"absolute",left:"0",right:"0",bottom:"0",height:"1px",backgroundColor:"transparent.transparent",...u&&{height:"2px",backgroundColor:"text.primary"}},"&.Mui-disabled":{color:"disabled.tertiary"},...p({color:"dark"===w.palette.mode?"onSurface.os300":"onSurface.os700","&&:after":{backgroundColor:"transparent.transparent"},"& .FlowHeaderNavigationLink-label":{opacity:"1"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"0"},...u&&{color:"text.primary","&&:after":{backgroundColor:"text.primary"},"& .FlowHeaderNavigationLink-label":{opacity:"0"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"1"}}},{color:"text.primary","&&:after":{backgroundColor:"text.primary"},"& .FlowHeaderNavigationLink-label":{opacity:"0"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"1"}}),...d(w),"&&:before":{borderRadius:"4px",top:void 0===f?{xs:"0",lg:"2px"}:["0","2px"][+!f],bottom:void 0===f?{xs:"0",lg:"-2px"}:["0","-2px"][+!f]}},t),ref:L,"data-testid":"HeaderNavigationLink",...k,children:[(x||g)&&o(l,{className:"FlowHeaderNavigationLink-labelWrapper",sx:n({display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",position:"relative"},N),...H,children:[e(l,{className:"FlowHeaderNavigationLink-label",sx:n({position:"absolute",left:void 0===f?{xs:"0",lg:"auto"}:["0","auto"][+!f]},F),...j,children:x||g}),e(l,{className:"FlowHeaderNavigationLink-selectedLabel",sx:n({fontWeight:"700",opacity:"0",position:"relative"},C),"aria-hidden":"true",...I,children:x||g})]}),S]})});export{x as HeaderNavigationLink};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as t,useMemo as i}from"react";import{useTheme as a,ButtonBase as r,Box as l}from"@mui/material";import{sxOverride as n}from"../../utils/sxOverride/sxOverride.js";import{ArrowTopRightIcon as s}from"../icon/stroke/ArrowTopRightIcon.js";import{getFocusRingStyle as d}from"../focusring/focusring.js";import{getInteractiveStyle as p}from"../../materialui/button/interactive.js";import{getTypography as c}from"../../materialui/typography/typography.theme.js";const x=t(({sx:t,children:x,label:g,icon:m,active:u=!1,external:b=!1,extend:f,labelWrapperProps:v,labelProps:y,selectedLabelProps:h,...k},L)=>{const w=a(),{sx:N,...H}=v??{},{sx:F,...j}=y??{},{sx:C,...I}=h??{},S=i(()=>b?e(s,{}):m,[m,b]);return o(r,{sx:n({...w.typography.list,...void 0===f?{[w.breakpoints.down("lg")]:{...c("body","rtl"===w.direction,"large")}}:[{"&&":{...c("body","rtl"===w.direction,"large")}},{}][+!f],position:"relative",zIndex:"100",display:void 0===f?{xs:"flex",lg:"inline-flex"}:["flex","inline-flex"][+!f],width:void 0===f?{xs:"100%",lg:"auto"}:["100%","auto"][+!f],gap:.5,alignItems:"center",justifyContent:"flex-start",py:void 0===f?{xs:2,lg:1}:[2,1][+!f],px:void 0===f?{xs:1,lg:.5}:[1,.5][+!f],transition:"transform 0.3s ease-out, color 0.3s ease-out, background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out","& .MuiSvgIcon-root":{fontSize:"14px"},"&:after":{content:void 0===f?{xs:"none",lg:'""'}:["none",'""'][+!f],position:"absolute",left:"0",right:"0",bottom:"0",height:"1px",backgroundColor:"transparent",...u&&{height:"2px",backgroundColor:"text.primary"}},"&.Mui-disabled":{color:"disabled.tertiary"},...p({color:"dark"===w.palette.mode?"onSurface.os300":"onSurface.os700","&&:after":{backgroundColor:"transparent"},"& .FlowHeaderNavigationLink-label":{opacity:"1"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"0"},...u&&{color:"text.primary","&&:after":{backgroundColor:"text.primary"},"& .FlowHeaderNavigationLink-label":{opacity:"0"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"1"}}},{color:"text.primary","&&:after":{backgroundColor:"text.primary"},"& .FlowHeaderNavigationLink-label":{opacity:"0"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"1"}}),...d(w),"&&:before":{borderRadius:"4px",top:void 0===f?{xs:"0",lg:"2px"}:["0","2px"][+!f],bottom:void 0===f?{xs:"0",lg:"-2px"}:["0","-2px"][+!f]}},t),ref:L,"data-testid":"HeaderNavigationLink",...k,children:[(x||g)&&o(l,{className:"FlowHeaderNavigationLink-labelWrapper",sx:n({display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",position:"relative"},N),...H,children:[e(l,{className:"FlowHeaderNavigationLink-label",sx:n({position:"absolute",left:void 0===f?{xs:"0",lg:"auto"}:["0","auto"][+!f]},F),...j,children:x||g}),e(l,{className:"FlowHeaderNavigationLink-selectedLabel",sx:n({fontWeight:"700",opacity:"0",position:"relative"},C),"aria-hidden":"true",...I,children:x||g})]}),S]})});export{x as HeaderNavigationLink};
2
2
  //# sourceMappingURL=HeaderNavigationLink.js.map