@cnamts/synapse 0.0.0-alpha.0

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 (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/design-system-v3.d.ts +246 -0
  4. package/dist/design-system-v3.js +5425 -0
  5. package/dist/design-system-v3.umd.cjs +2 -0
  6. package/dist/style.css +1 -0
  7. package/package.json +104 -0
  8. package/src/assets/tokens.scss +500 -0
  9. package/src/components/Alert/Alert.mdx +36 -0
  10. package/src/components/Alert/Alert.stories.ts +115 -0
  11. package/src/components/Alert/Alert.vue +248 -0
  12. package/src/components/Alert/locales.ts +3 -0
  13. package/src/components/Alert/tests/Alert.spec.ts +105 -0
  14. package/src/components/Alert/tests/__snapshots__/Alert.spec.ts.snap +15 -0
  15. package/src/components/BackBtn/BackBtn.mdx +26 -0
  16. package/src/components/BackBtn/BackBtn.stories.ts +138 -0
  17. package/src/components/BackBtn/BackBtn.vue +60 -0
  18. package/src/components/BackBtn/locales.ts +3 -0
  19. package/src/components/BackBtn/tests/BackBtn.spec.ts +103 -0
  20. package/src/components/BackBtn/tests/__snapshots__/BackBtn.spec.ts.snap +9 -0
  21. package/src/components/BackToTopBtn/BackToTopBtn.mdx +52 -0
  22. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +188 -0
  23. package/src/components/BackToTopBtn/BackToTopBtn.vue +137 -0
  24. package/src/components/BackToTopBtn/config.ts +12 -0
  25. package/src/components/BackToTopBtn/locales.ts +3 -0
  26. package/src/components/BackToTopBtn/tests/BackToTopBtn.spec.ts +173 -0
  27. package/src/components/BackToTopBtn/tests/__snapshots__/BackToTopBtn.spec.ts.snap +17 -0
  28. package/src/components/Beta/beta.mdx +5 -0
  29. package/src/components/CopyBtn/CopyBtn.mdx +38 -0
  30. package/src/components/CopyBtn/CopyBtn.stories.ts +209 -0
  31. package/src/components/CopyBtn/CopyBtn.vue +103 -0
  32. package/src/components/CopyBtn/config.ts +17 -0
  33. package/src/components/CopyBtn/locales.ts +3 -0
  34. package/src/components/CopyBtn/tests/CopyBtn.spec.ts +99 -0
  35. package/src/components/CopyBtn/tests/__snapshots__/CopyBtn.spec.ts.snap +7 -0
  36. package/src/components/Deprecated/deprecated.mdx +5 -0
  37. package/src/components/DownloadBtn/DownloadBtn.mdx +94 -0
  38. package/src/components/DownloadBtn/DownloadBtn.stories.ts +211 -0
  39. package/src/components/DownloadBtn/DownloadBtn.vue +113 -0
  40. package/src/components/DownloadBtn/config.ts +13 -0
  41. package/src/components/DownloadBtn/tests/DownloadBtn.spec.ts +82 -0
  42. package/src/components/DownloadBtn/tests/__snapshots__/DownloadBtn.spec.ts.snap +17 -0
  43. package/src/components/DownloadBtn/tests/data/filePromise.ts +53 -0
  44. package/src/components/DownloadBtn/tests/data/test.json +0 -0
  45. package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +34 -0
  46. package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +92 -0
  47. package/src/components/FranceConnectBtn/FranceConnectBtn.vue +154 -0
  48. package/src/components/FranceConnectBtn/locales.ts +6 -0
  49. package/src/components/FranceConnectBtn/tests/FranceConnectBtn.spec.ts +62 -0
  50. package/src/components/FranceConnectBtn/tests/__snapshots__/FranceConnectBtn.spec.ts.snap +36 -0
  51. package/src/components/LangBtn/LangBtn.mdx +37 -0
  52. package/src/components/LangBtn/LangBtn.stories.ts +147 -0
  53. package/src/components/LangBtn/LangBtn.vue +167 -0
  54. package/src/components/LangBtn/config.ts +17 -0
  55. package/src/components/LangBtn/locales.ts +3 -0
  56. package/src/components/LangBtn/tests/Config.spec.ts +24 -0
  57. package/src/components/LangBtn/tests/LangBtn.spec.ts +283 -0
  58. package/src/components/LangBtn/tests/__snapshots__/LangBtn.spec.ts.snap +11 -0
  59. package/src/components/LangBtn/types.d.ts +7 -0
  60. package/src/components/NotificationBar/NotificationBar.mdx +94 -0
  61. package/src/components/NotificationBar/NotificationBar.stories.ts +366 -0
  62. package/src/components/NotificationBar/NotificationBar.vue +296 -0
  63. package/src/components/NotificationBar/options.ts +15 -0
  64. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +332 -0
  65. package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +7 -0
  66. package/src/components/NotificationBar/types.ts +7 -0
  67. package/src/components/PageContainer/PageContainer.mdx +29 -0
  68. package/src/components/PageContainer/PageContainer.stories.ts +115 -0
  69. package/src/components/PageContainer/PageContainer.vue +68 -0
  70. package/src/components/PageContainer/tests/PageContainer.spec.ts +56 -0
  71. package/src/components/PageContainer/tests/__snapshots__/PageContainer.spec.ts.snap +7 -0
  72. package/src/components/SkipLink/SkipLink.mdx +55 -0
  73. package/src/components/SkipLink/SkipLink.stories.ts +70 -0
  74. package/src/components/SkipLink/SkipLink.vue +79 -0
  75. package/src/components/SkipLink/locales.ts +3 -0
  76. package/src/components/SkipLink/tests/__snapshots__/skipLink.spec.ts.snap +3 -0
  77. package/src/components/SkipLink/tests/skipLink.spec.ts +46 -0
  78. package/src/components/index.ts +8 -0
  79. package/src/composables/useCustomizableOptions.ts +23 -0
  80. package/src/designTokens/bootstrapColors.md +66 -0
  81. package/src/designTokens/cnamColors.md +193 -0
  82. package/src/designTokens/index.ts +15 -0
  83. package/src/designTokens/tokens/bootstrap/bootstrapColors.ts +158 -0
  84. package/src/designTokens/tokens/bootstrap/bootstrapLightTheme.ts +22 -0
  85. package/src/designTokens/tokens/cnam/cnamColors.ts +171 -0
  86. package/src/designTokens/tokens/cnam/cnamContextual.ts +58 -0
  87. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +90 -0
  88. package/src/designTokens/tokens/cnam/cnamSemantic.ts +87 -0
  89. package/src/designTokens/tokens/json/contextual-tokens.json +156 -0
  90. package/src/designTokens/tokens/json/primitives.json +209 -0
  91. package/src/designTokens/tokens/json/semantic.json +120 -0
  92. package/src/designTokens/utils/convertGaps.ts +11 -0
  93. package/src/designTokens/utils/convertSemanticsToken.ts +32 -0
  94. package/src/designTokens/utils/createFlattenTheme.ts +19 -0
  95. package/src/designTokens/utils/index.ts +4 -0
  96. package/src/main.ts +2 -0
  97. package/src/services/NotificationService.ts +27 -0
  98. package/src/stories/Fondamentaux/Accessibilite/Accessibilite.mdx +52 -0
  99. package/src/stories/Fondamentaux/Accessibilite/Accessibilite.stories.ts +36 -0
  100. package/src/stories/Fondamentaux/Accessibilite/AccessibiliteItems.ts +706 -0
  101. package/src/stories/Fondamentaux/Accessibilite/constants/ExpertiseLevelEnum.ts +5 -0
  102. package/src/stories/Fondamentaux/Accessibilite/constants/RGAALevelEnum.ts +4 -0
  103. package/src/stories/Fondamentaux/EcoConception/EcoConception.mdx +24 -0
  104. package/src/stories/Fondamentaux/EcoConception/Econception.stories.ts +30 -0
  105. package/src/stories/Fondamentaux/EcoConception/ecoDesignItems.ts +55 -0
  106. package/src/stories/GuideDuDev/CommentContribuer.mdx +22 -0
  107. package/src/stories/GuideDuDev/components.stories.ts +23 -0
  108. package/src/stories/GuideDuDev/moduleDeNotification.mdx +182 -0
  109. package/src/stories/GuideDuDev/vuetifyOptions.mdx +72 -0
  110. package/src/stories/Guidelines/Colors.mdx +220 -0
  111. package/src/stories/Guidelines/CustomisationEtThemes.mdx +3 -0
  112. package/src/stories/Guidelines/Introduction.mdx +35 -0
  113. package/src/stories/Guidelines/Typo.mdx +53 -0
  114. package/src/stories/Home/Accueil.mdx +7 -0
  115. package/src/stories/Home/PolitiqueDeConfidentialite.mdx +4 -0
  116. package/src/stories/Home/synapse.webp +0 -0
  117. package/src/temp/TestA11y.vue +14 -0
  118. package/src/temp/TestComponent.vue +37 -0
  119. package/src/temp/TestDTComponent.vue +93 -0
  120. package/src/temp/customizableOptions.vue +18 -0
  121. package/src/temp/gridsTests.vue +54 -0
  122. package/src/temp/options.json +5 -0
  123. package/src/types/vuetifyTypes.ts +3 -0
  124. package/src/utils/convertToUnit/index.ts +16 -0
  125. package/src/utils/convertToUnit/test/convertToUnit.spec.ts +32 -0
  126. package/src/utils/functions/copyToClipboard/index.ts +38 -0
  127. package/src/utils/functions/copyToClipboard/tests/copyToClipboard.spec.ts +104 -0
  128. package/src/utils/functions/downloadFile/index.ts +37 -0
  129. package/src/utils/functions/downloadFile/tests/downloadFile.spec.ts +69 -0
  130. package/src/utils/functions/downloadFile/types.ts +1 -0
@@ -0,0 +1,209 @@
1
+ {
2
+ "colors": {
3
+ "orange": {
4
+ "darken-80": { "value": "#2d100b" },
5
+ "darken-60": { "value": "#5a2017" },
6
+ "darken-40": { "value": "#862f22" },
7
+ "darken-20": { "value": "#b33f2e" },
8
+ "base": { "value": "#e04f39" },
9
+ "lighten-20": { "value": "#e67261" },
10
+ "lighten-40": { "value": "#ec9588" },
11
+ "lighten-60": { "value": "#f3b9b0" },
12
+ "lighten-80": { "value": "#f9dcd7" },
13
+ "lighten-90": { "value": "#fcedeb" },
14
+ "lighten-97": { "value": "#fefaf9" }
15
+ },
16
+ "yellow": {
17
+ "darken-80": { "value": "#302407" },
18
+ "darken-60": { "value": "#60480e" },
19
+ "darken-40": { "value": "#906b15" },
20
+ "darken-20": { "value": "#c08f1c" },
21
+ "base": { "value": "#f0b323" },
22
+ "lighten-20": { "value": "#f3c24f" },
23
+ "lighten-40": { "value": "#f6d17b" },
24
+ "lighten-60": { "value": "#f9e1a7" },
25
+ "lighten-80": { "value": "#fcf0d3" },
26
+ "lighten-90": { "value": "#fdf7e9" },
27
+ "lighten-97": { "value": "#fffdf8" }
28
+ },
29
+ "green": {
30
+ "darken-80": { "value": "#112717" },
31
+ "darken-60": { "value": "#224e2d" },
32
+ "darken-40": { "value": "#347444" },
33
+ "darken-20": { "value": "#459b5a" },
34
+ "base": { "value": "#56c271" },
35
+ "lighten-20": { "value": "#78ce8d" },
36
+ "lighten-40": { "value": "#9adaaa" },
37
+ "lighten-60": { "value": "#bbe7c6" },
38
+ "lighten-80": { "value": "#ddf3e3" },
39
+ "lighten-90": { "value": "#eef9f1" },
40
+ "lighten-97": { "value": "#fafdfb" }
41
+ },
42
+ "turquoise": {
43
+ "darken-80": { "value": "#00221c" },
44
+ "darken-60": { "value": "#004439" },
45
+ "darken-40": { "value": "#006755" },
46
+ "darken-20": { "value": "#008972" },
47
+ "base": { "value": "#00ab8e" },
48
+ "lighten-20": { "value": "#33bca5" },
49
+ "lighten-40": { "value": "#66cdbb" },
50
+ "lighten-60": { "value": "#99ddd2" },
51
+ "lighten-80": { "value": "#cceee8" },
52
+ "lighten-90": { "value": "#e5f7f4" },
53
+ "lighten-97": { "value": "#f7fcfc" }
54
+ },
55
+ "blue": {
56
+ "darken-80": { "value": "#020d1f" },
57
+ "darken-60": { "value": "#051a3e" },
58
+ "darken-40": { "value": "#07275c" },
59
+ "darken-20": { "value": "#0a347b" },
60
+ "base": { "value": "#0c419a" },
61
+ "lighten-20": { "value": "#3d67ae" },
62
+ "lighten-40": { "value": "#6d8dc2" },
63
+ "lighten-60": { "value": "#9eb3d7" },
64
+ "lighten-80": { "value": "#ced9eb" },
65
+ "lighten-90": { "value": "#e7ecf5" },
66
+ "lighten-97": { "value": "#f8f9fc" }
67
+ },
68
+ "cyan": {
69
+ "darken-80": { "value": "#00212d" },
70
+ "darken-60": { "value": "#004259" },
71
+ "darken-40": { "value": "#006386" },
72
+ "darken-20": { "value": "#0084b2" },
73
+ "base": { "value": "#00a5df" },
74
+ "lighten-20": { "value": "#33b7e5" },
75
+ "lighten-40": { "value": "#66c9ec" },
76
+ "lighten-60": { "value": "#99dbf2" },
77
+ "lighten-80": { "value": "#ccedf9" },
78
+ "lighten-90": { "value": "#e5f6fc" },
79
+ "lighten-97": { "value": "#f7fcfe" }
80
+ },
81
+ "frosted-blue": {
82
+ "darken-80": { "value": "#142327" },
83
+ "darken-60": { "value": "#28464d" },
84
+ "darken-40": { "value": "#3d6874" },
85
+ "darken-20": { "value": "#518b9a" },
86
+ "base": { "value": "#65aec1" },
87
+ "lighten-20": { "value": "#84becd" },
88
+ "lighten-40": { "value": "#a3ceda" },
89
+ "lighten-60": { "value": "#c1dfe6" },
90
+ "lighten-80": { "value": "#e0eff3" },
91
+ "lighten-90": { "value": "#f0f7f9" },
92
+ "lighten-97": { "value": "#fafdfd" }
93
+ },
94
+ "parma": {
95
+ "darken-80": { "value": "#171c26" },
96
+ "darken-60": { "value": "#2f384d" },
97
+ "darken-40": { "value": "#465473" },
98
+ "darken-20": { "value": "#5e709a" },
99
+ "base": { "value": "#758cc0" },
100
+ "lighten-20": { "value": "#91a3cd" },
101
+ "lighten-40": { "value": "#acbad9" },
102
+ "lighten-60": { "value": "#c8d1e6" },
103
+ "lighten-80": { "value": "#e3e8f2" },
104
+ "lighten-90": { "value": "#f1f3f9" },
105
+ "lighten-97": { "value": "#fbfcfd" }
106
+ },
107
+ "mauve": {
108
+ "darken-80": { "value": "#201224" },
109
+ "darken-60": { "value": "#402449" },
110
+ "darken-40": { "value": "#60376d" },
111
+ "darken-20": { "value": "#804992" },
112
+ "base": { "value": "#a05bb6" },
113
+ "lighten-20": { "value": "#b37cc5" },
114
+ "lighten-40": { "value": "#c69dd3" },
115
+ "lighten-60": { "value": "#d9bde2" },
116
+ "lighten-80": { "value": "#ecdef0" },
117
+ "lighten-90": { "value": "#f5eff8" },
118
+ "lighten-97": { "value": "#fcfafd" }
119
+ },
120
+ "pink": {
121
+ "darken-80": { "value": "#2d051a" },
122
+ "darken-60": { "value": "#5a0a34" },
123
+ "darken-40": { "value": "#87104d" },
124
+ "darken-20": { "value": "#b41567" },
125
+ "base": { "value": "#e11a81" },
126
+ "lighten-20": { "value": "#e7489a" },
127
+ "lighten-40": { "value": "#ed76b3" },
128
+ "lighten-60": { "value": "#f3a3cd" },
129
+ "lighten-80": { "value": "#f9d1e6" },
130
+ "lighten-90": { "value": "#fce8f2" },
131
+ "lighten-97": { "value": "#fef8fb" }
132
+ },
133
+ "brick": {
134
+ "darken-80": { "value": "#291112" },
135
+ "darken-60": { "value": "#522224" },
136
+ "darken-40": { "value": "#7b3237" },
137
+ "darken-20": { "value": "#a44349" },
138
+ "base": { "value": "#cd545b" },
139
+ "lighten-20": { "value": "#d7767c" },
140
+ "lighten-40": { "value": "#e1989d" },
141
+ "lighten-60": { "value": "#ebbbbd" },
142
+ "lighten-80": { "value": "#f5ddde" },
143
+ "lighten-90": { "value": "#faeeef" },
144
+ "lighten-97": { "value": "#fdfafa" }
145
+ },
146
+ "grey": {
147
+ "darken-80": { "value": "#111212" },
148
+ "darken-60": { "value": "#222324" },
149
+ "darken-40": { "value": "#323535" },
150
+ "darken-20": { "value": "#434647" },
151
+ "base": { "value": "#545859" },
152
+ "lighten-20": { "value": "#76797a" },
153
+ "lighten-40": { "value": "#989b9b" },
154
+ "lighten-60": { "value": "#bbbcbd" },
155
+ "lighten-80": { "value": "#dddede" },
156
+ "lighten-90": { "value": "#eeeeee" },
157
+ "lighten-97": { "value": "#fafafa" }
158
+ },
159
+ "white": {
160
+ "20": { "value": "rgba(255, 255, 255, 0.2000)" },
161
+ "38": { "value": "rgba(255, 255, 255, 0.3800)" },
162
+ "40": { "value": "rgba(255, 255, 255, 0.4000)" },
163
+ "70": { "value": "rgba(255, 255, 255, 0.7000)" },
164
+ "base": { "value": "#ffffff" },
165
+ "08": { "value": "rgba(255, 255, 255, 0.0800)" },
166
+ "00": { "value": "rgba(255, 255, 255, 0.0000)" }
167
+ },
168
+ "none": {
169
+ "value": "rgba(255, 255, 255, 0.0000)"
170
+ },
171
+ "transparent-blue": {
172
+ "18": { "value": "rgba(12, 65, 154, 0.1800)" },
173
+ "08": { "value": "rgba(12, 65, 154, 0.0800)" },
174
+ "00": { "value": "rgba(12, 65, 154, 0.0000)" }
175
+ }
176
+ },
177
+ "values": {
178
+ "0": { "value": 0 },
179
+ "4": { "value": 4 },
180
+ "8": { "value": 8 },
181
+ "12": { "value": 12 },
182
+ "16": { "value": 16 },
183
+ "20": { "value": 20 },
184
+ "24": { "value": 24 },
185
+ "28": { "value": 28 },
186
+ "32": { "value": 32 },
187
+ "36": { "value": 36 },
188
+ "40": { "value": 40 },
189
+ "44": { "value": 44 },
190
+ "48": { "value": 48 },
191
+ "52": { "value": 52 },
192
+ "56": { "value": 56 },
193
+ "60": { "value": 60 },
194
+ "64": { "value": 64 }
195
+ },
196
+ "font-size": {
197
+ "8": { "value": 8 },
198
+ "12": { "value": 12 },
199
+ "14": { "value": 14 },
200
+ "16": { "value": 16 },
201
+ "18": { "value": 18 },
202
+ "20": { "value": 20 },
203
+ "24": { "value": 24 },
204
+ "28": { "value": 28 },
205
+ "30": { "value": 30 },
206
+ "32": { "value": 32 },
207
+ "40": { "value": 40 }
208
+ }
209
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "semantic": {
3
+ "primary": {
4
+ "darker-2": {
5
+ "value": "{Colors.Blue.darken-40}"
6
+ },
7
+ "darker": {
8
+ "value": "{Colors.Blue.darken-20}"
9
+ },
10
+ "base": {
11
+ "value": "{Colors.Blue.base}"
12
+ },
13
+ "light": {
14
+ "value": "{Colors.Blue.lighten-20}"
15
+ },
16
+ "lighter-2": {
17
+ "value": "{Colors.Blue.lighten-60}"
18
+ },
19
+ "lighter-3": {
20
+ "value": "{Colors.Blue.lighten-80}"
21
+ },
22
+ "lighter-4": {
23
+ "value": "{Colors.Blue.lighten-90}"
24
+ },
25
+ "lighter-5": {
26
+ "value": "{Colors.Blue.lighten-97}"
27
+ }
28
+ },
29
+ "neutral": {
30
+ "black": {
31
+ "value": "{Colors.Grey.darken-60}"
32
+ },
33
+ "black-lighter": {
34
+ "value": "{Colors.Grey.base}"
35
+ },
36
+ "black-lighter-2": {
37
+ "value": "{Colors.Grey.lighten-40}"
38
+ },
39
+ "grey": {
40
+ "value": "{Colors.Grey.lighten-80}"
41
+ },
42
+ "white": {
43
+ "value": "{Colors.White.base}"
44
+ },
45
+ "white-alpha": {
46
+ "value": "{Colors.White.70%}"
47
+ },
48
+ "white-alpha-lighter": {
49
+ "value": "{Colors.White.40%}"
50
+ },
51
+ "white-alpha-lighter-2": {
52
+ "value": "{Colors.White.20%}"
53
+ },
54
+ "white-alpha-lighter-3": {
55
+ "value": "{Colors.White.08%}"
56
+ }
57
+ },
58
+ "info": {
59
+ "info-lightest": {
60
+ "value": "{Colors.Blue.lighten-90}"
61
+ },
62
+ "info-lighter": {
63
+ "value": "{Colors.Blue.lighten-80}"
64
+ },
65
+ "default": {
66
+ "value": "{Colors.Blue.base}"
67
+ }
68
+ },
69
+ "success": {
70
+ "lightest": {
71
+ "value": "{Colors.Turquoise.lighten-90}"
72
+ },
73
+ "lighter": {
74
+ "value": "{Colors.Turquoise.lighten-80}"
75
+ },
76
+ "default": {
77
+ "value": "{Colors.Green.base}"
78
+ },
79
+ "darker": {
80
+ "value": "{Colors.Turquoise.darken-60}"
81
+ }
82
+ },
83
+ "warning": {
84
+ "lightest": {
85
+ "value": "{Colors.Yellow.lighten-90}"
86
+ },
87
+ "lighter": {
88
+ "value": "{Colors.Yellow.lighten-80}"
89
+ },
90
+ "default": {
91
+ "value": "{Colors.Yellow.base}"
92
+ },
93
+ "darker": {
94
+ "value": "{Colors.Yellow.darken-60}"
95
+ }
96
+ },
97
+ "danger": {
98
+ "lightest": {
99
+ "value": "{Colors.Orange.lighten-90}"
100
+ },
101
+ "lighter": {
102
+ "value": "{Colors.Orange.lighten-80}"
103
+ },
104
+ "default": {
105
+ "value": "{Colors.Orange.darken-20}"
106
+ }
107
+ },
108
+ "user": {
109
+ "professionnel": {
110
+ "value": "{Colors.Cyan.lighten-40}"
111
+ },
112
+ "assure": {
113
+ "value": "{Colors.Pink.lighten-40}"
114
+ },
115
+ "entreprise": {
116
+ "value": "{Colors.Yellow.base}"
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,11 @@
1
+ type Gaps = {
2
+ [key: string]: string | number
3
+ }
4
+
5
+ export const convertGaps = (gaps: Gaps) => {
6
+ let result = ''
7
+ for (const key in gaps) {
8
+ result += `--ga-${key}: ${gaps[key]} !important; `
9
+ }
10
+ return result
11
+ }
@@ -0,0 +1,32 @@
1
+ // Fonction pour générer les variables à partir des tokens
2
+ type Tokens = {
3
+ colors: {
4
+ [category: string]: {
5
+ [token: string]: string
6
+ }
7
+ }
8
+ }
9
+
10
+ type ThemeVariables = {
11
+ [variableName: string]: string
12
+ }
13
+
14
+ export const generateThemeVariables = (tokens: Tokens): ThemeVariables => {
15
+ const themeVariables: ThemeVariables = {}
16
+
17
+ // Parcourir les catégories de couleurs
18
+ for (const category in tokens.colors) {
19
+ if (Object.prototype.hasOwnProperty.call(tokens.colors, category)) {
20
+ const categoryTokens = tokens.colors[category]
21
+
22
+ // Parcourir les tokens de chaque catégorie
23
+ for (const token in categoryTokens) {
24
+ if (Object.prototype.hasOwnProperty.call(categoryTokens, token)) {
25
+ const variableName = `on${category.charAt(0).toUpperCase() + category.slice(1)}${token.charAt(0).toUpperCase() + token.slice(1)}`
26
+ themeVariables[variableName] = categoryTokens[token]
27
+ }
28
+ }
29
+ }
30
+ }
31
+ return themeVariables
32
+ }
@@ -0,0 +1,19 @@
1
+ type Theme = { [key: string]: string | number | Theme }
2
+
3
+ export const createFlattenTheme = (theme: Theme) => {
4
+ const result: { [key: string]: string | number } = {}
5
+ const flatten = (obj: Theme, prefix = '') => {
6
+ for (const key in obj) {
7
+ const value = obj[key]
8
+ const newKey = prefix ? `${prefix}-${key}` : key
9
+ if (typeof value === 'object' && value !== null) {
10
+ flatten(value as Theme, newKey)
11
+ }
12
+ else {
13
+ result[newKey] = value
14
+ }
15
+ }
16
+ }
17
+ flatten(theme)
18
+ return result
19
+ }
@@ -0,0 +1,4 @@
1
+ import { createFlattenTheme } from './createFlattenTheme'
2
+ import { convertGaps } from './convertGaps'
3
+
4
+ export { createFlattenTheme, convertGaps }
package/src/main.ts ADDED
@@ -0,0 +1,2 @@
1
+ import '../src/assets/tokens.scss'
2
+ export * from './components'
@@ -0,0 +1,27 @@
1
+ import { ref } from 'vue'
2
+ import type { Notification } from '@/components/NotificationBar/types'
3
+
4
+ const notificationQueue = ref<Notification[]>([])
5
+
6
+ export function useNotificationService() {
7
+ const addNotification = (notification: Notification) => {
8
+ if (!notificationQueue.value.some(n => n.id === notification.id)) {
9
+ notificationQueue.value.push(notification)
10
+ }
11
+ }
12
+
13
+ const removeNotification = (id: string) => {
14
+ notificationQueue.value = notificationQueue.value.filter(n => n.id !== id)
15
+ }
16
+
17
+ const clearQueue = () => {
18
+ notificationQueue.value = []
19
+ }
20
+
21
+ return {
22
+ notificationQueue,
23
+ addNotification,
24
+ removeNotification,
25
+ clearQueue,
26
+ }
27
+ }
@@ -0,0 +1,52 @@
1
+ import { Meta, Story } from '@storybook/addon-docs';
2
+ import * as AccessStories from './Accessibilite.stories.ts';
3
+
4
+ <Meta of={AccessStories} />
5
+
6
+ Accessibilité
7
+ =============
8
+
9
+ En tant que personne morale de droit public nous concevons les composants de notre Design System en respectant le Référentiel Général d'Amélioration de l'Accessibilité (RGAA) régit par la Direction Interministérielle du Numérique (DINUM).
10
+
11
+ [](https://digital-design-system.netlify.app/fondamentaux/accessibilite#quest-ce-que-le-referentiel-general-damelioration-de-laccessibilite-rgaa)Qu'est-ce que le Référentiel Général d'Amélioration de l'Accessibilité (RGAA)?
12
+ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
13
+
14
+ Le RGAA est un outil méthodologique de certification permettant d'assurer par le respect de ses critères une manipulation des produits numériques dans le domaine du Web de manière égale entre chaque citoyen, qu'il soit ou non en situation de handicap (visuel, auditif, moteur, trouble dys...). Basé sur les travaux du W3C Web Accessibility Initiative (WAI) il vise à garantir quatre indices de performance:**la bonne perceptibilité de l'information**, une **manipulation efficiente dans la navigation**, une **bonne compréhension** et une **robustesse efficace** dans l'usage des produits numériques.
15
+
16
+ [En savoir plus sur le RGAA](https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu)
17
+
18
+ [En savoir plus sur le W3C WAI](https://www.w3.org/WAI/fundamentals/)
19
+
20
+ [](https://digital-design-system.netlify.app/fondamentaux/accessibilite#quels-sont-les-criteres-du-rgaa)Quels sont les critères du RGAA?
21
+ -----------------------------------------------------------------------------------------------------------------------------------------
22
+
23
+ Actuellement le RGAA (version 4) est constitué de 106 critères répartis dans 13 catégories:(1) Images, (2) Cadres, (3) Couleurs, (4) Multimédia, (5) Tableaux, (6) Liens, (7) Scripts, (8) Éléments obligatoires, (9) Structuration de l'information, (10) Présentation de l'information, (11) Formulaires, (12) Navigation, (13) Consultation. Afin de pouvoir mesurer la complexité à atteindre des critères, il existe 2 niveaux de difficulté:A et AA.
24
+
25
+ [Accéder à la liste des critères du RGAA](https://www.numerique.gouv.fr/publications/rgaa-accessibilite/methode-rgaa/criteres/#contenu)
26
+
27
+ [](https://digital-design-system.netlify.app/fondamentaux/accessibilite#comment-certifier-mon-produit-numerique)Comment certifier mon produit numérique?
28
+ ---------------------------------------------------------------------------------------------------------------------------------------------------------
29
+
30
+ La conduite d'une évaluation pour attester de la conformité du produit numérique avec le RGAA peut être menée par un audit en auto-évaluation ou par un organisme tiers. Au terme de cette évaluation vous recevez un score et des informations complémentaires permettant de définir l'état de conformité de votre produit. Il existe 3 états:
31
+
32
+ - **Conformité totale :** si tous les critères de contrôle du RGAA sont respectés
33
+ - **Conformité partielle :** si au moins 50 % des critères de contrôle du RGAA sont respectés
34
+ - **Non-conformité :** s'il n'existe aucun résultat d'audit en cours de validité permettant de mesurer le respect des critères ou si moins de 50 % des critères de contrôle du RGAA sont respectés
35
+
36
+ Vous garantissant d'un respect de ces critères, l'usage sans modification de notre Design System vous assure d'abord un gain de temps dans le développement mais surtout une augmentation du pourcentage de succès dans l'évaluation de votre produit.
37
+
38
+ [Faire son auto-évaluation](https://www.numerique.gouv.fr/publications/rgaa-accessibilite/kit/#contenu)
39
+
40
+ [](https://digital-design-system.netlify.app/fondamentaux/accessibilite#developpeur-ou-designer-qui-possede-la-bonne-expertise)Développeur ou designer, qui possède la bonne expertise?
41
+ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
42
+
43
+ En amont du recettage, il peut être difficile de déterminer le périmètre d'expertise pour répondre à la diversité des critères. C'est pourquoi, afin d'anticiper au mieux l'évaluation finale, nous fournissons ici un guide facilitant la répartition des tâches de contrôle préventif entre les développeurs et les designers. Certains critères peuvent nécessiter une discussion entre designer et développeur, notamment parce qu'ils impliquent des choix de conception ayant un impact direct dans l'expérience avec les utilisateurs.
44
+
45
+ Le tableau ci-dessous liste nos recommandations suivant les catégories du RGAA (version 4).
46
+
47
+ <Story of={AccessStories.AccessibilitePanel} />
48
+
49
+ [](https://digital-design-system.netlify.app/fondamentaux/accessibilite#aller-plus-loin-que-les-criteres-rgaa)Aller plus loin que les critères RGAA
50
+ ---------------------------------------------------------------------------------------------------------------------------------------------------
51
+
52
+ Au-delà des critères RGAA qui sont fondamentaux pour assurer l'accessibilité à tous, nous mettons en œuvre nos savoir-faire pour proposer des composants respectant des recommandations scientifiques pour garantir le plus largement possible un design efficient. Nous nous appuyons sur un large spectre d'études publiées dans les domaines de l'IHM ([CHI](https://chi2021.acm.org/), [CSCW](https://cscw.acm.org/2022/), [DIS](https://dis.acm.org/2021/), [IEEE](https://ieeexplore.ieee.org/xpl/RecentIssue.jsp?punumber=2945)) pour fournir un Design System efficace au plus grand nombre.
@@ -0,0 +1,36 @@
1
+ import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable } from 'vuetify/components'
2
+ import type { StoryObj } from '@storybook/vue3'
3
+ import { AccessibiliteItems } from './AccessibiliteItems'
4
+
5
+ export default {
6
+ title: 'Fondamentaux/Accessibilite',
7
+ }
8
+
9
+ export const AccessibilitePanel: StoryObj = {
10
+ render: () => {
11
+ return {
12
+ components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable },
13
+ setup() {
14
+ return { AccessibiliteItems }
15
+ },
16
+ template: `
17
+ <v-expansion-panels>
18
+ <v-expansion-panel
19
+ v-for="(item, index) in AccessibiliteItems"
20
+ :key="index"
21
+ >
22
+ <v-expansion-panel-title>{{ item.title }}</v-expansion-panel-title>
23
+ <v-expansion-panel-text>
24
+ <v-data-table
25
+ :items="item.items"
26
+ disable-pagination
27
+ hide-default-footer
28
+ />
29
+ </v-expansion-panel-text>
30
+ </v-expansion-panel>
31
+ </v-expansion-panels>
32
+ `,
33
+ }
34
+ },
35
+ tags: ['!dev'],
36
+ }