@forumone/throughline-design-contract 0.0.1 → 0.3.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,454 @@
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
+ group: z.ZodOptional<z.ZodEnum<["hero", "narrative", "proof", "listing", "media", "form", "cta", "navigation", "utility"]>>;
58
+ description: z.ZodString;
59
+ intent: z.ZodString;
60
+ composition: z.ZodObject<{
61
+ placement: z.ZodArray<z.ZodEnum<["page", "section", "inline"]>, "atleastone">;
62
+ maxPerPage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
63
+ requiredSiblings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
64
+ forbiddenAdjacent: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
65
+ allowedSlots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
68
+ maxPerPage: number | null;
69
+ requiredSiblings: string[];
70
+ forbiddenAdjacent: string[];
71
+ allowedSlots?: Record<string, string[]> | undefined;
72
+ }, {
73
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
74
+ maxPerPage?: number | null | undefined;
75
+ requiredSiblings?: string[] | undefined;
76
+ forbiddenAdjacent?: string[] | undefined;
77
+ allowedSlots?: Record<string, string[]> | undefined;
78
+ }>;
79
+ content: z.ZodObject<{
80
+ fields: z.ZodArray<z.ZodType<import("./schema.js").ContentField, z.ZodTypeDef, import("./schema.js").ContentFieldInput>, "many">;
81
+ variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
+ name: z.ZodString;
83
+ description: z.ZodString;
84
+ whenToUse: z.ZodString;
85
+ }, "strip", z.ZodTypeAny, {
86
+ name: string;
87
+ description: string;
88
+ whenToUse: string;
89
+ }, {
90
+ name: string;
91
+ description: string;
92
+ whenToUse: string;
93
+ }>, "many">>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ fields: import("./schema.js").ContentField[];
96
+ variants?: {
97
+ name: string;
98
+ description: string;
99
+ whenToUse: string;
100
+ }[] | undefined;
101
+ }, {
102
+ fields: import("./schema.js").ContentFieldInput[];
103
+ variants?: {
104
+ name: string;
105
+ description: string;
106
+ whenToUse: string;
107
+ }[] | undefined;
108
+ }>;
109
+ tokens: z.ZodObject<{
110
+ consumes: z.ZodArray<z.ZodString, "many">;
111
+ configurable: z.ZodOptional<z.ZodArray<z.ZodObject<{
112
+ prop: z.ZodString;
113
+ tokenGroup: z.ZodString;
114
+ allowedValues: z.ZodArray<z.ZodString, "many">;
115
+ }, "strip", z.ZodTypeAny, {
116
+ prop: string;
117
+ tokenGroup: string;
118
+ allowedValues: string[];
119
+ }, {
120
+ prop: string;
121
+ tokenGroup: string;
122
+ allowedValues: string[];
123
+ }>, "many">>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ consumes: string[];
126
+ configurable?: {
127
+ prop: string;
128
+ tokenGroup: string;
129
+ allowedValues: string[];
130
+ }[] | undefined;
131
+ }, {
132
+ consumes: string[];
133
+ configurable?: {
134
+ prop: string;
135
+ tokenGroup: string;
136
+ allowedValues: string[];
137
+ }[] | undefined;
138
+ }>;
139
+ accessibility: z.ZodObject<{
140
+ role: z.ZodOptional<z.ZodString>;
141
+ keyboardSupport: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
142
+ screenReaderBehavior: z.ZodString;
143
+ contentWarnings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ keyboardSupport: string[];
146
+ screenReaderBehavior: string;
147
+ contentWarnings: string[];
148
+ role?: string | undefined;
149
+ }, {
150
+ screenReaderBehavior: string;
151
+ role?: string | undefined;
152
+ keyboardSupport?: string[] | undefined;
153
+ contentWarnings?: string[] | undefined;
154
+ }>;
155
+ examples: z.ZodArray<z.ZodObject<{
156
+ label: z.ZodString;
157
+ intent: z.ZodString;
158
+ storyId: z.ZodString;
159
+ }, "strip", z.ZodTypeAny, {
160
+ intent: string;
161
+ label: string;
162
+ storyId: string;
163
+ }, {
164
+ intent: string;
165
+ label: string;
166
+ storyId: string;
167
+ }>, "many">;
168
+ antiExamples: z.ZodDefault<z.ZodArray<z.ZodObject<{
169
+ label: z.ZodString;
170
+ why: z.ZodString;
171
+ useInstead: z.ZodOptional<z.ZodString>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ label: string;
174
+ why: string;
175
+ useInstead?: string | undefined;
176
+ }, {
177
+ label: string;
178
+ why: string;
179
+ useInstead?: string | undefined;
180
+ }>, "many">>;
181
+ behavior: z.ZodDefault<z.ZodObject<{
182
+ fetchesData: z.ZodDefault<z.ZodBoolean>;
183
+ hasClientState: z.ZodDefault<z.ZodBoolean>;
184
+ animates: z.ZodDefault<z.ZodBoolean>;
185
+ requiresAnalytics: z.ZodDefault<z.ZodBoolean>;
186
+ }, "strip", z.ZodTypeAny, {
187
+ fetchesData: boolean;
188
+ hasClientState: boolean;
189
+ animates: boolean;
190
+ requiresAnalytics: boolean;
191
+ }, {
192
+ fetchesData?: boolean | undefined;
193
+ hasClientState?: boolean | undefined;
194
+ animates?: boolean | undefined;
195
+ requiresAnalytics?: boolean | undefined;
196
+ }>>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ name: string;
199
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
200
+ description: string;
201
+ intent: string;
202
+ composition: {
203
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
204
+ maxPerPage: number | null;
205
+ requiredSiblings: string[];
206
+ forbiddenAdjacent: string[];
207
+ allowedSlots?: Record<string, string[]> | undefined;
208
+ };
209
+ content: {
210
+ fields: import("./schema.js").ContentField[];
211
+ variants?: {
212
+ name: string;
213
+ description: string;
214
+ whenToUse: string;
215
+ }[] | undefined;
216
+ };
217
+ tokens: {
218
+ consumes: string[];
219
+ configurable?: {
220
+ prop: string;
221
+ tokenGroup: string;
222
+ allowedValues: string[];
223
+ }[] | undefined;
224
+ };
225
+ accessibility: {
226
+ keyboardSupport: string[];
227
+ screenReaderBehavior: string;
228
+ contentWarnings: string[];
229
+ role?: string | undefined;
230
+ };
231
+ examples: {
232
+ intent: string;
233
+ label: string;
234
+ storyId: string;
235
+ }[];
236
+ antiExamples: {
237
+ label: string;
238
+ why: string;
239
+ useInstead?: string | undefined;
240
+ }[];
241
+ behavior: {
242
+ fetchesData: boolean;
243
+ hasClientState: boolean;
244
+ animates: boolean;
245
+ requiresAnalytics: boolean;
246
+ };
247
+ group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
248
+ }, {
249
+ name: string;
250
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
251
+ description: string;
252
+ intent: string;
253
+ composition: {
254
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
255
+ maxPerPage?: number | null | undefined;
256
+ requiredSiblings?: string[] | undefined;
257
+ forbiddenAdjacent?: string[] | undefined;
258
+ allowedSlots?: Record<string, string[]> | undefined;
259
+ };
260
+ content: {
261
+ fields: import("./schema.js").ContentFieldInput[];
262
+ variants?: {
263
+ name: string;
264
+ description: string;
265
+ whenToUse: string;
266
+ }[] | undefined;
267
+ };
268
+ tokens: {
269
+ consumes: string[];
270
+ configurable?: {
271
+ prop: string;
272
+ tokenGroup: string;
273
+ allowedValues: string[];
274
+ }[] | undefined;
275
+ };
276
+ accessibility: {
277
+ screenReaderBehavior: string;
278
+ role?: string | undefined;
279
+ keyboardSupport?: string[] | undefined;
280
+ contentWarnings?: string[] | undefined;
281
+ };
282
+ examples: {
283
+ intent: string;
284
+ label: string;
285
+ storyId: string;
286
+ }[];
287
+ group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
288
+ antiExamples?: {
289
+ label: string;
290
+ why: string;
291
+ useInstead?: string | undefined;
292
+ }[] | undefined;
293
+ behavior?: {
294
+ fetchesData?: boolean | undefined;
295
+ hasClientState?: boolean | undefined;
296
+ animates?: boolean | undefined;
297
+ requiresAnalytics?: boolean | undefined;
298
+ } | undefined;
299
+ }>>;
300
+ /** Build metadata. */
301
+ build: z.ZodObject<{
302
+ timestamp: z.ZodString;
303
+ source: z.ZodOptional<z.ZodString>;
304
+ }, "strip", z.ZodTypeAny, {
305
+ timestamp: string;
306
+ source?: string | undefined;
307
+ }, {
308
+ timestamp: string;
309
+ source?: string | undefined;
310
+ }>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ tokens: {
313
+ value: string;
314
+ name: string;
315
+ category: string;
316
+ }[];
317
+ contractVersion: "1.0.0";
318
+ designSystem: {
319
+ name: string;
320
+ version: string;
321
+ description?: string | undefined;
322
+ homepage?: string | undefined;
323
+ storybookUrl?: string | undefined;
324
+ };
325
+ components: Record<string, {
326
+ name: string;
327
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
328
+ description: string;
329
+ intent: string;
330
+ composition: {
331
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
332
+ maxPerPage: number | null;
333
+ requiredSiblings: string[];
334
+ forbiddenAdjacent: string[];
335
+ allowedSlots?: Record<string, string[]> | undefined;
336
+ };
337
+ content: {
338
+ fields: import("./schema.js").ContentField[];
339
+ variants?: {
340
+ name: string;
341
+ description: string;
342
+ whenToUse: string;
343
+ }[] | undefined;
344
+ };
345
+ tokens: {
346
+ consumes: string[];
347
+ configurable?: {
348
+ prop: string;
349
+ tokenGroup: string;
350
+ allowedValues: string[];
351
+ }[] | undefined;
352
+ };
353
+ accessibility: {
354
+ keyboardSupport: string[];
355
+ screenReaderBehavior: string;
356
+ contentWarnings: string[];
357
+ role?: string | undefined;
358
+ };
359
+ examples: {
360
+ intent: string;
361
+ label: string;
362
+ storyId: string;
363
+ }[];
364
+ antiExamples: {
365
+ label: string;
366
+ why: string;
367
+ useInstead?: string | undefined;
368
+ }[];
369
+ behavior: {
370
+ fetchesData: boolean;
371
+ hasClientState: boolean;
372
+ animates: boolean;
373
+ requiresAnalytics: boolean;
374
+ };
375
+ group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
376
+ }>;
377
+ build: {
378
+ timestamp: string;
379
+ source?: string | undefined;
380
+ };
381
+ }, {
382
+ tokens: {
383
+ value: string;
384
+ name: string;
385
+ category: string;
386
+ }[];
387
+ contractVersion: "1.0.0";
388
+ designSystem: {
389
+ name: string;
390
+ version: string;
391
+ description?: string | undefined;
392
+ homepage?: string | undefined;
393
+ storybookUrl?: string | undefined;
394
+ };
395
+ components: Record<string, {
396
+ name: string;
397
+ category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
398
+ description: string;
399
+ intent: string;
400
+ composition: {
401
+ placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
402
+ maxPerPage?: number | null | undefined;
403
+ requiredSiblings?: string[] | undefined;
404
+ forbiddenAdjacent?: string[] | undefined;
405
+ allowedSlots?: Record<string, string[]> | undefined;
406
+ };
407
+ content: {
408
+ fields: import("./schema.js").ContentFieldInput[];
409
+ variants?: {
410
+ name: string;
411
+ description: string;
412
+ whenToUse: string;
413
+ }[] | undefined;
414
+ };
415
+ tokens: {
416
+ consumes: string[];
417
+ configurable?: {
418
+ prop: string;
419
+ tokenGroup: string;
420
+ allowedValues: string[];
421
+ }[] | undefined;
422
+ };
423
+ accessibility: {
424
+ screenReaderBehavior: string;
425
+ role?: string | undefined;
426
+ keyboardSupport?: string[] | undefined;
427
+ contentWarnings?: string[] | undefined;
428
+ };
429
+ examples: {
430
+ intent: string;
431
+ label: string;
432
+ storyId: string;
433
+ }[];
434
+ group?: "hero" | "media" | "cta" | "navigation" | "form" | "utility" | "narrative" | "proof" | "listing" | undefined;
435
+ antiExamples?: {
436
+ label: string;
437
+ why: string;
438
+ useInstead?: string | undefined;
439
+ }[] | undefined;
440
+ behavior?: {
441
+ fetchesData?: boolean | undefined;
442
+ hasClientState?: boolean | undefined;
443
+ animates?: boolean | undefined;
444
+ requiresAnalytics?: boolean | undefined;
445
+ } | undefined;
446
+ }>;
447
+ build: {
448
+ timestamp: string;
449
+ source?: string | undefined;
450
+ };
451
+ }>;
452
+ export type Manifest = z.infer<typeof ManifestSchema>;
453
+ export {};
454
+ //# 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"}