@alveole/theme 1.9.0 → 2.0.0-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.
- package/README.md +15 -15
- package/dist/WebThemeStyles.web.d.ts.map +1 -1
- package/dist/WebThemeStyles.web.js +4 -6
- package/dist/constants/Color.d.ts +0 -116
- package/dist/constants/Color.d.ts.map +1 -1
- package/dist/constants/Color.js +0 -116
- package/dist/constants/Control.d.ts +105 -0
- package/dist/constants/Control.d.ts.map +1 -0
- package/dist/constants/Control.js +28 -0
- package/dist/constants/Elevation.d.ts +8 -8
- package/dist/constants/Elevation.d.ts.map +1 -1
- package/dist/constants/Focus.d.ts +72 -0
- package/dist/constants/Focus.d.ts.map +1 -0
- package/dist/constants/Focus.js +79 -0
- package/dist/constants/FocusProps.d.ts +22 -0
- package/dist/constants/FocusProps.d.ts.map +1 -0
- package/dist/constants/FocusProps.js +15 -0
- package/dist/constants/Font.d.ts +13 -8
- package/dist/constants/Font.d.ts.map +1 -1
- package/dist/constants/Font.js +27 -27
- package/dist/constants/Grille.d.ts +9 -1
- package/dist/constants/Grille.d.ts.map +1 -1
- package/dist/constants/Grille.js +9 -1
- package/dist/constants/Link.d.ts +8 -0
- package/dist/constants/Link.d.ts.map +1 -0
- package/dist/constants/Link.js +8 -0
- package/dist/constants/LinkProps.d.ts +10 -0
- package/dist/constants/LinkProps.d.ts.map +1 -0
- package/dist/constants/LinkProps.js +9 -0
- package/dist/constants/Palette.d.ts +2 -10
- package/dist/constants/Palette.d.ts.map +1 -1
- package/dist/constants/Palette.js +2 -10
- package/dist/constants/Pill.d.ts +41 -0
- package/dist/constants/Pill.d.ts.map +1 -0
- package/dist/constants/Pill.js +26 -0
- package/dist/constants/Radius.d.ts +1 -1
- package/dist/constants/Radius.d.ts.map +1 -1
- package/dist/constants/Spacing.d.ts +4 -4
- package/dist/constants/Spacing.d.ts.map +1 -1
- package/dist/constants/Spacing.js +4 -4
- package/dist/constants/Typography.d.ts +25 -1
- package/dist/constants/Typography.d.ts.map +1 -1
- package/dist/constants/Typography.js +53 -29
- package/dist/constants/dataSetAttribute.d.ts +6 -0
- package/dist/constants/dataSetAttribute.d.ts.map +1 -0
- package/dist/constants/dataSetAttribute.js +5 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +4 -0
- package/dist/default.css +76 -176
- package/dist/helpers/alphaColor.d.ts.map +1 -1
- package/dist/helpers/alphaColor.js +2 -11
- package/dist/helpers/contrastColor.d.ts +12 -0
- package/dist/helpers/contrastColor.d.ts.map +1 -0
- package/dist/helpers/contrastColor.js +51 -0
- package/dist/helpers/cssVarPalette.d.ts +14 -0
- package/dist/helpers/cssVarPalette.d.ts.map +1 -0
- package/dist/helpers/cssVarPalette.js +9 -0
- package/dist/helpers/cssVarTypography.d.ts +12 -0
- package/dist/helpers/cssVarTypography.d.ts.map +1 -0
- package/dist/helpers/cssVarTypography.js +33 -0
- package/dist/helpers/darkenColor.d.ts.map +1 -1
- package/dist/helpers/darkenColor.js +5 -12
- package/dist/helpers/deepMerge.d.ts +12 -2
- package/dist/helpers/deepMerge.d.ts.map +1 -1
- package/dist/helpers/deepMerge.js +24 -14
- package/dist/helpers/elevationStyle.d.ts +1 -1
- package/dist/helpers/focusRingCSS.d.ts +15 -0
- package/dist/helpers/focusRingCSS.d.ts.map +1 -0
- package/dist/helpers/focusRingCSS.js +26 -0
- package/dist/helpers/hexToRgb.d.ts +6 -0
- package/dist/helpers/hexToRgb.d.ts.map +1 -0
- package/dist/helpers/hexToRgb.js +13 -0
- package/dist/helpers/injectVariableCSS.d.ts +14 -4
- package/dist/helpers/injectVariableCSS.d.ts.map +1 -1
- package/dist/helpers/injectVariableCSS.js +19 -42
- package/dist/helpers/isRecord.d.ts +3 -0
- package/dist/helpers/isRecord.d.ts.map +1 -0
- package/dist/helpers/isRecord.js +2 -0
- package/dist/helpers/linkCSS.d.ts +2 -0
- package/dist/helpers/linkCSS.d.ts.map +1 -0
- package/dist/helpers/linkCSS.js +2 -0
- package/dist/helpers/mapValues.d.ts +15 -0
- package/dist/helpers/mapValues.d.ts.map +1 -0
- package/dist/helpers/mapValues.js +11 -0
- package/dist/helpers/removeUnsupportedCSSProperties.d.ts.map +1 -1
- package/dist/helpers/removeUnsupportedCSSProperties.js +6 -10
- package/dist/helpers/typographyVariables.d.ts +22 -0
- package/dist/helpers/typographyVariables.d.ts.map +1 -0
- package/dist/helpers/typographyVariables.js +49 -0
- package/dist/helpers/useThemeBuilder.d.ts.map +1 -1
- package/dist/helpers/useThemeBuilder.js +10 -46
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/type/Theme.d.ts +4 -0
- package/dist/type/Theme.d.ts.map +1 -1
- package/package.json +12 -12
package/dist/default.css
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=
|
|
2
|
-
|
|
3
|
-
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&display=swap');
|
|
4
2
|
|
|
5
3
|
:root {
|
|
6
4
|
--color-VertPrairie-50: #F3FDE7;
|
|
@@ -18,17 +16,6 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
18
16
|
--color-VertPrairie-main-646: #60BB46;
|
|
19
17
|
--color-VertPrairie-sun-475: #3E7F2E;
|
|
20
18
|
--color-VertPrairie-sun-475-hover: #28571D;
|
|
21
|
-
--color-Mandarine-50: #FEF9EE;
|
|
22
|
-
--color-Mandarine-100: #FDF2D7;
|
|
23
|
-
--color-Mandarine-200: #FBE0AD;
|
|
24
|
-
--color-Mandarine-300: #F8C979;
|
|
25
|
-
--color-Mandarine-400: #F4A843;
|
|
26
|
-
--color-Mandarine-500: #F19023;
|
|
27
|
-
--color-Mandarine-600: #E27414;
|
|
28
|
-
--color-Mandarine-700: #BB5813;
|
|
29
|
-
--color-Mandarine-800: #954517;
|
|
30
|
-
--color-Mandarine-900: #783B16;
|
|
31
|
-
--color-Mandarine-950: #411C09;
|
|
32
19
|
--color-Lilas-50: #F6F5FD;
|
|
33
20
|
--color-Lilas-100: #EFECFB;
|
|
34
21
|
--color-Lilas-200: #E0DCF8;
|
|
@@ -40,17 +27,6 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
40
27
|
--color-Lilas-800: #5D36A1;
|
|
41
28
|
--color-Lilas-900: #4E2E84;
|
|
42
29
|
--color-Lilas-950: #301C59;
|
|
43
|
-
--color-Shakespeare-50: #EEFBFD;
|
|
44
|
-
--color-Shakespeare-100: #D3F3FA;
|
|
45
|
-
--color-Shakespeare-200: #ADE6F4;
|
|
46
|
-
--color-Shakespeare-300: #75D3EB;
|
|
47
|
-
--color-Shakespeare-400: #31B5DA;
|
|
48
|
-
--color-Shakespeare-500: #1999C1;
|
|
49
|
-
--color-Shakespeare-600: #187BA2;
|
|
50
|
-
--color-Shakespeare-700: #1A6484;
|
|
51
|
-
--color-Shakespeare-800: #1E526C;
|
|
52
|
-
--color-Shakespeare-900: #1D465C;
|
|
53
|
-
--color-Shakespeare-950: #0E2D3E;
|
|
54
30
|
--color-Cerise-50: #FDF2F8;
|
|
55
31
|
--color-Cerise-100: #FCE7F3;
|
|
56
32
|
--color-Cerise-200: #FBCFE8;
|
|
@@ -62,17 +38,6 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
62
38
|
--color-Cerise-800: #9E164E;
|
|
63
39
|
--color-Cerise-900: #841744;
|
|
64
40
|
--color-Cerise-950: #510624;
|
|
65
|
-
--color-Pacifika-50: #FFFDE4;
|
|
66
|
-
--color-Pacifika-100: #FFFDC5;
|
|
67
|
-
--color-Pacifika-200: #FFFF92;
|
|
68
|
-
--color-Pacifika-300: #F9FF53;
|
|
69
|
-
--color-Pacifika-400: #EEFB20;
|
|
70
|
-
--color-Pacifika-500: #D1E200;
|
|
71
|
-
--color-Pacifika-600: #A2B500;
|
|
72
|
-
--color-Pacifika-700: #738102;
|
|
73
|
-
--color-Pacifika-800: #5F6B09;
|
|
74
|
-
--color-Pacifika-900: #505A0D;
|
|
75
|
-
--color-Pacifika-950: #2A3300;
|
|
76
41
|
--color-GoldenFizz-50: #FFFEE5;
|
|
77
42
|
--color-GoldenFizz-100: #FEFFC7;
|
|
78
43
|
--color-GoldenFizz-200: #FCFF95;
|
|
@@ -95,50 +60,6 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
95
60
|
--color-GrisPolaire-800: #4B5282;
|
|
96
61
|
--color-GrisPolaire-900: #404668;
|
|
97
62
|
--color-GrisPolaire-950: #2A2D41;
|
|
98
|
-
--color-ButteryWhite-50: #FFFBEA;
|
|
99
|
-
--color-ButteryWhite-100: #FEF4C7;
|
|
100
|
-
--color-ButteryWhite-200: #FDE78A;
|
|
101
|
-
--color-ButteryWhite-300: #FCD54D;
|
|
102
|
-
--color-ButteryWhite-400: #FBC124;
|
|
103
|
-
--color-ButteryWhite-500: #F5A00B;
|
|
104
|
-
--color-ButteryWhite-600: #D97906;
|
|
105
|
-
--color-ButteryWhite-700: #B45509;
|
|
106
|
-
--color-ButteryWhite-800: #92410E;
|
|
107
|
-
--color-ButteryWhite-900: #78360F;
|
|
108
|
-
--color-ButteryWhite-950: #451B03;
|
|
109
|
-
--color-CoralRed-50: #FEF2F2;
|
|
110
|
-
--color-CoralRed-100: #FEE2E2;
|
|
111
|
-
--color-CoralRed-200: #FECACA;
|
|
112
|
-
--color-CoralRed-300: #FCA5A5;
|
|
113
|
-
--color-CoralRed-400: #F77272;
|
|
114
|
-
--color-CoralRed-500: #EF4E4E;
|
|
115
|
-
--color-CoralRed-600: #DB2727;
|
|
116
|
-
--color-CoralRed-700: #B81D1D;
|
|
117
|
-
--color-CoralRed-800: #981C1C;
|
|
118
|
-
--color-CoralRed-900: #7F1D1D;
|
|
119
|
-
--color-CoralRed-950: #450A0A;
|
|
120
|
-
--color-Lochmara-50: #F1F8FE;
|
|
121
|
-
--color-Lochmara-100: #E2F1FC;
|
|
122
|
-
--color-Lochmara-200: #BFE2F8;
|
|
123
|
-
--color-Lochmara-300: #87CCF2;
|
|
124
|
-
--color-Lochmara-400: #47B0E9;
|
|
125
|
-
--color-Lochmara-500: #1F97D8;
|
|
126
|
-
--color-Lochmara-600: #1177B6;
|
|
127
|
-
--color-Lochmara-700: #0F5F95;
|
|
128
|
-
--color-Lochmara-800: #11527B;
|
|
129
|
-
--color-Lochmara-900: #144566;
|
|
130
|
-
--color-Lochmara-950: #0D2C44;
|
|
131
|
-
--color-BigStone-50: #F2F8FD;
|
|
132
|
-
--color-BigStone-100: #E4EFFA;
|
|
133
|
-
--color-BigStone-200: #C2DFF5;
|
|
134
|
-
--color-BigStone-300: #8CC5ED;
|
|
135
|
-
--color-BigStone-400: #4EA7E2;
|
|
136
|
-
--color-BigStone-500: #288CCF;
|
|
137
|
-
--color-BigStone-600: #196FB0;
|
|
138
|
-
--color-BigStone-700: #16598E;
|
|
139
|
-
--color-BigStone-800: #164C76;
|
|
140
|
-
--color-BigStone-900: #174063;
|
|
141
|
-
--color-BigStone-950: #102A43;
|
|
142
63
|
--color-PinkVivid-50: #FFF5F8;
|
|
143
64
|
--color-PinkVivid-100: #FFB8D2;
|
|
144
65
|
--color-PinkVivid-200: #FF8CBA;
|
|
@@ -149,27 +70,6 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
149
70
|
--color-PinkVivid-700: #A30664;
|
|
150
71
|
--color-PinkVivid-800: #870557;
|
|
151
72
|
--color-PinkVivid-900: #620042;
|
|
152
|
-
--color-LimeGreen-50: #F6FCE9;
|
|
153
|
-
--color-LimeGreen-100: #EAF7D0;
|
|
154
|
-
--color-LimeGreen-200: #D7F0A6;
|
|
155
|
-
--color-LimeGreen-300: #BBE472;
|
|
156
|
-
--color-LimeGreen-400: #A1D447;
|
|
157
|
-
--color-LimeGreen-500: #7BB026;
|
|
158
|
-
--color-LimeGreen-600: #7BB026;
|
|
159
|
-
--color-LimeGreen-700: #4D711A;
|
|
160
|
-
--color-LimeGreen-800: #3F5A1A;
|
|
161
|
-
--color-LimeGreen-900: #374D1A;
|
|
162
|
-
--color-LimeGreen-950: #1A2A09;
|
|
163
|
-
--color-Purple-50: #EAE2F8;
|
|
164
|
-
--color-Purple-100: #CFBCF2;
|
|
165
|
-
--color-Purple-200: #A081D9;
|
|
166
|
-
--color-Purple-300: #8662C7;
|
|
167
|
-
--color-Purple-400: #724BB7;
|
|
168
|
-
--color-Purple-500: #653CAD;
|
|
169
|
-
--color-Purple-600: #51279B;
|
|
170
|
-
--color-Purple-700: #421987;
|
|
171
|
-
--color-Purple-800: #34126F;
|
|
172
|
-
--color-Purple-900: #240754;
|
|
173
73
|
--color-Focus-525: #0A76F6;
|
|
174
74
|
--color-OrangeWarning-425: #BC4401;
|
|
175
75
|
--color-OrangeWarning-625: #F96B24;
|
|
@@ -389,137 +289,129 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
389
289
|
--elevation-raised: 0 2px 6px 0 rgba(1, 43, 83, 0.16);
|
|
390
290
|
--elevation-overlap: 0 4px 12px 0 rgba(1, 43, 83, 0.16);
|
|
391
291
|
--elevation-lifted: 0 6px 18px 0 rgba(1, 43, 83, 0.16);
|
|
392
|
-
--font-
|
|
393
|
-
--font-
|
|
394
|
-
--font-
|
|
395
|
-
--font-
|
|
396
|
-
--font-
|
|
397
|
-
--font-
|
|
398
|
-
--font-
|
|
399
|
-
--font-
|
|
400
|
-
--
|
|
401
|
-
--
|
|
402
|
-
--font-Inter-Regular-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
403
|
-
--font-Inter-Regular-weight: 400;
|
|
404
|
-
--font-Inter-Medium-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
405
|
-
--font-Inter-Medium-weight: 500;
|
|
406
|
-
--font-Inter-Bold-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
407
|
-
--font-Inter-Bold-weight: 600;
|
|
408
|
-
--typography-titres-alternatifs-xs-font-family: var(--font-Barlow-Bold-family);
|
|
409
|
-
--typography-titres-alternatifs-xs-font-weight: var(--font-Barlow-Bold-weight);
|
|
292
|
+
--font-Geist-Light-family: Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
293
|
+
--font-Geist-Light-weight: 300;
|
|
294
|
+
--font-Geist-Regular-family: Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
295
|
+
--font-Geist-Regular-weight: 400;
|
|
296
|
+
--font-Geist-Medium-family: Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
297
|
+
--font-Geist-Medium-weight: 500;
|
|
298
|
+
--font-Geist-Bold-family: Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
|
|
299
|
+
--font-Geist-Bold-weight: 600;
|
|
300
|
+
--typography-titres-alternatifs-xs-font-family: var(--font-Geist-Bold-family);
|
|
301
|
+
--typography-titres-alternatifs-xs-font-weight: var(--font-Geist-Bold-weight);
|
|
410
302
|
--typography-titres-alternatifs-xs-font-size: 48px;
|
|
411
303
|
--typography-titres-alternatifs-xs-line-height: 56px;
|
|
412
|
-
--typography-titres-alternatifs-sm-font-family: var(--font-
|
|
413
|
-
--typography-titres-alternatifs-sm-font-weight: var(--font-
|
|
304
|
+
--typography-titres-alternatifs-sm-font-family: var(--font-Geist-Bold-family);
|
|
305
|
+
--typography-titres-alternatifs-sm-font-weight: var(--font-Geist-Bold-weight);
|
|
414
306
|
--typography-titres-alternatifs-sm-font-size: 56px;
|
|
415
307
|
--typography-titres-alternatifs-sm-line-height: 64px;
|
|
416
|
-
--typography-titres-alternatifs-md-font-family: var(--font-
|
|
417
|
-
--typography-titres-alternatifs-md-font-weight: var(--font-
|
|
308
|
+
--typography-titres-alternatifs-md-font-family: var(--font-Geist-Bold-family);
|
|
309
|
+
--typography-titres-alternatifs-md-font-weight: var(--font-Geist-Bold-weight);
|
|
418
310
|
--typography-titres-alternatifs-md-font-size: 64px;
|
|
419
311
|
--typography-titres-alternatifs-md-line-height: 72px;
|
|
420
|
-
--typography-titres-alternatifs-lg-font-family: var(--font-
|
|
421
|
-
--typography-titres-alternatifs-lg-font-weight: var(--font-
|
|
312
|
+
--typography-titres-alternatifs-lg-font-family: var(--font-Geist-Bold-family);
|
|
313
|
+
--typography-titres-alternatifs-lg-font-weight: var(--font-Geist-Bold-weight);
|
|
422
314
|
--typography-titres-alternatifs-lg-font-size: 72px;
|
|
423
315
|
--typography-titres-alternatifs-lg-line-height: 80px;
|
|
424
|
-
--typography-titres-alternatifs-xl-font-family: var(--font-
|
|
425
|
-
--typography-titres-alternatifs-xl-font-weight: var(--font-
|
|
316
|
+
--typography-titres-alternatifs-xl-font-family: var(--font-Geist-Bold-family);
|
|
317
|
+
--typography-titres-alternatifs-xl-font-weight: var(--font-Geist-Bold-weight);
|
|
426
318
|
--typography-titres-alternatifs-xl-font-size: 80px;
|
|
427
319
|
--typography-titres-alternatifs-xl-line-height: 88px;
|
|
428
|
-
--typography-titres-h6-xxs-font-family: var(--font-
|
|
429
|
-
--typography-titres-h6-xxs-font-weight: var(--font-
|
|
320
|
+
--typography-titres-h6-xxs-font-family: var(--font-Geist-Bold-family);
|
|
321
|
+
--typography-titres-h6-xxs-font-weight: var(--font-Geist-Bold-weight);
|
|
430
322
|
--typography-titres-h6-xxs-font-size: 20px;
|
|
431
323
|
--typography-titres-h6-xxs-line-height: 28px;
|
|
432
|
-
--typography-titres-h5-xs-font-family: var(--font-
|
|
433
|
-
--typography-titres-h5-xs-font-weight: var(--font-
|
|
324
|
+
--typography-titres-h5-xs-font-family: var(--font-Geist-Bold-family);
|
|
325
|
+
--typography-titres-h5-xs-font-weight: var(--font-Geist-Bold-weight);
|
|
434
326
|
--typography-titres-h5-xs-font-size: 22px;
|
|
435
327
|
--typography-titres-h5-xs-line-height: 28px;
|
|
436
|
-
--typography-titres-h4-sm-font-family: var(--font-
|
|
437
|
-
--typography-titres-h4-sm-font-weight: var(--font-
|
|
328
|
+
--typography-titres-h4-sm-font-family: var(--font-Geist-Bold-family);
|
|
329
|
+
--typography-titres-h4-sm-font-weight: var(--font-Geist-Bold-weight);
|
|
438
330
|
--typography-titres-h4-sm-font-size: 24px;
|
|
439
331
|
--typography-titres-h4-sm-line-height: 32px;
|
|
440
|
-
--typography-titres-h3-md-font-family: var(--font-
|
|
441
|
-
--typography-titres-h3-md-font-weight: var(--font-
|
|
332
|
+
--typography-titres-h3-md-font-family: var(--font-Geist-Bold-family);
|
|
333
|
+
--typography-titres-h3-md-font-weight: var(--font-Geist-Bold-weight);
|
|
442
334
|
--typography-titres-h3-md-font-size: 28px;
|
|
443
335
|
--typography-titres-h3-md-line-height: 36px;
|
|
444
|
-
--typography-titres-h2-lg-font-family: var(--font-
|
|
445
|
-
--typography-titres-h2-lg-font-weight: var(--font-
|
|
336
|
+
--typography-titres-h2-lg-font-family: var(--font-Geist-Bold-family);
|
|
337
|
+
--typography-titres-h2-lg-font-weight: var(--font-Geist-Bold-weight);
|
|
446
338
|
--typography-titres-h2-lg-font-size: 32px;
|
|
447
339
|
--typography-titres-h2-lg-line-height: 36px;
|
|
448
|
-
--typography-titres-h1-xl-font-family: var(--font-
|
|
449
|
-
--typography-titres-h1-xl-font-weight: var(--font-
|
|
340
|
+
--typography-titres-h1-xl-font-family: var(--font-Geist-Bold-family);
|
|
341
|
+
--typography-titres-h1-xl-font-weight: var(--font-Geist-Bold-weight);
|
|
450
342
|
--typography-titres-h1-xl-font-size: 40px;
|
|
451
343
|
--typography-titres-h1-xl-line-height: 48px;
|
|
452
|
-
--typography-corps-de-texte-xs-regular-font-family: var(--font-
|
|
453
|
-
--typography-corps-de-texte-xs-regular-font-weight: var(--font-
|
|
344
|
+
--typography-corps-de-texte-xs-regular-font-family: var(--font-Geist-Regular-family);
|
|
345
|
+
--typography-corps-de-texte-xs-regular-font-weight: var(--font-Geist-Regular-weight);
|
|
454
346
|
--typography-corps-de-texte-xs-regular-font-size: 12px;
|
|
455
347
|
--typography-corps-de-texte-xs-regular-line-height: 20px;
|
|
456
|
-
--typography-corps-de-texte-xs-bold-font-family: var(--font-
|
|
457
|
-
--typography-corps-de-texte-xs-bold-font-weight: var(--font-
|
|
348
|
+
--typography-corps-de-texte-xs-bold-font-family: var(--font-Geist-Bold-family);
|
|
349
|
+
--typography-corps-de-texte-xs-bold-font-weight: var(--font-Geist-Bold-weight);
|
|
458
350
|
--typography-corps-de-texte-xs-bold-font-size: 12px;
|
|
459
351
|
--typography-corps-de-texte-xs-bold-line-height: 20px;
|
|
460
|
-
--typography-corps-de-texte-xs-caps-font-family: var(--font-
|
|
461
|
-
--typography-corps-de-texte-xs-caps-font-weight: var(--font-
|
|
352
|
+
--typography-corps-de-texte-xs-caps-font-family: var(--font-Geist-Regular-family);
|
|
353
|
+
--typography-corps-de-texte-xs-caps-font-weight: var(--font-Geist-Regular-weight);
|
|
462
354
|
--typography-corps-de-texte-xs-caps-font-size: 12px;
|
|
463
355
|
--typography-corps-de-texte-xs-caps-line-height: 20px;
|
|
464
356
|
--typography-corps-de-texte-xs-caps-text-transform: uppercase;
|
|
465
|
-
--typography-corps-de-texte-xs-capsbold-font-family: var(--font-
|
|
466
|
-
--typography-corps-de-texte-xs-capsbold-font-weight: var(--font-
|
|
357
|
+
--typography-corps-de-texte-xs-capsbold-font-family: var(--font-Geist-Bold-family);
|
|
358
|
+
--typography-corps-de-texte-xs-capsbold-font-weight: var(--font-Geist-Bold-weight);
|
|
467
359
|
--typography-corps-de-texte-xs-capsbold-font-size: 12px;
|
|
468
360
|
--typography-corps-de-texte-xs-capsbold-line-height: 20px;
|
|
469
361
|
--typography-corps-de-texte-xs-capsbold-text-transform: uppercase;
|
|
470
|
-
--typography-corps-de-texte-xs-semibold-font-family: var(--font-
|
|
471
|
-
--typography-corps-de-texte-xs-semibold-font-weight: var(--font-
|
|
362
|
+
--typography-corps-de-texte-xs-semibold-font-family: var(--font-Geist-Bold-family);
|
|
363
|
+
--typography-corps-de-texte-xs-semibold-font-weight: var(--font-Geist-Bold-weight);
|
|
472
364
|
--typography-corps-de-texte-xs-semibold-font-size: 12px;
|
|
473
365
|
--typography-corps-de-texte-xs-semibold-line-height: 20px;
|
|
474
|
-
--typography-corps-de-texte-sm-regular-font-family: var(--font-
|
|
475
|
-
--typography-corps-de-texte-sm-regular-font-weight: var(--font-
|
|
366
|
+
--typography-corps-de-texte-sm-regular-font-family: var(--font-Geist-Regular-family);
|
|
367
|
+
--typography-corps-de-texte-sm-regular-font-weight: var(--font-Geist-Regular-weight);
|
|
476
368
|
--typography-corps-de-texte-sm-regular-font-size: 14px;
|
|
477
369
|
--typography-corps-de-texte-sm-regular-line-height: 20px;
|
|
478
|
-
--typography-corps-de-texte-sm-medium-font-family: var(--font-
|
|
479
|
-
--typography-corps-de-texte-sm-medium-font-weight: var(--font-
|
|
370
|
+
--typography-corps-de-texte-sm-medium-font-family: var(--font-Geist-Medium-family);
|
|
371
|
+
--typography-corps-de-texte-sm-medium-font-weight: var(--font-Geist-Medium-weight);
|
|
480
372
|
--typography-corps-de-texte-sm-medium-font-size: 14px;
|
|
481
373
|
--typography-corps-de-texte-sm-medium-line-height: 20px;
|
|
482
|
-
--typography-corps-de-texte-sm-semibold-font-family: var(--font-
|
|
483
|
-
--typography-corps-de-texte-sm-semibold-font-weight: var(--font-
|
|
374
|
+
--typography-corps-de-texte-sm-semibold-font-family: var(--font-Geist-Bold-family);
|
|
375
|
+
--typography-corps-de-texte-sm-semibold-font-weight: var(--font-Geist-Bold-weight);
|
|
484
376
|
--typography-corps-de-texte-sm-semibold-font-size: 14px;
|
|
485
377
|
--typography-corps-de-texte-sm-semibold-line-height: 20px;
|
|
486
|
-
--typography-corps-de-texte-sm-bold-font-family: var(--font-
|
|
487
|
-
--typography-corps-de-texte-sm-bold-font-weight: var(--font-
|
|
378
|
+
--typography-corps-de-texte-sm-bold-font-family: var(--font-Geist-Bold-family);
|
|
379
|
+
--typography-corps-de-texte-sm-bold-font-weight: var(--font-Geist-Bold-weight);
|
|
488
380
|
--typography-corps-de-texte-sm-bold-font-size: 14px;
|
|
489
381
|
--typography-corps-de-texte-sm-bold-line-height: 20px;
|
|
490
|
-
--typography-corps-de-texte-sm-capsbold-font-family: var(--font-
|
|
491
|
-
--typography-corps-de-texte-sm-capsbold-font-weight: var(--font-
|
|
382
|
+
--typography-corps-de-texte-sm-capsbold-font-family: var(--font-Geist-Bold-family);
|
|
383
|
+
--typography-corps-de-texte-sm-capsbold-font-weight: var(--font-Geist-Bold-weight);
|
|
492
384
|
--typography-corps-de-texte-sm-capsbold-font-size: 14px;
|
|
493
385
|
--typography-corps-de-texte-sm-capsbold-line-height: 20px;
|
|
494
386
|
--typography-corps-de-texte-sm-capsbold-text-transform: uppercase;
|
|
495
|
-
--typography-corps-de-texte-md-regular-font-family: var(--font-
|
|
496
|
-
--typography-corps-de-texte-md-regular-font-weight: var(--font-
|
|
387
|
+
--typography-corps-de-texte-md-regular-font-family: var(--font-Geist-Regular-family);
|
|
388
|
+
--typography-corps-de-texte-md-regular-font-weight: var(--font-Geist-Regular-weight);
|
|
497
389
|
--typography-corps-de-texte-md-regular-font-size: 16px;
|
|
498
390
|
--typography-corps-de-texte-md-regular-line-height: 24px;
|
|
499
|
-
--typography-corps-de-texte-md-medium-font-family: var(--font-
|
|
500
|
-
--typography-corps-de-texte-md-medium-font-weight: var(--font-
|
|
391
|
+
--typography-corps-de-texte-md-medium-font-family: var(--font-Geist-Medium-family);
|
|
392
|
+
--typography-corps-de-texte-md-medium-font-weight: var(--font-Geist-Medium-weight);
|
|
501
393
|
--typography-corps-de-texte-md-medium-font-size: 16px;
|
|
502
394
|
--typography-corps-de-texte-md-medium-line-height: 24px;
|
|
503
|
-
--typography-corps-de-texte-md-semibold-font-family: var(--font-
|
|
504
|
-
--typography-corps-de-texte-md-semibold-font-weight: var(--font-
|
|
395
|
+
--typography-corps-de-texte-md-semibold-font-family: var(--font-Geist-Bold-family);
|
|
396
|
+
--typography-corps-de-texte-md-semibold-font-weight: var(--font-Geist-Bold-weight);
|
|
505
397
|
--typography-corps-de-texte-md-semibold-font-size: 16px;
|
|
506
398
|
--typography-corps-de-texte-md-semibold-line-height: 24px;
|
|
507
|
-
--typography-corps-de-texte-md-bold-font-family: var(--font-
|
|
508
|
-
--typography-corps-de-texte-md-bold-font-weight: var(--font-
|
|
399
|
+
--typography-corps-de-texte-md-bold-font-family: var(--font-Geist-Bold-family);
|
|
400
|
+
--typography-corps-de-texte-md-bold-font-weight: var(--font-Geist-Bold-weight);
|
|
509
401
|
--typography-corps-de-texte-md-bold-font-size: 16px;
|
|
510
402
|
--typography-corps-de-texte-md-bold-line-height: 24px;
|
|
511
|
-
--typography-corps-de-texte-lg-regular-font-family: var(--font-
|
|
512
|
-
--typography-corps-de-texte-lg-regular-font-weight: var(--font-
|
|
403
|
+
--typography-corps-de-texte-lg-regular-font-family: var(--font-Geist-Regular-family);
|
|
404
|
+
--typography-corps-de-texte-lg-regular-font-weight: var(--font-Geist-Regular-weight);
|
|
513
405
|
--typography-corps-de-texte-lg-regular-font-size: 18px;
|
|
514
406
|
--typography-corps-de-texte-lg-regular-line-height: 28px;
|
|
515
|
-
--typography-corps-de-texte-lg-medium-font-family: var(--font-
|
|
516
|
-
--typography-corps-de-texte-lg-medium-font-weight: var(--font-
|
|
407
|
+
--typography-corps-de-texte-lg-medium-font-family: var(--font-Geist-Medium-family);
|
|
408
|
+
--typography-corps-de-texte-lg-medium-font-weight: var(--font-Geist-Medium-weight);
|
|
517
409
|
--typography-corps-de-texte-lg-medium-font-size: 18px;
|
|
518
410
|
--typography-corps-de-texte-lg-medium-line-height: 28px;
|
|
519
|
-
--typography-corps-de-texte-lg-
|
|
520
|
-
--typography-corps-de-texte-lg-
|
|
521
|
-
--typography-corps-de-texte-lg-
|
|
522
|
-
--typography-corps-de-texte-lg-
|
|
411
|
+
--typography-corps-de-texte-lg-bold-font-family: var(--font-Geist-Bold-family);
|
|
412
|
+
--typography-corps-de-texte-lg-bold-font-weight: var(--font-Geist-Bold-weight);
|
|
413
|
+
--typography-corps-de-texte-lg-bold-font-size: 18px;
|
|
414
|
+
--typography-corps-de-texte-lg-bold-line-height: 28px;
|
|
523
415
|
--artwork-major-primary: var(--color-BleuCaptive-200);
|
|
524
416
|
--artwork-decorative-primary: var(--color-BleuCaptive-950);
|
|
525
417
|
--artwork-minor-secondary: var(--color-Cerise-600);
|
|
@@ -581,4 +473,12 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
|
581
473
|
--text-default-warning: var(--color-OrangeWarning-425);
|
|
582
474
|
--text-default-info: var(--color-BleuCaptive-425);
|
|
583
475
|
--system-focus: var(--color-Focus-525);
|
|
584
|
-
|
|
476
|
+
--illustration-color-sun-default-yellow: var(--color-Ocre-sun-403);
|
|
477
|
+
--illustration-color-950-default-yellow: var(--color-Ocre-950);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
[data-alveole-focus]:focus-visible { outline: 2px solid #0A76F6 !important; outline-offset: 2px !important; }
|
|
481
|
+
[data-alveole-focus]:focus:not(:focus-visible) { outline: none !important; }
|
|
482
|
+
[data-alveole-focus='inset']:focus-visible { outline-offset: -2px !important; }
|
|
483
|
+
|
|
484
|
+
[data-alveole-link] { text-underline-offset: 0.2em; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaColor.d.ts","sourceRoot":"","sources":["../../src/helpers/alphaColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"alphaColor.d.ts","sourceRoot":"","sources":["../../src/helpers/alphaColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,KAAK,YAAY,GAAG,MAAM,CAAC;AAE3B,eAAO,MAAM,KAAK,GAAI,kBAAkB,KAAK,EAAE,SAAS,YAAY,KAAG,MAMtE,CAAC"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
+
import { hexToRgb } from './hexToRgb';
|
|
1
2
|
export const alpha = (hexadecimalColor, opacity) => {
|
|
2
3
|
if (hexadecimalColor.startsWith('var(')) {
|
|
3
4
|
return `color-mix(in srgb, ${hexadecimalColor} ${Math.round(opacity * 100)}%, transparent)`;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
if (hexadecimalColor.length === 3)
|
|
7
|
-
hexadecimalColor = hexadecimalColor
|
|
8
|
-
.split('')
|
|
9
|
-
.map(c => c + c)
|
|
10
|
-
.join('');
|
|
11
|
-
if (hexadecimalColor.length !== 6)
|
|
12
|
-
throw new Error('Invalid hex color');
|
|
13
|
-
const r = parseInt(hexadecimalColor.slice(0, 2), 16);
|
|
14
|
-
const g = parseInt(hexadecimalColor.slice(2, 4), 16);
|
|
15
|
-
const b = parseInt(hexadecimalColor.slice(4, 6), 16);
|
|
6
|
+
const [r, g, b] = hexToRgb(hexadecimalColor);
|
|
16
7
|
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
17
8
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Le rapport de contraste entre deux couleurs, de 1 (identiques) à 21 (noir sur blanc). */
|
|
2
|
+
export declare const contrastRatio: (premiere: string, seconde: string) => number;
|
|
3
|
+
/**
|
|
4
|
+
* Assombrit une couleur jusqu'à ce qu'elle atteigne le rapport de contraste demandé sur le
|
|
5
|
+
* fond donné, en conservant sa teinte. Une couleur qui l'atteint déjà revient inchangée.
|
|
6
|
+
*
|
|
7
|
+
* Écrit pour les palettes de coloration syntaxique, conçues pour des éditeurs et non pour
|
|
8
|
+
* WCAG : plutôt que de corriger une table de teintes à la main, qui deviendrait fausse au
|
|
9
|
+
* premier changement de thème, on ramène chaque couleur au seuil quel que soit le thème.
|
|
10
|
+
*/
|
|
11
|
+
export declare const withMinimumContrast: (couleur: string, fond: string, seuil: number) => string;
|
|
12
|
+
//# sourceMappingURL=contrastColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrastColor.d.ts","sourceRoot":"","sources":["../../src/helpers/contrastColor.ts"],"names":[],"mappings":"AA4BA,4FAA4F;AAC5F,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,KAAG,MAKjE,CAAC;AAKF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAkBlF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const EST_HEXADECIMAL = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2
|
+
const versCanaux = (couleur) => {
|
|
3
|
+
const hexadecimal = couleur.replace(/^#/, '');
|
|
4
|
+
const complet = hexadecimal.length === 3
|
|
5
|
+
? hexadecimal
|
|
6
|
+
.split('')
|
|
7
|
+
.map(c => c + c)
|
|
8
|
+
.join('')
|
|
9
|
+
: hexadecimal;
|
|
10
|
+
return [0, 2, 4].map(debut => parseInt(complet.slice(debut, debut + 2), 16));
|
|
11
|
+
};
|
|
12
|
+
// Luminance relative au sens de WCAG 2.
|
|
13
|
+
const luminance = (canaux) => {
|
|
14
|
+
const [r, v, b] = canaux.map(canal => {
|
|
15
|
+
const proportion = canal / 255;
|
|
16
|
+
return proportion <= 0.03928 ? proportion / 12.92 : Math.pow((proportion + 0.055) / 1.055, 2.4);
|
|
17
|
+
});
|
|
18
|
+
return 0.2126 * r + 0.7152 * v + 0.0722 * b;
|
|
19
|
+
};
|
|
20
|
+
/** Le rapport de contraste entre deux couleurs, de 1 (identiques) à 21 (noir sur blanc). */
|
|
21
|
+
export const contrastRatio = (premiere, seconde) => {
|
|
22
|
+
const a = luminance(versCanaux(premiere));
|
|
23
|
+
const b = luminance(versCanaux(seconde));
|
|
24
|
+
return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
25
|
+
};
|
|
26
|
+
const versHexadecimal = (canaux) => `#${canaux.map(canal => Math.round(canal).toString(16).padStart(2, '0')).join('')}`;
|
|
27
|
+
/**
|
|
28
|
+
* Assombrit une couleur jusqu'à ce qu'elle atteigne le rapport de contraste demandé sur le
|
|
29
|
+
* fond donné, en conservant sa teinte. Une couleur qui l'atteint déjà revient inchangée.
|
|
30
|
+
*
|
|
31
|
+
* Écrit pour les palettes de coloration syntaxique, conçues pour des éditeurs et non pour
|
|
32
|
+
* WCAG : plutôt que de corriger une table de teintes à la main, qui deviendrait fausse au
|
|
33
|
+
* premier changement de thème, on ramène chaque couleur au seuil quel que soit le thème.
|
|
34
|
+
*/
|
|
35
|
+
export const withMinimumContrast = (couleur, fond, seuil) => {
|
|
36
|
+
// Sur le web le thème rend des variables CSS, et rien n'interdit non plus une couleur
|
|
37
|
+
// nommée ou en `rgb()`. Ce qui n'est pas lisible ici ressort tel quel : corriger à
|
|
38
|
+
// l'aveugle effacerait la couleur d'origine, ce qui est pire que de ne rien corriger.
|
|
39
|
+
if (!EST_HEXADECIMAL.test(couleur) || !EST_HEXADECIMAL.test(fond))
|
|
40
|
+
return couleur;
|
|
41
|
+
const canaux = versCanaux(couleur);
|
|
42
|
+
if (contrastRatio(couleur, fond) >= seuil)
|
|
43
|
+
return couleur;
|
|
44
|
+
// Le noir atteint toujours le seuil sur un fond clair : la recherche se termine.
|
|
45
|
+
for (let facteur = 0.99; facteur > 0; facteur -= 0.01) {
|
|
46
|
+
const assombrie = versHexadecimal(canaux.map(canal => canal * facteur));
|
|
47
|
+
if (contrastRatio(assombrie, fond) >= seuil)
|
|
48
|
+
return assombrie;
|
|
49
|
+
}
|
|
50
|
+
return '#000000';
|
|
51
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traduit la palette `light` pour le rendu web : chaque couleur devient une reference a la
|
|
3
|
+
* variable CSS `--${categorie}-${jeton}`. Les cles sont preservees, d'ou la signature generique.
|
|
4
|
+
*/
|
|
5
|
+
export declare const toCSSVarPalette: <T extends {
|
|
6
|
+
light: Record<string, Record<string, string>>;
|
|
7
|
+
}>(palette: T) => T & {
|
|
8
|
+
light: {
|
|
9
|
+
[x: string]: {
|
|
10
|
+
[x: string]: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=cssVarPalette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVarPalette.d.ts","sourceRoot":"","sources":["../../src/helpers/cssVarPalette.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,EAAE,SAAS,CAAC;;;;;;CAKrG,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { mapValues } from './mapValues';
|
|
2
|
+
/**
|
|
3
|
+
* Traduit la palette `light` pour le rendu web : chaque couleur devient une reference a la
|
|
4
|
+
* variable CSS `--${categorie}-${jeton}`. Les cles sont preservees, d'ou la signature generique.
|
|
5
|
+
*/
|
|
6
|
+
export const toCSSVarPalette = (palette) => ({
|
|
7
|
+
...palette,
|
|
8
|
+
light: mapValues(palette.light, (jetons, categorie) => mapValues(jetons, (_couleur, jeton) => `var(--${categorie}-${jeton})`)),
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traduit l'arbre des jetons typographiques pour le rendu web : chaque feuille (reconnue a
|
|
3
|
+
* son `fontSize` numerique) voit ses metriques remplacees par des references aux variables
|
|
4
|
+
* CSS du theme, dont le nom vient du chemin dans l'arbre. La forme de l'arbre est preservee.
|
|
5
|
+
*
|
|
6
|
+
* Seconde assertion toleree, a la frontiere avec React Native : le `TextStyle` natif exige
|
|
7
|
+
* des nombres la ou react-native-web accepte une variable CSS. Un type honnete
|
|
8
|
+
* (`string | number`) serait refuse par chaque style `Text` des applications. Elle est
|
|
9
|
+
* exemptee de la regle par un override de la config ESLint, pas par une directive.
|
|
10
|
+
*/
|
|
11
|
+
export declare const toCSSVarTypography: <T>(node: T) => T;
|
|
12
|
+
//# sourceMappingURL=cssVarTypography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVarTypography.d.ts","sourceRoot":"","sources":["../../src/helpers/cssVarTypography.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isRecord } from './isRecord';
|
|
2
|
+
import { sanitizeCSSKey } from './sanitizeCSSKey';
|
|
3
|
+
const traduitArbre = (node, path = []) => {
|
|
4
|
+
if (!isRecord(node))
|
|
5
|
+
return node;
|
|
6
|
+
if (typeof node.fontSize === 'number') {
|
|
7
|
+
const prefix = path.map(sanitizeCSSKey).join('-');
|
|
8
|
+
const result = { ...node };
|
|
9
|
+
result.fontFamily = `var(--typography-${prefix}-font-family)`;
|
|
10
|
+
result.fontWeight = `var(--typography-${prefix}-font-weight)`;
|
|
11
|
+
result.fontSize = `var(--typography-${prefix}-font-size)`;
|
|
12
|
+
result.lineHeight = `var(--typography-${prefix}-line-height)`;
|
|
13
|
+
if (typeof node.letterSpacing === 'number' && node.letterSpacing !== 0) {
|
|
14
|
+
result.letterSpacing = `var(--typography-${prefix}-letter-spacing)`;
|
|
15
|
+
}
|
|
16
|
+
if (typeof node.textTransform === 'string') {
|
|
17
|
+
result.textTransform = `var(--typography-${prefix}-text-transform)`;
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
return Object.fromEntries(Object.entries(node).map(([key, value]) => [key, traduitArbre(value, [...path, key])]));
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Traduit l'arbre des jetons typographiques pour le rendu web : chaque feuille (reconnue a
|
|
25
|
+
* son `fontSize` numerique) voit ses metriques remplacees par des references aux variables
|
|
26
|
+
* CSS du theme, dont le nom vient du chemin dans l'arbre. La forme de l'arbre est preservee.
|
|
27
|
+
*
|
|
28
|
+
* Seconde assertion toleree, a la frontiere avec React Native : le `TextStyle` natif exige
|
|
29
|
+
* des nombres la ou react-native-web accepte une variable CSS. Un type honnete
|
|
30
|
+
* (`string | number`) serait refuse par chaque style `Text` des applications. Elle est
|
|
31
|
+
* exemptee de la regle par un override de la config ESLint, pas par une directive.
|
|
32
|
+
*/
|
|
33
|
+
export const toCSSVarTypography = traduitArbre;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"darkenColor.d.ts","sourceRoot":"","sources":["../../src/helpers/darkenColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"darkenColor.d.ts","sourceRoot":"","sources":["../../src/helpers/darkenColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;AAI7B,eAAO,MAAM,MAAM,GAAI,kBAAkB,KAAK,EAAE,QAAQ,YAAY,KAAG,QAItE,CAAC"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
+
import { hexToRgb } from './hexToRgb';
|
|
2
|
+
const toHexDigits = (channel) => channel.toString(16).padStart(2, '0');
|
|
1
3
|
export const darken = (hexadecimalColor, amount) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.split('')
|
|
6
|
-
.map(c => c + c)
|
|
7
|
-
.join('');
|
|
8
|
-
if (hexadecimalColor.length !== 6)
|
|
9
|
-
throw new Error('Invalid hex color');
|
|
10
|
-
const r = Math.max(0, parseInt(hexadecimalColor.slice(0, 2), 16) - Math.round(255 * amount));
|
|
11
|
-
const g = Math.max(0, parseInt(hexadecimalColor.slice(2, 4), 16) - Math.round(255 * amount));
|
|
12
|
-
const b = Math.max(0, parseInt(hexadecimalColor.slice(4, 6), 16) - Math.round(255 * amount));
|
|
13
|
-
return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
|
|
4
|
+
const shade = Math.round(255 * amount);
|
|
5
|
+
const channels = hexToRgb(hexadecimalColor).map(channel => Math.max(0, channel - shade));
|
|
6
|
+
return `#${channels.map(toHexDigits).join('')}`;
|
|
14
7
|
};
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { DeepPartial } from '../constants';
|
|
2
|
+
type DeepMerge = <T extends object>(base: T, patch?: DeepPartial<T>) => T;
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Fusionne une surcharge de theme dans sa base. Un objet se fusionne cle a cle, tout le reste se
|
|
5
|
+
* remplace, et une valeur nulle dans la surcharge laisse la base en place.
|
|
6
|
+
*
|
|
7
|
+
* La fusion elle-meme est verifiee par le compilateur : elle ne connait de ce qu'elle traverse
|
|
8
|
+
* que `object` et `unknown`, et `estFusionnable` decide seule de descendre ou de remplacer. Ce
|
|
9
|
+
* qu'il ne sait pas prouver, c'est que la sortie a la forme de la base : les cles ressortent par
|
|
10
|
+
* construction, comme dans `mapValues`. Cette unique assertion pose la signature publique ; elle
|
|
11
|
+
* est exemptee de la regle par un override de la config ESLint, pas par une directive. Une
|
|
12
|
+
* signature typee sur `Palette` n'y echapperait pas : la palette a une profondeur irreguliere.
|
|
4
13
|
*/
|
|
5
|
-
export declare
|
|
14
|
+
export declare const deepMerge: DeepMerge;
|
|
15
|
+
export {};
|
|
6
16
|
//# sourceMappingURL=deepMerge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/helpers/deepMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/helpers/deepMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,KAAK,SAAS,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAuB1E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAe,SAAS,CAAC"}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function deepMerge(base, patch) {
|
|
1
|
+
/** Ce qui se fusionne cle a cle. Un tableau n'en est pas : il se remplace en entier. */
|
|
2
|
+
const estFusionnable = (valeur) => typeof valeur === 'object' && valeur !== null && !Array.isArray(valeur);
|
|
3
|
+
const fusionne = (base, patch) => {
|
|
5
4
|
if (!patch)
|
|
6
5
|
return base;
|
|
7
|
-
const
|
|
8
|
-
for (const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
: (pv ?? bv);
|
|
6
|
+
const sortie = { ...base };
|
|
7
|
+
for (const [cle, valeur] of Object.entries(patch)) {
|
|
8
|
+
const valeurDeBase = sortie[cle];
|
|
9
|
+
sortie[cle] =
|
|
10
|
+
estFusionnable(valeur) && estFusionnable(valeurDeBase)
|
|
11
|
+
? fusionne(valeurDeBase, valeur)
|
|
12
|
+
: (valeur ?? valeurDeBase);
|
|
15
13
|
}
|
|
16
|
-
return
|
|
17
|
-
}
|
|
14
|
+
return Array.isArray(base) ? Object.assign([...base], sortie) : sortie;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Fusionne une surcharge de theme dans sa base. Un objet se fusionne cle a cle, tout le reste se
|
|
18
|
+
* remplace, et une valeur nulle dans la surcharge laisse la base en place.
|
|
19
|
+
*
|
|
20
|
+
* La fusion elle-meme est verifiee par le compilateur : elle ne connait de ce qu'elle traverse
|
|
21
|
+
* que `object` et `unknown`, et `estFusionnable` decide seule de descendre ou de remplacer. Ce
|
|
22
|
+
* qu'il ne sait pas prouver, c'est que la sortie a la forme de la base : les cles ressortent par
|
|
23
|
+
* construction, comme dans `mapValues`. Cette unique assertion pose la signature publique ; elle
|
|
24
|
+
* est exemptee de la regle par un override de la config ESLint, pas par une directive. Une
|
|
25
|
+
* signature typee sur `Palette` n'y echapperait pas : la palette a une profondeur irreguliere.
|
|
26
|
+
*/
|
|
27
|
+
export const deepMerge = fusionne;
|