@cnamts/synapse 0.0.8-alpha → 0.0.9-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/design-system-v3.d.ts +584 -128
  2. package/dist/design-system-v3.js +4176 -2694
  3. package/dist/design-system-v3.umd.cjs +1 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +1 -1
  6. package/src/assets/settings.scss +1 -1
  7. package/src/components/ContextualMenu/Accessibilite.mdx +14 -0
  8. package/src/components/ContextualMenu/Accessibilite.stories.ts +191 -0
  9. package/src/components/ContextualMenu/AccessibiliteItems.ts +89 -0
  10. package/src/components/ContextualMenu/constants/ExpertiseLevelEnum.ts +4 -0
  11. package/src/components/Customs/SySelect/SySelect.stories.ts +7 -7
  12. package/src/components/Customs/SySelect/SySelect.vue +9 -4
  13. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +2 -2
  14. package/src/components/Customs/SyTextField/SyTextField.stories.ts +187 -2
  15. package/src/components/Customs/SyTextField/SyTextField.vue +185 -16
  16. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +2 -4
  17. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +18 -16
  18. package/src/components/Customs/SyTextField/types.d.ts +2 -2
  19. package/src/components/DatePicker/DatePicker.mdx +191 -0
  20. package/src/components/DatePicker/DatePicker.stories.ts +787 -0
  21. package/src/components/DatePicker/DatePicker.vue +560 -0
  22. package/src/components/DatePicker/DateTextInput.vue +409 -0
  23. package/src/components/DatePicker/tests/DatePicker.spec.ts +266 -0
  24. package/src/components/DialogBox/DialogBox.stories.ts +1 -1
  25. package/src/components/ExternalLinks/Accessibilite.mdx +14 -0
  26. package/src/components/ExternalLinks/Accessibilite.stories.ts +191 -0
  27. package/src/components/ExternalLinks/AccessibiliteItems.ts +197 -0
  28. package/src/components/ExternalLinks/constants/ExpertiseLevelEnum.ts +4 -0
  29. package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +9 -9
  30. package/src/components/FileUpload/FileUpload.mdx +165 -0
  31. package/src/components/FileUpload/FileUpload.stories.ts +429 -0
  32. package/src/components/FileUpload/FileUpload.vue +195 -0
  33. package/src/components/FileUpload/FileUploadContent.vue +109 -0
  34. package/src/components/FileUpload/locales.ts +10 -0
  35. package/src/components/FileUpload/tests/FileUpload.spec.ts +332 -0
  36. package/src/components/FileUpload/tests/__snapshots__/FileUpload.spec.ts.snap +7 -0
  37. package/src/components/FileUpload/useFileDrop.ts +23 -0
  38. package/src/components/FileUpload/validateFiles.ts +39 -0
  39. package/src/components/NirField/NirField.stories.ts +1 -1
  40. package/src/components/NirField/NirField.vue +2 -1
  41. package/src/components/PasswordField/Accessibilite.mdx +14 -0
  42. package/src/components/PasswordField/Accessibilite.stories.ts +191 -0
  43. package/src/components/PasswordField/AccessibiliteItems.ts +184 -0
  44. package/src/components/PasswordField/PasswordField.vue +3 -3
  45. package/src/components/PasswordField/constants/ExpertiseLevelEnum.ts +4 -0
  46. package/src/components/PhoneField/PhoneField.vue +44 -60
  47. package/src/components/PhoneField/tests/PhoneField.spec.ts +0 -15
  48. package/src/components/RangeField/RangeField.mdx +54 -0
  49. package/src/components/RangeField/RangeField.stories.ts +189 -0
  50. package/src/components/RangeField/RangeField.vue +157 -0
  51. package/src/components/RangeField/RangeSlider/RangeSlider.vue +387 -0
  52. package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +64 -0
  53. package/src/components/RangeField/RangeSlider/tests/__snapshots__/rangeSlider.spec.ts.snap +27 -0
  54. package/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.ts +100 -0
  55. package/src/components/RangeField/RangeSlider/tests/useDoubleSlider.spec.ts +246 -0
  56. package/src/components/RangeField/RangeSlider/tests/useMouseSlide.spec.ts +204 -0
  57. package/src/components/RangeField/RangeSlider/tests/useThumb.spec.ts +22 -0
  58. package/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.ts +233 -0
  59. package/src/components/RangeField/RangeSlider/tests/useTooltipsNudge.spec.ts +150 -0
  60. package/src/components/RangeField/RangeSlider/tests/useTrack.spec.ts +314 -0
  61. package/src/components/RangeField/RangeSlider/tests/vAnimateClick.spec.ts +32 -0
  62. package/src/components/RangeField/RangeSlider/types.ts +15 -0
  63. package/src/components/RangeField/RangeSlider/useMouseSlide.ts +109 -0
  64. package/src/components/RangeField/RangeSlider/useRangeSlider.ts +126 -0
  65. package/src/components/RangeField/RangeSlider/useThumb.ts +18 -0
  66. package/src/components/RangeField/RangeSlider/useThumbKeyboard.ts +84 -0
  67. package/src/components/RangeField/RangeSlider/useTooltipsNudge.ts +92 -0
  68. package/src/components/RangeField/RangeSlider/useTrack.ts +116 -0
  69. package/src/components/RangeField/RangeSlider/vAnimateClick.ts +19 -0
  70. package/src/components/RangeField/config.ts +7 -0
  71. package/src/components/RangeField/locales.ts +4 -0
  72. package/src/components/RangeField/tests/RangeField.spec.ts +224 -0
  73. package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +379 -0
  74. package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +205 -0
  75. package/src/components/RatingPicker/EmotionPicker/locales.ts +3 -0
  76. package/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.ts +104 -0
  77. package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +66 -0
  78. package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +159 -0
  79. package/src/components/RatingPicker/NumberPicker/locales.ts +4 -0
  80. package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +73 -0
  81. package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +105 -0
  82. package/src/components/RatingPicker/Rating.ts +45 -0
  83. package/src/components/RatingPicker/RatingPicker.mdx +56 -0
  84. package/src/components/RatingPicker/RatingPicker.stories.ts +515 -0
  85. package/src/components/RatingPicker/RatingPicker.vue +122 -0
  86. package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +116 -0
  87. package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +95 -0
  88. package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +36 -0
  89. package/src/components/RatingPicker/locales.ts +3 -0
  90. package/src/components/RatingPicker/tests/Rating.spec.ts +104 -0
  91. package/src/components/RatingPicker/tests/RatingPicker.spec.ts +187 -0
  92. package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +108 -0
  93. package/src/components/SearchListField/SearchListField.mdx +74 -0
  94. package/src/components/SearchListField/SearchListField.stories.ts +126 -0
  95. package/src/components/SearchListField/SearchListField.vue +194 -0
  96. package/src/components/SearchListField/locales.ts +5 -0
  97. package/src/components/SearchListField/tests/SearchListField.spec.ts +323 -0
  98. package/src/components/SearchListField/types.d.ts +4 -0
  99. package/src/components/SelectBtnField/SelectBtnField.mdx +50 -0
  100. package/src/components/SelectBtnField/SelectBtnField.stories.ts +763 -0
  101. package/src/components/SelectBtnField/SelectBtnField.vue +283 -0
  102. package/src/components/SelectBtnField/config.ts +11 -0
  103. package/src/components/SelectBtnField/tests/SelectBtnField.spec.ts +327 -0
  104. package/src/components/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +125 -0
  105. package/src/components/SelectBtnField/types.d.ts +11 -0
  106. package/src/components/index.ts +8 -1
  107. package/src/composables/rules/useFieldValidation.ts +172 -44
  108. package/src/designTokens/index.ts +3 -3
  109. package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +52 -2
  110. package/src/utils/calcHumanFileSize/index.ts +12 -0
  111. package/src/utils/calcHumanFileSize/tests/calcHumanFileSize.spec.ts +21 -0
@@ -0,0 +1,191 @@
1
+ import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon } from 'vuetify/components'
2
+ import type { StoryObj } from '@storybook/vue3'
3
+ import { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated } from './AccessibiliteItems'
4
+ import { mdiCheckboxMarkedCircle, mdiLink, mdiEye } from '@mdi/js'
5
+
6
+ const checkIcon = mdiCheckboxMarkedCircle
7
+ const iconEye = mdiEye
8
+ const linkICon = mdiLink
9
+
10
+ export default {
11
+ title: 'Composants/Navigation/ContextualMenu/Accessibilité',
12
+ }
13
+
14
+ export const AccessibilitePanel: StoryObj = {
15
+
16
+ render: () => {
17
+ return {
18
+ components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon },
19
+
20
+ setup() {
21
+ const icon = checkIcon
22
+
23
+ return { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated, icon, linkICon, iconEye }
24
+ },
25
+ template: `
26
+ <div class="accessibiliteItems" style="display:flex; max-width: none !important;">
27
+ <v-col cols="6">
28
+ <div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
29
+ <h5>{{ AccessibiliteItemsIndeterminate.length }} critères à prendre en charge par le projet</h5>
30
+ <div style="display: flex; align-items: center;">
31
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
32
+ rounded>Tanaguru
33
+ </v-btn>
34
+ </div>
35
+ </div>
36
+
37
+ <v-expansion-panels value="opened" multiple>
38
+ <v-expansion-panel v-for="(item, index) in AccessibiliteItemsIndeterminate" :key="index" style="background-color: rgba(42, 96, 158, 0.1); margin-bottom: 10px;">
39
+ <v-expansion-panel-title>
40
+ <VIcon :icon="iconEye" style="margin-right: 5px; color:#5778b7;"/>
41
+ {{ item.title }}
42
+ </v-expansion-panel-title>
43
+ <v-expansion-panel-text>
44
+ <v-expansion-panels>
45
+ <v-expansion-panel v-for="(i, index) in item.items2" :key="i" style="margin-bottom: 10px;">
46
+ <v-expansion-panel-title
47
+ style="font-weight: bold; font-size: 13px; line-height: 16px;">
48
+ {{ i.subtitle}}
49
+ </v-expansion-panel-title>
50
+ <v-expansion-panel-text>
51
+ <div>
52
+ <p style="font-size: 13px;line-height: 16px;">
53
+ {{ i.precision }}
54
+ </p>
55
+ <div v-for="(value, index) in i.solution"
56
+ style="margin-top:15px; font-size: 13px;line-height: 16px;">
57
+ <p style="font-weight: bold;">Méthodologie du test : <a
58
+ href="{{i.link}}" target="blank">
59
+ <VIcon :icon="linkICon"/>
60
+ </a></p>
61
+ <p>{{ value.info1 }}</p>
62
+ <p>{{ value.info2 }}</p>
63
+ <p>{{ value.info3 }}</p>
64
+ <p>{{ value.info4 }}</p>
65
+
66
+ </div>
67
+ <span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
68
+ </div>
69
+ </v-expansion-panel-text>
70
+ </v-expansion-panel>
71
+ <v-expansion-panel >
72
+ <v-expansion-panel-title
73
+ style="font-weight: bold; font-size: 13px; line-height: 16px;">
74
+ {{ item.subtitle }}
75
+ </v-expansion-panel-title>
76
+ <v-expansion-panel-text>
77
+ <div v-for="(value, i) in item.items" :key="i">
78
+ <p style="font-size: 13px;line-height: 16px;">
79
+ {{ value.precision }}
80
+ </p>
81
+ <div v-for="element in value.solution"
82
+ style="margin-top:15px; font-size: 13px;line-height: 16px;">
83
+ <p style="font-weight: bold;">Méthodologie du test : <a
84
+ href="value.link" target="blank">
85
+ <VIcon :icon="linkICon"/>
86
+ </a></p>
87
+ <p>{{ element.info1 }}</p>
88
+ <p>{{ element.info2 }}</p>
89
+ <p>{{ element.info3 }}</p>
90
+ </div>
91
+ <span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
92
+ </div>
93
+ </v-expansion-panel-text>
94
+ </v-expansion-panel>
95
+ </v-expansion-panels>
96
+ </v-expansion-panel-text>
97
+ </v-expansion-panel>
98
+ </v-expansion-panels>
99
+ </v-col>
100
+ <v-col cols="6">
101
+ <div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
102
+ <h5>{{ AccessibiliteItemsValidated.length }} critères pris en charge par l'équipe Design System</h5>
103
+ <div style="display: flex; align-items: center;">
104
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
105
+ rounded>Tanaguru
106
+ </v-btn>
107
+ </div>
108
+ </div>
109
+ <v-expansion-panels v-if="AccessibiliteItemsValidated.length > 0" value="opened" multiple>
110
+ <v-expansion-panel
111
+ v-for="(item, index) in AccessibiliteItemsValidated"
112
+ :key="index" style="background-color: rgba(53,135,0,0.1); margin-bottom: 10px;">
113
+ <v-expansion-panel-title>
114
+ <VIcon color="green" :icon="icon" style="margin-right: 5px;"/>
115
+ {{ item.title }}
116
+ </v-expansion-panel-title>
117
+ <v-expansion-panel-text>
118
+ <v-expansion-panels>
119
+ <v-expansion-panel>
120
+ <v-expansion-panel-title style="font-weight: bold;font-size: 13px; line-height: 16px;">
121
+ {{ item.subtitle }}
122
+ </v-expansion-panel-title>
123
+ <v-expansion-panel-text>
124
+ <div v-for="(value, i) in item.items" :key="i">
125
+ <p style="font-size: 13px;line-height: 16px;">
126
+ {{ value.precision }}
127
+ </p>
128
+ <div v-for="element in value.solution"
129
+ style="margin-top:15px; font-size: 13px;line-height: 16px;">
130
+ <p style="font-weight: bold;">Méthodologie du test : <a
131
+ href="value.link" target="blank">
132
+ <VIcon :icon="linkICon"/>
133
+ </a></p>
134
+ <p>{{ element.info1 }}</p>
135
+ <p>{{ element.info2 }}</p>
136
+ <p>{{ element.info3 }}</p>
137
+ </div>
138
+ <span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
139
+ </div>
140
+ </v-expansion-panel-text>
141
+ </v-expansion-panel>
142
+ </v-expansion-panels>
143
+ </v-expansion-panel-text>
144
+ </v-expansion-panel>
145
+ </v-expansion-panels>
146
+ <div v-else style="display: flex;justify-content: center;"><span style="text-align:center;" >Pas de critère d'accessibilité bloquant</span></div>
147
+ </v-col>
148
+ </div>
149
+ `,
150
+ }
151
+ },
152
+ tags: ['!dev'],
153
+ }
154
+
155
+ export const Legende: StoryObj = {
156
+ args: {
157
+ icon: checkIcon,
158
+ },
159
+ render: (args) => {
160
+ return {
161
+ components: { VIcon },
162
+ setup() {
163
+ return { args }
164
+ },
165
+ template: `
166
+ <p style="color: grey;font-size: 11px; margin-bottom: 12px;">Date de conception: 20/11/2024</p>
167
+ <div>
168
+ <p>Le tableau ci-dessous liste nos recommandations suivant les <a target="blank" style="color:#0C41BD;" href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu">catégories du RGAA</a>.</p>
169
+ <p style="margin-bottom: 12px;font-weight:bold;">Pour rappel le composant seul ne garantie pas
170
+ l'accessibilité du site.</p>
171
+ <div style="font-size: 14px">
172
+ <p>Nous avons deux façons de relever les problèmes d'accessibilité des composants :</p>
173
+ <div>
174
+ <v-btn variant="tonal" color="grey" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
175
+ Audit
176
+ </v-btn>
177
+ Problèmes relevés par le projet
178
+ </div>
179
+ <div>
180
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
181
+ Tanaguru
182
+ </v-btn>
183
+ Problèmes relevés par Tanaguru
184
+ </div>
185
+ </div>
186
+ </div>
187
+ `,
188
+ }
189
+ },
190
+ tags: ['!dev'],
191
+ }
@@ -0,0 +1,89 @@
1
+ import { ExpertiseLevelEnum } from './constants/ExpertiseLevelEnum'
2
+
3
+ export const AccessibiliteItemsIndeterminate = [
4
+ {
5
+ title: 'Catégorie 3 : Couleurs',
6
+ subtitle: '3.1 Dans chaque page web, l’information ne doit pas être donnée uniquement par la couleur. Cette règle est-elle respectée ?',
7
+ items: [
8
+ {
9
+ precision: '3.1.2 Pour chaque indication de couleur donnée par un texte, l’information ne doit pas être donnée uniquement par la couleur. Cette règle est-elle respectée ?',
10
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#3.1.2',
11
+ solution: [{
12
+ info1: '1. Retrouver dans le document les textes et les textes en image sans effet de graisse d’une taille restituée inférieure à 24px qui pourraient poser des problèmes de contraste ;',
13
+ info2: '2. Pour chacun de ces textes, vérifier que : Soit le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Soit un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
14
+ info3: '3. Si c’est le cas pour chaque texte, le test est validé',
15
+ }],
16
+ expertise: ExpertiseLevelEnum.DEV,
17
+
18
+ },
19
+
20
+ ],
21
+ },
22
+ {
23
+ title: 'Catégorie 6 : Liens',
24
+ subtitle: ' 6.1 Chaque lien est-il explicite',
25
+ items: [
26
+ {
27
+
28
+ precision: ' 6.1.5 Pour chaque lien ayant un intitulé visible, le nom accessible du lien contient-il au moins l’intitulé visible (hors cas particuliers) ? '
29
+ + 'L’intitulé de lien seul permet d’en comprendre la fonction et la destination ; '
30
+ + 'L’intitulé de lien additionné au contexte du lien permet d’en comprendre la fonction et la destination.',
31
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#6.1.1',
32
+ solution: [{
33
+ info1: '1. Retrouver dans le document les liens autres que SVG dont le contenu est fourni à la fois par un intitulé visible et par le contenu soit d’un attribut title ou d’un attribut aria-label ou d’un attribut aria-labelledby ; ',
34
+ info2: '2. Pour chaque lien, vérifier que le contenu de l’attribut title ou de l’attribut aria-label ou de l’attribut aria-labelledby contient l’intitulé visible ; ',
35
+ info3: '3. Si c’est le cas pour chaque lien, le test est validé pour les liens autres que SVG. ',
36
+ info4: '4. Retrouver dans le document les liens SVG dont le contenu est fourni à la fois par un intitulé visible et par le contenu soit d’un attribut aria-labelledby, ou d’un attribut aria-label ou d’un élément title (enfant direct de l’élément <svg>) ou d’un attribut x-link:title (SVG 1.1) ou d’un ou plusieurs éléments <text>; ',
37
+ info5: '5. Pour chaque lien SVG, vérifier que le contenu de l’attribut aria-labelledby ou de l’attribut aria-label ou de l’élément <title> ou de l’attribut x-link:title ou d’un ou plusieurs éléments <text> contient l’intitulé visible ; ',
38
+ info6: '6. Si c’est le cas pour chaque lien SVG, le test est validé pour les liens SVG. ',
39
+ info7: '7. Si le test est validé à la fois pour les liens non SVG et pour les liens SVG, le test est globalement validé. ',
40
+
41
+ }],
42
+ expertise: ExpertiseLevelEnum.DEV,
43
+
44
+ },
45
+
46
+ ],
47
+ },
48
+
49
+ ]
50
+
51
+ export const AccessibiliteItemsValidated = [
52
+ {
53
+ title: 'Catégorie 3 : Couleurs',
54
+ subtitle: '3.2 Dans chaque page web, le contraste entre la couleur du texte et la couleur de son arrière-plan est-il suffisamment élevé?',
55
+ items: [
56
+ {
57
+ precision: '3.2.1 Dans chaque page web, le texte et le texte en image sans effet de graisse d’une taille restituée inférieure à 24px vérifient-ils une de ces conditions? Le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
58
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#3.2.1',
59
+ solution: [{
60
+ info1: '1. Retrouver dans le document les textes et les textes en image sans effet de graisse d’une taille restituée inférieure à 24px qui pourraient poser des problèmes de contraste ;',
61
+ info2: '2. Pour chacun de ces textes, vérifier que : Soit le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Soit un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
62
+ info3: '3. Si c’est le cas pour chaque texte, le test est validé',
63
+ }],
64
+ expertise: ExpertiseLevelEnum.DESIGN,
65
+
66
+ },
67
+ ],
68
+ },
69
+ {
70
+ title: 'Catégorie 6 : Liens',
71
+ subtitle: '6.2 Dans chaque page web, chaque lien a-t-il un intitulé ? ',
72
+ items: [
73
+ {
74
+
75
+ precision: ' 6.2.1 Dans chaque page web, chaque lien a-t-il un intitulé entre <a> et </a> ?',
76
+ link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#6.2.1',
77
+ solution: [{
78
+ info1: '1. Retrouver dans le document les liens quels qu’ils soient ; ',
79
+ info2: '2. Pour chaque lien, vérifier que le contenu de l’élément <a> (ou d’un élément pourvu d’un attribut WAI-ARIA role=link) contient un intitulé (texte ou alternative) ; ',
80
+ info3: '3. Si c’est le cas pour chaque lien, le test est validé.',
81
+ }],
82
+ expertise: ExpertiseLevelEnum.DESIGN,
83
+
84
+ },
85
+
86
+ ],
87
+ },
88
+
89
+ ]
@@ -0,0 +1,4 @@
1
+ export enum ExpertiseLevelEnum {
2
+ DEV = 'dev',
3
+ DESIGN = 'design',
4
+ }
@@ -1,10 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
  import SySelect from '@/components/Customs/SySelect/SySelect.vue'
3
+ import SyAlert from '@/components/SyAlert/SyAlert.vue'
3
4
  import { VBtn, VMenu, VList, VListItem, VListItemTitle } from 'vuetify/components'
4
5
  import { ref } from 'vue'
5
- import SyAlert from '@/components/SyAlert/SyAlert.vue'
6
6
 
7
- const meta = {
7
+ const meta: Meta<typeof SySelect> = {
8
8
  title: 'Composants/Formulaires/SySelect',
9
9
  component: SySelect,
10
10
  parameters: {
@@ -64,7 +64,7 @@ export const Default: Story = {
64
64
  return { args }
65
65
  },
66
66
  template: `
67
- <div class="d-flex flex-wrap align-center pa-4">
67
+ <div class="pa-4">
68
68
  <SySelect
69
69
  v-bind="args"
70
70
  />
@@ -119,7 +119,7 @@ export const Required: Story = {
119
119
  return { args }
120
120
  },
121
121
  template: `
122
- <div class="d-flex flex-wrap align-center pa-4">
122
+ <div class="pa-4">
123
123
  <SySelect
124
124
  v-bind="args"
125
125
  :required="args.required"
@@ -188,13 +188,13 @@ export const withCustomError: Story = {
188
188
  return { args, errorMessages, triggerError }
189
189
  },
190
190
  template: `
191
- <div class="d-flex flex-wrap align-center pa-4">
191
+ <div class="pa-4">
192
192
  <SySelect
193
193
  v-bind="args"
194
194
  :error-messages="errorMessages"
195
195
  />
196
196
  </div>
197
- <div class="d-flex flex-wrap align-center px-4">
197
+ <div class="px-4">
198
198
  <VBtn @click="triggerError">
199
199
  Trigger Error
200
200
  </VBtn>
@@ -247,7 +247,7 @@ export const withCustomKey: Story = {
247
247
  return { args }
248
248
  },
249
249
  template: `
250
- <div class="d-flex flex-wrap align-center pa-4">
250
+ <div class="pa-4">
251
251
  <SySelect
252
252
  v-bind="args"
253
253
  text-key="customKey"
@@ -4,7 +4,7 @@
4
4
 
5
5
  const props = defineProps({
6
6
  modelValue: {
7
- type: [Object, String],
7
+ type: [Object, String, Number],
8
8
  default: null,
9
9
  },
10
10
  items: {
@@ -13,7 +13,7 @@
13
13
  },
14
14
  label: {
15
15
  type: String,
16
- default: 'Sélectionnez une option',
16
+ default: '',
17
17
  },
18
18
  errorMessages: {
19
19
  type: [String, Array] as PropType<string | readonly string[]>,
@@ -23,6 +23,10 @@
23
23
  type: Boolean,
24
24
  default: false,
25
25
  },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
26
30
  menuId: {
27
31
  type: String,
28
32
  default: 'sy-select-menu',
@@ -44,7 +48,7 @@
44
48
  const emit = defineEmits(['update:modelValue'])
45
49
 
46
50
  const isOpen = ref(false)
47
- const selectedItem = ref<Record<string, unknown > | string | null | undefined>(props.modelValue)
51
+ const selectedItem = ref<Record<string, unknown > | string | number | null | undefined>(props.modelValue)
48
52
  const hasError = ref(false)
49
53
 
50
54
  const labelWidth = ref(0)
@@ -131,7 +135,8 @@
131
135
  color="primary"
132
136
  tabindex="0"
133
137
  readonly
134
- :label="selectedItem ? label : ''"
138
+ :disabled="disabled"
139
+ :label="selectedItem ? label : 'Sélectionnez une option'"
135
140
  :aria-label="selectedItem ? label : 'Sélectionnez une option'"
136
141
  :error-messages="errorMessages"
137
142
  :variant="outlined ? 'outlined' : 'underlined'"
@@ -11,7 +11,7 @@ describe('SySelect.vue', () => {
11
11
  },
12
12
  })
13
13
  expect(wrapper.exists()).toBe(true)
14
- expect(wrapper.find('.sy-select').text()).toBe('')
14
+ expect(wrapper.find('.sy-select').exists()).toBe(true)
15
15
  })
16
16
 
17
17
  it('displays the selected item text', async () => {
@@ -84,7 +84,7 @@ describe('SySelect.vue', () => {
84
84
  })
85
85
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
86
86
  const instance = wrapper.vm as any
87
- expect(instance.selectedItemText).toBe('Sélectionnez une option')
87
+ expect(instance.selectedItemText).toBe('')
88
88
  })
89
89
 
90
90
  it('returns the correct text when selectedItem is an object', async () => {
@@ -37,6 +37,181 @@ const meta = {
37
37
  color: {
38
38
  control: 'select',
39
39
  options: ['primary', 'secondary', 'success', 'error', 'warning'],
40
+ description: 'Couleur du champ',
41
+ },
42
+ density: {
43
+ control: 'select',
44
+ options: ['default', 'comfortable', 'compact'],
45
+ description: 'Densité du champ',
46
+ },
47
+ direction: {
48
+ control: 'select',
49
+ options: ['horizontal', 'vertical'],
50
+ description: 'Direction d\'affichage',
51
+ },
52
+ type: {
53
+ control: 'select',
54
+ options: ['text', 'number', 'password', 'email', 'tel', 'url', 'search', 'date', 'time', 'datetime-local'],
55
+ description: 'Type d\'input HTML',
56
+ },
57
+ baseColor: {
58
+ control: 'color',
59
+ description: 'Couleur de base personnalisée',
60
+ },
61
+ bgColor: {
62
+ control: 'color',
63
+ description: 'Couleur de fond personnalisée',
64
+ },
65
+ width: {
66
+ control: 'text',
67
+ description: 'Largeur du champ (px, %, vh, etc.)',
68
+ },
69
+ maxWidth: {
70
+ control: 'text',
71
+ description: 'Largeur maximale (px, %, vh, etc.)',
72
+ },
73
+ minWidth: {
74
+ control: 'text',
75
+ description: 'Largeur minimale (px, %, vh, etc.)',
76
+ },
77
+ rounded: {
78
+ control: 'select',
79
+ options: [true, false, 0, 'sm', 'lg', 'xl', 'pill'],
80
+ description: 'Style des coins arrondis',
81
+ },
82
+ required: {
83
+ control: 'boolean',
84
+ description: 'Champ obligatoire',
85
+ },
86
+ isReadOnly: {
87
+ control: 'boolean',
88
+ description: 'Mode lecture seule',
89
+ },
90
+ isDisabled: {
91
+ control: 'boolean',
92
+ description: 'Désactive le champ',
93
+ },
94
+ isClearable: {
95
+ control: 'boolean',
96
+ description: 'Affiche un bouton pour effacer',
97
+ },
98
+ isTiled: {
99
+ control: 'boolean',
100
+ description: 'Style tuile',
101
+ },
102
+ isFlat: {
103
+ control: 'boolean',
104
+ description: 'Sans élévation',
105
+ },
106
+ isActive: {
107
+ control: 'boolean',
108
+ description: 'Force l\'état actif',
109
+ },
110
+ isFocused: {
111
+ control: 'boolean',
112
+ description: 'Force l\'état focus',
113
+ },
114
+ isDirty: {
115
+ control: 'boolean',
116
+ description: 'Indique si modifié',
117
+ },
118
+ isOnError: {
119
+ control: 'boolean',
120
+ description: 'Force l\'état erreur',
121
+ },
122
+ displayAsterisk: {
123
+ control: 'boolean',
124
+ description: 'Affiche l\'astérisque requis',
125
+ },
126
+ displayPersistentClear: {
127
+ control: 'boolean',
128
+ description: 'Bouton effacer toujours visible',
129
+ },
130
+ displayPersistentCounter: {
131
+ control: 'boolean',
132
+ description: 'Compteur toujours visible',
133
+ },
134
+ displayPersistentHint: {
135
+ control: 'boolean',
136
+ description: 'Aide toujours visible',
137
+ },
138
+ displayPersistentPlaceholder: {
139
+ control: 'boolean',
140
+ description: 'Placeholder toujours visible',
141
+ },
142
+ areDetailsHidden: {
143
+ control: 'select',
144
+ options: [true, false, 'auto'],
145
+ description: 'Masque les détails',
146
+ },
147
+ areSpinButtonsHidden: {
148
+ control: 'boolean',
149
+ description: 'Masque les boutons number',
150
+ },
151
+ noIcon: {
152
+ control: 'boolean',
153
+ description: 'Masque toutes les icônes',
154
+ },
155
+ centerAffix: {
156
+ control: 'boolean',
157
+ description: 'Centre les affixes',
158
+ },
159
+ counter: {
160
+ control: 'select',
161
+ options: [true, false, 'words', 'characters'],
162
+ description: 'Type de compteur',
163
+ },
164
+ counterValue: {
165
+ control: 'number',
166
+ description: 'Valeur du compteur',
167
+ },
168
+ maxErrors: {
169
+ control: 'number',
170
+ description: 'Nombre max d\'erreurs',
171
+ },
172
+ errorMessages: {
173
+ control: 'object',
174
+ description: 'Messages d\'erreur',
175
+ },
176
+ messages: {
177
+ control: 'object',
178
+ description: 'Messages additionnels',
179
+ },
180
+ hint: {
181
+ control: 'text',
182
+ description: 'Message d\'aide',
183
+ },
184
+ placeholder: {
185
+ control: 'text',
186
+ description: 'Texte indicatif',
187
+ },
188
+ prefix: {
189
+ control: 'text',
190
+ description: 'Texte avant la valeur',
191
+ },
192
+ suffix: {
193
+ control: 'text',
194
+ description: 'Texte après la valeur',
195
+ },
196
+ id: {
197
+ control: 'text',
198
+ description: 'ID HTML',
199
+ },
200
+ name: {
201
+ control: 'text',
202
+ description: 'Nom du champ',
203
+ },
204
+ role: {
205
+ control: 'text',
206
+ description: 'Rôle ARIA',
207
+ },
208
+ theme: {
209
+ control: 'text',
210
+ description: 'Thème personnalisé',
211
+ },
212
+ loading: {
213
+ control: 'boolean',
214
+ description: 'État de chargement',
40
215
  },
41
216
  },
42
217
  } as Meta<typeof SyTextField>
@@ -71,16 +246,18 @@ export const Default: Story = {
71
246
  color: 'primary',
72
247
  isClearable: true,
73
248
  label: 'Label',
249
+ modelValue: '',
74
250
  },
75
251
  render: (args) => {
76
252
  return {
77
253
  components: { SyTextField, VIcon },
78
254
  setup() {
79
- return { args }
255
+ const value = ref('')
256
+ return { args, value }
80
257
  },
81
258
  template: `
82
259
  <div class="d-flex flex-wrap align-center pa-4">
83
- <SyTextField v-bind="args" />
260
+ <SyTextField v-bind="args" v-model="value" />
84
261
  </div>
85
262
  `,
86
263
  }
@@ -118,6 +295,7 @@ export const Required: Story = {
118
295
  isClearable: true,
119
296
  label: 'Label',
120
297
  required: true,
298
+ modelValue: '',
121
299
  },
122
300
  render: (args) => {
123
301
  return {
@@ -174,6 +352,7 @@ export const WithCustomError: Story = {
174
352
  isClearable: true,
175
353
  label: 'Label',
176
354
  required: false,
355
+ modelValue: '',
177
356
  },
178
357
  render: (args) => {
179
358
  return {
@@ -229,6 +408,7 @@ export const SlotPrepend: Story = {
229
408
  label: 'Label',
230
409
  color: 'primary',
231
410
  prependIcon: 'info',
411
+ modelValue: '',
232
412
  },
233
413
  render: (args) => {
234
414
  return {
@@ -280,6 +460,7 @@ export const SlotAppend: Story = {
280
460
  label: 'champs de text',
281
461
  color: 'primary',
282
462
  appendIcon: 'success',
463
+ modelValue: '',
283
464
  },
284
465
  render: (args) => {
285
466
  return {
@@ -330,6 +511,7 @@ export const SlotPrependInner: Story = {
330
511
  label: 'Label',
331
512
  color: 'primary',
332
513
  prependInnerIcon: 'info',
514
+ modelValue: '',
333
515
  },
334
516
  render: (args) => {
335
517
  return {
@@ -381,6 +563,7 @@ export const SlotPrependInnerDivider: Story = {
381
563
  label: 'Label',
382
564
  color: 'primary',
383
565
  prependInnerIcon: 'info',
566
+ modelValue: '',
384
567
  },
385
568
  render: (args) => {
386
569
  return {
@@ -432,6 +615,7 @@ export const SlotAppendInner: Story = {
432
615
  label: 'Label',
433
616
  color: 'primary',
434
617
  appendInnerIcon: 'success',
618
+ modelValue: '',
435
619
  },
436
620
  render: (args) => {
437
621
  return {
@@ -487,6 +671,7 @@ export const SlotCustomIcon: Story = {
487
671
  showDivider: false,
488
672
  label: 'Label',
489
673
  color: 'primary',
674
+ modelValue: '',
490
675
  },
491
676
  render: (args) => {
492
677
  return {