@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
@@ -20,6 +20,7 @@
20
20
  numberLabel?: string
21
21
  keyLabel?: string
22
22
  displayKey?: boolean
23
+ showSuccessMessages?: boolean
23
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
24
25
  customNumberRules?: any
25
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
@@ -33,6 +34,7 @@
33
34
  numberLabel: 'Numéro de sécurité sociale',
34
35
  keyLabel: 'Clé',
35
36
  displayKey: true,
37
+ showSuccessMessages: false,
36
38
  customNumberRules: [],
37
39
  customKeyRules: [],
38
40
  })
@@ -239,18 +241,19 @@
239
241
  validateOnSubmit,
240
242
  })
241
243
  </script>
244
+
242
245
  <template>
243
246
  <div class="d-flex align-start">
244
247
  <v-input
245
248
  ref="vInput"
246
249
  :class="{
247
- 'v-messages__message--success': successes.length > 0,
250
+ 'v-messages__message--success': successes.length > 0 && props.showSuccessMessages,
248
251
  'v-messages__message--error': errors.length > 0
249
252
  }"
250
253
  :error-messages="errors"
251
254
  :label="numberLabel"
252
255
  :max-errors="3"
253
- :messages="successes"
256
+ :messages="props.showSuccessMessages ? successes : []"
254
257
  :model-value="[numberValue, keyValue]"
255
258
  class="vd-nir-field__fields-wrapper multi-line"
256
259
  validate-on="blur lazy"
@@ -336,115 +339,112 @@
336
339
  </template>
337
340
 
338
341
  <style lang="scss" scoped>
339
- @use '@/assets/tokens.scss';
342
+ @use '@/assets/tokens';
340
343
 
341
344
  .v-messages__message--success {
342
- color: tokens.$colors-border-success !important;
345
+ color: tokens.$colors-border-success !important;
343
346
 
344
- .v-field--active & {
345
- color: tokens.$colors-border-success !important;
346
- }
347
+ .v-field--active & {
348
+ color: tokens.$colors-border-success !important;
349
+ }
347
350
  }
348
351
 
349
352
  .v-messages__message--error {
350
- color: tokens.$colors-border-error;
353
+ color: tokens.$colors-border-error;
351
354
 
352
- .v-field--active & {
353
- color: tokens.$colors-border-error;
354
- }
355
+ .v-field--active & {
356
+ color: tokens.$colors-border-error;
357
+ }
355
358
  }
356
359
 
357
360
  :deep(.v-field.v-field--active .v-label.v-field-label--floating) {
358
- opacity: 1;
361
+ opacity: 1;
359
362
  }
360
363
 
361
364
  .multi-line {
362
- white-space: pre-line !important;
365
+ white-space: pre-line !important;
363
366
  }
364
367
 
365
368
  .vd-number-field {
366
- max-width: 296px;
369
+ max-width: 296px;
367
370
  }
368
371
 
369
372
  .vd-key-field {
370
- width: 104px;
373
+ width: 104px;
374
+ flex: none;
371
375
  }
372
376
 
373
377
  .custom-counter {
374
- color: rgba(0, 0, 0, 0.54);
378
+ color: rgb(0 0 0 / 54%);
375
379
  }
376
380
 
377
381
  .vd-nir-field :deep(.v-input__append-inner),
378
382
  .vd-tooltip-icon {
379
- flex: none;
380
- color: rgba(0, 0, 0, 0.54);
383
+ flex: none;
384
+ color: rgb(0 0 0 / 54%);
381
385
  }
382
386
 
383
387
  :deep(.v-overlay__content) {
384
- background: rgba(84, 88, 89, 0.95) !important;
385
- }
386
-
387
- .vd-key-field {
388
- flex: none;
388
+ background: rgb(84 88 89 / 95%) !important;
389
389
  }
390
390
 
391
391
  .vd-nir-field--outlined :deep(.v-messages.error--text) {
392
- padding: 6px;
392
+ padding: 6px;
393
393
  }
394
394
 
395
395
  .vd-nir-field {
396
- container-name: nirFieldwrapper;
396
+ container-name: nirfieldwrapper;
397
397
  }
398
398
 
399
399
  :deep(.v-input__append) {
400
- margin-inline-start: 0 !important;
400
+ margin-inline-start: 0 !important;
401
401
  }
402
+
402
403
  :deep(.vd-number-field > .v-input__prepend) {
403
- margin-right: 0 !important;
404
+ margin-right: 0 !important;
404
405
  }
405
406
 
406
407
  :deep(.vd-key-field > .v-input__prepend) {
407
- @media screen and (max-width: 360px) {
408
- margin-inline-end: 0 !important;
409
- }
408
+ @media screen and (width <= 360px) {
409
+ margin-inline-end: 0 !important;
410
+ }
410
411
  }
411
412
 
412
413
  :deep(.v-text-field .v-input__details) {
413
- padding-inline-start: 0 !important;
414
- padding-inline-end: 0 !important;
415
- flex: none !important;
414
+ padding-inline: 0 !important;
415
+ flex: none !important;
416
416
  }
417
417
 
418
418
  :deep(.v-text-field .v-input__details .v-messages) {
419
- color: rgba(0, 0, 0, 1) !important;
419
+ color: rgb(0 0 0 / 100%) !important;
420
420
  }
421
421
 
422
422
  @mixin responsive-nir-wrapper {
423
- .vd-nir-field__fields-wrapper :deep(> .v-input__control) {
424
- justify-content: start;
425
- flex-wrap: wrap;
426
- gap: 4px;
427
- margin-bottom: 4px;
428
-
429
- .vd-number-field {
430
- flex: 100% 0 0;
431
- }
432
- }
423
+ .vd-nir-field__fields-wrapper :deep(> .v-input__control) {
424
+ justify-content: start;
425
+ flex-wrap: wrap;
426
+ gap: 4px;
427
+ margin-bottom: 4px;
428
+
429
+ .vd-number-field {
430
+ flex: 100% 0 0;
431
+ }
432
+ }
433
433
  }
434
434
 
435
435
  @container nirFieldwrapper (max-width: 300px) {
436
- @include responsive-nir-wrapper;
436
+ @include responsive-nir-wrapper;
437
437
  }
438
438
 
439
- @media screen and (max-width: 360px) {
440
- @include responsive-nir-wrapper;
439
+ @media screen and (width <= 360px) {
440
+ @include responsive-nir-wrapper;
441
441
  }
442
442
 
443
443
  .v-text-field .v-input__append-inner {
444
- padding-left: 0 !important;
444
+ padding-left: 0 !important;
445
445
  }
446
446
 
447
447
  :deep(.v-text-field > .v-input__control > .v-input__slot > .v-text-field__slot) {
448
- width: min-content !important;
448
+ width: min-content !important;
449
449
  }
450
450
  </style>
@@ -17,6 +17,7 @@ describe('NirField.vue', () => {
17
17
  props: {
18
18
  modelValue: '',
19
19
  required: true,
20
+ showSuccessMessages: true,
20
21
  },
21
22
  })
22
23
  })
@@ -7,6 +7,20 @@ const meta = {
7
7
  parameters: {
8
8
  layout: 'fullscreen',
9
9
  },
10
+ argTypes: {
11
+ hideBtn: {
12
+ control: { type: 'boolean' },
13
+ },
14
+ btnText: {
15
+ control: { type: 'text' },
16
+ },
17
+ btnHref: {
18
+ control: { type: 'text' },
19
+ },
20
+ btnLink: {
21
+ control: { type: 'text' },
22
+ },
23
+ },
10
24
  } satisfies Meta<typeof NotFoundPage>
11
25
 
12
26
  export default meta
@@ -14,6 +28,10 @@ export default meta
14
28
  type Story = StoryObj<typeof NotFoundPage>
15
29
 
16
30
  export const Default: Story = {
31
+ args: {
32
+ btnText: 'Retour à l’accueil',
33
+ btnHref: '/',
34
+ },
17
35
  parameters: {
18
36
  query: {
19
37
  support_id: '',
@@ -24,7 +42,10 @@ export const Default: Story = {
24
42
  code: `
25
43
  <template>
26
44
  <div style="padding: 20px; background: rgb(231, 236, 245)">
27
- <NotFoundPage />
45
+ <NotFoundPage
46
+ btn-text="Retour à l’accueil"
47
+ btn-href="/"
48
+ />
28
49
  </div>
29
50
  </template>
30
51
  `,
@@ -45,17 +66,27 @@ export const Default: Story = {
45
66
  }
46
67
 
47
68
  export const WithErrorCode: Story = {
69
+ args: {
70
+ btnText: 'Retour à l’accueil',
71
+ btnHref: '/',
72
+ },
48
73
  parameters: {
49
74
  query: {
50
75
  support_id: '1234567890123456789',
51
76
  },
77
+ btnText: 'Retour à l’accueil',
78
+ btnHref: '/',
79
+ hideBtn: false,
52
80
  sourceCode: [
53
81
  {
54
82
  name: 'Template',
55
83
  code: `
56
84
  <template>
57
85
  <div style="padding: 20px; background: rgb(231, 236, 245)">
58
- <NotFoundPage />
86
+ <NotFoundPage
87
+ btn-text="Retour à l’accueil"
88
+ btn-href="/"
89
+ />
59
90
  </div>
60
91
  </template>
61
92
  `,
@@ -2,10 +2,23 @@
2
2
  import { onMounted, ref } from 'vue'
3
3
  import ErrorPage from '../ErrorPage/ErrorPage.vue'
4
4
  import { locales } from './locales'
5
+ import type { RouteRecordRaw } from 'vue-router'
5
6
 
6
7
  const SUPPORT_ID_PARAM_NAME = 'support_id'
7
8
  const supportId = ref<string | undefined>()
8
9
 
10
+ withDefaults(defineProps<{
11
+ btnText?: string
12
+ btnHref?: string
13
+ btnLink?: RouteRecordRaw | string
14
+ hideBtn?: boolean
15
+ }>(), {
16
+ btnText: undefined,
17
+ btnLink: '/',
18
+ btnHref: undefined,
19
+ hideBtn: false,
20
+ })
21
+
9
22
  onMounted(() => {
10
23
  const params = new URLSearchParams(document.location.search)
11
24
  let supportIdParam = params.get(SUPPORT_ID_PARAM_NAME)
@@ -23,6 +36,10 @@
23
36
  :code="locales.code"
24
37
  :page-title="locales.pageTitle"
25
38
  :message="locales.message"
39
+ :btn-text="btnText"
40
+ :btn-href="btnHref"
41
+ :btn-link="btnLink"
42
+ :hide-btn="hideBtn"
26
43
  >
27
44
  <template
28
45
  v-if="supportId"
@@ -6,13 +6,13 @@ import * as NotificationBarStories from './NotificationBar.stories';
6
6
 
7
7
  # NotificationBar
8
8
 
9
- ##### Les notification bars servent à notifier l’utilisateur soit d’un retour d’action.
9
+ ##### Les NotificationsBar servent à notifier l’utilisateur soit d’un retour d’action.
10
10
 
11
- ##### Deux actions sont possible :
11
+ ##### Deux actions sont possibles :
12
12
  - Fermer la notification lorsqu’elle a été vue
13
13
  - Cliquer sur un élément qui permet de faire une action secondaire (comme amener sur une page visée par la notification).
14
14
 
15
- ##### L’affichage d’une durée de quelques secondes et disprition automatique de la notification bar est déconseillé pour des raisons d’accessibilité afin de permettre à tout le monde de prendre le temps nécessaire de lire la notification.
15
+ ##### L’affichage d’une durée de quelques secondes et disparition automatique de la notification bar est déconseillé pour des raisons d’accessibilité afin de permettre à tout le monde de prendre le temps nécessaire de lire la notification.
16
16
 
17
17
  ##### Les 4 états son disponibles :
18
18
  - **Information** : Information supplémentaire nécessaire à la compréhension de l’utilisateur d’un élément spécifique.
@@ -20,10 +20,10 @@ import * as NotificationBarStories from './NotificationBar.stories';
20
20
  - **Warning** : Alerte, élément important mais pas bloquant. L’utilisateur a besoin d’être informé d’un élément ou d’une conséquence.
21
21
  - **Success** : l’action a été réalisée correctement et prise en compte.
22
22
 
23
- <Canvas of={NotificationBarStories.Success} />
23
+ <Canvas of={NotificationBarStories.Default} />
24
24
 
25
25
  # API
26
- <Controls of={NotificationBarStories.Success} />
26
+ <Controls of={NotificationBarStories.Default} />
27
27
 
28
28
  # Exemple d'utilisation
29
29