@astryxdesign/theme-matcha 0.7.3 → 0.7.4-canary.10b832e

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,501 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ // Generated by astryx-oklch-v1. Review before committing.
4
+ export const black = '#000000' as const;
5
+ export const white = '#ffffff' as const;
6
+
7
+ // prettier-ignore
8
+ export const palette = {
9
+ "neutral": {
10
+ "name": "Matcha Neutral",
11
+ "light": {
12
+ "0": "#000000",
13
+ "5": "#111604",
14
+ "10": "#21270a",
15
+ "15": "#313914",
16
+ "20": "#3e481d",
17
+ "25": "#4c5924",
18
+ "30": "#5a6b2a",
19
+ "35": "#657438",
20
+ "40": "#707e46",
21
+ "45": "#7c8a54",
22
+ "50": "#879661",
23
+ "55": "#92a06f",
24
+ "60": "#9dab7d",
25
+ "65": "#aab58d",
26
+ "70": "#b7c29e",
27
+ "75": "#c0cba9",
28
+ "80": "#ced7bc",
29
+ "85": "#dce3ce",
30
+ "90": "#e7ead4",
31
+ "95": "#f0f0e0",
32
+ "100": "#ffffff"
33
+ },
34
+ "dark": {
35
+ "0": "#000000",
36
+ "5": "#12140e",
37
+ "10": "#1a1c14",
38
+ "15": "#1e2016",
39
+ "20": "#3e481d",
40
+ "25": "#4c552e",
41
+ "30": "#5a6440",
42
+ "35": "#657144",
43
+ "40": "#707e46",
44
+ "45": "#7a894f",
45
+ "50": "#829156",
46
+ "55": "#89995d",
47
+ "60": "#94a468",
48
+ "65": "#92af6a",
49
+ "70": "#a8bf6a",
50
+ "75": "#c0cba9",
51
+ "80": "#cdd8b9",
52
+ "85": "#d9e1c9",
53
+ "90": "#e4ead8",
54
+ "95": "#f0f4e8",
55
+ "100": "#ffffff"
56
+ }
57
+ },
58
+ "red": {
59
+ "name": "Red Berry",
60
+ "light": {
61
+ "0": "#000000",
62
+ "5": "#2c0000",
63
+ "10": "#3e0000",
64
+ "15": "#540000",
65
+ "20": "#710000",
66
+ "25": "#920000",
67
+ "30": "#b10000",
68
+ "35": "#cc0000",
69
+ "40": "#dd0000",
70
+ "45": "#eb0000",
71
+ "50": "#fd0000",
72
+ "55": "#ff4435",
73
+ "60": "#ff5d4c",
74
+ "65": "#ff705f",
75
+ "70": "#ff8372",
76
+ "75": "#ff9989",
77
+ "80": "#ffafa2",
78
+ "85": "#ffc4ba",
79
+ "90": "#ffd8d2",
80
+ "95": "#ffece8",
81
+ "100": "#ffffff"
82
+ },
83
+ "dark": {
84
+ "0": "#000000",
85
+ "5": "#2c0000",
86
+ "10": "#3e0000",
87
+ "15": "#500000",
88
+ "20": "#630000",
89
+ "25": "#760000",
90
+ "30": "#8d0000",
91
+ "35": "#a90000",
92
+ "40": "#c70000",
93
+ "45": "#e40000",
94
+ "50": "#fd0000",
95
+ "55": "#ff3731",
96
+ "60": "#ff3d3c",
97
+ "65": "#ff4446",
98
+ "70": "#ff5c5c",
99
+ "75": "#ff7a7a",
100
+ "80": "#ff9794",
101
+ "85": "#ffb3b0",
102
+ "90": "#ffd0cd",
103
+ "95": "#ffeae8",
104
+ "100": "#ffffff"
105
+ }
106
+ },
107
+ "orange": {
108
+ "name": "Roasted Orange",
109
+ "light": {
110
+ "0": "#000000",
111
+ "5": "#1e0c00",
112
+ "10": "#2d1903",
113
+ "15": "#402910",
114
+ "20": "#553d21",
115
+ "25": "#6a5031",
116
+ "30": "#7c5e3a",
117
+ "35": "#a06018",
118
+ "40": "#ad681b",
119
+ "45": "#b96d1d",
120
+ "50": "#c47620",
121
+ "55": "#d47f20",
122
+ "60": "#e0851b",
123
+ "65": "#ec8a13",
124
+ "70": "#f89007",
125
+ "75": "#ff9f3a",
126
+ "80": "#ffb470",
127
+ "85": "#ffc898",
128
+ "90": "#ffdbbc",
129
+ "95": "#ffedde",
130
+ "100": "#ffffff"
131
+ },
132
+ "dark": {
133
+ "0": "#000000",
134
+ "5": "#230700",
135
+ "10": "#311100",
136
+ "15": "#3f1a00",
137
+ "20": "#4e2300",
138
+ "25": "#5d2c00",
139
+ "30": "#6f3802",
140
+ "35": "#854709",
141
+ "40": "#9c5613",
142
+ "45": "#b3671b",
143
+ "50": "#c47620",
144
+ "55": "#cd7e26",
145
+ "60": "#cd832e",
146
+ "65": "#cc8735",
147
+ "70": "#d4903a",
148
+ "75": "#e0a04a",
149
+ "80": "#ecb062",
150
+ "85": "#f3c48b",
151
+ "90": "#f8d9b3",
152
+ "95": "#fdedda",
153
+ "100": "#ffffff"
154
+ }
155
+ },
156
+ "yellow": {
157
+ "name": "Tea Gold",
158
+ "light": {
159
+ "0": "#000000",
160
+ "5": "#190f00",
161
+ "10": "#251a00",
162
+ "15": "#312400",
163
+ "20": "#3e2e00",
164
+ "25": "#4b3900",
165
+ "30": "#584400",
166
+ "35": "#664f00",
167
+ "40": "#755b00",
168
+ "45": "#836700",
169
+ "50": "#927300",
170
+ "55": "#a17f00",
171
+ "60": "#b18c00",
172
+ "65": "#c19800",
173
+ "70": "#d1a500",
174
+ "75": "#e1b200",
175
+ "80": "#f2c000",
176
+ "85": "#fccf47",
177
+ "90": "#ffe08b",
178
+ "95": "#fff0c8",
179
+ "100": "#ffffff"
180
+ },
181
+ "dark": {
182
+ "0": "#000000",
183
+ "5": "#190f00",
184
+ "10": "#251a00",
185
+ "15": "#312400",
186
+ "20": "#3e2e00",
187
+ "25": "#4b3900",
188
+ "30": "#584400",
189
+ "35": "#664f00",
190
+ "40": "#755b00",
191
+ "45": "#836700",
192
+ "50": "#927300",
193
+ "55": "#a17f00",
194
+ "60": "#b18c00",
195
+ "65": "#c19800",
196
+ "70": "#d1a500",
197
+ "75": "#e0b318",
198
+ "80": "#ebc145",
199
+ "85": "#f6d066",
200
+ "90": "#ffe08b",
201
+ "95": "#fff0c8",
202
+ "100": "#ffffff"
203
+ }
204
+ },
205
+ "green": {
206
+ "name": "Matcha Green",
207
+ "light": {
208
+ "0": "#000000",
209
+ "5": "#031600",
210
+ "10": "#0a2200",
211
+ "15": "#123000",
212
+ "20": "#1d4200",
213
+ "25": "#285600",
214
+ "30": "#346a00",
215
+ "35": "#3d7a00",
216
+ "40": "#438500",
217
+ "45": "#478e00",
218
+ "50": "#4d9900",
219
+ "55": "#55a701",
220
+ "60": "#61b026",
221
+ "65": "#6fb93e",
222
+ "70": "#7ec356",
223
+ "75": "#90cd6f",
224
+ "80": "#a4d888",
225
+ "85": "#b7e4a0",
226
+ "90": "#caf0b8",
227
+ "95": "#defbd0",
228
+ "100": "#ffffff"
229
+ },
230
+ "dark": {
231
+ "0": "#000000",
232
+ "5": "#031600",
233
+ "10": "#092200",
234
+ "15": "#112e00",
235
+ "20": "#183a00",
236
+ "25": "#1f4700",
237
+ "30": "#265500",
238
+ "35": "#306600",
239
+ "40": "#397800",
240
+ "45": "#438900",
241
+ "50": "#4d9900",
242
+ "55": "#56a40e",
243
+ "60": "#5aad05",
244
+ "65": "#5fb50a",
245
+ "70": "#6dbf2a",
246
+ "75": "#80d43a",
247
+ "80": "#96e061",
248
+ "85": "#aee988",
249
+ "90": "#c7f2ad",
250
+ "95": "#dffbcf",
251
+ "100": "#ffffff"
252
+ }
253
+ },
254
+ "teal": {
255
+ "name": "Botanical Teal",
256
+ "light": {
257
+ "0": "#000000",
258
+ "5": "#00160e",
259
+ "10": "#002318",
260
+ "15": "#022d21",
261
+ "20": "#0b362a",
262
+ "25": "#153f32",
263
+ "30": "#1e493c",
264
+ "35": "#245546",
265
+ "40": "#275d4d",
266
+ "45": "#2a6252",
267
+ "50": "#2e6b5a",
268
+ "55": "#3a7c6b",
269
+ "60": "#3c8e79",
270
+ "65": "#38a48b",
271
+ "70": "#4ab99f",
272
+ "75": "#63cdb2",
273
+ "80": "#7fdbc2",
274
+ "85": "#9be7d1",
275
+ "90": "#b4f2df",
276
+ "95": "#cefdee",
277
+ "100": "#ffffff"
278
+ },
279
+ "dark": {
280
+ "0": "#000000",
281
+ "5": "#00160f",
282
+ "10": "#002219",
283
+ "15": "#002e23",
284
+ "20": "#003a2d",
285
+ "25": "#004737",
286
+ "30": "#065140",
287
+ "35": "#145646",
288
+ "40": "#1f5a4b",
289
+ "45": "#286051",
290
+ "50": "#2e6b5a",
291
+ "55": "#307c67",
292
+ "60": "#369277",
293
+ "65": "#45a889",
294
+ "70": "#5ab898",
295
+ "75": "#6ccaaa",
296
+ "80": "#87d5b9",
297
+ "85": "#a1e2c9",
298
+ "90": "#b9efdb",
299
+ "95": "#d3fceb",
300
+ "100": "#ffffff"
301
+ }
302
+ },
303
+ "cyan": {
304
+ "name": "Mineral Cyan",
305
+ "light": {
306
+ "0": "#000000",
307
+ "5": "#001616",
308
+ "10": "#002122",
309
+ "15": "#032d2d",
310
+ "20": "#0f3939",
311
+ "25": "#1b4646",
312
+ "30": "#275352",
313
+ "35": "#2e6060",
314
+ "40": "#326b6a",
315
+ "45": "#367172",
316
+ "50": "#3a7c7c",
317
+ "55": "#3b8b8c",
318
+ "60": "#369c9d",
319
+ "65": "#2aafb0",
320
+ "70": "#1cc2c3",
321
+ "75": "#53cecf",
322
+ "80": "#7ad9d9",
323
+ "85": "#9ae4e4",
324
+ "90": "#b5efef",
325
+ "95": "#cffbfa",
326
+ "100": "#ffffff"
327
+ },
328
+ "dark": {
329
+ "0": "#000000",
330
+ "5": "#001616",
331
+ "10": "#002122",
332
+ "15": "#002d2d",
333
+ "20": "#003939",
334
+ "25": "#004546",
335
+ "30": "#085151",
336
+ "35": "#185b5c",
337
+ "40": "#276565",
338
+ "45": "#326f70",
339
+ "50": "#3a7c7c",
340
+ "55": "#418c8d",
341
+ "60": "#4ba0a1",
342
+ "65": "#55b5b5",
343
+ "70": "#70c4c4",
344
+ "75": "#82d4d4",
345
+ "80": "#9cdede",
346
+ "85": "#b1e7e7",
347
+ "90": "#c3f1f0",
348
+ "95": "#d5fbfa",
349
+ "100": "#ffffff"
350
+ }
351
+ },
352
+ "blue": {
353
+ "name": "Rain Blue",
354
+ "light": {
355
+ "0": "#000000",
356
+ "5": "#000f31",
357
+ "10": "#001a41",
358
+ "15": "#03244d",
359
+ "20": "#0f2e54",
360
+ "25": "#1c3659",
361
+ "30": "#274060",
362
+ "35": "#2e4a6e",
363
+ "40": "#32527b",
364
+ "45": "#365680",
365
+ "50": "#3a5e8c",
366
+ "55": "#446da1",
367
+ "60": "#4b81c3",
368
+ "65": "#5d96de",
369
+ "70": "#71abf5",
370
+ "75": "#88bcff",
371
+ "80": "#a0caff",
372
+ "85": "#b9d7ff",
373
+ "90": "#d0e5ff",
374
+ "95": "#e8f2ff",
375
+ "100": "#ffffff"
376
+ },
377
+ "dark": {
378
+ "0": "#000000",
379
+ "5": "#000f30",
380
+ "10": "#001a41",
381
+ "15": "#002452",
382
+ "20": "#002f65",
383
+ "25": "#003978",
384
+ "30": "#054385",
385
+ "35": "#124989",
386
+ "40": "#1e4e87",
387
+ "45": "#2d5485",
388
+ "50": "#3a5e8c",
389
+ "55": "#466f9d",
390
+ "60": "#5683b3",
391
+ "65": "#6897c9",
392
+ "70": "#7ba8d4",
393
+ "75": "#8dbce0",
394
+ "80": "#a7c9e3",
395
+ "85": "#bdd6ea",
396
+ "90": "#d2e4f3",
397
+ "95": "#e6f2fb",
398
+ "100": "#ffffff"
399
+ }
400
+ },
401
+ "purple": {
402
+ "name": "Wisteria",
403
+ "light": {
404
+ "0": "#000000",
405
+ "5": "#1b012e",
406
+ "10": "#290343",
407
+ "15": "#330a51",
408
+ "20": "#3b175a",
409
+ "25": "#43245f",
410
+ "30": "#4b2f64",
411
+ "35": "#553a70",
412
+ "40": "#5e407b",
413
+ "45": "#634382",
414
+ "50": "#6b4a8c",
415
+ "55": "#7b589f",
416
+ "60": "#9168bc",
417
+ "65": "#aa7ada",
418
+ "70": "#c18cf6",
419
+ "75": "#cea1ff",
420
+ "80": "#d8b4ff",
421
+ "85": "#e1c8ff",
422
+ "90": "#ebdaff",
423
+ "95": "#f5edff",
424
+ "100": "#ffffff"
425
+ },
426
+ "dark": {
427
+ "0": "#000000",
428
+ "5": "#19042b",
429
+ "10": "#27083e",
430
+ "15": "#330f50",
431
+ "20": "#401760",
432
+ "25": "#4d2171",
433
+ "30": "#572a7c",
434
+ "35": "#5b3180",
435
+ "40": "#5e3881",
436
+ "45": "#624084",
437
+ "50": "#6b4a8c",
438
+ "55": "#7a589d",
439
+ "60": "#8d6bb1",
440
+ "65": "#a07dc6",
441
+ "70": "#b08ed4",
442
+ "75": "#c0a0e0",
443
+ "80": "#cbb1e8",
444
+ "85": "#d9c5ee",
445
+ "90": "#e7d9f6",
446
+ "95": "#f3edfc",
447
+ "100": "#ffffff"
448
+ }
449
+ },
450
+ "pink": {
451
+ "name": "Camellia Pink",
452
+ "light": {
453
+ "0": "#000000",
454
+ "5": "#2c0001",
455
+ "10": "#3e0407",
456
+ "15": "#501213",
457
+ "20": "#642223",
458
+ "25": "#783130",
459
+ "30": "#8c3a3a",
460
+ "35": "#a03a5a",
461
+ "40": "#ae3e61",
462
+ "45": "#b84267",
463
+ "50": "#c44a70",
464
+ "55": "#d5547b",
465
+ "60": "#e85b86",
466
+ "65": "#f86592",
467
+ "70": "#fd7ba0",
468
+ "75": "#ff93af",
469
+ "80": "#ffabbf",
470
+ "85": "#ffc1cf",
471
+ "90": "#ffd6df",
472
+ "95": "#ffebef",
473
+ "100": "#ffffff"
474
+ },
475
+ "dark": {
476
+ "0": "#000000",
477
+ "5": "#2a000d",
478
+ "10": "#3c0016",
479
+ "15": "#4d001f",
480
+ "20": "#5f0029",
481
+ "25": "#720032",
482
+ "30": "#85053d",
483
+ "35": "#981449",
484
+ "40": "#a82856",
485
+ "45": "#b63b63",
486
+ "50": "#c44a70",
487
+ "55": "#cd5a71",
488
+ "60": "#cf6a75",
489
+ "65": "#d47a7a",
490
+ "70": "#e07a9a",
491
+ "75": "#f08aaa",
492
+ "80": "#f1a3ba",
493
+ "85": "#f5bbcb",
494
+ "90": "#fad3dd",
495
+ "95": "#fdeaef",
496
+ "100": "#ffffff"
497
+ }
498
+ }
499
+ } as const;
500
+
501
+ export default palette;
@@ -0,0 +1,50 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {describe, expect, it} from 'vitest';
4
+ import {matchaPalettes} from './matchaPalettes';
5
+
6
+ const stops = [
7
+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
8
+ 100,
9
+ ] as const;
10
+ const families = [
11
+ 'neutral',
12
+ 'blue',
13
+ 'cyan',
14
+ 'green',
15
+ 'orange',
16
+ 'pink',
17
+ 'purple',
18
+ 'red',
19
+ 'teal',
20
+ 'yellow',
21
+ ] as const;
22
+
23
+ describe('matcha palette artifact', () => {
24
+ it('exposes complete reviewed light and dark ramps', () => {
25
+ expect(new Set(Object.keys(matchaPalettes))).toEqual(
26
+ new Set(['black', 'white', ...families]),
27
+ );
28
+ for (const familyName of families) {
29
+ const family = matchaPalettes[familyName];
30
+ for (const mode of ['light', 'dark'] as const) {
31
+ for (const stop of stops) {
32
+ expect(family[mode][stop]).toMatch(/^#[0-9a-f]{6}$/i);
33
+ }
34
+ expect(family[mode][0]).toBe('#000000');
35
+ expect(family[mode][100]).toBe('#ffffff');
36
+ }
37
+ }
38
+ });
39
+
40
+ it('keeps Matcha semantic, categorical, and Tea Gold values exact', () => {
41
+ expect(matchaPalettes.neutral.light[20]).toBe('#3e481d');
42
+ expect(matchaPalettes.neutral.light[40]).toBe('#707e46');
43
+ expect(matchaPalettes.neutral.light[75]).toBe('#c0cba9');
44
+ expect(matchaPalettes.neutral.light[95]).toBe('#f0f0e0');
45
+ expect(matchaPalettes.neutral.dark[5]).toBe('#12140e');
46
+ expect(matchaPalettes.neutral.dark[75]).toBe('#c0cba9');
47
+ expect(matchaPalettes.yellow.light[80]).toBe('#f2c000');
48
+ expect(matchaPalettes.yellow.dark[85]).toBe('#f6d066');
49
+ });
50
+ });
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {black, palette, white} from './matchaPalettes.generated';
4
+
5
+ /** Matcha's reviewed light and dark palette, generated from ../palette.config.json. */
6
+ export const matchaPalettes = {
7
+ black,
8
+ white,
9
+ neutral: palette.neutral,
10
+ red: palette.red,
11
+ orange: palette.orange,
12
+ yellow: palette.yellow,
13
+ green: palette.green,
14
+ teal: palette.teal,
15
+ cyan: palette.cyan,
16
+ blue: palette.blue,
17
+ purple: palette.purple,
18
+ pink: palette.pink,
19
+ } as const;
20
+
21
+ export default matchaPalettes;
@@ -0,0 +1,77 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {describe, expect, it} from 'vitest';
4
+ import {resolveThemeTokens} from '@astryxdesign/core/theme';
5
+ import {matchaPalettes} from './matchaPalettes';
6
+ import {matchaTheme} from './matchaTheme';
7
+
8
+ const categoricalFamilies = [
9
+ 'blue',
10
+ 'cyan',
11
+ 'green',
12
+ 'orange',
13
+ 'pink',
14
+ 'purple',
15
+ 'red',
16
+ 'teal',
17
+ ] as const;
18
+
19
+ describe('matcha palette mapping', () => {
20
+ it.each(['light', 'dark'] as const)(
21
+ 'maps the neutral surface ladder in %s mode',
22
+ mode => {
23
+ const tokens = resolveThemeTokens(matchaTheme, {mode});
24
+ const ramp = matchaPalettes.neutral[mode];
25
+ expect(tokens['--color-background-body']).toBe(
26
+ ramp[mode === 'light' ? 95 : 5],
27
+ );
28
+ expect(tokens['--color-background-surface']).toBe(
29
+ ramp[mode === 'light' ? 100 : 10],
30
+ );
31
+ expect(tokens['--color-background-card']).toBe(
32
+ ramp[mode === 'light' ? 100 : 15],
33
+ );
34
+ expect(tokens['--color-text-primary']).toBe(
35
+ ramp[mode === 'light' ? 20 : 75],
36
+ );
37
+ expect(tokens['--color-text-secondary']).toBe(
38
+ ramp[mode === 'light' ? 40 : 60],
39
+ );
40
+ },
41
+ );
42
+
43
+ it.each(['light', 'dark'] as const)(
44
+ 'maps categorical roles to reviewed %s stops',
45
+ mode => {
46
+ const tokens = resolveThemeTokens(matchaTheme, {mode});
47
+ for (const family of categoricalFamilies) {
48
+ const ramp = matchaPalettes[family][mode];
49
+ const backgroundStop =
50
+ mode === 'light' || family === 'blue' || family === 'cyan' ? 50 : 70;
51
+ expect(tokens[`--color-background-${family}`]).toBe(
52
+ `${ramp[backgroundStop]}33`,
53
+ );
54
+ expect(tokens[`--color-border-${family}`]).toBe(
55
+ ramp[mode === 'light' ? 50 : 70],
56
+ );
57
+ expect(tokens[`--color-icon-${family}`]).toBe(
58
+ ramp[mode === 'light' ? 50 : 70],
59
+ );
60
+ expect(tokens[`--color-text-${family}`]).toBe(
61
+ ramp[mode === 'light' ? 35 : 75],
62
+ );
63
+ }
64
+ },
65
+ );
66
+
67
+ it('maps warning and syntax roles to the reviewed Tea Gold ramp', () => {
68
+ const light = resolveThemeTokens(matchaTheme, {mode: 'light'});
69
+ const dark = resolveThemeTokens(matchaTheme, {mode: 'dark'});
70
+ expect(light['--color-warning']).toBe(matchaPalettes.yellow.light[80]);
71
+ expect(dark['--color-warning']).toBe(matchaPalettes.yellow.dark[85]);
72
+ expect(light['--color-syntax-number']).toBe(
73
+ matchaPalettes.yellow.light[45],
74
+ );
75
+ expect(dark['--color-syntax-number']).toBe(matchaPalettes.yellow.dark[75]);
76
+ });
77
+ });