@cnamts/synapse 0.0.4-alpha → 0.0.5-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 (150) hide show
  1. package/dist/design-system-v3.d.ts +932 -224
  2. package/dist/design-system-v3.js +3374 -1502
  3. package/dist/design-system-v3.umd.cjs +6 -6
  4. package/dist/style.css +1 -1
  5. package/package.json +2 -1
  6. package/src/assets/tokens.scss +0 -1
  7. package/src/components/Alert/Accessibilite.mdx +14 -0
  8. package/src/components/Alert/Accessibilite.stories.ts +166 -0
  9. package/src/components/Alert/AccessibiliteItems.ts +152 -0
  10. package/src/components/Alert/constants/ExpertiseLevelEnum.ts +4 -0
  11. package/src/components/BackBtn/Accessibilite.mdx +14 -0
  12. package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
  13. package/src/components/BackBtn/AccessibiliteItems.ts +132 -0
  14. package/src/components/BackBtn/constants/ExpertiseLevelEnum.ts +4 -0
  15. package/src/components/BackToTopBtn/Accessibilite.mdx +14 -0
  16. package/src/components/BackToTopBtn/Accessibilite.stories.ts +166 -0
  17. package/src/components/BackToTopBtn/AccessibiliteItems.ts +82 -0
  18. package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
  19. package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
  20. package/src/components/CollapsibleList/Accessibilite.stories.ts +166 -0
  21. package/src/components/CollapsibleList/AccessibiliteItems.ts +129 -0
  22. package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
  23. package/src/components/CopyBtn/Accessibilite.mdx +14 -0
  24. package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
  25. package/src/components/CopyBtn/AccessibiliteItems.ts +135 -0
  26. package/src/components/CopyBtn/config.ts +2 -0
  27. package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
  28. package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +44 -0
  29. package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +606 -0
  30. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +246 -0
  31. package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
  32. package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +40 -0
  33. package/src/components/Customs/{CustomInputSelect/CustomInputSelect.stories.ts → SyInputSelect/SyInputSelect.stories.ts} +29 -29
  34. package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +10 -2
  35. package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
  36. package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +8 -8
  37. package/src/components/Customs/{CustomSelect/CustomSelect.stories.ts → SySelect/SySelect.stories.ts} +25 -25
  38. package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +9 -5
  39. package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
  40. package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
  41. package/src/components/Customs/{CustomTextField/CustomTextField.stories.ts → SyTextField/SyTextField.stories.ts} +34 -34
  42. package/src/components/Customs/{CustomTextField/tests/CustomTextField.spec.ts → SyTextField/tests/SyTextField.spec.ts} +3 -3
  43. package/src/components/Customs/{CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap → SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap} +3 -5
  44. package/src/components/DialogBox/DialogBox.mdx +14 -0
  45. package/src/components/DialogBox/DialogBox.stories.ts +798 -0
  46. package/src/components/DialogBox/DialogBox.vue +181 -0
  47. package/src/components/DialogBox/config.ts +25 -0
  48. package/src/components/DialogBox/locales.ts +5 -0
  49. package/src/components/DialogBox/tests/DialogBox.spec.ts +329 -0
  50. package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +46 -0
  51. package/src/components/ErrorPage/ErrorPage.mdx +21 -0
  52. package/src/components/ErrorPage/ErrorPage.stories.ts +133 -0
  53. package/src/components/ErrorPage/ErrorPage.vue +93 -0
  54. package/src/components/ErrorPage/locales.ts +5 -0
  55. package/src/components/ErrorPage/tests/ErrorPage.spec.ts +40 -0
  56. package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +78 -0
  57. package/src/components/FooterBar/FooterBar.stories.ts +556 -8
  58. package/src/components/FooterBar/config.ts +2 -3
  59. package/src/components/FooterBar/tests/FooterBar.spec.ts +1 -1
  60. package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
  61. package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +2 -2
  62. package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
  63. package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
  64. package/src/components/FranceConnectBtn/AccessibiliteItems.ts +199 -0
  65. package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
  66. package/src/components/HeaderBar/HeaderBar.stories.ts +60 -2
  67. package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +6 -6
  68. package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +1 -1
  69. package/src/components/HeaderToolbar/HeaderToolbar.vue +2 -2
  70. package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +36 -2
  71. package/src/components/LangBtn/Accessibilite.mdx +14 -0
  72. package/src/components/LangBtn/Accessibilite.stories.ts +166 -0
  73. package/src/components/LangBtn/AccessibiliteItems.ts +132 -0
  74. package/src/components/LangBtn/constants/ExpertiseLevelEnum.ts +4 -0
  75. package/src/components/LangBtn/tests/LangBtn.spec.ts +1 -1
  76. package/src/components/LangBtn/tests/__snapshots__/LangBtn.spec.ts.snap +1 -1
  77. package/src/components/MaintenancePage/MaintenancePage.mdx +11 -0
  78. package/src/components/MaintenancePage/MaintenancePage.stories.ts +41 -0
  79. package/src/components/MaintenancePage/MaintenancePage.vue +25 -0
  80. package/src/components/MaintenancePage/assets/maintenance.svg +1 -0
  81. package/src/components/MaintenancePage/index.ts +3 -0
  82. package/src/components/MaintenancePage/locales.ts +5 -0
  83. package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +12 -0
  84. package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -0
  85. package/src/components/NotFoundPage/NotFoundPage.mdx +19 -0
  86. package/src/components/NotFoundPage/NotFoundPage.stories.ts +76 -0
  87. package/src/components/NotFoundPage/NotFoundPage.vue +52 -0
  88. package/src/components/NotFoundPage/assets/not-found.svg +1 -0
  89. package/src/components/NotFoundPage/locales.ts +6 -0
  90. package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +38 -0
  91. package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +76 -0
  92. package/src/components/NotificationBar/Accessibilite.mdx +14 -0
  93. package/src/components/NotificationBar/Accessibilite.stories.ts +166 -0
  94. package/src/components/NotificationBar/AccessibiliteItems.ts +174 -0
  95. package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
  96. package/src/components/NotificationBar/options.ts +1 -0
  97. package/src/components/PageContainer/Accessibilite.mdx +14 -0
  98. package/src/components/PageContainer/Accessibilite.stories.ts +166 -0
  99. package/src/components/PageContainer/AccessibiliteItems.ts +52 -0
  100. package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
  101. package/src/components/PhoneField/PhoneField.vue +5 -5
  102. package/src/components/PhoneField/tests/PhoneField.spec.ts +3 -3
  103. package/src/components/SkipLink/Accessibilite.mdx +14 -0
  104. package/src/components/SkipLink/Accessibilite.stories.ts +167 -0
  105. package/src/components/SkipLink/AccessibiliteItems.ts +77 -0
  106. package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
  107. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +17 -13
  108. package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +2 -1
  109. package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +1 -1
  110. package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
  111. package/src/components/SubHeader/SubHeader.vue +1 -1
  112. package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
  113. package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +438 -0
  114. package/src/components/UserMenuBtn/UserMenuBtn.vue +105 -0
  115. package/src/components/UserMenuBtn/config.ts +24 -0
  116. package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
  117. package/src/components/index.ts +12 -3
  118. package/src/composables/index.ts +8 -0
  119. package/src/composables/rules/tests/useFieldValidation.spec.ts +82 -0
  120. package/src/composables/rules/useFieldValidation.ts +53 -0
  121. package/src/designTokens/index.ts +2 -0
  122. package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
  123. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +1 -0
  124. package/src/main.ts +2 -0
  125. package/src/stories/Fondamentaux/Arrondis.mdx +24 -0
  126. package/src/stories/{Guidelines → Fondamentaux}/Colors.mdx +1 -1
  127. package/src/stories/Fondamentaux/Conteneurs.mdx +7 -0
  128. package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +7 -0
  129. package/src/stories/Fondamentaux/Elevations.mdx +14 -0
  130. package/src/stories/Fondamentaux/Espacements.mdx +29 -0
  131. package/src/stories/{Guidelines → Fondamentaux}/Introduction.mdx +1 -1
  132. package/src/stories/Fondamentaux/StylesTypographiques.mdx +33 -0
  133. package/src/stories/Fondamentaux/Typographie.mdx +58 -0
  134. package/src/stories/GuideDuDev/CommentUtiliserLesRules.mdx +132 -0
  135. package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
  136. package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
  137. package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -40
  138. package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
  139. package/src/components/Customs/CustomTextField/CustomTextField.mdx +0 -44
  140. package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
  141. package/src/stories/Guidelines/Typo.mdx +0 -53
  142. /package/src/components/Customs/{CustomInputSelect → SyInputSelect}/config.ts +0 -0
  143. /package/src/components/Customs/{CustomTextField/CustomTextField.vue → SyTextField/SyTextField.vue} +0 -0
  144. /package/src/components/Customs/{CustomTextField → SyTextField}/types.d.ts +0 -0
  145. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +0 -0
  146. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/AccessibiliteItems.ts +0 -0
  147. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/ExpertiseLevelEnum.ts +0 -0
  148. /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/RGAALevelEnum.ts +0 -0
  149. /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/EcoConception.mdx +0 -0
  150. /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/ecoDesignItems.ts +0 -0
@@ -0,0 +1,606 @@
1
+ import { mdiAccount } from '@mdi/js'
2
+ import type { Meta, StoryObj } from '@storybook/vue3'
3
+ import SyBtnSelect from './SyBtnSelect.vue'
4
+ import { VIcon, VListItem, VListItemTitle } from 'vuetify/components'
5
+
6
+ const meta: Meta<typeof SyBtnSelect> = {
7
+ title: 'Composants/Formulaires/SyBtnSelect',
8
+ component: SyBtnSelect,
9
+ parameters: {
10
+ layout: 'fullscreen',
11
+ controls: { exclude: ['modelValue', 'label', 'required', 'isOpen', 'formattedItems', 'selectedItem'] },
12
+ },
13
+ argTypes: {
14
+ modelValue: { control: 'text' },
15
+ menuItems: { control: 'object' },
16
+ label: { control: 'text' },
17
+ menuId: { control: 'text' },
18
+ textKey: { control: 'text' },
19
+ valueKey: { control: 'text' },
20
+ primaryInfo: { control: 'text' },
21
+ secondaryInfo: { control: 'text' },
22
+ hideIcon: { control: 'boolean' },
23
+ hideLogoutBtn: { control: 'boolean' },
24
+ isMobileView: { control: 'boolean' },
25
+ options: { control: 'object' },
26
+ },
27
+ }
28
+
29
+ export default meta
30
+
31
+ type Story = StoryObj<typeof meta>
32
+
33
+ export const Default: Story = {
34
+ parameters: {
35
+ sourceCode: [
36
+ {
37
+ name: 'Template',
38
+ code: `
39
+ <template>
40
+ <SyBtnSelect
41
+ :primary-info="primaryInfo"
42
+ :menu-items="items"
43
+ />
44
+ </template>
45
+ `,
46
+ },
47
+ {
48
+ name: 'Script',
49
+ code: `
50
+ <script setup lang="ts">
51
+ import SyBtnSelect from './SyBtnSelect.vue'
52
+
53
+ const primaryInfo = 'Mes options'
54
+ const items = ['Option 1', 'Option 2']
55
+ </script>
56
+ `,
57
+ },
58
+ ],
59
+ },
60
+ args: {
61
+ primaryInfo: 'Mes options',
62
+ menuItems: ['Option 1', 'Option 2'],
63
+ },
64
+ render: (args) => {
65
+ return {
66
+ components: { SyBtnSelect },
67
+ setup() {
68
+ return { args }
69
+ },
70
+ template: `
71
+ <div class="d-flex flex-wrap align-center pa-4">
72
+ <SyBtnSelect v-bind="args" />
73
+ </div>
74
+ `,
75
+ }
76
+ },
77
+ }
78
+
79
+ export const MobileView: Story = {
80
+ parameters: {
81
+ sourceCode: [
82
+ {
83
+ name: 'Template',
84
+ code: `
85
+ <template>
86
+ <SyBtnSelect
87
+ :primary-info="primaryInfo"
88
+ :menu-items="items"
89
+ is-mobile-view
90
+ />
91
+ </template>
92
+ `,
93
+ },
94
+ {
95
+ name: 'Script',
96
+ code: `
97
+ <script setup lang="ts">
98
+ import SyBtnSelect from './SyBtnSelect.vue'
99
+
100
+ const primaryInfo = 'Mes options'
101
+ const items = ['Option 1', 'Option 2']
102
+ </script>
103
+ `,
104
+ },
105
+ ],
106
+ },
107
+ args: {
108
+ primaryInfo: 'Mes options',
109
+ menuItems: ['Option 1', 'Option 2'],
110
+ isMobileView: true,
111
+ },
112
+ render: (args) => {
113
+ return {
114
+ components: { SyBtnSelect, VIcon },
115
+ setup() {
116
+ return { args, mdiAccount }
117
+ },
118
+ template: `
119
+ <div class="d-flex flex-wrap align-center pa-4">
120
+ <SyBtnSelect v-bind="args" />
121
+ </div>
122
+ `,
123
+ }
124
+ },
125
+ }
126
+
127
+ export const WithSlotPrependIcon: Story = {
128
+ parameters: {
129
+ sourceCode: [
130
+ {
131
+ name: 'Template',
132
+ code: `
133
+ <template>
134
+ <SyBtnSelect
135
+ :primary-info="primaryInfo"
136
+ :menu-items="items"
137
+ >
138
+ <template #prepend-icon>
139
+ <VIcon :icon="mdiAccount" color="secondary" />
140
+ </template>
141
+ </SyBtnSelect>
142
+ </template>
143
+ `,
144
+ },
145
+ {
146
+ name: 'Script',
147
+ code: `
148
+ <script setup lang="ts">
149
+ import SyBtnSelect from './SyBtnSelect.vue'
150
+
151
+ const primaryInfo = 'Jane Doe'
152
+ const items = ['Option 1', 'Option 2']
153
+ </script>
154
+ `,
155
+ },
156
+ ],
157
+ },
158
+ args: {
159
+ primaryInfo: 'Jane Doe',
160
+ menuItems: ['Option 1', 'Option 2'],
161
+ options: {
162
+ iconColor: 'secondary',
163
+ },
164
+ },
165
+ render: (args) => {
166
+ return {
167
+ components: { SyBtnSelect, VIcon },
168
+ setup() {
169
+ return { args, mdiAccount }
170
+ },
171
+ template: `
172
+ <div class="d-flex flex-wrap align-center pa-4">
173
+ <SyBtnSelect v-bind="args">
174
+ <template #prepend-icon>
175
+ <VIcon :icon="mdiAccount" color="secondary"/>
176
+ </template>
177
+ </SyBtnSelect>
178
+ </div>
179
+ `,
180
+ }
181
+ },
182
+ }
183
+
184
+ export const WithSlotAppendIcon: Story = {
185
+ parameters: {
186
+ sourceCode: [
187
+ {
188
+ name: 'Template',
189
+ code: `
190
+ <template>
191
+ <SyBtnSelect
192
+ :primary-info="primaryInfo"
193
+ :menu-items="items"
194
+ >
195
+ <template #append-icon>
196
+ <VIcon :icon="mdiAccount" color="secondary" />
197
+ </template>
198
+ </SyBtnSelect>
199
+ </template>
200
+ `,
201
+ },
202
+ {
203
+ name: 'Script',
204
+ code: `
205
+ <script setup lang="ts">
206
+ import SyBtnSelect from './SyBtnSelect.vue'
207
+
208
+ const primaryInfo = 'Jane Doe'
209
+ const items = ['Option 1', 'Option 2']
210
+ </script>
211
+ `,
212
+ },
213
+ ],
214
+ },
215
+ args: {
216
+ primaryInfo: 'Jane Doe',
217
+ menuItems: ['Option 1', 'Option 2'],
218
+ },
219
+ render: (args) => {
220
+ return {
221
+ components: { SyBtnSelect, VIcon },
222
+ setup() {
223
+ return { args, mdiAccount }
224
+ },
225
+ template: `
226
+ <div class="d-flex flex-wrap align-center pa-4">
227
+ <SyBtnSelect v-bind="args">
228
+ <template #append-icon>
229
+ <VIcon :icon="mdiAccount" color="secondary"/>
230
+ </template>
231
+ </SyBtnSelect>
232
+ </div>
233
+ `,
234
+ }
235
+ },
236
+ }
237
+
238
+ export const WithIconOnly: Story = {
239
+ parameters: {
240
+ sourceCode: [
241
+ {
242
+ name: 'Template',
243
+ code: `
244
+ <template>
245
+ <SyBtnSelect
246
+ :primary-info="primaryInfo"
247
+ :menu-items="items"
248
+ icon-only
249
+ >
250
+ <template #prepend-icon>
251
+ <VIcon :icon="mdiAccount" color="secondary" />
252
+ </template>
253
+ </SyBtnSelect>
254
+ </template>
255
+ `,
256
+ },
257
+ {
258
+ name: 'Script',
259
+ code: `
260
+ <script setup lang="ts">
261
+ import SyBtnSelect from './SyBtnSelect.vue'
262
+
263
+ const primaryInfo = 'Jane Doe'
264
+ const items = ['Option 1', 'Option 2']
265
+ </script>
266
+ `,
267
+ },
268
+ ],
269
+ },
270
+ args: {
271
+ primaryInfo: 'Jane Doe',
272
+ menuItems: ['Option 1', 'Option 2'],
273
+ iconOnly: true,
274
+ },
275
+ render: (args) => {
276
+ return {
277
+ components: { SyBtnSelect, VIcon },
278
+ setup() {
279
+ return { args, mdiAccount }
280
+ },
281
+ template: `
282
+ <div class="d-flex flex-wrap align-center pa-4">
283
+ <SyBtnSelect v-bind="args">
284
+ <template #prepend-icon>
285
+ <VIcon :icon="mdiAccount" color="secondary"/>
286
+ </template>
287
+ </SyBtnSelect>
288
+ </div>
289
+ `,
290
+ }
291
+ },
292
+ }
293
+
294
+ export const WithLogoutItemSlot: Story = {
295
+ parameters: {
296
+ sourceCode: [
297
+ {
298
+ name: 'Template',
299
+ code: `
300
+ <template>
301
+ <SyBtnSelect
302
+ :primary-info="primaryInfo"
303
+ :menu-items="items"
304
+ >
305
+ <template #footer-list-item>
306
+ <VListItem @click="args.logout">
307
+ <VListItemTitle>Logout</VListItemTitle>
308
+ </VListItem>
309
+ </template>
310
+ </SyBtnSelect>
311
+ </template>
312
+ `,
313
+ },
314
+ {
315
+ name: 'Script',
316
+ code: `
317
+ <script setup lang="ts">
318
+ import SyBtnSelect from './SyBtnSelect.vue'
319
+
320
+ const primaryInfo = 'Mes options'
321
+ const items = ['Option 1', 'Option 2']
322
+ </script>
323
+ `,
324
+ },
325
+ ],
326
+ },
327
+ args: {
328
+ primaryInfo: 'Mes options',
329
+ menuItems: ['Option 1', 'Option 2'],
330
+ },
331
+ render: (args) => {
332
+ return {
333
+ components: { SyBtnSelect, VListItem, VListItemTitle },
334
+ setup() {
335
+ return { args }
336
+ },
337
+ template: `
338
+ <div class="d-flex flex-wrap align-center pa-4">
339
+ <SyBtnSelect v-bind="args">
340
+ <template #footer-list-item>
341
+ <VListItem @click="args.logout">
342
+ <VListItemTitle>Logout</VListItemTitle>
343
+ </VListItem>
344
+ </template>
345
+ </SyBtnSelect>
346
+ </div>
347
+ `,
348
+ }
349
+ },
350
+ }
351
+
352
+ export const WithCustomKeys: Story = {
353
+ parameters: {
354
+ sourceCode: [
355
+ {
356
+ name: 'Template',
357
+ code: `
358
+ <template>
359
+ <SyBtnSelect
360
+ v-bind="args"
361
+ text-key="customText"
362
+ value-key="customValue"
363
+ :menu-items="menuItems"
364
+ >
365
+ <template #prepend-icon>
366
+ <VIcon :icon="mdiAccount" />
367
+ </template>
368
+ </SyBtnSelect>
369
+ </template>
370
+ `,
371
+ },
372
+ {
373
+ name: 'Script',
374
+ code: `
375
+ <script setup lang="ts">
376
+ import SyBtnSelect from './SyBtnSelect.vue'
377
+
378
+ const primaryInfo = 'Information principale'
379
+ const menuItems = [
380
+ { customText: 'Choix 1', customValue: '1' },
381
+ { customText: 'Choix 2', customValue: '2' },
382
+ ],
383
+ </script>
384
+ `,
385
+ },
386
+ ],
387
+ },
388
+ args: {
389
+ menuItems: [
390
+ { customText: 'Choix 1', customValue: '1' },
391
+ { customText: 'Choix 2', customValue: '2' },
392
+ ],
393
+ textKey: 'customText',
394
+ valueKey: 'customValue',
395
+ },
396
+ render: (args) => {
397
+ return {
398
+ components: { SyBtnSelect, VIcon },
399
+ setup() {
400
+ return { args, mdiAccount }
401
+ },
402
+ template: `
403
+ <div class="d-flex flex-wrap align-center pa-4">
404
+ <SyBtnSelect
405
+ v-bind="args"
406
+ >
407
+ <template #prepend-icon>
408
+ <VIcon :icon="mdiAccount"/>
409
+ </template>
410
+ </SyBtnSelect>
411
+ </div>
412
+ `,
413
+ }
414
+ },
415
+ }
416
+
417
+ export const WithMultipleSlots: Story = {
418
+ parameters: {
419
+ sourceCode: [
420
+ {
421
+ name: 'Template',
422
+ code: `
423
+ <template>
424
+ <SyBtnSelect
425
+ :primary-info="primaryInfo"
426
+ :menu-items="menuItems"
427
+ >
428
+ <template #prepend-icon>
429
+ <VIcon :icon="mdiAccount" />
430
+ </template>
431
+ <template #footer-list-item>
432
+ <VListItem @click="args.logout">
433
+ <VListItemTitle>Se déconnecter</VListItemTitle>
434
+ </VListItem>
435
+ </template>
436
+ </SyBtnSelect>
437
+ </template>
438
+ `,
439
+ },
440
+ {
441
+ name: 'Script',
442
+ code: `
443
+ <script setup lang="ts">
444
+ import SyBtnSelect from './SyBtnSelect.vue'
445
+
446
+ const primaryInfo = 'Information principale'
447
+ const menuItems = ['Option 1', 'Option 2']
448
+ </script>
449
+ `,
450
+ },
451
+ ],
452
+ },
453
+ args: {
454
+ menuItems: ['Option 1', 'Option 2'],
455
+ },
456
+ render: (args) => {
457
+ return {
458
+ components: { SyBtnSelect, VIcon, VListItem, VListItemTitle },
459
+ setup() {
460
+ return { args, mdiAccount }
461
+ },
462
+ template: `
463
+ <div class="d-flex flex-wrap align-center pa-4">
464
+ <SyBtnSelect v-bind="args">
465
+ <template #prepend-icon>
466
+ <VIcon :icon="mdiAccount"/>
467
+ </template>
468
+ <template #footer-list-item>
469
+ <VListItem @click="args.logout">
470
+ <VListItemTitle>Se déconnecter</VListItemTitle>
471
+ </VListItem>
472
+ </template>
473
+ </SyBtnSelect>
474
+ </div>
475
+ `,
476
+ }
477
+ },
478
+ }
479
+
480
+ export const WithCustomStyles: Story = {
481
+ parameters: {
482
+ sourceCode: [
483
+ {
484
+ name: 'Template',
485
+ code: `
486
+ <template>
487
+ <SyBtnSelect
488
+ :primary-info="primaryInfo"
489
+ :menu-items="items"
490
+ >
491
+ <template #prepend-icon>
492
+ <VIcon
493
+ :icon="mdiAccount"
494
+ class="mr-2"
495
+ color="red"
496
+ />
497
+ </template>
498
+ </SyBtnSelect>
499
+ </template>
500
+ `,
501
+ },
502
+ {
503
+ name: 'Script',
504
+ code: `
505
+ <script setup lang="ts">
506
+ import SyBtnSelect from './SyBtnSelect.vue'
507
+
508
+ const primaryInfo = 'Jane Doe'
509
+ const items = ['Option 1', 'Option 2']
510
+ </script>
511
+ `,
512
+ },
513
+ ],
514
+ },
515
+ args: {
516
+ primaryInfo: 'Jane Doe',
517
+ menuItems: ['Option 1', 'Option 2'],
518
+ },
519
+ render: (args) => {
520
+ return {
521
+ components: { SyBtnSelect, VIcon },
522
+ setup() {
523
+ return { args, mdiAccount }
524
+ },
525
+ template: `
526
+ <div class="d-flex flex-wrap align-center pa-4">
527
+ <SyBtnSelect v-bind="args">
528
+ <template #prepend-icon>
529
+ <VIcon
530
+ :icon="mdiAccount"
531
+ class="mr-2"
532
+ color="red"
533
+ />
534
+ </template>
535
+ </SyBtnSelect>
536
+ </div>
537
+ `,
538
+ }
539
+ },
540
+ }
541
+
542
+ export const WithStyledOptions: Story = {
543
+ parameters: {
544
+ sourceCode: [
545
+ {
546
+ name: 'Template',
547
+ code: `
548
+ <template>
549
+ <SyBtnSelect
550
+ :primary-info="primaryInfo"
551
+ :menu-items="menuItems"
552
+ :options="options"
553
+ >
554
+ <template #prepend-icon>
555
+ <VIcon :icon="mdiAccount" />
556
+ </template>
557
+ </SyBtnSelect>
558
+ </template>
559
+ `,
560
+ },
561
+ {
562
+ name: 'Script',
563
+ code: `
564
+ <script setup lang="ts">
565
+ import SyBtnSelect from './SyBtnSelect.vue'
566
+
567
+ const primaryInfo = 'Information principale'
568
+ const menuItems = ['Option 1', 'Option 2']
569
+ const options = {
570
+ menu: { height: '200px' },
571
+ btn: { variant: 'outlined', textColor: 'primary', color: 'primary' },
572
+ list: { dense: true, textColor: 'primary' },
573
+ }
574
+ </script>
575
+ `,
576
+ },
577
+ ],
578
+ },
579
+ args: {
580
+ menuItems: ['Option 1', 'Option 2'],
581
+ options: {
582
+ menu: { height: '200px' },
583
+ btn: { variant: 'outlined', textColor: 'primary', color: 'primary' },
584
+ list: { dense: true, textColor: 'primary' },
585
+ },
586
+ },
587
+ render: (args) => {
588
+ return {
589
+ components: { SyBtnSelect, VIcon },
590
+ setup() {
591
+ return { args, mdiAccount }
592
+ },
593
+ template: `
594
+ <div class="d-flex flex-wrap align-center pa-4">
595
+ <SyBtnSelect
596
+ v-bind="args"
597
+ >
598
+ <template #prepend-icon>
599
+ <VIcon :icon="mdiAccount"/>
600
+ </template>
601
+ </SyBtnSelect>
602
+ </div>
603
+ `,
604
+ }
605
+ },
606
+ }