@getvitops/generator 0.9.0 → 2.0.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/CHANGELOG.md +1031 -0
- package/README.md +24 -5
- package/assets/bricks/elements/icon.php +102 -0
- package/assets/bricks/elements/split.php +8 -5
- package/assets/bricks/load.php +137 -1
- package/assets/css/animation.css +147 -36
- package/assets/css/global.css +19 -3
- package/assets/css/index.css +8 -0
- package/assets/css/layout-utilities.css +764 -0
- package/assets/css/layout.css +50 -584
- package/assets/css/patterns/carousel.css +3 -3
- package/assets/css/patterns/code.css +2 -2
- package/assets/css/patterns/combobox.css +3 -3
- package/assets/css/patterns/comment.css +1 -1
- package/assets/css/patterns/consent.css +117 -0
- package/assets/css/patterns/copy.css +3 -3
- package/assets/css/patterns/details.css +1 -1
- package/assets/css/patterns/dialog.css +2 -2
- package/assets/css/patterns/drawer.css +2 -2
- package/assets/css/patterns/forms.css +11 -11
- package/assets/css/patterns/grouped.css +1 -1
- package/assets/css/patterns/icon.css +2 -2
- package/assets/css/patterns/list.css +5 -5
- package/assets/css/patterns/media.css +1 -1
- package/assets/css/patterns/nav.css +5 -5
- package/assets/css/patterns/notification.css +3 -3
- package/assets/css/patterns/reveal.css +92 -0
- package/assets/css/patterns/scroll-based.css +1 -1
- package/assets/css/patterns/scroll-target.css +3 -3
- package/assets/css/patterns/sitenav.css +14 -14
- package/assets/css/patterns/split-link.css +4 -4
- package/assets/css/patterns/subgrid.css +7 -2
- package/assets/css/patterns/tag.css +1 -1
- package/assets/css/patterns/text-effects.css +1 -1
- package/assets/css/patterns/theme-editor.css +43 -6
- package/assets/css/patterns/tooltip.css +2 -2
- package/assets/css/patterns/tree.css +3 -3
- package/assets/css/utilities.css +19 -98
- package/assets/js/consent.js +1 -0
- package/assets/js/deferred.js +1 -1
- package/assets/js/editor.js +2 -2
- package/dist/index.d.mts +1218 -376
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4384 -1784
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
- package/schema.json +54 -12
- package/site.schema.json +648 -458
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getvitops/generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.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": [
|
|
@@ -25,12 +25,14 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@iconify/utils": "^2.3.0",
|
|
28
29
|
"lightningcss": "^1.32.0",
|
|
29
30
|
"zod": "^4.1.13",
|
|
30
|
-
"@getvitops/utils": "0.
|
|
31
|
+
"@getvitops/utils": "2.0.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
34
|
+
"@iconify/types": "^2.0.0",
|
|
33
35
|
"vitest": "^4.1.9",
|
|
34
|
-
"@getvitops/core": "0.
|
|
36
|
+
"@getvitops/core": "2.0.0"
|
|
35
37
|
}
|
|
36
38
|
}
|
package/schema.json
CHANGED
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
"description": "URL of the published JSON Schema (stamped by `vitops init`) so editors provide autocomplete + validation.",
|
|
8
8
|
"type": "string"
|
|
9
9
|
},
|
|
10
|
+
"meta": {
|
|
11
|
+
"description": "Brand identity for agent-facing output. Consumed only by the `design` format (`DESIGN.md`); it emits no CSS and no tokens.",
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"name": {
|
|
15
|
+
"description": "Brand/system name. Used as the `name` field and `<h1>` of the `design` format's `DESIGN.md`. Defaults to \"Design System\".",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"description": "One or two sentences on the brand personality and the feeling the UI should evoke — what an agent needs when no token answers the question. Becomes the DESIGN.md `description` field and opens its Overview section; if omitted, a generic description of the system's mechanics is used instead.",
|
|
20
|
+
"type": "string"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"additionalProperties": false
|
|
24
|
+
},
|
|
10
25
|
"colors": {
|
|
11
26
|
"type": "object",
|
|
12
27
|
"properties": {
|
|
@@ -32,7 +47,7 @@
|
|
|
32
47
|
"additionalProperties": {
|
|
33
48
|
"type": "string"
|
|
34
49
|
},
|
|
35
|
-
"description": "Step → colour overrides (hex or oklch())
|
|
50
|
+
"description": "Step → colour overrides (hex or oklch()) pinned VERBATIM at those steps. Every other step takes its lightness from the shared ladder, with chroma and hue interpolated between the anchors — so an anchor is reproduced exactly and is the only step allowed off the ladder. An explicit anchor overrides the seed at that step; two anchors that resolve to the same step are an error."
|
|
36
51
|
}
|
|
37
52
|
},
|
|
38
53
|
"required": [
|
|
@@ -74,7 +89,7 @@
|
|
|
74
89
|
],
|
|
75
90
|
"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
91
|
},
|
|
77
|
-
"description": "Palette hues by name. Each becomes an 11-step numeric OKLCH scale (`--color-<hue>-50…950`)."
|
|
92
|
+
"description": "Palette hues by name. Each becomes an 11-step numeric OKLCH scale (`--color-<hue>-50…950`). Every ramp shares one fixed lightness ladder, so a step means the same lightness in every hue; only chroma and hue vary. Beyond the outermost authored colour the chroma decays towards a small endpoint value (0.008 light / 0.015 dark) so the near-white and near-black ends keep a whisper of the hue — but that is a **ceiling**, not a target, so a low-chroma seed stays low and **a chroma-0 seed gives a true neutral** rather than a tinted one. The ladder is also enforced: if pinned colours leave a ramp non-monotonic (some step darker than the one below it), the build fails rather than shipping a scale whose hover states run backwards."
|
|
78
93
|
},
|
|
79
94
|
"roles": {
|
|
80
95
|
"type": "object",
|
|
@@ -82,9 +97,35 @@
|
|
|
82
97
|
"type": "string"
|
|
83
98
|
},
|
|
84
99
|
"additionalProperties": {
|
|
85
|
-
"
|
|
100
|
+
"anyOf": [
|
|
101
|
+
{
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "A palette hue name. Shorthand for `{ hue, kind: \"chromatic\" }`."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"hue": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"description": "The palette hue this role resolves to."
|
|
111
|
+
},
|
|
112
|
+
"kind": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"enum": [
|
|
115
|
+
"surface",
|
|
116
|
+
"chromatic"
|
|
117
|
+
],
|
|
118
|
+
"description": "`surface` — a page/panel colour: gets a bare `bg-<role>` plus the full emphasis range and text scale. `chromatic` (default) — a signal colour: tints and solids only, no bare `bg-<role>`."
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"required": [
|
|
122
|
+
"hue"
|
|
123
|
+
],
|
|
124
|
+
"additionalProperties": false
|
|
125
|
+
}
|
|
126
|
+
]
|
|
86
127
|
},
|
|
87
|
-
"description": "Maps semantic role names onto palette hues. Role names are ARBITRARY — add a key and the generator emits that role's
|
|
128
|
+
"description": "Maps semantic role names onto palette hues. Role names are ARBITRARY — add a key and the generator emits that role's token set (`--color-<target>-<role>[-<variant>]` for target bg/text/icon/border), its dark-mode flip and its utility classes.\n\nA value is either a hue name (`\"danger\": \"rust\"`) or `{ \"hue\": …, \"kind\": \"surface\" | \"chromatic\" }`. **The kind decides the shape of the token set.** `chromatic` (the default, and what the bare-string form means) is a signal colour: its backgrounds split into tints (`bg-<role>-x-muted`/`-muted`) and solids (`bg-<role>-solid[-bold|-x-bold]`), with deliberately **no bare `bg-<role>`** — \"how loud?\" is a question the author answers. `surface` is a page/panel colour: it has a bare `bg-<role>` plus the full emphasis range and text scale.\n\nDark mode flips automatically; there is no per-appearance scheme grammar. The solid family and its computed `text-on-<role>` foreground stay mode-stable so a filled button keeps its identity. Six roles are a required core, because the shipped framework CSS references them with no fallback: brand-primary, danger, neutral, surface, ui-primary, warning. Conventional additions are ui-secondary/accent, brand-secondary, info and success."
|
|
88
129
|
},
|
|
89
130
|
"utilities": {
|
|
90
131
|
"type": "array",
|
|
@@ -93,13 +134,14 @@
|
|
|
93
134
|
"enum": [
|
|
94
135
|
"bg",
|
|
95
136
|
"text",
|
|
137
|
+
"icon",
|
|
96
138
|
"border",
|
|
97
139
|
"outline",
|
|
98
140
|
"fill",
|
|
99
141
|
"stroke"
|
|
100
142
|
]
|
|
101
143
|
},
|
|
102
|
-
"description": "Which colour utility-class families to emit (`bg-*`, `text-*`, `border-*`, `outline-*`, `fill-*`, `stroke-*`). Defaults to bg, text, border."
|
|
144
|
+
"description": "Which colour utility-class families to emit (`bg-*`, `text-*`, `icon-*`, `border-*`, `outline-*`, `fill-*`, `stroke-*`). Defaults to bg, text, icon, border. `icon` is a separate non-text tier (a glyph may run more vivid than text); `outline`/`fill`/`stroke` have no tokens of their own and alias the border and icon tiers."
|
|
103
145
|
}
|
|
104
146
|
},
|
|
105
147
|
"required": [
|
|
@@ -107,10 +149,10 @@
|
|
|
107
149
|
"roles"
|
|
108
150
|
],
|
|
109
151
|
"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
|
|
152
|
+
"description": "The colour system (the only required section): `palette` hues become generated OKLCH scales; `roles` map semantic roles onto those hues, from which all role tokens and dark mode derive."
|
|
111
153
|
},
|
|
112
154
|
"shadows": {
|
|
113
|
-
"description": "Named shadows → `--shadow-<name>` tokens and `.drop-shadow-<name>` utilities. Values are shadow parameter lists (offset/blur/colour),
|
|
155
|
+
"description": "Named shadows → `--shadow-<name>` tokens and `.drop-shadow-<name>` utilities. Values are shadow parameter lists (offset/blur/colour). Each token feeds two consumers with different grammars — `box-shadow` (pattern geometry, via the `--ds-*` group aliases) and `filter: drop-shadow(…)` (the utilities and the `shadow:` state shortcut) — so values must stay in the intersection: **one layer, no spread radius, no `inset`**. `drop-shadow()` rejects all three, and rejecting them invalidates the whole filter, so the shadow vanishes rather than degrading.",
|
|
114
156
|
"type": "object",
|
|
115
157
|
"propertyNames": {
|
|
116
158
|
"type": "string"
|
|
@@ -120,7 +162,7 @@
|
|
|
120
162
|
}
|
|
121
163
|
},
|
|
122
164
|
"fonts": {
|
|
123
|
-
"description": "Raw font stacks by name, emitted as `--font-<name>` tokens (referenced by `typography.families`).",
|
|
165
|
+
"description": "Raw font stacks by name, emitted as `--font-<name>` tokens (referenced by `typography.families`). **Stacks only — vitops does not load webfonts.** A value here is a `font-family` list and nothing more: it emits no `@font-face`, no preload, and no metrics-matched fallback. If a family needs loading, declare it in Astro's `fonts:` config (`astro.config`, or the site config's `fonts` array) and point the token at the family's `cssVariable` — `\"display\": \"var(--font-league-spartan), sans-serif\"`. Installing a `@fontsource*` package and importing its CSS also works but gives up subsetting, preload and `size-adjust`/`ascent-override` fallbacks, so it regresses CLS.",
|
|
124
166
|
"type": "object",
|
|
125
167
|
"propertyNames": {
|
|
126
168
|
"type": "string"
|
|
@@ -353,7 +395,7 @@
|
|
|
353
395
|
"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."
|
|
354
396
|
},
|
|
355
397
|
"states": {
|
|
356
|
-
"description": "Interaction states (hover / active / focus-visible), each a map of shortcuts: `step` (intensify
|
|
398
|
+
"description": "Interaction states (hover / active / focus-visible), each a map of shortcuts: `step` (intensify the fill or text by n rungs — `bg-<role>-solid` → `-solid-bold`, `text-<role>` → `-bold`), `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)`.",
|
|
357
399
|
"type": "object",
|
|
358
400
|
"propertyNames": {
|
|
359
401
|
"type": "string"
|
|
@@ -416,11 +458,11 @@
|
|
|
416
458
|
}
|
|
417
459
|
]
|
|
418
460
|
},
|
|
419
|
-
"description": "
|
|
461
|
+
"description": "A bag of CSS-ish keys, each mapped to a declaration plus a `--<role>-<sfx>` override hook. The recognised set is **closed**: `family`, `size`, `weight`, `style`, `line-height`, `tracking` (→ `letter-spacing`), `text-transform`, `text-decoration`, `text-wrap`, `color`. Note the last four are spelled with their full CSS property names — `transform` and `decoration` are NOT accepted. Anything unrecognised is **ignored**, not passed through, so the generator warns rather than emitting it: a silently-dropped `transform: uppercase` is how title-case navigation reaches production. Note also that `style`, `text-transform`, `text-decoration` and `text-wrap` are emitted on **every** role at their identity value (`normal`/`none`/`none`/`wrap`) whether declared or not, so applying one role class over another fully resets it — which means **omitting `text-wrap` is not \"inherit\"**: it emits `text-wrap: wrap` and cancels the `pretty` the role would otherwise inherit from a `pretty` ancestor such as a `body`-mapped role. Declare it on every role — `balance` for heading-like roles, `pretty` for copy, `wrap` for short single-line labels."
|
|
420
462
|
}
|
|
421
463
|
},
|
|
422
464
|
"headings": {
|
|
423
|
-
"description": "Maps
|
|
465
|
+
"description": "Maps bare elements to type roles so unclassed markup picks up role styling — `{ \"h1\": \"display\", \"h2\": \"heading\" }`. The key is used verbatim as a selector, so it is not limited to h1…h6: **map `\"body\"` to your prose role** to bind base page typography to the role rather than hand-writing it. That binding is what makes the role editable — a stylesheet that re-states `font-family`/`line-height` as literals on `body` shadows `--<role>-ff`/`--<role>-lh`, and the live theme editor then appears to do nothing.",
|
|
424
466
|
"type": "object",
|
|
425
467
|
"propertyNames": {
|
|
426
468
|
"type": "string"
|
|
@@ -431,7 +473,7 @@
|
|
|
431
473
|
}
|
|
432
474
|
},
|
|
433
475
|
"additionalProperties": false,
|
|
434
|
-
"description": "Typography: family aliases, semantic type roles (→ `font-<role>` classes), and the
|
|
476
|
+
"description": "Typography: family aliases, semantic type roles (→ `font-<role>` classes), and the bare-element → role mapping."
|
|
435
477
|
},
|
|
436
478
|
"animations": {
|
|
437
479
|
"type": "object",
|