@cnamts/synapse 1.0.19 → 1.0.21
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/{DateFilter-CeVuSfJ9.js → DateFilter-uN8OURoP.js} +1 -1
- package/dist/{NumberFilter-C8PAu_sw.js → NumberFilter-sm1dQNQi.js} +1 -1
- package/dist/{PeriodFilter-UMUaxx3d.js → PeriodFilter-Cklsxnh9.js} +1 -1
- package/dist/{SelectFilter-CqZl8CYt.js → SelectFilter-CWefj27Z.js} +1 -1
- package/dist/{TextFilter-D_RhhNOh.js → TextFilter-Ddyj885L.js} +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +17 -7
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +4 -4
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +2416 -0
- package/dist/components/Customs/Selects/SyAutocomplete/types.d.ts +5 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/ariaManager.d.ts +14 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/useItemUtils.d.ts +16 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.d.ts +28 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/useSelectionLogic.d.ts +12 -0
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +2 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +160 -0
- package/dist/components/Customs/SyCheckBoxGroup/locales.d.ts +3 -0
- package/dist/components/Customs/SyCheckBoxGroup/types.d.ts +10 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1545 -2
- package/dist/components/Customs/SyIcon/SyIcon.d.ts +2 -1
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1495 -2
- package/dist/components/DatePicker/composables/useDateSelection.d.ts +1 -0
- package/dist/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.d.ts +60 -0
- package/dist/components/ErrorPage/ErrorPage.d.ts +1 -12
- package/dist/components/ErrorPage/locales.d.ts +18 -3
- package/dist/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/components/MaintenancePage/locales.d.ts +18 -2
- package/dist/components/NotFoundPage/locales.d.ts +20 -4
- package/dist/components/PaginatedTable/PaginatedTable.d.ts +1 -1
- package/dist/components/PaginatedTable/Pagination.d.ts +17 -0
- package/dist/components/StatusPage/StatusPage.d.ts +39 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -5
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -5
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +13 -3
- package/dist/components/index.d.ts +4 -0
- package/dist/components/types.d.ts +15 -0
- package/dist/composables/useFormFieldErrorHandling.d.ts +31 -0
- package/dist/design-system-v3.js +126 -122
- package/dist/design-system-v3.umd.cjs +325 -314
- package/dist/{main-B39UVv5p.js → main-CWniLr0s.js} +15837 -14587
- package/dist/modules.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/utils/theme/index.d.ts +6 -0
- package/package.json +12 -10
- package/src/assets/amelipro/icons.ts +166 -153
- package/src/components/Accordion/Accordion.mdx +4 -1
- package/src/components/Accordion/{Accessibilite/AccessibilityGuide.mdx → accessibilite/Accessibility.mdx} +2 -2
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.stories.ts +73 -14
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.vue +119 -27
- package/src/components/Amelipro/AmeliproClickableTile/tests/AmeliproClickableTile.a11y.spec.ts +304 -0
- package/src/components/Amelipro/AmeliproClickableTile/tests/AmeliproClickableTile.spec.ts +435 -9
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +60 -0
- package/src/components/Amelipro/AmeliproIcon/__tests__/AmeliproIcon.spec.ts +1 -1
- package/src/components/Amelipro/AmeliproIcon/iconList.ts +2 -0
- package/src/components/BackBtn/BackBtn.vue +5 -4
- package/src/components/BackBtn/accessibilite/Accessibility.mdx +15 -0
- package/src/components/BackToTopBtn/BackToTopBtn.vue +6 -3
- package/src/components/BackToTopBtn/accessibilite/Accessibility.mdx +15 -0
- package/src/components/Captcha/Captcha.vue +5 -1
- package/src/components/Captcha/CaptchaAlert.vue +9 -7
- package/src/components/Captcha/accessibilite/Accessibility.mdx +10 -0
- package/src/components/ChipList/accessibilite/Accessibility.mdx +15 -0
- package/src/components/CollapsibleList/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +8 -6
- package/src/components/Common/IconSlot/IconSlot.vue +1 -1
- package/src/components/ContextualMenu/ContextualMenu.stories.ts +0 -3
- package/src/components/ContextualMenu/accessibilite/Accessibility.mdx +71 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +11 -20
- package/src/components/CookieBanner/CookieBanner.vue +20 -5
- package/src/components/CookieBanner/accessibilite/Accessibility.mdx +71 -0
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +48 -4
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +5 -4
- package/src/components/CopyBtn/CopyBtn.vue +6 -3
- package/src/components/CopyBtn/accessibilite/Accessibility.mdx +15 -0
- package/src/components/Customs/Selects/SelectBtnField/accessibilite/Accessibility.mdx +15 -0
- package/src/components/Customs/Selects/SelectOverview.mdx +112 -1
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.mdx +52 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +979 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +653 -0
- package/src/components/Customs/Selects/{SySelect → SyAutocomplete/accessibilite}/Accessibilite.stories.ts +7 -38
- package/src/components/Customs/Selects/{SySelect/Accessibilite.mdx → SyAutocomplete/accessibilite/Accessibility.mdx} +15 -20
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +72 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +345 -0
- package/src/components/Customs/Selects/SyAutocomplete/types.ts +7 -0
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +180 -0
- package/src/components/Customs/Selects/SyAutocomplete/utils/useItemUtils.ts +46 -0
- package/src/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.ts +107 -0
- package/src/components/Customs/Selects/SyAutocomplete/utils/useSelectionLogic.ts +74 -0
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +13 -9
- package/src/components/Customs/Selects/SyInputSelect/accessibilite/Accessibility.mdx +12 -0
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +43 -34
- package/src/components/Customs/Selects/SySelect/SySelect.vue +19 -2
- package/src/components/Customs/Selects/SySelect/accessibilite/Accessibility.mdx +274 -0
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +21 -16
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.mdx +32 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +856 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +334 -0
- package/src/components/Customs/SyCheckBoxGroup/accessibilite/Accessibility.mdx +243 -0
- package/src/components/Customs/SyCheckBoxGroup/locales.ts +3 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.a11y.spec.ts +30 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.spec.ts +152 -0
- package/src/components/Customs/SyCheckBoxGroup/types.ts +10 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +16 -27
- package/src/components/Customs/SyCheckbox/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +3 -3
- package/src/components/Customs/SyForm/SyForm.a11y.spec.ts +1 -1
- package/src/components/Customs/SyForm/accessibilite/Accessibility.mdx +10 -0
- package/src/components/Customs/SyIcon/SyIcon.mdx +4 -1
- package/src/components/Customs/SyIcon/SyIcon.vue +4 -3
- package/src/components/Customs/SyIcon/{Accessibilite.stories.ts → accessibilite/Accessibilite.stories.ts} +3 -3
- package/src/components/Customs/SyIcon/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +2 -2
- package/src/components/Customs/SyPagination/SyPagination.mdx +4 -2
- package/src/components/Customs/SyPagination/accessibilite/Accessibility.mdx +10 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +16 -43
- package/src/components/Customs/SyRadioGroup/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +2 -2
- package/src/components/Customs/SyTabs/SyTabs.mdx +4 -2
- package/src/components/Customs/SyTabs/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +2 -2
- package/src/components/Customs/SyTextField/SyTextField.mdx +1 -2
- package/src/components/Customs/SyTextField/SyTextField.vue +13 -0
- package/src/components/Customs/SyTextField/accessibilite/Accessibility.mdx +15 -0
- package/src/components/DataList/accessibilite/Accessibility.mdx +15 -0
- package/src/components/DataListGroup/accessibilite/Accessibility.mdx +14 -0
- package/src/components/DatePicker/Accessibilite.mdx +1 -1
- package/src/components/DatePicker/Accessibilite.stories.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +7 -4
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +49 -13
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +43 -2
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +297 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +48 -21
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +98 -0
- package/src/components/DatePicker/composables/useDateSelection.ts +5 -0
- package/src/components/DatePicker/docExamples/BidirectionalComplexValidation.vue +273 -0
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +4 -4
- package/src/components/DatePicker/docExamples/DatePickerValidationExamples.vue +10 -0
- package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.mdx +83 -0
- package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.stories.ts +502 -0
- package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.vue +428 -0
- package/src/components/DeclarationAccessibilityPage/accessibilite/Accessibility.mdx +75 -0
- package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.a11y.spec.ts +53 -0
- package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.spec.ts +59 -0
- package/src/components/DiacriticPicker/DiacriticPicker.vue +20 -1
- package/src/components/DiacriticPicker/accessibilite/Accessibility.mdx +10 -0
- package/src/components/DialogBox/accessibilite/Accessibility.mdx +15 -0
- package/src/components/DownloadBtn/DownloadBtn.vue +5 -4
- package/src/components/DownloadBtn/accessibilite/Accessibility.mdx +15 -0
- package/src/components/ErrorPage/ErrorPage.mdx +6 -16
- package/src/components/ErrorPage/ErrorPage.stories.ts +16 -87
- package/src/components/ErrorPage/ErrorPage.vue +38 -125
- package/src/components/ErrorPage/accessibilite/Accessibility.mdx +77 -0
- package/src/components/ErrorPage/assets/error-ap.svg +1774 -0
- package/src/components/ErrorPage/locales.ts +21 -3
- package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +5 -13
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +2 -41
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +8 -266
- package/src/components/ExternalLinks/accessibilite/Accessibility.mdx +15 -0
- package/src/components/FileList/UploadItem/UploadItem.vue +25 -20
- package/src/components/FileList/accessibilite/Accessibility.mdx +12 -0
- package/src/components/FilePreview/accessibilite/Accessibility.mdx +12 -0
- package/src/components/FileUpload/FileUpload.vue +5 -0
- package/src/components/FileUpload/FileUploadContent.vue +5 -4
- package/src/components/FileUpload/accessibilite/Accessibility.mdx +12 -0
- package/src/components/FilterInline/FilterInline.vue +5 -4
- package/src/components/FilterInline/accessibilite/Accessibility.mdx +12 -0
- package/src/components/FilterSideBar/accessibilite/Accessibility.mdx +15 -0
- package/src/components/FooterBar/FooterBar.stories.ts +18 -14
- package/src/components/FooterBar/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +3 -4
- package/src/components/FooterBar/defaultSocialMediaLinks.ts +6 -4
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +6 -5
- package/src/components/FranceConnectBtn/accessibilite/Accessibility.mdx +15 -0
- package/src/components/FranceConnectBtn/tests/__snapshots__/FranceConnectBtn.spec.ts.snap +3 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/accessibilite/Accessibility.mdx +15 -0
- package/src/components/HeaderBar/accessibilite/Accessibility.mdx +15 -0
- package/src/components/HeaderBar/{Usages.mdx → usages/Usages.mdx} +2 -2
- package/src/components/HeaderLoading/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +9 -5
- package/src/components/HeaderToolbar/accessibilite/Accessibility.mdx +15 -0
- package/src/components/LangBtn/LangBtn.vue +5 -4
- package/src/components/LangBtn/accessibilite/Accessibility.mdx +15 -0
- package/src/components/Logo/accessibilite/Accessibility.mdx +17 -0
- package/src/components/LogoBrandSection/accessibilite/Accessibility.mdx +12 -0
- package/src/components/LunarCalendar/accessibilite/Accessibility.mdx +10 -0
- package/src/components/MaintenancePage/MaintenancePage.mdx +1 -1
- package/src/components/MaintenancePage/MaintenancePage.vue +15 -7
- package/src/components/MaintenancePage/accessibilite/Accessibility.mdx +70 -0
- package/src/components/MaintenancePage/assets/maintenance-ap.svg +1718 -0
- package/src/components/MaintenancePage/locales.ts +24 -3
- package/src/components/MaintenancePage/tests/MaintenancePage.a11y.spec.ts +75 -3
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +42 -2
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -2
- package/src/components/NirField/accessibilite/Accessibility.mdx +15 -0
- package/src/components/NotFoundPage/NotFoundPage.mdx +1 -1
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +3 -3
- package/src/components/NotFoundPage/NotFoundPage.vue +16 -11
- package/src/components/NotFoundPage/accessibilite/Accessibility.mdx +87 -0
- package/src/components/NotFoundPage/assets/not-found-ap.svg +2061 -0
- package/src/components/NotFoundPage/locales.ts +24 -4
- package/src/components/NotFoundPage/tests/NotFoundPage.a11y.spec.ts +168 -4
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +100 -12
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +2 -2
- package/src/components/NotificationBar/Notification/Notification.vue +1 -1
- package/src/components/NotificationBar/NotificationBar.mdx +2 -2
- package/src/components/NotificationBar/accessibilite/Accessibility.mdx +75 -0
- package/src/components/PageContainer/{AccessibilityGuide.mdx → accessibilite/Accessibility.mdx} +7 -4
- package/src/components/PageContainer/tests/PageContainer.a11y.spec.ts +14 -7
- package/src/components/PaginatedTable/PaginatedTable.vue +27 -47
- package/src/components/PaginatedTable/Pagination.vue +93 -0
- package/src/components/PaginatedTable/accessibilite/Accessibility.mdx +12 -0
- package/src/components/PasswordField/PasswordField.vue +2 -1
- package/src/components/PasswordField/accessibilite/Accessibility.mdx +108 -0
- package/src/components/PeriodField/accessibilite/Accessibility.mdx +12 -0
- package/src/components/PhoneField/PhoneField.stories.ts +46 -38
- package/src/components/PhoneField/accessibilite/Accessibility.mdx +15 -0
- package/src/components/RangeField/accessibilite/Accessibility.mdx +15 -0
- package/src/components/RatingPicker/accessibilite/Accessibility.mdx +15 -0
- package/src/components/SearchListField/SearchListField.vue +6 -3
- package/src/components/SearchListField/accessibilite/Accessibility.mdx +15 -0
- package/src/components/SkipLink/{Accessibilite.mdx → accessibilite/Accessibility.mdx} +7 -4
- package/src/components/SocialMediaLinks/DefaultSocialMediaLinks.ts +6 -4
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +7 -5
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +17 -13
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +9 -1
- package/src/components/SocialMediaLinks/accessibilite/Accessibility.mdx +67 -0
- package/src/components/SocialMediaLinks/tests/DefaultSocialMediaLinks.spec.ts +5 -5
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.a11y.spec.ts +59 -0
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +9 -7
- package/src/components/StatusPage/StatusPage.mdx +22 -0
- package/src/components/StatusPage/StatusPage.stories.ts +193 -0
- package/src/components/StatusPage/StatusPage.vue +145 -0
- package/src/components/StatusPage/accessibilite/Accessibility.mdx +81 -0
- package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +29 -0
- package/src/components/StatusPage/tests/StatusPage.spec.ts +50 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +270 -0
- package/src/components/SubHeader/accessibilite/Accessibility.mdx +15 -0
- package/src/components/SyAlert/SyAlert.vue +6 -6
- package/src/components/SyAlert/accessibilite/Accessibility.mdx +12 -0
- package/src/components/SyTextArea/accessibilite/Accessibility.mdx +10 -0
- package/src/components/TableToolbar/TableToolbar.stories.ts +6 -6
- package/src/components/TableToolbar/TableToolbar.vue +7 -4
- package/src/components/TableToolbar/accessibilite/Accessibility.mdx +12 -0
- package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +0 -5
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +4 -1
- package/src/components/Tables/SyServerTable/accessibilite/Accessibility.mdx +10 -0
- package/src/components/Tables/SyTable/SyTable.mdx +4 -1
- package/src/components/Tables/SyTable/accessibilite/Accessibility.mdx +10 -0
- package/src/components/Tables/common/TableHeader.vue +3 -1
- package/src/components/Tables/common/organizeColumns/OrganizeColumns.vue +18 -14
- package/src/components/ToolbarContainer/ToolbarContainer.mdx +2 -1
- package/src/components/ToolbarContainer/ToolbarContainer.stories.ts +563 -420
- package/src/components/ToolbarContainer/accessibilite/Accessibility.mdx +69 -0
- package/src/components/UploadWorkflow/UploadWorkflow.mdx +11 -1
- package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +107 -3
- package/src/components/UploadWorkflow/UploadWorkflow.vue +35 -24
- package/src/components/UploadWorkflow/accessibilite/Accessibility.mdx +12 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +48 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +9 -5
- package/src/components/UploadWorkflow/useFileList.ts +7 -0
- package/src/components/Usages/Usages.vue +3 -2
- package/src/components/UserMenuBtn/UserMenuBtn.vue +7 -5
- package/src/components/UserMenuBtn/accessibilite/Accessibility.mdx +12 -0
- package/src/components/index.ts +5 -0
- package/src/components/types.ts +10 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +39 -3
- package/src/composables/rules/useFieldValidation.ts +31 -9
- package/src/composables/useFormFieldErrorHandling.ts +141 -0
- package/src/modules.d.ts +6 -0
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +7 -0
- package/src/utils/theme/index.ts +19 -0
- package/src/utils/theme/tests/useThemeLocales.spec.ts +245 -0
- package/dist/components/MaintenancePage/index.d.ts +0 -2
- package/src/components/BackBtn/Accessibilite.mdx +0 -14
- package/src/components/BackBtn/Accessibilite.stories.ts +0 -30
- package/src/components/BackToTopBtn/Accessibilite.mdx +0 -14
- package/src/components/BackToTopBtn/Accessibilite.stories.ts +0 -31
- package/src/components/ChipList/Accessibilite.mdx +0 -14
- package/src/components/ChipList/Accessibilite.stories.ts +0 -31
- package/src/components/CollapsibleList/Accessibilite.stories.ts +0 -29
- package/src/components/ContextualMenu/Accessibilite.mdx +0 -13
- package/src/components/ContextualMenu/Accessibilite.stories.ts +0 -29
- package/src/components/CookieBanner/Accessibilite.mdx +0 -13
- package/src/components/CookieBanner/Accessibilite.stories.ts +0 -30
- package/src/components/CopyBtn/Accessibilite.mdx +0 -13
- package/src/components/CopyBtn/Accessibilite.stories.ts +0 -29
- package/src/components/Customs/Selects/SelectBtnField/Accessibilite.mdx +0 -14
- package/src/components/Customs/Selects/SelectBtnField/Accessibilite.stories.ts +0 -29
- package/src/components/Customs/Selects/SyInputSelect/Accessibilite.mdx +0 -13
- package/src/components/Customs/Selects/SyInputSelect/Accessibilite.stories.ts +0 -25
- package/src/components/Customs/SyPagination/tests/SyPagination.a11y.spec.ts +0 -27
- package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +0 -51
- package/src/components/Customs/SyTextField/Accessibilite.mdx +0 -14
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +0 -34
- package/src/components/DataList/Accessibilite.mdx +0 -13
- package/src/components/DataList/Accessibilite.stories.ts +0 -29
- package/src/components/DataListGroup/Accessibilite.mdx +0 -13
- package/src/components/DataListGroup/Accessibilite.stories.ts +0 -29
- package/src/components/DataListItem/tests/DataListItem.a11y.spec.ts +0 -31
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +0 -27
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.a11y.spec.ts +0 -26
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.a11y.spec.ts +0 -27
- package/src/components/DialogBox/Accessibilite.mdx +0 -14
- package/src/components/DialogBox/Accessibilite.stories.ts +0 -29
- package/src/components/DownloadBtn/Accessibilite.mdx +0 -14
- package/src/components/DownloadBtn/Accessibilite.stories.ts +0 -29
- package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +0 -26
- package/src/components/ErrorPage/Accessibilite.mdx +0 -13
- package/src/components/ErrorPage/Accessibilite.stories.ts +0 -36
- package/src/components/ExternalLinks/Accessibilite.mdx +0 -18
- package/src/components/ExternalLinks/Accessibilite.stories.ts +0 -62
- package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +0 -39
- package/src/components/FileList/Accessibilite.mdx +0 -13
- package/src/components/FileList/Accessibilite.stories.ts +0 -26
- package/src/components/FilePreview/Accessibilite.mdx +0 -14
- package/src/components/FilePreview/Accessibilite.stories.ts +0 -26
- package/src/components/FileUpload/Accessibilite.mdx +0 -13
- package/src/components/FileUpload/Accessibilite.stories.ts +0 -26
- package/src/components/FilterInline/Accessibilite.mdx +0 -15
- package/src/components/FilterInline/Accessibilite.stories.ts +0 -26
- package/src/components/FilterSideBar/Accessibilite.mdx +0 -13
- package/src/components/FilterSideBar/Accessibilite.stories.ts +0 -30
- package/src/components/FooterBar/Accessibilite.stories.ts +0 -26
- package/src/components/FranceConnectBtn/Accessibilite.mdx +0 -13
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +0 -30
- package/src/components/HeaderBar/Accessibilite.mdx +0 -13
- package/src/components/HeaderBar/Accessibilite.stories.ts +0 -31
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.mdx +0 -13
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.stories.ts +0 -30
- package/src/components/HeaderLoading/Accessibilite.stories.ts +0 -31
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.a11y.spec.ts +0 -45
- package/src/components/HeaderToolbar/Accessibilite.mdx +0 -13
- package/src/components/HeaderToolbar/Accessibilite.stories.ts +0 -36
- package/src/components/HeaderToolbar/tests/HeaderToolbar.a11y.spec.ts +0 -25
- package/src/components/LangBtn/Accessibilite.mdx +0 -13
- package/src/components/LangBtn/Accessibilite.stories.ts +0 -32
- package/src/components/Logo/Accessibilite.mdx +0 -13
- package/src/components/Logo/Accessibilite.stories.ts +0 -30
- package/src/components/LogoBrandSection/Accessibilite.mdx +0 -13
- package/src/components/LogoBrandSection/Accessibilite.stories.ts +0 -26
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +0 -31
- package/src/components/MaintenancePage/Accessibilite.mdx +0 -13
- package/src/components/MaintenancePage/Accessibilite.stories.ts +0 -36
- package/src/components/MaintenancePage/index.ts +0 -3
- package/src/components/NirField/Accessibilite.mdx +0 -13
- package/src/components/NirField/Accessibilite.stories.ts +0 -31
- package/src/components/NotFoundPage/Accessibilite.mdx +0 -13
- package/src/components/NotFoundPage/Accessibilite.stories.ts +0 -36
- package/src/components/NotificationBar/Accessibilite.mdx +0 -13
- package/src/components/NotificationBar/Accessibilite.stories.ts +0 -30
- package/src/components/PageContainer/Accessibilite.mdx +0 -13
- package/src/components/PageContainer/Accessibilite.stories.ts +0 -30
- package/src/components/PaginatedTable/Accessibilite.mdx +0 -13
- package/src/components/PaginatedTable/Accessibilite.stories.ts +0 -26
- package/src/components/PaginatedTable/tests/PaginatedTable.a11y.spec.ts +0 -43
- package/src/components/PasswordField/Accessibilite.mdx +0 -13
- package/src/components/PasswordField/Accessibilite.stories.ts +0 -121
- package/src/components/PeriodField/Accessibilite.mdx +0 -13
- package/src/components/PeriodField/Accessibilite.stories.ts +0 -27
- package/src/components/PhoneField/Accessibilite.mdx +0 -13
- package/src/components/PhoneField/Accessibilite.stories.ts +0 -32
- package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +0 -34
- package/src/components/RangeField/Accessibilite.mdx +0 -13
- package/src/components/RangeField/Accessibilite.stories.ts +0 -32
- package/src/components/RatingPicker/Accessibilite.mdx +0 -13
- package/src/components/RatingPicker/Accessibilite.stories.ts +0 -30
- package/src/components/SearchListField/Accessibilite.mdx +0 -13
- package/src/components/SearchListField/Accessibilite.stories.ts +0 -30
- package/src/components/SkipLink/Accessibilite.stories.ts +0 -36
- package/src/components/SocialMediaLinks/Accessibilite.mdx +0 -13
- package/src/components/SocialMediaLinks/Accessibilite.stories.ts +0 -36
- package/src/components/SubHeader/Accessibilite.mdx +0 -13
- package/src/components/SubHeader/Accessibilite.stories.ts +0 -36
- package/src/components/SyAlert/Accessibilite.mdx +0 -13
- package/src/components/SyAlert/Accessibilite.stories.ts +0 -30
- package/src/components/TableToolbar/Accessibilite.mdx +0 -13
- package/src/components/TableToolbar/Accessibilite.stories.ts +0 -26
- package/src/components/UploadWorkflow/Accessibilite.mdx +0 -13
- package/src/components/UploadWorkflow/Accessibilite.stories.ts +0 -26
- package/src/components/UserMenuBtn/Accessibilite.mdx +0 -13
- package/src/components/UserMenuBtn/Accessibilite.stories.ts +0 -25
- /package/src/components/HeaderBar/{Usages.stories.ts → usages/Usages.stories.ts} +0 -0
- /package/src/components/NotFoundPage/assets/{not-found.svg → not-found-cnam.svg} +0 -0
- /package/src/components/SyBtnMenu/accessibilite/{AccessibilityGuide.mdx → Accessibility.mdx} +0 -0
|
@@ -1,17 +1,443 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import {
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import AmeliproClickableTile from '../AmeliproClickableTile.vue'
|
|
4
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
5
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
6
|
+
import type { PropType } from 'vue'
|
|
7
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
8
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
9
|
+
|
|
10
|
+
// Stub VBtn qui préserve les attributs comme aria-label
|
|
11
|
+
const VBtnStub = {
|
|
12
|
+
template: '<button v-bind="$attrs"><slot /></button>',
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproClickableTile> = {
|
|
17
|
+
borderedIcon: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false,
|
|
24
|
+
},
|
|
25
|
+
href: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: undefined,
|
|
28
|
+
},
|
|
29
|
+
icon: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: undefined,
|
|
32
|
+
},
|
|
33
|
+
imgMaxWidth: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: undefined,
|
|
36
|
+
},
|
|
37
|
+
imgMinWidth: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: undefined,
|
|
40
|
+
},
|
|
41
|
+
imgSrc: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: undefined,
|
|
44
|
+
},
|
|
45
|
+
imgWidth: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '100px',
|
|
48
|
+
},
|
|
49
|
+
tileTitle: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: undefined,
|
|
52
|
+
},
|
|
53
|
+
tileWidth: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '100%',
|
|
56
|
+
},
|
|
57
|
+
to: {
|
|
58
|
+
type: Object as PropType<RouteLocationRaw>,
|
|
59
|
+
default: undefined,
|
|
60
|
+
},
|
|
61
|
+
uniqueId: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: undefined,
|
|
64
|
+
},
|
|
65
|
+
onlyIconIsClickable: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Values pour les props "required"
|
|
72
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproClickableTile> => ({
|
|
73
|
+
icon: 'utilisateur',
|
|
74
|
+
tileTitle: 'titre de la tuile',
|
|
75
|
+
uniqueId: 'required-unique-id',
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// Valeurs pour les props "modified"
|
|
79
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproClickableTile> => ({
|
|
80
|
+
icon: 'document',
|
|
81
|
+
tileTitle: 'titre modifié',
|
|
82
|
+
uniqueId: 'modified-unique-id',
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const testHelper = new TestHelper(AmeliproClickableTile)
|
|
86
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
87
|
+
.setRequiredPropValues(requiredPropValues)
|
|
88
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
4
89
|
|
|
5
90
|
describe('AmeliproClickableTile', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
91
|
+
describe('Snapshots', () => {
|
|
92
|
+
testHelper.snapshots()
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
describe('Main container', () => {
|
|
96
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
100
|
+
props: {
|
|
101
|
+
icon: 'utilisateur',
|
|
102
|
+
tileTitle: 'Test',
|
|
103
|
+
uniqueId: 'test-tile',
|
|
104
|
+
},
|
|
105
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('prop uniqueId sets attribute id on container', async () => {
|
|
110
|
+
expect(vueWrapper.attributes('id')).toBe('test-tile')
|
|
111
|
+
await vueWrapper.setProps({ uniqueId: 'new-id' })
|
|
112
|
+
expect(vueWrapper.attributes('id')).toBe('new-id')
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it('prop tileWidth sets width attribute', async () => {
|
|
116
|
+
expect(vueWrapper.find('button').attributes('width')).toBe('100%')
|
|
117
|
+
await vueWrapper.setProps({ tileWidth: '50%' })
|
|
118
|
+
expect(vueWrapper.find('button').attributes('width')).toBe('50%')
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('prop disabled disables the button', async () => {
|
|
122
|
+
expect(vueWrapper.find('button').attributes('disabled')).toBeUndefined()
|
|
123
|
+
await vueWrapper.setProps({ disabled: true })
|
|
124
|
+
expect(vueWrapper.find('button').attributes('disabled')).toBeDefined()
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('prop href sets href attribute', async () => {
|
|
128
|
+
expect(vueWrapper.find('button').attributes('href')).toBeUndefined()
|
|
129
|
+
await vueWrapper.setProps({ href: 'https://example.com' })
|
|
130
|
+
expect(vueWrapper.find('button').attributes('href')).toBe('https://example.com')
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
it('prop to sets to attribute', async () => {
|
|
134
|
+
expect(vueWrapper.find('button').attributes('to')).toBeUndefined()
|
|
135
|
+
await vueWrapper.setProps({ to: '/dashboard' })
|
|
136
|
+
expect(vueWrapper.find('button').attributes('to')).toBe('/dashboard')
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
describe('Icon or Image display', () => {
|
|
141
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
142
|
+
|
|
143
|
+
beforeEach(() => {
|
|
144
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
145
|
+
props: {
|
|
146
|
+
icon: 'utilisateur',
|
|
147
|
+
tileTitle: 'Test',
|
|
148
|
+
},
|
|
149
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('displays icon when icon prop is provided', async () => {
|
|
154
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIcon' }).exists()).toBe(true)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
it('displays image when imgSrc prop is provided', async () => {
|
|
158
|
+
await vueWrapper.setProps({ icon: undefined, imgSrc: 'https://example.com/image.png' })
|
|
159
|
+
expect(vueWrapper.find('img').exists()).toBe(true)
|
|
160
|
+
expect(vueWrapper.find('img').attributes('src')).toBe('https://example.com/image.png')
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
it('prop imgWidth sets image width style', async () => {
|
|
164
|
+
await vueWrapper.setProps({ icon: undefined, imgSrc: 'https://example.com/image.png' })
|
|
165
|
+
expect(vueWrapper.find('img').attributes('style')).toContain('width: 100px')
|
|
166
|
+
await vueWrapper.setProps({ imgWidth: '150px' })
|
|
167
|
+
expect(vueWrapper.find('img').attributes('style')).toContain('width: 150px')
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it('prop imgMaxWidth sets image maxWidth style', async () => {
|
|
171
|
+
await vueWrapper.setProps({
|
|
172
|
+
icon: undefined,
|
|
173
|
+
imgSrc: 'https://example.com/image.png',
|
|
174
|
+
imgMaxWidth: '200px',
|
|
175
|
+
})
|
|
176
|
+
expect(vueWrapper.find('img').attributes('style')).toContain('max-width: 200px')
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
it('prop imgMinWidth sets image minWidth style', async () => {
|
|
180
|
+
await vueWrapper.setProps({
|
|
181
|
+
icon: undefined,
|
|
182
|
+
imgSrc: 'https://example.com/image.png',
|
|
183
|
+
imgMinWidth: '50px',
|
|
184
|
+
})
|
|
185
|
+
expect(vueWrapper.find('img').attributes('style')).toContain('min-width: 50px')
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
it('does not display both icon and image', async () => {
|
|
189
|
+
await vueWrapper.setProps({
|
|
9
190
|
icon: 'utilisateur',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
191
|
+
imgSrc: 'https://example.com/image.png',
|
|
192
|
+
})
|
|
193
|
+
const images = vueWrapper.findAll('img')
|
|
194
|
+
const icons = vueWrapper.findAllComponents({ name: 'AmeliproIcon' })
|
|
195
|
+
expect(images.length === 0 || icons.length === 0).toBe(true)
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
describe('Title display', () => {
|
|
200
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
201
|
+
|
|
202
|
+
beforeEach(() => {
|
|
203
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
204
|
+
props: {
|
|
205
|
+
icon: 'utilisateur',
|
|
206
|
+
tileTitle: 'titre de la tuile',
|
|
207
|
+
},
|
|
208
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
it('prop tileTitle displays title text', async () => {
|
|
213
|
+
expect(vueWrapper.text()).toContain('titre de la tuile')
|
|
214
|
+
await vueWrapper.setProps({ tileTitle: 'nouveau titre' })
|
|
215
|
+
expect(vueWrapper.text()).toContain('nouveau titre')
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
it('displays slot content when provided', async () => {
|
|
219
|
+
const slotWrapper = mount(AmeliproClickableTile, {
|
|
220
|
+
props: { icon: 'utilisateur' },
|
|
221
|
+
slots: {
|
|
222
|
+
default: 'Slot content',
|
|
223
|
+
},
|
|
224
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
225
|
+
})
|
|
226
|
+
expect(slotWrapper.text()).toContain('Slot content')
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
describe('Icon styling', () => {
|
|
231
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
232
|
+
|
|
233
|
+
beforeEach(() => {
|
|
234
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
235
|
+
props: {
|
|
236
|
+
icon: 'utilisateur',
|
|
237
|
+
tileTitle: 'Test',
|
|
238
|
+
},
|
|
239
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
it('prop borderedIcon changes icon style', async () => {
|
|
244
|
+
let icons = vueWrapper.findAllComponents({ name: 'AmeliproIcon' })
|
|
245
|
+
expect(icons.length).toBeGreaterThan(0)
|
|
246
|
+
expect(icons[0]?.props('bordered')).toBe(false)
|
|
247
|
+
|
|
248
|
+
await vueWrapper.setProps({ borderedIcon: true })
|
|
249
|
+
icons = vueWrapper.findAllComponents({ name: 'AmeliproIcon' })
|
|
250
|
+
expect(icons[0]?.props('bordered')).toBe(true)
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
it('icon has correct size', async () => {
|
|
254
|
+
const icons = vueWrapper.findAllComponents({ name: 'AmeliproIcon' })
|
|
255
|
+
expect(icons.length).toBeGreaterThan(0)
|
|
256
|
+
expect(icons[0]?.props('size')).toBe('32px')
|
|
13
257
|
})
|
|
14
258
|
|
|
15
|
-
|
|
259
|
+
it('arrow icon has correct size', async () => {
|
|
260
|
+
const icons = vueWrapper.findAllComponents({ name: 'AmeliproIcon' })
|
|
261
|
+
expect(icons.length).toBeGreaterThan(0)
|
|
262
|
+
const arrowIcon = icons[icons.length - 1]
|
|
263
|
+
expect(arrowIcon?.props('size')).toBe('16px')
|
|
264
|
+
expect(arrowIcon?.props('icon')).toBe('chevronRight')
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
describe('onlyIconIsClickable mode', () => {
|
|
269
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
270
|
+
|
|
271
|
+
beforeEach(() => {
|
|
272
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
273
|
+
props: {
|
|
274
|
+
icon: 'utilisateur',
|
|
275
|
+
tileTitle: 'Test',
|
|
276
|
+
uniqueId: 'test-tile',
|
|
277
|
+
onlyIconIsClickable: true,
|
|
278
|
+
},
|
|
279
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
280
|
+
})
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
it('renders span wrapper instead of VBtn when onlyIconIsClickable is true', () => {
|
|
284
|
+
expect(vueWrapper.find('span.amelipro-clickable-tile').exists()).toBe(true)
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
it('prop uniqueId sets attribute id on span wrapper', async () => {
|
|
288
|
+
expect(vueWrapper.find('span.amelipro-clickable-tile').attributes('id')).toBe('test-tile')
|
|
289
|
+
await vueWrapper.setProps({ uniqueId: 'new-id' })
|
|
290
|
+
expect(vueWrapper.find('span.amelipro-clickable-tile').attributes('id')).toBe('new-id')
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
it('contains a VBtn for icon button only', () => {
|
|
294
|
+
const buttons = vueWrapper.findAll('button')
|
|
295
|
+
expect(buttons.length > 0).toBe(true)
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
it('icon button has uniqueId suffix', async () => {
|
|
299
|
+
const buttons = vueWrapper.findAll('button')
|
|
300
|
+
expect(buttons.length).toBeGreaterThan(0)
|
|
301
|
+
expect(buttons[0]?.attributes('id')).toBe('test-tile-icon-button')
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
it('content is not clickable, only icon button is', () => {
|
|
305
|
+
const span = vueWrapper.find('span.amelipro-clickable-tile')
|
|
306
|
+
// Span should not have onclick handler
|
|
307
|
+
expect(span.attributes('onclick')).toBeUndefined()
|
|
308
|
+
})
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
describe('Events', () => {
|
|
312
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
313
|
+
|
|
314
|
+
beforeEach(() => {
|
|
315
|
+
vueWrapper = shallowMount(AmeliproClickableTile, {
|
|
316
|
+
props: {
|
|
317
|
+
icon: 'utilisateur',
|
|
318
|
+
tileTitle: 'Test',
|
|
319
|
+
uniqueId: 'test-id',
|
|
320
|
+
},
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
it('emits click event when clicked in normal mode', async () => {
|
|
325
|
+
expect(vueWrapper.emitted('click')).toBeUndefined()
|
|
326
|
+
await vueWrapper.trigger('click')
|
|
327
|
+
expect(vueWrapper.emitted('click')).toBeTruthy()
|
|
328
|
+
expect(vueWrapper.emitted('click')?.[0]).toEqual(['test-id'])
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
it('emits click event with uniqueId', async () => {
|
|
332
|
+
await vueWrapper.setProps({ uniqueId: 'new-id' })
|
|
333
|
+
await vueWrapper.trigger('click')
|
|
334
|
+
expect(vueWrapper.emitted('click')?.[0]).toEqual(['new-id'])
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
it('does not emit click when disabled', async () => {
|
|
338
|
+
await vueWrapper.setProps({ disabled: true })
|
|
339
|
+
// VBtn with disabled prop should not emit click
|
|
340
|
+
})
|
|
341
|
+
})
|
|
342
|
+
|
|
343
|
+
describe('Hover and Focus states', () => {
|
|
344
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
345
|
+
|
|
346
|
+
beforeEach(() => {
|
|
347
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
348
|
+
props: {
|
|
349
|
+
icon: 'utilisateur',
|
|
350
|
+
tileTitle: 'Test',
|
|
351
|
+
},
|
|
352
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
it('applies hover class on hover', async () => {
|
|
357
|
+
const btn = vueWrapper.find('button')
|
|
358
|
+
await btn.trigger('mouseenter')
|
|
359
|
+
// Check that the hover class is applied to the container
|
|
360
|
+
expect(vueWrapper.classes()).toContain('amelipro-clickable-tile--hover')
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
it('applies focus class on focus', async () => {
|
|
364
|
+
const btn = vueWrapper.find('button')
|
|
365
|
+
await btn.trigger('focus')
|
|
366
|
+
// Check that the hover/focus class is applied to the container
|
|
367
|
+
expect(vueWrapper.classes()).toContain('amelipro-clickable-tile--hover')
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
it('removes hover state on mouseleave', async () => {
|
|
371
|
+
const btn = vueWrapper.find('button')
|
|
372
|
+
await btn.trigger('mouseenter')
|
|
373
|
+
expect(vueWrapper.classes()).toContain('amelipro-clickable-tile--hover')
|
|
374
|
+
await btn.trigger('mouseleave')
|
|
375
|
+
// State should be reset
|
|
376
|
+
expect(vueWrapper.classes()).not.toContain('amelipro-clickable-tile--hover')
|
|
377
|
+
})
|
|
378
|
+
|
|
379
|
+
it('removes focus state on blur', async () => {
|
|
380
|
+
const btn = vueWrapper.find('button')
|
|
381
|
+
await btn.trigger('focus')
|
|
382
|
+
expect(vueWrapper.classes()).toContain('amelipro-clickable-tile--hover')
|
|
383
|
+
await btn.trigger('blur')
|
|
384
|
+
// State should be reset
|
|
385
|
+
expect(vueWrapper.classes()).not.toContain('amelipro-clickable-tile--hover')
|
|
386
|
+
})
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
describe('Disabled state styling', () => {
|
|
390
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproClickableTile>>
|
|
391
|
+
|
|
392
|
+
beforeEach(() => {
|
|
393
|
+
vueWrapper = mount(AmeliproClickableTile, {
|
|
394
|
+
props: {
|
|
395
|
+
icon: 'utilisateur',
|
|
396
|
+
tileTitle: 'Test',
|
|
397
|
+
disabled: true,
|
|
398
|
+
},
|
|
399
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
400
|
+
})
|
|
401
|
+
})
|
|
402
|
+
|
|
403
|
+
it('applies disabled styling to button', () => {
|
|
404
|
+
expect(vueWrapper.find('button').attributes('disabled')).toBeDefined()
|
|
405
|
+
})
|
|
406
|
+
|
|
407
|
+
it('button has disabled attribute when disabled prop is true', async () => {
|
|
408
|
+
expect(vueWrapper.find('button').attributes('disabled')).toBeDefined()
|
|
409
|
+
await vueWrapper.setProps({ disabled: false })
|
|
410
|
+
expect(vueWrapper.find('button').attributes('disabled')).toBeUndefined()
|
|
411
|
+
})
|
|
412
|
+
})
|
|
413
|
+
|
|
414
|
+
describe('ID generation', () => {
|
|
415
|
+
it('generates proper IDs for all elements when uniqueId is provided', () => {
|
|
416
|
+
const vueWrapper = mount(AmeliproClickableTile, {
|
|
417
|
+
props: {
|
|
418
|
+
icon: 'utilisateur',
|
|
419
|
+
tileTitle: 'Test',
|
|
420
|
+
uniqueId: 'test-tile',
|
|
421
|
+
},
|
|
422
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
423
|
+
})
|
|
424
|
+
|
|
425
|
+
expect(vueWrapper.attributes('id')).toBe('test-tile')
|
|
426
|
+
expect(vueWrapper.find('#test-tile-icon').exists()).toBe(true)
|
|
427
|
+
expect(vueWrapper.find('#test-tile-icon-arrow').exists()).toBe(true)
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
it('works without uniqueId', () => {
|
|
431
|
+
const vueWrapper = mount(AmeliproClickableTile, {
|
|
432
|
+
props: {
|
|
433
|
+
icon: 'utilisateur',
|
|
434
|
+
tileTitle: 'Test',
|
|
435
|
+
},
|
|
436
|
+
global: { stubs: { VBtn: VBtnStub } },
|
|
437
|
+
})
|
|
438
|
+
|
|
439
|
+
expect(vueWrapper.attributes('id')).toBeUndefined()
|
|
440
|
+
expect(vueWrapper.find('[id*="-icon"]').exists()).toBe(false)
|
|
441
|
+
})
|
|
16
442
|
})
|
|
17
443
|
})
|
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
+
exports[`AmeliproClickableTile > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<v-btn-stub
|
|
5
|
+
block="false"
|
|
6
|
+
border="false"
|
|
7
|
+
class="
|
|
8
|
+
amelipro-clickable-tile
|
|
9
|
+
text-none
|
|
10
|
+
"
|
|
11
|
+
density="default"
|
|
12
|
+
disabled="false"
|
|
13
|
+
elevation="0"
|
|
14
|
+
exact="false"
|
|
15
|
+
flat="false"
|
|
16
|
+
height="auto"
|
|
17
|
+
icon="false"
|
|
18
|
+
id="modified-unique-id"
|
|
19
|
+
loading="false"
|
|
20
|
+
replace="false"
|
|
21
|
+
ripple="false"
|
|
22
|
+
size="default"
|
|
23
|
+
slim="false"
|
|
24
|
+
stacked="false"
|
|
25
|
+
symbol="Symbol(vuetify:v-btn-toggle)"
|
|
26
|
+
tag="button"
|
|
27
|
+
tile="false"
|
|
28
|
+
variant="elevated"
|
|
29
|
+
width="100%"
|
|
30
|
+
></v-btn-stub>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`AmeliproClickableTile > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
34
|
+
<v-btn-stub
|
|
35
|
+
block="false"
|
|
36
|
+
border="false"
|
|
37
|
+
class="
|
|
38
|
+
amelipro-clickable-tile
|
|
39
|
+
text-none
|
|
40
|
+
"
|
|
41
|
+
density="default"
|
|
42
|
+
disabled="false"
|
|
43
|
+
elevation="0"
|
|
44
|
+
exact="false"
|
|
45
|
+
flat="false"
|
|
46
|
+
height="auto"
|
|
47
|
+
icon="false"
|
|
48
|
+
id="required-unique-id"
|
|
49
|
+
loading="false"
|
|
50
|
+
replace="false"
|
|
51
|
+
ripple="false"
|
|
52
|
+
size="default"
|
|
53
|
+
slim="false"
|
|
54
|
+
stacked="false"
|
|
55
|
+
symbol="Symbol(vuetify:v-btn-toggle)"
|
|
56
|
+
tag="button"
|
|
57
|
+
tile="false"
|
|
58
|
+
variant="elevated"
|
|
59
|
+
width="100%"
|
|
60
|
+
></v-btn-stub>
|
|
61
|
+
`;
|
|
62
|
+
|
|
3
63
|
exports[`AmeliproClickableTile > render correctly 1`] = `
|
|
4
64
|
<button
|
|
5
65
|
class="
|
|
@@ -348,7 +348,7 @@ describe('AmeliproIcon', () => {
|
|
|
348
348
|
})
|
|
349
349
|
|
|
350
350
|
it('themeIcon returns the good values', () => {
|
|
351
|
-
const expectedResult = `<svg
|
|
351
|
+
const expectedResult = `<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 1823 1823">
|
|
352
352
|
<circle class="circle-color" cx="912" cy="912" r="912"></circle>
|
|
353
353
|
<path class="shape-color" d="M962 454c117 0 125 154 125 154v145s1 111-73 152c-2 10-3 20-1 30 4-2-21 146 106 165 92 15 178 57 247 120 23 23 40 186 40 186H418s-2-132 40-186c73-62 162-104 257-120 128-19 85-160 89-158 2-10 1-21-1-31 0 0-69-89-68-169 1-81 0-134 0-134s-4-190 126-190l101 36z"></path>
|
|
354
354
|
</svg>`
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { mdiArrowLeft } from '@mdi/js'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
4
|
import { locales } from './locales'
|
|
5
|
+
import SyIcon from '@/components/Customs/SyIcon/SyIcon.vue'
|
|
5
6
|
|
|
6
7
|
const props = withDefaults(defineProps<{
|
|
7
8
|
hideBackIcon?: boolean
|
|
@@ -35,14 +36,14 @@
|
|
|
35
36
|
:style="{ backgroundColor: buttonBgColor }"
|
|
36
37
|
>
|
|
37
38
|
<slot name="icon">
|
|
38
|
-
<
|
|
39
|
+
<SyIcon
|
|
39
40
|
v-if="!props.hideBackIcon"
|
|
41
|
+
:icon="mdiArrowLeft"
|
|
42
|
+
decorative
|
|
40
43
|
:color="iconColor"
|
|
41
44
|
:class="{ 'ml-n1': isDark }"
|
|
42
45
|
class="mr-1"
|
|
43
|
-
|
|
44
|
-
{{ mdiArrowLeft }}
|
|
45
|
-
</VIcon>
|
|
46
|
+
/>
|
|
46
47
|
</slot>
|
|
47
48
|
|
|
48
49
|
<slot>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import * as Stories from '../BackBtn.stories.ts';
|
|
3
|
+
import '@/stories/styles/shared.css';
|
|
4
|
+
|
|
5
|
+
<Meta of={Stories} />
|
|
6
|
+
|
|
7
|
+
<div className="header">
|
|
8
|
+
<h1>Accessibilité</h1>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
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>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { locales } from './locales'
|
|
10
10
|
import { config } from './config'
|
|
11
|
+
import SyIcon from '@/components/Customs/SyIcon/SyIcon.vue'
|
|
11
12
|
|
|
12
13
|
import { type VBtn } from 'vuetify/components'
|
|
13
14
|
|
|
@@ -116,9 +117,11 @@
|
|
|
116
117
|
</span>
|
|
117
118
|
|
|
118
119
|
<slot name="icon">
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
<SyIcon
|
|
121
|
+
v-bind="options.icon"
|
|
122
|
+
:icon="mdiArrowUp"
|
|
123
|
+
decorative
|
|
124
|
+
/>
|
|
122
125
|
</slot>
|
|
123
126
|
</VBtn>
|
|
124
127
|
</VFadeTransition>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import * as Stories from '../BackToTopBtn.stories.ts';
|
|
3
|
+
import '@/stories/styles/shared.css';
|
|
4
|
+
|
|
5
|
+
<Meta of={Stories} />
|
|
6
|
+
|
|
7
|
+
<div className="header">
|
|
8
|
+
<h1>Accessibilité</h1>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<div class="mt-2">
|
|
13
|
+
<p>Rapport d’audit 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>
|
|
15
|
+
</div>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import volumeUp from './icons/volumeUp.vue'
|
|
12
12
|
import { locales as defaultLocales } from './locales'
|
|
13
13
|
import { type CaptchaType, type StateType } from './types'
|
|
14
|
+
import SyIcon from '@/components/Customs/SyIcon/SyIcon.vue'
|
|
14
15
|
|
|
15
16
|
const props = withDefaults(defineProps<{
|
|
16
17
|
urlCreate: string
|
|
@@ -202,7 +203,10 @@
|
|
|
202
203
|
@click="toggleAudio"
|
|
203
204
|
>
|
|
204
205
|
<span v-if="isPlaying">
|
|
205
|
-
<
|
|
206
|
+
<SyIcon
|
|
207
|
+
:icon="mdiPause"
|
|
208
|
+
decorative
|
|
209
|
+
/>
|
|
206
210
|
{{ locales.pause }}
|
|
207
211
|
</span>
|
|
208
212
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { mdiAlertCircleOutline, mdiAutorenew } from '@mdi/js'
|
|
3
3
|
import { useAttrs } from 'vue'
|
|
4
4
|
import type { locales as defaultLocales } from './locales'
|
|
5
|
+
import SyIcon from '@/components/Customs/SyIcon/SyIcon.vue'
|
|
5
6
|
|
|
6
7
|
defineProps<{
|
|
7
8
|
locales: typeof defaultLocales
|
|
@@ -22,12 +23,12 @@
|
|
|
22
23
|
v-bind="attrs"
|
|
23
24
|
>
|
|
24
25
|
<template #prepend>
|
|
25
|
-
<
|
|
26
|
+
<SyIcon
|
|
26
27
|
color="error"
|
|
27
28
|
class="mr-2"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
:icon="errorIcon"
|
|
30
|
+
decorative
|
|
31
|
+
/>
|
|
31
32
|
</template>
|
|
32
33
|
|
|
33
34
|
<span>
|
|
@@ -44,9 +45,10 @@
|
|
|
44
45
|
<p class="d-sr-only">
|
|
45
46
|
{{ locales.renew }}
|
|
46
47
|
</p>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
<SyIcon
|
|
49
|
+
:icon="renewIcon"
|
|
50
|
+
decorative
|
|
51
|
+
/>
|
|
50
52
|
</VBtn>
|
|
51
53
|
</template>
|
|
52
54
|
</VAlert>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import * as CaptchaStorie from '../Captcha.stories';
|
|
3
|
+
import '@/stories/styles/shared.css';
|
|
4
|
+
|
|
5
|
+
<Meta of={CaptchaStorie} />
|
|
6
|
+
|
|
7
|
+
<div className="header">
|
|
8
|
+
<h1>Accessibilité</h1>
|
|
9
|
+
<p>Cette page sera bientôt disponible</p>
|
|
10
|
+
</div>
|