@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
@@ -4,7 +4,7 @@ import BackToTopBtn from './BackToTopBtn.vue'
4
4
  import { VCard, VSheet } from 'vuetify/components'
5
5
 
6
6
  const meta = {
7
- title: 'Components/BackToTopBtn',
7
+ title: 'Composants/Boutons/BackToTopBtn',
8
8
  component: BackToTopBtn,
9
9
  parameters: {
10
10
  layout: 'fullscreen',
@@ -45,6 +45,43 @@ export default meta
45
45
  type Story = StoryObj<typeof meta>
46
46
 
47
47
  export const Default: Story = {
48
+ parameters: {
49
+ sourceCode: [
50
+ {
51
+ name: 'Template',
52
+ code: `<template>
53
+ <VCard
54
+ id="target"
55
+ width="100%"
56
+ max-height="200px"
57
+ class="overflow-y-auto"
58
+ style="scroll-behavior: smooth"
59
+ >
60
+ <VSheet
61
+ height="600px"
62
+ class="d-flex flex-column align-center"
63
+ >
64
+ <p class="pa-2">
65
+ Haut de la section.
66
+ </p>
67
+ </VSheet>
68
+ <BackToTopBtn :target="target">
69
+ Retour en haut
70
+ </BackToTopBtn>
71
+ </VCard>
72
+ </template>
73
+ `,
74
+ },
75
+ {
76
+ name: 'Script',
77
+ code: `<script setup lang="ts">
78
+ import BackToTopBtn from '@cnamts/BackToTopBtn'
79
+ import { VCard, VSheet } from 'vuetify/components'
80
+ </script>
81
+ `,
82
+ },
83
+ ],
84
+ },
48
85
  args: {
49
86
  target: 'target',
50
87
  vuetifyOptions: {
@@ -101,6 +138,57 @@ export const Default: Story = {
101
138
  }
102
139
 
103
140
  export const Customization: Story = {
141
+ parameters: {
142
+ sourceCode: [
143
+ {
144
+ name: 'Template',
145
+ code: `<template>
146
+ <VCard
147
+ id="btn-customization"
148
+ width="100%"
149
+ max-height="200px"
150
+ class="overflow-y-auto"
151
+ style="scroll-behavior: smooth"
152
+ >
153
+ <VSheet
154
+ height="600px"
155
+ class="d-flex flex-column align-center"
156
+ >
157
+ <p class="pa-2">
158
+ Haut de la section.
159
+ </p>
160
+ </VSheet>
161
+ <BackToTopBtn
162
+ :target="btn-customization"
163
+ :vuetify-options="vuetifyOptions"
164
+ >
165
+ Retour en haut
166
+ </BackToTopBtn>
167
+ </VCard>
168
+ </template>
169
+ `,
170
+ },
171
+ {
172
+ name: 'Script',
173
+ code: `<script setup lang="ts">
174
+ import BackToTopBtn from '@cnamts/BackToTopBtn'
175
+ import { VCard, VSheet } from 'vuetify/components'
176
+
177
+ const vuetifyOptions = {
178
+ btn: {
179
+ variant: 'elevated',
180
+ color: 'primary',
181
+ rounded: true,
182
+ },
183
+ icon: {
184
+ color: 'white',
185
+ },
186
+ }
187
+ </script>
188
+ `,
189
+ },
190
+ ],
191
+ },
104
192
  args: {
105
193
  target: 'btn-customization',
106
194
  vuetifyOptions: {
@@ -152,13 +240,66 @@ export const Customization: Story = {
152
240
  },
153
241
  }
154
242
 
155
- export const PillBtn: Story = {
243
+ export const CustomPosition: Story = {
244
+ parameters: {
245
+ sourceCode: [
246
+ {
247
+ name: 'Template',
248
+ code: `<template>
249
+ <VCard
250
+ id="pill-btn"
251
+ width="100%"
252
+ max-height="200px"
253
+ class="overflow-y-auto"
254
+ style="scroll-behavior: smooth"
255
+ >
256
+ <VSheet
257
+ height="600px"
258
+ class="d-flex flex-column align-center"
259
+ >
260
+ <p class="pa-2">
261
+ Haut de la section.
262
+ </p>
263
+ </VSheet>
264
+ <BackToTopBtn
265
+ :target="pill-btn"
266
+ :nudge-right="30"
267
+ :nudge-bottom="30"
268
+ :vuetify-options="vuetifyOptions"
269
+ >
270
+ Retour en haut
271
+ </BackToTopBtn>
272
+ </VCard>
273
+ </template>
274
+ `,
275
+ },
276
+ {
277
+ name: 'Script',
278
+ code: `<script setup lang="ts">
279
+ import BackToTopBtn from '@cnamts/BackToTopBtn'
280
+ import { VCard, VSheet } from 'vuetify/components'
281
+
282
+ const vuetifyOptions = {
283
+ btn: {
284
+ variant: 'outlined',
285
+ color: 'primary',
286
+ minWidth: 92,
287
+ rounded: true,
288
+ }
289
+ }
290
+ </script>
291
+ `,
292
+ },
293
+ ],
294
+ },
156
295
  args: {
157
296
  target: 'pill-btn',
297
+ nudgeRight: 30,
298
+ nudgeBottom: 30,
158
299
  vuetifyOptions: {
159
300
  btn: {
160
301
  variant: 'outlined',
161
- color: 'medium-emphasis',
302
+ color: 'primary',
162
303
  minWidth: 92,
163
304
  rounded: true,
164
305
  },
@@ -173,16 +314,36 @@ export const PillBtn: Story = {
173
314
  return { args }
174
315
  },
175
316
  template: `
176
- <v-btn
177
- color="primary"
178
- variant="outlined"
179
- size="small"
180
- rounded
181
- @click="() => { window.location.href = '' }"
317
+ <VCard
318
+ id="pill-btn"
319
+ width="100%"
320
+ max-height="200px"
321
+ class="overflow-y-auto"
322
+ style="scroll-behavior: smooth"
182
323
  >
183
- VuetifyOptions
184
- </v-btn>
324
+ <VSheet
325
+ height="600px"
326
+ class="d-flex flex-column align-center"
327
+ >
328
+ <p class="pa-2">
329
+ Haut de la section.
330
+ </p>
331
+ </VSheet>
332
+ <BackToTopBtn
333
+ v-bind="args"
334
+ :nudge-right="args.nudgeRight"
335
+ :nudge-bottom="args.nudgeBottom"
336
+ :vuetify-options="args.vuetifyOptions"
337
+ >
338
+ {{args.default}}
339
+ </BackToTopBtn>
340
+ </VCard>
185
341
  `,
186
342
  }
187
343
  },
344
+ play: async ({ canvasElement }) => {
345
+ await new Promise((resolve: (v: unknown) => void) => setTimeout(resolve, 1000))
346
+ const container = canvasElement.querySelector('#pill-btn')
347
+ container?.scrollTo(0, 1000)
348
+ },
188
349
  }
@@ -15,8 +15,8 @@ L’élément `CollapsibleList` est utilisé pour afficher des listes de liens.
15
15
 
16
16
  <Source dark code={`
17
17
  <script setup lang="ts">
18
- import CollapsibleList from '@/components/CollapsibleList/CollapsibleList.vue'
19
- import type { ListItem } from '@/components/CollapsibleList/types'
18
+ import CollapsibleList from '@cnamts/synapse'
19
+ import type { ListItem } from '@cnamts/synapse/src/components/CollapsibleList/types'
20
20
 
21
21
  const remboursementItems = [
22
22
  {
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
3
3
  import CollapsibleList from './CollapsibleList.vue'
4
4
 
5
5
  const meta = {
6
- title: 'Components/CollapsibleList',
6
+ title: 'Composants/Données/CollapsibleList',
7
7
  component: CollapsibleList,
8
8
  parameters: {
9
9
  layout: 'fullscreen',
@@ -23,6 +23,42 @@ export default meta
23
23
  type Story = StoryObj<typeof meta>
24
24
 
25
25
  export const Default: Story = {
26
+ parameters: {
27
+ sourceCode: [
28
+ {
29
+ name: 'Template',
30
+ code: `<template>
31
+ <div class="pa-4">
32
+ <CollapsibleList
33
+ :list-title="listTitle"
34
+ :items="items"
35
+ />
36
+ </div>
37
+ </template>
38
+ `,
39
+ },
40
+ {
41
+ name: 'Script',
42
+ code: `<script setup lang="ts">
43
+ import CollapsibleList from '@cnamts/synapse'
44
+
45
+ const listTitle = 'Santé'
46
+
47
+ const items = [
48
+ {
49
+ text: 'Mon espace santé',
50
+ href: 'https://www.ameli.fr/assure/sante/mon-espace-sante',
51
+ },
52
+ {
53
+ text: 'Accomplir les bons gestes',
54
+ href: 'https://www.ameli.fr/assure/sante/bons-gestes',
55
+ },
56
+ ]
57
+ </script>
58
+ `,
59
+ },
60
+ ],
61
+ },
26
62
  args: {
27
63
  listTitle: 'Santé',
28
64
  items: [
@@ -18,7 +18,7 @@ Le composant `CopyBtn` est utilisé pour afficher un bouton permettant à l’ut
18
18
 
19
19
  <Source dark code={`
20
20
  <script setup lang="ts">
21
- import CopyBtn from '@/components/CopyBtn/CopyBtn.vue'
21
+ import CopyBtn from '@cnamts/synapse'
22
22
  </script>
23
23
 
24
24
  <template>
@@ -6,7 +6,7 @@ import { mdiContentDuplicate } from '@mdi/js'
6
6
  const duplicateIcon = mdiContentDuplicate
7
7
 
8
8
  const meta = {
9
- title: 'Components/CopyBtn',
9
+ title: 'Composants/Boutons/CopyBtn',
10
10
  component: CopyBtn,
11
11
  parameters: {
12
12
  layout: 'fullscreen',
@@ -60,6 +60,33 @@ export default meta
60
60
  type Story = StoryObj<typeof meta>
61
61
 
62
62
  export const Default: Story = {
63
+ parameters: {
64
+ sourceCode: [
65
+ {
66
+ name: 'Template',
67
+ code: `<template>
68
+ <div class="d-flex flex-wrap align-center pa-4">
69
+ <p class="mb-0 mr-1">
70
+ Patient n°<b>1970756541</b>
71
+ </p>
72
+
73
+ <CopyBtn
74
+ label="Copier le numéro de patient"
75
+ text-to-copy="1970756541"
76
+ />
77
+ </div>
78
+ </template>
79
+ `,
80
+ },
81
+ {
82
+ name: 'Script',
83
+ code: `<script setup lang="ts">
84
+ import CopyBtn from '@cnamts/synapse'
85
+ </script>
86
+ `,
87
+ },
88
+ ],
89
+ },
63
90
  args: {
64
91
  ariaLabel: 'Copier le numéro de patient',
65
92
  ariaOwns: 'copy-btn-1',
@@ -108,6 +135,34 @@ export const Default: Story = {
108
135
  }
109
136
 
110
137
  export const NoTooltip: Story = {
138
+ parameters: {
139
+ sourceCode: [
140
+ {
141
+ name: 'Template',
142
+ code: `<template>
143
+ <div class="d-flex flex-wrap align-center pa-4">
144
+ <p class="mb-0 mr-1">
145
+ Patient n°<b>1970756541</b>
146
+ </p>
147
+
148
+ <CopyBtn
149
+ label="Copier le numéro de patient"
150
+ text-to-copy="1970756541"
151
+ hide-tooltip
152
+ />
153
+ </div>
154
+ </template>
155
+ `,
156
+ },
157
+ {
158
+ name: 'Script',
159
+ code: `<script setup lang="ts">
160
+ import CopyBtn from '@cnamts/synapse'
161
+ </script>
162
+ `,
163
+ },
164
+ ],
165
+ },
111
166
  args: {
112
167
  ariaLabel: 'Copier le numéro de patient',
113
168
  textToCopy: '1970756541',
@@ -139,6 +194,37 @@ export const NoTooltip: Story = {
139
194
  }
140
195
 
141
196
  export const SlotIcon: Story = {
197
+ parameters: {
198
+ sourceCode: [
199
+ {
200
+ name: 'Template',
201
+ code: `<template>
202
+ <div class="d-flex flex-wrap align-center pa-4">
203
+ <p class="mb-0 mr-1">
204
+ Patient n°<b>1970756541</b>
205
+ </p>
206
+
207
+ <CopyBtn
208
+ label="Copier le numéro de patient"
209
+ text-to-copy="1970756541"
210
+ :icon="duplicateIcon"
211
+ />
212
+ </div>
213
+ </template>
214
+ `,
215
+ },
216
+ {
217
+ name: 'Script',
218
+ code: `<script setup lang="ts">
219
+ import CopyBtn from '@cnamts/synapse'
220
+ import { mdiContentDuplicate } from '@mdi/js'
221
+
222
+ const duplicateIcon = mdiContentDuplicate
223
+ </script>
224
+ `,
225
+ },
226
+ ],
227
+ },
142
228
  args: {
143
229
  ariaLabel: 'Copier le numéro de patient',
144
230
  textToCopy: '1970756541',
@@ -174,6 +260,39 @@ export const SlotIcon: Story = {
174
260
  }
175
261
 
176
262
  export const SlotTooltip: Story = {
263
+ parameters: {
264
+ sourceCode: [
265
+ {
266
+ name: 'Template',
267
+ code: `<template>
268
+ <div class="d-flex flex-wrap align-center pa-4">
269
+ <p class="mb-0 mr-1">
270
+ Patient n°<b>1970756541</b>
271
+ </p>
272
+
273
+ <CopyBtn
274
+ label="Copier le numéro de patient"
275
+ text-to-copy="1970756541"
276
+ >
277
+ <template #tooltip>
278
+ {{ tooltip }}
279
+ </template>
280
+ </CopyBtn>
281
+ </div>
282
+ </template>
283
+ `,
284
+ },
285
+ {
286
+ name: 'Script',
287
+ code: `<script setup lang="ts">
288
+ import CopyBtn from '@cnamts/synapse'
289
+
290
+ const tooltip = 'Texte personalisé'
291
+ </script>
292
+ `,
293
+ },
294
+ ],
295
+ },
177
296
  args: {
178
297
  ariaLabel: 'Copier le numéro de patient',
179
298
  textToCopy: '1970756541',
@@ -93,7 +93,7 @@
93
93
  padding: 6px 16px;
94
94
  box-shadow: none;
95
95
  margin-top: 2px;
96
- background: rgba(97, 97, 97, 0.9);
96
+ background: rgba(84, 88, 89, 0.95);
97
97
  color: white;
98
98
  }
99
99
 
@@ -3,7 +3,7 @@ import * as CustomInputSelectStories from "./CustomInputSelect.stories.ts";
3
3
 
4
4
  <Meta of={CustomInputSelectStories} />
5
5
 
6
- # CustomSelect
6
+ # CustomInputSelect
7
7
 
8
8
  Le composant `CustomInputSelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles RGAA.
9
9
 
@@ -19,12 +19,12 @@ Le composant `CustomInputSelect` est utilisé pour proposer une alternative au `
19
19
 
20
20
  <Source dark code={`
21
21
  <script setup lang="ts">
22
- import CustomInputSelect from '@/components/Customs/CustomInputSelect/CustomInputSelect.vue'
23
- import { ref } from 'vue'
22
+ import CustomInputSelect from '@cnamts/synapse'
24
23
 
25
- const value = ref('fr')
26
- const items = ['fr', 'en', 'co']
27
- const ariaLabel = 'Choix de la langue'
24
+ const items = [
25
+ { text: 'Option 1', value: '1' },
26
+ { text: 'Option 2', value: '2' },
27
+ ],
28
28
  </script>
29
29
 
30
30
  <template>
@@ -33,8 +33,6 @@ Le composant `CustomInputSelect` est utilisé pour proposer une alternative au `
33
33
  <CustomInputSelect
34
34
  v-model="value"
35
35
  :items="items"
36
- :label="ariaLabel"
37
- aria-label="Choix de la langue"
38
36
  />
39
37
  </div>
40
38
  </main>