create-kerf-component 5.0.0-beta.13 → 5.0.0-beta.130

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,749 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/brianwestphal/kerf/main/ui/ai/component-composition.schema.json",
4
+ "title": "Kerf UI composition catalog",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "package", "compatibility", "entries"],
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string"
10
+ },
11
+ "schemaVersion": {
12
+ "const": 1,
13
+ "description": "Version of the composition catalog format itself, independent of component-catalog.json's own schemaVersion."
14
+ },
15
+ "package": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "compatibility": {
20
+ "type": "object",
21
+ "required": ["componentCatalog", "identity"],
22
+ "properties": {
23
+ "componentCatalog": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "description": "Relative path to the component (selection) catalog this composition layer describes, or \"not-applicable\" when the package publishes none."
27
+ },
28
+ "identity": {
29
+ "const": "package:id"
30
+ }
31
+ },
32
+ "additionalProperties": false
33
+ },
34
+ "entries": {
35
+ "type": "array",
36
+ "items": {
37
+ "$ref": "#/$defs/entry"
38
+ }
39
+ },
40
+ "libraryPreviewModule": {
41
+ "type": "string",
42
+ "minLength": 1,
43
+ "description": "Optional editor-only ESM preview registration module, relative to this catalog or a resolvable package export. It is imported by the Vite editor host, never evaluated as JSON."
44
+ },
45
+ "libraryPreviews": {
46
+ "type": "object",
47
+ "additionalProperties": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "props": {
52
+ "type": "object",
53
+ "additionalProperties": {
54
+ "$ref": "#/$defs/libraryPreviewJson"
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "description": "Library-only literal sample props, keyed by the complete component key. An empty entry restores automatic rendering. Values are literal JSON; no view bindings, CSS/icon expressions or JavaScript are evaluated."
60
+ }
61
+ },
62
+ "additionalProperties": false,
63
+ "$defs": {
64
+ "stateAttribute": {
65
+ "type": "object",
66
+ "required": ["name", "on", "helper", "meaning"],
67
+ "properties": {
68
+ "name": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "pattern": "^data-[a-z0-9]+(-[a-z0-9]+)*$"
72
+ },
73
+ "on": {
74
+ "type": "string",
75
+ "minLength": 1,
76
+ "description": "The element that carries it: a public class, or the element passed to the helper."
77
+ },
78
+ "helper": {
79
+ "type": "string",
80
+ "minLength": 1,
81
+ "description": "The helper, one of wiring.helpers, that writes it."
82
+ },
83
+ "meaning": {
84
+ "type": "string",
85
+ "minLength": 1,
86
+ "description": "What its presence or value means."
87
+ }
88
+ },
89
+ "additionalProperties": false
90
+ },
91
+ "stringList": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "string",
95
+ "minLength": 1
96
+ },
97
+ "uniqueItems": true
98
+ },
99
+ "cardinality": {
100
+ "type": "object",
101
+ "required": ["min", "max"],
102
+ "properties": {
103
+ "min": {
104
+ "type": "integer",
105
+ "minimum": 0
106
+ },
107
+ "max": {
108
+ "anyOf": [
109
+ {
110
+ "type": "integer",
111
+ "minimum": 1
112
+ },
113
+ {
114
+ "const": "unbounded"
115
+ }
116
+ ]
117
+ }
118
+ },
119
+ "additionalProperties": false
120
+ },
121
+ "zone": {
122
+ "type": "object",
123
+ "required": ["id", "accepts", "cardinality", "exclusiveWith"],
124
+ "properties": {
125
+ "id": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "jsx": {
130
+ "type": "object",
131
+ "required": ["prop"],
132
+ "properties": {
133
+ "prop": {
134
+ "type": "string",
135
+ "minLength": 1
136
+ }
137
+ },
138
+ "additionalProperties": false
139
+ },
140
+ "accepts": {
141
+ "$ref": "#/$defs/stringList"
142
+ },
143
+ "cardinality": {
144
+ "$ref": "#/$defs/cardinality"
145
+ },
146
+ "exclusiveWith": {
147
+ "$ref": "#/$defs/stringList"
148
+ }
149
+ },
150
+ "additionalProperties": false
151
+ },
152
+ "state": {
153
+ "type": "object",
154
+ "required": ["id", "owner", "required"],
155
+ "properties": {
156
+ "id": {
157
+ "type": "string",
158
+ "minLength": 1
159
+ },
160
+ "owner": {
161
+ "enum": ["application", "controlled", "component"]
162
+ },
163
+ "required": {
164
+ "type": "boolean"
165
+ }
166
+ },
167
+ "additionalProperties": false
168
+ },
169
+ "diagnostic": {
170
+ "type": "object",
171
+ "required": ["id", "severity", "when", "message"],
172
+ "properties": {
173
+ "id": {
174
+ "type": "string",
175
+ "pattern": "^KUI-C[0-9]{3}$"
176
+ },
177
+ "severity": {
178
+ "enum": ["error", "warning"]
179
+ },
180
+ "when": {
181
+ "type": "string",
182
+ "minLength": 1
183
+ },
184
+ "message": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ }
188
+ },
189
+ "additionalProperties": false
190
+ },
191
+ "entry": {
192
+ "type": "object",
193
+ "required": [
194
+ "key",
195
+ "package",
196
+ "id",
197
+ "name",
198
+ "kind",
199
+ "source",
200
+ "parents",
201
+ "contexts",
202
+ "zones",
203
+ "children",
204
+ "state",
205
+ "wiring",
206
+ "responsive",
207
+ "layout",
208
+ "accessibility",
209
+ "boundaries",
210
+ "diagnostics",
211
+ "provenance"
212
+ ],
213
+ "properties": {
214
+ "key": {
215
+ "type": "string",
216
+ "minLength": 3
217
+ },
218
+ "package": {
219
+ "type": "string",
220
+ "minLength": 1
221
+ },
222
+ "id": {
223
+ "type": "string",
224
+ "minLength": 1
225
+ },
226
+ "name": {
227
+ "type": "string",
228
+ "minLength": 1
229
+ },
230
+ "kind": {
231
+ "enum": ["component", "composition", "recipe"]
232
+ },
233
+ "purpose": {
234
+ "type": "string",
235
+ "minLength": 1
236
+ },
237
+ "publicExports": {
238
+ "description": "Each export's name and the package.json#exports subpath that serves it. An entry from a private application omits subpath: the application is bundled, never imported by package name, so the name resolves through the entry's source file.",
239
+ "type": "array",
240
+ "items": {
241
+ "type": "object",
242
+ "required": ["name"],
243
+ "properties": {
244
+ "name": {
245
+ "type": "string",
246
+ "minLength": 1
247
+ },
248
+ "subpath": {
249
+ "type": "string",
250
+ "pattern": "^\\."
251
+ }
252
+ },
253
+ "additionalProperties": false
254
+ },
255
+ "minItems": 1
256
+ },
257
+ "sourceLinks": {
258
+ "$ref": "#/$defs/stringList"
259
+ },
260
+ "source": {
261
+ "type": "string",
262
+ "minLength": 1
263
+ },
264
+ "styleSources": {
265
+ "description": "Stylesheets owned by this component, relative to the catalog package root. Required for an entry to own its CSS in opt-in component ownership mode when no selection catalog supplies it.",
266
+ "type": "array",
267
+ "items": {
268
+ "type": "string",
269
+ "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*\\.css$"
270
+ },
271
+ "minItems": 1,
272
+ "uniqueItems": true
273
+ },
274
+ "insetFreeChildren": {
275
+ "description": "Prop values under which the entry's direct JSX children must bring no content-item inset. While any condition holds, a child whose layout.geometry owns its margin, border, and padding (self on all three) double-insets the entry's own geometry unless one of the child's insetFreeWhen conditions holds; eslint-plugin-kerfjs reports it as KUI-L204.",
276
+ "type": "array",
277
+ "items": {
278
+ "$ref": "#/$defs/propCondition"
279
+ },
280
+ "minItems": 1
281
+ },
282
+ "insetFreeWhen": {
283
+ "description": "Prop values that render this inset-bearing entry with no margin, border, or padding of its own (Text flush). Any one condition makes the element inset-free.",
284
+ "type": "array",
285
+ "items": {
286
+ "$ref": "#/$defs/propCondition"
287
+ },
288
+ "minItems": 1
289
+ },
290
+ "content": {
291
+ "$ref": "#/$defs/interactiveContent"
292
+ },
293
+ "configTypes": {
294
+ "description": "Prop-value types (definition names in this package's component-props.json) that another component renders as this one, such as a NavStack view's toolbar config. A content field inside such a value is placed in this component, so this component is its parent for placement contracts. `TypeName.field` names one field of a type whose other fields render elsewhere.",
295
+ "type": "array",
296
+ "minItems": 1,
297
+ "items": {
298
+ "type": "string",
299
+ "pattern": "^[A-Z][A-Za-z0-9]*(\\.[a-z][A-Za-z0-9]*)?$"
300
+ },
301
+ "uniqueItems": true
302
+ },
303
+ "rendersAs": {
304
+ "description": "For a wrapper component: the cataloged roots it renders (package-qualified keys), any one of them or nothing. Composition checks treat an element of this entry as each declared root: a zone accepts it only if it accepts every root, and each root's parent contract applies to where it is placed.",
305
+ "type": "array",
306
+ "minItems": 1,
307
+ "items": {
308
+ "type": "string",
309
+ "pattern": "^[^:]+:[^:]+$"
310
+ },
311
+ "uniqueItems": true
312
+ },
313
+ "jsxExports": {
314
+ "description": "Placement contracts for additional JSX exports from one selection entry. These exports do not stand for the entry's root or its zones.",
315
+ "type": "object",
316
+ "propertyNames": {
317
+ "pattern": "^[A-Z][A-Za-z0-9]*$"
318
+ },
319
+ "additionalProperties": {
320
+ "type": "object",
321
+ "required": ["parents"],
322
+ "properties": {
323
+ "parents": {
324
+ "type": "object",
325
+ "required": ["mode", "entries"],
326
+ "properties": {
327
+ "mode": {
328
+ "enum": ["any", "root", "listed"]
329
+ },
330
+ "entries": {
331
+ "$ref": "#/$defs/stringList"
332
+ }
333
+ },
334
+ "additionalProperties": false
335
+ }
336
+ },
337
+ "additionalProperties": false
338
+ }
339
+ },
340
+ "parents": {
341
+ "type": "object",
342
+ "required": ["mode", "entries"],
343
+ "properties": {
344
+ "mode": {
345
+ "enum": ["any", "root", "listed"]
346
+ },
347
+ "entries": {
348
+ "$ref": "#/$defs/stringList"
349
+ }
350
+ },
351
+ "additionalProperties": false
352
+ },
353
+ "contexts": {
354
+ "$ref": "#/$defs/stringList"
355
+ },
356
+ "zones": {
357
+ "type": "array",
358
+ "items": {
359
+ "$ref": "#/$defs/zone"
360
+ }
361
+ },
362
+ "children": {
363
+ "type": "object",
364
+ "required": ["mode", "concepts", "requiredConcepts"],
365
+ "properties": {
366
+ "mode": {
367
+ "enum": ["any", "none", "listed"]
368
+ },
369
+ "concepts": {
370
+ "$ref": "#/$defs/stringList"
371
+ },
372
+ "requiredConcepts": {
373
+ "$ref": "#/$defs/stringList"
374
+ }
375
+ },
376
+ "additionalProperties": false
377
+ },
378
+ "state": {
379
+ "type": "array",
380
+ "items": {
381
+ "$ref": "#/$defs/state"
382
+ }
383
+ },
384
+ "wiring": {
385
+ "type": "object",
386
+ "required": ["required", "helpers", "obligations"],
387
+ "properties": {
388
+ "required": {
389
+ "type": "boolean"
390
+ },
391
+ "scope": {
392
+ "enum": ["application", "module"]
393
+ },
394
+ "helpers": {
395
+ "$ref": "#/$defs/stringList"
396
+ },
397
+ "sources": {
398
+ "description": "Application-owned helper exports and their defining source files, relative to the catalog package root.",
399
+ "type": "array",
400
+ "items": {
401
+ "type": "object",
402
+ "required": ["export", "source"],
403
+ "properties": {
404
+ "export": {
405
+ "type": "string",
406
+ "minLength": 1
407
+ },
408
+ "source": {
409
+ "type": "string",
410
+ "minLength": 1
411
+ },
412
+ "returnsDisposer": {
413
+ "type": "boolean"
414
+ }
415
+ },
416
+ "additionalProperties": false
417
+ }
418
+ },
419
+ "actions": {
420
+ "description": "data-action values the application must handle with a root-delegated listener (delegate or delegateActions) instead of a named helper. Required wiring names at least one helper or action.",
421
+ "$ref": "#/$defs/stringList"
422
+ },
423
+ "obligations": {
424
+ "$ref": "#/$defs/stringList"
425
+ },
426
+ "stateAttributes": {
427
+ "description": "Wiring-owned state attributes: data-* attributes a wiring helper writes at runtime, which the application must not render, remove, or treat as its own state. Optional for extension catalogs; first-party entries always list it, empty when their helpers write none.",
428
+ "type": "array",
429
+ "items": {
430
+ "$ref": "#/$defs/stateAttribute"
431
+ }
432
+ }
433
+ },
434
+ "additionalProperties": false
435
+ },
436
+ "responsive": {
437
+ "type": "object",
438
+ "required": ["owner", "behaviors"],
439
+ "properties": {
440
+ "owner": {
441
+ "enum": ["application", "component", "shared", "not-applicable"]
442
+ },
443
+ "behaviors": {
444
+ "$ref": "#/$defs/stringList"
445
+ }
446
+ },
447
+ "additionalProperties": false
448
+ },
449
+ "layout": {
450
+ "type": "object",
451
+ "required": ["roles", "geometry"],
452
+ "properties": {
453
+ "roles": {
454
+ "$ref": "#/$defs/stringList"
455
+ },
456
+ "geometry": {
457
+ "type": "object",
458
+ "required": ["margin", "border", "padding"],
459
+ "properties": {
460
+ "margin": {
461
+ "enum": [
462
+ "self",
463
+ "parent",
464
+ "child",
465
+ "none",
466
+ "conditional",
467
+ "composed"
468
+ ]
469
+ },
470
+ "border": {
471
+ "enum": [
472
+ "self",
473
+ "parent",
474
+ "child",
475
+ "none",
476
+ "conditional",
477
+ "composed"
478
+ ]
479
+ },
480
+ "padding": {
481
+ "enum": [
482
+ "self",
483
+ "parent",
484
+ "child",
485
+ "none",
486
+ "conditional",
487
+ "composed"
488
+ ]
489
+ },
490
+ "notes": {
491
+ "$ref": "#/$defs/stringList"
492
+ }
493
+ },
494
+ "additionalProperties": false
495
+ }
496
+ },
497
+ "additionalProperties": false
498
+ },
499
+ "accessibility": {
500
+ "type": "object",
501
+ "required": ["obligations"],
502
+ "properties": {
503
+ "obligations": {
504
+ "$ref": "#/$defs/stringList"
505
+ }
506
+ },
507
+ "additionalProperties": false
508
+ },
509
+ "cssValueProps": {
510
+ "type": "array",
511
+ "items": {
512
+ "$ref": "#/$defs/cssValueProp"
513
+ }
514
+ },
515
+ "boundaries": {
516
+ "type": "object",
517
+ "required": ["rootClass", "publicClasses", "publicTokens"],
518
+ "properties": {
519
+ "rootClass": {
520
+ "oneOf": [
521
+ {
522
+ "type": "string",
523
+ "minLength": 1
524
+ },
525
+ {
526
+ "type": "null"
527
+ }
528
+ ]
529
+ },
530
+ "publicClasses": {
531
+ "$ref": "#/$defs/stringList"
532
+ },
533
+ "placeableClasses": {
534
+ "$ref": "#/$defs/stringList",
535
+ "description": "The subset of publicClasses an application may place on its own elements. Absent means none: every public class is the component's rendered anatomy, reached by rendering the component."
536
+ },
537
+ "rootElement": {
538
+ "type": "string",
539
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
540
+ "description": "The intrinsic element the component renders at its root. It identifies composed child roots for ownership checks; a placeableClasses class on a plain element of this tag recreates the component, while the class stays placeable on another carrier."
541
+ },
542
+ "descendantElements": {
543
+ "$ref": "#/$defs/stringList",
544
+ "description": "Intrinsic element tags that can appear below the component root."
545
+ },
546
+ "descendantRootAttribute": {
547
+ "type": "string",
548
+ "pattern": "^data-[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
549
+ "description": "Root data attribute anchoring ownership of arbitrary unclassed descendants."
550
+ },
551
+ "publicTokens": {
552
+ "$ref": "#/$defs/stringList"
553
+ },
554
+ "publicParts": {
555
+ "$ref": "#/$defs/stringList"
556
+ }
557
+ },
558
+ "additionalProperties": false
559
+ },
560
+ "diagnostics": {
561
+ "type": "array",
562
+ "items": {
563
+ "$ref": "#/$defs/diagnostic"
564
+ }
565
+ },
566
+ "provenance": {
567
+ "type": "object",
568
+ "required": ["selection", "composition"],
569
+ "properties": {
570
+ "selection": {
571
+ "type": "string",
572
+ "minLength": 1
573
+ },
574
+ "composition": {
575
+ "type": "string",
576
+ "minLength": 1
577
+ }
578
+ },
579
+ "additionalProperties": false
580
+ }
581
+ },
582
+ "additionalProperties": false
583
+ },
584
+ "interactiveContent": {
585
+ "description": "Whether the element renders interactive content (HTML's button, a, input, label, select, textarea, summary, and so on). The view validator reports KUI-V014 for any root or contains element placed, at any depth, in the zones of a root element, because interactive content cannot hold more of it. An omitted field is unchecked.",
586
+ "type": "object",
587
+ "minProperties": 1,
588
+ "properties": {
589
+ "interactive": {
590
+ "type": "array",
591
+ "minItems": 1,
592
+ "items": {
593
+ "$ref": "#/$defs/interactiveRule"
594
+ }
595
+ },
596
+ "exports": {
597
+ "description": "The same rules for each additional JSX export of the entry, keyed by export name. Exports do not inherit the entry's rules.",
598
+ "type": "object",
599
+ "additionalProperties": {
600
+ "type": "object",
601
+ "required": ["interactive"],
602
+ "properties": {
603
+ "interactive": {
604
+ "type": "array",
605
+ "minItems": 1,
606
+ "items": {
607
+ "$ref": "#/$defs/interactiveRule"
608
+ }
609
+ }
610
+ },
611
+ "additionalProperties": false
612
+ }
613
+ }
614
+ },
615
+ "additionalProperties": false
616
+ },
617
+ "interactiveRule": {
618
+ "type": "object",
619
+ "required": ["kind"],
620
+ "properties": {
621
+ "kind": {
622
+ "description": "root: the control or link is the element's own root. contains: the element renders one inside.",
623
+ "enum": ["root", "contains"]
624
+ },
625
+ "whenProps": {
626
+ "description": "Props that turn the rule on when any one is set to a value other than false. Omitted, the rule always applies.",
627
+ "type": "array",
628
+ "minItems": 1,
629
+ "uniqueItems": true,
630
+ "items": {
631
+ "type": "string",
632
+ "pattern": "^[A-Za-z][A-Za-z0-9]*$"
633
+ }
634
+ }
635
+ },
636
+ "additionalProperties": false
637
+ },
638
+ "propCondition": {
639
+ "type": "object",
640
+ "required": ["prop", "equals"],
641
+ "properties": {
642
+ "prop": {
643
+ "type": "string",
644
+ "pattern": "^[A-Za-z][A-Za-z0-9]*$",
645
+ "description": "A JSX prop of the element."
646
+ },
647
+ "equals": {
648
+ "anyOf": [
649
+ {
650
+ "type": "string"
651
+ },
652
+ {
653
+ "type": "number"
654
+ },
655
+ {
656
+ "type": "boolean"
657
+ }
658
+ ],
659
+ "description": "The statically written value that satisfies the condition. A bare boolean prop (<Text flush />) equals true."
660
+ }
661
+ },
662
+ "additionalProperties": false
663
+ },
664
+ "cssValueProp": {
665
+ "type": "object",
666
+ "required": [
667
+ "path",
668
+ "grammar",
669
+ "helpers",
670
+ "shorthands",
671
+ "canonicalShorthands",
672
+ "exceptionalShorthands",
673
+ "rawPolicy",
674
+ "examples"
675
+ ],
676
+ "properties": {
677
+ "path": {
678
+ "type": "string",
679
+ "pattern": "^(?:[A-Za-z][A-Za-z0-9]*(?:\\[\\])?\\.)*[A-Za-z][A-Za-z0-9]*$"
680
+ },
681
+ "grammar": {
682
+ "enum": [
683
+ "length",
684
+ "size",
685
+ "flex",
686
+ "color",
687
+ "declarations",
688
+ "media-query",
689
+ "pixels"
690
+ ]
691
+ },
692
+ "helpers": {
693
+ "$ref": "#/$defs/stringList"
694
+ },
695
+ "nonStandaloneHelpers": {
696
+ "$ref": "#/$defs/stringList"
697
+ },
698
+ "shorthands": {
699
+ "$ref": "#/$defs/stringList"
700
+ },
701
+ "canonicalShorthands": {
702
+ "$ref": "#/$defs/stringList"
703
+ },
704
+ "exceptionalShorthands": {
705
+ "$ref": "#/$defs/stringList"
706
+ },
707
+ "rawPolicy": {
708
+ "enum": ["forbid", "allow", "unsafe-only"]
709
+ },
710
+ "unsafeHelper": {
711
+ "type": "string",
712
+ "minLength": 1
713
+ },
714
+ "examples": {
715
+ "$ref": "#/$defs/stringList"
716
+ }
717
+ },
718
+ "additionalProperties": false
719
+ },
720
+ "libraryPreviewJson": {
721
+ "anyOf": [
722
+ {
723
+ "type": "null"
724
+ },
725
+ {
726
+ "type": "boolean"
727
+ },
728
+ {
729
+ "type": "number"
730
+ },
731
+ {
732
+ "type": "string"
733
+ },
734
+ {
735
+ "type": "array",
736
+ "items": {
737
+ "$ref": "#/$defs/libraryPreviewJson"
738
+ }
739
+ },
740
+ {
741
+ "type": "object",
742
+ "additionalProperties": {
743
+ "$ref": "#/$defs/libraryPreviewJson"
744
+ }
745
+ }
746
+ ]
747
+ }
748
+ }
749
+ }