@pagopa/selfcare-common-frontend 1.35.0 → 1.35.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 (287) hide show
  1. package/CHANGELOG.md +875 -1
  2. package/README.md +34 -8
  3. package/examples/locale/en.d.ts +20 -0
  4. package/examples/locale/en.js +18 -0
  5. package/examples/locale/index.js +4 -0
  6. package/examples/locale/it.d.ts +20 -0
  7. package/examples/locale/it.js +19 -0
  8. package/{common-polyfill.d.ts → lib/common-polyfill.d.ts} +0 -1
  9. package/lib/common-polyfill.js +9 -0
  10. package/lib/components/BackComponent.d.ts +7 -0
  11. package/lib/components/BackComponent.js +8 -0
  12. package/lib/components/CustomAlert.d.ts +12 -0
  13. package/lib/components/CustomAlert.js +7 -0
  14. package/{components → lib/components}/CustomAvatar.d.ts +2 -3
  15. package/lib/components/CustomAvatar.js +13 -0
  16. package/{components → lib/components}/CustomPagination.d.ts +7 -3
  17. package/lib/components/CustomPagination.js +25 -0
  18. package/{components → lib/components}/EndingPage.d.ts +15 -3
  19. package/lib/components/EndingPage.js +4 -0
  20. package/lib/components/ErrorBoundary/ErrorBoundary.d.ts +11 -0
  21. package/lib/components/ErrorBoundary/ErrorBoundary.js +93 -0
  22. package/{components → lib/components}/ErrorBoundary/components/BlockingErrorPage.d.ts +2 -3
  23. package/lib/components/ErrorBoundary/components/BlockingErrorPage.js +11 -0
  24. package/{components → lib/components}/FilterModal.d.ts +3 -3
  25. package/lib/components/FilterModal.js +29 -0
  26. package/{components → lib/components}/Footer/Footer.d.ts +2 -3
  27. package/lib/components/Footer/Footer.js +179 -0
  28. package/{components → lib/components}/Footer/FooterConfig.js +5 -9
  29. package/{components → lib/components}/Header/Header.d.ts +11 -6
  30. package/lib/components/Header/Header.js +45 -0
  31. package/{components → lib/components}/Loading/LoadingOverlay.d.ts +1 -2
  32. package/lib/components/Loading/LoadingOverlay.js +13 -0
  33. package/lib/components/LoadingOverlayComponent.d.ts +7 -0
  34. package/lib/components/LoadingOverlayComponent.js +25 -0
  35. package/{components → lib/components}/NavigationBar.d.ts +5 -4
  36. package/lib/components/NavigationBar.js +17 -0
  37. package/{components → lib/components}/SessionModal.d.ts +3 -3
  38. package/lib/components/SessionModal.js +17 -0
  39. package/{components → lib/components}/TitleBox.d.ts +7 -7
  40. package/lib/components/TitleBox.js +9 -0
  41. package/{components → lib/components}/Toast.d.ts +3 -3
  42. package/lib/components/Toast.js +25 -0
  43. package/{components → lib/components}/ToastWrapper.d.ts +2 -2
  44. package/lib/components/ToastWrapper.js +12 -0
  45. package/{components → lib/components}/UnloadEventHandler.d.ts +1 -2
  46. package/lib/components/UnloadEventHandler.js +29 -0
  47. package/{components → lib/components}/UserNotifyHandle.d.ts +1 -2
  48. package/lib/components/UserNotifyHandle.js +62 -0
  49. package/{components → lib/components}/icons/CheckIllustrationIcon.d.ts +1 -2
  50. package/lib/components/icons/CheckIllustrationIcon.js +3 -0
  51. package/lib/components/icons/ConfirmIcon.js +4 -0
  52. package/{components → lib/components}/icons/ErrorIcon.d.ts +1 -2
  53. package/lib/components/icons/ErrorIcon.js +3 -0
  54. package/lib/components/icons/ErrorIconExclamation.js +4 -0
  55. package/lib/components/icons/FaultIcon.js +4 -0
  56. package/{components → lib/components}/icons/PagoPaIcon.d.ts +1 -2
  57. package/lib/components/icons/PagoPaIcon.js +3 -0
  58. package/{components → lib/components}/icons/PagoPaIconColored.d.ts +1 -2
  59. package/lib/components/icons/PagoPaIconColored.js +3 -0
  60. package/{components → lib/components}/icons/PagoPaMiniIcon.d.ts +1 -2
  61. package/lib/components/icons/PagoPaMiniIcon.js +3 -0
  62. package/lib/components/tests/FilterModal.test.d.ts +1 -0
  63. package/lib/components/tests/FilterModal.test.js +37 -0
  64. package/{config → lib/config}/env.d.ts +4 -1
  65. package/{config → lib/config}/env.js +13 -17
  66. package/lib/consentManagementConfigure.d.ts +1 -0
  67. package/{consentManagementConfigure.js → lib/consentManagementConfigure.js} +5 -8
  68. package/{decorators → lib/decorators}/__mocks__/withLogin.d.ts +1 -2
  69. package/lib/decorators/__mocks__/withLogin.js +18 -0
  70. package/{decorators → lib/decorators}/withLogin.d.ts +1 -2
  71. package/{decorators → lib/decorators}/withLogin.js +13 -18
  72. package/{decorators → lib/decorators}/withRetrievedValue.d.ts +1 -1
  73. package/{decorators → lib/decorators}/withRetrievedValue.js +9 -14
  74. package/lib/hooks/useErrorDispatcher.js +7 -0
  75. package/{hooks → lib/hooks}/useFakePagination.d.ts +3 -3
  76. package/{hooks → lib/hooks}/useFakePagination.js +9 -15
  77. package/lib/hooks/useFocus.d.ts +1 -0
  78. package/lib/hooks/useFocus.js +8 -0
  79. package/lib/hooks/useLiveAnnouncerWithRegion.d.ts +4 -0
  80. package/lib/hooks/useLiveAnnouncerWithRegion.js +19 -0
  81. package/lib/hooks/useLoading.js +10 -0
  82. package/lib/hooks/useLogin.js +40 -0
  83. package/lib/hooks/usePermissions.d.ts +7 -0
  84. package/lib/hooks/usePermissions.js +25 -0
  85. package/lib/hooks/useReduxCachedValue.d.ts +22 -0
  86. package/{hooks → lib/hooks}/useReduxCachedValue.js +10 -17
  87. package/{hooks → lib/hooks}/useUnloadEventInterceptor.d.ts +3 -3
  88. package/{hooks → lib/hooks}/useUnloadEventInterceptor.js +24 -32
  89. package/lib/hooks/useUserNotify.js +7 -0
  90. package/{index.d.ts → lib/index.d.ts} +11 -8
  91. package/lib/index.js +36 -0
  92. package/{locale/it.d.ts → lib/locale/de.d.ts} +4 -1
  93. package/{locale → lib/locale}/de.js +31 -31
  94. package/{locale → lib/locale}/en.d.ts +4 -1
  95. package/{locale → lib/locale}/en.js +30 -30
  96. package/{locale → lib/locale}/fr.d.ts +5 -2
  97. package/{locale → lib/locale}/fr.js +26 -26
  98. package/{locale/de.d.ts → lib/locale/it.d.ts} +8 -2
  99. package/{locale → lib/locale}/it.js +11 -8
  100. package/lib/locale/locale-utils.js +45 -0
  101. package/{locale → lib/locale}/sl.d.ts +5 -2
  102. package/{locale → lib/locale}/sl.js +31 -31
  103. package/{model → lib/model}/AppError.d.ts +1 -1
  104. package/lib/model/AppError.js +1 -0
  105. package/lib/model/JwtUser.d.ts +9 -0
  106. package/lib/model/JwtUser.js +1 -0
  107. package/{model → lib/model}/Page.d.ts +1 -1
  108. package/lib/model/Page.js +1 -0
  109. package/{model → lib/model}/PageRequest.d.ts +1 -1
  110. package/lib/model/PageRequest.js +1 -0
  111. package/{model → lib/model}/PageResource.d.ts +1 -1
  112. package/lib/model/PageResource.js +1 -0
  113. package/lib/model/User.d.ts +8 -0
  114. package/lib/model/User.js +1 -0
  115. package/{model → lib/model}/UserNotify.d.ts +1 -2
  116. package/lib/model/UserNotify.js +1 -0
  117. package/lib/redux/slices/appStateSlice.d.ts +58 -0
  118. package/{redux → lib/redux}/slices/appStateSlice.js +15 -9
  119. package/lib/redux/slices/permissionsSlice.d.ts +12 -0
  120. package/lib/redux/slices/permissionsSlice.js +23 -0
  121. package/lib/redux/slices/productsSlice.d.ts +204 -0
  122. package/lib/redux/slices/productsSlice.js +26 -0
  123. package/lib/redux/slices/userSlice.d.ts +36 -0
  124. package/lib/redux/slices/userSlice.js +17 -0
  125. package/{services → lib/services}/analyticsService.d.ts +2 -1
  126. package/{services → lib/services}/analyticsService.js +31 -28
  127. package/{services → lib/services}/assistanceService.d.ts +1 -1
  128. package/lib/services/assistanceService.js +14 -0
  129. package/lib/services/errorService.js +8 -0
  130. package/{utils → lib/utils}/api-utils.d.ts +3 -3
  131. package/{utils → lib/utils}/api-utils.js +28 -23
  132. package/lib/utils/constants.d.ts +67 -0
  133. package/lib/utils/constants.js +82 -0
  134. package/lib/utils/productId2ProductTitle.d.ts +1 -0
  135. package/lib/utils/productId2ProductTitle.js +13 -0
  136. package/lib/utils/routes-utils.js +2 -0
  137. package/{utils → lib/utils}/storage-utils.d.ts +3 -3
  138. package/{utils → lib/utils}/storage-utils.js +4 -12
  139. package/{utils → lib/utils}/storage.d.ts +6 -0
  140. package/lib/utils/storage.js +31 -0
  141. package/lib/utils/utils.d.ts +11 -0
  142. package/lib/utils/utils.js +148 -0
  143. package/{utils → lib/utils}/verifyChecksumMatchWithTaxCode.js +1 -6
  144. package/{utils → lib/utils}/verifyNameMatchWithTaxCode.d.ts +1 -1
  145. package/lib/utils/verifyNameMatchWithTaxCode.js +27 -0
  146. package/{utils → lib/utils}/verifySurnameMatchWithTaxCode.d.ts +1 -1
  147. package/lib/utils/verifySurnameMatchWithTaxCode.js +17 -0
  148. package/package.json +54 -79
  149. package/build.info +0 -2
  150. package/common-polyfill.js +0 -13
  151. package/common-polyfill.js.map +0 -1
  152. package/components/BackComponent.d.ts +0 -6
  153. package/components/BackComponent.js +0 -12
  154. package/components/BackComponent.js.map +0 -1
  155. package/components/CustomAvatar.js +0 -18
  156. package/components/CustomAvatar.js.map +0 -1
  157. package/components/CustomPagination.js +0 -31
  158. package/components/CustomPagination.js.map +0 -1
  159. package/components/EndingPage.js +0 -7
  160. package/components/EndingPage.js.map +0 -1
  161. package/components/ErrorBoundary/ErrorBoundary.d.ts +0 -11
  162. package/components/ErrorBoundary/ErrorBoundary.js +0 -98
  163. package/components/ErrorBoundary/ErrorBoundary.js.map +0 -1
  164. package/components/ErrorBoundary/components/BlockingErrorPage.js +0 -15
  165. package/components/ErrorBoundary/components/BlockingErrorPage.js.map +0 -1
  166. package/components/FilterModal.js +0 -37
  167. package/components/FilterModal.js.map +0 -1
  168. package/components/Footer/Footer.js +0 -213
  169. package/components/Footer/Footer.js.map +0 -1
  170. package/components/Footer/FooterConfig.js.map +0 -1
  171. package/components/Header/Header.js +0 -24
  172. package/components/Header/Header.js.map +0 -1
  173. package/components/Loading/LoadingOverlay.js +0 -18
  174. package/components/Loading/LoadingOverlay.js.map +0 -1
  175. package/components/LoadingOverlayComponent.d.ts +0 -7
  176. package/components/LoadingOverlayComponent.js +0 -20
  177. package/components/LoadingOverlayComponent.js.map +0 -1
  178. package/components/NavigationBar.js +0 -21
  179. package/components/NavigationBar.js.map +0 -1
  180. package/components/SessionModal.js +0 -21
  181. package/components/SessionModal.js.map +0 -1
  182. package/components/TitleBox.js +0 -13
  183. package/components/TitleBox.js.map +0 -1
  184. package/components/Toast.js +0 -29
  185. package/components/Toast.js.map +0 -1
  186. package/components/ToastWrapper.js +0 -16
  187. package/components/ToastWrapper.js.map +0 -1
  188. package/components/UnloadEventHandler.js +0 -35
  189. package/components/UnloadEventHandler.js.map +0 -1
  190. package/components/UserNotifyHandle.js +0 -67
  191. package/components/UserNotifyHandle.js.map +0 -1
  192. package/components/icons/CheckIllustrationIcon.js +0 -7
  193. package/components/icons/CheckIllustrationIcon.js.map +0 -1
  194. package/components/icons/ConfirmIcon.js +0 -7
  195. package/components/icons/ConfirmIcon.js.map +0 -1
  196. package/components/icons/ErrorIcon.js +0 -7
  197. package/components/icons/ErrorIcon.js.map +0 -1
  198. package/components/icons/ErrorIconExclamation.js +0 -7
  199. package/components/icons/ErrorIconExclamation.js.map +0 -1
  200. package/components/icons/FaultIcon.js +0 -7
  201. package/components/icons/FaultIcon.js.map +0 -1
  202. package/components/icons/PagoPaIcon.js +0 -7
  203. package/components/icons/PagoPaIcon.js.map +0 -1
  204. package/components/icons/PagoPaIconColored.js +0 -7
  205. package/components/icons/PagoPaIconColored.js.map +0 -1
  206. package/components/icons/PagoPaMiniIcon.js +0 -7
  207. package/components/icons/PagoPaMiniIcon.js.map +0 -1
  208. package/config/env.js.map +0 -1
  209. package/consentManagementConfigure.js.map +0 -1
  210. package/decorators/__mocks__/withLogin.js +0 -27
  211. package/decorators/__mocks__/withLogin.js.map +0 -1
  212. package/decorators/withLogin.js.map +0 -1
  213. package/decorators/withRetrievedValue.js.map +0 -1
  214. package/hooks/useErrorDispatcher.js +0 -11
  215. package/hooks/useErrorDispatcher.js.map +0 -1
  216. package/hooks/useFakePagination.js.map +0 -1
  217. package/hooks/useLoading.js +0 -14
  218. package/hooks/useLoading.js.map +0 -1
  219. package/hooks/useLogin.js +0 -44
  220. package/hooks/useLogin.js.map +0 -1
  221. package/hooks/useReduxCachedValue.d.ts +0 -14
  222. package/hooks/useReduxCachedValue.js.map +0 -1
  223. package/hooks/useUnloadEventInterceptor.js.map +0 -1
  224. package/hooks/useUserNotify.js +0 -11
  225. package/hooks/useUserNotify.js.map +0 -1
  226. package/index.js +0 -76
  227. package/index.js.map +0 -1
  228. package/locale/de.js.map +0 -1
  229. package/locale/en.js.map +0 -1
  230. package/locale/fr.js.map +0 -1
  231. package/locale/it.js.map +0 -1
  232. package/locale/locale-utils.js +0 -36
  233. package/locale/locale-utils.js.map +0 -1
  234. package/locale/sl.js.map +0 -1
  235. package/model/AppError.js +0 -3
  236. package/model/AppError.js.map +0 -1
  237. package/model/Page.js +0 -3
  238. package/model/Page.js.map +0 -1
  239. package/model/PageRequest.js +0 -3
  240. package/model/PageRequest.js.map +0 -1
  241. package/model/PageResource.js +0 -3
  242. package/model/PageResource.js.map +0 -1
  243. package/model/User.d.ts +0 -7
  244. package/model/User.js +0 -3
  245. package/model/User.js.map +0 -1
  246. package/model/UserNotify.js +0 -3
  247. package/model/UserNotify.js.map +0 -1
  248. package/redux/slices/appStateSlice.d.ts +0 -76
  249. package/redux/slices/appStateSlice.js.map +0 -1
  250. package/redux/slices/userSlice.d.ts +0 -18
  251. package/redux/slices/userSlice.js +0 -21
  252. package/redux/slices/userSlice.js.map +0 -1
  253. package/services/analyticsService.js.map +0 -1
  254. package/services/assistanceService.js +0 -20
  255. package/services/assistanceService.js.map +0 -1
  256. package/services/errorService.js +0 -13
  257. package/services/errorService.js.map +0 -1
  258. package/utils/api-utils.js.map +0 -1
  259. package/utils/constants.d.ts +0 -19
  260. package/utils/constants.js +0 -32
  261. package/utils/constants.js.map +0 -1
  262. package/utils/routes-utils.js +0 -7
  263. package/utils/routes-utils.js.map +0 -1
  264. package/utils/storage-utils.js.map +0 -1
  265. package/utils/storage.js +0 -9
  266. package/utils/storage.js.map +0 -1
  267. package/utils/utils.d.ts +0 -3
  268. package/utils/utils.js +0 -13
  269. package/utils/utils.js.map +0 -1
  270. package/utils/verifyChecksumMatchWithTaxCode.js.map +0 -1
  271. package/utils/verifyNameMatchWithTaxCode.js +0 -26
  272. package/utils/verifyNameMatchWithTaxCode.js.map +0 -1
  273. package/utils/verifySurnameMatchWithTaxCode.js +0 -23
  274. package/utils/verifySurnameMatchWithTaxCode.js.map +0 -1
  275. /package/{consentManagementConfigure.d.ts → examples/locale/index.d.ts} +0 -0
  276. /package/{components → lib/components}/Footer/FooterConfig.d.ts +0 -0
  277. /package/{components → lib/components}/icons/ConfirmIcon.d.ts +0 -0
  278. /package/{components → lib/components}/icons/ErrorIconExclamation.d.ts +0 -0
  279. /package/{components → lib/components}/icons/FaultIcon.d.ts +0 -0
  280. /package/{hooks → lib/hooks}/useErrorDispatcher.d.ts +0 -0
  281. /package/{hooks → lib/hooks}/useLoading.d.ts +0 -0
  282. /package/{hooks → lib/hooks}/useLogin.d.ts +0 -0
  283. /package/{hooks → lib/hooks}/useUserNotify.d.ts +0 -0
  284. /package/{locale → lib/locale}/locale-utils.d.ts +0 -0
  285. /package/{services → lib/services}/errorService.d.ts +0 -0
  286. /package/{utils → lib/utils}/routes-utils.d.ts +0 -0
  287. /package/{utils → lib/utils}/verifyChecksumMatchWithTaxCode.d.ts +0 -0
@@ -0,0 +1,179 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Footer as MuiItaliaFooter, } from '@pagopa/mui-italia';
3
+ import { useEffect } from 'react';
4
+ import { Trans, useTranslation } from 'react-i18next';
5
+ import { CONFIG } from '../../config/env';
6
+ import i18n from '../../locale/locale-utils';
7
+ import { LANGUAGES, pagoPALink } from './FooterConfig';
8
+ // eslint-disable-next-line sonarjs/cognitive-complexity
9
+ export default function Footer({ loggedUser, productsJsonUrl, onExit = (exitAction) => exitAction(), }) {
10
+ const { t } = useTranslation();
11
+ const currentLangByUrl = new URLSearchParams(window.location.search).get('lang');
12
+ const lang = (currentLangByUrl ? currentLangByUrl : i18n.language);
13
+ useEffect(() => {
14
+ if (lang) {
15
+ void i18n.changeLanguage(lang);
16
+ }
17
+ }, [lang]);
18
+ const preLoginLinks = {
19
+ // First column
20
+ aboutUs: {
21
+ title: undefined,
22
+ links: [
23
+ // TODO
24
+ // {
25
+ // label: 'PNRR',
26
+ // href: 'CONFIG.FOOTER.LINK.PNRR',
27
+ // ariaLabel: 'Vai al link: PNRR',
28
+ // linkType: 'internal',
29
+ // },
30
+ {
31
+ label: t('common.footer.preLoginLinks.aboutUs.links.aboutUs'),
32
+ href: CONFIG.FOOTER.LINK.ABOUTUS,
33
+ ariaLabel: `${t('common.footer.preLoginLinks.aboutUs.links.aboutUs')}: vai al link`,
34
+ linkType: 'internal',
35
+ },
36
+ {
37
+ label: t('common.footer.preLoginLinks.aboutUs.links.media'),
38
+ href: CONFIG.FOOTER.LINK.MEDIA,
39
+ ariaLabel: `${t('common.footer.preLoginLinks.aboutUs.links.media')}: vai al link`,
40
+ linkType: 'internal',
41
+ },
42
+ {
43
+ label: t('common.footer.preLoginLinks.aboutUs.links.workwithud'),
44
+ href: CONFIG.FOOTER.LINK.WORKWITHUS,
45
+ ariaLabel: `${t('common.footer.preLoginLinks.aboutUs.links.workwithud')}: vai al link`,
46
+ linkType: 'internal',
47
+ },
48
+ ],
49
+ },
50
+ // Third column
51
+ resources: {
52
+ title: t('common.footer.preLoginLinks.resources.title'),
53
+ links: [
54
+ {
55
+ label: t('common.footer.preLoginLinks.resources.links.privacyPolicy'),
56
+ href: CONFIG.FOOTER.LINK.PRIVACYPOLICY,
57
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.privacyPolicy')}: vai al link`,
58
+ linkType: 'internal',
59
+ },
60
+ {
61
+ label: t('common.footer.preLoginLinks.resources.links.certifications'),
62
+ href: CONFIG.FOOTER.LINK.CERTIFICATIONS,
63
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.certifications')}: vai al link`,
64
+ linkType: 'internal',
65
+ },
66
+ {
67
+ label: t('common.footer.preLoginLinks.resources.links.informationsecurity'),
68
+ href: CONFIG.FOOTER.LINK.INFORMATIONSECURITY,
69
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.informationsecurity')}: vai al link`,
70
+ linkType: 'internal',
71
+ },
72
+ {
73
+ label: t('common.footer.preLoginLinks.resources.links.protectionofpersonaldata'),
74
+ href: CONFIG.FOOTER.LINK.PROTECTIONOFPERSONALDATA,
75
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.protectionofpersonaldata')}: vai al link`,
76
+ linkType: 'internal',
77
+ },
78
+ {
79
+ label: t('common.footer.preLoginLinks.resources.links.cookies'),
80
+ onClick: () => window.OneTrust.ToggleInfoDisplay(),
81
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.cookies')}: vai al link`,
82
+ linkType: 'internal',
83
+ },
84
+ {
85
+ label: t('common.footer.preLoginLinks.resources.links.termsandconditions'),
86
+ href: CONFIG.FOOTER.LINK.TERMSANDCONDITIONS,
87
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.termsandconditions')}: vai al link`,
88
+ linkType: 'internal',
89
+ },
90
+ {
91
+ label: t('common.footer.preLoginLinks.resources.links.transparentcompany'),
92
+ href: CONFIG.FOOTER.LINK.TRANSPARENTCOMPANY,
93
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.transparentcompany')}: vai al link`,
94
+ linkType: 'internal',
95
+ },
96
+ {
97
+ label: t('common.footer.preLoginLinks.resources.links.disclosurePolicy'),
98
+ href: CONFIG.FOOTER.LINK.DISCLOSUREPOLICY,
99
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.disclosurePolicy')}: vai al link`,
100
+ linkType: 'internal',
101
+ },
102
+ {
103
+ label: t('common.footer.preLoginLinks.resources.links.model231'),
104
+ href: CONFIG.FOOTER.LINK.MODEL231,
105
+ ariaLabel: `${t('common.footer.preLoginLinks.resources.links.model231')}: vai al link`,
106
+ linkType: 'internal',
107
+ },
108
+ ],
109
+ },
110
+ // Fourth column
111
+ followUs: {
112
+ title: t('common.footer.preLoginLinks.followUs.title'),
113
+ socialLinks: [
114
+ {
115
+ icon: 'linkedin',
116
+ title: 'LinkedIn',
117
+ href: CONFIG.FOOTER.LINK.LINKEDIN,
118
+ ariaLabel: 'Link: vai al sito LinkedIn di PagoPA S.p.A.',
119
+ },
120
+ {
121
+ title: 'Twitter',
122
+ icon: 'twitter',
123
+ href: CONFIG.FOOTER.LINK.TWITTER,
124
+ ariaLabel: 'Link: vai al sito Twitter di PagoPA S.p.A.',
125
+ },
126
+ {
127
+ icon: 'instagram',
128
+ title: 'Instagram',
129
+ href: CONFIG.FOOTER.LINK.INSTAGRAM,
130
+ ariaLabel: 'Link: vai al sito Instagram di PagoPA S.p.A.',
131
+ },
132
+ {
133
+ icon: 'medium',
134
+ title: 'Medium',
135
+ href: CONFIG.FOOTER.LINK.MEDIUM,
136
+ ariaLabel: 'Link: vai al sito Medium di PagoPA S.p.A.',
137
+ },
138
+ ],
139
+ links: [
140
+ {
141
+ label: t('common.footer.preLoginLinks.accessibility'),
142
+ href: CONFIG.FOOTER.LINK.ACCESSIBILITY,
143
+ ariaLabel: `${t('common.footer.preLoginLinks.accessibility')}: vai al link`,
144
+ linkType: 'internal',
145
+ },
146
+ ],
147
+ },
148
+ };
149
+ const postLoginLinks = [
150
+ {
151
+ label: t('common.footer.postLoginLinks.privacyPolicy'),
152
+ href: CONFIG.FOOTER.LINK.PRIVACYPOLICY,
153
+ ariaLabel: `${t('common.footer.postLoginLinks.privacyPolicy')}: vai al link`,
154
+ linkType: 'internal',
155
+ },
156
+ {
157
+ label: t('common.footer.postLoginLinks.protectionofpersonaldata'),
158
+ href: CONFIG.FOOTER.LINK.PROTECTIONOFPERSONALDATA,
159
+ ariaLabel: `${t('common.footer.postLoginLinks.protectionofpersonaldata')}: vai al link`,
160
+ linkType: 'internal',
161
+ },
162
+ {
163
+ label: t('common.footer.postLoginLinks.termsandconditions'),
164
+ href: CONFIG.FOOTER.LINK.TERMSANDCONDITIONS,
165
+ ariaLabel: `${t('common.footer.postLoginLinks.termsandconditions')}: vai al link`,
166
+ linkType: 'internal',
167
+ },
168
+ {
169
+ label: t('common.footer.postLoginLinks.accessibility'),
170
+ href: CONFIG.FOOTER.LINK.ACCESSIBILITY,
171
+ ariaLabel: `${t('common.footer.postLoginLinks.accessibility')}: vai al link`,
172
+ linkType: 'internal',
173
+ },
174
+ ];
175
+ const companyLegalInfo = (_jsxs(Trans, { i18nKey: "common.footer.legalInfoText", children: [_jsx("strong", { children: "PagoPA S.p.A." }), " - Societ\u00E0 per azioni con socio unico - Capitale sociale di euro 1,000,000 interamente versato - Sede legale in Roma, Piazza Colonna 370, ", _jsx("br", {}), "CAP 00187 - N. di iscrizione a Registro Imprese di Roma, CF e P.IVA 15376371009"] }));
176
+ return (_jsx(MuiItaliaFooter, { companyLink: pagoPALink, postLoginLinks: postLoginLinks, preLoginLinks: preLoginLinks, legalInfo: companyLegalInfo, loggedUser: loggedUser, onExit: onExit, languages: LANGUAGES, onLanguageChanged: async (language) => {
177
+ await i18n.changeLanguage(language);
178
+ }, currentLangCode: lang, productsJsonUrl: productsJsonUrl }));
179
+ }
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LANGUAGES = exports.pagoPALink = void 0;
4
- const env_1 = require("../../config/env");
5
- exports.pagoPALink = {
6
- href: env_1.CONFIG.FOOTER.LINK.PAGOPALINK,
7
- ariaLabel: 'Link: vai al sito di PagoPA S.p.A.',
1
+ import { CONFIG } from '../../config/env';
2
+ export const pagoPALink = {
3
+ href: CONFIG.FOOTER.LINK.PAGOPALINK,
4
+ ariaLabel: 'PagoPA S.p.A.: vai al sito',
8
5
  };
9
- exports.LANGUAGES = {
6
+ export const LANGUAGES = {
10
7
  it: {
11
8
  it: 'Italiano',
12
9
  en: 'Inglese',
@@ -43,4 +40,3 @@ exports.LANGUAGES = {
43
40
  sl: 'Slovenski',
44
41
  },
45
42
  };
46
- //# sourceMappingURL=FooterConfig.js.map
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
- import { JwtUser, UserAction, ProductSwitchItem, ProductEntity } from '@pagopa/mui-italia';
3
- import { PartySwitchItem } from '@pagopa/mui-italia/dist/components/PartySwitch';
4
- declare type PartyEntity = PartySwitchItem;
5
- declare type HeaderProps = {
1
+ import { JwtUser, ProductEntity, ProductSwitchItem, UserAction } from '@pagopa/mui-italia';
2
+ import { PartySwitchItem } from '@pagopa/mui-italia/components/PartySwitch';
3
+ type PartyEntity = PartySwitchItem;
4
+ type HeaderProps = {
6
5
  /** If true, it will render an other toolbar under the Header */
7
6
  withSecondHeader: boolean;
8
7
  /** The list of products in header */
@@ -35,7 +34,13 @@ declare type HeaderProps = {
35
34
  maxCharactersNumberMultiLineItem?: number;
36
35
  /** If false hides assistance button */
37
36
  enableAssistanceButton?: boolean;
37
+ /** A callback function that controls the visibility of the documentation button and handles user clicks on the documentation button. */
38
+ onDocumentationClick?: () => void;
39
+ /** A callback function that handles user clicks on the logout button. */
40
+ onLogoutClick?: () => void;
41
+ /** An optional fixed list of parties to be shown in the party switcher */
42
+ fixedParty?: PartyEntity;
38
43
  };
39
44
  /** SelfCare Header component */
40
- declare const Header: ({ withSecondHeader, productsList, selectedPartyId, selectedProductId, partyList, loggedUser, assistanceEmail, enableLogin, userActions, enableDropdown, addSelfcareProduct, onExit, onSelectedProduct, onSelectedParty, maxCharactersNumberMultiLineButton, maxCharactersNumberMultiLineItem, enableAssistanceButton, }: HeaderProps) => JSX.Element;
45
+ declare const Header: ({ withSecondHeader, productsList, selectedPartyId, selectedProductId, partyList, loggedUser, assistanceEmail, enableLogin, userActions, enableDropdown, addSelfcareProduct, onExit, onSelectedProduct, onSelectedParty, maxCharactersNumberMultiLineButton, maxCharactersNumberMultiLineItem, enableAssistanceButton, onDocumentationClick, onLogoutClick, fixedParty, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
41
46
  export default Header;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { HeaderAccount, HeaderProduct, } from '@pagopa/mui-italia';
3
+ import { Fragment, useMemo } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { useLocation } from 'react-router-dom';
6
+ import { CONFIG } from '../../config/env';
7
+ import { buildAssistanceURI } from '../../services/assistanceService';
8
+ import { isPagoPaUser } from '../../utils/storage';
9
+ const SELFCARE_PRODUCT = {
10
+ id: 'prod-selfcare',
11
+ title: 'Area Riservata',
12
+ productUrl: CONFIG.HEADER.LINK.PRODUCTURL,
13
+ linkType: 'internal',
14
+ };
15
+ const BACKSTAGE_PRODUCT = {
16
+ id: 'prod-selfcare-backstage',
17
+ title: 'Area Riservata Backstage',
18
+ productUrl: CONFIG.HEADER.LINK.PRODUCTURL,
19
+ linkType: 'internal',
20
+ };
21
+ const ROOT_LINK = {
22
+ label: 'PagoPA S.p.A.',
23
+ href: CONFIG.HEADER.LINK.ROOTLINK,
24
+ ariaLabel: 'Link: vai al sito di PagoPA S.p.A.',
25
+ title: 'Sito di PagoPA S.p.A.',
26
+ };
27
+ /** SelfCare Header component */
28
+ const Header = ({ withSecondHeader, productsList = [], selectedPartyId, selectedProductId, partyList = [], loggedUser, assistanceEmail, enableLogin = true, userActions = [], enableDropdown = false, addSelfcareProduct = true, onExit = (exitAction) => exitAction(), onSelectedProduct, onSelectedParty, maxCharactersNumberMultiLineButton, maxCharactersNumberMultiLineItem, enableAssistanceButton = true, onDocumentationClick, onLogoutClick, fixedParty, }) => {
29
+ const { t } = useTranslation();
30
+ const { pathname } = useLocation();
31
+ // Logic Derivation
32
+ const isAdminPage = pathname.includes('/admin');
33
+ const productToRender = isAdminPage ? BACKSTAGE_PRODUCT : SELFCARE_PRODUCT;
34
+ const renderedPartyList = fixedParty ? [fixedParty] : partyList;
35
+ const renderedPartyId = fixedParty ? fixedParty.id : selectedPartyId;
36
+ // Memoize the product list
37
+ const fullProductList = useMemo(() => (addSelfcareProduct ? [productToRender, ...productsList] : productsList), [addSelfcareProduct, productToRender, productsList]);
38
+ return (_jsxs(Fragment, { children: [_jsx("header", { children: _jsx(HeaderAccount, { rootLink: ROOT_LINK, loggedUser: loggedUser, onAssistanceClick: () => onExit(() => window.location.assign(buildAssistanceURI(assistanceEmail))), onLogin: () => onExit(() => window.location.assign(CONFIG.URL_FE.LOGIN)), onLogout: onLogoutClick ?? (() => onExit(() => window.location.assign(CONFIG.URL_FE.LOGOUT))), enableLogin: enableLogin, userActions: userActions, enableDropdown: enableDropdown, enableAssistanceButton: enableAssistanceButton, onDocumentationClick: onDocumentationClick }) }), withSecondHeader === true ? (_jsx("nav", { children: _jsx(HeaderProduct, { productId: selectedProductId || productToRender.id, productsList: fullProductList, partyId: renderedPartyId, partyList: renderedPartyList, onSelectedProduct: onSelectedProduct, onSelectedParty: onSelectedParty, maxCharactersNumberMultiLineButton: maxCharactersNumberMultiLineButton, maxCharactersNumberMultiLineItem: maxCharactersNumberMultiLineItem, ...(isPagoPaUser() &&
39
+ !isAdminPage && {
40
+ chipLabel: t('common.header.chipLabel'),
41
+ chipColor: 'primary',
42
+ chipSize: 'medium',
43
+ }) }) })) : ('')] }));
44
+ };
45
+ export default Header;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
3
2
  It allows to draw a loader when an async task to wait is running.
4
3
 
5
4
  To use this feature you have to put LoadingOverlay in your App as a child of a redux Provider component.
6
5
  In order to register the start of an async task you have to use the custom hook useLoading passing the id of the task to await, which will return a setter function used to start and end the loading behavior. */
7
- export default function LoadingOverlay(): JSX.Element;
6
+ export default function LoadingOverlay(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSelector } from 'react-redux';
3
+ import { appStateSelectors } from '../../redux/slices/appStateSlice';
4
+ import LoadingOverlayComponent from '../LoadingOverlayComponent';
5
+ /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
6
+ It allows to draw a loader when an async task to wait is running.
7
+
8
+ To use this feature you have to put LoadingOverlay in your App as a child of a redux Provider component.
9
+ In order to register the start of an async task you have to use the custom hook useLoading passing the id of the task to await, which will return a setter function used to start and end the loading behavior. */
10
+ export default function LoadingOverlay() {
11
+ const loading = useSelector(appStateSelectors.selectLoading);
12
+ return _jsx(LoadingOverlayComponent, { open: loading });
13
+ }
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ open: boolean;
3
+ loadingMessage?: string;
4
+ };
5
+ /** A component which render an overlay loading */
6
+ export default function LoadingOverlayComponent({ open, loadingMessage }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Modal, useTheme } from '@mui/material';
3
+ import { Box } from '@mui/system';
4
+ import MDSpinner from 'react-md-spinner';
5
+ /** A component which render an overlay loading */
6
+ export default function LoadingOverlayComponent({ open, loadingMessage = 'Caricamento in corso' }) {
7
+ const theme = useTheme();
8
+ return (_jsx(Modal, { open: open, sx: { outline: 0, zIndex: 1500 }, "aria-labelledby": "loading-modal-title", children: _jsxs(Box, { sx: {
9
+ position: 'absolute',
10
+ top: '50%',
11
+ left: '50%',
12
+ width: '100px',
13
+ outline: 0,
14
+ }, role: "status", "aria-live": "assertive", "aria-atomic": "true", "aria-busy": "true", children: [_jsx("span", { id: "loading-modal-title", style: {
15
+ position: 'absolute',
16
+ width: '1px',
17
+ height: '1px',
18
+ padding: '0',
19
+ margin: '-1px',
20
+ overflow: 'hidden',
21
+ clip: 'rect(0,0,0,0)',
22
+ whiteSpace: 'nowrap',
23
+ border: '0'
24
+ }, children: loadingMessage }), _jsx(MDSpinner, { singleColor: theme.palette.primary.main, role: "loadingSpinner" })] }) }));
25
+ }
@@ -1,17 +1,18 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconComponent } from '@mui/icons-material';
3
- declare type Props = {
2
+ type Props = {
4
3
  paths: Array<NavigationPath>;
5
4
  goBack?: () => void;
5
+ backLabel?: string;
6
6
  backLinkTextDecoration?: string;
7
7
  backLinkFontWeight?: string;
8
8
  backLinkFontSize?: string;
9
9
  showBackComponent?: boolean;
10
+ color?: string;
10
11
  };
11
- export declare type NavigationPath = {
12
+ export type NavigationPath = {
12
13
  description: string;
13
14
  onClick?: () => void;
14
15
  icon?: SvgIconComponent;
15
16
  };
16
- export default function NavigationBar({ paths, goBack, showBackComponent }: Props): JSX.Element;
17
+ export default function NavigationBar({ paths, goBack, showBackComponent, backLabel, color, }: Props): import("react/jsx-runtime").JSX.Element;
17
18
  export {};
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
3
+ import { Box, Breadcrumbs, Icon, Typography } from '@mui/material';
4
+ import { ButtonNaked } from '@pagopa/mui-italia';
5
+ import { useUnloadEventOnExit } from '../hooks/useUnloadEventInterceptor';
6
+ import BackComponent from './BackComponent';
7
+ export default function NavigationBar({ paths, goBack, showBackComponent, backLabel, color, }) {
8
+ const onExit = useUnloadEventOnExit();
9
+ const truncatedText = {
10
+ display: 'inline-block',
11
+ maxWidth: '50ch',
12
+ whiteSpace: 'nowrap',
13
+ overflow: 'hidden',
14
+ textOverflow: 'ellipsis',
15
+ };
16
+ return (_jsxs(Box, { display: "flex", children: [showBackComponent && (_jsx(Box, { mr: 2, display: "flex", alignItems: 'center', children: _jsx(BackComponent, { goBack: goBack, backLabel: backLabel, color: color }) })), !showBackComponent && (_jsx(Box, { display: "flex", alignItems: 'center', children: _jsx(Breadcrumbs, { "aria-label": "breadcrumb", separator: _jsx(ArrowForwardIosIcon, { style: { height: '8px', width: '8px' } }), children: paths.map((p) => p.onClick ? (_jsx(Box, { display: "flex", alignItems: "center", justifyContent: "center", children: _jsx(ButtonNaked, { component: "button", onClick: () => onExit(p.onClick), startIcon: p.icon && _jsx(Icon, { component: p.icon }), sx: { color: 'colorTextPrimary' }, children: _jsx(Typography, { variant: "body2", sx: { ...truncatedText, fontWeight: 'fontWeightMedium' }, children: p.description }) }) }, p.description)) : (_jsxs(Box, { display: "flex", children: [p.icon && (_jsx(Box, { mr: 1, display: "flex", alignItems: "center", children: _jsx(Icon, { component: p.icon }) })), _jsx(Box, { display: "flex", alignItems: "center", children: _jsx(Typography, { variant: "body2", sx: { ...truncatedText, fontSize: 'fontSize' }, children: p.description }, p.description) })] }, p.description))) }) }))] }));
17
+ }
@@ -1,6 +1,6 @@
1
+ import { TFunction } from 'i18next';
1
2
  import * as React from 'react';
2
- import { TFunction } from 'react-i18next';
3
- declare type Props = {
3
+ type Props = {
4
4
  /** If this component should be displayed or not */
5
5
  open: boolean;
6
6
  /** The title to show in the popup */
@@ -36,5 +36,5 @@ declare type Props = {
36
36
  /** If false not show the close button, default true */
37
37
  showCloseButton?: boolean;
38
38
  };
39
- declare const _default: React.ComponentType<Omit<import("react-i18next").Subtract<Props, import("react-i18next").WithTranslationProps>, keyof import("react-i18next").WithTranslation<N>> & import("react-i18next").WithTranslationProps>;
39
+ declare const _default: React.ComponentType<Omit<Props, "t">>;
40
40
  export default _default;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ClearOutlinedIcon from '@mui/icons-material/ClearOutlined';
3
+ import { Box, Button, Grid, IconButton, Typography } from '@mui/material';
4
+ import Dialog from '@mui/material/Dialog';
5
+ import { useTheme } from '@mui/material/styles';
6
+ import useMediaQuery from '@mui/material/useMediaQuery';
7
+ import { withTranslation } from 'react-i18next';
8
+ /** Selfcare's popup */
9
+ function SessionModal({ t, open, title, message, onConfirm, onConfirmEnabled = true, onConfirmLabel = t('common.sessionModal.confirmButton'), productEnvironments, handleClose, handleExit = handleClose, onCloseLabel = t('common.sessionModal.closeButton'), height, minHeight, width = '100%', showCloseIcon = false, showCloseButton = true, }) {
10
+ const theme = useTheme();
11
+ const fullScreen = useMediaQuery(theme.breakpoints.down('xs'));
12
+ return (_jsx(Dialog, { fullScreen: fullScreen, open: open, onClose: handleClose, "aria-labelledby": "session-modal-title", "aria-describedby": "session-modal-description", children: _jsxs(Grid, { container: true, sx: { height, minHeight, width, maxWidth: '100%' }, px: 4, children: [_jsxs(Grid, { item: true, xs: 12, mt: 4, children: [showCloseIcon && (_jsx(IconButton, { onClick: handleExit, style: { position: 'absolute', top: '20px', right: '16px', zIndex: 100 }, children: _jsx(ClearOutlinedIcon, {}) })), _jsx(Typography, { id: "session-modal-title", variant: "h6", sx: { fontSize: '24px', fontWeight: '700', wordBreak: 'break-word' }, children: title })] }), _jsxs(Box, { width: "100%", children: [_jsx(Grid, { item: true, xs: 12, mt: 2, mb: 3, children: _jsx(Typography, { id: "session-modal-description", variant: "body1", children: message }) }), _jsxs(Grid, { item: true, xs: 12, display: "flex", justifyContent: productEnvironments ? 'space-between' : 'flex-end', flexWrap: 'wrap-reverse', children: [showCloseButton && (_jsx(Box, { mb: 3, mt: 0, children: _jsx(Button, { onClick: handleClose, color: "primary", variant: "outlined", children: onCloseLabel }) })), onConfirm && (_jsxs(Box, { mb: 3, display: "flex", flexDirection: "row-reverse", children: [_jsx(Button, { sx: { marginLeft: 2 }, color: "primary", variant: "contained", onClick: onConfirm, disabled: !onConfirmEnabled, children: onConfirmLabel }), productEnvironments?.map((p) => (_jsx(Box, { ml: 2, children: _jsx(Button, { value: p.environment, color: "primary", variant: "contained", onClick: onConfirm, children: p.environment
13
+ .toLowerCase()
14
+ .replace(/\b[a-z]/g, p.environment.charAt(0).toUpperCase()) }) }, p.environment)))] }))] })] })] }) }));
15
+ }
16
+ const SessionModalWithTranslation = withTranslation()(SessionModal);
17
+ export default SessionModalWithTranslation;
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { Variant } from '@mui/material/styles/createTypography';
3
- declare type Props = {
4
- /** The title to show */
5
- title: string;
6
- /** The subtitle to show */
7
- subTitle?: string;
2
+ import { ReactNode } from 'react';
3
+ type Props = {
4
+ /** The title to show (can be a string or JSX) */
5
+ title: ReactNode;
6
+ /** The subtitle to show (can be a string or JSX) */
7
+ subTitle?: ReactNode;
8
8
  /** The margin top of the title */
9
9
  mtTitle?: number;
10
10
  /** The margin bottom of the title */
@@ -21,5 +21,5 @@ declare type Props = {
21
21
  subTitleFontSize?: string;
22
22
  };
23
23
  /** Selfcare's page title */
24
- export default function TitleBox({ title, subTitle, mbTitle, mtTitle, mbSubTitle, variantTitle, variantSubTitle, titleFontSize, subTitleFontSize, }: Props): JSX.Element;
24
+ export default function TitleBox({ title, subTitle, mbTitle, mtTitle, mbSubTitle, variantTitle, variantSubTitle, titleFontSize, subTitleFontSize, }: Props): import("react/jsx-runtime").JSX.Element;
25
25
  export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // import React from 'react'
3
+ // import { Box } from '@mui/material';
4
+ import { Typography } from '@mui/material';
5
+ import { Grid } from '@mui/material';
6
+ /** Selfcare's page title */
7
+ export default function TitleBox({ title, subTitle, mbTitle = 2, mtTitle, mbSubTitle, variantTitle = 'h1', variantSubTitle = 'h5', titleFontSize, subTitleFontSize = '18px', }) {
8
+ return (_jsxs(Grid, { container: true, mt: mtTitle, children: [_jsx(Grid, { item: true, xs: 12, mb: mbTitle, children: _jsx(Typography, { variant: variantTitle, sx: { fontSize: titleFontSize }, children: title }) }), subTitle && (_jsx(Grid, { item: true, xs: 12, mb: mbSubTitle, children: _jsx(Typography, { variant: variantSubTitle, sx: { fontSize: subTitleFontSize }, children: subTitle }) }))] }));
9
+ }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type Props = {
2
+ type Props = {
3
3
  /** If this component should be displayed or not */
4
4
  open: boolean;
5
5
  /** The logo to be rendered. As default a confirm logo will be used */
@@ -13,7 +13,7 @@ declare type Props = {
13
13
  /** The function to be invoked when closing the toast */
14
14
  onCloseToast: () => void;
15
15
  /** The toast width */
16
- width?: string | undefined;
16
+ width?: string;
17
17
  /** If true, it will not position itself as fixed */
18
18
  wrapped?: boolean;
19
19
  /** If not wrapped, the pixel from the bottom of the viewport where to place the toast. Default "64px" */
@@ -26,5 +26,5 @@ declare type Props = {
26
26
  toastColorIcon?: string;
27
27
  };
28
28
  /** Selfcare's toast */
29
- export default function Toast({ open, title, message, onCloseToast, logo, leftBorderColor, width, wrapped, bottom, right, showToastCloseIcon, toastColorIcon, }: Props): JSX.Element;
29
+ export default function Toast({ open, title, message, onCloseToast, logo, leftBorderColor, width, wrapped, bottom, right, showToastCloseIcon, toastColorIcon, }: Readonly<Props>): import("react/jsx-runtime").JSX.Element;
30
30
  export {};
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ import { Alert, Grid, Typography, IconButton, SvgIcon } from '@mui/material';
4
+ import { styled } from '@mui/system';
5
+ import CloseIcon from '@mui/icons-material/Close';
6
+ import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
7
+ const CustomAlert = styled(Alert)({
8
+ '.MuiAlert-icon': { display: 'none' },
9
+ });
10
+ /** Selfcare's toast */
11
+ export default function Toast({ open, title, message, onCloseToast, logo = CheckCircleOutlineIcon, leftBorderColor = '#6CC66A', width = '376px', wrapped = false, bottom = '64px', right = '64px', showToastCloseIcon = false, toastColorIcon = '#6CC66A', }) {
12
+ const positionStyle = !wrapped
13
+ ? { position: 'fixed', bottom, right, zIndex: 500 }
14
+ : { marginTop: 2 };
15
+ return (_jsx(Fragment, { children: open && (_jsx(CustomAlert, { className: "userToast", variant: "outlined", sx: {
16
+ ...positionStyle,
17
+ width: { width },
18
+ backgroundColor: 'white',
19
+ borderLeft: `4px solid ${leftBorderColor} !important`,
20
+ borderRadius: '5px',
21
+ boxShadow: '0px 0px 45px rgba(0, 0, 0, 0.1) ',
22
+ border: 'none',
23
+ padding: '16px',
24
+ }, children: _jsxs(Grid, { container: true, children: [_jsx(Grid, { item: true, xs: 1, display: "flex", alignItems: "center", justifyContent: "center", mr: 2, children: _jsx(SvgIcon, { fontSize: "small", component: logo, sx: { color: toastColorIcon, width: '140px' } }) }), _jsxs(Grid, { container: true, item: true, xs: showToastCloseIcon ? 9 : 10, display: "flex", justifyContent: "center", direction: "column", children: [_jsx(Typography, { sx: { fontSize: 'fontSize', fontWeight: 'fontWeightMedium' }, children: title }), message && _jsx(Typography, { sx: { fontSize: 'fontSize' }, children: message })] }), showToastCloseIcon && (_jsx(Grid, { item: true, xs: 1, children: _jsx(IconButton, { onClick: onCloseToast, children: _jsx(CloseIcon, { sx: { fontSize: 'big' } }) }) }))] }) })) }));
25
+ }
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- declare type Props = {
2
+ type Props = {
3
3
  children: Array<ReactNode>;
4
4
  /** The pixel from the bottom of the viewport where to place the toast. Default "64px" */
5
5
  bottom?: string;
@@ -7,5 +7,5 @@ declare type Props = {
7
7
  right?: string;
8
8
  };
9
9
  /** To stack multiple Toast component. Each Toast should have the prop wrapped setted to true */
10
- export default function ToastWrapper({ children, bottom, right }: Props): JSX.Element;
10
+ export default function ToastWrapper({ children, bottom, right }: Props): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ import { Box } from '@mui/material';
4
+ /** To stack multiple Toast component. Each Toast should have the prop wrapped setted to true */
5
+ export default function ToastWrapper({ children, bottom = '64px', right = '64px' }) {
6
+ return (_jsx(Fragment, { children: _jsx(Box, { sx: {
7
+ position: 'fixed',
8
+ bottom: { bottom },
9
+ right: { right },
10
+ zIndex: 500,
11
+ }, children: children.slice().reverse() }) }));
12
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
3
2
  It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
4
3
 
@@ -6,4 +5,4 @@ To use this feature you have to put UnloadEventHandler in your App as a child of
6
5
  In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
7
6
  @see {@link useUnloadEventInterceptor}
8
7
  */
9
- export default function UnloadEventHandler(): JSX.Element;
8
+ export default function UnloadEventHandler(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTranslation } from 'react-i18next';
3
+ import { useSelector, useDispatch } from 'react-redux';
4
+ import { useUnloadEventInterceptor } from '../hooks/useUnloadEventInterceptor';
5
+ import { appStateSelectors, appStateActions } from '../redux/slices/appStateSlice';
6
+ import SessionModal from './SessionModal';
7
+ /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
8
+ It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
9
+
10
+ To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
11
+ In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
12
+ @see {@link useUnloadEventInterceptor}
13
+ */
14
+ export default function UnloadEventHandler() {
15
+ const dispatch = useDispatch();
16
+ const unloadEventconfiguration = useSelector(appStateSelectors.selectUnloadEventConfiguration);
17
+ const { unregisterUnloadEvent } = useUnloadEventInterceptor();
18
+ const onClose = () => {
19
+ dispatch(appStateActions.closeUnloadEventNotify());
20
+ };
21
+ const onConfirm = () => {
22
+ unregisterUnloadEvent();
23
+ if (unloadEventconfiguration.exitAction) {
24
+ unloadEventconfiguration.exitAction();
25
+ }
26
+ };
27
+ const { t } = useTranslation();
28
+ return (_jsx(SessionModal, { open: unloadEventconfiguration.enabled && unloadEventconfiguration.open, title: unloadEventconfiguration.title ?? t('common.unloadEventHandler.title'), message: unloadEventconfiguration.description ?? t('common.unloadEventHandler.message'), onConfirm: onConfirm, onConfirmLabel: t('common.unloadEventHandler.confirmLabel'), handleClose: onClose }));
29
+ }
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
3
2
  It allows to dispatch User Notifies in order to display a pop up or a toast notification.
4
3
 
5
4
  To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
6
5
  In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify. */
7
- declare function UserNotifyHandle(): JSX.Element;
6
+ declare function UserNotifyHandle(): import("react/jsx-runtime").JSX.Element;
8
7
  export default UserNotifyHandle;