@astryxdesign/theme-matcha 0.7.3 → 0.7.4-canary.28b1cd4

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.
@@ -0,0 +1,448 @@
1
+ {
2
+ "recipe": "astryx-oklch-v1",
3
+ "vibrancy": 80,
4
+ "neutralProfile": "custom",
5
+ "modeStrategy": "light-and-dark",
6
+ "stops": [
7
+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90,
8
+ 95, 100
9
+ ],
10
+ "families": [
11
+ {
12
+ "id": "neutral",
13
+ "name": "Matcha Neutral",
14
+ "seed": "#707e46",
15
+ "kind": "neutral",
16
+ "anchors": [
17
+ {
18
+ "mode": "dark",
19
+ "stop": 5,
20
+ "color": "#12140e",
21
+ "policy": "exact"
22
+ },
23
+ {
24
+ "mode": "dark",
25
+ "stop": 10,
26
+ "color": "#1a1c14",
27
+ "policy": "exact"
28
+ },
29
+ {
30
+ "mode": "dark",
31
+ "stop": 15,
32
+ "color": "#1e2016",
33
+ "policy": "exact"
34
+ },
35
+ {
36
+ "mode": "dark",
37
+ "stop": 20,
38
+ "color": "#3e481d",
39
+ "policy": "exact"
40
+ },
41
+ {
42
+ "mode": "dark",
43
+ "stop": 30,
44
+ "color": "#5a6440",
45
+ "policy": "exact"
46
+ },
47
+ {
48
+ "mode": "dark",
49
+ "stop": 40,
50
+ "color": "#707e46",
51
+ "policy": "exact"
52
+ },
53
+ {
54
+ "mode": "dark",
55
+ "stop": 60,
56
+ "color": "#94a468",
57
+ "policy": "exact"
58
+ },
59
+ {
60
+ "mode": "dark",
61
+ "stop": 65,
62
+ "color": "#92af6a",
63
+ "policy": "exact"
64
+ },
65
+ {
66
+ "mode": "dark",
67
+ "stop": 70,
68
+ "color": "#a8bf6a",
69
+ "policy": "exact"
70
+ },
71
+ {
72
+ "mode": "dark",
73
+ "stop": 75,
74
+ "color": "#c0cba9",
75
+ "policy": "exact"
76
+ },
77
+ {
78
+ "mode": "light",
79
+ "stop": 20,
80
+ "color": "#3e481d",
81
+ "policy": "exact"
82
+ },
83
+ {
84
+ "mode": "light",
85
+ "stop": 30,
86
+ "color": "#5a6b2a",
87
+ "policy": "exact"
88
+ },
89
+ {
90
+ "mode": "light",
91
+ "stop": 40,
92
+ "color": "#707e46",
93
+ "policy": "exact"
94
+ },
95
+ {
96
+ "mode": "light",
97
+ "stop": 70,
98
+ "color": "#b7c29e",
99
+ "policy": "exact"
100
+ },
101
+ {
102
+ "mode": "light",
103
+ "stop": 75,
104
+ "color": "#c0cba9",
105
+ "policy": "exact"
106
+ },
107
+ {
108
+ "mode": "light",
109
+ "stop": 85,
110
+ "color": "#dce3ce",
111
+ "policy": "exact"
112
+ },
113
+ {
114
+ "mode": "light",
115
+ "stop": 95,
116
+ "color": "#f0f0e0",
117
+ "policy": "exact"
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ "id": "red",
123
+ "name": "Red Berry",
124
+ "seed": "#fd0000",
125
+ "anchors": [
126
+ {
127
+ "mode": "light",
128
+ "stop": 35,
129
+ "color": "#cc0000",
130
+ "policy": "exact"
131
+ },
132
+ {
133
+ "mode": "light",
134
+ "stop": 50,
135
+ "color": "#fd0000",
136
+ "policy": "exact"
137
+ },
138
+ {
139
+ "mode": "dark",
140
+ "stop": 50,
141
+ "color": "#fd0000",
142
+ "policy": "exact"
143
+ },
144
+ {
145
+ "mode": "dark",
146
+ "stop": 70,
147
+ "color": "#ff5c5c",
148
+ "policy": "exact"
149
+ },
150
+ {
151
+ "mode": "dark",
152
+ "stop": 75,
153
+ "color": "#ff7a7a",
154
+ "policy": "exact"
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ "id": "orange",
160
+ "name": "Roasted Orange",
161
+ "seed": "#c47620",
162
+ "anchors": [
163
+ {
164
+ "mode": "dark",
165
+ "stop": 50,
166
+ "color": "#c47620",
167
+ "policy": "exact"
168
+ },
169
+ {
170
+ "mode": "dark",
171
+ "stop": 70,
172
+ "color": "#d4903a",
173
+ "policy": "exact"
174
+ },
175
+ {
176
+ "mode": "dark",
177
+ "stop": 75,
178
+ "color": "#e0a04a",
179
+ "policy": "exact"
180
+ },
181
+ {
182
+ "mode": "light",
183
+ "stop": 30,
184
+ "color": "#7c5e3a",
185
+ "policy": "exact"
186
+ },
187
+ {
188
+ "mode": "light",
189
+ "stop": 35,
190
+ "color": "#a06018",
191
+ "policy": "exact"
192
+ },
193
+ {
194
+ "mode": "light",
195
+ "stop": 50,
196
+ "color": "#c47620",
197
+ "policy": "exact"
198
+ }
199
+ ]
200
+ },
201
+ {
202
+ "id": "yellow",
203
+ "name": "Tea Gold",
204
+ "seed": "#e8b800",
205
+ "anchors": []
206
+ },
207
+ {
208
+ "id": "green",
209
+ "name": "Matcha Green",
210
+ "seed": "#4d9900",
211
+ "anchors": [
212
+ {
213
+ "mode": "light",
214
+ "stop": 35,
215
+ "color": "#3d7a00",
216
+ "policy": "exact"
217
+ },
218
+ {
219
+ "mode": "light",
220
+ "stop": 50,
221
+ "color": "#4d9900",
222
+ "policy": "exact"
223
+ },
224
+ {
225
+ "mode": "dark",
226
+ "stop": 50,
227
+ "color": "#4d9900",
228
+ "policy": "exact"
229
+ },
230
+ {
231
+ "mode": "dark",
232
+ "stop": 70,
233
+ "color": "#6dbf2a",
234
+ "policy": "exact"
235
+ },
236
+ {
237
+ "mode": "dark",
238
+ "stop": 75,
239
+ "color": "#80d43a",
240
+ "policy": "exact"
241
+ }
242
+ ]
243
+ },
244
+ {
245
+ "id": "teal",
246
+ "name": "Botanical Teal",
247
+ "seed": "#2e6b5a",
248
+ "anchors": [
249
+ {
250
+ "mode": "dark",
251
+ "stop": 50,
252
+ "color": "#2e6b5a",
253
+ "policy": "exact"
254
+ },
255
+ {
256
+ "mode": "dark",
257
+ "stop": 70,
258
+ "color": "#5ab898",
259
+ "policy": "exact"
260
+ },
261
+ {
262
+ "mode": "dark",
263
+ "stop": 75,
264
+ "color": "#6ccaaa",
265
+ "policy": "exact"
266
+ },
267
+ {
268
+ "mode": "light",
269
+ "stop": 35,
270
+ "color": "#245546",
271
+ "policy": "exact"
272
+ },
273
+ {
274
+ "mode": "light",
275
+ "stop": 50,
276
+ "color": "#2e6b5a",
277
+ "policy": "exact"
278
+ },
279
+ {
280
+ "mode": "light",
281
+ "stop": 55,
282
+ "color": "#3a7c6b",
283
+ "policy": "exact"
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "id": "cyan",
289
+ "name": "Mineral Cyan",
290
+ "seed": "#3a7c7c",
291
+ "anchors": [
292
+ {
293
+ "mode": "light",
294
+ "stop": 35,
295
+ "color": "#2e6060",
296
+ "policy": "exact"
297
+ },
298
+ {
299
+ "mode": "light",
300
+ "stop": 50,
301
+ "color": "#3a7c7c",
302
+ "policy": "exact"
303
+ },
304
+ {
305
+ "mode": "dark",
306
+ "stop": 50,
307
+ "color": "#3a7c7c",
308
+ "policy": "exact"
309
+ },
310
+ {
311
+ "mode": "dark",
312
+ "stop": 70,
313
+ "color": "#70c4c4",
314
+ "policy": "exact"
315
+ },
316
+ {
317
+ "mode": "dark",
318
+ "stop": 75,
319
+ "color": "#82d4d4",
320
+ "policy": "exact"
321
+ }
322
+ ]
323
+ },
324
+ {
325
+ "id": "blue",
326
+ "name": "Rain Blue",
327
+ "seed": "#3a5e8c",
328
+ "anchors": [
329
+ {
330
+ "mode": "light",
331
+ "stop": 35,
332
+ "color": "#2e4a6e",
333
+ "policy": "exact"
334
+ },
335
+ {
336
+ "mode": "light",
337
+ "stop": 50,
338
+ "color": "#3a5e8c",
339
+ "policy": "exact"
340
+ },
341
+ {
342
+ "mode": "dark",
343
+ "stop": 50,
344
+ "color": "#3a5e8c",
345
+ "policy": "exact"
346
+ },
347
+ {
348
+ "mode": "dark",
349
+ "stop": 70,
350
+ "color": "#7ba8d4",
351
+ "policy": "exact"
352
+ },
353
+ {
354
+ "mode": "dark",
355
+ "stop": 75,
356
+ "color": "#8dbce0",
357
+ "policy": "exact"
358
+ }
359
+ ]
360
+ },
361
+ {
362
+ "id": "purple",
363
+ "name": "Wisteria",
364
+ "seed": "#6b4a8c",
365
+ "anchors": [
366
+ {
367
+ "mode": "light",
368
+ "stop": 35,
369
+ "color": "#553a70",
370
+ "policy": "exact"
371
+ },
372
+ {
373
+ "mode": "light",
374
+ "stop": 50,
375
+ "color": "#6b4a8c",
376
+ "policy": "exact"
377
+ },
378
+ {
379
+ "mode": "dark",
380
+ "stop": 50,
381
+ "color": "#6b4a8c",
382
+ "policy": "exact"
383
+ },
384
+ {
385
+ "mode": "dark",
386
+ "stop": 70,
387
+ "color": "#b08ed4",
388
+ "policy": "exact"
389
+ },
390
+ {
391
+ "mode": "dark",
392
+ "stop": 75,
393
+ "color": "#c0a0e0",
394
+ "policy": "exact"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ "id": "pink",
400
+ "name": "Camellia Pink",
401
+ "seed": "#c44a70",
402
+ "anchors": [
403
+ {
404
+ "mode": "dark",
405
+ "stop": 50,
406
+ "color": "#c44a70",
407
+ "policy": "exact"
408
+ },
409
+ {
410
+ "mode": "dark",
411
+ "stop": 65,
412
+ "color": "#d47a7a",
413
+ "policy": "exact"
414
+ },
415
+ {
416
+ "mode": "dark",
417
+ "stop": 70,
418
+ "color": "#e07a9a",
419
+ "policy": "exact"
420
+ },
421
+ {
422
+ "mode": "dark",
423
+ "stop": 75,
424
+ "color": "#f08aaa",
425
+ "policy": "exact"
426
+ },
427
+ {
428
+ "mode": "light",
429
+ "stop": 30,
430
+ "color": "#8c3a3a",
431
+ "policy": "exact"
432
+ },
433
+ {
434
+ "mode": "light",
435
+ "stop": 35,
436
+ "color": "#a03a5a",
437
+ "policy": "exact"
438
+ },
439
+ {
440
+ "mode": "light",
441
+ "stop": 50,
442
+ "color": "#c44a70",
443
+ "policy": "exact"
444
+ }
445
+ ]
446
+ }
447
+ ]
448
+ }
@@ -0,0 +1,48 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {readFileSync} from 'node:fs';
4
+ import {describe, expect, it} from 'vitest';
5
+ import {matchaTheme} from './matchaTheme';
6
+
7
+ const source = readFileSync(
8
+ new URL('./matchaTheme.ts', import.meta.url),
9
+ 'utf8',
10
+ );
11
+
12
+ describe('matcha color token mapping completeness', () => {
13
+ it('does not redefine the data-visualization color system', () => {
14
+ expect(
15
+ Object.keys(matchaTheme.tokens).filter(name =>
16
+ name.startsWith('--color-data-'),
17
+ ),
18
+ ).toEqual([]);
19
+ });
20
+
21
+ it('keeps every root color value concrete', () => {
22
+ for (const [name, value] of Object.entries(matchaTheme.tokens)) {
23
+ if (!name.startsWith('--color-')) {
24
+ continue;
25
+ }
26
+ expect(typeof value, name).toBe('string');
27
+ expect(value, name).toMatch(
28
+ /^(?:transparent|#[0-9a-f]{6}(?:[0-9a-f]{2})?|light-dark\(#[0-9a-f]{6}(?:[0-9a-f]{2})?, #[0-9a-f]{6}(?:[0-9a-f]{2})?\)|color-mix\(.+\)|var\(.+\))$/i,
29
+ );
30
+ }
31
+ });
32
+
33
+ it('imports only the selected runtime palette projection', () => {
34
+ const relativeImports = [...source.matchAll(/from ['"](\.[^'"]+)['"]/g)]
35
+ .map(match => match[1])
36
+ .sort();
37
+ expect(relativeImports).toEqual([
38
+ './icons',
39
+ './matchaPaletteRefs.generated',
40
+ ]);
41
+ });
42
+
43
+ it('uses no one-off color literals in the maintained theme source', () => {
44
+ expect(source).not.toMatch(
45
+ /#[0-9a-f]{3,8}\b|\brgba?\(|\bhsl[a]?\(|\boklch\(|\bblack\b|\bwhite\b/i,
46
+ );
47
+ });
48
+ });
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ // Generated from the committed full palette for the stops used by Matcha's
4
+ // theme source. Regenerate with `pnpm generate:matcha-palette-refs`.
5
+ // Keep the complete palette available for authoring and audits without
6
+ // making consumers pay for unused palette stops.
7
+ // prettier-ignore
8
+ export const matchaPaletteRefs = {
9
+ neutral: {
10
+ light: {0: '#000000', 20: '#3e481d', 30: '#5a6b2a', 40: '#707e46', 70: '#b7c29e', 75: '#c0cba9', 85: '#dce3ce', 95: '#f0f0e0', 100: '#ffffff'},
11
+ dark: {0: '#000000', 5: '#12140e', 10: '#1a1c14', 15: '#1e2016', 20: '#3e481d', 30: '#5a6440', 40: '#707e46', 60: '#94a468', 65: '#92af6a', 70: '#a8bf6a', 75: '#c0cba9', 100: '#ffffff'},
12
+ },
13
+ teal: {
14
+ light: {35: '#245546', 50: '#2e6b5a', 55: '#3a7c6b'},
15
+ dark: {70: '#5ab898', 75: '#6ccaaa'},
16
+ },
17
+ yellow: {
18
+ light: {45: '#836700', 65: '#c19800', 80: '#f2c000'},
19
+ dark: {70: '#d1a500', 75: '#e0b318', 85: '#f6d066', 90: '#ffe08b'},
20
+ },
21
+ blue: {
22
+ light: {35: '#2e4a6e', 50: '#3a5e8c'},
23
+ dark: {50: '#3a5e8c', 70: '#7ba8d4', 75: '#8dbce0'},
24
+ },
25
+ purple: {
26
+ light: {35: '#553a70', 50: '#6b4a8c'},
27
+ dark: {70: '#b08ed4', 75: '#c0a0e0'},
28
+ },
29
+ pink: {
30
+ light: {30: '#8c3a3a', 35: '#a03a5a', 50: '#c44a70'},
31
+ dark: {65: '#d47a7a', 70: '#e07a9a', 75: '#f08aaa'},
32
+ },
33
+ orange: {
34
+ light: {30: '#7c5e3a', 35: '#a06018', 50: '#c47620'},
35
+ dark: {70: '#d4903a', 75: '#e0a04a'},
36
+ },
37
+ green: {
38
+ light: {35: '#3d7a00', 50: '#4d9900'},
39
+ dark: {70: '#6dbf2a', 75: '#80d43a'},
40
+ },
41
+ red: {
42
+ light: {35: '#cc0000', 50: '#fd0000'},
43
+ dark: {70: '#ff5c5c', 75: '#ff7a7a'},
44
+ },
45
+ cyan: {
46
+ light: {35: '#2e6060', 50: '#3a7c7c'},
47
+ dark: {50: '#3a7c7c', 70: '#70c4c4', 75: '#82d4d4'},
48
+ },
49
+ } as const;
50
+
51
+ export default matchaPaletteRefs;