@getvitops/generator 0.2.0 → 0.2.1
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/dist/index.d.mts +6 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -12,11 +12,11 @@ declare const DesignSystemSchema: z.ZodMiniObject<{
|
|
|
12
12
|
}, z.z.core.$strip>]>>;
|
|
13
13
|
roles: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
14
14
|
utilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
|
|
15
|
+
fill: "fill";
|
|
15
16
|
bg: "bg";
|
|
16
17
|
text: "text";
|
|
17
18
|
border: "border";
|
|
18
19
|
outline: "outline";
|
|
19
|
-
fill: "fill";
|
|
20
20
|
stroke: "stroke";
|
|
21
21
|
}>>>;
|
|
22
22
|
}, z.z.core.$strip>;
|
|
@@ -101,11 +101,11 @@ declare const jsonSchema: {
|
|
|
101
101
|
}, z.z.core.$strip>]>>;
|
|
102
102
|
roles: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
103
103
|
utilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
|
|
104
|
+
fill: "fill";
|
|
104
105
|
bg: "bg";
|
|
105
106
|
text: "text";
|
|
106
107
|
border: "border";
|
|
107
108
|
outline: "outline";
|
|
108
|
-
fill: "fill";
|
|
109
109
|
stroke: "stroke";
|
|
110
110
|
}>>>;
|
|
111
111
|
}, z.z.core.$strip>;
|
|
@@ -509,11 +509,11 @@ declare const SiteConfigSchema: z.ZodMiniObject<{
|
|
|
509
509
|
}, z.z.core.$strip>]>>>;
|
|
510
510
|
roles: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
511
511
|
utilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
|
|
512
|
+
fill: "fill";
|
|
512
513
|
bg: "bg";
|
|
513
514
|
text: "text";
|
|
514
515
|
border: "border";
|
|
515
516
|
outline: "outline";
|
|
516
|
-
fill: "fill";
|
|
517
517
|
stroke: "stroke";
|
|
518
518
|
}>>>;
|
|
519
519
|
}, z.z.core.$strip>>;
|
|
@@ -621,9 +621,9 @@ declare const SiteConfigSchema: z.ZodMiniObject<{
|
|
|
621
621
|
number: "number";
|
|
622
622
|
date: "date";
|
|
623
623
|
file: "file";
|
|
624
|
-
text: "text";
|
|
625
624
|
email: "email";
|
|
626
625
|
url: "url";
|
|
626
|
+
text: "text";
|
|
627
627
|
tel: "tel";
|
|
628
628
|
password: "password";
|
|
629
629
|
textarea: "textarea";
|
|
@@ -1004,11 +1004,11 @@ declare const siteJsonSchema: {
|
|
|
1004
1004
|
}, z.z.core.$strip>]>>>;
|
|
1005
1005
|
roles: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
1006
1006
|
utilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
|
|
1007
|
+
fill: "fill";
|
|
1007
1008
|
bg: "bg";
|
|
1008
1009
|
text: "text";
|
|
1009
1010
|
border: "border";
|
|
1010
1011
|
outline: "outline";
|
|
1011
|
-
fill: "fill";
|
|
1012
1012
|
stroke: "stroke";
|
|
1013
1013
|
}>>>;
|
|
1014
1014
|
}, z.z.core.$strip>>;
|
|
@@ -1116,9 +1116,9 @@ declare const siteJsonSchema: {
|
|
|
1116
1116
|
number: "number";
|
|
1117
1117
|
date: "date";
|
|
1118
1118
|
file: "file";
|
|
1119
|
-
text: "text";
|
|
1120
1119
|
email: "email";
|
|
1121
1120
|
url: "url";
|
|
1121
|
+
text: "text";
|
|
1122
1122
|
tel: "tel";
|
|
1123
1123
|
password: "password";
|
|
1124
1124
|
textarea: "textarea";
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/schema.ts","../src/generate.ts","../src/docs.ts","../src/site.ts","../src/index.ts"],"mappings":";;;cA4Ga,kBAAA,EAAkB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYnB,YAAA,GAAe,CAAA,CAAE,KAAK,QAAQ,kBAAA;;;;;;cAsB7B,UAAA;;cAGA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKD,gBAAA;EACN,EAAA;EAAU,IAAA,EAAM,YAAA;EAAc,MAAA;AAAA;EAC9B,EAAA;EAAW,IAAA;EAAiB,MAAA,EAAQ,CAAA,CAAE,IAAA,CAAK,SAAS;AAAA;;iBAG1C,QAAA,CAAS,KAAA,YAAiB,gBAAgB;;;KC/H9C,MAAA;AAAA,UAEK,eAAA;ED8EJ;EC5EX,KAAA,WAAgB,YAAA;;EAEhB,MAAA,GAAS,MAAM;;EAEf,MAAA;;EAEA,SAAA;AAAA;AAAA,UAGe,cAAA;EACf,MAAA,EAAQ,MAAM;EACd,MAAA;EACA,OAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/schema.ts","../src/generate.ts","../src/docs.ts","../src/site.ts","../src/index.ts"],"mappings":";;;cA4Ga,kBAAA,EAAkB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYnB,YAAA,GAAe,CAAA,CAAE,KAAK,QAAQ,kBAAA;;;;;;cAsB7B,UAAA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YAAA;;;;;;;;;iBA4Ba,iBAAA,CAAkB,KAAA,WAAgB,OAAA,YAAyB,UAAU;;iBA4BrE,UAAA,CAAW,GAAY;;iBAevB,SAAA,CAAU,MAAA,EAAQ,MAAA,mBAAyB,MAAA,EAAQ,MAAM;;;;;;;;iBC9sBzD,aAAA,IAAiB,YAAY"}
|
package/dist/index.mjs
CHANGED
|
@@ -1654,6 +1654,11 @@ body {
|
|
|
1654
1654
|
container-type: inline-size;
|
|
1655
1655
|
}
|
|
1656
1656
|
|
|
1657
|
+
/* Class-level structure rules live in \`components\` so track/spacing utilities
|
|
1658
|
+
(@layer utilities — later in the layer order) can override them; unlayered
|
|
1659
|
+
CSS would beat ALL layered utilities regardless of specificity (e.g.
|
|
1660
|
+
\`.centered > *\` pinning children to \`measure\` over \`.spotlight\`). */
|
|
1661
|
+
@layer components {
|
|
1657
1662
|
.rhythm {
|
|
1658
1663
|
display: flow-root;
|
|
1659
1664
|
}
|
|
@@ -1711,9 +1716,10 @@ body {
|
|
|
1711
1716
|
var(--region-space-max, 8rem)
|
|
1712
1717
|
);
|
|
1713
1718
|
}
|
|
1719
|
+
}
|
|
1714
1720
|
`);
|
|
1715
1721
|
const animEngine = readFileSync(join(cssDir, "animation.css"), "utf8");
|
|
1716
|
-
parts.push(`/* ── Animation engine (animation.css) ── */\n${animEngine}`);
|
|
1722
|
+
parts.push(`/* ── Animation engine (animation.css) ── */\n@layer components {\n${animEngine}\n}`);
|
|
1717
1723
|
parts.push(`/* ── Component patterns ── */\n@layer components {\n${patternsCss}\n}`);
|
|
1718
1724
|
const TW_CLASH = new Set([
|
|
1719
1725
|
"block",
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/schema.ts","../src/tokens.ts","../src/docs.ts","../src/generate.ts","../src/site.ts","../src/index.ts"],"sourcesContent":["/**\n * Canonical `design-system.json` schema — the single source of truth.\n *\n * Authored with `zod/mini` (tree-shakeable Zod v4). Everything else derives from it:\n * • the `DesignSystem` TS type (`z.infer`), used throughout the generator,\n * • the published JSON Schema (`toJSONSchema`), emitted to `schema.json` for `$schema` refs,\n * • runtime validation (`validate`) for the CLI and to gate `generate`.\n */\nimport * as z from 'zod/mini';\n\n// A CSS declaration block: prop -> value. Values stay strings (they can be hex,\n// var(), clamp(), keywords, …); the generator, not the schema, interprets them.\nconst CssDecls = z.record(z.string(), z.string());\n// Animation/effect vars + typography role values are string | number.\nconst Scalar = z.union([z.string(), z.number()]);\nconst VarMap = z.record(z.string(), Scalar);\n\n// ── colors ──────────────────────────────────────────────────────────────────\n// A palette hue, authored one of two ways:\n// • `{ seed, anchors? }` — an 11-step numeric scale (50…950) is GENERATED in\n// OKLCH from the seed (anchors pin specific steps; hex or oklch() values).\n// • `{ tones }` — a fixed brand kit: authored tones used verbatim at their\n// nearest steps + tinted off-white/off-black endpoints; no interpolation.\nconst SeededRamp = z.object({\n seed: z.string(),\n anchors: z.optional(z.record(z.string(), z.string())),\n});\nconst FixedRamp = z.object({\n tones: z.union([z.array(z.string()), z.record(z.string(), z.string())]),\n});\nconst Ramp = z.union([SeededRamp, FixedRamp]);\n\nconst UtilityName = z.enum(['bg', 'text', 'border', 'outline', 'fill', 'stroke']);\n\n// `roles` maps each semantic role (neutral, surface, ui-primary, …) to the\n// palette hue backing it. The generator derives every role's FUNCTIONAL tokens\n// (bg / text / solid / on-solid / borders / muted stops) from the hue's scale,\n// and dark mode flips automatically — there is no per-appearance scheme grammar.\nconst Colors = z.object({\n palette: z.record(z.string(), Ramp),\n roles: z.record(z.string(), z.string()),\n utilities: z.optional(z.array(UtilityName)),\n});\n\n// ── fluid modular scale (type + space) ──────────────────────────────────────\nconst Scale = z.object({\n base: z.string(), // anchor size, e.g. \"1rem\"\n ratio: z.number(), // modular ratio at large viewports\n steps: z.optional(z.number()), // token count when `names` is absent\n names: z.optional(z.array(z.string())), // t-shirt names (else 1..steps)\n baseStep: z.optional(z.number()), // 1-based index of the value anchor\n baseline: z.optional(z.string()), // GUI scale centre (metadata)\n fluid: z.optional(\n z.object({\n minVw: z.string(),\n maxVw: z.string(),\n minRatio: z.number(),\n }),\n ),\n});\n\n// ── patterns ────────────────────────────────────────────────────────────────\nconst Pattern = z.object({\n group: z.optional(z.string()), // token-cascade group (tag/control/panel/…)\n overrides: z.optional(CssDecls), // per-pattern token overrides\n element: z.optional(z.string()), // styled at element level via :where()\n class: z.optional(z.string()), // or as a class\n default_role: z.optional(z.string()), // role for the bare/default variant\n base: z.optional(CssDecls),\n states: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))),\n roles: z.optional(z.array(z.string())), // semantic role variants to emit\n});\n\nconst Patterns = z.object({\n defaults: z.optional(CssDecls), // --<prop>-default\n radii: z.optional(CssDecls), // --br-<name> shape primitives\n groups: z.optional(z.record(z.string(), CssDecls)), // --<prop>-<group>\n z: z.optional(z.record(z.string(), z.number())), // --z-tier-<name>\n items: z.optional(z.record(z.string(), Pattern)),\n});\n\n// ── typography ──────────────────────────────────────────────────────────────\n// A role is an open bag of CSS-ish keys (family/size/weight/tracking/…); values\n// are string | number. The generator maps known keys and ignores the rest.\nconst TypographyRole = z.record(z.string(), Scalar);\nconst Typography = z.object({\n families: z.optional(z.record(z.string(), z.string())),\n roles: z.optional(z.record(z.string(), TypographyRole)),\n headings: z.optional(z.record(z.string(), z.string())),\n});\n\n// ── animations ──────────────────────────────────────────────────────────────\nconst AnimEffect = z.object({\n kf: z.string(), // keyframe family: composite | paint | layout\n css: z.optional(VarMap), // extra literal declarations\n vars: z.optional(VarMap), // --<key>: <value> (non-default endpoints)\n});\nconst Animations = z.object({\n effects: z.optional(z.record(z.string(), AnimEffect)),\n journeys: z.optional(\n z.object({\n base: z.optional(z.record(z.string(), VarMap)),\n compose: z.optional(z.array(z.array(z.string()))),\n }),\n ),\n});\n\n// ── the design system ───────────────────────────────────────────────────────\nexport const DesignSystemSchema = z.object({\n $schema: z.optional(z.string()),\n colors: Colors,\n shadows: z.optional(z.record(z.string(), z.string())),\n fonts: z.optional(z.record(z.string(), z.string())),\n typeScale: z.optional(Scale),\n spaceScale: z.optional(Scale),\n patterns: z.optional(Patterns),\n typography: z.optional(Typography),\n animations: z.optional(Animations),\n});\n\nexport type DesignSystem = z.infer<typeof DesignSystemSchema>;\n\n// A deep-partial view used for theme deltas: `extends` patches and alternate\n// schemes supply only what they override, so every field (down through\n// colors → schemes → semantic) is optional. Reuses the same leaf schemas, so\n// there's no second source of truth. Completeness is enforced after merge\n// (validate the resolved theme against `DesignSystemSchema`).\nconst ColorsPatch = z.object({\n palette: z.optional(z.record(z.string(), Ramp)),\n roles: z.optional(z.record(z.string(), z.string())),\n utilities: z.optional(z.array(UtilityName)),\n});\nexport const DesignSystemPatchSchema = z.extend(z.partial(DesignSystemSchema), {\n colors: z.optional(ColorsPatch),\n});\nexport type DesignSystemPatch = z.infer<typeof DesignSystemPatchSchema>;\n\n/**\n * Stable URL of the published JSON Schema. Resolves once `@getvitops/generator` is on\n * npm (unpkg serves the packaged `schema.json`); `vitops init` stamps this into a\n * scaffolded config's `$schema` so editors light up autocomplete + validation.\n */\nexport const SCHEMA_URL = 'https://unpkg.com/@getvitops/generator/schema.json';\n\n/** The published JSON Schema (draft-2020-12), derived from the zod schema. */\nexport const jsonSchema = {\n $id: SCHEMA_URL,\n ...z.toJSONSchema(DesignSystemSchema, { target: 'draft-2020-12' }),\n};\n\nexport type ValidationResult =\n | { ok: true; data: DesignSystem; errors: [] }\n | { ok: false; data: undefined; errors: z.core.$ZodIssue[] };\n\n/** Validate an unknown value against the design-system schema. */\nexport function validate(input: unknown): ValidationResult {\n const result = z.safeParse(DesignSystemSchema, input);\n if (!result.success) return { ok: false, data: undefined, errors: result.error.issues };\n // Every role must point at a palette hue that exists.\n const { palette, roles } = result.data.colors;\n for (const [role, hue] of Object.entries(roles)) {\n if (palette[hue] == null) {\n return {\n ok: false,\n data: undefined,\n errors: [\n {\n code: 'custom',\n path: ['colors', 'roles', role],\n message: `role \"${role}\" references unknown palette hue \"${hue}\"`,\n } as z.core.$ZodIssue,\n ],\n };\n }\n }\n return { ok: true, data: result.data, errors: [] };\n}\n","/**\n * Palette expansion + semantic functional tokens.\n *\n * A palette hue is authored one of two ways:\n * • `{ seed, anchors? }` — an 11-step numeric scale (50…950) generated in\n * OKLCH via @getvitops/utils/color (lightness transposed toward tinted\n * near-white/near-black, chroma dampened at the extremes),\n * • `{ tones }` — a fixed brand kit: authored tones placed verbatim at their\n * nearest steps + tinted endpoints; nothing else is invented (strict kits).\n *\n * Every role (from `colors.roles`) gets FUNCTIONAL tokens — the public API:\n * --<role>-bg / -bg-muted / -border / -border-bold / -solid / -solid-bold /\n * -on-solid / -text / -text-muted / -text-x-muted\n * plus the appearance-relative emphasis stops (x-muted · muted · bold · x-bold)\n * and, for `surface`, the translucent `--surface-glass` + `--overlay` scrim.\n * Dark mode flips the mapping automatically (solid stays mode-stable).\n */\nimport {\n contrastLc,\n generateOklchPalette,\n hexToOklch,\n oklchStringToHex,\n pickOn,\n} from '@getvitops/utils/color';\n\nexport const NUMERIC_STEPS = [\n '50',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n '950',\n] as const;\ntype NumStep = (typeof NUMERIC_STEPS)[number];\n\n// Lightness centres of the numeric scale (mirrors the engine's internal curve).\nconst STEP_L: Record<NumStep, number> = {\n '50': 0.95,\n '100': 0.9,\n '200': 0.8,\n '300': 0.7,\n '400': 0.6,\n '500': 0.5,\n '600': 0.4,\n '700': 0.3,\n '800': 0.2,\n '900': 0.1,\n '950': 0.05,\n};\n\nexport interface ExpandedHue {\n /** Numeric steps (sparse for fixed-tone kits). */\n numeric: Partial<Record<NumStep, string>>;\n /** True when only authored tones + endpoints exist (no interpolation). */\n sparse?: boolean;\n}\n\ninterface SeedInput {\n seed: string;\n anchors?: Record<string, string>;\n}\ninterface TonesInput {\n tones: string[] | Record<string, string>;\n}\n\nconst isHex = (v: string) => v.startsWith('#');\nconst toOklchStr = (v: string) => {\n if (!isHex(v)) return v; // already oklch(...)\n const { l, c, h } = hexToOklch(v);\n return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${h.toFixed(2)})`;\n};\nconst nearestStep = (l: number): NumStep =>\n NUMERIC_STEPS.reduce((best, s) =>\n Math.abs(l - STEP_L[s]) < Math.abs(l - STEP_L[best]) ? s : best,\n );\n\nfunction expandSeeded(input: SeedInput): ExpandedHue {\n // Seed + author anchors pinned at their natural (or explicit) steps, PLUS\n // implicit tinted near-white/near-black endpoint anchors (unless the author\n // pins 50/950 themselves). The engine then interpolates lightness/chroma\n // piecewise BETWEEN anchors — monotonic by construction, with the light side\n // actually reaching near-white (the original \"mid-gray light end\" bug) and\n // chroma tapering toward the tinted-neutral ends.\n const anchors: Record<string, string> = {};\n const seedStep = nearestStep(hexToOklch(input.seed).l);\n anchors[seedStep] = toOklchStr(input.seed);\n for (const [key, value] of Object.entries(input.anchors ?? {})) {\n const step = (NUMERIC_STEPS as readonly string[]).includes(key)\n ? key\n : nearestStep(hexToOklch(value).l);\n anchors[step] = toOklchStr(value);\n }\n const hue = hexToOklch(input.seed).h;\n anchors['50'] ??= `oklch(97% 0.008 ${hue.toFixed(2)})`;\n anchors['950'] ??= `oklch(13% 0.015 ${hue.toFixed(2)})`;\n const scale = generateOklchPalette(anchors) as Record<string, string>;\n const numeric: Partial<Record<NumStep, string>> = {};\n for (const s of NUMERIC_STEPS) if (scale[s] != null) numeric[s] = oklchStringToHex(scale[s]);\n return { numeric };\n}\n\nfunction expandTones(input: TonesInput): ExpandedHue {\n // Strict kit: authored tones verbatim at their nearest step; add tinted\n // endpoints (the one allowed exception); interpolate nothing else.\n const tones = Array.isArray(input.tones) ? input.tones : Object.values(input.tones);\n const numeric: Partial<Record<NumStep, string>> = {};\n for (const hex of tones) numeric[nearestStep(hexToOklch(hex).l)] = hex;\n const hue = hexToOklch(tones[0] ?? '#808080').h;\n numeric['50'] ??= oklchStringToHex(`oklch(97% 0.010 ${hue.toFixed(2)})`);\n numeric['950'] ??= oklchStringToHex(`oklch(15% 0.015 ${hue.toFixed(2)})`);\n return { numeric, sparse: true };\n}\n\n/** Snap to the nearest AVAILABLE numeric step (sparse kits). */\nfunction snap(numeric: Partial<Record<NumStep, string>>, want: NumStep): NumStep {\n if (numeric[want] != null) return want;\n const have = NUMERIC_STEPS.filter((s) => numeric[s] != null);\n return have.reduce((best, s) =>\n Math.abs(STEP_L[s] - STEP_L[want]) < Math.abs(STEP_L[best] - STEP_L[want]) ? s : best,\n );\n}\n\n/** Expand every palette hue into its numeric scale. */\nexport function expandPalette(raw: Record<string, unknown>): Record<string, ExpandedHue> {\n const out: Record<string, ExpandedHue> = {};\n for (const [name, entry] of Object.entries(raw)) {\n const e = entry as Partial<SeedInput & TonesInput>;\n if (typeof e?.seed === 'string') out[name] = expandSeeded(e as SeedInput);\n else if (e?.tones != null) out[name] = expandTones(e as TonesInput);\n else throw new Error(`palette hue \"${name}\" must have a \"seed\" or \"tones\"`);\n }\n return out;\n}\n\n// ── functional token mapping ─────────────────────────────────────────────────\n\ntype TokenMap = Record<string, NumStep>;\nconst LIGHT: TokenMap = {\n bg: '50',\n 'bg-muted': '100',\n border: '200',\n 'border-bold': '300',\n text: '950',\n 'text-muted': '800',\n 'text-x-muted': '600',\n};\nconst DARK: TokenMap = {\n bg: '950',\n 'bg-muted': '900',\n border: '800',\n 'border-bold': '700',\n text: '50',\n 'text-muted': '200',\n 'text-x-muted': '400',\n};\n// surface = background planes; elevation is lighter-when-raised in BOTH modes.\nconst SURFACE_LIGHT: TokenMap = { ...LIGHT, bg: '100', 'bg-muted': '200', 'bg-bold': '50' };\nconst SURFACE_DARK: TokenMap = { ...DARK, bg: '900', 'bg-muted': '950', 'bg-bold': '800' };\n// appearance-relative emphasis stops (base excluded — the bare name is functional).\nconst EMPHASIS_LIGHT: TokenMap = { 'x-muted': '100', muted: '300', bold: '700', 'x-bold': '900' };\nconst EMPHASIS_DARK: TokenMap = { 'x-muted': '900', muted: '700', bold: '300', 'x-bold': '100' };\n\nexport interface FunctionalRole {\n role: string;\n hue: string;\n /** token → CSS value, per appearance. */\n light: Record<string, string>;\n dark: Record<string, string>;\n}\n\n/** Resolve the functional token set for one role over its hue. */\nexport function functionalRole(role: string, hueName: string, hue: ExpandedHue): FunctionalRole {\n const numeric = hue.numeric;\n const v = (n: NumStep) => `var(--color-${hueName}-${snap(numeric, n)})`;\n const hex = (n: NumStep) => numeric[snap(numeric, n)] as string;\n\n // solid: the vivid tone — at least 500 (white text needs the depth), at most 700.\n const naturalRaw = NUMERIC_STEPS.find((s) => numeric[s] === hex('500')) ?? '500';\n const natural = Number(snap(numeric, naturalRaw));\n const solidStep = snap(numeric, String(Math.min(Math.max(natural, 500), 700)) as NumStep);\n const solidBold = snap(numeric, String(Math.min(Number(solidStep) + 100, 950)) as NumStep);\n const onSolid = pickOn(numeric[solidStep] as string);\n\n const isSurface = role === 'surface';\n const map = (table: TokenMap): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [token, step] of Object.entries(table)) out[token] = v(step as NumStep);\n return out;\n };\n const emphasis = (table: TokenMap, prefix: string): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [stop, step] of Object.entries(table)) out[`${prefix}-${stop}`] = v(step as NumStep);\n return out;\n };\n\n const light = {\n ...map(isSurface ? SURFACE_LIGHT : LIGHT),\n solid: v(solidStep),\n 'solid-bold': v(solidBold),\n 'on-solid': onSolid,\n ...emphasis(EMPHASIS_LIGHT, 'stop'),\n };\n const dark = {\n ...map(isSurface ? SURFACE_DARK : DARK),\n solid: v(solidStep),\n 'solid-bold': v(solidBold),\n 'on-solid': onSolid,\n ...emphasis(EMPHASIS_DARK, 'stop'),\n };\n return { role, hue: hueName, light, dark };\n}\n\n/** Verify a functional role's contrast targets. Returns human-readable failures. */\nexport function checkContrast(\n fr: FunctionalRole,\n numericOf: (hueName: string) => Partial<Record<NumStep, string>>,\n): string[] {\n const failures: string[] = [];\n const resolve = (val: string): string => {\n const m = /^var\\(--color-([a-z0-9-]+)-(\\d+)\\)$/.exec(val);\n if (!m) return val;\n return numericOf(m[1] as string)[m[2] as NumStep] ?? val;\n };\n for (const [name, tokens] of [\n ['light', fr.light],\n ['dark', fr.dark],\n ] as const) {\n const bg = resolve(tokens.bg as string);\n const checks: Array<[string, string, number]> = [\n ['text', resolve(tokens.text as string), 75],\n ['text-muted', resolve(tokens['text-muted'] as string), 60],\n ];\n for (const [token, hexV, min] of checks) {\n const lc = contrastLc(hexV, bg);\n if (lc < min)\n failures.push(`${fr.role}/${name}: ${token} Lc ${lc.toFixed(1)} < ${min} on bg ${bg}`);\n }\n const onLc = contrastLc(tokens['on-solid'] as string, resolve(tokens.solid as string));\n if (onLc < 60)\n failures.push(`${fr.role}/${name}: on-solid Lc ${onLc.toFixed(1)} < 60 on solid`);\n }\n return failures;\n}\n","/**\n * OKF documentation bundle generator (ported from the repo's `generate-docs.ts`).\n *\n * Pure: `generateDocs(ds, assetsDir)` returns a `{ relPath: markdown }` map for the\n * Open Knowledge Format tree (top index, css/, bricks/), reading the Bricks element\n * PHP from `<assetsDir>/bricks/elements`. No filesystem writes — the caller decides\n * where the bundle lands (e.g. `<outDir>/docs`).\n */\nimport { readFileSync, readdirSync, existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { DesignSystem } from './schema.ts';\nimport { expandPalette } from './tokens.ts';\n\nconst DS_PATH = 'design-system.json';\n\n// Curated element display order (by $name, sans the vitops- prefix). Unlisted\n// elements fall to the end alphabetically so new ones still appear.\nconst ORDER = [\n 'split',\n 'centered',\n 'carousel',\n 'color-scheme-toggle',\n 'copy-button',\n 'dismissable',\n 'entries',\n 'image-compare',\n 'sitenav',\n 'multi-field',\n 'split-link',\n 'split-panel',\n];\n\n// ── PHP array-literal parser ─────────────────────────────────────────────────\ntype Json = string | number | boolean | null | Json[] | { [k: string]: Json };\n\ninterface Tok {\n t: 'str' | 'num' | 'id' | 'punc' | 'arrow';\n v: string;\n}\n\nfunction tokenize(src: string): Tok[] {\n const toks: Tok[] = [];\n let i = 0;\n const n = src.length;\n while (i < n) {\n const c = src[i] as string;\n if (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n i++;\n continue;\n }\n if (c === '/' && src[i + 1] === '/') {\n while (i < n && src[i] !== '\\n') i++;\n continue;\n }\n if (c === '#') {\n while (i < n && src[i] !== '\\n') i++;\n continue;\n }\n if (c === '/' && src[i + 1] === '*') {\n i += 2;\n while (i < n && !(src[i] === '*' && src[i + 1] === '/')) i++;\n i += 2;\n continue;\n }\n if (c === \"'\" || c === '\"') {\n const quote = c;\n i++;\n let s = '';\n while (i < n && src[i] !== quote) {\n if (src[i] === '\\\\' && i + 1 < n) {\n const next = src[i + 1];\n s += next === 'n' ? '\\n' : next === 't' ? '\\t' : next;\n i += 2;\n } else {\n s += src[i++];\n }\n }\n i++;\n toks.push({ t: 'str', v: s });\n continue;\n }\n if (c === '=' && src[i + 1] === '>') {\n toks.push({ t: 'arrow', v: '=>' });\n i += 2;\n continue;\n }\n if ('[](){},'.includes(c)) {\n toks.push({ t: 'punc', v: c });\n i++;\n continue;\n }\n if (\n (c >= '0' && c <= '9') ||\n (c === '-' && (src[i + 1] as string) >= '0' && (src[i + 1] as string) <= '9')\n ) {\n let s = c;\n i++;\n while (i < n && (src[i] as string) >= '0' && (src[i] as string) <= '9') s += src[i++];\n toks.push({ t: 'num', v: s });\n continue;\n }\n if (/[A-Za-z_\\\\]/.test(c)) {\n let s = c;\n i++;\n while (i < n && /[A-Za-z0-9_\\\\]/.test(src[i] as string)) s += src[i++];\n toks.push({ t: 'id', v: s });\n continue;\n }\n i++;\n }\n return toks;\n}\n\nclass Parser {\n p = 0;\n toks: Tok[];\n constructor(toks: Tok[]) {\n this.toks = toks;\n }\n peek(): Tok | undefined {\n return this.toks[this.p];\n }\n next(): Tok | undefined {\n return this.toks[this.p++];\n }\n parseValue(): Json {\n const t = this.peek();\n if (!t) return null;\n if (t.t === 'str') {\n this.next();\n return t.v;\n }\n if (t.t === 'num') {\n this.next();\n return Number(t.v);\n }\n if (t.t === 'id') {\n this.next();\n if (t.v === 'true') return true;\n if (t.v === 'false') return false;\n if (t.v === 'null') return null;\n if (this.peek()?.t === 'punc' && this.peek()?.v === '(') {\n this.next();\n if (t.v === 'array') return this.parseBody(')');\n const args = this.parseCallArgs();\n return args.find((a) => typeof a === 'string') ?? args[0] ?? '';\n }\n return t.v;\n }\n if (t.t === 'punc' && t.v === '[') {\n this.next();\n return this.parseBody(']');\n }\n if (t.t === 'punc' && t.v === '(') {\n this.next();\n return this.parseBody(')');\n }\n this.next();\n return null;\n }\n private parseCallArgs(): Json[] {\n const args: Json[] = [];\n while (this.peek() && !(this.peek()!.t === 'punc' && this.peek()!.v === ')')) {\n args.push(this.parseValue());\n if (this.peek()?.t === 'punc' && this.peek()?.v === ',') this.next();\n }\n this.next();\n return args;\n }\n private parseBody(close: string): Json {\n const list: Json[] = [];\n const map: Record<string, Json> = {};\n let keyed = false;\n while (this.peek() && !(this.peek()!.t === 'punc' && this.peek()!.v === close)) {\n const first = this.parseValue();\n if (this.peek()?.t === 'arrow') {\n this.next();\n const val = this.parseValue();\n // PHP array keys are scalars; stringify objects defensively.\n map[typeof first === 'object' && first !== null ? JSON.stringify(first) : String(first)] =\n val;\n keyed = true;\n } else {\n list.push(first);\n }\n if (this.peek()?.t === 'punc' && this.peek()?.v === ',') this.next();\n }\n this.next();\n return keyed ? map : list;\n }\n}\n\nfunction parsePhpLiteral(text: string): Json {\n return new Parser(tokenize(text)).parseValue();\n}\n\n// ── Source-region helpers ────────────────────────────────────────────────────\nfunction matchBalanced(src: string, open: number): number {\n const pairs: Record<string, string> = { '(': ')', '[': ']', '{': '}' };\n const stack: string[] = [];\n let i = open;\n const n = src.length;\n while (i < n) {\n const c = src[i] as string;\n if (c === '/' && src[i + 1] === '/') {\n while (i < n && src[i] !== '\\n') i++;\n continue;\n }\n if (c === '/' && src[i + 1] === '*') {\n i += 2;\n while (i < n && !(src[i] === '*' && src[i + 1] === '/')) i++;\n i += 2;\n continue;\n }\n if (c === \"'\" || c === '\"') {\n i++;\n while (i < n && src[i] !== c) {\n if (src[i] === '\\\\') i++;\n i++;\n }\n i++;\n continue;\n }\n if (c in pairs) stack.push(pairs[c] as string);\n else if (c === ')' || c === ']' || c === '}') {\n if (stack.pop() !== c) {\n /* unbalanced — best effort */\n }\n if (stack.length === 0) return i + 1;\n }\n i++;\n }\n return n;\n}\n\nfunction methodBody(src: string, name: string): string | null {\n const m = new RegExp(`function\\\\s+${name}\\\\s*\\\\([^)]*\\\\)`).exec(src);\n if (!m) return null;\n const brace = src.indexOf('{', m.index + m[0].length);\n if (brace < 0) return null;\n const end = matchBalanced(src, brace);\n return src.slice(brace + 1, end - 1);\n}\n\nfunction literalAt(src: string, fromIdx: number): { text: string; end: number } | null {\n let i = fromIdx;\n while (i < src.length && /\\s/.test(src[i] as string)) i++;\n let open: number;\n if (src[i] === '[') open = i;\n else if (src.startsWith('array', i)) open = src.indexOf('(', i);\n else return null;\n const end = matchBalanced(src, open);\n return { text: src.slice(i, end), end };\n}\n\n// ── Per-element extraction ───────────────────────────────────────────────────\ninterface Control {\n key: string;\n def: Record<string, Json>;\n}\ninterface Element {\n name: string;\n label: string;\n nestable: boolean;\n docblock: string;\n controls: Control[];\n cssClass: string | null;\n children: string[];\n keywords: string[];\n}\n\nfunction firstString(re: RegExp, src: string): string | null {\n const m = re.exec(src);\n return m ? (m[1] ?? null) : null;\n}\n\nfunction extractDocblock(src: string): string {\n const m = /\\/\\*\\*([\\s\\S]*?)\\*\\//.exec(src);\n if (!m) return '';\n const lines = (m[1] as string)\n .split('\\n')\n .map((l) => l.replace(/^\\s*\\*?\\s?/, '').replace(/\\s+$/, ''));\n while (lines.length && lines[0] === '') lines.shift();\n if (lines.length && /Bricks Builder\\)\\./.test(lines[0] as string)) lines.shift();\n const owned = lines.findIndex((l) => l.startsWith('Owned by the framework repo'));\n const kept = (owned >= 0 ? lines.slice(0, owned) : lines).map((l) => l.replace(/^•\\s*/, '- '));\n while (kept.length && kept[kept.length - 1] === '') kept.pop();\n while (kept.length && kept[0] === '') kept.shift();\n return kept.join('\\n');\n}\n\nfunction extractControls(src: string): Control[] {\n const body = methodBody(src, 'set_controls');\n if (!body) return [];\n const controls: Control[] = [];\n const re = /\\$this->controls\\[\\s*'([^']+)'\\s*\\](\\[\\s*'([^']+)'\\s*\\])?\\s*=\\s*/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(body))) {\n const key = m[1] as string;\n if (m[2]) continue;\n const lit = literalAt(body, m.index + m[0].length);\n if (!lit) continue;\n const def = parsePhpLiteral(lit.text);\n if (def && typeof def === 'object' && !Array.isArray(def))\n controls.push({ key, def: def as Record<string, Json> });\n re.lastIndex = lit.end;\n }\n return controls;\n}\n\nfunction extractChildren(src: string): string[] {\n const body = methodBody(src, 'get_nestable_children');\n if (!body) return [];\n const labels: string[] = [];\n const re = /'label'\\s*=>\\s*esc_html__\\(\\s*'([^']*)'/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(body))) labels.push(m[1] as string);\n return labels;\n}\n\nfunction extractKeywords(src: string): string[] {\n const body = methodBody(src, 'get_keywords');\n if (!body) return [];\n const ret = /return\\s+/.exec(body);\n if (!ret) return [];\n const lit = literalAt(body, ret.index + ret[0].length);\n if (!lit) return [];\n const arr = parsePhpLiteral(lit.text);\n return Array.isArray(arr) ? arr.filter((x): x is string => typeof x === 'string') : [];\n}\n\nfunction parseElement(src: string): Element | null {\n const name = firstString(/public\\s+\\$name\\s*=\\s*'vitops-([^']+)'/, src);\n if (!name) return null;\n return {\n name,\n label:\n firstString(/function get_label\\(\\)[\\s\\S]*?return\\s+esc_html__\\(\\s*'([^']*)'/, src) ?? name,\n nestable: /public\\s+\\$nestable\\s*=\\s*true/.test(src),\n docblock: extractDocblock(src),\n controls: extractControls(src),\n cssClass: firstString(\n /\\$this->controls\\[\\s*'_cssClasses'\\s*\\]\\[\\s*'default'\\s*\\]\\s*=\\s*'([^']*)'/,\n src,\n ),\n children: extractChildren(src),\n keywords: extractKeywords(src),\n };\n}\n\n// ── Markdown rendering ───────────────────────────────────────────────────────\n/** Stringify a parsed-PHP Json value for prose (objects → JSON, not [object Object]). */\nconst asText = (v: Json | undefined): string =>\n v == null ? '' : typeof v === 'object' ? JSON.stringify(v) : String(v);\n\nfunction controlLine(c: Control): string {\n const def = c.def;\n if (def.type === 'info') return `- _Note:_ ${asText(def.content)}`;\n const label = (def.label as string) || c.key;\n const options =\n def.options && typeof def.options === 'object' && !Array.isArray(def.options)\n ? (def.options as Record<string, string>)\n : null;\n const meta: string[] = [];\n let type = (def.type as string) || 'text';\n if (def.units === true) type += '+units';\n meta.push(type);\n if (def.default !== undefined) {\n const raw = asText(def.default);\n const shown = options && options[raw] ? options[raw] : raw;\n meta.push(`default \\`${shown}\\``);\n }\n if (def.placeholder !== undefined && def.placeholder !== '')\n meta.push(`placeholder \\`${asText(def.placeholder)}\\``);\n if (def.min !== undefined || def.max !== undefined)\n meta.push(\n `range ${def.min != null ? asText(def.min) : '–'}–${def.max != null ? asText(def.max) : '∞'}`,\n );\n const tail: string[] = [];\n if (def.description) tail.push(asText(def.description));\n if (options)\n tail.push(\n `Options: ${Object.values(options)\n .map((o) => `\\`${o}\\``)\n .join(', ')}.`,\n );\n if (Array.isArray(def.css) && def.css.length) {\n const first = def.css[0];\n if (first && typeof first === 'object' && !Array.isArray(first) && 'property' in first)\n tail.push(`Bound to \\`${asText((first as Record<string, Json>).property)}\\`.`);\n }\n if (def.type === 'repeater' && def.fields && typeof def.fields === 'object') {\n const fields = Object.values(def.fields as Record<string, Json>)\n .map((f) =>\n f && typeof f === 'object' && !Array.isArray(f)\n ? asText((f as Record<string, Json>).label)\n : null,\n )\n .filter(Boolean);\n if (fields.length) tail.push(`Fields: ${fields.join(', ')}.`);\n }\n const head = `- **${label}** (${meta.join(', ')})`;\n return tail.length ? `${head} — ${tail.join(' ')}` : head;\n}\n\nfunction renderElement(el: Element): string {\n const out: string[] = [];\n const nest = el.nestable ? 'nestable' : 'not nestable';\n out.push(`## ${el.label} — \\`vitops-${el.name}\\` · ${nest}`);\n out.push('');\n if (el.docblock) {\n out.push(el.docblock);\n out.push('');\n }\n const real = el.controls.filter((c) => c.def.type !== 'info');\n if (real.length) {\n out.push('**Controls**');\n out.push('');\n for (const c of el.controls) out.push(controlLine(c));\n out.push('');\n } else {\n const notes = el.controls.filter((c) => c.def.type === 'info');\n if (notes.length) {\n for (const c of notes) out.push(controlLine(c));\n out.push('');\n }\n }\n if (el.cssClass) {\n out.push(\n `**Base CSS class:** \\`${el.cssClass}\\` (applied automatically; add ratio/modifier classes alongside it in the element's \"CSS classes\" field).`,\n );\n out.push('');\n }\n if (el.children.length) {\n out.push(`**Seeded children:** ${el.children.join(', ')}.`);\n out.push('');\n }\n if (el.keywords.length) {\n out.push(`**Keywords:** ${el.keywords.filter((k) => k !== 'vitops').join(', ')}.`);\n out.push('');\n }\n return out.join('\\n');\n}\n\n// ── OKF helpers ──────────────────────────────────────────────────────────────\ninterface Frontmatter {\n type: string;\n title: string;\n description: string;\n resource?: string;\n tags?: string[];\n}\nfunction frontmatter(fm: Frontmatter): string {\n const q = (s: string) => `\"${s.replace(/\"/g, '\\\\\"')}\"`;\n const lines = [\n `type: ${q(fm.type)}`,\n `title: ${q(fm.title)}`,\n `description: ${q(fm.description)}`,\n ];\n if (fm.resource) lines.push(`resource: ${q(fm.resource)}`);\n if (fm.tags) lines.push(`tags: [${fm.tags.join(', ')}]`);\n lines.push('generator: \"@getvitops/generator\"');\n return `---\\n${lines.join('\\n')}\\n---`;\n}\n\nconst INDEX_NOTE = `<!-- GENERATED by @getvitops/generator — do not edit; regenerate with \\`vitops generate\\`. -->`;\n\nconst ELEMENTS_FRONTMATTER = frontmatter({\n type: 'Bricks Elements Reference',\n title: 'Vitops — Bricks Builder elements reference',\n description:\n 'Every repo-owned Bricks element, its controls, defaults, seeded children and keywords, for driving the Bricks Builder UI.',\n resource: 'bricks/elements',\n tags: ['bricks', 'wordpress', 'elements', 'design-system'],\n});\n\nconst ELEMENTS_PREAMBLE = `${ELEMENTS_FRONTMATTER}\n\n# Vitops — Bricks Builder elements reference\n\nContext for driving the Bricks Builder UI (e.g. Claude for Chrome). Every section below\nis generated from the element's own source, so this reference always matches the elements\ncurrently deployed. See also the CSS class vocabulary in [/css/classes.md](../css/classes.md)\nand the integration guidance in [/bricks/index.md](index.md).\n\n## How they appear in the builder\n\n- The elements register from \\`dist/bricks/load.php\\` and group under a **\"Vitops\"** category\n pinned to the **top** of the element panel. Insert one by searching its **label** (e.g.\n \"Split\", \"Carousel\") or any of its **keywords** (listed per element).\n- Two rendering families:\n - **Web-component elements** render a Lit custom element (\\`<wc-*>\\`, \\`<copy-button>\\`, …)\n from \\`dist/elements.js\\` and progressively enhance. A few (Image Compare, Split Panel)\n show their children stacked in the builder canvas until the client-side upgrade runs —\n that is expected, not broken.\n - **CSS-pattern elements** (Split, Centered, Menu, Split Link) render plain markup styled\n by the framework CSS — no JS dependency.\n- **Nestable** elements accept child elements dropped into them; some seed starter children\n (listed as \"Seeded children\"). **Non-nestable** elements are configured entirely through\n their controls.\n\n## Configuring layout\n\nSome layout is set through **controls**; some through **CSS classes typed into the element's\nbuilt-in \"CSS classes\" field** (called out per element as modifier classes). Responsive\nsuffixes on those classes engage from a container breakpoint: \\`-sm\\` = 30rem, \\`-md\\` = 48rem,\n\\`-lg\\` = 64rem, \\`-xl\\` = 80rem.\n\nEach control below lists its type, default/placeholder, any select options, and the CSS\ncustom property it writes (when it drives one). Info notes flagged _Note:_ carry the\nmodifier-class and structural guidance from the element itself.\n\n---\n`;\n\nfunction renderElementsDoc(elementsDir: string): string {\n const files = existsSync(elementsDir)\n ? readdirSync(elementsDir).filter((f) => f.endsWith('.php'))\n : [];\n const elements: Element[] = [];\n for (const f of files) {\n try {\n const el = parseElement(readFileSync(join(elementsDir, f), 'utf8'));\n if (el) elements.push(el);\n } catch {\n /* skip unparseable element */\n }\n }\n elements.sort((a, b) => {\n const ia = ORDER.indexOf(a.name);\n const ib = ORDER.indexOf(b.name);\n if (ia >= 0 && ib >= 0) return ia - ib;\n if (ia >= 0) return -1;\n if (ib >= 0) return 1;\n return a.name.localeCompare(b.name);\n });\n const body = elements.map(renderElement).join('\\n---\\n\\n');\n return `${ELEMENTS_PREAMBLE}\\n${body}`;\n}\n\n// ── CSS framework reference (rule-summarized, from the config) ────────────────\nconst code = (xs: string[]) => xs.map((x) => `\\`${x}\\``).join(', ');\n\nfunction renderCssClasses(ds: DesignSystem): string {\n const expanded = expandPalette(ds.colors.palette as Record<string, unknown>);\n const ramps = Object.keys(expanded);\n const roles = Object.keys(ds.colors.roles ?? {});\n const utils = ds.colors.utilities ?? ['bg', 'text', 'border'];\n const typeRoles = Object.keys(ds.typography?.roles ?? {});\n const shadows = Object.keys(ds.shadows ?? {});\n const effects = Object.keys(ds.animations?.effects ?? {});\n const items = (ds.patterns?.items ?? {}) as Record<\n string,\n { roles?: string[]; default_role?: string }\n >;\n const patterns = Object.keys(items);\n const patternRoles = Array.from(\n new Set(\n Object.values(items).flatMap(\n (p) => [p.default_role, ...(p.roles ?? [])].filter(Boolean) as string[],\n ),\n ),\n );\n const spaceNames = ds.spaceScale?.names ?? [];\n const typeNames = ds.typeScale?.names ?? [];\n const families = Object.keys(ds.typography?.families ?? {});\n const radii = Object.keys(ds.patterns?.radii ?? {});\n\n return `${frontmatter({\n type: 'CSS Framework Reference',\n title: 'Vitops CSS framework — class vocabulary',\n description:\n 'Every utility and component class in the Vitops CSS framework, stated as a naming rule over the design tokens it expands.',\n resource: DS_PATH,\n tags: ['css', 'utilities', 'patterns', 'design-system'],\n })}\n\n# Vitops CSS framework — class vocabulary (LLM reference)\n\nA variable-driven CSS framework. Classes encode the design system's **tokens** (colour,\ntype, space, shadow), **responsive grammar**, and **interaction states** — so styling with\nthese classes stays consistent and theme-/dark-mode-aware. Prefer them over hand-written\nCSS or ad-hoc property values.\n\nThis is a **rule reference**, not an exhaustive list: each family below is a naming rule\nplus the set of tokens it expands over. Applying a rule to any listed token yields a valid\nclass (e.g. rule \\`bg-<color>\\` + colour \\`pine-xl\\` → \\`bg-pine-xl\\`).\n\n## Responsive & state variant grammar\n\nEvery utility accepts a **container-breakpoint prefix**; animation utilities also accept a\n**state prefix**. In CSS/Bricks the separator is \\`-\\`; in Tailwind it is \\`:\\` / \\`@\\`.\n\n| Intent | CSS / Bricks | Tailwind |\n| ----------------- | -------------------------- | ----------------------------------------- |\n| responsive split | \\`md-split-1-2\\` | \\`@md:split-1-2\\` |\n| responsive align | \\`md-items-center\\` | \\`@md:items-center\\` |\n| hover effect | \\`transition hover-fade-in\\` | \\`transition fade-in hover:flip-fade-in\\` |\n\n- Breakpoint prefixes (bare): \\`sm-\\` = 30rem, \\`md-\\` = 48rem, \\`lg-\\` = 64rem, \\`xl-\\` = 80rem.\n- State prefixes (animation effects only): \\`hover-\\`, \\`active-\\`, \\`focus-\\`, and \\`flip-<effect>\\`\n (plays the effect in reverse on toggle). Effects require \\`transition\\` on the element.\n\n## Layout & structure\n\n- **\\`centered\\`** — named-track grid centering content in the reading \\`measure\\` track.\n Widen a **direct child** by adding \\`breakout\\`, \\`spotlight\\`, or \\`fullbleed\\` (each\n breakpoint-prefixable) to that child. Track widths are set via \\`--width-measure\\` /\n \\`--width-breakout\\` / \\`--width-spotlight\\` and \\`--gutter\\`.\n- **\\`rhythm\\`** — relationship-based vertical spacing (margins between headings, paragraphs,\n lists, media) driven by the space scale. Usually paired with \\`centered\\`.\n- **\\`split\\`** — equal flex columns. Ratio rule: **\\`split-<a>-<b>\\`** where \\`<a>-<b>\\` ∈\n \\`1-2\\`, \\`2-1\\`, \\`1-3\\`, \\`3-1\\`, \\`1-4\\`, \\`4-1\\`, \\`2-3\\`, \\`3-2\\` (breakpoint-prefixable).\n- **Flex** — \\`flex\\`, \\`flex-row\\`, \\`flex-col\\`; \\`g\\` for gap (space-scale token).\n- **Alignment** — \\`items-{start,center,end,stretch}\\`, \\`justify-{start,center,end,between}\\`,\n text align \\`text-{start,center,end}\\` (all breakpoint-prefixable).\n- **Display** — \\`block\\`, \\`inline\\`, \\`inline-block\\`, \\`flex\\`, \\`grid\\`, \\`hidden\\`\n (breakpoint-prefixable, e.g. \\`md-hidden\\`).\n- **Accessibility** — \\`sr-only\\` / \\`not-sr-only\\` (breakpoint-prefixable).\n- **State hooks** — \\`is-active\\`, \\`is-open\\` (styling flags toggled by JS / native state).\n\n## Spacing\n\nThe space scale is ${code(spaceNames)} exposed as \\`--space-<name>\\` tokens.\nGap (\\`g\\`) and \\`rhythm\\` margins consume these tokens; prefer \\`rhythm\\` for vertical flow\nrather than per-element margins.\n\n## Typography\n\nRule: **\\`font-<role>\\`** — role ∈ ${code(typeRoles)}. Each role carries its own family,\nsize (from the type scale ${code(typeNames)}), tracking, transform, and weight.\nFamilies: ${code(families)} (\\`--font-*\\`).\n\n## Colour\n\n**Functional tokens are the primary vocabulary** — classes name the *job*, not the tone, and\nevery one remaps automatically under \\`:root[data-brx-theme=\"dark\"]\\` (background/text ends\nswap; \\`solid\\` fills stay mode-stable with a computed \\`on-\\` foreground). Prefer these over\nraw steps. Rules (role ∈ ${code(roles)}):\n\n- **Surfaces** — \\`bg-<role>\\` (the role's background wash; for \\`surface\\` this is the\n card/panel plane), \\`bg-<role>-muted\\` (subtle / sunken), \\`bg-surface-bold\\` (raised plane).\n- **Solid fills** — \\`bg-<role>-solid\\`, \\`bg-<role>-solid-bold\\` (hover / emphasis), paired\n with \\`text-on-<role>\\` for guaranteed-contrast foreground.\n- **Content** — \\`text-<role>\\` (primary, contrast-guaranteed in both appearances),\n \\`text-<role>-muted\\` (secondary), \\`text-<role>-x-muted\\` (tertiary / disabled).\n- **Borders** — \\`border-<role>\\`, \\`border-<role>-bold\\`.\n- **Translucency** — \\`glass\\` (translucent surface + backdrop blur); \\`--overlay\\` scrim var.\n- **Emphasis stops** (appearance-relative vars for power use):\n \\`--color-<role>-{x-muted,muted,bold,x-bold}\\` — \\`muted\\` recedes toward the background\n extreme, \\`bold\\` advances toward the foreground, in *either* appearance.\n\nEveryday pairings: page \\`bg-neutral\\` + \\`text-neutral\\`; cards \\`bg-surface\\`; captions\n\\`text-neutral-muted\\`; buttons \\`bg-ui-primary-solid text-on-ui-primary\\`; status text\n\\`text-danger\\` / \\`text-success\\` / \\`text-warning\\` / \\`text-info\\`.\n\n**Raw scale** (secondary / fine control) — rule \\`<util>-<hue>-<step>\\` with util ∈\n${code(utils)}: every hue is an 11-step OKLCH scale generated from its seed (or fixed brand\ntones), numeric steps \\`50\\` … \\`950\\` (tinted near-white → tinted near-black) — e.g.\n\\`bg-${ramps[0] ?? 'brand'}-100\\`, \\`text-${ramps[0] ?? 'brand'}-800\\`. Hues: ${code(ramps)}.\nThe **bare** role name (\\`bg-<role>\\`, \\`text-<role>\\`) is always the functional token.\n\n## Shadows\n\nRule: **\\`drop-shadow-<size>\\`** — size ∈ ${code(shadows)} (applied as a \\`filter\\`, so it\nfollows non-rectangular shapes).\n\n## Animation\n\nRule: **\\`<effect>\\`** (with the state/flip prefixes above) — effect ∈ ${code(effects)}.\nComposed **journeys** chain multiple effects into one entrance: rule \\`<parts>-journey\\`\n(e.g. \\`fade-slide-journey\\`, \\`fade-scale-blur-journey\\`). All require \\`transition\\` on the\nelement; scroll-linked entrances resolve within the first portion of the element's scroll.\n\n## Component patterns\n\nEach pattern is a base class \\`<pattern>\\` with interaction states (hover/active/focus-visible)\nbaked in; coloured patterns add role variants via rule **\\`<pattern>-<role>\\`**.\n\n- Patterns: ${code(patterns)}.\n- Roles (for coloured patterns like \\`badge\\`, \\`tag\\`, \\`status\\`, \\`button\\`):\n ${code(patternRoles)} — e.g. \\`badge-success\\`, \\`button-danger\\`. The default (unsuffixed)\n variant uses the brand-primary role.\n- Shape primitives: \\`--br-<name>\\` radii — ${code(radii)}.\n`;\n}\n\n// ── Reserved index.md listings (no frontmatter) ──────────────────────────────\nfunction renderTopIndex(): string {\n return `${INDEX_NOTE}\n\n# Vitops design system\n\nLLM-oriented documentation bundle (Open Knowledge Format) for the Vitops design system — a\nvariable-driven CSS framework plus progressively-enhanced web components, generated from\n\\`design-system.json\\` and published alongside the deployed theme.\n\n# Contents\n\n* [CSS framework](css/) - the class vocabulary (colour, type, space, layout, animation, component patterns), stated as naming rules\n* [Bricks Builder](bricks/) - custom elements and how to style them\n`;\n}\n\nfunction renderCssIndex(): string {\n return `${INDEX_NOTE}\n\n# CSS framework\n\n# Contents\n\n* [Class vocabulary](classes.md) - every utility and component class, summarized by naming rule\n`;\n}\n\nfunction renderBricksIndex(): string {\n return `${INDEX_NOTE}\n\n# Bricks Builder integration\n\n# Styling\n\nPrefer adding the framework **CSS classes** — see [/css/classes.md](../css/classes.md) — in a\nBricks element's \"CSS classes\" field over hand-setting spacing, colour, or typography through\nthe Bricks Builder property panels. The classes encode the design system's tokens, responsive\ngrammar, and interaction states, so they stay consistent, respond to theme / dark mode, and\nupdate with the system. Values typed directly into Bricks' property controls are one-off,\ndrift from the system, and don't react to theme changes — reserve them for genuinely bespoke,\none-element cases.\n\n# Contents\n\n* [Elements reference](elements.md) - every custom Vitops element, its controls, defaults, seeded children and keywords\n* [Class vocabulary](../css/classes.md) - the framework CSS classes to apply to elements\n`;\n}\n\n/**\n * Build the OKF docs bundle for a config. Returns a `{ relPath: content }` map;\n * the caller writes it wherever the bundle should live (e.g. `<outDir>/docs`).\n */\nexport function generateDocs(ds: DesignSystem, assetsDir: string): Record<string, string> {\n const elementsDir = join(assetsDir, 'bricks', 'elements');\n return {\n 'index.md': renderTopIndex(),\n 'css/index.md': renderCssIndex(),\n 'css/classes.md': renderCssClasses(ds),\n 'bricks/index.md': renderBricksIndex(),\n 'bricks/elements.md': renderElementsDoc(elementsDir),\n };\n}\n","/**\n * Pure, parameterized port of the Vitops design-system generator.\n *\n * `generate({ input, format, outDir })` reads a consumer's `design-system.json`,\n * validates it, and emits consumer-ready output for the chosen format into\n * `outDir`. Unlike the original CWD-bound script it mutates no shared state: every\n * generated token layer is built in memory and either bundled (css/bricks) or\n * inlined (tailwind) before writing.\n *\n * Framework-static assets (the hand-written CSS partials, the Bricks PHP + loader,\n * and the pre-built JS bundles) live under `assets/` in this package and are read /\n * copied from there — they are the same for every consumer.\n */\nimport { readFileSync, writeFileSync, mkdirSync, cpSync, existsSync, readdirSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createHash } from 'node:crypto';\nimport { transform } from 'lightningcss';\nimport { validate, type DesignSystem } from './schema.ts';\nimport { generateDocs } from './docs.ts';\nimport {\n expandPalette,\n functionalRole,\n NUMERIC_STEPS,\n type ExpandedHue,\n type FunctionalRole,\n} from './tokens.ts';\n\nexport type Format = 'bricks' | 'css' | 'tailwind';\n\nexport interface GenerateOptions {\n /** Path to a design-system.json, OR an already-parsed config object. */\n input: string | DesignSystem;\n /** Output target. Default: 'bricks'. */\n format?: Format;\n /** Directory to write outputs into. Default: 'dist'. */\n outDir?: string;\n /** Override the framework asset root (advanced/testing). */\n assetsDir?: string;\n}\n\nexport interface GenerateResult {\n format: Format;\n outDir: string;\n written: string[];\n}\n\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst DEFAULT_ASSETS = join(HERE, '..', 'assets');\n\n// ── colour machinery ─────────────────────────────────────────────────────────\n// Every hue is an 11-step numeric OKLCH scale (see tokens.ts); every role is a\n// hue reference that resolves to FUNCTIONAL tokens. No named steps, no scheme\n// grammar — dark mode is the automatic functional flip.\nconst UTILITY_PROPS: Record<string, string> = {\n bg: 'background-color',\n text: 'color',\n border: 'border-color',\n outline: 'outline-color',\n fill: 'fill',\n stroke: 'stroke',\n};\n\n// Functional-token var name: emphasis stops live in the --color-* namespace\n// (`stop-x-muted` → --color-<role>-x-muted); everything else is --<role>-<token>.\nconst fnVar = (role: string, token: string): string =>\n token.startsWith('stop-') ? `--color-${role}-${token.slice(5)}` : `--${role}-${token}`;\n// The functional utility classes for one role (bare name = functional default).\nconst fnUtilities = (role: string, utilities: string[], isSurface: boolean): string => {\n const rows: string[] = [];\n if (utilities.includes('bg')) {\n rows.push(`.bg-${role} { background-color: var(--${role}-bg); }`);\n rows.push(`.bg-${role}-muted { background-color: var(--${role}-bg-muted); }`);\n rows.push(`.bg-${role}-solid { background-color: var(--${role}-solid); }`);\n rows.push(`.bg-${role}-solid-bold { background-color: var(--${role}-solid-bold); }`);\n if (isSurface) rows.push(`.bg-${role}-bold { background-color: var(--${role}-bg-bold); }`);\n }\n if (utilities.includes('text')) {\n rows.push(`.text-${role} { color: var(--${role}-text); }`);\n rows.push(`.text-${role}-muted { color: var(--${role}-text-muted); }`);\n rows.push(`.text-${role}-x-muted { color: var(--${role}-text-x-muted); }`);\n rows.push(`.text-on-${role} { color: var(--${role}-on-solid); }`);\n }\n if (utilities.includes('border'))\n rows.push(\n `.border-${role} { border-color: var(--${role}-border); }`,\n `.border-${role}-bold { border-color: var(--${role}-border-bold); }`,\n );\n return rows.join('\\n');\n};\n\nconst decls = (obj: Record<string, string>, indent = ' ') =>\n Object.entries(obj)\n .map(([k, v]) => `${indent}${k}: ${v};`)\n .join('\\n');\n\n// ── fluid modular scale ───────────────────────────────────────────────────────\ninterface ScaleConfig {\n base: string;\n ratio: number;\n steps?: number;\n names?: string[];\n baseStep?: number;\n baseline?: string;\n fluid?: { minVw: string; maxVw: string; minRatio: number };\n}\ninterface ScaleStep {\n name: string;\n value: string;\n max: string;\n offset: number;\n}\nconst round = (n: number) => Number(n.toFixed(4)).toString();\nconst rem = (v: string) => parseFloat(v);\nconst buildScale = (s: ScaleConfig): ScaleStep[] => {\n const names = s.names ?? Array.from({ length: s.steps ?? 0 }, (_, i) => String(i + 1));\n const base = rem(s.base);\n const baseStep = s.baseStep ?? Math.ceil(names.length / 2);\n const baselineIdx = s.baseline ? names.indexOf(s.baseline) : baseStep - 1;\n return names.map((name, i) => {\n const k = i - (baseStep - 1);\n const vMax = base * Math.pow(s.ratio, k);\n const max = `${round(vMax)}rem`;\n let value = max;\n if (s.fluid) {\n const { minVw, maxVw, minRatio } = s.fluid;\n const vMin = base * Math.pow(minRatio, k);\n const lo = Math.min(vMin, vMax);\n const hi = Math.max(vMin, vMax);\n if (lo !== hi) {\n const slope = (vMax - vMin) / (rem(maxVw) - rem(minVw));\n const intercept = vMin - slope * rem(minVw);\n const sign = slope < 0 ? '-' : '+';\n const pref = `calc(${round(intercept)}rem ${sign} ${round(Math.abs(slope * 100))}vw)`;\n value = `clamp(${round(lo)}rem, ${pref}, ${round(hi)}rem)`;\n }\n }\n return { name, value, max, offset: i - baselineIdx };\n });\n};\n\n// ── typography ─────────────────────────────────────────────────────────────────\ninterface TypographyRole {\n family?: string;\n [key: string]: string | number | undefined;\n}\nconst TYPO_KEYMAP: Record<string, [string, string]> = {\n family: ['font-family', 'ff'],\n size: ['font-size', 'fs'],\n weight: ['font-weight', 'fw'],\n style: ['font-style', 'fst'],\n 'line-height': ['line-height', 'lh'],\n tracking: ['letter-spacing', 'ls'],\n 'text-decoration': ['text-decoration', 'td'],\n 'text-transform': ['text-transform', 'tt'],\n 'text-wrap': ['text-wrap', 'tw'],\n color: ['color', 'color'],\n};\nconst TYPO_IDENTITY: Record<string, string> = {\n 'font-style': 'normal',\n 'letter-spacing': 'normal',\n 'text-decoration': 'none',\n 'text-transform': 'none',\n 'text-wrap': 'wrap',\n};\n\n// ── animation state defaults ─────────────────────────────────────────────────\nconst STATE_DEFAULT: Record<string, string> = {\n opacity: '1',\n 'translate-x': '0',\n 'translate-y': '0',\n 'scale-x': '1',\n 'scale-y': '1',\n rotate: '0deg',\n blur: '0px',\n shadow: '0 0 0 transparent',\n brightness: '1',\n grayscale: '0',\n contrast: '1',\n saturate: '1',\n sepia: '0',\n 'hue-rotate': '0deg',\n clip: 'none',\n};\n\n// Pattern base geometry props → override-hook shorthand.\nconst BASE_HOOK: Record<string, string> = {\n padding: 'p',\n 'border-radius': 'br',\n border: 'b',\n 'box-shadow': 'ds',\n 'font-size': 'fs',\n};\n\ninterface Pattern {\n group?: string;\n overrides?: Record<string, string>;\n element?: string;\n class?: string;\n default_role?: string;\n base?: Record<string, string>;\n states?: Record<string, Record<string, unknown>>;\n roles?: string[];\n}\n\nconst id = (key: string) => createHash('sha256').update(key).digest('hex').slice(0, 6);\n\n/**\n * The in-memory output of building a design system. String fields are CSS/JSON\n * ready to write; the generated CSS partials feed the css/bricks bundler.\n */\ninterface Built {\n generated: Record<string, string>; // filename (under generated/) -> css\n bricksColorsNamed: string;\n bricksColorsSemantic: string;\n bricksVariables: string;\n tokensJson: string;\n designManifest: string;\n tailwind: string;\n // captured for the tailwind bundler\n twTypeTokensCss: string;\n twPatternTokensCss: string;\n patternsCss: string;\n}\n\nfunction build(ds: DesignSystem, format: Format, assetsDir: string): Built {\n const BRICKS = format === 'bricks';\n // Every hue expands to its 11-step numeric OKLCH scale; every role resolves\n // to functional tokens over its hue. Dark mode is the automatic flip.\n const expandedPalette = expandPalette(ds.colors.palette as Record<string, unknown>);\n const roleMap = ds.colors.roles as Record<string, string>;\n const scaleRoles: FunctionalRole[] = [];\n for (const [role, hueName] of Object.entries(roleMap)) {\n const hue = expandedPalette[hueName];\n if (hue == null) throw new Error(`role \"${role}\" references unknown palette hue \"${hueName}\"`);\n scaleRoles.push(functionalRole(role, hueName, hue));\n }\n const surfaceRole = scaleRoles.find((r) => r.role === 'surface');\n const patterns = ds.patterns;\n const shadows = ds.shadows;\n const typography = ds.typography;\n const UTILITIES = (ds.colors.utilities ?? ['bg', 'text', 'border']).filter(\n (u) => u in UTILITY_PROPS,\n );\n\n const generated: Record<string, string> = {};\n\n // ── color.css ──────────────────────────────────────────────────────────────\n if (BRICKS) {\n generated['color.css'] =\n '/* Colours provided by Bricks (palette import generates tokens + utilities). */\\n';\n } else {\n let css = `/* GENERATED from design-system.json — do not edit by hand. */\\n:root {\\n`;\n css += ` color-scheme: light;\\n`;\n css += ` /* Hue scales (numeric steps, 50 = tinted near-white … 950 = tinted near-black) */\\n`;\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const [n, hex] of Object.entries(hue.numeric))\n css += ` --color-${name}-${n}: ${hex};\\n`;\n css += `\\n /* Functional role tokens (the public API) */\\n`;\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.light)) css += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n if (surfaceRole) {\n css += `\\n /* Translucent surface + scrim */\\n`;\n css += ` --surface-glass: color-mix(in oklch, var(--surface-bg) 72%, transparent);\\n`;\n css += ` --overlay: color-mix(in oklch, var(--color-${surfaceRole.hue}-950) 45%, transparent);\\n`;\n }\n css += `}\\n\\n`;\n // Dark appearance: the automatic functional flip (solid stays mode-stable).\n {\n let fb = '';\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.dark))\n if (fr.light[t] !== val) fb += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n if (surfaceRole)\n fb += ` --overlay: color-mix(in oklch, var(--color-${surfaceRole.hue}-950) 60%, transparent);\\n`;\n if (fb) {\n css += `/* Functional role tokens (dark) */\\n`;\n css += `:root[data-brx-theme=\"dark\"] {\\n color-scheme: dark;\\n${fb}}\\n\\n`;\n }\n }\n // Utilities: hue numeric steps + role emphasis stops, then the functional\n // set (emitted last so it wins ties, e.g. bg-<role>-muted).\n const allTokens: string[] = [];\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const n of Object.keys(hue.numeric)) allTokens.push(`${name}-${n}`);\n for (const fr of scaleRoles)\n for (const stop of ['x-muted', 'muted', 'bold', 'x-bold'])\n allTokens.push(`${fr.role}-${stop}`);\n css += `/* Colour utilities — ${UTILITIES.join(', ')} */\\n`;\n for (const token of allTokens)\n css +=\n UTILITIES.map(\n (cls) => `.${cls}-${token} { ${UTILITY_PROPS[cls]}: var(--color-${token}); }`,\n ).join('\\n') + '\\n';\n css += `\\n/* Functional utilities (the public API) */\\n`;\n for (const fr of scaleRoles)\n css += `${fnUtilities(fr.role, UTILITIES, fr.role === 'surface')}\\n`;\n if (surfaceRole)\n css += `.glass { background-color: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }\\n`;\n generated['color.css'] = css;\n }\n\n // ── shadows.css ──────────────────────────────────────────────────────────────\n {\n const entries = Object.entries(shadows ?? {});\n let sh = `/* GENERATED drop-shadow tokens + utilities — do not edit by hand. */\\n`;\n if (entries.length) {\n sh += `:root {\\n`;\n for (const [name, value] of entries) sh += ` --shadow-${name}: ${value};\\n`;\n sh += `}\\n\\n`;\n for (const [name] of entries)\n sh += `.drop-shadow-${name} { filter: drop-shadow(var(--shadow-${name})); }\\n`;\n }\n generated['shadows.css'] = sh;\n }\n\n // ── scales ───────────────────────────────────────────────────────────────────\n const typeSteps = ds.typeScale ? buildScale(ds.typeScale as ScaleConfig) : [];\n const spaceSteps = ds.spaceScale ? buildScale(ds.spaceScale as ScaleConfig) : [];\n const textMax: Record<string, string> = Object.fromEntries(\n typeSteps.map((s) => [`text-${s.name}`, s.max]),\n );\n\n const typographyFamilies = typography?.families ?? {};\n const withScaleFallback = (v: string) =>\n v.replace(/var\\(\\s*(--text-[\\w-]+)\\s*\\)/g, (m, name) =>\n textMax[name.slice(2)] ? `var(${name}, ${textMax[name.slice(2)]})` : m,\n );\n const roleDecls = (role: string, spec: TypographyRole): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [key, [prop, sfx]] of Object.entries(TYPO_KEYMAP)) {\n const identity = TYPO_IDENTITY[prop];\n if (spec[key] == null && identity == null) continue;\n const raw =\n spec[key] == null\n ? (identity as string)\n : key === 'family'\n ? (typographyFamilies[spec.family as string] ?? String(spec.family))\n : key === 'size'\n ? withScaleFallback(String(spec[key]))\n : String(spec[key]);\n out[prop] = `var(--${role}-${sfx}, ${raw})`;\n }\n return out;\n };\n\n // ── type-tokens.css ──────────────────────────────────────────────────────────\n let twTypeTokensCss = '';\n if (BRICKS) {\n generated['type-tokens.css'] =\n '/* Fonts + type/space scales provided by Bricks (Font + Variables managers). */\\n';\n } else {\n const root: Record<string, string> = {};\n for (const [name, stack] of Object.entries(ds.fonts ?? {})) root[`--font-${name}`] = stack;\n for (const s of typeSteps) root[`--text-${s.name}`] = s.value;\n for (const s of spaceSteps) root[`--space-${s.name}`] = s.value;\n const css = `/* GENERATED font families + fluid type/space scales — do not edit by hand. */\\n:root {\\n${decls(root)}\\n}\\n`;\n twTypeTokensCss = css;\n generated['type-tokens.css'] = css;\n }\n\n // ── tokens.css (pattern token cascade) ───────────────────────────────────────\n let twPatternTokensCss = '';\n {\n const tDefaults = patterns?.defaults ?? {};\n const tRadii = patterns?.radii ?? {};\n const tGroups = patterns?.groups ?? {};\n const tZ = patterns?.z ?? {};\n const tItems = (patterns?.items ?? {}) as Record<string, Pattern>;\n const root: Record<string, string> = {};\n for (const [prop, val] of Object.entries(tDefaults)) root[`--${prop}-default`] = val;\n if (!BRICKS) for (const [name, val] of Object.entries(tRadii)) root[`--br-${name}`] = val;\n for (const [group, props] of Object.entries(tGroups))\n for (const [prop, val] of Object.entries(props)) root[`--${prop}-${group}`] = val;\n for (const [name, n] of Object.entries(tZ)) root[`--z-tier-${name}`] = String(n);\n const aliases: Record<string, string> = {};\n for (const [name, p] of Object.entries(tItems)) {\n if (!p.group) continue;\n for (const prop of Object.keys(tGroups[p.group] ?? {}))\n aliases[`--${prop}-${name}-group`] = `var(--${prop}-${p.group})`;\n for (const [prop, val] of Object.entries(p.overrides ?? {}))\n aliases[`--${prop}-${name}-group`] = val;\n }\n let tok = `/* GENERATED pattern token cascade — do not edit by hand. */\\n:root {\\n`;\n tok += decls(root) + '\\n';\n if (Object.keys(aliases).length) tok += '\\n' + decls(aliases) + '\\n';\n tok += `}\\n`;\n twPatternTokensCss = tok;\n generated['tokens.css'] = tok;\n }\n\n // ── typography.css (.font-* roles) ───────────────────────────────────────────\n {\n const roles = (typography?.roles ?? {}) as Record<string, TypographyRole>;\n const headings = typography?.headings ?? {};\n let typo = `/* GENERATED typography roles — do not edit by hand. */\\n`;\n for (const [role, spec] of Object.entries(roles))\n typo += `.font-${role} {\\n${decls(roleDecls(role, spec))}\\n}\\n`;\n for (const [tag, role] of Object.entries(headings))\n if (roles[role]) typo += `${tag} {\\n${decls(roleDecls(role, roles[role]))}\\n}\\n`;\n generated['typography.css'] = typo;\n }\n\n // ── patterns.css (component interaction patterns) ────────────────────────────\n const stateRules = (\n sel: string,\n role: string | null,\n states: Record<string, Record<string, unknown>>,\n colorProp: 'background-color' | 'color' = 'background-color',\n ) => {\n let out = '';\n for (const [state, spec] of Object.entries(states)) {\n const body: string[] = [];\n // `step` intensifies the pattern's colour: fills swap solid → solid-bold;\n // text swaps the bold emphasis stop → x-bold.\n if (typeof spec.step === 'number' && role) {\n const stateVar =\n colorProp === 'background-color'\n ? `var(--${role}-${spec.step >= 1 ? 'solid-bold' : 'solid'})`\n : `var(--color-${role}-${spec.step >= 1 ? 'x-bold' : 'bold'})`;\n body.push(`${colorProp}: ${stateVar};`);\n }\n if (typeof spec.scale === 'number') body.push(`scale: ${spec.scale};`);\n if (typeof spec.lift === 'string') body.push(`translate: 0 calc(-1 * ${spec.lift});`);\n if (typeof spec.shadow === 'string' && shadows?.[spec.shadow])\n body.push(`filter: drop-shadow(var(--shadow-${spec.shadow}));`);\n else if (spec.shadow === true)\n body.push(`box-shadow: var(--lift-shadow, 0 8px 20px -6px rgb(0 0 0 / 0.25));`);\n if (spec.ring === true) {\n const ringColor = role ? `var(--color-${role}-muted)` : `var(--color-ui-primary-muted)`;\n body.push(`outline: none;`, `box-shadow: 0 0 0 3px ${ringColor};`);\n }\n if (spec.css && typeof spec.css === 'object')\n for (const [k, v] of Object.entries(spec.css as Record<string, string>))\n body.push(`${k}: ${v};`);\n if (!body.length) continue;\n const pseudo =\n state === 'hover'\n ? ':hover'\n : state === 'active'\n ? ':active'\n : state === 'focus-visible'\n ? ':focus-visible'\n : `:${state}`;\n const rule = `${sel}${pseudo} {\\n ${body.join('\\n ')}\\n}\\n`;\n out += state === 'hover' ? `@media (hover: hover) {\\n${rule}}\\n` : rule;\n }\n return out;\n };\n\n let pat = `/* GENERATED component patterns — do not edit by hand. */\\n`;\n pat += `/* Interaction transitions for patterned elements (independent props compose). */\\n`;\n for (const [pname, p] of Object.entries((patterns?.items ?? {}) as Record<string, Pattern>)) {\n if (!p.base) continue;\n const states = p.states ?? {};\n const isElement = !!p.element;\n const defaultSel = isElement ? `:where(${p.element})` : `.${p.class ?? pname}`;\n const defaultRole = p.default_role ?? null;\n const base = { ...p.base };\n const fills =\n pname === 'button' ||\n pname === 'badge' ||\n base['background-color'] != null ||\n base['background'] != null;\n const colorProp: 'background-color' | 'color' = fills ? 'background-color' : 'color';\n pat += `${defaultSel} {\\n`;\n const hasStates = Object.keys(states).length > 0;\n if (hasStates) {\n pat += ` transition-property: translate, scale, rotate, filter, box-shadow, background-color, color;\\n`;\n pat += ` transition-duration: var(--interact-duration, 200ms);\\n`;\n pat += ` transition-timing-function: var(--interact-easing, ease);\\n`;\n pat += ` translate: 0 0; scale: 1; rotate: 0deg;\\n`;\n }\n if (defaultRole && fills && base['background-color'] == null && base['background'] == null)\n base['background-color'] = `var(--${defaultRole}-solid)`;\n const wrappedBase: Record<string, string> = {};\n for (const [prop, val] of Object.entries(base)) {\n const sfx = BASE_HOOK[prop];\n wrappedBase[prop] = sfx ? `var(--${sfx}-${pname}, ${val})` : String(val);\n }\n pat += decls(wrappedBase) + '\\n}\\n';\n pat += stateRules(defaultSel, defaultRole, states, colorProp);\n for (const role of p.roles ?? []) {\n const variantSel = isElement ? `${p.element}.${role}` : `.${p.class ?? pname}-${role}`;\n // Fills sit on the role's solid + pair with on-solid; text variants use\n // the bold emphasis stop (readable accent in both appearances).\n const variantColorDecl = fills\n ? `background-color: var(--${role}-solid); color: var(--${role}-on-solid)`\n : `color: var(--color-${role}-bold)`;\n pat += `${variantSel} { ${variantColorDecl}; }\\n`;\n pat += stateRules(variantSel, role, states, colorProp);\n }\n pat += '\\n';\n }\n generated['patterns.css'] = pat;\n\n // ── animation-effects.css ────────────────────────────────────────────────────\n {\n const anim = ds.animations ?? {};\n const asStr = (v: string | number) => String(v);\n const block = (sel: string, d: Record<string, string>) => `.${sel} {\\n${decls(d)}\\n}\\n`;\n let out = `/* GENERATED animation effects + journeys — do not edit by hand. */\\n`;\n for (const [name, e] of Object.entries(anim.effects ?? {})) {\n const d: Record<string, string> = { '--_anim': e.kf };\n for (const [k, v] of Object.entries(e.css ?? {})) d[k] = asStr(v);\n for (const [k, v] of Object.entries(e.vars ?? {})) d[`--${k}`] = asStr(v);\n out += block(name, d);\n }\n const base = anim.journeys?.base ?? {};\n for (const parts of anim.journeys?.compose ?? []) {\n const d: Record<string, string> = {\n '--_anim': parts.map((p) => `${p}-journey`).join(', '),\n 'animation-range': 'entry exit',\n };\n for (const p of parts)\n for (const [k, v] of Object.entries(base[p] ?? {})) d[`--${k}`] = asStr(v);\n out += block(`${parts.join('-')}-journey`, d);\n }\n const STATES: [string, (s: string) => string][] = [\n ['hover', (s) => `.${s}:hover`],\n ['focus', (s) => `.${s}:focus-visible`],\n ['active', (s) => `.${s}.is-active, .${s}[data-active]`],\n ];\n out += `\\n/* State-flip variants — compose with .transition (hover-/focus-/active-<fx>). */\\n`;\n for (const [name, e] of Object.entries(anim.effects ?? {})) {\n if (e.kf !== 'composite' && e.kf !== 'paint') continue;\n const props: Record<string, { from?: string; to?: string }> = {};\n for (const [k, v] of Object.entries(e.vars ?? {})) {\n const m = /^(.*)-(from|to)$/.exec(k);\n if (m) (props[m[1] as string] ??= {})[m[2] as 'from' | 'to'] = asStr(v);\n }\n const rest: Record<string, string> = {};\n for (const [p, ft] of Object.entries(props)) {\n if (ft.from != null && ft.from !== STATE_DEFAULT[p]) rest[`--${p}-from`] = ft.from;\n if (ft.to != null && ft.to !== STATE_DEFAULT[p]) rest[`--${p}-to`] = ft.to;\n }\n const flip: Record<string, string> = Object.fromEntries(\n Object.keys(props).map((p) => [`--t-${p}`, `var(--${p}-to, ${STATE_DEFAULT[p]})`]),\n );\n if (Object.keys(rest).length)\n out += `${STATES.map(([s]) => `.${s}-${name}`).join(', ')} {\\n${decls(rest)}\\n}\\n`;\n for (const [s, sel] of STATES) out += `${sel(`${s}-${name}`)} {\\n${decls(flip)}\\n}\\n`;\n }\n generated['animation-effects.css'] = out;\n }\n\n // ── Bricks palettes ──────────────────────────────────────────────────────────\n // Named = the hue scales (numeric steps); Semantic = the functional role\n // tokens with their automatic light/dark pairing.\n const namedColors: unknown[] = [];\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const [n, hex] of Object.entries(hue.numeric)) {\n const token = `${name}-${n}`;\n namedColors.push({\n raw: `var(--color-${token})`,\n light: hex,\n id: id(`named:${token}`),\n utilityClasses: UTILITIES,\n });\n }\n const semanticColors: unknown[] = [];\n for (const fr of scaleRoles)\n for (const [t, light] of Object.entries(fr.light)) {\n const dark = fr.dark[t] as string;\n semanticColors.push({\n raw: `var(${fnVar(fr.role, t)})`,\n light,\n darkModeEnabled: light !== dark,\n dark,\n id: id(`semantic:${fr.role}-${t}`),\n utilityClasses: UTILITIES,\n });\n }\n const bricksColorsNamed = JSON.stringify(\n { id: id('palette:named'), name: 'Named', colors: namedColors },\n null,\n 2,\n );\n const bricksColorsSemantic = JSON.stringify(\n { id: id('palette:semantic'), name: 'Semantic', colors: semanticColors },\n null,\n 2,\n );\n\n // ── Bricks Global Variables (fonts + scales) ─────────────────────────────────\n const bricksVariables = (() => {\n type BrxScale = { scale: number; scaleName: string };\n type BrxVar = { id: string; name: string; value: string; category?: string; scale?: BrxScale };\n type BrxCat = { id: string; name: string; scale: Record<string, unknown>; utilityClasses: [] };\n const scaleMeta = (scope: string, prefix: string, s: ScaleConfig, names: string[]) => {\n const px = Math.round(rem(s.base) * 16);\n const lo = s.fluid?.minRatio ?? s.ratio;\n return {\n scaleScope: scope,\n scaleType: 'tshirt',\n scaleNames: names,\n prefix,\n minFontSize: px,\n minScaleRatio: lo,\n minScaleRatioSelect: lo,\n maxFontSize: px,\n maxScaleRatio: s.ratio,\n maxScaleRatioSelect: s.ratio,\n baseline: s.baseline ?? names[Math.floor((names.length - 1) / 2)],\n };\n };\n const categories: BrxCat[] = [];\n const variables: BrxVar[] = [];\n const addScale = (\n label: string,\n scope: string,\n prefix: string,\n cfg: ScaleConfig | undefined,\n steps: ScaleStep[],\n ) => {\n if (!cfg || !steps.length) return;\n const names = steps.map((s) => s.name);\n const catId = id(`varcat:${scope}`);\n categories.push({\n id: catId,\n name: label,\n scale: scaleMeta(scope, prefix, cfg, names),\n utilityClasses: [],\n });\n for (const st of steps)\n variables.push({\n id: id(`var:${prefix}${st.name}`),\n name: `${prefix}${st.name}`,\n value: st.value,\n category: catId,\n scale: { scale: st.offset, scaleName: st.name },\n });\n };\n addScale('Typography', 'typography', 'text-', ds.typeScale as ScaleConfig, typeSteps);\n addScale('Spacing', 'spacing', 'space-', ds.spaceScale as ScaleConfig, spaceSteps);\n for (const [name, stack] of Object.entries(ds.fonts ?? {}))\n variables.push({ id: id(`var:font-${name}`), name: `font-${name}`, value: stack });\n for (const [name, val] of Object.entries(ds.patterns?.radii ?? {}))\n variables.push({ id: id(`var:br-${name}`), name: `br-${name}`, value: val });\n return JSON.stringify({ variables, categories }, null, 2);\n })();\n\n // ── tokens.json (trimmed token export for programmatic consumers) ────────────\n const numericPalette = Object.fromEntries(\n Object.entries(expandedPalette).map(([k, v]) => [k, v.numeric]),\n );\n const tokensJson = JSON.stringify(\n {\n colors: {\n palette: numericPalette,\n roles: roleMap,\n functional: Object.fromEntries(\n scaleRoles.map((fr) => [fr.role, { light: fr.light, dark: fr.dark }]),\n ),\n },\n fonts: ds.fonts ?? {},\n text: Object.fromEntries(typeSteps.map((s) => [s.name, s.value])),\n spacing: Object.fromEntries(spaceSteps.map((s) => [s.name, s.value])),\n shadows: shadows ?? {},\n radii: ds.patterns?.radii ?? {},\n },\n null,\n 2,\n );\n\n // ── design-manifest.json (live-editor manifest; css format) ──────────────────\n const designManifest = (() => {\n const reverseIndex: Record<string, string> = {};\n // Numeric steps are generated from the hue's seed — edits map back to it.\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const n of Object.keys(hue.numeric))\n reverseIndex[`--color-${name}-${n}`] = `colors.palette.${name}.seed`;\n const colorRoles = Object.entries(roleMap).map(([name, ramp]) => ({ name, ramp }));\n const typoRoles = (typography?.roles ?? {}) as Record<string, TypographyRole>;\n const hooks: Record<string, { prop: string; key: string }> = {};\n for (const [key, [prop, sfx]] of Object.entries(TYPO_KEYMAP)) hooks[sfx] = { prop, key };\n for (const [role, spec] of Object.entries(typoRoles))\n for (const [key, [, sfx]] of Object.entries(TYPO_KEYMAP))\n if (spec[key] != null) reverseIndex[`--${role}-${sfx}`] = `typography.roles.${role}.${key}`;\n const pDefaults = patterns?.defaults ?? {};\n const pRadii = patterns?.radii ?? {};\n const pGroups = patterns?.groups ?? {};\n const pItems = (patterns?.items ?? {}) as Record<string, Pattern>;\n for (const prop of Object.keys(pDefaults))\n reverseIndex[`--${prop}-default`] = `patterns.defaults.${prop}`;\n for (const name of Object.keys(pRadii)) reverseIndex[`--br-${name}`] = `patterns.radii.${name}`;\n for (const [group, props] of Object.entries(pGroups))\n for (const prop of Object.keys(props))\n reverseIndex[`--${prop}-${group}`] = `patterns.groups.${group}.${prop}`;\n const items = Object.entries(pItems).map(([name, p]) => {\n const base = p.base ?? {};\n const wrappable = Object.keys(base)\n .filter((prop) => prop in BASE_HOOK)\n .map((prop) => ({ sfx: BASE_HOOK[prop] as string, prop }));\n for (const { sfx, prop } of wrappable)\n reverseIndex[`--${sfx}-${name}`] = `patterns.items.${name}.base.${prop}`;\n return { name, group: p.group ?? null, base, wrappable, roles: p.roles ?? [] };\n });\n return JSON.stringify(\n {\n colors: {\n ramps: Object.keys(expandedPalette),\n steps: NUMERIC_STEPS,\n palette: numericPalette,\n roles: colorRoles,\n },\n typography: {\n roles: Object.keys(typoRoles),\n hooks,\n families: typographyFamilies,\n specs: typoRoles,\n },\n scales: {\n text: typeSteps.map((s) => ({ name: s.name, value: s.value, max: s.max })),\n space: spaceSteps.map((s) => ({ name: s.name, value: s.value, max: s.max })),\n },\n fonts: ds.fonts ?? {},\n patterns: { defaults: pDefaults, radii: pRadii, groups: pGroups, items },\n shadows: shadows ?? {},\n interaction: { duration: '200ms', easing: 'ease' },\n reverseIndex,\n },\n null,\n 2,\n );\n })();\n\n // ── Tailwind bundle ──────────────────────────────────────────────────────────\n const tailwind = emitTailwind({\n ds,\n expandedPalette,\n scaleRoles,\n shadows,\n typeSteps,\n spaceSteps,\n typography,\n roleDecls,\n twTypeTokensCss,\n twPatternTokensCss,\n patternsCss: pat,\n assetsDir,\n });\n\n return {\n generated,\n bricksColorsNamed,\n bricksColorsSemantic,\n bricksVariables,\n tokensJson,\n designManifest,\n tailwind,\n twTypeTokensCss,\n twPatternTokensCss,\n patternsCss: pat,\n };\n}\n\n// ── Tailwind emitter ──────────────────────────────────────────────────────────\ninterface TwCtx {\n ds: DesignSystem;\n expandedPalette: Record<string, ExpandedHue>;\n scaleRoles: FunctionalRole[];\n shadows: Record<string, string> | undefined;\n typeSteps: ScaleStep[];\n spaceSteps: ScaleStep[];\n typography: DesignSystem['typography'];\n roleDecls: (role: string, spec: TypographyRole) => Record<string, string>;\n twTypeTokensCss: string;\n twPatternTokensCss: string;\n patternsCss: string;\n assetsDir: string;\n}\n\nfunction emitTailwind(ctx: TwCtx): string {\n const {\n ds,\n expandedPalette,\n scaleRoles,\n shadows,\n typeSteps,\n spaceSteps,\n typography,\n roleDecls,\n twTypeTokensCss,\n twPatternTokensCss,\n patternsCss,\n assetsDir,\n } = ctx;\n const cssDir = join(assetsDir, 'css');\n const nl = (arr: string[]) => arr.filter(Boolean).join('\\n');\n const parts: string[] = [`/* GENERATED for Tailwind v4 (Astro) — do not edit by hand. */`];\n parts.push(`@import \"tailwindcss\";\\n`);\n\n const theme: string[] = [];\n theme.push(` /* Hue scales → bg-<hue>-<step> text-* border-* (numeric, 50…950) */`);\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const [n, hex] of Object.entries(hue.numeric))\n theme.push(` --color-${name}-${n}: ${hex};`);\n theme.push(`\\n /* Fonts → font-* */`);\n for (const [name, stack] of Object.entries(ds.fonts ?? {}))\n theme.push(` --font-${name}: ${stack};`);\n theme.push(`\\n /* Fluid type scale → text-* */`);\n for (const s of typeSteps) theme.push(` --text-${s.name}: ${s.value};`);\n // Fluid space steps are NOT put in Tailwind's --spacing-* namespace: named\n // spacing keys shadow the size scales (e.g. `max-w-7xl` would resolve to\n // var(--spacing-7xl) ≈ 6rem and collapse layouts). They ship as --space-*\n // (matching the css format) in a plain :root below; use var(--space-<name>)\n // or the TW4 arbitrary form p-(--space-md). Numeric spacing (p-4 …) keeps\n // Tailwind's default --spacing multiplier.\n theme.push(`\\n /* Drop-shadows → shadow-* */`);\n for (const [name, value] of Object.entries(shadows ?? {}))\n theme.push(` --shadow-${name}: ${value};`);\n theme.push(`\\n /* Container breakpoints → @sm:/@md:/@lg:/@xl: */`);\n for (const [name, val] of [\n ['sm', '30rem'],\n ['md', '48rem'],\n ['lg', '64rem'],\n ['xl', '80rem'],\n ])\n theme.push(` --container-${name}: ${val};`);\n parts.push(`@theme {\\n${theme.join('\\n')}\\n}\\n`);\n\n if (spaceSteps.length)\n parts.push(\n `/* Fluid space scale — var(--space-<name>) or p-(--space-<name>) */\\n:root {\\n` +\n spaceSteps.map((s) => ` --space-${s.name}: ${s.value};`).join('\\n') +\n `\\n}\\n`,\n );\n\n // Functional role tokens (not --color-*, so a plain :root block — Tailwind\n // must not derive single-purpose utilities from them; the @utility set below\n // is the public API).\n if (scaleRoles.length) {\n let fn = '';\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.light)) fn += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n const surface = scaleRoles.find((r) => r.role === 'surface');\n if (surface) {\n fn += ` --surface-glass: color-mix(in oklch, var(--surface-bg) 72%, transparent);\\n`;\n fn += ` --overlay: color-mix(in oklch, var(--color-${surface.hue}-950) 45%, transparent);\\n`;\n }\n parts.push(`/* Functional role tokens (the public API) */\\n:root {\\n${fn}}\\n`);\n }\n\n parts.push(\n `/* ── Framework tokens (consumed by the inlined components) ── */\\n` +\n `${twTypeTokensCss}\\n${twPatternTokensCss}`,\n );\n\n // Dark appearance: the automatic functional flip (solid stays mode-stable).\n let darkBlock = '';\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.dark))\n if (fr.light[t] !== val) darkBlock += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n {\n const surface = scaleRoles.find((r) => r.role === 'surface');\n if (surface)\n darkBlock += ` --overlay: color-mix(in oklch, var(--color-${surface.hue}-950) 60%, transparent);\\n`;\n }\n if (darkBlock)\n parts.push(\n `/* Functional role tokens (dark) */\\n:root[data-brx-theme=\"dark\"] {\\n color-scheme: dark;\\n${darkBlock}}\\n`,\n );\n\n parts.push(\n `/* State variant for the active flip (hover/focus-visible are built in). */\\n` +\n `@custom-variant is-active (&.is-active, &[data-active]);\\n`,\n );\n\n const util: string[] = [];\n if (scaleRoles.length) {\n util.push(`/* Functional colour utilities (the public API) */`);\n for (const fr of scaleRoles)\n for (const row of fnUtilities(fr.role, ['bg', 'text', 'border'], fr.role === 'surface').split(\n '\\n',\n )) {\n const m = /^\\.([^ ]+) \\{ (.*) \\}$/.exec(row);\n if (m) util.push(`@utility ${m[1]} {\\n ${m[2]}\\n}`);\n }\n if (scaleRoles.some((r) => r.role === 'surface'))\n util.push(\n `@utility glass {\\n background-color: var(--surface-glass);\\n backdrop-filter: blur(12px);\\n -webkit-backdrop-filter: blur(12px);\\n}`,\n );\n }\n util.push(`/* Typography roles */`);\n for (const [role, spec] of Object.entries(\n (typography?.roles ?? {}) as Record<string, TypographyRole>,\n ))\n util.push(`@utility font-${role} {\\n${decls(roleDecls(role, spec))}\\n}`);\n util.push(`\\n/* Animation effects (pair with .transition or a driver) */`);\n const asStr = (v: string | number) => String(v);\n for (const [name, e] of Object.entries(ds.animations?.effects ?? {})) {\n const d: Record<string, string> = { '--_anim': e.kf };\n for (const [k, v] of Object.entries(e.css ?? {})) d[k] = asStr(v);\n for (const [k, v] of Object.entries(e.vars ?? {})) d[`--${k}`] = asStr(v);\n util.push(`@utility ${name} {\\n${decls(d)}\\n}`);\n if (e.kf !== 'composite' && e.kf !== 'paint') continue;\n const props = new Set<string>();\n for (const k of Object.keys(e.vars ?? {})) {\n const m = /^(.*)-(from|to)$/.exec(k);\n if (m) props.add(m[1] as string);\n }\n const flip = Object.fromEntries(\n [...props].map((p) => [`--t-${p}`, `var(--${p}-to, ${STATE_DEFAULT[p]})`]),\n );\n util.push(`@utility flip-${name} {\\n${decls(flip)}\\n}`);\n }\n util.push(`\\n/* Split — internal fractions (pair split with a ratio) */`);\n util.push(\n `@utility split {\\n display: flex;\\n` +\n ` & > * { flex: 1; }\\n` +\n ` & > :first-child { flex: var(--_split-a, 1); }\\n` +\n ` & > :last-child { flex: var(--_split-b, 1); }\\n}`,\n );\n const RATIOS: [number, number][] = [\n [1, 2],\n [2, 1],\n [1, 3],\n [3, 1],\n [1, 4],\n [4, 1],\n [2, 3],\n [3, 2],\n ];\n for (const [a, b] of RATIOS)\n util.push(`@utility split-${a}-${b} {\\n --_split-a: ${a};\\n --_split-b: ${b};\\n}`);\n util.push(`\\n/* Track placement (inside .centered) */`);\n for (const track of ['measure', 'breakout', 'spotlight', 'fullbleed'])\n util.push(`@utility ${track} {\\n grid-column: ${track};\\n}`);\n parts.push(util.join('\\n') + '\\n');\n\n // Structure mirrors layout.css (kept literal for parity with the original emitter).\n parts.push(`/* ── Structure (mirrors src/css/layout.css) ── */\n:root {\n --rhythm-scale: 1;\n --rhythm-base: calc(1rlh * var(--rhythm-scale));\n --rhythm-h-p: 0.4;\n --rhythm-p-p: 0.9;\n --rhythm-p-h: 1.6;\n --rhythm-h-h: 0.6;\n --rhythm-p-list: 0.5;\n --rhythm-list-p: 0.9;\n --rhythm-li-li: 0.3;\n --rhythm-text-media: 1.2;\n --rhythm-media-text: 1.2;\n --width-measure: 65ch;\n --width-breakout: 90ch;\n --width-spotlight: 120ch;\n --gutter: clamp(1rem, 4cqi, 3rem);\n}\n\nbody {\n container-type: inline-size;\n}\n\n.rhythm {\n display: flow-root;\n}\n.rhythm > * + * {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-p-p));\n}\n.rhythm > :where(h1, h2, h3, h4, h5, h6) + p {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-h-p));\n}\n.rhythm > p + :where(h1, h2, h3, h4, h5, h6) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-p-h));\n}\n.rhythm > :where(h1, h2, h3, h4, h5, h6) + :where(h1, h2, h3, h4, h5, h6) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-h-h));\n}\n.rhythm > p + :where(ul, ol) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-p-list));\n}\n.rhythm > :where(ul, ol) + p {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-list-p));\n}\n.rhythm :where(ul, ol) > li + li {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-li-li));\n}\n.rhythm > :where(p, h1, h2, h3, h4, h5, h6, ul, ol) + :where(figure, img, picture, video) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-text-media));\n}\n.rhythm > :where(figure, img, picture, video) + :where(p, h1, h2, h3, h4, h5, h6, ul, ol) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-media-text));\n}\n\n.centered {\n --_measure: min(var(--width-measure), 100% - var(--gutter) * 2);\n --_breakout: minmax(0, calc((var(--width-breakout) - var(--width-measure)) / 2));\n --_spotlight: minmax(0, calc((var(--width-spotlight) - var(--width-breakout)) / 2));\n position: relative;\n display: grid;\n grid-template-columns:\n [fullbleed-start] minmax(var(--gutter), 1fr)\n [spotlight-start] var(--_spotlight)\n [breakout-start] var(--_breakout)\n [measure-start] var(--_measure) [measure-end]\n var(--_breakout) [breakout-end]\n var(--_spotlight) [spotlight-end]\n minmax(var(--gutter), 1fr) [fullbleed-end];\n}\n.centered > * {\n grid-column: measure;\n}\n\n.region {\n padding-block: clamp(\n var(--region-space-min, 3rem),\n var(--region-space, 8vh),\n var(--region-space-max, 8rem)\n );\n}\n`);\n\n const animEngine = readFileSync(join(cssDir, 'animation.css'), 'utf8');\n parts.push(`/* ── Animation engine (animation.css) ── */\\n${animEngine}`);\n // Patterns live in Tailwind's `components` layer so single-purpose utilities\n // (@layer utilities — declared later in the layer order) override them, e.g.\n // `.text-on-ui-primary` beating the link pattern's element-level `a { color }`.\n // Unlayered CSS would win over ALL layered utilities regardless of specificity.\n parts.push(`/* ── Component patterns ── */\\n@layer components {\\n${patternsCss}\\n}`);\n\n // Component + structural partials: the full framework library, minus the\n // Tailwind-owned utility layer. Sourced live from the CSS partials (in index.css\n // cascade order) so this never goes stale, then run through stripForTailwind.\n const TW_CLASH = new Set<string>([\n 'block',\n 'inline',\n 'inline-block',\n 'flow-root',\n 'flex',\n 'inline-flex',\n 'grid',\n 'inline-grid',\n 'table',\n 'inline-table',\n 'table-caption',\n 'table-cell',\n 'table-row',\n 'contents',\n 'hidden',\n 'list-item',\n 'static',\n 'fixed',\n 'absolute',\n 'relative',\n 'sticky',\n 'isolate',\n 'visible',\n 'invisible',\n 'collapse',\n 'sr-only',\n 'not-sr-only',\n 'flex-row',\n 'flex-row-reverse',\n 'flex-col',\n 'flex-col-reverse',\n 'flex-wrap',\n 'flex-nowrap',\n 'items-start',\n 'items-end',\n 'items-center',\n 'items-baseline',\n 'items-stretch',\n 'justify-start',\n 'justify-end',\n 'justify-center',\n 'justify-between',\n 'justify-around',\n 'justify-evenly',\n 'content-start',\n 'content-end',\n 'content-center',\n 'content-between',\n 'content-around',\n 'content-evenly',\n 'text-left',\n 'text-center',\n 'text-right',\n 'text-justify',\n 'text-start',\n 'text-end',\n ]);\n const droppedClashes = new Set<string>();\n let droppedVariantBlocks = 0;\n const stripForTailwind = (css: string): string => {\n const kept: string[] = [];\n let depth = 0;\n let start = 0;\n let preludeEnd = -1;\n for (let i = 0; i < css.length; i++) {\n const ch = css[i];\n if (ch === '/' && css[i + 1] === '*') {\n const end = css.indexOf('*/', i + 2);\n i = end === -1 ? css.length : end + 1;\n continue;\n }\n if (ch === '\"' || ch === \"'\") {\n i += 1;\n while (i < css.length && css[i] !== ch) i += css[i] === '\\\\' ? 2 : 1;\n continue;\n }\n if (ch === '{') {\n if (depth === 0) preludeEnd = i;\n depth++;\n } else if (ch === '}') {\n depth--;\n if (depth === 0) {\n const raw = css.slice(start, i + 1).trim();\n const prelude = css\n .slice(start, preludeEnd)\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .trim();\n const clash = /^\\.([A-Za-z0-9_-]+)/.exec(prelude);\n if (/^@container\\s*\\(\\s*min-width:/.test(prelude)) droppedVariantBlocks++;\n else if (clash && TW_CLASH.has(clash[1] as string))\n droppedClashes.add(clash[1] as string);\n else if (raw) kept.push(raw);\n start = i + 1;\n }\n }\n }\n return kept.join('\\n\\n');\n };\n\n const partials = componentPartialOrder(cssDir);\n const componentCss = partials\n .map((rel) => {\n const css = readFileSync(join(cssDir, rel), 'utf8');\n return `/* ── ${rel} ── */\\n${stripForTailwind(css)}`;\n })\n .join('\\n\\n');\n // Same layering rationale as the patterns block above.\n parts.push(\n `/* ── Component + structural partials (Tailwind-clashing utilities dropped) ── */\\n@layer components {\\n${componentCss}\\n}`,\n );\n\n return nl(parts) + '\\n';\n}\n\n/**\n * The component/structural CSS partials to inline into the Tailwind bundle, in\n * index.css cascade order. Everything the aggregator imports EXCEPT the engine\n * (global/animation), the layout utilities (Tailwind owns them), and the generated\n * token layer (Tailwind builds its own via @theme).\n */\nfunction componentPartialOrder(cssDir: string): string[] {\n const indexPath = join(cssDir, 'index.css');\n const skip = new Set(['global.css', 'animation.css', 'layout.css']);\n const order: string[] = [];\n const seen = new Set<string>();\n const text = existsSync(indexPath) ? readFileSync(indexPath, 'utf8') : '';\n for (const m of text.matchAll(/@import\\s+['\"]\\.\\/([^'\"]+)['\"]/g)) {\n const rel = m[1] as string;\n if (rel.startsWith('generated/')) continue;\n if (skip.has(rel)) continue;\n if (!seen.has(rel) && existsSync(join(cssDir, rel))) {\n seen.add(rel);\n order.push(rel);\n }\n }\n // Fallback: if no index.css, inline utilities + every pattern partial.\n if (!order.length) {\n if (existsSync(join(cssDir, 'utilities.css'))) order.push('utilities.css');\n const pdir = join(cssDir, 'patterns');\n if (existsSync(pdir))\n for (const f of readdirSync(pdir).sort()) if (f.endsWith('.css')) order.push(`patterns/${f}`);\n }\n return order;\n}\n\n// ── CSS bundling (css + bricks formats) ───────────────────────────────────────\n/**\n * Assemble the full stylesheet by resolving index.css's @import order against the\n * static partials (from assets) and the freshly generated token partials (in\n * memory), then minify with lightningcss. No @import survives, so no disk\n * resolution / shared `generated/` dir is needed.\n */\nfunction bundleCss(\n generated: Record<string, string>,\n assetsDir: string,\n minify: boolean,\n): { code: string; map: string | undefined } {\n const cssDir = join(assetsDir, 'css');\n const indexPath = join(cssDir, 'index.css');\n const index = readFileSync(indexPath, 'utf8');\n const chunks: string[] = [];\n for (const line of index.split('\\n')) {\n const m = /@import\\s+['\"]\\.\\/([^'\"]+)['\"]/.exec(line);\n if (!m) continue;\n const rel = m[1] as string;\n if (rel.startsWith('generated/')) {\n const name = rel.slice('generated/'.length);\n chunks.push(generated[name] ?? '');\n } else {\n chunks.push(readFileSync(join(cssDir, rel), 'utf8'));\n }\n }\n const merged = chunks.join('\\n');\n const res = transform({\n filename: 'styles.css',\n code: Buffer.from(merged),\n minify,\n sourceMap: minify,\n });\n return {\n code: res.code.toString(),\n map: res.map ? res.map.toString() : undefined,\n };\n}\n\n// ── public generate() ─────────────────────────────────────────────────────────\nfunction loadConfig(input: string | DesignSystem): DesignSystem {\n const raw = typeof input === 'string' ? JSON.parse(readFileSync(input, 'utf8')) : input;\n const result = validate(raw);\n if (!result.ok) {\n const lines = result.errors\n .slice(0, 12)\n .map((e) => ` • ${e.path.join('.') || '(root)'}: ${e.message}`)\n .join('\\n');\n throw new Error(`Invalid design-system.json:\\n${lines}`);\n }\n return result.data;\n}\n\nexport async function generate(options: GenerateOptions): Promise<GenerateResult> {\n const format: Format = options.format ?? 'bricks';\n const outDir = options.outDir ?? 'dist';\n const assetsDir = options.assetsDir ?? DEFAULT_ASSETS;\n const ds = loadConfig(options.input);\n const built = build(ds, format, assetsDir);\n mkdirSync(outDir, { recursive: true });\n const written: string[] = [];\n const put = (rel: string, content: string) => {\n const p = join(outDir, rel);\n mkdirSync(dirname(p), { recursive: true });\n writeFileSync(p, content);\n written.push(p);\n };\n\n if (format === 'tailwind') {\n put('tailwind.css', built.tailwind);\n put('tokens.json', built.tokensJson);\n } else if (format === 'css') {\n const { code } = bundleCss(built.generated, assetsDir, true);\n put('styles.css', code);\n put('tokens.json', built.tokensJson);\n put('design-manifest.json', built.designManifest);\n } else {\n // bricks: bundled minified CSS + Bricks import JSON + copied JS/PHP/docs.\n const { code, map } = bundleCss(built.generated, assetsDir, true);\n put('styles.min.css', map ? code + `\\n/*# sourceMappingURL=styles.min.css.map */` : code);\n if (map) put('styles.min.css.map', map);\n put('bricks-colors-named.json', built.bricksColorsNamed);\n put('bricks-colors-semantic.json', built.bricksColorsSemantic);\n put('bricks-variables.json', built.bricksVariables);\n put('tokens.json', built.tokensJson);\n // Framework-static JS bundles → outDir root (theme enqueues them).\n const jsDir = join(assetsDir, 'js');\n if (existsSync(jsDir)) {\n cpSync(jsDir, outDir, { recursive: true });\n for (const f of readdirSync(jsDir)) written.push(join(outDir, f));\n }\n // Bricks PHP elements + loader → outDir/bricks.\n const bricksSrc = join(assetsDir, 'bricks');\n if (existsSync(bricksSrc)) {\n cpSync(bricksSrc, join(outDir, 'bricks'), { recursive: true });\n written.push(join(outDir, 'bricks'));\n }\n // OKF docs bundle (generated per-config) → outDir/docs.\n const docs = generateDocs(ds, assetsDir);\n for (const [rel, content] of Object.entries(docs)) put(join('docs', rel), content);\n }\n\n return { format, outDir, written };\n}\n","/**\n * Company / site-level configuration schema — the umbrella around a\n * `design-system.json`-compliant `designSystem`.\n *\n * Authored with `zod/mini` (same instance the design-system schema uses), so the\n * two compose: `DesignSystemSchema` is embedded as `designSystem.<theme>` and the\n * whole thing serialises to one JSON Schema via `z.toJSONSchema`. Everything a\n * generator needs derives from here: the `SiteConfig` type (`z.infer`), the\n * published JSON Schema (`siteJsonSchema`), and runtime validation (`validateSite`).\n *\n * Pure: no YAML/env/fs. `resolveSiteConfig` takes an already-parsed object; a\n * thin loader (reading YAML, injecting `SITE_ENV`) lives outside this module.\n */\nimport * as z from 'zod/mini';\nimport { DesignSystemPatchSchema, type DesignSystem } from './schema.ts';\n\n// ── Primitives ────────────────────────────────────────────────────────────────\n\n/** A string, or a per-locale map of strings (`{ en: \"…\", fr: \"…\" }`). */\nconst LocalizableSchema = z.union([z.string(), z.record(z.string(), z.string())]);\n\nconst ImageRefSchema = z.union([\n z.string(),\n z.object({\n src: z.string(),\n alt: z.string(),\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n }),\n]);\n\n// Attribute bags on generated HTML — constrained to serialisable scalars so the\n// exported JSON Schema still offers validation (vs. an opaque `unknown`).\nconst AttrValue = z.union([z.string(), z.number(), z.boolean()]);\nconst AttrsSchema = z.optional(z.record(z.string(), AttrValue));\n\nconst IsoDate = z.string().check(z.regex(/^\\d{4}-\\d{2}-\\d{2}$/)); // YYYY-MM-DD\nconst Iso4217 = z.string().check(z.regex(/^[A-Z]{3}$/)); // currency code\nconst DayOfWeek = z.enum([\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n 'Sunday',\n]);\n\n// ── Design system (named-theme map) ─────────────────────────────────────────────\n// Each entry is a full `DesignSystem` plus a localised `displayName` and an\n// optional `extends` (another entry's key). Entries are lenient (all top-level\n// fields optional) so an extending entry can be a partial patch; the resolved\n// theme is validated against the full `DesignSystemSchema` by `resolveTheme`.\n\nconst DesignSystemEntry = z.extend(DesignSystemPatchSchema, {\n displayName: z.optional(LocalizableSchema),\n extends: z.optional(z.string()),\n});\n\n// ── Locales ─────────────────────────────────────────────────────────────────────\n\nconst LocaleSchema = z.object({\n name: z.string(),\n tagline: z.optional(z.string()),\n basePath: z.optional(z.string()),\n});\n\n// ── Domains ─────────────────────────────────────────────────────────────────────\n\nconst HttpRedirect = z.union([z.literal(301), z.literal(302), z.literal(307), z.literal(308)]);\n\nconst DomainAliasSchema = z.object({\n domain: z.string(),\n redirectType: HttpRedirect,\n redirectTo: z.string(),\n environment: z.optional(z.string()),\n});\n\n// ── Contact / address (schema.org-aligned) ──────────────────────────────────────\n\n/** schema.org `PostalAddress` field names, so JSON-LD generation is lossless. */\nconst PostalAddressSchema = z.object({\n streetAddress: z.string(),\n addressLocality: z.string(), // city\n addressRegion: z.optional(z.string()), // state/province\n postalCode: z.optional(z.string()),\n addressCountry: z.string(), // ISO 3166-1 alpha-2 preferred\n});\n\nconst ContactObjectSchema = z.object({\n name: z.optional(z.string()),\n email: z.optional(z.email()),\n phone: z.optional(z.string()),\n address: z.optional(PostalAddressSchema),\n});\n\n// contact is either a string (location key reference) or an inline object\nconst ContactConfigSchema = z.union([z.string(), ContactObjectSchema]);\n\n// ── Locations (schema.org LocalBusiness) ────────────────────────────────────────\n\nconst GeoSchema = z.object({\n latitude: z.number().check(z.gte(-90), z.lte(90)),\n longitude: z.number().check(z.gte(-180), z.lte(180)),\n});\n\n/** schema.org `OpeningHoursSpecification` — per-day open/close (24h `HH:MM`). */\nconst OpeningHoursSchema = z.object({\n dayOfWeek: z.array(DayOfWeek),\n opens: z.string().check(z.regex(/^\\d{2}:\\d{2}$/)),\n closes: z.string().check(z.regex(/^\\d{2}:\\d{2}$/)),\n});\n\n// Common schema.org LocalBusiness subtypes (extend as needed).\nconst LocalBusinessType = z.enum([\n 'LocalBusiness',\n 'Store',\n 'Restaurant',\n 'CafeOrCoffeeShop',\n 'ProfessionalService',\n 'MedicalBusiness',\n 'HealthAndBeautyBusiness',\n 'HomeAndConstructionBusiness',\n 'AutomotiveBusiness',\n 'FinancialService',\n 'LegalService',\n 'RealEstateAgent',\n 'Organization',\n]);\n\nconst LocationSchema = z.object({\n slug: z.optional(LocalizableSchema),\n name: LocalizableSchema,\n email: z.optional(z.email()),\n phone: z.optional(z.string()),\n address: z.optional(PostalAddressSchema),\n geo: z.optional(GeoSchema),\n hours: z.optional(z.array(OpeningHoursSchema)),\n type: z.optional(LocalBusinessType),\n description: z.optional(LocalizableSchema),\n areaServed: z.optional(z.array(z.string())),\n priceRange: z.optional(z.string()),\n paymentAccepted: z.optional(z.array(z.string())),\n currenciesAccepted: z.optional(Iso4217),\n knowsLanguage: z.optional(z.array(z.string())),\n});\n\n// ── Organization (schema.org Organization) ──────────────────────────────────────\n\nconst OrganizationSchema = z.object({\n name: z.optional(LocalizableSchema),\n legalName: z.optional(z.string()),\n foundingDate: z.optional(IsoDate),\n logo: z.optional(ImageRefSchema),\n email: z.optional(z.email()),\n phone: z.optional(z.string()),\n address: z.optional(PostalAddressSchema),\n taxID: z.optional(z.string()),\n vatID: z.optional(z.string()),\n /** Profile URLs → JSON-LD `sameAs` (mirrors `links`). */\n sameAs: z.optional(z.array(z.url())),\n});\n\n// ── DNS ──────────────────────────────────────────────────────────────────────\n\nconst DnsRecordType = z.enum(['A', 'AAAA', 'CNAME', 'TXT', 'MX', 'NS', 'SRV', 'CAA', 'PTR', 'SOA']);\n\nconst DnsRecordSchema = z.object({\n type: DnsRecordType,\n name: z.optional(z.string()),\n value: z.string(),\n ttl: z.optional(z.number().check(z.int(), z.positive())),\n proxied: z.optional(z.boolean()),\n});\n\nconst DnsDomainSchema = z.object({\n provider: z.optional(z.string()),\n nameservers: z.optional(z.array(z.string())),\n records: z.optional(z.array(DnsRecordSchema)),\n});\n\n// ── Environments ──────────────────────────────────────────────────────────────\n\nconst RobotsSchema = z.string(); // e.g. \"index,follow\" / \"noindex,nofollow\"\n\nconst EnvironmentSchema = z.object({\n url: z.url(),\n api: z.optional(z.url()),\n analytics: z.optional(z.boolean()),\n robots: z.optional(RobotsSchema),\n variant: z.optional(z.string()),\n});\n\n// ── A/B testing ─────────────────────────────────────────────────────────────────\n\nconst AbVariantSchema = z.object({\n environment: z.string(),\n description: z.optional(z.string()),\n // Deliberate escape hatch: overrides are deep-merged into the raw config\n // before validation, so their shape is the config's own.\n overrides: z.optional(z.record(z.string(), z.unknown())),\n});\n\n// ── Fonts (Astro Fonts API projection) ──────────────────────────────────────────\n// Font *loading* — a serialisable projection of Astro's `fonts:[…]` config. A\n// loader maps `provider` (string) → `fontProviders.<name>()`. Distinct from the\n// design-system font *tokens* (`designSystem.<theme>.fonts` / typography.families),\n// which reference the same `cssVariable`.\n\nconst FontProvider = z.enum([\n 'google',\n 'fontsource',\n 'adobe',\n 'bunny',\n 'fontshare',\n 'googleicons',\n 'npm',\n 'local',\n]);\nconst FontStyle = z.enum(['normal', 'italic']);\nconst FontDisplay = z.enum(['auto', 'block', 'swap', 'fallback', 'optional']);\nconst FontWeight = z.union([z.number(), z.string()]); // discrete, or a variable range like \"100 900\"\n\n/** A local-font face (`provider: 'local'`). */\nconst FontVariantSchema = z.object({\n src: z.array(z.string()),\n weight: z.optional(FontWeight),\n style: z.optional(FontStyle),\n unicodeRange: z.optional(z.array(z.string())),\n display: z.optional(FontDisplay),\n});\n\nconst FontSchema = z.object({\n name: z.string(),\n provider: FontProvider,\n cssVariable: z.string().check(z.regex(/^--/)),\n weights: z.optional(z.array(FontWeight)),\n styles: z.optional(z.array(FontStyle)),\n subsets: z.optional(z.array(z.string())),\n fallbacks: z.optional(z.array(z.string())),\n optimizedFallbacks: z.optional(z.boolean()),\n display: z.optional(FontDisplay),\n formats: z.optional(z.array(z.string())),\n unicodeRange: z.optional(z.array(z.string())),\n variants: z.optional(z.array(FontVariantSchema)), // local provider\n /** Emit `<Font preload />` for this family. */\n preload: z.optional(\n z.union([z.boolean(), z.array(z.object({ weight: FontWeight, style: z.optional(FontStyle) }))]),\n ),\n});\n\n// ── Templates (nav / form / nodes) ──────────────────────────────────────────────\n\nconst PresentSchema = z.optional(z.record(z.string(), z.unknown()));\n\nconst NavItemSchema: z.ZodMiniType = z.object({\n label: z.optional(LocalizableSchema),\n image: z.optional(ImageRefSchema),\n href: z.optional(z.string()),\n icon: z.optional(z.string()),\n attrs: AttrsSchema,\n itemAttrs: AttrsSchema,\n submenu: z.optional(\n z.object({\n present: PresentSchema,\n get items() {\n return z.optional(z.array(NavItemSchema));\n },\n }),\n ),\n});\n\nconst FormFieldType = z.enum([\n 'text',\n 'email',\n 'tel',\n 'url',\n 'number',\n 'password',\n 'textarea',\n 'select',\n 'checkbox',\n 'radio',\n 'date',\n 'file',\n 'hidden',\n]);\n\nconst FormFieldSchema = z.object({\n name: z.string(),\n type: FormFieldType,\n label: z.optional(LocalizableSchema),\n required: z.optional(z.boolean()),\n validation: z.optional(z.string()), // regex source or named rule\n options: z.optional(\n z.union([z.string(), z.array(z.object({ label: z.string(), value: z.string() }))]),\n ),\n attrs: AttrsSchema,\n});\n\nconst ContentNodeSchema: z.ZodMiniType = z.object({\n tag: z.string(),\n attrs: AttrsSchema,\n text: z.optional(z.string()),\n get children() {\n return z.optional(z.array(ContentNodeSchema));\n },\n});\n\nconst TemplateSchema = z.union([\n z.object({\n type: z.literal('nav'),\n tags: z.optional(z.array(z.string())),\n present: PresentSchema,\n items: z.optional(z.array(NavItemSchema)),\n }),\n z.object({\n type: z.literal('form'),\n tags: z.optional(z.array(z.string())),\n present: PresentSchema,\n action: z.optional(z.string()),\n method: z.optional(z.enum(['get', 'post'])),\n fields: z.optional(z.array(FormFieldSchema)),\n submit: z.optional(z.record(z.string(), AttrValue)),\n honeypot: z.optional(z.boolean()),\n }),\n z.object({\n type: z.literal('nodes'),\n tags: z.optional(z.array(z.string())),\n nodes: z.optional(z.array(ContentNodeSchema)),\n }),\n]);\n\n// ── Galleries / testimonials ────────────────────────────────────────────────────\n\nconst GalleryImageSchema = z.object({\n src: z.string(),\n alt: LocalizableSchema,\n caption: z.optional(LocalizableSchema),\n});\n\nconst GallerySchema = z.object({\n title: z.optional(LocalizableSchema),\n tags: z.optional(z.array(z.string())),\n images: z.array(GalleryImageSchema),\n});\n\nconst TestimonialItemSchema = z.object({\n quote: LocalizableSchema,\n name: z.string(),\n role: z.optional(z.string()),\n rating: z.optional(z.number().check(z.gte(0), z.lte(5))),\n date: z.optional(IsoDate),\n});\n\nconst TestimonialGroupSchema = z.object({\n title: z.optional(LocalizableSchema),\n items: z.array(TestimonialItemSchema),\n});\n\n// ── Services (schema.org Offer) ─────────────────────────────────────────────────\n\nconst OfferSchema = z.object({\n name: z.optional(LocalizableSchema),\n price: z.optional(z.union([z.string(), z.number()])),\n priceCurrency: z.optional(Iso4217),\n availability: z.optional(z.string()),\n url: z.optional(z.url()),\n validFrom: z.optional(IsoDate),\n priceValidUntil: z.optional(IsoDate),\n});\n\nconst ServiceSchema = z.object({\n name: LocalizableSchema,\n description: z.optional(LocalizableSchema),\n slug: z.optional(LocalizableSchema),\n offers: z.optional(z.array(OfferSchema)),\n});\n\n// ── SEO / social ─────────────────────────────────────────────────────────────\n\nconst OpenGraphSchema = z.object({\n type: z.optional(z.string()),\n siteName: z.optional(z.string()),\n title: z.optional(LocalizableSchema),\n description: z.optional(LocalizableSchema),\n image: z.optional(ImageRefSchema),\n locale: z.optional(z.string()),\n});\n\nconst TwitterSchema = z.object({\n card: z.optional(z.enum(['summary', 'summary_large_image', 'app', 'player'])),\n site: z.optional(z.string()),\n creator: z.optional(z.string()),\n title: z.optional(LocalizableSchema),\n description: z.optional(LocalizableSchema),\n image: z.optional(ImageRefSchema),\n});\n\n// ── Top-level schema ────────────────────────────────────────────────────────────\n\nexport const SiteConfigSchema = z.object({\n defaultLocale: z.string(),\n locales: z.record(z.string(), LocaleSchema),\n organization: z.optional(OrganizationSchema),\n contact: z.optional(ContactConfigSchema),\n domains: z.optional(\n z.object({\n canonical: z.url(),\n aliases: z.optional(z.array(DomainAliasSchema)),\n }),\n ),\n primaryLocation: z.optional(z.string()),\n locations: z.optional(z.record(z.string(), LocationSchema)),\n services: z.optional(z.record(z.string(), ServiceSchema)),\n links: z.optional(\n z.object({\n googleMaps: z.optional(z.url()),\n instagram: z.optional(z.url()),\n facebook: z.optional(z.url()),\n x: z.optional(z.url()),\n linkedin: z.optional(z.url()),\n youtube: z.optional(z.url()),\n github: z.optional(z.url()),\n }),\n ),\n dns: z.optional(z.record(z.string(), DnsDomainSchema)),\n // Deliberate escape hatch — provider-specific, out of scope to model here.\n cloudflare: z.optional(z.record(z.string(), z.unknown())),\n environments: z.record(z.string(), EnvironmentSchema),\n abTesting: z.optional(\n z.object({\n enabled: z.boolean(),\n cookieName: z.optional(z.string()),\n cookieMaxAge: z.optional(z.number().check(z.int(), z.positive())),\n splitRatio: z.optional(z.number().check(z.gte(0), z.lte(1))),\n variants: z.optional(z.record(z.string(), AbVariantSchema)),\n }),\n ),\n\n // Design system: named-theme map. `default` is the base; other entries may\n // `extends` another and supply a partial patch. Light/dark is automatic\n // (functional tokens flip per appearance), not a separate theme entry.\n designSystem: z.record(z.string(), DesignSystemEntry),\n defaultTheme: z.optional(z.string()), // convention: \"default\"\n defaultColorScheme: z.optional(z.enum(['light', 'dark'])), // initial appearance to render\n respectSystemPreference: z.optional(z.boolean()),\n\n // Font *loading* (Astro Fonts API). Font *tokens* live in `designSystem`.\n fonts: z.optional(z.array(FontSchema)),\n\n tags: z.optional(z.record(z.string(), z.unknown())),\n postTypes: z.optional(z.record(z.string(), z.unknown())),\n galleries: z.optional(z.record(z.string(), GallerySchema)),\n testimonials: z.optional(z.record(z.string(), TestimonialGroupSchema)),\n templates: z.optional(z.record(z.string(), TemplateSchema)),\n navigation: z.optional(\n z.object({\n activeTemplate: z.optional(\n z.object({\n default: z.optional(z.string()),\n breakpoints: z.optional(z.record(z.string(), z.string())),\n }),\n ),\n }),\n ),\n seo: z.optional(\n z.object({\n titleTemplate: z.optional(z.string()),\n descriptionTemplate: z.optional(z.string()),\n robots: z.optional(RobotsSchema),\n googleSiteVerification: z.optional(z.string()),\n bingSiteVerification: z.optional(z.string()),\n openGraph: z.optional(OpenGraphSchema),\n twitter: z.optional(TwitterSchema),\n }),\n ),\n analytics: z.optional(\n z.object({\n googleAnalyticsId: z.optional(z.string()),\n plausibleDomain: z.optional(z.string()),\n googleTagManagerId: z.optional(z.string()),\n }),\n ),\n notifications: z.optional(z.object({ email: z.optional(z.email()) })),\n tracking: z.optional(\n z.object({\n enabled: z.optional(z.boolean()),\n platforms: z.optional(z.array(z.string())),\n }),\n ),\n security: z.optional(\n z.object({\n turnstile: z.optional(z.object({ siteKey: z.optional(z.string()) })),\n }),\n ),\n legal: z.optional(\n z.object({\n privacyPolicy: z.optional(\n z.object({\n enabled: z.boolean(),\n url: z.optional(z.url()),\n lastUpdated: z.optional(IsoDate),\n }),\n ),\n termsOfService: z.optional(\n z.object({\n enabled: z.boolean(),\n url: z.optional(z.url()),\n lastUpdated: z.optional(z.nullable(IsoDate)),\n }),\n ),\n cookieConsent: z.optional(\n z.object({\n enabled: z.boolean(),\n type: z.optional(z.enum(['opt-in', 'opt-out'])),\n position: z.optional(z.enum(['top', 'bottom', 'center'])),\n categories: z.optional(z.array(z.string())),\n }),\n ),\n }),\n ),\n icons: z.optional(\n z.object({\n ui: z.optional(z.string()),\n brand: z.optional(z.string()),\n semantic: z.optional(z.array(z.string())),\n 'fa7-solid': z.optional(z.array(z.string())),\n 'fa7-regular': z.optional(z.array(z.string())),\n 'fa7-light': z.optional(z.array(z.string())),\n 'fa7-thin': z.optional(z.array(z.string())),\n 'fa7-brands': z.optional(z.array(z.string())),\n 'simple-icons': z.optional(z.array(z.string())),\n 'material-symbols': z.optional(z.array(z.string())),\n lucide: z.optional(z.array(z.string())),\n }),\n ),\n favicon: z.optional(\n z.object({\n source: z.string(),\n lowResSource: z.optional(z.string()),\n /** App name for the generated web manifest / PWA. */\n name: z.optional(z.string()),\n /** PWA theme color (also `<meta name=\"theme-color\">`). */\n themeColor: z.optional(z.string()),\n /** PWA background color. */\n backgroundColor: z.optional(z.string()),\n }),\n ),\n deployment: z.optional(\n z.object({\n platform: z.optional(z.string()),\n buildCommand: z.optional(z.string()),\n deployCommand: z.optional(z.string()),\n outputDirectory: z.optional(z.string()),\n type: z.optional(z.string()),\n }),\n ),\n});\n\nexport type SiteConfig = z.infer<typeof SiteConfigSchema>;\n\n// ── JSON Schema + validation ────────────────────────────────────────────────────\n\nexport const SITE_SCHEMA_URL = 'https://unpkg.com/@getvitops/generator/site.schema.json';\n\n/** The published JSON Schema (draft-2020-12), derived from the zod schema. */\nexport const siteJsonSchema = {\n $id: SITE_SCHEMA_URL,\n ...z.toJSONSchema(SiteConfigSchema, { target: 'draft-2020-12' }),\n};\n\nexport type SiteValidationResult =\n | { ok: true; data: SiteConfig; errors: [] }\n | { ok: false; data: undefined; errors: z.core.$ZodIssue[] };\n\ntype Issue = z.core.$ZodIssue;\nconst issue = (path: (string | number)[], message: string): Issue =>\n ({ code: 'custom', path, message }) as Issue;\n\n/**\n * Validate a raw (already parsed) config: shape via zod, then the cross-field\n * integrity that JSON Schema can't express (referential keys, extends acyclicity).\n * These live only here — the published JSON Schema enforces shape, not integrity.\n */\nexport function validateSite(input: unknown): SiteValidationResult {\n const parsed = z.safeParse(SiteConfigSchema, input);\n if (!parsed.success) return { ok: false, data: undefined, errors: parsed.error.issues };\n const cfg = parsed.data;\n const errors: Issue[] = [];\n const has = (m: Record<string, unknown> | undefined, k: string) => !!m && k in m;\n\n if (!has(cfg.locales, cfg.defaultLocale))\n errors.push(issue(['defaultLocale'], `defaultLocale \"${cfg.defaultLocale}\" is not in locales`));\n\n if (!has(cfg.designSystem, 'default') && cfg.defaultTheme == null)\n errors.push(issue(['designSystem'], 'designSystem must include a \"default\" theme'));\n\n if (cfg.defaultTheme != null && !has(cfg.designSystem, cfg.defaultTheme))\n errors.push(\n issue(['defaultTheme'], `defaultTheme \"${cfg.defaultTheme}\" is not in designSystem`),\n );\n\n for (const [key, entry] of Object.entries(cfg.designSystem)) {\n if (entry.extends != null && !has(cfg.designSystem, entry.extends))\n errors.push(\n issue(\n ['designSystem', key, 'extends'],\n `extends \"${entry.extends}\" is not a designSystem key`,\n ),\n );\n }\n // extends acyclicity + each resolved theme is a complete DesignSystem\n for (const key of Object.keys(cfg.designSystem)) {\n try {\n resolveTheme(cfg.designSystem as Record<string, DesignSystemEntryT>, key);\n } catch (e) {\n errors.push(issue(['designSystem', key], (e as Error).message));\n }\n }\n\n if (cfg.primaryLocation != null && !has(cfg.locations, cfg.primaryLocation))\n errors.push(\n issue(['primaryLocation'], `primaryLocation \"${cfg.primaryLocation}\" is not in locations`),\n );\n if (typeof cfg.contact === 'string' && !has(cfg.locations, cfg.contact))\n errors.push(issue(['contact'], `contact \"${cfg.contact}\" is not a locations key`));\n\n for (const [name, v] of Object.entries(cfg.abTesting?.variants ?? {}))\n if (!has(cfg.environments, v.environment))\n errors.push(\n issue(\n ['abTesting', 'variants', name, 'environment'],\n `environment \"${v.environment}\" is not in environments`,\n ),\n );\n for (const [i, a] of (cfg.domains?.aliases ?? []).entries())\n if (a.environment != null && !has(cfg.environments, a.environment))\n errors.push(\n issue(\n ['domains', 'aliases', i, 'environment'],\n `environment \"${a.environment}\" is not in environments`,\n ),\n );\n\n const templates = cfg.templates;\n const at = cfg.navigation?.activeTemplate;\n if (at?.default != null && !has(templates, at.default))\n errors.push(\n issue(\n ['navigation', 'activeTemplate', 'default'],\n `template \"${at.default}\" is not in templates`,\n ),\n );\n for (const [bp, tpl] of Object.entries(at?.breakpoints ?? {}))\n if (!has(templates, tpl))\n errors.push(\n issue(\n ['navigation', 'activeTemplate', 'breakpoints', bp],\n `template \"${tpl}\" is not in templates`,\n ),\n );\n\n if (errors.length) return { ok: false, data: undefined, errors };\n return { ok: true, data: cfg, errors: [] };\n}\n\n// ── Theme resolution (extends) ──────────────────────────────────────────────────\n\ntype DesignSystemEntryT = Partial<DesignSystem> & { displayName?: unknown; extends?: string };\n\n/**\n * Resolve a design-system theme by following its `extends` chain and deep-merging\n * base → child (child wins; arrays replace wholesale, correct for token overrides).\n * Throws on unknown keys or an `extends` cycle. The result is a plain\n * `DesignSystem` (validate it against `DesignSystemSchema` for completeness).\n */\nexport function resolveTheme(\n designSystem: Record<string, DesignSystemEntryT>,\n key: string,\n): DesignSystem {\n const chain: DesignSystemEntryT[] = [];\n const seen = new Set<string>();\n let cur: string | undefined = key;\n while (cur != null) {\n if (seen.has(cur)) throw new Error(`extends cycle in designSystem at \"${cur}\"`);\n seen.add(cur);\n const entry: DesignSystemEntryT | undefined = designSystem[cur];\n if (entry == null) throw new Error(`designSystem theme \"${cur}\" not found`);\n chain.unshift(entry);\n cur = entry.extends;\n }\n const out: Record<string, unknown> = {};\n for (const entry of chain) {\n const { extends: _e, displayName: _d, ...ds } = entry;\n deepMerge(out, ds as Record<string, unknown>);\n }\n return out as DesignSystem;\n}\n\n/**\n * Resolve a raw (already-parsed) config into a validated `SiteConfig`:\n * 1. strip YAML nulls,\n * 2. apply the active A/B variant's `overrides` (by `siteEnv`),\n * 3. normalise a bare-`DesignSystem` `designSystem` shorthand to `{ default: … }`,\n * 4. validate (shape + cross-field).\n * Pure — no YAML/env access. A loader supplies `siteEnv`.\n */\nexport function resolveSiteConfig(input: unknown, siteEnv = 'production'): SiteConfig {\n const raw = stripNulls(input) as Record<string, unknown>;\n\n const envConfig = (raw.environments as Record<string, { variant?: string }> | undefined)?.[\n siteEnv\n ];\n if (envConfig?.variant) {\n const overrides = (\n raw.abTesting as { variants?: Record<string, { overrides?: Record<string, unknown> }> }\n )?.variants?.[envConfig.variant]?.overrides;\n if (overrides) deepMerge(raw, overrides);\n }\n\n // Shorthand: a bare DesignSystem (has `colors`) → { default: … }.\n const ds = raw.designSystem as Record<string, unknown> | undefined;\n if (ds != null && 'colors' in ds) raw.designSystem = { default: ds };\n\n const result = validateSite(raw);\n if (!result.ok) {\n const msg = result.errors.map((e) => ` ${e.path.join('.')}: ${e.message}`).join('\\n');\n throw new Error(`Invalid site config:\\n${msg}`);\n }\n return result.data;\n}\n\n// ── Helpers ─────────────────────────────────────────────────────────────────────\n\n/** Strip nulls (YAML `~`/`null`) → undefined so optional fields validate. */\nexport function stripNulls(obj: unknown): unknown {\n if (obj === null) return undefined;\n if (Array.isArray(obj)) return obj.map(stripNulls);\n if (obj && typeof obj === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n const stripped = stripNulls(value);\n if (stripped !== undefined) result[key] = stripped;\n }\n return result;\n }\n return obj;\n}\n\n/** Deep-merge `source` into `target` (in place). Arrays replace wholesale. */\nexport function deepMerge(target: Record<string, unknown>, source: Record<string, unknown>) {\n for (const key of Object.keys(source)) {\n const s = source[key];\n const t = target[key];\n if (\n s &&\n typeof s === 'object' &&\n !Array.isArray(s) &&\n t &&\n typeof t === 'object' &&\n !Array.isArray(t)\n ) {\n deepMerge(t as Record<string, unknown>, s as Record<string, unknown>);\n } else {\n target[key] = s;\n }\n }\n}\n","/**\n * @getvitops/generator — public API.\n *\n * Turn a `design-system.json` into platform outputs (Bricks, standalone CSS,\n * Tailwind v4). The `zod/mini` schema is the single source of truth: types,\n * validation, and the published JSON Schema all derive from it.\n */\nexport { generate } from './generate.ts';\nexport type { GenerateOptions, GenerateResult, Format } from './generate.ts';\n\nexport { generateDocs } from './docs.ts';\n\nexport { DesignSystemSchema, jsonSchema, SCHEMA_URL, validate } from './schema.ts';\nexport type { DesignSystem, ValidationResult } from './schema.ts';\nexport {\n SiteConfigSchema,\n siteJsonSchema,\n SITE_SCHEMA_URL,\n validateSite,\n resolveSiteConfig,\n resolveTheme,\n stripNulls,\n deepMerge,\n} from './site.ts';\nexport type { SiteConfig, SiteValidationResult } from './site.ts';\n\nimport { SCHEMA_URL, type DesignSystem } from './schema.ts';\n\n/**\n * A minimal but complete starter design system, used by `vitops init`. It\n * validates against the schema and generates real output in every format, so a\n * new project can `vitops generate` immediately and then tune from here.\n */\nexport function defaultConfig(): DesignSystem {\n return {\n $schema: SCHEMA_URL,\n colors: {\n // Each hue is generated as an 11-step OKLCH scale from its seed.\n palette: {\n brand: { seed: '#2e9b73' },\n ink: { seed: '#3f4a5c' },\n sky: { seed: '#2f7bc0' },\n sun: { seed: '#d08a1f' },\n rose: { seed: '#c74a42' },\n },\n // role → hue. Functional tokens (bg/text/solid/on-solid/…) derive from\n // the hue's scale; dark mode flips automatically.\n roles: {\n neutral: 'ink',\n surface: 'ink',\n 'ui-primary': 'brand',\n 'brand-primary': 'brand',\n info: 'sky',\n success: 'brand',\n warning: 'sun',\n danger: 'rose',\n },\n utilities: ['bg', 'text', 'border'],\n },\n shadows: {\n sm: '0 1px 2px rgb(0 0 0 / 0.08)',\n md: '0 4px 6px rgb(0 0 0 / 0.12)',\n lg: '0 10px 15px rgb(0 0 0 / 0.18)',\n },\n fonts: {\n display: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n sans: 'system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif',\n mono: 'ui-monospace, \"SF Mono\", Menlo, monospace',\n },\n typeScale: {\n base: '1rem',\n names: ['2xs', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'],\n baseStep: 4,\n baseline: 'm',\n ratio: 1.2,\n fluid: { minVw: '22.5rem', maxVw: '80rem', minRatio: 1.12 },\n },\n spaceScale: {\n base: '1rem',\n names: ['2xs', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'],\n baseStep: 4,\n baseline: 'm',\n ratio: 1.25,\n fluid: { minVw: '22.5rem', maxVw: '80rem', minRatio: 1.2 },\n },\n patterns: {\n defaults: {\n ds: 'none',\n b: '1px solid var(--color-surface-xl)',\n br: '0.375rem',\n p: '1rem',\n fs: '1rem',\n },\n radii: { pill: '999px', circle: '50%', card: '0.5rem' },\n groups: {\n control: {\n ds: 'var(--ds-default)',\n b: 'var(--b-default)',\n br: 'var(--br-default)',\n p: '0.5em 1em',\n fs: 'var(--fs-default)',\n },\n panel: {\n ds: 'var(--shadow-md)',\n b: 'var(--b-default)',\n br: '0.5rem',\n p: '1rem',\n fs: 'var(--fs-default)',\n },\n },\n z: { raised: 1, sticky: 100, overlay: 200, top: 1000 },\n items: {\n button: {\n group: 'control',\n element: 'button',\n default_role: 'brand-primary',\n base: {\n padding: '0.6em 1.2em',\n 'border-radius': 'var(--br-control, 0.25rem)',\n border: 'none',\n 'font-weight': '600',\n color: '#fff',\n cursor: 'pointer',\n 'box-shadow': 'var(--shadow-sm)',\n },\n states: { hover: { step: 1 }, active: { scale: 0.97 }, 'focus-visible': { ring: true } },\n roles: [],\n },\n card: {\n group: 'panel',\n class: 'card',\n base: {\n 'border-radius': 'var(--br-card-group)',\n padding: '1.5rem',\n background: 'var(--color-surface-xxl)',\n border: 'var(--b-card-group)',\n 'box-shadow': 'var(--ds-card-group)',\n },\n states: {},\n roles: [],\n },\n },\n },\n typography: {\n families: {\n display: 'var(--font-display)',\n sans: 'var(--font-sans)',\n code: 'var(--font-mono, ui-monospace, monospace)',\n },\n roles: {\n display: {\n family: 'display',\n size: 'var(--text-3xl)',\n weight: 700,\n 'line-height': '1.05',\n tracking: '-0.03em',\n },\n heading: { family: 'display', size: 'var(--text-xl)', weight: 600, 'line-height': '1.3' },\n body: { family: 'sans', size: 'var(--text-m)', weight: 400, 'line-height': '1.55' },\n },\n headings: { h1: 'display', h2: 'heading', h3: 'heading' },\n },\n animations: {\n effects: {\n 'fade-in': { kf: 'composite', vars: { 'opacity-from': 0 } },\n 'slide-up': {\n kf: 'composite',\n vars: { 'translate-y-from': 'var(--slide-distance, 2rem)' },\n },\n },\n journeys: {\n base: { fade: { 'opacity-from': 0 }, slide: {} },\n compose: [['fade'], ['slide'], ['fade', 'slide']],\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAM,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;AAEhD,MAAM,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAC/C,MAAM,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM;AAQ1C,MAAM,aAAa,EAAE,OAAO;CAC1B,MAAM,EAAE,OAAO;CACf,SAAS,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AAQ;KACR,MAAM;KACN,QAAQ;KACR,eAAe;KACf,UAAU;IACZ;IACA,SAAS;KAAE,QAAQ;KAAW,MAAM;KAAkB,QAAQ;KAAK,eAAe;IAAM;IACxF,MAAM;KAAE,QAAQ;KAAQ,MAAM;KAAiB,QAAQ;KAAK,eAAe;IAAO;GACpF;GACA,UAAU;IAAE,IAAI;IAAW,IAAI;IAAW,IAAI;GAAU;EAC1D;EACA,YAAY;GACV,SAAS;IACP,WAAW;KAAE,IAAI;KAAa,MAAM,EAAE,gBAAgB,EAAE;IAAE;IAC1D,YAAY;KACV,IAAI;KACJ,MAAM,EAAE,oBAAoB,8BAA8B;IAC5D;GACF;GACA,UAAU;IACR,MAAM;KAAE,MAAM,EAAE,gBAAgB,EAAE;KAAG,OAAO,CAAC;IAAE;IAC/C,SAAS;KAAC,CAAC,MAAM;KAAG,CAAC,OAAO;KAAG,CAAC,QAAQ,OAAO;IAAC;GAClD;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/schema.ts","../src/tokens.ts","../src/docs.ts","../src/generate.ts","../src/site.ts","../src/index.ts"],"sourcesContent":["/**\n * Canonical `design-system.json` schema — the single source of truth.\n *\n * Authored with `zod/mini` (tree-shakeable Zod v4). Everything else derives from it:\n * • the `DesignSystem` TS type (`z.infer`), used throughout the generator,\n * • the published JSON Schema (`toJSONSchema`), emitted to `schema.json` for `$schema` refs,\n * • runtime validation (`validate`) for the CLI and to gate `generate`.\n */\nimport * as z from 'zod/mini';\n\n// A CSS declaration block: prop -> value. Values stay strings (they can be hex,\n// var(), clamp(), keywords, …); the generator, not the schema, interprets them.\nconst CssDecls = z.record(z.string(), z.string());\n// Animation/effect vars + typography role values are string | number.\nconst Scalar = z.union([z.string(), z.number()]);\nconst VarMap = z.record(z.string(), Scalar);\n\n// ── colors ──────────────────────────────────────────────────────────────────\n// A palette hue, authored one of two ways:\n// • `{ seed, anchors? }` — an 11-step numeric scale (50…950) is GENERATED in\n// OKLCH from the seed (anchors pin specific steps; hex or oklch() values).\n// • `{ tones }` — a fixed brand kit: authored tones used verbatim at their\n// nearest steps + tinted off-white/off-black endpoints; no interpolation.\nconst SeededRamp = z.object({\n seed: z.string(),\n anchors: z.optional(z.record(z.string(), z.string())),\n});\nconst FixedRamp = z.object({\n tones: z.union([z.array(z.string()), z.record(z.string(), z.string())]),\n});\nconst Ramp = z.union([SeededRamp, FixedRamp]);\n\nconst UtilityName = z.enum(['bg', 'text', 'border', 'outline', 'fill', 'stroke']);\n\n// `roles` maps each semantic role (neutral, surface, ui-primary, …) to the\n// palette hue backing it. The generator derives every role's FUNCTIONAL tokens\n// (bg / text / solid / on-solid / borders / muted stops) from the hue's scale,\n// and dark mode flips automatically — there is no per-appearance scheme grammar.\nconst Colors = z.object({\n palette: z.record(z.string(), Ramp),\n roles: z.record(z.string(), z.string()),\n utilities: z.optional(z.array(UtilityName)),\n});\n\n// ── fluid modular scale (type + space) ──────────────────────────────────────\nconst Scale = z.object({\n base: z.string(), // anchor size, e.g. \"1rem\"\n ratio: z.number(), // modular ratio at large viewports\n steps: z.optional(z.number()), // token count when `names` is absent\n names: z.optional(z.array(z.string())), // t-shirt names (else 1..steps)\n baseStep: z.optional(z.number()), // 1-based index of the value anchor\n baseline: z.optional(z.string()), // GUI scale centre (metadata)\n fluid: z.optional(\n z.object({\n minVw: z.string(),\n maxVw: z.string(),\n minRatio: z.number(),\n }),\n ),\n});\n\n// ── patterns ────────────────────────────────────────────────────────────────\nconst Pattern = z.object({\n group: z.optional(z.string()), // token-cascade group (tag/control/panel/…)\n overrides: z.optional(CssDecls), // per-pattern token overrides\n element: z.optional(z.string()), // styled at element level via :where()\n class: z.optional(z.string()), // or as a class\n default_role: z.optional(z.string()), // role for the bare/default variant\n base: z.optional(CssDecls),\n states: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))),\n roles: z.optional(z.array(z.string())), // semantic role variants to emit\n});\n\nconst Patterns = z.object({\n defaults: z.optional(CssDecls), // --<prop>-default\n radii: z.optional(CssDecls), // --br-<name> shape primitives\n groups: z.optional(z.record(z.string(), CssDecls)), // --<prop>-<group>\n z: z.optional(z.record(z.string(), z.number())), // --z-tier-<name>\n items: z.optional(z.record(z.string(), Pattern)),\n});\n\n// ── typography ──────────────────────────────────────────────────────────────\n// A role is an open bag of CSS-ish keys (family/size/weight/tracking/…); values\n// are string | number. The generator maps known keys and ignores the rest.\nconst TypographyRole = z.record(z.string(), Scalar);\nconst Typography = z.object({\n families: z.optional(z.record(z.string(), z.string())),\n roles: z.optional(z.record(z.string(), TypographyRole)),\n headings: z.optional(z.record(z.string(), z.string())),\n});\n\n// ── animations ──────────────────────────────────────────────────────────────\nconst AnimEffect = z.object({\n kf: z.string(), // keyframe family: composite | paint | layout\n css: z.optional(VarMap), // extra literal declarations\n vars: z.optional(VarMap), // --<key>: <value> (non-default endpoints)\n});\nconst Animations = z.object({\n effects: z.optional(z.record(z.string(), AnimEffect)),\n journeys: z.optional(\n z.object({\n base: z.optional(z.record(z.string(), VarMap)),\n compose: z.optional(z.array(z.array(z.string()))),\n }),\n ),\n});\n\n// ── the design system ───────────────────────────────────────────────────────\nexport const DesignSystemSchema = z.object({\n $schema: z.optional(z.string()),\n colors: Colors,\n shadows: z.optional(z.record(z.string(), z.string())),\n fonts: z.optional(z.record(z.string(), z.string())),\n typeScale: z.optional(Scale),\n spaceScale: z.optional(Scale),\n patterns: z.optional(Patterns),\n typography: z.optional(Typography),\n animations: z.optional(Animations),\n});\n\nexport type DesignSystem = z.infer<typeof DesignSystemSchema>;\n\n// A deep-partial view used for theme deltas: `extends` patches and alternate\n// schemes supply only what they override, so every field (down through\n// colors → schemes → semantic) is optional. Reuses the same leaf schemas, so\n// there's no second source of truth. Completeness is enforced after merge\n// (validate the resolved theme against `DesignSystemSchema`).\nconst ColorsPatch = z.object({\n palette: z.optional(z.record(z.string(), Ramp)),\n roles: z.optional(z.record(z.string(), z.string())),\n utilities: z.optional(z.array(UtilityName)),\n});\nexport const DesignSystemPatchSchema = z.extend(z.partial(DesignSystemSchema), {\n colors: z.optional(ColorsPatch),\n});\nexport type DesignSystemPatch = z.infer<typeof DesignSystemPatchSchema>;\n\n/**\n * Stable URL of the published JSON Schema. Resolves once `@getvitops/generator` is on\n * npm (unpkg serves the packaged `schema.json`); `vitops init` stamps this into a\n * scaffolded config's `$schema` so editors light up autocomplete + validation.\n */\nexport const SCHEMA_URL = 'https://unpkg.com/@getvitops/generator/schema.json';\n\n/** The published JSON Schema (draft-2020-12), derived from the zod schema. */\nexport const jsonSchema = {\n $id: SCHEMA_URL,\n ...z.toJSONSchema(DesignSystemSchema, { target: 'draft-2020-12' }),\n};\n\nexport type ValidationResult =\n | { ok: true; data: DesignSystem; errors: [] }\n | { ok: false; data: undefined; errors: z.core.$ZodIssue[] };\n\n/** Validate an unknown value against the design-system schema. */\nexport function validate(input: unknown): ValidationResult {\n const result = z.safeParse(DesignSystemSchema, input);\n if (!result.success) return { ok: false, data: undefined, errors: result.error.issues };\n // Every role must point at a palette hue that exists.\n const { palette, roles } = result.data.colors;\n for (const [role, hue] of Object.entries(roles)) {\n if (palette[hue] == null) {\n return {\n ok: false,\n data: undefined,\n errors: [\n {\n code: 'custom',\n path: ['colors', 'roles', role],\n message: `role \"${role}\" references unknown palette hue \"${hue}\"`,\n } as z.core.$ZodIssue,\n ],\n };\n }\n }\n return { ok: true, data: result.data, errors: [] };\n}\n","/**\n * Palette expansion + semantic functional tokens.\n *\n * A palette hue is authored one of two ways:\n * • `{ seed, anchors? }` — an 11-step numeric scale (50…950) generated in\n * OKLCH via @getvitops/utils/color (lightness transposed toward tinted\n * near-white/near-black, chroma dampened at the extremes),\n * • `{ tones }` — a fixed brand kit: authored tones placed verbatim at their\n * nearest steps + tinted endpoints; nothing else is invented (strict kits).\n *\n * Every role (from `colors.roles`) gets FUNCTIONAL tokens — the public API:\n * --<role>-bg / -bg-muted / -border / -border-bold / -solid / -solid-bold /\n * -on-solid / -text / -text-muted / -text-x-muted\n * plus the appearance-relative emphasis stops (x-muted · muted · bold · x-bold)\n * and, for `surface`, the translucent `--surface-glass` + `--overlay` scrim.\n * Dark mode flips the mapping automatically (solid stays mode-stable).\n */\nimport {\n contrastLc,\n generateOklchPalette,\n hexToOklch,\n oklchStringToHex,\n pickOn,\n} from '@getvitops/utils/color';\n\nexport const NUMERIC_STEPS = [\n '50',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n '950',\n] as const;\ntype NumStep = (typeof NUMERIC_STEPS)[number];\n\n// Lightness centres of the numeric scale (mirrors the engine's internal curve).\nconst STEP_L: Record<NumStep, number> = {\n '50': 0.95,\n '100': 0.9,\n '200': 0.8,\n '300': 0.7,\n '400': 0.6,\n '500': 0.5,\n '600': 0.4,\n '700': 0.3,\n '800': 0.2,\n '900': 0.1,\n '950': 0.05,\n};\n\nexport interface ExpandedHue {\n /** Numeric steps (sparse for fixed-tone kits). */\n numeric: Partial<Record<NumStep, string>>;\n /** True when only authored tones + endpoints exist (no interpolation). */\n sparse?: boolean;\n}\n\ninterface SeedInput {\n seed: string;\n anchors?: Record<string, string>;\n}\ninterface TonesInput {\n tones: string[] | Record<string, string>;\n}\n\nconst isHex = (v: string) => v.startsWith('#');\nconst toOklchStr = (v: string) => {\n if (!isHex(v)) return v; // already oklch(...)\n const { l, c, h } = hexToOklch(v);\n return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${h.toFixed(2)})`;\n};\nconst nearestStep = (l: number): NumStep =>\n NUMERIC_STEPS.reduce((best, s) =>\n Math.abs(l - STEP_L[s]) < Math.abs(l - STEP_L[best]) ? s : best,\n );\n\nfunction expandSeeded(input: SeedInput): ExpandedHue {\n // Seed + author anchors pinned at their natural (or explicit) steps, PLUS\n // implicit tinted near-white/near-black endpoint anchors (unless the author\n // pins 50/950 themselves). The engine then interpolates lightness/chroma\n // piecewise BETWEEN anchors — monotonic by construction, with the light side\n // actually reaching near-white (the original \"mid-gray light end\" bug) and\n // chroma tapering toward the tinted-neutral ends.\n const anchors: Record<string, string> = {};\n const seedStep = nearestStep(hexToOklch(input.seed).l);\n anchors[seedStep] = toOklchStr(input.seed);\n for (const [key, value] of Object.entries(input.anchors ?? {})) {\n const step = (NUMERIC_STEPS as readonly string[]).includes(key)\n ? key\n : nearestStep(hexToOklch(value).l);\n anchors[step] = toOklchStr(value);\n }\n const hue = hexToOklch(input.seed).h;\n anchors['50'] ??= `oklch(97% 0.008 ${hue.toFixed(2)})`;\n anchors['950'] ??= `oklch(13% 0.015 ${hue.toFixed(2)})`;\n const scale = generateOklchPalette(anchors) as Record<string, string>;\n const numeric: Partial<Record<NumStep, string>> = {};\n for (const s of NUMERIC_STEPS) if (scale[s] != null) numeric[s] = oklchStringToHex(scale[s]);\n return { numeric };\n}\n\nfunction expandTones(input: TonesInput): ExpandedHue {\n // Strict kit: authored tones verbatim at their nearest step; add tinted\n // endpoints (the one allowed exception); interpolate nothing else.\n const tones = Array.isArray(input.tones) ? input.tones : Object.values(input.tones);\n const numeric: Partial<Record<NumStep, string>> = {};\n for (const hex of tones) numeric[nearestStep(hexToOklch(hex).l)] = hex;\n const hue = hexToOklch(tones[0] ?? '#808080').h;\n numeric['50'] ??= oklchStringToHex(`oklch(97% 0.010 ${hue.toFixed(2)})`);\n numeric['950'] ??= oklchStringToHex(`oklch(15% 0.015 ${hue.toFixed(2)})`);\n return { numeric, sparse: true };\n}\n\n/** Snap to the nearest AVAILABLE numeric step (sparse kits). */\nfunction snap(numeric: Partial<Record<NumStep, string>>, want: NumStep): NumStep {\n if (numeric[want] != null) return want;\n const have = NUMERIC_STEPS.filter((s) => numeric[s] != null);\n return have.reduce((best, s) =>\n Math.abs(STEP_L[s] - STEP_L[want]) < Math.abs(STEP_L[best] - STEP_L[want]) ? s : best,\n );\n}\n\n/** Expand every palette hue into its numeric scale. */\nexport function expandPalette(raw: Record<string, unknown>): Record<string, ExpandedHue> {\n const out: Record<string, ExpandedHue> = {};\n for (const [name, entry] of Object.entries(raw)) {\n const e = entry as Partial<SeedInput & TonesInput>;\n if (typeof e?.seed === 'string') out[name] = expandSeeded(e as SeedInput);\n else if (e?.tones != null) out[name] = expandTones(e as TonesInput);\n else throw new Error(`palette hue \"${name}\" must have a \"seed\" or \"tones\"`);\n }\n return out;\n}\n\n// ── functional token mapping ─────────────────────────────────────────────────\n\ntype TokenMap = Record<string, NumStep>;\nconst LIGHT: TokenMap = {\n bg: '50',\n 'bg-muted': '100',\n border: '200',\n 'border-bold': '300',\n text: '950',\n 'text-muted': '800',\n 'text-x-muted': '600',\n};\nconst DARK: TokenMap = {\n bg: '950',\n 'bg-muted': '900',\n border: '800',\n 'border-bold': '700',\n text: '50',\n 'text-muted': '200',\n 'text-x-muted': '400',\n};\n// surface = background planes; elevation is lighter-when-raised in BOTH modes.\nconst SURFACE_LIGHT: TokenMap = { ...LIGHT, bg: '100', 'bg-muted': '200', 'bg-bold': '50' };\nconst SURFACE_DARK: TokenMap = { ...DARK, bg: '900', 'bg-muted': '950', 'bg-bold': '800' };\n// appearance-relative emphasis stops (base excluded — the bare name is functional).\nconst EMPHASIS_LIGHT: TokenMap = { 'x-muted': '100', muted: '300', bold: '700', 'x-bold': '900' };\nconst EMPHASIS_DARK: TokenMap = { 'x-muted': '900', muted: '700', bold: '300', 'x-bold': '100' };\n\nexport interface FunctionalRole {\n role: string;\n hue: string;\n /** token → CSS value, per appearance. */\n light: Record<string, string>;\n dark: Record<string, string>;\n}\n\n/** Resolve the functional token set for one role over its hue. */\nexport function functionalRole(role: string, hueName: string, hue: ExpandedHue): FunctionalRole {\n const numeric = hue.numeric;\n const v = (n: NumStep) => `var(--color-${hueName}-${snap(numeric, n)})`;\n const hex = (n: NumStep) => numeric[snap(numeric, n)] as string;\n\n // solid: the vivid tone — at least 500 (white text needs the depth), at most 700.\n const naturalRaw = NUMERIC_STEPS.find((s) => numeric[s] === hex('500')) ?? '500';\n const natural = Number(snap(numeric, naturalRaw));\n const solidStep = snap(numeric, String(Math.min(Math.max(natural, 500), 700)) as NumStep);\n const solidBold = snap(numeric, String(Math.min(Number(solidStep) + 100, 950)) as NumStep);\n const onSolid = pickOn(numeric[solidStep] as string);\n\n const isSurface = role === 'surface';\n const map = (table: TokenMap): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [token, step] of Object.entries(table)) out[token] = v(step as NumStep);\n return out;\n };\n const emphasis = (table: TokenMap, prefix: string): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [stop, step] of Object.entries(table)) out[`${prefix}-${stop}`] = v(step as NumStep);\n return out;\n };\n\n const light = {\n ...map(isSurface ? SURFACE_LIGHT : LIGHT),\n solid: v(solidStep),\n 'solid-bold': v(solidBold),\n 'on-solid': onSolid,\n ...emphasis(EMPHASIS_LIGHT, 'stop'),\n };\n const dark = {\n ...map(isSurface ? SURFACE_DARK : DARK),\n solid: v(solidStep),\n 'solid-bold': v(solidBold),\n 'on-solid': onSolid,\n ...emphasis(EMPHASIS_DARK, 'stop'),\n };\n return { role, hue: hueName, light, dark };\n}\n\n/** Verify a functional role's contrast targets. Returns human-readable failures. */\nexport function checkContrast(\n fr: FunctionalRole,\n numericOf: (hueName: string) => Partial<Record<NumStep, string>>,\n): string[] {\n const failures: string[] = [];\n const resolve = (val: string): string => {\n const m = /^var\\(--color-([a-z0-9-]+)-(\\d+)\\)$/.exec(val);\n if (!m) return val;\n return numericOf(m[1] as string)[m[2] as NumStep] ?? val;\n };\n for (const [name, tokens] of [\n ['light', fr.light],\n ['dark', fr.dark],\n ] as const) {\n const bg = resolve(tokens.bg as string);\n const checks: Array<[string, string, number]> = [\n ['text', resolve(tokens.text as string), 75],\n ['text-muted', resolve(tokens['text-muted'] as string), 60],\n ];\n for (const [token, hexV, min] of checks) {\n const lc = contrastLc(hexV, bg);\n if (lc < min)\n failures.push(`${fr.role}/${name}: ${token} Lc ${lc.toFixed(1)} < ${min} on bg ${bg}`);\n }\n const onLc = contrastLc(tokens['on-solid'] as string, resolve(tokens.solid as string));\n if (onLc < 60)\n failures.push(`${fr.role}/${name}: on-solid Lc ${onLc.toFixed(1)} < 60 on solid`);\n }\n return failures;\n}\n","/**\n * OKF documentation bundle generator (ported from the repo's `generate-docs.ts`).\n *\n * Pure: `generateDocs(ds, assetsDir)` returns a `{ relPath: markdown }` map for the\n * Open Knowledge Format tree (top index, css/, bricks/), reading the Bricks element\n * PHP from `<assetsDir>/bricks/elements`. No filesystem writes — the caller decides\n * where the bundle lands (e.g. `<outDir>/docs`).\n */\nimport { readFileSync, readdirSync, existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { DesignSystem } from './schema.ts';\nimport { expandPalette } from './tokens.ts';\n\nconst DS_PATH = 'design-system.json';\n\n// Curated element display order (by $name, sans the vitops- prefix). Unlisted\n// elements fall to the end alphabetically so new ones still appear.\nconst ORDER = [\n 'split',\n 'centered',\n 'carousel',\n 'color-scheme-toggle',\n 'copy-button',\n 'dismissable',\n 'entries',\n 'image-compare',\n 'sitenav',\n 'multi-field',\n 'split-link',\n 'split-panel',\n];\n\n// ── PHP array-literal parser ─────────────────────────────────────────────────\ntype Json = string | number | boolean | null | Json[] | { [k: string]: Json };\n\ninterface Tok {\n t: 'str' | 'num' | 'id' | 'punc' | 'arrow';\n v: string;\n}\n\nfunction tokenize(src: string): Tok[] {\n const toks: Tok[] = [];\n let i = 0;\n const n = src.length;\n while (i < n) {\n const c = src[i] as string;\n if (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n i++;\n continue;\n }\n if (c === '/' && src[i + 1] === '/') {\n while (i < n && src[i] !== '\\n') i++;\n continue;\n }\n if (c === '#') {\n while (i < n && src[i] !== '\\n') i++;\n continue;\n }\n if (c === '/' && src[i + 1] === '*') {\n i += 2;\n while (i < n && !(src[i] === '*' && src[i + 1] === '/')) i++;\n i += 2;\n continue;\n }\n if (c === \"'\" || c === '\"') {\n const quote = c;\n i++;\n let s = '';\n while (i < n && src[i] !== quote) {\n if (src[i] === '\\\\' && i + 1 < n) {\n const next = src[i + 1];\n s += next === 'n' ? '\\n' : next === 't' ? '\\t' : next;\n i += 2;\n } else {\n s += src[i++];\n }\n }\n i++;\n toks.push({ t: 'str', v: s });\n continue;\n }\n if (c === '=' && src[i + 1] === '>') {\n toks.push({ t: 'arrow', v: '=>' });\n i += 2;\n continue;\n }\n if ('[](){},'.includes(c)) {\n toks.push({ t: 'punc', v: c });\n i++;\n continue;\n }\n if (\n (c >= '0' && c <= '9') ||\n (c === '-' && (src[i + 1] as string) >= '0' && (src[i + 1] as string) <= '9')\n ) {\n let s = c;\n i++;\n while (i < n && (src[i] as string) >= '0' && (src[i] as string) <= '9') s += src[i++];\n toks.push({ t: 'num', v: s });\n continue;\n }\n if (/[A-Za-z_\\\\]/.test(c)) {\n let s = c;\n i++;\n while (i < n && /[A-Za-z0-9_\\\\]/.test(src[i] as string)) s += src[i++];\n toks.push({ t: 'id', v: s });\n continue;\n }\n i++;\n }\n return toks;\n}\n\nclass Parser {\n p = 0;\n toks: Tok[];\n constructor(toks: Tok[]) {\n this.toks = toks;\n }\n peek(): Tok | undefined {\n return this.toks[this.p];\n }\n next(): Tok | undefined {\n return this.toks[this.p++];\n }\n parseValue(): Json {\n const t = this.peek();\n if (!t) return null;\n if (t.t === 'str') {\n this.next();\n return t.v;\n }\n if (t.t === 'num') {\n this.next();\n return Number(t.v);\n }\n if (t.t === 'id') {\n this.next();\n if (t.v === 'true') return true;\n if (t.v === 'false') return false;\n if (t.v === 'null') return null;\n if (this.peek()?.t === 'punc' && this.peek()?.v === '(') {\n this.next();\n if (t.v === 'array') return this.parseBody(')');\n const args = this.parseCallArgs();\n return args.find((a) => typeof a === 'string') ?? args[0] ?? '';\n }\n return t.v;\n }\n if (t.t === 'punc' && t.v === '[') {\n this.next();\n return this.parseBody(']');\n }\n if (t.t === 'punc' && t.v === '(') {\n this.next();\n return this.parseBody(')');\n }\n this.next();\n return null;\n }\n private parseCallArgs(): Json[] {\n const args: Json[] = [];\n while (this.peek() && !(this.peek()!.t === 'punc' && this.peek()!.v === ')')) {\n args.push(this.parseValue());\n if (this.peek()?.t === 'punc' && this.peek()?.v === ',') this.next();\n }\n this.next();\n return args;\n }\n private parseBody(close: string): Json {\n const list: Json[] = [];\n const map: Record<string, Json> = {};\n let keyed = false;\n while (this.peek() && !(this.peek()!.t === 'punc' && this.peek()!.v === close)) {\n const first = this.parseValue();\n if (this.peek()?.t === 'arrow') {\n this.next();\n const val = this.parseValue();\n // PHP array keys are scalars; stringify objects defensively.\n map[typeof first === 'object' && first !== null ? JSON.stringify(first) : String(first)] =\n val;\n keyed = true;\n } else {\n list.push(first);\n }\n if (this.peek()?.t === 'punc' && this.peek()?.v === ',') this.next();\n }\n this.next();\n return keyed ? map : list;\n }\n}\n\nfunction parsePhpLiteral(text: string): Json {\n return new Parser(tokenize(text)).parseValue();\n}\n\n// ── Source-region helpers ────────────────────────────────────────────────────\nfunction matchBalanced(src: string, open: number): number {\n const pairs: Record<string, string> = { '(': ')', '[': ']', '{': '}' };\n const stack: string[] = [];\n let i = open;\n const n = src.length;\n while (i < n) {\n const c = src[i] as string;\n if (c === '/' && src[i + 1] === '/') {\n while (i < n && src[i] !== '\\n') i++;\n continue;\n }\n if (c === '/' && src[i + 1] === '*') {\n i += 2;\n while (i < n && !(src[i] === '*' && src[i + 1] === '/')) i++;\n i += 2;\n continue;\n }\n if (c === \"'\" || c === '\"') {\n i++;\n while (i < n && src[i] !== c) {\n if (src[i] === '\\\\') i++;\n i++;\n }\n i++;\n continue;\n }\n if (c in pairs) stack.push(pairs[c] as string);\n else if (c === ')' || c === ']' || c === '}') {\n if (stack.pop() !== c) {\n /* unbalanced — best effort */\n }\n if (stack.length === 0) return i + 1;\n }\n i++;\n }\n return n;\n}\n\nfunction methodBody(src: string, name: string): string | null {\n const m = new RegExp(`function\\\\s+${name}\\\\s*\\\\([^)]*\\\\)`).exec(src);\n if (!m) return null;\n const brace = src.indexOf('{', m.index + m[0].length);\n if (brace < 0) return null;\n const end = matchBalanced(src, brace);\n return src.slice(brace + 1, end - 1);\n}\n\nfunction literalAt(src: string, fromIdx: number): { text: string; end: number } | null {\n let i = fromIdx;\n while (i < src.length && /\\s/.test(src[i] as string)) i++;\n let open: number;\n if (src[i] === '[') open = i;\n else if (src.startsWith('array', i)) open = src.indexOf('(', i);\n else return null;\n const end = matchBalanced(src, open);\n return { text: src.slice(i, end), end };\n}\n\n// ── Per-element extraction ───────────────────────────────────────────────────\ninterface Control {\n key: string;\n def: Record<string, Json>;\n}\ninterface Element {\n name: string;\n label: string;\n nestable: boolean;\n docblock: string;\n controls: Control[];\n cssClass: string | null;\n children: string[];\n keywords: string[];\n}\n\nfunction firstString(re: RegExp, src: string): string | null {\n const m = re.exec(src);\n return m ? (m[1] ?? null) : null;\n}\n\nfunction extractDocblock(src: string): string {\n const m = /\\/\\*\\*([\\s\\S]*?)\\*\\//.exec(src);\n if (!m) return '';\n const lines = (m[1] as string)\n .split('\\n')\n .map((l) => l.replace(/^\\s*\\*?\\s?/, '').replace(/\\s+$/, ''));\n while (lines.length && lines[0] === '') lines.shift();\n if (lines.length && /Bricks Builder\\)\\./.test(lines[0] as string)) lines.shift();\n const owned = lines.findIndex((l) => l.startsWith('Owned by the framework repo'));\n const kept = (owned >= 0 ? lines.slice(0, owned) : lines).map((l) => l.replace(/^•\\s*/, '- '));\n while (kept.length && kept[kept.length - 1] === '') kept.pop();\n while (kept.length && kept[0] === '') kept.shift();\n return kept.join('\\n');\n}\n\nfunction extractControls(src: string): Control[] {\n const body = methodBody(src, 'set_controls');\n if (!body) return [];\n const controls: Control[] = [];\n const re = /\\$this->controls\\[\\s*'([^']+)'\\s*\\](\\[\\s*'([^']+)'\\s*\\])?\\s*=\\s*/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(body))) {\n const key = m[1] as string;\n if (m[2]) continue;\n const lit = literalAt(body, m.index + m[0].length);\n if (!lit) continue;\n const def = parsePhpLiteral(lit.text);\n if (def && typeof def === 'object' && !Array.isArray(def))\n controls.push({ key, def: def as Record<string, Json> });\n re.lastIndex = lit.end;\n }\n return controls;\n}\n\nfunction extractChildren(src: string): string[] {\n const body = methodBody(src, 'get_nestable_children');\n if (!body) return [];\n const labels: string[] = [];\n const re = /'label'\\s*=>\\s*esc_html__\\(\\s*'([^']*)'/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(body))) labels.push(m[1] as string);\n return labels;\n}\n\nfunction extractKeywords(src: string): string[] {\n const body = methodBody(src, 'get_keywords');\n if (!body) return [];\n const ret = /return\\s+/.exec(body);\n if (!ret) return [];\n const lit = literalAt(body, ret.index + ret[0].length);\n if (!lit) return [];\n const arr = parsePhpLiteral(lit.text);\n return Array.isArray(arr) ? arr.filter((x): x is string => typeof x === 'string') : [];\n}\n\nfunction parseElement(src: string): Element | null {\n const name = firstString(/public\\s+\\$name\\s*=\\s*'vitops-([^']+)'/, src);\n if (!name) return null;\n return {\n name,\n label:\n firstString(/function get_label\\(\\)[\\s\\S]*?return\\s+esc_html__\\(\\s*'([^']*)'/, src) ?? name,\n nestable: /public\\s+\\$nestable\\s*=\\s*true/.test(src),\n docblock: extractDocblock(src),\n controls: extractControls(src),\n cssClass: firstString(\n /\\$this->controls\\[\\s*'_cssClasses'\\s*\\]\\[\\s*'default'\\s*\\]\\s*=\\s*'([^']*)'/,\n src,\n ),\n children: extractChildren(src),\n keywords: extractKeywords(src),\n };\n}\n\n// ── Markdown rendering ───────────────────────────────────────────────────────\n/** Stringify a parsed-PHP Json value for prose (objects → JSON, not [object Object]). */\nconst asText = (v: Json | undefined): string =>\n v == null ? '' : typeof v === 'object' ? JSON.stringify(v) : String(v);\n\nfunction controlLine(c: Control): string {\n const def = c.def;\n if (def.type === 'info') return `- _Note:_ ${asText(def.content)}`;\n const label = (def.label as string) || c.key;\n const options =\n def.options && typeof def.options === 'object' && !Array.isArray(def.options)\n ? (def.options as Record<string, string>)\n : null;\n const meta: string[] = [];\n let type = (def.type as string) || 'text';\n if (def.units === true) type += '+units';\n meta.push(type);\n if (def.default !== undefined) {\n const raw = asText(def.default);\n const shown = options && options[raw] ? options[raw] : raw;\n meta.push(`default \\`${shown}\\``);\n }\n if (def.placeholder !== undefined && def.placeholder !== '')\n meta.push(`placeholder \\`${asText(def.placeholder)}\\``);\n if (def.min !== undefined || def.max !== undefined)\n meta.push(\n `range ${def.min != null ? asText(def.min) : '–'}–${def.max != null ? asText(def.max) : '∞'}`,\n );\n const tail: string[] = [];\n if (def.description) tail.push(asText(def.description));\n if (options)\n tail.push(\n `Options: ${Object.values(options)\n .map((o) => `\\`${o}\\``)\n .join(', ')}.`,\n );\n if (Array.isArray(def.css) && def.css.length) {\n const first = def.css[0];\n if (first && typeof first === 'object' && !Array.isArray(first) && 'property' in first)\n tail.push(`Bound to \\`${asText((first as Record<string, Json>).property)}\\`.`);\n }\n if (def.type === 'repeater' && def.fields && typeof def.fields === 'object') {\n const fields = Object.values(def.fields as Record<string, Json>)\n .map((f) =>\n f && typeof f === 'object' && !Array.isArray(f)\n ? asText((f as Record<string, Json>).label)\n : null,\n )\n .filter(Boolean);\n if (fields.length) tail.push(`Fields: ${fields.join(', ')}.`);\n }\n const head = `- **${label}** (${meta.join(', ')})`;\n return tail.length ? `${head} — ${tail.join(' ')}` : head;\n}\n\nfunction renderElement(el: Element): string {\n const out: string[] = [];\n const nest = el.nestable ? 'nestable' : 'not nestable';\n out.push(`## ${el.label} — \\`vitops-${el.name}\\` · ${nest}`);\n out.push('');\n if (el.docblock) {\n out.push(el.docblock);\n out.push('');\n }\n const real = el.controls.filter((c) => c.def.type !== 'info');\n if (real.length) {\n out.push('**Controls**');\n out.push('');\n for (const c of el.controls) out.push(controlLine(c));\n out.push('');\n } else {\n const notes = el.controls.filter((c) => c.def.type === 'info');\n if (notes.length) {\n for (const c of notes) out.push(controlLine(c));\n out.push('');\n }\n }\n if (el.cssClass) {\n out.push(\n `**Base CSS class:** \\`${el.cssClass}\\` (applied automatically; add ratio/modifier classes alongside it in the element's \"CSS classes\" field).`,\n );\n out.push('');\n }\n if (el.children.length) {\n out.push(`**Seeded children:** ${el.children.join(', ')}.`);\n out.push('');\n }\n if (el.keywords.length) {\n out.push(`**Keywords:** ${el.keywords.filter((k) => k !== 'vitops').join(', ')}.`);\n out.push('');\n }\n return out.join('\\n');\n}\n\n// ── OKF helpers ──────────────────────────────────────────────────────────────\ninterface Frontmatter {\n type: string;\n title: string;\n description: string;\n resource?: string;\n tags?: string[];\n}\nfunction frontmatter(fm: Frontmatter): string {\n const q = (s: string) => `\"${s.replace(/\"/g, '\\\\\"')}\"`;\n const lines = [\n `type: ${q(fm.type)}`,\n `title: ${q(fm.title)}`,\n `description: ${q(fm.description)}`,\n ];\n if (fm.resource) lines.push(`resource: ${q(fm.resource)}`);\n if (fm.tags) lines.push(`tags: [${fm.tags.join(', ')}]`);\n lines.push('generator: \"@getvitops/generator\"');\n return `---\\n${lines.join('\\n')}\\n---`;\n}\n\nconst INDEX_NOTE = `<!-- GENERATED by @getvitops/generator — do not edit; regenerate with \\`vitops generate\\`. -->`;\n\nconst ELEMENTS_FRONTMATTER = frontmatter({\n type: 'Bricks Elements Reference',\n title: 'Vitops — Bricks Builder elements reference',\n description:\n 'Every repo-owned Bricks element, its controls, defaults, seeded children and keywords, for driving the Bricks Builder UI.',\n resource: 'bricks/elements',\n tags: ['bricks', 'wordpress', 'elements', 'design-system'],\n});\n\nconst ELEMENTS_PREAMBLE = `${ELEMENTS_FRONTMATTER}\n\n# Vitops — Bricks Builder elements reference\n\nContext for driving the Bricks Builder UI (e.g. Claude for Chrome). Every section below\nis generated from the element's own source, so this reference always matches the elements\ncurrently deployed. See also the CSS class vocabulary in [/css/classes.md](../css/classes.md)\nand the integration guidance in [/bricks/index.md](index.md).\n\n## How they appear in the builder\n\n- The elements register from \\`dist/bricks/load.php\\` and group under a **\"Vitops\"** category\n pinned to the **top** of the element panel. Insert one by searching its **label** (e.g.\n \"Split\", \"Carousel\") or any of its **keywords** (listed per element).\n- Two rendering families:\n - **Web-component elements** render a Lit custom element (\\`<wc-*>\\`, \\`<copy-button>\\`, …)\n from \\`dist/elements.js\\` and progressively enhance. A few (Image Compare, Split Panel)\n show their children stacked in the builder canvas until the client-side upgrade runs —\n that is expected, not broken.\n - **CSS-pattern elements** (Split, Centered, Menu, Split Link) render plain markup styled\n by the framework CSS — no JS dependency.\n- **Nestable** elements accept child elements dropped into them; some seed starter children\n (listed as \"Seeded children\"). **Non-nestable** elements are configured entirely through\n their controls.\n\n## Configuring layout\n\nSome layout is set through **controls**; some through **CSS classes typed into the element's\nbuilt-in \"CSS classes\" field** (called out per element as modifier classes). Responsive\nsuffixes on those classes engage from a container breakpoint: \\`-sm\\` = 30rem, \\`-md\\` = 48rem,\n\\`-lg\\` = 64rem, \\`-xl\\` = 80rem.\n\nEach control below lists its type, default/placeholder, any select options, and the CSS\ncustom property it writes (when it drives one). Info notes flagged _Note:_ carry the\nmodifier-class and structural guidance from the element itself.\n\n---\n`;\n\nfunction renderElementsDoc(elementsDir: string): string {\n const files = existsSync(elementsDir)\n ? readdirSync(elementsDir).filter((f) => f.endsWith('.php'))\n : [];\n const elements: Element[] = [];\n for (const f of files) {\n try {\n const el = parseElement(readFileSync(join(elementsDir, f), 'utf8'));\n if (el) elements.push(el);\n } catch {\n /* skip unparseable element */\n }\n }\n elements.sort((a, b) => {\n const ia = ORDER.indexOf(a.name);\n const ib = ORDER.indexOf(b.name);\n if (ia >= 0 && ib >= 0) return ia - ib;\n if (ia >= 0) return -1;\n if (ib >= 0) return 1;\n return a.name.localeCompare(b.name);\n });\n const body = elements.map(renderElement).join('\\n---\\n\\n');\n return `${ELEMENTS_PREAMBLE}\\n${body}`;\n}\n\n// ── CSS framework reference (rule-summarized, from the config) ────────────────\nconst code = (xs: string[]) => xs.map((x) => `\\`${x}\\``).join(', ');\n\nfunction renderCssClasses(ds: DesignSystem): string {\n const expanded = expandPalette(ds.colors.palette as Record<string, unknown>);\n const ramps = Object.keys(expanded);\n const roles = Object.keys(ds.colors.roles ?? {});\n const utils = ds.colors.utilities ?? ['bg', 'text', 'border'];\n const typeRoles = Object.keys(ds.typography?.roles ?? {});\n const shadows = Object.keys(ds.shadows ?? {});\n const effects = Object.keys(ds.animations?.effects ?? {});\n const items = (ds.patterns?.items ?? {}) as Record<\n string,\n { roles?: string[]; default_role?: string }\n >;\n const patterns = Object.keys(items);\n const patternRoles = Array.from(\n new Set(\n Object.values(items).flatMap(\n (p) => [p.default_role, ...(p.roles ?? [])].filter(Boolean) as string[],\n ),\n ),\n );\n const spaceNames = ds.spaceScale?.names ?? [];\n const typeNames = ds.typeScale?.names ?? [];\n const families = Object.keys(ds.typography?.families ?? {});\n const radii = Object.keys(ds.patterns?.radii ?? {});\n\n return `${frontmatter({\n type: 'CSS Framework Reference',\n title: 'Vitops CSS framework — class vocabulary',\n description:\n 'Every utility and component class in the Vitops CSS framework, stated as a naming rule over the design tokens it expands.',\n resource: DS_PATH,\n tags: ['css', 'utilities', 'patterns', 'design-system'],\n })}\n\n# Vitops CSS framework — class vocabulary (LLM reference)\n\nA variable-driven CSS framework. Classes encode the design system's **tokens** (colour,\ntype, space, shadow), **responsive grammar**, and **interaction states** — so styling with\nthese classes stays consistent and theme-/dark-mode-aware. Prefer them over hand-written\nCSS or ad-hoc property values.\n\nThis is a **rule reference**, not an exhaustive list: each family below is a naming rule\nplus the set of tokens it expands over. Applying a rule to any listed token yields a valid\nclass (e.g. rule \\`bg-<color>\\` + colour \\`pine-xl\\` → \\`bg-pine-xl\\`).\n\n## Responsive & state variant grammar\n\nEvery utility accepts a **container-breakpoint prefix**; animation utilities also accept a\n**state prefix**. In CSS/Bricks the separator is \\`-\\`; in Tailwind it is \\`:\\` / \\`@\\`.\n\n| Intent | CSS / Bricks | Tailwind |\n| ----------------- | -------------------------- | ----------------------------------------- |\n| responsive split | \\`md-split-1-2\\` | \\`@md:split-1-2\\` |\n| responsive align | \\`md-items-center\\` | \\`@md:items-center\\` |\n| hover effect | \\`transition hover-fade-in\\` | \\`transition fade-in hover:flip-fade-in\\` |\n\n- Breakpoint prefixes (bare): \\`sm-\\` = 30rem, \\`md-\\` = 48rem, \\`lg-\\` = 64rem, \\`xl-\\` = 80rem.\n- State prefixes (animation effects only): \\`hover-\\`, \\`active-\\`, \\`focus-\\`, and \\`flip-<effect>\\`\n (plays the effect in reverse on toggle). Effects require \\`transition\\` on the element.\n\n## Layout & structure\n\n- **\\`centered\\`** — named-track grid centering content in the reading \\`measure\\` track.\n Widen a **direct child** by adding \\`breakout\\`, \\`spotlight\\`, or \\`fullbleed\\` (each\n breakpoint-prefixable) to that child. Track widths are set via \\`--width-measure\\` /\n \\`--width-breakout\\` / \\`--width-spotlight\\` and \\`--gutter\\`.\n- **\\`rhythm\\`** — relationship-based vertical spacing (margins between headings, paragraphs,\n lists, media) driven by the space scale. Usually paired with \\`centered\\`.\n- **\\`split\\`** — equal flex columns. Ratio rule: **\\`split-<a>-<b>\\`** where \\`<a>-<b>\\` ∈\n \\`1-2\\`, \\`2-1\\`, \\`1-3\\`, \\`3-1\\`, \\`1-4\\`, \\`4-1\\`, \\`2-3\\`, \\`3-2\\` (breakpoint-prefixable).\n- **Flex** — \\`flex\\`, \\`flex-row\\`, \\`flex-col\\`; \\`g\\` for gap (space-scale token).\n- **Alignment** — \\`items-{start,center,end,stretch}\\`, \\`justify-{start,center,end,between}\\`,\n text align \\`text-{start,center,end}\\` (all breakpoint-prefixable).\n- **Display** — \\`block\\`, \\`inline\\`, \\`inline-block\\`, \\`flex\\`, \\`grid\\`, \\`hidden\\`\n (breakpoint-prefixable, e.g. \\`md-hidden\\`).\n- **Accessibility** — \\`sr-only\\` / \\`not-sr-only\\` (breakpoint-prefixable).\n- **State hooks** — \\`is-active\\`, \\`is-open\\` (styling flags toggled by JS / native state).\n\n## Spacing\n\nThe space scale is ${code(spaceNames)} exposed as \\`--space-<name>\\` tokens.\nGap (\\`g\\`) and \\`rhythm\\` margins consume these tokens; prefer \\`rhythm\\` for vertical flow\nrather than per-element margins.\n\n## Typography\n\nRule: **\\`font-<role>\\`** — role ∈ ${code(typeRoles)}. Each role carries its own family,\nsize (from the type scale ${code(typeNames)}), tracking, transform, and weight.\nFamilies: ${code(families)} (\\`--font-*\\`).\n\n## Colour\n\n**Functional tokens are the primary vocabulary** — classes name the *job*, not the tone, and\nevery one remaps automatically under \\`:root[data-brx-theme=\"dark\"]\\` (background/text ends\nswap; \\`solid\\` fills stay mode-stable with a computed \\`on-\\` foreground). Prefer these over\nraw steps. Rules (role ∈ ${code(roles)}):\n\n- **Surfaces** — \\`bg-<role>\\` (the role's background wash; for \\`surface\\` this is the\n card/panel plane), \\`bg-<role>-muted\\` (subtle / sunken), \\`bg-surface-bold\\` (raised plane).\n- **Solid fills** — \\`bg-<role>-solid\\`, \\`bg-<role>-solid-bold\\` (hover / emphasis), paired\n with \\`text-on-<role>\\` for guaranteed-contrast foreground.\n- **Content** — \\`text-<role>\\` (primary, contrast-guaranteed in both appearances),\n \\`text-<role>-muted\\` (secondary), \\`text-<role>-x-muted\\` (tertiary / disabled).\n- **Borders** — \\`border-<role>\\`, \\`border-<role>-bold\\`.\n- **Translucency** — \\`glass\\` (translucent surface + backdrop blur); \\`--overlay\\` scrim var.\n- **Emphasis stops** (appearance-relative vars for power use):\n \\`--color-<role>-{x-muted,muted,bold,x-bold}\\` — \\`muted\\` recedes toward the background\n extreme, \\`bold\\` advances toward the foreground, in *either* appearance.\n\nEveryday pairings: page \\`bg-neutral\\` + \\`text-neutral\\`; cards \\`bg-surface\\`; captions\n\\`text-neutral-muted\\`; buttons \\`bg-ui-primary-solid text-on-ui-primary\\`; status text\n\\`text-danger\\` / \\`text-success\\` / \\`text-warning\\` / \\`text-info\\`.\n\n**Raw scale** (secondary / fine control) — rule \\`<util>-<hue>-<step>\\` with util ∈\n${code(utils)}: every hue is an 11-step OKLCH scale generated from its seed (or fixed brand\ntones), numeric steps \\`50\\` … \\`950\\` (tinted near-white → tinted near-black) — e.g.\n\\`bg-${ramps[0] ?? 'brand'}-100\\`, \\`text-${ramps[0] ?? 'brand'}-800\\`. Hues: ${code(ramps)}.\nThe **bare** role name (\\`bg-<role>\\`, \\`text-<role>\\`) is always the functional token.\n\n## Shadows\n\nRule: **\\`drop-shadow-<size>\\`** — size ∈ ${code(shadows)} (applied as a \\`filter\\`, so it\nfollows non-rectangular shapes).\n\n## Animation\n\nRule: **\\`<effect>\\`** (with the state/flip prefixes above) — effect ∈ ${code(effects)}.\nComposed **journeys** chain multiple effects into one entrance: rule \\`<parts>-journey\\`\n(e.g. \\`fade-slide-journey\\`, \\`fade-scale-blur-journey\\`). All require \\`transition\\` on the\nelement; scroll-linked entrances resolve within the first portion of the element's scroll.\n\n## Component patterns\n\nEach pattern is a base class \\`<pattern>\\` with interaction states (hover/active/focus-visible)\nbaked in; coloured patterns add role variants via rule **\\`<pattern>-<role>\\`**.\n\n- Patterns: ${code(patterns)}.\n- Roles (for coloured patterns like \\`badge\\`, \\`tag\\`, \\`status\\`, \\`button\\`):\n ${code(patternRoles)} — e.g. \\`badge-success\\`, \\`button-danger\\`. The default (unsuffixed)\n variant uses the brand-primary role.\n- Shape primitives: \\`--br-<name>\\` radii — ${code(radii)}.\n`;\n}\n\n// ── Reserved index.md listings (no frontmatter) ──────────────────────────────\nfunction renderTopIndex(): string {\n return `${INDEX_NOTE}\n\n# Vitops design system\n\nLLM-oriented documentation bundle (Open Knowledge Format) for the Vitops design system — a\nvariable-driven CSS framework plus progressively-enhanced web components, generated from\n\\`design-system.json\\` and published alongside the deployed theme.\n\n# Contents\n\n* [CSS framework](css/) - the class vocabulary (colour, type, space, layout, animation, component patterns), stated as naming rules\n* [Bricks Builder](bricks/) - custom elements and how to style them\n`;\n}\n\nfunction renderCssIndex(): string {\n return `${INDEX_NOTE}\n\n# CSS framework\n\n# Contents\n\n* [Class vocabulary](classes.md) - every utility and component class, summarized by naming rule\n`;\n}\n\nfunction renderBricksIndex(): string {\n return `${INDEX_NOTE}\n\n# Bricks Builder integration\n\n# Styling\n\nPrefer adding the framework **CSS classes** — see [/css/classes.md](../css/classes.md) — in a\nBricks element's \"CSS classes\" field over hand-setting spacing, colour, or typography through\nthe Bricks Builder property panels. The classes encode the design system's tokens, responsive\ngrammar, and interaction states, so they stay consistent, respond to theme / dark mode, and\nupdate with the system. Values typed directly into Bricks' property controls are one-off,\ndrift from the system, and don't react to theme changes — reserve them for genuinely bespoke,\none-element cases.\n\n# Contents\n\n* [Elements reference](elements.md) - every custom Vitops element, its controls, defaults, seeded children and keywords\n* [Class vocabulary](../css/classes.md) - the framework CSS classes to apply to elements\n`;\n}\n\n/**\n * Build the OKF docs bundle for a config. Returns a `{ relPath: content }` map;\n * the caller writes it wherever the bundle should live (e.g. `<outDir>/docs`).\n */\nexport function generateDocs(ds: DesignSystem, assetsDir: string): Record<string, string> {\n const elementsDir = join(assetsDir, 'bricks', 'elements');\n return {\n 'index.md': renderTopIndex(),\n 'css/index.md': renderCssIndex(),\n 'css/classes.md': renderCssClasses(ds),\n 'bricks/index.md': renderBricksIndex(),\n 'bricks/elements.md': renderElementsDoc(elementsDir),\n };\n}\n","/**\n * Pure, parameterized port of the Vitops design-system generator.\n *\n * `generate({ input, format, outDir })` reads a consumer's `design-system.json`,\n * validates it, and emits consumer-ready output for the chosen format into\n * `outDir`. Unlike the original CWD-bound script it mutates no shared state: every\n * generated token layer is built in memory and either bundled (css/bricks) or\n * inlined (tailwind) before writing.\n *\n * Framework-static assets (the hand-written CSS partials, the Bricks PHP + loader,\n * and the pre-built JS bundles) live under `assets/` in this package and are read /\n * copied from there — they are the same for every consumer.\n */\nimport { readFileSync, writeFileSync, mkdirSync, cpSync, existsSync, readdirSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createHash } from 'node:crypto';\nimport { transform } from 'lightningcss';\nimport { validate, type DesignSystem } from './schema.ts';\nimport { generateDocs } from './docs.ts';\nimport {\n expandPalette,\n functionalRole,\n NUMERIC_STEPS,\n type ExpandedHue,\n type FunctionalRole,\n} from './tokens.ts';\n\nexport type Format = 'bricks' | 'css' | 'tailwind';\n\nexport interface GenerateOptions {\n /** Path to a design-system.json, OR an already-parsed config object. */\n input: string | DesignSystem;\n /** Output target. Default: 'bricks'. */\n format?: Format;\n /** Directory to write outputs into. Default: 'dist'. */\n outDir?: string;\n /** Override the framework asset root (advanced/testing). */\n assetsDir?: string;\n}\n\nexport interface GenerateResult {\n format: Format;\n outDir: string;\n written: string[];\n}\n\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst DEFAULT_ASSETS = join(HERE, '..', 'assets');\n\n// ── colour machinery ─────────────────────────────────────────────────────────\n// Every hue is an 11-step numeric OKLCH scale (see tokens.ts); every role is a\n// hue reference that resolves to FUNCTIONAL tokens. No named steps, no scheme\n// grammar — dark mode is the automatic functional flip.\nconst UTILITY_PROPS: Record<string, string> = {\n bg: 'background-color',\n text: 'color',\n border: 'border-color',\n outline: 'outline-color',\n fill: 'fill',\n stroke: 'stroke',\n};\n\n// Functional-token var name: emphasis stops live in the --color-* namespace\n// (`stop-x-muted` → --color-<role>-x-muted); everything else is --<role>-<token>.\nconst fnVar = (role: string, token: string): string =>\n token.startsWith('stop-') ? `--color-${role}-${token.slice(5)}` : `--${role}-${token}`;\n// The functional utility classes for one role (bare name = functional default).\nconst fnUtilities = (role: string, utilities: string[], isSurface: boolean): string => {\n const rows: string[] = [];\n if (utilities.includes('bg')) {\n rows.push(`.bg-${role} { background-color: var(--${role}-bg); }`);\n rows.push(`.bg-${role}-muted { background-color: var(--${role}-bg-muted); }`);\n rows.push(`.bg-${role}-solid { background-color: var(--${role}-solid); }`);\n rows.push(`.bg-${role}-solid-bold { background-color: var(--${role}-solid-bold); }`);\n if (isSurface) rows.push(`.bg-${role}-bold { background-color: var(--${role}-bg-bold); }`);\n }\n if (utilities.includes('text')) {\n rows.push(`.text-${role} { color: var(--${role}-text); }`);\n rows.push(`.text-${role}-muted { color: var(--${role}-text-muted); }`);\n rows.push(`.text-${role}-x-muted { color: var(--${role}-text-x-muted); }`);\n rows.push(`.text-on-${role} { color: var(--${role}-on-solid); }`);\n }\n if (utilities.includes('border'))\n rows.push(\n `.border-${role} { border-color: var(--${role}-border); }`,\n `.border-${role}-bold { border-color: var(--${role}-border-bold); }`,\n );\n return rows.join('\\n');\n};\n\nconst decls = (obj: Record<string, string>, indent = ' ') =>\n Object.entries(obj)\n .map(([k, v]) => `${indent}${k}: ${v};`)\n .join('\\n');\n\n// ── fluid modular scale ───────────────────────────────────────────────────────\ninterface ScaleConfig {\n base: string;\n ratio: number;\n steps?: number;\n names?: string[];\n baseStep?: number;\n baseline?: string;\n fluid?: { minVw: string; maxVw: string; minRatio: number };\n}\ninterface ScaleStep {\n name: string;\n value: string;\n max: string;\n offset: number;\n}\nconst round = (n: number) => Number(n.toFixed(4)).toString();\nconst rem = (v: string) => parseFloat(v);\nconst buildScale = (s: ScaleConfig): ScaleStep[] => {\n const names = s.names ?? Array.from({ length: s.steps ?? 0 }, (_, i) => String(i + 1));\n const base = rem(s.base);\n const baseStep = s.baseStep ?? Math.ceil(names.length / 2);\n const baselineIdx = s.baseline ? names.indexOf(s.baseline) : baseStep - 1;\n return names.map((name, i) => {\n const k = i - (baseStep - 1);\n const vMax = base * Math.pow(s.ratio, k);\n const max = `${round(vMax)}rem`;\n let value = max;\n if (s.fluid) {\n const { minVw, maxVw, minRatio } = s.fluid;\n const vMin = base * Math.pow(minRatio, k);\n const lo = Math.min(vMin, vMax);\n const hi = Math.max(vMin, vMax);\n if (lo !== hi) {\n const slope = (vMax - vMin) / (rem(maxVw) - rem(minVw));\n const intercept = vMin - slope * rem(minVw);\n const sign = slope < 0 ? '-' : '+';\n const pref = `calc(${round(intercept)}rem ${sign} ${round(Math.abs(slope * 100))}vw)`;\n value = `clamp(${round(lo)}rem, ${pref}, ${round(hi)}rem)`;\n }\n }\n return { name, value, max, offset: i - baselineIdx };\n });\n};\n\n// ── typography ─────────────────────────────────────────────────────────────────\ninterface TypographyRole {\n family?: string;\n [key: string]: string | number | undefined;\n}\nconst TYPO_KEYMAP: Record<string, [string, string]> = {\n family: ['font-family', 'ff'],\n size: ['font-size', 'fs'],\n weight: ['font-weight', 'fw'],\n style: ['font-style', 'fst'],\n 'line-height': ['line-height', 'lh'],\n tracking: ['letter-spacing', 'ls'],\n 'text-decoration': ['text-decoration', 'td'],\n 'text-transform': ['text-transform', 'tt'],\n 'text-wrap': ['text-wrap', 'tw'],\n color: ['color', 'color'],\n};\nconst TYPO_IDENTITY: Record<string, string> = {\n 'font-style': 'normal',\n 'letter-spacing': 'normal',\n 'text-decoration': 'none',\n 'text-transform': 'none',\n 'text-wrap': 'wrap',\n};\n\n// ── animation state defaults ─────────────────────────────────────────────────\nconst STATE_DEFAULT: Record<string, string> = {\n opacity: '1',\n 'translate-x': '0',\n 'translate-y': '0',\n 'scale-x': '1',\n 'scale-y': '1',\n rotate: '0deg',\n blur: '0px',\n shadow: '0 0 0 transparent',\n brightness: '1',\n grayscale: '0',\n contrast: '1',\n saturate: '1',\n sepia: '0',\n 'hue-rotate': '0deg',\n clip: 'none',\n};\n\n// Pattern base geometry props → override-hook shorthand.\nconst BASE_HOOK: Record<string, string> = {\n padding: 'p',\n 'border-radius': 'br',\n border: 'b',\n 'box-shadow': 'ds',\n 'font-size': 'fs',\n};\n\ninterface Pattern {\n group?: string;\n overrides?: Record<string, string>;\n element?: string;\n class?: string;\n default_role?: string;\n base?: Record<string, string>;\n states?: Record<string, Record<string, unknown>>;\n roles?: string[];\n}\n\nconst id = (key: string) => createHash('sha256').update(key).digest('hex').slice(0, 6);\n\n/**\n * The in-memory output of building a design system. String fields are CSS/JSON\n * ready to write; the generated CSS partials feed the css/bricks bundler.\n */\ninterface Built {\n generated: Record<string, string>; // filename (under generated/) -> css\n bricksColorsNamed: string;\n bricksColorsSemantic: string;\n bricksVariables: string;\n tokensJson: string;\n designManifest: string;\n tailwind: string;\n // captured for the tailwind bundler\n twTypeTokensCss: string;\n twPatternTokensCss: string;\n patternsCss: string;\n}\n\nfunction build(ds: DesignSystem, format: Format, assetsDir: string): Built {\n const BRICKS = format === 'bricks';\n // Every hue expands to its 11-step numeric OKLCH scale; every role resolves\n // to functional tokens over its hue. Dark mode is the automatic flip.\n const expandedPalette = expandPalette(ds.colors.palette as Record<string, unknown>);\n const roleMap = ds.colors.roles as Record<string, string>;\n const scaleRoles: FunctionalRole[] = [];\n for (const [role, hueName] of Object.entries(roleMap)) {\n const hue = expandedPalette[hueName];\n if (hue == null) throw new Error(`role \"${role}\" references unknown palette hue \"${hueName}\"`);\n scaleRoles.push(functionalRole(role, hueName, hue));\n }\n const surfaceRole = scaleRoles.find((r) => r.role === 'surface');\n const patterns = ds.patterns;\n const shadows = ds.shadows;\n const typography = ds.typography;\n const UTILITIES = (ds.colors.utilities ?? ['bg', 'text', 'border']).filter(\n (u) => u in UTILITY_PROPS,\n );\n\n const generated: Record<string, string> = {};\n\n // ── color.css ──────────────────────────────────────────────────────────────\n if (BRICKS) {\n generated['color.css'] =\n '/* Colours provided by Bricks (palette import generates tokens + utilities). */\\n';\n } else {\n let css = `/* GENERATED from design-system.json — do not edit by hand. */\\n:root {\\n`;\n css += ` color-scheme: light;\\n`;\n css += ` /* Hue scales (numeric steps, 50 = tinted near-white … 950 = tinted near-black) */\\n`;\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const [n, hex] of Object.entries(hue.numeric))\n css += ` --color-${name}-${n}: ${hex};\\n`;\n css += `\\n /* Functional role tokens (the public API) */\\n`;\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.light)) css += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n if (surfaceRole) {\n css += `\\n /* Translucent surface + scrim */\\n`;\n css += ` --surface-glass: color-mix(in oklch, var(--surface-bg) 72%, transparent);\\n`;\n css += ` --overlay: color-mix(in oklch, var(--color-${surfaceRole.hue}-950) 45%, transparent);\\n`;\n }\n css += `}\\n\\n`;\n // Dark appearance: the automatic functional flip (solid stays mode-stable).\n {\n let fb = '';\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.dark))\n if (fr.light[t] !== val) fb += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n if (surfaceRole)\n fb += ` --overlay: color-mix(in oklch, var(--color-${surfaceRole.hue}-950) 60%, transparent);\\n`;\n if (fb) {\n css += `/* Functional role tokens (dark) */\\n`;\n css += `:root[data-brx-theme=\"dark\"] {\\n color-scheme: dark;\\n${fb}}\\n\\n`;\n }\n }\n // Utilities: hue numeric steps + role emphasis stops, then the functional\n // set (emitted last so it wins ties, e.g. bg-<role>-muted).\n const allTokens: string[] = [];\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const n of Object.keys(hue.numeric)) allTokens.push(`${name}-${n}`);\n for (const fr of scaleRoles)\n for (const stop of ['x-muted', 'muted', 'bold', 'x-bold'])\n allTokens.push(`${fr.role}-${stop}`);\n css += `/* Colour utilities — ${UTILITIES.join(', ')} */\\n`;\n for (const token of allTokens)\n css +=\n UTILITIES.map(\n (cls) => `.${cls}-${token} { ${UTILITY_PROPS[cls]}: var(--color-${token}); }`,\n ).join('\\n') + '\\n';\n css += `\\n/* Functional utilities (the public API) */\\n`;\n for (const fr of scaleRoles)\n css += `${fnUtilities(fr.role, UTILITIES, fr.role === 'surface')}\\n`;\n if (surfaceRole)\n css += `.glass { background-color: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }\\n`;\n generated['color.css'] = css;\n }\n\n // ── shadows.css ──────────────────────────────────────────────────────────────\n {\n const entries = Object.entries(shadows ?? {});\n let sh = `/* GENERATED drop-shadow tokens + utilities — do not edit by hand. */\\n`;\n if (entries.length) {\n sh += `:root {\\n`;\n for (const [name, value] of entries) sh += ` --shadow-${name}: ${value};\\n`;\n sh += `}\\n\\n`;\n for (const [name] of entries)\n sh += `.drop-shadow-${name} { filter: drop-shadow(var(--shadow-${name})); }\\n`;\n }\n generated['shadows.css'] = sh;\n }\n\n // ── scales ───────────────────────────────────────────────────────────────────\n const typeSteps = ds.typeScale ? buildScale(ds.typeScale as ScaleConfig) : [];\n const spaceSteps = ds.spaceScale ? buildScale(ds.spaceScale as ScaleConfig) : [];\n const textMax: Record<string, string> = Object.fromEntries(\n typeSteps.map((s) => [`text-${s.name}`, s.max]),\n );\n\n const typographyFamilies = typography?.families ?? {};\n const withScaleFallback = (v: string) =>\n v.replace(/var\\(\\s*(--text-[\\w-]+)\\s*\\)/g, (m, name) =>\n textMax[name.slice(2)] ? `var(${name}, ${textMax[name.slice(2)]})` : m,\n );\n const roleDecls = (role: string, spec: TypographyRole): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [key, [prop, sfx]] of Object.entries(TYPO_KEYMAP)) {\n const identity = TYPO_IDENTITY[prop];\n if (spec[key] == null && identity == null) continue;\n const raw =\n spec[key] == null\n ? (identity as string)\n : key === 'family'\n ? (typographyFamilies[spec.family as string] ?? String(spec.family))\n : key === 'size'\n ? withScaleFallback(String(spec[key]))\n : String(spec[key]);\n out[prop] = `var(--${role}-${sfx}, ${raw})`;\n }\n return out;\n };\n\n // ── type-tokens.css ──────────────────────────────────────────────────────────\n let twTypeTokensCss = '';\n if (BRICKS) {\n generated['type-tokens.css'] =\n '/* Fonts + type/space scales provided by Bricks (Font + Variables managers). */\\n';\n } else {\n const root: Record<string, string> = {};\n for (const [name, stack] of Object.entries(ds.fonts ?? {})) root[`--font-${name}`] = stack;\n for (const s of typeSteps) root[`--text-${s.name}`] = s.value;\n for (const s of spaceSteps) root[`--space-${s.name}`] = s.value;\n const css = `/* GENERATED font families + fluid type/space scales — do not edit by hand. */\\n:root {\\n${decls(root)}\\n}\\n`;\n twTypeTokensCss = css;\n generated['type-tokens.css'] = css;\n }\n\n // ── tokens.css (pattern token cascade) ───────────────────────────────────────\n let twPatternTokensCss = '';\n {\n const tDefaults = patterns?.defaults ?? {};\n const tRadii = patterns?.radii ?? {};\n const tGroups = patterns?.groups ?? {};\n const tZ = patterns?.z ?? {};\n const tItems = (patterns?.items ?? {}) as Record<string, Pattern>;\n const root: Record<string, string> = {};\n for (const [prop, val] of Object.entries(tDefaults)) root[`--${prop}-default`] = val;\n if (!BRICKS) for (const [name, val] of Object.entries(tRadii)) root[`--br-${name}`] = val;\n for (const [group, props] of Object.entries(tGroups))\n for (const [prop, val] of Object.entries(props)) root[`--${prop}-${group}`] = val;\n for (const [name, n] of Object.entries(tZ)) root[`--z-tier-${name}`] = String(n);\n const aliases: Record<string, string> = {};\n for (const [name, p] of Object.entries(tItems)) {\n if (!p.group) continue;\n for (const prop of Object.keys(tGroups[p.group] ?? {}))\n aliases[`--${prop}-${name}-group`] = `var(--${prop}-${p.group})`;\n for (const [prop, val] of Object.entries(p.overrides ?? {}))\n aliases[`--${prop}-${name}-group`] = val;\n }\n let tok = `/* GENERATED pattern token cascade — do not edit by hand. */\\n:root {\\n`;\n tok += decls(root) + '\\n';\n if (Object.keys(aliases).length) tok += '\\n' + decls(aliases) + '\\n';\n tok += `}\\n`;\n twPatternTokensCss = tok;\n generated['tokens.css'] = tok;\n }\n\n // ── typography.css (.font-* roles) ───────────────────────────────────────────\n {\n const roles = (typography?.roles ?? {}) as Record<string, TypographyRole>;\n const headings = typography?.headings ?? {};\n let typo = `/* GENERATED typography roles — do not edit by hand. */\\n`;\n for (const [role, spec] of Object.entries(roles))\n typo += `.font-${role} {\\n${decls(roleDecls(role, spec))}\\n}\\n`;\n for (const [tag, role] of Object.entries(headings))\n if (roles[role]) typo += `${tag} {\\n${decls(roleDecls(role, roles[role]))}\\n}\\n`;\n generated['typography.css'] = typo;\n }\n\n // ── patterns.css (component interaction patterns) ────────────────────────────\n const stateRules = (\n sel: string,\n role: string | null,\n states: Record<string, Record<string, unknown>>,\n colorProp: 'background-color' | 'color' = 'background-color',\n ) => {\n let out = '';\n for (const [state, spec] of Object.entries(states)) {\n const body: string[] = [];\n // `step` intensifies the pattern's colour: fills swap solid → solid-bold;\n // text swaps the bold emphasis stop → x-bold.\n if (typeof spec.step === 'number' && role) {\n const stateVar =\n colorProp === 'background-color'\n ? `var(--${role}-${spec.step >= 1 ? 'solid-bold' : 'solid'})`\n : `var(--color-${role}-${spec.step >= 1 ? 'x-bold' : 'bold'})`;\n body.push(`${colorProp}: ${stateVar};`);\n }\n if (typeof spec.scale === 'number') body.push(`scale: ${spec.scale};`);\n if (typeof spec.lift === 'string') body.push(`translate: 0 calc(-1 * ${spec.lift});`);\n if (typeof spec.shadow === 'string' && shadows?.[spec.shadow])\n body.push(`filter: drop-shadow(var(--shadow-${spec.shadow}));`);\n else if (spec.shadow === true)\n body.push(`box-shadow: var(--lift-shadow, 0 8px 20px -6px rgb(0 0 0 / 0.25));`);\n if (spec.ring === true) {\n const ringColor = role ? `var(--color-${role}-muted)` : `var(--color-ui-primary-muted)`;\n body.push(`outline: none;`, `box-shadow: 0 0 0 3px ${ringColor};`);\n }\n if (spec.css && typeof spec.css === 'object')\n for (const [k, v] of Object.entries(spec.css as Record<string, string>))\n body.push(`${k}: ${v};`);\n if (!body.length) continue;\n const pseudo =\n state === 'hover'\n ? ':hover'\n : state === 'active'\n ? ':active'\n : state === 'focus-visible'\n ? ':focus-visible'\n : `:${state}`;\n const rule = `${sel}${pseudo} {\\n ${body.join('\\n ')}\\n}\\n`;\n out += state === 'hover' ? `@media (hover: hover) {\\n${rule}}\\n` : rule;\n }\n return out;\n };\n\n let pat = `/* GENERATED component patterns — do not edit by hand. */\\n`;\n pat += `/* Interaction transitions for patterned elements (independent props compose). */\\n`;\n for (const [pname, p] of Object.entries((patterns?.items ?? {}) as Record<string, Pattern>)) {\n if (!p.base) continue;\n const states = p.states ?? {};\n const isElement = !!p.element;\n const defaultSel = isElement ? `:where(${p.element})` : `.${p.class ?? pname}`;\n const defaultRole = p.default_role ?? null;\n const base = { ...p.base };\n const fills =\n pname === 'button' ||\n pname === 'badge' ||\n base['background-color'] != null ||\n base['background'] != null;\n const colorProp: 'background-color' | 'color' = fills ? 'background-color' : 'color';\n pat += `${defaultSel} {\\n`;\n const hasStates = Object.keys(states).length > 0;\n if (hasStates) {\n pat += ` transition-property: translate, scale, rotate, filter, box-shadow, background-color, color;\\n`;\n pat += ` transition-duration: var(--interact-duration, 200ms);\\n`;\n pat += ` transition-timing-function: var(--interact-easing, ease);\\n`;\n pat += ` translate: 0 0; scale: 1; rotate: 0deg;\\n`;\n }\n if (defaultRole && fills && base['background-color'] == null && base['background'] == null)\n base['background-color'] = `var(--${defaultRole}-solid)`;\n const wrappedBase: Record<string, string> = {};\n for (const [prop, val] of Object.entries(base)) {\n const sfx = BASE_HOOK[prop];\n wrappedBase[prop] = sfx ? `var(--${sfx}-${pname}, ${val})` : String(val);\n }\n pat += decls(wrappedBase) + '\\n}\\n';\n pat += stateRules(defaultSel, defaultRole, states, colorProp);\n for (const role of p.roles ?? []) {\n const variantSel = isElement ? `${p.element}.${role}` : `.${p.class ?? pname}-${role}`;\n // Fills sit on the role's solid + pair with on-solid; text variants use\n // the bold emphasis stop (readable accent in both appearances).\n const variantColorDecl = fills\n ? `background-color: var(--${role}-solid); color: var(--${role}-on-solid)`\n : `color: var(--color-${role}-bold)`;\n pat += `${variantSel} { ${variantColorDecl}; }\\n`;\n pat += stateRules(variantSel, role, states, colorProp);\n }\n pat += '\\n';\n }\n generated['patterns.css'] = pat;\n\n // ── animation-effects.css ────────────────────────────────────────────────────\n {\n const anim = ds.animations ?? {};\n const asStr = (v: string | number) => String(v);\n const block = (sel: string, d: Record<string, string>) => `.${sel} {\\n${decls(d)}\\n}\\n`;\n let out = `/* GENERATED animation effects + journeys — do not edit by hand. */\\n`;\n for (const [name, e] of Object.entries(anim.effects ?? {})) {\n const d: Record<string, string> = { '--_anim': e.kf };\n for (const [k, v] of Object.entries(e.css ?? {})) d[k] = asStr(v);\n for (const [k, v] of Object.entries(e.vars ?? {})) d[`--${k}`] = asStr(v);\n out += block(name, d);\n }\n const base = anim.journeys?.base ?? {};\n for (const parts of anim.journeys?.compose ?? []) {\n const d: Record<string, string> = {\n '--_anim': parts.map((p) => `${p}-journey`).join(', '),\n 'animation-range': 'entry exit',\n };\n for (const p of parts)\n for (const [k, v] of Object.entries(base[p] ?? {})) d[`--${k}`] = asStr(v);\n out += block(`${parts.join('-')}-journey`, d);\n }\n const STATES: [string, (s: string) => string][] = [\n ['hover', (s) => `.${s}:hover`],\n ['focus', (s) => `.${s}:focus-visible`],\n ['active', (s) => `.${s}.is-active, .${s}[data-active]`],\n ];\n out += `\\n/* State-flip variants — compose with .transition (hover-/focus-/active-<fx>). */\\n`;\n for (const [name, e] of Object.entries(anim.effects ?? {})) {\n if (e.kf !== 'composite' && e.kf !== 'paint') continue;\n const props: Record<string, { from?: string; to?: string }> = {};\n for (const [k, v] of Object.entries(e.vars ?? {})) {\n const m = /^(.*)-(from|to)$/.exec(k);\n if (m) (props[m[1] as string] ??= {})[m[2] as 'from' | 'to'] = asStr(v);\n }\n const rest: Record<string, string> = {};\n for (const [p, ft] of Object.entries(props)) {\n if (ft.from != null && ft.from !== STATE_DEFAULT[p]) rest[`--${p}-from`] = ft.from;\n if (ft.to != null && ft.to !== STATE_DEFAULT[p]) rest[`--${p}-to`] = ft.to;\n }\n const flip: Record<string, string> = Object.fromEntries(\n Object.keys(props).map((p) => [`--t-${p}`, `var(--${p}-to, ${STATE_DEFAULT[p]})`]),\n );\n if (Object.keys(rest).length)\n out += `${STATES.map(([s]) => `.${s}-${name}`).join(', ')} {\\n${decls(rest)}\\n}\\n`;\n for (const [s, sel] of STATES) out += `${sel(`${s}-${name}`)} {\\n${decls(flip)}\\n}\\n`;\n }\n generated['animation-effects.css'] = out;\n }\n\n // ── Bricks palettes ──────────────────────────────────────────────────────────\n // Named = the hue scales (numeric steps); Semantic = the functional role\n // tokens with their automatic light/dark pairing.\n const namedColors: unknown[] = [];\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const [n, hex] of Object.entries(hue.numeric)) {\n const token = `${name}-${n}`;\n namedColors.push({\n raw: `var(--color-${token})`,\n light: hex,\n id: id(`named:${token}`),\n utilityClasses: UTILITIES,\n });\n }\n const semanticColors: unknown[] = [];\n for (const fr of scaleRoles)\n for (const [t, light] of Object.entries(fr.light)) {\n const dark = fr.dark[t] as string;\n semanticColors.push({\n raw: `var(${fnVar(fr.role, t)})`,\n light,\n darkModeEnabled: light !== dark,\n dark,\n id: id(`semantic:${fr.role}-${t}`),\n utilityClasses: UTILITIES,\n });\n }\n const bricksColorsNamed = JSON.stringify(\n { id: id('palette:named'), name: 'Named', colors: namedColors },\n null,\n 2,\n );\n const bricksColorsSemantic = JSON.stringify(\n { id: id('palette:semantic'), name: 'Semantic', colors: semanticColors },\n null,\n 2,\n );\n\n // ── Bricks Global Variables (fonts + scales) ─────────────────────────────────\n const bricksVariables = (() => {\n type BrxScale = { scale: number; scaleName: string };\n type BrxVar = { id: string; name: string; value: string; category?: string; scale?: BrxScale };\n type BrxCat = { id: string; name: string; scale: Record<string, unknown>; utilityClasses: [] };\n const scaleMeta = (scope: string, prefix: string, s: ScaleConfig, names: string[]) => {\n const px = Math.round(rem(s.base) * 16);\n const lo = s.fluid?.minRatio ?? s.ratio;\n return {\n scaleScope: scope,\n scaleType: 'tshirt',\n scaleNames: names,\n prefix,\n minFontSize: px,\n minScaleRatio: lo,\n minScaleRatioSelect: lo,\n maxFontSize: px,\n maxScaleRatio: s.ratio,\n maxScaleRatioSelect: s.ratio,\n baseline: s.baseline ?? names[Math.floor((names.length - 1) / 2)],\n };\n };\n const categories: BrxCat[] = [];\n const variables: BrxVar[] = [];\n const addScale = (\n label: string,\n scope: string,\n prefix: string,\n cfg: ScaleConfig | undefined,\n steps: ScaleStep[],\n ) => {\n if (!cfg || !steps.length) return;\n const names = steps.map((s) => s.name);\n const catId = id(`varcat:${scope}`);\n categories.push({\n id: catId,\n name: label,\n scale: scaleMeta(scope, prefix, cfg, names),\n utilityClasses: [],\n });\n for (const st of steps)\n variables.push({\n id: id(`var:${prefix}${st.name}`),\n name: `${prefix}${st.name}`,\n value: st.value,\n category: catId,\n scale: { scale: st.offset, scaleName: st.name },\n });\n };\n addScale('Typography', 'typography', 'text-', ds.typeScale as ScaleConfig, typeSteps);\n addScale('Spacing', 'spacing', 'space-', ds.spaceScale as ScaleConfig, spaceSteps);\n for (const [name, stack] of Object.entries(ds.fonts ?? {}))\n variables.push({ id: id(`var:font-${name}`), name: `font-${name}`, value: stack });\n for (const [name, val] of Object.entries(ds.patterns?.radii ?? {}))\n variables.push({ id: id(`var:br-${name}`), name: `br-${name}`, value: val });\n return JSON.stringify({ variables, categories }, null, 2);\n })();\n\n // ── tokens.json (trimmed token export for programmatic consumers) ────────────\n const numericPalette = Object.fromEntries(\n Object.entries(expandedPalette).map(([k, v]) => [k, v.numeric]),\n );\n const tokensJson = JSON.stringify(\n {\n colors: {\n palette: numericPalette,\n roles: roleMap,\n functional: Object.fromEntries(\n scaleRoles.map((fr) => [fr.role, { light: fr.light, dark: fr.dark }]),\n ),\n },\n fonts: ds.fonts ?? {},\n text: Object.fromEntries(typeSteps.map((s) => [s.name, s.value])),\n spacing: Object.fromEntries(spaceSteps.map((s) => [s.name, s.value])),\n shadows: shadows ?? {},\n radii: ds.patterns?.radii ?? {},\n },\n null,\n 2,\n );\n\n // ── design-manifest.json (live-editor manifest; css format) ──────────────────\n const designManifest = (() => {\n const reverseIndex: Record<string, string> = {};\n // Numeric steps are generated from the hue's seed — edits map back to it.\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const n of Object.keys(hue.numeric))\n reverseIndex[`--color-${name}-${n}`] = `colors.palette.${name}.seed`;\n const colorRoles = Object.entries(roleMap).map(([name, ramp]) => ({ name, ramp }));\n const typoRoles = (typography?.roles ?? {}) as Record<string, TypographyRole>;\n const hooks: Record<string, { prop: string; key: string }> = {};\n for (const [key, [prop, sfx]] of Object.entries(TYPO_KEYMAP)) hooks[sfx] = { prop, key };\n for (const [role, spec] of Object.entries(typoRoles))\n for (const [key, [, sfx]] of Object.entries(TYPO_KEYMAP))\n if (spec[key] != null) reverseIndex[`--${role}-${sfx}`] = `typography.roles.${role}.${key}`;\n const pDefaults = patterns?.defaults ?? {};\n const pRadii = patterns?.radii ?? {};\n const pGroups = patterns?.groups ?? {};\n const pItems = (patterns?.items ?? {}) as Record<string, Pattern>;\n for (const prop of Object.keys(pDefaults))\n reverseIndex[`--${prop}-default`] = `patterns.defaults.${prop}`;\n for (const name of Object.keys(pRadii)) reverseIndex[`--br-${name}`] = `patterns.radii.${name}`;\n for (const [group, props] of Object.entries(pGroups))\n for (const prop of Object.keys(props))\n reverseIndex[`--${prop}-${group}`] = `patterns.groups.${group}.${prop}`;\n const items = Object.entries(pItems).map(([name, p]) => {\n const base = p.base ?? {};\n const wrappable = Object.keys(base)\n .filter((prop) => prop in BASE_HOOK)\n .map((prop) => ({ sfx: BASE_HOOK[prop] as string, prop }));\n for (const { sfx, prop } of wrappable)\n reverseIndex[`--${sfx}-${name}`] = `patterns.items.${name}.base.${prop}`;\n return { name, group: p.group ?? null, base, wrappable, roles: p.roles ?? [] };\n });\n return JSON.stringify(\n {\n colors: {\n ramps: Object.keys(expandedPalette),\n steps: NUMERIC_STEPS,\n palette: numericPalette,\n roles: colorRoles,\n },\n typography: {\n roles: Object.keys(typoRoles),\n hooks,\n families: typographyFamilies,\n specs: typoRoles,\n },\n scales: {\n text: typeSteps.map((s) => ({ name: s.name, value: s.value, max: s.max })),\n space: spaceSteps.map((s) => ({ name: s.name, value: s.value, max: s.max })),\n },\n fonts: ds.fonts ?? {},\n patterns: { defaults: pDefaults, radii: pRadii, groups: pGroups, items },\n shadows: shadows ?? {},\n interaction: { duration: '200ms', easing: 'ease' },\n reverseIndex,\n },\n null,\n 2,\n );\n })();\n\n // ── Tailwind bundle ──────────────────────────────────────────────────────────\n const tailwind = emitTailwind({\n ds,\n expandedPalette,\n scaleRoles,\n shadows,\n typeSteps,\n spaceSteps,\n typography,\n roleDecls,\n twTypeTokensCss,\n twPatternTokensCss,\n patternsCss: pat,\n assetsDir,\n });\n\n return {\n generated,\n bricksColorsNamed,\n bricksColorsSemantic,\n bricksVariables,\n tokensJson,\n designManifest,\n tailwind,\n twTypeTokensCss,\n twPatternTokensCss,\n patternsCss: pat,\n };\n}\n\n// ── Tailwind emitter ──────────────────────────────────────────────────────────\ninterface TwCtx {\n ds: DesignSystem;\n expandedPalette: Record<string, ExpandedHue>;\n scaleRoles: FunctionalRole[];\n shadows: Record<string, string> | undefined;\n typeSteps: ScaleStep[];\n spaceSteps: ScaleStep[];\n typography: DesignSystem['typography'];\n roleDecls: (role: string, spec: TypographyRole) => Record<string, string>;\n twTypeTokensCss: string;\n twPatternTokensCss: string;\n patternsCss: string;\n assetsDir: string;\n}\n\nfunction emitTailwind(ctx: TwCtx): string {\n const {\n ds,\n expandedPalette,\n scaleRoles,\n shadows,\n typeSteps,\n spaceSteps,\n typography,\n roleDecls,\n twTypeTokensCss,\n twPatternTokensCss,\n patternsCss,\n assetsDir,\n } = ctx;\n const cssDir = join(assetsDir, 'css');\n const nl = (arr: string[]) => arr.filter(Boolean).join('\\n');\n const parts: string[] = [`/* GENERATED for Tailwind v4 (Astro) — do not edit by hand. */`];\n parts.push(`@import \"tailwindcss\";\\n`);\n\n const theme: string[] = [];\n theme.push(` /* Hue scales → bg-<hue>-<step> text-* border-* (numeric, 50…950) */`);\n for (const [name, hue] of Object.entries(expandedPalette))\n for (const [n, hex] of Object.entries(hue.numeric))\n theme.push(` --color-${name}-${n}: ${hex};`);\n theme.push(`\\n /* Fonts → font-* */`);\n for (const [name, stack] of Object.entries(ds.fonts ?? {}))\n theme.push(` --font-${name}: ${stack};`);\n theme.push(`\\n /* Fluid type scale → text-* */`);\n for (const s of typeSteps) theme.push(` --text-${s.name}: ${s.value};`);\n // Fluid space steps are NOT put in Tailwind's --spacing-* namespace: named\n // spacing keys shadow the size scales (e.g. `max-w-7xl` would resolve to\n // var(--spacing-7xl) ≈ 6rem and collapse layouts). They ship as --space-*\n // (matching the css format) in a plain :root below; use var(--space-<name>)\n // or the TW4 arbitrary form p-(--space-md). Numeric spacing (p-4 …) keeps\n // Tailwind's default --spacing multiplier.\n theme.push(`\\n /* Drop-shadows → shadow-* */`);\n for (const [name, value] of Object.entries(shadows ?? {}))\n theme.push(` --shadow-${name}: ${value};`);\n theme.push(`\\n /* Container breakpoints → @sm:/@md:/@lg:/@xl: */`);\n for (const [name, val] of [\n ['sm', '30rem'],\n ['md', '48rem'],\n ['lg', '64rem'],\n ['xl', '80rem'],\n ])\n theme.push(` --container-${name}: ${val};`);\n parts.push(`@theme {\\n${theme.join('\\n')}\\n}\\n`);\n\n if (spaceSteps.length)\n parts.push(\n `/* Fluid space scale — var(--space-<name>) or p-(--space-<name>) */\\n:root {\\n` +\n spaceSteps.map((s) => ` --space-${s.name}: ${s.value};`).join('\\n') +\n `\\n}\\n`,\n );\n\n // Functional role tokens (not --color-*, so a plain :root block — Tailwind\n // must not derive single-purpose utilities from them; the @utility set below\n // is the public API).\n if (scaleRoles.length) {\n let fn = '';\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.light)) fn += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n const surface = scaleRoles.find((r) => r.role === 'surface');\n if (surface) {\n fn += ` --surface-glass: color-mix(in oklch, var(--surface-bg) 72%, transparent);\\n`;\n fn += ` --overlay: color-mix(in oklch, var(--color-${surface.hue}-950) 45%, transparent);\\n`;\n }\n parts.push(`/* Functional role tokens (the public API) */\\n:root {\\n${fn}}\\n`);\n }\n\n parts.push(\n `/* ── Framework tokens (consumed by the inlined components) ── */\\n` +\n `${twTypeTokensCss}\\n${twPatternTokensCss}`,\n );\n\n // Dark appearance: the automatic functional flip (solid stays mode-stable).\n let darkBlock = '';\n for (const fr of scaleRoles)\n for (const [t, val] of Object.entries(fr.dark))\n if (fr.light[t] !== val) darkBlock += ` ${fnVar(fr.role, t)}: ${val};\\n`;\n {\n const surface = scaleRoles.find((r) => r.role === 'surface');\n if (surface)\n darkBlock += ` --overlay: color-mix(in oklch, var(--color-${surface.hue}-950) 60%, transparent);\\n`;\n }\n if (darkBlock)\n parts.push(\n `/* Functional role tokens (dark) */\\n:root[data-brx-theme=\"dark\"] {\\n color-scheme: dark;\\n${darkBlock}}\\n`,\n );\n\n parts.push(\n `/* State variant for the active flip (hover/focus-visible are built in). */\\n` +\n `@custom-variant is-active (&.is-active, &[data-active]);\\n`,\n );\n\n const util: string[] = [];\n if (scaleRoles.length) {\n util.push(`/* Functional colour utilities (the public API) */`);\n for (const fr of scaleRoles)\n for (const row of fnUtilities(fr.role, ['bg', 'text', 'border'], fr.role === 'surface').split(\n '\\n',\n )) {\n const m = /^\\.([^ ]+) \\{ (.*) \\}$/.exec(row);\n if (m) util.push(`@utility ${m[1]} {\\n ${m[2]}\\n}`);\n }\n if (scaleRoles.some((r) => r.role === 'surface'))\n util.push(\n `@utility glass {\\n background-color: var(--surface-glass);\\n backdrop-filter: blur(12px);\\n -webkit-backdrop-filter: blur(12px);\\n}`,\n );\n }\n util.push(`/* Typography roles */`);\n for (const [role, spec] of Object.entries(\n (typography?.roles ?? {}) as Record<string, TypographyRole>,\n ))\n util.push(`@utility font-${role} {\\n${decls(roleDecls(role, spec))}\\n}`);\n util.push(`\\n/* Animation effects (pair with .transition or a driver) */`);\n const asStr = (v: string | number) => String(v);\n for (const [name, e] of Object.entries(ds.animations?.effects ?? {})) {\n const d: Record<string, string> = { '--_anim': e.kf };\n for (const [k, v] of Object.entries(e.css ?? {})) d[k] = asStr(v);\n for (const [k, v] of Object.entries(e.vars ?? {})) d[`--${k}`] = asStr(v);\n util.push(`@utility ${name} {\\n${decls(d)}\\n}`);\n if (e.kf !== 'composite' && e.kf !== 'paint') continue;\n const props = new Set<string>();\n for (const k of Object.keys(e.vars ?? {})) {\n const m = /^(.*)-(from|to)$/.exec(k);\n if (m) props.add(m[1] as string);\n }\n const flip = Object.fromEntries(\n [...props].map((p) => [`--t-${p}`, `var(--${p}-to, ${STATE_DEFAULT[p]})`]),\n );\n util.push(`@utility flip-${name} {\\n${decls(flip)}\\n}`);\n }\n util.push(`\\n/* Split — internal fractions (pair split with a ratio) */`);\n util.push(\n `@utility split {\\n display: flex;\\n` +\n ` & > * { flex: 1; }\\n` +\n ` & > :first-child { flex: var(--_split-a, 1); }\\n` +\n ` & > :last-child { flex: var(--_split-b, 1); }\\n}`,\n );\n const RATIOS: [number, number][] = [\n [1, 2],\n [2, 1],\n [1, 3],\n [3, 1],\n [1, 4],\n [4, 1],\n [2, 3],\n [3, 2],\n ];\n for (const [a, b] of RATIOS)\n util.push(`@utility split-${a}-${b} {\\n --_split-a: ${a};\\n --_split-b: ${b};\\n}`);\n util.push(`\\n/* Track placement (inside .centered) */`);\n for (const track of ['measure', 'breakout', 'spotlight', 'fullbleed'])\n util.push(`@utility ${track} {\\n grid-column: ${track};\\n}`);\n parts.push(util.join('\\n') + '\\n');\n\n // Structure mirrors layout.css (kept literal for parity with the original emitter).\n parts.push(`/* ── Structure (mirrors src/css/layout.css) ── */\n:root {\n --rhythm-scale: 1;\n --rhythm-base: calc(1rlh * var(--rhythm-scale));\n --rhythm-h-p: 0.4;\n --rhythm-p-p: 0.9;\n --rhythm-p-h: 1.6;\n --rhythm-h-h: 0.6;\n --rhythm-p-list: 0.5;\n --rhythm-list-p: 0.9;\n --rhythm-li-li: 0.3;\n --rhythm-text-media: 1.2;\n --rhythm-media-text: 1.2;\n --width-measure: 65ch;\n --width-breakout: 90ch;\n --width-spotlight: 120ch;\n --gutter: clamp(1rem, 4cqi, 3rem);\n}\n\nbody {\n container-type: inline-size;\n}\n\n/* Class-level structure rules live in \\`components\\` so track/spacing utilities\n (@layer utilities — later in the layer order) can override them; unlayered\n CSS would beat ALL layered utilities regardless of specificity (e.g.\n \\`.centered > *\\` pinning children to \\`measure\\` over \\`.spotlight\\`). */\n@layer components {\n.rhythm {\n display: flow-root;\n}\n.rhythm > * + * {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-p-p));\n}\n.rhythm > :where(h1, h2, h3, h4, h5, h6) + p {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-h-p));\n}\n.rhythm > p + :where(h1, h2, h3, h4, h5, h6) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-p-h));\n}\n.rhythm > :where(h1, h2, h3, h4, h5, h6) + :where(h1, h2, h3, h4, h5, h6) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-h-h));\n}\n.rhythm > p + :where(ul, ol) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-p-list));\n}\n.rhythm > :where(ul, ol) + p {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-list-p));\n}\n.rhythm :where(ul, ol) > li + li {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-li-li));\n}\n.rhythm > :where(p, h1, h2, h3, h4, h5, h6, ul, ol) + :where(figure, img, picture, video) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-text-media));\n}\n.rhythm > :where(figure, img, picture, video) + :where(p, h1, h2, h3, h4, h5, h6, ul, ol) {\n margin-top: calc(var(--rhythm-base) * var(--rhythm-media-text));\n}\n\n.centered {\n --_measure: min(var(--width-measure), 100% - var(--gutter) * 2);\n --_breakout: minmax(0, calc((var(--width-breakout) - var(--width-measure)) / 2));\n --_spotlight: minmax(0, calc((var(--width-spotlight) - var(--width-breakout)) / 2));\n position: relative;\n display: grid;\n grid-template-columns:\n [fullbleed-start] minmax(var(--gutter), 1fr)\n [spotlight-start] var(--_spotlight)\n [breakout-start] var(--_breakout)\n [measure-start] var(--_measure) [measure-end]\n var(--_breakout) [breakout-end]\n var(--_spotlight) [spotlight-end]\n minmax(var(--gutter), 1fr) [fullbleed-end];\n}\n.centered > * {\n grid-column: measure;\n}\n\n.region {\n padding-block: clamp(\n var(--region-space-min, 3rem),\n var(--region-space, 8vh),\n var(--region-space-max, 8rem)\n );\n}\n}\n`);\n\n // Same layering rationale as the structure block above.\n const animEngine = readFileSync(join(cssDir, 'animation.css'), 'utf8');\n parts.push(`/* ── Animation engine (animation.css) ── */\\n@layer components {\\n${animEngine}\\n}`);\n // Patterns live in Tailwind's `components` layer so single-purpose utilities\n // (@layer utilities — declared later in the layer order) override them, e.g.\n // `.text-on-ui-primary` beating the link pattern's element-level `a { color }`.\n // Unlayered CSS would win over ALL layered utilities regardless of specificity.\n parts.push(`/* ── Component patterns ── */\\n@layer components {\\n${patternsCss}\\n}`);\n\n // Component + structural partials: the full framework library, minus the\n // Tailwind-owned utility layer. Sourced live from the CSS partials (in index.css\n // cascade order) so this never goes stale, then run through stripForTailwind.\n const TW_CLASH = new Set<string>([\n 'block',\n 'inline',\n 'inline-block',\n 'flow-root',\n 'flex',\n 'inline-flex',\n 'grid',\n 'inline-grid',\n 'table',\n 'inline-table',\n 'table-caption',\n 'table-cell',\n 'table-row',\n 'contents',\n 'hidden',\n 'list-item',\n 'static',\n 'fixed',\n 'absolute',\n 'relative',\n 'sticky',\n 'isolate',\n 'visible',\n 'invisible',\n 'collapse',\n 'sr-only',\n 'not-sr-only',\n 'flex-row',\n 'flex-row-reverse',\n 'flex-col',\n 'flex-col-reverse',\n 'flex-wrap',\n 'flex-nowrap',\n 'items-start',\n 'items-end',\n 'items-center',\n 'items-baseline',\n 'items-stretch',\n 'justify-start',\n 'justify-end',\n 'justify-center',\n 'justify-between',\n 'justify-around',\n 'justify-evenly',\n 'content-start',\n 'content-end',\n 'content-center',\n 'content-between',\n 'content-around',\n 'content-evenly',\n 'text-left',\n 'text-center',\n 'text-right',\n 'text-justify',\n 'text-start',\n 'text-end',\n ]);\n const droppedClashes = new Set<string>();\n let droppedVariantBlocks = 0;\n const stripForTailwind = (css: string): string => {\n const kept: string[] = [];\n let depth = 0;\n let start = 0;\n let preludeEnd = -1;\n for (let i = 0; i < css.length; i++) {\n const ch = css[i];\n if (ch === '/' && css[i + 1] === '*') {\n const end = css.indexOf('*/', i + 2);\n i = end === -1 ? css.length : end + 1;\n continue;\n }\n if (ch === '\"' || ch === \"'\") {\n i += 1;\n while (i < css.length && css[i] !== ch) i += css[i] === '\\\\' ? 2 : 1;\n continue;\n }\n if (ch === '{') {\n if (depth === 0) preludeEnd = i;\n depth++;\n } else if (ch === '}') {\n depth--;\n if (depth === 0) {\n const raw = css.slice(start, i + 1).trim();\n const prelude = css\n .slice(start, preludeEnd)\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .trim();\n const clash = /^\\.([A-Za-z0-9_-]+)/.exec(prelude);\n if (/^@container\\s*\\(\\s*min-width:/.test(prelude)) droppedVariantBlocks++;\n else if (clash && TW_CLASH.has(clash[1] as string))\n droppedClashes.add(clash[1] as string);\n else if (raw) kept.push(raw);\n start = i + 1;\n }\n }\n }\n return kept.join('\\n\\n');\n };\n\n const partials = componentPartialOrder(cssDir);\n const componentCss = partials\n .map((rel) => {\n const css = readFileSync(join(cssDir, rel), 'utf8');\n return `/* ── ${rel} ── */\\n${stripForTailwind(css)}`;\n })\n .join('\\n\\n');\n // Same layering rationale as the patterns block above.\n parts.push(\n `/* ── Component + structural partials (Tailwind-clashing utilities dropped) ── */\\n@layer components {\\n${componentCss}\\n}`,\n );\n\n return nl(parts) + '\\n';\n}\n\n/**\n * The component/structural CSS partials to inline into the Tailwind bundle, in\n * index.css cascade order. Everything the aggregator imports EXCEPT the engine\n * (global/animation), the layout utilities (Tailwind owns them), and the generated\n * token layer (Tailwind builds its own via @theme).\n */\nfunction componentPartialOrder(cssDir: string): string[] {\n const indexPath = join(cssDir, 'index.css');\n const skip = new Set(['global.css', 'animation.css', 'layout.css']);\n const order: string[] = [];\n const seen = new Set<string>();\n const text = existsSync(indexPath) ? readFileSync(indexPath, 'utf8') : '';\n for (const m of text.matchAll(/@import\\s+['\"]\\.\\/([^'\"]+)['\"]/g)) {\n const rel = m[1] as string;\n if (rel.startsWith('generated/')) continue;\n if (skip.has(rel)) continue;\n if (!seen.has(rel) && existsSync(join(cssDir, rel))) {\n seen.add(rel);\n order.push(rel);\n }\n }\n // Fallback: if no index.css, inline utilities + every pattern partial.\n if (!order.length) {\n if (existsSync(join(cssDir, 'utilities.css'))) order.push('utilities.css');\n const pdir = join(cssDir, 'patterns');\n if (existsSync(pdir))\n for (const f of readdirSync(pdir).sort()) if (f.endsWith('.css')) order.push(`patterns/${f}`);\n }\n return order;\n}\n\n// ── CSS bundling (css + bricks formats) ───────────────────────────────────────\n/**\n * Assemble the full stylesheet by resolving index.css's @import order against the\n * static partials (from assets) and the freshly generated token partials (in\n * memory), then minify with lightningcss. No @import survives, so no disk\n * resolution / shared `generated/` dir is needed.\n */\nfunction bundleCss(\n generated: Record<string, string>,\n assetsDir: string,\n minify: boolean,\n): { code: string; map: string | undefined } {\n const cssDir = join(assetsDir, 'css');\n const indexPath = join(cssDir, 'index.css');\n const index = readFileSync(indexPath, 'utf8');\n const chunks: string[] = [];\n for (const line of index.split('\\n')) {\n const m = /@import\\s+['\"]\\.\\/([^'\"]+)['\"]/.exec(line);\n if (!m) continue;\n const rel = m[1] as string;\n if (rel.startsWith('generated/')) {\n const name = rel.slice('generated/'.length);\n chunks.push(generated[name] ?? '');\n } else {\n chunks.push(readFileSync(join(cssDir, rel), 'utf8'));\n }\n }\n const merged = chunks.join('\\n');\n const res = transform({\n filename: 'styles.css',\n code: Buffer.from(merged),\n minify,\n sourceMap: minify,\n });\n return {\n code: res.code.toString(),\n map: res.map ? res.map.toString() : undefined,\n };\n}\n\n// ── public generate() ─────────────────────────────────────────────────────────\nfunction loadConfig(input: string | DesignSystem): DesignSystem {\n const raw = typeof input === 'string' ? JSON.parse(readFileSync(input, 'utf8')) : input;\n const result = validate(raw);\n if (!result.ok) {\n const lines = result.errors\n .slice(0, 12)\n .map((e) => ` • ${e.path.join('.') || '(root)'}: ${e.message}`)\n .join('\\n');\n throw new Error(`Invalid design-system.json:\\n${lines}`);\n }\n return result.data;\n}\n\nexport async function generate(options: GenerateOptions): Promise<GenerateResult> {\n const format: Format = options.format ?? 'bricks';\n const outDir = options.outDir ?? 'dist';\n const assetsDir = options.assetsDir ?? DEFAULT_ASSETS;\n const ds = loadConfig(options.input);\n const built = build(ds, format, assetsDir);\n mkdirSync(outDir, { recursive: true });\n const written: string[] = [];\n const put = (rel: string, content: string) => {\n const p = join(outDir, rel);\n mkdirSync(dirname(p), { recursive: true });\n writeFileSync(p, content);\n written.push(p);\n };\n\n if (format === 'tailwind') {\n put('tailwind.css', built.tailwind);\n put('tokens.json', built.tokensJson);\n } else if (format === 'css') {\n const { code } = bundleCss(built.generated, assetsDir, true);\n put('styles.css', code);\n put('tokens.json', built.tokensJson);\n put('design-manifest.json', built.designManifest);\n } else {\n // bricks: bundled minified CSS + Bricks import JSON + copied JS/PHP/docs.\n const { code, map } = bundleCss(built.generated, assetsDir, true);\n put('styles.min.css', map ? code + `\\n/*# sourceMappingURL=styles.min.css.map */` : code);\n if (map) put('styles.min.css.map', map);\n put('bricks-colors-named.json', built.bricksColorsNamed);\n put('bricks-colors-semantic.json', built.bricksColorsSemantic);\n put('bricks-variables.json', built.bricksVariables);\n put('tokens.json', built.tokensJson);\n // Framework-static JS bundles → outDir root (theme enqueues them).\n const jsDir = join(assetsDir, 'js');\n if (existsSync(jsDir)) {\n cpSync(jsDir, outDir, { recursive: true });\n for (const f of readdirSync(jsDir)) written.push(join(outDir, f));\n }\n // Bricks PHP elements + loader → outDir/bricks.\n const bricksSrc = join(assetsDir, 'bricks');\n if (existsSync(bricksSrc)) {\n cpSync(bricksSrc, join(outDir, 'bricks'), { recursive: true });\n written.push(join(outDir, 'bricks'));\n }\n // OKF docs bundle (generated per-config) → outDir/docs.\n const docs = generateDocs(ds, assetsDir);\n for (const [rel, content] of Object.entries(docs)) put(join('docs', rel), content);\n }\n\n return { format, outDir, written };\n}\n","/**\n * Company / site-level configuration schema — the umbrella around a\n * `design-system.json`-compliant `designSystem`.\n *\n * Authored with `zod/mini` (same instance the design-system schema uses), so the\n * two compose: `DesignSystemSchema` is embedded as `designSystem.<theme>` and the\n * whole thing serialises to one JSON Schema via `z.toJSONSchema`. Everything a\n * generator needs derives from here: the `SiteConfig` type (`z.infer`), the\n * published JSON Schema (`siteJsonSchema`), and runtime validation (`validateSite`).\n *\n * Pure: no YAML/env/fs. `resolveSiteConfig` takes an already-parsed object; a\n * thin loader (reading YAML, injecting `SITE_ENV`) lives outside this module.\n */\nimport * as z from 'zod/mini';\nimport { DesignSystemPatchSchema, type DesignSystem } from './schema.ts';\n\n// ── Primitives ────────────────────────────────────────────────────────────────\n\n/** A string, or a per-locale map of strings (`{ en: \"…\", fr: \"…\" }`). */\nconst LocalizableSchema = z.union([z.string(), z.record(z.string(), z.string())]);\n\nconst ImageRefSchema = z.union([\n z.string(),\n z.object({\n src: z.string(),\n alt: z.string(),\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n }),\n]);\n\n// Attribute bags on generated HTML — constrained to serialisable scalars so the\n// exported JSON Schema still offers validation (vs. an opaque `unknown`).\nconst AttrValue = z.union([z.string(), z.number(), z.boolean()]);\nconst AttrsSchema = z.optional(z.record(z.string(), AttrValue));\n\nconst IsoDate = z.string().check(z.regex(/^\\d{4}-\\d{2}-\\d{2}$/)); // YYYY-MM-DD\nconst Iso4217 = z.string().check(z.regex(/^[A-Z]{3}$/)); // currency code\nconst DayOfWeek = z.enum([\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n 'Sunday',\n]);\n\n// ── Design system (named-theme map) ─────────────────────────────────────────────\n// Each entry is a full `DesignSystem` plus a localised `displayName` and an\n// optional `extends` (another entry's key). Entries are lenient (all top-level\n// fields optional) so an extending entry can be a partial patch; the resolved\n// theme is validated against the full `DesignSystemSchema` by `resolveTheme`.\n\nconst DesignSystemEntry = z.extend(DesignSystemPatchSchema, {\n displayName: z.optional(LocalizableSchema),\n extends: z.optional(z.string()),\n});\n\n// ── Locales ─────────────────────────────────────────────────────────────────────\n\nconst LocaleSchema = z.object({\n name: z.string(),\n tagline: z.optional(z.string()),\n basePath: z.optional(z.string()),\n});\n\n// ── Domains ─────────────────────────────────────────────────────────────────────\n\nconst HttpRedirect = z.union([z.literal(301), z.literal(302), z.literal(307), z.literal(308)]);\n\nconst DomainAliasSchema = z.object({\n domain: z.string(),\n redirectType: HttpRedirect,\n redirectTo: z.string(),\n environment: z.optional(z.string()),\n});\n\n// ── Contact / address (schema.org-aligned) ──────────────────────────────────────\n\n/** schema.org `PostalAddress` field names, so JSON-LD generation is lossless. */\nconst PostalAddressSchema = z.object({\n streetAddress: z.string(),\n addressLocality: z.string(), // city\n addressRegion: z.optional(z.string()), // state/province\n postalCode: z.optional(z.string()),\n addressCountry: z.string(), // ISO 3166-1 alpha-2 preferred\n});\n\nconst ContactObjectSchema = z.object({\n name: z.optional(z.string()),\n email: z.optional(z.email()),\n phone: z.optional(z.string()),\n address: z.optional(PostalAddressSchema),\n});\n\n// contact is either a string (location key reference) or an inline object\nconst ContactConfigSchema = z.union([z.string(), ContactObjectSchema]);\n\n// ── Locations (schema.org LocalBusiness) ────────────────────────────────────────\n\nconst GeoSchema = z.object({\n latitude: z.number().check(z.gte(-90), z.lte(90)),\n longitude: z.number().check(z.gte(-180), z.lte(180)),\n});\n\n/** schema.org `OpeningHoursSpecification` — per-day open/close (24h `HH:MM`). */\nconst OpeningHoursSchema = z.object({\n dayOfWeek: z.array(DayOfWeek),\n opens: z.string().check(z.regex(/^\\d{2}:\\d{2}$/)),\n closes: z.string().check(z.regex(/^\\d{2}:\\d{2}$/)),\n});\n\n// Common schema.org LocalBusiness subtypes (extend as needed).\nconst LocalBusinessType = z.enum([\n 'LocalBusiness',\n 'Store',\n 'Restaurant',\n 'CafeOrCoffeeShop',\n 'ProfessionalService',\n 'MedicalBusiness',\n 'HealthAndBeautyBusiness',\n 'HomeAndConstructionBusiness',\n 'AutomotiveBusiness',\n 'FinancialService',\n 'LegalService',\n 'RealEstateAgent',\n 'Organization',\n]);\n\nconst LocationSchema = z.object({\n slug: z.optional(LocalizableSchema),\n name: LocalizableSchema,\n email: z.optional(z.email()),\n phone: z.optional(z.string()),\n address: z.optional(PostalAddressSchema),\n geo: z.optional(GeoSchema),\n hours: z.optional(z.array(OpeningHoursSchema)),\n type: z.optional(LocalBusinessType),\n description: z.optional(LocalizableSchema),\n areaServed: z.optional(z.array(z.string())),\n priceRange: z.optional(z.string()),\n paymentAccepted: z.optional(z.array(z.string())),\n currenciesAccepted: z.optional(Iso4217),\n knowsLanguage: z.optional(z.array(z.string())),\n});\n\n// ── Organization (schema.org Organization) ──────────────────────────────────────\n\nconst OrganizationSchema = z.object({\n name: z.optional(LocalizableSchema),\n legalName: z.optional(z.string()),\n foundingDate: z.optional(IsoDate),\n logo: z.optional(ImageRefSchema),\n email: z.optional(z.email()),\n phone: z.optional(z.string()),\n address: z.optional(PostalAddressSchema),\n taxID: z.optional(z.string()),\n vatID: z.optional(z.string()),\n /** Profile URLs → JSON-LD `sameAs` (mirrors `links`). */\n sameAs: z.optional(z.array(z.url())),\n});\n\n// ── DNS ──────────────────────────────────────────────────────────────────────\n\nconst DnsRecordType = z.enum(['A', 'AAAA', 'CNAME', 'TXT', 'MX', 'NS', 'SRV', 'CAA', 'PTR', 'SOA']);\n\nconst DnsRecordSchema = z.object({\n type: DnsRecordType,\n name: z.optional(z.string()),\n value: z.string(),\n ttl: z.optional(z.number().check(z.int(), z.positive())),\n proxied: z.optional(z.boolean()),\n});\n\nconst DnsDomainSchema = z.object({\n provider: z.optional(z.string()),\n nameservers: z.optional(z.array(z.string())),\n records: z.optional(z.array(DnsRecordSchema)),\n});\n\n// ── Environments ──────────────────────────────────────────────────────────────\n\nconst RobotsSchema = z.string(); // e.g. \"index,follow\" / \"noindex,nofollow\"\n\nconst EnvironmentSchema = z.object({\n url: z.url(),\n api: z.optional(z.url()),\n analytics: z.optional(z.boolean()),\n robots: z.optional(RobotsSchema),\n variant: z.optional(z.string()),\n});\n\n// ── A/B testing ─────────────────────────────────────────────────────────────────\n\nconst AbVariantSchema = z.object({\n environment: z.string(),\n description: z.optional(z.string()),\n // Deliberate escape hatch: overrides are deep-merged into the raw config\n // before validation, so their shape is the config's own.\n overrides: z.optional(z.record(z.string(), z.unknown())),\n});\n\n// ── Fonts (Astro Fonts API projection) ──────────────────────────────────────────\n// Font *loading* — a serialisable projection of Astro's `fonts:[…]` config. A\n// loader maps `provider` (string) → `fontProviders.<name>()`. Distinct from the\n// design-system font *tokens* (`designSystem.<theme>.fonts` / typography.families),\n// which reference the same `cssVariable`.\n\nconst FontProvider = z.enum([\n 'google',\n 'fontsource',\n 'adobe',\n 'bunny',\n 'fontshare',\n 'googleicons',\n 'npm',\n 'local',\n]);\nconst FontStyle = z.enum(['normal', 'italic']);\nconst FontDisplay = z.enum(['auto', 'block', 'swap', 'fallback', 'optional']);\nconst FontWeight = z.union([z.number(), z.string()]); // discrete, or a variable range like \"100 900\"\n\n/** A local-font face (`provider: 'local'`). */\nconst FontVariantSchema = z.object({\n src: z.array(z.string()),\n weight: z.optional(FontWeight),\n style: z.optional(FontStyle),\n unicodeRange: z.optional(z.array(z.string())),\n display: z.optional(FontDisplay),\n});\n\nconst FontSchema = z.object({\n name: z.string(),\n provider: FontProvider,\n cssVariable: z.string().check(z.regex(/^--/)),\n weights: z.optional(z.array(FontWeight)),\n styles: z.optional(z.array(FontStyle)),\n subsets: z.optional(z.array(z.string())),\n fallbacks: z.optional(z.array(z.string())),\n optimizedFallbacks: z.optional(z.boolean()),\n display: z.optional(FontDisplay),\n formats: z.optional(z.array(z.string())),\n unicodeRange: z.optional(z.array(z.string())),\n variants: z.optional(z.array(FontVariantSchema)), // local provider\n /** Emit `<Font preload />` for this family. */\n preload: z.optional(\n z.union([z.boolean(), z.array(z.object({ weight: FontWeight, style: z.optional(FontStyle) }))]),\n ),\n});\n\n// ── Templates (nav / form / nodes) ──────────────────────────────────────────────\n\nconst PresentSchema = z.optional(z.record(z.string(), z.unknown()));\n\nconst NavItemSchema: z.ZodMiniType = z.object({\n label: z.optional(LocalizableSchema),\n image: z.optional(ImageRefSchema),\n href: z.optional(z.string()),\n icon: z.optional(z.string()),\n attrs: AttrsSchema,\n itemAttrs: AttrsSchema,\n submenu: z.optional(\n z.object({\n present: PresentSchema,\n get items() {\n return z.optional(z.array(NavItemSchema));\n },\n }),\n ),\n});\n\nconst FormFieldType = z.enum([\n 'text',\n 'email',\n 'tel',\n 'url',\n 'number',\n 'password',\n 'textarea',\n 'select',\n 'checkbox',\n 'radio',\n 'date',\n 'file',\n 'hidden',\n]);\n\nconst FormFieldSchema = z.object({\n name: z.string(),\n type: FormFieldType,\n label: z.optional(LocalizableSchema),\n required: z.optional(z.boolean()),\n validation: z.optional(z.string()), // regex source or named rule\n options: z.optional(\n z.union([z.string(), z.array(z.object({ label: z.string(), value: z.string() }))]),\n ),\n attrs: AttrsSchema,\n});\n\nconst ContentNodeSchema: z.ZodMiniType = z.object({\n tag: z.string(),\n attrs: AttrsSchema,\n text: z.optional(z.string()),\n get children() {\n return z.optional(z.array(ContentNodeSchema));\n },\n});\n\nconst TemplateSchema = z.union([\n z.object({\n type: z.literal('nav'),\n tags: z.optional(z.array(z.string())),\n present: PresentSchema,\n items: z.optional(z.array(NavItemSchema)),\n }),\n z.object({\n type: z.literal('form'),\n tags: z.optional(z.array(z.string())),\n present: PresentSchema,\n action: z.optional(z.string()),\n method: z.optional(z.enum(['get', 'post'])),\n fields: z.optional(z.array(FormFieldSchema)),\n submit: z.optional(z.record(z.string(), AttrValue)),\n honeypot: z.optional(z.boolean()),\n }),\n z.object({\n type: z.literal('nodes'),\n tags: z.optional(z.array(z.string())),\n nodes: z.optional(z.array(ContentNodeSchema)),\n }),\n]);\n\n// ── Galleries / testimonials ────────────────────────────────────────────────────\n\nconst GalleryImageSchema = z.object({\n src: z.string(),\n alt: LocalizableSchema,\n caption: z.optional(LocalizableSchema),\n});\n\nconst GallerySchema = z.object({\n title: z.optional(LocalizableSchema),\n tags: z.optional(z.array(z.string())),\n images: z.array(GalleryImageSchema),\n});\n\nconst TestimonialItemSchema = z.object({\n quote: LocalizableSchema,\n name: z.string(),\n role: z.optional(z.string()),\n rating: z.optional(z.number().check(z.gte(0), z.lte(5))),\n date: z.optional(IsoDate),\n});\n\nconst TestimonialGroupSchema = z.object({\n title: z.optional(LocalizableSchema),\n items: z.array(TestimonialItemSchema),\n});\n\n// ── Services (schema.org Offer) ─────────────────────────────────────────────────\n\nconst OfferSchema = z.object({\n name: z.optional(LocalizableSchema),\n price: z.optional(z.union([z.string(), z.number()])),\n priceCurrency: z.optional(Iso4217),\n availability: z.optional(z.string()),\n url: z.optional(z.url()),\n validFrom: z.optional(IsoDate),\n priceValidUntil: z.optional(IsoDate),\n});\n\nconst ServiceSchema = z.object({\n name: LocalizableSchema,\n description: z.optional(LocalizableSchema),\n slug: z.optional(LocalizableSchema),\n offers: z.optional(z.array(OfferSchema)),\n});\n\n// ── SEO / social ─────────────────────────────────────────────────────────────\n\nconst OpenGraphSchema = z.object({\n type: z.optional(z.string()),\n siteName: z.optional(z.string()),\n title: z.optional(LocalizableSchema),\n description: z.optional(LocalizableSchema),\n image: z.optional(ImageRefSchema),\n locale: z.optional(z.string()),\n});\n\nconst TwitterSchema = z.object({\n card: z.optional(z.enum(['summary', 'summary_large_image', 'app', 'player'])),\n site: z.optional(z.string()),\n creator: z.optional(z.string()),\n title: z.optional(LocalizableSchema),\n description: z.optional(LocalizableSchema),\n image: z.optional(ImageRefSchema),\n});\n\n// ── Top-level schema ────────────────────────────────────────────────────────────\n\nexport const SiteConfigSchema = z.object({\n defaultLocale: z.string(),\n locales: z.record(z.string(), LocaleSchema),\n organization: z.optional(OrganizationSchema),\n contact: z.optional(ContactConfigSchema),\n domains: z.optional(\n z.object({\n canonical: z.url(),\n aliases: z.optional(z.array(DomainAliasSchema)),\n }),\n ),\n primaryLocation: z.optional(z.string()),\n locations: z.optional(z.record(z.string(), LocationSchema)),\n services: z.optional(z.record(z.string(), ServiceSchema)),\n links: z.optional(\n z.object({\n googleMaps: z.optional(z.url()),\n instagram: z.optional(z.url()),\n facebook: z.optional(z.url()),\n x: z.optional(z.url()),\n linkedin: z.optional(z.url()),\n youtube: z.optional(z.url()),\n github: z.optional(z.url()),\n }),\n ),\n dns: z.optional(z.record(z.string(), DnsDomainSchema)),\n // Deliberate escape hatch — provider-specific, out of scope to model here.\n cloudflare: z.optional(z.record(z.string(), z.unknown())),\n environments: z.record(z.string(), EnvironmentSchema),\n abTesting: z.optional(\n z.object({\n enabled: z.boolean(),\n cookieName: z.optional(z.string()),\n cookieMaxAge: z.optional(z.number().check(z.int(), z.positive())),\n splitRatio: z.optional(z.number().check(z.gte(0), z.lte(1))),\n variants: z.optional(z.record(z.string(), AbVariantSchema)),\n }),\n ),\n\n // Design system: named-theme map. `default` is the base; other entries may\n // `extends` another and supply a partial patch. Light/dark is automatic\n // (functional tokens flip per appearance), not a separate theme entry.\n designSystem: z.record(z.string(), DesignSystemEntry),\n defaultTheme: z.optional(z.string()), // convention: \"default\"\n defaultColorScheme: z.optional(z.enum(['light', 'dark'])), // initial appearance to render\n respectSystemPreference: z.optional(z.boolean()),\n\n // Font *loading* (Astro Fonts API). Font *tokens* live in `designSystem`.\n fonts: z.optional(z.array(FontSchema)),\n\n tags: z.optional(z.record(z.string(), z.unknown())),\n postTypes: z.optional(z.record(z.string(), z.unknown())),\n galleries: z.optional(z.record(z.string(), GallerySchema)),\n testimonials: z.optional(z.record(z.string(), TestimonialGroupSchema)),\n templates: z.optional(z.record(z.string(), TemplateSchema)),\n navigation: z.optional(\n z.object({\n activeTemplate: z.optional(\n z.object({\n default: z.optional(z.string()),\n breakpoints: z.optional(z.record(z.string(), z.string())),\n }),\n ),\n }),\n ),\n seo: z.optional(\n z.object({\n titleTemplate: z.optional(z.string()),\n descriptionTemplate: z.optional(z.string()),\n robots: z.optional(RobotsSchema),\n googleSiteVerification: z.optional(z.string()),\n bingSiteVerification: z.optional(z.string()),\n openGraph: z.optional(OpenGraphSchema),\n twitter: z.optional(TwitterSchema),\n }),\n ),\n analytics: z.optional(\n z.object({\n googleAnalyticsId: z.optional(z.string()),\n plausibleDomain: z.optional(z.string()),\n googleTagManagerId: z.optional(z.string()),\n }),\n ),\n notifications: z.optional(z.object({ email: z.optional(z.email()) })),\n tracking: z.optional(\n z.object({\n enabled: z.optional(z.boolean()),\n platforms: z.optional(z.array(z.string())),\n }),\n ),\n security: z.optional(\n z.object({\n turnstile: z.optional(z.object({ siteKey: z.optional(z.string()) })),\n }),\n ),\n legal: z.optional(\n z.object({\n privacyPolicy: z.optional(\n z.object({\n enabled: z.boolean(),\n url: z.optional(z.url()),\n lastUpdated: z.optional(IsoDate),\n }),\n ),\n termsOfService: z.optional(\n z.object({\n enabled: z.boolean(),\n url: z.optional(z.url()),\n lastUpdated: z.optional(z.nullable(IsoDate)),\n }),\n ),\n cookieConsent: z.optional(\n z.object({\n enabled: z.boolean(),\n type: z.optional(z.enum(['opt-in', 'opt-out'])),\n position: z.optional(z.enum(['top', 'bottom', 'center'])),\n categories: z.optional(z.array(z.string())),\n }),\n ),\n }),\n ),\n icons: z.optional(\n z.object({\n ui: z.optional(z.string()),\n brand: z.optional(z.string()),\n semantic: z.optional(z.array(z.string())),\n 'fa7-solid': z.optional(z.array(z.string())),\n 'fa7-regular': z.optional(z.array(z.string())),\n 'fa7-light': z.optional(z.array(z.string())),\n 'fa7-thin': z.optional(z.array(z.string())),\n 'fa7-brands': z.optional(z.array(z.string())),\n 'simple-icons': z.optional(z.array(z.string())),\n 'material-symbols': z.optional(z.array(z.string())),\n lucide: z.optional(z.array(z.string())),\n }),\n ),\n favicon: z.optional(\n z.object({\n source: z.string(),\n lowResSource: z.optional(z.string()),\n /** App name for the generated web manifest / PWA. */\n name: z.optional(z.string()),\n /** PWA theme color (also `<meta name=\"theme-color\">`). */\n themeColor: z.optional(z.string()),\n /** PWA background color. */\n backgroundColor: z.optional(z.string()),\n }),\n ),\n deployment: z.optional(\n z.object({\n platform: z.optional(z.string()),\n buildCommand: z.optional(z.string()),\n deployCommand: z.optional(z.string()),\n outputDirectory: z.optional(z.string()),\n type: z.optional(z.string()),\n }),\n ),\n});\n\nexport type SiteConfig = z.infer<typeof SiteConfigSchema>;\n\n// ── JSON Schema + validation ────────────────────────────────────────────────────\n\nexport const SITE_SCHEMA_URL = 'https://unpkg.com/@getvitops/generator/site.schema.json';\n\n/** The published JSON Schema (draft-2020-12), derived from the zod schema. */\nexport const siteJsonSchema = {\n $id: SITE_SCHEMA_URL,\n ...z.toJSONSchema(SiteConfigSchema, { target: 'draft-2020-12' }),\n};\n\nexport type SiteValidationResult =\n | { ok: true; data: SiteConfig; errors: [] }\n | { ok: false; data: undefined; errors: z.core.$ZodIssue[] };\n\ntype Issue = z.core.$ZodIssue;\nconst issue = (path: (string | number)[], message: string): Issue =>\n ({ code: 'custom', path, message }) as Issue;\n\n/**\n * Validate a raw (already parsed) config: shape via zod, then the cross-field\n * integrity that JSON Schema can't express (referential keys, extends acyclicity).\n * These live only here — the published JSON Schema enforces shape, not integrity.\n */\nexport function validateSite(input: unknown): SiteValidationResult {\n const parsed = z.safeParse(SiteConfigSchema, input);\n if (!parsed.success) return { ok: false, data: undefined, errors: parsed.error.issues };\n const cfg = parsed.data;\n const errors: Issue[] = [];\n const has = (m: Record<string, unknown> | undefined, k: string) => !!m && k in m;\n\n if (!has(cfg.locales, cfg.defaultLocale))\n errors.push(issue(['defaultLocale'], `defaultLocale \"${cfg.defaultLocale}\" is not in locales`));\n\n if (!has(cfg.designSystem, 'default') && cfg.defaultTheme == null)\n errors.push(issue(['designSystem'], 'designSystem must include a \"default\" theme'));\n\n if (cfg.defaultTheme != null && !has(cfg.designSystem, cfg.defaultTheme))\n errors.push(\n issue(['defaultTheme'], `defaultTheme \"${cfg.defaultTheme}\" is not in designSystem`),\n );\n\n for (const [key, entry] of Object.entries(cfg.designSystem)) {\n if (entry.extends != null && !has(cfg.designSystem, entry.extends))\n errors.push(\n issue(\n ['designSystem', key, 'extends'],\n `extends \"${entry.extends}\" is not a designSystem key`,\n ),\n );\n }\n // extends acyclicity + each resolved theme is a complete DesignSystem\n for (const key of Object.keys(cfg.designSystem)) {\n try {\n resolveTheme(cfg.designSystem as Record<string, DesignSystemEntryT>, key);\n } catch (e) {\n errors.push(issue(['designSystem', key], (e as Error).message));\n }\n }\n\n if (cfg.primaryLocation != null && !has(cfg.locations, cfg.primaryLocation))\n errors.push(\n issue(['primaryLocation'], `primaryLocation \"${cfg.primaryLocation}\" is not in locations`),\n );\n if (typeof cfg.contact === 'string' && !has(cfg.locations, cfg.contact))\n errors.push(issue(['contact'], `contact \"${cfg.contact}\" is not a locations key`));\n\n for (const [name, v] of Object.entries(cfg.abTesting?.variants ?? {}))\n if (!has(cfg.environments, v.environment))\n errors.push(\n issue(\n ['abTesting', 'variants', name, 'environment'],\n `environment \"${v.environment}\" is not in environments`,\n ),\n );\n for (const [i, a] of (cfg.domains?.aliases ?? []).entries())\n if (a.environment != null && !has(cfg.environments, a.environment))\n errors.push(\n issue(\n ['domains', 'aliases', i, 'environment'],\n `environment \"${a.environment}\" is not in environments`,\n ),\n );\n\n const templates = cfg.templates;\n const at = cfg.navigation?.activeTemplate;\n if (at?.default != null && !has(templates, at.default))\n errors.push(\n issue(\n ['navigation', 'activeTemplate', 'default'],\n `template \"${at.default}\" is not in templates`,\n ),\n );\n for (const [bp, tpl] of Object.entries(at?.breakpoints ?? {}))\n if (!has(templates, tpl))\n errors.push(\n issue(\n ['navigation', 'activeTemplate', 'breakpoints', bp],\n `template \"${tpl}\" is not in templates`,\n ),\n );\n\n if (errors.length) return { ok: false, data: undefined, errors };\n return { ok: true, data: cfg, errors: [] };\n}\n\n// ── Theme resolution (extends) ──────────────────────────────────────────────────\n\ntype DesignSystemEntryT = Partial<DesignSystem> & { displayName?: unknown; extends?: string };\n\n/**\n * Resolve a design-system theme by following its `extends` chain and deep-merging\n * base → child (child wins; arrays replace wholesale, correct for token overrides).\n * Throws on unknown keys or an `extends` cycle. The result is a plain\n * `DesignSystem` (validate it against `DesignSystemSchema` for completeness).\n */\nexport function resolveTheme(\n designSystem: Record<string, DesignSystemEntryT>,\n key: string,\n): DesignSystem {\n const chain: DesignSystemEntryT[] = [];\n const seen = new Set<string>();\n let cur: string | undefined = key;\n while (cur != null) {\n if (seen.has(cur)) throw new Error(`extends cycle in designSystem at \"${cur}\"`);\n seen.add(cur);\n const entry: DesignSystemEntryT | undefined = designSystem[cur];\n if (entry == null) throw new Error(`designSystem theme \"${cur}\" not found`);\n chain.unshift(entry);\n cur = entry.extends;\n }\n const out: Record<string, unknown> = {};\n for (const entry of chain) {\n const { extends: _e, displayName: _d, ...ds } = entry;\n deepMerge(out, ds as Record<string, unknown>);\n }\n return out as DesignSystem;\n}\n\n/**\n * Resolve a raw (already-parsed) config into a validated `SiteConfig`:\n * 1. strip YAML nulls,\n * 2. apply the active A/B variant's `overrides` (by `siteEnv`),\n * 3. normalise a bare-`DesignSystem` `designSystem` shorthand to `{ default: … }`,\n * 4. validate (shape + cross-field).\n * Pure — no YAML/env access. A loader supplies `siteEnv`.\n */\nexport function resolveSiteConfig(input: unknown, siteEnv = 'production'): SiteConfig {\n const raw = stripNulls(input) as Record<string, unknown>;\n\n const envConfig = (raw.environments as Record<string, { variant?: string }> | undefined)?.[\n siteEnv\n ];\n if (envConfig?.variant) {\n const overrides = (\n raw.abTesting as { variants?: Record<string, { overrides?: Record<string, unknown> }> }\n )?.variants?.[envConfig.variant]?.overrides;\n if (overrides) deepMerge(raw, overrides);\n }\n\n // Shorthand: a bare DesignSystem (has `colors`) → { default: … }.\n const ds = raw.designSystem as Record<string, unknown> | undefined;\n if (ds != null && 'colors' in ds) raw.designSystem = { default: ds };\n\n const result = validateSite(raw);\n if (!result.ok) {\n const msg = result.errors.map((e) => ` ${e.path.join('.')}: ${e.message}`).join('\\n');\n throw new Error(`Invalid site config:\\n${msg}`);\n }\n return result.data;\n}\n\n// ── Helpers ─────────────────────────────────────────────────────────────────────\n\n/** Strip nulls (YAML `~`/`null`) → undefined so optional fields validate. */\nexport function stripNulls(obj: unknown): unknown {\n if (obj === null) return undefined;\n if (Array.isArray(obj)) return obj.map(stripNulls);\n if (obj && typeof obj === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n const stripped = stripNulls(value);\n if (stripped !== undefined) result[key] = stripped;\n }\n return result;\n }\n return obj;\n}\n\n/** Deep-merge `source` into `target` (in place). Arrays replace wholesale. */\nexport function deepMerge(target: Record<string, unknown>, source: Record<string, unknown>) {\n for (const key of Object.keys(source)) {\n const s = source[key];\n const t = target[key];\n if (\n s &&\n typeof s === 'object' &&\n !Array.isArray(s) &&\n t &&\n typeof t === 'object' &&\n !Array.isArray(t)\n ) {\n deepMerge(t as Record<string, unknown>, s as Record<string, unknown>);\n } else {\n target[key] = s;\n }\n }\n}\n","/**\n * @getvitops/generator — public API.\n *\n * Turn a `design-system.json` into platform outputs (Bricks, standalone CSS,\n * Tailwind v4). The `zod/mini` schema is the single source of truth: types,\n * validation, and the published JSON Schema all derive from it.\n */\nexport { generate } from './generate.ts';\nexport type { GenerateOptions, GenerateResult, Format } from './generate.ts';\n\nexport { generateDocs } from './docs.ts';\n\nexport { DesignSystemSchema, jsonSchema, SCHEMA_URL, validate } from './schema.ts';\nexport type { DesignSystem, ValidationResult } from './schema.ts';\nexport {\n SiteConfigSchema,\n siteJsonSchema,\n SITE_SCHEMA_URL,\n validateSite,\n resolveSiteConfig,\n resolveTheme,\n stripNulls,\n deepMerge,\n} from './site.ts';\nexport type { SiteConfig, SiteValidationResult } from './site.ts';\n\nimport { SCHEMA_URL, type DesignSystem } from './schema.ts';\n\n/**\n * A minimal but complete starter design system, used by `vitops init`. It\n * validates against the schema and generates real output in every format, so a\n * new project can `vitops generate` immediately and then tune from here.\n */\nexport function defaultConfig(): DesignSystem {\n return {\n $schema: SCHEMA_URL,\n colors: {\n // Each hue is generated as an 11-step OKLCH scale from its seed.\n palette: {\n brand: { seed: '#2e9b73' },\n ink: { seed: '#3f4a5c' },\n sky: { seed: '#2f7bc0' },\n sun: { seed: '#d08a1f' },\n rose: { seed: '#c74a42' },\n },\n // role → hue. Functional tokens (bg/text/solid/on-solid/…) derive from\n // the hue's scale; dark mode flips automatically.\n roles: {\n neutral: 'ink',\n surface: 'ink',\n 'ui-primary': 'brand',\n 'brand-primary': 'brand',\n info: 'sky',\n success: 'brand',\n warning: 'sun',\n danger: 'rose',\n },\n utilities: ['bg', 'text', 'border'],\n },\n shadows: {\n sm: '0 1px 2px rgb(0 0 0 / 0.08)',\n md: '0 4px 6px rgb(0 0 0 / 0.12)',\n lg: '0 10px 15px rgb(0 0 0 / 0.18)',\n },\n fonts: {\n display: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n sans: 'system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif',\n mono: 'ui-monospace, \"SF Mono\", Menlo, monospace',\n },\n typeScale: {\n base: '1rem',\n names: ['2xs', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'],\n baseStep: 4,\n baseline: 'm',\n ratio: 1.2,\n fluid: { minVw: '22.5rem', maxVw: '80rem', minRatio: 1.12 },\n },\n spaceScale: {\n base: '1rem',\n names: ['2xs', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'],\n baseStep: 4,\n baseline: 'm',\n ratio: 1.25,\n fluid: { minVw: '22.5rem', maxVw: '80rem', minRatio: 1.2 },\n },\n patterns: {\n defaults: {\n ds: 'none',\n b: '1px solid var(--color-surface-xl)',\n br: '0.375rem',\n p: '1rem',\n fs: '1rem',\n },\n radii: { pill: '999px', circle: '50%', card: '0.5rem' },\n groups: {\n control: {\n ds: 'var(--ds-default)',\n b: 'var(--b-default)',\n br: 'var(--br-default)',\n p: '0.5em 1em',\n fs: 'var(--fs-default)',\n },\n panel: {\n ds: 'var(--shadow-md)',\n b: 'var(--b-default)',\n br: '0.5rem',\n p: '1rem',\n fs: 'var(--fs-default)',\n },\n },\n z: { raised: 1, sticky: 100, overlay: 200, top: 1000 },\n items: {\n button: {\n group: 'control',\n element: 'button',\n default_role: 'brand-primary',\n base: {\n padding: '0.6em 1.2em',\n 'border-radius': 'var(--br-control, 0.25rem)',\n border: 'none',\n 'font-weight': '600',\n color: '#fff',\n cursor: 'pointer',\n 'box-shadow': 'var(--shadow-sm)',\n },\n states: { hover: { step: 1 }, active: { scale: 0.97 }, 'focus-visible': { ring: true } },\n roles: [],\n },\n card: {\n group: 'panel',\n class: 'card',\n base: {\n 'border-radius': 'var(--br-card-group)',\n padding: '1.5rem',\n background: 'var(--color-surface-xxl)',\n border: 'var(--b-card-group)',\n 'box-shadow': 'var(--ds-card-group)',\n },\n states: {},\n roles: [],\n },\n },\n },\n typography: {\n families: {\n display: 'var(--font-display)',\n sans: 'var(--font-sans)',\n code: 'var(--font-mono, ui-monospace, monospace)',\n },\n roles: {\n display: {\n family: 'display',\n size: 'var(--text-3xl)',\n weight: 700,\n 'line-height': '1.05',\n tracking: '-0.03em',\n },\n heading: { family: 'display', size: 'var(--text-xl)', weight: 600, 'line-height': '1.3' },\n body: { family: 'sans', size: 'var(--text-m)', weight: 400, 'line-height': '1.55' },\n },\n headings: { h1: 'display', h2: 'heading', h3: 'heading' },\n },\n animations: {\n effects: {\n 'fade-in': { kf: 'composite', vars: { 'opacity-from': 0 } },\n 'slide-up': {\n kf: 'composite',\n vars: { 'translate-y-from': 'var(--slide-distance, 2rem)' },\n },\n },\n journeys: {\n base: { fade: { 'opacity-from': 0 }, slide: {} },\n compose: [['fade'], ['slide'], ['fade', 'slide']],\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAM,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;AAEhD,MAAM,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAC/C,MAAM,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM;AAQ1C,MAAM,aAAa,EAAE,OAAO;CAC1B,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AACD,MAAM,YAAY,EAAE,OAAO,EACzB,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EACxE,CAAC;AACD,MAAM,OAAO,E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AAU;EAC1D;EACA,YAAY;GACV,SAAS;IACP,WAAW;KAAE,IAAI;KAAa,MAAM,EAAE,gBAAgB,EAAE;IAAE;IAC1D,YAAY;KACV,IAAI;KACJ,MAAM,EAAE,oBAAoB,8BAA8B;IAC5D;GACF;GACA,UAAU;IACR,MAAM;KAAE,MAAM,EAAE,gBAAgB,EAAE;KAAG,OAAO,CAAC;IAAE;IAC/C,SAAS;KAAC,CAAC,MAAM;KAAG,CAAC,OAAO;KAAG,CAAC,QAAQ,OAAO;IAAC;GAClD;EACF;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getvitops/generator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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.2.
|
|
29
|
+
"@getvitops/utils": "0.2.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"vitest": "^4.1.9",
|
|
33
|
-
"@getvitops/core": "0.2.
|
|
33
|
+
"@getvitops/core": "0.2.1"
|
|
34
34
|
}
|
|
35
35
|
}
|