@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
@@ -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
+ }