@cnamts/synapse 0.0.3-alpha → 0.0.5-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 +1461 -68
- package/dist/design-system-v3.js +4775 -1673
- package/dist/design-system-v3.umd.cjs +10 -1
- package/dist/style.css +1 -1
- package/package.json +6 -2
- package/src/assets/tokens.scss +0 -1
- package/src/components/Alert/Accessibilite.mdx +14 -0
- package/src/components/Alert/Accessibilite.stories.ts +166 -0
- package/src/components/Alert/AccessibiliteItems.ts +152 -0
- package/src/components/Alert/Alert.mdx +1 -1
- package/src/components/Alert/Alert.stories.ts +91 -1
- package/src/components/Alert/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/BackBtn/Accessibilite.mdx +14 -0
- package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackBtn/AccessibiliteItems.ts +132 -0
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackBtn/BackBtn.stories.ts +84 -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 +82 -0
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +3 -3
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +172 -11
- package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
- package/src/components/CollapsibleList/Accessibilite.stories.ts +166 -0
- package/src/components/CollapsibleList/AccessibiliteItems.ts +129 -0
- package/src/components/CollapsibleList/CollapsibleList.mdx +2 -2
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +37 -1
- package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CopyBtn/Accessibilite.mdx +14 -0
- package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
- package/src/components/CopyBtn/AccessibiliteItems.ts +135 -0
- package/src/components/CopyBtn/CopyBtn.mdx +1 -1
- package/src/components/CopyBtn/CopyBtn.stories.ts +120 -1
- package/src/components/CopyBtn/CopyBtn.vue +1 -1
- package/src/components/CopyBtn/config.ts +2 -0
- package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +44 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +606 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +246 -0
- package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +40 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +420 -0
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +89 -54
- package/src/components/Customs/SyInputSelect/config.ts +10 -0
- package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +10 -10
- package/src/components/Customs/SySelect/SySelect.stories.ts +338 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +34 -11
- package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
- package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +403 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +110 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +93 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +57 -0
- package/src/components/Customs/SyTextField/types.d.ts +3 -0
- package/src/components/DataList/DataList.mdx +77 -0
- package/src/components/DataList/DataList.stories.ts +960 -0
- package/src/components/DataList/DataList.vue +140 -0
- package/src/components/DataList/DataListLoading/DataListLoading.vue +56 -0
- package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +23 -0
- package/src/components/DataList/locales.ts +3 -0
- package/src/components/DataList/tests/DataList.spec.ts +194 -0
- package/src/components/DataList/types.d.ts +23 -0
- package/src/components/DataListGroup/DataListGroup.mdx +77 -0
- package/src/components/DataListGroup/DataListGroup.stories.ts +987 -0
- package/src/components/DataListGroup/DataListGroup.vue +59 -0
- package/src/components/DataListGroup/tests/DataListGroup.spec.ts +54 -0
- package/src/components/DataListGroup/tests/data/dataListGroupItems.ts +41 -0
- package/src/components/DataListGroup/types.d.ts +15 -0
- package/src/components/DataListItem/DataListItem.vue +135 -0
- package/src/components/DataListItem/config.ts +17 -0
- package/src/components/DataListItem/locales.ts +3 -0
- package/src/components/DataListItem/tests/DataListItem.spec.ts +156 -0
- package/src/components/DataListItem/types.d.ts +23 -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/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/Accessibilite.mdx +14 -0
- package/src/components/DownloadBtn/Accessibilite.stories.ts +166 -0
- package/src/components/DownloadBtn/AccessibiliteItems.ts +129 -0
- package/src/components/DownloadBtn/DownloadBtn.mdx +5 -6
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +207 -2
- package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +4 -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/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/FooterBar.mdx +2 -2
- package/src/components/FooterBar/FooterBar.stories.ts +557 -9
- package/src/components/FooterBar/config.ts +2 -3
- 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 +2 -2
- package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +199 -0
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +58 -1
- package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/HeaderBar.mdx +164 -45
- package/src/components/HeaderBar/HeaderBar.stories.ts +618 -16
- package/src/components/HeaderBar/HeaderBar.vue +60 -22
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
- package/src/components/HeaderBar/{HeaderComplexMenu/HeaderComplexMenu.vue → HeaderBurgerMenu/HeaderBurgerMenu.vue} +74 -45
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +38 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +89 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +17 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +121 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/HeaderMenuSection.vue +2 -2
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +1 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +43 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +261 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/HeaderSubMenu.vue +17 -3
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +180 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +13 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +13 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +62 -25
- package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +49 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +19 -23
- package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +70 -0
- package/src/components/HeaderBar/Usages.mdx +85 -0
- package/src/components/HeaderBar/consts.scss +0 -1
- package/src/components/HeaderBar/tests/HeaderBar.spec.ts +8 -2
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +5 -10
- package/src/components/HeaderLoading/HeaderLoading.mdx +28 -0
- package/src/components/HeaderLoading/HeaderLoading.stories.ts +62 -0
- package/src/components/HeaderLoading/HeaderLoading.vue +45 -0
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +22 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +128 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +784 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +194 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +74 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/config.ts +18 -0
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +127 -0
- package/src/components/HeaderNavigationBar/types.ts +7 -0
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +31 -0
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +343 -0
- package/src/components/HeaderToolbar/HeaderToolbar.vue +487 -0
- package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +230 -0
- package/src/components/HeaderToolbar/types.d.ts +20 -0
- package/src/components/LangBtn/Accessibilite.mdx +14 -0
- package/src/components/LangBtn/Accessibilite.stories.ts +166 -0
- package/src/components/LangBtn/AccessibiliteItems.ts +132 -0
- package/src/components/LangBtn/LangBtn.mdx +1 -1
- package/src/components/LangBtn/LangBtn.stories.ts +125 -8
- 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/Logo.mdx +2 -2
- package/src/components/Logo/Logo.stories.ts +147 -1
- package/src/components/LogoBrandSection/LogoBrandSection.mdx +14 -0
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +158 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +312 -0
- package/src/components/LogoBrandSection/assets/ameli-pro.svg +1 -0
- package/src/components/LogoBrandSection/assets/ameli.svg +1 -0
- package/src/components/LogoBrandSection/assets/cnam.svg +1 -0
- package/src/components/LogoBrandSection/assets/compte-ameli.svg +1 -0
- package/src/components/LogoBrandSection/dividerDimensionsMapping.ts +14 -0
- package/src/components/LogoBrandSection/locales.ts +14 -0
- package/src/components/LogoBrandSection/secondaryLogoMapping.ts +24 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +365 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +14 -0
- package/src/components/LogoBrandSection/types.ts +8 -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/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/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/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 +174 -0
- package/src/components/NotificationBar/NotificationBar.mdx +6 -6
- package/src/components/NotificationBar/NotificationBar.stories.ts +1 -1
- package/src/components/NotificationBar/NotificationBar.vue +2 -2
- package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotificationBar/options.ts +1 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +1 -1
- 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 +86 -1
- package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PhoneField/PhoneField.mdx +49 -0
- package/src/components/PhoneField/PhoneField.stories.ts +869 -0
- package/src/components/PhoneField/PhoneField.vue +230 -0
- package/src/components/PhoneField/indicatifs.ts +104 -0
- package/src/components/PhoneField/locales.ts +4 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +179 -0
- 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 +50 -1
- package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +33 -2
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +38 -1
- 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/SubHeader.mdx +31 -0
- package/src/components/SubHeader/SubHeader.stories.ts +1032 -0
- package/src/components/SubHeader/SubHeader.vue +185 -0
- package/src/components/SubHeader/config.ts +12 -0
- package/src/components/SubHeader/locales.ts +3 -0
- package/src/components/SubHeader/tests/SubHeader.spec.ts +144 -0
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +438 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +105 -0
- package/src/components/UserMenuBtn/config.ts +24 -0
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
- package/src/components/index.ts +33 -7
- package/src/composables/index.ts +8 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +82 -0
- package/src/composables/rules/useFieldValidation.ts +53 -0
- package/src/composables/widthable/index.ts +29 -0
- package/src/composables/widthable/tests/widthable.spec.ts +52 -0
- package/src/designTokens/index.ts +2 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +3 -2
- package/src/main.ts +3 -0
- package/src/modules.d.ts +4 -0
- package/src/services/index.ts +1 -0
- package/src/stories/Demarrer/Accueil.mdx +10 -0
- package/src/stories/Demarrer/Accueil.stories.ts +76 -0
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +9 -0
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +20 -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 +132 -0
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +52 -48
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +31 -28
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +1 -2
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
- package/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.ts +47 -0
- package/src/utils/functions/throttleDisplayFn/throttleDisplayFn.ts +26 -0
- package/src/utils/rules/exactLength/index.ts +33 -0
- package/src/utils/rules/exactLength/locales.ts +6 -0
- package/src/utils/rules/required/index.ts +25 -0
- package/src/utils/rules/required/locales.ts +5 -0
- package/src/utils/rules/required/ruleMessageHelper.ts +14 -0
- package/src/utils/rules/required/tests/index.spec.ts +47 -0
- package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +22 -0
- package/src/utils/rules/types.d.ts +15 -0
- package/src/components/Beta/beta.mdx +0 -5
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -42
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +0 -154
- package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +0 -182
- package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
- package/src/components/Deprecated/deprecated.mdx +0 -5
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderComplexMenu.stories.ts +0 -272
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +0 -49
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +0 -56
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +0 -137
- package/src/components/HeaderBar/HeaderComplexMenu/tests/HeaderComplexMenu.spec.ts +0 -129
- package/src/components/HeaderBar/HeaderComplexMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +0 -18
- package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
- package/src/stories/Guidelines/Typo.mdx +0 -53
- package/src/stories/Home/Accueil.mdx +0 -7
- package/src/stories/Home/PolitiqueDeConfidentialite.mdx +0 -4
- package/src/stories/Home/synapse.webp +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/HeaderMenuItem.vue +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/conts.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/locals.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/tests/useHandleSubMenus.spec.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/useHandleSubMenus.ts +0 -0
- /package/src/components/Logo/{types.d.ts → types.ts} +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,246 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, watch, computed, onMounted, useSlots } from 'vue'
|
|
3
|
+
import { useDisplay } from 'vuetify'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: [Object, String, null],
|
|
8
|
+
default: null,
|
|
9
|
+
},
|
|
10
|
+
menuItems: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => [],
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'Sélectionnez une option',
|
|
17
|
+
},
|
|
18
|
+
required: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
menuId: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'custom-btn-select-menu',
|
|
25
|
+
},
|
|
26
|
+
textKey: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: 'text',
|
|
29
|
+
},
|
|
30
|
+
valueKey: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'value',
|
|
33
|
+
},
|
|
34
|
+
primaryInfo: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'Information principale',
|
|
37
|
+
},
|
|
38
|
+
secondaryInfo: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: undefined,
|
|
41
|
+
},
|
|
42
|
+
hideIcon: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
hideLogoutBtn: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
isMobileView: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
iconOnly: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
options: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default: () => ({ menu: {}, btn: {}, list: {} }),
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const emit = defineEmits(['update:modelValue', 'logout'])
|
|
65
|
+
const slots = useSlots()
|
|
66
|
+
const { smAndDown } = useDisplay()
|
|
67
|
+
|
|
68
|
+
const isOpen = ref(false)
|
|
69
|
+
const selectedItem = ref<Record<string, unknown> | string | null>(props.modelValue as Record<string, unknown> | string | null)
|
|
70
|
+
const toggleMenu = () => {
|
|
71
|
+
isOpen.value = !isOpen.value
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const buttonRef = ref<HTMLElement | null>(null)
|
|
75
|
+
const buttonWidth = ref('')
|
|
76
|
+
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
if (buttonRef.value && !isMobileVersion.value) {
|
|
79
|
+
buttonWidth.value = `${buttonRef.value.getBoundingClientRect().width}px`
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const selectItem = (item: unknown) => {
|
|
84
|
+
selectedItem.value = item as string | Record<string, unknown> | null
|
|
85
|
+
emit('update:modelValue', item)
|
|
86
|
+
isOpen.value = false
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const getItemText = (item: unknown) => {
|
|
90
|
+
return (item as Record<string, unknown>)[props.textKey]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const formattedItems = computed(() => {
|
|
94
|
+
return props.menuItems.map((item) => {
|
|
95
|
+
if (typeof item === 'string') {
|
|
96
|
+
return { [props.textKey]: item, [props.valueKey]: item }
|
|
97
|
+
}
|
|
98
|
+
return item
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
const btnPadding = computed(() => {
|
|
103
|
+
if (props.hideIcon) {
|
|
104
|
+
return 'pa-1 pa-sm-2'
|
|
105
|
+
}
|
|
106
|
+
return isMobileVersion.value ? 'pa-0' : 'pa-1 pa-sm-3'
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
const hasListContent = computed(() => {
|
|
110
|
+
return Boolean(slots.default || !props.hideLogoutBtn)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const isMobileVersion = computed(() => {
|
|
114
|
+
return props.isMobileView || smAndDown.value || props.iconOnly
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
watch(() => props.modelValue, (newValue) => {
|
|
118
|
+
selectedItem.value = newValue
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const generatedId = ref(`custom-btn-select-${Math.random().toString(36).substring(7)}`)
|
|
122
|
+
|
|
123
|
+
defineExpose({
|
|
124
|
+
isOpen,
|
|
125
|
+
formattedItems,
|
|
126
|
+
selectedItem,
|
|
127
|
+
})
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<template>
|
|
131
|
+
<div
|
|
132
|
+
ref="buttonRef"
|
|
133
|
+
class="vd-user-menu-btn-ctn d-inline-block"
|
|
134
|
+
>
|
|
135
|
+
<VMenu
|
|
136
|
+
:id="generatedId"
|
|
137
|
+
:disabled="!hasListContent"
|
|
138
|
+
location="bottom end"
|
|
139
|
+
transition="fade-transition"
|
|
140
|
+
v-bind="props.options['menu']"
|
|
141
|
+
z-index="9999"
|
|
142
|
+
>
|
|
143
|
+
<template #activator="{ props: menuProps }">
|
|
144
|
+
<VBtn
|
|
145
|
+
:id="generatedId"
|
|
146
|
+
:class="btnPadding"
|
|
147
|
+
:height="iconOnly ? 'auto' : undefined"
|
|
148
|
+
:width="iconOnly ? 'auto' : undefined"
|
|
149
|
+
:icon="iconOnly"
|
|
150
|
+
:size="iconOnly ? 'x-large' : 'default'"
|
|
151
|
+
class="vd-user-menu-btn"
|
|
152
|
+
v-bind="{
|
|
153
|
+
...menuProps,
|
|
154
|
+
...props.options['btn'],
|
|
155
|
+
}"
|
|
156
|
+
@click="toggleMenu"
|
|
157
|
+
>
|
|
158
|
+
<div
|
|
159
|
+
:class="['text-'+props?.options['btn']?.color]"
|
|
160
|
+
class="d-flex align-center"
|
|
161
|
+
>
|
|
162
|
+
<slot name="prepend-icon" />
|
|
163
|
+
<span class="d-sr-only">{{ props.label }}</span>
|
|
164
|
+
<span
|
|
165
|
+
v-if="!isMobileVersion && !iconOnly"
|
|
166
|
+
class="d-flex flex-column align-end py-1 mr-1"
|
|
167
|
+
>
|
|
168
|
+
<span
|
|
169
|
+
:class="`text-${props?.options['btn']?.textColor}`"
|
|
170
|
+
class="font-weight-bold"
|
|
171
|
+
>{{ props.primaryInfo }}
|
|
172
|
+
</span>
|
|
173
|
+
<span
|
|
174
|
+
:class="`text-${props?.options['btn']?.textColor}`"
|
|
175
|
+
class="text-grey text-darken-2 font-weight-medium"
|
|
176
|
+
>{{ props.secondaryInfo }}
|
|
177
|
+
</span>
|
|
178
|
+
</span>
|
|
179
|
+
<span
|
|
180
|
+
v-if="isMobileVersion && !iconOnly"
|
|
181
|
+
:class="`text-${props?.options['btn']?.textColor}`"
|
|
182
|
+
class="font-weight-bold text-caption"
|
|
183
|
+
>{{ props.primaryInfo }}</span>
|
|
184
|
+
<slot name="append-icon" />
|
|
185
|
+
</div>
|
|
186
|
+
</VBtn>
|
|
187
|
+
</template>
|
|
188
|
+
<slot name="content">
|
|
189
|
+
<VList
|
|
190
|
+
v-if="hasListContent"
|
|
191
|
+
v-bind="props.options['list']"
|
|
192
|
+
>
|
|
193
|
+
<VListItem
|
|
194
|
+
v-for="(item, index) in formattedItems"
|
|
195
|
+
:key="index"
|
|
196
|
+
:class="`text-${props?.options['list']?.textColor}`"
|
|
197
|
+
v-bind="props.options['list']"
|
|
198
|
+
@click="selectItem(item)"
|
|
199
|
+
>
|
|
200
|
+
<VListItemTitle v-bind="props.options['list']">
|
|
201
|
+
{{ getItemText(item) }}
|
|
202
|
+
</VListItemTitle>
|
|
203
|
+
</VListItem>
|
|
204
|
+
<slot />
|
|
205
|
+
<slot name="footer-list-item" />
|
|
206
|
+
</VList>
|
|
207
|
+
</slot>
|
|
208
|
+
</VMenu>
|
|
209
|
+
</div>
|
|
210
|
+
</template>
|
|
211
|
+
|
|
212
|
+
<style lang="scss" scoped>
|
|
213
|
+
@use '@/assets/tokens.scss';
|
|
214
|
+
|
|
215
|
+
.vd-user-menu-btn-ctn {
|
|
216
|
+
position: relative;
|
|
217
|
+
z-index: 1;
|
|
218
|
+
|
|
219
|
+
.v-btn.v-btn--density-default {
|
|
220
|
+
height: auto !important;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.vd-user-menu-btn {
|
|
225
|
+
outline: none;
|
|
226
|
+
padding: 12px !important;
|
|
227
|
+
|
|
228
|
+
&:hover:before {
|
|
229
|
+
background: #000;
|
|
230
|
+
opacity: 0.05;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&:focus:before {
|
|
234
|
+
background: tokens.$blue-base;
|
|
235
|
+
opacity: 0.08;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&:focus {
|
|
239
|
+
background: rgba(tokens.$blue-base, 0.08) !important;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:deep(.vd-user-menu-btn:focus > .v-btn__overlay) {
|
|
244
|
+
opacity: 0 !important;
|
|
245
|
+
}
|
|
246
|
+
</style>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import SyBtnSelect from '../SyBtnSelect.vue'
|
|
4
|
+
import { vuetify } from '@tests/unit/setup'
|
|
5
|
+
|
|
6
|
+
describe('SyBtnSelect', () => {
|
|
7
|
+
it('renders the component with default props', () => {
|
|
8
|
+
const wrapper = mount(SyBtnSelect, {
|
|
9
|
+
global: {
|
|
10
|
+
plugins: [vuetify],
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
primaryInfo: 'John Doe',
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
expect(wrapper.exists()).toBe(true)
|
|
18
|
+
expect(wrapper.text()).toContain('John Doe')
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('shows secondaryInfo if provided', () => {
|
|
22
|
+
const wrapper = mount(SyBtnSelect, {
|
|
23
|
+
global: {
|
|
24
|
+
plugins: [vuetify],
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
primaryInfo: 'John Doe',
|
|
28
|
+
secondaryInfo: 'Additional Info',
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
expect(wrapper.text()).toContain('Additional Info')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('emits "update:modelValue" when an item is selected', async () => {
|
|
36
|
+
const wrapper = mount(SyBtnSelect, {
|
|
37
|
+
global: {
|
|
38
|
+
plugins: [vuetify],
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
modelValue: null,
|
|
42
|
+
menuItems: [
|
|
43
|
+
{ text: 'Option 1', value: 'option1' },
|
|
44
|
+
{ text: 'Option 2', value: 'option2' },
|
|
45
|
+
],
|
|
46
|
+
primaryInfo: 'John Doe',
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const button = wrapper.find('.vd-user-menu-btn')
|
|
51
|
+
await button.trigger('click')
|
|
52
|
+
|
|
53
|
+
expect(wrapper.vm.isOpen).toBe(true)
|
|
54
|
+
|
|
55
|
+
const listItem = wrapper.findAllComponents({ name: 'VListItem' }).at(0)
|
|
56
|
+
expect(listItem).toBeTruthy()
|
|
57
|
+
await listItem?.trigger('click')
|
|
58
|
+
|
|
59
|
+
expect(wrapper.emitted('update:modelValue')).toBeTruthy()
|
|
60
|
+
expect(wrapper.emitted('update:modelValue')![0]).toEqual([
|
|
61
|
+
{ text: 'Option 1', value: 'option1' },
|
|
62
|
+
])
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('toggles the menu open and closed', async () => {
|
|
66
|
+
const wrapper = mount(SyBtnSelect, {
|
|
67
|
+
global: {
|
|
68
|
+
plugins: [vuetify],
|
|
69
|
+
},
|
|
70
|
+
props: {
|
|
71
|
+
primaryInfo: 'John Doe',
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const button = wrapper.find('.vd-user-menu-btn')
|
|
76
|
+
expect(wrapper.vm.isOpen).toBe(false)
|
|
77
|
+
|
|
78
|
+
await button.trigger('click')
|
|
79
|
+
expect(wrapper.vm.isOpen).toBe(true)
|
|
80
|
+
|
|
81
|
+
await button.trigger('click')
|
|
82
|
+
expect(wrapper.vm.isOpen).toBe(false)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('formats menu items correctly', () => {
|
|
86
|
+
const wrapper = mount(SyBtnSelect, {
|
|
87
|
+
global: {
|
|
88
|
+
plugins: [vuetify],
|
|
89
|
+
},
|
|
90
|
+
props: {
|
|
91
|
+
primaryInfo: 'John Doe',
|
|
92
|
+
menuItems: ['Option 1', 'Option 2'],
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const formattedItems = wrapper.vm.formattedItems
|
|
97
|
+
expect(formattedItems).toEqual([
|
|
98
|
+
{ text: 'Option 1', value: 'Option 1' },
|
|
99
|
+
{ text: 'Option 2', value: 'Option 2' },
|
|
100
|
+
])
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('updates selectedItem when modelValue changes', async () => {
|
|
104
|
+
const wrapper = mount(SyBtnSelect, {
|
|
105
|
+
global: {
|
|
106
|
+
plugins: [vuetify],
|
|
107
|
+
},
|
|
108
|
+
props: {
|
|
109
|
+
modelValue: 'initial-value',
|
|
110
|
+
primaryInfo: 'John Doe',
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
expect(wrapper.vm.selectedItem).toBe('initial-value')
|
|
115
|
+
|
|
116
|
+
await wrapper.setProps({ modelValue: 'new-value' })
|
|
117
|
+
expect(wrapper.vm.selectedItem).toBe('new-value')
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
it('renders the primaryInfo in a span when isMobileVersion and hideIcon are true', async () => {
|
|
121
|
+
const wrapper = mount(SyBtnSelect, {
|
|
122
|
+
global: {
|
|
123
|
+
plugins: [vuetify],
|
|
124
|
+
},
|
|
125
|
+
props: {
|
|
126
|
+
primaryInfo: 'John Doe',
|
|
127
|
+
isMobileView: true,
|
|
128
|
+
hideIcon: true,
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const span = wrapper.find('span.font-weight-bold.text-caption')
|
|
133
|
+
|
|
134
|
+
expect(span.text()).toBe('John Doe')
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it('does not render the span if isMobileVersion is false', () => {
|
|
138
|
+
const wrapper = mount(SyBtnSelect, {
|
|
139
|
+
global: {
|
|
140
|
+
plugins: [vuetify],
|
|
141
|
+
},
|
|
142
|
+
props: {
|
|
143
|
+
primaryInfo: 'John Doe',
|
|
144
|
+
isMobileView: false,
|
|
145
|
+
hideIcon: true,
|
|
146
|
+
},
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
const span = wrapper.find('span.font-weight-bold.text-sm-caption')
|
|
150
|
+
expect(span.exists()).toBe(false)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('does not render the span if hideIcon is false', () => {
|
|
154
|
+
const wrapper = mount(SyBtnSelect, {
|
|
155
|
+
global: {
|
|
156
|
+
plugins: [vuetify],
|
|
157
|
+
},
|
|
158
|
+
props: {
|
|
159
|
+
primaryInfo: 'John Doe',
|
|
160
|
+
isMobileView: true,
|
|
161
|
+
hideIcon: false,
|
|
162
|
+
},
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
const span = wrapper.find('span.font-weight-bold.text-sm-caption')
|
|
166
|
+
expect(span.exists()).toBe(false)
|
|
167
|
+
})
|
|
168
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Canvas, Meta, Controls, Story, Source } from '@storybook/blocks';
|
|
2
|
+
import * as SyInputSelectStories from "./SyInputSelect.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={SyInputSelectStories} />
|
|
5
|
+
|
|
6
|
+
# SyInputSelect
|
|
7
|
+
|
|
8
|
+
Le composant `SyInputSelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles RGAA.
|
|
9
|
+
|
|
10
|
+
<Canvas of={SyInputSelectStories.Default} />
|
|
11
|
+
|
|
12
|
+
<Story of={SyInputSelectStories.Info} />
|
|
13
|
+
|
|
14
|
+
# API
|
|
15
|
+
|
|
16
|
+
<Controls of={SyInputSelectStories.Default} />
|
|
17
|
+
|
|
18
|
+
# Exemple d'utilisation
|
|
19
|
+
|
|
20
|
+
<Source dark code={`
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import SyInputSelect from '@cnamts/synapse'
|
|
23
|
+
|
|
24
|
+
const items = [
|
|
25
|
+
{ text: 'Option 1', value: '1' },
|
|
26
|
+
{ text: 'Option 2', value: '2' },
|
|
27
|
+
],
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<main>
|
|
32
|
+
<div class="mt-12 ml-12">
|
|
33
|
+
<SyInputSelect
|
|
34
|
+
v-model="value"
|
|
35
|
+
:items="items"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</main>
|
|
39
|
+
</template>
|
|
40
|
+
`} />
|