@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.
- package/dist/{DateFilter-DSwJUvBu.js → DateFilter-RHtdShO1.js} +1 -1
- package/dist/{NumberFilter-CwsbYyz4.js → NumberFilter-DXYz_b_w.js} +1 -1
- package/dist/{PeriodFilter-csnEZU30.js → PeriodFilter-CzphmrNu.js} +1 -1
- package/dist/{SelectFilter-Bd5fndzR.js → SelectFilter-a4fUV5Jp.js} +1 -1
- package/dist/{TextFilter-B6gxzq2a.js → TextFilter-CZ4LTKoq.js} +1 -1
- package/dist/components/Accordion/Accordion.d.ts +22 -7
- package/dist/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.d.ts +31 -8
- package/dist/components/Amelipro/AmeliproPatientLogged/types.d.ts +2 -1
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabBtn/AmeliproTabBtn.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +14 -5
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +10 -1
- package/dist/components/Amelipro/AmeliproTooltips/AmeliproTooltips.d.ts +6 -2
- package/dist/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.d.ts +9 -0
- package/dist/components/Amelipro/StructureMenu/StructureItem/types.d.ts +1 -0
- package/dist/components/Amelipro/StructureMenu/StructureMenu.d.ts +9 -0
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +23 -2
- package/dist/components/ChipList/locales.d.ts +1 -0
- package/dist/components/CookieBanner/CookieBanner.d.ts +2 -2
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +4 -4
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +9 -11
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +7 -10
- package/dist/components/DatePicker/composables/index.d.ts +0 -1
- package/dist/components/DialogBox/DialogBox.d.ts +3 -3
- package/dist/components/DialogBox/config.d.ts +4 -0
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +10 -3
- package/dist/components/FilterSideBar/locales.d.ts +5 -0
- package/dist/components/HeaderBar/HeaderBar.d.ts +2 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +14 -4
- package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +5 -1
- package/dist/components/MaintenancePage/MaintenancePage.d.ts +8 -1
- package/dist/components/NotFoundPage/NotFoundPage.d.ts +9 -2
- package/dist/components/NotificationBar/Notification/Notification.d.ts +30 -0
- package/dist/components/NotificationBar/NotificationBar.d.ts +32 -20
- package/dist/components/PeriodField/PeriodField.d.ts +16 -16
- package/dist/components/SubHeader/SubHeader.d.ts +11 -8
- package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
- package/dist/components/SyTextArea/locales.d.ts +1 -0
- package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +2 -0
- package/dist/design-system-v3.js +1 -1
- package/dist/design-system-v3.umd.cjs +18 -18
- package/dist/directives/lockFocus.d.ts +1 -1
- package/dist/{main-DkZZpa3S.js → main-BXIMMzFS.js} +9368 -9157
- package/dist/style.css +1 -1
- package/package.json +11 -4
- package/src/components/Accordion/Accessibilite/AccessibilityGuide.mdx +70 -241
- package/src/components/Accordion/Accordion.mdx +6 -1
- package/src/components/Accordion/Accordion.stories.ts +88 -9
- package/src/components/Accordion/Accordion.vue +56 -24
- package/src/components/Accordion/tests/Accordion.a11y.spec.ts +46 -0
- package/src/components/Accordion/tests/__snapshots__/accordion.spec.ts.snap +26 -30
- package/src/components/Accordion/tests/accordion.spec.ts +27 -26
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.stories.ts +62 -34
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.vue +48 -15
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/AmeliproPatientLogged.spec.ts +4 -2
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +54 -4
- package/src/components/Amelipro/AmeliproPatientLogged/types.d.ts +2 -1
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLogin.stories.ts +11 -5
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/AmeliproPatientLoginForm.vue +8 -0
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +37 -1
- package/src/components/Amelipro/AmeliproSelect/__tests__/__snapshots__/AmeliproSelect.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.stories.ts +94 -0
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +6 -2
- package/src/components/Amelipro/AmeliproTabs/__tests__/AmeliproTabs.spec.ts +4 -0
- package/src/components/Amelipro/AmeliproTabs/__tests__/__snapshots__/AmeliproTabs.spec.ts.snap +4 -2
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.stories.ts +68 -0
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +110 -2
- package/src/components/Amelipro/AmeliproTextField/__tests__/AmeliproTextField.spec.ts +14 -2
- package/src/components/Amelipro/AmeliproTextField/__tests__/__snapshots__/AmeliproTextField.spec.ts.snap +2 -0
- package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.stories.ts +45 -0
- package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.vue +6 -0
- package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +13 -0
- package/src/components/Amelipro/StructureMenu/StructureBtn/__tests__/StructureBtn.spec.ts +6 -0
- package/src/components/Amelipro/StructureMenu/StructureBtn/__tests__/__snapshots__/StructureBtn.spec.ts.snap +1 -1
- package/src/components/Amelipro/StructureMenu/StructureItem/StructureItem.vue +14 -2
- package/src/components/Amelipro/StructureMenu/StructureItem/__tests__/__snapshots__/StructureItem.spec.ts.snap +22 -6
- package/src/components/Amelipro/StructureMenu/StructureItem/types.d.ts +1 -0
- package/src/components/Amelipro/StructureMenu/StructureMenu.stories.ts +93 -63
- package/src/components/Amelipro/StructureMenu/StructureMenu.vue +5 -0
- package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +22 -1
- package/src/components/Amelipro/StructureMenu/StructureTabs/__tests__/StructureTabs.spec.ts +4 -0
- package/src/components/Amelipro/StructureMenu/StructureTabs/__tests__/__snapshots__/StructureTabs.spec.ts.snap +2 -0
- package/src/components/Amelipro/StructureMenu/__tests__/StructureMenu.spec.ts +12 -6
- package/src/components/BackBtn/tests/BackBtn.a11y.spec.ts +20 -0
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +9 -0
- package/src/components/BackToTopBtn/tests/BackToTopBtn.a11y.spec.ts +37 -0
- package/src/components/Captcha/tests/Captcha.a11y.spec.ts +49 -0
- package/src/components/ChipList/ChipList.stories.ts +15 -0
- package/src/components/ChipList/ChipList.vue +20 -17
- package/src/components/ChipList/locales.ts +1 -0
- package/src/components/ChipList/tests/ChipList.a11y.spec.ts +40 -0
- package/src/components/CollapsibleList/Accessibilite.mdx +67 -11
- package/src/components/CollapsibleList/tests/CollapsibleList.a11y.spec.ts +38 -0
- package/src/components/ContextualMenu/ContextualMenu.stories.ts +3 -0
- package/src/components/ContextualMenu/tests/ContextualMenu.a11y.spec.ts +30 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +15 -0
- package/src/components/CookieBanner/CookieBanner.vue +0 -1
- package/src/components/CookieBanner/tests/CookieBanner.a11y.spec.ts +29 -0
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.a11y.spec.ts +46 -0
- package/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.a11y.spec.ts +37 -0
- package/src/components/CookiesSelection/tests/CookiesSelection.a11y.spec.ts +58 -0
- package/src/components/CopyBtn/CopyBtn.stories.ts +21 -0
- package/src/components/CopyBtn/tests/CopyBtn.a11y.spec.ts +40 -0
- package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.stories.ts +30 -0
- package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.vue +1 -0
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +27 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.a11y.spec.ts +40 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +7 -3
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +20 -2
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.a11y.spec.ts +26 -0
- package/src/components/Customs/SyForm/SyForm.a11y.spec.ts +33 -0
- package/src/components/Customs/SyIcon/SyIcon.a11y.spec.ts +37 -0
- package/src/components/Customs/SyIcon/SyIcon.stories.ts +5 -0
- package/src/components/Customs/SyPagination/tests/SyPagination.a11y.spec.ts +27 -0
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.a11y.spec.ts +30 -0
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +33 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +51 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +3 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +13 -11
- package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +27 -0
- package/src/components/DataList/tests/DataList.a11y.spec.ts +35 -0
- package/src/components/DataListGroup/tests/DataListGroup.a11y.spec.ts +24 -0
- package/src/components/DataListItem/tests/DataListItem.a11y.spec.ts +31 -0
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +45 -0
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +76 -30
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +27 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +54 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +79 -23
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.a11y.spec.ts +26 -0
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +12 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +0 -8
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.a11y.spec.ts +27 -0
- package/src/components/DatePicker/composables/index.ts +0 -1
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +0 -1
- package/src/components/DiacriticPicker/tests/DiacriticPicker.a11y.spec.ts +46 -0
- package/src/components/DialogBox/DialogBox.stories.ts +5 -2
- package/src/components/DialogBox/DialogBox.vue +5 -0
- package/src/components/DialogBox/config.ts +5 -0
- package/src/components/DialogBox/tests/DialogBox.a11y.spec.ts +43 -0
- package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +26 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +60 -0
- package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +29 -0
- package/src/components/ExternalLinks/ExternalLinks.stories.ts +21 -0
- package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +39 -0
- package/src/components/FileList/FileList.stories.ts +3 -0
- package/src/components/FileList/tests/FileList.a11y.spec.ts +41 -0
- package/src/components/FilePreview/FilePreview.stories.ts +3 -0
- package/src/components/FilePreview/tests/FilePreview.a11y.spec.ts +47 -0
- package/src/components/FileUpload/tests/FileUpload.a11y.spec.ts +25 -0
- package/src/components/FilterInline/FilterInline.stories.ts +15 -0
- package/src/components/FilterInline/FilterInline.vue +8 -4
- package/src/components/FilterInline/tests/FilterInline.a11y.spec.ts +36 -0
- package/src/components/FilterInline/tests/__snapshots__/FilterInline.spec.ts.snap +0 -3
- package/src/components/FilterSideBar/Accessibilite.stories.ts +4 -0
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +33 -11
- package/src/components/FilterSideBar/FilterSideBar.vue +146 -83
- package/src/components/FilterSideBar/locales.ts +6 -0
- package/src/components/FilterSideBar/tests/FilterSideBar.a11y.spec.ts +59 -0
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +2 -2
- package/src/components/FooterBar/Accessibilite.mdx +67 -11
- package/src/components/FooterBar/FooterBar.vue +1 -1
- package/src/components/FooterBar/config.ts +2 -2
- package/src/components/FooterBar/tests/FooterBar.a11y.spec.ts +31 -0
- package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
- package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +1 -1
- package/src/components/FranceConnectBtn/tests/FranceConnectBtn.a11y.spec.ts +25 -0
- package/src/components/HeaderBar/HeaderBar.stories.ts +21 -0
- package/src/components/HeaderBar/HeaderBar.vue +47 -40
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +12 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +3 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +4 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +17 -7
- package/src/components/HeaderBar/consts.scss +0 -1
- package/src/components/HeaderBar/tests/HeaderBar.a11y.spec.ts +33 -0
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +58 -57
- package/src/components/HeaderLoading/tests/HeaderLoading.a11y.spec.ts +25 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +42 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +4 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +6 -2
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.a11y.spec.ts +45 -0
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +6 -0
- package/src/components/HeaderToolbar/HeaderToolbar.vue +0 -3
- package/src/components/HeaderToolbar/tests/HeaderToolbar.a11y.spec.ts +25 -0
- package/src/components/LangBtn/LangBtn.stories.ts +12 -0
- package/src/components/LangBtn/tests/LangBtn.a11y.spec.ts +25 -0
- package/src/components/Logo/tests/Logo.a11y.spec.ts +20 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.a11y.spec.ts +38 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +31 -0
- package/src/components/MaintenancePage/MaintenancePage.stories.ts +46 -0
- package/src/components/MaintenancePage/MaintenancePage.vue +7 -5
- package/src/components/MaintenancePage/tests/MaintenancePage.a11y.spec.ts +21 -0
- package/src/components/NirField/NirField.stories.ts +6 -0
- package/src/components/NirField/tests/NirField.a11y.spec.ts +32 -0
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +56 -0
- package/src/components/NotFoundPage/NotFoundPage.vue +7 -5
- package/src/components/NotFoundPage/tests/NotFoundPage.a11y.spec.ts +31 -0
- package/src/components/NotificationBar/Notification/Notification.vue +203 -0
- package/src/components/NotificationBar/NotificationBar.stories.ts +151 -140
- package/src/components/NotificationBar/NotificationBar.vue +148 -202
- package/src/components/NotificationBar/config.ts +1 -1
- package/src/components/NotificationBar/tests/NotificationBar.a11y.spec.ts +66 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +173 -177
- package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +67 -29
- package/src/components/PageContainer/tests/PageContainer.a11y.spec.ts +27 -0
- package/src/components/PaginatedTable/PaginatedTable.stories.ts +6 -0
- package/src/components/PaginatedTable/PaginatedTable.vue +48 -1
- package/src/components/PaginatedTable/tests/PaginatedTable.a11y.spec.ts +43 -0
- package/src/components/PasswordField/PasswordField.stories.ts +39 -0
- package/src/components/PasswordField/tests/PasswordField.a11y.spec.ts +26 -0
- package/src/components/PeriodField/tests/PeriodField.a11y.spec.ts +31 -0
- package/src/components/PhoneField/PhoneField.stories.ts +51 -0
- package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +34 -0
- package/src/components/RangeField/tests/RangeField.a11y.spec.ts +32 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +21 -0
- package/src/components/SkipLink/Accessibilite.mdx +59 -13
- package/src/components/SkipLink/SkipLink.stories.ts +41 -8
- package/src/components/SubHeader/SubHeader.stories.ts +178 -92
- package/src/components/SubHeader/SubHeader.vue +84 -71
- package/src/components/SubHeader/config.ts +1 -1
- package/src/components/SyAlert/SyAlert.vue +1 -1
- package/src/components/SyTextArea/SyTextArea.stories.ts +40 -0
- package/src/components/SyTextArea/SyTextArea.vue +13 -0
- package/src/components/SyTextArea/locales.ts +1 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +42 -0
- package/src/components/TableToolbar/TableToolbar.stories.ts +3 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +70 -1
- package/src/components/Tables/SyTable/FilterRules.stories.ts +12 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +69 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +31 -1
- package/src/components/UserMenuBtn/UserMenuBtn.vue +2 -1
- package/src/components/UserMenuBtn/tests/UserMenuBtn.a11y.spec.ts +31 -0
- package/src/directives/lockFocus.ts +12 -2
- package/src/stories/GuideDuDev/ClassesUtilitaires/DataUtilities.mdx +6 -6
- package/src/stories/GuideDuDev/ClassesUtilitaires/DomBrowserUtilities.mdx +52 -59
- package/src/stories/GuideDuDev/ClassesUtilitaires/FormattingUtilities.mdx +9 -9
- package/src/stories/GuideDuDev/ClassesUtilitaires/StorageUtilities.mdx +2 -2
- package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationRules.mdx +3 -3
- package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationUtilities.mdx +11 -11
- package/src/stories/GuideDuDev/ClassesUtilitaires/index.mdx +15 -15
- package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +1 -1
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
- package/src/stories/accessibility/AccessibilityGuideLayout.mdx +87 -0
- package/src/stories/styles/accessibility-guide.css +153 -0
- package/dist/components/DatePicker/composables/useIconState.d.ts +0 -17
- package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +0 -162
- package/src/components/DatePicker/composables/tests/useIconState.spec.ts +0 -130
- package/src/components/DatePicker/composables/useIconState.ts +0 -53
- 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>
|