@alveole/theme 0.4.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 (90) hide show
  1. package/README.md +109 -0
  2. package/assets/fonts/Barlow/Barlow-Bold.ttf +0 -0
  3. package/assets/fonts/Barlow/Barlow-Light.ttf +0 -0
  4. package/assets/fonts/Barlow/Barlow-Medium.ttf +0 -0
  5. package/assets/fonts/Barlow/Barlow-Regular.ttf +0 -0
  6. package/assets/fonts/Barlow/Barlow-SemiBold.ttf +0 -0
  7. package/assets/fonts/Inter/Inter-Bold.ttf +0 -0
  8. package/assets/fonts/Inter/Inter-Light.ttf +0 -0
  9. package/assets/fonts/Inter/Inter-Medium.ttf +0 -0
  10. package/assets/fonts/Inter/Inter-Regular.ttf +0 -0
  11. package/assets/fonts/Inter/Inter-SemiBold.ttf +0 -0
  12. package/dist/ThemeProvider.d.ts +8 -0
  13. package/dist/ThemeProvider.d.ts.map +1 -0
  14. package/dist/ThemeProvider.js +32 -0
  15. package/dist/ThemeProviderLoader.d.ts +2 -0
  16. package/dist/ThemeProviderLoader.d.ts.map +1 -0
  17. package/dist/ThemeProviderLoader.js +5 -0
  18. package/dist/constants/Breakpoint.d.ts +10 -0
  19. package/dist/constants/Breakpoint.d.ts.map +1 -0
  20. package/dist/constants/Breakpoint.js +14 -0
  21. package/dist/constants/Color.d.ts +357 -0
  22. package/dist/constants/Color.d.ts.map +1 -0
  23. package/dist/constants/Color.js +352 -0
  24. package/dist/constants/Elevation.d.ts +81 -0
  25. package/dist/constants/Elevation.d.ts.map +1 -0
  26. package/dist/constants/Elevation.js +53 -0
  27. package/dist/constants/Font.d.ts +15 -0
  28. package/dist/constants/Font.d.ts.map +1 -0
  29. package/dist/constants/Font.js +15 -0
  30. package/dist/constants/Palette.d.ts +187 -0
  31. package/dist/constants/Palette.d.ts.map +1 -0
  32. package/dist/constants/Palette.js +180 -0
  33. package/dist/constants/Radius.d.ts +9 -0
  34. package/dist/constants/Radius.d.ts.map +1 -0
  35. package/dist/constants/Radius.js +6 -0
  36. package/dist/constants/Sizes.d.ts +35 -0
  37. package/dist/constants/Sizes.d.ts.map +1 -0
  38. package/dist/constants/Sizes.js +30 -0
  39. package/dist/constants/Spacing.d.ts +24 -0
  40. package/dist/constants/Spacing.d.ts.map +1 -0
  41. package/dist/constants/Spacing.js +21 -0
  42. package/dist/constants/Typography.d.ts +189 -0
  43. package/dist/constants/Typography.d.ts.map +1 -0
  44. package/dist/constants/Typography.js +190 -0
  45. package/dist/constants/UnsupportedCSSProperties.d.ts +4 -0
  46. package/dist/constants/UnsupportedCSSProperties.d.ts.map +1 -0
  47. package/dist/constants/UnsupportedCSSProperties.js +3 -0
  48. package/dist/constants/Variant.d.ts +8 -0
  49. package/dist/constants/Variant.d.ts.map +1 -0
  50. package/dist/constants/Variant.js +5 -0
  51. package/dist/constants/index.d.ts +11 -0
  52. package/dist/constants/index.d.ts.map +1 -0
  53. package/dist/constants/index.js +10 -0
  54. package/dist/helpers/alphaColor.d.ts +12 -0
  55. package/dist/helpers/alphaColor.d.ts.map +1 -0
  56. package/dist/helpers/alphaColor.js +20 -0
  57. package/dist/helpers/deepMerge.d.ts +6 -0
  58. package/dist/helpers/deepMerge.d.ts.map +1 -0
  59. package/dist/helpers/deepMerge.js +17 -0
  60. package/dist/helpers/elevationStyle.d.ts +19 -0
  61. package/dist/helpers/elevationStyle.d.ts.map +1 -0
  62. package/dist/helpers/elevationStyle.js +16 -0
  63. package/dist/helpers/injectVariableCSS.d.ts +3 -0
  64. package/dist/helpers/injectVariableCSS.d.ts.map +1 -0
  65. package/dist/helpers/injectVariableCSS.js +27 -0
  66. package/dist/helpers/isSpacingKey.d.ts +3 -0
  67. package/dist/helpers/isSpacingKey.d.ts.map +1 -0
  68. package/dist/helpers/isSpacingKey.js +2 -0
  69. package/dist/helpers/makeStyles.d.ts +15 -0
  70. package/dist/helpers/makeStyles.d.ts.map +1 -0
  71. package/dist/helpers/makeStyles.js +14 -0
  72. package/dist/helpers/removeUnsupportedCSSProperties.d.ts +8 -0
  73. package/dist/helpers/removeUnsupportedCSSProperties.d.ts.map +1 -0
  74. package/dist/helpers/removeUnsupportedCSSProperties.js +20 -0
  75. package/dist/helpers/useThemeBuilder.d.ts +9 -0
  76. package/dist/helpers/useThemeBuilder.d.ts.map +1 -0
  77. package/dist/helpers/useThemeBuilder.js +38 -0
  78. package/dist/index.d.ts +6 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +5 -0
  81. package/dist/type/Theme.d.ts +21 -0
  82. package/dist/type/Theme.d.ts.map +1 -0
  83. package/dist/type/Theme.js +1 -0
  84. package/dist/type/Typography.d.ts +8 -0
  85. package/dist/type/Typography.d.ts.map +1 -0
  86. package/dist/type/Typography.js +1 -0
  87. package/dist/type/index.d.ts +2 -0
  88. package/dist/type/index.d.ts.map +1 -0
  89. package/dist/type/index.js +1 -0
  90. package/package.json +26 -0
@@ -0,0 +1,189 @@
1
+ export declare const CustomTypography: {
2
+ readonly 'Titres alternatifs': {
3
+ readonly XS: {
4
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
5
+ readonly fontSize: 48;
6
+ readonly lineHeight: 56;
7
+ readonly letterSpacing: 0;
8
+ };
9
+ readonly SM: {
10
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
11
+ readonly fontSize: 56;
12
+ readonly lineHeight: 64;
13
+ readonly letterSpacing: 0;
14
+ };
15
+ readonly MD: {
16
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
17
+ readonly fontSize: 64;
18
+ readonly lineHeight: 72;
19
+ readonly letterSpacing: 0;
20
+ };
21
+ readonly LG: {
22
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
23
+ readonly fontSize: 72;
24
+ readonly lineHeight: 80;
25
+ readonly letterSpacing: 0;
26
+ };
27
+ readonly XL: {
28
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
29
+ readonly fontSize: 80;
30
+ readonly lineHeight: 88;
31
+ readonly letterSpacing: 0;
32
+ };
33
+ };
34
+ /** Les titres sont de tailles distinctes selon la platform (Mobile/Web) - Pas de React ici */
35
+ readonly Titres: {
36
+ /** Font size: 18/20 */
37
+ readonly 'H6 - XXS': {
38
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
39
+ readonly fontSize: 18 | 20;
40
+ readonly lineHeight: 24 | 28;
41
+ readonly letterSpacing: 0;
42
+ };
43
+ /** Font size: 20/22 */
44
+ readonly 'H5 - XS': {
45
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
46
+ readonly fontSize: 20 | 22;
47
+ readonly lineHeight: 28;
48
+ readonly letterSpacing: 0;
49
+ };
50
+ /** Font size: 22/24 */
51
+ readonly 'H4 - SM': {
52
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
53
+ readonly fontSize: 24 | 22;
54
+ readonly lineHeight: 28 | 32;
55
+ readonly letterSpacing: 0;
56
+ };
57
+ /** Font size: 24/28 */
58
+ readonly 'H3 - MD': {
59
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
60
+ readonly fontSize: 24 | 28;
61
+ readonly lineHeight: 36 | 32;
62
+ readonly letterSpacing: 0;
63
+ };
64
+ /** Font size: 28/32 */
65
+ readonly 'H2 - LG': {
66
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
67
+ readonly fontSize: 28 | 32;
68
+ readonly lineHeight: 36 | 32;
69
+ readonly letterSpacing: 0;
70
+ };
71
+ /** Font size: 40/48 */
72
+ readonly 'H1 - XL': {
73
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
74
+ readonly fontSize: 48 | 40;
75
+ readonly lineHeight: 48 | 56;
76
+ readonly letterSpacing: 0;
77
+ };
78
+ };
79
+ readonly 'Corps de texte': {
80
+ readonly XS: {
81
+ readonly Regular: {
82
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
83
+ readonly fontSize: 12;
84
+ readonly lineHeight: 20;
85
+ readonly letterSpacing: 0;
86
+ };
87
+ readonly Caps: {
88
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
89
+ readonly fontSize: 12;
90
+ readonly lineHeight: 20;
91
+ readonly letterSpacing: 0;
92
+ readonly textTransform: "uppercase";
93
+ };
94
+ readonly CapsBold: {
95
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
96
+ readonly fontSize: 12;
97
+ readonly lineHeight: 20;
98
+ readonly letterSpacing: 0;
99
+ readonly textTransform: "uppercase";
100
+ };
101
+ readonly SemiBold: {
102
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
103
+ readonly fontSize: 12;
104
+ readonly lineHeight: 20;
105
+ readonly letterSpacing: 0;
106
+ };
107
+ };
108
+ readonly SM: {
109
+ readonly Regular: {
110
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
111
+ readonly fontSize: 14;
112
+ readonly lineHeight: 24;
113
+ readonly letterSpacing: 0;
114
+ };
115
+ readonly Medium: {
116
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
117
+ readonly fontSize: 14;
118
+ readonly lineHeight: 24;
119
+ readonly letterSpacing: 0;
120
+ };
121
+ readonly SemiBold: {
122
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
123
+ readonly fontSize: 14;
124
+ readonly lineHeight: 24;
125
+ readonly letterSpacing: 0;
126
+ };
127
+ readonly Bold: {
128
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
129
+ readonly fontSize: 14;
130
+ readonly lineHeight: 24;
131
+ readonly letterSpacing: 0;
132
+ };
133
+ readonly CapsBold: {
134
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
135
+ readonly fontSize: 14;
136
+ readonly lineHeight: 24;
137
+ readonly letterSpacing: 0;
138
+ readonly textTransform: "uppercase";
139
+ };
140
+ };
141
+ readonly MD: {
142
+ readonly Regular: {
143
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
144
+ readonly fontSize: 16;
145
+ readonly lineHeight: 24;
146
+ readonly letterSpacing: 0;
147
+ };
148
+ readonly Medium: {
149
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
150
+ readonly fontSize: 16;
151
+ readonly lineHeight: 24;
152
+ readonly letterSpacing: 0;
153
+ };
154
+ readonly SemiBold: {
155
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
156
+ readonly fontSize: 16;
157
+ readonly lineHeight: 24;
158
+ readonly letterSpacing: 0;
159
+ };
160
+ readonly Bold: {
161
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
162
+ readonly fontSize: 16;
163
+ readonly lineHeight: 24;
164
+ readonly letterSpacing: 0;
165
+ };
166
+ };
167
+ readonly LG: {
168
+ readonly Regular: {
169
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
170
+ readonly fontSize: 18;
171
+ readonly lineHeight: 28;
172
+ readonly letterSpacing: 0;
173
+ };
174
+ readonly Medium: {
175
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
176
+ readonly fontSize: 18;
177
+ readonly lineHeight: 28;
178
+ readonly letterSpacing: 0;
179
+ };
180
+ readonly SemiBold: {
181
+ readonly fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
182
+ readonly fontSize: 18;
183
+ readonly lineHeight: 28;
184
+ readonly letterSpacing: 0;
185
+ };
186
+ };
187
+ };
188
+ };
189
+ //# sourceMappingURL=Typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../src/constants/Typography.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC3B,8FAA8F;;QAE5F,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsHjB,CAAC"}
@@ -0,0 +1,190 @@
1
+ import { Platform } from 'react-native';
2
+ import { Fonts } from './Font';
3
+ export const CustomTypography = {
4
+ 'Titres alternatifs': {
5
+ XS: {
6
+ fontFamily: Fonts['Barlow-Bold'],
7
+ fontSize: 48,
8
+ lineHeight: 56,
9
+ letterSpacing: 0,
10
+ },
11
+ SM: {
12
+ fontFamily: Fonts['Barlow-Bold'],
13
+ fontSize: 56,
14
+ lineHeight: 64,
15
+ letterSpacing: 0,
16
+ },
17
+ MD: {
18
+ fontFamily: Fonts['Barlow-Bold'],
19
+ fontSize: 64,
20
+ lineHeight: 72,
21
+ letterSpacing: 0,
22
+ },
23
+ LG: {
24
+ fontFamily: Fonts['Barlow-Bold'],
25
+ fontSize: 72,
26
+ lineHeight: 80,
27
+ letterSpacing: 0,
28
+ },
29
+ XL: {
30
+ fontFamily: Fonts['Barlow-Bold'],
31
+ fontSize: 80,
32
+ lineHeight: 88,
33
+ letterSpacing: 0,
34
+ },
35
+ },
36
+ /** Les titres sont de tailles distinctes selon la platform (Mobile/Web) - Pas de React ici */
37
+ Titres: {
38
+ /** Font size: 18/20 */
39
+ 'H6 - XXS': {
40
+ fontFamily: Fonts['Inter-Bold'],
41
+ fontSize: Platform.OS !== 'web' ? 20 : 18,
42
+ lineHeight: Platform.OS !== 'web' ? 28 : 24,
43
+ letterSpacing: 0,
44
+ },
45
+ /** Font size: 20/22 */
46
+ 'H5 - XS': {
47
+ fontFamily: Fonts['Inter-Bold'],
48
+ fontSize: Platform.OS !== 'web' ? 22 : 20,
49
+ lineHeight: 28,
50
+ letterSpacing: 0,
51
+ },
52
+ /** Font size: 22/24 */
53
+ 'H4 - SM': {
54
+ fontFamily: Fonts['Inter-Bold'],
55
+ fontSize: Platform.OS !== 'web' ? 24 : 22,
56
+ lineHeight: Platform.OS !== 'web' ? 32 : 28,
57
+ letterSpacing: 0,
58
+ },
59
+ /** Font size: 24/28 */
60
+ 'H3 - MD': {
61
+ fontFamily: Fonts['Inter-Bold'],
62
+ fontSize: Platform.OS !== 'web' ? 28 : 24,
63
+ lineHeight: Platform.OS !== 'web' ? 36 : 32,
64
+ letterSpacing: 0,
65
+ },
66
+ /** Font size: 28/32 */
67
+ 'H2 - LG': {
68
+ fontFamily: Fonts['Inter-Bold'],
69
+ fontSize: Platform.OS !== 'web' ? 32 : 28,
70
+ lineHeight: Platform.OS !== 'web' ? 36 : 32,
71
+ letterSpacing: 0,
72
+ },
73
+ /** Font size: 40/48 */
74
+ 'H1 - XL': {
75
+ fontFamily: Fonts['Barlow-SemiBold'],
76
+ fontSize: Platform.OS !== 'web' ? 48 : 40,
77
+ lineHeight: Platform.OS !== 'web' ? 56 : 48,
78
+ letterSpacing: 0,
79
+ },
80
+ },
81
+ 'Corps de texte': {
82
+ XS: {
83
+ Regular: {
84
+ fontFamily: Fonts['Inter-Regular'],
85
+ fontSize: 12,
86
+ lineHeight: 20,
87
+ letterSpacing: 0,
88
+ },
89
+ Caps: {
90
+ fontFamily: Fonts['Inter-Regular'],
91
+ fontSize: 12,
92
+ lineHeight: 20,
93
+ letterSpacing: 0,
94
+ textTransform: 'uppercase',
95
+ },
96
+ CapsBold: {
97
+ fontFamily: Fonts['Inter-SemiBold'],
98
+ fontSize: 12,
99
+ lineHeight: 20,
100
+ letterSpacing: 0,
101
+ textTransform: 'uppercase',
102
+ },
103
+ SemiBold: {
104
+ fontFamily: Fonts['Inter-SemiBold'],
105
+ fontSize: 12,
106
+ lineHeight: 20,
107
+ letterSpacing: 0,
108
+ },
109
+ },
110
+ SM: {
111
+ Regular: {
112
+ fontFamily: Fonts['Inter-Regular'],
113
+ fontSize: 14,
114
+ lineHeight: 24,
115
+ letterSpacing: 0,
116
+ },
117
+ Medium: {
118
+ fontFamily: Fonts['Inter-Medium'],
119
+ fontSize: 14,
120
+ lineHeight: 24,
121
+ letterSpacing: 0,
122
+ },
123
+ SemiBold: {
124
+ fontFamily: Fonts['Inter-SemiBold'],
125
+ fontSize: 14,
126
+ lineHeight: 24,
127
+ letterSpacing: 0,
128
+ },
129
+ Bold: {
130
+ fontFamily: Fonts['Inter-Bold'],
131
+ fontSize: 14,
132
+ lineHeight: 24,
133
+ letterSpacing: 0,
134
+ },
135
+ CapsBold: {
136
+ fontFamily: Fonts['Inter-SemiBold'],
137
+ fontSize: 14,
138
+ lineHeight: 24,
139
+ letterSpacing: 0,
140
+ textTransform: 'uppercase',
141
+ },
142
+ },
143
+ MD: {
144
+ Regular: {
145
+ fontFamily: Fonts['Inter-Regular'],
146
+ fontSize: 16,
147
+ lineHeight: 24,
148
+ letterSpacing: 0,
149
+ },
150
+ Medium: {
151
+ fontFamily: Fonts['Inter-Medium'],
152
+ fontSize: 16,
153
+ lineHeight: 24,
154
+ letterSpacing: 0,
155
+ },
156
+ SemiBold: {
157
+ fontFamily: Fonts['Inter-SemiBold'],
158
+ fontSize: 16,
159
+ lineHeight: 24,
160
+ letterSpacing: 0,
161
+ },
162
+ Bold: {
163
+ fontFamily: Fonts['Inter-Bold'],
164
+ fontSize: 16,
165
+ lineHeight: 24,
166
+ letterSpacing: 0,
167
+ },
168
+ },
169
+ LG: {
170
+ Regular: {
171
+ fontFamily: Fonts['Inter-Regular'],
172
+ fontSize: 18,
173
+ lineHeight: 28,
174
+ letterSpacing: 0,
175
+ },
176
+ Medium: {
177
+ fontFamily: Fonts['Inter-Medium'],
178
+ fontSize: 18,
179
+ lineHeight: 28,
180
+ letterSpacing: 0,
181
+ },
182
+ SemiBold: {
183
+ fontFamily: Fonts['Inter-SemiBold'],
184
+ fontSize: 18,
185
+ lineHeight: 28,
186
+ letterSpacing: 0,
187
+ },
188
+ },
189
+ },
190
+ };
@@ -0,0 +1,4 @@
1
+ import type { Platform } from 'react-native';
2
+ import type { StyleValue } from '../helpers/makeStyles';
3
+ export declare const UnsupportedCSSProperties: Partial<Record<typeof Platform.OS, (keyof StyleValue)[]>>;
4
+ //# sourceMappingURL=UnsupportedCSSProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnsupportedCSSProperties.d.ts","sourceRoot":"","sources":["../../src/constants/UnsupportedCSSProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,QAAQ,CAAC,EAAE,EAAE,CAAC,MAAM,UAAU,CAAC,EAAE,CAAC,CAE9F,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const UnsupportedCSSProperties = {
2
+ ios: ['outlineWidth'],
3
+ };
@@ -0,0 +1,8 @@
1
+ export declare const Variants: {
2
+ readonly Mobile: "mobile";
3
+ readonly Tablet: "tablet";
4
+ readonly Desktop: "desktop";
5
+ };
6
+ export type VariantKey = keyof typeof Variants;
7
+ export type Variant = (typeof Variants)[VariantKey];
8
+ //# sourceMappingURL=Variant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Variant.d.ts","sourceRoot":"","sources":["../../src/constants/Variant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAGX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,QAAQ,CAAC;AAC/C,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export const Variants = {
2
+ Mobile: 'mobile',
3
+ Tablet: 'tablet',
4
+ Desktop: 'desktop',
5
+ };
@@ -0,0 +1,11 @@
1
+ export * from './Breakpoint';
2
+ export * from './Color';
3
+ export * from './Elevation';
4
+ export * from './Font';
5
+ export * from './Palette';
6
+ export * from './Sizes';
7
+ export * from './Spacing';
8
+ export * from './Typography';
9
+ export * from './UnsupportedCSSProperties';
10
+ export * from './Variant';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from './Breakpoint';
2
+ export * from './Color';
3
+ export * from './Elevation';
4
+ export * from './Font';
5
+ export * from './Palette';
6
+ export * from './Sizes';
7
+ export * from './Spacing';
8
+ export * from './Typography';
9
+ export * from './UnsupportedCSSProperties';
10
+ export * from './Variant';
@@ -0,0 +1,12 @@
1
+ import { Color } from '../constants';
2
+ type Between0And1 = number;
3
+ type RGBAColor = `rgba${string}`;
4
+ /**
5
+ * Génère une couleur avec de l’opacité à partir d’une valeur hexadecimal
6
+ * @param hexadecimalColor - La couleur hexadecimal (Issue du thème ou string)
7
+ * @param opacity - Entre 0 et 1
8
+ * @returns La valeur rgba, par exemple: 'rgba(235, 220, 200, 0.5)'
9
+ */
10
+ export declare const alpha: (hexadecimalColor: Color, opacity: Between0And1) => RGBAColor;
11
+ export {};
12
+ //# sourceMappingURL=alphaColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alphaColor.d.ts","sourceRoot":"","sources":["../../src/helpers/alphaColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,SAAS,GAAG,OAAO,MAAM,EAAE,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,kBAAkB,KAAK,EAAE,SAAS,YAAY,KAAG,SAYtE,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Génère une couleur avec de l’opacité à partir d’une valeur hexadecimal
3
+ * @param hexadecimalColor - La couleur hexadecimal (Issue du thème ou string)
4
+ * @param opacity - Entre 0 et 1
5
+ * @returns La valeur rgba, par exemple: 'rgba(235, 220, 200, 0.5)'
6
+ */
7
+ export const alpha = (hexadecimalColor, opacity) => {
8
+ hexadecimalColor = hexadecimalColor.replace(/^#/, '');
9
+ if (hexadecimalColor.length === 3)
10
+ hexadecimalColor = hexadecimalColor
11
+ .split('')
12
+ .map(c => c + c)
13
+ .join('');
14
+ if (hexadecimalColor.length !== 6)
15
+ throw new Error('Invalid hex color');
16
+ const r = parseInt(hexadecimalColor.slice(0, 2), 16);
17
+ const g = parseInt(hexadecimalColor.slice(2, 4), 16);
18
+ const b = parseInt(hexadecimalColor.slice(4, 6), 16);
19
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
20
+ };
@@ -0,0 +1,6 @@
1
+ import { DeepPartial } from '../constants';
2
+ /**
3
+ * Merge des surchage de theme
4
+ */
5
+ export declare function deepMerge<T extends object>(base: T, patch?: DeepPartial<T>): T;
6
+ //# sourceMappingURL=deepMerge.d.ts.map
@@ -0,0 +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;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAY9E"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Merge des surchage de theme
3
+ */
4
+ export function deepMerge(base, patch) {
5
+ if (!patch)
6
+ return base;
7
+ const out = Array.isArray(base) ? [...base] : { ...base };
8
+ for (const k in patch) {
9
+ const pv = patch[k];
10
+ const bv = base[k];
11
+ out[k] =
12
+ pv && typeof pv === 'object' && !Array.isArray(pv) && bv && typeof bv === 'object'
13
+ ? deepMerge(bv, pv)
14
+ : (pv ?? bv);
15
+ }
16
+ return out;
17
+ }
@@ -0,0 +1,19 @@
1
+ import { ElevationKey } from '../constants';
2
+ /**
3
+ * Transforme les shadow en fonction de la platforme (web ou mobile)
4
+ * @param level L’élévation
5
+ * @returns
6
+ */
7
+ export declare const elevationStyle: (level: ElevationKey) => {
8
+ shadowColor: import("..").Color;
9
+ shadowOffset: {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ shadowOpacity: number;
14
+ shadowRadius: number;
15
+ elevation: number;
16
+ } | {
17
+ boxShadow: string;
18
+ } | undefined;
19
+ //# sourceMappingURL=elevationStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevationStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/elevationStyle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,cAAc,CAAC;AAKxD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,YAAY;;;;;;;;;;;aAKjD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Platform } from 'react-native';
2
+ import { Elevations } from '../constants';
3
+ const isElevationKey = (key) => Object.prototype.hasOwnProperty.call(Elevations, key);
4
+ /**
5
+ * Transforme les shadow en fonction de la platforme (web ou mobile)
6
+ * @param level L’élévation
7
+ * @returns
8
+ */
9
+ export const elevationStyle = (level) => {
10
+ const value = isElevationKey(level) ? Elevations[level] : undefined;
11
+ if (value == null)
12
+ return;
13
+ if (Platform.OS === 'web')
14
+ return { boxShadow: value.web };
15
+ return value.mobile;
16
+ };
@@ -0,0 +1,3 @@
1
+ import { Theme } from '../type';
2
+ export declare const injectVariableCSS: (theme: Theme) => void;
3
+ //# sourceMappingURL=injectVariableCSS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectVariableCSS.d.ts","sourceRoot":"","sources":["../../src/helpers/injectVariableCSS.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAoBhC,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,SAY7C,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Spacings } from '../constants';
2
+ const generateCSSVariables = (theme) => {
3
+ const lines = [];
4
+ // Couleurs
5
+ Object.entries(theme.color._constants).forEach(([key, colors]) => {
6
+ Object.entries(colors).forEach(([variant, value]) => {
7
+ lines.push(` --color-${key}-${variant}: ${value};`);
8
+ });
9
+ });
10
+ // Spacing
11
+ Object.entries(Spacings).forEach(([key, value]) => {
12
+ lines.push(` --spacing-${key}: ${value}px;`);
13
+ });
14
+ return `:root {\n${lines.join('\n')}\n}`;
15
+ };
16
+ export const injectVariableCSS = (theme) => {
17
+ if (typeof document === 'undefined')
18
+ return;
19
+ const styleId = 'theme-css-variables';
20
+ const oldStyle = document.getElementById(styleId);
21
+ if (oldStyle)
22
+ oldStyle.remove();
23
+ const styleTag = document.createElement('style');
24
+ styleTag.id = styleId;
25
+ styleTag.innerHTML = generateCSSVariables(theme);
26
+ document.head.appendChild(styleTag);
27
+ };
@@ -0,0 +1,3 @@
1
+ import { SpacingKey } from '../constants';
2
+ export declare const isSpacingKey: (value: unknown) => value is SpacingKey;
3
+ //# sourceMappingURL=isSpacingKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSpacingKey.d.ts","sourceRoot":"","sources":["../../src/helpers/isSpacingKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UACa,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Spacings } from '../constants';
2
+ export const isSpacingKey = (value) => typeof value === 'string' && Object.keys(Spacings).includes(value);
@@ -0,0 +1,15 @@
1
+ import { TextProps } from '@tamagui/core';
2
+ import { CSSProperties } from 'react';
3
+ import { useTheme } from '../ThemeProvider';
4
+ export type StyleValue = Omit<CSSProperties, 'fontVariant'> & {
5
+ width?: number | `${string}%`;
6
+ height?: number | `${string}%`;
7
+ fontVariant?: TextProps['fontVariant'];
8
+ };
9
+ /**
10
+ * Génère les styles pour les composants en injectant le theme
11
+ * @param stylesFn - (theme: Theme) => CSSProperties
12
+ * @returns Des proprité css avec les valeurs du thème injecté
13
+ */
14
+ export declare function makeStyles<T extends Record<string, StyleValue>>(stylesFn: (theme: ReturnType<typeof useTheme>) => T): () => T;
15
+ //# sourceMappingURL=makeStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/makeStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG;IAC5D,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC/B,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;CACxC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,CAAC,GAClD,MAAM,CAAC,CAMT"}
@@ -0,0 +1,14 @@
1
+ import { useTheme } from '../ThemeProvider';
2
+ import { removeUnsupportedCSSProperties } from './removeUnsupportedCSSProperties';
3
+ /**
4
+ * Génère les styles pour les composants en injectant le theme
5
+ * @param stylesFn - (theme: Theme) => CSSProperties
6
+ * @returns Des proprité css avec les valeurs du thème injecté
7
+ */
8
+ export function makeStyles(stylesFn) {
9
+ return () => {
10
+ const theme = useTheme();
11
+ const styles = stylesFn(theme);
12
+ return removeUnsupportedCSSProperties(styles);
13
+ };
14
+ }
@@ -0,0 +1,8 @@
1
+ import type { StyleValue } from './makeStyles';
2
+ /**
3
+ * Retire les propriétés CSS non supportées pour une platforme
4
+ * @param styles Styles appliqués
5
+ * @returns Les styles sans les propriétés exclues pour la platform
6
+ */
7
+ export declare function removeUnsupportedCSSProperties<T extends Record<string, StyleValue>>(styles: T): T;
8
+ //# sourceMappingURL=removeUnsupportedCSSProperties.d.ts.map