mdx-artifacts 0.1.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/LICENSE +21 -0
- package/README.md +234 -0
- package/README.zh-CN.md +129 -0
- package/agents/AGENTS.snippet.md +13 -0
- package/artifact-docs/examples/commentable-feedback.mdx +126 -0
- package/artifact-docs/examples/decision-matrix.mdx +80 -0
- package/artifact-docs/examples/layout-composition.mdx +216 -0
- package/artifact-docs/examples/streamlit-style-mixed.mdx +183 -0
- package/dist/lib/cli/artifact-state.d.ts +27 -0
- package/dist/lib/cli/artifact-state.js +115 -0
- package/dist/lib/cli/build.d.ts +1 -0
- package/dist/lib/cli/build.js +25 -0
- package/dist/lib/cli/components.d.ts +3 -0
- package/dist/lib/cli/components.js +58 -0
- package/dist/lib/cli/config.d.ts +2 -0
- package/dist/lib/cli/config.js +36 -0
- package/dist/lib/cli/dev.d.ts +1 -0
- package/dist/lib/cli/dev.js +24 -0
- package/dist/lib/cli/index.d.ts +2 -0
- package/dist/lib/cli/index.js +69 -0
- package/dist/lib/cli/review.d.ts +33 -0
- package/dist/lib/cli/review.js +390 -0
- package/dist/lib/cli/scaffold.d.ts +1 -0
- package/dist/lib/cli/scaffold.js +56 -0
- package/dist/lib/cli/types.d.ts +7 -0
- package/dist/lib/cli/types.js +1 -0
- package/dist/lib/cli/validate.d.ts +6 -0
- package/dist/lib/cli/validate.js +79 -0
- package/dist/lib/cli/vite-artifact.d.ts +13 -0
- package/dist/lib/cli/vite-artifact.js +213 -0
- package/dist/lib/react/components/AnnotatedCode.d.ts +19 -0
- package/dist/lib/react/components/AnnotatedCode.js +30 -0
- package/dist/lib/react/components/ArtifactState.d.ts +68 -0
- package/dist/lib/react/components/ArtifactState.js +286 -0
- package/dist/lib/react/components/Callout.d.ts +9 -0
- package/dist/lib/react/components/Callout.js +21 -0
- package/dist/lib/react/components/CodeBlock.d.ts +10 -0
- package/dist/lib/react/components/CodeBlock.js +28 -0
- package/dist/lib/react/components/Comments.d.ts +53 -0
- package/dist/lib/react/components/Comments.js +613 -0
- package/dist/lib/react/components/ComparisonSet.d.ts +24 -0
- package/dist/lib/react/components/ComparisonSet.js +30 -0
- package/dist/lib/react/components/DecisionMatrix.d.ts +16 -0
- package/dist/lib/react/components/DecisionMatrix.js +27 -0
- package/dist/lib/react/components/DiffBlock.d.ts +15 -0
- package/dist/lib/react/components/DiffBlock.js +24 -0
- package/dist/lib/react/components/ExportPanel.d.ts +7 -0
- package/dist/lib/react/components/ExportPanel.js +84 -0
- package/dist/lib/react/components/InlineText.d.ts +9 -0
- package/dist/lib/react/components/InlineText.js +18 -0
- package/dist/lib/react/components/Layout.d.ts +44 -0
- package/dist/lib/react/components/Layout.js +28 -0
- package/dist/lib/react/components/MarkdownBody.d.ts +7 -0
- package/dist/lib/react/components/MarkdownBody.js +36 -0
- package/dist/lib/react/components/OptionGrid.d.ts +13 -0
- package/dist/lib/react/components/OptionGrid.js +21 -0
- package/dist/lib/react/components/Section.d.ts +7 -0
- package/dist/lib/react/components/Section.js +41 -0
- package/dist/lib/react/components/SeverityBadge.d.ts +7 -0
- package/dist/lib/react/components/SeverityBadge.js +14 -0
- package/dist/lib/react/index.d.ts +33 -0
- package/dist/lib/react/index.js +16 -0
- package/dist/lib/react/registry.d.ts +24 -0
- package/dist/lib/react/registry.js +1002 -0
- package/dist/lib/react/styles.css +1417 -0
- package/docs/component-protocol.md +273 -0
- package/docs/component-taxonomy.md +273 -0
- package/docs/design.md +239 -0
- package/docs/design.zh-CN.md +217 -0
- package/docs/naming.md +123 -0
- package/docs/testing.md +138 -0
- package/package.json +90 -0
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
export const componentRegistry = [
|
|
2
|
+
{
|
|
3
|
+
name: "InlineText",
|
|
4
|
+
category: "content",
|
|
5
|
+
stability: "stable",
|
|
6
|
+
description: "Renders short single-line text with controlled inline Markdown.",
|
|
7
|
+
useWhen: ["Titles", "Labels", "Captions", "Short notes", "Inline explanations"],
|
|
8
|
+
props: [
|
|
9
|
+
{
|
|
10
|
+
name: "text",
|
|
11
|
+
type: "string",
|
|
12
|
+
contentType: "inlineMarkdown",
|
|
13
|
+
required: true,
|
|
14
|
+
description: "Short text. Supports bold, emphasis, strikethrough, inline code, and links."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "as",
|
|
18
|
+
type: "'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
|
|
19
|
+
description: "Semantic element to render. Use this instead of Markdown headings."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "variant",
|
|
23
|
+
type: "'default' | 'title' | 'subtitle' | 'label' | 'caption'",
|
|
24
|
+
description: "Visual text variant."
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
example: `<InlineText
|
|
28
|
+
as="h3"
|
|
29
|
+
variant="subtitle"
|
|
30
|
+
text="Use **MDX** as source and ~~raw HTML~~ only as fallback."
|
|
31
|
+
/>`
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "MarkdownBody",
|
|
35
|
+
category: "content",
|
|
36
|
+
stability: "stable",
|
|
37
|
+
description: "Renders controlled multi-line Markdown for component body copy.",
|
|
38
|
+
useWhen: ["Component body explanations", "Controlled lists inside components", "Component-local prose"],
|
|
39
|
+
props: [
|
|
40
|
+
{
|
|
41
|
+
name: "body",
|
|
42
|
+
type: "string",
|
|
43
|
+
contentType: "blockMarkdown",
|
|
44
|
+
required: true,
|
|
45
|
+
description: "Multi-line Markdown. Supports headings, paragraphs, lists, blockquotes, bold, emphasis, strikethrough, inline code, and links. Use native MDX children inside Section for document-level prose."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "variant",
|
|
49
|
+
type: "'default' | 'compact'",
|
|
50
|
+
description: "Body density variant."
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
example: `<MarkdownBody
|
|
54
|
+
body={\`Use MarkdownBody when a component needs controlled body copy:
|
|
55
|
+
|
|
56
|
+
- **Readable** paragraphs and lists
|
|
57
|
+
- \\\`inline code\\\` for short technical names
|
|
58
|
+
- Headings for local body sections
|
|
59
|
+
- No tables, HTML, math, or code blocks\`}
|
|
60
|
+
/>`
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "CodeBlock",
|
|
64
|
+
category: "content",
|
|
65
|
+
stability: "stable",
|
|
66
|
+
description: "Renders code text with optional filename, language label, line numbers, and highlighted lines.",
|
|
67
|
+
useWhen: ["Code examples", "Implementation notes", "Technical explanations", "Code review context"],
|
|
68
|
+
props: [
|
|
69
|
+
{
|
|
70
|
+
name: "id",
|
|
71
|
+
type: "string",
|
|
72
|
+
contentType: "plainText",
|
|
73
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as code.example."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "code",
|
|
77
|
+
type: "string",
|
|
78
|
+
contentType: "code",
|
|
79
|
+
required: true,
|
|
80
|
+
description: "Raw code text. Whitespace and indentation are preserved."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "language",
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "Optional language label and future highlighter hook. Does not enable syntax highlighting in v1."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "filename",
|
|
89
|
+
type: "string",
|
|
90
|
+
contentType: "plainText",
|
|
91
|
+
description: "Optional filename shown above the code."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "showLineNumbers",
|
|
95
|
+
type: "boolean",
|
|
96
|
+
description: "Shows one-based line numbers when true."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "highlightLines",
|
|
100
|
+
type: "number[]",
|
|
101
|
+
description: "One-based line numbers to visually emphasize."
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
example: `<CodeBlock
|
|
105
|
+
id="code.artifact-normalizer"
|
|
106
|
+
filename="src/artifact.ts"
|
|
107
|
+
language="ts"
|
|
108
|
+
showLineNumbers
|
|
109
|
+
highlightLines={[2]}
|
|
110
|
+
code={\`export function createArtifact(input: ArtifactInput) {
|
|
111
|
+
return normalizeInput(input);
|
|
112
|
+
}\`}
|
|
113
|
+
/>`
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "DiffBlock",
|
|
117
|
+
category: "content",
|
|
118
|
+
stability: "stable",
|
|
119
|
+
description: "Renders structured diff lines with add, remove, and context rows plus a compact effective line number column.",
|
|
120
|
+
useWhen: ["Code review context", "Patch explanations", "Before and after code changes", "Implementation reports"],
|
|
121
|
+
props: [
|
|
122
|
+
{
|
|
123
|
+
name: "id",
|
|
124
|
+
type: "string",
|
|
125
|
+
contentType: "plainText",
|
|
126
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as diff.patch."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "lines",
|
|
130
|
+
type: "DiffLine[]",
|
|
131
|
+
contentType: "json",
|
|
132
|
+
required: true,
|
|
133
|
+
description: "Structured diff rows. Each row has type, optional oldLine, optional newLine, and content. The UI shows one effective line number."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "filename",
|
|
137
|
+
type: "string",
|
|
138
|
+
contentType: "plainText",
|
|
139
|
+
description: "Optional filename shown above the diff."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "language",
|
|
143
|
+
type: "string",
|
|
144
|
+
description: "Optional language label and future highlighter hook. Does not enable syntax highlighting in v1."
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
types: [
|
|
148
|
+
{
|
|
149
|
+
name: "DiffLine",
|
|
150
|
+
description: "One structured row in a rendered diff.",
|
|
151
|
+
fields: [
|
|
152
|
+
{
|
|
153
|
+
name: "type",
|
|
154
|
+
type: "'add' | 'remove' | 'context'",
|
|
155
|
+
required: true,
|
|
156
|
+
description: "Diff row kind. Use add for inserted lines, remove for deleted lines, and context for unchanged lines."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "oldLine",
|
|
160
|
+
type: "number",
|
|
161
|
+
description: "Original file line number. Required for remove rows and usually present for context rows."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "newLine",
|
|
165
|
+
type: "number",
|
|
166
|
+
description: "New file line number. Required for add rows and usually present for context rows."
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "content",
|
|
170
|
+
type: "string",
|
|
171
|
+
contentType: "code",
|
|
172
|
+
required: true,
|
|
173
|
+
description: "Line content without the leading diff marker."
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
example: `<DiffBlock
|
|
179
|
+
id="diff.exporter"
|
|
180
|
+
filename="src/exporter.ts"
|
|
181
|
+
language="ts"
|
|
182
|
+
lines={[
|
|
183
|
+
{ type: "context", oldLine: 12, newLine: 12, content: "export function serialize(value: unknown) {" },
|
|
184
|
+
{ type: "remove", oldLine: 13, content: " return JSON.stringify(value);" },
|
|
185
|
+
{ type: "add", newLine: 13, content: " return JSON.stringify(value, null, 2);" },
|
|
186
|
+
{ type: "context", oldLine: 14, newLine: 14, content: "}" }
|
|
187
|
+
]}
|
|
188
|
+
/>`
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "SeverityBadge",
|
|
192
|
+
category: "semantic",
|
|
193
|
+
stability: "stable",
|
|
194
|
+
description: "Renders a compact severity, confidence, status, or risk label.",
|
|
195
|
+
useWhen: ["Code review findings", "Risk labels", "Status summaries", "Annotated explanations"],
|
|
196
|
+
props: [
|
|
197
|
+
{
|
|
198
|
+
name: "level",
|
|
199
|
+
type: "'info' | 'low' | 'medium' | 'high' | 'critical'",
|
|
200
|
+
description: "Severity level. Defaults to info."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "label",
|
|
204
|
+
type: "string",
|
|
205
|
+
contentType: "plainText",
|
|
206
|
+
description: "Optional visible label. Defaults to a title-cased version of the level."
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
example: `<SeverityBadge level="high" label="Regression risk" />`
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "Callout",
|
|
213
|
+
category: "semantic",
|
|
214
|
+
stability: "stable",
|
|
215
|
+
description: "Highlights a focused note, warning, recommendation, or risk with controlled Markdown body copy.",
|
|
216
|
+
useWhen: ["Review notes", "Assumptions", "Warnings", "Implementation gotchas", "Recommendations"],
|
|
217
|
+
props: [
|
|
218
|
+
{
|
|
219
|
+
name: "id",
|
|
220
|
+
type: "string",
|
|
221
|
+
contentType: "plainText",
|
|
222
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as callout.risk."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "body",
|
|
226
|
+
type: "string",
|
|
227
|
+
contentType: "blockMarkdown",
|
|
228
|
+
required: true,
|
|
229
|
+
description: "Controlled Markdown body. Use for the message inside the callout."
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "title",
|
|
233
|
+
type: "string",
|
|
234
|
+
contentType: "inlineMarkdown",
|
|
235
|
+
description: "Optional callout title."
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "tone",
|
|
239
|
+
type: "'info' | 'success' | 'warning' | 'danger'",
|
|
240
|
+
description: "Visual tone. Defaults to info."
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
example: `<Callout
|
|
244
|
+
id="callout.review-focus"
|
|
245
|
+
tone="warning"
|
|
246
|
+
title="Review focus"
|
|
247
|
+
body="Check the **export path** before treating this artifact as complete."
|
|
248
|
+
/>`
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "AnnotatedCode",
|
|
252
|
+
category: "semantic",
|
|
253
|
+
stability: "stable",
|
|
254
|
+
description: "Combines a CodeBlock with line-level annotations and severity labels.",
|
|
255
|
+
useWhen: ["Code explanations", "Review focus areas", "Implementation walkthroughs", "Risk notes tied to code lines"],
|
|
256
|
+
props: [
|
|
257
|
+
{
|
|
258
|
+
name: "id",
|
|
259
|
+
type: "string",
|
|
260
|
+
contentType: "plainText",
|
|
261
|
+
description: "Optional stable anchor id for comments and state. Child code and annotation anchors derive from this id."
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "code",
|
|
265
|
+
type: "string",
|
|
266
|
+
contentType: "code",
|
|
267
|
+
required: true,
|
|
268
|
+
description: "Raw code text. Whitespace and indentation are preserved."
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
name: "annotations",
|
|
272
|
+
type: "CodeAnnotation[]",
|
|
273
|
+
contentType: "json",
|
|
274
|
+
required: true,
|
|
275
|
+
description: "Line-level annotations with line, optional title, Markdown body, and optional severity."
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "language",
|
|
279
|
+
type: "string",
|
|
280
|
+
description: "Optional language label passed through to CodeBlock."
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: "filename",
|
|
284
|
+
type: "string",
|
|
285
|
+
contentType: "plainText",
|
|
286
|
+
description: "Optional filename shown above the code."
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "showLineNumbers",
|
|
290
|
+
type: "boolean",
|
|
291
|
+
description: "Shows line numbers. Defaults to true."
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: "highlightLines",
|
|
295
|
+
type: "number[]",
|
|
296
|
+
description: "Additional one-based line numbers to visually emphasize."
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
types: [
|
|
300
|
+
{
|
|
301
|
+
name: "CodeAnnotation",
|
|
302
|
+
description: "Line-level explanation attached to a CodeBlock line.",
|
|
303
|
+
fields: [
|
|
304
|
+
{
|
|
305
|
+
name: "id",
|
|
306
|
+
type: "string",
|
|
307
|
+
contentType: "plainText",
|
|
308
|
+
description: "Optional stable child anchor id. When AnnotatedCode has id, child anchors become parentId.annotationId."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "line",
|
|
312
|
+
type: "number",
|
|
313
|
+
required: true,
|
|
314
|
+
description: "One-based line number in the code string."
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "body",
|
|
318
|
+
type: "string",
|
|
319
|
+
contentType: "blockMarkdown",
|
|
320
|
+
required: true,
|
|
321
|
+
description: "Controlled Markdown explanation for this line."
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: "title",
|
|
325
|
+
type: "string",
|
|
326
|
+
contentType: "inlineMarkdown",
|
|
327
|
+
description: "Optional short annotation title."
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "severity",
|
|
331
|
+
type: "'info' | 'low' | 'medium' | 'high' | 'critical'",
|
|
332
|
+
description: "Optional severity label. Defaults to info in the rendered badge."
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
example: `<AnnotatedCode
|
|
338
|
+
id="code.export-panel"
|
|
339
|
+
filename="src/export-panel.ts"
|
|
340
|
+
language="ts"
|
|
341
|
+
code={\`export function copyOutput(value: string) {
|
|
342
|
+
return navigator.clipboard.writeText(value);
|
|
343
|
+
}\`}
|
|
344
|
+
annotations={[
|
|
345
|
+
{
|
|
346
|
+
id: "clipboard-boundary",
|
|
347
|
+
line: 2,
|
|
348
|
+
severity: "medium",
|
|
349
|
+
title: "Clipboard boundary",
|
|
350
|
+
body: "Keep a fallback for local artifact previews."
|
|
351
|
+
}
|
|
352
|
+
]}
|
|
353
|
+
/>`
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: "Stack",
|
|
357
|
+
category: "layout",
|
|
358
|
+
stability: "advanced",
|
|
359
|
+
description: "Arranges children in a single vertical column with controlled spacing and alignment.",
|
|
360
|
+
useWhen: ["Advanced composition", "Vertical sections", "Storybook layout checks"],
|
|
361
|
+
props: [
|
|
362
|
+
{
|
|
363
|
+
name: "children",
|
|
364
|
+
type: "ReactNode",
|
|
365
|
+
required: true,
|
|
366
|
+
description: "Content to arrange vertically."
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "gap",
|
|
370
|
+
type: "'sm' | 'md' | 'lg'",
|
|
371
|
+
description: "Spacing between children. Defaults to md."
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: "align",
|
|
375
|
+
type: "'start' | 'center' | 'stretch'",
|
|
376
|
+
description: "Horizontal child alignment. Defaults to stretch."
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
example: `<Stack gap="md">
|
|
380
|
+
<MarkdownBody body="Use semantic components first." />
|
|
381
|
+
<ExportPanel value={{ status: "ready" }} />
|
|
382
|
+
</Stack>`
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "Columns",
|
|
386
|
+
category: "layout",
|
|
387
|
+
stability: "advanced",
|
|
388
|
+
description: "Arranges children in ratio-based columns that collapse responsively.",
|
|
389
|
+
useWhen: ["Advanced composition", "Main and supporting content", "Side-by-side artifact sections"],
|
|
390
|
+
props: [
|
|
391
|
+
{
|
|
392
|
+
name: "children",
|
|
393
|
+
type: "ReactNode",
|
|
394
|
+
required: true,
|
|
395
|
+
description: "Content to arrange into columns."
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: "ratio",
|
|
399
|
+
type: "'1:1' | '1:1:1' | '1:1:1:1' | '2:1' | '3:1' | '3:1:1' | '1:3:1' | '1:1:3'",
|
|
400
|
+
description: "Column ratio. Defaults to 1:1."
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "gap",
|
|
404
|
+
type: "'sm' | 'md' | 'lg'",
|
|
405
|
+
description: "Spacing between columns. Defaults to md."
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: "collapseAt",
|
|
409
|
+
type: "'sm' | 'md' | 'lg'",
|
|
410
|
+
description: "Viewport size where columns collapse to one column. Defaults to md."
|
|
411
|
+
}
|
|
412
|
+
],
|
|
413
|
+
example: `<Columns ratio="3:1" gap="md">
|
|
414
|
+
<MarkdownBody body="Main explanation." />
|
|
415
|
+
<Frame surface="subtle">Supporting notes</Frame>
|
|
416
|
+
</Columns>`
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: "Grid",
|
|
420
|
+
category: "layout",
|
|
421
|
+
stability: "advanced",
|
|
422
|
+
description: "Arranges children in equal-width two, three, or four column grids.",
|
|
423
|
+
useWhen: ["Advanced composition", "Equal alternative cards", "Preview groups"],
|
|
424
|
+
props: [
|
|
425
|
+
{
|
|
426
|
+
name: "children",
|
|
427
|
+
type: "ReactNode",
|
|
428
|
+
required: true,
|
|
429
|
+
description: "Content to arrange into equal columns."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "columns",
|
|
433
|
+
type: "2 | 3 | 4",
|
|
434
|
+
description: "Number of equal columns. Defaults to 2."
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: "gap",
|
|
438
|
+
type: "'sm' | 'md' | 'lg'",
|
|
439
|
+
description: "Spacing between grid items. Defaults to md."
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: "collapseAt",
|
|
443
|
+
type: "'sm' | 'md' | 'lg'",
|
|
444
|
+
description: "Viewport size where the grid collapses to one column. Defaults to md."
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
example: `<Grid columns={3}>
|
|
448
|
+
<Frame>Variant A</Frame>
|
|
449
|
+
<Frame>Variant B</Frame>
|
|
450
|
+
<Frame>Variant C</Frame>
|
|
451
|
+
</Grid>`
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "SplitPane",
|
|
455
|
+
category: "layout",
|
|
456
|
+
stability: "advanced",
|
|
457
|
+
description: "Arranges children into a two-pane layout with a controlled ratio.",
|
|
458
|
+
useWhen: ["Advanced composition", "Main content with sidebar", "Editor and preview layouts"],
|
|
459
|
+
props: [
|
|
460
|
+
{
|
|
461
|
+
name: "children",
|
|
462
|
+
type: "ReactNode",
|
|
463
|
+
required: true,
|
|
464
|
+
description: "Two panes to arrange."
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "ratio",
|
|
468
|
+
type: "'1:1' | '2:1' | '3:1' | '1:2' | '1:3'",
|
|
469
|
+
description: "Pane ratio. Defaults to 3:1."
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "gap",
|
|
473
|
+
type: "'sm' | 'md' | 'lg'",
|
|
474
|
+
description: "Spacing between panes. Defaults to md."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "collapseAt",
|
|
478
|
+
type: "'sm' | 'md' | 'lg'",
|
|
479
|
+
description: "Viewport size where panes collapse to one column. Defaults to md."
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
example: `<SplitPane ratio="3:1">
|
|
483
|
+
<MarkdownBody body="Primary reading surface." />
|
|
484
|
+
<Frame surface="outlined">Sidebar</Frame>
|
|
485
|
+
</SplitPane>`
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "Frame",
|
|
489
|
+
category: "layout",
|
|
490
|
+
stability: "advanced",
|
|
491
|
+
description: "Provides a stable visual boundary for previews, snippets, mockups, or charts.",
|
|
492
|
+
useWhen: ["Advanced composition", "Preview boundaries", "Code or mockup framing"],
|
|
493
|
+
props: [
|
|
494
|
+
{
|
|
495
|
+
name: "children",
|
|
496
|
+
type: "ReactNode",
|
|
497
|
+
required: true,
|
|
498
|
+
description: "Content to frame."
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
name: "surface",
|
|
502
|
+
type: "'none' | 'plain' | 'subtle' | 'outlined'",
|
|
503
|
+
description: "Visual surface treatment. Defaults to outlined."
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
name: "padding",
|
|
507
|
+
type: "'none' | 'sm' | 'md' | 'lg'",
|
|
508
|
+
description: "Inner spacing. Defaults to md."
|
|
509
|
+
}
|
|
510
|
+
],
|
|
511
|
+
example: `<Frame surface="outlined" padding="md">
|
|
512
|
+
<MarkdownBody body="A framed preview." />
|
|
513
|
+
</Frame>`
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: "CommentLayer",
|
|
517
|
+
category: "artifact",
|
|
518
|
+
stability: "stable",
|
|
519
|
+
description: "Provides local browser comment state for block-level artifact feedback. Artifact and Storybook shells provide this automatically.",
|
|
520
|
+
useWhen: ["Custom React shells", "Reviewable artifacts", "Block-level user feedback", "Agent handoff comments"],
|
|
521
|
+
props: [
|
|
522
|
+
{
|
|
523
|
+
name: "children",
|
|
524
|
+
type: "ReactNode",
|
|
525
|
+
required: true,
|
|
526
|
+
description: "CommentableBlock and CommentExport children that share one local comment state. Most MDX authors should rely on the artifact shell instead of writing this manually."
|
|
527
|
+
}
|
|
528
|
+
],
|
|
529
|
+
example: `// Usually provided by the artifact shell.
|
|
530
|
+
<CommentLayer>
|
|
531
|
+
<CommentableBlock blockId="decision" title="Decision">
|
|
532
|
+
<DecisionMatrix question="Choose a path" options={[]} />
|
|
533
|
+
</CommentableBlock>
|
|
534
|
+
<CommentExport />
|
|
535
|
+
</CommentLayer>`
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: "Section",
|
|
539
|
+
category: "artifact",
|
|
540
|
+
stability: "stable",
|
|
541
|
+
description: "Defines a stable reviewable document section for native MDX prose.",
|
|
542
|
+
useWhen: ["Reviewable native MDX prose", "Stable Markdown anchors", "Document structure", "Block-level feedback"],
|
|
543
|
+
props: [
|
|
544
|
+
{
|
|
545
|
+
name: "id",
|
|
546
|
+
type: "string",
|
|
547
|
+
contentType: "plainText",
|
|
548
|
+
required: true,
|
|
549
|
+
description: "Stable unique anchor id for this section within one artifact."
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
name: "children",
|
|
553
|
+
type: "ReactNode",
|
|
554
|
+
required: true,
|
|
555
|
+
description: "Native MDX prose or composed content that belongs to this section. Put the native Markdown heading inside the Section."
|
|
556
|
+
}
|
|
557
|
+
],
|
|
558
|
+
example: `<Section id="context">
|
|
559
|
+
|
|
560
|
+
## Context
|
|
561
|
+
|
|
562
|
+
This section can contain native MDX paragraphs, lists, and code fences.
|
|
563
|
+
|
|
564
|
+
- Stable review anchor
|
|
565
|
+
- Native Markdown heading
|
|
566
|
+
- One comment thread per section
|
|
567
|
+
|
|
568
|
+
</Section>`
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: "CommentableBlock",
|
|
572
|
+
category: "artifact",
|
|
573
|
+
stability: "stable",
|
|
574
|
+
description: "Wraps any artifact content with a stable block target and hover-revealed local comment input.",
|
|
575
|
+
useWhen: ["Commenting on existing components", "Commenting on prose blocks", "Exporting block-level feedback"],
|
|
576
|
+
props: [
|
|
577
|
+
{
|
|
578
|
+
name: "blockId",
|
|
579
|
+
type: "string",
|
|
580
|
+
contentType: "plainText",
|
|
581
|
+
required: true,
|
|
582
|
+
description: "Stable unique identifier for this comment target within one artifact."
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
name: "title",
|
|
586
|
+
type: "string",
|
|
587
|
+
contentType: "inlineMarkdown",
|
|
588
|
+
required: true,
|
|
589
|
+
description: "Human-readable block title shown in the UI and exported comments."
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: "description",
|
|
593
|
+
type: "string",
|
|
594
|
+
contentType: "plainText",
|
|
595
|
+
description: "Optional block context exported with comments."
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
name: "children",
|
|
599
|
+
type: "ReactNode",
|
|
600
|
+
required: true,
|
|
601
|
+
description: "The prose, semantic component, or layout composition being reviewed."
|
|
602
|
+
}
|
|
603
|
+
],
|
|
604
|
+
example: `<CommentableBlock
|
|
605
|
+
blockId="component-menu"
|
|
606
|
+
title="Component menu"
|
|
607
|
+
description="Feedback on the option grid"
|
|
608
|
+
>
|
|
609
|
+
<OptionGrid title="Components" options={[]} />
|
|
610
|
+
</CommentableBlock>`
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: "CommentTarget",
|
|
614
|
+
category: "artifact",
|
|
615
|
+
stability: "stable",
|
|
616
|
+
description: "Marks a fine-grained comment target with hover affordance and persistent comment count.",
|
|
617
|
+
useWhen: ["Component internals", "Fine-grained review targets", "Custom local component comment anchors"],
|
|
618
|
+
props: [
|
|
619
|
+
{
|
|
620
|
+
name: "targetId",
|
|
621
|
+
type: "string",
|
|
622
|
+
contentType: "plainText",
|
|
623
|
+
required: true,
|
|
624
|
+
description: "Stable unique identifier for this fine-grained comment target within one artifact."
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
name: "title",
|
|
628
|
+
type: "string",
|
|
629
|
+
contentType: "inlineMarkdown",
|
|
630
|
+
required: true,
|
|
631
|
+
description: "Human-readable target title shown in the form and exported comments."
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: "description",
|
|
635
|
+
type: "string",
|
|
636
|
+
contentType: "plainText",
|
|
637
|
+
description: "Optional target context exported with comments."
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: "children",
|
|
641
|
+
type: "ReactNode",
|
|
642
|
+
required: true,
|
|
643
|
+
description: "The smallest visible content block being reviewed."
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
example: `<CommentTarget targetId="decision-explicit-blocks" title="Explicit blocks">
|
|
647
|
+
<Frame surface="outlined">Small reviewable block</Frame>
|
|
648
|
+
</CommentTarget>`
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: "CommentExport",
|
|
652
|
+
category: "artifact",
|
|
653
|
+
stability: "stable",
|
|
654
|
+
description: "Compatibility dock for exporting comments from the nearest CommentLayer. Prefer ExportPanel when an artifact also has result output.",
|
|
655
|
+
useWhen: ["Comments-only artifacts", "Legacy comment handoff", "Copying review comments without a result export"],
|
|
656
|
+
props: [
|
|
657
|
+
{
|
|
658
|
+
name: "title",
|
|
659
|
+
type: "string",
|
|
660
|
+
contentType: "inlineMarkdown",
|
|
661
|
+
description: "Comment export drawer title. Defaults to Export Comments."
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
name: "formats",
|
|
665
|
+
type: "Array<'markdown' | 'json'>",
|
|
666
|
+
description: "Available comment export formats. Defaults to markdown and json."
|
|
667
|
+
}
|
|
668
|
+
],
|
|
669
|
+
types: [
|
|
670
|
+
{
|
|
671
|
+
name: "ArtifactComment",
|
|
672
|
+
description: "One block-level comment exported from CommentLayer.",
|
|
673
|
+
fields: [
|
|
674
|
+
{
|
|
675
|
+
name: "blockId",
|
|
676
|
+
type: "string",
|
|
677
|
+
contentType: "plainText",
|
|
678
|
+
required: true,
|
|
679
|
+
description: "Stable identifier for the commented block."
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "blockTitle",
|
|
683
|
+
type: "string",
|
|
684
|
+
contentType: "plainText",
|
|
685
|
+
required: true,
|
|
686
|
+
description: "Human-readable title for the commented block."
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
name: "blockDescription",
|
|
690
|
+
type: "string",
|
|
691
|
+
contentType: "plainText",
|
|
692
|
+
description: "Optional block context."
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: "comment",
|
|
696
|
+
type: "string",
|
|
697
|
+
contentType: "plainText",
|
|
698
|
+
required: true,
|
|
699
|
+
description: "User-entered block-level comment."
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "createdAt",
|
|
703
|
+
type: "string",
|
|
704
|
+
description: "ISO timestamp created in the browser when the comment is added."
|
|
705
|
+
}
|
|
706
|
+
]
|
|
707
|
+
}
|
|
708
|
+
],
|
|
709
|
+
example: `<CommentExport
|
|
710
|
+
title="Export artifact feedback"
|
|
711
|
+
formats={["markdown", "json"]}
|
|
712
|
+
/>`
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
name: "DecisionMatrix",
|
|
716
|
+
category: "artifact",
|
|
717
|
+
stability: "stable",
|
|
718
|
+
description: "Compares options by pros, cons, risks, confidence, and recommendation.",
|
|
719
|
+
useWhen: ["Architecture decisions", "Product tradeoffs", "Implementation planning", "Open-source roadmap"],
|
|
720
|
+
props: [
|
|
721
|
+
{
|
|
722
|
+
name: "id",
|
|
723
|
+
type: "string",
|
|
724
|
+
contentType: "plainText",
|
|
725
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as decision.comment-targets."
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
name: "question",
|
|
729
|
+
type: "string",
|
|
730
|
+
contentType: "inlineMarkdown",
|
|
731
|
+
required: true,
|
|
732
|
+
description: "The decision question being answered."
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: "options",
|
|
736
|
+
type: "DecisionMatrixOption[]",
|
|
737
|
+
required: true,
|
|
738
|
+
description: "Options to compare. Each option can include name, pros, cons, risks, confidence, and verdict."
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
types: [
|
|
742
|
+
{
|
|
743
|
+
name: "DecisionMatrixOption",
|
|
744
|
+
description: "One option in a decision comparison.",
|
|
745
|
+
fields: [
|
|
746
|
+
{
|
|
747
|
+
name: "id",
|
|
748
|
+
type: "string",
|
|
749
|
+
contentType: "plainText",
|
|
750
|
+
description: "Optional stable child anchor id. When the parent has id, child anchors become parentId.optionId."
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
name: "name",
|
|
754
|
+
type: "string",
|
|
755
|
+
contentType: "inlineMarkdown",
|
|
756
|
+
required: true,
|
|
757
|
+
description: "Option title."
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
name: "summary",
|
|
761
|
+
type: "string",
|
|
762
|
+
contentType: "inlineMarkdown",
|
|
763
|
+
description: "Short option summary."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "pros",
|
|
767
|
+
type: "string[]",
|
|
768
|
+
contentType: "inlineMarkdown",
|
|
769
|
+
description: "Advantages for this option."
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "cons",
|
|
773
|
+
type: "string[]",
|
|
774
|
+
contentType: "inlineMarkdown",
|
|
775
|
+
description: "Disadvantages for this option."
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
name: "risks",
|
|
779
|
+
type: "string[]",
|
|
780
|
+
contentType: "inlineMarkdown",
|
|
781
|
+
description: "Risks or failure modes for this option."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
name: "confidence",
|
|
785
|
+
type: "'low' | 'medium' | 'high'",
|
|
786
|
+
description: "Confidence level for this option."
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "verdict",
|
|
790
|
+
type: "string",
|
|
791
|
+
contentType: "inlineMarkdown",
|
|
792
|
+
description: "Short recommendation or conclusion for this option."
|
|
793
|
+
}
|
|
794
|
+
]
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
example: `<DecisionMatrix
|
|
798
|
+
id="decision.stage-one"
|
|
799
|
+
question="Should the first stage focus on a Vite single HTML artifact?"
|
|
800
|
+
options={[
|
|
801
|
+
{
|
|
802
|
+
id: "vite",
|
|
803
|
+
name: "Vite single HTML artifact",
|
|
804
|
+
pros: ["Short feedback loop", "Direct component debugging"],
|
|
805
|
+
cons: ["No docs-site navigation yet"],
|
|
806
|
+
confidence: "high",
|
|
807
|
+
verdict: "Recommended for stage one"
|
|
808
|
+
}
|
|
809
|
+
]}
|
|
810
|
+
/>`
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: "ComparisonSet",
|
|
814
|
+
category: "artifact",
|
|
815
|
+
stability: "stable",
|
|
816
|
+
description: "Groups comparable candidates while allowing each item to render arbitrary component content.",
|
|
817
|
+
useWhen: ["Candidate comparison", "Mixed media alternatives", "Prototype comparison", "Reviewable option sets"],
|
|
818
|
+
props: [
|
|
819
|
+
{
|
|
820
|
+
name: "id",
|
|
821
|
+
type: "string",
|
|
822
|
+
contentType: "plainText",
|
|
823
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as comparison.content-shapes."
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
name: "title",
|
|
827
|
+
type: "string",
|
|
828
|
+
contentType: "inlineMarkdown",
|
|
829
|
+
required: true,
|
|
830
|
+
description: "Comparison set title."
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
name: "children",
|
|
834
|
+
type: "ReactNode",
|
|
835
|
+
required: true,
|
|
836
|
+
description: "Use `ComparisonSet.Item` children. Each item accepts title, optional value, and arbitrary component content."
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: "columns",
|
|
840
|
+
type: "2 | 3 | 4",
|
|
841
|
+
description: "Number of comparison columns. Defaults to 2."
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
types: [
|
|
845
|
+
{
|
|
846
|
+
name: "ComparisonSet.Item",
|
|
847
|
+
description: "Compound child used inside ComparisonSet.",
|
|
848
|
+
fields: [
|
|
849
|
+
{
|
|
850
|
+
name: "id",
|
|
851
|
+
type: "string",
|
|
852
|
+
contentType: "plainText",
|
|
853
|
+
description: "Optional stable child anchor id. When the parent has id, child anchors become parentId.itemId."
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
name: "title",
|
|
857
|
+
type: "string",
|
|
858
|
+
contentType: "inlineMarkdown",
|
|
859
|
+
required: true,
|
|
860
|
+
description: "Item title."
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: "children",
|
|
864
|
+
type: "ReactNode",
|
|
865
|
+
required: true,
|
|
866
|
+
description: "Arbitrary component content for this comparable item."
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
name: "value",
|
|
870
|
+
type: "string",
|
|
871
|
+
contentType: "plainText",
|
|
872
|
+
description: "Optional stable machine value for future review or export flows."
|
|
873
|
+
}
|
|
874
|
+
]
|
|
875
|
+
}
|
|
876
|
+
],
|
|
877
|
+
example: `<ComparisonSet id="comparison.artifact-forms" title="Compare artifact forms" columns={3}>
|
|
878
|
+
<ComparisonSet.Item id="markdown" title="Markdown explanation" value="markdown">
|
|
879
|
+
<MarkdownBody body="Best for prose-heavy context." />
|
|
880
|
+
</ComparisonSet.Item>
|
|
881
|
+
<ComparisonSet.Item id="code" title="Code path" value="code">
|
|
882
|
+
<Frame surface="subtle">Code renderer or local component</Frame>
|
|
883
|
+
</ComparisonSet.Item>
|
|
884
|
+
</ComparisonSet>`
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
name: "OptionGrid",
|
|
888
|
+
category: "artifact",
|
|
889
|
+
stability: "stable",
|
|
890
|
+
description: "Displays multiple options, component candidates, or prototype directions in a scannable grid.",
|
|
891
|
+
useWhen: ["Option exploration", "Component scope", "Prototype comparison"],
|
|
892
|
+
props: [
|
|
893
|
+
{
|
|
894
|
+
name: "id",
|
|
895
|
+
type: "string",
|
|
896
|
+
contentType: "plainText",
|
|
897
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as option.comment-flow."
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
name: "title",
|
|
901
|
+
type: "string",
|
|
902
|
+
contentType: "inlineMarkdown",
|
|
903
|
+
required: true,
|
|
904
|
+
description: "Grid title."
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
name: "options",
|
|
908
|
+
type: "OptionGridItem[]",
|
|
909
|
+
required: true,
|
|
910
|
+
description: "Items to display. Each item can include name, intent, description, and tradeoffs."
|
|
911
|
+
}
|
|
912
|
+
],
|
|
913
|
+
types: [
|
|
914
|
+
{
|
|
915
|
+
name: "OptionGridItem",
|
|
916
|
+
description: "One option in an OptionGrid.",
|
|
917
|
+
fields: [
|
|
918
|
+
{
|
|
919
|
+
name: "id",
|
|
920
|
+
type: "string",
|
|
921
|
+
contentType: "plainText",
|
|
922
|
+
description: "Optional stable child anchor id. When the parent has id, child anchors become parentId.itemId."
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
name: "name",
|
|
926
|
+
type: "string",
|
|
927
|
+
contentType: "inlineMarkdown",
|
|
928
|
+
required: true,
|
|
929
|
+
description: "Option title."
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
name: "intent",
|
|
933
|
+
type: "string",
|
|
934
|
+
contentType: "inlineMarkdown",
|
|
935
|
+
description: "Short statement of what this option is trying to achieve."
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
name: "description",
|
|
939
|
+
type: "string",
|
|
940
|
+
contentType: "inlineMarkdown",
|
|
941
|
+
description: "Short option description."
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
name: "tradeoffs",
|
|
945
|
+
type: "string[]",
|
|
946
|
+
contentType: "inlineMarkdown",
|
|
947
|
+
description: "Tradeoffs or caveats for this option."
|
|
948
|
+
}
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
],
|
|
952
|
+
example: `<OptionGrid
|
|
953
|
+
id="option.first-components"
|
|
954
|
+
title="First component scope"
|
|
955
|
+
options={[
|
|
956
|
+
{
|
|
957
|
+
id: "export",
|
|
958
|
+
name: "ExportPanel",
|
|
959
|
+
intent: "Return human edits to the workflow",
|
|
960
|
+
tradeoffs: ["Copy-only in v1", "Can add downloads later"]
|
|
961
|
+
}
|
|
962
|
+
]}
|
|
963
|
+
/>`
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
name: "ExportPanel",
|
|
967
|
+
category: "artifact",
|
|
968
|
+
stability: "stable",
|
|
969
|
+
description: "Shows a floating export dock for artifact results and, when comments are available, review comments.",
|
|
970
|
+
useWhen: ["Exporting decisions", "Copying state back to an agent", "Issue or PR handoff", "Configuration handoff", "Exporting comments with artifact results"],
|
|
971
|
+
props: [
|
|
972
|
+
{
|
|
973
|
+
name: "title",
|
|
974
|
+
type: "string",
|
|
975
|
+
contentType: "inlineMarkdown",
|
|
976
|
+
description: "Export drawer title. Defaults to Export Result."
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: "formats",
|
|
980
|
+
type: "Array<'markdown' | 'json'>",
|
|
981
|
+
description: "Available export formats. Defaults to markdown and json."
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
name: "value",
|
|
985
|
+
type: "unknown",
|
|
986
|
+
required: true,
|
|
987
|
+
description: "Structured value to serialize."
|
|
988
|
+
}
|
|
989
|
+
],
|
|
990
|
+
example: `<ExportPanel
|
|
991
|
+
title="Export recommendation"
|
|
992
|
+
formats={["markdown", "json"]}
|
|
993
|
+
value={{
|
|
994
|
+
recommendation: "Start with Vite + React + MDX to single HTML artifact.",
|
|
995
|
+
nextSteps: ["Add CLI component metadata lookup", "Support external CSS injection"]
|
|
996
|
+
}}
|
|
997
|
+
/>`
|
|
998
|
+
}
|
|
999
|
+
];
|
|
1000
|
+
export function findComponentMeta(name) {
|
|
1001
|
+
return componentRegistry.find((component) => component.name.toLowerCase() === name.toLowerCase());
|
|
1002
|
+
}
|