@cueplusplus/theme-base 1.0.2

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,741 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/cueplusplus/cue-ui/theme-manifest-1.json",
4
+ "title": "CUE++ theme manifest",
5
+ "description": "The runtime's whole view of a theme, version 1. `@cueplusplus/theme-base` ships an equivalent dependency-free check in validateManifest(); test/validate.test.ts holds the two to identical verdicts on every fixture.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "name",
11
+ "package",
12
+ "extends",
13
+ "mode",
14
+ "supportsLight",
15
+ "colors",
16
+ "fonts",
17
+ "densities",
18
+ "fontPairings",
19
+ "contrast"
20
+ ],
21
+ "properties": {
22
+ "schemaVersion": {
23
+ "const": 1,
24
+ "description": "The manifest format. Bumped only for a breaking shape change."
25
+ },
26
+ "name": {
27
+ "type": "string",
28
+ "pattern": "^[a-zA-Z][a-zA-Z0-9-]*$",
29
+ "description": "Becomes `data-theme`, so it is interpolated into an attribute selector: no character that could close the quote."
30
+ },
31
+ "package": {
32
+ "type": "string",
33
+ "minLength": 1
34
+ },
35
+ "extends": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "description": "The `theme-base` range this manifest was resolved against, e.g. `@cueplusplus/theme-base@^1`."
39
+ },
40
+ "mode": {
41
+ "enum": [
42
+ "delta",
43
+ "complete"
44
+ ],
45
+ "description": "`delta`: theme.css holds only what differs from base. `complete`: it stands alone."
46
+ },
47
+ "supportsLight": {
48
+ "type": "boolean"
49
+ },
50
+ "colors": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": [
54
+ "dark"
55
+ ],
56
+ "description": "`light` is present exactly when `supportsLight` is true; the conditional at the root of this schema says so.",
57
+ "properties": {
58
+ "dark": {
59
+ "$ref": "#/definitions/colorBlock"
60
+ },
61
+ "light": {
62
+ "$ref": "#/definitions/colorBlock"
63
+ }
64
+ }
65
+ },
66
+ "fonts": {
67
+ "$ref": "#/definitions/fontStacksPatch",
68
+ "description": "The theme's overrides of the base stacks (a preset's `font-mono`, typically)."
69
+ },
70
+ "densities": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "adds",
75
+ "overrides"
76
+ ],
77
+ "properties": {
78
+ "adds": {
79
+ "type": "object",
80
+ "description": "Rungs this theme adds. Each carries the full geometry contract, and none may take a base rung's name.",
81
+ "propertyNames": {
82
+ "type": "string",
83
+ "pattern": "^(?!([uU][lL][tT][rR][aA]-[cC][oO][mM][pP][aA][cC][tT]|[cC][oO][mM][pP][aA][cC][tT]|[nN][oO][rR][mM][aA][lL]|[lL][aA][rR][gG][eE]|[uU][lL][tT][rR][aA]-[lL][aA][rR][gG][eE])$)[a-zA-Z][a-zA-Z0-9-]*$",
84
+ "$comment": "case-insensitive by hand: JSON Schema patterns have no `i` flag, and THEME_NAME_PATTERN is case-insensitive, so a base name is reserved in every case."
85
+ },
86
+ "additionalProperties": {
87
+ "$ref": "#/definitions/geometryBlock"
88
+ }
89
+ },
90
+ "overrides": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "description": "Base rungs this theme retunes, scoped to itself. Each carries only what changed.",
94
+ "properties": {
95
+ "ultra-compact": {
96
+ "$ref": "#/definitions/geometryPatch"
97
+ },
98
+ "compact": {
99
+ "$ref": "#/definitions/geometryPatch"
100
+ },
101
+ "normal": {
102
+ "$ref": "#/definitions/geometryPatch"
103
+ },
104
+ "large": {
105
+ "$ref": "#/definitions/geometryPatch"
106
+ },
107
+ "ultra-large": {
108
+ "$ref": "#/definitions/geometryPatch"
109
+ }
110
+ }
111
+ },
112
+ "default": {
113
+ "type": "string",
114
+ "description": "The rung this theme prefers when the consumer names none."
115
+ }
116
+ }
117
+ },
118
+ "fontPairings": {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": [
122
+ "adds",
123
+ "overrides"
124
+ ],
125
+ "properties": {
126
+ "adds": {
127
+ "type": "object",
128
+ "description": "Pairings this theme adds. Each names a sans, none may take a base pairing's name in any case, and the name itself is written into `[data-font=\"…\"]`, so it obeys the same grammar a theme name does.",
129
+ "propertyNames": {
130
+ "type": "string",
131
+ "pattern": "^(?!([sS][yY][sS][tT][eE][mM]|[gG][eE][iI][sS][tT]|[iI][nN][tT][eE][rR]|[pP][lL][eE][xX]|[rR][oO][bB][oO][tT][oO]|[sS][oO][uU][rR][cC][eE]|[aA][pP][pP][lL][eE]|[oO][fF][fF][iI][cC][eE])$)[a-zA-Z][a-zA-Z0-9-]*$",
132
+ "$comment": "case-insensitive by hand: JSON Schema patterns have no `i` flag, and THEME_NAME_PATTERN is case-insensitive, so a base name is reserved in every case."
133
+ },
134
+ "additionalProperties": {
135
+ "$ref": "#/definitions/fontStacks"
136
+ }
137
+ },
138
+ "overrides": {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "description": "Base pairings this theme retunes, scoped to itself.",
142
+ "properties": {
143
+ "system": {
144
+ "$ref": "#/definitions/fontStacksPatch"
145
+ },
146
+ "geist": {
147
+ "$ref": "#/definitions/fontStacksPatch"
148
+ },
149
+ "inter": {
150
+ "$ref": "#/definitions/fontStacksPatch"
151
+ },
152
+ "plex": {
153
+ "$ref": "#/definitions/fontStacksPatch"
154
+ },
155
+ "roboto": {
156
+ "$ref": "#/definitions/fontStacksPatch"
157
+ },
158
+ "source": {
159
+ "$ref": "#/definitions/fontStacksPatch"
160
+ },
161
+ "apple": {
162
+ "$ref": "#/definitions/fontStacksPatch"
163
+ },
164
+ "office": {
165
+ "$ref": "#/definitions/fontStacksPatch"
166
+ }
167
+ }
168
+ },
169
+ "default": {
170
+ "type": "string"
171
+ }
172
+ }
173
+ },
174
+ "contrast": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "required": [
178
+ "passes",
179
+ "advisories",
180
+ "waived",
181
+ "digest"
182
+ ],
183
+ "properties": {
184
+ "passes": {
185
+ "type": "boolean",
186
+ "description": "Every required pair cleared its floor. False is emitted only when every failure is waived."
187
+ },
188
+ "advisories": {
189
+ "type": "integer",
190
+ "minimum": 0,
191
+ "description": "Advisory pairs that missed. Reported, never fatal."
192
+ },
193
+ "waived": {
194
+ "type": "integer",
195
+ "minimum": 0,
196
+ "description": "Required pairs the theme named as known-bad. A build tool refuses any failure not named."
197
+ },
198
+ "digest": {
199
+ "type": "string",
200
+ "pattern": "^sha256-",
201
+ "description": "sha256-… over the resolved colours."
202
+ }
203
+ },
204
+ "if": {
205
+ "type": "object",
206
+ "required": [
207
+ "passes"
208
+ ],
209
+ "properties": {
210
+ "passes": {
211
+ "const": true
212
+ }
213
+ }
214
+ },
215
+ "then": {
216
+ "type": "object",
217
+ "description": "passes is true, so nothing was waived: a waived pair is a failed pair that was named, not one that passed.",
218
+ "properties": {
219
+ "waived": {
220
+ "const": 0
221
+ }
222
+ }
223
+ },
224
+ "else": {
225
+ "type": "object",
226
+ "description": "passes is false, so at least one pair was waived: a build refuses every failure no waiver names, and could not have emitted this otherwise.",
227
+ "properties": {
228
+ "waived": {
229
+ "type": "integer",
230
+ "minimum": 1
231
+ }
232
+ }
233
+ }
234
+ }
235
+ },
236
+ "if": {
237
+ "type": "object",
238
+ "properties": {
239
+ "supportsLight": {
240
+ "const": true
241
+ }
242
+ }
243
+ },
244
+ "then": {
245
+ "type": "object",
246
+ "description": "supportsLight is true, so a light block is required. The `true` schemas under `properties` define the two names for Ajv's strictRequired; what they must look like is said once, in `#/properties/colors`.",
247
+ "properties": {
248
+ "colors": {
249
+ "type": "object",
250
+ "required": [
251
+ "dark",
252
+ "light"
253
+ ],
254
+ "properties": {
255
+ "dark": true,
256
+ "light": true
257
+ }
258
+ }
259
+ }
260
+ },
261
+ "else": {
262
+ "type": "object",
263
+ "description": "supportsLight is false, so a light block must be absent: `false` is the schema nothing satisfies.",
264
+ "properties": {
265
+ "colors": {
266
+ "type": "object",
267
+ "properties": {
268
+ "light": false
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "definitions": {
274
+ "colorBlock": {
275
+ "type": "object",
276
+ "additionalProperties": false,
277
+ "description": "A complete colour block: every one of the 26 tokens in COLOR_CONTRACT.",
278
+ "required": [
279
+ "bg",
280
+ "sunken",
281
+ "surface-1",
282
+ "surface-2",
283
+ "surface-3",
284
+ "fg",
285
+ "fg-muted",
286
+ "fg-subtle",
287
+ "border",
288
+ "border-strong",
289
+ "border-overlay",
290
+ "accent",
291
+ "accent-hover",
292
+ "accent-fg",
293
+ "ok",
294
+ "busy",
295
+ "warn",
296
+ "warn-fg",
297
+ "danger",
298
+ "danger-fg",
299
+ "info",
300
+ "stream",
301
+ "selection",
302
+ "focus",
303
+ "data-ground",
304
+ "scrim"
305
+ ],
306
+ "properties": {
307
+ "bg": {
308
+ "type": "string",
309
+ "minLength": 1
310
+ },
311
+ "sunken": {
312
+ "type": "string",
313
+ "minLength": 1
314
+ },
315
+ "surface-1": {
316
+ "type": "string",
317
+ "minLength": 1
318
+ },
319
+ "surface-2": {
320
+ "type": "string",
321
+ "minLength": 1
322
+ },
323
+ "surface-3": {
324
+ "type": "string",
325
+ "minLength": 1
326
+ },
327
+ "fg": {
328
+ "type": "string",
329
+ "minLength": 1
330
+ },
331
+ "fg-muted": {
332
+ "type": "string",
333
+ "minLength": 1
334
+ },
335
+ "fg-subtle": {
336
+ "type": "string",
337
+ "minLength": 1
338
+ },
339
+ "border": {
340
+ "type": "string",
341
+ "minLength": 1
342
+ },
343
+ "border-strong": {
344
+ "type": "string",
345
+ "minLength": 1
346
+ },
347
+ "border-overlay": {
348
+ "type": "string",
349
+ "minLength": 1
350
+ },
351
+ "accent": {
352
+ "type": "string",
353
+ "minLength": 1
354
+ },
355
+ "accent-hover": {
356
+ "type": "string",
357
+ "minLength": 1
358
+ },
359
+ "accent-fg": {
360
+ "type": "string",
361
+ "minLength": 1
362
+ },
363
+ "ok": {
364
+ "type": "string",
365
+ "minLength": 1
366
+ },
367
+ "busy": {
368
+ "type": "string",
369
+ "minLength": 1
370
+ },
371
+ "warn": {
372
+ "type": "string",
373
+ "minLength": 1
374
+ },
375
+ "warn-fg": {
376
+ "type": "string",
377
+ "minLength": 1
378
+ },
379
+ "danger": {
380
+ "type": "string",
381
+ "minLength": 1
382
+ },
383
+ "danger-fg": {
384
+ "type": "string",
385
+ "minLength": 1
386
+ },
387
+ "info": {
388
+ "type": "string",
389
+ "minLength": 1
390
+ },
391
+ "stream": {
392
+ "type": "string",
393
+ "minLength": 1
394
+ },
395
+ "selection": {
396
+ "type": "string",
397
+ "minLength": 1
398
+ },
399
+ "focus": {
400
+ "type": "string",
401
+ "minLength": 1
402
+ },
403
+ "data-ground": {
404
+ "type": "string",
405
+ "minLength": 1
406
+ },
407
+ "scrim": {
408
+ "type": "string",
409
+ "minLength": 1
410
+ }
411
+ }
412
+ },
413
+ "geometryBlock": {
414
+ "type": "object",
415
+ "additionalProperties": false,
416
+ "description": "A complete geometry block: every one of the 30 tokens in GEOMETRY_CONTRACT.",
417
+ "required": [
418
+ "control-sm",
419
+ "control-md",
420
+ "control-lg",
421
+ "chip-h",
422
+ "icon-sm",
423
+ "icon-md",
424
+ "text-micro",
425
+ "text-label",
426
+ "text-ui",
427
+ "text-body",
428
+ "text-emphasis",
429
+ "text-title",
430
+ "radius-control",
431
+ "radius-surface",
432
+ "radius-overlay",
433
+ "pad-row-y",
434
+ "pad-row-x",
435
+ "space-1",
436
+ "space-2",
437
+ "space-3",
438
+ "space-4",
439
+ "space-5",
440
+ "space-6",
441
+ "space-7",
442
+ "space-8",
443
+ "chrome-toolbar",
444
+ "chrome-statusbar",
445
+ "chrome-titlebar",
446
+ "density",
447
+ "radius-scale"
448
+ ],
449
+ "properties": {
450
+ "control-sm": {
451
+ "type": "string",
452
+ "minLength": 1
453
+ },
454
+ "control-md": {
455
+ "type": "string",
456
+ "minLength": 1
457
+ },
458
+ "control-lg": {
459
+ "type": "string",
460
+ "minLength": 1
461
+ },
462
+ "chip-h": {
463
+ "type": "string",
464
+ "minLength": 1
465
+ },
466
+ "icon-sm": {
467
+ "type": "string",
468
+ "minLength": 1
469
+ },
470
+ "icon-md": {
471
+ "type": "string",
472
+ "minLength": 1
473
+ },
474
+ "text-micro": {
475
+ "type": "string",
476
+ "minLength": 1
477
+ },
478
+ "text-label": {
479
+ "type": "string",
480
+ "minLength": 1
481
+ },
482
+ "text-ui": {
483
+ "type": "string",
484
+ "minLength": 1
485
+ },
486
+ "text-body": {
487
+ "type": "string",
488
+ "minLength": 1
489
+ },
490
+ "text-emphasis": {
491
+ "type": "string",
492
+ "minLength": 1
493
+ },
494
+ "text-title": {
495
+ "type": "string",
496
+ "minLength": 1
497
+ },
498
+ "radius-control": {
499
+ "type": "string",
500
+ "minLength": 1
501
+ },
502
+ "radius-surface": {
503
+ "type": "string",
504
+ "minLength": 1
505
+ },
506
+ "radius-overlay": {
507
+ "type": "string",
508
+ "minLength": 1
509
+ },
510
+ "pad-row-y": {
511
+ "type": "string",
512
+ "minLength": 1
513
+ },
514
+ "pad-row-x": {
515
+ "type": "string",
516
+ "minLength": 1
517
+ },
518
+ "space-1": {
519
+ "type": "string",
520
+ "minLength": 1
521
+ },
522
+ "space-2": {
523
+ "type": "string",
524
+ "minLength": 1
525
+ },
526
+ "space-3": {
527
+ "type": "string",
528
+ "minLength": 1
529
+ },
530
+ "space-4": {
531
+ "type": "string",
532
+ "minLength": 1
533
+ },
534
+ "space-5": {
535
+ "type": "string",
536
+ "minLength": 1
537
+ },
538
+ "space-6": {
539
+ "type": "string",
540
+ "minLength": 1
541
+ },
542
+ "space-7": {
543
+ "type": "string",
544
+ "minLength": 1
545
+ },
546
+ "space-8": {
547
+ "type": "string",
548
+ "minLength": 1
549
+ },
550
+ "chrome-toolbar": {
551
+ "type": "string",
552
+ "minLength": 1
553
+ },
554
+ "chrome-statusbar": {
555
+ "type": "string",
556
+ "minLength": 1
557
+ },
558
+ "chrome-titlebar": {
559
+ "type": "string",
560
+ "minLength": 1
561
+ },
562
+ "density": {
563
+ "type": "string",
564
+ "minLength": 1
565
+ },
566
+ "radius-scale": {
567
+ "type": "string",
568
+ "minLength": 1
569
+ }
570
+ }
571
+ },
572
+ "geometryPatch": {
573
+ "type": "object",
574
+ "additionalProperties": false,
575
+ "description": "A partial geometry block: only what an override changes.",
576
+ "properties": {
577
+ "control-sm": {
578
+ "type": "string",
579
+ "minLength": 1
580
+ },
581
+ "control-md": {
582
+ "type": "string",
583
+ "minLength": 1
584
+ },
585
+ "control-lg": {
586
+ "type": "string",
587
+ "minLength": 1
588
+ },
589
+ "chip-h": {
590
+ "type": "string",
591
+ "minLength": 1
592
+ },
593
+ "icon-sm": {
594
+ "type": "string",
595
+ "minLength": 1
596
+ },
597
+ "icon-md": {
598
+ "type": "string",
599
+ "minLength": 1
600
+ },
601
+ "text-micro": {
602
+ "type": "string",
603
+ "minLength": 1
604
+ },
605
+ "text-label": {
606
+ "type": "string",
607
+ "minLength": 1
608
+ },
609
+ "text-ui": {
610
+ "type": "string",
611
+ "minLength": 1
612
+ },
613
+ "text-body": {
614
+ "type": "string",
615
+ "minLength": 1
616
+ },
617
+ "text-emphasis": {
618
+ "type": "string",
619
+ "minLength": 1
620
+ },
621
+ "text-title": {
622
+ "type": "string",
623
+ "minLength": 1
624
+ },
625
+ "radius-control": {
626
+ "type": "string",
627
+ "minLength": 1
628
+ },
629
+ "radius-surface": {
630
+ "type": "string",
631
+ "minLength": 1
632
+ },
633
+ "radius-overlay": {
634
+ "type": "string",
635
+ "minLength": 1
636
+ },
637
+ "pad-row-y": {
638
+ "type": "string",
639
+ "minLength": 1
640
+ },
641
+ "pad-row-x": {
642
+ "type": "string",
643
+ "minLength": 1
644
+ },
645
+ "space-1": {
646
+ "type": "string",
647
+ "minLength": 1
648
+ },
649
+ "space-2": {
650
+ "type": "string",
651
+ "minLength": 1
652
+ },
653
+ "space-3": {
654
+ "type": "string",
655
+ "minLength": 1
656
+ },
657
+ "space-4": {
658
+ "type": "string",
659
+ "minLength": 1
660
+ },
661
+ "space-5": {
662
+ "type": "string",
663
+ "minLength": 1
664
+ },
665
+ "space-6": {
666
+ "type": "string",
667
+ "minLength": 1
668
+ },
669
+ "space-7": {
670
+ "type": "string",
671
+ "minLength": 1
672
+ },
673
+ "space-8": {
674
+ "type": "string",
675
+ "minLength": 1
676
+ },
677
+ "chrome-toolbar": {
678
+ "type": "string",
679
+ "minLength": 1
680
+ },
681
+ "chrome-statusbar": {
682
+ "type": "string",
683
+ "minLength": 1
684
+ },
685
+ "chrome-titlebar": {
686
+ "type": "string",
687
+ "minLength": 1
688
+ },
689
+ "density": {
690
+ "type": "string",
691
+ "minLength": 1
692
+ },
693
+ "radius-scale": {
694
+ "type": "string",
695
+ "minLength": 1
696
+ }
697
+ }
698
+ },
699
+ "fontStacks": {
700
+ "type": "object",
701
+ "additionalProperties": false,
702
+ "description": "The stacks a pairing names. A pairing must name a sans; the rest are optional.",
703
+ "required": [
704
+ "font-sans"
705
+ ],
706
+ "properties": {
707
+ "font-sans": {
708
+ "type": "string",
709
+ "minLength": 1
710
+ },
711
+ "font-mono": {
712
+ "type": "string",
713
+ "minLength": 1
714
+ },
715
+ "font-display": {
716
+ "type": "string",
717
+ "minLength": 1
718
+ }
719
+ }
720
+ },
721
+ "fontStacksPatch": {
722
+ "type": "object",
723
+ "additionalProperties": false,
724
+ "description": "Font stacks, all optional.",
725
+ "properties": {
726
+ "font-sans": {
727
+ "type": "string",
728
+ "minLength": 1
729
+ },
730
+ "font-mono": {
731
+ "type": "string",
732
+ "minLength": 1
733
+ },
734
+ "font-display": {
735
+ "type": "string",
736
+ "minLength": 1
737
+ }
738
+ }
739
+ }
740
+ }
741
+ }