@cnamts/synapse 0.0.7-alpha → 0.0.9-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 (198) hide show
  1. package/dist/design-system-v3.d.ts +785 -372
  2. package/dist/design-system-v3.js +4993 -3357
  3. package/dist/design-system-v3.umd.cjs +1 -10
  4. package/dist/style.css +1 -1
  5. package/package.json +10 -2
  6. package/src/assets/settings.scss +2 -2
  7. package/src/assets/tokens.scss +107 -112
  8. package/src/components/BackBtn/BackBtn.vue +4 -4
  9. package/src/components/BackToTopBtn/BackToTopBtn.vue +1 -0
  10. package/src/components/CollapsibleList/CollapsibleList.mdx +1 -1
  11. package/src/components/CollapsibleList/CollapsibleList.vue +43 -44
  12. package/src/components/ContextualMenu/Accessibilite.mdx +14 -0
  13. package/src/components/ContextualMenu/Accessibilite.stories.ts +191 -0
  14. package/src/components/ContextualMenu/AccessibiliteItems.ts +89 -0
  15. package/src/components/ContextualMenu/ContextualMenu.mdx +118 -0
  16. package/src/components/ContextualMenu/ContextualMenu.stories.ts +430 -0
  17. package/src/components/ContextualMenu/ContextualMenu.vue +101 -0
  18. package/src/components/ContextualMenu/constants/ExpertiseLevelEnum.ts +4 -0
  19. package/src/components/ContextualMenu/tests/ContextualMenu.spec.ts +115 -0
  20. package/src/components/ContextualMenu/tests/__snapshots__/ContextualMenu.spec.ts.snap +10 -0
  21. package/src/components/ContextualMenu/types.ts +5 -0
  22. package/src/components/CookieBanner/CookieBanner.stories.ts +1 -2
  23. package/src/components/CookieBanner/CookieBanner.vue +13 -10
  24. package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +17 -15
  25. package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +6 -1
  26. package/src/components/CookiesSelection/CookiesInformation/locales.ts +1 -0
  27. package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +1 -0
  28. package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +17 -15
  29. package/src/components/CopyBtn/CopyBtn.vue +7 -7
  30. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +26 -26
  31. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +24 -24
  32. package/src/components/Customs/SySelect/SySelect.stories.ts +7 -7
  33. package/src/components/Customs/SySelect/SySelect.vue +36 -30
  34. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +2 -2
  35. package/src/components/Customs/SyTextField/SyTextField.stories.ts +187 -2
  36. package/src/components/Customs/SyTextField/SyTextField.vue +185 -16
  37. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +2 -4
  38. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +18 -16
  39. package/src/components/Customs/SyTextField/types.d.ts +2 -2
  40. package/src/components/DataList/DataList.stories.ts +3 -2
  41. package/src/components/DataList/DataList.vue +1 -1
  42. package/src/components/DataListGroup/DataListGroup.stories.ts +3 -2
  43. package/src/components/DataListItem/DataListItem.vue +12 -12
  44. package/src/components/DatePicker/DatePicker.mdx +191 -0
  45. package/src/components/DatePicker/DatePicker.stories.ts +787 -0
  46. package/src/components/DatePicker/DatePicker.vue +560 -0
  47. package/src/components/DatePicker/DateTextInput.vue +409 -0
  48. package/src/components/DatePicker/tests/DatePicker.spec.ts +266 -0
  49. package/src/components/DialogBox/DialogBox.mdx +28 -2
  50. package/src/components/DialogBox/DialogBox.stories.ts +2 -2
  51. package/src/components/DialogBox/DialogBox.vue +3 -2
  52. package/src/components/DownloadBtn/DownloadBtn.vue +2 -1
  53. package/src/components/ExternalLinks/Accessibilite.mdx +14 -0
  54. package/src/components/ExternalLinks/Accessibilite.stories.ts +191 -0
  55. package/src/components/ExternalLinks/AccessibiliteItems.ts +197 -0
  56. package/src/components/ExternalLinks/ExternalLinks.mdx +86 -0
  57. package/src/components/ExternalLinks/ExternalLinks.stories.ts +553 -0
  58. package/src/components/ExternalLinks/ExternalLinks.vue +200 -0
  59. package/src/components/ExternalLinks/config.ts +34 -0
  60. package/src/components/ExternalLinks/constants/ExpertiseLevelEnum.ts +4 -0
  61. package/src/components/ExternalLinks/locales.ts +4 -0
  62. package/src/components/ExternalLinks/tests/ExternalLinks.spec.ts +154 -0
  63. package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +159 -0
  64. package/src/components/FileUpload/FileUpload.mdx +165 -0
  65. package/src/components/FileUpload/FileUpload.stories.ts +429 -0
  66. package/src/components/FileUpload/FileUpload.vue +195 -0
  67. package/src/components/FileUpload/FileUploadContent.vue +109 -0
  68. package/src/components/FileUpload/locales.ts +10 -0
  69. package/src/components/FileUpload/tests/FileUpload.spec.ts +332 -0
  70. package/src/components/FileUpload/tests/__snapshots__/FileUpload.spec.ts.snap +7 -0
  71. package/src/components/FileUpload/useFileDrop.ts +23 -0
  72. package/src/components/FileUpload/validateFiles.ts +39 -0
  73. package/src/components/FooterBar/FooterBar.vue +105 -80
  74. package/src/components/FranceConnectBtn/FranceConnectBtn.vue +14 -13
  75. package/src/components/HeaderBar/HeaderBar.vue +3 -3
  76. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +11 -7
  77. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +5 -5
  78. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +2 -2
  79. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +10 -8
  80. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -2
  81. package/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.vue +2 -1
  82. package/src/components/HeaderBar/HeaderLogo/logos/Logo.vue +2 -1
  83. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +10 -10
  84. package/src/components/HeaderBar/consts.scss +1 -1
  85. package/src/components/HeaderLoading/HeaderLoading.vue +12 -11
  86. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
  87. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +9 -9
  88. package/src/components/HeaderToolbar/HeaderToolbar.vue +215 -202
  89. package/src/components/LangBtn/LangBtn.vue +8 -6
  90. package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
  91. package/src/components/NirField/NirField.stories.ts +8 -8
  92. package/src/components/NirField/NirField.vue +46 -48
  93. package/src/components/NotFoundPage/NotFoundPage.stories.ts +33 -2
  94. package/src/components/NotFoundPage/NotFoundPage.vue +17 -0
  95. package/src/components/NotificationBar/NotificationBar.mdx +5 -5
  96. package/src/components/NotificationBar/NotificationBar.stories.ts +410 -314
  97. package/src/components/NotificationBar/NotificationBar.vue +43 -41
  98. package/src/components/PageContainer/PageContainer.vue +4 -4
  99. package/src/components/PasswordField/Accessibilite.mdx +14 -0
  100. package/src/components/PasswordField/Accessibilite.stories.ts +191 -0
  101. package/src/components/PasswordField/AccessibiliteItems.ts +184 -0
  102. package/src/components/PasswordField/PasswordField.mdx +70 -0
  103. package/src/components/PasswordField/PasswordField.stories.ts +213 -0
  104. package/src/components/PasswordField/PasswordField.vue +189 -0
  105. package/src/components/PasswordField/config.ts +11 -0
  106. package/src/components/PasswordField/constants/ExpertiseLevelEnum.ts +4 -0
  107. package/src/components/PasswordField/locales.ts +4 -0
  108. package/src/components/PasswordField/tests/PasswordField.spec.ts +96 -0
  109. package/src/components/PhoneField/PhoneField.mdx +0 -2
  110. package/src/components/PhoneField/PhoneField.stories.ts +10 -50
  111. package/src/components/PhoneField/PhoneField.vue +77 -93
  112. package/src/components/PhoneField/tests/PhoneField.spec.ts +0 -15
  113. package/src/components/RangeField/RangeField.mdx +54 -0
  114. package/src/components/RangeField/RangeField.stories.ts +189 -0
  115. package/src/components/RangeField/RangeField.vue +157 -0
  116. package/src/components/RangeField/RangeSlider/RangeSlider.vue +387 -0
  117. package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +64 -0
  118. package/src/components/RangeField/RangeSlider/tests/__snapshots__/rangeSlider.spec.ts.snap +27 -0
  119. package/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.ts +100 -0
  120. package/src/components/RangeField/RangeSlider/tests/useDoubleSlider.spec.ts +246 -0
  121. package/src/components/RangeField/RangeSlider/tests/useMouseSlide.spec.ts +204 -0
  122. package/src/components/RangeField/RangeSlider/tests/useThumb.spec.ts +22 -0
  123. package/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.ts +233 -0
  124. package/src/components/RangeField/RangeSlider/tests/useTooltipsNudge.spec.ts +150 -0
  125. package/src/components/RangeField/RangeSlider/tests/useTrack.spec.ts +314 -0
  126. package/src/components/RangeField/RangeSlider/tests/vAnimateClick.spec.ts +32 -0
  127. package/src/components/RangeField/RangeSlider/types.ts +15 -0
  128. package/src/components/RangeField/RangeSlider/useMouseSlide.ts +109 -0
  129. package/src/components/RangeField/RangeSlider/useRangeSlider.ts +126 -0
  130. package/src/components/RangeField/RangeSlider/useThumb.ts +18 -0
  131. package/src/components/RangeField/RangeSlider/useThumbKeyboard.ts +84 -0
  132. package/src/components/RangeField/RangeSlider/useTooltipsNudge.ts +92 -0
  133. package/src/components/RangeField/RangeSlider/useTrack.ts +116 -0
  134. package/src/components/RangeField/RangeSlider/vAnimateClick.ts +19 -0
  135. package/src/components/RangeField/config.ts +7 -0
  136. package/src/components/RangeField/locales.ts +4 -0
  137. package/src/components/RangeField/tests/RangeField.spec.ts +224 -0
  138. package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +379 -0
  139. package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +205 -0
  140. package/src/components/RatingPicker/EmotionPicker/locales.ts +3 -0
  141. package/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.ts +104 -0
  142. package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +66 -0
  143. package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +159 -0
  144. package/src/components/RatingPicker/NumberPicker/locales.ts +4 -0
  145. package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +73 -0
  146. package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +105 -0
  147. package/src/components/RatingPicker/Rating.ts +45 -0
  148. package/src/components/RatingPicker/RatingPicker.mdx +56 -0
  149. package/src/components/RatingPicker/RatingPicker.stories.ts +515 -0
  150. package/src/components/RatingPicker/RatingPicker.vue +122 -0
  151. package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +116 -0
  152. package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +95 -0
  153. package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +36 -0
  154. package/src/components/RatingPicker/locales.ts +3 -0
  155. package/src/components/RatingPicker/tests/Rating.spec.ts +104 -0
  156. package/src/components/RatingPicker/tests/RatingPicker.spec.ts +187 -0
  157. package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +108 -0
  158. package/src/components/SearchListField/SearchListField.mdx +74 -0
  159. package/src/components/SearchListField/SearchListField.stories.ts +126 -0
  160. package/src/components/SearchListField/SearchListField.vue +194 -0
  161. package/src/components/SearchListField/locales.ts +5 -0
  162. package/src/components/SearchListField/tests/SearchListField.spec.ts +323 -0
  163. package/src/components/SearchListField/types.d.ts +4 -0
  164. package/src/components/SelectBtnField/SelectBtnField.mdx +50 -0
  165. package/src/components/SelectBtnField/SelectBtnField.stories.ts +763 -0
  166. package/src/components/SelectBtnField/SelectBtnField.vue +283 -0
  167. package/src/components/SelectBtnField/config.ts +11 -0
  168. package/src/components/SelectBtnField/tests/SelectBtnField.spec.ts +327 -0
  169. package/src/components/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +125 -0
  170. package/src/components/SelectBtnField/types.d.ts +11 -0
  171. package/src/components/SkipLink/SkipLink.vue +10 -10
  172. package/src/components/SocialMediaLinks/SocialMediaLinks.vue +28 -26
  173. package/src/components/SubHeader/SubHeader.vue +32 -31
  174. package/src/components/SyAlert/SyAlert.vue +12 -12
  175. package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -1
  176. package/src/components/UserMenuBtn/config.ts +1 -1
  177. package/src/components/index.ts +17 -7
  178. package/src/composables/rules/useFieldValidation.ts +172 -44
  179. package/src/designTokens/index.ts +6 -4
  180. package/src/designTokens/{bootstrapColors.md → paColors.md} +1 -1
  181. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -0
  182. package/src/designTokens/tokens/pa/paColors.ts +171 -0
  183. package/src/designTokens/tokens/pa/paContextual.ts +58 -0
  184. package/src/designTokens/tokens/pa/paDarkTheme.ts +5 -0
  185. package/src/designTokens/tokens/pa/paLightTheme.ts +123 -0
  186. package/src/designTokens/tokens/pa/paSemantic.ts +87 -0
  187. package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +52 -2
  188. package/src/stories/GuideDuDev/CreerUneIssue.mdx +64 -0
  189. package/src/stories/GuideDuDev/{CommentUtiliserLesRules.mdx → UtiliserLesRules.mdx} +2 -2
  190. package/src/stories/GuideDuDev/components.stories.ts +9 -7
  191. package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +163 -88
  192. package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +250 -23
  193. package/src/temp/TestDTComponent.vue +5 -6
  194. package/src/utils/calcHumanFileSize/index.ts +12 -0
  195. package/src/utils/calcHumanFileSize/tests/calcHumanFileSize.spec.ts +21 -0
  196. package/src/designTokens/tokens/bootstrap/bootstrapColors.ts +0 -158
  197. package/src/designTokens/tokens/bootstrap/bootstrapLightTheme.ts +0 -22
  198. package/src/stories/GuideDuDev/CommentContribuer.mdx +0 -22
@@ -203,8 +203,8 @@
203
203
  <template #actions>
204
204
  <div
205
205
  class="d-flex ga-2"
206
- style="width:100%"
207
- :class="hasLongContent ? 'action-section-longText' : 'action-section-shortText'"
206
+ style="width: 100%;"
207
+ :class="hasLongContent ? 'action-section-long-text' : 'action-section-short-text'"
208
208
  >
209
209
  <slot name="action" />
210
210
  <VBtn
@@ -228,67 +228,69 @@
228
228
  </template>
229
229
 
230
230
  <style lang="scss" scoped>
231
- @use '@/assets/tokens.scss';
231
+ @use '@/assets/tokens';
232
232
 
233
233
  .vd-notification-content {
234
- display: flex;
235
- align-items: center;
234
+ display: flex;
235
+ align-items: center;
236
236
  }
237
237
 
238
238
  .vd-notification-bar :deep(.v-snack__wrapper) {
239
- padding: 16px;
240
- min-width: 0;
241
- max-width: none;
239
+ padding: 16px;
240
+ min-width: 0;
241
+ max-width: none;
242
242
  }
243
243
 
244
244
  :deep(.v-snackbar__content) {
245
- padding: tokens.$padding-4 !important;
245
+ padding: tokens.$padding-4 !important;
246
246
  }
247
+
247
248
  :deep(.v-snackbar__actions) {
248
- margin-inline-end: 10px;
249
+ margin-inline-end: 10px;
249
250
  }
250
251
 
251
252
  .vd-notification-bar.v-snackbar--vertical :deep() {
252
- .v-snackbar--vertical .v-snackbar__wrapper .v-snackbar__actions {
253
- width: 100% !important;
254
- align-self: auto;
255
- }
256
- .v-snack__wrapper {
257
- align-items: stretch;
258
- flex-direction: row;
259
- }
260
-
261
- .v-snack__action {
262
- align-self: stretch;
263
- align-items: stretch;
264
- flex-direction: column;
265
- }
266
-
267
- .v-snackbar__content {
268
- margin: 0;
269
- width: 100%;
270
- display: flex;
271
- }
272
-
273
- .vd-notification-content {
274
- flex-direction: column;
275
- display: flex;
276
- }
253
+ .v-snackbar--vertical .v-snackbar__wrapper .v-snackbar__actions {
254
+ width: 100% !important;
255
+ align-self: auto;
256
+ }
257
+
258
+ .v-snack__wrapper {
259
+ align-items: stretch;
260
+ flex-direction: row;
261
+ }
262
+
263
+ .v-snack__action {
264
+ align-self: stretch;
265
+ align-items: stretch;
266
+ flex-direction: column;
267
+ }
268
+
269
+ .v-snackbar__content {
270
+ margin: 0;
271
+ width: 100%;
272
+ display: flex;
273
+ }
274
+
275
+ .vd-notification-content {
276
+ flex-direction: column;
277
+ display: flex;
278
+ }
277
279
  }
278
280
 
279
281
  .long-text :deep(.v-snackbar__actions) {
280
- width: 98% !important;
282
+ width: 98% !important;
281
283
  }
282
284
 
283
285
  .short-text :deep(.v-snackbar__actions) {
284
- width: 48% !important;
286
+ width: 48% !important;
285
287
  }
286
288
 
287
- .action-section-longText {
288
- justify-content: space-around;
289
+ .action-section-long-text {
290
+ justify-content: space-around;
289
291
  }
290
292
 
291
- .action-section-shortText {
292
- justify-content: end !important;
293
+ .action-section-short-text {
294
+ justify-content: end !important;
293
295
  }
294
296
  </style>
@@ -65,9 +65,9 @@
65
65
 
66
66
  <style lang="scss" scoped>
67
67
  .vd-page-container {
68
- flex: 1;
69
- width: 100%;
70
- max-width: 1712px;
71
- margin: 0 auto;
68
+ flex: 1;
69
+ width: 100%;
70
+ max-width: 1712px;
71
+ margin: 0 auto;
72
72
  }
73
73
  </style>
@@ -0,0 +1,14 @@
1
+ import { Meta, Story } from '@storybook/addon-docs';
2
+ import * as AccessStories from './Accessibilite.stories.ts';
3
+
4
+ <Meta of={AccessStories} />
5
+
6
+ Accessibilité
7
+ =============
8
+ <Story of={AccessStories.Legende} />
9
+ <br />
10
+
11
+ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12
+
13
+ <Story of={AccessStories.AccessibilitePanel} />
14
+ <br />
@@ -0,0 +1,191 @@
1
+ import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon } from 'vuetify/components'
2
+ import type { StoryObj } from '@storybook/vue3'
3
+ import { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated } from './AccessibiliteItems'
4
+ import { mdiCheckboxMarkedCircle, mdiLink, mdiEye } from '@mdi/js'
5
+
6
+ const checkIcon = mdiCheckboxMarkedCircle
7
+ const iconEye = mdiEye
8
+ const linkICon = mdiLink
9
+
10
+ export default {
11
+ title: 'Composants/Formulaires/PasswordField/Accessibilité',
12
+ }
13
+
14
+ export const AccessibilitePanel: StoryObj = {
15
+
16
+ render: () => {
17
+ return {
18
+ components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon },
19
+
20
+ setup() {
21
+ const icon = checkIcon
22
+
23
+ return { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated, icon, linkICon, iconEye }
24
+ },
25
+ template: `
26
+ <div class="accessibiliteItems" style="display:flex; max-width: none !important;">
27
+ <v-col cols="6">
28
+ <div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
29
+ <h5>{{ AccessibiliteItemsIndeterminate.length }} critères à prendre en charge par le projet</h5>
30
+ <div style="display: flex; align-items: center;">
31
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
32
+ rounded>Tanaguru
33
+ </v-btn>
34
+ </div>
35
+ </div>
36
+
37
+ <v-expansion-panels value="opened" multiple>
38
+ <v-expansion-panel v-for="(item, index) in AccessibiliteItemsIndeterminate" :key="index" style="background-color: rgba(42, 96, 158, 0.1); margin-bottom: 10px;">
39
+ <v-expansion-panel-title>
40
+ <VIcon :icon="iconEye" style="margin-right: 5px; color:#5778b7;"/>
41
+ {{ item.title }}
42
+ </v-expansion-panel-title>
43
+ <v-expansion-panel-text>
44
+ <v-expansion-panels>
45
+ <v-expansion-panel v-for="(i, index) in item.items2" :key="i" style="margin-bottom: 10px;">
46
+ <v-expansion-panel-title
47
+ style="font-weight: bold; font-size: 13px; line-height: 16px;">
48
+ {{ i.subtitle}}
49
+ </v-expansion-panel-title>
50
+ <v-expansion-panel-text>
51
+ <div>
52
+ <p style="font-size: 13px;line-height: 16px;">
53
+ {{ i.precision }}
54
+ </p>
55
+ <div v-for="(value, index) in i.solution"
56
+ style="margin-top:15px; font-size: 13px;line-height: 16px;">
57
+ <p style="font-weight: bold;">Méthodologie du test : <a
58
+ href="{{i.link}}" target="blank">
59
+ <VIcon :icon="linkICon"/>
60
+ </a></p>
61
+ <p>{{ value.info1 }}</p>
62
+ <p>{{ value.info2 }}</p>
63
+ <p>{{ value.info3 }}</p>
64
+ <p>{{ value.info4 }}</p>
65
+
66
+ </div>
67
+ <span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
68
+ </div>
69
+ </v-expansion-panel-text>
70
+ </v-expansion-panel>
71
+ <v-expansion-panel >
72
+ <v-expansion-panel-title
73
+ style="font-weight: bold; font-size: 13px; line-height: 16px;">
74
+ {{ item.subtitle }}
75
+ </v-expansion-panel-title>
76
+ <v-expansion-panel-text>
77
+ <div v-for="(value, i) in item.items" :key="i">
78
+ <p style="font-size: 13px;line-height: 16px;">
79
+ {{ value.precision }}
80
+ </p>
81
+ <div v-for="element in value.solution"
82
+ style="margin-top:15px; font-size: 13px;line-height: 16px;">
83
+ <p style="font-weight: bold;">Méthodologie du test : <a
84
+ href="value.link" target="blank">
85
+ <VIcon :icon="linkICon"/>
86
+ </a></p>
87
+ <p>{{ element.info1 }}</p>
88
+ <p>{{ element.info2 }}</p>
89
+ <p>{{ element.info3 }}</p>
90
+ </div>
91
+ <span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
92
+ </div>
93
+ </v-expansion-panel-text>
94
+ </v-expansion-panel>
95
+ </v-expansion-panels>
96
+ </v-expansion-panel-text>
97
+ </v-expansion-panel>
98
+ </v-expansion-panels>
99
+ </v-col>
100
+ <v-col cols="6">
101
+ <div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
102
+ <h5>{{ AccessibiliteItemsValidated.length }} critères pris en charge par l'équipe Design System</h5>
103
+ <div style="display: flex; align-items: center;">
104
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
105
+ rounded>Tanaguru
106
+ </v-btn>
107
+ </div>
108
+ </div>
109
+ <v-expansion-panels v-if="AccessibiliteItemsValidated.length > 0" value="opened" multiple>
110
+ <v-expansion-panel
111
+ v-for="(item, index) in AccessibiliteItemsValidated"
112
+ :key="index" style="background-color: rgba(53,135,0,0.1); margin-bottom: 10px;">
113
+ <v-expansion-panel-title>
114
+ <VIcon color="green" :icon="icon" style="margin-right: 5px;"/>
115
+ {{ item.title }}
116
+ </v-expansion-panel-title>
117
+ <v-expansion-panel-text>
118
+ <v-expansion-panels>
119
+ <v-expansion-panel>
120
+ <v-expansion-panel-title style="font-weight: bold;font-size: 13px; line-height: 16px;">
121
+ {{ item.subtitle }}
122
+ </v-expansion-panel-title>
123
+ <v-expansion-panel-text>
124
+ <div v-for="(value, i) in item.items" :key="i">
125
+ <p style="font-size: 13px;line-height: 16px;">
126
+ {{ value.precision }}
127
+ </p>
128
+ <div v-for="element in value.solution"
129
+ style="margin-top:15px; font-size: 13px;line-height: 16px;">
130
+ <p style="font-weight: bold;">Méthodologie du test : <a
131
+ href="value.link" target="blank">
132
+ <VIcon :icon="linkICon"/>
133
+ </a></p>
134
+ <p>{{ element.info1 }}</p>
135
+ <p>{{ element.info2 }}</p>
136
+ <p>{{ element.info3 }}</p>
137
+ </div>
138
+ <span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
139
+ </div>
140
+ </v-expansion-panel-text>
141
+ </v-expansion-panel>
142
+ </v-expansion-panels>
143
+ </v-expansion-panel-text>
144
+ </v-expansion-panel>
145
+ </v-expansion-panels>
146
+ <div v-else style="display: flex;justify-content: center;"><span style="text-align:center;" >Pas de critère d'accessibilité bloquant</span></div>
147
+ </v-col>
148
+ </div>
149
+ `,
150
+ }
151
+ },
152
+ tags: ['!dev'],
153
+ }
154
+
155
+ export const Legende: StoryObj = {
156
+ args: {
157
+ icon: checkIcon,
158
+ },
159
+ render: (args) => {
160
+ return {
161
+ components: { VIcon },
162
+ setup() {
163
+ return { args }
164
+ },
165
+ template: `
166
+ <p style="color: grey;font-size: 11px; margin-bottom: 12px;">Date de conception: 20/11/2024</p>
167
+ <div>
168
+ <p>Le tableau ci-dessous liste nos recommandations suivant les <a target="blank" style="color:#0C41BD;" href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu">catégories du RGAA</a>.</p>
169
+ <p style="margin-bottom: 12px;font-weight:bold;">Pour rappel le composant seul ne garantie pas
170
+ l'accessibilité du site.</p>
171
+ <div style="font-size: 14px">
172
+ <p>Nous avons deux façons de relever les problèmes d'accessibilité des composants :</p>
173
+ <div>
174
+ <v-btn variant="tonal" color="grey" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
175
+ Audit
176
+ </v-btn>
177
+ Problèmes relevés par le projet
178
+ </div>
179
+ <div>
180
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
181
+ Tanaguru
182
+ </v-btn>
183
+ Problèmes relevés par Tanaguru
184
+ </div>
185
+ </div>
186
+ </div>
187
+ `,
188
+ }
189
+ },
190
+ tags: ['!dev'],
191
+ }
@@ -0,0 +1,184 @@
1
+ import { ExpertiseLevelEnum } from './constants/ExpertiseLevelEnum'
2
+
3
+ export const AccessibiliteItemsIndeterminate = [
4
+
5
+ {
6
+ title: 'Catégorie 10 : Présentation de l’information',
7
+ subtitle: '10.1 Dans le site web, des feuilles de styles sont-elles utilisées pour contrôler la présentation de l’information ? ?',
8
+ items: [
9
+
10
+ {
11
+ precision: '10.1.1 Dans chaque page web, les balises servant à la présentation de l’information ne doivent pas être présentes dans le code source généré des pages. Cette règle est-elle respectée ? ',
12
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#10.1.1',
13
+ solution: [{
14
+ info1: '1. Vérifier l’absence des éléments de présentation <basefont>, <big>, <blink>, <center>, <font>, <marquee>, <s>, <strike>, <tt> ; ',
15
+ info2: '2. Vérifier l’absence de l’élément <u> uniquement si le DOCTYPE du document ne correspond pas à HTML 5 ; ',
16
+ info3: '3. Si c’est le cas, le test est validé',
17
+ }],
18
+ expertise: ExpertiseLevelEnum.DEV,
19
+
20
+ },
21
+
22
+ ],
23
+ },
24
+ {
25
+ title: 'Catégorie 11 : Formulaires',
26
+ subtitle: '11.2 Chaque étiquette associée à un champ de formulaire est-elle pertinente (hors cas particuliers) ? ',
27
+
28
+ items2: [
29
+
30
+ {
31
+
32
+ subtitle: '11.13 La finalité d’un champ de saisie peut-elle être déduite pour faciliter le remplissage automatique des champs avec les données de l’utilisateur ? ',
33
+ precision: '11.13.1 Chaque champ de formulaire dont l’objet se rapporte à une information concernant l’utilisateur vérifie-t-il ces conditions ? '
34
+ + 'Le champ de formulaire possède un attribut autocomplete ; '
35
+ + 'L’attribut autocomplete est pourvu d’une valeur présente dans la liste des valeurs possibles pour l’attribut autocomplete associés à un champ de formulaire ; '
36
+ + 'La valeur indiquée pour l’attribut autocomplete est pertinente au regard du type d’information attendu. ',
37
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.13.1',
38
+ solution: [{
39
+ info1: '1. Retrouver dans le document les champs de formulaire qui se rapportent à une information concernant l’utilisateur (nom, prénom, numéro de téléphone, etc.) ; ',
40
+ info2: '2. Pour chaque champ de formulaire, vérifier que : Le champ de formulaire possède un attribut autocomplete ; L’attribut autocomplete est pourvu d’une valeur présente dans la liste des valeurs possibles; La valeur indiquée pour l’attribut autocomplete est pertinente au regard du type d’information attendu.',
41
+ info3: '3. Si c’est le cas pour chaque champ de formulaire retrouvé, le test est validé.',
42
+ }],
43
+ expertise: ExpertiseLevelEnum.DEV,
44
+
45
+ },
46
+
47
+ ],
48
+ items: [
49
+ {
50
+ precision: '11.2.2 Chaque attribut title permet-il de connaître la fonction exacte du champ de formulaire auquel il est associé',
51
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.2.2',
52
+ solution: [{
53
+ info1: '1. Retrouver dans le document les champs de formulaire dont l’étiquette est fournie par un attribut title ; ',
54
+ info2: '2. Pour chaque champ de formulaire, vérifier que le contenu de l’attribut est pertinent ; ',
55
+ info3: '3. Si c’est le cas pour chaque champ de formulaire, le test est validé.',
56
+ }],
57
+ expertise: ExpertiseLevelEnum.DEV,
58
+
59
+ },
60
+ {
61
+ precision: '11.2.5 Chaque champ de formulaire ayant un intitulé visible vérifie-t-il ces conditions (hors cas particuliers) ? '
62
+ + 'S’il est présent, le contenu de l’attribut WAI-ARIA aria-label du champ de formulaire contient au moins l’intitulé visible ; '
63
+ + 'S’il est présent, le passage de texte lié au champ de formulaire via un attribut WAI-ARIA aria-labelledby contient au moins l’intitulé visible ; '
64
+ + 'S’il est présent, le contenu de l’attribut title du champ de formulaire contient au moins l’intitulé visible ; '
65
+ + 'S’il est présent le contenu de la balise <label> associé au champ de formulaire contient au moins l’intitulé visible.',
66
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.2.5',
67
+ solution: [{
68
+ info1: '1. Retrouver dans le document les champs de formulaire dont l’étiquette est fournie à la fois par un intitulé visible et par le contenu soit d’un élément <label>, soit d’un attribut title ou d’un attribut aria-label ou d’un attribut aria-labelledby ; ',
69
+ info2: '2. Pour chaque champ de formulaire, vérifier que le contenu de l’élément <label> ou de l’attribut title ou de l’attribut aria-label ou de l’attribut aria-labelledby contient l’intitulé visible ; ',
70
+ info3: '3. Si c’est le cas pour chaque champ de formulaire, le test est validé. ',
71
+ }],
72
+ expertise: ExpertiseLevelEnum.DEV,
73
+
74
+ },
75
+ ],
76
+
77
+ },
78
+
79
+ ]
80
+
81
+ export const AccessibiliteItemsValidated = [
82
+ {
83
+ title: 'Catégorie 1 : Images',
84
+ subtitle: '1.2 Chaque image de décoration est-elle correctement ignorée par les technologies d’assistance ?',
85
+ items: [
86
+
87
+ {
88
+ precision: '1.2.4 Chaque image vectorielle (balise <svg>) de décoration, sans légende, vérifie-t-elle ces conditions ?'
89
+ + ' La balise <svg> possède un attribut WAI-ARIA aria-hidden="true" ;'
90
+ + ' La balise <svg> et ses enfants sont dépourvus d’alternative textuelle ;'
91
+ + ' Les balises <title> et <desc> sont absentes ou vides ;'
92
+ + ' La balise <svg> et ses enfants sont dépourvus d’attribut title.',
93
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#1.2.4',
94
+ solution: [{
95
+ info1: '1. Retrouver dans le document les images décoratives dépourvues de légende structurées au moyen d’un élément <svg> ;',
96
+ info2: '2. Pour chaque image, vérifier que l’élément <svg> ne possède pas d’attributs aria-labelledby ou aria-label et qu’il :'
97
+ + ' Possède un attribut WAI-ARIA aria-hidden="true" ;'
98
+ + ' Et est dépourvu d’alternative textuelle (ainsi que ses éléments enfants) ;'
99
+ + ' Et ne contient pas d’éléments <title> et <desc> à moins que vides de contenu ;'
100
+ + ' Et est dépourvu d’attribut title (ainsi que ses éléments enfants).',
101
+ info3: '3. Si c’est le cas pour chaque image, le test est validé',
102
+ }],
103
+ expertise: ExpertiseLevelEnum.DESIGN,
104
+
105
+ },
106
+
107
+ ],
108
+
109
+ },
110
+ {
111
+ title: 'Catégorie 7 : Scripts',
112
+ subtitle: '7.1 Chaque script est-il, si nécessaire, compatible avec les technologies d’assistance ?',
113
+ items: [
114
+
115
+ {
116
+ precision: ' 7.1.3 Chaque script qui génère ou contrôle un composant d’interface vérifie-t-il ces conditions : '
117
+ + 'Le composant possède un nom pertinent ;'
118
+ + 'Le nom accessible du composant contient au moins l’intitulé visible ;'
119
+ + 'Le composant possède un rôle pertinent.',
120
+
121
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#7.1.3',
122
+ solution: [{
123
+ info1: '1. Pour chacun des composants d’interface ayant validé le test 7.1.1, vérifier que le composant d’interface possède : ',
124
+ info2: '2. Un nom pertinent (intitulé visible) et un rôle pertinent',
125
+ info3: '3. Si le composant d’interface possède un nom accessible, vérifier que ce nom est pertinent et contient au moins l’intitulé visible.',
126
+ }],
127
+ expertise: ExpertiseLevelEnum.DESIGN,
128
+
129
+ },
130
+
131
+ ],
132
+ },
133
+ {
134
+ title: 'Catégorie 8 : Eléments Obligatoires',
135
+ subtitle: '8.9 Dans chaque page web, les balises ne doivent pas être utilisées uniquement à des fins de présentation',
136
+ items: [
137
+
138
+ {
139
+ precision: ' 8.9.1 Dans chaque page web les balises (à l’exception de <div>, <span> et <table>) ne doivent pas être utilisées uniquement à des fins de présentation. Cette règle est-elle respectée',
140
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#8.9.1',
141
+ solution: [{
142
+ info1: '1. Retrouver dans le document l’ensemble des éléments sémantiques utilisés à des fins de présentation ;',
143
+ info2: '2. Pour chacun de ces éléments, vérifier que :'
144
+ + 'L’élément est pourvu d’un attribut role=“presentation” ;'
145
+ + 'L’utilisation de cet élément à des fins de présentation reste justifée',
146
+ info3: '3. Si c’est le cas, le test est validé',
147
+ }],
148
+ expertise: ExpertiseLevelEnum.DESIGN,
149
+
150
+ },
151
+
152
+ ],
153
+ },
154
+ {
155
+ title: 'Catégorie 11 : Formulaires',
156
+ subtitle: '11.1 Chaque champ de formulaire a-t-il une étiquette ',
157
+ items: [
158
+ {
159
+ precision: '11.1.1 Chaque champ de formulaire vérifie-t-il une de ces conditions ? '
160
+ + 'Le champ de formulaire possède un attribut WAI-ARIA aria-labelledby référençant un passage de texte identifié ; '
161
+ + 'Le champ de formulaire possède un attribut WAI-ARIA aria-label ; '
162
+ + 'Une balise <label> ayant un attribut for est associée au champ de formulaire ; '
163
+ + 'Le champ de formulaire possède un attribut title ; '
164
+ + 'Un bouton adjacent au champ de formulaire lui fournit une étiquette visible et un élément <label> visuellement caché ou un attribut WAI-ARIA aria-label, aria-labelledby ou title lui fournit un nom accessible.',
165
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.1.1',
166
+ solution: [{
167
+ info1: '1. Retrouver dans le document les champs de formulaire ; ',
168
+ info2: '2. Pour chaque champ de formulaire, vérifier que le champ de formulaire : '
169
+ + 'Possède un attribut WAI-ARIA aria-labelledby référençant un passage de texte identifié ; '
170
+ + 'Possède un attribut WAI-ARIA aria-label ; '
171
+ + 'Est associé à un élément <label> ayant un attribut for ; '
172
+ + 'Possède un attribut title ; '
173
+ + 'Un bouton adjacent au champ de formulaire lui fournit une étiquette visible et un élément <label> visuellement caché ou un attribut WAI-ARIA aria-label, aria-labelledby ou title lui fournit un nom accessible. ',
174
+ info3: '3. Si c’est le cas pour champ de formulaire, le test est validé. ',
175
+ }],
176
+ expertise: ExpertiseLevelEnum.DESIGN,
177
+
178
+ },
179
+
180
+ ],
181
+
182
+ },
183
+
184
+ ]
@@ -0,0 +1,70 @@
1
+ import {Canvas, Meta, Controls, Source} from '@storybook/blocks';
2
+ import * as PasswordFieldStories from './PasswordField.stories';
3
+ import PasswordField from './PasswordField.vue';
4
+
5
+ <Meta title="Composants/Formulaires/PasswordField" component={PasswordField}/>
6
+
7
+ # PasswordField
8
+
9
+ Le composant `PasswordField` est utilisé pour afficher un champ de saisie de mot de passe et gérer sa validation.
10
+ Il permet également d’afficher ou de masquer le contenu du champ à l’aide d’une icône.
11
+
12
+ <Canvas story={{height: '150px'}} of={PasswordFieldStories.Default}/>
13
+
14
+ # API
15
+
16
+ <Controls of={PasswordFieldStories.Default}/>
17
+
18
+ ## Utilisation de base
19
+
20
+ <Source
21
+ dark
22
+ code={`
23
+ <script setup lang="ts">
24
+ import { ref } from 'vue'
25
+ import { PasswordField } from '@cnamts/synapse'
26
+
27
+ const password = ref('')
28
+ const passwordFieldRef = ref() // Référence Vue pour accéder au composant enfant
29
+
30
+ function handleSubmit() {
31
+ // Appeler la méthode exposée validateOnSubmit via la référence
32
+ const isValid = passwordFieldRef.value?.validateOnSubmit()
33
+ if (!isValid) {
34
+ alert('Veuillez corriger les erreurs avant de soumettre.')
35
+ } else {
36
+ alert('Formulaire soumis avec succès !')
37
+ }
38
+ }
39
+ </script>
40
+
41
+ <template>
42
+ <form @submit.prevent="handleSubmit">
43
+ <PasswordField
44
+ ref="passwordFieldRef"
45
+ v-model="password"
46
+ outlined
47
+ :is-validate-on-blur="true"
48
+ />
49
+ <button type="submit">Soumettre</button>
50
+ </form>
51
+ </template>
52
+ `}
53
+ />
54
+
55
+ ## Gestion de la validation
56
+
57
+ ### Validation par défaut
58
+
59
+ - **required** : Si `true`, le champ est obligatoire et affiche une erreur si le champ est vide.
60
+ - **isValidateOnBlur** : Si `true`, la validation se déclenche automatiquement lors du blur (perte de focus).
61
+
62
+ ### Règles de validation personnalisées (props `customRules`)
63
+
64
+ Vous pouvez définir des règles de validation personnalisées sous forme de tableau d’objets.
65
+
66
+ Pour savoir comment utiliser les règles personnalisées, veuillez consulter la section [Comment utiliser les rules](/docs/guide-du-dev-comment-utiliser-les-rules--docs).
67
+
68
+
69
+
70
+