@cnamts/synapse 0.0.6-alpha → 0.0.8-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 (122) hide show
  1. package/dist/design-system-v3.d.ts +331 -372
  2. package/dist/design-system-v3.js +2794 -2637
  3. package/dist/design-system-v3.umd.cjs +1 -10
  4. package/dist/style.css +1 -1
  5. package/package.json +10 -2
  6. package/src/assets/settings.scss +2 -2
  7. package/src/assets/tokens.scss +107 -112
  8. package/src/components/BackBtn/BackBtn.stories.ts +4 -1
  9. package/src/components/BackBtn/BackBtn.vue +4 -4
  10. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +3 -3
  11. package/src/components/BackToTopBtn/BackToTopBtn.vue +1 -0
  12. package/src/components/CollapsibleList/CollapsibleList.mdx +1 -1
  13. package/src/components/CollapsibleList/CollapsibleList.vue +43 -44
  14. package/src/components/ContextualMenu/ContextualMenu.mdx +118 -0
  15. package/src/components/ContextualMenu/ContextualMenu.stories.ts +430 -0
  16. package/src/components/ContextualMenu/ContextualMenu.vue +101 -0
  17. package/src/components/ContextualMenu/tests/ContextualMenu.spec.ts +115 -0
  18. package/src/components/ContextualMenu/tests/__snapshots__/ContextualMenu.spec.ts.snap +10 -0
  19. package/src/components/ContextualMenu/types.ts +5 -0
  20. package/src/components/CookieBanner/CookieBanner.stories.ts +3 -2
  21. package/src/components/CookieBanner/CookieBanner.vue +13 -10
  22. package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +17 -15
  23. package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +6 -1
  24. package/src/components/CookiesSelection/CookiesInformation/locales.ts +1 -0
  25. package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +1 -0
  26. package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +17 -15
  27. package/src/components/CopyBtn/CopyBtn.stories.ts +5 -2
  28. package/src/components/CopyBtn/CopyBtn.vue +7 -7
  29. package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +11 -51
  30. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +26 -26
  31. package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +4 -1
  32. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +19 -7
  33. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +24 -24
  34. package/src/components/Customs/SySelect/SySelect.mdx +1 -2
  35. package/src/components/Customs/SySelect/SySelect.stories.ts +0 -2
  36. package/src/components/Customs/SySelect/SySelect.vue +27 -26
  37. package/src/components/DataList/DataList.stories.ts +3 -2
  38. package/src/components/DataList/DataList.vue +1 -1
  39. package/src/components/DataListGroup/DataListGroup.stories.ts +3 -2
  40. package/src/components/DataListItem/DataListItem.vue +12 -12
  41. package/src/components/DialogBox/DialogBox.mdx +28 -2
  42. package/src/components/DialogBox/DialogBox.stories.ts +1 -1
  43. package/src/components/DialogBox/DialogBox.vue +3 -2
  44. package/src/components/DownloadBtn/DownloadBtn.mdx +3 -4
  45. package/src/components/DownloadBtn/DownloadBtn.stories.ts +20 -21
  46. package/src/components/DownloadBtn/DownloadBtn.vue +2 -1
  47. package/src/components/ErrorPage/ErrorPage.vue +1 -1
  48. package/src/components/ExternalLinks/ExternalLinks.mdx +86 -0
  49. package/src/components/ExternalLinks/ExternalLinks.stories.ts +553 -0
  50. package/src/components/ExternalLinks/ExternalLinks.vue +200 -0
  51. package/src/components/ExternalLinks/config.ts +34 -0
  52. package/src/components/ExternalLinks/locales.ts +4 -0
  53. package/src/components/ExternalLinks/tests/ExternalLinks.spec.ts +154 -0
  54. package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +159 -0
  55. package/src/components/FooterBar/FooterBar.vue +111 -82
  56. package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +2 -1
  57. package/src/components/FranceConnectBtn/FranceConnectBtn.vue +14 -13
  58. package/src/components/HeaderBar/HeaderBar.stories.ts +19 -12
  59. package/src/components/HeaderBar/HeaderBar.vue +8 -3
  60. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +12 -7
  61. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +5 -5
  62. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +2 -2
  63. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +10 -8
  64. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -2
  65. package/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.vue +2 -1
  66. package/src/components/HeaderBar/HeaderLogo/logos/Logo.vue +2 -1
  67. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +10 -10
  68. package/src/components/HeaderBar/consts.scss +1 -1
  69. package/src/components/HeaderLoading/HeaderLoading.vue +12 -11
  70. package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +104 -32
  71. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
  72. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +9 -9
  73. package/src/components/HeaderToolbar/HeaderToolbar.vue +215 -180
  74. package/src/components/LangBtn/LangBtn.vue +8 -6
  75. package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
  76. package/src/components/NirField/NirField.mdx +1 -4
  77. package/src/components/NirField/NirField.stories.ts +71 -18
  78. package/src/components/NirField/NirField.vue +49 -49
  79. package/src/components/NirField/tests/NirField.spec.ts +1 -0
  80. package/src/components/NotFoundPage/NotFoundPage.stories.ts +33 -2
  81. package/src/components/NotFoundPage/NotFoundPage.vue +17 -0
  82. package/src/components/NotificationBar/NotificationBar.mdx +5 -5
  83. package/src/components/NotificationBar/NotificationBar.stories.ts +410 -314
  84. package/src/components/NotificationBar/NotificationBar.vue +43 -41
  85. package/src/components/PageContainer/PageContainer.stories.ts +5 -5
  86. package/src/components/PageContainer/PageContainer.vue +13 -8
  87. package/src/components/PageContainer/tests/PageContainer.spec.ts +1 -1
  88. package/src/components/PasswordField/PasswordField.mdx +70 -0
  89. package/src/components/PasswordField/PasswordField.stories.ts +213 -0
  90. package/src/components/PasswordField/PasswordField.vue +189 -0
  91. package/src/components/PasswordField/config.ts +11 -0
  92. package/src/components/PasswordField/locales.ts +4 -0
  93. package/src/components/PasswordField/tests/PasswordField.spec.ts +96 -0
  94. package/src/components/PhoneField/PhoneField.mdx +0 -2
  95. package/src/components/PhoneField/PhoneField.stories.ts +10 -50
  96. package/src/components/PhoneField/PhoneField.vue +34 -34
  97. package/src/components/SkipLink/SkipLink.vue +10 -10
  98. package/src/components/SocialMediaLinks/SocialMediaLinks.vue +29 -21
  99. package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
  100. package/src/components/SubHeader/SubHeader.stories.ts +6 -3
  101. package/src/components/SubHeader/SubHeader.vue +32 -31
  102. package/src/components/SyAlert/SyAlert.vue +15 -8
  103. package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -1
  104. package/src/components/UserMenuBtn/config.ts +1 -1
  105. package/src/components/index.ts +10 -6
  106. package/src/designTokens/index.ts +6 -4
  107. package/src/designTokens/{bootstrapColors.md → paColors.md} +1 -1
  108. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -0
  109. package/src/designTokens/tokens/pa/paColors.ts +171 -0
  110. package/src/designTokens/tokens/pa/paContextual.ts +58 -0
  111. package/src/designTokens/tokens/pa/paDarkTheme.ts +5 -0
  112. package/src/designTokens/tokens/pa/paLightTheme.ts +123 -0
  113. package/src/designTokens/tokens/pa/paSemantic.ts +87 -0
  114. package/src/stories/GuideDuDev/CreerUneIssue.mdx +64 -0
  115. package/src/stories/GuideDuDev/{CommentUtiliserLesRules.mdx → UtiliserLesRules.mdx} +2 -2
  116. package/src/stories/GuideDuDev/components.stories.ts +9 -7
  117. package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +163 -88
  118. package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +250 -23
  119. package/src/temp/TestDTComponent.vue +5 -6
  120. package/src/designTokens/tokens/bootstrap/bootstrapColors.ts +0 -158
  121. package/src/designTokens/tokens/bootstrap/bootstrapLightTheme.ts +0 -22
  122. package/src/stories/GuideDuDev/CommentContribuer.mdx +0 -22
@@ -0,0 +1,553 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import ExternalLinks from './ExternalLinks.vue'
3
+ import { mdiArrowTopRight } from '@mdi/js'
4
+ import { VIcon } from 'vuetify/components'
5
+
6
+ const meta = {
7
+ title: 'Composants/Navigation/ExternalLinks',
8
+ component: ExternalLinks,
9
+ parameters: {
10
+ layout: 'fullscreen',
11
+ },
12
+ argTypes: {
13
+ 'position': {
14
+ control: {
15
+ type: 'select',
16
+ },
17
+ options: ['top left', 'top right', 'bottom left', 'bottom right'],
18
+ table: {
19
+ defaultValue: {
20
+ summary: 'top left',
21
+ },
22
+ type: {
23
+ summary: `'top left' | 'top right' | 'bottom left' | 'bottom right'`,
24
+ },
25
+ },
26
+ },
27
+ 'items': {
28
+ control: {
29
+ type: 'object',
30
+ },
31
+ table: {
32
+ type: {
33
+ summary: 'Array<{ text: string, href: string }>',
34
+ },
35
+ category: 'props',
36
+ },
37
+ description: 'List des liens',
38
+ },
39
+ 'btnText': {
40
+ control: {
41
+ type: 'text',
42
+ },
43
+ table: {
44
+ defaultValue: {
45
+ summary: 'Consulter les données externes',
46
+ },
47
+ type: {
48
+ summary: 'string',
49
+ },
50
+ },
51
+ description: 'Text affiché dans le bouton',
52
+ },
53
+ 'nudgeTop': {
54
+ control: {
55
+ type: 'text',
56
+ },
57
+ table: {
58
+ defaultValue: {
59
+ summary: '0px',
60
+ },
61
+ type: {
62
+ summary: 'string|number',
63
+ },
64
+ },
65
+ },
66
+ 'nudgeBottom': {
67
+ control: {
68
+ type: 'text',
69
+ },
70
+ table: {
71
+ defaultValue: {
72
+ summary: '0px',
73
+ },
74
+ type: {
75
+ summary: 'string|number',
76
+ },
77
+ },
78
+ },
79
+ 'fixed': {
80
+ control: {
81
+ type: 'boolean',
82
+ },
83
+ table: {
84
+ defaultValue: {
85
+ summary: 'false',
86
+ },
87
+ type: {
88
+ summary: 'boolean',
89
+ },
90
+ },
91
+ },
92
+ 'link-icon': {
93
+ description: 'Remplace l\'icône des liens',
94
+ control: {
95
+ type: 'text',
96
+ },
97
+ },
98
+ 'vuetifyOptions': {
99
+ control: { type: 'object' },
100
+ description:
101
+ 'Permet de personnaliser les props des composants vuetify `VMenu`, `VBtn`, `VIcon`, `VList`, `VListItem` et `VSheet` utilisés en interne.',
102
+ table: {
103
+ category: 'props',
104
+ type: {
105
+ summary: 'object',
106
+ detail: `{
107
+ menu: Record<string, any>,
108
+ btn: Record<string, any>,
109
+ btnIcon: Record<string, any>,
110
+ linkIcon: Record<string, any>,
111
+ list: Record<string, any>,
112
+ listItem: Record<string, any>,
113
+ sheet: Record<string, any>,
114
+ }`,
115
+ },
116
+ defaultValue: {
117
+ summary: 'object',
118
+ detail: `{
119
+ menu: {
120
+ tile: true,
121
+ zIndex: 4,
122
+ offset: 0,
123
+ },
124
+ btn: {
125
+ tile: true,
126
+ minHeight: '48px',
127
+ minWidth: '328px',
128
+ color: cnamColorsTokens.blue.lighten20,
129
+ class: 'd-flex px-3',
130
+ },
131
+ btnIcon: {
132
+ color: 'white',
133
+ },
134
+ linkIcon: {
135
+ color: 'rgba(0, 0, 0, .54)',
136
+ },
137
+ list: {
138
+ border: false,
139
+ elevation: 0,
140
+ class: 'py-0',
141
+ },
142
+ listItem: {
143
+ target: '_blank',
144
+ rel: 'noopener noreferrer',
145
+ },
146
+ sheet: {
147
+ class: 'px-4 py-3',
148
+ },
149
+ }`,
150
+ },
151
+ },
152
+ },
153
+ },
154
+ decorators: [() => ({ template: '<div style="min-height: 300px; overflow: hidden; position: relative"><story/></div>' })],
155
+ } satisfies Meta<typeof ExternalLinks>
156
+
157
+ export default meta
158
+
159
+ type Story = StoryObj<typeof ExternalLinks>
160
+
161
+ export const Default: Story = {
162
+ args: {
163
+ position: 'top left',
164
+ items: [
165
+ {
166
+ text: 'ameli.fr',
167
+ href: 'https://www.ameli.fr',
168
+ },
169
+ {
170
+ text: 'Github',
171
+ href: 'https://www.github.com',
172
+ },
173
+ {
174
+ text: 'Twitter',
175
+ href: 'https://www.twitter.com',
176
+ },
177
+ ],
178
+ },
179
+ parameters: {
180
+ sourceCode: [
181
+ {
182
+ name: 'Template',
183
+ code: `
184
+ <ExternalLinks
185
+ position="top left"
186
+ :items="items"
187
+ />
188
+ `,
189
+ },
190
+ {
191
+ name: 'Script',
192
+ code: `
193
+ import { ExternalLinks } from '@cnamts/synapse'
194
+
195
+ const items = [
196
+ {
197
+ text: 'ameli.fr',
198
+ href: 'https://www.ameli.fr',
199
+ },
200
+ {
201
+ text: 'Github',
202
+ href: 'https://www.github.com',
203
+ },
204
+ {
205
+ text: 'Twitter',
206
+ href: 'https://www.twitter.com',
207
+ },
208
+ ]
209
+ `,
210
+ },
211
+ ],
212
+ },
213
+ }
214
+
215
+ export const NudgeTop: Story = {
216
+ args: {
217
+ position: 'top left',
218
+ nudgeTop: '50px',
219
+ items: [
220
+ {
221
+ text: 'ameli.fr',
222
+ href: 'https://www.ameli.fr',
223
+ },
224
+ {
225
+ text: 'Github',
226
+ href: 'https://www.github.com',
227
+ },
228
+ {
229
+ text: 'Twitter',
230
+ href: 'https://www.twitter.com',
231
+ },
232
+ ],
233
+ },
234
+ parameters: {
235
+ sourceCode: [
236
+ {
237
+ name: 'Template',
238
+ code: `
239
+ <ExternalLinks
240
+ position="top left"
241
+ :items="items"
242
+ nudgeTop="50px"
243
+ />
244
+ `,
245
+ },
246
+ {
247
+ name: 'Script',
248
+ code: `
249
+ import { ExternalLinks } from '@cnamts/synapse'
250
+
251
+ const items = [
252
+ {
253
+ text: 'ameli.fr',
254
+ href: 'https://www.ameli.fr',
255
+ },
256
+ {
257
+ text: 'Github',
258
+ href: 'https://www.github.com',
259
+ },
260
+ {
261
+ text: 'Twitter',
262
+ href: 'https://www.twitter.com',
263
+ },
264
+ ]
265
+ `,
266
+ },
267
+ ],
268
+ },
269
+ }
270
+
271
+ export const NudgeBottom: Story = {
272
+ args: {
273
+ position: 'bottom left',
274
+ nudgeBottom: '50px',
275
+ items: [
276
+ {
277
+ text: 'ameli.fr',
278
+ href: 'https://www.ameli.fr',
279
+ },
280
+ {
281
+ text: 'Github',
282
+ href: 'https://www.github.com',
283
+ },
284
+ {
285
+ text: 'Twitter',
286
+ href: 'https://www.twitter.com',
287
+ },
288
+ ],
289
+ },
290
+ parameters: {
291
+ sourceCode: [
292
+ {
293
+ name: 'Template',
294
+ code: `
295
+ <ExternalLinks
296
+ position="bottom left"
297
+ :items="items"
298
+ nudgeBottom="50px"
299
+ />
300
+ `,
301
+ },
302
+ {
303
+ name: 'Script',
304
+ code: `
305
+ import { ExternalLinks } from '@cnamts/synapse'
306
+
307
+ const items = [
308
+ {
309
+ text: 'ameli.fr',
310
+ href: 'https://www.ameli.fr',
311
+ },
312
+ {
313
+ text: 'Github',
314
+ href: 'https://www.github.com',
315
+ },
316
+ {
317
+ text: 'Twitter',
318
+ href: 'https://www.twitter.com',
319
+ },
320
+ ]
321
+ `,
322
+ },
323
+ ],
324
+ },
325
+ }
326
+
327
+ export const NoData: Story = {
328
+ args: {
329
+ position: 'top left',
330
+ items: [],
331
+ },
332
+ parameters: {
333
+ sourceCode: [
334
+ {
335
+ name: 'Template',
336
+ code: `
337
+ <ExternalLinks
338
+ position="top left"
339
+ :items="[]"
340
+ />
341
+ `,
342
+ },
343
+ {
344
+ name: 'Script',
345
+ code: `
346
+ import { ExternalLinks } from '@cnamts/synapse'
347
+
348
+ `,
349
+ },
350
+ ],
351
+ },
352
+ }
353
+
354
+ export const BtnText: Story = {
355
+ args: {
356
+ items: [
357
+ {
358
+ text: 'ameli.fr',
359
+ href: 'https://www.ameli.fr',
360
+ },
361
+ {
362
+ text: 'Github',
363
+ href: 'https://www.github.com',
364
+ },
365
+ {
366
+ text: 'Twitter',
367
+ href: 'https://www.twitter.com',
368
+ },
369
+ ],
370
+ btnText: 'Afficher les liens externes',
371
+ },
372
+ parameters: {
373
+ sourceCode: [
374
+ {
375
+ name: 'Template',
376
+ code: `
377
+ <ExternalLinks
378
+ position="top left"
379
+ btn-text="Afficher les liens externes"
380
+ :items="items"
381
+ />
382
+ `,
383
+ },
384
+ {
385
+ name: 'Script',
386
+ code: `
387
+ import { ExternalLinks } from '@cnamts/synapse'
388
+
389
+ const items = [
390
+ {
391
+ text: 'ameli.fr',
392
+ href: 'https://www.ameli.fr',
393
+ },
394
+ {
395
+ text: 'Github',
396
+ href: 'https://www.github.com',
397
+ },
398
+ {
399
+ text: 'Twitter',
400
+ href: 'https://www.twitter.com',
401
+ },
402
+ ]
403
+ `,
404
+ },
405
+ ],
406
+ },
407
+ }
408
+
409
+ export const VuetifyOptions: Story = {
410
+ args: {
411
+ vuetifyOptions: {
412
+ btn: {
413
+ color: 'secondary',
414
+ },
415
+ list: {
416
+ density: 'compact',
417
+ },
418
+ },
419
+ items: [
420
+ {
421
+ text: 'ameli.fr',
422
+ href: 'https://www.ameli.fr',
423
+ },
424
+ {
425
+ text: 'Github',
426
+ href: 'https://www.github.com',
427
+ },
428
+ {
429
+ text: 'Twitter',
430
+ href: 'https://www.twitter.com',
431
+ },
432
+ ],
433
+ },
434
+ parameters: {
435
+ sourceCode: [
436
+ {
437
+ name: 'Template',
438
+ code: `
439
+ <ExternalLinks
440
+ :items
441
+ :vuetifyOptions="options"
442
+ />
443
+ `,
444
+ },
445
+ {
446
+ name: 'Script',
447
+ code: `
448
+ import { ExternalLinks } from '@cnamts/synapse'
449
+
450
+ const items = [
451
+ {
452
+ text: 'ameli.fr',
453
+ href: 'https://www.ameli.fr',
454
+ },
455
+ {
456
+ text: 'Github',
457
+ href: 'https://www.github.com',
458
+ },
459
+ {
460
+ text: 'Twitter',
461
+ href: 'https://www.twitter.com',
462
+ },
463
+ ]
464
+
465
+ const options = {
466
+ btn: {
467
+ color: 'secondary',
468
+ },
469
+ list: {
470
+ density: 'compact',
471
+ },
472
+ }
473
+ `,
474
+ },
475
+ ],
476
+ },
477
+ }
478
+
479
+ export const CustomLinksIcon: Story = {
480
+ render: (args) => {
481
+ return {
482
+ components: { ExternalLinks, VIcon },
483
+ setup() {
484
+ const items = [
485
+ {
486
+ text: 'ameli.fr',
487
+ href: 'https://www.ameli.fr',
488
+ },
489
+ {
490
+ text: 'Github',
491
+ href: 'https://www.github.com',
492
+ },
493
+ {
494
+ text: 'Twitter',
495
+ href: 'https://www.twitter.com',
496
+ },
497
+ ]
498
+ const arrowIcon = mdiArrowTopRight
499
+ return { args, items, arrowIcon }
500
+ },
501
+ template: `
502
+ <ExternalLinks :items>
503
+ <template #link-icon>
504
+ <VIcon color="rgba(0, 0, 0, 0.5)">
505
+ {{ arrowIcon }}
506
+ </VIcon>
507
+ </template>
508
+ </ExternalLinks>
509
+ `,
510
+ }
511
+ },
512
+ parameters: {
513
+ sourceCode: [
514
+ {
515
+ name: 'Template',
516
+ code: `
517
+ <ExternalLinks :items>
518
+ <template #link-icon>
519
+ <VIcon color="rgba(0, 0, 0, 0.5)">
520
+ {{ arrowIcon }}
521
+ </VIcon>
522
+ </template>
523
+ </ExternalLinks>
524
+ `,
525
+ },
526
+ {
527
+ name: 'Script',
528
+ code: `
529
+ import { ExternalLinks } from '@cnamts/synapse'
530
+ import { VIcon } from 'vuetify/components'
531
+ import { mdiArrowTopRight } from '@mdi/js'
532
+
533
+ const items = [
534
+ {
535
+ text: 'ameli.fr',
536
+ href: 'https://www.ameli.fr',
537
+ },
538
+ {
539
+ text: 'Github',
540
+ href: 'https://www.github.com',
541
+ },
542
+ {
543
+ text: 'Twitter',
544
+ href: 'https://www.twitter.com',
545
+ },
546
+ ]
547
+
548
+ const arrowIcon = mdiArrowTopRight
549
+ `,
550
+ },
551
+ ],
552
+ },
553
+ }