@cnamts/synapse 1.0.22 → 1.0.23

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 (190) hide show
  1. package/dist/{DateFilter-B5n-ZkLi.js → DateFilter-Dc-gSGwk.js} +1 -1
  2. package/dist/{NumberFilter-CtiZ9uj8.js → NumberFilter-vP38Wp6j.js} +1 -1
  3. package/dist/{PeriodFilter-DzqiMb-b.js → PeriodFilter-Ba1uYUnT.js} +1 -1
  4. package/dist/{SelectFilter-BOYlF7rX.js → SelectFilter-BioGT6Nn.js} +1 -1
  5. package/dist/{TextFilter-BOFRNfcX.js → TextFilter-B84dpnoq.js} +1 -1
  6. package/dist/components/Accordion/Accordion.d.ts +13 -2
  7. package/dist/components/Accordion/composables/useAccordionState.d.ts +2 -1
  8. package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +7 -7
  9. package/dist/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.d.ts +1 -1
  10. package/dist/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.d.ts +1 -1
  11. package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +1 -1
  12. package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +7 -7
  13. package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +16 -16
  14. package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +1 -1
  15. package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +1 -1
  16. package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +22 -1
  17. package/dist/components/Customs/Selects/SyAutocomplete/locales.d.ts +5 -0
  18. package/dist/components/Customs/Selects/SyInputSelect/SyInputSelect.d.ts +1 -1
  19. package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +1 -1
  20. package/dist/components/Customs/Selects/SySelect/locales.d.ts +1 -0
  21. package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +1 -1
  22. package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1 -1
  23. package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1 -1
  24. package/dist/components/Customs/SyTextField/SyTextField.d.ts +5 -2
  25. package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +13 -9
  26. package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +7 -5
  27. package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +2 -1
  28. package/dist/components/ErrorPage/ErrorPage.d.ts +3 -1
  29. package/dist/components/FileList/UploadItem/UploadItem.d.ts +6 -0
  30. package/dist/components/FileList/UploadItem/locales.d.ts +1 -4
  31. package/dist/components/FileUpload/FileUploadContent.d.ts +2 -0
  32. package/dist/components/FileUpload/validateFiles.d.ts +2 -1
  33. package/dist/components/HeaderBar/HeaderBar.d.ts +2 -1
  34. package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +2 -1
  35. package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +2 -1
  36. package/dist/components/MonthPicker/MonthPicker.d.ts +1939 -0
  37. package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +1899 -0
  38. package/dist/components/MonthPicker/MonthPickerText/useTextField.d.ts +21 -0
  39. package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.d.ts +21 -0
  40. package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.d.ts +12 -0
  41. package/dist/components/MonthPicker/MonthPickerVisual/MonthSelector.d.ts +11 -0
  42. package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.d.ts +6 -0
  43. package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.d.ts +14 -0
  44. package/dist/components/MonthPicker/MonthPickerVisual/YearSelector.d.ts +14 -0
  45. package/dist/components/MonthPicker/MonthPickerVisual/useMonthGrid.d.ts +9 -0
  46. package/dist/components/MonthPicker/MonthPickerVisual/useYearGrid.d.ts +8 -0
  47. package/dist/components/MonthPicker/MonthPickerVisual/utils.d.ts +8 -0
  48. package/dist/components/MonthPicker/locales.d.ts +12 -0
  49. package/dist/components/MonthPicker/useMonthPickerValidation.d.ts +25 -0
  50. package/dist/components/NirField/NirField.d.ts +3 -1
  51. package/dist/components/NotificationBar/Notification/Notification.d.ts +3 -0
  52. package/dist/components/PasswordField/PasswordField.d.ts +1 -1
  53. package/dist/components/PeriodField/PeriodField.d.ts +29 -21
  54. package/dist/components/PhoneField/PhoneField.d.ts +2 -1
  55. package/dist/components/SyBtnMenu/SyBtnMenu.d.ts +1 -1
  56. package/dist/components/SyHeading/SyHeading.a11y.test.d.ts +1 -0
  57. package/dist/components/SyHeading/SyHeading.d.ts +4 -2
  58. package/dist/components/SyHeading/SyHeading.test.d.ts +1 -0
  59. package/dist/components/SyTextArea/SyTextArea.d.ts +1 -1
  60. package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +4 -4
  61. package/dist/components/Tables/SyTable/SyTable.d.ts +4 -4
  62. package/dist/components/Tables/common/SyTablePagination.d.ts +6 -6
  63. package/dist/components/index.d.ts +1 -0
  64. package/dist/design-system-v3.js +102 -99
  65. package/dist/design-system-v3.umd.cjs +126 -126
  66. package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +5 -0
  67. package/dist/{main-CEl4J8_T.js → main-aLKwdMi1.js} +11167 -10522
  68. package/dist/main.d.ts +1 -0
  69. package/dist/style.css +1 -1
  70. package/package.json +10 -4
  71. package/src/assets/apTokens.scss +2 -2
  72. package/src/assets/overrides/_btns.scss +8 -0
  73. package/src/assets/overrides/_forms.scss +9 -0
  74. package/src/assets/overrides/_icons.scss +38 -9
  75. package/src/assets/overrides/_tables.scss +19 -0
  76. package/src/components/Accordion/Accordion.mdx +23 -9
  77. package/src/components/Accordion/Accordion.stories.ts +153 -3
  78. package/src/components/Accordion/Accordion.vue +7 -6
  79. package/src/components/Accordion/composables/__tests__/useAccordionState.spec.ts +40 -12
  80. package/src/components/Accordion/composables/useAccordionState.ts +3 -4
  81. package/src/components/Accordion/tests/accordion.spec.ts +131 -19
  82. package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.mdx +3 -1
  83. package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.stories.ts +8 -0
  84. package/src/components/BackBtn/accessibilite/Accessibility.mdx +62 -10
  85. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +9 -3
  86. package/src/components/BackToTopBtn/accessibilite/Accessibility.mdx +86 -6
  87. package/src/components/Captcha/tests/Captcha.spec.ts +0 -29
  88. package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +2 -110
  89. package/src/components/Customs/Selects/SelectBtnField/accessibilite/Accessibility.mdx +133 -10
  90. package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +379 -93
  91. package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +144 -83
  92. package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibilite.stories.ts +40 -1
  93. package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibility.mdx +7 -1
  94. package/src/components/Customs/Selects/SyAutocomplete/locales.ts +5 -0
  95. package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +96 -0
  96. package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +234 -9
  97. package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +13 -3
  98. package/src/components/Customs/Selects/SyAutocomplete/utils/useSelectionLogic.ts +9 -10
  99. package/src/components/Customs/Selects/SySelect/SySelect.vue +46 -3
  100. package/src/components/Customs/Selects/SySelect/locales.ts +1 -0
  101. package/src/components/Customs/SyIcon/SyIcon.vue +1 -1
  102. package/src/components/Customs/SyIcon/tests/SyIcon.a11y.spec.ts +20 -0
  103. package/src/components/Customs/SyIconButton/SyIconButton.mdx +46 -0
  104. package/src/components/Customs/SyIconButton/SyIconButton.stories.ts +184 -0
  105. package/src/components/Customs/SyIconButton/SyIconButton.vue +38 -0
  106. package/src/components/Customs/SyIconButton/accessibilite/Accessibility.mdx +64 -0
  107. package/src/components/Customs/SyIconButton/tests/SyIconButton.a11y.spec.ts +87 -0
  108. package/src/components/Customs/SyIconButton/tests/SyIconButton.spec.ts +152 -0
  109. package/src/components/Customs/SyIconButton/tests/__snapshots__/SyIconButton.spec.ts.snap +61 -0
  110. package/src/components/Customs/SyPagination/SyPagination.vue +5 -5
  111. package/src/components/Customs/SyTextField/SyTextField.vue +20 -2
  112. package/src/components/Customs/SyTextField/accessibilite/Accessibility.mdx +67 -9
  113. package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +15 -0
  114. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +36 -0
  115. package/src/components/DataList/accessibilite/Accessibility.mdx +79 -11
  116. package/src/components/DataListGroup/accessibilite/Accessibility.mdx +80 -11
  117. package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +25 -0
  118. package/src/components/ErrorPage/ErrorPage.stories.ts +113 -19
  119. package/src/components/ErrorPage/ErrorPage.vue +17 -2
  120. package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +17 -0
  121. package/src/components/ErrorPage/tests/ErrorPage.spec.ts +21 -1
  122. package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +0 -1
  123. package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +23 -0
  124. package/src/components/FileList/FileList.stories.ts +51 -1
  125. package/src/components/FileList/UploadItem/UploadItem.vue +13 -6
  126. package/src/components/FileList/UploadItem/locales.ts +3 -12
  127. package/src/components/FileList/accessibilite/Accessibility.mdx +3 -0
  128. package/src/components/FileUpload/FileUpload.vue +2 -1
  129. package/src/components/FileUpload/FileUploadContent.vue +2 -1
  130. package/src/components/FileUpload/tests/FileUpload.spec.ts +47 -0
  131. package/src/components/FileUpload/validateFiles.ts +5 -2
  132. package/src/components/FranceConnectBtn/accessibilite/Accessibility.mdx +62 -9
  133. package/src/components/HeaderBar/HeaderBar.vue +2 -1
  134. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -1
  135. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
  136. package/src/components/LunarCalendar/accessibilite/Accessibility.mdx +74 -8
  137. package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +163 -0
  138. package/src/components/MaintenancePage/MaintenancePage.vue +1 -1
  139. package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +4 -5
  140. package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +0 -1
  141. package/src/components/MonthPicker/MonthPicker.mdx +35 -0
  142. package/src/components/MonthPicker/MonthPicker.stories.ts +527 -0
  143. package/src/components/MonthPicker/MonthPicker.vue +79 -0
  144. package/src/components/MonthPicker/MonthPickerText/MonthPickerInput.vue +89 -0
  145. package/src/components/MonthPicker/MonthPickerText/useTextField.ts +27 -0
  146. package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.vue +154 -0
  147. package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.ts +13 -0
  148. package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +137 -0
  149. package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +60 -0
  150. package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +149 -0
  151. package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +143 -0
  152. package/src/components/MonthPicker/MonthPickerVisual/useMonthGrid.ts +45 -0
  153. package/src/components/MonthPicker/MonthPickerVisual/useYearGrid.ts +45 -0
  154. package/src/components/MonthPicker/MonthPickerVisual/utils.ts +17 -0
  155. package/src/components/MonthPicker/accessibilite/Accessibility.mdx +59 -0
  156. package/src/components/MonthPicker/locales.ts +12 -0
  157. package/src/components/MonthPicker/tests/MonthPicker.a11y.spec.ts +71 -0
  158. package/src/components/MonthPicker/tests/MonthPicker.spec.ts +1248 -0
  159. package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +2545 -0
  160. package/src/components/MonthPicker/useMonthPickerValidation.ts +30 -0
  161. package/src/components/NirField/NirField.mdx +1 -2
  162. package/src/components/NirField/NirField.stories.ts +66 -6
  163. package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +2 -3
  164. package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +22 -14
  165. package/src/components/NotificationBar/Notification/Notification.vue +3 -1
  166. package/src/components/NotificationBar/NotificationBar.stories.ts +154 -0
  167. package/src/components/NotificationBar/tests/NotificationBar.a11y.spec.ts +26 -0
  168. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +60 -0
  169. package/src/components/RangeField/accessibilite/Accessibility.mdx +79 -11
  170. package/src/components/SkipLink/tests/SkipLink.a11y.spec.ts +23 -0
  171. package/src/components/StatusPage/StatusPage.stories.ts +118 -0
  172. package/src/components/StatusPage/StatusPage.vue +5 -3
  173. package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +22 -0
  174. package/src/components/StatusPage/tests/StatusPage.spec.ts +22 -0
  175. package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +22 -14
  176. package/src/components/SubHeader/tests/SubHeader.a11y.spec.ts +20 -0
  177. package/src/components/SyAlert/SyAlert.vue +1 -0
  178. package/src/components/SyAlert/accessibilite/Accessibility.mdx +79 -9
  179. package/src/components/SyAlert/tests/SyAlert.a11y.spec.ts +23 -0
  180. package/src/components/SyHeading/SyHeading.a11y.test.ts +149 -0
  181. package/src/components/SyHeading/SyHeading.test.ts +115 -0
  182. package/src/components/SyHeading/SyHeading.vue +5 -3
  183. package/src/components/SyTextArea/accessibilite/Accessibility.mdx +80 -8
  184. package/src/components/SyTextArea/tests/SyTextArea.a11y.spec.ts +151 -0
  185. package/src/components/ToolbarContainer/tests/ToolbarContainer.a11y.spec.ts +126 -0
  186. package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +2 -2
  187. package/src/components/index.ts +1 -0
  188. package/src/composables/useFormFieldErrorHandling.ts +11 -2
  189. package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -1
  190. package/src/main.ts +2 -0
@@ -1,6 +1,5 @@
1
1
  import { describe, it, expect, vi } from 'vitest'
2
2
  import { mount, shallowMount } from '@vue/test-utils'
3
-
4
3
  import Accordion from '../Accordion.vue'
5
4
  import { config } from '../config'
6
5
 
@@ -23,7 +22,7 @@ describe('Accordion', () => {
23
22
 
24
23
  it('renders correctly', () => {
25
24
  const wrapper = shallowMount(Accordion, {
26
- propsData: {
25
+ props: {
27
26
  items: defaultItems,
28
27
  headingLevel: 2,
29
28
  },
@@ -34,7 +33,7 @@ describe('Accordion', () => {
34
33
 
35
34
  it('renders the correct number of accordion items', () => {
36
35
  const wrapper = mount(Accordion, {
37
- propsData: {
36
+ props: {
38
37
  items: defaultItems,
39
38
  headingLevel: 2,
40
39
  },
@@ -47,7 +46,7 @@ describe('Accordion', () => {
47
46
  it('uses the correct heading level', () => {
48
47
  const headingLevel = 3
49
48
  const wrapper = mount(Accordion, {
50
- propsData: {
49
+ props: {
51
50
  items: defaultItems,
52
51
  headingLevel,
53
52
  },
@@ -59,7 +58,7 @@ describe('Accordion', () => {
59
58
 
60
59
  it('toggles content visibility when button is clicked', async () => {
61
60
  const wrapper = mount(Accordion, {
62
- propsData: {
61
+ props: {
63
62
  items: defaultItems,
64
63
  headingLevel: 2,
65
64
  },
@@ -82,7 +81,7 @@ describe('Accordion', () => {
82
81
 
83
82
  it('renders string content correctly', () => {
84
83
  const wrapper = mount(Accordion, {
85
- propsData: {
84
+ props: {
86
85
  items: [defaultItems[0]!],
87
86
  headingLevel: 2,
88
87
  },
@@ -97,7 +96,7 @@ describe('Accordion', () => {
97
96
 
98
97
  it('renders object content correctly', async () => {
99
98
  const wrapper = mount(Accordion, {
100
- propsData: {
99
+ props: {
101
100
  items: [defaultItems[2]!],
102
101
  headingLevel: 2,
103
102
  },
@@ -114,7 +113,7 @@ describe('Accordion', () => {
114
113
 
115
114
  it('has correct accessibility attributes', () => {
116
115
  const wrapper = mount(Accordion, {
117
- propsData: {
116
+ props: {
118
117
  items: defaultItems,
119
118
  headingLevel: 2,
120
119
  },
@@ -137,7 +136,7 @@ describe('Accordion', () => {
137
136
 
138
137
  it('updates aria-expanded attribute when toggled', async () => {
139
138
  const wrapper = mount(Accordion, {
140
- propsData: {
139
+ props: {
141
140
  items: defaultItems,
142
141
  headingLevel: 2,
143
142
  },
@@ -155,7 +154,7 @@ describe('Accordion', () => {
155
154
 
156
155
  it('applies focus style when accordion is opened', async () => {
157
156
  const wrapper = mount(Accordion, {
158
- propsData: {
157
+ props: {
159
158
  items: defaultItems,
160
159
  headingLevel: 2,
161
160
  },
@@ -185,7 +184,7 @@ describe('Accordion', () => {
185
184
  })
186
185
 
187
186
  const wrapper = mount(Accordion, {
188
- propsData: {
187
+ props: {
189
188
  items: defaultItems,
190
189
  headingLevel: 2,
191
190
  groupId: 'test-group',
@@ -209,7 +208,7 @@ describe('Accordion', () => {
209
208
 
210
209
  it('applies primary color to the title', () => {
211
210
  const wrapper = mount(Accordion, {
212
- propsData: {
211
+ props: {
213
212
  items: defaultItems,
214
213
  headingLevel: 2,
215
214
  },
@@ -224,7 +223,7 @@ describe('Accordion', () => {
224
223
 
225
224
  it('updates tabindex when accordion is opened', async () => {
226
225
  const wrapper = mount(Accordion, {
227
- propsData: {
226
+ props: {
228
227
  items: defaultItems,
229
228
  headingLevel: 2,
230
229
  },
@@ -246,7 +245,7 @@ describe('Accordion', () => {
246
245
 
247
246
  it('renders semantic content structure for accessibility', async () => {
248
247
  const wrapper = mount(Accordion, {
249
- propsData: {
248
+ props: {
250
249
  items: [
251
250
  { id: 'item1', title: 'Section 1', content: 'Contenu de la section 1' },
252
251
  {
@@ -300,7 +299,7 @@ describe('Accordion', () => {
300
299
  }
301
300
 
302
301
  const wrapper = mount(Accordion, {
303
- propsData: {
302
+ props: {
304
303
  items: defaultItems,
305
304
  headingLevel: 2,
306
305
  ...customOptions,
@@ -336,7 +335,7 @@ describe('Accordion', () => {
336
335
 
337
336
  it('uses default colors from config when no custom options are provided', () => {
338
337
  const wrapper = mount(Accordion, {
339
- propsData: {
338
+ props: {
340
339
  items: defaultItems,
341
340
  headingLevel: 2,
342
341
  },
@@ -363,7 +362,7 @@ describe('Accordion', () => {
363
362
 
364
363
  it('can open multiple accordions simultaneously', async () => {
365
364
  const wrapper = mount(Accordion, {
366
- propsData: {
365
+ props: {
367
366
  items: defaultItems,
368
367
  headingLevel: 2,
369
368
  },
@@ -387,7 +386,7 @@ describe('Accordion', () => {
387
386
 
388
387
  it('transfers focus correctly when clicking on different accordion items', async () => {
389
388
  const wrapper = mount(Accordion, {
390
- propsData: {
389
+ props: {
391
390
  items: defaultItems,
392
391
  headingLevel: 2,
393
392
  },
@@ -417,7 +416,7 @@ describe('Accordion', () => {
417
416
 
418
417
  // Monter le composant
419
418
  const wrapper = mount(Accordion, {
420
- propsData: {
419
+ props: {
421
420
  items: defaultItems,
422
421
  headingLevel: 2,
423
422
  },
@@ -435,4 +434,117 @@ describe('Accordion', () => {
435
434
  // Restaurer le spy
436
435
  removeEventListenerSpy.mockRestore()
437
436
  })
437
+
438
+ describe('v-model support', () => {
439
+ it('opens items specified in modelValue prop', () => {
440
+ const wrapper = mount(Accordion, {
441
+ props: {
442
+ items: defaultItems,
443
+ headingLevel: 2,
444
+ modelValue: ['item2'],
445
+ },
446
+ })
447
+
448
+ const contents = wrapper.findAll('.sy-accordion-content')
449
+ expect(contents[1]!.classes()).toContain('sy-accordion-content--open')
450
+ expect(contents[0]!.classes()).not.toContain('sy-accordion-content--open')
451
+ })
452
+
453
+ it('opens multiple items specified in modelValue', () => {
454
+ const wrapper = mount(Accordion, {
455
+ props: {
456
+ items: defaultItems,
457
+ headingLevel: 2,
458
+ modelValue: ['item1', 'item3'],
459
+ },
460
+ })
461
+
462
+ const contents = wrapper.findAll('.sy-accordion-content')
463
+ expect(contents[0]!.classes()).toContain('sy-accordion-content--open')
464
+ expect(contents[1]!.classes()).not.toContain('sy-accordion-content--open')
465
+ expect(contents[2]!.classes()).toContain('sy-accordion-content--open')
466
+ })
467
+
468
+ it('sets correct aria-expanded for pre-opened items', () => {
469
+ const wrapper = mount(Accordion, {
470
+ props: {
471
+ items: defaultItems,
472
+ headingLevel: 2,
473
+ modelValue: ['item1'],
474
+ },
475
+ })
476
+
477
+ const buttons = wrapper.findAll('.sy-accordion-button')
478
+ expect(buttons[0]!.attributes('aria-expanded')).toBe('true')
479
+ expect(buttons[1]!.attributes('aria-expanded')).toBe('false')
480
+ })
481
+
482
+ it('toggles an item and updates the DOM when clicked', async () => {
483
+ const wrapper = mount(Accordion, {
484
+ props: {
485
+ items: defaultItems,
486
+ headingLevel: 2,
487
+ modelValue: ['item1'],
488
+ },
489
+ })
490
+
491
+ // item1 is initially open
492
+ let contents = wrapper.findAll('.sy-accordion-content')
493
+ expect(contents[0]!.classes()).toContain('sy-accordion-content--open')
494
+
495
+ // Close item1
496
+ const firstButton = wrapper.find('.sy-accordion-button')
497
+ await firstButton.trigger('click')
498
+
499
+ contents = wrapper.findAll('.sy-accordion-content')
500
+ expect(contents[0]!.classes()).not.toContain('sy-accordion-content--open')
501
+ })
502
+
503
+ it('opens additional items while keeping existing ones open', async () => {
504
+ const wrapper = mount(Accordion, {
505
+ props: {
506
+ items: defaultItems,
507
+ headingLevel: 2,
508
+ modelValue: ['item1'],
509
+ },
510
+ })
511
+
512
+ // Open item2 as well
513
+ const buttons = wrapper.findAll('.sy-accordion-button')
514
+ await buttons[1]!.trigger('click')
515
+
516
+ const contents = wrapper.findAll('.sy-accordion-content')
517
+ expect(contents[0]!.classes()).toContain('sy-accordion-content--open')
518
+ expect(contents[1]!.classes()).toContain('sy-accordion-content--open')
519
+ })
520
+
521
+ it('defaults to no open items when no modelValue is provided', () => {
522
+ const wrapper = mount(Accordion, {
523
+ props: {
524
+ items: defaultItems,
525
+ headingLevel: 2,
526
+ modelValue: [],
527
+ },
528
+ })
529
+
530
+ const buttons = wrapper.findAll('.sy-accordion-button')
531
+ buttons.forEach((button) => {
532
+ expect(button.attributes('aria-expanded')).toBe('false')
533
+ })
534
+ })
535
+
536
+ it('sets correct tabindex on content region for pre-opened items', () => {
537
+ const wrapper = mount(Accordion, {
538
+ props: {
539
+ items: defaultItems,
540
+ headingLevel: 2,
541
+ modelValue: ['item1'],
542
+ },
543
+ })
544
+
545
+ const regions = wrapper.findAll('[role="region"]')
546
+ expect(regions[0]!.attributes('tabindex')).toBe('0')
547
+ expect(regions[1]!.attributes('tabindex')).toBe('-1')
548
+ })
549
+ })
438
550
  })
@@ -1,9 +1,11 @@
1
- import { Controls, Canvas, Meta } from '@storybook/blocks';
1
+ import { Controls, Canvas, Meta, Story } from '@storybook/blocks';
2
2
 
3
3
  import * as AmeliproPaginationStories from './AmeliproPagination.stories';
4
4
 
5
5
  <Meta of={AmeliproPaginationStories} />
6
6
 
7
+ <Story of={AmeliproPaginationStories.DeprecationNotice}/>
8
+
7
9
  # AmeliproPagination
8
10
 
9
11
  L’élément `Amelipropagination` est utilisé pour afficher des paginations
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
  import AmeliproPagination from './AmeliproPagination.vue'
3
+ import { createDeprecationNotice } from '@/stories/DeprecationNotice/DeprecationNotice'
3
4
 
4
5
  const meta = {
5
6
  argTypes: {
@@ -174,3 +175,10 @@ function onPageClick(page: number) {
174
175
  `,
175
176
  }),
176
177
  }
178
+
179
+ export const DeprecationNotice = {
180
+ ...createDeprecationNotice([
181
+ { label: 'SyPagination', url: '/?path=/docs/composants-navigation-sypagination--docs&globals=theme:ap' },
182
+ ]),
183
+ tags: ['!dev'],
184
+ }
@@ -1,15 +1,67 @@
1
- import { Meta, Story } from '@storybook/addon-docs';
1
+ import { Meta, Primary } from '@storybook/blocks';
2
2
  import * as Stories from '../BackBtn.stories.ts';
3
- import '@/stories/styles/shared.css';
3
+ import AccessibilityIcon from '@/common/imgs/accessibility-svgrepo-com.svg';
4
+ import {
5
+ AccessibilityGuideLayout,
6
+ CriteriaSection,
7
+ CriteriaCard,
8
+ DemoSection,
9
+ BestPracticesSection,
10
+ ResourcesSection,
11
+ } from '@/stories/accessibility/AccessibilityGuideLayout.mdx';
4
12
 
5
- <Meta of={Stories} />
13
+ <Meta of={Stories}/>
6
14
 
7
- <div className="header">
8
- <h1>Accessibilité</h1>
9
- </div>
15
+ <AccessibilityGuideLayout
16
+ componentName="BackBtn"
17
+ iconSrc={AccessibilityIcon}
18
+ apgHref="https://www.w3.org/WAI/ARIA/apg/patterns/button/"
19
+ >
20
+ <div class="mt-8">
21
+ <p>Rapport d’audit manuel : <a href="/audits/BackBtn.xlsx" style={{ color:'#0C41BD' }}>Voir le rapport</a></p>
22
+ <p style={{ color: 'grey', fontSize: '14px', marginTop: '0px' }}>Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system-v3/issues/4006" target="_blank" style={{color:'#0C41BD'}}>issue #4006</a>)</p>
23
+ </div>
10
24
 
25
+ <CriteriaSection>
26
+ <CriteriaCard icon="🔍" title="Structure sémantique et attributs">
27
+ <ul>
28
+ <li><strong>Rôle natif</strong> : Utilisation de l'élément <code>&lt;button&gt;</code> natif (via <code>VBtn</code>) pour un comportement sémantique correct par défaut.</li>
29
+ <li><strong>Icône décorative</strong> : L'icône de retour (si présente) est masquée aux lecteurs d'écran (<code>decorative=true</code>) pour éviter la redondance d'information avec le texte du bouton.</li>
30
+ </ul>
31
+ </CriteriaCard>
11
32
 
12
- <div class="mt-2">
13
- <p>Rapport d’audit manuel : <a href="/audits/BackBtn.xlsx" style={{ color:'#0C41BD' }}>Voir le rapport</a></p>
14
- <p style={{ color: 'grey', fontSize: '14px', marginTop: '0px' }}>Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system-v3/issues/4006" target="_blank" style={{color:'#0C41BD'}}>issue #4006</a>)</p>
15
- </div>
33
+ <CriteriaCard icon="⌨️" title="Navigation et interaction clavier">
34
+ <ul>
35
+ <li><strong>Focus natif</strong> : Le bouton est focusable via la touche <kbd>Tab</kbd> de manière naturelle.</li>
36
+ <li><strong>Activation</strong> : Le bouton peut être activé avec les touches <kbd>Entrée</kbd> ou <kbd>Espace</kbd>.</li>
37
+ <li><strong>Indicateur de focus</strong> : Un style de focus clair et visible (<code>:focus-visible</code>) est implémenté pour garantir que les utilisateurs naviguant au clavier savent quel élément est actif.</li>
38
+ </ul>
39
+ </CriteriaCard>
40
+
41
+ <CriteriaCard icon="🎨" title="Styles et contrastes">
42
+ <ul>
43
+ <li><strong>Contrastes garantis</strong> : Couleurs de texte adaptées ("primary" ou "white") selon le thème clair ou sombre (<code>dark</code>) pour répondre aux critères WCAG de contraste.</li>
44
+ <li><strong>États distincts</strong> : Apparence distincte entre le mode clair (bouton texte) et sombre (bouton contour) tout en maintenant l'accessibilité visuelle.</li>
45
+ </ul>
46
+ </CriteriaCard>
47
+ </CriteriaSection>
48
+
49
+ <DemoSection componentName="BackBtn">
50
+ <Primary />
51
+ </DemoSection>
52
+
53
+ <BestPracticesSection>
54
+ <ul>
55
+ <li><strong>Texte descriptif</strong> : Assurez-vous que le texte du bouton explique clairement l'action (par ex. "Retour à la page précédente" plutôt que juste "Retour") si le contexte n'est pas explicite.</li>
56
+ <li><strong>Cohérence de placement</strong> : Placez le bouton de retour à un endroit prévisible et constant sur vos différentes pages (généralement en haut à gauche).</li>
57
+ <li>Ne surchargez pas le bouton avec des attributs <code>aria-label</code> si le texte affiché à l'écran est déjà suffisamment clair.</li>
58
+ </ul>
59
+ </BestPracticesSection>
60
+
61
+ <ResourcesSection>
62
+ <ul>
63
+ <li><a href="https://www.w3.org/WAI/ARIA/apg/patterns/button/" target="_blank" rel="noopener noreferrer">Guide des pratiques WAI-ARIA : Boutons</a></li>
64
+ <li><a href="https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.1" target="_blank" rel="noopener noreferrer">RGAA : Formulaires et boutons</a></li>
65
+ </ul>
66
+ </ResourcesSection>
67
+ </AccessibilityGuideLayout>
@@ -92,7 +92,7 @@ type Story = StoryObj<typeof meta>
92
92
  export const Default: Story = {
93
93
  parameters: {
94
94
  a11y: {
95
- disable: true,
95
+ disable: false,
96
96
  },
97
97
  sourceCode: [
98
98
  {
@@ -104,6 +104,7 @@ export const Default: Story = {
104
104
  max-height="200px"
105
105
  class="overflow-y-auto"
106
106
  style="scroll-behavior: smooth"
107
+ tabindex="0"
107
108
  >
108
109
  <VSheet
109
110
  height="600px"
@@ -166,6 +167,7 @@ export const Default: Story = {
166
167
  max-height="200px"
167
168
  class="overflow-y-auto"
168
169
  style="scroll-behavior: smooth"
170
+ tabindex="0"
169
171
  >
170
172
  <VSheet
171
173
  height="600px"
@@ -192,7 +194,7 @@ export const Default: Story = {
192
194
  export const Customization: Story = {
193
195
  parameters: {
194
196
  a11y: {
195
- disable: true,
197
+ disable: false,
196
198
  },
197
199
  sourceCode: [
198
200
  {
@@ -204,6 +206,7 @@ export const Customization: Story = {
204
206
  max-height="200px"
205
207
  class="overflow-y-auto"
206
208
  style="scroll-behavior: smooth"
209
+ tabindex="0"
207
210
  >
208
211
  <VSheet
209
212
  height="600px"
@@ -276,6 +279,7 @@ export const Customization: Story = {
276
279
  max-height="200px"
277
280
  class="overflow-y-auto"
278
281
  style="scroll-behavior: smooth"
282
+ tabindex="0"
279
283
  >
280
284
  <VSheet
281
285
  height="600px"
@@ -302,7 +306,7 @@ export const Customization: Story = {
302
306
  export const CustomPosition: Story = {
303
307
  parameters: {
304
308
  a11y: {
305
- disable: true,
309
+ disable: false,
306
310
  },
307
311
  sourceCode: [
308
312
  {
@@ -314,6 +318,7 @@ export const CustomPosition: Story = {
314
318
  max-height="200px"
315
319
  class="overflow-y-auto"
316
320
  style="scroll-behavior: smooth"
321
+ tabindex="0"
317
322
  >
318
323
  <VSheet
319
324
  height="600px"
@@ -386,6 +391,7 @@ export const CustomPosition: Story = {
386
391
  max-height="200px"
387
392
  class="overflow-y-auto"
388
393
  style="scroll-behavior: smooth"
394
+ tabindex="0"
389
395
  >
390
396
  <VSheet
391
397
  height="600px"
@@ -1,15 +1,95 @@
1
1
  import { Meta, Story } from '@storybook/addon-docs';
2
2
  import * as Stories from '../BackToTopBtn.stories.ts';
3
+ import AccessibilityIcon from '@/common/imgs/accessibility-svgrepo-com.svg';
3
4
  import '@/stories/styles/shared.css';
5
+ import {
6
+ AccessibilityGuideLayout,
7
+ CriteriaSection,
8
+ CriteriaCard,
9
+ DemoSection,
10
+ BestPracticesSection,
11
+ ResourcesSection,
12
+ } from '@/stories/accessibility/AccessibilityGuideLayout.mdx';
4
13
 
5
14
  <Meta of={Stories} />
6
15
 
7
- <div className="header">
8
- <h1>Accessibilité</h1>
9
- </div>
10
-
16
+ <AccessibilityGuideLayout
17
+ componentName="BackToTopBtn"
18
+ iconSrc={AccessibilityIcon}
19
+ apgHref="https://www.w3.org/WAI/ARIA/apg/patterns/button/"
20
+ apgLabel="WAI-ARIA Authoring Practices pour les boutons"
21
+ >
11
22
 
12
23
  <div class="mt-2">
13
- <p>Rapport daudit manuel : <a href="/audits/BackToTopBtn.xlsx" style={{ color:'#0C41BD' }}>Voir le rapport</a></p>
14
- <p style={{ color: 'grey', fontSize: '14px', marginTop: '0px' }}>Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system-v3/issues/4022" target="_blank" style={{color:'#0C41BD'}}>issue #4022</a>)</p>
24
+ <p>Rapport d'audit manuel : <a href="/audits/BackToTopBtn.xlsx" style={{ color:'#0C41BD' }}>Voir le rapport</a></p>
25
+ <p style={{ color: 'grey', fontSize: '14px', marginTop: '0px' }}>Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system-v3/issues/4022" target="_blank" style={{color:'#0C41BD'}}>issue #4022</a>)</p>
15
26
  </div>
27
+
28
+ <CriteriaSection>
29
+ <CriteriaCard icon="⌨️" title="Navigation au clavier">
30
+ <ul>
31
+ <li><strong>Accessibilité native</strong> : Le bouton est un élément focusable via la touche Tab</li>
32
+ <li><strong>Activation clavier</strong> : Peut être activé avec les touches Entrée et Espace</li>
33
+ <li><strong>Focus visible</strong> : Indicateur de focus clair pour les utilisateurs du clavier</li>
34
+ <li><strong>Positionnement cohérent</strong> : Le bouton reste toujours accessible et n'interfère pas avec la navigation</li>
35
+ </ul>
36
+ </CriteriaCard>
37
+
38
+ <CriteriaCard icon="🔊" title="Lecteurs d'écran">
39
+ <ul>
40
+ <li><strong>Texte descriptif</strong> : Le bouton contient un texte clair indiquant sa fonction ("Retour en haut")</li>
41
+ <li><strong>Icône décorative</strong> : L'icône flèche est marquée comme décorative pour éviter la redondance</li>
42
+ <li><strong>Annonce sémantique</strong> : La fonction du bouton est clairement annoncée par les technologies d'assistance</li>
43
+ </ul>
44
+ </CriteriaCard>
45
+
46
+ <CriteriaCard icon="📱" title="Adaptation responsive">
47
+ <ul>
48
+ <li><strong>Mode mobile</strong> : Le texte est masqué visuellement sur mobile (screen reader only)</li>
49
+ <li><strong>Taille minimale</strong> : Le bouton maintient une taille de 36px minimum sur mobile pour le toucher</li>
50
+ <li><strong>Positionnement optimisé</strong> : Le positionnement s'adapte aux différentes tailles d'écran</li>
51
+ <li><strong>Comportement cohérent</strong> : La fonctionnalité reste identique quel que soit l'appareil utilisé</li>
52
+ </ul>
53
+ </CriteriaCard>
54
+
55
+ <CriteriaCard icon="🎯" title="Critères RGAA respectés">
56
+ <ul>
57
+ <li><strong>Critère 7.1</strong> : Chaque script est compatible avec les technologies d'assistance</li>
58
+ <li><strong>Critère 7.3</strong> : Chaque script est contrôlable par le clavier et par tout dispositif de pointage</li>
59
+ <li><strong>Critère 11.2</strong> : Chaque conteneur d'informations possède une balise permettant de le rendre accessible</li>
60
+ <li><strong>Critère 12.4</strong> : Chaque texte est lisible lorsque la taille des caractères est modifiée</li>
61
+ </ul>
62
+ </CriteriaCard>
63
+ </CriteriaSection>
64
+
65
+ <DemoSection>
66
+ <p>
67
+ Explorez ci-dessous un exemple de BackToTopBtn entièrement accessible.
68
+ Essayez de modifier les propriétés pour voir comment le composant s'adapte.
69
+ </p>
70
+ <Story of={Stories.Default} />
71
+ </DemoSection>
72
+
73
+ <BestPracticesSection>
74
+ <ul>
75
+ <li><strong>Rendre les conteneurs accessibles</strong> : Ajouter <code>tabindex="0"</code> sur les conteneurs scrollables pour permettre l'accès au clavier</li>
76
+ <li><strong>Choisir le bon seuil</strong> : Utiliser un threshold raisonnable (100-200px) pour éviter que le bouton n'apparaisse trop tôt</li>
77
+ <li><strong>Positionnement cohérent</strong> : Maintenir une position cohérente du bouton pour ne pas dérouter les utilisateurs</li>
78
+ <li><strong>Texte clair et concis</strong> : Utiliser un texte descriptif mais court pour le bouton (ex: "Retour en haut", "Haut de page")</li>
79
+ <li><strong>Contraste suffisant</strong> : S'assurer que le bouton a un contraste suffisant avec l'arrière-plan dans tous les thèmes</li>
80
+ <li><strong>Ne pas surcharger</strong> : Éviter d'utiliser plusieurs boutons de retour en haut sur la même page</li>
81
+ <li><strong>Test mobile</strong> : Vérifier que le bouton reste facilement accessible sur les écrans tactiles</li>
82
+ </ul>
83
+ </BestPracticesSection>
84
+
85
+ <ResourcesSection>
86
+ <ul>
87
+ <li><a href="https://www.w3.org/WAI/WCAG21/Understanding/keyboard.html" target="_blank" rel="noopener noreferrer">WCAG 2.1 - Keyboard Accessibility</a> - Guide complet sur l'accessibilité au clavier</li>
88
+ <li><a href="https://www.w3.org/WAI/ARIA/apg/patterns/button/" target="_blank" rel="noopener noreferrer">ARIA Authoring Practices - Button Pattern</a> - Bonnes pratiques pour les boutons accessibles</li>
89
+ <li><a href="https://rgaa_numerique.gitbook.io/rgaa-accessibilite/criteres-techniques/" target="_blank" rel="noopener noreferrer">Référentiel Général d'Amélioration de l'Accessibilité (RGAA)</a> - Critères techniques français</li>
90
+ <li><a href="https://web.dev/focus-visible/" target="_blank" rel="noopener noreferrer">Focus Visible Best Practices</a> - Guide sur les indicateurs de focus visibles</li>
91
+ <li><a href="https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html" target="_blank" rel="noopener noreferrer">WCAG Understanding Focus Visible</a> - Comprendre l'exigence de focus visible</li>
92
+ </ul>
93
+ </ResourcesSection>
94
+
95
+ </AccessibilityGuideLayout>
@@ -1,8 +1,6 @@
1
1
  import { describe, it, expect, vi, afterEach } from 'vitest'
2
2
  import { mount } from '@vue/test-utils'
3
-
4
3
  import Captcha from '../Captcha.vue'
5
- import { vuetify } from '@tests/unit/setup'
6
4
 
7
5
  describe('Captcha', () => {
8
6
  afterEach(() => {
@@ -18,9 +16,6 @@ describe('Captcha', () => {
18
16
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
19
17
 
20
18
  const wrapper = mount(Captcha, {
21
- global: {
22
- plugins: [vuetify],
23
- },
24
19
  props: {
25
20
  urlCreate: '/captcha/captcha.json',
26
21
  urlGetImage: '/captcha/captcha.png',
@@ -60,9 +55,6 @@ describe('Captcha', () => {
60
55
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
61
56
 
62
57
  const wrapper = mount(Captcha, {
63
- global: {
64
- plugins: [vuetify],
65
- },
66
58
  props: {
67
59
  urlCreate: '/captcha/captcha.json',
68
60
  urlGetImage: '/captcha/captcha.png',
@@ -101,9 +93,6 @@ describe('Captcha', () => {
101
93
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
102
94
 
103
95
  const wrapper = mount(Captcha, {
104
- global: {
105
- plugins: [vuetify],
106
- },
107
96
  props: {
108
97
  urlCreate: '/captcha/captcha.json',
109
98
  urlGetImage: '/captcha/captcha.png',
@@ -124,9 +113,6 @@ describe('Captcha', () => {
124
113
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
125
114
 
126
115
  const wrapper = mount(Captcha, {
127
- global: {
128
- plugins: [vuetify],
129
- },
130
116
  props: {
131
117
  urlCreate: '/captcha/captcha.json',
132
118
  urlGetImage: '/captcha/captcha.png',
@@ -163,9 +149,6 @@ describe('Captcha', () => {
163
149
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
164
150
 
165
151
  const wrapper = mount(Captcha, {
166
- global: {
167
- plugins: [vuetify],
168
- },
169
152
  props: {
170
153
  urlCreate: '/captcha/captcha.json',
171
154
  urlGetImage: '/captcha/captcha.png',
@@ -193,9 +176,6 @@ describe('Captcha', () => {
193
176
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
194
177
 
195
178
  const wrapper = mount(Captcha, {
196
- global: {
197
- plugins: [vuetify],
198
- },
199
179
  props: {
200
180
  urlCreate: '/captcha/captcha.json',
201
181
  urlGetImage: '/captcha/captcha.png',
@@ -221,9 +201,6 @@ describe('Captcha', () => {
221
201
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
222
202
 
223
203
  const wrapper = mount(Captcha, {
224
- global: {
225
- plugins: [vuetify],
226
- },
227
204
  props: {
228
205
  urlCreate: '/captcha/captcha.json',
229
206
  urlGetImage: '/captcha/captcha.png',
@@ -251,9 +228,6 @@ describe('Captcha', () => {
251
228
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
252
229
 
253
230
  const wrapper = mount(Captcha, {
254
- global: {
255
- plugins: [vuetify],
256
- },
257
231
  props: {
258
232
  urlCreate: '/captcha/captcha.json',
259
233
  urlGetImage: '/captcha/captcha.png',
@@ -278,9 +252,6 @@ describe('Captcha', () => {
278
252
  vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response))
279
253
 
280
254
  const wrapper = mount(Captcha, {
281
- global: {
282
- plugins: [vuetify],
283
- },
284
255
  props: {
285
256
  urlCreate: '/captcha/captcha.json',
286
257
  urlGetImage: '/captcha/captcha.png',