@getvitops/generator 0.4.0 → 0.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/generator",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Generate design-system outputs (Bricks, standalone CSS, Tailwind v4) from a design-system.json.",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -26,10 +26,10 @@
26
26
  "dependencies": {
27
27
  "lightningcss": "^1.32.0",
28
28
  "zod": "^4.1.13",
29
- "@getvitops/utils": "0.4.0"
29
+ "@getvitops/utils": "0.6.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "vitest": "^4.1.9",
33
- "@getvitops/core": "0.4.0"
33
+ "@getvitops/core": "0.6.0"
34
34
  }
35
35
  }
package/schema.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "$schema": {
7
+ "description": "URL of the published JSON Schema (stamped by `vitops init`) so editors provide autocomplete + validation.",
7
8
  "type": "string"
8
9
  },
9
10
  "colors": {
@@ -20,7 +21,8 @@
20
21
  "type": "object",
21
22
  "properties": {
22
23
  "seed": {
23
- "type": "string"
24
+ "type": "string",
25
+ "description": "Seed colour (hex or oklch()). An 11-step numeric scale (50…950, tinted near-white → tinted near-black) is generated in OKLCH from it; the seed is preserved at its natural step."
24
26
  },
25
27
  "anchors": {
26
28
  "type": "object",
@@ -29,13 +31,15 @@
29
31
  },
30
32
  "additionalProperties": {
31
33
  "type": "string"
32
- }
34
+ },
35
+ "description": "Step → colour overrides (hex or oklch()) that pin specific steps of the generated scale; the remaining steps interpolate around them."
33
36
  }
34
37
  },
35
38
  "required": [
36
39
  "seed"
37
40
  ],
38
- "additionalProperties": false
41
+ "additionalProperties": false,
42
+ "description": "Seeded hue: the 11-step scale is GENERATED in OKLCH from `seed` (anchors pin specific steps)."
39
43
  },
40
44
  {
41
45
  "type": "object",
@@ -57,16 +61,20 @@
57
61
  "type": "string"
58
62
  }
59
63
  }
60
- ]
64
+ ],
65
+ "description": "Fixed brand kit: authored tones placed verbatim at their nearest steps plus tinted off-white/off-black endpoints; no interpolation. Either an ordered light → dark array or a step → colour map."
61
66
  }
62
67
  },
63
68
  "required": [
64
69
  "tones"
65
70
  ],
66
- "additionalProperties": false
71
+ "additionalProperties": false,
72
+ "description": "Fixed hue: authored brand tones used verbatim; no generation."
67
73
  }
68
- ]
69
- }
74
+ ],
75
+ "description": "A palette hue, authored one of two ways: `{ seed, anchors? }` generates an 11-step numeric OKLCH scale (50…950) from the seed, or `{ tones }` supplies a fixed brand kit used verbatim."
76
+ },
77
+ "description": "Palette hues by name. Each becomes an 11-step numeric OKLCH scale (`--color-<hue>-50…950`)."
70
78
  },
71
79
  "roles": {
72
80
  "type": "object",
@@ -75,7 +83,8 @@
75
83
  },
76
84
  "additionalProperties": {
77
85
  "type": "string"
78
- }
86
+ },
87
+ "description": "Maps each semantic role (neutral, surface, ui-primary/secondary/accent, brand-primary/secondary, info, success, warning, danger) to the palette hue backing it. The generator derives every role's FUNCTIONAL tokens (`--<role>-{bg,bg-muted,border,border-bold,solid,solid-bold,on-solid,text,text-muted,text-x-muted}`) plus emphasis stops from the hue's scale, and dark mode flips automatically — there is no per-appearance scheme grammar."
79
88
  },
80
89
  "utilities": {
81
90
  "type": "array",
@@ -89,16 +98,19 @@
89
98
  "fill",
90
99
  "stroke"
91
100
  ]
92
- }
101
+ },
102
+ "description": "Which colour utility-class families to emit (`bg-*`, `text-*`, `border-*`, `outline-*`, `fill-*`, `stroke-*`). Defaults to bg, text, border."
93
103
  }
94
104
  },
95
105
  "required": [
96
106
  "palette",
97
107
  "roles"
98
108
  ],
99
- "additionalProperties": false
109
+ "additionalProperties": false,
110
+ "description": "The colour system (the only required section): `palette` hues become generated OKLCH scales; `roles` map semantic roles onto those hues, from which all functional tokens and dark mode derive."
100
111
  },
101
112
  "shadows": {
113
+ "description": "Named shadows → `--shadow-<name>` tokens and `.drop-shadow-<name>` utilities. Values are shadow parameter lists (offset/blur/colour), applied via `filter: drop-shadow(…)`.",
102
114
  "type": "object",
103
115
  "propertyNames": {
104
116
  "type": "string"
@@ -108,6 +120,7 @@
108
120
  }
109
121
  },
110
122
  "fonts": {
123
+ "description": "Raw font stacks by name, emitted as `--font-<name>` tokens (referenced by `typography.families`).",
111
124
  "type": "object",
112
125
  "propertyNames": {
113
126
  "type": "string"
@@ -117,40 +130,51 @@
117
130
  }
118
131
  },
119
132
  "typeScale": {
133
+ "description": "Fluid modular TYPE scale → `--text-<name>` tokens, consumed by typography roles and text-size utilities.",
120
134
  "type": "object",
121
135
  "properties": {
122
136
  "base": {
123
- "type": "string"
137
+ "type": "string",
138
+ "description": "Anchor size (a CSS length, e.g. \"1rem\") — the value at `baseStep`."
124
139
  },
125
140
  "ratio": {
126
- "type": "number"
141
+ "type": "number",
142
+ "description": "Modular ratio between adjacent steps at large viewports."
127
143
  },
128
144
  "steps": {
145
+ "description": "Token count when `names` is absent (steps are then named 1..steps).",
129
146
  "type": "number"
130
147
  },
131
148
  "names": {
149
+ "description": "Step names, smallest → largest (e.g. [\"xs\",\"sm\",\"md\",…]); each becomes a token suffix.",
132
150
  "type": "array",
133
151
  "items": {
134
152
  "type": "string"
135
153
  }
136
154
  },
137
155
  "baseStep": {
156
+ "description": "1-based index of the step whose value is `base`.",
138
157
  "type": "number"
139
158
  },
140
159
  "baseline": {
160
+ "description": "Named step used as the fluid pivot / GUI scale centre (defaults to `baseStep`).",
141
161
  "type": "string"
142
162
  },
143
163
  "fluid": {
164
+ "description": "Makes the scale fluid: each step compiles to a clamp() that interpolates from `minRatio` at `minVw` to `ratio` at `maxVw`.",
144
165
  "type": "object",
145
166
  "properties": {
146
167
  "minVw": {
147
- "type": "string"
168
+ "type": "string",
169
+ "description": "Viewport width (CSS length) where fluid scaling bottoms out."
148
170
  },
149
171
  "maxVw": {
150
- "type": "string"
172
+ "type": "string",
173
+ "description": "Viewport width (CSS length) where fluid scaling tops out."
151
174
  },
152
175
  "minRatio": {
153
- "type": "number"
176
+ "type": "number",
177
+ "description": "Modular ratio at/below `minVw` (usually < `ratio`)."
154
178
  }
155
179
  },
156
180
  "required": [
@@ -168,40 +192,51 @@
168
192
  "additionalProperties": false
169
193
  },
170
194
  "spaceScale": {
195
+ "description": "Fluid modular SPACE scale → `--space-<name>` tokens, consumed by spacing/gap utilities and vertical rhythm.",
171
196
  "type": "object",
172
197
  "properties": {
173
198
  "base": {
174
- "type": "string"
199
+ "type": "string",
200
+ "description": "Anchor size (a CSS length, e.g. \"1rem\") — the value at `baseStep`."
175
201
  },
176
202
  "ratio": {
177
- "type": "number"
203
+ "type": "number",
204
+ "description": "Modular ratio between adjacent steps at large viewports."
178
205
  },
179
206
  "steps": {
207
+ "description": "Token count when `names` is absent (steps are then named 1..steps).",
180
208
  "type": "number"
181
209
  },
182
210
  "names": {
211
+ "description": "Step names, smallest → largest (e.g. [\"xs\",\"sm\",\"md\",…]); each becomes a token suffix.",
183
212
  "type": "array",
184
213
  "items": {
185
214
  "type": "string"
186
215
  }
187
216
  },
188
217
  "baseStep": {
218
+ "description": "1-based index of the step whose value is `base`.",
189
219
  "type": "number"
190
220
  },
191
221
  "baseline": {
222
+ "description": "Named step used as the fluid pivot / GUI scale centre (defaults to `baseStep`).",
192
223
  "type": "string"
193
224
  },
194
225
  "fluid": {
226
+ "description": "Makes the scale fluid: each step compiles to a clamp() that interpolates from `minRatio` at `minVw` to `ratio` at `maxVw`.",
195
227
  "type": "object",
196
228
  "properties": {
197
229
  "minVw": {
198
- "type": "string"
230
+ "type": "string",
231
+ "description": "Viewport width (CSS length) where fluid scaling bottoms out."
199
232
  },
200
233
  "maxVw": {
201
- "type": "string"
234
+ "type": "string",
235
+ "description": "Viewport width (CSS length) where fluid scaling tops out."
202
236
  },
203
237
  "minRatio": {
204
- "type": "number"
238
+ "type": "number",
239
+ "description": "Modular ratio at/below `minVw` (usually < `ratio`)."
205
240
  }
206
241
  },
207
242
  "required": [
@@ -228,7 +263,8 @@
228
263
  },
229
264
  "additionalProperties": {
230
265
  "type": "string"
231
- }
266
+ },
267
+ "description": "Cascade-wide fallback tokens, emitted as `--<prop>-default`."
232
268
  },
233
269
  "radii": {
234
270
  "type": "object",
@@ -237,9 +273,11 @@
237
273
  },
238
274
  "additionalProperties": {
239
275
  "type": "string"
240
- }
276
+ },
277
+ "description": "Shape primitives, emitted as `--br-<name>` (referenced by pattern bases)."
241
278
  },
242
279
  "groups": {
280
+ "description": "Group-level tokens, emitted as `--<prop>-<group>`; patterns opt in via their `group` key.",
243
281
  "type": "object",
244
282
  "propertyNames": {
245
283
  "type": "string"
@@ -251,10 +289,12 @@
251
289
  },
252
290
  "additionalProperties": {
253
291
  "type": "string"
254
- }
292
+ },
293
+ "description": "A CSS declaration block: property → value. Values stay strings (they can be hex, var(), clamp(), keywords, …); the generator, not the schema, interprets them."
255
294
  }
256
295
  },
257
296
  "z": {
297
+ "description": "Z-index tiers → `--z-tier-<name>`.",
258
298
  "type": "object",
259
299
  "propertyNames": {
260
300
  "type": "string"
@@ -264,6 +304,7 @@
264
304
  }
265
305
  },
266
306
  "items": {
307
+ "description": "The component patterns to emit, keyed by name.",
267
308
  "type": "object",
268
309
  "propertyNames": {
269
310
  "type": "string"
@@ -272,6 +313,7 @@
272
313
  "type": "object",
273
314
  "properties": {
274
315
  "group": {
316
+ "description": "Token-cascade group this pattern belongs to (e.g. tag / control / panel); base declarations resolve through `--<prop>-<group>` before `--<prop>-default`.",
275
317
  "type": "string"
276
318
  },
277
319
  "overrides": {
@@ -281,15 +323,19 @@
281
323
  },
282
324
  "additionalProperties": {
283
325
  "type": "string"
284
- }
326
+ },
327
+ "description": "Per-pattern token overrides, emitted as `--<prop>-<name>-group` values."
285
328
  },
286
329
  "element": {
330
+ "description": "Style at element level via zero-specificity `:where(<element>)` (instead of, or alongside, a class).",
287
331
  "type": "string"
288
332
  },
289
333
  "class": {
334
+ "description": "Class name to emit (defaults to the pattern's key).",
290
335
  "type": "string"
291
336
  },
292
337
  "default_role": {
338
+ "description": "Semantic colour role applied to the bare/default variant.",
293
339
  "type": "string"
294
340
  },
295
341
  "base": {
@@ -299,9 +345,11 @@
299
345
  },
300
346
  "additionalProperties": {
301
347
  "type": "string"
302
- }
348
+ },
349
+ "description": "Base CSS declarations. Geometry properties (padding, border-radius, border, box-shadow, font-size) are wrapped in per-pattern override hooks (`--p-<name>`, `--br-<name>`, `--b-<name>`, `--ds-<name>`, `--fs-<name>`) so consumers can restyle one pattern by setting one variable."
303
350
  },
304
351
  "states": {
352
+ "description": "Interaction states (hover / active / focus-visible), each a map of shortcuts: `step` (intensify fills/text by n emphasis stops), `scale` (transform scale), `lift` (translateY + shadow), `shadow` (a shadow name → drop-shadow(var(--shadow-<name>)), or true → lift shadow), `ring` (focus ring), or raw `css` declarations. Hover rules are wrapped in `@media (hover: hover)`.",
305
353
  "type": "object",
306
354
  "propertyNames": {
307
355
  "type": "string"
@@ -315,22 +363,26 @@
315
363
  }
316
364
  },
317
365
  "roles": {
366
+ "description": "Semantic colour role variants to emit as `<pattern>-<role>` classes (fills use the role solid / on-solid tokens).",
318
367
  "type": "array",
319
368
  "items": {
320
369
  "type": "string"
321
370
  }
322
371
  }
323
372
  },
324
- "additionalProperties": false
373
+ "additionalProperties": false,
374
+ "description": "One component pattern (button, link, badge, card, …): base declarations + interaction states + semantic role variants, resolved through the pattern token cascade."
325
375
  }
326
376
  }
327
377
  },
328
- "additionalProperties": false
378
+ "additionalProperties": false,
379
+ "description": "Component patterns and their token cascade: `defaults` → `groups` → per-pattern `overrides`, plus shape (`radii`) and z-index primitives."
329
380
  },
330
381
  "typography": {
331
382
  "type": "object",
332
383
  "properties": {
333
384
  "families": {
385
+ "description": "Role-facing family aliases → CSS font values, usually referencing the top-level `fonts` tokens (e.g. \"var(--font-display)\").",
334
386
  "type": "object",
335
387
  "propertyNames": {
336
388
  "type": "string"
@@ -340,6 +392,7 @@
340
392
  }
341
393
  },
342
394
  "roles": {
395
+ "description": "Semantic type roles (display, title, heading, body, quote, caption, eyebrow, code, lead, footnote, tag, …), each emitted as a `font-<role>` class.",
343
396
  "type": "object",
344
397
  "propertyNames": {
345
398
  "type": "string"
@@ -358,10 +411,12 @@
358
411
  "type": "number"
359
412
  }
360
413
  ]
361
- }
414
+ },
415
+ "description": "An open bag of CSS-ish keys (family / size / weight / line-height / tracking / transform / decoration / text-wrap / …); the generator maps known keys and passes the rest through."
362
416
  }
363
417
  },
364
418
  "headings": {
419
+ "description": "Maps heading elements (h1…h6) to type roles so bare headings pick up role styling.",
365
420
  "type": "object",
366
421
  "propertyNames": {
367
422
  "type": "string"
@@ -371,12 +426,14 @@
371
426
  }
372
427
  }
373
428
  },
374
- "additionalProperties": false
429
+ "additionalProperties": false,
430
+ "description": "Typography: family aliases, semantic type roles (→ `font-<role>` classes), and the heading-element → role mapping."
375
431
  },
376
432
  "animations": {
377
433
  "type": "object",
378
434
  "properties": {
379
435
  "effects": {
436
+ "description": "Effect classes to emit (`.fade-in`, `.reveal-left`, …), keyed by class name.",
380
437
  "type": "object",
381
438
  "propertyNames": {
382
439
  "type": "string"
@@ -385,7 +442,8 @@
385
442
  "type": "object",
386
443
  "properties": {
387
444
  "kf": {
388
- "type": "string"
445
+ "type": "string",
446
+ "description": "Keyframe family driving the effect: composite (transform/opacity), paint, or layout."
389
447
  },
390
448
  "css": {
391
449
  "type": "object",
@@ -401,7 +459,8 @@
401
459
  "type": "number"
402
460
  }
403
461
  ]
404
- }
462
+ },
463
+ "description": "Extra literal declarations merged into the effect class as-is."
405
464
  },
406
465
  "vars": {
407
466
  "type": "object",
@@ -417,19 +476,23 @@
417
476
  "type": "number"
418
477
  }
419
478
  ]
420
- }
479
+ },
480
+ "description": "Effect endpoint variables (`--<key>: <value>`, e.g. opacity-from, translate-y-to) that override the keyframe defaults."
421
481
  }
422
482
  },
423
483
  "required": [
424
484
  "kf"
425
485
  ],
426
- "additionalProperties": false
486
+ "additionalProperties": false,
487
+ "description": "A named animation effect class — a pure value layer (`--_anim` + `--<prop>-from/-to`) over the static keyframe engine."
427
488
  }
428
489
  },
429
490
  "journeys": {
491
+ "description": "Multi-part journey classes composed from `base` building blocks.",
430
492
  "type": "object",
431
493
  "properties": {
432
494
  "base": {
495
+ "description": "Named journey building blocks: part name → var map.",
433
496
  "type": "object",
434
497
  "propertyNames": {
435
498
  "type": "string"
@@ -452,6 +515,7 @@
452
515
  }
453
516
  },
454
517
  "compose": {
518
+ "description": "Combinations of base parts, each emitted as a `.<parts>-journey` class.",
455
519
  "type": "array",
456
520
  "items": {
457
521
  "type": "array",
@@ -464,7 +528,8 @@
464
528
  "additionalProperties": false
465
529
  }
466
530
  },
467
- "additionalProperties": false
531
+ "additionalProperties": false,
532
+ "description": "Animation effect + journey classes (pure value layers). The animation engine itself — keyframes, drivers, floats, utilities — is static framework CSS, not configured here."
468
533
  }
469
534
  },
470
535
  "required": [