@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.
Files changed (300) hide show
  1. package/dist/design-system-v3.d.ts +1461 -68
  2. package/dist/design-system-v3.js +4775 -1673
  3. package/dist/design-system-v3.umd.cjs +10 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +6 -2
  6. package/src/assets/tokens.scss +0 -1
  7. package/src/components/Alert/Accessibilite.mdx +14 -0
  8. package/src/components/Alert/Accessibilite.stories.ts +166 -0
  9. package/src/components/Alert/AccessibiliteItems.ts +152 -0
  10. package/src/components/Alert/Alert.mdx +1 -1
  11. package/src/components/Alert/Alert.stories.ts +91 -1
  12. package/src/components/Alert/constants/ExpertiseLevelEnum.ts +4 -0
  13. package/src/components/BackBtn/Accessibilite.mdx +14 -0
  14. package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
  15. package/src/components/BackBtn/AccessibiliteItems.ts +132 -0
  16. package/src/components/BackBtn/BackBtn.mdx +1 -1
  17. package/src/components/BackBtn/BackBtn.stories.ts +84 -1
  18. package/src/components/BackBtn/constants/ExpertiseLevelEnum.ts +4 -0
  19. package/src/components/BackToTopBtn/Accessibilite.mdx +14 -0
  20. package/src/components/BackToTopBtn/Accessibilite.stories.ts +166 -0
  21. package/src/components/BackToTopBtn/AccessibiliteItems.ts +82 -0
  22. package/src/components/BackToTopBtn/BackToTopBtn.mdx +3 -3
  23. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +172 -11
  24. package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
  25. package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
  26. package/src/components/CollapsibleList/Accessibilite.stories.ts +166 -0
  27. package/src/components/CollapsibleList/AccessibiliteItems.ts +129 -0
  28. package/src/components/CollapsibleList/CollapsibleList.mdx +2 -2
  29. package/src/components/CollapsibleList/CollapsibleList.stories.ts +37 -1
  30. package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
  31. package/src/components/CopyBtn/Accessibilite.mdx +14 -0
  32. package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
  33. package/src/components/CopyBtn/AccessibiliteItems.ts +135 -0
  34. package/src/components/CopyBtn/CopyBtn.mdx +1 -1
  35. package/src/components/CopyBtn/CopyBtn.stories.ts +120 -1
  36. package/src/components/CopyBtn/CopyBtn.vue +1 -1
  37. package/src/components/CopyBtn/config.ts +2 -0
  38. package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
  39. package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +44 -0
  40. package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +606 -0
  41. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +246 -0
  42. package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
  43. package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +40 -0
  44. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +420 -0
  45. package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +89 -54
  46. package/src/components/Customs/SyInputSelect/config.ts +10 -0
  47. package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
  48. package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +10 -10
  49. package/src/components/Customs/SySelect/SySelect.stories.ts +338 -0
  50. package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +34 -11
  51. package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
  52. package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
  53. package/src/components/Customs/SyTextField/SyTextField.stories.ts +403 -0
  54. package/src/components/Customs/SyTextField/SyTextField.vue +110 -0
  55. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +93 -0
  56. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +57 -0
  57. package/src/components/Customs/SyTextField/types.d.ts +3 -0
  58. package/src/components/DataList/DataList.mdx +77 -0
  59. package/src/components/DataList/DataList.stories.ts +960 -0
  60. package/src/components/DataList/DataList.vue +140 -0
  61. package/src/components/DataList/DataListLoading/DataListLoading.vue +56 -0
  62. package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +23 -0
  63. package/src/components/DataList/locales.ts +3 -0
  64. package/src/components/DataList/tests/DataList.spec.ts +194 -0
  65. package/src/components/DataList/types.d.ts +23 -0
  66. package/src/components/DataListGroup/DataListGroup.mdx +77 -0
  67. package/src/components/DataListGroup/DataListGroup.stories.ts +987 -0
  68. package/src/components/DataListGroup/DataListGroup.vue +59 -0
  69. package/src/components/DataListGroup/tests/DataListGroup.spec.ts +54 -0
  70. package/src/components/DataListGroup/tests/data/dataListGroupItems.ts +41 -0
  71. package/src/components/DataListGroup/types.d.ts +15 -0
  72. package/src/components/DataListItem/DataListItem.vue +135 -0
  73. package/src/components/DataListItem/config.ts +17 -0
  74. package/src/components/DataListItem/locales.ts +3 -0
  75. package/src/components/DataListItem/tests/DataListItem.spec.ts +156 -0
  76. package/src/components/DataListItem/types.d.ts +23 -0
  77. package/src/components/DialogBox/DialogBox.mdx +14 -0
  78. package/src/components/DialogBox/DialogBox.stories.ts +798 -0
  79. package/src/components/DialogBox/DialogBox.vue +181 -0
  80. package/src/components/DialogBox/config.ts +25 -0
  81. package/src/components/DialogBox/locales.ts +5 -0
  82. package/src/components/DialogBox/tests/DialogBox.spec.ts +329 -0
  83. package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +46 -0
  84. package/src/components/DownloadBtn/Accessibilite.mdx +14 -0
  85. package/src/components/DownloadBtn/Accessibilite.stories.ts +166 -0
  86. package/src/components/DownloadBtn/AccessibiliteItems.ts +129 -0
  87. package/src/components/DownloadBtn/DownloadBtn.mdx +5 -6
  88. package/src/components/DownloadBtn/DownloadBtn.stories.ts +207 -2
  89. package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +4 -0
  90. package/src/components/ErrorPage/ErrorPage.mdx +21 -0
  91. package/src/components/ErrorPage/ErrorPage.stories.ts +133 -0
  92. package/src/components/ErrorPage/ErrorPage.vue +93 -0
  93. package/src/components/ErrorPage/locales.ts +5 -0
  94. package/src/components/ErrorPage/tests/ErrorPage.spec.ts +40 -0
  95. package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +78 -0
  96. package/src/components/FooterBar/FooterBar.mdx +2 -2
  97. package/src/components/FooterBar/FooterBar.stories.ts +557 -9
  98. package/src/components/FooterBar/config.ts +2 -3
  99. package/src/components/FooterBar/tests/FooterBar.spec.ts +1 -1
  100. package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
  101. package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +2 -2
  102. package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
  103. package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
  104. package/src/components/FranceConnectBtn/AccessibiliteItems.ts +199 -0
  105. package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
  106. package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +58 -1
  107. package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
  108. package/src/components/HeaderBar/HeaderBar.mdx +164 -45
  109. package/src/components/HeaderBar/HeaderBar.stories.ts +618 -16
  110. package/src/components/HeaderBar/HeaderBar.vue +60 -22
  111. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
  112. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
  113. package/src/components/HeaderBar/{HeaderComplexMenu/HeaderComplexMenu.vue → HeaderBurgerMenu/HeaderBurgerMenu.vue} +74 -45
  114. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +38 -0
  115. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +89 -0
  116. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +1 -1
  117. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +17 -0
  118. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +121 -0
  119. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/HeaderMenuSection.vue +2 -2
  120. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +1 -3
  121. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +43 -0
  122. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +261 -0
  123. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/HeaderSubMenu.vue +17 -3
  124. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +1 -1
  125. package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +180 -0
  126. package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +13 -0
  127. package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +13 -0
  128. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +62 -25
  129. package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +49 -1
  130. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +19 -23
  131. package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +70 -0
  132. package/src/components/HeaderBar/Usages.mdx +85 -0
  133. package/src/components/HeaderBar/consts.scss +0 -1
  134. package/src/components/HeaderBar/tests/HeaderBar.spec.ts +8 -2
  135. package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +5 -10
  136. package/src/components/HeaderLoading/HeaderLoading.mdx +28 -0
  137. package/src/components/HeaderLoading/HeaderLoading.stories.ts +62 -0
  138. package/src/components/HeaderLoading/HeaderLoading.vue +45 -0
  139. package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +22 -0
  140. package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +128 -0
  141. package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +784 -0
  142. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +194 -0
  143. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +74 -0
  144. package/src/components/HeaderNavigationBar/HorizontalNavbar/config.ts +18 -0
  145. package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +127 -0
  146. package/src/components/HeaderNavigationBar/types.ts +7 -0
  147. package/src/components/HeaderToolbar/HeaderToolbar.mdx +31 -0
  148. package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +343 -0
  149. package/src/components/HeaderToolbar/HeaderToolbar.vue +487 -0
  150. package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +230 -0
  151. package/src/components/HeaderToolbar/types.d.ts +20 -0
  152. package/src/components/LangBtn/Accessibilite.mdx +14 -0
  153. package/src/components/LangBtn/Accessibilite.stories.ts +166 -0
  154. package/src/components/LangBtn/AccessibiliteItems.ts +132 -0
  155. package/src/components/LangBtn/LangBtn.mdx +1 -1
  156. package/src/components/LangBtn/LangBtn.stories.ts +125 -8
  157. package/src/components/LangBtn/constants/ExpertiseLevelEnum.ts +4 -0
  158. package/src/components/LangBtn/tests/LangBtn.spec.ts +1 -1
  159. package/src/components/LangBtn/tests/__snapshots__/LangBtn.spec.ts.snap +1 -1
  160. package/src/components/Logo/Logo.mdx +2 -2
  161. package/src/components/Logo/Logo.stories.ts +147 -1
  162. package/src/components/LogoBrandSection/LogoBrandSection.mdx +14 -0
  163. package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +158 -0
  164. package/src/components/LogoBrandSection/LogoBrandSection.vue +312 -0
  165. package/src/components/LogoBrandSection/assets/ameli-pro.svg +1 -0
  166. package/src/components/LogoBrandSection/assets/ameli.svg +1 -0
  167. package/src/components/LogoBrandSection/assets/cnam.svg +1 -0
  168. package/src/components/LogoBrandSection/assets/compte-ameli.svg +1 -0
  169. package/src/components/LogoBrandSection/dividerDimensionsMapping.ts +14 -0
  170. package/src/components/LogoBrandSection/locales.ts +14 -0
  171. package/src/components/LogoBrandSection/secondaryLogoMapping.ts +24 -0
  172. package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +365 -0
  173. package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +14 -0
  174. package/src/components/LogoBrandSection/types.ts +8 -0
  175. package/src/components/MaintenancePage/MaintenancePage.mdx +11 -0
  176. package/src/components/MaintenancePage/MaintenancePage.stories.ts +41 -0
  177. package/src/components/MaintenancePage/MaintenancePage.vue +25 -0
  178. package/src/components/MaintenancePage/assets/maintenance.svg +1 -0
  179. package/src/components/MaintenancePage/index.ts +3 -0
  180. package/src/components/MaintenancePage/locales.ts +5 -0
  181. package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +12 -0
  182. package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -0
  183. package/src/components/NotFoundPage/NotFoundPage.mdx +19 -0
  184. package/src/components/NotFoundPage/NotFoundPage.stories.ts +76 -0
  185. package/src/components/NotFoundPage/NotFoundPage.vue +52 -0
  186. package/src/components/NotFoundPage/assets/not-found.svg +1 -0
  187. package/src/components/NotFoundPage/locales.ts +6 -0
  188. package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +38 -0
  189. package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +76 -0
  190. package/src/components/NotificationBar/Accessibilite.mdx +14 -0
  191. package/src/components/NotificationBar/Accessibilite.stories.ts +166 -0
  192. package/src/components/NotificationBar/AccessibiliteItems.ts +174 -0
  193. package/src/components/NotificationBar/NotificationBar.mdx +6 -6
  194. package/src/components/NotificationBar/NotificationBar.stories.ts +1 -1
  195. package/src/components/NotificationBar/NotificationBar.vue +2 -2
  196. package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
  197. package/src/components/NotificationBar/options.ts +1 -0
  198. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +1 -1
  199. package/src/components/PageContainer/Accessibilite.mdx +14 -0
  200. package/src/components/PageContainer/Accessibilite.stories.ts +166 -0
  201. package/src/components/PageContainer/AccessibiliteItems.ts +52 -0
  202. package/src/components/PageContainer/PageContainer.mdx +1 -1
  203. package/src/components/PageContainer/PageContainer.stories.ts +86 -1
  204. package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
  205. package/src/components/PhoneField/PhoneField.mdx +49 -0
  206. package/src/components/PhoneField/PhoneField.stories.ts +869 -0
  207. package/src/components/PhoneField/PhoneField.vue +230 -0
  208. package/src/components/PhoneField/indicatifs.ts +104 -0
  209. package/src/components/PhoneField/locales.ts +4 -0
  210. package/src/components/PhoneField/tests/PhoneField.spec.ts +179 -0
  211. package/src/components/SkipLink/Accessibilite.mdx +14 -0
  212. package/src/components/SkipLink/Accessibilite.stories.ts +167 -0
  213. package/src/components/SkipLink/AccessibiliteItems.ts +77 -0
  214. package/src/components/SkipLink/SkipLink.stories.ts +50 -1
  215. package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
  216. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +33 -2
  217. package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +38 -1
  218. package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +1 -1
  219. package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
  220. package/src/components/SubHeader/SubHeader.mdx +31 -0
  221. package/src/components/SubHeader/SubHeader.stories.ts +1032 -0
  222. package/src/components/SubHeader/SubHeader.vue +185 -0
  223. package/src/components/SubHeader/config.ts +12 -0
  224. package/src/components/SubHeader/locales.ts +3 -0
  225. package/src/components/SubHeader/tests/SubHeader.spec.ts +144 -0
  226. package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
  227. package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +438 -0
  228. package/src/components/UserMenuBtn/UserMenuBtn.vue +105 -0
  229. package/src/components/UserMenuBtn/config.ts +24 -0
  230. package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
  231. package/src/components/index.ts +33 -7
  232. package/src/composables/index.ts +8 -0
  233. package/src/composables/rules/tests/useFieldValidation.spec.ts +82 -0
  234. package/src/composables/rules/useFieldValidation.ts +53 -0
  235. package/src/composables/widthable/index.ts +29 -0
  236. package/src/composables/widthable/tests/widthable.spec.ts +52 -0
  237. package/src/designTokens/index.ts +2 -0
  238. package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
  239. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +3 -2
  240. package/src/main.ts +3 -0
  241. package/src/modules.d.ts +4 -0
  242. package/src/services/index.ts +1 -0
  243. package/src/stories/Demarrer/Accueil.mdx +10 -0
  244. package/src/stories/Demarrer/Accueil.stories.ts +76 -0
  245. package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +9 -0
  246. package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +20 -0
  247. package/src/stories/Fondamentaux/Arrondis.mdx +24 -0
  248. package/src/stories/{Guidelines → Fondamentaux}/Colors.mdx +1 -1
  249. package/src/stories/Fondamentaux/Conteneurs.mdx +7 -0
  250. package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +7 -0
  251. package/src/stories/Fondamentaux/Elevations.mdx +14 -0
  252. package/src/stories/Fondamentaux/Espacements.mdx +29 -0
  253. package/src/stories/{Guidelines → Fondamentaux}/Introduction.mdx +1 -1
  254. package/src/stories/Fondamentaux/StylesTypographiques.mdx +33 -0
  255. package/src/stories/Fondamentaux/Typographie.mdx +58 -0
  256. package/src/stories/GuideDuDev/CommentUtiliserLesRules.mdx +132 -0
  257. package/src/stories/GuideDuDev/moduleDeNotification.mdx +52 -48
  258. package/src/stories/GuideDuDev/vuetifyOptions.mdx +31 -28
  259. package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +1 -2
  260. package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
  261. package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
  262. package/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.ts +47 -0
  263. package/src/utils/functions/throttleDisplayFn/throttleDisplayFn.ts +26 -0
  264. package/src/utils/rules/exactLength/index.ts +33 -0
  265. package/src/utils/rules/exactLength/locales.ts +6 -0
  266. package/src/utils/rules/required/index.ts +25 -0
  267. package/src/utils/rules/required/locales.ts +5 -0
  268. package/src/utils/rules/required/ruleMessageHelper.ts +14 -0
  269. package/src/utils/rules/required/tests/index.spec.ts +47 -0
  270. package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +22 -0
  271. package/src/utils/rules/types.d.ts +15 -0
  272. package/src/components/Beta/beta.mdx +0 -5
  273. package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -42
  274. package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +0 -154
  275. package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +0 -182
  276. package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
  277. package/src/components/Deprecated/deprecated.mdx +0 -5
  278. package/src/components/HeaderBar/HeaderComplexMenu/HeaderComplexMenu.stories.ts +0 -272
  279. package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +0 -49
  280. package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +0 -56
  281. package/src/components/HeaderBar/HeaderComplexMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +0 -137
  282. package/src/components/HeaderBar/HeaderComplexMenu/tests/HeaderComplexMenu.spec.ts +0 -129
  283. package/src/components/HeaderBar/HeaderComplexMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +0 -18
  284. package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
  285. package/src/stories/Guidelines/Typo.mdx +0 -53
  286. package/src/stories/Home/Accueil.mdx +0 -7
  287. package/src/stories/Home/PolitiqueDeConfidentialite.mdx +0 -4
  288. package/src/stories/Home/synapse.webp +0 -0
  289. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/HeaderMenuItem.vue +0 -0
  290. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +0 -0
  291. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/conts.ts +0 -0
  292. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/locals.ts +0 -0
  293. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/tests/useHandleSubMenus.spec.ts +0 -0
  294. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/useHandleSubMenus.ts +0 -0
  295. /package/src/components/Logo/{types.d.ts → types.ts} +0 -0
  296. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/AccessibiliteItems.ts +0 -0
  297. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/ExpertiseLevelEnum.ts +0 -0
  298. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/RGAALevelEnum.ts +0 -0
  299. /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/EcoConception.mdx +0 -0
  300. /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/ecoDesignItems.ts +0 -0
@@ -0,0 +1,194 @@
1
+ <script setup lang="ts">
2
+ import HeaderBar from '@/components/HeaderBar/HeaderBar.vue'
3
+ import HeaderBurgerMenu from '@/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue'
4
+ import HeaderMenuItem from '@/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue'
5
+ import HeaderMenuSection from '@/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue'
6
+ import useHeaderResponsiveMode from '@/components/HeaderBar/useHeaderResponsiveMode'
7
+ import type { CustomizableOptions } from '@/composables/useCustomizableOptions'
8
+ import { computed } from 'vue'
9
+ import { RouterLink, type RouteLocationRaw } from 'vue-router'
10
+ import HorizontalNavbar from './HorizontalNavbar/HorizontalNavbar.vue'
11
+ import type { NavigationItem } from './types'
12
+
13
+ const props = withDefaults(defineProps<CustomizableOptions & {
14
+ homeAriaLabel?: string
15
+ serviceTitle?: string
16
+ serviceSubtitle?: string
17
+ homeLink?: {
18
+ ariaLabel?: string
19
+ to?: RouteLocationRaw
20
+ href?: string
21
+ }
22
+ /** Keep the header visible */
23
+ sticky?: boolean
24
+ /**
25
+ * Show the header at sticky only when the user scroll up in mobile
26
+ * Need 'sticky' at true,
27
+ */
28
+ hideWhenDown?: boolean
29
+ /**
30
+ * The number of item to shown in the horizontal menu before using
31
+ * the Burger menu (default: 6)
32
+ */
33
+ maxHorizontalMenuItems?: number
34
+ /**
35
+ * The items to show in the horizontal menu
36
+ */
37
+ items?: NavigationItem[]
38
+ }>(),
39
+ {
40
+ homeAriaLabel: undefined,
41
+ serviceTitle: undefined,
42
+ serviceSubtitle: undefined,
43
+ homeLink: undefined,
44
+ sticky: true,
45
+ hideWhenDown: false,
46
+ maxHorizontalMenuItems: 6,
47
+ items: undefined,
48
+ })
49
+
50
+ type SlotProps = {
51
+ menuOpen: boolean | undefined
52
+ }
53
+
54
+ type LogoProps = {
55
+ homeAriaLabel?: string
56
+ serviceTitle?: string
57
+ serviceSubtitle?: string
58
+ }
59
+
60
+ defineSlots<{
61
+ 'logo': (props: SlotProps & LogoProps) => unknown
62
+ 'logo-brand-content': (props: SlotProps & LogoProps) => unknown
63
+ 'header-side': (props: SlotProps) => unknown
64
+ 'navigation-bar-prepend': () => unknown
65
+ 'navigation-bar-append': () => unknown
66
+ 'navigation-bar-content': () => unknown
67
+ 'navigation-menu-prepend': (props: SlotProps) => unknown
68
+ 'navigation-menu-append': (props: SlotProps) => unknown
69
+ 'navigation-menu-content': (props: SlotProps) => unknown
70
+ }>()
71
+
72
+ const menuOpen = defineModel<boolean>(
73
+ 'burgerMenu',
74
+ { default: false },
75
+ )
76
+
77
+ const { isDesktop } = useHeaderResponsiveMode()
78
+
79
+ const verticalMenu = computed<boolean>(() => {
80
+ return (
81
+ !isDesktop.value
82
+ || (props.items !== undefined
83
+ && props.items.length > 0
84
+ && props.items.length > props.maxHorizontalMenuItems)
85
+ )
86
+ })
87
+ </script>
88
+
89
+ <template>
90
+ <HeaderBar
91
+ :sticky="sticky"
92
+ :hide-when-down="hideWhenDown"
93
+ :home-aria-label="homeAriaLabel"
94
+ :service-title="serviceTitle"
95
+ :service-subtitle="serviceSubtitle"
96
+ >
97
+ <template #menu>
98
+ <HeaderBurgerMenu
99
+ v-if="verticalMenu"
100
+ v-model="menuOpen"
101
+ >
102
+ <div class="inner-vertical-menu">
103
+ <slot
104
+ name="navigation-menu-prepend"
105
+ :menu-open="menuOpen"
106
+ />
107
+ <div class="inner-vertical-menu__main-content">
108
+ <slot
109
+ name="navigation-menu-content"
110
+ :menu-open="menuOpen"
111
+ >
112
+ <HeaderMenuSection>
113
+ <HeaderMenuItem
114
+ v-for="item in items"
115
+ :key="item.label"
116
+ >
117
+ <a
118
+ v-if="'href' in item"
119
+ :href="item.href"
120
+ >
121
+ {{ item.label }}
122
+ </a>
123
+ <RouterLink
124
+ v-else-if="item.to"
125
+ :to="item.to"
126
+ >
127
+ {{ item.label }}
128
+ </RouterLink>
129
+ </HeaderMenuItem>
130
+ </HeaderMenuSection>
131
+ </slot>
132
+ </div>
133
+ <slot
134
+ name="navigation-menu-append"
135
+ :menu-open="menuOpen"
136
+ />
137
+ </div>
138
+ </HeaderBurgerMenu>
139
+ </template>
140
+ <template
141
+ #logo-brand-content
142
+ >
143
+ <slot
144
+ name="logo-brand-content"
145
+ :menu-open="menuOpen"
146
+ :home-aria-label="homeAriaLabel"
147
+ :service-title="serviceTitle"
148
+ :service-subtitle="serviceSubtitle"
149
+ />
150
+ </template>
151
+ <template #logo>
152
+ <slot
153
+ name="logo"
154
+ :menu-open="menuOpen"
155
+ :home-aria-label="homeAriaLabel"
156
+ :service-title="serviceTitle"
157
+ :service-subtitle="serviceSubtitle"
158
+ />
159
+ </template>
160
+ <template #header-side>
161
+ <slot
162
+ name="header-side"
163
+ :menu-open="menuOpen"
164
+ />
165
+ </template>
166
+ <template #append>
167
+ <HorizontalNavbar
168
+ v-if="props.items && !verticalMenu"
169
+ :items="items"
170
+ :vuetify-options
171
+ >
172
+ <template #navigation-bar-prepend>
173
+ <slot name="navigation-bar-prepend" />
174
+ </template>
175
+ <slot name="navigation-bar-content" />
176
+ <template #navigation-bar-append>
177
+ <slot name="navigation-bar-append" />
178
+ </template>
179
+ </HorizontalNavbar>
180
+ </template>
181
+ </HeaderBar>
182
+ </template>
183
+
184
+ <style lang="scss" scoped>
185
+ .inner-vertical-menu {
186
+ display: flex;
187
+ flex-direction: column;
188
+ height: 100%;
189
+ }
190
+
191
+ .inner-vertical-menu__main-content {
192
+ flex: 1;
193
+ }
194
+ </style>
@@ -0,0 +1,74 @@
1
+ <script setup lang="ts">
2
+ import { VTabs } from 'vuetify/components'
3
+ import type { NavigationItem } from '../types'
4
+ import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
5
+ import { config } from './config'
6
+
7
+ const props = defineProps<CustomizableOptions & {
8
+ items: NavigationItem[]
9
+ }>()
10
+
11
+ defineSlots<{
12
+ 'navigation-bar-prepend': () => unknown
13
+ 'navigation-bar-append': () => unknown
14
+ 'default': () => unknown
15
+ }>()
16
+
17
+ const options = useCustomizableOptions(config, props)
18
+
19
+ </script>
20
+
21
+ <template>
22
+ <VSheet
23
+ class="horizontal-menu px-12"
24
+ v-bind="options.sheet"
25
+ >
26
+ <slot name="navigation-bar-prepend" />
27
+ <slot>
28
+ <VTabs
29
+ class="horizontal-menu__tabs"
30
+ v-bind="options.tabs"
31
+ >
32
+ <VTab
33
+ v-for="(item, index) in items"
34
+ :key="index"
35
+ :href="item.href"
36
+ :to="item.to"
37
+ v-bind="options.tab"
38
+ tabindex="0"
39
+ class="horizontal-menu__item"
40
+ >
41
+ <span class="horizontal-menu__item-link">
42
+ {{ item.label }}
43
+ </span>
44
+ </VTab>
45
+ </VTabs>
46
+ </slot>
47
+ <slot name="navigation-bar-append" />
48
+ </VSheet>
49
+ </template>
50
+
51
+ <style lang="scss" scoped>
52
+
53
+ .horizontal-menu {
54
+ display: flex;
55
+ align-items: center;
56
+ }
57
+
58
+ .horizontal-menu__tabs {
59
+ flex: 1 1 0;
60
+ }
61
+
62
+ .horizontal-menu__item {
63
+ cursor: pointer;
64
+ }
65
+
66
+ .horizontal-menu__item-link {
67
+ font-size: 0.875rem;
68
+ font-weight: 700;
69
+ }
70
+
71
+ .v-tab-item--selected span {
72
+ color: #fff;
73
+ }
74
+ </style>
@@ -0,0 +1,18 @@
1
+ import { cnamSemanticTokens } from '@/designTokens'
2
+
3
+ export const config = {
4
+ sheet: {
5
+ theme: 'dark',
6
+ dense: true,
7
+ color: cnamSemanticTokens.colors.background.accentContrasted,
8
+ },
9
+ tabs: {
10
+ 'height': '53',
11
+ 'show-arrows': true,
12
+ },
13
+ tab: {
14
+ 'base-color': cnamSemanticTokens.colors.text.subduedOnDark,
15
+ 'slider-color': '#fff',
16
+ 'ripple': false,
17
+ },
18
+ }
@@ -0,0 +1,127 @@
1
+ import HeaderBurgerMenu from '@/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue'
2
+ import { vuetify } from '@tests/unit/setup'
3
+ import { mount } from '@vue/test-utils'
4
+ import { afterAll, describe, expect, it, vi } from 'vitest'
5
+ import HeaderNavbar from '../HeaderNavigationBar.vue'
6
+ import HorizontalNavbar from '../HorizontalNavbar/HorizontalNavbar.vue'
7
+
8
+ describe('HeaderNavigationBar', () => {
9
+ vi.mock('@/utils/functions/throttleDisplayFn/throttleDisplayFn.ts', () => ({
10
+ default: (fn: (...args: unknown[]) => void) => fn,
11
+ }))
12
+
13
+ afterAll(() => {
14
+ vi.restoreAllMocks()
15
+ document.body.innerHTML = ''
16
+ })
17
+
18
+ it('should render the component', async () => {
19
+ // @ts-expect-error - Property 'happyDOM' does not exist on type 'Window & typeof globalThis'.
20
+ window.window.happyDOM.setInnerWidth(1200)
21
+
22
+ const wrapper = mount(HeaderNavbar, {
23
+ global: {
24
+ plugins: [vuetify],
25
+ stubs: {
26
+ Teleport: true,
27
+ },
28
+ },
29
+ props: {
30
+ items: [
31
+ {
32
+ label: 'Home',
33
+ to: '/',
34
+ },
35
+ {
36
+ label: 'About',
37
+ to: '/about',
38
+ },
39
+ ],
40
+ },
41
+ attachTo: document.body,
42
+ })
43
+
44
+ await wrapper.vm.$nextTick()
45
+
46
+ expect(wrapper.html()).toContain('Home')
47
+ expect(wrapper.findComponent(HeaderBurgerMenu).exists()).toBe(false)
48
+ expect(wrapper.findComponent(HorizontalNavbar).exists()).toBe(true)
49
+
50
+ await wrapper.setProps({
51
+ maxHorizontalMenuItems: 1,
52
+ })
53
+
54
+ expect(wrapper.findComponent(HeaderBurgerMenu).exists()).toBe(true)
55
+ expect(wrapper.findComponent(HorizontalNavbar).exists()).toBe(false)
56
+
57
+ wrapper.unmount()
58
+ })
59
+
60
+ it('transform the menu on resize', async () => {
61
+ // @ts-expect-error - Property 'happyDOM' does not exist on type 'Window & typeof globalThis'.
62
+ window.window.happyDOM.setInnerWidth(600)
63
+
64
+ const wrapper = mount(HeaderNavbar, {
65
+ global: {
66
+ plugins: [vuetify],
67
+ stubs: {
68
+ Teleport: true,
69
+ },
70
+ },
71
+ props: {
72
+ items: [
73
+ {
74
+ label: 'Home',
75
+ to: '/',
76
+ },
77
+ {
78
+ label: 'About',
79
+ to: '/about',
80
+ },
81
+ ],
82
+ },
83
+ attachTo: document.body,
84
+ })
85
+
86
+ await wrapper.vm.$nextTick()
87
+
88
+ expect(wrapper.findComponent(HeaderBurgerMenu).exists()).toBe(true)
89
+ expect(wrapper.findComponent(HorizontalNavbar).exists()).toBe(false)
90
+
91
+ wrapper.unmount()
92
+ })
93
+
94
+ it('should toggle the burger menu', async () => {
95
+ // @ts-expect-error - Property 'happyDOM' does not exist on type 'Window & typeof globalThis'.
96
+ window.window.happyDOM.setInnerWidth(600)
97
+
98
+ const wrapper = mount(HeaderNavbar, {
99
+ global: {
100
+ plugins: [vuetify],
101
+ stubs: {
102
+ Teleport: true,
103
+ RouterLink: true,
104
+ },
105
+ },
106
+ props: {
107
+ items: [
108
+ {
109
+ label: 'Home',
110
+ to: '/',
111
+ },
112
+ {
113
+ label: 'About',
114
+ to: '/about',
115
+ },
116
+ ],
117
+ },
118
+ attachTo: document.body,
119
+ })
120
+
121
+ const btn = wrapper.find('.header-menu-btn')
122
+ await btn.trigger('click')
123
+ expect(wrapper.find('.header-menu').exists()).toBe(true)
124
+ await btn.trigger('click')
125
+ expect(wrapper.find('.header-menu').exists()).toBe(false)
126
+ })
127
+ })
@@ -0,0 +1,7 @@
1
+ import type { RouteLocationRaw } from 'vue-router'
2
+
3
+ export interface NavigationItem {
4
+ label: string
5
+ href?: string
6
+ to?: RouteLocationRaw
7
+ }
@@ -0,0 +1,31 @@
1
+ import { Controls, Canvas, Meta, Source } from '@storybook/blocks';
2
+ import * as HeaderToolbar from './HeaderToolbar.stories';
3
+
4
+ <Meta of={HeaderToolbar} />
5
+
6
+ # HeaderToolbar
7
+
8
+ L’élément `HeaderToolbar` est utilisé pour afficher une barre d'outils en haut de la page. Il est composé de deux zones customisables.
9
+
10
+ <Canvas
11
+ of={HeaderToolbar.Default}
12
+ story={{
13
+ height: '500px',
14
+ }}
15
+ />
16
+
17
+ # API
18
+
19
+ <Controls of={HeaderToolbar.Default} />
20
+
21
+ # Exemple d'utilisation
22
+
23
+ <Source dark code={`
24
+ <script setup lang="ts">
25
+ import HeaderToolbar from '@cnamts/synapse'
26
+ </script>
27
+
28
+ <template>
29
+ <HeaderToolbar />
30
+ </template>
31
+ `} />