@cnamts/synapse 1.0.16 → 1.0.17

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 (248) hide show
  1. package/dist/{DateFilter-DSwJUvBu.js → DateFilter-RHtdShO1.js} +1 -1
  2. package/dist/{NumberFilter-CwsbYyz4.js → NumberFilter-DXYz_b_w.js} +1 -1
  3. package/dist/{PeriodFilter-csnEZU30.js → PeriodFilter-CzphmrNu.js} +1 -1
  4. package/dist/{SelectFilter-Bd5fndzR.js → SelectFilter-a4fUV5Jp.js} +1 -1
  5. package/dist/{TextFilter-B6gxzq2a.js → TextFilter-CZ4LTKoq.js} +1 -1
  6. package/dist/components/Accordion/Accordion.d.ts +22 -7
  7. package/dist/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.d.ts +31 -8
  8. package/dist/components/Amelipro/AmeliproPatientLogged/types.d.ts +2 -1
  9. package/dist/components/Amelipro/AmeliproTabs/AmeliproTabBtn/AmeliproTabBtn.d.ts +1 -1
  10. package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +14 -5
  11. package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +10 -1
  12. package/dist/components/Amelipro/AmeliproTooltips/AmeliproTooltips.d.ts +6 -2
  13. package/dist/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.d.ts +9 -0
  14. package/dist/components/Amelipro/StructureMenu/StructureItem/types.d.ts +1 -0
  15. package/dist/components/Amelipro/StructureMenu/StructureMenu.d.ts +9 -0
  16. package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +23 -2
  17. package/dist/components/ChipList/locales.d.ts +1 -0
  18. package/dist/components/CookieBanner/CookieBanner.d.ts +2 -2
  19. package/dist/components/Customs/SyTextField/SyTextField.d.ts +1 -1
  20. package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +4 -4
  21. package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +9 -11
  22. package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +7 -10
  23. package/dist/components/DatePicker/composables/index.d.ts +0 -1
  24. package/dist/components/DialogBox/DialogBox.d.ts +3 -3
  25. package/dist/components/DialogBox/config.d.ts +4 -0
  26. package/dist/components/FilterSideBar/FilterSideBar.d.ts +10 -3
  27. package/dist/components/FilterSideBar/locales.d.ts +5 -0
  28. package/dist/components/HeaderBar/HeaderBar.d.ts +2 -0
  29. package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +14 -4
  30. package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +5 -1
  31. package/dist/components/MaintenancePage/MaintenancePage.d.ts +8 -1
  32. package/dist/components/NotFoundPage/NotFoundPage.d.ts +9 -2
  33. package/dist/components/NotificationBar/Notification/Notification.d.ts +30 -0
  34. package/dist/components/NotificationBar/NotificationBar.d.ts +32 -20
  35. package/dist/components/PeriodField/PeriodField.d.ts +16 -16
  36. package/dist/components/SubHeader/SubHeader.d.ts +11 -8
  37. package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
  38. package/dist/components/SyTextArea/locales.d.ts +1 -0
  39. package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +2 -0
  40. package/dist/design-system-v3.js +1 -1
  41. package/dist/design-system-v3.umd.cjs +18 -18
  42. package/dist/directives/lockFocus.d.ts +1 -1
  43. package/dist/{main-DkZZpa3S.js → main-BXIMMzFS.js} +9368 -9157
  44. package/dist/style.css +1 -1
  45. package/package.json +11 -4
  46. package/src/components/Accordion/Accessibilite/AccessibilityGuide.mdx +70 -241
  47. package/src/components/Accordion/Accordion.mdx +6 -1
  48. package/src/components/Accordion/Accordion.stories.ts +88 -9
  49. package/src/components/Accordion/Accordion.vue +56 -24
  50. package/src/components/Accordion/tests/Accordion.a11y.spec.ts +46 -0
  51. package/src/components/Accordion/tests/__snapshots__/accordion.spec.ts.snap +26 -30
  52. package/src/components/Accordion/tests/accordion.spec.ts +27 -26
  53. package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.stories.ts +62 -34
  54. package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.vue +48 -15
  55. package/src/components/Amelipro/AmeliproPatientLogged/__tests__/AmeliproPatientLogged.spec.ts +4 -2
  56. package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +54 -4
  57. package/src/components/Amelipro/AmeliproPatientLogged/types.d.ts +2 -1
  58. package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLogin.stories.ts +11 -5
  59. package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/AmeliproPatientLoginForm.vue +8 -0
  60. package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +37 -1
  61. package/src/components/Amelipro/AmeliproSelect/__tests__/__snapshots__/AmeliproSelect.spec.ts.snap +2 -2
  62. package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.stories.ts +94 -0
  63. package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +6 -2
  64. package/src/components/Amelipro/AmeliproTabs/__tests__/AmeliproTabs.spec.ts +4 -0
  65. package/src/components/Amelipro/AmeliproTabs/__tests__/__snapshots__/AmeliproTabs.spec.ts.snap +4 -2
  66. package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.stories.ts +68 -0
  67. package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +110 -2
  68. package/src/components/Amelipro/AmeliproTextField/__tests__/AmeliproTextField.spec.ts +14 -2
  69. package/src/components/Amelipro/AmeliproTextField/__tests__/__snapshots__/AmeliproTextField.spec.ts.snap +2 -0
  70. package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.stories.ts +45 -0
  71. package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.vue +6 -0
  72. package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +13 -0
  73. package/src/components/Amelipro/StructureMenu/StructureBtn/__tests__/StructureBtn.spec.ts +6 -0
  74. package/src/components/Amelipro/StructureMenu/StructureBtn/__tests__/__snapshots__/StructureBtn.spec.ts.snap +1 -1
  75. package/src/components/Amelipro/StructureMenu/StructureItem/StructureItem.vue +14 -2
  76. package/src/components/Amelipro/StructureMenu/StructureItem/__tests__/__snapshots__/StructureItem.spec.ts.snap +22 -6
  77. package/src/components/Amelipro/StructureMenu/StructureItem/types.d.ts +1 -0
  78. package/src/components/Amelipro/StructureMenu/StructureMenu.stories.ts +93 -63
  79. package/src/components/Amelipro/StructureMenu/StructureMenu.vue +5 -0
  80. package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +22 -1
  81. package/src/components/Amelipro/StructureMenu/StructureTabs/__tests__/StructureTabs.spec.ts +4 -0
  82. package/src/components/Amelipro/StructureMenu/StructureTabs/__tests__/__snapshots__/StructureTabs.spec.ts.snap +2 -0
  83. package/src/components/Amelipro/StructureMenu/__tests__/StructureMenu.spec.ts +12 -6
  84. package/src/components/BackBtn/tests/BackBtn.a11y.spec.ts +20 -0
  85. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +9 -0
  86. package/src/components/BackToTopBtn/tests/BackToTopBtn.a11y.spec.ts +37 -0
  87. package/src/components/Captcha/tests/Captcha.a11y.spec.ts +49 -0
  88. package/src/components/ChipList/ChipList.stories.ts +15 -0
  89. package/src/components/ChipList/ChipList.vue +20 -17
  90. package/src/components/ChipList/locales.ts +1 -0
  91. package/src/components/ChipList/tests/ChipList.a11y.spec.ts +40 -0
  92. package/src/components/CollapsibleList/Accessibilite.mdx +67 -11
  93. package/src/components/CollapsibleList/tests/CollapsibleList.a11y.spec.ts +38 -0
  94. package/src/components/ContextualMenu/ContextualMenu.stories.ts +3 -0
  95. package/src/components/ContextualMenu/tests/ContextualMenu.a11y.spec.ts +30 -0
  96. package/src/components/CookieBanner/CookieBanner.stories.ts +15 -0
  97. package/src/components/CookieBanner/CookieBanner.vue +0 -1
  98. package/src/components/CookieBanner/tests/CookieBanner.a11y.spec.ts +29 -0
  99. package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.a11y.spec.ts +46 -0
  100. package/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.a11y.spec.ts +37 -0
  101. package/src/components/CookiesSelection/tests/CookiesSelection.a11y.spec.ts +58 -0
  102. package/src/components/CopyBtn/CopyBtn.stories.ts +21 -0
  103. package/src/components/CopyBtn/tests/CopyBtn.a11y.spec.ts +40 -0
  104. package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.stories.ts +30 -0
  105. package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.vue +1 -0
  106. package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +27 -0
  107. package/src/components/Customs/Selects/SySelect/tests/SySelect.a11y.spec.ts +40 -0
  108. package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +7 -3
  109. package/src/components/Customs/SyCheckbox/SyCheckbox.vue +20 -2
  110. package/src/components/Customs/SyCheckbox/tests/SyCheckbox.a11y.spec.ts +26 -0
  111. package/src/components/Customs/SyForm/SyForm.a11y.spec.ts +33 -0
  112. package/src/components/Customs/SyIcon/SyIcon.a11y.spec.ts +37 -0
  113. package/src/components/Customs/SyIcon/SyIcon.stories.ts +5 -0
  114. package/src/components/Customs/SyPagination/tests/SyPagination.a11y.spec.ts +27 -0
  115. package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.a11y.spec.ts +30 -0
  116. package/src/components/Customs/SyTabs/SyTabs.stories.ts +33 -0
  117. package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +51 -0
  118. package/src/components/Customs/SyTextField/SyTextField.stories.ts +3 -0
  119. package/src/components/Customs/SyTextField/SyTextField.vue +13 -11
  120. package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +27 -0
  121. package/src/components/DataList/tests/DataList.a11y.spec.ts +35 -0
  122. package/src/components/DataListGroup/tests/DataListGroup.a11y.spec.ts +24 -0
  123. package/src/components/DataListItem/tests/DataListItem.a11y.spec.ts +31 -0
  124. package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +45 -0
  125. package/src/components/DatePicker/CalendarMode/DatePicker.vue +76 -30
  126. package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +27 -0
  127. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +54 -0
  128. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +79 -23
  129. package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.a11y.spec.ts +26 -0
  130. package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +12 -0
  131. package/src/components/DatePicker/DateTextInput/DateTextInput.vue +0 -8
  132. package/src/components/DatePicker/DateTextInput/tests/DateTextInput.a11y.spec.ts +27 -0
  133. package/src/components/DatePicker/composables/index.ts +0 -1
  134. package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +0 -1
  135. package/src/components/DiacriticPicker/tests/DiacriticPicker.a11y.spec.ts +46 -0
  136. package/src/components/DialogBox/DialogBox.stories.ts +5 -2
  137. package/src/components/DialogBox/DialogBox.vue +5 -0
  138. package/src/components/DialogBox/config.ts +5 -0
  139. package/src/components/DialogBox/tests/DialogBox.a11y.spec.ts +43 -0
  140. package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +26 -0
  141. package/src/components/ErrorPage/ErrorPage.stories.ts +60 -0
  142. package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +29 -0
  143. package/src/components/ExternalLinks/ExternalLinks.stories.ts +21 -0
  144. package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +39 -0
  145. package/src/components/FileList/FileList.stories.ts +3 -0
  146. package/src/components/FileList/tests/FileList.a11y.spec.ts +41 -0
  147. package/src/components/FilePreview/FilePreview.stories.ts +3 -0
  148. package/src/components/FilePreview/tests/FilePreview.a11y.spec.ts +47 -0
  149. package/src/components/FileUpload/tests/FileUpload.a11y.spec.ts +25 -0
  150. package/src/components/FilterInline/FilterInline.stories.ts +15 -0
  151. package/src/components/FilterInline/FilterInline.vue +8 -4
  152. package/src/components/FilterInline/tests/FilterInline.a11y.spec.ts +36 -0
  153. package/src/components/FilterInline/tests/__snapshots__/FilterInline.spec.ts.snap +0 -3
  154. package/src/components/FilterSideBar/Accessibilite.stories.ts +4 -0
  155. package/src/components/FilterSideBar/FilterSideBar.stories.ts +33 -11
  156. package/src/components/FilterSideBar/FilterSideBar.vue +146 -83
  157. package/src/components/FilterSideBar/locales.ts +6 -0
  158. package/src/components/FilterSideBar/tests/FilterSideBar.a11y.spec.ts +59 -0
  159. package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +2 -2
  160. package/src/components/FooterBar/Accessibilite.mdx +67 -11
  161. package/src/components/FooterBar/FooterBar.vue +1 -1
  162. package/src/components/FooterBar/config.ts +2 -2
  163. package/src/components/FooterBar/tests/FooterBar.a11y.spec.ts +31 -0
  164. package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
  165. package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +1 -1
  166. package/src/components/FranceConnectBtn/tests/FranceConnectBtn.a11y.spec.ts +25 -0
  167. package/src/components/HeaderBar/HeaderBar.stories.ts +21 -0
  168. package/src/components/HeaderBar/HeaderBar.vue +47 -40
  169. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +12 -0
  170. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +3 -0
  171. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +4 -0
  172. package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +17 -7
  173. package/src/components/HeaderBar/consts.scss +0 -1
  174. package/src/components/HeaderBar/tests/HeaderBar.a11y.spec.ts +33 -0
  175. package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +58 -57
  176. package/src/components/HeaderLoading/tests/HeaderLoading.a11y.spec.ts +25 -0
  177. package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +42 -0
  178. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +4 -0
  179. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +6 -2
  180. package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.a11y.spec.ts +45 -0
  181. package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +6 -0
  182. package/src/components/HeaderToolbar/HeaderToolbar.vue +0 -3
  183. package/src/components/HeaderToolbar/tests/HeaderToolbar.a11y.spec.ts +25 -0
  184. package/src/components/LangBtn/LangBtn.stories.ts +12 -0
  185. package/src/components/LangBtn/tests/LangBtn.a11y.spec.ts +25 -0
  186. package/src/components/Logo/tests/Logo.a11y.spec.ts +20 -0
  187. package/src/components/LogoBrandSection/tests/LogoBrandSection.a11y.spec.ts +38 -0
  188. package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +31 -0
  189. package/src/components/MaintenancePage/MaintenancePage.stories.ts +46 -0
  190. package/src/components/MaintenancePage/MaintenancePage.vue +7 -5
  191. package/src/components/MaintenancePage/tests/MaintenancePage.a11y.spec.ts +21 -0
  192. package/src/components/NirField/NirField.stories.ts +6 -0
  193. package/src/components/NirField/tests/NirField.a11y.spec.ts +32 -0
  194. package/src/components/NotFoundPage/NotFoundPage.stories.ts +56 -0
  195. package/src/components/NotFoundPage/NotFoundPage.vue +7 -5
  196. package/src/components/NotFoundPage/tests/NotFoundPage.a11y.spec.ts +31 -0
  197. package/src/components/NotificationBar/Notification/Notification.vue +203 -0
  198. package/src/components/NotificationBar/NotificationBar.stories.ts +151 -140
  199. package/src/components/NotificationBar/NotificationBar.vue +148 -202
  200. package/src/components/NotificationBar/config.ts +1 -1
  201. package/src/components/NotificationBar/tests/NotificationBar.a11y.spec.ts +66 -0
  202. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +173 -177
  203. package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +67 -29
  204. package/src/components/PageContainer/tests/PageContainer.a11y.spec.ts +27 -0
  205. package/src/components/PaginatedTable/PaginatedTable.stories.ts +6 -0
  206. package/src/components/PaginatedTable/PaginatedTable.vue +48 -1
  207. package/src/components/PaginatedTable/tests/PaginatedTable.a11y.spec.ts +43 -0
  208. package/src/components/PasswordField/PasswordField.stories.ts +39 -0
  209. package/src/components/PasswordField/tests/PasswordField.a11y.spec.ts +26 -0
  210. package/src/components/PeriodField/tests/PeriodField.a11y.spec.ts +31 -0
  211. package/src/components/PhoneField/PhoneField.stories.ts +51 -0
  212. package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +34 -0
  213. package/src/components/RangeField/tests/RangeField.a11y.spec.ts +32 -0
  214. package/src/components/RatingPicker/RatingPicker.stories.ts +21 -0
  215. package/src/components/SkipLink/Accessibilite.mdx +59 -13
  216. package/src/components/SkipLink/SkipLink.stories.ts +41 -8
  217. package/src/components/SubHeader/SubHeader.stories.ts +178 -92
  218. package/src/components/SubHeader/SubHeader.vue +84 -71
  219. package/src/components/SubHeader/config.ts +1 -1
  220. package/src/components/SyAlert/SyAlert.vue +1 -1
  221. package/src/components/SyTextArea/SyTextArea.stories.ts +40 -0
  222. package/src/components/SyTextArea/SyTextArea.vue +13 -0
  223. package/src/components/SyTextArea/locales.ts +1 -0
  224. package/src/components/SyTextArea/tests/SyTextArea.spec.ts +42 -0
  225. package/src/components/TableToolbar/TableToolbar.stories.ts +3 -0
  226. package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +70 -1
  227. package/src/components/Tables/SyTable/FilterRules.stories.ts +12 -0
  228. package/src/components/Tables/SyTable/SyTable.stories.ts +69 -0
  229. package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +31 -1
  230. package/src/components/UserMenuBtn/UserMenuBtn.vue +2 -1
  231. package/src/components/UserMenuBtn/tests/UserMenuBtn.a11y.spec.ts +31 -0
  232. package/src/directives/lockFocus.ts +12 -2
  233. package/src/stories/GuideDuDev/ClassesUtilitaires/DataUtilities.mdx +6 -6
  234. package/src/stories/GuideDuDev/ClassesUtilitaires/DomBrowserUtilities.mdx +52 -59
  235. package/src/stories/GuideDuDev/ClassesUtilitaires/FormattingUtilities.mdx +9 -9
  236. package/src/stories/GuideDuDev/ClassesUtilitaires/StorageUtilities.mdx +2 -2
  237. package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationRules.mdx +3 -3
  238. package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationUtilities.mdx +11 -11
  239. package/src/stories/GuideDuDev/ClassesUtilitaires/index.mdx +15 -15
  240. package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +1 -1
  241. package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
  242. package/src/stories/accessibility/AccessibilityGuideLayout.mdx +87 -0
  243. package/src/stories/styles/accessibility-guide.css +153 -0
  244. package/dist/components/DatePicker/composables/useIconState.d.ts +0 -17
  245. package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +0 -162
  246. package/src/components/DatePicker/composables/tests/useIconState.spec.ts +0 -130
  247. package/src/components/DatePicker/composables/useIconState.ts +0 -53
  248. package/src/components/Usages/tests/Usages.spec.ts +0 -155
@@ -0,0 +1,203 @@
1
+ <script setup lang="ts">
2
+ import { computed, getCurrentInstance } from 'vue'
3
+ import { useDisplay } from 'vuetify'
4
+ import { mdiAlertOutline, mdiAlertOctagonOutline, mdiCheckCircleOutline, mdiClose, mdiInformationOutline } from '@mdi/js'
5
+ import type { Notification } from '../types'
6
+ import SyIcon from '@/components/Customs/SyIcon/SyIcon.vue'
7
+
8
+ const props = withDefaults(defineProps<{
9
+ notification: Notification
10
+ options: {
11
+ btn?: Record<string, unknown>
12
+ icon?: Record<string, unknown>
13
+ }
14
+ closeBtnText?: string
15
+ rounded?: 0 | 1 | 2 | 3 | 4 | 'xs' | 'sm' | true | 'lg' | 'xl' | 'pill' | 'circle' | 'shaped'
16
+ }>(), {
17
+ closeBtnText: 'Fermer',
18
+ rounded: 4,
19
+ })
20
+
21
+ const emits = defineEmits<{
22
+ (e: 'close', id: string): void
23
+ }>()
24
+
25
+ const display = useDisplay()
26
+ const isMobileVersion = computed(() => display.name.value === 'xs')
27
+ const hasLongContent = computed(() => (props.notification.message.length > 50))
28
+
29
+ const iconMapping: Record<string, string> = {
30
+ info: mdiInformationOutline,
31
+ success: mdiCheckCircleOutline,
32
+ warning: mdiAlertOutline,
33
+ error: mdiAlertOctagonOutline,
34
+ }
35
+
36
+ const icon = computed(() => {
37
+ if (props.notification.icon === null)
38
+ return undefined
39
+
40
+ if (props.notification.icon !== undefined)
41
+ return props.notification.icon
42
+
43
+ return iconMapping[props.notification.type] ?? mdiInformationOutline
44
+ })
45
+
46
+ const instance = getCurrentInstance()
47
+ const hasActionSlot = computed(() => {
48
+ return !!instance?.slots.action || !!instance?.slots[`action:${props.notification.id}`]
49
+ })
50
+ </script>
51
+
52
+ <!-- eslint-disable vuejs-accessibility/no-static-element-interactions -->
53
+ <template>
54
+ <div
55
+ class="notification"
56
+ :class="[
57
+ `notification--${props.notification.type}`,
58
+ `notification--${props.rounded}`,
59
+ { 'notification--long-text': hasLongContent },
60
+ { 'notification--short-text': !hasLongContent },
61
+ { 'notification--with-action': hasActionSlot },
62
+ `rounded-${props.rounded}`
63
+ ]"
64
+ :style="{
65
+ borderRadius: typeof props.rounded == 'number' ? `${props.rounded}px` : ''
66
+ }"
67
+ @keydown.escape="emits('close', props.notification.id)"
68
+ >
69
+ <SyIcon
70
+ v-if="icon"
71
+ v-bind="options.icon"
72
+ :icon="icon"
73
+ size="24"
74
+ decorative
75
+ />
76
+
77
+ <span class="notification__message">{{ notification.message }}</span>
78
+ <div
79
+ class="d-flex ga-2 notification__actions"
80
+ :class="notification.message.length > 50 ? 'action-section-long-text' : 'action-section-short-text'"
81
+ >
82
+ <slot
83
+ name="action"
84
+ :notification="props.notification"
85
+ />
86
+ <slot
87
+ :name="`action:${props.notification.id}`"
88
+ :notification="props.notification"
89
+ />
90
+ <VBtn
91
+ class="notification__close ml-auto"
92
+ :class="{ 'ma-0': isMobileVersion && hasLongContent && !hasActionSlot }"
93
+ aria-label="Fermer la notification"
94
+ v-bind="options.btn"
95
+ @click="emits('close', notification.id)"
96
+ >
97
+ <template v-if="(!isMobileVersion || hasLongContent) && !hasActionSlot">
98
+ {{ props.closeBtnText }}
99
+ </template>
100
+ <template v-else>
101
+ <VIcon :icon="mdiClose" />
102
+ </template>
103
+ </VBtn>
104
+ </div>
105
+ </div>
106
+ </template>
107
+ <style scoped lang="scss">
108
+ @use '@/assets/tokens';
109
+
110
+ .notification {
111
+ display: flex;
112
+ align-items: center;
113
+ width: 100%;
114
+ transform: translateX(-50%);
115
+ padding: tokens.$gap-2 tokens.$gap-4;
116
+ margin-block: tokens.$gap-1;
117
+ gap: tokens.$gap-2 tokens.$gap-4;
118
+ box-shadow:
119
+ 0 3px 5px -1px var(--v-shadow-key-umbra-opacity, rgb(0 0 0 / 20%)),
120
+ 0 6px 10px 0 var(--v-shadow-key-penumbra-opacity, rgb(0 0 0 / 14%)),
121
+ 0 1px 18px 0 var(--v-shadow-key-ambient-opacity, rgb(0 0 0 / 12%));
122
+
123
+ // prevent margins collapsing
124
+ clear: both;
125
+ float: left;
126
+ }
127
+
128
+ .notification__close:focus-visible {
129
+ :deep(.v-btn__overlay) {
130
+ display: none;
131
+ }
132
+
133
+ &::after {
134
+ display: none;
135
+ }
136
+ }
137
+
138
+ /* stylelint-disable custom-property-pattern */
139
+ .notification--info {
140
+ background-color: rgb(var(--v-theme-backgroundInfoContrasted, '12, 65, 154'));
141
+ color: rgb(var(--v-theme-textOnDark, '255, 255, 255'));
142
+
143
+ .notification__close:focus-visible {
144
+ outline: 2px solid rgb(var(--v-theme-textOnDark, '255, 255, 255'));
145
+ }
146
+ }
147
+
148
+ .notification--success {
149
+ background-color: rgb(var(--v-theme-backgroundSuccessContrasted, '86, 194, 113'));
150
+ color: rgb(var(--v-theme-textBase, '0, 0, 0'));
151
+
152
+ .notification__close:focus-visible {
153
+ outline: 2px solid rgb(var(--v-theme-textBase, '0, 0, 0'));
154
+ }
155
+ }
156
+
157
+ .notification--warning {
158
+ background-color: rgb(var(--v-theme-backgroundWarningContrasted, '240, 179, 35'));
159
+ color: rgb(var(--v-theme-textBase, '0, 0, 0'));
160
+
161
+ .notification__close:focus-visible {
162
+ outline: 2px solid rgb(var(--v-theme-textBase, '0, 0, 0'));
163
+ }
164
+ }
165
+
166
+ .notification--error {
167
+ background-color: rgb(var(--v-theme-backgroundErrorContrasted, '179, 63, 46'));
168
+ color: rgb(var(--v-theme-textOnDark, '255, 255, 255'));
169
+
170
+ .notification__close:focus-visible {
171
+ outline: 2px solid rgb(var(--v-theme-textOnDark, '255, 255, 255'));
172
+ }
173
+ }
174
+
175
+ .notification__message {
176
+ flex-grow: 1;
177
+ }
178
+
179
+ .notification--long-text {
180
+ /* stylelint-disable-next-line */
181
+ @media screen and (width <= tokens.$container-mobile-max-width) {
182
+ flex-direction: column;
183
+ align-items: flex-start;
184
+ padding: tokens.$gap-4;
185
+
186
+ .notification__actions {
187
+ justify-content: space-between;
188
+ width: 100%;
189
+ }
190
+ }
191
+
192
+ .notification__actions {
193
+ justify-content: space-around;
194
+ }
195
+ }
196
+
197
+ .notification--short-text {
198
+ .notification__actions {
199
+ justify-content: flex-end !important;
200
+ }
201
+ }
202
+
203
+ </style>