@cnamts/synapse 0.0.7-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 (198) hide show
  1. package/dist/design-system-v3.d.ts +785 -372
  2. package/dist/design-system-v3.js +4993 -3357
  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.vue +4 -4
  9. package/src/components/BackToTopBtn/BackToTopBtn.vue +1 -0
  10. package/src/components/CollapsibleList/CollapsibleList.mdx +1 -1
  11. package/src/components/CollapsibleList/CollapsibleList.vue +43 -44
  12. package/src/components/ContextualMenu/Accessibilite.mdx +14 -0
  13. package/src/components/ContextualMenu/Accessibilite.stories.ts +191 -0
  14. package/src/components/ContextualMenu/AccessibiliteItems.ts +89 -0
  15. package/src/components/ContextualMenu/ContextualMenu.mdx +118 -0
  16. package/src/components/ContextualMenu/ContextualMenu.stories.ts +430 -0
  17. package/src/components/ContextualMenu/ContextualMenu.vue +101 -0
  18. package/src/components/ContextualMenu/constants/ExpertiseLevelEnum.ts +4 -0
  19. package/src/components/ContextualMenu/tests/ContextualMenu.spec.ts +115 -0
  20. package/src/components/ContextualMenu/tests/__snapshots__/ContextualMenu.spec.ts.snap +10 -0
  21. package/src/components/ContextualMenu/types.ts +5 -0
  22. package/src/components/CookieBanner/CookieBanner.stories.ts +1 -2
  23. package/src/components/CookieBanner/CookieBanner.vue +13 -10
  24. package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +17 -15
  25. package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +6 -1
  26. package/src/components/CookiesSelection/CookiesInformation/locales.ts +1 -0
  27. package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +1 -0
  28. package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +17 -15
  29. package/src/components/CopyBtn/CopyBtn.vue +7 -7
  30. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +26 -26
  31. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +24 -24
  32. package/src/components/Customs/SySelect/SySelect.stories.ts +7 -7
  33. package/src/components/Customs/SySelect/SySelect.vue +36 -30
  34. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +2 -2
  35. package/src/components/Customs/SyTextField/SyTextField.stories.ts +187 -2
  36. package/src/components/Customs/SyTextField/SyTextField.vue +185 -16
  37. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +2 -4
  38. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +18 -16
  39. package/src/components/Customs/SyTextField/types.d.ts +2 -2
  40. package/src/components/DataList/DataList.stories.ts +3 -2
  41. package/src/components/DataList/DataList.vue +1 -1
  42. package/src/components/DataListGroup/DataListGroup.stories.ts +3 -2
  43. package/src/components/DataListItem/DataListItem.vue +12 -12
  44. package/src/components/DatePicker/DatePicker.mdx +191 -0
  45. package/src/components/DatePicker/DatePicker.stories.ts +787 -0
  46. package/src/components/DatePicker/DatePicker.vue +560 -0
  47. package/src/components/DatePicker/DateTextInput.vue +409 -0
  48. package/src/components/DatePicker/tests/DatePicker.spec.ts +266 -0
  49. package/src/components/DialogBox/DialogBox.mdx +28 -2
  50. package/src/components/DialogBox/DialogBox.stories.ts +2 -2
  51. package/src/components/DialogBox/DialogBox.vue +3 -2
  52. package/src/components/DownloadBtn/DownloadBtn.vue +2 -1
  53. package/src/components/ExternalLinks/Accessibilite.mdx +14 -0
  54. package/src/components/ExternalLinks/Accessibilite.stories.ts +191 -0
  55. package/src/components/ExternalLinks/AccessibiliteItems.ts +197 -0
  56. package/src/components/ExternalLinks/ExternalLinks.mdx +86 -0
  57. package/src/components/ExternalLinks/ExternalLinks.stories.ts +553 -0
  58. package/src/components/ExternalLinks/ExternalLinks.vue +200 -0
  59. package/src/components/ExternalLinks/config.ts +34 -0
  60. package/src/components/ExternalLinks/constants/ExpertiseLevelEnum.ts +4 -0
  61. package/src/components/ExternalLinks/locales.ts +4 -0
  62. package/src/components/ExternalLinks/tests/ExternalLinks.spec.ts +154 -0
  63. package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +159 -0
  64. package/src/components/FileUpload/FileUpload.mdx +165 -0
  65. package/src/components/FileUpload/FileUpload.stories.ts +429 -0
  66. package/src/components/FileUpload/FileUpload.vue +195 -0
  67. package/src/components/FileUpload/FileUploadContent.vue +109 -0
  68. package/src/components/FileUpload/locales.ts +10 -0
  69. package/src/components/FileUpload/tests/FileUpload.spec.ts +332 -0
  70. package/src/components/FileUpload/tests/__snapshots__/FileUpload.spec.ts.snap +7 -0
  71. package/src/components/FileUpload/useFileDrop.ts +23 -0
  72. package/src/components/FileUpload/validateFiles.ts +39 -0
  73. package/src/components/FooterBar/FooterBar.vue +105 -80
  74. package/src/components/FranceConnectBtn/FranceConnectBtn.vue +14 -13
  75. package/src/components/HeaderBar/HeaderBar.vue +3 -3
  76. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +11 -7
  77. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +5 -5
  78. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +2 -2
  79. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +10 -8
  80. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -2
  81. package/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.vue +2 -1
  82. package/src/components/HeaderBar/HeaderLogo/logos/Logo.vue +2 -1
  83. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +10 -10
  84. package/src/components/HeaderBar/consts.scss +1 -1
  85. package/src/components/HeaderLoading/HeaderLoading.vue +12 -11
  86. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
  87. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +9 -9
  88. package/src/components/HeaderToolbar/HeaderToolbar.vue +215 -202
  89. package/src/components/LangBtn/LangBtn.vue +8 -6
  90. package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
  91. package/src/components/NirField/NirField.stories.ts +8 -8
  92. package/src/components/NirField/NirField.vue +46 -48
  93. package/src/components/NotFoundPage/NotFoundPage.stories.ts +33 -2
  94. package/src/components/NotFoundPage/NotFoundPage.vue +17 -0
  95. package/src/components/NotificationBar/NotificationBar.mdx +5 -5
  96. package/src/components/NotificationBar/NotificationBar.stories.ts +410 -314
  97. package/src/components/NotificationBar/NotificationBar.vue +43 -41
  98. package/src/components/PageContainer/PageContainer.vue +4 -4
  99. package/src/components/PasswordField/Accessibilite.mdx +14 -0
  100. package/src/components/PasswordField/Accessibilite.stories.ts +191 -0
  101. package/src/components/PasswordField/AccessibiliteItems.ts +184 -0
  102. package/src/components/PasswordField/PasswordField.mdx +70 -0
  103. package/src/components/PasswordField/PasswordField.stories.ts +213 -0
  104. package/src/components/PasswordField/PasswordField.vue +189 -0
  105. package/src/components/PasswordField/config.ts +11 -0
  106. package/src/components/PasswordField/constants/ExpertiseLevelEnum.ts +4 -0
  107. package/src/components/PasswordField/locales.ts +4 -0
  108. package/src/components/PasswordField/tests/PasswordField.spec.ts +96 -0
  109. package/src/components/PhoneField/PhoneField.mdx +0 -2
  110. package/src/components/PhoneField/PhoneField.stories.ts +10 -50
  111. package/src/components/PhoneField/PhoneField.vue +77 -93
  112. package/src/components/PhoneField/tests/PhoneField.spec.ts +0 -15
  113. package/src/components/RangeField/RangeField.mdx +54 -0
  114. package/src/components/RangeField/RangeField.stories.ts +189 -0
  115. package/src/components/RangeField/RangeField.vue +157 -0
  116. package/src/components/RangeField/RangeSlider/RangeSlider.vue +387 -0
  117. package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +64 -0
  118. package/src/components/RangeField/RangeSlider/tests/__snapshots__/rangeSlider.spec.ts.snap +27 -0
  119. package/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.ts +100 -0
  120. package/src/components/RangeField/RangeSlider/tests/useDoubleSlider.spec.ts +246 -0
  121. package/src/components/RangeField/RangeSlider/tests/useMouseSlide.spec.ts +204 -0
  122. package/src/components/RangeField/RangeSlider/tests/useThumb.spec.ts +22 -0
  123. package/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.ts +233 -0
  124. package/src/components/RangeField/RangeSlider/tests/useTooltipsNudge.spec.ts +150 -0
  125. package/src/components/RangeField/RangeSlider/tests/useTrack.spec.ts +314 -0
  126. package/src/components/RangeField/RangeSlider/tests/vAnimateClick.spec.ts +32 -0
  127. package/src/components/RangeField/RangeSlider/types.ts +15 -0
  128. package/src/components/RangeField/RangeSlider/useMouseSlide.ts +109 -0
  129. package/src/components/RangeField/RangeSlider/useRangeSlider.ts +126 -0
  130. package/src/components/RangeField/RangeSlider/useThumb.ts +18 -0
  131. package/src/components/RangeField/RangeSlider/useThumbKeyboard.ts +84 -0
  132. package/src/components/RangeField/RangeSlider/useTooltipsNudge.ts +92 -0
  133. package/src/components/RangeField/RangeSlider/useTrack.ts +116 -0
  134. package/src/components/RangeField/RangeSlider/vAnimateClick.ts +19 -0
  135. package/src/components/RangeField/config.ts +7 -0
  136. package/src/components/RangeField/locales.ts +4 -0
  137. package/src/components/RangeField/tests/RangeField.spec.ts +224 -0
  138. package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +379 -0
  139. package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +205 -0
  140. package/src/components/RatingPicker/EmotionPicker/locales.ts +3 -0
  141. package/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.ts +104 -0
  142. package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +66 -0
  143. package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +159 -0
  144. package/src/components/RatingPicker/NumberPicker/locales.ts +4 -0
  145. package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +73 -0
  146. package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +105 -0
  147. package/src/components/RatingPicker/Rating.ts +45 -0
  148. package/src/components/RatingPicker/RatingPicker.mdx +56 -0
  149. package/src/components/RatingPicker/RatingPicker.stories.ts +515 -0
  150. package/src/components/RatingPicker/RatingPicker.vue +122 -0
  151. package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +116 -0
  152. package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +95 -0
  153. package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +36 -0
  154. package/src/components/RatingPicker/locales.ts +3 -0
  155. package/src/components/RatingPicker/tests/Rating.spec.ts +104 -0
  156. package/src/components/RatingPicker/tests/RatingPicker.spec.ts +187 -0
  157. package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +108 -0
  158. package/src/components/SearchListField/SearchListField.mdx +74 -0
  159. package/src/components/SearchListField/SearchListField.stories.ts +126 -0
  160. package/src/components/SearchListField/SearchListField.vue +194 -0
  161. package/src/components/SearchListField/locales.ts +5 -0
  162. package/src/components/SearchListField/tests/SearchListField.spec.ts +323 -0
  163. package/src/components/SearchListField/types.d.ts +4 -0
  164. package/src/components/SelectBtnField/SelectBtnField.mdx +50 -0
  165. package/src/components/SelectBtnField/SelectBtnField.stories.ts +763 -0
  166. package/src/components/SelectBtnField/SelectBtnField.vue +283 -0
  167. package/src/components/SelectBtnField/config.ts +11 -0
  168. package/src/components/SelectBtnField/tests/SelectBtnField.spec.ts +327 -0
  169. package/src/components/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +125 -0
  170. package/src/components/SelectBtnField/types.d.ts +11 -0
  171. package/src/components/SkipLink/SkipLink.vue +10 -10
  172. package/src/components/SocialMediaLinks/SocialMediaLinks.vue +28 -26
  173. package/src/components/SubHeader/SubHeader.vue +32 -31
  174. package/src/components/SyAlert/SyAlert.vue +12 -12
  175. package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -1
  176. package/src/components/UserMenuBtn/config.ts +1 -1
  177. package/src/components/index.ts +17 -7
  178. package/src/composables/rules/useFieldValidation.ts +172 -44
  179. package/src/designTokens/index.ts +6 -4
  180. package/src/designTokens/{bootstrapColors.md → paColors.md} +1 -1
  181. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -0
  182. package/src/designTokens/tokens/pa/paColors.ts +171 -0
  183. package/src/designTokens/tokens/pa/paContextual.ts +58 -0
  184. package/src/designTokens/tokens/pa/paDarkTheme.ts +5 -0
  185. package/src/designTokens/tokens/pa/paLightTheme.ts +123 -0
  186. package/src/designTokens/tokens/pa/paSemantic.ts +87 -0
  187. package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +52 -2
  188. package/src/stories/GuideDuDev/CreerUneIssue.mdx +64 -0
  189. package/src/stories/GuideDuDev/{CommentUtiliserLesRules.mdx → UtiliserLesRules.mdx} +2 -2
  190. package/src/stories/GuideDuDev/components.stories.ts +9 -7
  191. package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +163 -88
  192. package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +250 -23
  193. package/src/temp/TestDTComponent.vue +5 -6
  194. package/src/utils/calcHumanFileSize/index.ts +12 -0
  195. package/src/utils/calcHumanFileSize/tests/calcHumanFileSize.spec.ts +21 -0
  196. package/src/designTokens/tokens/bootstrap/bootstrapColors.ts +0 -158
  197. package/src/designTokens/tokens/bootstrap/bootstrapLightTheme.ts +0 -22
  198. package/src/stories/GuideDuDev/CommentContribuer.mdx +0 -22
@@ -233,7 +233,7 @@
233
233
 
234
234
  function validateOnSubmit() {
235
235
  isValidating.value = true
236
- validateFields()
236
+ validateFields(true)
237
237
  return errors.value.length === 0
238
238
  }
239
239
 
@@ -339,115 +339,113 @@
339
339
  </template>
340
340
 
341
341
  <style lang="scss" scoped>
342
- @use '@/assets/tokens.scss';
342
+ @use '@/assets/tokens';
343
343
 
344
344
  .v-messages__message--success {
345
- color: tokens.$colors-border-success !important;
345
+ color: tokens.$colors-border-success !important;
346
346
 
347
- .v-field--active & {
348
- color: tokens.$colors-border-success !important;
349
- }
347
+ .v-field--active & {
348
+ color: tokens.$colors-border-success !important;
349
+ }
350
350
  }
351
351
 
352
352
  .v-messages__message--error {
353
- color: tokens.$colors-border-error;
353
+ color: tokens.$colors-border-error;
354
354
 
355
- .v-field--active & {
356
- color: tokens.$colors-border-error;
357
- }
355
+ .v-field--active & {
356
+ color: tokens.$colors-border-error;
357
+ }
358
358
  }
359
359
 
360
360
  :deep(.v-field.v-field--active .v-label.v-field-label--floating) {
361
- opacity: 1;
361
+ opacity: 1;
362
362
  }
363
363
 
364
364
  .multi-line {
365
- white-space: pre-line !important;
365
+ white-space: pre-line !important;
366
366
  }
367
367
 
368
368
  .vd-number-field {
369
- max-width: 296px;
369
+ max-width: 296px;
370
370
  }
371
371
 
372
372
  .vd-key-field {
373
- width: 104px;
373
+ width: 104px;
374
+ flex: none;
375
+ margin-left: 2%;
374
376
  }
375
377
 
376
378
  .custom-counter {
377
- color: rgba(0, 0, 0, 0.54);
379
+ color: rgb(0 0 0 / 54%);
378
380
  }
379
381
 
380
382
  .vd-nir-field :deep(.v-input__append-inner),
381
383
  .vd-tooltip-icon {
382
- flex: none;
383
- color: rgba(0, 0, 0, 0.54);
384
+ flex: none;
385
+ color: rgb(0 0 0 / 54%);
384
386
  }
385
387
 
386
388
  :deep(.v-overlay__content) {
387
- background: rgba(84, 88, 89, 0.95) !important;
388
- }
389
-
390
- .vd-key-field {
391
- flex: none;
389
+ background: rgb(84 88 89 / 95%) !important;
392
390
  }
393
391
 
394
392
  .vd-nir-field--outlined :deep(.v-messages.error--text) {
395
- padding: 6px;
393
+ padding: 6px;
396
394
  }
397
395
 
398
396
  .vd-nir-field {
399
- container-name: nirFieldwrapper;
397
+ container-name: nirfieldwrapper;
400
398
  }
401
399
 
402
400
  :deep(.v-input__append) {
403
- margin-inline-start: 0 !important;
401
+ margin-inline-start: 0 !important;
404
402
  }
403
+
405
404
  :deep(.vd-number-field > .v-input__prepend) {
406
- margin-right: 0 !important;
405
+ margin-right: 0 !important;
407
406
  }
408
407
 
409
408
  :deep(.vd-key-field > .v-input__prepend) {
410
- @media screen and (max-width: 360px) {
411
- margin-inline-end: 0 !important;
412
- }
409
+ @media screen and (width <= 360px) {
410
+ margin-inline-end: 0 !important;
411
+ }
413
412
  }
414
413
 
415
414
  :deep(.v-text-field .v-input__details) {
416
- padding-inline-start: 0 !important;
417
- padding-inline-end: 0 !important;
418
- flex: none !important;
415
+ padding-inline: 0 !important;
416
+ flex: none !important;
419
417
  }
420
418
 
421
419
  :deep(.v-text-field .v-input__details .v-messages) {
422
- color: rgba(0, 0, 0, 1) !important;
420
+ color: rgb(0 0 0 / 100%) !important;
423
421
  }
424
422
 
425
423
  @mixin responsive-nir-wrapper {
426
- .vd-nir-field__fields-wrapper :deep(> .v-input__control) {
427
- justify-content: start;
428
- flex-wrap: wrap;
429
- gap: 4px;
430
- margin-bottom: 4px;
431
-
432
- .vd-number-field {
433
- flex: 100% 0 0;
434
- }
435
- }
424
+ .vd-nir-field__fields-wrapper :deep(> .v-input__control) {
425
+ justify-content: start;
426
+ flex-wrap: wrap;
427
+ gap: 4px;
428
+ margin-bottom: 4px;
429
+
430
+ .vd-number-field {
431
+ flex: 100% 0 0;
432
+ }
433
+ }
436
434
  }
437
435
 
438
436
  @container nirFieldwrapper (max-width: 300px) {
439
- @include responsive-nir-wrapper;
437
+ @include responsive-nir-wrapper;
440
438
  }
441
439
 
442
- @media screen and (max-width: 360px) {
443
- @include responsive-nir-wrapper;
440
+ @media screen and (width <= 360px) {
441
+ @include responsive-nir-wrapper;
444
442
  }
445
443
 
446
444
  .v-text-field .v-input__append-inner {
447
- padding-left: 0 !important;
445
+ padding-left: 0 !important;
448
446
  }
449
447
 
450
448
  :deep(.v-text-field > .v-input__control > .v-input__slot > .v-text-field__slot) {
451
- width: min-content !important;
449
+ width: min-content !important;
452
450
  }
453
451
  </style>
@@ -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