@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
@@ -1,90 +1,51 @@
1
1
  import { mount } from '@vue/test-utils'
2
2
  import { expect, describe, it } from 'vitest'
3
- import CustomSelect from '../CustomInputSelect.vue'
3
+ import SySelect from '../SySelect.vue'
4
4
  import { vuetify } from '@tests/unit/setup'
5
5
 
6
- describe('CustomInputSelect.vue', () => {
6
+ describe('SySelect.vue', () => {
7
7
  it('renders the component with default props', () => {
8
- const wrapper = mount(CustomSelect, {
8
+ const wrapper = mount(SySelect, {
9
9
  global: {
10
10
  plugins: [vuetify],
11
11
  },
12
12
  })
13
13
  expect(wrapper.exists()).toBe(true)
14
- expect(wrapper.find('.custom-select').text()).toBe('Sélectionnez une option')
14
+ expect(wrapper.find('.sy-select').text()).toBe('')
15
15
  })
16
16
 
17
- it('toggles the menu when clicked', async () => {
18
- const wrapper = mount(CustomSelect, {
19
- global: {
20
- plugins: [vuetify],
21
- },
22
- })
23
- await wrapper.find('.custom-select').trigger('click')
24
- expect(wrapper.find('.v-list').exists()).toBe(true)
25
- await wrapper.find('.custom-select').trigger('click')
26
- expect(wrapper.find('.v-list').exists()).toBe(false)
27
- })
28
-
29
- it('selects an item when clicked', async () => {
30
- const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
31
- const wrapper = mount(CustomSelect, {
32
- props: { items },
33
- global: {
34
- plugins: [vuetify],
35
- },
36
- })
37
- await wrapper.find('.custom-select').trigger('click')
38
- const firstItem = wrapper.findAll('.v-list-item').at(0)
39
- if (firstItem) {
40
- await firstItem.trigger('click')
41
- }
42
- expect(wrapper.emitted()['update:modelValue'][0]).toEqual([{ text: 'Option 1', value: '1' }])
43
- })
44
-
45
- it('closes the menu when an item is selected', async () => {
17
+ it('displays the selected item text', async () => {
46
18
  const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
47
- const wrapper = mount(CustomSelect, {
48
- props: { items },
19
+ const wrapper = mount(SySelect, {
20
+ props: { items, modelValue: { text: 'Option 1', value: '1' } },
49
21
  global: {
50
22
  plugins: [vuetify],
51
23
  },
52
24
  })
53
- await wrapper.find('.custom-select').trigger('click')
25
+ await wrapper.find('.sy-select').trigger('click')
54
26
  const firstItem = wrapper.findAll('.v-list-item').at(0)
55
27
  if (firstItem) {
56
28
  await firstItem.trigger('click')
57
29
  }
58
- expect(wrapper.find('.v-list').exists()).toBe(false)
59
- })
60
-
61
- it('displays the selected item text', async () => {
62
- const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
63
- const wrapper = mount(CustomSelect, {
64
- props: { items, modelValue: { text: 'Option 1', value: '1' } },
65
- global: {
66
- plugins: [vuetify],
67
- },
68
- })
69
- expect(wrapper.find('.custom-select').text()).toContain('Option 1')
30
+ expect(wrapper.find('input').element.value).toBe('Option 1')
70
31
  })
71
32
 
72
33
  it('closes the menu on escape key press', async () => {
73
34
  const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
74
- const wrapper = mount(CustomSelect, {
35
+ const wrapper = mount(SySelect, {
75
36
  props: { items },
76
37
  global: {
77
38
  plugins: [vuetify],
78
39
  },
79
40
  })
80
- await wrapper.find('.custom-select').trigger('click')
41
+ await wrapper.find('.sy-select').trigger('click')
81
42
  await wrapper.find('.v-list').trigger('keydown.esc')
82
43
  expect(wrapper.find('.v-list').exists()).toBe(false)
83
44
  })
84
45
 
85
46
  it('renders error messages when provided', () => {
86
47
  const errorMessages = ['Error 1']
87
- const wrapper = mount(CustomSelect, {
48
+ const wrapper = mount(SySelect, {
88
49
  props: { errorMessages },
89
50
  global: {
90
51
  plugins: [vuetify],
@@ -94,7 +55,7 @@ describe('CustomInputSelect.vue', () => {
94
55
  })
95
56
 
96
57
  it('does not render error messages when not provided', () => {
97
- const wrapper = mount(CustomSelect, {
58
+ const wrapper = mount(SySelect, {
98
59
  global: {
99
60
  plugins: [vuetify],
100
61
  },
@@ -102,17 +63,8 @@ describe('CustomInputSelect.vue', () => {
102
63
  expect(wrapper.find('.v-messages__message').exists()).toBe(false)
103
64
  })
104
65
 
105
- it('does not render the label when not provided', () => {
106
- const wrapper = mount(CustomSelect, {
107
- global: {
108
- plugins: [vuetify],
109
- },
110
- })
111
- expect(wrapper.find('label').exists()).toBe(false)
112
- })
113
-
114
66
  it('returns the correct item text using getItemText', () => {
115
- const wrapper = mount(CustomSelect, {
67
+ const wrapper = mount(SySelect, {
116
68
  props: { textKey: 'text' },
117
69
  global: {
118
70
  plugins: [vuetify],
@@ -125,7 +77,7 @@ describe('CustomInputSelect.vue', () => {
125
77
  })
126
78
 
127
79
  it('returns default text when selectedItem is null', () => {
128
- const wrapper = mount(CustomSelect, {
80
+ const wrapper = mount(SySelect, {
129
81
  global: {
130
82
  plugins: [vuetify],
131
83
  },
@@ -136,7 +88,7 @@ describe('CustomInputSelect.vue', () => {
136
88
  })
137
89
 
138
90
  it('returns the correct text when selectedItem is an object', async () => {
139
- const wrapper = mount(CustomSelect, {
91
+ const wrapper = mount(SySelect, {
140
92
  props: { modelValue: { text: 'Option 1', value: '1' }, textKey: 'text' },
141
93
  global: {
142
94
  plugins: [vuetify],
@@ -150,7 +102,7 @@ describe('CustomInputSelect.vue', () => {
150
102
 
151
103
  it('formats items correctly', () => {
152
104
  const items = ['Option 1', 'Option 2']
153
- const wrapper = mount(CustomSelect, {
105
+ const wrapper = mount(SySelect, {
154
106
  props: { items, textKey: 'text', valueKey: 'value' },
155
107
  global: {
156
108
  plugins: [vuetify],
@@ -165,27 +117,27 @@ describe('CustomInputSelect.vue', () => {
165
117
  })
166
118
 
167
119
  it('applies the correct button class when outlined is true', () => {
168
- const wrapper = mount(CustomSelect, {
120
+ const wrapper = mount(SySelect, {
169
121
  props: { outlined: true },
170
122
  global: {
171
123
  plugins: [vuetify],
172
124
  },
173
125
  })
174
- expect(wrapper.find('.custom-select').classes()).toContain('v-btn--variant-outlined')
126
+ expect(wrapper.find('.v-field--variant-outlined').exists()).toBe(true)
175
127
  })
176
128
 
177
129
  it('does not apply the outlined button class when outlined is false', () => {
178
- const wrapper = mount(CustomSelect, {
130
+ const wrapper = mount(SySelect, {
179
131
  props: { outlined: false },
180
132
  global: {
181
133
  plugins: [vuetify],
182
134
  },
183
135
  })
184
- expect(wrapper.find('.custom-select').classes()).not.toContain('v-btn--variant-outlined')
136
+ expect(wrapper.find('.sy-select').classes()).not.toContain('v-btn--variant-outlined')
185
137
  })
186
138
 
187
139
  it('updates selectedItem when v-model changes', async () => {
188
- const wrapper = mount(CustomSelect, {
140
+ const wrapper = mount(SySelect, {
189
141
  props: { modelValue: { text: 'Option 1', value: '1' }, textKey: 'text' },
190
142
  global: {
191
143
  plugins: [vuetify],
@@ -200,7 +152,7 @@ describe('CustomInputSelect.vue', () => {
200
152
  })
201
153
 
202
154
  it('emits update:modelValue when selectedItem changes', async () => {
203
- const wrapper = mount(CustomSelect, {
155
+ const wrapper = mount(SySelect, {
204
156
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
205
157
  props: { modelValue: null as any, textKey: 'text' },
206
158
  global: {
@@ -213,4 +165,29 @@ describe('CustomInputSelect.vue', () => {
213
165
  await wrapper.vm.$nextTick()
214
166
  expect(wrapper.emitted()['update:modelValue'][0]).toEqual([{ text: 'Option 1', value: '1' }])
215
167
  })
168
+
169
+ it('closes the menu when v-click-outside directive is called', async () => {
170
+ const wrapper = mount(SySelect, {
171
+ global: {
172
+ plugins: [vuetify],
173
+ },
174
+ })
175
+ await wrapper.find('.sy-select').trigger('click')
176
+ expect(wrapper.find('.v-list').exists()).toBe(true)
177
+ await wrapper.find('.sy-select').trigger('mouseleave')
178
+ await wrapper.find('.sy-select').trigger('click')
179
+ await wrapper.vm.$nextTick()
180
+
181
+ expect(wrapper.find('.v-list').exists()).toBe(false)
182
+ })
183
+
184
+ it('use closeList method', async () => {
185
+ const wrapper = mount(SySelect, {
186
+ global: {
187
+ plugins: [vuetify],
188
+ },
189
+ })
190
+ await wrapper.vm.closeList()
191
+ expect(wrapper.vm.isOpen).toBe(false)
192
+ })
216
193
  })
@@ -0,0 +1,44 @@
1
+ import { Meta, Canvas, Controls, Source } from '@storybook/blocks';
2
+ import * as SyTextFieldStories from "./SyTextField.stories";
3
+
4
+ <Meta of={SyTextFieldStories} />
5
+
6
+ # SyTextField
7
+
8
+ Le composant `SyTextField` est utilisé pour proposer une alternative au `TextField` de Vuetify, conforme au style du Design System et qui respecte les règles d'accessibilité RGAA.
9
+
10
+ <Canvas of={SyTextFieldStories.Default} />
11
+
12
+
13
+ # API
14
+
15
+ <Controls of={SyTextFieldStories.Default} />
16
+
17
+
18
+ # Exemple d'utilisation
19
+
20
+ <Source
21
+ dark code={`
22
+ <script setup lang="ts">
23
+ import { ref } from 'vue'
24
+ import SyTextField from '@cnamts/synapse'
25
+
26
+ const model = ref('')
27
+
28
+ </script>
29
+
30
+ <template>
31
+ <main class="ma-12">
32
+ Text saisie: {{ model }}
33
+ <div class="d-flex flex-wrap align-center">
34
+ <SyTextField
35
+ v-model="model"
36
+ label="Label"
37
+ color="primary"
38
+ is-clearable
39
+ />
40
+ </div>
41
+ </main>
42
+ </template>
43
+ `}
44
+ />
@@ -0,0 +1,403 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
3
+ import { VIcon } from 'vuetify/components'
4
+ import { ref } from 'vue'
5
+ import { mdiAccountBox } from '@mdi/js'
6
+
7
+ const meta = {
8
+ title: 'Composants/Formulaires/SyTextField',
9
+ component: SyTextField,
10
+ parameters: {
11
+ layout: 'fullscreen',
12
+ controls: { exclude: ['modelValue', 'appendInnerIconColor'] },
13
+ },
14
+ argTypes: {
15
+ modelValue: { control: 'text' },
16
+ label: { control: 'text' },
17
+ prependIcon: {
18
+ control: 'select',
19
+ options: ['info', 'success', 'warning', 'error', 'close'],
20
+ },
21
+ appendIcon: {
22
+ control: 'select',
23
+ options: ['info', 'success', 'warning', 'error', 'close'],
24
+ },
25
+ prependInnerIcon: {
26
+ control: 'select',
27
+ options: ['info', 'success', 'warning', 'error', 'close'],
28
+ },
29
+ appendInnerIcon: {
30
+ control: 'select',
31
+ options: ['info', 'success', 'warning', 'error', 'close'],
32
+ },
33
+ variantStyle: {
34
+ control: 'select',
35
+ options: ['outlined', 'plain', 'underlined', 'filled', 'solo', 'solo-inverted', 'solo-filled'],
36
+ },
37
+ color: {
38
+ control: 'select',
39
+ options: ['primary', 'secondary', 'success', 'error', 'warning'],
40
+ },
41
+ },
42
+ } as Meta<typeof SyTextField>
43
+
44
+ export default meta
45
+
46
+ type Story = StoryObj<typeof meta>
47
+ export const Default: Story = {
48
+ parameters: {
49
+ sourceCode: [
50
+ {
51
+ name: 'Template',
52
+ code: `
53
+ <template>
54
+ <SyTextField v-model="value" />
55
+ </template>
56
+ `,
57
+ },
58
+ {
59
+ name: 'Script',
60
+ code: `
61
+ <script setup lang="ts">
62
+ import SyTextField from '@cnamts/synapse'
63
+ </script>
64
+ `,
65
+ },
66
+ ],
67
+ },
68
+ args: {
69
+ showDivider: false,
70
+ variantStyle: 'outlined',
71
+ color: 'primary',
72
+ isClearable: true,
73
+ label: 'Label',
74
+ },
75
+ render: (args) => {
76
+ return {
77
+ components: { SyTextField, VIcon },
78
+ setup() {
79
+ return { args }
80
+ },
81
+ template: `
82
+ <div class="d-flex flex-wrap align-center pa-4">
83
+ <SyTextField v-bind="args" />
84
+ </div>
85
+ `,
86
+ }
87
+ },
88
+ }
89
+
90
+ export const SlotPrepend: Story = {
91
+ parameters: {
92
+ sourceCode: [
93
+ {
94
+ name: 'Template',
95
+ code: `
96
+ <template>
97
+ <SyTextField
98
+ v-model="value"
99
+ prepend-icon="info"
100
+ />
101
+ </template>
102
+ `,
103
+ },
104
+ {
105
+ name: 'Script',
106
+ code: `
107
+ <script setup lang="ts">
108
+ import SyTextField from '@cnamts/synapse'
109
+ </script>
110
+ `,
111
+ },
112
+ ],
113
+ },
114
+ args: {
115
+ variantStyle: 'outlined',
116
+ isClearable: true,
117
+ showDivider: false,
118
+ label: 'Label',
119
+ color: 'primary',
120
+ prependIcon: 'info',
121
+ },
122
+ render: (args) => {
123
+ return {
124
+ components: { SyTextField, VIcon },
125
+ setup() {
126
+ return { args }
127
+ },
128
+ template: `
129
+ <div class="d-flex flex-wrap align-center pa-4">
130
+ <SyTextField
131
+ v-bind="args"
132
+ :label="args.label"
133
+ :prepend-icon="args.prependIcon"
134
+ />
135
+ </div>
136
+ `,
137
+ }
138
+ },
139
+ }
140
+
141
+ export const SlotAppend: Story = {
142
+ parameters: {
143
+ sourceCode: [
144
+ {
145
+ name: 'Template',
146
+ code: `
147
+ <template>
148
+ <SyTextField
149
+ v-model="value"
150
+ append-icon="success"
151
+ />
152
+ </template>
153
+ `,
154
+ },
155
+ {
156
+ name: 'Script',
157
+ code: `
158
+ <script setup lang="ts">
159
+ import SyTextField from '@cnamts/synapse'
160
+ </script>
161
+ `,
162
+ },
163
+ ],
164
+ },
165
+ args: {
166
+ variantStyle: 'outlined',
167
+ isClearable: true,
168
+ showDivider: false,
169
+ label: 'champs de text',
170
+ color: 'primary',
171
+ appendIcon: 'success',
172
+ },
173
+ render: (args) => {
174
+ return {
175
+ components: { SyTextField, VIcon },
176
+ setup() {
177
+ return { args }
178
+ },
179
+ template: `
180
+ <div class="d-flex flex-wrap align-center pa-4">
181
+ <SyTextField
182
+ v-bind="args"
183
+ :append-icon="args.appendIcon"
184
+ />
185
+ </div>
186
+ `,
187
+ }
188
+ },
189
+ }
190
+
191
+ export const SlotPrependInner: Story = {
192
+ parameters: {
193
+ sourceCode: [
194
+ {
195
+ name: 'Template',
196
+ code: `
197
+ <template>
198
+ <SyTextField
199
+ v-model="value"
200
+ prepend-inner-icon="info"
201
+ />
202
+ </template>
203
+ `,
204
+ },
205
+ {
206
+ name: 'Script',
207
+ code: `
208
+ <script setup lang="ts">
209
+ import SyTextField from '@cnamts/synapse'
210
+ </script>
211
+ `,
212
+ },
213
+ ],
214
+ },
215
+ args: {
216
+ variantStyle: 'outlined',
217
+ isClearable: true,
218
+ showDivider: false,
219
+ label: 'Label',
220
+ color: 'primary',
221
+ prependInnerIcon: 'info',
222
+ },
223
+ render: (args) => {
224
+ return {
225
+ components: { SyTextField, VIcon },
226
+ setup() {
227
+ return { args }
228
+ },
229
+ template: `
230
+ <div class="d-flex flex-wrap align-center pa-4">
231
+ <SyTextField
232
+ v-bind="args"
233
+ :prepend-inner-icon="args.prependInnerIcon"
234
+ />
235
+ </div>
236
+ `,
237
+ }
238
+ },
239
+ }
240
+
241
+ export const SlotPrependInnerDivider: Story = {
242
+ parameters: {
243
+ sourceCode: [
244
+ {
245
+ name: 'Template',
246
+ code: `
247
+ <template>
248
+ <SyTextField
249
+ v-model="value"
250
+ prepend-inner-icon="info"
251
+ show-divider
252
+ />
253
+ </template>
254
+ `,
255
+ },
256
+ {
257
+ name: 'Script',
258
+ code: `
259
+ <script setup lang="ts">
260
+ import SyTextField from '@cnamts/synapse'
261
+ </script>
262
+ `,
263
+ },
264
+ ],
265
+ },
266
+ args: {
267
+ variantStyle: 'outlined',
268
+ isClearable: true,
269
+ showDivider: true,
270
+ label: 'Label',
271
+ color: 'primary',
272
+ prependInnerIcon: 'info',
273
+ },
274
+ render: (args) => {
275
+ return {
276
+ components: { SyTextField, VIcon },
277
+ setup() {
278
+ return { args }
279
+ },
280
+ template: `
281
+ <div class="d-flex flex-wrap align-center pa-4">
282
+ <SyTextField
283
+ v-bind="args"
284
+ :prepend-inner-icon="args.prependInnerIcon"
285
+ :show-divider="args.showDivider"
286
+ />
287
+ </div>
288
+ `,
289
+ }
290
+ },
291
+ }
292
+
293
+ export const SlotAppendInner: Story = {
294
+ parameters: {
295
+ sourceCode: [
296
+ {
297
+ name: 'Template',
298
+ code: `
299
+ <template>
300
+ <SyTextField
301
+ v-model="value"
302
+ append-inner-icon="success"
303
+ />
304
+ </template>
305
+ `,
306
+ },
307
+ {
308
+ name: 'Script',
309
+ code: `
310
+ <script setup lang="ts">
311
+ import SyTextField from '@cnamts/synapse'
312
+ </script>
313
+ `,
314
+ },
315
+ ],
316
+ },
317
+ args: {
318
+ variantStyle: 'outlined',
319
+ isClearable: true,
320
+ showDivider: false,
321
+ label: 'Label',
322
+ color: 'primary',
323
+ appendInnerIcon: 'success',
324
+ },
325
+ render: (args) => {
326
+ return {
327
+ components: { SyTextField, VIcon },
328
+ setup() {
329
+ return { args }
330
+ },
331
+ template: `
332
+ <div class="d-flex flex-wrap align-center pa-4">
333
+ <SyTextField
334
+ v-bind="args"
335
+ :append-inner-icon="args.appendInnerIcon"
336
+ />
337
+ </div>
338
+ `,
339
+ }
340
+ },
341
+ }
342
+
343
+ export const SlotCustomIcon: Story = {
344
+ parameters: {
345
+ sourceCode: [
346
+ {
347
+ name: 'Template',
348
+ code: `
349
+ <template>
350
+ <SyTextField v-model="value">
351
+ <template #append-inner>
352
+ <VIcon>
353
+ {{ iconName }}
354
+ </VIcon>
355
+ </template>
356
+ </SyTextField>
357
+ </template>
358
+ `,
359
+ },
360
+ {
361
+ name: 'Script',
362
+ code: `
363
+ <script setup lang="ts">
364
+ import SyTextField from '@cnamts/synapse'
365
+ import { mdiAccountBox } from '@mdi/js'
366
+
367
+ const iconName = mdiAccountBox
368
+ </script>
369
+ `,
370
+ },
371
+ ],
372
+ },
373
+ args: {
374
+ variantStyle: 'outlined',
375
+ isClearable: true,
376
+ showDivider: false,
377
+ label: 'Label',
378
+ color: 'primary',
379
+ },
380
+ render: (args) => {
381
+ return {
382
+ components: { SyTextField, VIcon },
383
+ setup() {
384
+ const iconName = ref(mdiAccountBox)
385
+
386
+ return { args, iconName }
387
+ },
388
+ template: `
389
+ <div class="d-flex flex-wrap align-center pa-4">
390
+ <SyTextField
391
+ v-bind="args"
392
+ >
393
+ <template #append-inner>
394
+ <VIcon>
395
+ {{ iconName }}
396
+ </VIcon>
397
+ </template>
398
+ </SyTextField>
399
+ </div>
400
+ `,
401
+ }
402
+ },
403
+ }