@getvitops/generator 8.1.0 → 8.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +352 -17
- package/assets/js/consent.js +1 -1
- package/assets/js/deferred.js +1 -1
- package/assets/js/editor.js +2 -2
- package/assets/js/elements.js +4 -4
- package/assets/js/polyfills/adoptedStyleSheets.js +1 -1
- package/assets/js/polyfills/css-anchor-positioning-fn.js +4 -4
- package/assets/js/polyfills/global.esm.js +1 -1
- package/assets/js/polyfills/invokers-polyfill.js +1 -1
- package/assets/js/polyfills/popover.js +2 -2
- package/assets/js/polyfills/webcomponents-bundle.js +9 -9
- package/config.schema.json +333 -118
- package/dist/config-DvbYx3Gi.mjs +1971 -0
- package/dist/config-DvbYx3Gi.mjs.map +1 -0
- package/dist/config.d.mts +2544 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +3 -0
- package/dist/icons-sprite-Bf_KmKeX.d.mts +267 -0
- package/dist/icons-sprite-Bf_KmKeX.d.mts.map +1 -0
- package/dist/icons-sprite.d.mts +2 -0
- package/dist/icons-sprite.mjs +129 -0
- package/dist/icons-sprite.mjs.map +1 -0
- package/dist/index.d.mts +57 -2854
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +93 -2386
- package/dist/index.mjs.map +1 -1
- package/dist/schema-Dmq1J7S3.d.mts +292 -0
- package/dist/schema-Dmq1J7S3.d.mts.map +1 -0
- package/dist/tokens-8SXMDAd1.d.mts +229 -0
- package/dist/tokens-8SXMDAd1.d.mts.map +1 -0
- package/dist/tokens-zi594IZ3.mjs +697 -0
- package/dist/tokens-zi594IZ3.mjs.map +1 -0
- package/dist/tokens.d.mts +2 -0
- package/dist/tokens.mjs +3 -0
- package/package.json +17 -5
- package/schema.json +12 -28
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import * as z from "@zod/mini";
|
|
2
|
+
//#region src/schema.d.ts
|
|
3
|
+
declare const DesignSystemSchema: z.ZodMiniObject<{
|
|
4
|
+
$schema: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
meta: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
6
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
7
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
|
+
}, z.core.$strict>>;
|
|
9
|
+
colors: z.ZodMiniObject<{
|
|
10
|
+
palette: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
11
|
+
seed: z.ZodMiniString<string>;
|
|
12
|
+
anchors: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
13
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
14
|
+
tones: z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniString<string>>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>]>;
|
|
15
|
+
}, z.core.$strict>]>>;
|
|
16
|
+
roles: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
17
|
+
hue: z.ZodMiniString<string>;
|
|
18
|
+
kind: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
19
|
+
surface: "surface";
|
|
20
|
+
chromatic: "chromatic";
|
|
21
|
+
}>>;
|
|
22
|
+
}, z.core.$strict>]>>;
|
|
23
|
+
utilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
|
|
24
|
+
fill: "fill";
|
|
25
|
+
bg: "bg";
|
|
26
|
+
text: "text";
|
|
27
|
+
icon: "icon";
|
|
28
|
+
border: "border";
|
|
29
|
+
outline: "outline";
|
|
30
|
+
stroke: "stroke";
|
|
31
|
+
}>>>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
shadows: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
34
|
+
fonts: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
35
|
+
typeScale: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
36
|
+
base: z.ZodMiniString<string>;
|
|
37
|
+
ratio: z.ZodMiniNumber<number>;
|
|
38
|
+
steps: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
39
|
+
names: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
40
|
+
baseStep: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
41
|
+
baseline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
42
|
+
fluid: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
43
|
+
minVw: z.ZodMiniString<string>;
|
|
44
|
+
maxVw: z.ZodMiniString<string>;
|
|
45
|
+
minRatio: z.ZodMiniNumber<number>;
|
|
46
|
+
}, z.core.$strict>>;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
spaceScale: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
49
|
+
base: z.ZodMiniString<string>;
|
|
50
|
+
ratio: z.ZodMiniNumber<number>;
|
|
51
|
+
steps: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
52
|
+
names: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
53
|
+
baseStep: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
54
|
+
baseline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
55
|
+
fluid: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
56
|
+
minVw: z.ZodMiniString<string>;
|
|
57
|
+
maxVw: z.ZodMiniString<string>;
|
|
58
|
+
minRatio: z.ZodMiniNumber<number>;
|
|
59
|
+
}, z.core.$strict>>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
patterns: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
62
|
+
defaults: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
63
|
+
radii: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
64
|
+
groups: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>>;
|
|
65
|
+
z: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
|
|
66
|
+
items: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
67
|
+
group: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
68
|
+
overrides: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
69
|
+
element: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
70
|
+
class: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
71
|
+
fill: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
72
|
+
default_role: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
73
|
+
base: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
74
|
+
states: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>>;
|
|
75
|
+
roles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
76
|
+
}, z.core.$strict>>>;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
typography: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
79
|
+
families: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
80
|
+
roles: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>>;
|
|
81
|
+
headings: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
82
|
+
}, z.core.$strict>>;
|
|
83
|
+
animations: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
84
|
+
effects: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
85
|
+
kf: z.ZodMiniString<string>;
|
|
86
|
+
css: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
87
|
+
vars: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
88
|
+
}, z.core.$strict>>>;
|
|
89
|
+
journeys: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
90
|
+
base: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>>;
|
|
91
|
+
compose: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniArray<z.ZodMiniString<string>>>>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
type DesignSystem = z.infer<typeof DesignSystemSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* Stable URL of the published JSON Schema. Resolves once `@getvitops/generator` is on
|
|
98
|
+
* npm (unpkg serves the packaged `schema.json`); `vitops init` stamps this into a
|
|
99
|
+
* scaffolded config's `$schema` so editors light up autocomplete + validation.
|
|
100
|
+
*/
|
|
101
|
+
declare const SCHEMA_URL = "https://unpkg.com/@getvitops/generator/schema.json";
|
|
102
|
+
/**
|
|
103
|
+
* What `vitops init` actually stamps into a scaffolded config's `$schema`.
|
|
104
|
+
*
|
|
105
|
+
* A **local** path, following wrangler's `node_modules/wrangler/config-schema.json`.
|
|
106
|
+
* `SCHEMA_URL` has no version in it, so unpkg resolves it to whatever is newest
|
|
107
|
+
* — an editor validating a project pinned to generator 2.x silently checks it
|
|
108
|
+
* against the 3.x schema, reporting errors for valid config and accepting
|
|
109
|
+
* fields that do not exist yet. The installed copy is by definition the one
|
|
110
|
+
* that matches the toolchain doing the building.
|
|
111
|
+
*
|
|
112
|
+
* `SCHEMA_URL` remains the schema's `$id`, which is what it is for.
|
|
113
|
+
*/
|
|
114
|
+
declare const SCHEMA_LOCAL_PATH = "./node_modules/@getvitops/generator/schema.json";
|
|
115
|
+
/** The published JSON Schema (draft-2020-12), derived from the zod schema. */
|
|
116
|
+
declare const jsonSchema: {
|
|
117
|
+
"~standard": z.core.ZodStandardSchemaWithJSON<z.ZodMiniObject<{
|
|
118
|
+
$schema: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
119
|
+
meta: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
120
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
121
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
colors: z.ZodMiniObject<{
|
|
124
|
+
palette: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
125
|
+
seed: z.ZodMiniString<string>;
|
|
126
|
+
anchors: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
127
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
128
|
+
tones: z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniString<string>>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>]>;
|
|
129
|
+
}, z.core.$strict>]>>;
|
|
130
|
+
roles: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
131
|
+
hue: z.ZodMiniString<string>;
|
|
132
|
+
kind: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
133
|
+
surface: "surface";
|
|
134
|
+
chromatic: "chromatic";
|
|
135
|
+
}>>;
|
|
136
|
+
}, z.core.$strict>]>>;
|
|
137
|
+
utilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
|
|
138
|
+
fill: "fill";
|
|
139
|
+
bg: "bg";
|
|
140
|
+
text: "text";
|
|
141
|
+
icon: "icon";
|
|
142
|
+
border: "border";
|
|
143
|
+
outline: "outline";
|
|
144
|
+
stroke: "stroke";
|
|
145
|
+
}>>>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
shadows: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
148
|
+
fonts: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
149
|
+
typeScale: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
150
|
+
base: z.ZodMiniString<string>;
|
|
151
|
+
ratio: z.ZodMiniNumber<number>;
|
|
152
|
+
steps: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
153
|
+
names: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
154
|
+
baseStep: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
155
|
+
baseline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
156
|
+
fluid: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
157
|
+
minVw: z.ZodMiniString<string>;
|
|
158
|
+
maxVw: z.ZodMiniString<string>;
|
|
159
|
+
minRatio: z.ZodMiniNumber<number>;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
}, z.core.$strict>>;
|
|
162
|
+
spaceScale: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
163
|
+
base: z.ZodMiniString<string>;
|
|
164
|
+
ratio: z.ZodMiniNumber<number>;
|
|
165
|
+
steps: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
166
|
+
names: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
167
|
+
baseStep: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
168
|
+
baseline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
169
|
+
fluid: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
170
|
+
minVw: z.ZodMiniString<string>;
|
|
171
|
+
maxVw: z.ZodMiniString<string>;
|
|
172
|
+
minRatio: z.ZodMiniNumber<number>;
|
|
173
|
+
}, z.core.$strict>>;
|
|
174
|
+
}, z.core.$strict>>;
|
|
175
|
+
patterns: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
176
|
+
defaults: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
177
|
+
radii: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
178
|
+
groups: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>>;
|
|
179
|
+
z: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
|
|
180
|
+
items: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
181
|
+
group: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
182
|
+
overrides: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
183
|
+
element: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
184
|
+
class: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
185
|
+
fill: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
186
|
+
default_role: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
187
|
+
base: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
188
|
+
states: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>>;
|
|
189
|
+
roles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
190
|
+
}, z.core.$strict>>>;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
typography: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
193
|
+
families: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
194
|
+
roles: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>>;
|
|
195
|
+
headings: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
animations: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
198
|
+
effects: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
199
|
+
kf: z.ZodMiniString<string>;
|
|
200
|
+
css: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
201
|
+
vars: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
202
|
+
}, z.core.$strict>>>;
|
|
203
|
+
journeys: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
204
|
+
base: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>>;
|
|
205
|
+
compose: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniArray<z.ZodMiniString<string>>>>;
|
|
206
|
+
}, z.core.$strict>>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
}, z.core.$strict>>;
|
|
209
|
+
$schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
|
|
210
|
+
$id: string;
|
|
211
|
+
$anchor?: string;
|
|
212
|
+
$ref?: string;
|
|
213
|
+
$dynamicRef?: string;
|
|
214
|
+
$dynamicAnchor?: string;
|
|
215
|
+
$vocabulary?: Record<string, boolean>;
|
|
216
|
+
$comment?: string;
|
|
217
|
+
$defs?: Record<string, z.core.JSONSchema.JSONSchema>;
|
|
218
|
+
type?: z.core.JSONSchema.SchemaType | z.core.JSONSchema.SchemaType[];
|
|
219
|
+
additionalItems?: z.core.JSONSchema._JSONSchema;
|
|
220
|
+
unevaluatedItems?: z.core.JSONSchema._JSONSchema;
|
|
221
|
+
prefixItems?: z.core.JSONSchema._JSONSchema[];
|
|
222
|
+
items?: z.core.JSONSchema._JSONSchema | z.core.JSONSchema._JSONSchema[];
|
|
223
|
+
contains?: z.core.JSONSchema._JSONSchema;
|
|
224
|
+
additionalProperties?: z.core.JSONSchema._JSONSchema;
|
|
225
|
+
unevaluatedProperties?: z.core.JSONSchema._JSONSchema;
|
|
226
|
+
properties?: Record<string, z.core.JSONSchema._JSONSchema>;
|
|
227
|
+
patternProperties?: Record<string, z.core.JSONSchema._JSONSchema>;
|
|
228
|
+
dependentSchemas?: Record<string, z.core.JSONSchema._JSONSchema>;
|
|
229
|
+
propertyNames?: z.core.JSONSchema._JSONSchema;
|
|
230
|
+
if?: z.core.JSONSchema._JSONSchema;
|
|
231
|
+
then?: z.core.JSONSchema._JSONSchema;
|
|
232
|
+
else?: z.core.JSONSchema._JSONSchema;
|
|
233
|
+
allOf?: z.core.JSONSchema.JSONSchema[];
|
|
234
|
+
anyOf?: z.core.JSONSchema.JSONSchema[];
|
|
235
|
+
oneOf?: z.core.JSONSchema.JSONSchema[];
|
|
236
|
+
not?: z.core.JSONSchema._JSONSchema;
|
|
237
|
+
multipleOf?: number;
|
|
238
|
+
maximum?: number;
|
|
239
|
+
exclusiveMaximum?: number | boolean;
|
|
240
|
+
minimum?: number;
|
|
241
|
+
exclusiveMinimum?: number | boolean;
|
|
242
|
+
maxLength?: number;
|
|
243
|
+
minLength?: number;
|
|
244
|
+
pattern?: string;
|
|
245
|
+
maxItems?: number;
|
|
246
|
+
minItems?: number;
|
|
247
|
+
uniqueItems?: boolean;
|
|
248
|
+
maxContains?: number;
|
|
249
|
+
minContains?: number;
|
|
250
|
+
maxProperties?: number;
|
|
251
|
+
minProperties?: number;
|
|
252
|
+
required?: string[];
|
|
253
|
+
dependentRequired?: Record<string, string[]>;
|
|
254
|
+
enum?: Array<string | number | boolean | null>;
|
|
255
|
+
const?: string | number | boolean | null;
|
|
256
|
+
id?: string;
|
|
257
|
+
title?: string;
|
|
258
|
+
description?: string;
|
|
259
|
+
default?: unknown;
|
|
260
|
+
deprecated?: boolean;
|
|
261
|
+
readOnly?: boolean;
|
|
262
|
+
writeOnly?: boolean;
|
|
263
|
+
nullable?: boolean;
|
|
264
|
+
examples?: unknown[];
|
|
265
|
+
format?: string;
|
|
266
|
+
contentMediaType?: string;
|
|
267
|
+
contentEncoding?: string;
|
|
268
|
+
contentSchema?: z.core.JSONSchema.JSONSchema;
|
|
269
|
+
_prefault?: unknown;
|
|
270
|
+
};
|
|
271
|
+
type ValidationResult = {
|
|
272
|
+
ok: true;
|
|
273
|
+
data: DesignSystem;
|
|
274
|
+
errors: [];
|
|
275
|
+
warnings: string[];
|
|
276
|
+
} | {
|
|
277
|
+
ok: false;
|
|
278
|
+
data: undefined;
|
|
279
|
+
errors: z.core.$ZodIssue[];
|
|
280
|
+
warnings: string[];
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Validate an unknown value against the design-system schema.
|
|
284
|
+
*
|
|
285
|
+
* `warnings` are configurations that parse and generate, but produce output that
|
|
286
|
+
* won't behave as authored — currently only the token-namespace collisions the
|
|
287
|
+
* flat `--<prop>-<name>` grammar makes possible.
|
|
288
|
+
*/
|
|
289
|
+
declare function validate(input: unknown): ValidationResult;
|
|
290
|
+
//#endregion
|
|
291
|
+
export { ValidationResult as a, SCHEMA_URL as i, DesignSystemSchema as n, jsonSchema as o, SCHEMA_LOCAL_PATH as r, validate as s, DesignSystem as t };
|
|
292
|
+
//# sourceMappingURL=schema-Dmq1J7S3.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-Dmq1J7S3.d.mts","names":[],"sources":["../src/schema.ts"],"mappings":";;cAsQa,oBAAkB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwC7B,EAAA,KAAA;KAEU,eAAe,EAAE,aAAa;;;;;;cA0B7B;;;;;;;;;;;;;cAcA;;cAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDD;EACN;EAAU,MAAM;EAAc;EAAY;;EAC1C;EAAW;EAAiB,QAAQ,EAAE,KAAK;EAAa;;;;;;;;;iBAsD9C,SAAS,iBAAiB"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { t as DesignSystem } from "./schema-Dmq1J7S3.mjs";
|
|
2
|
+
//#region src/shared.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Data shared between the generator (`generate.ts`) and the docs bundle
|
|
5
|
+
* (`docs.ts`). Lives in its own module because `generate.ts` imports `docs.ts` —
|
|
6
|
+
* importing back the other way would be a cycle.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Selector the dark functional-token flip hangs off.
|
|
10
|
+
*
|
|
11
|
+
* `data-brx-theme` is Bricks' own attribute — Bricks sets it, so it's what the
|
|
12
|
+
* WordPress target needs. Nothing sets it anywhere else, which meant the dark
|
|
13
|
+
* flip was unreachable outside Bricks: the shipped `<wc-color-scheme-toggle>` web
|
|
14
|
+
* component writes `documentElement.dataset.theme` (i.e. `data-theme`), so
|
|
15
|
+
* clicking "Dark" changed an attribute no rule matched. Matching both makes the
|
|
16
|
+
* component work on every target without changing what Bricks already does.
|
|
17
|
+
*
|
|
18
|
+
* This covers the EXPLICIT choice. The OS preference is a second, opt-in block —
|
|
19
|
+
* see `SYSTEM_DARK_SEL` — because turning it on flips a site dark for dark-OS
|
|
20
|
+
* users, which is the site's decision rather than the design system's.
|
|
21
|
+
*
|
|
22
|
+
* Shared so the docs quote the selector the generator actually emits.
|
|
23
|
+
*/
|
|
24
|
+
declare const DARK_SEL = ":root[data-brx-theme=\"dark\"], :root[data-theme=\"dark\"]";
|
|
25
|
+
/**
|
|
26
|
+
* Roles the shipped CSS partials reference with NO fallback, so a config that
|
|
27
|
+
* omits one leaves those rules resolving to nothing — an invalid declaration,
|
|
28
|
+
* not a graceful degrade.
|
|
29
|
+
*
|
|
30
|
+
* `colors.roles` is an open record: any name works and generates a full token
|
|
31
|
+
* set, utilities and dark flip. But the framework's own component CSS is
|
|
32
|
+
* written against these six, so "roles are arbitrary" is only half true — they
|
|
33
|
+
* are *extensible*, over a required core. `validate()` warns when one is
|
|
34
|
+
* missing; `required-roles.test.ts` re-derives this list from the partials so
|
|
35
|
+
* it cannot drift as components are added.
|
|
36
|
+
*
|
|
37
|
+
* Kept as a constant rather than scanned at call time because `validate()` is
|
|
38
|
+
* a pure function — the CLI, the Vite plugin and `toJSONSchema` all import it,
|
|
39
|
+
* and none of them should touch the filesystem to answer "is this config ok?".
|
|
40
|
+
*/
|
|
41
|
+
declare const REQUIRED_ROLES: readonly string[];
|
|
42
|
+
/**
|
|
43
|
+
* Every token key a role can resolve to, across both role kinds. Shared so the
|
|
44
|
+
* required-roles drift test greps for exactly what the generator emits.
|
|
45
|
+
*
|
|
46
|
+
* These are *keys*, not var names: the role sits in the middle of the property
|
|
47
|
+
* (`--color-bg-danger-muted`), so compose them with `tokenVar()` from `tokens.ts`
|
|
48
|
+
* rather than concatenating by hand.
|
|
49
|
+
*/
|
|
50
|
+
declare const ROLE_TOKEN_KEYS: readonly string[];
|
|
51
|
+
/** How a role is authored in `colors.roles`: a bare hue, or a hue plus its kind. */
|
|
52
|
+
type RoleSpec = string | {
|
|
53
|
+
hue: string;
|
|
54
|
+
kind?: 'surface' | 'chromatic' | undefined;
|
|
55
|
+
};
|
|
56
|
+
/** The palette hue a role points at, through either authoring form. */
|
|
57
|
+
declare const roleHue: (spec: RoleSpec) => string;
|
|
58
|
+
/**
|
|
59
|
+
* A role's kind. The bare-string shorthand means `chromatic`, because signal
|
|
60
|
+
* colours are the common case and surfaces are the two or three you name once.
|
|
61
|
+
*/
|
|
62
|
+
declare const roleKind: (spec: RoleSpec) => "surface" | "chromatic";
|
|
63
|
+
/**
|
|
64
|
+
* Pattern base geometry props → per-pattern override-hook shorthand. Each hook
|
|
65
|
+
* wraps the authored value (`padding: var(--p-btn, 0.4em 0.8em)`) so a
|
|
66
|
+
* consumer restyles one pattern by setting one variable. The hook is named after
|
|
67
|
+
* the pattern's key, not its class.
|
|
68
|
+
*/
|
|
69
|
+
declare const BASE_HOOK: Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* A typography role's declared key → [CSS property, var-name suffix]. The
|
|
72
|
+
* recognised key set is CLOSED (an unrecognised key is a config error, see
|
|
73
|
+
* `generate.ts`'s `ALSO_MEANT`) — shared here (rather than living only in
|
|
74
|
+
* `generate.ts`) because `tokens.ts`'s `buildReverseIndex` needs the exact
|
|
75
|
+
* same key → suffix mapping to stay in step with what `generate()` itself
|
|
76
|
+
* builds, and `tokens.ts` can't import from `generate.ts` (the CSS-bundling
|
|
77
|
+
* half, which needs lightningcss/node:fs) without losing its own
|
|
78
|
+
* Worker-safety.
|
|
79
|
+
*/
|
|
80
|
+
declare const TYPO_KEYMAP: Record<string, [string, string]>;
|
|
81
|
+
/**
|
|
82
|
+
* Framework utility classes whose names collide with Tailwind's own defaults.
|
|
83
|
+
* The `tailwind` format strips any rule targeting these — Tailwind provides
|
|
84
|
+
* them, so consumers use Tailwind's utilities for these names instead.
|
|
85
|
+
*/
|
|
86
|
+
declare const TW_CLASH: ReadonlySet<string>;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/tokens.d.ts
|
|
89
|
+
declare const NUMERIC_STEPS: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
|
|
90
|
+
type NumStep = (typeof NUMERIC_STEPS)[number];
|
|
91
|
+
interface ExpandedHue {
|
|
92
|
+
/** Numeric steps (sparse for fixed-tone kits). */
|
|
93
|
+
numeric: Partial<Record<NumStep, string>>;
|
|
94
|
+
/** True when only authored tones + endpoints exist (no interpolation). */
|
|
95
|
+
sparse?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Steps the author pinned, and how far each sits from the ladder's lightness.
|
|
98
|
+
* A pinned colour is reproduced exactly, so a large value here is legal — but
|
|
99
|
+
* it means this hue reads heavier or lighter than its siblings at that step,
|
|
100
|
+
* which the generator surfaces as a warning.
|
|
101
|
+
*/
|
|
102
|
+
deviations?: Partial<Record<NumStep, number>>;
|
|
103
|
+
}
|
|
104
|
+
/** Expand every palette hue into its numeric scale. */
|
|
105
|
+
declare function expandPalette(raw: Record<string, unknown>): Record<string, ExpandedHue>;
|
|
106
|
+
declare function ladderWarnings(palette: Record<string, ExpandedHue>): string[];
|
|
107
|
+
/**
|
|
108
|
+
* Ramps whose lightness does not fall monotonically from 50 to 950.
|
|
109
|
+
*
|
|
110
|
+
* A ramp built from the ladder alone cannot invert — only pinned colours (a seed,
|
|
111
|
+
* an `anchor`, a `tones` entry) can, because they are the one thing allowed off
|
|
112
|
+
* it. `ladderWarnings` will not catch it: it compares each pinned step against
|
|
113
|
+
* *its own* ladder rung, never against its neighbours, so it reports the wrong
|
|
114
|
+
* defect ("reads darker than others at 600") while the real problem is that 600
|
|
115
|
+
* is darker than 700. And since `LADDER_TOLERANCE` is 0.03 — the same size as the
|
|
116
|
+
* ladder's own 50→100 gap — two anchors can each sit within tolerance and still
|
|
117
|
+
* invert, with no warning at all.
|
|
118
|
+
*
|
|
119
|
+
* This is an error rather than a warning because the rest of the system assumes
|
|
120
|
+
* the order: `snap` picks the nearest step by ladder lightness, the mode-stable
|
|
121
|
+
* solid family hard-codes 600/700/800 as increasingly dark, and both dark tables
|
|
122
|
+
* re-point steps on the same assumption. An inverted ramp therefore runs hover
|
|
123
|
+
* states backwards — the failure the fixed ladder was introduced to eliminate.
|
|
124
|
+
*/
|
|
125
|
+
declare function monotonicityErrors(palette: Record<string, ExpandedHue>): string[];
|
|
126
|
+
/** Which shape of token set a role gets. */
|
|
127
|
+
type RoleKind = 'surface' | 'chromatic';
|
|
128
|
+
/**
|
|
129
|
+
* Map a token key to its CSS custom property for a given role.
|
|
130
|
+
*
|
|
131
|
+
* `on` is the one irregular case: the foreground for a filled surface reads
|
|
132
|
+
* `--color-text-on-<role>`, with the role *after* `on`, because it names what it
|
|
133
|
+
* sits on rather than what it is.
|
|
134
|
+
*
|
|
135
|
+
* The utility class name is this minus the `--color-` prefix, which is why the
|
|
136
|
+
* emitter and the linter can both derive their vocabulary from one function.
|
|
137
|
+
*/
|
|
138
|
+
declare function tokenVar(role: string, key: string): string;
|
|
139
|
+
/** The class name a token key produces for a role (`bg-danger-solid`, …). */
|
|
140
|
+
declare const tokenClass: (role: string, key: string) => string;
|
|
141
|
+
interface FunctionalRole {
|
|
142
|
+
role: string;
|
|
143
|
+
hue: string;
|
|
144
|
+
kind: RoleKind;
|
|
145
|
+
/** token key → CSS value, per appearance. */
|
|
146
|
+
light: Record<string, string>;
|
|
147
|
+
dark: Record<string, string>;
|
|
148
|
+
}
|
|
149
|
+
/** Resolve the token set for one role over its hue. */
|
|
150
|
+
declare function functionalRole(role: string, hueName: string, hue: ExpandedHue, kind?: RoleKind): FunctionalRole;
|
|
151
|
+
/**
|
|
152
|
+
* APCA targets. `TEXT` is the body-text bar; `SECONDARY` covers text on a
|
|
153
|
+
* non-primary surface and de-emphasised text. `NON_TEXT` is the icon/boundary
|
|
154
|
+
* tier — the APCA analogue of WCAG's 3:1, where a glyph may run more vivid than
|
|
155
|
+
* text because shape carries meaning alongside contrast.
|
|
156
|
+
*/
|
|
157
|
+
declare const CONTRAST: {
|
|
158
|
+
readonly TEXT: 75;
|
|
159
|
+
readonly SECONDARY: 60;
|
|
160
|
+
readonly NON_TEXT: 45;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Verify a role's contrast targets. Returns human-readable failures.
|
|
164
|
+
*
|
|
165
|
+
* Chromatic roles are checked against the surface planes they actually sit on
|
|
166
|
+
* (`surfaceBg`) as well as their own tints — coloured text almost never appears
|
|
167
|
+
* over its own solid, it appears over the page. Checking only within the role
|
|
168
|
+
* would have missed the pairing that matters most.
|
|
169
|
+
*/
|
|
170
|
+
declare function checkContrast(fr: FunctionalRole, numericOf: (hueName: string) => Partial<Record<NumStep, string>>, surfaceBg?: {
|
|
171
|
+
light: string[];
|
|
172
|
+
dark: string[];
|
|
173
|
+
}): string[];
|
|
174
|
+
/**
|
|
175
|
+
* Runs the same monotonicity + contrast contract `generate()`'s `build()`
|
|
176
|
+
* enforces at build time (by throwing), standalone and non-throwing — for a
|
|
177
|
+
* caller that needs to validate a `colors` subtree *before* handing it to
|
|
178
|
+
* `generate()`, most notably the EmDash design-system-editor's save route
|
|
179
|
+
* (see AGENTS.md's "live theme editor" section): a client's edit gets the
|
|
180
|
+
* exact same accessibility gate a real build would apply, synchronously, at
|
|
181
|
+
* save time, rather than only discovering a violation at the next deploy.
|
|
182
|
+
*
|
|
183
|
+
* Deliberately re-derives `expandPalette`/`functionalRole` independently
|
|
184
|
+
* rather than sharing state with `build()` — both are cheap, pure
|
|
185
|
+
* computations, and keeping this standalone means it has no dependency on
|
|
186
|
+
* `generate.ts`'s CSS-bundling half (which needs lightningcss/node:fs) and so
|
|
187
|
+
* stays reachable from a Worker.
|
|
188
|
+
*/
|
|
189
|
+
declare function validateColorContract(colors: {
|
|
190
|
+
palette: Record<string, unknown>;
|
|
191
|
+
roles: Record<string, RoleSpec>;
|
|
192
|
+
}): string[];
|
|
193
|
+
/**
|
|
194
|
+
* The `reverseIndex` half of `generate()`'s `design-manifest.json` (css
|
|
195
|
+
* format), standalone — a CSS var name → the config path that produced it
|
|
196
|
+
* (e.g. `--color-navy-500` → `colors.palette.navy.anchors.500`). Kept in exact
|
|
197
|
+
* step with the block inside `generate.ts`'s `build()` that builds the same
|
|
198
|
+
* map (both read `TYPO_KEYMAP`/`BASE_HOOK` from `shared.ts`, never duplicated
|
|
199
|
+
* inline) — this is the standalone half for a caller that has a
|
|
200
|
+
* `DesignSystem` but no built `design-manifest.json` to fetch, most notably
|
|
201
|
+
* the EmDash design-system-editor plugin route: a deployed Worker has no
|
|
202
|
+
* filesystem to read a manifest asset from over HTTP without adding a
|
|
203
|
+
* `network:request` capability + a hostname declared in `allowedHosts` for
|
|
204
|
+
* *the site's own, deployment-specific* origin — recomputing this from the
|
|
205
|
+
* `DesignSystem` the site's own build already bundles avoids that entirely.
|
|
206
|
+
*/
|
|
207
|
+
declare function buildReverseIndex(ds: Pick<DesignSystem, 'colors' | 'typography' | 'patterns'>): Record<string, string>;
|
|
208
|
+
/**
|
|
209
|
+
* Turns a design-system PATCH (paths matching `manifest.reverseIndex`'s own
|
|
210
|
+
* config-path values, e.g. `colors.palette.navy.anchors.500`) into the runtime
|
|
211
|
+
* `:root` override `<wc-theme-editor>` already injects client-side for its own
|
|
212
|
+
* live preview — server-rendered instead, for the EmDash design-system-editor
|
|
213
|
+
* plugin route to serve site-wide via a `page:fragments` `html` contribution
|
|
214
|
+
* (see AGENTS.md's "live theme editor" + "EmDash plugin as the design-system
|
|
215
|
+
* editing surface" sections). `''` (no matching var, or an empty patch) means
|
|
216
|
+
* "nothing to override" — the caller should serve no fragment at all rather
|
|
217
|
+
* than an empty `<style>` tag.
|
|
218
|
+
*
|
|
219
|
+
* Inverts `reverseIndex` (`cssVar → configPath`) once into `configPath →
|
|
220
|
+
* cssVar`, so it costs one pass regardless of how deep the patch nests. A
|
|
221
|
+
* patched leaf with no matching var (a `reverseIndex` miss — the same case
|
|
222
|
+
* `<wc-theme-editor>`'s own `buildPatch()` calls "skipped") is silently
|
|
223
|
+
* omitted here too, for the same reason: a value with nothing to preview is
|
|
224
|
+
* not an error, just nothing to show yet.
|
|
225
|
+
*/
|
|
226
|
+
declare function patchToOverrideCss(patch: Record<string, unknown>, reverseIndex: Record<string, string>): string;
|
|
227
|
+
//#endregion
|
|
228
|
+
export { roleHue as C, TYPO_KEYMAP as S, DARK_SEL as _, RoleKind as a, RoleSpec as b, expandPalette as c, monotonicityErrors as d, patchToOverrideCss as f, BASE_HOOK as g, validateColorContract as h, NUMERIC_STEPS as i, functionalRole as l, tokenVar as m, ExpandedHue as n, buildReverseIndex as o, tokenClass as p, FunctionalRole as r, checkContrast as s, CONTRAST as t, ladderWarnings as u, REQUIRED_ROLES as v, roleKind as w, TW_CLASH as x, ROLE_TOKEN_KEYS as y };
|
|
229
|
+
//# sourceMappingURL=tokens-8SXMDAd1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-8SXMDAd1.d.mts","names":[],"sources":["../src/shared.ts","../src/tokens.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;cAsBa;;;;;;;;;;;;;;;;;cAmCA;;;;;;;;;cAiBA;;KA+BD;EAAsB;EAAa;;;cAGlC,UAAW,MAAM;;;;;cAMjB,WAAY,MAAM;;;;;;;cASlB,WAAW;;;;;;;;;;;cAuBX,aAAa;;;;;;cAkBb,UAAU;;;cCtHV;KAaR,kBAAkB;UAWN;;EAEf,SAAS,QAAQ,OAAO;;EAExB;;;;;;;EAOA,aAAa,QAAQ,OAAO;;;iBAwHd,cAAc,KAAK,0BAA0B,eAAe;iBAmB5D,eAAe,SAAS,eAAe;;;;;;;;;;;;;;;;;;;iBAyCvC,mBAAmB,SAAS,eAAe;;KA0C/C;;;;;;;;;;;iBA8FI,SAAS,cAAc;;cAU1B,aAAc,cAAc;UAGxB;EACf;EACA;EACA,MAAM;;EAEN,OAAO;EACP,MAAM;;;iBAIQ,eACd,cACA,iBACA,KAAK,aACL,OAAM,WACL;;;;;;;cAqCU;;;;;;;;;;;;;iBAiBG,cACd,IAAI,gBACJ,YAAY,oBAAoB,QAAQ,OAAO,mBAC/C;EAAc;EAAiB;;;;;;;;;;;;;;;;;iBA0FjB,sBAAsB;EACpC,SAAS;EACT,OAAO,eAAe;;;;;;;;;;;;;;;;iBAgDR,kBAAkB,IAAI,KAAK,sDAAmD;;;;;;;;;;;;;;;;;;;iBAyD9E,mBACd,OAAO,yBACP,cAAc"}
|