@cnamts/synapse 0.0.4-alpha → 0.0.6-alpha
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/design-system-v3.d.ts +1277 -499
- package/dist/design-system-v3.js +4193 -1573
- package/dist/design-system-v3.umd.cjs +8 -8
- package/dist/style.css +1 -1
- package/package.json +18 -17
- package/src/assets/settings.scss +3 -0
- package/src/assets/tokens.scss +16 -17
- package/src/components/BackBtn/Accessibilite.mdx +14 -0
- package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackBtn/AccessibiliteItems.ts +102 -0
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackBtn/BackBtn.stories.ts +8 -8
- package/src/components/BackBtn/BackBtn.vue +0 -1
- package/src/components/BackBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/BackToTopBtn/Accessibilite.mdx +14 -0
- package/src/components/BackToTopBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackToTopBtn/AccessibiliteItems.ts +52 -0
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +1 -1
- package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
- package/src/components/CollapsibleList/Accessibilite.stories.ts +170 -0
- package/src/components/CollapsibleList/AccessibiliteItems.ts +122 -0
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +1 -1
- package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CookieBanner/Accessibilite.mdx +14 -0
- package/src/components/CookieBanner/Accessibilite.stories.ts +219 -0
- package/src/components/CookieBanner/AccessibiliteItems.ts +356 -0
- package/src/components/CookieBanner/CookieBanner.mdx +219 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +678 -0
- package/src/components/CookieBanner/CookieBanner.vue +225 -0
- package/src/components/CookieBanner/config.ts +38 -0
- package/src/components/CookieBanner/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CookieBanner/locales.ts +12 -0
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +129 -0
- package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +197 -0
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +123 -0
- package/src/components/CookiesSelection/CookiesInformation/locales.ts +21 -0
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.spec.ts +121 -0
- package/src/components/CookiesSelection/CookiesSelection.vue +127 -0
- package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +47 -0
- package/src/components/CookiesSelection/CookiesTable/headers.ts +14 -0
- package/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.spec.ts +30 -0
- package/src/components/CookiesSelection/CookiesTable/tests/__snapshots__/CookiesTable.spec.ts.snap +3 -0
- package/src/components/CookiesSelection/locales.ts +10 -0
- package/src/components/CookiesSelection/tests/CookiesSelection.spec.ts +184 -0
- package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +192 -0
- package/src/components/CookiesSelection/types.ts +15 -0
- package/src/components/CopyBtn/Accessibilite.mdx +14 -0
- package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
- package/src/components/CopyBtn/AccessibiliteItems.ts +105 -0
- package/src/components/CopyBtn/CopyBtn.mdx +1 -1
- package/src/components/CopyBtn/CopyBtn.stories.ts +4 -4
- package/src/components/CopyBtn/CopyBtn.vue +0 -1
- package/src/components/CopyBtn/config.ts +2 -0
- package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyBtnSelect/Accessibilite.stories.ts +193 -0
- package/src/components/Customs/SyBtnSelect/AccessibiliteItems.ts +139 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +45 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +662 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +254 -0
- package/src/components/Customs/SyBtnSelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
- package/src/components/Customs/SyInputSelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyInputSelect/Accessibilite.stories.ts +166 -0
- package/src/components/Customs/SyInputSelect/AccessibiliteItems.ts +96 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +41 -0
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.stories.ts → SyInputSelect/SyInputSelect.stories.ts} +30 -83
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +46 -6
- package/src/components/Customs/SyInputSelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
- package/src/components/Customs/SySelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SySelect/Accessibilite.stories.ts +217 -0
- package/src/components/Customs/SySelect/AccessibiliteItems.ts +173 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +9 -8
- package/src/components/Customs/{CustomSelect/CustomSelect.stories.ts → SySelect/SySelect.stories.ts} +25 -79
- package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +44 -13
- package/src/components/Customs/SySelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
- package/src/components/Customs/SyTextField/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +224 -0
- package/src/components/Customs/SyTextField/AccessibiliteItems.ts +198 -0
- package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
- package/src/components/Customs/{CustomTextField/CustomTextField.stories.ts → SyTextField/SyTextField.stories.ts} +145 -34
- package/src/components/Customs/{CustomTextField/CustomTextField.vue → SyTextField/SyTextField.vue} +27 -7
- package/src/components/Customs/SyTextField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/{CustomTextField/tests/CustomTextField.spec.ts → SyTextField/tests/SyTextField.spec.ts} +3 -3
- package/src/components/Customs/{CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap → SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap} +5 -6
- package/src/components/DataList/Accessibilite.mdx +14 -0
- package/src/components/DataList/Accessibilite.stories.ts +166 -0
- package/src/components/DataList/AccessibiliteItems.ts +47 -0
- package/src/components/DataList/DataList.mdx +1 -1
- package/src/components/DataList/DataList.stories.ts +10 -10
- package/src/components/DataList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DataListGroup/Accessibilite.mdx +14 -0
- package/src/components/DataListGroup/Accessibilite.stories.ts +225 -0
- package/src/components/DataListGroup/AccessibiliteItems.ts +79 -0
- package/src/components/DataListGroup/DataListGroup.mdx +1 -1
- package/src/components/DataListGroup/DataListGroup.stories.ts +7 -7
- package/src/components/DataListGroup/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DialogBox/Accessibilite.mdx +14 -0
- package/src/components/DialogBox/Accessibilite.stories.ts +189 -0
- package/src/components/DialogBox/AccessibiliteItems.ts +167 -0
- package/src/components/DialogBox/DialogBox.mdx +14 -0
- package/src/components/DialogBox/DialogBox.stories.ts +798 -0
- package/src/components/DialogBox/DialogBox.vue +181 -0
- package/src/components/DialogBox/config.ts +25 -0
- package/src/components/DialogBox/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DialogBox/locales.ts +5 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +329 -0
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +46 -0
- package/src/components/DownloadBtn/AccessibiliteItems.ts +1 -31
- package/src/components/DownloadBtn/DownloadBtn.mdx +3 -3
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +6 -6
- package/src/components/ErrorPage/Accessibilite.mdx +14 -0
- package/src/components/ErrorPage/Accessibilite.stories.ts +189 -0
- package/src/components/ErrorPage/AccessibiliteItems.ts +205 -0
- package/src/components/ErrorPage/ErrorPage.mdx +21 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +133 -0
- package/src/components/ErrorPage/ErrorPage.vue +93 -0
- package/src/components/ErrorPage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/ErrorPage/locales.ts +5 -0
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +40 -0
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +78 -0
- package/src/components/FooterBar/Accessibilite.mdx +14 -0
- package/src/components/FooterBar/Accessibilite.stories.ts +223 -0
- package/src/components/FooterBar/AccessibiliteItems.ts +257 -0
- package/src/components/FooterBar/FooterBar.mdx +2 -2
- package/src/components/FooterBar/FooterBar.stories.ts +556 -8
- package/src/components/FooterBar/FooterBar.vue +80 -73
- package/src/components/FooterBar/config.ts +2 -3
- package/src/components/FooterBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FooterBar/tests/FooterBar.spec.ts +1 -1
- package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
- package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +24 -22
- package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +169 -0
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +3 -3
- package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/Accessibilite.mdx +14 -0
- package/src/components/HeaderBar/Accessibilite.stories.ts +223 -0
- package/src/components/HeaderBar/AccessibiliteItems.ts +194 -0
- package/src/components/HeaderBar/HeaderBar.stories.ts +60 -2
- package/src/components/HeaderBar/HeaderBar.vue +1 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.mdx +14 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.stories.ts +223 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/AccessibiliteItems.ts +174 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +1 -1
- package/src/components/HeaderLoading/Accessibilite.mdx +14 -0
- package/src/components/HeaderLoading/Accessibilite.stories.ts +167 -0
- package/src/components/HeaderLoading/AccessibiliteItems.ts +29 -0
- package/src/components/HeaderLoading/HeaderLoading.mdx +1 -1
- package/src/components/HeaderLoading/HeaderLoading.stories.ts +1 -1
- package/src/components/HeaderLoading/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +6 -6
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +35 -33
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +1 -1
- package/src/components/HeaderToolbar/Accessibilite.mdx +14 -0
- package/src/components/HeaderToolbar/Accessibilite.stories.ts +203 -0
- package/src/components/HeaderToolbar/AccessibiliteItems.ts +200 -0
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +1 -1
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +2 -2
- package/src/components/HeaderToolbar/HeaderToolbar.vue +3 -2
- package/src/components/HeaderToolbar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +36 -2
- package/src/components/LangBtn/Accessibilite.mdx +14 -0
- package/src/components/LangBtn/Accessibilite.stories.ts +168 -0
- package/src/components/LangBtn/AccessibiliteItems.ts +101 -0
- package/src/components/LangBtn/LangBtn.mdx +1 -1
- package/src/components/LangBtn/LangBtn.stories.ts +4 -4
- package/src/components/LangBtn/LangBtn.vue +3 -2
- package/src/components/LangBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LangBtn/tests/LangBtn.spec.ts +1 -1
- package/src/components/LangBtn/tests/__snapshots__/LangBtn.spec.ts.snap +1 -1
- package/src/components/Logo/Accessibilite.mdx +14 -0
- package/src/components/Logo/Accessibilite.stories.ts +223 -0
- package/src/components/Logo/AccessibiliteItems.ts +155 -0
- package/src/components/Logo/Logo.mdx +1 -1
- package/src/components/Logo/Logo.stories.ts +8 -8
- package/src/components/Logo/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LogoBrandSection/Accessibilite.mdx +14 -0
- package/src/components/LogoBrandSection/Accessibilite.stories.ts +223 -0
- package/src/components/LogoBrandSection/AccessibiliteItems.ts +194 -0
- package/src/components/LogoBrandSection/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/MaintenancePage/Accessibilite.mdx +14 -0
- package/src/components/MaintenancePage/Accessibilite.stories.ts +189 -0
- package/src/components/MaintenancePage/AccessibiliteItems.ts +173 -0
- package/src/components/MaintenancePage/MaintenancePage.mdx +11 -0
- package/src/components/MaintenancePage/MaintenancePage.stories.ts +41 -0
- package/src/components/MaintenancePage/MaintenancePage.vue +25 -0
- package/src/components/MaintenancePage/assets/maintenance.svg +1 -0
- package/src/components/MaintenancePage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/MaintenancePage/index.ts +3 -0
- package/src/components/MaintenancePage/locales.ts +5 -0
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +12 -0
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -0
- package/src/components/NirField/Accessibilite.mdx +14 -0
- package/src/components/NirField/Accessibilite.stories.ts +214 -0
- package/src/components/NirField/AccessibiliteItems.ts +243 -0
- package/src/components/NirField/NirField.mdx +216 -0
- package/src/components/NirField/NirField.stories.ts +359 -0
- package/src/components/NirField/NirField.vue +450 -0
- package/src/components/NirField/config.ts +16 -0
- package/src/components/NirField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NirField/locales.ts +12 -0
- package/src/components/NirField/nirValidation.ts +42 -0
- package/src/components/NirField/tests/NirField.spec.ts +119 -0
- package/src/components/NotFoundPage/Accessibilite.mdx +14 -0
- package/src/components/NotFoundPage/Accessibilite.stories.ts +190 -0
- package/src/components/NotFoundPage/AccessibiliteItems.ts +205 -0
- package/src/components/NotFoundPage/NotFoundPage.mdx +19 -0
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +76 -0
- package/src/components/NotFoundPage/NotFoundPage.vue +52 -0
- package/src/components/NotFoundPage/assets/not-found.svg +1 -0
- package/src/components/NotFoundPage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotFoundPage/locales.ts +6 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +38 -0
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +76 -0
- package/src/components/NotificationBar/Accessibilite.mdx +14 -0
- package/src/components/NotificationBar/Accessibilite.stories.ts +166 -0
- package/src/components/NotificationBar/AccessibiliteItems.ts +144 -0
- package/src/components/NotificationBar/NotificationBar.mdx +1 -1
- package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotificationBar/options.ts +1 -0
- package/src/components/PageContainer/Accessibilite.mdx +14 -0
- package/src/components/PageContainer/Accessibilite.stories.ts +166 -0
- package/src/components/PageContainer/AccessibiliteItems.ts +52 -0
- package/src/components/PageContainer/PageContainer.mdx +1 -1
- package/src/components/PageContainer/PageContainer.stories.ts +4 -4
- package/src/components/PageContainer/PageContainer.vue +16 -15
- package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PageContainer/tests/PageContainer.spec.ts +1 -1
- package/src/components/PageContainer/tests/__snapshots__/PageContainer.spec.ts.snap +2 -2
- package/src/components/PhoneField/Accessibilite.mdx +14 -0
- package/src/components/PhoneField/Accessibilite.stories.ts +216 -0
- package/src/components/PhoneField/AccessibiliteItems.ts +238 -0
- package/src/components/PhoneField/PhoneField.mdx +1 -1
- package/src/components/PhoneField/PhoneField.stories.ts +2 -2
- package/src/components/PhoneField/PhoneField.vue +5 -6
- package/src/components/PhoneField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +3 -3
- package/src/components/SkipLink/Accessibilite.mdx +14 -0
- package/src/components/SkipLink/Accessibilite.stories.ts +167 -0
- package/src/components/SkipLink/AccessibiliteItems.ts +77 -0
- package/src/components/SkipLink/SkipLink.stories.ts +2 -2
- package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/Accessibilite.mdx +14 -0
- package/src/components/SocialMediaLinks/Accessibilite.stories.ts +170 -0
- package/src/components/SocialMediaLinks/AccessibiliteItems.ts +160 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +18 -14
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +3 -2
- package/src/components/SocialMediaLinks/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +1 -1
- package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
- package/src/components/SubHeader/Accessibilite.mdx +14 -0
- package/src/components/SubHeader/Accessibilite.stories.ts +166 -0
- package/src/components/SubHeader/AccessibiliteItems.ts +146 -0
- package/src/components/SubHeader/SubHeader.mdx +1 -1
- package/src/components/SubHeader/SubHeader.stories.ts +11 -11
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SubHeader/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SyAlert/Accessibilite.mdx +14 -0
- package/src/components/SyAlert/Accessibilite.stories.ts +166 -0
- package/src/components/SyAlert/AccessibiliteItems.ts +122 -0
- package/src/components/{Alert/Alert.mdx → SyAlert/SyAlert.mdx} +9 -9
- package/src/components/{Alert/Alert.stories.ts → SyAlert/SyAlert.stories.ts} +22 -22
- package/src/components/SyAlert/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/{Alert/tests/Alert.spec.ts → SyAlert/tests/SyAlert.spec.ts} +5 -5
- package/src/components/{Alert/tests/__snapshots__/Alert.spec.ts.snap → SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap} +2 -2
- package/src/components/UserMenuBtn/Accessibilite.mdx +14 -0
- package/src/components/UserMenuBtn/Accessibilite.stories.ts +189 -0
- package/src/components/UserMenuBtn/AccessibiliteItems.ts +155 -0
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +540 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +101 -0
- package/src/components/UserMenuBtn/config.ts +24 -0
- package/src/components/UserMenuBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
- package/src/components/index.ts +19 -4
- package/src/composables/index.ts +8 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +84 -0
- package/src/composables/rules/useFieldValidation.ts +90 -0
- package/src/designTokens/index.ts +2 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +1 -0
- package/src/main.ts +3 -0
- package/src/stories/Fondamentaux/Arrondis.mdx +24 -0
- package/src/stories/{Guidelines → Fondamentaux}/Colors.mdx +1 -1
- package/src/stories/Fondamentaux/Conteneurs.mdx +7 -0
- package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +7 -0
- package/src/stories/Fondamentaux/Elevations.mdx +14 -0
- package/src/stories/Fondamentaux/Espacements.mdx +29 -0
- package/src/stories/{Guidelines → Fondamentaux}/Introduction.mdx +1 -1
- package/src/stories/Fondamentaux/StylesTypographiques.mdx +33 -0
- package/src/stories/Fondamentaux/Typographie.mdx +58 -0
- package/src/stories/GuideDuDev/CommentUtiliserLesRules.mdx +120 -0
- package/src/stories/GuideDuDev/components.stories.ts +5 -5
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
- package/src/stories/Guidelines/Vuetify/Vuetify.mdx +11 -0
- package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +138 -0
- package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +350 -0
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -40
- package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
- package/src/components/Customs/CustomTextField/CustomTextField.mdx +0 -44
- package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
- package/src/stories/Guidelines/Typo.mdx +0 -53
- /package/src/components/Customs/{CustomInputSelect → SyInputSelect}/config.ts +0 -0
- /package/src/components/Customs/{CustomTextField → SyTextField}/types.d.ts +0 -0
- /package/src/components/{Alert/Alert.vue → SyAlert/SyAlert.vue} +0 -0
- /package/src/components/{Alert → SyAlert}/locales.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/AccessibiliteItems.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/ExpertiseLevelEnum.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/RGAALevelEnum.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/EcoConception.mdx +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/ecoDesignItems.ts +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
|
|
3
|
+
import { mdiClose } from '@mdi/js'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import type { VDialog } from 'vuetify/components'
|
|
6
|
+
import { config } from './config'
|
|
7
|
+
import { locales } from './locales'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
title?: string
|
|
11
|
+
width?: string
|
|
12
|
+
cancelBtnText?: string
|
|
13
|
+
confirmBtnText?: string
|
|
14
|
+
hideActions?: boolean
|
|
15
|
+
persistent?: boolean
|
|
16
|
+
} & CustomizableOptions>(), {
|
|
17
|
+
title: undefined,
|
|
18
|
+
width: '800px',
|
|
19
|
+
cancelBtnText: locales.cancelBtn,
|
|
20
|
+
confirmBtnText: locales.confirmBtn,
|
|
21
|
+
hideActions: false,
|
|
22
|
+
persistent: false,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
defineEmits(['cancel', 'confirm', 'update:modelValue'])
|
|
26
|
+
defineSlots<{
|
|
27
|
+
default?: () => undefined
|
|
28
|
+
title?: () => undefined
|
|
29
|
+
actions?: () => undefined
|
|
30
|
+
}>()
|
|
31
|
+
|
|
32
|
+
const dialog = defineModel<boolean>({
|
|
33
|
+
default: false,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const dialogContent = ref<VDialog | undefined>(undefined)
|
|
37
|
+
|
|
38
|
+
const options = useCustomizableOptions(config, props)
|
|
39
|
+
|
|
40
|
+
const closeIcon = mdiClose
|
|
41
|
+
|
|
42
|
+
async function getSelectableElements(): Promise<HTMLElement[]> {
|
|
43
|
+
const parentNode = dialogContent?.value?.$el // Is undefined when dialog is closed
|
|
44
|
+
|
|
45
|
+
if (!parentNode) {
|
|
46
|
+
return []
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const elements = Array.from<HTMLElement>(parentNode.querySelectorAll(
|
|
50
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
|
|
51
|
+
))
|
|
52
|
+
|
|
53
|
+
const filteredElements = elements.filter(element => (
|
|
54
|
+
!element.hasAttribute('disabled')
|
|
55
|
+
&& !element.getAttribute('aria-hidden')
|
|
56
|
+
))
|
|
57
|
+
|
|
58
|
+
return filteredElements
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function handleFocus(e: KeyboardEvent): Promise<void> {
|
|
62
|
+
const selectableElements = await getSelectableElements()
|
|
63
|
+
|
|
64
|
+
const focused = selectableElements.findIndex(
|
|
65
|
+
(el: HTMLElement) => el === e.target,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
const isOutside = focused === -1
|
|
69
|
+
const lastElement = selectableElements.length - 1
|
|
70
|
+
|
|
71
|
+
if (!e.shiftKey && (isOutside || focused === lastElement)) {
|
|
72
|
+
e.preventDefault()
|
|
73
|
+
selectableElements[0].focus()
|
|
74
|
+
}
|
|
75
|
+
else if (e.shiftKey && (isOutside || focused === 0)) {
|
|
76
|
+
e.preventDefault()
|
|
77
|
+
selectableElements[lastElement].focus()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<VDialog
|
|
84
|
+
v-model="dialog"
|
|
85
|
+
v-bind="$attrs"
|
|
86
|
+
:width="props.width"
|
|
87
|
+
:persistent="props.persistent"
|
|
88
|
+
:retain-focus="false"
|
|
89
|
+
aria-modal="true"
|
|
90
|
+
class="vd-dialog-box"
|
|
91
|
+
@keydown.tab="handleFocus"
|
|
92
|
+
>
|
|
93
|
+
<VCard
|
|
94
|
+
v-bind="options.card"
|
|
95
|
+
id="dialogContent"
|
|
96
|
+
ref="dialogContent"
|
|
97
|
+
:aria-labelledby="props.title ? props.title : 'dialogContent'"
|
|
98
|
+
>
|
|
99
|
+
<VCardTitle v-bind="options.cardTitle">
|
|
100
|
+
<slot name="title">
|
|
101
|
+
<h2
|
|
102
|
+
v-if="title"
|
|
103
|
+
class="text-h6 font-weight-bold"
|
|
104
|
+
>
|
|
105
|
+
{{ props.title }}
|
|
106
|
+
</h2>
|
|
107
|
+
</slot>
|
|
108
|
+
|
|
109
|
+
<VSpacer v-bind="options.spacer" />
|
|
110
|
+
|
|
111
|
+
<VBtn
|
|
112
|
+
v-if="!props.persistent"
|
|
113
|
+
v-bind="options.closeBtn"
|
|
114
|
+
:aria-label="locales.closeBtn"
|
|
115
|
+
@click="dialog = false"
|
|
116
|
+
>
|
|
117
|
+
<VIcon v-bind="options.icon">
|
|
118
|
+
{{ closeIcon }}
|
|
119
|
+
</VIcon>
|
|
120
|
+
</VBtn>
|
|
121
|
+
</VCardTitle>
|
|
122
|
+
<slot />
|
|
123
|
+
|
|
124
|
+
<div
|
|
125
|
+
v-if="!props.hideActions"
|
|
126
|
+
v-bind="options.actionsCtn"
|
|
127
|
+
class="vd-dialog-box-actions-ctn"
|
|
128
|
+
>
|
|
129
|
+
<VSpacer v-bind="options.actionsSpacer" />
|
|
130
|
+
|
|
131
|
+
<slot name="actions">
|
|
132
|
+
<VBtn
|
|
133
|
+
v-bind="options.cancelBtn"
|
|
134
|
+
@click="$emit('cancel')"
|
|
135
|
+
>
|
|
136
|
+
{{ props.cancelBtnText }}
|
|
137
|
+
</VBtn>
|
|
138
|
+
|
|
139
|
+
<VBtn
|
|
140
|
+
v-bind="options.confirmBtn"
|
|
141
|
+
data-test-id="confirm-btn"
|
|
142
|
+
@click="$emit('confirm')"
|
|
143
|
+
>
|
|
144
|
+
{{ props.confirmBtnText }}
|
|
145
|
+
</VBtn>
|
|
146
|
+
</slot>
|
|
147
|
+
</div>
|
|
148
|
+
</VCard>
|
|
149
|
+
</VDialog>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style lang="scss" scoped>
|
|
153
|
+
@use '@/assets/tokens' as *;
|
|
154
|
+
.v-card__title > * {
|
|
155
|
+
line-height: 1em;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.v-btn--icon {
|
|
159
|
+
color: $colors-icon-base;
|
|
160
|
+
position: absolute;
|
|
161
|
+
right: 24px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
h2 {
|
|
165
|
+
word-break: break-word;
|
|
166
|
+
text-wrap: balance;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.vd-dialog-box-actions-ctn {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column-reverse;
|
|
172
|
+
justify-content: stretch;
|
|
173
|
+
gap: $spacing-small;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@media screen and (min-width: $container-mobile-max-width) {
|
|
177
|
+
.vd-dialog-box-actions-ctn {
|
|
178
|
+
flex-direction: row;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const config = {
|
|
2
|
+
card: {
|
|
3
|
+
class: 'pa-6',
|
|
4
|
+
},
|
|
5
|
+
cardTitle: {
|
|
6
|
+
class: 'd-flex align-start flex-nowrap pa-0 mb-6 mr-6',
|
|
7
|
+
},
|
|
8
|
+
closeBtn: {
|
|
9
|
+
icon: true,
|
|
10
|
+
elevation: 0,
|
|
11
|
+
width: '32px',
|
|
12
|
+
height: '32px',
|
|
13
|
+
class: 'mt-n2 mr-n2 ml-4',
|
|
14
|
+
},
|
|
15
|
+
actionsCtn: {
|
|
16
|
+
class: 'd-flex flex-wrap mt-6',
|
|
17
|
+
},
|
|
18
|
+
cancelBtn: {
|
|
19
|
+
color: 'primary',
|
|
20
|
+
variant: 'text',
|
|
21
|
+
},
|
|
22
|
+
confirmBtn: {
|
|
23
|
+
color: 'primary',
|
|
24
|
+
},
|
|
25
|
+
} as const
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/* eslint-disable vue/one-component-per-file */
|
|
2
|
+
import { describe, it, expect } from 'vitest'
|
|
3
|
+
import { mount, shallowMount } from '@vue/test-utils'
|
|
4
|
+
import { vuetify } from '@tests/unit/setup'
|
|
5
|
+
|
|
6
|
+
import { VCard } from 'vuetify/components'
|
|
7
|
+
import { defineComponent } from 'vue'
|
|
8
|
+
import DialogBox from '../DialogBox.vue'
|
|
9
|
+
|
|
10
|
+
const defaultProps = {
|
|
11
|
+
modelValue: true,
|
|
12
|
+
title: 'Test title',
|
|
13
|
+
width: '600px',
|
|
14
|
+
cancelBtnText: 'Cancel',
|
|
15
|
+
confirmBtnText: 'Confirm',
|
|
16
|
+
hideActions: false,
|
|
17
|
+
persistent: false,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('DialogBox', () => {
|
|
21
|
+
describe('rendering and props', () => {
|
|
22
|
+
it('renders correctly with props', () => {
|
|
23
|
+
const wrapper = mount(DialogBox, {
|
|
24
|
+
props: defaultProps,
|
|
25
|
+
global: {
|
|
26
|
+
plugins: [vuetify],
|
|
27
|
+
stubs: {
|
|
28
|
+
VDialog: {
|
|
29
|
+
template: '<div><slot></slot></div>',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('is closed when model value is false', async () => {
|
|
39
|
+
const wrapper = mount(DialogBox, {
|
|
40
|
+
props: {
|
|
41
|
+
...defaultProps,
|
|
42
|
+
modelValue: false,
|
|
43
|
+
},
|
|
44
|
+
global: {
|
|
45
|
+
plugins: [vuetify],
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
expect(wrapper.html()).toBe('')
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('becomes visible when the model value is updated', async () => {
|
|
53
|
+
const wrapper = mount(DialogBox, {
|
|
54
|
+
props: defaultProps,
|
|
55
|
+
global: {
|
|
56
|
+
plugins: [vuetify],
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const card = wrapper.getComponent(VCard)
|
|
61
|
+
expect(card.isVisible()).toBe(true)
|
|
62
|
+
|
|
63
|
+
await wrapper.setProps({ modelValue: false })
|
|
64
|
+
expect(card.isVisible()).toBe(false)
|
|
65
|
+
|
|
66
|
+
await wrapper.setProps({ modelValue: true })
|
|
67
|
+
expect(card.isVisible()).toBe(true)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('renders the title slot', async () => {
|
|
71
|
+
const wrapper = mount(DialogBox, {
|
|
72
|
+
slots: {
|
|
73
|
+
title: '<h2>Test title</h2>',
|
|
74
|
+
},
|
|
75
|
+
props: defaultProps,
|
|
76
|
+
global: {
|
|
77
|
+
plugins: [vuetify],
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const modal = wrapper.getComponent(VCard)
|
|
82
|
+
const title = modal.find<HTMLElement>('h2').text()
|
|
83
|
+
|
|
84
|
+
await modal.vm.$nextTick()
|
|
85
|
+
|
|
86
|
+
expect(title).toBe('Test title')
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
describe('focusable elements and tab navigation', () => {
|
|
91
|
+
it('gets the correct focusable elements', async () => {
|
|
92
|
+
const wrapper = mount(DialogBox, {
|
|
93
|
+
slots: {
|
|
94
|
+
default: `
|
|
95
|
+
<button id="first">First</button>
|
|
96
|
+
<button id="second" disabled>Second</button>
|
|
97
|
+
<button id="third">third</button>
|
|
98
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
99
|
+
`,
|
|
100
|
+
},
|
|
101
|
+
props: {
|
|
102
|
+
...defaultProps,
|
|
103
|
+
hideActions: true,
|
|
104
|
+
persistent: true,
|
|
105
|
+
},
|
|
106
|
+
global: {
|
|
107
|
+
plugins: [vuetify],
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const modal = wrapper.getComponent(VCard)
|
|
112
|
+
|
|
113
|
+
const firstBtn = modal.find<HTMLElement>('#first')
|
|
114
|
+
const thirdBtn = modal.find<HTMLElement>('#third')
|
|
115
|
+
const theLink = modal.find<HTMLElement>('#link')
|
|
116
|
+
|
|
117
|
+
await modal.vm.$nextTick()
|
|
118
|
+
|
|
119
|
+
// @ts-expect-error - Testing private method
|
|
120
|
+
expect(await wrapper.vm.getSelectableElements()).toEqual([
|
|
121
|
+
firstBtn.element,
|
|
122
|
+
thirdBtn.element,
|
|
123
|
+
theLink.element,
|
|
124
|
+
])
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('handles the internal tab navigation', async () => {
|
|
128
|
+
const wrapper = mount(DialogBox, {
|
|
129
|
+
slots: {
|
|
130
|
+
default: `
|
|
131
|
+
<button id="first">First</button>
|
|
132
|
+
<button id="second" disabled>Second</button>
|
|
133
|
+
<button id="third">third</button>
|
|
134
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
135
|
+
`,
|
|
136
|
+
},
|
|
137
|
+
props: {
|
|
138
|
+
...defaultProps,
|
|
139
|
+
hideActions: true,
|
|
140
|
+
persistent: true,
|
|
141
|
+
},
|
|
142
|
+
global: {
|
|
143
|
+
plugins: [vuetify],
|
|
144
|
+
},
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
async function triggerTab() {
|
|
148
|
+
await modal.find(':focus').trigger('keydown', {
|
|
149
|
+
keyCode: 9,
|
|
150
|
+
key: 'Tab',
|
|
151
|
+
code: 'Tab',
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function triggerShiftTab() {
|
|
156
|
+
await modal.find(':focus').trigger('keydown', {
|
|
157
|
+
keyCode: 9,
|
|
158
|
+
key: 'Tab',
|
|
159
|
+
code: 'Tab',
|
|
160
|
+
shiftKey: true,
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const modal = wrapper.getComponent(VCard)
|
|
165
|
+
|
|
166
|
+
const firstBtn = modal.find<HTMLElement>('#first')
|
|
167
|
+
const link = modal.find<HTMLElement>('#link')
|
|
168
|
+
await modal.vm.$nextTick()
|
|
169
|
+
|
|
170
|
+
firstBtn.element.focus()
|
|
171
|
+
await modal.vm.$nextTick()
|
|
172
|
+
|
|
173
|
+
await triggerShiftTab()
|
|
174
|
+
expect(link.element).toEqual(document.activeElement)
|
|
175
|
+
|
|
176
|
+
await triggerTab()
|
|
177
|
+
expect(firstBtn.element).toEqual(document.activeElement)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it('return to the first focusable element', async () => {
|
|
181
|
+
const testComponent = defineComponent({
|
|
182
|
+
components: { DialogBox },
|
|
183
|
+
setup() {
|
|
184
|
+
return {
|
|
185
|
+
dialog: true,
|
|
186
|
+
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
template: `
|
|
190
|
+
<DialogBox v-model="dialog" title="Test title" :hide-actions="true">
|
|
191
|
+
<button id="first">First</button>
|
|
192
|
+
<button id="second" disabled>Second</button>
|
|
193
|
+
<button id="third">third</button>
|
|
194
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
195
|
+
</DialogBox>
|
|
196
|
+
<button id="external">External</button>
|
|
197
|
+
`,
|
|
198
|
+
})
|
|
199
|
+
const wrapper = mount(testComponent, {
|
|
200
|
+
global: {
|
|
201
|
+
plugins: [vuetify],
|
|
202
|
+
},
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
const externalBtn = wrapper.find<HTMLButtonElement>('#external')
|
|
206
|
+
externalBtn.element.focus()
|
|
207
|
+
await wrapper.vm.$nextTick()
|
|
208
|
+
|
|
209
|
+
await externalBtn.trigger('keydown', {
|
|
210
|
+
keyCode: 9,
|
|
211
|
+
key: 'Tab',
|
|
212
|
+
code: 'Tab',
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
const modal = wrapper.getComponent(VCard)
|
|
216
|
+
|
|
217
|
+
const firstBtn = modal.find<HTMLElement>('#first')
|
|
218
|
+
expect(firstBtn.element).toEqual(document.activeElement)
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
it('return the last focusable element', async () => {
|
|
222
|
+
const testComponent = defineComponent({
|
|
223
|
+
components: { DialogBox },
|
|
224
|
+
setup() {
|
|
225
|
+
return {
|
|
226
|
+
dialog: true,
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
template: `
|
|
230
|
+
<button id="external">External</button>
|
|
231
|
+
<DialogBox v-model="dialog" title="Test title" :hide-actions="true">
|
|
232
|
+
<button id="first">First</button>
|
|
233
|
+
<button id="second" disabled>Second</button>
|
|
234
|
+
<button id="third">third</button>
|
|
235
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
236
|
+
</DialogBox>
|
|
237
|
+
`,
|
|
238
|
+
})
|
|
239
|
+
const wrapper = mount(testComponent, {
|
|
240
|
+
global: {
|
|
241
|
+
plugins: [vuetify],
|
|
242
|
+
},
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
const external = wrapper.find<HTMLElement>('#external')
|
|
246
|
+
const modal = wrapper.getComponent(VCard)
|
|
247
|
+
external.element.focus()
|
|
248
|
+
await wrapper.vm.$nextTick()
|
|
249
|
+
|
|
250
|
+
await modal.trigger('keydown', {
|
|
251
|
+
keyCode: 9,
|
|
252
|
+
key: 'Tab',
|
|
253
|
+
code: 'Tab',
|
|
254
|
+
shiftKey: true,
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
const link = modal.find<HTMLButtonElement>('#link')
|
|
258
|
+
expect(link.element).toEqual(document.activeElement)
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
describe('event emissions', () => {
|
|
263
|
+
it('emits an event when close button is clicked', async () => {
|
|
264
|
+
const wrapper = mount(DialogBox, {
|
|
265
|
+
props: {
|
|
266
|
+
modelValue: true,
|
|
267
|
+
},
|
|
268
|
+
global: {
|
|
269
|
+
plugins: [vuetify],
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
const modal = wrapper.getComponent(VCard)
|
|
274
|
+
|
|
275
|
+
expect(modal.isVisible()).toBe(true)
|
|
276
|
+
|
|
277
|
+
const closeBtn = modal.find('button')
|
|
278
|
+
await closeBtn.trigger('click')
|
|
279
|
+
|
|
280
|
+
expect(wrapper.emitted('update:modelValue')).toBeTruthy()
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
it('emits a cancel event when cancel button is clicked', async () => {
|
|
284
|
+
const wrapper = mount(DialogBox, {
|
|
285
|
+
props: defaultProps,
|
|
286
|
+
global: {
|
|
287
|
+
plugins: [vuetify],
|
|
288
|
+
},
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
const modal = wrapper.getComponent(VCard)
|
|
292
|
+
|
|
293
|
+
const cancelBtn = modal.find('.vd-dialog-box-actions-ctn button')
|
|
294
|
+
await cancelBtn.trigger('click')
|
|
295
|
+
|
|
296
|
+
expect(wrapper.emitted('cancel')).toBeTruthy()
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
it('emits a confirm event when confirm button is clicked', async () => {
|
|
300
|
+
const wrapper = mount(DialogBox, {
|
|
301
|
+
props: defaultProps,
|
|
302
|
+
global: {
|
|
303
|
+
plugins: [vuetify],
|
|
304
|
+
},
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
const modal = wrapper.getComponent(VCard)
|
|
308
|
+
|
|
309
|
+
const confirmBtn = modal.find('[data-test-id="confirm-btn"]')
|
|
310
|
+
await confirmBtn.trigger('click')
|
|
311
|
+
|
|
312
|
+
expect(wrapper.emitted('confirm')).toBeTruthy()
|
|
313
|
+
})
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
describe('Test methods', () => {
|
|
317
|
+
it('getSelectableElements if this.$refs.dialogContent.$el is undefined', async () => {
|
|
318
|
+
const wrapper = shallowMount(DialogBox, {
|
|
319
|
+
props: defaultProps,
|
|
320
|
+
global: {
|
|
321
|
+
plugins: [vuetify],
|
|
322
|
+
},
|
|
323
|
+
})
|
|
324
|
+
// @ts-expect-error - Testing private method
|
|
325
|
+
const result = await wrapper.vm.getSelectableElements()
|
|
326
|
+
expect(result).toEqual([])
|
|
327
|
+
})
|
|
328
|
+
})
|
|
329
|
+
})
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`DialogBox > rendering and props > renders correctly with props 1`] = `
|
|
4
|
+
"<div data-v-e77b7070="" modelvalue="true" width="600px" persistent="false" retain-focus="false" aria-modal="true" class="vd-dialog-box">
|
|
5
|
+
<div data-v-e77b7070="" class="v-card v-theme--light v-card--density-default v-card--variant-elevated pa-6" id="dialogContent" aria-labelledby="Test title">
|
|
6
|
+
<!---->
|
|
7
|
+
<div class="v-card__loader">
|
|
8
|
+
<div class="v-progress-linear v-theme--light v-locale--is-ltr" style="top: 0px; height: 0px; --v-progress-linear-height: 2px;" role="progressbar" aria-hidden="true" aria-valuemin="0" aria-valuemax="100">
|
|
9
|
+
<!---->
|
|
10
|
+
<div class="v-progress-linear__background" style="opacity: NaN;"></div>
|
|
11
|
+
<div class="v-progress-linear__buffer" style="opacity: NaN; width: 0%;"></div>
|
|
12
|
+
<transition-stub name="fade-transition" appear="false" persisted="false" css="true">
|
|
13
|
+
<div class="v-progress-linear__indeterminate">
|
|
14
|
+
<div class="v-progress-linear__indeterminate long"></div>
|
|
15
|
+
<div class="v-progress-linear__indeterminate short"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</transition-stub>
|
|
18
|
+
<!---->
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<!---->
|
|
22
|
+
<!---->
|
|
23
|
+
<div data-v-e77b7070="" class="v-card-title d-flex align-start flex-nowrap pa-0 mb-6 mr-6">
|
|
24
|
+
<h2 data-v-e77b7070="" class="text-h6 font-weight-bold">Test title</h2>
|
|
25
|
+
<div data-v-e77b7070="" class="v-spacer"></div><button data-v-e77b7070="" type="button" class="v-btn v-btn--elevated v-btn--icon v-theme--light v-btn--density-default elevation-0 v-btn--size-default v-btn--variant-elevated mt-n2 mr-n2 ml-4" style="height: 32px; width: 32px;" aria-label="Fermer la boîte de dialogue"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
26
|
+
<!----><span class="v-btn__content" data-no-activator=""><i data-v-e77b7070="" class="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z mdi v-icon notranslate v-theme--light v-icon--size-default" aria-hidden="true"></i></span>
|
|
27
|
+
<!---->
|
|
28
|
+
<!---->
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
<div data-v-e77b7070="" class="d-flex flex-wrap mt-6 vd-dialog-box-actions-ctn">
|
|
32
|
+
<div data-v-e77b7070="" class="v-spacer"></div><button data-v-e77b7070="" type="button" class="v-btn v-theme--light text-primary v-btn--density-default v-btn--size-default v-btn--variant-text"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
33
|
+
<!----><span class="v-btn__content" data-no-activator="">Cancel</span>
|
|
34
|
+
<!---->
|
|
35
|
+
<!---->
|
|
36
|
+
</button><button data-v-e77b7070="" type="button" class="v-btn v-btn--elevated v-theme--light bg-primary v-btn--density-default v-btn--size-default v-btn--variant-elevated" data-test-id="confirm-btn"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
37
|
+
<!----><span class="v-btn__content" data-no-activator="">Confirm</span>
|
|
38
|
+
<!---->
|
|
39
|
+
<!---->
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
<!---->
|
|
43
|
+
<!----><span class="v-card__underlay"></span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>"
|
|
46
|
+
`;
|
|
@@ -1,37 +1,7 @@
|
|
|
1
1
|
import { ExpertiseLevelEnum } from './constants/ExpertiseLevelEnum'
|
|
2
2
|
|
|
3
3
|
export const AccessibiliteItemsIndeterminate = [
|
|
4
|
-
{
|
|
5
|
-
title: 'Catégorie 1 : Images',
|
|
6
|
-
subtitle: '1.4 Pour chaque image utilisée comme CAPTCHA ou comme image-test, ayant une alternative textuelle, cette alternative permet-elle d’identifier la nature et la fonction de l’image ?',
|
|
7
|
-
items: [
|
|
8
|
-
{
|
|
9
4
|
|
|
10
|
-
precision: '1.4.1 Pour chaque image (balise <img>) utilisée comme CAPTCHA ou comme image-test, ayant une alternative textuelle, cette alternative est-elle pertinente ?',
|
|
11
|
-
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#1.4.1',
|
|
12
|
-
solution: [{
|
|
13
|
-
info1: '1. Retrouver dans le document les images structurées au moyen d’un élément <img> pourvues d’une alternative textuelle et utilisées comme CAPTCHA ou comme image-test',
|
|
14
|
-
info2: '2. Pour chaque image, vérifier que l’alternative textuelle est pertinente',
|
|
15
|
-
info3: '3. Si c’est le cas pour chaque image, le test est validé',
|
|
16
|
-
}],
|
|
17
|
-
expertise: ExpertiseLevelEnum.DEV,
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
precision: ' 1.4.6 Pour chaque image vectorielle (balise <svg>) utilisée comme CAPTCHA ou comme image-test, ayant une alternative textuelle, cette alternative est-elle pertinente ?',
|
|
23
|
-
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#1.4.6',
|
|
24
|
-
solution: [{
|
|
25
|
-
info1: '1. Retrouver dans le document les éléments <svg> pourvus d’une alternative textuelle et utilisés comme CAPTCHA ou comme image-test;',
|
|
26
|
-
info2: '2. Pour chaque élément <svg>, vérifier que l’alternative textuelle est pertinente',
|
|
27
|
-
info3: '3. Si c’est le cas pour chaque image, le test est validé',
|
|
28
|
-
}],
|
|
29
|
-
expertise: ExpertiseLevelEnum.DEV,
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
5
|
{
|
|
36
6
|
title: 'Catégorie 10 : Présentation de l’information',
|
|
37
7
|
subtitle: '10.8 Pour chaque page Web, les contenus cachés ont-ils vocation à être ignorés par les technologies d’assistance ?',
|
|
@@ -61,7 +31,7 @@ export const AccessibiliteItemsValidated = [
|
|
|
61
31
|
items: [
|
|
62
32
|
|
|
63
33
|
{
|
|
64
|
-
precision: 'Chaque image vectorielle (balise <svg>) de décoration, sans légende, vérifie-t-elle ces conditions ?'
|
|
34
|
+
precision: '1.2.4 Chaque image vectorielle (balise <svg>) de décoration, sans légende, vérifie-t-elle ces conditions ?'
|
|
65
35
|
+ ' La balise <svg> possède un attribut WAI-ARIA aria-hidden="true" ;'
|
|
66
36
|
+ ' La balise <svg> et ses enfants sont dépourvus d’alternative textuelle ;'
|
|
67
37
|
+ ' Les balises <title> et <desc> sont absentes ou vides ;'
|
|
@@ -18,7 +18,7 @@ L'élément `DownloadBtn` est utilisé pour permettre à l'utilisateur de télé
|
|
|
18
18
|
|
|
19
19
|
<Source dark code={`
|
|
20
20
|
<script setup lang="ts">
|
|
21
|
-
import DownloadBtn from '@cnamts/synapse'
|
|
21
|
+
import { DownloadBtn } from '@cnamts/synapse'
|
|
22
22
|
import axios from 'axios'
|
|
23
23
|
|
|
24
24
|
function download() {
|
|
@@ -51,8 +51,8 @@ Exemple :
|
|
|
51
51
|
|
|
52
52
|
<Source dark code={`
|
|
53
53
|
<script setup lang="ts">
|
|
54
|
-
import DownloadBtn from '@cnamts/synapse'
|
|
55
|
-
import NotificationBar from '@cnamts/synapse'
|
|
54
|
+
import { DownloadBtn } from '@cnamts/synapse'
|
|
55
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
56
56
|
import axios from 'axios'
|
|
57
57
|
import { useNotificationService } from '@cnamts/synapse/src/services/NotificationService'
|
|
58
58
|
import type { Notification } from '@cnamts/synapse/src/components/NotificationBar/types'
|