@cnamts/synapse 0.0.3-alpha → 0.0.4-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 (185) hide show
  1. package/dist/design-system-v3.d.ts +712 -27
  2. package/dist/design-system-v3.js +2715 -1485
  3. package/dist/design-system-v3.umd.cjs +10 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +5 -2
  6. package/src/components/Alert/Alert.mdx +1 -1
  7. package/src/components/Alert/Alert.stories.ts +91 -1
  8. package/src/components/BackBtn/BackBtn.mdx +1 -1
  9. package/src/components/BackBtn/BackBtn.stories.ts +84 -1
  10. package/src/components/BackToTopBtn/BackToTopBtn.mdx +3 -3
  11. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +172 -11
  12. package/src/components/CollapsibleList/CollapsibleList.mdx +2 -2
  13. package/src/components/CollapsibleList/CollapsibleList.stories.ts +37 -1
  14. package/src/components/CopyBtn/CopyBtn.mdx +1 -1
  15. package/src/components/CopyBtn/CopyBtn.stories.ts +120 -1
  16. package/src/components/CopyBtn/CopyBtn.vue +1 -1
  17. package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +6 -8
  18. package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +270 -4
  19. package/src/components/Customs/CustomInputSelect/CustomInputSelect.vue +80 -53
  20. package/src/components/Customs/CustomInputSelect/config.ts +10 -0
  21. package/src/components/Customs/CustomSelect/CustomSelect.mdx +3 -3
  22. package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +158 -2
  23. package/src/components/Customs/CustomSelect/CustomSelect.vue +25 -6
  24. package/src/components/Customs/CustomTextField/CustomTextField.mdx +44 -0
  25. package/src/components/Customs/CustomTextField/CustomTextField.stories.ts +403 -0
  26. package/src/components/Customs/CustomTextField/CustomTextField.vue +110 -0
  27. package/src/components/Customs/CustomTextField/tests/CustomTextField.spec.ts +93 -0
  28. package/src/components/Customs/CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap +59 -0
  29. package/src/components/Customs/CustomTextField/types.d.ts +3 -0
  30. package/src/components/DataList/DataList.mdx +77 -0
  31. package/src/components/DataList/DataList.stories.ts +960 -0
  32. package/src/components/DataList/DataList.vue +140 -0
  33. package/src/components/DataList/DataListLoading/DataListLoading.vue +56 -0
  34. package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +23 -0
  35. package/src/components/DataList/locales.ts +3 -0
  36. package/src/components/DataList/tests/DataList.spec.ts +194 -0
  37. package/src/components/DataList/types.d.ts +23 -0
  38. package/src/components/DataListGroup/DataListGroup.mdx +77 -0
  39. package/src/components/DataListGroup/DataListGroup.stories.ts +987 -0
  40. package/src/components/DataListGroup/DataListGroup.vue +59 -0
  41. package/src/components/DataListGroup/tests/DataListGroup.spec.ts +54 -0
  42. package/src/components/DataListGroup/tests/data/dataListGroupItems.ts +41 -0
  43. package/src/components/DataListGroup/types.d.ts +15 -0
  44. package/src/components/DataListItem/DataListItem.vue +135 -0
  45. package/src/components/DataListItem/config.ts +17 -0
  46. package/src/components/DataListItem/locales.ts +3 -0
  47. package/src/components/DataListItem/tests/DataListItem.spec.ts +156 -0
  48. package/src/components/DataListItem/types.d.ts +23 -0
  49. package/src/components/DownloadBtn/Accessibilite.mdx +14 -0
  50. package/src/components/DownloadBtn/Accessibilite.stories.ts +166 -0
  51. package/src/components/DownloadBtn/AccessibiliteItems.ts +129 -0
  52. package/src/components/DownloadBtn/DownloadBtn.mdx +5 -6
  53. package/src/components/DownloadBtn/DownloadBtn.stories.ts +207 -2
  54. package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +4 -0
  55. package/src/components/FooterBar/FooterBar.mdx +2 -2
  56. package/src/components/FooterBar/FooterBar.stories.ts +1 -1
  57. package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
  58. package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +58 -1
  59. package/src/components/HeaderBar/HeaderBar.mdx +164 -45
  60. package/src/components/HeaderBar/HeaderBar.stories.ts +559 -15
  61. package/src/components/HeaderBar/HeaderBar.vue +60 -22
  62. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
  63. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
  64. package/src/components/HeaderBar/{HeaderComplexMenu/HeaderComplexMenu.vue → HeaderBurgerMenu/HeaderBurgerMenu.vue} +74 -45
  65. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +38 -0
  66. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +89 -0
  67. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +1 -1
  68. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +17 -0
  69. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +121 -0
  70. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/HeaderMenuSection.vue +2 -2
  71. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +1 -3
  72. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +43 -0
  73. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +261 -0
  74. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/HeaderSubMenu.vue +17 -3
  75. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +1 -1
  76. package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +180 -0
  77. package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +13 -0
  78. package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +13 -0
  79. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +62 -25
  80. package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +49 -1
  81. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +19 -23
  82. package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +70 -0
  83. package/src/components/HeaderBar/Usages.mdx +85 -0
  84. package/src/components/HeaderBar/consts.scss +0 -1
  85. package/src/components/HeaderBar/tests/HeaderBar.spec.ts +8 -2
  86. package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +5 -10
  87. package/src/components/HeaderLoading/HeaderLoading.mdx +28 -0
  88. package/src/components/HeaderLoading/HeaderLoading.stories.ts +62 -0
  89. package/src/components/HeaderLoading/HeaderLoading.vue +45 -0
  90. package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +22 -0
  91. package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +128 -0
  92. package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +784 -0
  93. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +194 -0
  94. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +74 -0
  95. package/src/components/HeaderNavigationBar/HorizontalNavbar/config.ts +18 -0
  96. package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +127 -0
  97. package/src/components/HeaderNavigationBar/types.ts +7 -0
  98. package/src/components/HeaderToolbar/HeaderToolbar.mdx +31 -0
  99. package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +343 -0
  100. package/src/components/HeaderToolbar/HeaderToolbar.vue +487 -0
  101. package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +196 -0
  102. package/src/components/HeaderToolbar/types.d.ts +20 -0
  103. package/src/components/LangBtn/LangBtn.mdx +1 -1
  104. package/src/components/LangBtn/LangBtn.stories.ts +125 -8
  105. package/src/components/Logo/Logo.mdx +2 -2
  106. package/src/components/Logo/Logo.stories.ts +147 -1
  107. package/src/components/LogoBrandSection/LogoBrandSection.mdx +14 -0
  108. package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +158 -0
  109. package/src/components/LogoBrandSection/LogoBrandSection.vue +312 -0
  110. package/src/components/LogoBrandSection/assets/ameli-pro.svg +1 -0
  111. package/src/components/LogoBrandSection/assets/ameli.svg +1 -0
  112. package/src/components/LogoBrandSection/assets/cnam.svg +1 -0
  113. package/src/components/LogoBrandSection/assets/compte-ameli.svg +1 -0
  114. package/src/components/LogoBrandSection/dividerDimensionsMapping.ts +14 -0
  115. package/src/components/LogoBrandSection/locales.ts +14 -0
  116. package/src/components/LogoBrandSection/secondaryLogoMapping.ts +24 -0
  117. package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +365 -0
  118. package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +14 -0
  119. package/src/components/LogoBrandSection/types.ts +8 -0
  120. package/src/components/NotificationBar/NotificationBar.mdx +6 -6
  121. package/src/components/NotificationBar/NotificationBar.stories.ts +1 -1
  122. package/src/components/NotificationBar/NotificationBar.vue +2 -2
  123. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +1 -1
  124. package/src/components/PageContainer/PageContainer.mdx +1 -1
  125. package/src/components/PageContainer/PageContainer.stories.ts +86 -1
  126. package/src/components/PhoneField/PhoneField.mdx +49 -0
  127. package/src/components/PhoneField/PhoneField.stories.ts +869 -0
  128. package/src/components/PhoneField/PhoneField.vue +230 -0
  129. package/src/components/PhoneField/indicatifs.ts +104 -0
  130. package/src/components/PhoneField/locales.ts +4 -0
  131. package/src/components/PhoneField/tests/PhoneField.spec.ts +179 -0
  132. package/src/components/SkipLink/SkipLink.stories.ts +50 -1
  133. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +28 -1
  134. package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +37 -1
  135. package/src/components/SubHeader/SubHeader.mdx +31 -0
  136. package/src/components/SubHeader/SubHeader.stories.ts +1032 -0
  137. package/src/components/SubHeader/SubHeader.vue +185 -0
  138. package/src/components/SubHeader/config.ts +12 -0
  139. package/src/components/SubHeader/locales.ts +3 -0
  140. package/src/components/SubHeader/tests/SubHeader.spec.ts +144 -0
  141. package/src/components/index.ts +24 -7
  142. package/src/composables/widthable/index.ts +29 -0
  143. package/src/composables/widthable/tests/widthable.spec.ts +52 -0
  144. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -2
  145. package/src/main.ts +1 -0
  146. package/src/modules.d.ts +4 -0
  147. package/src/services/index.ts +1 -0
  148. package/src/stories/Demarrer/Accueil.mdx +10 -0
  149. package/src/stories/Demarrer/Accueil.stories.ts +76 -0
  150. package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +9 -0
  151. package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +20 -0
  152. package/src/stories/Fondamentaux/Accessibilite/Accessibilite.mdx +1 -2
  153. package/src/stories/Fondamentaux/Accessibilite/Accessibilite.stories.ts +1 -1
  154. package/src/stories/Fondamentaux/EcoConception/Econception.stories.ts +1 -1
  155. package/src/stories/GuideDuDev/moduleDeNotification.mdx +52 -48
  156. package/src/stories/GuideDuDev/vuetifyOptions.mdx +31 -28
  157. package/src/stories/Guidelines/CustomisationEtThemes.mdx +1 -1
  158. package/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.ts +47 -0
  159. package/src/utils/functions/throttleDisplayFn/throttleDisplayFn.ts +26 -0
  160. package/src/utils/rules/exactLength/index.ts +33 -0
  161. package/src/utils/rules/exactLength/locales.ts +6 -0
  162. package/src/utils/rules/required/index.ts +25 -0
  163. package/src/utils/rules/required/locales.ts +5 -0
  164. package/src/utils/rules/required/ruleMessageHelper.ts +14 -0
  165. package/src/utils/rules/required/tests/index.spec.ts +47 -0
  166. package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +22 -0
  167. package/src/utils/rules/types.d.ts +15 -0
  168. package/src/components/Beta/beta.mdx +0 -5
  169. package/src/components/Deprecated/deprecated.mdx +0 -5
  170. package/src/components/HeaderBar/HeaderComplexMenu/HeaderComplexMenu.stories.ts +0 -272
  171. package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +0 -49
  172. package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +0 -56
  173. package/src/components/HeaderBar/HeaderComplexMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +0 -137
  174. package/src/components/HeaderBar/HeaderComplexMenu/tests/HeaderComplexMenu.spec.ts +0 -129
  175. package/src/components/HeaderBar/HeaderComplexMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +0 -18
  176. package/src/stories/Home/Accueil.mdx +0 -7
  177. package/src/stories/Home/PolitiqueDeConfidentialite.mdx +0 -4
  178. package/src/stories/Home/synapse.webp +0 -0
  179. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/HeaderMenuItem.vue +0 -0
  180. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +0 -0
  181. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/conts.ts +0 -0
  182. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/locals.ts +0 -0
  183. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/tests/useHandleSubMenus.spec.ts +0 -0
  184. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/useHandleSubMenus.ts +0 -0
  185. /package/src/components/Logo/{types.d.ts → types.ts} +0 -0
@@ -0,0 +1,365 @@
1
+ import { describe, it, expect } from 'vitest'
2
+ import { mount } from '@vue/test-utils'
3
+
4
+ import LogoBrandSection from '../LogoBrandSection.vue'
5
+ import { vuetify } from '@tests/unit/setup'
6
+
7
+ describe('LogoBrandSection', () => {
8
+ it('renders correctly', () => {
9
+ const wrapper = mount(LogoBrandSection, {
10
+ global: {
11
+ plugins: [vuetify],
12
+ stubs: ['RouterLink', 'Logo'],
13
+ },
14
+ props: {
15
+ theme: 'default',
16
+ serviceTitle: 'Service Title',
17
+ serviceSubTitle: 'Service Sub Title',
18
+ mobileVersion: false,
19
+ reduceLogo: false,
20
+ homeLink: {
21
+ href: '/',
22
+ },
23
+ },
24
+ })
25
+
26
+ expect(wrapper.html()).toMatchSnapshot()
27
+ })
28
+
29
+ it('renders correctly with service computed', () => {
30
+ const wrapper = mount(LogoBrandSection, {
31
+ global: {
32
+ plugins: [vuetify],
33
+ stubs: ['RouterLink', 'Logo'],
34
+ },
35
+ props: {
36
+ theme: 'default',
37
+ serviceTitle: 'Service Title',
38
+ serviceSubTitle: 'Service Sub Title',
39
+ },
40
+ })
41
+
42
+ expect(wrapper.text()).toContain('Service Title')
43
+ })
44
+
45
+ it('renders correctly with service computed', () => {
46
+ const wrapper = mount(LogoBrandSection, {
47
+ global: {
48
+ plugins: [vuetify],
49
+ stubs: ['RouterLink', 'Logo'],
50
+ },
51
+ props: {
52
+ theme: 'compte-entreprise',
53
+ },
54
+ })
55
+
56
+ expect(wrapper.text()).toContain('Compte entreprise')
57
+ })
58
+
59
+ it('renders correctly with height', () => {
60
+ const wrapper = mount(LogoBrandSection, {
61
+ global: {
62
+ plugins: [vuetify],
63
+ stubs: ['RouterLink', 'Logo'],
64
+ },
65
+ props: {
66
+ theme: 'default',
67
+ serviceTitle: 'Service Title',
68
+ serviceSubTitle: 'Service Sub Title',
69
+ mobileVersion: false,
70
+ reduceLogo: false,
71
+ homeLink: {
72
+ href: '/',
73
+ },
74
+ },
75
+ })
76
+
77
+ const mainDiv = wrapper.find('.vd-logo-brand-section')
78
+ expect(mainDiv.attributes('height')).toBe('64px')
79
+ })
80
+
81
+ it('renders correctly with showServiceSubTitle', () => {
82
+ const wrapper = mount(LogoBrandSection, {
83
+ global: {
84
+ plugins: [vuetify],
85
+ stubs: ['RouterLink', 'Logo'],
86
+ },
87
+ props: {
88
+ theme: 'default',
89
+ serviceTitle: 'Service Title',
90
+ serviceSubTitle: 'Service Sub Title',
91
+ },
92
+ })
93
+
94
+ expect(wrapper.text()).toContain('Service Sub Title')
95
+ })
96
+
97
+ it('renders correctly with no showServiceSubTitle', () => {
98
+ const wrapper = mount(LogoBrandSection, {
99
+ global: {
100
+ plugins: [vuetify],
101
+ stubs: ['RouterLink', 'Logo'],
102
+ },
103
+ props: {
104
+ theme: 'default',
105
+ serviceTitle: 'Service Title',
106
+ serviceSubTitle: '',
107
+ },
108
+ })
109
+
110
+ expect(wrapper.find('.vd-title').text()).toBe('Service Title')
111
+ })
112
+
113
+ it('renders correctly with default theme', () => {
114
+ const wrapper = mount(LogoBrandSection, {
115
+ global: {
116
+ plugins: [vuetify],
117
+ stubs: ['RouterLink', 'Logo'],
118
+ },
119
+ props: {
120
+ serviceTitle: 'Service Title',
121
+ serviceSubTitle: 'Service Sub Title',
122
+ },
123
+ })
124
+
125
+ const divider = wrapper.find('.vd-divider')
126
+ expect(divider.attributes('fill')).toBe('#0c419a')
127
+ })
128
+
129
+ it('renders correctly with cnam theme', () => {
130
+ const wrapper = mount(LogoBrandSection, {
131
+ global: {
132
+ plugins: [vuetify],
133
+ stubs: ['RouterLink', 'Logo'],
134
+ },
135
+ props: {
136
+ theme: 'cnam',
137
+ serviceTitle: 'Service Title',
138
+ serviceSubTitle: 'Service Sub Title',
139
+ },
140
+ })
141
+
142
+ const divider = wrapper.find('.vd-divider')
143
+ expect(divider.attributes('fill')).toBe('#006386')
144
+ })
145
+
146
+ it('renders correctly with compte entreprise theme', () => {
147
+ const wrapper = mount(LogoBrandSection, {
148
+ global: {
149
+ plugins: [vuetify],
150
+ stubs: ['RouterLink', 'Logo'],
151
+ },
152
+ props: {
153
+ theme: 'compte-entreprise',
154
+ serviceTitle: 'Service Title',
155
+ serviceSubTitle: 'Service Sub Title',
156
+ },
157
+ })
158
+
159
+ const divider = wrapper.find('.vd-divider')
160
+ expect(divider.attributes('fill')).toBe('#cd545b')
161
+ })
162
+
163
+ it('renders correctly with risquePro if no reduceLogo', () => {
164
+ const wrapper = mount(LogoBrandSection, {
165
+ global: {
166
+ plugins: [vuetify],
167
+ stubs: ['RouterLink', 'Logo'],
168
+ },
169
+ props: {
170
+ theme: 'risque-pro',
171
+ reduceLogo: false,
172
+ },
173
+ })
174
+
175
+ expect(wrapper.find('logo-stub').attributes('risquepro')).toBe('true')
176
+ expect(wrapper.find('logo-stub').attributes('hidesignature')).toBe('false')
177
+ })
178
+
179
+ it('renders correctly with risquePro', () => {
180
+ const wrapper = mount(LogoBrandSection, {
181
+ global: {
182
+ plugins: [vuetify],
183
+ stubs: ['RouterLink', 'Logo'],
184
+ },
185
+ props: {
186
+ theme: 'risque-pro',
187
+ reduceLogo: true,
188
+ },
189
+ })
190
+
191
+ expect(wrapper.find('logo-stub').attributes('hidesignature')).toBe('true')
192
+ })
193
+
194
+ it('renders correctly with isCompteEntreprise', () => {
195
+ const wrapper = mount(LogoBrandSection, {
196
+ global: {
197
+ plugins: [vuetify],
198
+ stubs: ['RouterLink', 'Logo'],
199
+ },
200
+ props: {
201
+ theme: 'compte-entreprise',
202
+ },
203
+ })
204
+
205
+ expect(wrapper.text()).toContain('Compte entreprise')
206
+ })
207
+
208
+ it('renders correctly with isCompteAmeliMobile', () => {
209
+ const wrapper = mount(LogoBrandSection, {
210
+ global: {
211
+ plugins: [vuetify],
212
+ stubs: ['RouterLink', 'Logo'],
213
+ },
214
+ props: {
215
+ theme: 'compte-ameli',
216
+ mobileVersion: true,
217
+ },
218
+ })
219
+
220
+ const img = wrapper.find('.vd-home-link img')
221
+ expect(img.attributes('alt')).toBe('Compte ameli')
222
+ })
223
+
224
+ it('renders correctly without signature', () => {
225
+ const wrapper = mount(LogoBrandSection, {
226
+ global: {
227
+ plugins: [vuetify],
228
+ stubs: ['RouterLink', 'Logo'],
229
+ },
230
+ props: {
231
+ theme: 'default',
232
+ reduceLogo: true,
233
+ },
234
+ })
235
+
236
+ expect(wrapper.find('logo-stub').attributes('hidesignature')).toBe('true')
237
+ })
238
+
239
+ it('renders correctly without hideSignature', () => {
240
+ const wrapper = mount(LogoBrandSection, {
241
+ global: {
242
+ plugins: [vuetify],
243
+ stubs: ['RouterLink', 'Logo'],
244
+ },
245
+ props: {
246
+ theme: 'default',
247
+ reduceLogo: false,
248
+ },
249
+ })
250
+
251
+ expect(wrapper.find('logo-stub').attributes('hidesignature')).toBe('false')
252
+ })
253
+
254
+ it('renders correctly with secondaryLogo', () => {
255
+ const wrapper = mount(LogoBrandSection, {
256
+ global: {
257
+ stubs: ['RouterLink', 'Logo'],
258
+ plugins: [vuetify],
259
+ },
260
+ props: {
261
+ theme: 'compte-ameli',
262
+ },
263
+ })
264
+
265
+ expect(wrapper.find('[alt="Compte ameli"]').exists()).toBe(true)
266
+ })
267
+
268
+ it('renders correctly with logoContainerComponent', () => {
269
+ const wrapper = mount(LogoBrandSection, {
270
+ global: {
271
+ plugins: [vuetify],
272
+ stubs: ['RouterLink', 'Logo'],
273
+ },
274
+ props: {
275
+ theme: 'default',
276
+ homeLink: {
277
+ href: '#',
278
+ },
279
+ },
280
+ })
281
+
282
+ expect(wrapper.find('a').attributes('href')).toBe('#')
283
+ })
284
+
285
+ it('renders correctly RouterLink with logoContainerComponent', () => {
286
+ const wrapper = mount(LogoBrandSection, {
287
+ global: {
288
+ plugins: [vuetify],
289
+ stubs: ['RouterLink', 'Logo'],
290
+ },
291
+ props: {
292
+ theme: 'default',
293
+ homeLink: {
294
+ to: '/',
295
+ },
296
+ },
297
+ })
298
+
299
+ expect(wrapper.find('router-link-stub').attributes('to')).toBe('/')
300
+ })
301
+
302
+ it('renders correctly with logoContainerComponent', () => {
303
+ const wrapper = mount(LogoBrandSection, {
304
+ global: {
305
+ plugins: [vuetify],
306
+ stubs: ['RouterLink', 'Logo'],
307
+ },
308
+ props: {
309
+ theme: 'default',
310
+ homeLink: {
311
+ href: undefined,
312
+ to: undefined,
313
+ },
314
+ },
315
+ })
316
+
317
+ expect(wrapper.find('.vd-home-link').element.tagName).toBe('DIV')
318
+ })
319
+
320
+ it('renders correctly with secondaryLogoCtnComponent', () => {
321
+ const wrapper = mount(LogoBrandSection, {
322
+ global: {
323
+ plugins: [vuetify],
324
+ stubs: ['RouterLink', 'Logo'],
325
+ },
326
+ props: {
327
+ theme: 'default',
328
+ },
329
+ })
330
+
331
+ expect(wrapper.findAll('.vd-home-link').length).toBe(1)
332
+ })
333
+
334
+ it('renders correctly with secondaryLogoCtnComponent', () => {
335
+ const wrapper = mount(LogoBrandSection, {
336
+ global: {
337
+ plugins: [vuetify],
338
+ stubs: ['RouterLink', 'Logo'],
339
+ },
340
+ props: {
341
+ theme: 'ameli-pro',
342
+ },
343
+ })
344
+
345
+ expect(wrapper.findAll('.vd-home-link').length).toBe(2)
346
+ })
347
+
348
+ it('renders correctly with secondaryLogoCtnComponent', () => {
349
+ const wrapper = mount(LogoBrandSection, {
350
+ global: {
351
+ plugins: [vuetify],
352
+ stubs: ['RouterLink', 'Logo'],
353
+ },
354
+ props: {
355
+ theme: 'ameli',
356
+ homeLink: {
357
+ href: undefined,
358
+ to: undefined,
359
+ },
360
+ },
361
+ })
362
+
363
+ expect(wrapper.findAll('.vd-home-link')[1].element.tagName).toBe('DIV')
364
+ })
365
+ })
@@ -0,0 +1,14 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`LogoBrandSection > renders correctly 1`] = `
4
+ "<div data-v-7f5c1754="" height="64px" class="vd-logo-brand-section d-flex"><a data-v-7f5c1754="" href="/" class="vd-home-link">
5
+ <logo-stub data-v-7f5c1754="" hidesignature="false" hideorganism="false" risquepro="false" avatar="false" dark="false" size="normal" class=""></logo-stub>
6
+ </a><svg data-v-7f5c1754="" width="22" height="64" fill="#0c419a" role="img" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 64" class="vd-divider">
7
+ <path data-v-7f5c1754="" d="M14.3 49.3c-.2 0-.4-.2-.4-.4V14.2c0-.2.2-.4.4-.4.3 0 .5.2.5.4v34.7c0 .2-.2.4-.5.4Z"></path>
8
+ </svg>
9
+ <div data-v-7f5c1754="" class="vd-title-container d-flex justify-center flex-column text-primary">
10
+ <h1 data-v-7f5c1754="" class="vd-title text-caption text-md-subtitle-1 font-weight-medium">Service Title</h1>
11
+ <h2 data-v-7f5c1754="" class="vd-title text-caption">Service Sub Title</h2>
12
+ </div>
13
+ </div>"
14
+ `;
@@ -0,0 +1,8 @@
1
+ export type Theme =
2
+ | 'ameli'
3
+ | 'ameli-pro'
4
+ | 'cnam'
5
+ | 'compte-ameli'
6
+ | 'compte-entreprise'
7
+ | 'default'
8
+ | 'risque-pro'
@@ -30,9 +30,9 @@ import * as NotificationBarStories from './NotificationBar.stories';
30
30
  <Source dark code={`
31
31
  <script setup lang="ts">
32
32
  import { VBtn } from 'vuetify/components'
33
- import NotificationBar from '@/components/NotificationBar/NotificationBar.vue'
34
- import { useNotificationService } from '@/services/NotificationService'
35
- import type { Notification } from '@/components/NotificationBar/types'
33
+ import NotificationBar from '@cnamts/synapse'
34
+ import { useNotificationService } from '@cnamts/synapse/src/services/NotificationService'
35
+ import type { Notification } from '@cnamts/synapse/src/components/NotificationBar/types'
36
36
 
37
37
  const { addNotification } = useNotificationService()
38
38
 
@@ -83,12 +83,12 @@ import * as NotificationBarStories from './NotificationBar.stories';
83
83
  </div>
84
84
  </template>
85
85
 
86
- <style scoped>
86
+ <style scoped>
87
87
  .button-group {
88
88
  display: flex;
89
89
  flex-direction: column;
90
90
  gap: 16px;
91
91
  margin-top: 20px;
92
92
  }
93
- </style>
94
- `} />
93
+ </style>
94
+ `} />
@@ -13,7 +13,7 @@ interface StoryArgs {
13
13
  }
14
14
 
15
15
  const meta: Meta<typeof NotificationBar> = {
16
- title: 'Components/NotificationBar',
16
+ title: 'Composants/Feedback/NotificationBar',
17
17
  parameters: {
18
18
  layout: 'fullscreen',
19
19
  },
@@ -50,8 +50,8 @@
50
50
  if (currentNotification.value) {
51
51
  const typeColor: Record<string, string> = {
52
52
  info: 'info',
53
- success: 'success',
54
- warning: 'warning',
53
+ success: '#56C271',
54
+ warning: '#F0B323',
55
55
  error: 'error',
56
56
  }
57
57
  return typeColor[currentNotification.value.type] || 'info'
@@ -64,7 +64,7 @@ describe('NotificationBar.vue', () => {
64
64
  wrapper.vm.openNotification(notification)
65
65
 
66
66
  await nextTick()
67
- expect(wrapper.vm.color).toBe('success')
67
+ expect(wrapper.vm.color).toBe('#56C271')
68
68
  })
69
69
 
70
70
  it('should close notification when handleClearNotification is called', async () => {
@@ -18,7 +18,7 @@ Le composant `PageContainer` est un conteneur transparent utilisé pour afficher
18
18
 
19
19
  <Source dark code={`
20
20
  <script setup lang="ts">
21
- import PageContainer from '@/components/PageContainer/PageContainer.vue'
21
+ import PageContainer from '@cnamts/synapse'
22
22
  </script>
23
23
 
24
24
  <template>
@@ -3,7 +3,7 @@ import PageContainer from './PageContainer.vue'
3
3
  import { VCard } from 'vuetify/components'
4
4
 
5
5
  const meta = {
6
- title: 'Components/PageContainer',
6
+ title: 'Composants/Layout/PageContainer',
7
7
  component: PageContainer,
8
8
  parameters: {
9
9
  layout: 'fullscreen',
@@ -33,6 +33,26 @@ export default meta
33
33
  type Story = StoryObj<typeof meta>
34
34
 
35
35
  export const Default: Story = {
36
+ parameters: {
37
+ sourceCode: [
38
+ {
39
+ name: 'Template',
40
+ code: `<template>
41
+ <PageContainer>
42
+ Contenu de la page
43
+ </PageContainer>
44
+ </template>
45
+ `,
46
+ },
47
+ {
48
+ name: 'Script',
49
+ code: `<script setup lang="ts">
50
+ import PageContainer from '@cnamts/synapse'
51
+ </script>
52
+ `,
53
+ },
54
+ ],
55
+ },
36
56
  args: {
37
57
  default: 'Contenu de la page',
38
58
  },
@@ -52,6 +72,26 @@ export const Default: Story = {
52
72
  }
53
73
 
54
74
  export const Size: Story = {
75
+ parameters: {
76
+ sourceCode: [
77
+ {
78
+ name: 'Template',
79
+ code: `<template>
80
+ <PageContainer size="s">
81
+ Contenu de la page
82
+ </PageContainer>
83
+ </template>
84
+ `,
85
+ },
86
+ {
87
+ name: 'Script',
88
+ code: `<script setup lang="ts">
89
+ import PageContainer from '@cnamts/synapse'
90
+ </script>
91
+ `,
92
+ },
93
+ ],
94
+ },
55
95
  args: {
56
96
  default: 'Contenu de la page',
57
97
  size: 's',
@@ -72,6 +112,28 @@ export const Size: Story = {
72
112
  }
73
113
 
74
114
  export const Color: Story = {
115
+ parameters: {
116
+ sourceCode: [
117
+ {
118
+ name: 'Template',
119
+ code: `<template>
120
+ <PageContainer color="primary">
121
+ <div class="pa-8">
122
+ Contenu de la page
123
+ </div>
124
+ </PageContainer>
125
+ </template>
126
+ `,
127
+ },
128
+ {
129
+ name: 'Script',
130
+ code: `<script setup lang="ts">
131
+ import PageContainer from '@cnamts/synapse'
132
+ </script>
133
+ `,
134
+ },
135
+ ],
136
+ },
75
137
  args: {
76
138
  default: 'Contenu de la page',
77
139
  color: 'primary',
@@ -94,6 +156,29 @@ export const Color: Story = {
94
156
  }
95
157
 
96
158
  export const Card: Story = {
159
+ parameters: {
160
+ sourceCode: [
161
+ {
162
+ name: 'Template',
163
+ code: `<template>
164
+ <PageContainer>
165
+ <VCard class="pa-8">
166
+ Contenu de la page
167
+ </VCard>
168
+ </PageContainer>
169
+ </template>
170
+ `,
171
+ },
172
+ {
173
+ name: 'Script',
174
+ code: `<script setup lang="ts">
175
+ import PageContainer from '@cnamts/synapse'
176
+ import { VCard } from 'vuetify/components'
177
+ </script>
178
+ `,
179
+ },
180
+ ],
181
+ },
97
182
  args: {
98
183
  default: 'Contenu de la page',
99
184
  },
@@ -0,0 +1,49 @@
1
+ import { Meta, Canvas, Controls, Source } from '@storybook/addon-docs'
2
+ import * as PhoneFieldStories from './PhoneField.stories.ts';
3
+ import PhoneField from './PhoneField.vue'
4
+
5
+ <Meta title="Composants/Formulaires/PhoneField" component={PhoneField} />
6
+
7
+ # PhoneField
8
+
9
+ The `PhoneField` component is used to input phone numbers with various formatting options.
10
+
11
+ <Canvas of={PhoneFieldStories.Default} />
12
+
13
+ # API
14
+
15
+ <Controls of={PhoneFieldStories.Default} />
16
+
17
+ # Exemple d'utilisation
18
+
19
+ <Source dark code={`
20
+ <script setup lang="ts">
21
+ import PhoneField from '@cnamts/synapse'
22
+ import { ref } from 'vue'
23
+
24
+ const value = ref('')
25
+
26
+ const handleChange = (newValue) => {
27
+ console.log('Value changed:', newValue)
28
+ }
29
+ const customIndicatifs = ref([
30
+ { code: '+99', country: 'Utopia', abbreviation: 'UT', mask: '## ## ## ##', phoneLength: 8 },
31
+ { code: '+98', country: 'Paradise', abbreviation: 'PA', mask: '## ## ## ##', phoneLength: 18 },
32
+ ])
33
+ </script>
34
+
35
+ <template>
36
+ <PhoneField
37
+ v-model="value"
38
+ required
39
+ with-country-code
40
+ country-code-required
41
+ display-format="code-abbreviation"
42
+ :custom-indicatifs="customIndicatifs"
43
+ :use-custom-indicatifs-only="true"
44
+ outlined
45
+ outlined-indicatif
46
+ @change="handleChange"
47
+ />
48
+ </template>
49
+ `} />