@cnamts/synapse 0.0.0-alpha.0 → 0.0.2-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 (55) hide show
  1. package/README.md +72 -2
  2. package/dist/design-system-v3.d.ts +234 -2
  3. package/dist/design-system-v3.js +3020 -2142
  4. package/dist/design-system-v3.umd.cjs +2 -2
  5. package/dist/style.css +1 -1
  6. package/package.json +11 -10
  7. package/src/components/CollapsibleList/CollapsibleList.mdx +47 -0
  8. package/src/components/CollapsibleList/CollapsibleList.stories.ts +52 -0
  9. package/src/components/CollapsibleList/CollapsibleList.vue +157 -0
  10. package/src/components/CollapsibleList/tests/CollapsibleList.spec.ts +60 -0
  11. package/src/components/CollapsibleList/types.d.ts +5 -0
  12. package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +42 -0
  13. package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +154 -0
  14. package/src/components/Customs/CustomInputSelect/CustomInputSelect.vue +185 -0
  15. package/src/components/Customs/CustomInputSelect/tests/CustomInputSelect.spec.ts +216 -0
  16. package/src/components/Customs/CustomSelect/CustomSelect.mdx +47 -0
  17. package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +182 -0
  18. package/src/components/Customs/CustomSelect/CustomSelect.vue +188 -0
  19. package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +236 -0
  20. package/src/components/FooterBar/A11yCompliance.ts +9 -0
  21. package/src/components/FooterBar/FooterBar.mdx +115 -0
  22. package/src/components/FooterBar/FooterBar.stories.ts +632 -0
  23. package/src/components/FooterBar/FooterBar.vue +330 -0
  24. package/src/components/FooterBar/config.ts +20 -0
  25. package/src/components/FooterBar/defaultSocialMediaLinks.ts +21 -0
  26. package/src/components/FooterBar/locales.ts +16 -0
  27. package/src/components/FooterBar/tests/FooterBar.spec.ts +167 -0
  28. package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +36 -0
  29. package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +27 -0
  30. package/src/components/FooterBar/types.d.ts +10 -0
  31. package/src/components/LangBtn/LangBtn.mdx +2 -1
  32. package/src/components/LangBtn/LangBtn.vue +3 -3
  33. package/src/components/Logo/Logo.mdx +26 -0
  34. package/src/components/Logo/Logo.stories.ts +217 -0
  35. package/src/components/Logo/Logo.vue +397 -0
  36. package/src/components/Logo/LogoSize.ts +7 -0
  37. package/src/components/Logo/locales.ts +6 -0
  38. package/src/components/Logo/logoDimensionsMapping.ts +16 -0
  39. package/src/components/Logo/tests/Logo.spec.ts +75 -0
  40. package/src/components/Logo/types.d.ts +8 -0
  41. package/src/components/SocialMediaLinks/DefaultSocialMediaLinks.ts +21 -0
  42. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +15 -0
  43. package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +72 -0
  44. package/src/components/SocialMediaLinks/SocialMediaLinks.vue +92 -0
  45. package/src/components/SocialMediaLinks/locales.ts +3 -0
  46. package/src/components/SocialMediaLinks/tests/DefaultSocialMediaLinks.spec.ts +21 -0
  47. package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +89 -0
  48. package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +24 -0
  49. package/src/components/SocialMediaLinks/types.d.ts +5 -0
  50. package/src/components/index.ts +6 -0
  51. package/src/directives/clickOutside.ts +24 -0
  52. package/src/temp/TestDTComponent.vue +6 -10
  53. package/src/temp/gridsTests.vue +0 -4
  54. package/src/utils/propValidator/index.ts +20 -0
  55. package/src/utils/propValidator/tests/propValidator.spec.ts +40 -0
package/README.md CHANGED
@@ -1,2 +1,72 @@
1
- # design-system-v3
2
- 📦 Un Design System pour l’Assurance Maladie
1
+ # Synapse
2
+
3
+ 🗃️ Ce package contient les composants du Design System de l'Assurance Maladie réécrits en Vue 3.
4
+
5
+ ## Changelog
6
+
7
+ Pour consulter les changements récents, veuillez consulter le [CHANGELOG](https://github.com/assurance-maladie-digital/design-system-v3/CHANGELOG.md).
8
+
9
+ ## Prérequis
10
+
11
+ Pour utiliser ce Design System, vous devez avoir au moins les versions suivantes de Node :
12
+
13
+ - Node : 18.0.0
14
+
15
+ ## Stack Technique
16
+
17
+ - Vue 3
18
+ - Vuetify 3
19
+ - Vue Router 4
20
+
21
+ ## Outils Inclus
22
+
23
+ - Typescript
24
+ - Axios
25
+ - Sass
26
+ - Vitest pour les tests unitaires
27
+
28
+ ## Installation et utilisation
29
+
30
+ ### Starter kit
31
+
32
+ Pour utiliser ce package, vous pouvez installer le starter kit suivant :
33
+
34
+ - [Starter Kit Synapse](https://gitlab.cnqd.cnamts.fr/human/developpement/SKV3_X)
35
+
36
+ ### Librairie uniquement
37
+
38
+ Vous pouvez également utiliser ce package en tant que librairie de composants dans votre projet.
39
+ Pour cela, vous pouvez l'installer via npm ou un autre gestionnaire de paquets :
40
+
41
+ ```bash
42
+ npm i @cnamts/synapse
43
+ ```
44
+
45
+ ## Commandes disponibles
46
+
47
+ ```bash
48
+ "pnpm build": Build du projet,
49
+ "pnpm dev": Lancement du serveur de développement,
50
+ "pnpm preview": Lancement du serveur de prévisualisation,
51
+ "pnpm test:unit": Lancement des tests unitaires,
52
+ "pnpm lint": Lancement de l\'analyseur de code,
53
+ ```
54
+
55
+ ## Contribution
56
+
57
+ Nous encourageons les contributions de la communauté ! Si vous souhaitez contribuer à ce projet, veuillez suivre les étapes suivantes :
58
+
59
+ ### Fork du dépôt
60
+
61
+ - Créez une branche pour votre fonctionnalité ou correction de bogue
62
+ - Effectuez les modifications nécessaires
63
+ - Soumettez une pull request
64
+ - Assurez-vous de suivre notre Guide de contribution pour plus de détails.
65
+
66
+ ### Support
67
+
68
+ Si vous rencontrez des problèmes ou avez des questions, n'hésitez pas à ouvrir une issue.
69
+
70
+ ## Licence
71
+
72
+ Ce projet est sous licence MIT. Veuillez consulter le fichier LICENSE pour plus d'informations.
@@ -1,9 +1,18 @@
1
+ import { AxiosResponse } from 'axios';
1
2
  import { ComponentOptionsMixin } from 'vue';
2
3
  import { ComponentProvideOptions } from 'vue';
3
4
  import { ComputedRef } from 'vue';
4
5
  import { DefineComponent } from 'vue';
6
+ import { ExtractPropTypes } from 'vue';
7
+ import { LinkItem } from './types';
8
+ import { ListItem } from './types';
9
+ import { PropType } from 'vue';
5
10
  import { PublicProps } from 'vue';
6
11
  import { Ref } from 'vue';
12
+ import { RouteLocationAsPathGeneric } from 'vue-router';
13
+ import { RouteLocationAsRelativeGeneric } from 'vue-router';
14
+ import { SocialMediaLink } from './types';
15
+ import { SocialMediaLink as SocialMediaLink_2 } from '../SocialMediaLinks/types';
7
16
 
8
17
  declare type __VLS_PublicProps = {
9
18
  modelValue?: boolean;
@@ -51,6 +60,24 @@ declare type __VLS_WithTemplateSlots_6<T, S> = T & {
51
60
  };
52
61
  };
53
62
 
63
+ declare type __VLS_WithTemplateSlots_7<T, S> = T & {
64
+ new (): {
65
+ $slots: S;
66
+ };
67
+ };
68
+
69
+ declare type __VLS_WithTemplateSlots_8<T, S> = T & {
70
+ new (): {
71
+ $slots: S;
72
+ };
73
+ };
74
+
75
+ declare type __VLS_WithTemplateSlots_9<T, S> = T & {
76
+ new (): {
77
+ $slots: S;
78
+ };
79
+ };
80
+
54
81
  export declare const Alert: __VLS_WithTemplateSlots_2<DefineComponent<__VLS_PublicProps, {
55
82
  prependIcon: ComputedRef<string>;
56
83
  dismissAlert: typeof dismissAlert;
@@ -67,6 +94,17 @@ variant: "tonal" | "outlined";
67
94
  default?(_: {}): any;
68
95
  }>;
69
96
 
97
+ export declare const BackBtn: __VLS_WithTemplateSlots_6<DefineComponent< {
98
+ hideBackIcon?: boolean | undefined;
99
+ dark?: boolean | undefined;
100
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
101
+ hideBackIcon?: boolean | undefined;
102
+ dark?: boolean | undefined;
103
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
104
+ icon?(_: {}): any;
105
+ default?(_: {}): any;
106
+ }>;
107
+
70
108
  export declare const BackToTopBtn: __VLS_WithTemplateSlots_5<DefineComponent<Props & CustomizableOptions, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props & CustomizableOptions> & Readonly<{}>, {
71
109
  target: string;
72
110
  threshold: number;
@@ -77,6 +115,14 @@ nudgeBottom: string | number;
77
115
  icon?(_: {}): any;
78
116
  }>;
79
117
 
118
+ export declare const CollapsibleList: DefineComponent< {
119
+ listTitle: string | null;
120
+ items: ListItem[];
121
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
122
+ listTitle: string | null;
123
+ items: ListItem[];
124
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
125
+
80
126
  declare type ComponentsProps = Record<string, PropsList>;
81
127
 
82
128
  declare function copy(): void;
@@ -113,6 +159,96 @@ declare interface CustomizableOptions {
113
159
 
114
160
  declare function dismissAlert(): void;
115
161
 
162
+ declare function download(): Promise<void>;
163
+
164
+ export declare const DownloadBtn: __VLS_WithTemplateSlots_7<DefineComponent<Props_2 & CustomizableOptions, {
165
+ getFileInfo: typeof getFileInfo;
166
+ download: typeof download;
167
+ state: Ref<State, State>;
168
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
169
+ error: (...args: any[]) => void;
170
+ success: (...args: any[]) => void;
171
+ }, string, PublicProps, Readonly<Props_2 & CustomizableOptions> & Readonly<{
172
+ onError?: ((...args: any[]) => any) | undefined;
173
+ onSuccess?: ((...args: any[]) => any) | undefined;
174
+ }>, {
175
+ fallbackFilename: string;
176
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
177
+ icon?(_: {}): any;
178
+ default?(_: {}): any;
179
+ }>;
180
+
181
+ declare interface FileInfo {
182
+ name: string;
183
+ type: string;
184
+ }
185
+
186
+ export declare const FooterBar: __VLS_WithTemplateSlots_9<DefineComponent<CustomizableOptions & {
187
+ a11yCompliance?: string | undefined;
188
+ linkItems?: LinkItem[] | null | undefined;
189
+ items?: LinkItem[] | null | undefined;
190
+ sitemapRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
191
+ cguRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
192
+ cookiesRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
193
+ legalNoticeRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
194
+ a11yStatementRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
195
+ hideSitemapLink?: boolean | undefined;
196
+ hideCguLink?: boolean | undefined;
197
+ hideCookiesLink?: boolean | undefined;
198
+ hideLegalNoticeLink?: boolean | undefined;
199
+ hideA11yLink?: boolean | undefined;
200
+ version?: string | undefined;
201
+ hideLogo?: boolean | undefined;
202
+ hideSocialMediaLinks?: boolean | undefined;
203
+ socialMediaLinks?: SocialMediaLink_2[] | undefined;
204
+ light?: boolean | undefined;
205
+ }, {
206
+ logoSize: ComputedRef<"small" | "normal">;
207
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CustomizableOptions & {
208
+ a11yCompliance?: string | undefined;
209
+ linkItems?: LinkItem[] | null | undefined;
210
+ items?: LinkItem[] | null | undefined;
211
+ sitemapRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
212
+ cguRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
213
+ cookiesRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
214
+ legalNoticeRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
215
+ a11yStatementRoute?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined;
216
+ hideSitemapLink?: boolean | undefined;
217
+ hideCguLink?: boolean | undefined;
218
+ hideCookiesLink?: boolean | undefined;
219
+ hideLegalNoticeLink?: boolean | undefined;
220
+ hideA11yLink?: boolean | undefined;
221
+ version?: string | undefined;
222
+ hideLogo?: boolean | undefined;
223
+ hideSocialMediaLinks?: boolean | undefined;
224
+ socialMediaLinks?: SocialMediaLink_2[] | undefined;
225
+ light?: boolean | undefined;
226
+ }> & Readonly<{}>, {
227
+ light: boolean;
228
+ items: LinkItem[] | null;
229
+ a11yCompliance: string;
230
+ linkItems: LinkItem[] | null;
231
+ sitemapRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
232
+ cguRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
233
+ cookiesRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
234
+ legalNoticeRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
235
+ a11yStatementRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
236
+ hideSitemapLink: boolean;
237
+ hideCguLink: boolean;
238
+ hideCookiesLink: boolean;
239
+ hideLegalNoticeLink: boolean;
240
+ hideA11yLink: boolean;
241
+ version: string;
242
+ hideLogo: boolean;
243
+ hideSocialMediaLinks: boolean;
244
+ socialMediaLinks: SocialMediaLink_2[];
245
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
246
+ logo?(_: {}): any;
247
+ default?(_: {}): any;
248
+ prepend?(_: {}): any;
249
+ append?(_: {}): any;
250
+ }>;
251
+
116
252
  export declare const FranceConnectBtn: DefineComponent< {
117
253
  href: string;
118
254
  isConnectPlus?: boolean | undefined;
@@ -122,10 +258,15 @@ href: string;
122
258
  isConnectPlus?: boolean | undefined;
123
259
  dark?: boolean | undefined;
124
260
  }> & Readonly<{}>, {
125
- isConnectPlus: boolean;
126
261
  dark: boolean;
262
+ isConnectPlus: boolean;
127
263
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
128
264
 
265
+ /**
266
+ * Get filename and content type from headers
267
+ */
268
+ declare function getFileInfo(header: Record<string, string>): FileInfo;
269
+
129
270
  export declare const LangBtn: DefineComponent<CustomizableOptions & {
130
271
  modelValue?: string | undefined;
131
272
  hideDownArrow?: boolean | undefined;
@@ -159,6 +300,76 @@ hideDownArrow: boolean;
159
300
  availableLanguages: string[] | "*";
160
301
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
161
302
 
303
+ export declare const Logo: DefineComponent<ExtractPropTypes< {
304
+ hideSignature: {
305
+ type: BooleanConstructor;
306
+ default: boolean;
307
+ };
308
+ hideOrganism: {
309
+ type: BooleanConstructor;
310
+ default: boolean;
311
+ };
312
+ risquePro: {
313
+ type: BooleanConstructor;
314
+ default: boolean;
315
+ };
316
+ ariaLabel: {
317
+ type: StringConstructor;
318
+ default: undefined;
319
+ };
320
+ avatar: {
321
+ type: BooleanConstructor;
322
+ default: boolean;
323
+ };
324
+ dark: {
325
+ type: BooleanConstructor;
326
+ default: boolean;
327
+ };
328
+ size: {
329
+ type: PropType<"small" | "x-small" | "normal">;
330
+ default: "normal";
331
+ validator: (value: string) => boolean;
332
+ };
333
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
334
+ hideSignature: {
335
+ type: BooleanConstructor;
336
+ default: boolean;
337
+ };
338
+ hideOrganism: {
339
+ type: BooleanConstructor;
340
+ default: boolean;
341
+ };
342
+ risquePro: {
343
+ type: BooleanConstructor;
344
+ default: boolean;
345
+ };
346
+ ariaLabel: {
347
+ type: StringConstructor;
348
+ default: undefined;
349
+ };
350
+ avatar: {
351
+ type: BooleanConstructor;
352
+ default: boolean;
353
+ };
354
+ dark: {
355
+ type: BooleanConstructor;
356
+ default: boolean;
357
+ };
358
+ size: {
359
+ type: PropType<"small" | "x-small" | "normal">;
360
+ default: "normal";
361
+ validator: (value: string) => boolean;
362
+ };
363
+ }>> & Readonly<{}>, {
364
+ size: "small" | "x-small" | "normal";
365
+ ariaLabel: string;
366
+ dark: boolean;
367
+ hideSignature: boolean;
368
+ hideOrganism: boolean;
369
+ risquePro: boolean;
370
+ avatar: boolean;
371
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
372
+
162
373
  declare interface Notification_2 {
163
374
  id: string;
164
375
  message: string;
@@ -167,7 +378,7 @@ declare interface Notification_2 {
167
378
  icon?: string | null;
168
379
  }
169
380
 
170
- export declare const NotificationBar: __VLS_WithTemplateSlots_6<DefineComponent<CustomizableOptions & {
381
+ export declare const NotificationBar: __VLS_WithTemplateSlots_8<DefineComponent<CustomizableOptions & {
171
382
  closeBtnText?: string | undefined;
172
383
  rounded?: true | 0 | "xl" | "xs" | "sm" | "lg" | 1 | 2 | 3 | 4 | "circle" | "pill" | "shaped" | undefined;
173
384
  bottom?: boolean | undefined;
@@ -226,6 +437,11 @@ declare interface Props {
226
437
  target?: string;
227
438
  }
228
439
 
440
+ declare interface Props_2 {
441
+ filePromise: () => Promise<AxiosResponse<Blob>>;
442
+ fallbackFilename?: string;
443
+ }
444
+
229
445
  declare type PropsList = Record<string, unknown>;
230
446
 
231
447
  export declare const SkipLink: __VLS_WithTemplateSlots_4<DefineComponent< {
@@ -241,6 +457,22 @@ target: string;
241
457
  default?(_: {}): any;
242
458
  }>;
243
459
 
460
+ export declare const SocialMediaLinks: DefineComponent<ExtractPropTypes< {
461
+ links: {
462
+ type: PropType<SocialMediaLink[]>;
463
+ default: null;
464
+ };
465
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
466
+ links: {
467
+ type: PropType<SocialMediaLink[]>;
468
+ default: null;
469
+ };
470
+ }>> & Readonly<{}>, {
471
+ links: SocialMediaLink[];
472
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
473
+
474
+ declare type State = 'idle' | 'loading' | 'success' | 'error';
475
+
244
476
  declare function updateLang(lang: string): void;
245
477
 
246
478
  export { }