@kaizen/design-tokens 3.1.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 (129) hide show
  1. package/CHANGELOG.md +773 -0
  2. package/LICENSE +21 -0
  3. package/README.md +66 -0
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +23 -0
  7. package/dist/react/ThemeProvider.d.ts +13 -0
  8. package/dist/react/ThemeProvider.d.ts.map +1 -0
  9. package/dist/react/ThemeProvider.js +42 -0
  10. package/dist/react/index.d.ts +2 -0
  11. package/dist/react/index.d.ts.map +1 -0
  12. package/dist/react/index.js +13 -0
  13. package/dist/src/ThemeManager.d.ts +23 -0
  14. package/dist/src/ThemeManager.d.ts.map +1 -0
  15. package/dist/src/ThemeManager.js +70 -0
  16. package/dist/src/lib/addExtraThemeEntries.d.ts +25 -0
  17. package/dist/src/lib/addExtraThemeEntries.d.ts.map +1 -0
  18. package/dist/src/lib/addExtraThemeEntries.js +56 -0
  19. package/dist/src/lib/cssVariables.d.ts +23 -0
  20. package/dist/src/lib/cssVariables.d.ts.map +1 -0
  21. package/dist/src/lib/cssVariables.js +33 -0
  22. package/dist/src/lib/makeCssVariableDefinitionsMap.d.ts +30 -0
  23. package/dist/src/lib/makeCssVariableDefinitionsMap.d.ts.map +1 -0
  24. package/dist/src/lib/makeCssVariableDefinitionsMap.js +57 -0
  25. package/dist/src/lib/makeCssVariableTheme.d.ts +35 -0
  26. package/dist/src/lib/makeCssVariableTheme.d.ts.map +1 -0
  27. package/dist/src/lib/makeCssVariableTheme.js +54 -0
  28. package/dist/src/lib/mapLeafsOfObject.d.ts +23 -0
  29. package/dist/src/lib/mapLeafsOfObject.d.ts.map +1 -0
  30. package/dist/src/lib/mapLeafsOfObject.js +59 -0
  31. package/dist/src/themes/heart.d.ts +3 -0
  32. package/dist/src/themes/heart.d.ts.map +1 -0
  33. package/dist/src/themes/heart.js +286 -0
  34. package/dist/src/themes/index.d.ts +4 -0
  35. package/dist/src/themes/index.d.ts.map +1 -0
  36. package/dist/src/themes/index.js +9 -0
  37. package/dist/src/themes/zen.d.ts +3 -0
  38. package/dist/src/themes/zen.d.ts.map +1 -0
  39. package/dist/src/themes/zen.js +293 -0
  40. package/dist/src/types.d.ts +205 -0
  41. package/dist/src/types.d.ts.map +1 -0
  42. package/dist/src/types.js +2 -0
  43. package/elm/Kaizen/Theme.elm +29 -0
  44. package/index.ts +9 -0
  45. package/less/animation.less +49 -0
  46. package/less/border.less +47 -0
  47. package/less/color.less +210 -0
  48. package/less/layout.less +8 -0
  49. package/less/shadow.less +12 -0
  50. package/less/spacing.less +20 -0
  51. package/less/typography.less +526 -0
  52. package/package.json +63 -0
  53. package/react/ThemeProvider.d.ts +12 -0
  54. package/react/ThemeProvider.js +43 -0
  55. package/react/ThemeProvider.js.map +1 -0
  56. package/react/ThemeProvider.tsx +39 -0
  57. package/react/index.d.ts +1 -0
  58. package/react/index.js +14 -0
  59. package/react/index.js.map +1 -0
  60. package/react/index.tsx +1 -0
  61. package/sass/animation.scss +49 -0
  62. package/sass/border.scss +47 -0
  63. package/sass/color.scss +210 -0
  64. package/sass/layout.scss +8 -0
  65. package/sass/shadow.scss +12 -0
  66. package/sass/spacing.scss +20 -0
  67. package/sass/typography.scss +526 -0
  68. package/src/ThemeManager.d.ts +22 -0
  69. package/src/ThemeManager.js +71 -0
  70. package/src/ThemeManager.js.map +1 -0
  71. package/src/ThemeManager.ts +70 -0
  72. package/src/lib/__tests__/themeForTesting.d.ts +38 -0
  73. package/src/lib/__tests__/themeForTesting.js +21 -0
  74. package/src/lib/__tests__/themeForTesting.js.map +1 -0
  75. package/src/lib/__tests__/themeForTesting.ts +17 -0
  76. package/src/lib/addExtraThemeEntries.d.ts +24 -0
  77. package/src/lib/addExtraThemeEntries.js +57 -0
  78. package/src/lib/addExtraThemeEntries.js.map +1 -0
  79. package/src/lib/addExtraThemeEntries.ts +56 -0
  80. package/src/lib/cssVariables.d.ts +22 -0
  81. package/src/lib/cssVariables.js +34 -0
  82. package/src/lib/cssVariables.js.map +1 -0
  83. package/src/lib/cssVariables.ts +27 -0
  84. package/src/lib/makeCssVariableDefinitionsMap.d.ts +29 -0
  85. package/src/lib/makeCssVariableDefinitionsMap.js +58 -0
  86. package/src/lib/makeCssVariableDefinitionsMap.js.map +1 -0
  87. package/src/lib/makeCssVariableDefinitionsMap.ts +55 -0
  88. package/src/lib/makeCssVariableTheme.d.ts +34 -0
  89. package/src/lib/makeCssVariableTheme.js +55 -0
  90. package/src/lib/makeCssVariableTheme.js.map +1 -0
  91. package/src/lib/makeCssVariableTheme.ts +63 -0
  92. package/src/lib/mapLeafsOfObject.d.ts +22 -0
  93. package/src/lib/mapLeafsOfObject.js +60 -0
  94. package/src/lib/mapLeafsOfObject.js.map +1 -0
  95. package/src/lib/mapLeafsOfObject.ts +50 -0
  96. package/src/lib/patterns.d.ts +2 -0
  97. package/src/lib/patterns.js +6 -0
  98. package/src/lib/patterns.js.map +1 -0
  99. package/src/lib/patterns.ts +2 -0
  100. package/src/themes/heart.d.ts +2 -0
  101. package/src/themes/heart.js +287 -0
  102. package/src/themes/heart.js.map +1 -0
  103. package/src/themes/heart.ts +285 -0
  104. package/src/themes/index.d.ts +3 -0
  105. package/src/themes/index.js +17 -0
  106. package/src/themes/index.js.map +1 -0
  107. package/src/themes/index.ts +4 -0
  108. package/src/themes/zen.d.ts +2 -0
  109. package/src/themes/zen.js +294 -0
  110. package/src/themes/zen.js.map +1 -0
  111. package/src/themes/zen.ts +292 -0
  112. package/src/types.d.ts +204 -0
  113. package/src/types.js +3 -0
  114. package/src/types.js.map +1 -0
  115. package/src/types.ts +225 -0
  116. package/tokens/animation.json +34 -0
  117. package/tokens/animation.json.d.ts +12 -0
  118. package/tokens/border.json +44 -0
  119. package/tokens/border.json.d.ts +12 -0
  120. package/tokens/color.json +228 -0
  121. package/tokens/color.json.d.ts +12 -0
  122. package/tokens/layout.json +9 -0
  123. package/tokens/layout.json.d.ts +12 -0
  124. package/tokens/shadow.json +12 -0
  125. package/tokens/shadow.json.d.ts +12 -0
  126. package/tokens/spacing.json +22 -0
  127. package/tokens/spacing.json.d.ts +12 -0
  128. package/tokens/typography.json +236 -0
  129. package/tokens/typography.json.d.ts +12 -0
@@ -0,0 +1,526 @@
1
+ /** THIS IS AN AUTOGENERATED FILE **/
2
+
3
+ @typography-data-large-font-family: var(
4
+ --typography-data-large-font-family,
5
+ "Inter",
6
+ "Noto Sans",
7
+ Helvetica,
8
+ Arial,
9
+ sans-serif
10
+ );
11
+ @typography-data-large-font-family-id: --typography-data-large-font-family;
12
+ @typography-data-large-font-weight: var(
13
+ --typography-data-large-font-weight,
14
+ 700
15
+ );
16
+ @typography-data-large-font-weight-id: --typography-data-large-font-weight;
17
+ @typography-data-large-font-size: var(
18
+ --typography-data-large-font-size,
19
+ 5.25rem
20
+ );
21
+ @typography-data-large-font-size-id: --typography-data-large-font-size;
22
+ @typography-data-large-line-height: var(
23
+ --typography-data-large-line-height,
24
+ 5.25rem
25
+ );
26
+ @typography-data-large-line-height-id: --typography-data-large-line-height;
27
+ @typography-data-large-letter-spacing: var(
28
+ --typography-data-large-letter-spacing,
29
+ normal
30
+ );
31
+ @typography-data-large-letter-spacing-id: --typography-data-large-letter-spacing;
32
+ @typography-data-large-units-font-family: var(
33
+ --typography-data-large-units-font-family,
34
+ "Inter",
35
+ "Noto Sans",
36
+ Helvetica,
37
+ Arial,
38
+ sans-serif
39
+ );
40
+ @typography-data-large-units-font-family-id: --typography-data-large-units-font-family;
41
+ @typography-data-large-units-font-weight: var(
42
+ --typography-data-large-units-font-weight,
43
+ 700
44
+ );
45
+ @typography-data-large-units-font-weight-id: --typography-data-large-units-font-weight;
46
+ @typography-data-large-units-font-size: var(
47
+ --typography-data-large-units-font-size,
48
+ 2.625rem
49
+ );
50
+ @typography-data-large-units-font-size-id: --typography-data-large-units-font-size;
51
+ @typography-data-large-units-line-height: var(
52
+ --typography-data-large-units-line-height,
53
+ 5.25rem
54
+ );
55
+ @typography-data-large-units-line-height-id: --typography-data-large-units-line-height;
56
+ @typography-data-large-units-letter-spacing: var(
57
+ --typography-data-large-units-letter-spacing,
58
+ normal
59
+ );
60
+ @typography-data-large-units-letter-spacing-id: --typography-data-large-units-letter-spacing;
61
+ @typography-data-medium-font-family: var(
62
+ --typography-data-medium-font-family,
63
+ "Inter",
64
+ "Noto Sans",
65
+ Helvetica,
66
+ Arial,
67
+ sans-serif
68
+ );
69
+ @typography-data-medium-font-family-id: --typography-data-medium-font-family;
70
+ @typography-data-medium-font-weight: var(
71
+ --typography-data-medium-font-weight,
72
+ 700
73
+ );
74
+ @typography-data-medium-font-weight-id: --typography-data-medium-font-weight;
75
+ @typography-data-medium-font-size: var(
76
+ --typography-data-medium-font-size,
77
+ 3rem
78
+ );
79
+ @typography-data-medium-font-size-id: --typography-data-medium-font-size;
80
+ @typography-data-medium-line-height: var(
81
+ --typography-data-medium-line-height,
82
+ 5rem
83
+ );
84
+ @typography-data-medium-line-height-id: --typography-data-medium-line-height;
85
+ @typography-data-medium-letter-spacing: var(
86
+ --typography-data-medium-letter-spacing,
87
+ normal
88
+ );
89
+ @typography-data-medium-letter-spacing-id: --typography-data-medium-letter-spacing;
90
+ @typography-data-medium-units-font-family: var(
91
+ --typography-data-medium-units-font-family,
92
+ "Inter",
93
+ "Noto Sans",
94
+ Helvetica,
95
+ Arial,
96
+ sans-serif
97
+ );
98
+ @typography-data-medium-units-font-family-id: --typography-data-medium-units-font-family;
99
+ @typography-data-medium-units-font-weight: var(
100
+ --typography-data-medium-units-font-weight,
101
+ 700
102
+ );
103
+ @typography-data-medium-units-font-weight-id: --typography-data-medium-units-font-weight;
104
+ @typography-data-medium-units-font-size: var(
105
+ --typography-data-medium-units-font-size,
106
+ 1.5rem
107
+ );
108
+ @typography-data-medium-units-font-size-id: --typography-data-medium-units-font-size;
109
+ @typography-data-medium-units-line-height: var(
110
+ --typography-data-medium-units-line-height,
111
+ 5rem
112
+ );
113
+ @typography-data-medium-units-line-height-id: --typography-data-medium-units-line-height;
114
+ @typography-data-medium-units-letter-spacing: var(
115
+ --typography-data-medium-units-letter-spacing,
116
+ normal
117
+ );
118
+ @typography-data-medium-units-letter-spacing-id: --typography-data-medium-units-letter-spacing;
119
+ @typography-data-small-font-family: var(
120
+ --typography-data-small-font-family,
121
+ "Greycliff CF",
122
+ "Noto Sans",
123
+ Helvetica,
124
+ Arial,
125
+ sans-serif
126
+ );
127
+ @typography-data-small-font-family-id: --typography-data-small-font-family;
128
+ @typography-data-small-font-weight: var(
129
+ --typography-data-small-font-weight,
130
+ 700
131
+ );
132
+ @typography-data-small-font-weight-id: --typography-data-small-font-weight;
133
+ @typography-data-small-font-size: var(
134
+ --typography-data-small-font-size,
135
+ 1.5rem
136
+ );
137
+ @typography-data-small-font-size-id: --typography-data-small-font-size;
138
+ @typography-data-small-line-height: var(
139
+ --typography-data-small-line-height,
140
+ 1.5rem
141
+ );
142
+ @typography-data-small-line-height-id: --typography-data-small-line-height;
143
+ @typography-data-small-letter-spacing: var(
144
+ --typography-data-small-letter-spacing,
145
+ normal
146
+ );
147
+ @typography-data-small-letter-spacing-id: --typography-data-small-letter-spacing;
148
+ @typography-data-small-units-font-family: var(
149
+ --typography-data-small-units-font-family,
150
+ "Greycliff CF",
151
+ "Noto Sans",
152
+ Helvetica,
153
+ Arial,
154
+ sans-serif
155
+ );
156
+ @typography-data-small-units-font-family-id: --typography-data-small-units-font-family;
157
+ @typography-data-small-units-font-weight: var(
158
+ --typography-data-small-units-font-weight,
159
+ 700
160
+ );
161
+ @typography-data-small-units-font-weight-id: --typography-data-small-units-font-weight;
162
+ @typography-data-small-units-font-size: var(
163
+ --typography-data-small-units-font-size,
164
+ 1.125rem
165
+ );
166
+ @typography-data-small-units-font-size-id: --typography-data-small-units-font-size;
167
+ @typography-data-small-units-line-height: var(
168
+ --typography-data-small-units-line-height,
169
+ 1.5rem
170
+ );
171
+ @typography-data-small-units-line-height-id: --typography-data-small-units-line-height;
172
+ @typography-data-small-units-letter-spacing: var(
173
+ --typography-data-small-units-letter-spacing,
174
+ normal
175
+ );
176
+ @typography-data-small-units-letter-spacing-id: --typography-data-small-units-letter-spacing;
177
+ @typography-display-0-font-family: var(
178
+ --typography-display-0-font-family,
179
+ "Tiempos Headline",
180
+ Georgia,
181
+ serif
182
+ );
183
+ @typography-display-0-font-family-id: --typography-display-0-font-family;
184
+ @typography-display-0-font-weight: var(--typography-display-0-font-weight, 800);
185
+ @typography-display-0-font-weight-id: --typography-display-0-font-weight;
186
+ @typography-display-0-font-size: var(--typography-display-0-font-size, 4.5rem);
187
+ @typography-display-0-font-size-id: --typography-display-0-font-size;
188
+ @typography-display-0-line-height: var(
189
+ --typography-display-0-line-height,
190
+ 5.25rem
191
+ );
192
+ @typography-display-0-line-height-id: --typography-display-0-line-height;
193
+ @typography-display-0-letter-spacing: var(
194
+ --typography-display-0-letter-spacing,
195
+ 0em
196
+ );
197
+ @typography-display-0-letter-spacing-id: --typography-display-0-letter-spacing;
198
+ @typography-heading-1-font-family: var(
199
+ --typography-heading-1-font-family,
200
+ "Inter",
201
+ "Noto Sans",
202
+ Helvetica,
203
+ Arial,
204
+ sans-serif
205
+ );
206
+ @typography-heading-1-font-family-id: --typography-heading-1-font-family;
207
+ @typography-heading-1-font-weight: var(--typography-heading-1-font-weight, 700);
208
+ @typography-heading-1-font-weight-id: --typography-heading-1-font-weight;
209
+ @typography-heading-1-font-size: var(
210
+ --typography-heading-1-font-size,
211
+ 2.125rem
212
+ );
213
+ @typography-heading-1-font-size-id: --typography-heading-1-font-size;
214
+ @typography-heading-1-line-height: var(
215
+ --typography-heading-1-line-height,
216
+ 2.625rem
217
+ );
218
+ @typography-heading-1-line-height-id: --typography-heading-1-line-height;
219
+ @typography-heading-1-letter-spacing: var(
220
+ --typography-heading-1-letter-spacing,
221
+ normal
222
+ );
223
+ @typography-heading-1-letter-spacing-id: --typography-heading-1-letter-spacing;
224
+ @typography-heading-2-font-family: var(
225
+ --typography-heading-2-font-family,
226
+ "Inter",
227
+ "Noto Sans",
228
+ Helvetica,
229
+ Arial,
230
+ sans-serif
231
+ );
232
+ @typography-heading-2-font-family-id: --typography-heading-2-font-family;
233
+ @typography-heading-2-font-weight: var(--typography-heading-2-font-weight, 700);
234
+ @typography-heading-2-font-weight-id: --typography-heading-2-font-weight;
235
+ @typography-heading-2-font-size: var(--typography-heading-2-font-size, 1.75rem);
236
+ @typography-heading-2-font-size-id: --typography-heading-2-font-size;
237
+ @typography-heading-2-line-height: var(
238
+ --typography-heading-2-line-height,
239
+ 2.25rem
240
+ );
241
+ @typography-heading-2-line-height-id: --typography-heading-2-line-height;
242
+ @typography-heading-2-letter-spacing: var(
243
+ --typography-heading-2-letter-spacing,
244
+ normal
245
+ );
246
+ @typography-heading-2-letter-spacing-id: --typography-heading-2-letter-spacing;
247
+ @typography-heading-3-font-family: var(
248
+ --typography-heading-3-font-family,
249
+ "Inter",
250
+ "Noto Sans",
251
+ Helvetica,
252
+ Arial,
253
+ sans-serif
254
+ );
255
+ @typography-heading-3-font-family-id: --typography-heading-3-font-family;
256
+ @typography-heading-3-font-weight: var(--typography-heading-3-font-weight, 700);
257
+ @typography-heading-3-font-weight-id: --typography-heading-3-font-weight;
258
+ @typography-heading-3-font-size: var(
259
+ --typography-heading-3-font-size,
260
+ 1.375rem
261
+ );
262
+ @typography-heading-3-font-size-id: --typography-heading-3-font-size;
263
+ @typography-heading-3-line-height: var(
264
+ --typography-heading-3-line-height,
265
+ 1.5rem
266
+ );
267
+ @typography-heading-3-line-height-id: --typography-heading-3-line-height;
268
+ @typography-heading-3-letter-spacing: var(
269
+ --typography-heading-3-letter-spacing,
270
+ normal
271
+ );
272
+ @typography-heading-3-letter-spacing-id: --typography-heading-3-letter-spacing;
273
+ @typography-heading-4-font-family: var(
274
+ --typography-heading-4-font-family,
275
+ "Inter",
276
+ "Noto Sans",
277
+ Helvetica,
278
+ Arial,
279
+ sans-serif
280
+ );
281
+ @typography-heading-4-font-family-id: --typography-heading-4-font-family;
282
+ @typography-heading-4-font-weight: var(--typography-heading-4-font-weight, 600);
283
+ @typography-heading-4-font-weight-id: --typography-heading-4-font-weight;
284
+ @typography-heading-4-font-size: var(
285
+ --typography-heading-4-font-size,
286
+ 1.125rem
287
+ );
288
+ @typography-heading-4-font-size-id: --typography-heading-4-font-size;
289
+ @typography-heading-4-line-height: var(
290
+ --typography-heading-4-line-height,
291
+ 1.5rem
292
+ );
293
+ @typography-heading-4-line-height-id: --typography-heading-4-line-height;
294
+ @typography-heading-4-letter-spacing: var(
295
+ --typography-heading-4-letter-spacing,
296
+ normal
297
+ );
298
+ @typography-heading-4-letter-spacing-id: --typography-heading-4-letter-spacing;
299
+ @typography-heading-5-font-family: var(
300
+ --typography-heading-5-font-family,
301
+ "Inter",
302
+ "Noto Sans",
303
+ Helvetica,
304
+ Arial,
305
+ sans-serif
306
+ );
307
+ @typography-heading-5-font-family-id: --typography-heading-5-font-family;
308
+ @typography-heading-5-font-weight: var(--typography-heading-5-font-weight, 600);
309
+ @typography-heading-5-font-weight-id: --typography-heading-5-font-weight;
310
+ @typography-heading-5-font-size: var(--typography-heading-5-font-size, 1rem);
311
+ @typography-heading-5-font-size-id: --typography-heading-5-font-size;
312
+ @typography-heading-5-line-height: var(
313
+ --typography-heading-5-line-height,
314
+ 1.5rem
315
+ );
316
+ @typography-heading-5-line-height-id: --typography-heading-5-line-height;
317
+ @typography-heading-5-letter-spacing: var(
318
+ --typography-heading-5-letter-spacing,
319
+ normal
320
+ );
321
+ @typography-heading-5-letter-spacing-id: --typography-heading-5-letter-spacing;
322
+ @typography-heading-6-font-family: var(
323
+ --typography-heading-6-font-family,
324
+ "Inter",
325
+ "Noto Sans",
326
+ Helvetica,
327
+ Arial,
328
+ sans-serif
329
+ );
330
+ @typography-heading-6-font-family-id: --typography-heading-6-font-family;
331
+ @typography-heading-6-font-weight: var(--typography-heading-6-font-weight, 700);
332
+ @typography-heading-6-font-weight-id: --typography-heading-6-font-weight;
333
+ @typography-heading-6-font-size: var(
334
+ --typography-heading-6-font-size,
335
+ 0.875rem
336
+ );
337
+ @typography-heading-6-font-size-id: --typography-heading-6-font-size;
338
+ @typography-heading-6-line-height: var(
339
+ --typography-heading-6-line-height,
340
+ 1.5rem
341
+ );
342
+ @typography-heading-6-line-height-id: --typography-heading-6-line-height;
343
+ @typography-heading-6-letter-spacing: var(
344
+ --typography-heading-6-letter-spacing,
345
+ normal
346
+ );
347
+ @typography-heading-6-letter-spacing-id: --typography-heading-6-letter-spacing;
348
+ @typography-paragraph-intro-lede-font-family: var(
349
+ --typography-paragraph-intro-lede-font-family,
350
+ "Inter",
351
+ "Noto Sans",
352
+ Helvetica,
353
+ Arial,
354
+ sans-serif
355
+ );
356
+ @typography-paragraph-intro-lede-font-family-id: --typography-paragraph-intro-lede-font-family;
357
+ @typography-paragraph-intro-lede-font-weight: var(
358
+ --typography-paragraph-intro-lede-font-weight,
359
+ 400
360
+ );
361
+ @typography-paragraph-intro-lede-font-weight-id: --typography-paragraph-intro-lede-font-weight;
362
+ @typography-paragraph-intro-lede-font-size: var(
363
+ --typography-paragraph-intro-lede-font-size,
364
+ 1.25rem
365
+ );
366
+ @typography-paragraph-intro-lede-font-size-id: --typography-paragraph-intro-lede-font-size;
367
+ @typography-paragraph-intro-lede-line-height: var(
368
+ --typography-paragraph-intro-lede-line-height,
369
+ 1.875rem
370
+ );
371
+ @typography-paragraph-intro-lede-line-height-id: --typography-paragraph-intro-lede-line-height;
372
+ @typography-paragraph-intro-lede-letter-spacing: var(
373
+ --typography-paragraph-intro-lede-letter-spacing,
374
+ -0.5px
375
+ );
376
+ @typography-paragraph-intro-lede-letter-spacing-id: --typography-paragraph-intro-lede-letter-spacing;
377
+ @typography-paragraph-body-font-family: var(
378
+ --typography-paragraph-body-font-family,
379
+ "Inter",
380
+ "Noto Sans",
381
+ Helvetica,
382
+ Arial,
383
+ sans-serif
384
+ );
385
+ @typography-paragraph-body-font-family-id: --typography-paragraph-body-font-family;
386
+ @typography-paragraph-body-font-weight: var(
387
+ --typography-paragraph-body-font-weight,
388
+ 400
389
+ );
390
+ @typography-paragraph-body-font-weight-id: --typography-paragraph-body-font-weight;
391
+ @typography-paragraph-body-font-size: var(
392
+ --typography-paragraph-body-font-size,
393
+ 1rem
394
+ );
395
+ @typography-paragraph-body-font-size-id: --typography-paragraph-body-font-size;
396
+ @typography-paragraph-body-line-height: var(
397
+ --typography-paragraph-body-line-height,
398
+ 1.5rem
399
+ );
400
+ @typography-paragraph-body-line-height-id: --typography-paragraph-body-line-height;
401
+ @typography-paragraph-body-letter-spacing: var(
402
+ --typography-paragraph-body-letter-spacing,
403
+ normal
404
+ );
405
+ @typography-paragraph-body-letter-spacing-id: --typography-paragraph-body-letter-spacing;
406
+ @typography-paragraph-small-font-family: var(
407
+ --typography-paragraph-small-font-family,
408
+ "Inter",
409
+ "Noto Sans",
410
+ Helvetica,
411
+ Arial,
412
+ sans-serif
413
+ );
414
+ @typography-paragraph-small-font-family-id: --typography-paragraph-small-font-family;
415
+ @typography-paragraph-small-font-weight: var(
416
+ --typography-paragraph-small-font-weight,
417
+ 400
418
+ );
419
+ @typography-paragraph-small-font-weight-id: --typography-paragraph-small-font-weight;
420
+ @typography-paragraph-small-font-size: var(
421
+ --typography-paragraph-small-font-size,
422
+ 0.875rem
423
+ );
424
+ @typography-paragraph-small-font-size-id: --typography-paragraph-small-font-size;
425
+ @typography-paragraph-small-line-height: var(
426
+ --typography-paragraph-small-line-height,
427
+ 1.125rem
428
+ );
429
+ @typography-paragraph-small-line-height-id: --typography-paragraph-small-line-height;
430
+ @typography-paragraph-small-letter-spacing: var(
431
+ --typography-paragraph-small-letter-spacing,
432
+ normal
433
+ );
434
+ @typography-paragraph-small-letter-spacing-id: --typography-paragraph-small-letter-spacing;
435
+ @typography-paragraph-extra-small-font-family: var(
436
+ --typography-paragraph-extra-small-font-family,
437
+ "Inter",
438
+ "Noto Sans",
439
+ Helvetica,
440
+ Arial,
441
+ sans-serif
442
+ );
443
+ @typography-paragraph-extra-small-font-family-id: --typography-paragraph-extra-small-font-family;
444
+ @typography-paragraph-extra-small-font-weight: var(
445
+ --typography-paragraph-extra-small-font-weight,
446
+ 400
447
+ );
448
+ @typography-paragraph-extra-small-font-weight-id: --typography-paragraph-extra-small-font-weight;
449
+ @typography-paragraph-extra-small-font-size: var(
450
+ --typography-paragraph-extra-small-font-size,
451
+ 0.75rem
452
+ );
453
+ @typography-paragraph-extra-small-font-size-id: --typography-paragraph-extra-small-font-size;
454
+ @typography-paragraph-extra-small-line-height: var(
455
+ --typography-paragraph-extra-small-line-height,
456
+ 1.125rem
457
+ );
458
+ @typography-paragraph-extra-small-line-height-id: --typography-paragraph-extra-small-line-height;
459
+ @typography-paragraph-extra-small-letter-spacing: var(
460
+ --typography-paragraph-extra-small-letter-spacing,
461
+ normal
462
+ );
463
+ @typography-paragraph-extra-small-letter-spacing-id: --typography-paragraph-extra-small-letter-spacing;
464
+ @typography-paragraph-bold-font-weight: var(
465
+ --typography-paragraph-bold-font-weight,
466
+ 600
467
+ );
468
+ @typography-paragraph-bold-font-weight-id: --typography-paragraph-bold-font-weight;
469
+ @typography-button-primary-font-family: var(
470
+ --typography-button-primary-font-family,
471
+ "Inter",
472
+ "Noto Sans",
473
+ Helvetica,
474
+ Arial,
475
+ sans-serif
476
+ );
477
+ @typography-button-primary-font-family-id: --typography-button-primary-font-family;
478
+ @typography-button-primary-font-weight: var(
479
+ --typography-button-primary-font-weight,
480
+ 700
481
+ );
482
+ @typography-button-primary-font-weight-id: --typography-button-primary-font-weight;
483
+ @typography-button-primary-font-size: var(
484
+ --typography-button-primary-font-size,
485
+ 1.125rem
486
+ );
487
+ @typography-button-primary-font-size-id: --typography-button-primary-font-size;
488
+ @typography-button-primary-line-height: var(
489
+ --typography-button-primary-line-height,
490
+ 1.5rem
491
+ );
492
+ @typography-button-primary-line-height-id: --typography-button-primary-line-height;
493
+ @typography-button-primary-letter-spacing: var(
494
+ --typography-button-primary-letter-spacing,
495
+ normal
496
+ );
497
+ @typography-button-primary-letter-spacing-id: --typography-button-primary-letter-spacing;
498
+ @typography-button-secondary-font-family: var(
499
+ --typography-button-secondary-font-family,
500
+ "Inter",
501
+ "Noto Sans",
502
+ Helvetica,
503
+ Arial,
504
+ sans-serif
505
+ );
506
+ @typography-button-secondary-font-family-id: --typography-button-secondary-font-family;
507
+ @typography-button-secondary-font-weight: var(
508
+ --typography-button-secondary-font-weight,
509
+ 500
510
+ );
511
+ @typography-button-secondary-font-weight-id: --typography-button-secondary-font-weight;
512
+ @typography-button-secondary-font-size: var(
513
+ --typography-button-secondary-font-size,
514
+ 1rem
515
+ );
516
+ @typography-button-secondary-font-size-id: --typography-button-secondary-font-size;
517
+ @typography-button-secondary-line-height: var(
518
+ --typography-button-secondary-line-height,
519
+ 1.5rem
520
+ );
521
+ @typography-button-secondary-line-height-id: --typography-button-secondary-line-height;
522
+ @typography-button-secondary-letter-spacing: var(
523
+ --typography-button-secondary-letter-spacing,
524
+ normal
525
+ );
526
+ @typography-button-secondary-letter-spacing-id: --typography-button-secondary-letter-spacing;
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@kaizen/design-tokens",
3
+ "description": "Tokens used in the Kaizen Design System",
4
+ "version": "3.1.0",
5
+ "homepage": "https://github.com/cultureamp/kaizen-design-system/tree/master/packages/design-tokens",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/cultureamp/kaizen-design-system.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/cultureamp/kaizen-design-system/issues"
12
+ },
13
+ "files": [
14
+ "tokens",
15
+ "sass",
16
+ "less",
17
+ "index.ts",
18
+ "src",
19
+ "react",
20
+ "dist",
21
+ "elm",
22
+ "!**/*.spec.*"
23
+ ],
24
+ "types": "dist/**/*.d.ts",
25
+ "main": "dist/index.js",
26
+ "private": false,
27
+ "license": "MIT",
28
+ "sideEffects": false,
29
+ "scripts": {
30
+ "test": "cd ../../ && yarn jest ./packages/design-tokens",
31
+ "build": "yarn clean && yarn prepublish",
32
+ "build:json": "yarn ts-node --files ./bin/buildCssVarTokens.ts",
33
+ "build:ts": "tsc --project tsconfig.dist.json",
34
+ "build:less": "json-to-flat-sass './tokens/*.json' 'less' --extension 'less' --caseType 'kebab' && prettier less/* --write",
35
+ "build:sass": "json-to-flat-sass './tokens/*.json' 'sass' --extension 'scss' --caseType 'kebab' && prettier sass/* --write",
36
+ "clean": "rimraf '?(docs|react|src|bin)/**/?(*.js*|*.d.ts)'",
37
+ "prepublish": "yarn build:json && yarn build:less && yarn build:sass && yarn build:ts"
38
+ },
39
+ "devDependencies": {
40
+ "@types/lodash.flatmap": "^4.5.3",
41
+ "@types/react-highlight": "^0.12.2",
42
+ "@types/yargs": "^16.0.0",
43
+ "json-to-flat-sass": "^1.0.0",
44
+ "lodash.flatmap": "^4.5.0",
45
+ "postcss": "^8.3.6",
46
+ "prettier": "*",
47
+ "react-highlight": "^0.13.0",
48
+ "react-intersection-observer": "^8.31.0",
49
+ "react-map-interaction": "^2.0.0",
50
+ "ts-node": "^9.1.1",
51
+ "yargs": "^16.2.0"
52
+ },
53
+ "dependencies": {
54
+ "@types/color-string": "^1.5.0",
55
+ "@types/lodash.kebabcase": "^4.1.3",
56
+ "color-string": "^1.5.3",
57
+ "lodash.kebabcase": "^4.1.1"
58
+ },
59
+ "peerDependencies": {
60
+ "react": ">=16"
61
+ },
62
+ "gitHead": "91e9d5802a86ef6ed02c00aadbcca7e3c3f92452"
63
+ }
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { ThemeManager, Theme } from "../";
3
+ export declare const ThemeContext: React.Context<Theme>;
4
+ /**
5
+ * Wrap your application in this provider using a ThemeManager, to synchronise it with a react context.
6
+ * This allows child react elements to more easily use theme variables, using the {@link useTheme} hook.
7
+ */
8
+ export declare const ThemeProvider: ({ themeManager, ...props }: {
9
+ themeManager: ThemeManager;
10
+ children: React.ReactNode;
11
+ }) => JSX.Element;
12
+ export declare const useTheme: () => Theme;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ exports.__esModule = true;
17
+ exports.useTheme = exports.ThemeProvider = exports.ThemeContext = void 0;
18
+ var react_1 = __importDefault(require("react"));
19
+ var __1 = require("../");
20
+ exports.ThemeContext = react_1["default"].createContext(__1.defaultTheme);
21
+ /**
22
+ * Wrap your application in this provider using a ThemeManager, to synchronise it with a react context.
23
+ * This allows child react elements to more easily use theme variables, using the {@link useTheme} hook.
24
+ */
25
+ exports.ThemeProvider = function (_a) {
26
+ var themeManager = _a.themeManager, props = __rest(_a, ["themeManager"]);
27
+ var _b = react_1["default"].useState(themeManager.getCurrentTheme()), theme = _b[0], setTheme = _b[1];
28
+ react_1["default"].useEffect(function () {
29
+ var cancelled = false;
30
+ var listener = function (newTheme) {
31
+ if (!cancelled)
32
+ setTheme(newTheme);
33
+ };
34
+ themeManager.addThemeChangeListener(listener);
35
+ return function () {
36
+ cancelled = true;
37
+ themeManager.removeThemeChangeListener(listener);
38
+ };
39
+ }, []);
40
+ return (react_1["default"].createElement(exports.ThemeContext.Provider, { value: theme }, props.children));
41
+ };
42
+ exports.useTheme = function () { return react_1["default"].useContext(exports.ThemeContext); };
43
+ //# sourceMappingURL=ThemeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["ThemeProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,yBAAuD;AAE1C,QAAA,YAAY,GAAG,kBAAK,CAAC,aAAa,CAAQ,gBAAY,CAAC,CAAA;AAEpE;;;GAGG;AACU,QAAA,aAAa,GAAG,UAAC,EAM7B;IALC,IAAA,YAAY,kBAAA,EACT,KAAK,cAFoB,gBAG7B,CADS;IAKF,IAAA,KAAoB,kBAAK,CAAC,QAAQ,CACtC,YAAY,CAAC,eAAe,EAAE,CAC/B,EAFM,KAAK,QAAA,EAAE,QAAQ,QAErB,CAAA;IACD,kBAAK,CAAC,SAAS,CAAC;QACd,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAM,QAAQ,GAAG,UAAC,QAAe;YAC/B,IAAI,CAAC,SAAS;gBAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACpC,CAAC,CAAA;QACD,YAAY,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;QAC7C,OAAO;YACL,SAAS,GAAG,IAAI,CAAA;YAChB,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAA;QAClD,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,iCAAC,oBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAChC,KAAK,CAAC,QAAQ,CACO,CACzB,CAAA;AACH,CAAC,CAAA;AAEY,QAAA,QAAQ,GAAG,cAAM,OAAA,kBAAK,CAAC,UAAU,CAAC,oBAAY,CAAC,EAA9B,CAA8B,CAAA"}
@@ -0,0 +1,39 @@
1
+ import React from "react"
2
+ import { ThemeManager, defaultTheme, Theme } from "../"
3
+
4
+ export const ThemeContext = React.createContext<Theme>(defaultTheme)
5
+
6
+ /**
7
+ * Wrap your application in this provider using a ThemeManager, to synchronise it with a react context.
8
+ * This allows child react elements to more easily use theme variables, using the {@link useTheme} hook.
9
+ */
10
+ export const ThemeProvider = ({
11
+ themeManager,
12
+ ...props
13
+ }: {
14
+ themeManager: ThemeManager
15
+ children: React.ReactNode
16
+ }) => {
17
+ const [theme, setTheme] = React.useState<Theme>(
18
+ themeManager.getCurrentTheme()
19
+ )
20
+ React.useEffect(() => {
21
+ let cancelled = false
22
+ const listener = (newTheme: Theme) => {
23
+ if (!cancelled) setTheme(newTheme)
24
+ }
25
+ themeManager.addThemeChangeListener(listener)
26
+ return () => {
27
+ cancelled = true
28
+ themeManager.removeThemeChangeListener(listener)
29
+ }
30
+ }, [])
31
+
32
+ return (
33
+ <ThemeContext.Provider value={theme}>
34
+ {props.children}
35
+ </ThemeContext.Provider>
36
+ )
37
+ }
38
+
39
+ export const useTheme = () => React.useContext(ThemeContext)
@@ -0,0 +1 @@
1
+ export * from "./ThemeProvider";