@cnamts/synapse 1.0.5 → 1.0.7
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-BQpRKTju.js → DateFilter-CHDLz2EO.js} +1 -1
- package/dist/{NumberFilter-BykSKt2D.js → NumberFilter-DXNQ4Uls.js} +1 -1
- package/dist/{PeriodFilter-Cks6NygV.js → PeriodFilter-C8Qf3Jcn.js} +1 -1
- package/dist/{SelectFilter-DEL5dHd_.js → SelectFilter-B2Ejs4Cb.js} +1 -1
- package/dist/{TextFilter-0RAFj7Oe.js → TextFilter-CfR5_A1S.js} +1 -1
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordion.d.ts +103 -0
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.d.ts +105 -0
- package/dist/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.d.ts +116 -0
- package/dist/components/Amelipro/AmeliproAccordionGroup/types.d.ts +4 -0
- package/dist/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.d.ts +220 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.d.ts +68 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.d.ts +70 -0
- package/dist/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.d.ts +204 -0
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +26 -26
- package/dist/components/Amelipro/AmeliproBadge/AmeliproBadge.d.ts +59 -0
- package/dist/components/Amelipro/AmeliproBtn/AmeliproBtn.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.d.ts +132 -0
- package/dist/components/Amelipro/AmeliproCaptcha/types.d.ts +5 -0
- package/dist/components/Amelipro/AmeliproCard/AmeliproCard.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +214 -0
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.d.ts +70 -0
- package/dist/components/Amelipro/AmeliproCarousel/types.d.ts +7 -0
- package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +125 -0
- package/dist/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.d.ts +126 -0
- package/dist/components/Amelipro/AmeliproCustomSelector/types.d.ts +6 -0
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproResultList/AmeliproResultList.d.ts +164 -0
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +27 -27
- package/dist/components/Amelipro/AmeliproStateTile/AmeliproStateTile.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +190 -0
- package/dist/components/Amelipro/AmeliproTable/types.d.ts +34 -0
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +32 -32
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +6 -6
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +7 -7
- package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproTooltips/AmeliproTooltips.d.ts +2 -2
- package/dist/components/Amelipro/types.d.ts +6 -0
- package/dist/components/ChipList/ChipList.d.ts +4 -0
- package/dist/components/ChipList/locales.d.ts +4 -2
- package/dist/components/CookieBanner/CookieBanner.d.ts +1 -1
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +8 -8
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +454 -8
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +6 -1
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +2 -0
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +71 -0
- package/dist/components/Customs/SyTabs/config.d.ts +17 -0
- package/dist/components/Customs/SyTabs/types.d.ts +11 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +12 -10
- package/dist/components/DataList/DataList.d.ts +10 -1
- package/dist/components/DataListGroup/DataListGroup.d.ts +10 -1
- package/dist/components/DataListItem/DataListItem.d.ts +1 -1
- package/dist/components/DataListItem/config.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +4825 -244
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +58 -29
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +28 -10
- package/dist/components/DatePicker/composables/useDateInputEditing.d.ts +18 -8
- package/dist/components/DatePicker/composables/useKeyboardEvents.d.ts +41 -0
- package/dist/components/DatePicker/composables/useManualDateValidation.d.ts +4 -9
- package/dist/components/DatePicker/composables/useTodayButton.d.ts +1 -0
- package/dist/components/DatePicker/utils/dateFormattingUtils.d.ts +72 -0
- package/dist/components/DatePicker/utils/validationUtils.d.ts +38 -0
- package/dist/components/DialogBox/DialogBox.d.ts +219 -0
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.d.ts +9 -3
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.d.ts +6 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.d.ts +11 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.d.ts +11 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/locals.d.ts +2 -0
- package/dist/components/HeaderBar/HeaderBurgerMenu/useMenuPosition.d.ts +4 -0
- package/dist/components/HeaderLoading/HeaderLoading.d.ts +27 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +110 -3
- package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +19 -1
- package/dist/components/LangBtn/LangBtn.d.ts +2 -2
- package/dist/components/NirField/NirField.d.ts +30 -20
- package/dist/components/PeriodField/PeriodField.d.ts +10949 -1783
- package/dist/components/PhoneField/PhoneField.d.ts +1866 -2
- package/dist/components/PhoneField/indicatifs.d.ts +1 -0
- package/dist/components/PhoneField/locales.d.ts +1 -0
- package/dist/components/RangeField/RangeField.d.ts +1 -1
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +1 -1
- package/dist/components/SubHeader/SubHeader.d.ts +8 -0
- package/dist/components/SubHeader/locales.d.ts +1 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +6 -6
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -4
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -4
- package/dist/components/Tables/common/SyTablePagination.d.ts +458 -7
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +2 -2
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/usePagination.d.ts +16 -0
- package/dist/design-system-v3.js +174 -160
- package/dist/design-system-v3.umd.cjs +290 -281
- package/dist/directives/lockFocus.d.ts +17 -0
- package/dist/{main-Co2P_lBt.js → main-C66C1BkG.js} +14406 -11554
- package/dist/style.css +1 -1
- package/package.json +4 -1
- package/src/assets/amelipro/apTheme.scss +149 -0
- package/src/assets/amelipro/apTokens.scss +0 -148
- package/src/assets/amelipro/icons.ts +38 -11
- package/src/assets/overrides/_btns.scss +15 -0
- package/src/assets/overrides/_container.scss +36 -0
- package/src/assets/overrides/_forms.scss +7 -0
- package/src/assets/{_spacers.scss → overrides/_spacers.scss} +0 -7
- package/src/assets/overrides/_tables.scss +18 -0
- package/src/assets/overrides/_tooltips.scss +10 -0
- package/src/assets/overrides/_typography.scss +196 -0
- package/src/assets/settings.scss +11 -51
- package/src/assets/themes.scss +10 -0
- package/src/assets/tokens.scss +9 -156
- package/src/components/Accordion/composables/__tests__/useAccordionGroupCommunication.spec.ts +80 -40
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.mdx +15 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +83 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.vue +86 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.vue +242 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/AmeliproAccordionTemplate.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/__snapshots__/AmeliproAccordionTemplate.spec.ts.snap +124 -0
- package/src/components/Amelipro/AmeliproAccordion/__tests__/AmeliproAccordion.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproAccordion/__tests__/__snapshots__/AmeliproAccordion.spec.ts.snap +124 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.mdx +20 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.stories.ts +135 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.vue +107 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/AmeliproAccordionGroup.spec.ts +37 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/__snapshots__/AmeliproAccordionGroup.spec.ts.snap +513 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/types.d.ts +4 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.mdx +16 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +300 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +288 -0
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/AmeliproAccordionList.spec.ts +38 -0
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +1712 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.mdx +19 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +68 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.vue +66 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.vue +145 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/AmeliproAccordionResultTemplate.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/__snapshots__/AmeliproAccordionResultTemplate.spec.ts.snap +127 -0
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/AmeliproAccordionResult.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/__snapshots__/AmeliproAccordionResult.spec.ts.snap +123 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.mdx +20 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +273 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +275 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/AmeliproAccordionResultList.spec.ts +38 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +1593 -0
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.mdx +15 -0
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.stories.ts +54 -0
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.vue +76 -0
- package/src/components/Amelipro/AmeliproBadge/__tests__/AmeliproBadge.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproBadge/__tests__/__snapshots__/AmeliproBadge.spec.ts.snap +19 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.mdx +15 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.stories.ts +87 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.vue +233 -0
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/AmeliproCaptcha.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +384 -0
- package/src/components/Amelipro/AmeliproCaptcha/types.d.ts +5 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.mdx +15 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.stories.ts +191 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.vue +263 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.vue +93 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/__tests__/AmeliproCarouselItem.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/__tests__/__snapshots__/AmeliproCarouselItem.spec.ts.snap +43 -0
- package/src/components/Amelipro/AmeliproCarousel/__tests__/AmeliproCarousel.spec.ts +40 -0
- package/src/components/Amelipro/AmeliproCarousel/__tests__/__snapshots__/AmeliproCarousel.spec.ts.snap +342 -0
- package/src/components/Amelipro/AmeliproCarousel/types.d.ts +8 -0
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.mdx +18 -0
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.stories.ts +67 -0
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.vue +233 -0
- package/src/components/Amelipro/AmeliproClickableTile/tests/AmeliproClickableTile.spec.ts +21 -0
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +140 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.mdx +15 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.stories.ts +143 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +351 -0
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/AmeliproCustomSelector.spec.ts +50 -0
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +186 -0
- package/src/components/Amelipro/AmeliproCustomSelector/types.d.ts +6 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +7 -1
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +5 -711
- package/src/components/Amelipro/AmeliproIcon/iconList.ts +6 -0
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +5 -711
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.mdx +15 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +264 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +231 -0
- package/src/components/Amelipro/AmeliproResultList/__tests__/AmeliproResultList.spec.ts +37 -0
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +434 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.mdx +22 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +550 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +422 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +72 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +424 -0
- package/src/components/Amelipro/AmeliproTable/types.d.ts +34 -0
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.stories.ts +2 -2
- package/src/components/Amelipro/ServiceMenu/ServiceMenu.vue +12 -1
- package/src/components/Amelipro/ServiceMenu/tests/__snapshots__/ServiceMenu.spec.ts.snap +0 -820
- package/src/components/Amelipro/types.ts +8 -0
- package/src/components/ChipList/Accessibilite.stories.ts +4 -0
- package/src/components/ChipList/ChipList.vue +185 -42
- package/src/components/ChipList/locales.ts +4 -2
- package/src/components/ChipList/tests/chipList.spec.ts +7 -4
- package/src/components/CollapsibleList/CollapsibleList.vue +0 -2
- package/src/components/CookieBanner/CookieBanner.vue +1 -3
- package/src/components/CopyBtn/CopyBtn.vue +9 -2
- package/src/components/CopyBtn/tests/CopyBtn.spec.ts +3 -1
- package/src/components/Customs/Selects/SelectOverview.mdx +18 -15
- package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.stories.ts +10 -10
- package/src/components/Customs/Selects/SySelect/Accessibilite.mdx +7 -0
- package/src/components/Customs/Selects/SySelect/Accessibilite.stories.ts +4 -1
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +92 -4
- package/src/components/Customs/Selects/SySelect/SySelect.vue +373 -56
- package/src/components/Customs/Selects/SySelect/composables/tests/useSySelectKeyboard.spec.ts +14 -5
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +129 -12
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +3 -1
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +165 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +28 -9
- package/src/components/Customs/SyIcon/SyIcon.spec.ts +3 -0
- package/src/components/Customs/SyTabs/Accessibilite.mdx +309 -0
- package/src/components/Customs/SyTabs/SyTabs.mdx +117 -0
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +354 -0
- package/src/components/Customs/SyTabs/SyTabs.vue +350 -0
- package/src/components/Customs/SyTabs/config.ts +17 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +425 -0
- package/src/components/Customs/SyTabs/types.ts +12 -0
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +3 -1
- package/src/components/Customs/SyTextField/SyTextField.mdx +3 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +221 -7
- package/src/components/Customs/SyTextField/SyTextField.vue +226 -29
- package/src/components/DataList/Accessibilite.stories.ts +4 -0
- package/src/components/DataList/DataList.vue +52 -47
- package/src/components/DataListGroup/Accessibilite.stories.ts +4 -0
- package/src/components/DataListGroup/DataListGroup.vue +32 -15
- package/src/components/DataListItem/DataListItem.vue +72 -65
- package/src/components/DataListItem/config.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +3 -3
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +59 -18
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +174 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +421 -636
- package/src/components/DatePicker/DatePickerValidationExample/CalendarMode.stories.ts +215 -0
- package/src/components/DatePicker/DatePickerValidationExample/ComplexDatePicker.stories.ts +218 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +2 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +287 -1
- package/src/components/DatePicker/DatePickerValidationExample/DateTextInput.stories.ts +218 -0
- package/src/components/DatePicker/DatePickerValidationExample/MultiMode.stories.ts +281 -0
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +17 -4
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +111 -18
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +238 -6
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +716 -759
- package/src/components/DatePicker/composables/tests/useDateInputEditing.spec.ts +4 -4
- package/src/components/DatePicker/composables/tests/useDisplayedDateString.spec.ts +17 -10
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +11 -3
- package/src/components/DatePicker/composables/useDateInputEditing.ts +119 -225
- package/src/components/DatePicker/composables/useDisplayedDateString.ts +18 -4
- package/src/components/DatePicker/composables/useKeyboardEvents.ts +149 -0
- package/src/components/DatePicker/composables/useManualDateValidation.ts +27 -68
- package/src/components/DatePicker/composables/useTodayButton.ts +13 -1
- package/src/components/DatePicker/utils/dateFormattingUtils.ts +293 -0
- package/src/components/DatePicker/utils/validationUtils.ts +90 -0
- package/src/components/DialogBox/Accessibilite.stories.ts +4 -0
- package/src/components/DialogBox/DialogBox.stories.ts +22 -10
- package/src/components/DialogBox/DialogBox.vue +89 -22
- package/src/components/DialogBox/tests/DialogBox.spec.ts +22 -0
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +12 -6
- package/src/components/FileUpload/tests/FileUpload.spec.ts +3 -0
- package/src/components/FooterBar/FooterBar.vue +1 -0
- package/src/components/HeaderBar/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderBar/HeaderBar.mdx +47 -22
- package/src/components/HeaderBar/HeaderBar.stories.ts +54 -13
- package/src/components/HeaderBar/HeaderBar.vue +2 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +160 -82
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +41 -56
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +10 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +41 -18
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +7 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +36 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +41 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/locals.ts +2 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +8 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/useMenuPosition.ts +50 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +5 -5
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +7 -4
- package/src/components/HeaderBar/locales.ts +1 -1
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +2 -1
- package/src/components/HeaderLoading/Accessibilite.mdx +429 -8
- package/src/components/HeaderLoading/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderLoading/HeaderLoading.vue +59 -1
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +17 -2
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +91 -2
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +37 -1
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +276 -21
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +4 -2
- package/src/components/LangBtn/LangBtn.vue +0 -3
- package/src/components/LogoBrandSection/Accessibilite.stories.ts +4 -1
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
- package/src/components/LogoBrandSection/LogoBrandSection.vue +13 -8
- package/src/components/LogoBrandSection/locales.ts +1 -1
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +1 -1
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +6 -4
- package/src/components/NirField/NirField.mdx +3 -0
- package/src/components/NirField/NirField.vue +15 -6
- package/src/components/NirField/tests/NirField.spec.ts +159 -12
- package/src/components/PasswordField/PasswordField.mdx +3 -0
- package/src/components/PeriodField/PeriodField.mdx +2 -0
- package/src/components/PeriodField/PeriodField.stories.ts +195 -0
- package/src/components/PhoneField/Accessibilite.stories.ts +4 -0
- package/src/components/PhoneField/PhoneField.mdx +3 -1
- package/src/components/PhoneField/PhoneField.stories.ts +285 -1
- package/src/components/PhoneField/PhoneField.vue +228 -95
- package/src/components/PhoneField/indicatifs.ts +102 -102
- package/src/components/PhoneField/locales.ts +1 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +429 -2
- package/src/components/SkipLink/SkipLink.vue +3 -31
- package/src/components/SkipLink/tests/skipLink.spec.ts +0 -21
- package/src/components/SubHeader/Accessibilite.stories.ts +8 -0
- package/src/components/SubHeader/SubHeader.mdx +1 -0
- package/src/components/SubHeader/SubHeader.stories.ts +179 -60
- package/src/components/SubHeader/SubHeader.vue +45 -15
- package/src/components/SubHeader/locales.ts +1 -0
- package/src/components/SyAlert/SyAlert.vue +6 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +3 -10
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +242 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +29 -10
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +104 -6
- package/src/components/Tables/SyTable/SyTable.mdx +3 -10
- package/src/components/Tables/SyTable/SyTable.stories.ts +242 -0
- package/src/components/Tables/SyTable/SyTable.vue +2 -0
- package/src/components/Tables/common/SyTablePagination.vue +13 -6
- package/src/components/Tables/common/TableHeader.vue +10 -7
- package/src/components/Tables/common/tableAccessibilityUtils.ts +13 -2
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +157 -0
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/Tables/common/useTableAria.ts +17 -1
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +2 -1
- package/src/components/index.ts +13 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +34 -5
- package/src/composables/index.ts +3 -0
- package/src/composables/useFilterable/useFilterable.ts +23 -1
- package/src/composables/usePagination.ts +103 -0
- package/src/designTokens/tokens/amelipro/apColors.ts +1 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +3 -3
- package/src/directives/lockFocus.ts +48 -0
- package/src/main.ts +1 -2
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +1 -8
- package/src/stories/Accessibilite/{Aculturation/AuditDesignSystem.mdx → AuditDesignSystem.mdx} +1 -1
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.mdx +102 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.stories.ts +219 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/{Tanaguru.mdx → Tanaguru/Utilisation.mdx} +1 -1
- package/src/stories/Components/Components.stories.ts +1 -1
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +43 -0
- package/src/stories/DesignTokens/Colors.mdx +2 -0
- package/src/stories/DesignTokens/colors.stories.ts +9 -0
- package/src/stories/GuideDuDev/FormValidationGuide.mdx +342 -0
- package/src/stories/Templates/Templates.stories.ts +1 -1
- package/src/utils/functions/ameliproColors/ameliproColors.ts +1 -1
- package/src/vuetifyConfig.ts +3 -3
- package/dist/components/DataList/locales.d.ts +0 -3
- package/dist/directives/letterSpacing.d.ts +0 -27
- package/src/assets/_fonts.scss +0 -6
- package/src/assets/_typography.scss +0 -157
- package/src/components/DataList/locales.ts +0 -3
- package/src/components/PhoneField/tests/PhoneField.additional.spec.ts +0 -266
- package/src/directives/letterSpacing.ts +0 -233
- /package/src/assets/{_elevations.scss → overrides/_elevations.scss} +0 -0
- /package/src/assets/{_radius.scss → overrides/_radius.scss} +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Guide Du Dev/Guide de Validation des Formulaires"/>
|
|
4
|
+
|
|
5
|
+
# Guide de Validation des Formulaires
|
|
6
|
+
|
|
7
|
+
Ce guide pratique explique comment utiliser le système de validation des formulaires du Design System dans vos applications.
|
|
8
|
+
|
|
9
|
+
## Les bases de la validation
|
|
10
|
+
|
|
11
|
+
Le système de validation offre un mécanisme complet et intuitif pour valider les entrées utilisateur avec trois niveaux de retour :
|
|
12
|
+
|
|
13
|
+
- **Erreurs** 🔴 : Empêchent la soumission du formulaire
|
|
14
|
+
- **Avertissements** 🟠 : Informent l'utilisateur sans bloquer la soumission
|
|
15
|
+
- **Succès** 🟢 : Confirment la validité de l'entrée
|
|
16
|
+
|
|
17
|
+
## Mise en place simple
|
|
18
|
+
|
|
19
|
+
Voici comment mettre en place une validation basique sur un champ :
|
|
20
|
+
|
|
21
|
+
<Source dark code={`
|
|
22
|
+
<template>
|
|
23
|
+
<SyTextField
|
|
24
|
+
v-model="email"
|
|
25
|
+
label="Email"
|
|
26
|
+
:custom-rules="emailRules"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { ref } from 'vue';
|
|
32
|
+
import { SyTextField } from '@cnamts/synapse';
|
|
33
|
+
|
|
34
|
+
const email = ref('');
|
|
35
|
+
|
|
36
|
+
const emailRules = [
|
|
37
|
+
{
|
|
38
|
+
type: 'required',
|
|
39
|
+
options: { message: "L'email est obligatoire" }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: 'email',
|
|
43
|
+
options: { message: "L'email n'est pas valide" }
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
</script>
|
|
47
|
+
`}/>
|
|
48
|
+
|
|
49
|
+
## Validation complète avec les 3 niveaux
|
|
50
|
+
|
|
51
|
+
Utilisez les différents types de règles pour une expérience utilisateur riche :
|
|
52
|
+
|
|
53
|
+
<Source dark code={`
|
|
54
|
+
<script setup>
|
|
55
|
+
import { ref } from 'vue'
|
|
56
|
+
import PasswordField from '@/components/PasswordField/PasswordField.vue'
|
|
57
|
+
|
|
58
|
+
const password = ref('')
|
|
59
|
+
|
|
60
|
+
// Règles d'erreur (bloquantes)
|
|
61
|
+
const passwordRules = [
|
|
62
|
+
{
|
|
63
|
+
type: 'required',
|
|
64
|
+
options: {
|
|
65
|
+
message: 'Le mot de passe est obligatoire',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'minLength',
|
|
70
|
+
options: {
|
|
71
|
+
length: 8,
|
|
72
|
+
message: 'Le mot de passe doit contenir au moins 8 caractères',
|
|
73
|
+
// si pas de successMessage, le message par defaut est affiché
|
|
74
|
+
successMessage: 'Le mot de passe est sécurisé',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
// Règles d'avertissement (non-bloquantes)
|
|
80
|
+
const passwordWarningRules = [
|
|
81
|
+
{
|
|
82
|
+
type: 'custom',
|
|
83
|
+
options: {
|
|
84
|
+
validate: (value) => {
|
|
85
|
+
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(value)
|
|
86
|
+
if (!hasSpecialChar) {
|
|
87
|
+
return 'Le mot de passe pourrait être plus fort avec des caractères spéciaux'
|
|
88
|
+
}
|
|
89
|
+
return true
|
|
90
|
+
},
|
|
91
|
+
fieldIdentifier: 'password',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<PasswordField
|
|
100
|
+
v-model="password"
|
|
101
|
+
label="Mot de passe"
|
|
102
|
+
:custom-warning-rules="passwordWarningRules"
|
|
103
|
+
:custom-rules="passwordRules"
|
|
104
|
+
/>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
`}/>
|
|
108
|
+
|
|
109
|
+
## Validation à la soumission avec validateOnSubmit
|
|
110
|
+
|
|
111
|
+
La méthode `validateOnSubmit` est essentielle pour valider l'ensemble du formulaire lors de sa soumission :
|
|
112
|
+
|
|
113
|
+
<Source dark code={`
|
|
114
|
+
<template>
|
|
115
|
+
<form @submit.prevent="handleSubmit">
|
|
116
|
+
<SyTextField
|
|
117
|
+
ref="emailField"
|
|
118
|
+
v-model="email"
|
|
119
|
+
label="Email"
|
|
120
|
+
:custom-rules="emailRules"
|
|
121
|
+
/>
|
|
122
|
+
|
|
123
|
+
<PasswordField
|
|
124
|
+
ref="passwordField"
|
|
125
|
+
v-model="password"
|
|
126
|
+
label="Mot de passe"
|
|
127
|
+
type="password"
|
|
128
|
+
:custom-rules="passwordRules"
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
<VBtn type="submit">Se connecter</VBtn>
|
|
132
|
+
|
|
133
|
+
<p v-if="formError" class="error-message">{{ formError }}</p>
|
|
134
|
+
</form>
|
|
135
|
+
</template>
|
|
136
|
+
|
|
137
|
+
<script setup>
|
|
138
|
+
import { ref } from 'vue';
|
|
139
|
+
import { SyTextField, PasswordField } from '@cnamts/synapse';
|
|
140
|
+
|
|
141
|
+
const email = ref('');
|
|
142
|
+
const password = ref('');
|
|
143
|
+
const formError = ref('');
|
|
144
|
+
|
|
145
|
+
const emailField = ref();
|
|
146
|
+
const passwordField = ref();
|
|
147
|
+
|
|
148
|
+
const emailRules = [
|
|
149
|
+
{ type: 'required', options: { message: "L'email est obligatoire" } },
|
|
150
|
+
{ type: 'email', options: { message: "L'email n'est pas valide" } }
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
const passwordRules = [
|
|
154
|
+
{ type: 'required', options: { message: 'Le mot de passe est obligatoire' } }
|
|
155
|
+
];
|
|
156
|
+
|
|
157
|
+
const handleSubmit = async () => {
|
|
158
|
+
formError.value = '';
|
|
159
|
+
|
|
160
|
+
// Validation de tous les champs
|
|
161
|
+
const isEmailValid = await emailField.value.validateOnSubmit();
|
|
162
|
+
const isPasswordValid = await passwordField.value.validateOnSubmit();
|
|
163
|
+
|
|
164
|
+
if (isEmailValid && isPasswordValid) {
|
|
165
|
+
// Soumettre le formulaire
|
|
166
|
+
console.log('Formulaire soumis avec succès !');
|
|
167
|
+
// loginUser(email.value, password.value);
|
|
168
|
+
} else {
|
|
169
|
+
formError.value = 'Veuillez corriger les erreurs dans le formulaire';
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
</script>
|
|
173
|
+
`}/>
|
|
174
|
+
|
|
175
|
+
## Validation croisée entre champs
|
|
176
|
+
|
|
177
|
+
Parfois, la validation d'un champ dépend de la valeur d'un autre champ. Voici comment gérer ce cas :
|
|
178
|
+
|
|
179
|
+
<Source dark code={`
|
|
180
|
+
<template>
|
|
181
|
+
<form @submit.prevent="handleSubmit">
|
|
182
|
+
<PasswordField
|
|
183
|
+
ref="passwordField"
|
|
184
|
+
v-model="password"
|
|
185
|
+
label="Mot de passe"
|
|
186
|
+
type="password"
|
|
187
|
+
:custom-rules="passwordRules"
|
|
188
|
+
/>
|
|
189
|
+
|
|
190
|
+
<PasswordField
|
|
191
|
+
ref="confirmPasswordField"
|
|
192
|
+
v-model="confirmPassword"
|
|
193
|
+
label="Confirmer le mot de passe"
|
|
194
|
+
type="password"
|
|
195
|
+
:custom-rules="confirmPasswordRules"
|
|
196
|
+
/>
|
|
197
|
+
|
|
198
|
+
<VBtn type="submit">S'inscrire</VBtn>
|
|
199
|
+
</form>
|
|
200
|
+
</template>
|
|
201
|
+
|
|
202
|
+
<script setup>
|
|
203
|
+
import { ref, watch } from 'vue';
|
|
204
|
+
import { PasswordField } from '@cnamts/synapse';
|
|
205
|
+
|
|
206
|
+
const password = ref('');
|
|
207
|
+
const confirmPassword = ref('');
|
|
208
|
+
|
|
209
|
+
const passwordField = ref();
|
|
210
|
+
const confirmPasswordField = ref();
|
|
211
|
+
|
|
212
|
+
const passwordRules = [
|
|
213
|
+
{ type: 'required', options: { message: 'Le mot de passe est obligatoire' } },
|
|
214
|
+
{ type: 'minLength', options: { length: 8, message: 'Le mot de passe doit contenir au moins 8 caractères' } }
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
const confirmPasswordRules = [
|
|
218
|
+
{ type: 'required', options: { message: 'La confirmation du mot de passe est obligatoire' } },
|
|
219
|
+
{
|
|
220
|
+
type: 'custom',
|
|
221
|
+
options: {
|
|
222
|
+
validate: (value) => {
|
|
223
|
+
if (value !== password.value) {
|
|
224
|
+
return 'Les mots de passe ne correspondent pas';
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
];
|
|
231
|
+
|
|
232
|
+
// Revalider la confirmation lorsque le mot de passe change
|
|
233
|
+
watch(password, () => {
|
|
234
|
+
if (confirmPassword.value && confirmPasswordField.value) {
|
|
235
|
+
// Forcer la validation du champ de confirmation
|
|
236
|
+
confirmPasswordField.value.validateOnSubmit();
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
const handleSubmit = async () => {
|
|
241
|
+
// Validation de tous les champs
|
|
242
|
+
const isPasswordValid = await passwordField.value.validateOnSubmit();
|
|
243
|
+
const isConfirmValid = await confirmPasswordField.value.validateOnSubmit();
|
|
244
|
+
|
|
245
|
+
if (isPasswordValid && isConfirmValid) {
|
|
246
|
+
// Soumettre le formulaire
|
|
247
|
+
console.log('Inscription réussie !');
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
</script>
|
|
251
|
+
`}/>
|
|
252
|
+
|
|
253
|
+
## Composants avec validation intégrée
|
|
254
|
+
|
|
255
|
+
Plusieurs composants du Design System intègrent déjà la validation :
|
|
256
|
+
|
|
257
|
+
- **SyTextField** : Pour les champs texte
|
|
258
|
+
- **NirField** : Pour les numéros de sécurité sociale
|
|
259
|
+
- **DatePicker** : Pour les dates
|
|
260
|
+
- **PeriodField** : Pour les périodes (deux dates liées)
|
|
261
|
+
- **PasswordField** : Pour les mots de passe sécurisés
|
|
262
|
+
|
|
263
|
+
### Exemple avec NirField
|
|
264
|
+
|
|
265
|
+
<Source dark code={`
|
|
266
|
+
<template>
|
|
267
|
+
<form @submit.prevent="handleSubmit">
|
|
268
|
+
<NirField
|
|
269
|
+
ref="nirFieldRef"
|
|
270
|
+
v-model="nirValue"
|
|
271
|
+
label="Numéro de sécurité sociale"
|
|
272
|
+
/>
|
|
273
|
+
|
|
274
|
+
<SyButton type="submit">Valider</SyButton>
|
|
275
|
+
</form>
|
|
276
|
+
</template>
|
|
277
|
+
|
|
278
|
+
<script setup>
|
|
279
|
+
import { ref } from 'vue';
|
|
280
|
+
import { NirField, SyButton } from '@cnamts/synapse';
|
|
281
|
+
|
|
282
|
+
const nirValue = ref('');
|
|
283
|
+
const nirFieldRef = ref();
|
|
284
|
+
|
|
285
|
+
const handleSubmit = async () => {
|
|
286
|
+
const isValid = await nirFieldRef.value.validateOnSubmit();
|
|
287
|
+
|
|
288
|
+
if (isValid) {
|
|
289
|
+
console.log('NIR valide :', nirValue.value);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
</script>
|
|
293
|
+
`}/>
|
|
294
|
+
|
|
295
|
+
## Règles de validation disponibles
|
|
296
|
+
|
|
297
|
+
### Règles génériques
|
|
298
|
+
- `required` : Champ obligatoire
|
|
299
|
+
- `minLength` / `maxLength` : Longueur minimale/maximale
|
|
300
|
+
- `min` / `max` : Valeur minimale/maximale pour les nombres
|
|
301
|
+
- `email` : Format d'email valide
|
|
302
|
+
- `matchPattern` : Correspondance à une expression régulière
|
|
303
|
+
|
|
304
|
+
### Règles de dates
|
|
305
|
+
- `notBeforeToday` / `notAfterToday` : Date après/avant aujourd'hui
|
|
306
|
+
- `notBeforeDate` / `notAfterDate` : Date après/avant une date spécifique
|
|
307
|
+
- `notWeekend` : Jour ouvrable
|
|
308
|
+
- `isHolidayDay` : Jour non férié
|
|
309
|
+
|
|
310
|
+
### Règles personnalisées
|
|
311
|
+
Utilisez le type `custom` avec une fonction `validate` pour créer vos propres règles :
|
|
312
|
+
|
|
313
|
+
<Source dark code={`
|
|
314
|
+
const customRule = {
|
|
315
|
+
type: 'custom',
|
|
316
|
+
options: {
|
|
317
|
+
validate: (value) => {
|
|
318
|
+
// Votre logique personnalisée
|
|
319
|
+
if (!condition) {
|
|
320
|
+
return 'Message d\'erreur personnalisé';
|
|
321
|
+
}
|
|
322
|
+
return true; // Valide
|
|
323
|
+
},
|
|
324
|
+
// Optionnel : traiter comme avertissement au lieu d'erreur
|
|
325
|
+
isWarning: false
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
`}/>
|
|
329
|
+
|
|
330
|
+
## Bonnes pratiques
|
|
331
|
+
|
|
332
|
+
1. **Validation progressive** : Validez pendant la saisie pour une rétroaction immédiate
|
|
333
|
+
2. **Messages clairs** : Utilisez des messages d'erreur explicites et constructifs
|
|
334
|
+
3. **Validation côté client ET serveur** : Ne vous fiez jamais uniquement à la validation côté client
|
|
335
|
+
4. **Utilisez validateOnSubmit** : Assurez-vous que tous les champs sont validés à la soumission
|
|
336
|
+
5. **Hiérarchisez les erreurs** : Affichez d'abord les erreurs les plus importantes
|
|
337
|
+
6. **Utilisez les avertissements** pour les recommandations non-bloquantes
|
|
338
|
+
7. **Célébrez la réussite** avec des messages de succès pour renforcer les bonnes pratiques
|
|
339
|
+
|
|
340
|
+
## Conclusion
|
|
341
|
+
|
|
342
|
+
Le système de validation du Design System vous permet de créer des formulaires intuitifs avec des retours utilisateur riches. En combinant validation à la saisie et validation à la soumission, vous offrez une expérience utilisateur optimale tout en garantissant l'intégrité des données.
|
|
@@ -10,7 +10,7 @@ export const Header: StoryObj = {
|
|
|
10
10
|
return {
|
|
11
11
|
template: `
|
|
12
12
|
<div class="mb-8">
|
|
13
|
-
<h1 class="
|
|
13
|
+
<h1 class="mb-4">Templates</h1>
|
|
14
14
|
<p class="text-body-1">Découvrez notre collection de templates conçus pour accélérer le développement de vos IHM.</p>
|
|
15
15
|
</div>
|
|
16
16
|
`,
|
|
@@ -14,7 +14,7 @@ export const AmeliproColors: AmeliproColorsTypes = {
|
|
|
14
14
|
apGreendarken1: { hexColor: '#459B5A' },
|
|
15
15
|
apGreendarken2: { hexColor: '#337343' },
|
|
16
16
|
apGreenlighten1: { hexColor: '#78CE8D' },
|
|
17
|
-
apGreenlighten2: { hexColor: '#
|
|
17
|
+
apGreenlighten2: { hexColor: '#DDF3E3' },
|
|
18
18
|
apGrey: { hexColor: '#545859' },
|
|
19
19
|
apGreydarken1: { hexColor: '#1A1B1B' },
|
|
20
20
|
apGreylighten1: { hexColor: '#CCCDCE' },
|
package/src/vuetifyConfig.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './assets/themes.scss'
|
|
2
|
+
|
|
2
3
|
import * as components from 'vuetify/components'
|
|
3
4
|
import * as directives from 'vuetify/directives'
|
|
4
5
|
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'
|
|
@@ -21,8 +22,7 @@ import {
|
|
|
21
22
|
import { createFlattenTheme, createFontVariables } from './designTokens/utils'
|
|
22
23
|
import { fr } from 'vuetify/locale'
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
import './assets/_typography.scss'
|
|
25
|
+
import { createVuetify } from 'vuetify'
|
|
26
26
|
|
|
27
27
|
export const createVuetifyInstance = () => createVuetify({
|
|
28
28
|
components,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Directive } from 'vue';
|
|
2
|
-
interface LetterSpacingOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Whether to apply to all typography elements or only specific selectors
|
|
5
|
-
* @default true
|
|
6
|
-
*/
|
|
7
|
-
applyToAll?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Specific selectors to target (if applyToAll is false)
|
|
10
|
-
*/
|
|
11
|
-
selectors?: string[];
|
|
12
|
-
/**
|
|
13
|
-
* Whether to observe DOM changes for dynamic content
|
|
14
|
-
* @default true
|
|
15
|
-
*/
|
|
16
|
-
observeChanges?: boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Vue directive to override Vuetify's !important letter-spacing with design token values
|
|
20
|
-
*
|
|
21
|
-
* Usage:
|
|
22
|
-
* - v-letter-spacing (applies to all typography elements)
|
|
23
|
-
* - v-letter-spacing="{ applyToAll: false, selectors: ['.text-h1', '.text-h2'] }"
|
|
24
|
-
* - v-letter-spacing="{ observeChanges: false }" (disable mutation observer)
|
|
25
|
-
*/
|
|
26
|
-
export declare const vLetterSpacing: Directive<HTMLElement, LetterSpacingOptions | boolean>;
|
|
27
|
-
export default vLetterSpacing;
|
package/src/assets/_fonts.scss
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/* Typography styles for CNAM and PA themes */
|
|
2
|
-
|
|
3
|
-
.v-application .v-theme--cnam,
|
|
4
|
-
.v-application .v-theme--pa {
|
|
5
|
-
/* Headings with Vuetify classes */
|
|
6
|
-
.text-h1 {
|
|
7
|
-
font-size: var(--v-typography-h1-font-size) !important;
|
|
8
|
-
font-weight: var(--v-typography-h1-font-weight) !important;
|
|
9
|
-
line-height: var(--v-typography-h1-line-height) !important;
|
|
10
|
-
letter-spacing: var(--v-typography-h1-letter-spacing);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.text-h2 {
|
|
14
|
-
font-size: var(--v-typography-h2-font-size) !important;
|
|
15
|
-
font-weight: var(--v-typography-h2-font-weight) !important;
|
|
16
|
-
line-height: var(--v-typography-h2-line-height) !important;
|
|
17
|
-
letter-spacing: var(--v-typography-h2-letter-spacing);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.text-h3 {
|
|
21
|
-
font-size: var(--v-typography-h3-font-size) !important;
|
|
22
|
-
font-weight: var(--v-typography-h3-font-weight) !important;
|
|
23
|
-
line-height: var(--v-typography-h3-line-height) !important;
|
|
24
|
-
letter-spacing: var(--v-typography-h3-letter-spacing);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.text-h4 {
|
|
28
|
-
font-size: var(--v-typography-h4-font-size) !important;
|
|
29
|
-
font-weight: var(--v-typography-h4-font-weight) !important;
|
|
30
|
-
line-height: var(--v-typography-h4-line-height) !important;
|
|
31
|
-
letter-spacing: var(--v-typography-h4-letter-spacing);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.text-h5 {
|
|
35
|
-
font-size: var(--v-typography-h5-font-size) !important;
|
|
36
|
-
font-weight: var(--v-typography-h5-font-weight) !important;
|
|
37
|
-
line-height: var(--v-typography-h5-line-height) !important;
|
|
38
|
-
letter-spacing: var(--v-typography-h5-letter-spacing);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.text-h6 {
|
|
42
|
-
font-size: var(--v-typography-h6-font-size) !important;
|
|
43
|
-
font-weight: var(--v-typography-h6-font-weight) !important;
|
|
44
|
-
line-height: var(--v-typography-h6-line-height) !important;
|
|
45
|
-
letter-spacing: var(--v-typography-h6-letter-spacing);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Native HTML heading elements */
|
|
49
|
-
h1 {
|
|
50
|
-
font-size: var(--v-typography-h1-font-size) !important;
|
|
51
|
-
font-weight: var(--v-typography-h1-font-weight) !important;
|
|
52
|
-
line-height: var(--v-typography-h1-line-height) !important;
|
|
53
|
-
letter-spacing: var(--v-typography-h1-letter-spacing);
|
|
54
|
-
margin-bottom: 0.5rem;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
h2 {
|
|
58
|
-
font-size: var(--v-typography-h2-font-size) !important;
|
|
59
|
-
font-weight: var(--v-typography-h2-font-weight) !important;
|
|
60
|
-
line-height: var(--v-typography-h2-line-height) !important;
|
|
61
|
-
letter-spacing: var(--v-typography-h2-letter-spacing);
|
|
62
|
-
margin-bottom: 0.5rem;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
h3 {
|
|
66
|
-
font-size: var(--v-typography-h3-font-size) !important;
|
|
67
|
-
font-weight: var(--v-typography-h3-font-weight) !important;
|
|
68
|
-
line-height: var(--v-typography-h3-line-height) !important;
|
|
69
|
-
letter-spacing: var(--v-typography-h3-letter-spacing);
|
|
70
|
-
margin-bottom: 0.5rem;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
h4 {
|
|
74
|
-
font-size: var(--v-typography-h4-font-size) !important;
|
|
75
|
-
font-weight: var(--v-typography-h4-font-weight) !important;
|
|
76
|
-
line-height: var(--v-typography-h4-line-height) !important;
|
|
77
|
-
letter-spacing: var(--v-typography-h4-letter-spacing);
|
|
78
|
-
margin-bottom: 0.5rem;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
h5 {
|
|
82
|
-
font-size: var(--v-typography-h5-font-size) !important;
|
|
83
|
-
font-weight: var(--v-typography-h5-font-weight) !important;
|
|
84
|
-
line-height: var(--v-typography-h5-line-height) !important;
|
|
85
|
-
letter-spacing: var(--v-typography-h5-letter-spacing);
|
|
86
|
-
margin-bottom: 0.5rem;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
h6 {
|
|
90
|
-
font-size: var(--v-typography-h6-font-size) !important;
|
|
91
|
-
font-weight: var(--v-typography-h6-font-weight) !important;
|
|
92
|
-
line-height: var(--v-typography-h6-line-height) !important;
|
|
93
|
-
letter-spacing: var(--v-typography-h6-letter-spacing);
|
|
94
|
-
margin-bottom: 0.5rem;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* Body text */
|
|
98
|
-
.text-body-1 {
|
|
99
|
-
font-size: var(--v-typography-body1-font-size) !important;
|
|
100
|
-
font-weight: var(--v-typography-body1-font-weight) !important;
|
|
101
|
-
line-height: var(--v-typography-body1-line-height) !important;
|
|
102
|
-
letter-spacing: var(--v-typography-body1-letter-spacing);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.text-body-2 {
|
|
106
|
-
font-size: var(--v-typography-body2-font-size) !important;
|
|
107
|
-
font-weight: var(--v-typography-body2-font-weight) !important;
|
|
108
|
-
line-height: var(--v-typography-body2-line-height) !important;
|
|
109
|
-
letter-spacing: var(--v-typography-body2-letter-spacing);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* Subtitle text */
|
|
113
|
-
.text-subtitle-1 {
|
|
114
|
-
font-size: var(--v-typography-subtitle1-font-size) !important;
|
|
115
|
-
font-weight: var(--v-typography-subtitle1-font-weight) !important;
|
|
116
|
-
line-height: var(--v-typography-subtitle1-line-height) !important;
|
|
117
|
-
letter-spacing: var(--v-typography-subtitle1-letter-spacing);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.text-subtitle-2 {
|
|
121
|
-
font-size: var(--v-typography-subtitle2-font-size) !important;
|
|
122
|
-
font-weight: var(--v-typography-subtitle2-font-weight) !important;
|
|
123
|
-
line-height: var(--v-typography-subtitle2-line-height) !important;
|
|
124
|
-
letter-spacing: var(--v-typography-subtitle2-letter-spacing);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* Other typography */
|
|
128
|
-
.text-caption {
|
|
129
|
-
font-size: var(--v-typography-caption-font-size) !important;
|
|
130
|
-
font-weight: var(--v-typography-caption-font-weight) !important;
|
|
131
|
-
line-height: var(--v-typography-caption-line-height) !important;
|
|
132
|
-
letter-spacing: var(--v-typography-caption-letter-spacing);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.text-overline {
|
|
136
|
-
font-size: var(--v-typography-overline-font-size) !important;
|
|
137
|
-
font-weight: var(--v-typography-overline-font-weight) !important;
|
|
138
|
-
line-height: var(--v-typography-overline-line-height) !important;
|
|
139
|
-
letter-spacing: var(--v-typography-overline-letter-spacing);
|
|
140
|
-
text-transform: var(--v-typography-overline-text-transform, uppercase) !important;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/* Display text */
|
|
144
|
-
.text-display-1 {
|
|
145
|
-
font-size: var(--v-typography-display1-font-size) !important;
|
|
146
|
-
font-weight: var(--v-typography-display1-font-weight) !important;
|
|
147
|
-
line-height: var(--v-typography-display1-line-height) !important;
|
|
148
|
-
letter-spacing: var(--v-typography-display1-letter-spacing);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.text-display-2 {
|
|
152
|
-
font-size: var(--v-typography-display2-font-size) !important;
|
|
153
|
-
font-weight: var(--v-typography-display2-font-weight) !important;
|
|
154
|
-
line-height: var(--v-typography-display2-line-height) !important;
|
|
155
|
-
letter-spacing: var(--v-typography-display2-letter-spacing);
|
|
156
|
-
}
|
|
157
|
-
}
|