@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,125 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import UserMenuBtn from '../UserMenuBtn.vue'
|
|
4
|
+
import { vuetify } from '@tests/unit/setup'
|
|
5
|
+
import { nextTick } from 'vue'
|
|
6
|
+
|
|
7
|
+
describe('UserMenuBtn', () => {
|
|
8
|
+
it('renders the component', () => {
|
|
9
|
+
const wrapper = mount(UserMenuBtn, {
|
|
10
|
+
global: {
|
|
11
|
+
plugins: [vuetify],
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: null,
|
|
15
|
+
menuItems: [{ text: 'Item 1', value: 'item1' }],
|
|
16
|
+
additionalInformation: 'Additional Info',
|
|
17
|
+
fullName: 'John Doe',
|
|
18
|
+
hideLogoutBtn: false,
|
|
19
|
+
isMobileView: false,
|
|
20
|
+
hideUserIcon: false,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
expect(wrapper.exists()).toBe(true)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('displays the full name', () => {
|
|
27
|
+
const wrapper = mount(UserMenuBtn, {
|
|
28
|
+
global: {
|
|
29
|
+
plugins: [vuetify],
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
modelValue: null,
|
|
33
|
+
fullName: 'John Doe',
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
expect(wrapper.text()).toContain('John Doe')
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('does not render logout button when hidden', () => {
|
|
40
|
+
const wrapper = mount(UserMenuBtn, {
|
|
41
|
+
global: {
|
|
42
|
+
plugins: [vuetify],
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
modelValue: null,
|
|
46
|
+
hideLogoutBtn: true,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
expect(wrapper.find('.logout').exists()).toBe(false)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('renders user icon when not hidden', () => {
|
|
53
|
+
const wrapper = mount(UserMenuBtn, {
|
|
54
|
+
global: {
|
|
55
|
+
plugins: [vuetify],
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
modelValue: null,
|
|
59
|
+
hideUserIcon: false,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
expect(wrapper.find('.vd-user-icon').exists()).toBe(true)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('does not render user icon when hidden', () => {
|
|
66
|
+
const wrapper = mount(UserMenuBtn, {
|
|
67
|
+
global: {
|
|
68
|
+
plugins: [vuetify],
|
|
69
|
+
},
|
|
70
|
+
props: {
|
|
71
|
+
modelValue: null,
|
|
72
|
+
hideUserIcon: true,
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
expect(wrapper.find('.vd-user-icon').exists()).toBe(false)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('emits "update:modelValue" when selected changes', async () => {
|
|
79
|
+
const wrapper = mount(UserMenuBtn, {
|
|
80
|
+
global: {
|
|
81
|
+
plugins: [vuetify],
|
|
82
|
+
},
|
|
83
|
+
props: {
|
|
84
|
+
modelValue: null,
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
wrapper.vm.$emit('update:modelValue', 'item1')
|
|
88
|
+
await nextTick()
|
|
89
|
+
const emitted = wrapper.emitted('update:modelValue')
|
|
90
|
+
expect(emitted).toBeTruthy()
|
|
91
|
+
if (emitted && emitted[0]) {
|
|
92
|
+
expect(emitted[0]).toEqual(['item1'])
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('computes mobile view correctly based on props and display', () => {
|
|
97
|
+
const wrapper = mount(UserMenuBtn, {
|
|
98
|
+
global: {
|
|
99
|
+
plugins: [vuetify],
|
|
100
|
+
},
|
|
101
|
+
props: {
|
|
102
|
+
modelValue: null,
|
|
103
|
+
isMobileView: true,
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
expect(wrapper.vm.isMobileView).toBe(true)
|
|
107
|
+
})
|
|
108
|
+
it('emits "update:modelValue" when updateModelValue is called via event', async () => {
|
|
109
|
+
const wrapper = mount(UserMenuBtn, {
|
|
110
|
+
global: {
|
|
111
|
+
plugins: [vuetify],
|
|
112
|
+
},
|
|
113
|
+
props: {
|
|
114
|
+
modelValue: null,
|
|
115
|
+
menuItems: [{ text: 'Item 1', value: 'item1' }],
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const SyBtnSelect = wrapper.findComponent({ name: 'SyBtnSelect' })
|
|
120
|
+
await SyBtnSelect.vm.$emit('update:model-value', 'test-value')
|
|
121
|
+
|
|
122
|
+
expect(wrapper.emitted('update:modelValue')).toBeTruthy()
|
|
123
|
+
expect(wrapper.emitted('update:modelValue')![0]).toEqual(['test-value'])
|
|
124
|
+
})
|
|
125
|
+
})
|
package/src/components/index.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as SyAlert } from './SyAlert/SyAlert.vue'
|
|
2
2
|
export { default as BackBtn } from './BackBtn/BackBtn.vue'
|
|
3
3
|
export { default as BackToTopBtn } from './BackToTopBtn/BackToTopBtn.vue'
|
|
4
4
|
export { default as CollapsibleList } from './CollapsibleList/CollapsibleList.vue'
|
|
5
5
|
export { default as CopyBtn } from './CopyBtn/CopyBtn.vue'
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
6
|
+
export { default as SyBtnSelect } from './Customs/SyBtnSelect/SyBtnSelect.vue'
|
|
7
|
+
export { default as SyInputSelect } from './Customs/SyInputSelect/SyInputSelect.vue'
|
|
8
|
+
export { default as SySelect } from './Customs/SySelect/SySelect.vue'
|
|
9
|
+
export { default as SyTextField } from './Customs/SyTextField/SyTextField.vue'
|
|
9
10
|
export { default as DataList } from './DataList/DataList.vue'
|
|
10
11
|
export { default as DataListGroup } from './DataListGroup/DataListGroup.vue'
|
|
12
|
+
export { default as DataListItem } from './DataListItem/DataListItem.vue'
|
|
13
|
+
export { default as DialogBox } from './DialogBox/DialogBox.vue'
|
|
11
14
|
export { default as DownloadBtn } from './DownloadBtn/DownloadBtn.vue'
|
|
15
|
+
export { default as ErrorPage } from './ErrorPage/ErrorPage.vue'
|
|
12
16
|
export { default as FooterBar } from './FooterBar/FooterBar.vue'
|
|
13
17
|
export { default as FranceConnectBtn } from './FranceConnectBtn/FranceConnectBtn.vue'
|
|
14
18
|
export { default as HeaderBar } from './HeaderBar/HeaderBar.vue'
|
|
@@ -20,12 +24,23 @@ export { default as HeaderLogo } from './HeaderBar/HeaderLogo/HeaderLogo.vue'
|
|
|
20
24
|
export { default as HeaderMenuBtn } from './HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue'
|
|
21
25
|
export { default as HeaderLoading } from './HeaderLoading/HeaderLoading.vue'
|
|
22
26
|
export { default as HeaderNavigationBar } from './HeaderNavigationBar/HeaderNavigationBar.vue'
|
|
27
|
+
export { default as HeaderToolbar } from './HeaderToolbar/HeaderToolbar.vue'
|
|
23
28
|
export { default as LangBtn } from './LangBtn/LangBtn.vue'
|
|
24
29
|
export { default as Logo } from './Logo/Logo.vue'
|
|
25
30
|
export { default as LogoBrandSection } from './LogoBrandSection/LogoBrandSection.vue'
|
|
31
|
+
export { default as MaintenancePage } from './MaintenancePage/MaintenancePage.vue'
|
|
32
|
+
export { default as NotFoundPage } from './NotFoundPage/NotFoundPage.vue'
|
|
33
|
+
export { default as NirField } from './NirField/NirField.vue'
|
|
34
|
+
export * from './NirField/nirValidation'
|
|
26
35
|
export { default as NotificationBar } from './NotificationBar/NotificationBar.vue'
|
|
27
36
|
export * from './NotificationBar/types'
|
|
28
37
|
export { default as PageContainer } from './PageContainer/PageContainer.vue'
|
|
38
|
+
export { default as PhoneField } from './PhoneField/PhoneField.vue'
|
|
29
39
|
export { default as SkipLink } from './SkipLink/SkipLink.vue'
|
|
30
40
|
export { default as SocialMediaLinks } from './SocialMediaLinks/SocialMediaLinks.vue'
|
|
31
41
|
export { default as SubHeader } from './SubHeader/SubHeader.vue'
|
|
42
|
+
export { default as UserMenuBtn } from './UserMenuBtn/UserMenuBtn.vue'
|
|
43
|
+
export { default as CookieBanner } from './CookieBanner/CookieBanner.vue'
|
|
44
|
+
export { default as CookiesSelection } from './CookiesSelection/CookiesSelection.vue'
|
|
45
|
+
export { default as CookiesInformation } from './CookiesSelection/CookiesInformation/CookiesInformation.vue'
|
|
46
|
+
export { default as CookiesTable } from './CookiesSelection/CookiesTable/CookiesTable.vue'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { useFieldValidation } from '../useFieldValidation'
|
|
3
|
+
|
|
4
|
+
describe('useFieldValidation', () => {
|
|
5
|
+
const { generateRules } = useFieldValidation()
|
|
6
|
+
|
|
7
|
+
it('should validate required rule', () => {
|
|
8
|
+
const rules = generateRules([{ type: 'required', options: { message: 'This field is required.' } }])
|
|
9
|
+
const rule = rules[0]
|
|
10
|
+
|
|
11
|
+
expect(rule('')).toEqual({ error: 'This field is required.' })
|
|
12
|
+
expect(rule('value')).toEqual({ success: 'Le champ est valide.' })
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
it('should validate min rule', () => {
|
|
16
|
+
const rules = generateRules([{ type: 'min', options: { value: 5, message: 'Value must be at least 5.' } }])
|
|
17
|
+
const rule = rules[0]
|
|
18
|
+
|
|
19
|
+
expect(rule(3)).toEqual({ error: 'Value must be at least 5.' })
|
|
20
|
+
expect(rule(5)).toEqual({ success: 'Le champ est valide.' })
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('should validate max rule', () => {
|
|
24
|
+
const rules = generateRules([{ type: 'max', options: { value: 10, message: 'Value must be at most 10.' } }])
|
|
25
|
+
const rule = rules[0]
|
|
26
|
+
|
|
27
|
+
expect(rule(15)).toEqual({ error: 'Value must be at most 10.' })
|
|
28
|
+
expect(rule(10)).toEqual({ success: 'Le champ est valide.' })
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('should validate minLength rule', () => {
|
|
32
|
+
const rules = generateRules([{ type: 'minLength', options: { length: 5, message: 'Minimum length is 5.' } }])
|
|
33
|
+
const rule = rules[0]
|
|
34
|
+
|
|
35
|
+
expect(rule('1234')).toEqual({ error: 'Minimum length is 5.' })
|
|
36
|
+
expect(rule('12345')).toEqual({ success: 'Le champ est valide.' })
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('should validate maxLength rule', () => {
|
|
40
|
+
const rules = generateRules([{ type: 'maxLength', options: { length: 5, message: 'Maximum length is 5.' } }])
|
|
41
|
+
const rule = rules[0]
|
|
42
|
+
|
|
43
|
+
expect(rule('123456')).toEqual({ error: 'Maximum length is 5.' })
|
|
44
|
+
expect(rule('12345')).toEqual({ success: 'Le champ est valide.' })
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('should validate exactLength rule', () => {
|
|
48
|
+
const rules = generateRules([{ type: 'exactLength', options: { length: 5, message: 'Length must be exactly 5.' } }])
|
|
49
|
+
const rule = rules[0]
|
|
50
|
+
|
|
51
|
+
expect(rule('1234')).toEqual({ error: 'Length must be exactly 5.' })
|
|
52
|
+
expect(rule('12345')).toEqual({ success: 'Le champ est valide.' })
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('should validate email rule', () => {
|
|
56
|
+
const rules = generateRules([{ type: 'email', options: { message: 'Invalid email address.' } }])
|
|
57
|
+
const rule = rules[0]
|
|
58
|
+
|
|
59
|
+
expect(rule('invalid-email')).toEqual({ error: 'Invalid email address.' })
|
|
60
|
+
expect(rule('test@example.com')).toEqual({ success: 'Le champ est valide.' })
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('should validate matchPattern rule', () => {
|
|
64
|
+
const rules = generateRules([{
|
|
65
|
+
type: 'matchPattern',
|
|
66
|
+
options: { pattern: /^[a-z]+$/, message: 'Invalid format.' },
|
|
67
|
+
}])
|
|
68
|
+
const rule = rules[0]
|
|
69
|
+
|
|
70
|
+
expect(rule('123')).toEqual({ error: 'Invalid format.' })
|
|
71
|
+
expect(rule('abc')).toEqual({ success: 'Le champ est valide.' })
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('should validate custom rule', () => {
|
|
75
|
+
const rules = generateRules([{
|
|
76
|
+
type: 'custom',
|
|
77
|
+
options: { validate: value => value === 'valid', message: 'Custom validation failed.' },
|
|
78
|
+
}])
|
|
79
|
+
const rule = rules[0]
|
|
80
|
+
|
|
81
|
+
expect(rule('invalid')).toEqual({ error: 'Custom validation failed.' })
|
|
82
|
+
expect(rule('valid')).toEqual({ success: 'Le champ est valide.' })
|
|
83
|
+
})
|
|
84
|
+
})
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
type RuleOptions = {
|
|
2
|
+
fieldName?: string
|
|
3
|
+
message?: string
|
|
4
|
+
successMessage?: string
|
|
5
|
+
length?: number
|
|
6
|
+
value?: number
|
|
7
|
+
pattern?: RegExp
|
|
8
|
+
ignoreSpace?: boolean
|
|
9
|
+
fieldIdentifier?: string
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
11
|
+
validate?: (value: any) => boolean | string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type ValidationResult = {
|
|
15
|
+
success?: string
|
|
16
|
+
error?: string
|
|
17
|
+
}
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
19
|
+
type ValidationRule = (value: any) => ValidationResult
|
|
20
|
+
|
|
21
|
+
export function useFieldValidation() {
|
|
22
|
+
const createRule = (type: string, options: RuleOptions = {}): ValidationRule => {
|
|
23
|
+
const getValueLength = (value: string) => {
|
|
24
|
+
return options.ignoreSpace ? value.replace(/\s/g, '').length : value.length
|
|
25
|
+
}
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
27
|
+
return (value: any) => {
|
|
28
|
+
if (type !== 'required' && typeof value === 'string' && value.trim() === '') {
|
|
29
|
+
return {}
|
|
30
|
+
}
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'required':
|
|
33
|
+
return typeof value === 'string' && value.trim()
|
|
34
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
35
|
+
: { error: options.message || `Vous devez renseigner ${options.fieldName || 'ce champ'}.` }
|
|
36
|
+
|
|
37
|
+
case 'min':
|
|
38
|
+
return typeof value === 'number' && value >= (options.value ?? 0)
|
|
39
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
40
|
+
: { error: options.message || `La valeur doit être supérieure ou égale à ${options.value}.` }
|
|
41
|
+
|
|
42
|
+
case 'minLength':
|
|
43
|
+
return typeof value === 'string' && getValueLength(value) >= (options.length ?? 0)
|
|
44
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
45
|
+
: { error: options.message || `Ce champ doit avoir au moins ${options.length} caractères.` }
|
|
46
|
+
|
|
47
|
+
case 'max':
|
|
48
|
+
return typeof value === 'number' && value <= (options.value ?? Infinity)
|
|
49
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
50
|
+
: { error: options.message || `La valeur doit être inférieure ou égale à ${options.value}.` }
|
|
51
|
+
|
|
52
|
+
case 'maxLength':
|
|
53
|
+
return typeof value === 'string' && getValueLength(value) <= (options.length ?? Infinity)
|
|
54
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
55
|
+
: { error: options.message || `Ce champ ne doit pas dépasser ${options.length} caractères.` }
|
|
56
|
+
|
|
57
|
+
case 'exactLength':
|
|
58
|
+
return typeof value === 'string' && getValueLength(value) === (options.length ?? 0)
|
|
59
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
60
|
+
: { error: options.message || `Ce champ doit avoir exactement ${options.length} caractères.` }
|
|
61
|
+
|
|
62
|
+
case 'email':
|
|
63
|
+
return typeof value === 'string' && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)
|
|
64
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
65
|
+
: { error: options.message || `Veuillez entrer un email valide.` }
|
|
66
|
+
|
|
67
|
+
case 'matchPattern':
|
|
68
|
+
return typeof value === 'string' && options.pattern?.test(value)
|
|
69
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
70
|
+
: { error: options.message || `Format invalide.` }
|
|
71
|
+
|
|
72
|
+
case 'custom': {
|
|
73
|
+
const result = options.validate?.(value)
|
|
74
|
+
return result === true
|
|
75
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
76
|
+
: { error: typeof result === 'string' ? result : options.message || `Validation échouée.` }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
default:
|
|
80
|
+
return { error: `La règle spécifiée n'existe pas.` }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const generateRules = (fieldRules: Array<{ type: string, options?: RuleOptions }>) => {
|
|
86
|
+
return fieldRules.map(rule => createRule(rule.type, rule.options))
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return { generateRules }
|
|
90
|
+
}
|
|
@@ -2,6 +2,7 @@ import { cnamSemanticTokens } from './tokens/cnam/cnamSemantic'
|
|
|
2
2
|
import { cnamContextualTokens } from './tokens/cnam/cnamContextual'
|
|
3
3
|
import { cnamColorsTokens } from './tokens/cnam/cnamColors'
|
|
4
4
|
import { cnamLightTheme } from './tokens/cnam/cnamLightTheme'
|
|
5
|
+
import { cnamDarkTheme } from './tokens/cnam/cnamDarkTheme'
|
|
5
6
|
import { bootstrapColorsTokens } from './tokens/bootstrap/bootstrapColors'
|
|
6
7
|
import { bootstrapLightTheme } from './tokens/bootstrap/bootstrapLightTheme'
|
|
7
8
|
|
|
@@ -10,6 +11,7 @@ export {
|
|
|
10
11
|
cnamSemanticTokens,
|
|
11
12
|
cnamContextualTokens,
|
|
12
13
|
cnamLightTheme,
|
|
14
|
+
cnamDarkTheme,
|
|
13
15
|
bootstrapColorsTokens,
|
|
14
16
|
bootstrapLightTheme,
|
|
15
17
|
}
|
|
@@ -7,6 +7,7 @@ export const cnamLightTheme = {
|
|
|
7
7
|
accent: cnamColorsTokens.cyan.base,
|
|
8
8
|
error: cnamColorsTokens.orange.darken20,
|
|
9
9
|
info: cnamColorsTokens.blue.base,
|
|
10
|
+
avatar: cnamColorsTokens.cyan.darken20,
|
|
10
11
|
success: cnamColorsTokens.turquoise.darken60,
|
|
11
12
|
warning: cnamColorsTokens.yellow.darken60,
|
|
12
13
|
risquePro: cnamColorsTokens.brick.base,
|
package/src/main.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Meta } from "@storybook/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="Fondamentaux/Arrondis" />
|
|
4
|
+
|
|
5
|
+
# Arrondis
|
|
6
|
+
|
|
7
|
+
Les angles des éléments permettent de créer du contraste entre les formes et de suggérer l’utilisation des composants
|
|
8
|
+
|
|
9
|
+
Il existe 4 radius disponibles :
|
|
10
|
+
|
|
11
|
+
- <b>rounded-0 : 0px</b><br/>
|
|
12
|
+
Dès lors que l’on ne souhaite pas utiliser de radius
|
|
13
|
+
|
|
14
|
+
- <b>rounded : 4px</b><br/>
|
|
15
|
+
Ce radius peut être utilisé sur des éléments interactifs tels que les boutons, les inputs, les alerts,
|
|
16
|
+
|
|
17
|
+
- <b>rounded-lg : 8px</b><br/>
|
|
18
|
+
Ce radius peut être utilisé sur des blocs de structure (cards, tableaux...)
|
|
19
|
+
|
|
20
|
+
- <b>rounded-pill : 96px</b><br/>
|
|
21
|
+
Ce radius peut être utilisé sur des éléments (intéractifs ou non) présentant de la donnée, comme des tags, des filtres, des status...
|
|
22
|
+
|
|
23
|
+
<br />
|
|
24
|
+
<img alt="Radius" src={'/radius.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
@@ -2,7 +2,7 @@ import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs';
|
|
|
2
2
|
import { cnamLightTheme } from "@/designTokens/tokens/cnam/cnamLightTheme.ts";
|
|
3
3
|
import { cnamColorsTokens } from '@/designTokens/tokens/cnam/cnamColors.ts'
|
|
4
4
|
|
|
5
|
-
<Meta title="
|
|
5
|
+
<Meta title="Fondamentaux/Couleurs" />
|
|
6
6
|
|
|
7
7
|
# Couleurs
|
|
8
8
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta } from "@storybook/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="Fondamentaux/Elévations" />
|
|
4
|
+
|
|
5
|
+
# Elévations
|
|
6
|
+
|
|
7
|
+
<b>Les plateformes de l’Assurance Maladie n’utilisent pas d’élévations à but esthétiques.</b><br/>
|
|
8
|
+
L’élévation est à utiliser pour représenter des interactions avec superposition, comme un élément fixe se positionnant au-dessus d’un élément scrollable, un bouton flottant...
|
|
9
|
+
|
|
10
|
+
<b>Le style d’élévation est issu de la librairie Vuetify.</b><br/>
|
|
11
|
+
Pour des raisons de cohérence et d’esthétique, des 24 élévations différentes, nous avons retenue la <b>02</b> qui sera la seule et unique utilisée sur les plateformes.
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
<img alt="Elevation" src={'/elevation.jpg'} style={{marginLeft: '-5px'}} />
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Meta } from "@storybook/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="Fondamentaux/Espacements" />
|
|
4
|
+
|
|
5
|
+
# Espacements
|
|
6
|
+
|
|
7
|
+
Le design système de la CNAM est basé sur des multiples de 4 pour définir la taille des éléments, placer des espacements et disposer des composants.<br/>
|
|
8
|
+
Ce système d’espacement permet de garantir une homogénéité, cohérence et consistance des interfaces conçues. Cela dans le but d'améliorer l’UX et de faciliter la conception et le développement.
|
|
9
|
+
|
|
10
|
+
Chaque partie de l'interface utilisateur doit être intentionnellement conçue, y compris l'espace vide entre les éléments. Les espacements permettent de :
|
|
11
|
+
|
|
12
|
+
- <b>Créer des relations</b>
|
|
13
|
+
Utilisez des espacements faibles entre plusieurs composants pour signaler qu’ils sont liés, ou font partie d’un même groupe (exemple : champs de formulaire) ;
|
|
14
|
+
Utilisez des espacements importants pour mettre en évidence un élément indépendant du reste de la page (exemple : call to action).
|
|
15
|
+
|
|
16
|
+
- <b>Créer des hiérarchies</b>
|
|
17
|
+
Augmentez les espacements autour d’un composant clé de votre page permet d’améliorer sa visibilité.
|
|
18
|
+
|
|
19
|
+
## Les espacements verticaux
|
|
20
|
+
<br />
|
|
21
|
+
<img alt="Les espacements verticaux" src={'/espacements-verticaux.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
22
|
+
|
|
23
|
+
## Les espacements horizontaux
|
|
24
|
+
<br />
|
|
25
|
+
<img alt="Les espacements horizontaux" src={'/espacements-horizontaux.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
26
|
+
|
|
27
|
+
## Mise en situation
|
|
28
|
+
<br />
|
|
29
|
+
<img alt="Mise en situation" src={'/espacements-situation.jpg'} style={{ border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meta } from "@storybook/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="Fondamentaux/Styles typographiques" />
|
|
4
|
+
|
|
5
|
+
# Styles typographiques
|
|
6
|
+
|
|
7
|
+
## Styles de titres
|
|
8
|
+
|
|
9
|
+
Les titres sont utilisés pour créer une hiérarchie visuelle dans la page, et permettent de trouver facilement une information.
|
|
10
|
+
|
|
11
|
+
<img alt="Styles de titres" src={'/font-titres.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Styles de titres alternatifs
|
|
15
|
+
|
|
16
|
+
Pour donner une plus grande liberté éditoriale et graphique, sans nuire à la hiérarchie de l’information et au référencement nous vous proposons plusieurs niveaux de titres alternatifs (display). Vous pourrez les utiliser pour les mise en avant, les bannières, etc..
|
|
17
|
+
Les titres alternatifs peuvent être associés selon votre besoin à un h1, un h2, un h3 ou un h4.
|
|
18
|
+
|
|
19
|
+
<img alt="Styles de titres alternatifs" src={'/font-titres-alt.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Corps de texte
|
|
23
|
+
|
|
24
|
+
Les styles de texte sont là pour vous aider à concevoir vos interfaces efficacement et assurer l’homogénéité entre les différents sites.
|
|
25
|
+
|
|
26
|
+
<img alt="Corps de texte" src={'/font-corps.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Liens et libellés
|
|
30
|
+
|
|
31
|
+
<br />
|
|
32
|
+
|
|
33
|
+
<img alt="Liens et libellés" src={'/font-liens.jpg'} style={{ padding: '10px', border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Meta, Typeset } from '@storybook/addon-docs';
|
|
2
|
+
|
|
3
|
+
<Meta title="Fondamentaux/Typographie" />
|
|
4
|
+
|
|
5
|
+
export const typography = {
|
|
6
|
+
type: {
|
|
7
|
+
primary: 'Arial',
|
|
8
|
+
},
|
|
9
|
+
weight: {
|
|
10
|
+
regular: '400',
|
|
11
|
+
bold: '700',
|
|
12
|
+
extrabold: '800',
|
|
13
|
+
black: '900',
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
s1: 12,
|
|
17
|
+
s2: 14,
|
|
18
|
+
s3: 16,
|
|
19
|
+
m1: 18,
|
|
20
|
+
m2: 20,
|
|
21
|
+
m3: 24,
|
|
22
|
+
l1: 28,
|
|
23
|
+
l2: 30,
|
|
24
|
+
l3: 32,
|
|
25
|
+
l4:40,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const SampleText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
|
|
30
|
+
|
|
31
|
+
# Typographie
|
|
32
|
+
|
|
33
|
+
<img alt="Arial" src={'/font-arial.jpg'} style={{ border: '1px solid rgba(0, 0, 0, 0.05)', boxShadow: 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' }} />
|
|
34
|
+
|
|
35
|
+
**Weights:** 400(regular), 700(bold), 900(black)
|
|
36
|
+
|
|
37
|
+
<Typeset
|
|
38
|
+
fontSizes={[
|
|
39
|
+
Number(typography.size.s1),
|
|
40
|
+
Number(typography.size.s2),
|
|
41
|
+
Number(typography.size.s3),
|
|
42
|
+
Number(typography.size.m1),
|
|
43
|
+
Number(typography.size.m2),
|
|
44
|
+
Number(typography.size.m3),
|
|
45
|
+
Number(typography.size.l1),
|
|
46
|
+
Number(typography.size.l2),
|
|
47
|
+
Number(typography.size.l3),
|
|
48
|
+
Number(typography.size.l4),
|
|
49
|
+
]}
|
|
50
|
+
fontWeight={typography.weight.regular}
|
|
51
|
+
sampleText={SampleText}
|
|
52
|
+
fontFamily={typography.type.primary}
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
**Interlignage:** 2 ratio de line-height :
|
|
56
|
+
|
|
57
|
+
- 130% quand le `font-size` est supérieur à 18px
|
|
58
|
+
- 150% quand le `font-size` est inférieur ou égal à 18px
|