@cnamts/synapse 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AutocompleteFilter-BWLR3U7W.js +114 -0
- package/dist/AutocompleteFilter-D9jzRzAL.cjs +1 -0
- package/dist/{DateFilter-B5n-ZkLi.js → DateFilter-BpwFexzi.js} +1 -1
- package/dist/DateFilter-DTUl8hb1.cjs +1 -0
- package/dist/{NumberFilter-CtiZ9uj8.js → NumberFilter-Bz_NTdX9.js} +3 -3
- package/dist/NumberFilter-MAEojdk0.cjs +1 -0
- package/dist/PeriodFilter-CC4WgIhl.cjs +1 -0
- package/dist/{PeriodFilter-DzqiMb-b.js → PeriodFilter-DX_wy9g-.js} +1 -1
- package/dist/SelectFilter-BR3fvl-a.cjs +1 -0
- package/dist/SelectFilter-xqiPtPgX.js +135 -0
- package/dist/{TextFilter-BOFRNfcX.js → TextFilter-BBl3JFqK.js} +7 -7
- package/dist/TextFilter-CCfYFl5F.cjs +1 -0
- package/dist/apLightTheme-CFSRrjv2.cjs +1 -0
- package/dist/apLightTheme-D1P4jcD0.js +1231 -0
- package/dist/components/Accordion/Accordion.d.ts +13 -2
- package/dist/components/Accordion/composables/useAccordionState.d.ts +2 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +7022 -9616
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +40 -40
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +61 -61
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +7168 -9762
- package/dist/components/Amelipro/AmeliproStepper/AmeliproStepper.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +7506 -10100
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +22 -22
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +42 -42
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +2 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +20 -498
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +130 -147
- package/dist/components/Customs/Selects/SyAutocomplete/locales.d.ts +5 -0
- package/dist/components/Customs/Selects/SyInputSelect/SyInputSelect.d.ts +6 -6
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +13 -17
- package/dist/components/Customs/Selects/SySelect/locales.d.ts +1 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +9 -9
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +29 -507
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +29 -507
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +64 -81
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +640 -780
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +322 -407
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +114 -156
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerFocusTrap.d.ts +11 -0
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +4 -4
- package/dist/components/DatePicker/composables/useDateValidation.d.ts +3 -3
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +2 -2
- package/dist/components/DatePicker/composables/useManualDateValidation.d.ts +2 -2
- package/dist/components/ErrorPage/ErrorPage.d.ts +3 -1
- package/dist/components/FileList/UploadItem/UploadItem.d.ts +6 -0
- package/dist/components/FileList/UploadItem/locales.d.ts +1 -4
- package/dist/components/FileUpload/FileUploadContent.d.ts +2 -0
- package/dist/components/FileUpload/validateFiles.d.ts +2 -1
- package/dist/components/HeaderBar/HeaderBar.d.ts +2 -1
- package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +2 -1
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +6 -5
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +20 -28
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +3 -3
- package/dist/components/MonthPicker/MonthPicker.d.ts +1903 -0
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +1863 -0
- package/dist/components/MonthPicker/MonthPickerText/useTextField.d.ts +21 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.d.ts +21 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.d.ts +12 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthSelector.d.ts +11 -0
- package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.d.ts +6 -0
- package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.d.ts +14 -0
- package/dist/components/MonthPicker/MonthPickerVisual/YearSelector.d.ts +14 -0
- package/dist/components/MonthPicker/MonthPickerVisual/useMonthGrid.d.ts +9 -0
- package/dist/components/MonthPicker/MonthPickerVisual/useYearGrid.d.ts +8 -0
- package/dist/components/MonthPicker/MonthPickerVisual/utils.d.ts +8 -0
- package/dist/components/MonthPicker/locales.d.ts +12 -0
- package/dist/components/MonthPicker/useMonthPickerValidation.d.ts +25 -0
- package/dist/components/NirField/NirField.d.ts +209 -271
- package/dist/components/NirField/locales.d.ts +10 -10
- package/dist/components/NirField/useNirValidation.d.ts +64 -0
- package/dist/components/NotificationBar/Notification/Notification.d.ts +3 -0
- package/dist/components/PasswordField/PasswordField.d.ts +9 -10
- package/dist/components/PeriodField/PeriodField.d.ts +1379 -1659
- package/dist/components/PhoneField/PhoneField.d.ts +90 -125
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +12 -12
- package/dist/components/SyBtnMenu/SyBtnMenu.d.ts +1 -1
- package/dist/components/SyHeading/SyHeading.a11y.test.d.ts +1 -0
- package/dist/components/SyHeading/SyHeading.d.ts +4 -2
- package/dist/components/SyHeading/SyHeading.test.d.ts +1 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +35 -15
- package/dist/components/SyTextArea/useDefaultValidationRules.d.ts +11 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +11 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +11 -8
- package/dist/components/Tables/common/SyTableFilter.d.ts +2 -3
- package/dist/components/Tables/common/SyTablePagination.d.ts +21 -23
- package/dist/components/Tables/common/filters/AutocompleteFilter.d.ts +120 -0
- package/dist/components/Tables/common/filters/locales.d.ts +0 -1
- package/dist/components/Tables/common/types.d.ts +19 -3
- package/dist/components/Tables/common/useClickableTableRow.d.ts +17 -0
- package/dist/components/Tables/common/usePagination.d.ts +3 -1
- package/dist/components/Tables/common/usePinnedColumns.d.ts +31 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +2 -0
- package/dist/components/Tables/common/useTableRowCheckboxAccessibility.d.ts +5 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +6 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/date/useDatePickerAccessibility.d.ts +1 -1
- package/dist/composables/rules/useFieldValidation.d.ts +4 -4
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +8 -0
- package/dist/composables/unifyValidation/useValidation.d.ts +102 -0
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +18 -0
- package/dist/composables/useFormFieldErrorHandling.d.ts +2 -2
- package/dist/composables/validation/useFormValidation.d.ts +11 -2
- package/dist/composables/validation/useValidation.d.ts +15 -9
- package/dist/design-system-v3.d.ts +2 -0
- package/dist/design-system-v3.js +196 -194
- package/dist/design-system-v3.umd.cjs +1 -1066
- package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +5 -0
- package/dist/{main-CEl4J8_T.js → main-BtTqyn4z.js} +16983 -15576
- package/dist/main-C1e3eoxd.cjs +1067 -0
- package/dist/synapse.css +1 -0
- package/dist/tooth-11-D3sLWv2n.cjs +1 -0
- package/dist/tooth-12-CXrLuH03.cjs +1 -0
- package/dist/tooth-13-BSfo5fpT.cjs +1 -0
- package/dist/tooth-14-DMzulx0h.cjs +1 -0
- package/dist/tooth-15-BKRFVi-9.cjs +1 -0
- package/dist/tooth-16-CpuxAbuM.cjs +1 -0
- package/dist/tooth-17-BPoahUdg.cjs +1 -0
- package/dist/tooth-18-DhHJz8sy.cjs +1 -0
- package/dist/tooth-21-Dgd5hn_X.cjs +1 -0
- package/dist/tooth-22-C2Tn19sB.cjs +1 -0
- package/dist/tooth-23-C9uaaSGb.cjs +1 -0
- package/dist/tooth-24-BrK9UGpf.cjs +1 -0
- package/dist/tooth-25-CE_EfGNp.cjs +1 -0
- package/dist/tooth-26-Ctv4i9Fy.cjs +1 -0
- package/dist/tooth-27-C5J7JkWM.cjs +1 -0
- package/dist/tooth-28-Z9oWqjo0.cjs +1 -0
- package/dist/tooth-31-BrYqmkTi.cjs +1 -0
- package/dist/tooth-32-BNNR0oCZ.cjs +1 -0
- package/dist/tooth-33-DuxvqO2J.cjs +1 -0
- package/dist/tooth-34-BCSCXMB6.cjs +1 -0
- package/dist/tooth-35-BLUXkX88.cjs +1 -0
- package/dist/tooth-36-IrKHYqlA.cjs +1 -0
- package/dist/tooth-37-BYqpdMwo.cjs +1 -0
- package/dist/tooth-38-B_eNXXdu.cjs +1 -0
- package/dist/tooth-41-Ddva4Ot8.cjs +1 -0
- package/dist/tooth-42-szcDqlM0.cjs +1 -0
- package/dist/tooth-43-B3ka6rQm.cjs +1 -0
- package/dist/tooth-44-CazyQucj.cjs +1 -0
- package/dist/tooth-45-B4HQtc8n.cjs +1 -0
- package/dist/tooth-46-BPM40gbG.cjs +1 -0
- package/dist/tooth-47-Dvr20dlh.cjs +1 -0
- package/dist/tooth-48-Bd8ljGsF.cjs +1 -0
- package/dist/tooth-51-OBpwCOF3.cjs +1 -0
- package/dist/tooth-52-aKxyHcmq.cjs +1 -0
- package/dist/tooth-53-vCwJjTOc.cjs +1 -0
- package/dist/tooth-54-DsWu2iFy.cjs +1 -0
- package/dist/tooth-55-BxC1X2Dn.cjs +1 -0
- package/dist/tooth-61-BbLvxMQi.cjs +1 -0
- package/dist/tooth-62-CmTkWczP.cjs +1 -0
- package/dist/tooth-63-DI7l_2qI.cjs +1 -0
- package/dist/tooth-64-B21sOsJh.cjs +1 -0
- package/dist/tooth-65-D2ZC2VEr.cjs +1 -0
- package/dist/tooth-71-D473PPO5.cjs +1 -0
- package/dist/tooth-72-Drh1wnNu.cjs +1 -0
- package/dist/tooth-73-DzlwYI23.cjs +1 -0
- package/dist/tooth-74-8aGvcZPg.cjs +1 -0
- package/dist/tooth-75-BFK7At_r.cjs +1 -0
- package/dist/tooth-81-BZmR-I0M.cjs +1 -0
- package/dist/tooth-82-euVfUUZV.cjs +1 -0
- package/dist/tooth-83-KV010j64.cjs +1 -0
- package/dist/tooth-84-BBg1RjhZ.cjs +1 -0
- package/dist/tooth-85-Cr-kc1wM.cjs +1 -0
- package/dist/vuetifyConfig.js +561 -0
- package/dist/vuetifyConfig.umd.cjs +1 -0
- package/package.json +18 -6
- package/src/assets/apTokens.scss +2 -2
- package/src/assets/overrides/_btns.scss +2 -0
- package/src/assets/overrides/_forms.scss +9 -0
- package/src/assets/overrides/_icons.scss +41 -4
- package/src/assets/overrides/_tables.scss +19 -0
- package/src/assets/overrides/_typography.scss +0 -10
- package/src/components/Accordion/Accordion.mdx +23 -9
- package/src/components/Accordion/Accordion.stories.ts +153 -3
- package/src/components/Accordion/Accordion.vue +7 -6
- package/src/components/Accordion/composables/__tests__/useAccordionState.spec.ts +40 -12
- package/src/components/Accordion/composables/useAccordionState.ts +3 -4
- package/src/components/Accordion/tests/accordion.spec.ts +131 -19
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.mdx +3 -1
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.stories.ts +8 -0
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +2 -2
- package/src/components/BackBtn/accessibilite/Accessibility.mdx +62 -10
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +9 -3
- package/src/components/BackToTopBtn/accessibilite/Accessibility.mdx +86 -6
- package/src/components/Captcha/accessibilite/Accessibility.mdx +86 -8
- package/src/components/Captcha/tests/Captcha.spec.ts +0 -29
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +14 -122
- package/src/components/ChipList/ChipList.stories.ts +0 -15
- package/src/components/ChipList/ChipList.vue +5 -1
- package/src/components/ChipList/accessibilite/Accessibility.mdx +83 -10
- package/src/components/ChipList/tests/ChipList.a11y.spec.ts +41 -0
- package/src/components/Customs/Selects/SelectBtnField/accessibilite/Accessibility.mdx +124 -10
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +379 -93
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +162 -84
- package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibilite.stories.ts +40 -1
- package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibility.mdx +7 -1
- package/src/components/Customs/Selects/SyAutocomplete/locales.ts +5 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +96 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +377 -9
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +27 -13
- package/src/components/Customs/Selects/SyAutocomplete/utils/useSelectionLogic.ts +9 -10
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.stories.ts +4 -4
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +8 -9
- package/src/components/Customs/Selects/SyInputSelect/tests/SyInputSelect.spec.ts +10 -10
- package/src/components/Customs/Selects/SySelect/SySelect.vue +60 -14
- package/src/components/Customs/Selects/SySelect/locales.ts +1 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +54 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +6 -9
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +10 -16
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +16 -11
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +35 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.a11y.spec.ts +134 -2
- package/src/components/Customs/SyForm/SyForm.stories.ts +31 -5
- package/src/components/Customs/SyIcon/SyIcon.vue +1 -1
- package/src/components/Customs/SyIcon/tests/SyIcon.a11y.spec.ts +20 -0
- package/src/components/Customs/SyIconButton/SyIconButton.mdx +46 -0
- package/src/components/Customs/SyIconButton/SyIconButton.stories.ts +184 -0
- package/src/components/Customs/SyIconButton/SyIconButton.vue +38 -0
- package/src/components/Customs/SyIconButton/accessibilite/Accessibility.mdx +64 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.a11y.spec.ts +87 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.spec.ts +152 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/SyIconButton.spec.ts.snap +61 -0
- package/src/components/Customs/SyPagination/SyPagination.vue +5 -5
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +4 -7
- package/src/components/Customs/SyTextField/SyTextField.mdx +1 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +29 -27
- package/src/components/Customs/SyTextField/SyTextField.vue +174 -159
- package/src/components/Customs/SyTextField/accessibilite/Accessibility.mdx +67 -9
- package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +47 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +155 -10
- package/src/components/DataList/accessibilite/Accessibility.mdx +79 -11
- package/src/components/DataListGroup/accessibilite/Accessibility.mdx +80 -11
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +62 -58
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +330 -223
- package/src/components/DatePicker/CalendarMode/accessibilite/Accessibility.mdx +82 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +141 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +2 -56
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +195 -159
- package/src/components/DatePicker/ComplexDatePicker/accessibilite/Accessibility.mdx +76 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +10 -10
- package/src/components/DatePicker/DatePickerValidationExample/CalendarMode.stories.ts +8 -8
- package/src/components/DatePicker/DatePickerValidationExample/ComplexDatePicker.stories.ts +106 -8
- package/src/components/DatePicker/DatePickerValidationExample/DateTextInput.stories.ts +12 -11
- package/src/components/DatePicker/DatePickerValidationExample/MultiMode.stories.ts +12 -12
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +0 -12
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +63 -57
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +3 -0
- package/src/components/DatePicker/DateTextInput/accessibilite/Accessibility.mdx +66 -0
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +52 -1
- package/src/components/DatePicker/composables/index.ts +1 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +109 -65
- package/src/components/DatePicker/composables/tests/useDatePickerFocusTrap.spec.ts +138 -0
- package/src/components/DatePicker/composables/tests/useDateValidation.spec.ts +74 -18
- package/src/components/DatePicker/composables/tests/useInputBlurHandler.spec.ts +39 -0
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +91 -0
- package/src/components/DatePicker/composables/useCalendarKeyboardNavigation.ts +442 -36
- package/src/components/DatePicker/composables/useDatePickerFocusTrap.ts +92 -0
- package/src/components/DatePicker/composables/useDateTextField.ts +7 -6
- package/src/components/DatePicker/composables/useDateValidation.ts +36 -35
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +3 -3
- package/src/components/DatePicker/composables/useManualDateValidation.ts +6 -2
- package/src/components/DiacriticPicker/accessibilite/Accessibility.mdx +76 -8
- package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +25 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +113 -19
- package/src/components/ErrorPage/ErrorPage.vue +17 -2
- package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +17 -0
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +21 -1
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +0 -1
- package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +23 -0
- package/src/components/FileList/FileList.stories.ts +51 -1
- package/src/components/FileList/UploadItem/UploadItem.vue +13 -6
- package/src/components/FileList/UploadItem/locales.ts +3 -12
- package/src/components/FileList/accessibilite/Accessibility.mdx +3 -0
- package/src/components/FileUpload/FileUpload.vue +2 -1
- package/src/components/FileUpload/FileUploadContent.vue +2 -1
- package/src/components/FileUpload/tests/FileUpload.spec.ts +47 -0
- package/src/components/FileUpload/validateFiles.ts +5 -2
- package/src/components/FranceConnectBtn/accessibilite/Accessibility.mdx +62 -9
- package/src/components/HeaderBar/HeaderBar.stories.ts +14 -2
- package/src/components/HeaderBar/HeaderBar.vue +2 -1
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -1
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
- package/src/components/Logo/accessibilite/Accessibility.mdx +73 -11
- package/src/components/LogoBrandSection/accessibilite/Accessibility.mdx +85 -9
- package/src/components/LunarCalendar/accessibilite/Accessibility.mdx +74 -8
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +163 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.spec.ts +3 -1
- package/src/components/LunarCalendar/useLunarCalendarValidation.ts +4 -5
- package/src/components/MaintenancePage/MaintenancePage.vue +1 -1
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +4 -5
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +0 -1
- package/src/components/MonthPicker/MonthPicker.mdx +35 -0
- package/src/components/MonthPicker/MonthPicker.stories.ts +527 -0
- package/src/components/MonthPicker/MonthPicker.vue +79 -0
- package/src/components/MonthPicker/MonthPickerText/MonthPickerInput.vue +89 -0
- package/src/components/MonthPicker/MonthPickerText/useTextField.ts +27 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.vue +154 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.ts +13 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +137 -0
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +60 -0
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +149 -0
- package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +143 -0
- package/src/components/MonthPicker/MonthPickerVisual/useMonthGrid.ts +45 -0
- package/src/components/MonthPicker/MonthPickerVisual/useYearGrid.ts +45 -0
- package/src/components/MonthPicker/MonthPickerVisual/utils.ts +17 -0
- package/src/components/MonthPicker/accessibilite/Accessibility.mdx +59 -0
- package/src/components/MonthPicker/locales.ts +12 -0
- package/src/components/MonthPicker/tests/MonthPicker.a11y.spec.ts +71 -0
- package/src/components/MonthPicker/tests/MonthPicker.spec.ts +1249 -0
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +2545 -0
- package/src/components/MonthPicker/useMonthPickerValidation.ts +30 -0
- package/src/components/NirField/NirField.mdx +1 -2
- package/src/components/NirField/NirField.stories.ts +70 -6
- package/src/components/NirField/NirField.vue +64 -260
- package/src/components/NirField/accessibilite/Accessibility.mdx +2 -2
- package/src/components/NirField/locales.ts +1 -1
- package/src/components/NirField/tests/NirField.spec.ts +6 -0
- package/src/components/NirField/useNirValidation.ts +271 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +2 -3
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +22 -14
- package/src/components/NotificationBar/Notification/Notification.vue +3 -1
- package/src/components/NotificationBar/NotificationBar.stories.ts +154 -0
- package/src/components/NotificationBar/tests/NotificationBar.a11y.spec.ts +26 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +60 -0
- package/src/components/PasswordField/PasswordField.stories.ts +4 -4
- package/src/components/PasswordField/PasswordField.vue +18 -24
- package/src/components/PasswordField/tests/PasswordField.spec.ts +6 -3
- package/src/components/PeriodField/PeriodField.stories.ts +4 -4
- package/src/components/PeriodField/PeriodField.vue +57 -57
- package/src/components/PeriodField/__tests__/PeriodField.async.spec.ts +32 -0
- package/src/components/PeriodField/accessibilite/Accessibility.mdx +68 -8
- package/src/components/PeriodField/tests/PeriodField.spec.ts +28 -2
- package/src/components/PhoneField/PhoneField.vue +5 -6
- package/src/components/PhoneField/tests/PhoneField.spec.ts +1 -0
- package/src/components/RangeField/RangeField.vue +6 -0
- package/src/components/RangeField/accessibilite/Accessibility.mdx +79 -11
- package/src/components/SkipLink/tests/SkipLink.a11y.spec.ts +23 -0
- package/src/components/StatusPage/StatusPage.stories.ts +118 -0
- package/src/components/StatusPage/StatusPage.vue +5 -3
- package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +22 -0
- package/src/components/StatusPage/tests/StatusPage.spec.ts +22 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +22 -14
- package/src/components/SubHeader/tests/SubHeader.a11y.spec.ts +20 -0
- package/src/components/SyAlert/SyAlert.vue +1 -0
- package/src/components/SyAlert/accessibilite/Accessibility.mdx +79 -9
- package/src/components/SyAlert/tests/SyAlert.a11y.spec.ts +23 -0
- package/src/components/SyHeading/SyHeading.a11y.test.ts +149 -0
- package/src/components/SyHeading/SyHeading.test.ts +115 -0
- package/src/components/SyHeading/SyHeading.vue +5 -3
- package/src/components/SyTextArea/SyTextArea.stories.ts +138 -2
- package/src/components/SyTextArea/SyTextArea.vue +53 -23
- package/src/components/SyTextArea/accessibilite/Accessibility.mdx +80 -8
- package/src/components/SyTextArea/tests/SyTextArea.a11y.spec.ts +151 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +126 -3
- package/src/components/SyTextArea/useDefaultValidationRules.ts +74 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +25 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +673 -1
- package/src/components/Tables/SyServerTable/SyServerTable.vue +148 -91
- package/src/components/Tables/SyServerTable/tests/SyServerTable.a11y.spec.ts +58 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +122 -0
- package/src/components/Tables/SyTable/SyTable.mdx +25 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +452 -1
- package/src/components/Tables/SyTable/SyTable.vue +130 -56
- package/src/components/Tables/SyTable/tests/SyTable.a11y.spec.ts +57 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +108 -0
- package/src/components/Tables/common/SyTableFilter.vue +22 -2
- package/src/components/Tables/common/TableHeader.vue +5 -1
- package/src/components/Tables/common/filters/AutocompleteFilter.vue +160 -0
- package/src/components/Tables/common/filters/NumberFilter.vue +1 -1
- package/src/components/Tables/common/filters/SelectFilter.vue +10 -11
- package/src/components/Tables/common/filters/TextFilter.vue +1 -1
- package/src/components/Tables/common/filters/getFilterComponent.ts +8 -1
- package/src/components/Tables/common/filters/locales.ts +0 -1
- package/src/components/Tables/common/filters/tests/AutocompleteFilter.a11y.spec.ts +110 -0
- package/src/components/Tables/common/filters/tests/AutocompleteFilter.spec.ts +203 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.a11y.spec.ts +104 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.spec.ts +152 -16
- package/src/components/Tables/common/tableFilterUtils.ts +3 -0
- package/src/components/Tables/common/tableStyles.scss +48 -4
- package/src/components/Tables/common/tests/filterByRange.spec.ts +2 -1
- package/src/components/Tables/common/types.ts +13 -4
- package/src/components/Tables/common/useClickableTableRow.ts +103 -0
- package/src/components/Tables/common/usePagination.ts +13 -0
- package/src/components/Tables/common/usePinnedColumns.ts +237 -0
- package/src/components/Tables/common/useTableHeaders.ts +3 -3
- package/src/components/Tables/common/useTableRowCheckboxAccessibility.ts +41 -0
- package/src/components/ToolbarContainer/tests/ToolbarContainer.a11y.spec.ts +126 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +2 -2
- package/src/components/index.ts +1 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +2 -6
- package/src/composables/date/useDatePickerAccessibility.ts +42 -207
- package/src/composables/rules/tests/useFieldValidation.spec.ts +120 -120
- package/src/composables/rules/useFieldValidation.ts +34 -17
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +601 -0
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +2048 -0
- package/src/composables/unifyValidation/tests/useVuetifyValidation.spec.ts +184 -0
- package/src/composables/unifyValidation/useCustomValidation.ts +95 -0
- package/src/composables/unifyValidation/useValidation.ts +190 -0
- package/src/composables/unifyValidation/useVuetifyValidation.ts +54 -0
- package/src/composables/useFormFieldErrorHandling.ts +15 -9
- package/src/composables/validation/tests/useFormValidation.spec.ts +14 -0
- package/src/composables/validation/tests/useValidation.spec.ts +116 -21
- package/src/composables/validation/useFormValidation.ts +20 -13
- package/src/composables/validation/useValidatable.ts +8 -1
- package/src/composables/validation/useValidation.ts +135 -99
- package/src/composantsVuetify/Introduction.mdx +48 -0
- package/src/composantsVuetify/VBtn/VBtn.mdx +72 -0
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +121 -0
- package/src/composantsVuetify/VTooltip/VTooltip.mdx +32 -0
- package/src/composantsVuetify/VTooltip/v-tooltip.stories.ts +95 -0
- package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +2 -2
- package/src/stories/Components/Components.stories.ts +74 -9
- package/src/stories/Demarrer/Accueil.stories.ts +3 -3
- package/src/stories/GuideDuDev/Amelipro.mdx +15 -0
- package/src/stories/GuideDuDev/Amelipro.stories.ts +209 -0
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +3 -3
- package/dist/SelectFilter-BOYlF7rX.js +0 -136
- package/dist/style.css +0 -1
- package/src/components/DatePicker/Accessibilite.mdx +0 -14
|
@@ -5,6 +5,7 @@ import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
|
|
|
5
5
|
import SyCheckbox from '@/components/Customs/SyCheckbox/SyCheckbox.vue'
|
|
6
6
|
import SySelect from '@/components/Customs/Selects/SySelect/SySelect.vue'
|
|
7
7
|
import { VBtn } from 'vuetify/components'
|
|
8
|
+
import { fn } from '@storybook/test'
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
title: 'Composants/Formulaires/SyForm',
|
|
@@ -42,6 +43,10 @@ export default {
|
|
|
42
43
|
type Story = StoryObj<typeof SyForm>
|
|
43
44
|
|
|
44
45
|
export const Basic: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
onReset: fn(),
|
|
48
|
+
onSubmit: fn(),
|
|
49
|
+
},
|
|
45
50
|
render: args => ({
|
|
46
51
|
components: { SyForm, SyTextField, VBtn },
|
|
47
52
|
setup() {
|
|
@@ -126,6 +131,11 @@ const onSubmit = (event: { isValid: boolean }) => {
|
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
export const CustomValidation: Story = {
|
|
134
|
+
args: {
|
|
135
|
+
validateOnSubmit: false,
|
|
136
|
+
onReset: fn(),
|
|
137
|
+
onSubmit: fn(),
|
|
138
|
+
},
|
|
129
139
|
render: args => ({
|
|
130
140
|
components: { SyForm, SyTextField, VBtn },
|
|
131
141
|
setup() {
|
|
@@ -142,7 +152,7 @@ export const CustomValidation: Story = {
|
|
|
142
152
|
|
|
143
153
|
const confirmPasswordRules = computed(() => [
|
|
144
154
|
{ type: 'custom', options: {
|
|
145
|
-
validate: value => value === password.value
|
|
155
|
+
validate: (value: string) => value === password.value,
|
|
146
156
|
message: 'Les mots de passe ne correspondent pas',
|
|
147
157
|
} },
|
|
148
158
|
{ type: 'required', options: { message: 'Veuillez confirmer le mot de passe' } },
|
|
@@ -150,7 +160,7 @@ export const CustomValidation: Story = {
|
|
|
150
160
|
|
|
151
161
|
const submitForm = async (e: { isValid: boolean }) => {
|
|
152
162
|
if (e.isValid) {
|
|
153
|
-
alert('Inscription réussie !')
|
|
163
|
+
alert('Inscription réussie ! (validate on submit = ' + args.validateOnSubmit + ')')
|
|
154
164
|
}
|
|
155
165
|
else {
|
|
156
166
|
alert('Formulaire invalide, veuillez corriger les erreurs.')
|
|
@@ -171,7 +181,7 @@ export const CustomValidation: Story = {
|
|
|
171
181
|
},
|
|
172
182
|
template: `
|
|
173
183
|
<div>
|
|
174
|
-
<SyForm ref="form" v-bind="args" @submit="submitForm" :validate-on-submit="
|
|
184
|
+
<SyForm ref="form" v-bind="args" @submit="submitForm" :validate-on-submit="args.validateOnSubmit">
|
|
175
185
|
<div class="d-flex flex-column gap-4">
|
|
176
186
|
<SyTextField v-model="username" label="Nom d'utilisateur" required class="mb-2" />
|
|
177
187
|
<SyTextField v-model="password" label="Mot de passe" type="password" :custom-rules="passwordRules" class="mb-2" />
|
|
@@ -238,7 +248,7 @@ const passwordRules = computed(() => [
|
|
|
238
248
|
|
|
239
249
|
const confirmPasswordRules = computed(() => [
|
|
240
250
|
{ type: 'custom', options: {
|
|
241
|
-
validate: value => value === password.value
|
|
251
|
+
validate: (value: string) => value === password.value,
|
|
242
252
|
message: 'Les mots de passe ne correspondent pas',
|
|
243
253
|
} },
|
|
244
254
|
{ type: 'required', options: { message: 'Veuillez confirmer le mot de passe' } },
|
|
@@ -267,6 +277,10 @@ const validateManually = () => {
|
|
|
267
277
|
}
|
|
268
278
|
|
|
269
279
|
export const MixedFields: Story = {
|
|
280
|
+
args: {
|
|
281
|
+
onReset: fn(),
|
|
282
|
+
onSubmit: fn(),
|
|
283
|
+
},
|
|
270
284
|
render: args => ({
|
|
271
285
|
components: { SyForm, SyTextField, SySelect, SyCheckbox, VBtn },
|
|
272
286
|
setup() {
|
|
@@ -372,6 +386,9 @@ export const MixedFields: Story = {
|
|
|
372
386
|
if (event.isValid) {
|
|
373
387
|
alert('Formulaire valide ! Données: ' + JSON.stringify(formData.value))
|
|
374
388
|
}
|
|
389
|
+
else {
|
|
390
|
+
alert('Formulaire invalide, veuillez corriger les erreurs.')
|
|
391
|
+
}
|
|
375
392
|
}
|
|
376
393
|
</script>
|
|
377
394
|
`,
|
|
@@ -381,6 +398,10 @@ export const MixedFields: Story = {
|
|
|
381
398
|
}
|
|
382
399
|
|
|
383
400
|
export const Reset: Story = {
|
|
401
|
+
args: {
|
|
402
|
+
onReset: fn(),
|
|
403
|
+
onSubmit: fn(),
|
|
404
|
+
},
|
|
384
405
|
render: args => ({
|
|
385
406
|
components: { SyForm, SyTextField, VBtn },
|
|
386
407
|
setup() {
|
|
@@ -408,7 +429,12 @@ export const Reset: Story = {
|
|
|
408
429
|
form.value?.clearValidation()
|
|
409
430
|
}
|
|
410
431
|
|
|
411
|
-
|
|
432
|
+
function onFormReset() {
|
|
433
|
+
alert('Formulaire réinitialisé !')
|
|
434
|
+
args.onReset?.()
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return { name, email, emailRules, form, submitForm, clearAll, onFormReset, args }
|
|
412
438
|
},
|
|
413
439
|
template: `
|
|
414
440
|
<SyForm ref="form" v-bind="args" @submit="submitForm" @reset="onFormReset">
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
|
|
3
|
+
import { describe, it } from 'vitest'
|
|
4
|
+
import { mount } from '@vue/test-utils'
|
|
5
|
+
import { axe } from 'vitest-axe'
|
|
6
|
+
import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
|
|
7
|
+
import SyIcon from '../SyIcon.vue'
|
|
8
|
+
|
|
9
|
+
describe('SyIcon – accessibility (axe)', () => {
|
|
10
|
+
it('has no obvious axe violations', async () => {
|
|
11
|
+
const wrapper = mount(SyIcon, {
|
|
12
|
+
props: {
|
|
13
|
+
icon: 'home',
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const results = await axe(wrapper.element as HTMLElement)
|
|
18
|
+
assertNoA11yViolations(results, 'SyIcon – default state')
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Meta, Primary, Controls, Canvas } from '@storybook/blocks';
|
|
2
|
+
import * as SyIconButtonStories from './SyIconButton.stories';
|
|
3
|
+
import '@/stories/styles/shared.css';
|
|
4
|
+
|
|
5
|
+
<Meta of={SyIconButtonStories} />
|
|
6
|
+
|
|
7
|
+
<div className="header">
|
|
8
|
+
<h1>SyIconButton</h1>
|
|
9
|
+
<p>Le composant `SyIconButton` est un bouton icône qui combine `v-btn` de Vuetify et `SyIcon` en garantissant l'accessibilité via une prop `label` obligatoire portée par `aria-label`.</p>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<Canvas of={SyIconButtonStories.Default} />
|
|
13
|
+
|
|
14
|
+
# API
|
|
15
|
+
|
|
16
|
+
<Controls of={SyIconButtonStories.Default} />
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Accessibilité
|
|
20
|
+
|
|
21
|
+
Le composant `SyIconButton` gère automatiquement les attributs ARIA :
|
|
22
|
+
|
|
23
|
+
- **Label obligatoire** : la prop `label` est portée par le bouton via `aria-label` — elle constitue le nom accessible du bouton
|
|
24
|
+
- **Icône décorative** : `SyIcon` interne reçoit `:decorative="true"` car le bouton porte déjà le nom accessible via `aria-label` — l'icône est donc ignorée par les lecteurs d'écran
|
|
25
|
+
|
|
26
|
+
> **Important :** Le `label` doit décrire l'**action** du bouton et non l'icône elle-même (ex. _"Fermer"_ plutôt que _"Croix"_). Ne jamais fournir un `label` vide.
|
|
27
|
+
|
|
28
|
+
Pour plus d'informations sur l'accessibilité, consultez la [page dédiée à l'accessibilité](?path=/docs/customs-syiconbutton--accessibility).
|
|
29
|
+
|
|
30
|
+
## Exemples
|
|
31
|
+
|
|
32
|
+
### Bouton icône par défaut
|
|
33
|
+
|
|
34
|
+
<Canvas of={SyIconButtonStories.Default} />
|
|
35
|
+
|
|
36
|
+
### Bouton icône désactivé
|
|
37
|
+
|
|
38
|
+
<Canvas of={SyIconButtonStories.Disabled} />
|
|
39
|
+
|
|
40
|
+
### Bouton icône avec couleur
|
|
41
|
+
|
|
42
|
+
<Canvas of={SyIconButtonStories.WithColor} />
|
|
43
|
+
|
|
44
|
+
### Bouton icône avec taille personnalisée
|
|
45
|
+
|
|
46
|
+
<Canvas of={SyIconButtonStories.WithSize} />
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { fn } from '@storybook/test'
|
|
3
|
+
import SyIconButton from './SyIconButton.vue'
|
|
4
|
+
import { mdiClose, mdiAlert, mdiMagnify } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Composants/Boutons/SyIconButton',
|
|
8
|
+
component: SyIconButton,
|
|
9
|
+
decorators: [
|
|
10
|
+
() => ({
|
|
11
|
+
template: '<div style="padding: 20px;"><story/></div>',
|
|
12
|
+
}),
|
|
13
|
+
],
|
|
14
|
+
argTypes: {
|
|
15
|
+
'icon': {
|
|
16
|
+
control: { type: 'text' },
|
|
17
|
+
description: 'Nom de l\'icône à afficher (format Material Design Icons)',
|
|
18
|
+
},
|
|
19
|
+
'label': {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
description: 'Texte accessible obligatoire porté par `aria-label` sur le bouton',
|
|
22
|
+
},
|
|
23
|
+
'color': {
|
|
24
|
+
control: { type: 'text' },
|
|
25
|
+
description: 'Couleur de l\'icône (nom de couleur Vuetify)',
|
|
26
|
+
},
|
|
27
|
+
'size': {
|
|
28
|
+
options: ['x-small', 'small', 'default', 'large', 'x-large'],
|
|
29
|
+
control: {
|
|
30
|
+
type: 'select',
|
|
31
|
+
},
|
|
32
|
+
description: 'Taille du bouton et de l\'icône',
|
|
33
|
+
default: 'default',
|
|
34
|
+
},
|
|
35
|
+
'disabled': {
|
|
36
|
+
control: { type: 'boolean' },
|
|
37
|
+
description: 'Désactive le bouton',
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
'onClick-icon-button': {
|
|
41
|
+
action: 'click-icon-button',
|
|
42
|
+
description: 'Événement émis lors du clic sur le bouton',
|
|
43
|
+
},
|
|
44
|
+
'variant': {
|
|
45
|
+
options: ['flat', 'elevated', 'tonal', 'outlined', 'text', 'plain'],
|
|
46
|
+
control: { type: 'select' },
|
|
47
|
+
description: 'Variante visuelle du bouton',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
} satisfies Meta<typeof SyIconButton>
|
|
51
|
+
|
|
52
|
+
export default meta
|
|
53
|
+
|
|
54
|
+
type Story = StoryObj<typeof meta>
|
|
55
|
+
|
|
56
|
+
export const Default: Story = {
|
|
57
|
+
parameters: {
|
|
58
|
+
sourceCode: [
|
|
59
|
+
{
|
|
60
|
+
name: 'Template',
|
|
61
|
+
language: 'vue',
|
|
62
|
+
code: `
|
|
63
|
+
<template>
|
|
64
|
+
<SyIconButton :icon="mdiClose" label="Fermer" @click-icon-button="handleClick" />
|
|
65
|
+
</template>`,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
args: {
|
|
70
|
+
'icon': mdiClose,
|
|
71
|
+
'label': 'Fermer',
|
|
72
|
+
'onClick-icon-button': fn(),
|
|
73
|
+
},
|
|
74
|
+
render: args => ({
|
|
75
|
+
components: { SyIconButton },
|
|
76
|
+
setup() {
|
|
77
|
+
const handleClick = () => {
|
|
78
|
+
alert('Bouton cliqué !')
|
|
79
|
+
}
|
|
80
|
+
return { args, mdiClose, handleClick }
|
|
81
|
+
},
|
|
82
|
+
template: `
|
|
83
|
+
<div class="pa-4">
|
|
84
|
+
<SyIconButton v-bind="args" @click-icon-button="handleClick" />
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const Disabled: Story = {
|
|
91
|
+
parameters: {
|
|
92
|
+
sourceCode: [
|
|
93
|
+
{
|
|
94
|
+
name: 'Template',
|
|
95
|
+
language: 'vue',
|
|
96
|
+
code: `
|
|
97
|
+
<template>
|
|
98
|
+
<SyIconButton :icon="mdiClose" label="Fermer" :disabled="true" />
|
|
99
|
+
</template>`,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
args: {
|
|
104
|
+
'icon': mdiClose,
|
|
105
|
+
'label': 'Fermer',
|
|
106
|
+
'disabled': true,
|
|
107
|
+
'onClick-icon-button': fn(),
|
|
108
|
+
},
|
|
109
|
+
render: args => ({
|
|
110
|
+
components: { SyIconButton },
|
|
111
|
+
setup() {
|
|
112
|
+
return { args, mdiClose }
|
|
113
|
+
},
|
|
114
|
+
template: `
|
|
115
|
+
<div class="pa-4">
|
|
116
|
+
<SyIconButton v-bind="args" />
|
|
117
|
+
</div>
|
|
118
|
+
`,
|
|
119
|
+
}),
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const WithColor: Story = {
|
|
123
|
+
parameters: {
|
|
124
|
+
sourceCode: [
|
|
125
|
+
{
|
|
126
|
+
name: 'Template',
|
|
127
|
+
language: 'vue',
|
|
128
|
+
code: `
|
|
129
|
+
<template>
|
|
130
|
+
<SyIconButton :icon="mdiAlert" label="Alerte" color="red" />
|
|
131
|
+
</template>`,
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
args: {
|
|
136
|
+
'icon': mdiAlert,
|
|
137
|
+
'label': 'Alerte',
|
|
138
|
+
'color': 'red',
|
|
139
|
+
'onClick-icon-button': fn(),
|
|
140
|
+
},
|
|
141
|
+
render: args => ({
|
|
142
|
+
components: { SyIconButton },
|
|
143
|
+
setup() {
|
|
144
|
+
return { args, mdiAlert }
|
|
145
|
+
},
|
|
146
|
+
template: `
|
|
147
|
+
<div class="pa-4">
|
|
148
|
+
<SyIconButton v-bind="args" />
|
|
149
|
+
</div>
|
|
150
|
+
`,
|
|
151
|
+
}),
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export const WithSize: Story = {
|
|
155
|
+
parameters: {
|
|
156
|
+
sourceCode: [
|
|
157
|
+
{
|
|
158
|
+
name: 'Template',
|
|
159
|
+
language: 'vue',
|
|
160
|
+
code: `
|
|
161
|
+
<template>
|
|
162
|
+
<SyIconButton :icon="mdiMagnify" label="Rechercher" size="small" />
|
|
163
|
+
</template>`,
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
args: {
|
|
168
|
+
'icon': mdiMagnify,
|
|
169
|
+
'label': 'Rechercher',
|
|
170
|
+
'onClick-icon-button': fn(),
|
|
171
|
+
},
|
|
172
|
+
render: args => ({
|
|
173
|
+
components: { SyIconButton },
|
|
174
|
+
setup() {
|
|
175
|
+
const sizes = ['x-small', 'small', 'default', 'large', 'x-large']
|
|
176
|
+
return { args, mdiMagnify, sizes }
|
|
177
|
+
},
|
|
178
|
+
template: `
|
|
179
|
+
<div class="pa-4 d-flex align-center ga-4">
|
|
180
|
+
<SyIconButton v-for="size in sizes" :key="size" v-bind="args" :size="size" />
|
|
181
|
+
</div>
|
|
182
|
+
`,
|
|
183
|
+
}),
|
|
184
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { IconValue } from 'vuetify/lib/composables/icons.mjs'
|
|
3
|
+
import SyIcon from '../SyIcon/SyIcon.vue'
|
|
4
|
+
|
|
5
|
+
type Size = 'x-small' | 'small' | 'default' | 'large' | 'x-large'
|
|
6
|
+
type Variant = 'flat' | 'text' | 'elevated' | 'tonal' | 'outlined' | 'plain'
|
|
7
|
+
type Color = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | (string & {})
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
icon: IconValue
|
|
11
|
+
label: string
|
|
12
|
+
color?: Color
|
|
13
|
+
size?: Size
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
variant?: Variant
|
|
16
|
+
}>()
|
|
17
|
+
|
|
18
|
+
defineEmits<{ 'click-icon-button': [] }>()
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<v-btn
|
|
23
|
+
:disabled="props.disabled"
|
|
24
|
+
:aria-label="props.label"
|
|
25
|
+
:variant="props.variant ?? 'text'"
|
|
26
|
+
:size="props.size"
|
|
27
|
+
class="rounded-circle"
|
|
28
|
+
icon
|
|
29
|
+
@click="$emit('click-icon-button')"
|
|
30
|
+
>
|
|
31
|
+
<SyIcon
|
|
32
|
+
:icon="props.icon"
|
|
33
|
+
:size="props.size"
|
|
34
|
+
:color="props.color"
|
|
35
|
+
:decorative="true"
|
|
36
|
+
/>
|
|
37
|
+
</v-btn>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Meta, Primary } from '@storybook/blocks';
|
|
2
|
+
import * as SyIconButtonStories from '../SyIconButton.stories';
|
|
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';
|
|
12
|
+
|
|
13
|
+
<Meta of={SyIconButtonStories} />
|
|
14
|
+
|
|
15
|
+
<AccessibilityGuideLayout
|
|
16
|
+
componentName="SyIconButton"
|
|
17
|
+
iconSrc={AccessibilityIcon}
|
|
18
|
+
>
|
|
19
|
+
<CriteriaSection>
|
|
20
|
+
<CriteriaCard icon="🔍" title="Structure sémantique">
|
|
21
|
+
<ul>
|
|
22
|
+
<li><strong>Élément bouton</strong> : le composant repose sur un <code>v-btn</code> qui génère un élément <code><button></code> natif — il est nativement reconnu par les lecteurs d'écran et les outils d'assistance</li>
|
|
23
|
+
<li><strong>Prop <code>label</code> obligatoire</strong> : la prop <code>label</code> est requise et est portée par le bouton via <code>aria-label</code> — elle constitue le nom accessible du bouton</li>
|
|
24
|
+
<li><strong>Icône décorative</strong> : le composant <code>SyIcon</code> interne reçoit <code>:decorative="true"</code> — l'icône est ignorée par les lecteurs d'écran car le bouton porte déjà le nom accessible via <code>aria-label</code></li>
|
|
25
|
+
<li><strong>Prop <code>disabled</code></strong> : lorsque <code>disabled</code> est à <code>true</code>, l'attribut <code>disabled</code> est appliqué nativement sur le <code><button></code>, le rendant inaccessible au clavier et annoncé comme désactivé par les lecteurs d'écran</li>
|
|
26
|
+
<li><strong>Prop <code>variant</code></strong> : par défaut à <code>text</code> — les autres variantes (<code>outlined</code>, <code>tonal</code>, etc.) n'affectent pas l'accessibilité du bouton</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</CriteriaCard>
|
|
29
|
+
|
|
30
|
+
<CriteriaCard icon="⌨️" title="Navigation clavier">
|
|
31
|
+
<ul>
|
|
32
|
+
<li><strong>Focusable</strong> : le bouton est naturellement focusable via <kbd>Tab</kbd> grâce à l'élément <code><button></code> natif</li>
|
|
33
|
+
<li><strong>Activation</strong> : le bouton peut être activé via <kbd>Entrée</kbd> ou <kbd>Espace</kbd> nativement</li>
|
|
34
|
+
<li><strong>État désactivé</strong> : lorsque <code>disabled</code> est à <code>true</code>, le bouton est retiré de l'ordre de tabulation et ne peut pas être activé au clavier</li>
|
|
35
|
+
<li><strong>Événement</strong> : le composant émet <code>click-icon-button</code> au clic ou à l'activation clavier</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</CriteriaCard>
|
|
38
|
+
</CriteriaSection>
|
|
39
|
+
|
|
40
|
+
<DemoSection componentName="SyIconButton">
|
|
41
|
+
<Primary />
|
|
42
|
+
</DemoSection>
|
|
43
|
+
|
|
44
|
+
<BestPracticesSection>
|
|
45
|
+
<ul>
|
|
46
|
+
<li>La prop <code>label</code> est <strong>obligatoire</strong> — sans elle, le bouton icône n'a pas de nom accessible et sera incompréhensible pour les utilisateurs de lecteurs d'écran</li>
|
|
47
|
+
<li>Le <code>label</code> doit décrire l'<strong>action</strong> du bouton et non l'icône elle-même (ex. <em>"Fermer"</em> plutôt que <em>"Croix"</em>)</li>
|
|
48
|
+
<li>Ne jamais fournir un <code>label</code> vide (<code>""</code>) — cela rendrait le bouton inaccessible</li>
|
|
49
|
+
<li>Utiliser <code>disabled</code> plutôt que de masquer le bouton lorsqu'il est temporairement indisponible, afin de préserver la cohérence de la mise en page</li>
|
|
50
|
+
<li>Ne pas ajouter d'<code>aria-label</code> supplémentaire sur le composant parent — celui du <code>v-btn</code> est suffisant</li>
|
|
51
|
+
<li>La prop <code>variant</code> ne doit pas être choisie pour des raisons d'accessibilité — s'assurer que le contraste reste suffisant quelle que soit la variante utilisée (WCAG 1.4.3)</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</BestPracticesSection>
|
|
54
|
+
|
|
55
|
+
<ResourcesSection>
|
|
56
|
+
<ul>
|
|
57
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 4.1.2 – Name, Role, Value</a></li>
|
|
58
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 1.1.1 – Non-text Content</a></li>
|
|
59
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/keyboard.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 2.1.1 – Keyboard</a></li>
|
|
60
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 1.4.3 – Contrast (Minimum)</a></li>
|
|
61
|
+
<li><a href="https://www.w3.org/WAI/ARIA/apg/patterns/button/" target="_blank" style={{ color: '#0C41BD' }}>ARIA Authoring Practices – Button Pattern</a></li>
|
|
62
|
+
</ul>
|
|
63
|
+
</ResourcesSection>
|
|
64
|
+
</AccessibilityGuideLayout>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { describe, it } from 'vitest'
|
|
3
|
+
import { mount } from '@vue/test-utils'
|
|
4
|
+
import { axe } from 'vitest-axe'
|
|
5
|
+
import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
|
|
6
|
+
import SyIconButton from '../SyIconButton.vue'
|
|
7
|
+
|
|
8
|
+
const globalStubs = {
|
|
9
|
+
global: {
|
|
10
|
+
stubs: {
|
|
11
|
+
'v-btn': {
|
|
12
|
+
template: '<button :aria-label="ariaLabel" :disabled="disabled"><slot></slot></button>',
|
|
13
|
+
props: ['ariaLabel', 'disabled', 'size', 'variant', 'icon'],
|
|
14
|
+
},
|
|
15
|
+
'SyIcon': {
|
|
16
|
+
template: '<span class="sy-icon" :aria-hidden="decorative ? true : undefined"></span>',
|
|
17
|
+
props: ['icon', 'color', 'size', 'decorative'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
describe('SyIconButton – accessibility (axe)', () => {
|
|
24
|
+
it('has no obvious axe violations in default state', async () => {
|
|
25
|
+
const wrapper = mount(SyIconButton, {
|
|
26
|
+
props: {
|
|
27
|
+
icon: 'mdi-close',
|
|
28
|
+
label: 'Fermer',
|
|
29
|
+
},
|
|
30
|
+
...globalStubs,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const results = await axe(wrapper.element as HTMLElement)
|
|
34
|
+
assertNoA11yViolations(results, 'SyIconButton – default state', {
|
|
35
|
+
ignoreRules: ['region'],
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('has no obvious axe violations when disabled', async () => {
|
|
40
|
+
const wrapper = mount(SyIconButton, {
|
|
41
|
+
props: {
|
|
42
|
+
icon: 'mdi-close',
|
|
43
|
+
label: 'Fermer',
|
|
44
|
+
disabled: true,
|
|
45
|
+
},
|
|
46
|
+
...globalStubs,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const results = await axe(wrapper.element as HTMLElement)
|
|
50
|
+
assertNoA11yViolations(results, 'SyIconButton – disabled', {
|
|
51
|
+
ignoreRules: ['region'],
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('has no obvious axe violations with color and size', async () => {
|
|
56
|
+
const wrapper = mount(SyIconButton, {
|
|
57
|
+
props: {
|
|
58
|
+
icon: 'mdi-alert',
|
|
59
|
+
label: 'Alerte importante',
|
|
60
|
+
color: 'primary',
|
|
61
|
+
size: 'large',
|
|
62
|
+
},
|
|
63
|
+
...globalStubs,
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const results = await axe(wrapper.element as HTMLElement)
|
|
67
|
+
assertNoA11yViolations(results, 'SyIconButton – color and size', {
|
|
68
|
+
ignoreRules: ['region'],
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('has aria-label on the button', async () => {
|
|
73
|
+
const wrapper = mount(SyIconButton, {
|
|
74
|
+
props: {
|
|
75
|
+
icon: 'mdi-close',
|
|
76
|
+
label: 'Fermer',
|
|
77
|
+
},
|
|
78
|
+
...globalStubs,
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const results = await axe(wrapper.element as HTMLElement)
|
|
82
|
+
|
|
83
|
+
assertNoA11yViolations(results, 'SyIconButton – aria-label on button', {
|
|
84
|
+
ignoreRules: ['region'],
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|