@forumone/throughline-design-contract 0.0.1 → 0.2.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.
@@ -0,0 +1,449 @@
1
+ import { z } from 'zod';
2
+ declare const TokenDefinitionSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ value: z.ZodString;
5
+ category: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ value: string;
8
+ name: string;
9
+ category: string;
10
+ }, {
11
+ value: string;
12
+ name: string;
13
+ category: string;
14
+ }>;
15
+ export type TokenDefinition = z.infer<typeof TokenDefinitionSchema>;
16
+ export declare const ManifestSchema: z.ZodObject<{
17
+ /** The contract schema version this manifest satisfies. */
18
+ contractVersion: z.ZodLiteral<"1.0.0">;
19
+ /** Metadata about the design system. */
20
+ designSystem: z.ZodObject<{
21
+ name: z.ZodString;
22
+ version: z.ZodString;
23
+ description: z.ZodOptional<z.ZodString>;
24
+ homepage: z.ZodOptional<z.ZodString>;
25
+ storybookUrl: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ name: string;
28
+ version: string;
29
+ description?: string | undefined;
30
+ homepage?: string | undefined;
31
+ storybookUrl?: string | undefined;
32
+ }, {
33
+ name: string;
34
+ version: string;
35
+ description?: string | undefined;
36
+ homepage?: string | undefined;
37
+ storybookUrl?: string | undefined;
38
+ }>;
39
+ /** All tokens the design system exposes. Components reference them by name. */
40
+ tokens: z.ZodArray<z.ZodObject<{
41
+ name: z.ZodString;
42
+ value: z.ZodString;
43
+ category: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ value: string;
46
+ name: string;
47
+ category: string;
48
+ }, {
49
+ value: string;
50
+ name: string;
51
+ category: string;
52
+ }>, "many">;
53
+ /** Components keyed by name. */
54
+ components: z.ZodRecord<z.ZodString, z.ZodObject<{
55
+ name: z.ZodString;
56
+ category: z.ZodEnum<["hero", "section", "card", "media", "cta", "navigation", "data", "form", "utility"]>;
57
+ description: z.ZodString;
58
+ intent: z.ZodString;
59
+ composition: z.ZodObject<{
60
+ placement: z.ZodArray<z.ZodEnum<["page", "section", "inline"]>, "atleastone">;
61
+ maxPerPage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
62
+ requiredSiblings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
63
+ forbiddenAdjacent: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
64
+ allowedSlots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
67
+ maxPerPage: number | null;
68
+ requiredSiblings: string[];
69
+ forbiddenAdjacent: string[];
70
+ allowedSlots?: Record<string, string[]> | undefined;
71
+ }, {
72
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
73
+ maxPerPage?: number | null | undefined;
74
+ requiredSiblings?: string[] | undefined;
75
+ forbiddenAdjacent?: string[] | undefined;
76
+ allowedSlots?: Record<string, string[]> | undefined;
77
+ }>;
78
+ content: z.ZodObject<{
79
+ fields: z.ZodArray<z.ZodType<import("./schema.js").ContentField, z.ZodTypeDef, import("./schema.js").ContentFieldInput>, "many">;
80
+ variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
81
+ name: z.ZodString;
82
+ description: z.ZodString;
83
+ whenToUse: z.ZodString;
84
+ }, "strip", z.ZodTypeAny, {
85
+ name: string;
86
+ description: string;
87
+ whenToUse: string;
88
+ }, {
89
+ name: string;
90
+ description: string;
91
+ whenToUse: string;
92
+ }>, "many">>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ fields: import("./schema.js").ContentField[];
95
+ variants?: {
96
+ name: string;
97
+ description: string;
98
+ whenToUse: string;
99
+ }[] | undefined;
100
+ }, {
101
+ fields: import("./schema.js").ContentFieldInput[];
102
+ variants?: {
103
+ name: string;
104
+ description: string;
105
+ whenToUse: string;
106
+ }[] | undefined;
107
+ }>;
108
+ tokens: z.ZodObject<{
109
+ consumes: z.ZodArray<z.ZodString, "many">;
110
+ configurable: z.ZodOptional<z.ZodArray<z.ZodObject<{
111
+ prop: z.ZodString;
112
+ tokenGroup: z.ZodString;
113
+ allowedValues: z.ZodArray<z.ZodString, "many">;
114
+ }, "strip", z.ZodTypeAny, {
115
+ prop: string;
116
+ tokenGroup: string;
117
+ allowedValues: string[];
118
+ }, {
119
+ prop: string;
120
+ tokenGroup: string;
121
+ allowedValues: string[];
122
+ }>, "many">>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ consumes: string[];
125
+ configurable?: {
126
+ prop: string;
127
+ tokenGroup: string;
128
+ allowedValues: string[];
129
+ }[] | undefined;
130
+ }, {
131
+ consumes: string[];
132
+ configurable?: {
133
+ prop: string;
134
+ tokenGroup: string;
135
+ allowedValues: string[];
136
+ }[] | undefined;
137
+ }>;
138
+ accessibility: z.ZodObject<{
139
+ role: z.ZodOptional<z.ZodString>;
140
+ keyboardSupport: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
141
+ screenReaderBehavior: z.ZodString;
142
+ contentWarnings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ keyboardSupport: string[];
145
+ screenReaderBehavior: string;
146
+ contentWarnings: string[];
147
+ role?: string | undefined;
148
+ }, {
149
+ screenReaderBehavior: string;
150
+ role?: string | undefined;
151
+ keyboardSupport?: string[] | undefined;
152
+ contentWarnings?: string[] | undefined;
153
+ }>;
154
+ examples: z.ZodArray<z.ZodObject<{
155
+ label: z.ZodString;
156
+ intent: z.ZodString;
157
+ storyId: z.ZodString;
158
+ }, "strip", z.ZodTypeAny, {
159
+ intent: string;
160
+ label: string;
161
+ storyId: string;
162
+ }, {
163
+ intent: string;
164
+ label: string;
165
+ storyId: string;
166
+ }>, "many">;
167
+ antiExamples: z.ZodDefault<z.ZodArray<z.ZodObject<{
168
+ label: z.ZodString;
169
+ why: z.ZodString;
170
+ useInstead: z.ZodOptional<z.ZodString>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ label: string;
173
+ why: string;
174
+ useInstead?: string | undefined;
175
+ }, {
176
+ label: string;
177
+ why: string;
178
+ useInstead?: string | undefined;
179
+ }>, "many">>;
180
+ behavior: z.ZodDefault<z.ZodObject<{
181
+ fetchesData: z.ZodDefault<z.ZodBoolean>;
182
+ hasClientState: z.ZodDefault<z.ZodBoolean>;
183
+ animates: z.ZodDefault<z.ZodBoolean>;
184
+ requiresAnalytics: z.ZodDefault<z.ZodBoolean>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ fetchesData: boolean;
187
+ hasClientState: boolean;
188
+ animates: boolean;
189
+ requiresAnalytics: boolean;
190
+ }, {
191
+ fetchesData?: boolean | undefined;
192
+ hasClientState?: boolean | undefined;
193
+ animates?: boolean | undefined;
194
+ requiresAnalytics?: boolean | undefined;
195
+ }>>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ name: string;
198
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
199
+ description: string;
200
+ intent: string;
201
+ composition: {
202
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
203
+ maxPerPage: number | null;
204
+ requiredSiblings: string[];
205
+ forbiddenAdjacent: string[];
206
+ allowedSlots?: Record<string, string[]> | undefined;
207
+ };
208
+ content: {
209
+ fields: import("./schema.js").ContentField[];
210
+ variants?: {
211
+ name: string;
212
+ description: string;
213
+ whenToUse: string;
214
+ }[] | undefined;
215
+ };
216
+ tokens: {
217
+ consumes: string[];
218
+ configurable?: {
219
+ prop: string;
220
+ tokenGroup: string;
221
+ allowedValues: string[];
222
+ }[] | undefined;
223
+ };
224
+ accessibility: {
225
+ keyboardSupport: string[];
226
+ screenReaderBehavior: string;
227
+ contentWarnings: string[];
228
+ role?: string | undefined;
229
+ };
230
+ examples: {
231
+ intent: string;
232
+ label: string;
233
+ storyId: string;
234
+ }[];
235
+ antiExamples: {
236
+ label: string;
237
+ why: string;
238
+ useInstead?: string | undefined;
239
+ }[];
240
+ behavior: {
241
+ fetchesData: boolean;
242
+ hasClientState: boolean;
243
+ animates: boolean;
244
+ requiresAnalytics: boolean;
245
+ };
246
+ }, {
247
+ name: string;
248
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
249
+ description: string;
250
+ intent: string;
251
+ composition: {
252
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
253
+ maxPerPage?: number | null | undefined;
254
+ requiredSiblings?: string[] | undefined;
255
+ forbiddenAdjacent?: string[] | undefined;
256
+ allowedSlots?: Record<string, string[]> | undefined;
257
+ };
258
+ content: {
259
+ fields: import("./schema.js").ContentFieldInput[];
260
+ variants?: {
261
+ name: string;
262
+ description: string;
263
+ whenToUse: string;
264
+ }[] | undefined;
265
+ };
266
+ tokens: {
267
+ consumes: string[];
268
+ configurable?: {
269
+ prop: string;
270
+ tokenGroup: string;
271
+ allowedValues: string[];
272
+ }[] | undefined;
273
+ };
274
+ accessibility: {
275
+ screenReaderBehavior: string;
276
+ role?: string | undefined;
277
+ keyboardSupport?: string[] | undefined;
278
+ contentWarnings?: string[] | undefined;
279
+ };
280
+ examples: {
281
+ intent: string;
282
+ label: string;
283
+ storyId: string;
284
+ }[];
285
+ antiExamples?: {
286
+ label: string;
287
+ why: string;
288
+ useInstead?: string | undefined;
289
+ }[] | undefined;
290
+ behavior?: {
291
+ fetchesData?: boolean | undefined;
292
+ hasClientState?: boolean | undefined;
293
+ animates?: boolean | undefined;
294
+ requiresAnalytics?: boolean | undefined;
295
+ } | undefined;
296
+ }>>;
297
+ /** Build metadata. */
298
+ build: z.ZodObject<{
299
+ timestamp: z.ZodString;
300
+ source: z.ZodOptional<z.ZodString>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ timestamp: string;
303
+ source?: string | undefined;
304
+ }, {
305
+ timestamp: string;
306
+ source?: string | undefined;
307
+ }>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ tokens: {
310
+ value: string;
311
+ name: string;
312
+ category: string;
313
+ }[];
314
+ contractVersion: "1.0.0";
315
+ designSystem: {
316
+ name: string;
317
+ version: string;
318
+ description?: string | undefined;
319
+ homepage?: string | undefined;
320
+ storybookUrl?: string | undefined;
321
+ };
322
+ components: Record<string, {
323
+ name: string;
324
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
325
+ description: string;
326
+ intent: string;
327
+ composition: {
328
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
329
+ maxPerPage: number | null;
330
+ requiredSiblings: string[];
331
+ forbiddenAdjacent: string[];
332
+ allowedSlots?: Record<string, string[]> | undefined;
333
+ };
334
+ content: {
335
+ fields: import("./schema.js").ContentField[];
336
+ variants?: {
337
+ name: string;
338
+ description: string;
339
+ whenToUse: string;
340
+ }[] | undefined;
341
+ };
342
+ tokens: {
343
+ consumes: string[];
344
+ configurable?: {
345
+ prop: string;
346
+ tokenGroup: string;
347
+ allowedValues: string[];
348
+ }[] | undefined;
349
+ };
350
+ accessibility: {
351
+ keyboardSupport: string[];
352
+ screenReaderBehavior: string;
353
+ contentWarnings: string[];
354
+ role?: string | undefined;
355
+ };
356
+ examples: {
357
+ intent: string;
358
+ label: string;
359
+ storyId: string;
360
+ }[];
361
+ antiExamples: {
362
+ label: string;
363
+ why: string;
364
+ useInstead?: string | undefined;
365
+ }[];
366
+ behavior: {
367
+ fetchesData: boolean;
368
+ hasClientState: boolean;
369
+ animates: boolean;
370
+ requiresAnalytics: boolean;
371
+ };
372
+ }>;
373
+ build: {
374
+ timestamp: string;
375
+ source?: string | undefined;
376
+ };
377
+ }, {
378
+ tokens: {
379
+ value: string;
380
+ name: string;
381
+ category: string;
382
+ }[];
383
+ contractVersion: "1.0.0";
384
+ designSystem: {
385
+ name: string;
386
+ version: string;
387
+ description?: string | undefined;
388
+ homepage?: string | undefined;
389
+ storybookUrl?: string | undefined;
390
+ };
391
+ components: Record<string, {
392
+ name: string;
393
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
394
+ description: string;
395
+ intent: string;
396
+ composition: {
397
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
398
+ maxPerPage?: number | null | undefined;
399
+ requiredSiblings?: string[] | undefined;
400
+ forbiddenAdjacent?: string[] | undefined;
401
+ allowedSlots?: Record<string, string[]> | undefined;
402
+ };
403
+ content: {
404
+ fields: import("./schema.js").ContentFieldInput[];
405
+ variants?: {
406
+ name: string;
407
+ description: string;
408
+ whenToUse: string;
409
+ }[] | undefined;
410
+ };
411
+ tokens: {
412
+ consumes: string[];
413
+ configurable?: {
414
+ prop: string;
415
+ tokenGroup: string;
416
+ allowedValues: string[];
417
+ }[] | undefined;
418
+ };
419
+ accessibility: {
420
+ screenReaderBehavior: string;
421
+ role?: string | undefined;
422
+ keyboardSupport?: string[] | undefined;
423
+ contentWarnings?: string[] | undefined;
424
+ };
425
+ examples: {
426
+ intent: string;
427
+ label: string;
428
+ storyId: string;
429
+ }[];
430
+ antiExamples?: {
431
+ label: string;
432
+ why: string;
433
+ useInstead?: string | undefined;
434
+ }[] | undefined;
435
+ behavior?: {
436
+ fetchesData?: boolean | undefined;
437
+ hasClientState?: boolean | undefined;
438
+ animates?: boolean | undefined;
439
+ requiresAnalytics?: boolean | undefined;
440
+ } | undefined;
441
+ }>;
442
+ build: {
443
+ timestamp: string;
444
+ source?: string | undefined;
445
+ };
446
+ }>;
447
+ export type Manifest = z.infer<typeof ManifestSchema>;
448
+ export {};
449
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;EAIzB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc;IACzB,2DAA2D;;IAG3D,wCAAwC;;;;;;;;;;;;;;;;;;;;IASxC,+EAA+E;;;;;;;;;;;;;;IAG/E,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGhC,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { CONTRACT_VERSION, ComponentContractSchema } from './schema.js';
3
+ const TokenDefinitionSchema = z.object({
4
+ name: z.string(),
5
+ value: z.string(),
6
+ category: z.string(),
7
+ });
8
+ export const ManifestSchema = z.object({
9
+ /** The contract schema version this manifest satisfies. */
10
+ contractVersion: z.literal(CONTRACT_VERSION),
11
+ /** Metadata about the design system. */
12
+ designSystem: z.object({
13
+ name: z.string(),
14
+ version: z.string(),
15
+ description: z.string().optional(),
16
+ homepage: z.string().url().optional(),
17
+ storybookUrl: z.string().url().optional(),
18
+ }),
19
+ /** All tokens the design system exposes. Components reference them by name. */
20
+ tokens: z.array(TokenDefinitionSchema),
21
+ /** Components keyed by name. */
22
+ components: z.record(z.string(), ComponentContractSchema),
23
+ /** Build metadata. */
24
+ build: z.object({
25
+ timestamp: z.string().datetime(),
26
+ source: z.string().optional(),
27
+ }),
28
+ });
29
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAEvE,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,2DAA2D;IAC3D,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAE5C,wCAAwC;IACxC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;QACrC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;KAC1C,CAAC;IAEF,+EAA+E;IAC/E,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;IAEtC,gCAAgC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,uBAAuB,CAAC;IAEzD,sBAAsB;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B,CAAC;CACH,CAAC,CAAA"}