sparkdesign 0.4.8 → 0.4.9
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/cli/registry/AGENTS.md +1 -1
- package/cli/registry/agent-manifest.json +3996 -67
- package/cli/registry/basic/accordion.tsx +79 -0
- package/cli/registry/basic/badge.tsx +49 -0
- package/cli/registry/basic/button.tsx +19 -14
- package/cli/registry/basic/collapsible-card.tsx +10 -1
- package/cli/registry/basic/ellipsis-text.tsx +151 -0
- package/cli/registry/basic/form.tsx +186 -0
- package/cli/registry/basic/icon-button.tsx +12 -4
- package/cli/registry/basic/sidebar.tsx +665 -0
- package/cli/registry/basic/sonner.tsx +10 -10
- package/cli/registry/chat/chat-input/compound.tsx +1 -0
- package/cli/registry/chat/user-question/compound.tsx +2 -0
- package/cli/registry/meta.json +153 -0
- package/dist/registry/basic/accordion.d.ts +15 -0
- package/dist/registry/basic/badge.d.ts +23 -0
- package/dist/registry/basic/ellipsis-text.d.ts +45 -0
- package/dist/registry/basic/form.d.ts +23 -0
- package/dist/registry/basic/icon-button.d.ts +15 -2
- package/dist/registry/basic/item.d.ts +1 -1
- package/dist/registry/basic/sidebar.d.ts +72 -0
- package/dist/registry/basic/tag.d.ts +1 -1
- package/dist/spark-design.cjs.js +24 -27
- package/dist/spark-design.es.js +5353 -4470
- package/dist/sparkdesign.css +1 -1
- package/dist/src/components/basic/Accordion/index.d.ts +13 -0
- package/dist/src/components/basic/Badge/index.d.ts +13 -0
- package/dist/src/components/basic/EllipsisText/index.d.ts +4 -36
- package/dist/src/components/basic/Form/index.d.ts +12 -0
- package/dist/src/components/basic/Sidebar/index.d.ts +13 -0
- package/dist/src/components/index.d.ts +6 -2
- package/docs/agent/component-selection.md +106 -4
- package/package.json +8 -3
- package/registry/agent-manifest.json +3996 -67
- package/cli/registry/chat/user-question/UserQuestionCard.tsx +0 -198
- package/cli/registry/chat/user-question/UserQuestionFooter.tsx +0 -66
- package/cli/registry/chat/user-question/UserQuestionHeader.tsx +0 -64
- package/cli/registry/chat/user-question/useUserQuestionState.ts +0 -165
- package/dist/registry/chat/user-question/UserQuestionCard.d.ts +0 -36
- package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +0 -24
- package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +0 -26
- package/dist/registry/chat/user-question/useUserQuestionState.d.ts +0 -26
- package/dist/src/components/basic/CollapsibleSection/index.d.ts +0 -43
- package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +0 -12
|
@@ -110,6 +110,307 @@
|
|
|
110
110
|
"Prefer Toast for ephemeral success notifications."
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
|
+
"alert-dialog": {
|
|
114
|
+
"id": "alert-dialog",
|
|
115
|
+
"name": "AlertDialog",
|
|
116
|
+
"category": "basic",
|
|
117
|
+
"status": "stable",
|
|
118
|
+
"intent": "Modal confirmation surface for destructive, risky, or irreversible user decisions.",
|
|
119
|
+
"packageImport": "import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from 'sparkdesign'",
|
|
120
|
+
"cliAdd": "npx sparkdesign@latest add alert-dialog",
|
|
121
|
+
"slots": [
|
|
122
|
+
"AlertDialog",
|
|
123
|
+
"AlertDialogTrigger",
|
|
124
|
+
"AlertDialogContent",
|
|
125
|
+
"AlertDialogTitle",
|
|
126
|
+
"AlertDialogDescription",
|
|
127
|
+
"AlertDialogAction",
|
|
128
|
+
"AlertDialogCancel"
|
|
129
|
+
],
|
|
130
|
+
"states": [
|
|
131
|
+
"open",
|
|
132
|
+
"closed",
|
|
133
|
+
"focus-trapped",
|
|
134
|
+
"destructive",
|
|
135
|
+
"loading by composition"
|
|
136
|
+
],
|
|
137
|
+
"a11y": [
|
|
138
|
+
"Always provide AlertDialogTitle.",
|
|
139
|
+
"Use AlertDialogDescription to explain the consequence.",
|
|
140
|
+
"Keep cancel and confirm actions keyboard reachable.",
|
|
141
|
+
"Return focus to the trigger after close."
|
|
142
|
+
],
|
|
143
|
+
"composition": [
|
|
144
|
+
"Button",
|
|
145
|
+
"IconButton",
|
|
146
|
+
"DropdownMenu",
|
|
147
|
+
"PermissionCard",
|
|
148
|
+
"Alert"
|
|
149
|
+
],
|
|
150
|
+
"antiPatterns": [
|
|
151
|
+
"Do not use AlertDialog for ordinary passive information; use Dialog or Alert.",
|
|
152
|
+
"Do not hide the cancel action for destructive decisions.",
|
|
153
|
+
"Do not use vague confirm labels like OK for irreversible actions."
|
|
154
|
+
],
|
|
155
|
+
"agentHints": [
|
|
156
|
+
"Choose AlertDialog when the user must explicitly confirm risk.",
|
|
157
|
+
"Use PermissionCard instead when the confirmation is part of an agent tool approval flow."
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"accordion": {
|
|
161
|
+
"id": "accordion",
|
|
162
|
+
"name": "Accordion",
|
|
163
|
+
"category": "basic",
|
|
164
|
+
"status": "stable",
|
|
165
|
+
"intent": "Tokenized disclosure set for vertically stacked expandable sections.",
|
|
166
|
+
"packageImport": "import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from 'sparkdesign'",
|
|
167
|
+
"cliAdd": "npx sparkdesign@latest add accordion",
|
|
168
|
+
"slots": [
|
|
169
|
+
"Accordion",
|
|
170
|
+
"AccordionItem",
|
|
171
|
+
"AccordionTrigger",
|
|
172
|
+
"AccordionContent"
|
|
173
|
+
],
|
|
174
|
+
"states": [
|
|
175
|
+
"single",
|
|
176
|
+
"multiple",
|
|
177
|
+
"expanded item",
|
|
178
|
+
"collapsed item",
|
|
179
|
+
"disabled item",
|
|
180
|
+
"collapsible"
|
|
181
|
+
],
|
|
182
|
+
"a11y": [
|
|
183
|
+
"Use trigger text that describes the hidden content.",
|
|
184
|
+
"Keep keyboard activation available on every trigger.",
|
|
185
|
+
"Do not hide required errors or critical instructions without a visible summary."
|
|
186
|
+
],
|
|
187
|
+
"composition": [
|
|
188
|
+
"Card",
|
|
189
|
+
"Separator",
|
|
190
|
+
"Badge",
|
|
191
|
+
"Button"
|
|
192
|
+
],
|
|
193
|
+
"antiPatterns": [
|
|
194
|
+
"Do not use Accordion as primary app navigation.",
|
|
195
|
+
"Do not collapse content that users must compare side by side.",
|
|
196
|
+
"Do not nest many accordions without clear hierarchy."
|
|
197
|
+
],
|
|
198
|
+
"agentHints": [
|
|
199
|
+
"Choose Accordion for FAQ, settings, and grouped details.",
|
|
200
|
+
"Use Collapsible for one independent disclosure and Collapse for Spark's existing collapse pattern."
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
"aspect-ratio": {
|
|
204
|
+
"id": "aspect-ratio",
|
|
205
|
+
"name": "AspectRatio",
|
|
206
|
+
"category": "basic",
|
|
207
|
+
"status": "stable",
|
|
208
|
+
"intent": "Responsive media or preview frame that preserves a fixed width-to-height ratio.",
|
|
209
|
+
"packageImport": "import { AspectRatio } from 'sparkdesign'",
|
|
210
|
+
"cliAdd": "npx sparkdesign@latest add aspect-ratio",
|
|
211
|
+
"slots": [
|
|
212
|
+
"AspectRatio",
|
|
213
|
+
"media content",
|
|
214
|
+
"overlay by composition"
|
|
215
|
+
],
|
|
216
|
+
"states": [
|
|
217
|
+
"fixed ratio",
|
|
218
|
+
"responsive width",
|
|
219
|
+
"loading by composition",
|
|
220
|
+
"empty by composition"
|
|
221
|
+
],
|
|
222
|
+
"a11y": [
|
|
223
|
+
"Keep image and media children semantically labeled.",
|
|
224
|
+
"Do not crop important content without an accessible alternative.",
|
|
225
|
+
"Preserve keyboard access for interactive children."
|
|
226
|
+
],
|
|
227
|
+
"composition": [
|
|
228
|
+
"Skeleton",
|
|
229
|
+
"Empty",
|
|
230
|
+
"Card",
|
|
231
|
+
"GeneratedImagesGrid"
|
|
232
|
+
],
|
|
233
|
+
"antiPatterns": [
|
|
234
|
+
"Do not use AspectRatio for arbitrary spacing.",
|
|
235
|
+
"Do not hard-code fixed pixel heights when a ratio should preserve media shape.",
|
|
236
|
+
"Do not place long text content inside a forced media ratio."
|
|
237
|
+
],
|
|
238
|
+
"agentHints": [
|
|
239
|
+
"Choose AspectRatio for thumbnails, generated image previews, video embeds, and fixed-ratio canvases.",
|
|
240
|
+
"Pair with Skeleton while media loads."
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
"avatar": {
|
|
244
|
+
"id": "avatar",
|
|
245
|
+
"name": "Avatar",
|
|
246
|
+
"category": "basic",
|
|
247
|
+
"status": "stable",
|
|
248
|
+
"intent": "User, agent, organization, or entity identity marker with image, fallback, badge, and group support.",
|
|
249
|
+
"packageImport": "import { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup } from 'sparkdesign'",
|
|
250
|
+
"cliAdd": "npx sparkdesign@latest add avatar",
|
|
251
|
+
"slots": [
|
|
252
|
+
"Avatar",
|
|
253
|
+
"AvatarImage",
|
|
254
|
+
"AvatarFallback",
|
|
255
|
+
"AvatarBadge",
|
|
256
|
+
"AvatarGroup",
|
|
257
|
+
"AvatarGroupCount"
|
|
258
|
+
],
|
|
259
|
+
"states": [
|
|
260
|
+
"image loaded",
|
|
261
|
+
"fallback",
|
|
262
|
+
"with badge",
|
|
263
|
+
"grouped",
|
|
264
|
+
"overflow count"
|
|
265
|
+
],
|
|
266
|
+
"a11y": [
|
|
267
|
+
"Provide meaningful alt text for identity images when the image adds information.",
|
|
268
|
+
"Use fallback text that remains understandable when the image fails.",
|
|
269
|
+
"Do not rely on badge color alone to communicate status."
|
|
270
|
+
],
|
|
271
|
+
"composition": [
|
|
272
|
+
"HoverCard",
|
|
273
|
+
"Tooltip",
|
|
274
|
+
"UserMessage",
|
|
275
|
+
"Card"
|
|
276
|
+
],
|
|
277
|
+
"antiPatterns": [
|
|
278
|
+
"Do not use Avatar as a decorative icon when identity is not involved.",
|
|
279
|
+
"Do not place unrelated badges on an avatar without a visible explanation.",
|
|
280
|
+
"Do not use tiny fallback text that cannot be read."
|
|
281
|
+
],
|
|
282
|
+
"agentHints": [
|
|
283
|
+
"Choose Avatar for people, agents, teams, providers, and collaborators.",
|
|
284
|
+
"Use AvatarGroup when multiple identities share ownership or presence."
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
"badge": {
|
|
288
|
+
"id": "badge",
|
|
289
|
+
"name": "Badge",
|
|
290
|
+
"category": "basic",
|
|
291
|
+
"status": "stable",
|
|
292
|
+
"intent": "Compact Spark label for status, category, count, or short metadata.",
|
|
293
|
+
"packageImport": "import { Badge } from 'sparkdesign'",
|
|
294
|
+
"cliAdd": "npx sparkdesign@latest add badge",
|
|
295
|
+
"slots": [
|
|
296
|
+
"Badge",
|
|
297
|
+
"label",
|
|
298
|
+
"icon by composition"
|
|
299
|
+
],
|
|
300
|
+
"states": [
|
|
301
|
+
"default",
|
|
302
|
+
"secondary",
|
|
303
|
+
"destructive",
|
|
304
|
+
"outline",
|
|
305
|
+
"asChild"
|
|
306
|
+
],
|
|
307
|
+
"a11y": [
|
|
308
|
+
"Use readable text inside every badge.",
|
|
309
|
+
"Do not rely on badge color alone for status meaning.",
|
|
310
|
+
"Keep destructive badges reserved for real risk or error state."
|
|
311
|
+
],
|
|
312
|
+
"composition": [
|
|
313
|
+
"Card",
|
|
314
|
+
"Item",
|
|
315
|
+
"DataTable",
|
|
316
|
+
"Tooltip"
|
|
317
|
+
],
|
|
318
|
+
"antiPatterns": [
|
|
319
|
+
"Do not use Badge as an action button.",
|
|
320
|
+
"Do not use many badge colors without a clear taxonomy.",
|
|
321
|
+
"Do not use Badge for removable tokens; use Tag when close behavior is needed."
|
|
322
|
+
],
|
|
323
|
+
"agentHints": [
|
|
324
|
+
"Choose Badge for non-interactive labels and statuses.",
|
|
325
|
+
"Choose Tag when the label is closable or needs richer color taxonomy."
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"breadcrumb": {
|
|
329
|
+
"id": "breadcrumb",
|
|
330
|
+
"name": "Breadcrumb",
|
|
331
|
+
"category": "basic",
|
|
332
|
+
"status": "stable",
|
|
333
|
+
"intent": "Hierarchical navigation trail showing the current page or resource location.",
|
|
334
|
+
"packageImport": "import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage } from 'sparkdesign'",
|
|
335
|
+
"cliAdd": "npx sparkdesign@latest add breadcrumb",
|
|
336
|
+
"slots": [
|
|
337
|
+
"Breadcrumb",
|
|
338
|
+
"BreadcrumbList",
|
|
339
|
+
"BreadcrumbItem",
|
|
340
|
+
"BreadcrumbLink",
|
|
341
|
+
"BreadcrumbPage",
|
|
342
|
+
"BreadcrumbSeparator",
|
|
343
|
+
"BreadcrumbEllipsis"
|
|
344
|
+
],
|
|
345
|
+
"states": [
|
|
346
|
+
"linked ancestor",
|
|
347
|
+
"current page",
|
|
348
|
+
"truncated",
|
|
349
|
+
"custom separator"
|
|
350
|
+
],
|
|
351
|
+
"a11y": [
|
|
352
|
+
"Keep the root element labeled as breadcrumb navigation.",
|
|
353
|
+
"Mark only the current page with aria-current.",
|
|
354
|
+
"Use real links for navigable ancestors."
|
|
355
|
+
],
|
|
356
|
+
"composition": [
|
|
357
|
+
"NavigationMenu",
|
|
358
|
+
"DropdownMenu",
|
|
359
|
+
"Tooltip"
|
|
360
|
+
],
|
|
361
|
+
"antiPatterns": [
|
|
362
|
+
"Do not use Breadcrumb for tab navigation or step progress.",
|
|
363
|
+
"Do not make the current page clickable when it represents the current location.",
|
|
364
|
+
"Do not replace the semantic list with plain slash-separated text."
|
|
365
|
+
],
|
|
366
|
+
"agentHints": [
|
|
367
|
+
"Choose Breadcrumb for nested app sections, files, projects, and documentation pages.",
|
|
368
|
+
"Use Pagination for page-by-page result navigation."
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
"button-group": {
|
|
372
|
+
"id": "button-group",
|
|
373
|
+
"name": "ButtonGroup",
|
|
374
|
+
"category": "basic",
|
|
375
|
+
"status": "stable",
|
|
376
|
+
"intent": "Visually connected group of related controls, actions, or inline control text.",
|
|
377
|
+
"packageImport": "import { ButtonGroup, ButtonGroupText, ButtonGroupSeparator } from 'sparkdesign'",
|
|
378
|
+
"cliAdd": "npx sparkdesign@latest add button-group",
|
|
379
|
+
"slots": [
|
|
380
|
+
"ButtonGroup",
|
|
381
|
+
"ButtonGroupText",
|
|
382
|
+
"ButtonGroupSeparator",
|
|
383
|
+
"Button by composition",
|
|
384
|
+
"Input by composition"
|
|
385
|
+
],
|
|
386
|
+
"states": [
|
|
387
|
+
"horizontal",
|
|
388
|
+
"vertical by composition",
|
|
389
|
+
"with separator",
|
|
390
|
+
"mixed controls",
|
|
391
|
+
"disabled child"
|
|
392
|
+
],
|
|
393
|
+
"a11y": [
|
|
394
|
+
"Keep each child control individually labeled.",
|
|
395
|
+
"Use group labels when the relationship is not visually obvious.",
|
|
396
|
+
"Do not remove focus visibility from grouped controls."
|
|
397
|
+
],
|
|
398
|
+
"composition": [
|
|
399
|
+
"Button",
|
|
400
|
+
"IconButton",
|
|
401
|
+
"Input",
|
|
402
|
+
"Tooltip"
|
|
403
|
+
],
|
|
404
|
+
"antiPatterns": [
|
|
405
|
+
"Do not use ButtonGroup for mutually exclusive selected state; use ToggleGroup or RadioGroup.",
|
|
406
|
+
"Do not group unrelated commands just to reduce spacing.",
|
|
407
|
+
"Do not put long form layouts inside a button group."
|
|
408
|
+
],
|
|
409
|
+
"agentHints": [
|
|
410
|
+
"Choose ButtonGroup when controls act as one compact unit.",
|
|
411
|
+
"Use ToggleGroup when the group represents selectable modes."
|
|
412
|
+
]
|
|
413
|
+
},
|
|
113
414
|
"button": {
|
|
114
415
|
"id": "button",
|
|
115
416
|
"name": "Button",
|
|
@@ -151,101 +452,3286 @@
|
|
|
151
452
|
"Pair dangerous actions with AlertDialog or PermissionCard."
|
|
152
453
|
]
|
|
153
454
|
},
|
|
154
|
-
"
|
|
155
|
-
"id": "
|
|
156
|
-
"name": "
|
|
455
|
+
"checkbox": {
|
|
456
|
+
"id": "checkbox",
|
|
457
|
+
"name": "Checkbox",
|
|
157
458
|
"category": "basic",
|
|
158
459
|
"status": "stable",
|
|
159
|
-
"intent": "
|
|
160
|
-
"packageImport": "import {
|
|
161
|
-
"cliAdd": "npx sparkdesign@latest add
|
|
460
|
+
"intent": "Binary form control for independent yes/no choices or multi-select option lists.",
|
|
461
|
+
"packageImport": "import { Checkbox } from 'sparkdesign'",
|
|
462
|
+
"cliAdd": "npx sparkdesign@latest add checkbox",
|
|
463
|
+
"slots": [
|
|
464
|
+
"Checkbox",
|
|
465
|
+
"indicator",
|
|
466
|
+
"label by composition",
|
|
467
|
+
"description by composition"
|
|
468
|
+
],
|
|
469
|
+
"states": [
|
|
470
|
+
"checked",
|
|
471
|
+
"unchecked",
|
|
472
|
+
"indeterminate",
|
|
473
|
+
"disabled",
|
|
474
|
+
"focus-visible",
|
|
475
|
+
"error by composition"
|
|
476
|
+
],
|
|
477
|
+
"a11y": [
|
|
478
|
+
"Pair with Label or aria-label so the purpose is announced.",
|
|
479
|
+
"Use indeterminate only when representing mixed child selection.",
|
|
480
|
+
"Do not rely on the checkmark alone when disabled or error state needs explanation."
|
|
481
|
+
],
|
|
482
|
+
"composition": [
|
|
483
|
+
"Label",
|
|
484
|
+
"Field",
|
|
485
|
+
"Alert",
|
|
486
|
+
"PermissionCard",
|
|
487
|
+
"DataTable"
|
|
488
|
+
],
|
|
489
|
+
"antiPatterns": [
|
|
490
|
+
"Do not use Checkbox for mutually exclusive choices; use RadioGroup.",
|
|
491
|
+
"Do not use Checkbox as a command button.",
|
|
492
|
+
"Do not hide labels for settings that change persistent state."
|
|
493
|
+
],
|
|
494
|
+
"agentHints": [
|
|
495
|
+
"Choose Checkbox when each choice can be toggled independently.",
|
|
496
|
+
"For a single on/off setting with immediate effect, prefer Switch."
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
"collapse": {
|
|
500
|
+
"id": "collapse",
|
|
501
|
+
"name": "Collapse",
|
|
502
|
+
"category": "basic",
|
|
503
|
+
"status": "stable",
|
|
504
|
+
"intent": "Multi-item disclosure set for grouped expandable content such as FAQs, settings, or inspector sections.",
|
|
505
|
+
"packageImport": "import { Collapse, CollapseItem, CollapseTrigger, CollapseContent } from 'sparkdesign'",
|
|
506
|
+
"cliAdd": "npx sparkdesign@latest add collapse",
|
|
162
507
|
"slots": [
|
|
508
|
+
"Collapse",
|
|
509
|
+
"CollapseItem",
|
|
510
|
+
"CollapseTrigger",
|
|
511
|
+
"CollapseContent"
|
|
512
|
+
],
|
|
513
|
+
"states": [
|
|
514
|
+
"expanded item",
|
|
515
|
+
"collapsed item",
|
|
516
|
+
"multiple items",
|
|
517
|
+
"single item by composition",
|
|
518
|
+
"disabled by composition"
|
|
519
|
+
],
|
|
520
|
+
"a11y": [
|
|
521
|
+
"Use trigger text that describes the hidden content.",
|
|
522
|
+
"Keep keyboard activation available on every trigger.",
|
|
523
|
+
"Do not hide critical errors or required fields in collapsed sections without an indicator."
|
|
524
|
+
],
|
|
525
|
+
"composition": [
|
|
163
526
|
"Card",
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"
|
|
527
|
+
"Field",
|
|
528
|
+
"IconButton",
|
|
529
|
+
"Separator"
|
|
530
|
+
],
|
|
531
|
+
"antiPatterns": [
|
|
532
|
+
"Do not use Collapse as primary navigation.",
|
|
533
|
+
"Do not collapse tiny content that should simply remain visible.",
|
|
534
|
+
"Do not nest many collapse sets without clear hierarchy."
|
|
535
|
+
],
|
|
536
|
+
"agentHints": [
|
|
537
|
+
"Choose Collapse for repeated expandable sections.",
|
|
538
|
+
"Use Collapsible for one independent disclosure region."
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
"collapsible": {
|
|
542
|
+
"id": "collapsible",
|
|
543
|
+
"name": "Collapsible",
|
|
544
|
+
"category": "basic",
|
|
545
|
+
"status": "stable",
|
|
546
|
+
"intent": "Single independent disclosure primitive for showing or hiding nearby content.",
|
|
547
|
+
"packageImport": "import { Collapsible, CollapsibleTrigger, CollapsibleContent } from 'sparkdesign'",
|
|
548
|
+
"cliAdd": "npx sparkdesign@latest add collapsible",
|
|
549
|
+
"slots": [
|
|
550
|
+
"Collapsible",
|
|
551
|
+
"CollapsibleTrigger",
|
|
552
|
+
"CollapsibleContent"
|
|
170
553
|
],
|
|
171
554
|
"states": [
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
555
|
+
"open",
|
|
556
|
+
"closed",
|
|
557
|
+
"controlled",
|
|
558
|
+
"uncontrolled",
|
|
559
|
+
"disabled by composition"
|
|
176
560
|
],
|
|
177
561
|
"a11y": [
|
|
178
|
-
"Use
|
|
179
|
-
"
|
|
180
|
-
"
|
|
562
|
+
"Use a button-like trigger with clear text or aria-label.",
|
|
563
|
+
"Keep the expanded content close to its trigger in the DOM.",
|
|
564
|
+
"Do not hide content required to understand the current task."
|
|
181
565
|
],
|
|
182
566
|
"composition": [
|
|
183
567
|
"Button",
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"Skeleton",
|
|
188
|
-
"Badge"
|
|
568
|
+
"IconButton",
|
|
569
|
+
"Tooltip",
|
|
570
|
+
"CollapsibleCard"
|
|
189
571
|
],
|
|
190
572
|
"antiPatterns": [
|
|
191
|
-
"Do not use
|
|
192
|
-
"Do not
|
|
573
|
+
"Do not use Collapsible for modal or overlay behavior.",
|
|
574
|
+
"Do not use it for mutually exclusive tab panels.",
|
|
575
|
+
"Do not make the trigger icon-only without an accessible name."
|
|
193
576
|
],
|
|
194
577
|
"agentHints": [
|
|
195
|
-
"
|
|
578
|
+
"Choose Collapsible for a single expandable details region.",
|
|
579
|
+
"Use Collapse when rendering a list of expandable items."
|
|
196
580
|
]
|
|
197
581
|
},
|
|
198
|
-
"
|
|
199
|
-
"id": "
|
|
200
|
-
"name": "
|
|
201
|
-
"category": "
|
|
582
|
+
"collapsible-card": {
|
|
583
|
+
"id": "collapsible-card",
|
|
584
|
+
"name": "CollapsibleCard",
|
|
585
|
+
"category": "basic",
|
|
202
586
|
"status": "stable",
|
|
203
|
-
"intent": "
|
|
204
|
-
"packageImport": "import {
|
|
205
|
-
"cliAdd": "npx sparkdesign@latest add
|
|
587
|
+
"intent": "Card-like disclosure surface with header, content, and compact collapse behavior.",
|
|
588
|
+
"packageImport": "import { CollapsibleCard } from 'sparkdesign'",
|
|
589
|
+
"cliAdd": "npx sparkdesign@latest add collapsible-card",
|
|
590
|
+
"slots": [
|
|
591
|
+
"CollapsibleCard",
|
|
592
|
+
"header",
|
|
593
|
+
"title",
|
|
594
|
+
"actions",
|
|
595
|
+
"content"
|
|
596
|
+
],
|
|
597
|
+
"states": [
|
|
598
|
+
"expanded",
|
|
599
|
+
"collapsed",
|
|
600
|
+
"with actions",
|
|
601
|
+
"loading by composition",
|
|
602
|
+
"error by composition"
|
|
603
|
+
],
|
|
604
|
+
"a11y": [
|
|
605
|
+
"Ensure the header control clearly announces expanded state.",
|
|
606
|
+
"Keep action buttons separate from the collapse trigger.",
|
|
607
|
+
"Do not collapse active validation errors without a visible summary."
|
|
608
|
+
],
|
|
609
|
+
"composition": [
|
|
610
|
+
"Collapsible",
|
|
611
|
+
"Card",
|
|
612
|
+
"IconButton",
|
|
613
|
+
"Spinner",
|
|
614
|
+
"Alert"
|
|
615
|
+
],
|
|
616
|
+
"antiPatterns": [
|
|
617
|
+
"Do not use CollapsibleCard for every static card on a page.",
|
|
618
|
+
"Do not hide primary actions in collapsed content.",
|
|
619
|
+
"Do not nest cards inside cards without a strong information hierarchy."
|
|
620
|
+
],
|
|
621
|
+
"agentHints": [
|
|
622
|
+
"Choose CollapsibleCard for compact inspectors, tool results, and expandable summaries.",
|
|
623
|
+
"Use Card when the content should always remain visible."
|
|
624
|
+
]
|
|
625
|
+
},
|
|
626
|
+
"dropdown-menu": {
|
|
627
|
+
"id": "dropdown-menu",
|
|
628
|
+
"name": "DropdownMenu",
|
|
629
|
+
"category": "basic",
|
|
630
|
+
"status": "stable",
|
|
631
|
+
"intent": "Command menu for contextual actions, grouped commands, submenus, shortcuts, and non-form choices.",
|
|
632
|
+
"packageImport": "import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from 'sparkdesign'",
|
|
633
|
+
"cliAdd": "npx sparkdesign@latest add dropdown-menu",
|
|
634
|
+
"slots": [
|
|
635
|
+
"DropdownMenu",
|
|
636
|
+
"DropdownMenuTrigger",
|
|
637
|
+
"DropdownMenuContent",
|
|
638
|
+
"DropdownMenuItem",
|
|
639
|
+
"DropdownMenuLabel",
|
|
640
|
+
"DropdownMenuSeparator",
|
|
641
|
+
"DropdownMenuShortcut",
|
|
642
|
+
"DropdownMenuSub"
|
|
643
|
+
],
|
|
644
|
+
"states": [
|
|
645
|
+
"open",
|
|
646
|
+
"closed",
|
|
647
|
+
"disabled item",
|
|
648
|
+
"checked item",
|
|
649
|
+
"radio item",
|
|
650
|
+
"submenu"
|
|
651
|
+
],
|
|
652
|
+
"a11y": [
|
|
653
|
+
"Use menu items for commands, not form field values.",
|
|
654
|
+
"Keep destructive items clearly labeled and visually distinct.",
|
|
655
|
+
"Ensure trigger text or aria-label explains the menu purpose."
|
|
656
|
+
],
|
|
657
|
+
"composition": [
|
|
658
|
+
"Button",
|
|
659
|
+
"IconButton",
|
|
660
|
+
"Tooltip",
|
|
661
|
+
"AlertDialog",
|
|
662
|
+
"Command"
|
|
663
|
+
],
|
|
664
|
+
"antiPatterns": [
|
|
665
|
+
"Do not use DropdownMenu for selecting a persistent form value; use Select.",
|
|
666
|
+
"Do not hide primary actions in a menu when they should be visible.",
|
|
667
|
+
"Do not put long forms inside menu content."
|
|
668
|
+
],
|
|
669
|
+
"agentHints": [
|
|
670
|
+
"Choose DropdownMenu for action overflow, row actions, and command groups.",
|
|
671
|
+
"Use Select when the user is choosing one value to store."
|
|
672
|
+
]
|
|
673
|
+
},
|
|
674
|
+
"context-menu": {
|
|
675
|
+
"id": "context-menu",
|
|
676
|
+
"name": "ContextMenu",
|
|
677
|
+
"category": "basic",
|
|
678
|
+
"status": "stable",
|
|
679
|
+
"intent": "Right-click or context-triggered command menu for actions tied to a specific surface or item.",
|
|
680
|
+
"packageImport": "import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem } from 'sparkdesign'",
|
|
681
|
+
"cliAdd": "npx sparkdesign@latest add context-menu",
|
|
682
|
+
"slots": [
|
|
683
|
+
"ContextMenu",
|
|
684
|
+
"ContextMenuTrigger",
|
|
685
|
+
"ContextMenuContent",
|
|
686
|
+
"ContextMenuItem",
|
|
687
|
+
"ContextMenuLabel",
|
|
688
|
+
"ContextMenuSeparator",
|
|
689
|
+
"ContextMenuSub"
|
|
690
|
+
],
|
|
691
|
+
"states": [
|
|
692
|
+
"open",
|
|
693
|
+
"closed",
|
|
694
|
+
"disabled item",
|
|
695
|
+
"checked item",
|
|
696
|
+
"submenu",
|
|
697
|
+
"destructive by composition"
|
|
698
|
+
],
|
|
699
|
+
"a11y": [
|
|
700
|
+
"Do not make context menu the only way to access critical actions.",
|
|
701
|
+
"Keep menu item labels readable and action-oriented.",
|
|
702
|
+
"Ensure destructive context actions require clear confirmation when needed."
|
|
703
|
+
],
|
|
704
|
+
"composition": [
|
|
705
|
+
"AlertDialog",
|
|
706
|
+
"DropdownMenu",
|
|
707
|
+
"IconButton",
|
|
708
|
+
"Tooltip"
|
|
709
|
+
],
|
|
710
|
+
"antiPatterns": [
|
|
711
|
+
"Do not hide primary workflows behind right-click only.",
|
|
712
|
+
"Do not use ContextMenu for persistent form values; use Select or Combobox.",
|
|
713
|
+
"Do not put long forms inside context menu content."
|
|
714
|
+
],
|
|
715
|
+
"agentHints": [
|
|
716
|
+
"Choose ContextMenu for item-specific secondary actions.",
|
|
717
|
+
"Also expose frequent actions through visible buttons or row actions."
|
|
718
|
+
]
|
|
719
|
+
},
|
|
720
|
+
"hover-card": {
|
|
721
|
+
"id": "hover-card",
|
|
722
|
+
"name": "HoverCard",
|
|
723
|
+
"category": "basic",
|
|
724
|
+
"status": "stable",
|
|
725
|
+
"intent": "Hover/focus preview surface for supplemental details about a person, item, link, or entity.",
|
|
726
|
+
"packageImport": "import { HoverCard, HoverCardTrigger, HoverCardContent } from 'sparkdesign'",
|
|
727
|
+
"cliAdd": "npx sparkdesign@latest add hover-card",
|
|
728
|
+
"slots": [
|
|
729
|
+
"HoverCard",
|
|
730
|
+
"HoverCardTrigger",
|
|
731
|
+
"HoverCardContent",
|
|
732
|
+
"preview content"
|
|
733
|
+
],
|
|
734
|
+
"states": [
|
|
735
|
+
"closed",
|
|
736
|
+
"open on hover",
|
|
737
|
+
"open on focus",
|
|
738
|
+
"delayed",
|
|
739
|
+
"rich preview"
|
|
740
|
+
],
|
|
741
|
+
"a11y": [
|
|
742
|
+
"Do not put required task information only in HoverCard.",
|
|
743
|
+
"Keep trigger content meaningful without hover.",
|
|
744
|
+
"Ensure focus users can access the same supplemental information."
|
|
745
|
+
],
|
|
746
|
+
"composition": [
|
|
747
|
+
"Avatar",
|
|
748
|
+
"Button",
|
|
749
|
+
"Card",
|
|
750
|
+
"Tooltip"
|
|
751
|
+
],
|
|
752
|
+
"antiPatterns": [
|
|
753
|
+
"Do not use HoverCard for interactive forms or destructive choices.",
|
|
754
|
+
"Do not use as the only source of validation or error feedback.",
|
|
755
|
+
"Do not overload hover previews with long documentation."
|
|
756
|
+
],
|
|
757
|
+
"agentHints": [
|
|
758
|
+
"Choose HoverCard for supplemental previews.",
|
|
759
|
+
"Use Popover or Dialog when the user needs to interact with the content."
|
|
760
|
+
]
|
|
761
|
+
},
|
|
762
|
+
"menubar": {
|
|
763
|
+
"id": "menubar",
|
|
764
|
+
"name": "Menubar",
|
|
765
|
+
"category": "basic",
|
|
766
|
+
"status": "stable",
|
|
767
|
+
"intent": "Application-style menu bar for grouped top-level commands and nested command menus.",
|
|
768
|
+
"packageImport": "import { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem } from 'sparkdesign'",
|
|
769
|
+
"cliAdd": "npx sparkdesign@latest add menubar",
|
|
770
|
+
"slots": [
|
|
771
|
+
"Menubar",
|
|
772
|
+
"MenubarMenu",
|
|
773
|
+
"MenubarTrigger",
|
|
774
|
+
"MenubarContent",
|
|
775
|
+
"MenubarItem",
|
|
776
|
+
"MenubarShortcut",
|
|
777
|
+
"MenubarSub"
|
|
778
|
+
],
|
|
779
|
+
"states": [
|
|
780
|
+
"open menu",
|
|
781
|
+
"closed",
|
|
782
|
+
"disabled item",
|
|
783
|
+
"submenu",
|
|
784
|
+
"checked item"
|
|
785
|
+
],
|
|
786
|
+
"a11y": [
|
|
787
|
+
"Use clear top-level command group labels.",
|
|
788
|
+
"Keep keyboard traversal predictable across menus.",
|
|
789
|
+
"Expose shortcuts as supplementary text, not the only command label."
|
|
790
|
+
],
|
|
791
|
+
"composition": [
|
|
792
|
+
"Command",
|
|
793
|
+
"AlertDialog",
|
|
794
|
+
"Tooltip"
|
|
795
|
+
],
|
|
796
|
+
"antiPatterns": [
|
|
797
|
+
"Do not use Menubar as ordinary site navigation; use NavigationMenu.",
|
|
798
|
+
"Do not place form fields inside Menubar content.",
|
|
799
|
+
"Do not overload it with unrelated product navigation and destructive commands."
|
|
800
|
+
],
|
|
801
|
+
"agentHints": [
|
|
802
|
+
"Choose Menubar for desktop-like application command groups.",
|
|
803
|
+
"Choose NavigationMenu for page/site navigation."
|
|
804
|
+
]
|
|
805
|
+
},
|
|
806
|
+
"navigation-menu": {
|
|
807
|
+
"id": "navigation-menu",
|
|
808
|
+
"name": "NavigationMenu",
|
|
809
|
+
"category": "basic",
|
|
810
|
+
"status": "stable",
|
|
811
|
+
"intent": "Primary or sectional navigation menu with grouped links and optional flyout content.",
|
|
812
|
+
"packageImport": "import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink } from 'sparkdesign'",
|
|
813
|
+
"cliAdd": "npx sparkdesign@latest add navigation-menu",
|
|
814
|
+
"slots": [
|
|
815
|
+
"NavigationMenu",
|
|
816
|
+
"NavigationMenuList",
|
|
817
|
+
"NavigationMenuItem",
|
|
818
|
+
"NavigationMenuTrigger",
|
|
819
|
+
"NavigationMenuContent",
|
|
820
|
+
"NavigationMenuLink",
|
|
821
|
+
"NavigationMenuViewport"
|
|
822
|
+
],
|
|
823
|
+
"states": [
|
|
824
|
+
"active link",
|
|
825
|
+
"open flyout",
|
|
826
|
+
"closed",
|
|
827
|
+
"nested groups",
|
|
828
|
+
"responsive by composition"
|
|
829
|
+
],
|
|
830
|
+
"a11y": [
|
|
831
|
+
"Use real links for navigation destinations.",
|
|
832
|
+
"Keep labels short and route-oriented.",
|
|
833
|
+
"Do not mix command actions and navigation without clear grouping."
|
|
834
|
+
],
|
|
835
|
+
"composition": [
|
|
836
|
+
"Button",
|
|
837
|
+
"Popover",
|
|
838
|
+
"Sheet",
|
|
839
|
+
"SidebarMenu"
|
|
840
|
+
],
|
|
841
|
+
"antiPatterns": [
|
|
842
|
+
"Do not use NavigationMenu for contextual row actions; use DropdownMenu.",
|
|
843
|
+
"Do not hide primary navigation behind hover-only flyouts.",
|
|
844
|
+
"Do not use for desktop app command menus; use Menubar."
|
|
845
|
+
],
|
|
846
|
+
"agentHints": [
|
|
847
|
+
"Choose NavigationMenu for top-level page or section navigation.",
|
|
848
|
+
"Use SidebarMenu for persistent app side navigation."
|
|
849
|
+
]
|
|
850
|
+
},
|
|
851
|
+
"pagination": {
|
|
852
|
+
"id": "pagination",
|
|
853
|
+
"name": "Pagination",
|
|
854
|
+
"category": "basic",
|
|
855
|
+
"status": "stable",
|
|
856
|
+
"intent": "Page navigation controls for paginated lists, tables, and search results.",
|
|
857
|
+
"packageImport": "import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from 'sparkdesign'",
|
|
858
|
+
"cliAdd": "npx sparkdesign@latest add pagination",
|
|
859
|
+
"slots": [
|
|
860
|
+
"Pagination",
|
|
861
|
+
"PaginationContent",
|
|
862
|
+
"PaginationItem",
|
|
863
|
+
"PaginationLink",
|
|
864
|
+
"PaginationPrevious",
|
|
865
|
+
"PaginationNext",
|
|
866
|
+
"PaginationEllipsis"
|
|
867
|
+
],
|
|
868
|
+
"states": [
|
|
869
|
+
"current page",
|
|
870
|
+
"previous disabled",
|
|
871
|
+
"next disabled",
|
|
872
|
+
"ellipsis",
|
|
873
|
+
"page links"
|
|
874
|
+
],
|
|
875
|
+
"a11y": [
|
|
876
|
+
"Provide readable labels for previous and next controls.",
|
|
877
|
+
"Mark the current page semantically.",
|
|
878
|
+
"Do not rely on pagination alone when filtering or search would better reduce results."
|
|
879
|
+
],
|
|
880
|
+
"composition": [
|
|
881
|
+
"DataTable",
|
|
882
|
+
"Table",
|
|
883
|
+
"Search",
|
|
884
|
+
"Button"
|
|
885
|
+
],
|
|
886
|
+
"antiPatterns": [
|
|
887
|
+
"Do not paginate very small result sets.",
|
|
888
|
+
"Do not hide current page context.",
|
|
889
|
+
"Do not use Pagination for tab-like mode switching."
|
|
890
|
+
],
|
|
891
|
+
"agentHints": [
|
|
892
|
+
"Choose Pagination when users browse large result sets page by page.",
|
|
893
|
+
"Use infinite scroll only when the product explicitly calls for it."
|
|
894
|
+
]
|
|
895
|
+
},
|
|
896
|
+
"popover": {
|
|
897
|
+
"id": "popover",
|
|
898
|
+
"name": "Popover",
|
|
899
|
+
"category": "basic",
|
|
900
|
+
"status": "stable",
|
|
901
|
+
"intent": "Anchored interactive floating panel for compact controls, pickers, or contextual editing.",
|
|
902
|
+
"packageImport": "import { Popover, PopoverTrigger, PopoverContent } from 'sparkdesign'",
|
|
903
|
+
"cliAdd": "npx sparkdesign@latest add popover",
|
|
904
|
+
"slots": [
|
|
905
|
+
"Popover",
|
|
906
|
+
"PopoverTrigger",
|
|
907
|
+
"PopoverContent",
|
|
908
|
+
"PopoverAnchor"
|
|
909
|
+
],
|
|
910
|
+
"states": [
|
|
911
|
+
"open",
|
|
912
|
+
"closed",
|
|
913
|
+
"anchored",
|
|
914
|
+
"interactive content",
|
|
915
|
+
"dismissible"
|
|
916
|
+
],
|
|
917
|
+
"a11y": [
|
|
918
|
+
"Ensure the trigger has a clear accessible name.",
|
|
919
|
+
"Keep focus behavior predictable for interactive content.",
|
|
920
|
+
"Do not put long multi-step workflows inside a small popover."
|
|
921
|
+
],
|
|
922
|
+
"composition": [
|
|
923
|
+
"Button",
|
|
924
|
+
"Calendar",
|
|
925
|
+
"Command",
|
|
926
|
+
"Combobox",
|
|
927
|
+
"Input"
|
|
928
|
+
],
|
|
929
|
+
"antiPatterns": [
|
|
930
|
+
"Do not use Popover for destructive confirmations; use AlertDialog.",
|
|
931
|
+
"Do not use Popover for passive hover help; use Tooltip or HoverCard.",
|
|
932
|
+
"Do not make the user complete long forms in a constrained popover."
|
|
933
|
+
],
|
|
934
|
+
"agentHints": [
|
|
935
|
+
"Choose Popover for compact pickers and contextual controls.",
|
|
936
|
+
"Use Dialog or Sheet when the content needs more space."
|
|
937
|
+
]
|
|
938
|
+
},
|
|
939
|
+
"sheet": {
|
|
940
|
+
"id": "sheet",
|
|
941
|
+
"name": "Sheet",
|
|
942
|
+
"category": "basic",
|
|
943
|
+
"status": "stable",
|
|
944
|
+
"intent": "Side panel overlay for contextual details, filters, settings, or secondary editing flows.",
|
|
945
|
+
"packageImport": "import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from 'sparkdesign'",
|
|
946
|
+
"cliAdd": "npx sparkdesign@latest add sheet",
|
|
947
|
+
"slots": [
|
|
948
|
+
"Sheet",
|
|
949
|
+
"SheetTrigger",
|
|
950
|
+
"SheetContent",
|
|
951
|
+
"SheetHeader",
|
|
952
|
+
"SheetTitle",
|
|
953
|
+
"SheetDescription",
|
|
954
|
+
"SheetFooter"
|
|
955
|
+
],
|
|
956
|
+
"states": [
|
|
957
|
+
"open",
|
|
958
|
+
"closed",
|
|
959
|
+
"side-left",
|
|
960
|
+
"side-right",
|
|
961
|
+
"side-top",
|
|
962
|
+
"side-bottom",
|
|
963
|
+
"focus-trapped"
|
|
964
|
+
],
|
|
965
|
+
"a11y": [
|
|
966
|
+
"Always provide SheetTitle.",
|
|
967
|
+
"Use SheetDescription when the panel purpose is not obvious.",
|
|
968
|
+
"Return focus to the trigger after close."
|
|
969
|
+
],
|
|
970
|
+
"composition": [
|
|
971
|
+
"Button",
|
|
972
|
+
"Field",
|
|
973
|
+
"Tabs",
|
|
974
|
+
"SidebarMenu",
|
|
975
|
+
"Alert"
|
|
976
|
+
],
|
|
977
|
+
"antiPatterns": [
|
|
978
|
+
"Do not use Sheet for destructive confirmations; use AlertDialog.",
|
|
979
|
+
"Do not create nested sheets unless the product specifically requires it.",
|
|
980
|
+
"Do not put primary app navigation in a temporary sheet on desktop when persistent navigation is expected."
|
|
981
|
+
],
|
|
982
|
+
"agentHints": [
|
|
983
|
+
"Choose Sheet for secondary panels that preserve page context.",
|
|
984
|
+
"Use Drawer when the product already follows drawer terminology or behavior."
|
|
985
|
+
]
|
|
986
|
+
},
|
|
987
|
+
"sidebar-menu": {
|
|
988
|
+
"id": "sidebar-menu",
|
|
989
|
+
"name": "SidebarMenu",
|
|
990
|
+
"category": "basic",
|
|
991
|
+
"status": "stable",
|
|
992
|
+
"intent": "Lightweight data-driven side navigation menu for app sections and per-item actions, without owning the full app shell.",
|
|
993
|
+
"packageImport": "import { SidebarMenu } from 'sparkdesign'",
|
|
994
|
+
"cliAdd": "npx sparkdesign@latest add sidebar-menu",
|
|
995
|
+
"slots": [
|
|
996
|
+
"SidebarMenu",
|
|
997
|
+
"menu item",
|
|
998
|
+
"item action",
|
|
999
|
+
"nested group by composition",
|
|
1000
|
+
"active state"
|
|
1001
|
+
],
|
|
1002
|
+
"states": [
|
|
1003
|
+
"active item",
|
|
1004
|
+
"collapsed by composition",
|
|
1005
|
+
"expanded by composition",
|
|
1006
|
+
"disabled item",
|
|
1007
|
+
"with actions"
|
|
1008
|
+
],
|
|
1009
|
+
"a11y": [
|
|
1010
|
+
"Use readable item labels and real navigation links when navigating.",
|
|
1011
|
+
"Do not encode active state only with color.",
|
|
1012
|
+
"Keep item actions keyboard reachable."
|
|
1013
|
+
],
|
|
1014
|
+
"composition": [
|
|
1015
|
+
"NavigationMenu",
|
|
1016
|
+
"Tooltip",
|
|
1017
|
+
"DropdownMenu",
|
|
1018
|
+
"Sheet"
|
|
1019
|
+
],
|
|
1020
|
+
"antiPatterns": [
|
|
1021
|
+
"Do not use SidebarMenu for transient action menus.",
|
|
1022
|
+
"Do not hide core navigation labels without an accessible collapsed pattern.",
|
|
1023
|
+
"Do not mix unrelated settings, commands, and navigation in one flat list.",
|
|
1024
|
+
"Do not use SidebarMenu when the layout needs provider-managed collapse, mobile sheet behavior, or an inset content area; use Sidebar instead."
|
|
1025
|
+
],
|
|
1026
|
+
"agentHints": [
|
|
1027
|
+
"Choose SidebarMenu for a simple controlled list of navigation items with optional item actions.",
|
|
1028
|
+
"Choose Sidebar when generating a complete app shell with SidebarProvider, SidebarTrigger, and SidebarInset.",
|
|
1029
|
+
"Use NavigationMenu for top navigation and DropdownMenu for contextual actions."
|
|
1030
|
+
]
|
|
1031
|
+
},
|
|
1032
|
+
"sidebar": {
|
|
1033
|
+
"id": "sidebar",
|
|
1034
|
+
"name": "Sidebar",
|
|
1035
|
+
"category": "basic",
|
|
1036
|
+
"status": "stable",
|
|
1037
|
+
"intent": "Application sidebar system with provider-managed collapse, mobile sheet behavior, inset content, groups, and menu primitives.",
|
|
1038
|
+
"packageImport": "import { Sidebar, SidebarProvider, SidebarTrigger, SidebarInset, SidebarNavMenu } from 'sparkdesign'",
|
|
1039
|
+
"cliAdd": "npx sparkdesign@latest add sidebar",
|
|
1040
|
+
"slots": [
|
|
1041
|
+
"SidebarProvider",
|
|
1042
|
+
"Sidebar",
|
|
1043
|
+
"SidebarTrigger",
|
|
1044
|
+
"SidebarInset",
|
|
1045
|
+
"SidebarHeader",
|
|
1046
|
+
"SidebarContent",
|
|
1047
|
+
"SidebarGroup",
|
|
1048
|
+
"SidebarNavMenu"
|
|
1049
|
+
],
|
|
1050
|
+
"states": [
|
|
1051
|
+
"expanded",
|
|
1052
|
+
"collapsed",
|
|
1053
|
+
"mobile sheet",
|
|
1054
|
+
"offcanvas",
|
|
1055
|
+
"icon collapsed",
|
|
1056
|
+
"active menu item"
|
|
1057
|
+
],
|
|
1058
|
+
"a11y": [
|
|
1059
|
+
"Provide readable labels for sidebar trigger and menu buttons.",
|
|
1060
|
+
"Do not hide core navigation labels without tooltip or accessible names in icon mode.",
|
|
1061
|
+
"Keep the main content reachable when the sidebar is collapsed or mobile."
|
|
1062
|
+
],
|
|
1063
|
+
"composition": [
|
|
1064
|
+
"Button",
|
|
1065
|
+
"Sheet",
|
|
1066
|
+
"Tooltip",
|
|
1067
|
+
"Input",
|
|
1068
|
+
"Separator",
|
|
1069
|
+
"Skeleton"
|
|
1070
|
+
],
|
|
1071
|
+
"antiPatterns": [
|
|
1072
|
+
"Do not use Sidebar for transient context menus.",
|
|
1073
|
+
"Do not put unrelated commands, settings, and navigation in one flat sidebar.",
|
|
1074
|
+
"Do not rely on collapsed icon visuals alone for navigation meaning.",
|
|
1075
|
+
"Do not use Sidebar for a single static menu list when SidebarMenu is enough."
|
|
1076
|
+
],
|
|
1077
|
+
"agentHints": [
|
|
1078
|
+
"Choose Sidebar for complete app shells that need provider state, responsive collapse, a trigger, and an inset content area.",
|
|
1079
|
+
"In package imports, use SidebarNavMenu and SidebarNavMenuItem for the menu list exported from Sidebar; the name SidebarMenu is reserved for Spark's lightweight data-driven menu.",
|
|
1080
|
+
"Choose SidebarMenu for Spark's lightweight data-driven menu list."
|
|
1081
|
+
]
|
|
1082
|
+
},
|
|
1083
|
+
"empty": {
|
|
1084
|
+
"id": "empty",
|
|
1085
|
+
"name": "Empty",
|
|
1086
|
+
"category": "basic",
|
|
1087
|
+
"status": "stable",
|
|
1088
|
+
"intent": "Empty-state layout for blank pages, lists, panels, or first-run surfaces with guidance and optional actions.",
|
|
1089
|
+
"packageImport": "import { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia } from 'sparkdesign'",
|
|
1090
|
+
"cliAdd": "npx sparkdesign@latest add empty",
|
|
1091
|
+
"slots": [
|
|
1092
|
+
"Empty",
|
|
1093
|
+
"EmptyHeader",
|
|
1094
|
+
"EmptyTitle",
|
|
1095
|
+
"EmptyDescription",
|
|
1096
|
+
"EmptyContent",
|
|
1097
|
+
"EmptyMedia"
|
|
1098
|
+
],
|
|
1099
|
+
"states": [
|
|
1100
|
+
"blank",
|
|
1101
|
+
"first-run",
|
|
1102
|
+
"no-results",
|
|
1103
|
+
"filtered-empty",
|
|
1104
|
+
"error by composition"
|
|
1105
|
+
],
|
|
1106
|
+
"a11y": [
|
|
1107
|
+
"Use a clear title that explains what is empty.",
|
|
1108
|
+
"Do not make illustration or icon the only explanation.",
|
|
1109
|
+
"Keep primary recovery or start action keyboard reachable."
|
|
1110
|
+
],
|
|
1111
|
+
"composition": [
|
|
1112
|
+
"Button",
|
|
1113
|
+
"ChatInput",
|
|
1114
|
+
"RelatedPrompts",
|
|
1115
|
+
"Alert",
|
|
1116
|
+
"Card"
|
|
1117
|
+
],
|
|
1118
|
+
"antiPatterns": [
|
|
1119
|
+
"Do not use Empty when data is still loading; use Skeleton or Spinner.",
|
|
1120
|
+
"Do not show many competing calls to action.",
|
|
1121
|
+
"Do not use generic copy that fails to explain the user's next step."
|
|
1122
|
+
],
|
|
1123
|
+
"agentHints": [
|
|
1124
|
+
"Choose Empty for no-content states that need guidance.",
|
|
1125
|
+
"Pair with ChatInput or RelatedPrompts when the next step is AI-assisted."
|
|
1126
|
+
]
|
|
1127
|
+
},
|
|
1128
|
+
"ellipsis-text": {
|
|
1129
|
+
"id": "ellipsis-text",
|
|
1130
|
+
"name": "EllipsisText",
|
|
1131
|
+
"category": "basic",
|
|
1132
|
+
"status": "stable",
|
|
1133
|
+
"intent": "Single-line or constrained text truncation with optional tooltip for full content.",
|
|
1134
|
+
"packageImport": "import { EllipsisText } from 'sparkdesign'",
|
|
1135
|
+
"cliAdd": "npx sparkdesign@latest add ellipsis-text",
|
|
1136
|
+
"slots": [
|
|
1137
|
+
"EllipsisText",
|
|
1138
|
+
"visible text",
|
|
1139
|
+
"tooltip by composition"
|
|
1140
|
+
],
|
|
1141
|
+
"states": [
|
|
1142
|
+
"fits",
|
|
1143
|
+
"truncated",
|
|
1144
|
+
"tooltip enabled",
|
|
1145
|
+
"custom element"
|
|
1146
|
+
],
|
|
1147
|
+
"a11y": [
|
|
1148
|
+
"Do not truncate labels where the full value is required to complete a task.",
|
|
1149
|
+
"Expose the full text through title, Tooltip, or adjacent details when needed.",
|
|
1150
|
+
"Avoid truncating text that differs only at the end, such as file names, without another disambiguator."
|
|
1151
|
+
],
|
|
1152
|
+
"composition": [
|
|
1153
|
+
"Tooltip",
|
|
1154
|
+
"Table",
|
|
1155
|
+
"DataTable",
|
|
1156
|
+
"FileCard"
|
|
1157
|
+
],
|
|
1158
|
+
"antiPatterns": [
|
|
1159
|
+
"Do not use EllipsisText as a substitute for responsive layout.",
|
|
1160
|
+
"Do not truncate critical error messages.",
|
|
1161
|
+
"Do not place multi-line rich content inside EllipsisText."
|
|
1162
|
+
],
|
|
1163
|
+
"agentHints": [
|
|
1164
|
+
"Choose EllipsisText for dense tables, file paths, titles, and IDs that may overflow.",
|
|
1165
|
+
"Prefer wrapping text when readability is more important than density."
|
|
1166
|
+
]
|
|
1167
|
+
},
|
|
1168
|
+
"calendar": {
|
|
1169
|
+
"id": "calendar",
|
|
1170
|
+
"name": "Calendar",
|
|
1171
|
+
"category": "basic",
|
|
1172
|
+
"status": "stable",
|
|
1173
|
+
"intent": "Calendar grid for visible date selection, date ranges, or scheduling surfaces.",
|
|
1174
|
+
"packageImport": "import { Calendar } from 'sparkdesign'",
|
|
1175
|
+
"cliAdd": "npx sparkdesign@latest add calendar",
|
|
1176
|
+
"slots": [
|
|
1177
|
+
"Calendar",
|
|
1178
|
+
"CalendarDayButton",
|
|
1179
|
+
"month navigation",
|
|
1180
|
+
"day grid"
|
|
1181
|
+
],
|
|
1182
|
+
"states": [
|
|
1183
|
+
"single date",
|
|
1184
|
+
"range by composition",
|
|
1185
|
+
"disabled dates",
|
|
1186
|
+
"selected date",
|
|
1187
|
+
"today",
|
|
1188
|
+
"outside month"
|
|
1189
|
+
],
|
|
1190
|
+
"a11y": [
|
|
1191
|
+
"Preserve keyboard navigation through dates.",
|
|
1192
|
+
"Use readable date labels for selected and disabled dates.",
|
|
1193
|
+
"Do not rely on color alone to indicate selected or unavailable days."
|
|
1194
|
+
],
|
|
1195
|
+
"composition": [
|
|
1196
|
+
"Popover",
|
|
1197
|
+
"DatePicker",
|
|
1198
|
+
"Button",
|
|
1199
|
+
"Alert"
|
|
1200
|
+
],
|
|
1201
|
+
"antiPatterns": [
|
|
1202
|
+
"Do not use Calendar for free-form date text entry; use Input or DatePicker.",
|
|
1203
|
+
"Do not show a full calendar when a compact date picker is sufficient.",
|
|
1204
|
+
"Do not hide unavailable date rules from the user."
|
|
1205
|
+
],
|
|
1206
|
+
"agentHints": [
|
|
1207
|
+
"Choose Calendar when the user benefits from seeing the month layout.",
|
|
1208
|
+
"Choose DatePicker for a compact form field."
|
|
1209
|
+
]
|
|
1210
|
+
},
|
|
1211
|
+
"carousel": {
|
|
1212
|
+
"id": "carousel",
|
|
1213
|
+
"name": "Carousel",
|
|
1214
|
+
"category": "basic",
|
|
1215
|
+
"status": "stable",
|
|
1216
|
+
"intent": "Horizontal or vertical slide collection for browsable media, cards, examples, or featured content.",
|
|
1217
|
+
"packageImport": "import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } from 'sparkdesign'",
|
|
1218
|
+
"cliAdd": "npx sparkdesign@latest add carousel",
|
|
1219
|
+
"slots": [
|
|
1220
|
+
"Carousel",
|
|
1221
|
+
"CarouselContent",
|
|
1222
|
+
"CarouselItem",
|
|
1223
|
+
"CarouselPrevious",
|
|
1224
|
+
"CarouselNext",
|
|
1225
|
+
"CarouselApi"
|
|
1226
|
+
],
|
|
1227
|
+
"states": [
|
|
1228
|
+
"first slide",
|
|
1229
|
+
"last slide",
|
|
1230
|
+
"scrollable",
|
|
1231
|
+
"disabled previous",
|
|
1232
|
+
"disabled next",
|
|
1233
|
+
"loop by configuration"
|
|
1234
|
+
],
|
|
1235
|
+
"a11y": [
|
|
1236
|
+
"Provide context for what the carousel contains.",
|
|
1237
|
+
"Keep previous and next controls keyboard reachable and named.",
|
|
1238
|
+
"Do not hide essential content only in off-screen slides."
|
|
1239
|
+
],
|
|
1240
|
+
"composition": [
|
|
1241
|
+
"Card",
|
|
1242
|
+
"AspectRatio",
|
|
1243
|
+
"Button",
|
|
1244
|
+
"GeneratedImagesGrid"
|
|
1245
|
+
],
|
|
1246
|
+
"antiPatterns": [
|
|
1247
|
+
"Do not use Carousel for primary navigation.",
|
|
1248
|
+
"Do not put unrelated forms or critical decisions across slides.",
|
|
1249
|
+
"Do not auto-advance content without a clear product reason."
|
|
1250
|
+
],
|
|
1251
|
+
"agentHints": [
|
|
1252
|
+
"Choose Carousel for browsable previews or media collections.",
|
|
1253
|
+
"Use a grid or list when users need to compare all items at once."
|
|
1254
|
+
]
|
|
1255
|
+
},
|
|
1256
|
+
"chart": {
|
|
1257
|
+
"id": "chart",
|
|
1258
|
+
"name": "Chart",
|
|
1259
|
+
"category": "basic",
|
|
1260
|
+
"status": "stable",
|
|
1261
|
+
"intent": "Tokenized chart container and tooltip/legend primitives for data visualization.",
|
|
1262
|
+
"packageImport": "import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from 'sparkdesign'",
|
|
1263
|
+
"cliAdd": "npx sparkdesign@latest add chart",
|
|
1264
|
+
"slots": [
|
|
1265
|
+
"ChartContainer",
|
|
1266
|
+
"ChartTooltip",
|
|
1267
|
+
"ChartTooltipContent",
|
|
1268
|
+
"ChartLegend",
|
|
1269
|
+
"ChartLegendContent",
|
|
1270
|
+
"ChartStyle"
|
|
1271
|
+
],
|
|
1272
|
+
"states": [
|
|
1273
|
+
"loading by composition",
|
|
1274
|
+
"empty by composition",
|
|
1275
|
+
"interactive tooltip",
|
|
1276
|
+
"legend",
|
|
1277
|
+
"responsive"
|
|
1278
|
+
],
|
|
1279
|
+
"a11y": [
|
|
1280
|
+
"Provide surrounding text that explains the chart insight.",
|
|
1281
|
+
"Do not rely on color alone to distinguish series.",
|
|
1282
|
+
"Ensure important values are available outside hover-only tooltips."
|
|
1283
|
+
],
|
|
1284
|
+
"composition": [
|
|
1285
|
+
"Card",
|
|
1286
|
+
"Skeleton",
|
|
1287
|
+
"Empty",
|
|
1288
|
+
"Table"
|
|
1289
|
+
],
|
|
1290
|
+
"antiPatterns": [
|
|
1291
|
+
"Do not use Chart for decorative metrics without readable values.",
|
|
1292
|
+
"Do not hide critical data only inside hover states.",
|
|
1293
|
+
"Do not use charts when a table or simple metric is clearer."
|
|
1294
|
+
],
|
|
1295
|
+
"agentHints": [
|
|
1296
|
+
"Choose Chart for trends, comparisons, or distributions.",
|
|
1297
|
+
"Pair with Table when exact values must be inspected."
|
|
1298
|
+
]
|
|
1299
|
+
},
|
|
1300
|
+
"combobox": {
|
|
1301
|
+
"id": "combobox",
|
|
1302
|
+
"name": "Combobox",
|
|
1303
|
+
"category": "basic",
|
|
1304
|
+
"status": "stable",
|
|
1305
|
+
"intent": "Searchable picker for choosing from a small to medium local option set.",
|
|
1306
|
+
"packageImport": "import { Combobox } from 'sparkdesign'",
|
|
1307
|
+
"cliAdd": "npx sparkdesign@latest add combobox",
|
|
1308
|
+
"slots": [
|
|
1309
|
+
"Combobox",
|
|
1310
|
+
"trigger",
|
|
1311
|
+
"search input",
|
|
1312
|
+
"option list",
|
|
1313
|
+
"empty state"
|
|
1314
|
+
],
|
|
1315
|
+
"states": [
|
|
1316
|
+
"open",
|
|
1317
|
+
"closed",
|
|
1318
|
+
"searching",
|
|
1319
|
+
"selected",
|
|
1320
|
+
"empty",
|
|
1321
|
+
"disabled"
|
|
1322
|
+
],
|
|
1323
|
+
"a11y": [
|
|
1324
|
+
"Provide a label or accessible name for the picker.",
|
|
1325
|
+
"Keep option labels readable and unique.",
|
|
1326
|
+
"Preserve keyboard search and selection behavior."
|
|
1327
|
+
],
|
|
1328
|
+
"composition": [
|
|
1329
|
+
"Command",
|
|
1330
|
+
"Popover",
|
|
1331
|
+
"Button",
|
|
1332
|
+
"Label",
|
|
1333
|
+
"Field"
|
|
1334
|
+
],
|
|
1335
|
+
"antiPatterns": [
|
|
1336
|
+
"Do not use Combobox for command execution; use Command or DropdownMenu.",
|
|
1337
|
+
"Do not use for tiny 2-3 option sets where RadioGroup or Select is clearer.",
|
|
1338
|
+
"Do not use for large remote datasets without explicit loading and empty states."
|
|
1339
|
+
],
|
|
1340
|
+
"agentHints": [
|
|
1341
|
+
"Choose Combobox when users need to search a list before selecting one value.",
|
|
1342
|
+
"Choose Select when search is unnecessary."
|
|
1343
|
+
]
|
|
1344
|
+
},
|
|
1345
|
+
"command": {
|
|
1346
|
+
"id": "command",
|
|
1347
|
+
"name": "Command",
|
|
1348
|
+
"category": "basic",
|
|
1349
|
+
"status": "stable",
|
|
1350
|
+
"intent": "Command palette or searchable action/list surface with grouped results and keyboard-first selection.",
|
|
1351
|
+
"packageImport": "import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from 'sparkdesign'",
|
|
1352
|
+
"cliAdd": "npx sparkdesign@latest add command",
|
|
1353
|
+
"slots": [
|
|
1354
|
+
"Command",
|
|
1355
|
+
"CommandInput",
|
|
1356
|
+
"CommandList",
|
|
1357
|
+
"CommandEmpty",
|
|
1358
|
+
"CommandGroup",
|
|
1359
|
+
"CommandItem",
|
|
1360
|
+
"CommandShortcut"
|
|
1361
|
+
],
|
|
1362
|
+
"states": [
|
|
1363
|
+
"searching",
|
|
1364
|
+
"empty",
|
|
1365
|
+
"grouped",
|
|
1366
|
+
"selected item",
|
|
1367
|
+
"disabled item",
|
|
1368
|
+
"dialog mode"
|
|
1369
|
+
],
|
|
1370
|
+
"a11y": [
|
|
1371
|
+
"Keep command labels action-oriented and readable.",
|
|
1372
|
+
"Expose keyboard shortcuts as supplementary text, not the only label.",
|
|
1373
|
+
"Preserve keyboard navigation and selection semantics."
|
|
1374
|
+
],
|
|
1375
|
+
"composition": [
|
|
1376
|
+
"Dialog",
|
|
1377
|
+
"Popover",
|
|
1378
|
+
"Combobox",
|
|
1379
|
+
"DropdownMenu"
|
|
1380
|
+
],
|
|
1381
|
+
"antiPatterns": [
|
|
1382
|
+
"Do not use Command as a normal form Select unless command search behavior is needed.",
|
|
1383
|
+
"Do not bury destructive commands without confirmation.",
|
|
1384
|
+
"Do not mix navigation, destructive actions, and form values without grouping."
|
|
1385
|
+
],
|
|
1386
|
+
"agentHints": [
|
|
1387
|
+
"Choose Command for command palettes, quick switchers, and searchable actions.",
|
|
1388
|
+
"Choose Combobox for searchable value selection."
|
|
1389
|
+
]
|
|
1390
|
+
},
|
|
1391
|
+
"data-table": {
|
|
1392
|
+
"id": "data-table",
|
|
1393
|
+
"name": "DataTable",
|
|
1394
|
+
"category": "basic",
|
|
1395
|
+
"status": "stable",
|
|
1396
|
+
"intent": "Structured tabular data surface with columns, rows, and optional row actions.",
|
|
1397
|
+
"packageImport": "import { DataTable } from 'sparkdesign'",
|
|
1398
|
+
"cliAdd": "npx sparkdesign@latest add data-table",
|
|
1399
|
+
"slots": [
|
|
1400
|
+
"columns",
|
|
1401
|
+
"rows",
|
|
1402
|
+
"header",
|
|
1403
|
+
"cell renderers",
|
|
1404
|
+
"row actions by composition"
|
|
1405
|
+
],
|
|
1406
|
+
"states": [
|
|
1407
|
+
"loading by composition",
|
|
1408
|
+
"empty",
|
|
1409
|
+
"sortable by composition",
|
|
1410
|
+
"selectable by composition",
|
|
1411
|
+
"error by composition"
|
|
1412
|
+
],
|
|
1413
|
+
"a11y": [
|
|
1414
|
+
"Use meaningful column headers.",
|
|
1415
|
+
"Keep row actions reachable by keyboard.",
|
|
1416
|
+
"Do not rely on visual alignment alone to communicate relationships."
|
|
1417
|
+
],
|
|
1418
|
+
"composition": [
|
|
1419
|
+
"Table",
|
|
1420
|
+
"DropdownMenu",
|
|
1421
|
+
"Checkbox",
|
|
1422
|
+
"Skeleton",
|
|
1423
|
+
"Empty"
|
|
1424
|
+
],
|
|
1425
|
+
"antiPatterns": [
|
|
1426
|
+
"Do not use DataTable for simple key-value details; use Card or Item.",
|
|
1427
|
+
"Do not hide critical row actions behind unlabeled icon-only menus.",
|
|
1428
|
+
"Do not put unrelated layouts inside cells when a card list is clearer."
|
|
1429
|
+
],
|
|
1430
|
+
"agentHints": [
|
|
1431
|
+
"Choose DataTable for scan-heavy lists with repeated fields.",
|
|
1432
|
+
"Use Table primitives for custom static tables."
|
|
1433
|
+
]
|
|
1434
|
+
},
|
|
1435
|
+
"date-picker": {
|
|
1436
|
+
"id": "date-picker",
|
|
1437
|
+
"name": "DatePicker",
|
|
1438
|
+
"category": "basic",
|
|
1439
|
+
"status": "stable",
|
|
1440
|
+
"intent": "Compact form control for choosing a date through a trigger and calendar popover.",
|
|
1441
|
+
"packageImport": "import { DatePicker } from 'sparkdesign'",
|
|
1442
|
+
"cliAdd": "npx sparkdesign@latest add date-picker",
|
|
1443
|
+
"slots": [
|
|
1444
|
+
"DatePicker",
|
|
1445
|
+
"trigger",
|
|
1446
|
+
"calendar popover",
|
|
1447
|
+
"selected date label"
|
|
1448
|
+
],
|
|
1449
|
+
"states": [
|
|
1450
|
+
"selected",
|
|
1451
|
+
"placeholder",
|
|
1452
|
+
"open",
|
|
1453
|
+
"closed",
|
|
1454
|
+
"disabled",
|
|
1455
|
+
"invalid by composition"
|
|
1456
|
+
],
|
|
1457
|
+
"a11y": [
|
|
1458
|
+
"Pair with Label or an accessible name in forms.",
|
|
1459
|
+
"Expose the selected date as readable text.",
|
|
1460
|
+
"Preserve keyboard access to the calendar popover."
|
|
1461
|
+
],
|
|
1462
|
+
"composition": [
|
|
1463
|
+
"Calendar",
|
|
1464
|
+
"Popover",
|
|
1465
|
+
"Button",
|
|
1466
|
+
"Label",
|
|
1467
|
+
"Field"
|
|
1468
|
+
],
|
|
1469
|
+
"antiPatterns": [
|
|
1470
|
+
"Do not use DatePicker for arbitrary date ranges unless the component supports the range flow.",
|
|
1471
|
+
"Do not use a plain Input when users need calendar validation.",
|
|
1472
|
+
"Do not hide date format expectations."
|
|
1473
|
+
],
|
|
1474
|
+
"agentHints": [
|
|
1475
|
+
"Choose DatePicker for date fields in forms.",
|
|
1476
|
+
"Choose Calendar for visible scheduling surfaces."
|
|
1477
|
+
]
|
|
1478
|
+
},
|
|
1479
|
+
"direction": {
|
|
1480
|
+
"id": "direction",
|
|
1481
|
+
"name": "DirectionProvider",
|
|
1482
|
+
"category": "basic",
|
|
1483
|
+
"status": "stable",
|
|
1484
|
+
"intent": "Direction context provider for left-to-right and right-to-left UI rendering.",
|
|
1485
|
+
"packageImport": "import { DirectionProvider, useDirection } from 'sparkdesign'",
|
|
1486
|
+
"cliAdd": "npx sparkdesign@latest add direction",
|
|
1487
|
+
"slots": [
|
|
1488
|
+
"DirectionProvider",
|
|
1489
|
+
"children",
|
|
1490
|
+
"dir"
|
|
1491
|
+
],
|
|
1492
|
+
"states": [
|
|
1493
|
+
"ltr",
|
|
1494
|
+
"rtl",
|
|
1495
|
+
"inherited",
|
|
1496
|
+
"explicit"
|
|
1497
|
+
],
|
|
1498
|
+
"a11y": [
|
|
1499
|
+
"Set direction at a meaningful subtree boundary.",
|
|
1500
|
+
"Do not mix opposing directions inside a single phrase unless the content requires it.",
|
|
1501
|
+
"Keep icon mirroring and reading order consistent with the selected direction."
|
|
1502
|
+
],
|
|
1503
|
+
"composition": [
|
|
1504
|
+
"NavigationMenu",
|
|
1505
|
+
"Tabs",
|
|
1506
|
+
"DropdownMenu",
|
|
1507
|
+
"Table"
|
|
1508
|
+
],
|
|
1509
|
+
"antiPatterns": [
|
|
1510
|
+
"Do not use DirectionProvider as a layout alignment shortcut.",
|
|
1511
|
+
"Do not hard-code direction when content locale should decide it.",
|
|
1512
|
+
"Do not wrap tiny isolated controls when the whole app direction is known."
|
|
1513
|
+
],
|
|
1514
|
+
"agentHints": [
|
|
1515
|
+
"Choose DirectionProvider when generating RTL-ready demos, localized shells, or bidirectional component examples.",
|
|
1516
|
+
"Use CSS alignment utilities for visual alignment that is unrelated to language direction."
|
|
1517
|
+
]
|
|
1518
|
+
},
|
|
1519
|
+
"field": {
|
|
1520
|
+
"id": "field",
|
|
1521
|
+
"name": "Field",
|
|
1522
|
+
"category": "basic",
|
|
1523
|
+
"status": "stable",
|
|
1524
|
+
"intent": "Form field structure for labels, descriptions, errors, grouped controls, and fieldsets.",
|
|
1525
|
+
"packageImport": "import { Field, FieldLabel, FieldDescription, FieldError, FieldGroup } from 'sparkdesign'",
|
|
1526
|
+
"cliAdd": "npx sparkdesign@latest add field",
|
|
1527
|
+
"slots": [
|
|
1528
|
+
"Field",
|
|
1529
|
+
"FieldLabel",
|
|
1530
|
+
"FieldDescription",
|
|
1531
|
+
"FieldError",
|
|
1532
|
+
"FieldContent",
|
|
1533
|
+
"FieldGroup",
|
|
1534
|
+
"FieldSet",
|
|
1535
|
+
"FieldLegend"
|
|
1536
|
+
],
|
|
1537
|
+
"states": [
|
|
1538
|
+
"default",
|
|
1539
|
+
"invalid",
|
|
1540
|
+
"disabled by composition",
|
|
1541
|
+
"required by composition",
|
|
1542
|
+
"grouped"
|
|
1543
|
+
],
|
|
1544
|
+
"a11y": [
|
|
1545
|
+
"Associate labels and descriptions with the underlying control.",
|
|
1546
|
+
"Expose errors as readable text.",
|
|
1547
|
+
"Use FieldSet and FieldLegend for grouped related controls."
|
|
1548
|
+
],
|
|
1549
|
+
"composition": [
|
|
1550
|
+
"Input",
|
|
1551
|
+
"Textarea",
|
|
1552
|
+
"Select",
|
|
1553
|
+
"Checkbox",
|
|
1554
|
+
"RadioGroup",
|
|
1555
|
+
"Switch"
|
|
1556
|
+
],
|
|
1557
|
+
"antiPatterns": [
|
|
1558
|
+
"Do not use Field as generic spacing wrapper.",
|
|
1559
|
+
"Do not show errors only through border color.",
|
|
1560
|
+
"Do not duplicate labels between FieldLabel and placeholder."
|
|
1561
|
+
],
|
|
1562
|
+
"agentHints": [
|
|
1563
|
+
"Choose Field when generated forms need label, help text, and validation.",
|
|
1564
|
+
"Use Label alone for very small inline controls."
|
|
1565
|
+
]
|
|
1566
|
+
},
|
|
1567
|
+
"form": {
|
|
1568
|
+
"id": "form",
|
|
1569
|
+
"name": "Form",
|
|
1570
|
+
"category": "basic",
|
|
1571
|
+
"status": "stable",
|
|
1572
|
+
"intent": "React Hook Form composition helpers for validated forms.",
|
|
1573
|
+
"packageImport": "import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from 'sparkdesign'",
|
|
1574
|
+
"cliAdd": "npx sparkdesign@latest add form",
|
|
1575
|
+
"slots": [
|
|
1576
|
+
"Form",
|
|
1577
|
+
"FormField",
|
|
1578
|
+
"FormItem",
|
|
1579
|
+
"FormLabel",
|
|
1580
|
+
"FormControl",
|
|
1581
|
+
"FormDescription",
|
|
1582
|
+
"FormMessage"
|
|
1583
|
+
],
|
|
1584
|
+
"states": [
|
|
1585
|
+
"valid",
|
|
1586
|
+
"invalid",
|
|
1587
|
+
"dirty",
|
|
1588
|
+
"submitted",
|
|
1589
|
+
"described",
|
|
1590
|
+
"controlled field"
|
|
1591
|
+
],
|
|
1592
|
+
"a11y": [
|
|
1593
|
+
"Connect every FormLabel to its FormControl.",
|
|
1594
|
+
"Expose validation errors through FormMessage.",
|
|
1595
|
+
"Do not rely on placeholder text as the only field label."
|
|
1596
|
+
],
|
|
1597
|
+
"composition": [
|
|
1598
|
+
"Input",
|
|
1599
|
+
"Textarea",
|
|
1600
|
+
"Select",
|
|
1601
|
+
"Checkbox",
|
|
1602
|
+
"Button"
|
|
1603
|
+
],
|
|
1604
|
+
"antiPatterns": [
|
|
1605
|
+
"Do not use Form without react-hook-form context.",
|
|
1606
|
+
"Do not use Form helpers for static display-only fields.",
|
|
1607
|
+
"Do not hide validation errors outside the field reading order."
|
|
1608
|
+
],
|
|
1609
|
+
"agentHints": [
|
|
1610
|
+
"Choose Form when generating validated forms with React Hook Form wiring.",
|
|
1611
|
+
"Choose Field for layout-only form rows that do not need react-hook-form."
|
|
1612
|
+
]
|
|
1613
|
+
},
|
|
1614
|
+
"icon-button": {
|
|
1615
|
+
"id": "icon-button",
|
|
1616
|
+
"name": "IconButton",
|
|
1617
|
+
"category": "basic",
|
|
1618
|
+
"status": "stable",
|
|
1619
|
+
"intent": "Icon-only action button with enforced accessible naming for dense toolbars and compact controls.",
|
|
1620
|
+
"packageImport": "import { IconButton } from 'sparkdesign'",
|
|
1621
|
+
"cliAdd": "npx sparkdesign@latest add icon-button",
|
|
1622
|
+
"slots": [
|
|
1623
|
+
"icon",
|
|
1624
|
+
"accessible name",
|
|
1625
|
+
"loading by composition",
|
|
1626
|
+
"tooltip by composition"
|
|
1627
|
+
],
|
|
1628
|
+
"states": [
|
|
1629
|
+
"default",
|
|
1630
|
+
"hover",
|
|
1631
|
+
"focus-visible",
|
|
1632
|
+
"disabled",
|
|
1633
|
+
"pressed by composition"
|
|
1634
|
+
],
|
|
1635
|
+
"a11y": [
|
|
1636
|
+
"Provide aria-label, aria-labelledby, or title.",
|
|
1637
|
+
"Use Tooltip to clarify unfamiliar icons, but keep the button itself named.",
|
|
1638
|
+
"Do not rely on icon shape alone for meaning."
|
|
1639
|
+
],
|
|
1640
|
+
"composition": [
|
|
1641
|
+
"Tooltip",
|
|
1642
|
+
"DropdownMenu",
|
|
1643
|
+
"ButtonGroup",
|
|
1644
|
+
"AlertDialog"
|
|
1645
|
+
],
|
|
1646
|
+
"antiPatterns": [
|
|
1647
|
+
"Do not use IconButton for primary labeled actions when text would reduce ambiguity.",
|
|
1648
|
+
"Do not omit accessible names.",
|
|
1649
|
+
"Do not use decorative icons as controls."
|
|
1650
|
+
],
|
|
1651
|
+
"agentHints": [
|
|
1652
|
+
"Choose IconButton for compact repeated actions like edit, remove, copy, or more.",
|
|
1653
|
+
"Use Button when the action needs a visible label."
|
|
1654
|
+
]
|
|
1655
|
+
},
|
|
1656
|
+
"input": {
|
|
1657
|
+
"id": "input",
|
|
1658
|
+
"name": "Input",
|
|
1659
|
+
"category": "basic",
|
|
1660
|
+
"status": "stable",
|
|
1661
|
+
"intent": "Single-line text, search, URL, email, number, password, or file input with Spark token styling.",
|
|
1662
|
+
"packageImport": "import { Input } from 'sparkdesign'",
|
|
1663
|
+
"cliAdd": "npx sparkdesign@latest add input",
|
|
1664
|
+
"slots": [
|
|
1665
|
+
"Input",
|
|
1666
|
+
"native input attributes",
|
|
1667
|
+
"label by composition",
|
|
1668
|
+
"description by composition",
|
|
1669
|
+
"error by composition"
|
|
1670
|
+
],
|
|
1671
|
+
"states": [
|
|
1672
|
+
"default",
|
|
1673
|
+
"focus-visible",
|
|
1674
|
+
"disabled",
|
|
1675
|
+
"read-only",
|
|
1676
|
+
"invalid",
|
|
1677
|
+
"file"
|
|
1678
|
+
],
|
|
1679
|
+
"a11y": [
|
|
1680
|
+
"Associate every user-facing input with Label or aria-label.",
|
|
1681
|
+
"Expose validation errors with readable text and aria-invalid when applicable.",
|
|
1682
|
+
"Use the correct native type instead of masking semantics with custom UI."
|
|
1683
|
+
],
|
|
1684
|
+
"composition": [
|
|
1685
|
+
"Label",
|
|
1686
|
+
"Field",
|
|
1687
|
+
"InputGroup",
|
|
1688
|
+
"Button",
|
|
1689
|
+
"Alert"
|
|
1690
|
+
],
|
|
1691
|
+
"antiPatterns": [
|
|
1692
|
+
"Do not use Input for multi-line text; use Textarea.",
|
|
1693
|
+
"Do not rely on placeholder text as the only label.",
|
|
1694
|
+
"Do not build custom combobox behavior from Input when Combobox or Command fits."
|
|
1695
|
+
],
|
|
1696
|
+
"agentHints": [
|
|
1697
|
+
"Choose Input for short free-form values.",
|
|
1698
|
+
"Wrap with Field when the generated UI needs label, description, and error structure."
|
|
1699
|
+
]
|
|
1700
|
+
},
|
|
1701
|
+
"input-group": {
|
|
1702
|
+
"id": "input-group",
|
|
1703
|
+
"name": "InputGroup",
|
|
1704
|
+
"category": "basic",
|
|
1705
|
+
"status": "stable",
|
|
1706
|
+
"intent": "Compound input wrapper for inputs with addons, buttons, text, or textarea affordances.",
|
|
1707
|
+
"packageImport": "import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton, InputGroupTextarea } from 'sparkdesign'",
|
|
1708
|
+
"cliAdd": "npx sparkdesign@latest add input-group",
|
|
1709
|
+
"slots": [
|
|
1710
|
+
"InputGroup",
|
|
1711
|
+
"InputGroupInput",
|
|
1712
|
+
"InputGroupTextarea",
|
|
1713
|
+
"InputGroupAddon",
|
|
1714
|
+
"InputGroupButton",
|
|
1715
|
+
"InputGroupText"
|
|
1716
|
+
],
|
|
1717
|
+
"states": [
|
|
1718
|
+
"default",
|
|
1719
|
+
"focused child",
|
|
1720
|
+
"disabled child",
|
|
1721
|
+
"with leading addon",
|
|
1722
|
+
"with trailing action",
|
|
1723
|
+
"textarea"
|
|
1724
|
+
],
|
|
1725
|
+
"a11y": [
|
|
1726
|
+
"Keep the actual input or textarea labeled.",
|
|
1727
|
+
"Use buttons inside InputGroup only for related field actions.",
|
|
1728
|
+
"Do not put unrelated controls into the group."
|
|
1729
|
+
],
|
|
1730
|
+
"composition": [
|
|
1731
|
+
"Input",
|
|
1732
|
+
"Textarea",
|
|
1733
|
+
"Button",
|
|
1734
|
+
"Tooltip",
|
|
1735
|
+
"Field"
|
|
1736
|
+
],
|
|
1737
|
+
"antiPatterns": [
|
|
1738
|
+
"Do not use InputGroup as a generic horizontal layout container.",
|
|
1739
|
+
"Do not hide the field label inside an addon only.",
|
|
1740
|
+
"Do not place multiple competing submit actions inside one field group."
|
|
1741
|
+
],
|
|
1742
|
+
"agentHints": [
|
|
1743
|
+
"Choose InputGroup for URL prefixes, search actions, copy buttons, and inline units.",
|
|
1744
|
+
"Use plain Input when no attached affordance is needed."
|
|
1745
|
+
]
|
|
1746
|
+
},
|
|
1747
|
+
"input-otp": {
|
|
1748
|
+
"id": "input-otp",
|
|
1749
|
+
"name": "InputOTP",
|
|
1750
|
+
"category": "basic",
|
|
1751
|
+
"status": "stable",
|
|
1752
|
+
"intent": "Segmented one-time passcode, verification code, or short token entry.",
|
|
1753
|
+
"packageImport": "import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from 'sparkdesign'",
|
|
1754
|
+
"cliAdd": "npx sparkdesign@latest add input-otp",
|
|
1755
|
+
"slots": [
|
|
1756
|
+
"InputOTP",
|
|
1757
|
+
"InputOTPGroup",
|
|
1758
|
+
"InputOTPSlot",
|
|
1759
|
+
"InputOTPSeparator"
|
|
1760
|
+
],
|
|
1761
|
+
"states": [
|
|
1762
|
+
"empty",
|
|
1763
|
+
"partially filled",
|
|
1764
|
+
"filled",
|
|
1765
|
+
"focused slot",
|
|
1766
|
+
"invalid by composition",
|
|
1767
|
+
"disabled"
|
|
1768
|
+
],
|
|
1769
|
+
"a11y": [
|
|
1770
|
+
"Label the verification code field clearly.",
|
|
1771
|
+
"Expose validation errors as readable text.",
|
|
1772
|
+
"Do not split ordinary text input into OTP slots."
|
|
1773
|
+
],
|
|
1774
|
+
"composition": [
|
|
1775
|
+
"Field",
|
|
1776
|
+
"Label",
|
|
1777
|
+
"Button",
|
|
1778
|
+
"Alert",
|
|
1779
|
+
"Spinner"
|
|
1780
|
+
],
|
|
1781
|
+
"antiPatterns": [
|
|
1782
|
+
"Do not use InputOTP for passwords, names, or arbitrary numeric input.",
|
|
1783
|
+
"Do not hide resend or recovery options when verification can fail.",
|
|
1784
|
+
"Do not assume every verification code has the same length without product rules."
|
|
1785
|
+
],
|
|
1786
|
+
"agentHints": [
|
|
1787
|
+
"Choose InputOTP for authentication, invite, or device verification codes.",
|
|
1788
|
+
"Use Input for normal short strings and numbers."
|
|
1789
|
+
]
|
|
1790
|
+
},
|
|
1791
|
+
"item": {
|
|
1792
|
+
"id": "item",
|
|
1793
|
+
"name": "Item",
|
|
1794
|
+
"category": "basic",
|
|
1795
|
+
"status": "stable",
|
|
1796
|
+
"intent": "Composable list row or detail item with media, content, actions, footer, and separators.",
|
|
1797
|
+
"packageImport": "import { Item, ItemContent, ItemTitle, ItemDescription, ItemActions } from 'sparkdesign'",
|
|
1798
|
+
"cliAdd": "npx sparkdesign@latest add item",
|
|
1799
|
+
"slots": [
|
|
1800
|
+
"Item",
|
|
1801
|
+
"ItemMedia",
|
|
1802
|
+
"ItemContent",
|
|
1803
|
+
"ItemHeader",
|
|
1804
|
+
"ItemTitle",
|
|
1805
|
+
"ItemDescription",
|
|
1806
|
+
"ItemActions",
|
|
1807
|
+
"ItemFooter",
|
|
1808
|
+
"ItemGroup",
|
|
1809
|
+
"ItemSeparator"
|
|
1810
|
+
],
|
|
1811
|
+
"states": [
|
|
1812
|
+
"default",
|
|
1813
|
+
"interactive by composition",
|
|
1814
|
+
"with media",
|
|
1815
|
+
"with actions",
|
|
1816
|
+
"grouped",
|
|
1817
|
+
"disabled by composition"
|
|
1818
|
+
],
|
|
1819
|
+
"a11y": [
|
|
1820
|
+
"Keep row actions keyboard reachable and clearly named.",
|
|
1821
|
+
"Use semantic links or buttons inside the item when it navigates or performs an action.",
|
|
1822
|
+
"Do not make the whole item clickable when it contains nested controls unless event behavior is clear."
|
|
1823
|
+
],
|
|
1824
|
+
"composition": [
|
|
1825
|
+
"Avatar",
|
|
1826
|
+
"IconButton",
|
|
1827
|
+
"DropdownMenu",
|
|
1828
|
+
"Separator",
|
|
1829
|
+
"Tag"
|
|
1830
|
+
],
|
|
1831
|
+
"antiPatterns": [
|
|
1832
|
+
"Do not use Item for tabular data that needs column relationships; use Table or DataTable.",
|
|
1833
|
+
"Do not overload one item with many unrelated actions.",
|
|
1834
|
+
"Do not nest Card inside Item without a clear hierarchy."
|
|
1835
|
+
],
|
|
1836
|
+
"agentHints": [
|
|
1837
|
+
"Choose Item for settings rows, activity rows, file rows, search results, and compact resource summaries.",
|
|
1838
|
+
"Use Card when the content needs a standalone framed surface."
|
|
1839
|
+
]
|
|
1840
|
+
},
|
|
1841
|
+
"kbd": {
|
|
1842
|
+
"id": "kbd",
|
|
1843
|
+
"name": "Kbd",
|
|
1844
|
+
"category": "basic",
|
|
1845
|
+
"status": "stable",
|
|
1846
|
+
"intent": "Keyboard shortcut or key token display for command hints and documentation.",
|
|
1847
|
+
"packageImport": "import { Kbd, KbdGroup } from 'sparkdesign'",
|
|
1848
|
+
"cliAdd": "npx sparkdesign@latest add kbd",
|
|
1849
|
+
"slots": [
|
|
1850
|
+
"Kbd",
|
|
1851
|
+
"KbdGroup",
|
|
1852
|
+
"key text"
|
|
1853
|
+
],
|
|
1854
|
+
"states": [
|
|
1855
|
+
"single key",
|
|
1856
|
+
"key group",
|
|
1857
|
+
"shortcut sequence",
|
|
1858
|
+
"inline"
|
|
1859
|
+
],
|
|
1860
|
+
"a11y": [
|
|
1861
|
+
"Keep shortcut text readable and not the only way to invoke a command.",
|
|
1862
|
+
"Use platform-appropriate key labels when the product knows the platform.",
|
|
1863
|
+
"Do not use Kbd styling for ordinary badges or tags."
|
|
1864
|
+
],
|
|
1865
|
+
"composition": [
|
|
1866
|
+
"Command",
|
|
1867
|
+
"Menubar",
|
|
1868
|
+
"Tooltip",
|
|
1869
|
+
"Typography"
|
|
1870
|
+
],
|
|
1871
|
+
"antiPatterns": [
|
|
1872
|
+
"Do not use Kbd as a generic pill component.",
|
|
1873
|
+
"Do not hide command labels and show only shortcuts.",
|
|
1874
|
+
"Do not use misleading platform-specific shortcut symbols."
|
|
1875
|
+
],
|
|
1876
|
+
"agentHints": [
|
|
1877
|
+
"Choose Kbd for visible keyboard shortcuts and key names.",
|
|
1878
|
+
"Use Tag for labels, statuses, or categories."
|
|
1879
|
+
]
|
|
1880
|
+
},
|
|
1881
|
+
"label": {
|
|
1882
|
+
"id": "label",
|
|
1883
|
+
"name": "Label",
|
|
1884
|
+
"category": "basic",
|
|
1885
|
+
"status": "stable",
|
|
1886
|
+
"intent": "Accessible text label for form controls and settings.",
|
|
1887
|
+
"packageImport": "import { Label } from 'sparkdesign'",
|
|
1888
|
+
"cliAdd": "npx sparkdesign@latest add label",
|
|
1889
|
+
"slots": [
|
|
1890
|
+
"Label",
|
|
1891
|
+
"htmlFor target",
|
|
1892
|
+
"children"
|
|
1893
|
+
],
|
|
1894
|
+
"states": [
|
|
1895
|
+
"default",
|
|
1896
|
+
"disabled by composition",
|
|
1897
|
+
"required by composition"
|
|
1898
|
+
],
|
|
1899
|
+
"a11y": [
|
|
1900
|
+
"Connect Label to its control with htmlFor or a wrapping pattern.",
|
|
1901
|
+
"Keep labels concise and specific.",
|
|
1902
|
+
"Do not replace labels with placeholder-only copy."
|
|
1903
|
+
],
|
|
1904
|
+
"composition": [
|
|
1905
|
+
"Input",
|
|
1906
|
+
"Textarea",
|
|
1907
|
+
"Select",
|
|
1908
|
+
"Checkbox",
|
|
1909
|
+
"RadioGroup",
|
|
1910
|
+
"Switch"
|
|
1911
|
+
],
|
|
1912
|
+
"antiPatterns": [
|
|
1913
|
+
"Do not use Label as a generic typography component.",
|
|
1914
|
+
"Do not point htmlFor at a non-control element.",
|
|
1915
|
+
"Do not make required state visible only through color."
|
|
1916
|
+
],
|
|
1917
|
+
"agentHints": [
|
|
1918
|
+
"Use Label for every visible form field in generated forms.",
|
|
1919
|
+
"Use Typography or plain text for non-form captions."
|
|
1920
|
+
]
|
|
1921
|
+
},
|
|
1922
|
+
"radio-group": {
|
|
1923
|
+
"id": "radio-group",
|
|
1924
|
+
"name": "RadioGroup",
|
|
1925
|
+
"category": "basic",
|
|
1926
|
+
"status": "stable",
|
|
1927
|
+
"intent": "Mutually exclusive option picker where all or most choices should be visible at once.",
|
|
1928
|
+
"packageImport": "import { RadioGroup, RadioGroupItem } from 'sparkdesign'",
|
|
1929
|
+
"cliAdd": "npx sparkdesign@latest add radio-group",
|
|
1930
|
+
"slots": [
|
|
1931
|
+
"RadioGroup",
|
|
1932
|
+
"RadioGroupItem",
|
|
1933
|
+
"label by composition",
|
|
1934
|
+
"description by composition"
|
|
1935
|
+
],
|
|
1936
|
+
"states": [
|
|
1937
|
+
"selected",
|
|
1938
|
+
"unselected",
|
|
1939
|
+
"disabled",
|
|
1940
|
+
"focus-visible",
|
|
1941
|
+
"horizontal by layout",
|
|
1942
|
+
"vertical by layout"
|
|
1943
|
+
],
|
|
1944
|
+
"a11y": [
|
|
1945
|
+
"Give the group a visible label or accessible name.",
|
|
1946
|
+
"Pair each item with readable text.",
|
|
1947
|
+
"Use RadioGroup only when exactly one option can be selected."
|
|
1948
|
+
],
|
|
1949
|
+
"composition": [
|
|
1950
|
+
"Label",
|
|
1951
|
+
"Field",
|
|
1952
|
+
"Card",
|
|
1953
|
+
"Alert"
|
|
1954
|
+
],
|
|
1955
|
+
"antiPatterns": [
|
|
1956
|
+
"Do not use RadioGroup for independent toggles; use Checkbox or Switch.",
|
|
1957
|
+
"Do not use RadioGroup when the option list is very long; consider Select or Combobox.",
|
|
1958
|
+
"Do not make option meaning depend only on icons."
|
|
1959
|
+
],
|
|
1960
|
+
"agentHints": [
|
|
1961
|
+
"Choose RadioGroup for 2-6 visible exclusive options.",
|
|
1962
|
+
"Choose Select when space is tight or choices are numerous."
|
|
1963
|
+
]
|
|
1964
|
+
},
|
|
1965
|
+
"progress": {
|
|
1966
|
+
"id": "progress",
|
|
1967
|
+
"name": "Progress",
|
|
1968
|
+
"category": "basic",
|
|
1969
|
+
"status": "stable",
|
|
1970
|
+
"intent": "Linear progress indicator for determinate task completion, uploads, generation, or setup flows.",
|
|
1971
|
+
"packageImport": "import { Progress } from 'sparkdesign'",
|
|
1972
|
+
"cliAdd": "npx sparkdesign@latest add progress",
|
|
1973
|
+
"slots": [
|
|
1974
|
+
"Progress",
|
|
1975
|
+
"value",
|
|
1976
|
+
"label by composition",
|
|
1977
|
+
"status text by composition"
|
|
1978
|
+
],
|
|
1979
|
+
"states": [
|
|
1980
|
+
"determinate",
|
|
1981
|
+
"indeterminate by composition",
|
|
1982
|
+
"complete",
|
|
1983
|
+
"error by composition",
|
|
1984
|
+
"disabled by composition"
|
|
1985
|
+
],
|
|
1986
|
+
"a11y": [
|
|
1987
|
+
"Provide readable status text when progress matters to the task.",
|
|
1988
|
+
"Use aria values correctly for determinate progress.",
|
|
1989
|
+
"Do not rely on bar length alone for critical status."
|
|
1990
|
+
],
|
|
1991
|
+
"composition": [
|
|
1992
|
+
"TaskPart",
|
|
1993
|
+
"GenerationStatusBar",
|
|
1994
|
+
"Card",
|
|
1995
|
+
"Alert"
|
|
1996
|
+
],
|
|
1997
|
+
"antiPatterns": [
|
|
1998
|
+
"Do not use Progress as decorative loading chrome.",
|
|
1999
|
+
"Do not show fake precision when actual progress is unknown.",
|
|
2000
|
+
"Do not replace short inline loading with a full progress bar."
|
|
2001
|
+
],
|
|
2002
|
+
"agentHints": [
|
|
2003
|
+
"Choose Progress when there is meaningful completion percentage.",
|
|
2004
|
+
"Use Spinner for brief unknown-duration loading."
|
|
2005
|
+
]
|
|
2006
|
+
},
|
|
2007
|
+
"resizable": {
|
|
2008
|
+
"id": "resizable",
|
|
2009
|
+
"name": "Resizable",
|
|
2010
|
+
"category": "basic",
|
|
2011
|
+
"status": "stable",
|
|
2012
|
+
"intent": "Resizable panel group primitives for split panes, inspectors, sidebars, and adjustable workspaces.",
|
|
2013
|
+
"packageImport": "import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from 'sparkdesign'",
|
|
2014
|
+
"cliAdd": "npx sparkdesign@latest add resizable",
|
|
2015
|
+
"slots": [
|
|
2016
|
+
"ResizablePanelGroup",
|
|
2017
|
+
"ResizablePanel",
|
|
2018
|
+
"ResizableHandle"
|
|
2019
|
+
],
|
|
2020
|
+
"states": [
|
|
2021
|
+
"horizontal",
|
|
2022
|
+
"vertical",
|
|
2023
|
+
"dragging",
|
|
2024
|
+
"collapsed by configuration",
|
|
2025
|
+
"with handle",
|
|
2026
|
+
"keyboard resize"
|
|
2027
|
+
],
|
|
2028
|
+
"a11y": [
|
|
2029
|
+
"Keep panel content reachable when resized small.",
|
|
2030
|
+
"Use handles only between panels that can actually resize.",
|
|
2031
|
+
"Do not make critical controls disappear without a recovery path."
|
|
2032
|
+
],
|
|
2033
|
+
"composition": [
|
|
2034
|
+
"SidebarMenu",
|
|
2035
|
+
"ScrollArea",
|
|
2036
|
+
"Tabs",
|
|
2037
|
+
"Tooltip"
|
|
2038
|
+
],
|
|
2039
|
+
"antiPatterns": [
|
|
2040
|
+
"Do not use Resizable for simple fixed columns.",
|
|
2041
|
+
"Do not nest many resizable groups unless the workspace model requires it.",
|
|
2042
|
+
"Do not let text or controls overflow when panels become narrow."
|
|
2043
|
+
],
|
|
2044
|
+
"agentHints": [
|
|
2045
|
+
"Choose Resizable for IDE-like shells, split inspectors, preview panes, and data workspaces.",
|
|
2046
|
+
"Use normal CSS grid or flex for static layouts."
|
|
2047
|
+
]
|
|
2048
|
+
},
|
|
2049
|
+
"select": {
|
|
2050
|
+
"id": "select",
|
|
2051
|
+
"name": "Select",
|
|
2052
|
+
"category": "basic",
|
|
2053
|
+
"status": "stable",
|
|
2054
|
+
"intent": "Dropdown form control for choosing one persistent value from a known option set.",
|
|
2055
|
+
"packageImport": "import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from 'sparkdesign'",
|
|
2056
|
+
"cliAdd": "npx sparkdesign@latest add select",
|
|
2057
|
+
"slots": [
|
|
2058
|
+
"Select",
|
|
2059
|
+
"SelectTrigger",
|
|
2060
|
+
"SelectValue",
|
|
2061
|
+
"SelectContent",
|
|
2062
|
+
"SelectItem",
|
|
2063
|
+
"SelectGroup",
|
|
2064
|
+
"SelectLabel",
|
|
2065
|
+
"SelectSeparator"
|
|
2066
|
+
],
|
|
2067
|
+
"states": [
|
|
2068
|
+
"open",
|
|
2069
|
+
"closed",
|
|
2070
|
+
"selected",
|
|
2071
|
+
"placeholder",
|
|
2072
|
+
"disabled",
|
|
2073
|
+
"invalid by composition"
|
|
2074
|
+
],
|
|
2075
|
+
"a11y": [
|
|
2076
|
+
"Pair with Label or otherwise provide an accessible name.",
|
|
2077
|
+
"Use placeholder copy only as a hint, not as the label.",
|
|
2078
|
+
"Keep option labels concise and unique."
|
|
2079
|
+
],
|
|
2080
|
+
"composition": [
|
|
2081
|
+
"Label",
|
|
2082
|
+
"Field",
|
|
2083
|
+
"Popover",
|
|
2084
|
+
"Alert"
|
|
2085
|
+
],
|
|
2086
|
+
"antiPatterns": [
|
|
2087
|
+
"Do not use Select for command menus; use DropdownMenu.",
|
|
2088
|
+
"Do not use Select for free-form search across large remote datasets; use Combobox or Command.",
|
|
2089
|
+
"Do not put destructive commands inside SelectItem."
|
|
2090
|
+
],
|
|
2091
|
+
"agentHints": [
|
|
2092
|
+
"Choose Select when the value will be saved as field state.",
|
|
2093
|
+
"Use NativeSelect when platform-native behavior is more important than custom popover styling."
|
|
2094
|
+
]
|
|
2095
|
+
},
|
|
2096
|
+
"native-select": {
|
|
2097
|
+
"id": "native-select",
|
|
2098
|
+
"name": "NativeSelect",
|
|
2099
|
+
"category": "basic",
|
|
2100
|
+
"status": "stable",
|
|
2101
|
+
"intent": "Browser-native select control for simple form value selection with platform behavior.",
|
|
2102
|
+
"packageImport": "import { NativeSelect, NativeSelectOption, NativeSelectOptGroup } from 'sparkdesign'",
|
|
2103
|
+
"cliAdd": "npx sparkdesign@latest add native-select",
|
|
2104
|
+
"slots": [
|
|
2105
|
+
"NativeSelect",
|
|
2106
|
+
"NativeSelectOption",
|
|
2107
|
+
"NativeSelectOptGroup"
|
|
2108
|
+
],
|
|
2109
|
+
"states": [
|
|
2110
|
+
"selected",
|
|
2111
|
+
"placeholder option",
|
|
2112
|
+
"disabled",
|
|
2113
|
+
"invalid",
|
|
2114
|
+
"small size"
|
|
2115
|
+
],
|
|
2116
|
+
"a11y": [
|
|
2117
|
+
"Pair with Label or an accessible name.",
|
|
2118
|
+
"Use native option text that is readable without custom formatting.",
|
|
2119
|
+
"Keep disabled placeholder behavior explicit."
|
|
2120
|
+
],
|
|
2121
|
+
"composition": [
|
|
2122
|
+
"Field",
|
|
2123
|
+
"Label",
|
|
2124
|
+
"Alert"
|
|
2125
|
+
],
|
|
2126
|
+
"antiPatterns": [
|
|
2127
|
+
"Do not use NativeSelect for rich option rendering, search, or command menus.",
|
|
2128
|
+
"Do not put destructive actions in native options.",
|
|
2129
|
+
"Do not use when custom trigger/content styling is required; use Select."
|
|
2130
|
+
],
|
|
2131
|
+
"agentHints": [
|
|
2132
|
+
"Choose NativeSelect for simple forms, settings, and platform-native behavior.",
|
|
2133
|
+
"Choose Select or Combobox when the option UI needs richer behavior."
|
|
2134
|
+
]
|
|
2135
|
+
},
|
|
2136
|
+
"option-list": {
|
|
2137
|
+
"id": "option-list",
|
|
2138
|
+
"name": "OptionList",
|
|
2139
|
+
"category": "basic",
|
|
2140
|
+
"status": "stable",
|
|
2141
|
+
"intent": "Keyboard-friendly selectable option list for generated suggestions, choices, or lightweight pickers.",
|
|
2142
|
+
"packageImport": "import { OptionList } from 'sparkdesign'",
|
|
2143
|
+
"cliAdd": "npx sparkdesign@latest add option-list",
|
|
2144
|
+
"slots": [
|
|
2145
|
+
"OptionList",
|
|
2146
|
+
"OptionItem",
|
|
2147
|
+
"prefix",
|
|
2148
|
+
"label",
|
|
2149
|
+
"description"
|
|
2150
|
+
],
|
|
2151
|
+
"states": [
|
|
2152
|
+
"selected",
|
|
2153
|
+
"focused",
|
|
2154
|
+
"disabled",
|
|
2155
|
+
"dimmed",
|
|
2156
|
+
"multi-select by selectedIds"
|
|
2157
|
+
],
|
|
2158
|
+
"a11y": [
|
|
2159
|
+
"Provide unique labels for each option.",
|
|
2160
|
+
"Use descriptions when options need disambiguation.",
|
|
2161
|
+
"Do not rely on numeric prefixes alone to explain choices."
|
|
2162
|
+
],
|
|
2163
|
+
"composition": [
|
|
2164
|
+
"Command",
|
|
2165
|
+
"Card",
|
|
2166
|
+
"ChatInput",
|
|
2167
|
+
"RelatedPrompts"
|
|
2168
|
+
],
|
|
2169
|
+
"antiPatterns": [
|
|
2170
|
+
"Do not use OptionList for persistent form values when Select, RadioGroup, or Checkbox is semantically clearer.",
|
|
2171
|
+
"Do not use it for complex row actions that need menus.",
|
|
2172
|
+
"Do not omit disabled state when an option cannot be chosen."
|
|
2173
|
+
],
|
|
2174
|
+
"agentHints": [
|
|
2175
|
+
"Choose OptionList for AI-generated suggestions, prompt choices, quick pickers, and lightweight selection flows.",
|
|
2176
|
+
"Use Combobox when the list needs search."
|
|
2177
|
+
]
|
|
2178
|
+
},
|
|
2179
|
+
"switch": {
|
|
2180
|
+
"id": "switch",
|
|
2181
|
+
"name": "Switch",
|
|
2182
|
+
"category": "basic",
|
|
2183
|
+
"status": "stable",
|
|
2184
|
+
"intent": "Immediate on/off control for a setting or feature flag.",
|
|
2185
|
+
"packageImport": "import { Switch } from 'sparkdesign'",
|
|
2186
|
+
"cliAdd": "npx sparkdesign@latest add switch",
|
|
2187
|
+
"slots": [
|
|
2188
|
+
"Switch",
|
|
2189
|
+
"thumb",
|
|
2190
|
+
"label by composition",
|
|
2191
|
+
"description by composition"
|
|
2192
|
+
],
|
|
2193
|
+
"states": [
|
|
2194
|
+
"on",
|
|
2195
|
+
"off",
|
|
2196
|
+
"disabled",
|
|
2197
|
+
"focus-visible",
|
|
2198
|
+
"segment variant"
|
|
2199
|
+
],
|
|
2200
|
+
"a11y": [
|
|
2201
|
+
"Pair with Label or aria-label.",
|
|
2202
|
+
"Make the resulting state clear in surrounding copy.",
|
|
2203
|
+
"Avoid switch controls for irreversible or destructive actions."
|
|
2204
|
+
],
|
|
2205
|
+
"composition": [
|
|
2206
|
+
"Label",
|
|
2207
|
+
"Field",
|
|
2208
|
+
"Card",
|
|
2209
|
+
"Tooltip"
|
|
2210
|
+
],
|
|
2211
|
+
"antiPatterns": [
|
|
2212
|
+
"Do not use Switch for multi-option selection; use RadioGroup, Select, or ToggleGroup.",
|
|
2213
|
+
"Do not use Switch when the user must confirm before changing state.",
|
|
2214
|
+
"Do not hide the setting name inside a tooltip only."
|
|
2215
|
+
],
|
|
2216
|
+
"agentHints": [
|
|
2217
|
+
"Choose Switch for settings that can be applied immediately.",
|
|
2218
|
+
"Use Checkbox when the control is part of a form submitted later."
|
|
2219
|
+
]
|
|
2220
|
+
},
|
|
2221
|
+
"skeleton": {
|
|
2222
|
+
"id": "skeleton",
|
|
2223
|
+
"name": "Skeleton",
|
|
2224
|
+
"category": "basic",
|
|
2225
|
+
"status": "stable",
|
|
2226
|
+
"intent": "Placeholder shape for content that is loading while preserving layout stability.",
|
|
2227
|
+
"packageImport": "import { Skeleton } from 'sparkdesign'",
|
|
2228
|
+
"cliAdd": "npx sparkdesign@latest add skeleton",
|
|
2229
|
+
"slots": [
|
|
2230
|
+
"Skeleton",
|
|
2231
|
+
"shape by className",
|
|
2232
|
+
"layout by composition"
|
|
2233
|
+
],
|
|
2234
|
+
"states": [
|
|
2235
|
+
"loading",
|
|
2236
|
+
"content-replaced",
|
|
2237
|
+
"reduced-motion by environment"
|
|
2238
|
+
],
|
|
2239
|
+
"a11y": [
|
|
2240
|
+
"Pair with readable loading state when the wait is meaningful.",
|
|
2241
|
+
"Avoid skeletons that shift layout when content loads.",
|
|
2242
|
+
"Do not expose decorative skeleton blocks as meaningful content."
|
|
2243
|
+
],
|
|
2244
|
+
"composition": [
|
|
2245
|
+
"Card",
|
|
2246
|
+
"Table",
|
|
2247
|
+
"Response",
|
|
2248
|
+
"FileCard"
|
|
2249
|
+
],
|
|
2250
|
+
"antiPatterns": [
|
|
2251
|
+
"Do not use Skeleton after an error; use Alert or Empty with recovery.",
|
|
2252
|
+
"Do not use for very short interactions where Spinner is clearer.",
|
|
2253
|
+
"Do not create fake text density that misrepresents the final layout."
|
|
2254
|
+
],
|
|
2255
|
+
"agentHints": [
|
|
2256
|
+
"Choose Skeleton for page, card, table, or response placeholders.",
|
|
2257
|
+
"Use Spinner for small inline operations."
|
|
2258
|
+
]
|
|
2259
|
+
},
|
|
2260
|
+
"spinner": {
|
|
2261
|
+
"id": "spinner",
|
|
2262
|
+
"name": "Spinner",
|
|
2263
|
+
"category": "basic",
|
|
2264
|
+
"status": "stable",
|
|
2265
|
+
"intent": "Compact indeterminate loading indicator for short or inline operations.",
|
|
2266
|
+
"packageImport": "import { Spinner } from 'sparkdesign'",
|
|
2267
|
+
"cliAdd": "npx sparkdesign@latest add spinner",
|
|
2268
|
+
"slots": [
|
|
2269
|
+
"Spinner",
|
|
2270
|
+
"label by composition",
|
|
2271
|
+
"container by composition"
|
|
2272
|
+
],
|
|
2273
|
+
"states": [
|
|
2274
|
+
"loading",
|
|
2275
|
+
"inline",
|
|
2276
|
+
"button-loading by composition",
|
|
2277
|
+
"hidden after complete"
|
|
2278
|
+
],
|
|
2279
|
+
"a11y": [
|
|
2280
|
+
"Add readable loading text when the action is not otherwise clear.",
|
|
2281
|
+
"Do not rely on motion alone to convey loading.",
|
|
2282
|
+
"Avoid trapping focus on spinner-only content."
|
|
2283
|
+
],
|
|
2284
|
+
"composition": [
|
|
2285
|
+
"Button",
|
|
2286
|
+
"ChatInput",
|
|
2287
|
+
"ToolInvocationCard",
|
|
2288
|
+
"TaskPart"
|
|
2289
|
+
],
|
|
2290
|
+
"antiPatterns": [
|
|
2291
|
+
"Do not use Spinner for long determinate tasks; use Progress.",
|
|
2292
|
+
"Do not leave spinner visible after an error or success state.",
|
|
2293
|
+
"Do not use as decorative motion."
|
|
2294
|
+
],
|
|
2295
|
+
"agentHints": [
|
|
2296
|
+
"Choose Spinner for brief unknown-duration operations.",
|
|
2297
|
+
"Pair with status text for agent tool or generation loading."
|
|
2298
|
+
]
|
|
2299
|
+
},
|
|
2300
|
+
"tabs": {
|
|
2301
|
+
"id": "tabs",
|
|
2302
|
+
"name": "Tabs",
|
|
2303
|
+
"category": "basic",
|
|
2304
|
+
"status": "stable",
|
|
2305
|
+
"intent": "Switch between peer views, panels, or categories without leaving the current surface.",
|
|
2306
|
+
"packageImport": "import { Tabs, TabsList, TabsTrigger, TabsContent } from 'sparkdesign'",
|
|
2307
|
+
"cliAdd": "npx sparkdesign@latest add tabs",
|
|
2308
|
+
"slots": [
|
|
2309
|
+
"Tabs",
|
|
2310
|
+
"TabsList",
|
|
2311
|
+
"TabsTrigger",
|
|
2312
|
+
"TabsContent"
|
|
2313
|
+
],
|
|
2314
|
+
"states": [
|
|
2315
|
+
"active tab",
|
|
2316
|
+
"inactive tab",
|
|
2317
|
+
"disabled tab",
|
|
2318
|
+
"focus-visible",
|
|
2319
|
+
"horizontal",
|
|
2320
|
+
"vertical by layout"
|
|
2321
|
+
],
|
|
2322
|
+
"a11y": [
|
|
2323
|
+
"Keep trigger labels short and descriptive.",
|
|
2324
|
+
"Ensure each TabsContent corresponds to a TabsTrigger value.",
|
|
2325
|
+
"Do not hide critical information behind a tab that users may miss."
|
|
2326
|
+
],
|
|
2327
|
+
"composition": [
|
|
2328
|
+
"Card",
|
|
2329
|
+
"Table",
|
|
2330
|
+
"Form",
|
|
2331
|
+
"Response"
|
|
2332
|
+
],
|
|
2333
|
+
"antiPatterns": [
|
|
2334
|
+
"Do not use Tabs as primary navigation across unrelated pages.",
|
|
2335
|
+
"Do not create one-tab tab lists.",
|
|
2336
|
+
"Do not use Tabs when content should be compared side-by-side."
|
|
2337
|
+
],
|
|
2338
|
+
"agentHints": [
|
|
2339
|
+
"Choose Tabs for sibling modes such as Overview, Activity, Settings.",
|
|
2340
|
+
"Use segmented Switch or ToggleGroup for compact option changes."
|
|
2341
|
+
]
|
|
2342
|
+
},
|
|
2343
|
+
"textarea": {
|
|
2344
|
+
"id": "textarea",
|
|
2345
|
+
"name": "Textarea",
|
|
2346
|
+
"category": "basic",
|
|
2347
|
+
"status": "stable",
|
|
2348
|
+
"intent": "Multi-line text field for notes, prompts, descriptions, comments, and longer free-form input.",
|
|
2349
|
+
"packageImport": "import { Textarea } from 'sparkdesign'",
|
|
2350
|
+
"cliAdd": "npx sparkdesign@latest add textarea",
|
|
2351
|
+
"slots": [
|
|
2352
|
+
"Textarea",
|
|
2353
|
+
"native textarea attributes",
|
|
2354
|
+
"label by composition",
|
|
2355
|
+
"description by composition",
|
|
2356
|
+
"error by composition"
|
|
2357
|
+
],
|
|
2358
|
+
"states": [
|
|
2359
|
+
"default",
|
|
2360
|
+
"focus-visible",
|
|
2361
|
+
"disabled",
|
|
2362
|
+
"read-only",
|
|
2363
|
+
"invalid",
|
|
2364
|
+
"resizable"
|
|
2365
|
+
],
|
|
2366
|
+
"a11y": [
|
|
2367
|
+
"Associate with Label or aria-label.",
|
|
2368
|
+
"Use aria-invalid and readable error text for validation.",
|
|
2369
|
+
"Keep helper text outside placeholder when users need it after typing."
|
|
2370
|
+
],
|
|
2371
|
+
"composition": [
|
|
2372
|
+
"Label",
|
|
2373
|
+
"Field",
|
|
2374
|
+
"Button",
|
|
2375
|
+
"Alert",
|
|
2376
|
+
"ChatInput"
|
|
2377
|
+
],
|
|
2378
|
+
"antiPatterns": [
|
|
2379
|
+
"Do not use Textarea for chat composition when ChatInput is expected.",
|
|
2380
|
+
"Do not use Textarea for short single values; use Input.",
|
|
2381
|
+
"Do not disable resizing when longer text is expected unless layout requires it."
|
|
2382
|
+
],
|
|
2383
|
+
"agentHints": [
|
|
2384
|
+
"Choose Textarea for long-form user-authored text.",
|
|
2385
|
+
"Choose ChatInput for conversational prompt entry with send actions."
|
|
2386
|
+
]
|
|
2387
|
+
},
|
|
2388
|
+
"table": {
|
|
2389
|
+
"id": "table",
|
|
2390
|
+
"name": "Table",
|
|
2391
|
+
"category": "basic",
|
|
2392
|
+
"status": "stable",
|
|
2393
|
+
"intent": "Semantic table primitives for static tabular content, comparison data, or custom table layouts.",
|
|
2394
|
+
"packageImport": "import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from 'sparkdesign'",
|
|
2395
|
+
"cliAdd": "npx sparkdesign@latest add table",
|
|
2396
|
+
"slots": [
|
|
2397
|
+
"Table",
|
|
2398
|
+
"TableHeader",
|
|
2399
|
+
"TableBody",
|
|
2400
|
+
"TableRow",
|
|
2401
|
+
"TableHead",
|
|
2402
|
+
"TableCell",
|
|
2403
|
+
"TableCaption"
|
|
2404
|
+
],
|
|
2405
|
+
"states": [
|
|
2406
|
+
"static",
|
|
2407
|
+
"captioned",
|
|
2408
|
+
"empty by composition",
|
|
2409
|
+
"loading by composition",
|
|
2410
|
+
"custom layout"
|
|
2411
|
+
],
|
|
2412
|
+
"a11y": [
|
|
2413
|
+
"Use table headers for data relationships.",
|
|
2414
|
+
"Use captions or surrounding headings when context is not obvious.",
|
|
2415
|
+
"Do not use tables for purely visual grid layout."
|
|
2416
|
+
],
|
|
2417
|
+
"composition": [
|
|
2418
|
+
"Card",
|
|
2419
|
+
"DataTable",
|
|
2420
|
+
"Skeleton",
|
|
2421
|
+
"Empty"
|
|
2422
|
+
],
|
|
2423
|
+
"antiPatterns": [
|
|
2424
|
+
"Do not use Table for non-tabular card grids.",
|
|
2425
|
+
"Do not omit headers for data tables.",
|
|
2426
|
+
"Do not use Table when DataTable behavior such as repeated columns and row actions is needed."
|
|
2427
|
+
],
|
|
2428
|
+
"agentHints": [
|
|
2429
|
+
"Choose Table for static or custom tabular data.",
|
|
2430
|
+
"Choose DataTable for reusable row/column datasets and actions."
|
|
2431
|
+
]
|
|
2432
|
+
},
|
|
2433
|
+
"tag": {
|
|
2434
|
+
"id": "tag",
|
|
2435
|
+
"name": "Tag",
|
|
2436
|
+
"category": "basic",
|
|
2437
|
+
"status": "stable",
|
|
2438
|
+
"intent": "Compact label, category, status, or removable token displayed inline with content.",
|
|
2439
|
+
"packageImport": "import { Tag } from 'sparkdesign'",
|
|
2440
|
+
"cliAdd": "npx sparkdesign@latest add tag",
|
|
2441
|
+
"slots": [
|
|
2442
|
+
"Tag",
|
|
2443
|
+
"label",
|
|
2444
|
+
"close button",
|
|
2445
|
+
"close icon"
|
|
2446
|
+
],
|
|
2447
|
+
"states": [
|
|
2448
|
+
"filled",
|
|
2449
|
+
"outline",
|
|
2450
|
+
"color variants",
|
|
2451
|
+
"closable",
|
|
2452
|
+
"hover close affordance"
|
|
2453
|
+
],
|
|
2454
|
+
"a11y": [
|
|
2455
|
+
"Use readable text inside every tag.",
|
|
2456
|
+
"Provide a specific closeAriaLabel for removable tags.",
|
|
2457
|
+
"Do not rely on color alone for status meaning."
|
|
2458
|
+
],
|
|
2459
|
+
"composition": [
|
|
2460
|
+
"Item",
|
|
2461
|
+
"DataTable",
|
|
2462
|
+
"FileCard",
|
|
2463
|
+
"Tooltip"
|
|
2464
|
+
],
|
|
2465
|
+
"antiPatterns": [
|
|
2466
|
+
"Do not use Tag as a button when the user expects a command.",
|
|
2467
|
+
"Do not use many colored tags without a clear taxonomy.",
|
|
2468
|
+
"Do not use Tag for keyboard shortcuts; use Kbd."
|
|
2469
|
+
],
|
|
2470
|
+
"agentHints": [
|
|
2471
|
+
"Choose Tag for statuses, categories, filters, labels, and removable tokens.",
|
|
2472
|
+
"Use Alert for important status messages that need explanation."
|
|
2473
|
+
]
|
|
2474
|
+
},
|
|
2475
|
+
"scroll-area": {
|
|
2476
|
+
"id": "scroll-area",
|
|
2477
|
+
"name": "ScrollArea",
|
|
2478
|
+
"category": "basic",
|
|
2479
|
+
"status": "stable",
|
|
2480
|
+
"intent": "Tokenized scroll container with styled scrollbars for constrained panels or dense content regions.",
|
|
2481
|
+
"packageImport": "import { ScrollArea, ScrollBar } from 'sparkdesign'",
|
|
2482
|
+
"cliAdd": "npx sparkdesign@latest add scroll-area",
|
|
2483
|
+
"slots": [
|
|
2484
|
+
"ScrollArea",
|
|
2485
|
+
"ScrollBar",
|
|
2486
|
+
"viewport",
|
|
2487
|
+
"content"
|
|
2488
|
+
],
|
|
2489
|
+
"states": [
|
|
2490
|
+
"vertical scroll",
|
|
2491
|
+
"horizontal scroll",
|
|
2492
|
+
"both axes",
|
|
2493
|
+
"keyboard focus",
|
|
2494
|
+
"overflowing",
|
|
2495
|
+
"not overflowing"
|
|
2496
|
+
],
|
|
2497
|
+
"a11y": [
|
|
2498
|
+
"Keep keyboard focus visible inside the scroll region.",
|
|
2499
|
+
"Ensure important content is not hidden without an obvious scroll affordance.",
|
|
2500
|
+
"Use semantic structure inside the scroll content."
|
|
2501
|
+
],
|
|
2502
|
+
"composition": [
|
|
2503
|
+
"Command",
|
|
2504
|
+
"Dialog",
|
|
2505
|
+
"Sheet",
|
|
2506
|
+
"Table",
|
|
2507
|
+
"Markdown"
|
|
2508
|
+
],
|
|
2509
|
+
"antiPatterns": [
|
|
2510
|
+
"Do not wrap whole pages in nested ScrollArea without a layout reason.",
|
|
2511
|
+
"Do not use ScrollArea to hide layout overflow bugs.",
|
|
2512
|
+
"Do not create nested scroll traps inside small modals."
|
|
2513
|
+
],
|
|
2514
|
+
"agentHints": [
|
|
2515
|
+
"Choose ScrollArea for command lists, side panels, long markdown, and bounded tables.",
|
|
2516
|
+
"Prefer normal page scroll for primary page content."
|
|
2517
|
+
]
|
|
2518
|
+
},
|
|
2519
|
+
"scrollbar": {
|
|
2520
|
+
"id": "scrollbar",
|
|
2521
|
+
"name": "Scrollbar",
|
|
2522
|
+
"category": "basic",
|
|
2523
|
+
"status": "stable",
|
|
2524
|
+
"intent": "Custom scrollbar utility for scrollable containers that need explicit visibility behavior.",
|
|
2525
|
+
"packageImport": "import { Scrollbar } from 'sparkdesign'",
|
|
2526
|
+
"cliAdd": "npx sparkdesign@latest add scrollbar",
|
|
2527
|
+
"slots": [
|
|
2528
|
+
"Scrollbar",
|
|
2529
|
+
"scroll container",
|
|
2530
|
+
"thumb"
|
|
2531
|
+
],
|
|
2532
|
+
"states": [
|
|
2533
|
+
"auto",
|
|
2534
|
+
"always",
|
|
2535
|
+
"hidden",
|
|
2536
|
+
"horizontal",
|
|
2537
|
+
"vertical"
|
|
2538
|
+
],
|
|
2539
|
+
"a11y": [
|
|
2540
|
+
"Do not hide scroll affordance when users may miss overflow content.",
|
|
2541
|
+
"Keep scrollable regions operable by keyboard and touch.",
|
|
2542
|
+
"Use visible state for dense panels where overflow is common."
|
|
2543
|
+
],
|
|
2544
|
+
"composition": [
|
|
2545
|
+
"ScrollArea",
|
|
2546
|
+
"Markdown",
|
|
2547
|
+
"Response",
|
|
2548
|
+
"Table"
|
|
2549
|
+
],
|
|
2550
|
+
"antiPatterns": [
|
|
2551
|
+
"Do not use Scrollbar as decoration.",
|
|
2552
|
+
"Do not hide native scrolling without a tested alternative.",
|
|
2553
|
+
"Do not combine with nested scroll areas that trap interaction."
|
|
2554
|
+
],
|
|
2555
|
+
"agentHints": [
|
|
2556
|
+
"Choose Scrollbar when a custom scroll container needs tokenized scrollbar visibility.",
|
|
2557
|
+
"Use ScrollArea when you need the full scroll container primitive."
|
|
2558
|
+
]
|
|
2559
|
+
},
|
|
2560
|
+
"separator": {
|
|
2561
|
+
"id": "separator",
|
|
2562
|
+
"name": "Separator",
|
|
2563
|
+
"category": "basic",
|
|
2564
|
+
"status": "stable",
|
|
2565
|
+
"intent": "Semantic or decorative divider between related groups of content or controls.",
|
|
2566
|
+
"packageImport": "import { Separator } from 'sparkdesign'",
|
|
2567
|
+
"cliAdd": "npx sparkdesign@latest add separator",
|
|
2568
|
+
"slots": [
|
|
2569
|
+
"Separator",
|
|
2570
|
+
"orientation"
|
|
2571
|
+
],
|
|
2572
|
+
"states": [
|
|
2573
|
+
"horizontal",
|
|
2574
|
+
"vertical",
|
|
2575
|
+
"decorative",
|
|
2576
|
+
"semantic"
|
|
2577
|
+
],
|
|
2578
|
+
"a11y": [
|
|
2579
|
+
"Use decorative separators when the divider is purely visual.",
|
|
2580
|
+
"Do not rely on separators alone to create information hierarchy.",
|
|
2581
|
+
"Keep vertical separators out of places where they confuse reading order."
|
|
2582
|
+
],
|
|
2583
|
+
"composition": [
|
|
2584
|
+
"DropdownMenu",
|
|
2585
|
+
"Menubar",
|
|
2586
|
+
"Field",
|
|
2587
|
+
"Item",
|
|
2588
|
+
"ButtonGroup"
|
|
2589
|
+
],
|
|
2590
|
+
"antiPatterns": [
|
|
2591
|
+
"Do not use Separator as a spacer.",
|
|
2592
|
+
"Do not over-segment dense UIs with repeated dividers.",
|
|
2593
|
+
"Do not replace headings or grouping labels with separators only."
|
|
2594
|
+
],
|
|
2595
|
+
"agentHints": [
|
|
2596
|
+
"Choose Separator to clarify groups inside menus, forms, and sidebars.",
|
|
2597
|
+
"Use spacing and headings first when hierarchy needs explanation."
|
|
2598
|
+
]
|
|
2599
|
+
},
|
|
2600
|
+
"shimmering-text": {
|
|
2601
|
+
"id": "shimmering-text",
|
|
2602
|
+
"name": "ShimmeringText",
|
|
2603
|
+
"category": "basic",
|
|
2604
|
+
"status": "stable",
|
|
2605
|
+
"intent": "Animated text emphasis for active generation, premium affordances, or short status labels.",
|
|
2606
|
+
"packageImport": "import { ShimmeringText } from 'sparkdesign'",
|
|
2607
|
+
"cliAdd": "npx sparkdesign@latest add shimmering-text",
|
|
2608
|
+
"slots": [
|
|
2609
|
+
"ShimmeringText",
|
|
2610
|
+
"text",
|
|
2611
|
+
"motion props"
|
|
2612
|
+
],
|
|
2613
|
+
"states": [
|
|
2614
|
+
"animated",
|
|
2615
|
+
"paused by environment",
|
|
2616
|
+
"inline",
|
|
2617
|
+
"status"
|
|
2618
|
+
],
|
|
2619
|
+
"a11y": [
|
|
2620
|
+
"Keep the underlying text readable without motion.",
|
|
2621
|
+
"Use sparingly so animated emphasis does not distract from task content.",
|
|
2622
|
+
"Avoid shimmering text for critical errors or required labels."
|
|
2623
|
+
],
|
|
2624
|
+
"composition": [
|
|
2625
|
+
"Spinner",
|
|
2626
|
+
"GenerationStatusBar",
|
|
2627
|
+
"ThinkingIndicator",
|
|
2628
|
+
"Card"
|
|
2629
|
+
],
|
|
2630
|
+
"antiPatterns": [
|
|
2631
|
+
"Do not use ShimmeringText for long paragraphs.",
|
|
2632
|
+
"Do not animate multiple competing text elements on the same surface.",
|
|
2633
|
+
"Do not use as the only indicator of loading or success."
|
|
2634
|
+
],
|
|
2635
|
+
"agentHints": [
|
|
2636
|
+
"Choose ShimmeringText for short AI activity labels or lightweight delight.",
|
|
2637
|
+
"Use Spinner, Progress, or Skeleton when loading state needs stronger feedback."
|
|
2638
|
+
]
|
|
2639
|
+
},
|
|
2640
|
+
"slider": {
|
|
2641
|
+
"id": "slider",
|
|
2642
|
+
"name": "Slider",
|
|
2643
|
+
"category": "basic",
|
|
2644
|
+
"status": "stable",
|
|
2645
|
+
"intent": "Continuous or stepped numeric value control for ranges like volume, size, threshold, or intensity.",
|
|
2646
|
+
"packageImport": "import { Slider } from 'sparkdesign'",
|
|
2647
|
+
"cliAdd": "npx sparkdesign@latest add slider",
|
|
2648
|
+
"slots": [
|
|
2649
|
+
"Slider",
|
|
2650
|
+
"track",
|
|
2651
|
+
"range",
|
|
2652
|
+
"thumb",
|
|
2653
|
+
"label by composition",
|
|
2654
|
+
"value text by composition"
|
|
2655
|
+
],
|
|
2656
|
+
"states": [
|
|
2657
|
+
"default",
|
|
2658
|
+
"dragging",
|
|
2659
|
+
"focused",
|
|
2660
|
+
"disabled",
|
|
2661
|
+
"single thumb",
|
|
2662
|
+
"range by composition"
|
|
2663
|
+
],
|
|
2664
|
+
"a11y": [
|
|
2665
|
+
"Provide a label and readable value when the value matters.",
|
|
2666
|
+
"Use sensible min, max, and step values.",
|
|
2667
|
+
"Do not rely on position alone when precise values are required."
|
|
2668
|
+
],
|
|
2669
|
+
"composition": [
|
|
2670
|
+
"Field",
|
|
2671
|
+
"Label",
|
|
2672
|
+
"Input",
|
|
2673
|
+
"Tooltip"
|
|
2674
|
+
],
|
|
2675
|
+
"antiPatterns": [
|
|
2676
|
+
"Do not use Slider for categorical choices; use RadioGroup, Select, or ToggleGroup.",
|
|
2677
|
+
"Do not use when exact typed numeric entry is required without also offering Input.",
|
|
2678
|
+
"Do not hide units or scale meaning."
|
|
2679
|
+
],
|
|
2680
|
+
"agentHints": [
|
|
2681
|
+
"Choose Slider for adjustable numeric settings with immediate visual feedback.",
|
|
2682
|
+
"Pair with Input when users need precise values."
|
|
2683
|
+
]
|
|
2684
|
+
},
|
|
2685
|
+
"toggle": {
|
|
2686
|
+
"id": "toggle",
|
|
2687
|
+
"name": "Toggle",
|
|
2688
|
+
"category": "basic",
|
|
2689
|
+
"status": "stable",
|
|
2690
|
+
"intent": "Pressed/unpressed button control for a single mode, formatting option, or transient UI state.",
|
|
2691
|
+
"packageImport": "import { Toggle } from 'sparkdesign'",
|
|
2692
|
+
"cliAdd": "npx sparkdesign@latest add toggle",
|
|
2693
|
+
"slots": [
|
|
2694
|
+
"Toggle",
|
|
2695
|
+
"icon",
|
|
2696
|
+
"label",
|
|
2697
|
+
"pressed state"
|
|
2698
|
+
],
|
|
2699
|
+
"states": [
|
|
2700
|
+
"pressed",
|
|
2701
|
+
"not pressed",
|
|
2702
|
+
"disabled",
|
|
2703
|
+
"focus-visible",
|
|
2704
|
+
"icon-only"
|
|
2705
|
+
],
|
|
2706
|
+
"a11y": [
|
|
2707
|
+
"Expose the pressed state through the component semantics.",
|
|
2708
|
+
"Give icon-only toggles an accessible name.",
|
|
2709
|
+
"Do not use Toggle for persistent form fields that should be submitted as checkboxes."
|
|
2710
|
+
],
|
|
2711
|
+
"composition": [
|
|
2712
|
+
"Tooltip",
|
|
2713
|
+
"ButtonGroup",
|
|
2714
|
+
"ToggleGroup",
|
|
2715
|
+
"IconButton"
|
|
2716
|
+
],
|
|
2717
|
+
"antiPatterns": [
|
|
2718
|
+
"Do not use Toggle for irreversible actions.",
|
|
2719
|
+
"Do not use Toggle when the user must pick exactly one option from a set; use ToggleGroup or RadioGroup.",
|
|
2720
|
+
"Do not make state depend on color only."
|
|
2721
|
+
],
|
|
2722
|
+
"agentHints": [
|
|
2723
|
+
"Choose Toggle for toolbar modes such as bold, preview, pin, or visibility.",
|
|
2724
|
+
"Use Switch for settings that turn a feature on or off."
|
|
2725
|
+
]
|
|
2726
|
+
},
|
|
2727
|
+
"toggle-group": {
|
|
2728
|
+
"id": "toggle-group",
|
|
2729
|
+
"name": "ToggleGroup",
|
|
2730
|
+
"category": "basic",
|
|
2731
|
+
"status": "stable",
|
|
2732
|
+
"intent": "Grouped toggle controls for selecting one or multiple compact modes.",
|
|
2733
|
+
"packageImport": "import { ToggleGroup, ToggleGroupItem } from 'sparkdesign'",
|
|
2734
|
+
"cliAdd": "npx sparkdesign@latest add toggle-group",
|
|
2735
|
+
"slots": [
|
|
2736
|
+
"ToggleGroup",
|
|
2737
|
+
"ToggleGroupItem",
|
|
2738
|
+
"icons",
|
|
2739
|
+
"labels"
|
|
2740
|
+
],
|
|
2741
|
+
"states": [
|
|
2742
|
+
"single selection",
|
|
2743
|
+
"multiple selection",
|
|
2744
|
+
"selected item",
|
|
2745
|
+
"unselected item",
|
|
2746
|
+
"disabled item",
|
|
2747
|
+
"roving focus"
|
|
2748
|
+
],
|
|
2749
|
+
"a11y": [
|
|
2750
|
+
"Label the group when the option meaning is not obvious.",
|
|
2751
|
+
"Give icon-only items accessible names.",
|
|
2752
|
+
"Make selected state clear without relying on color alone."
|
|
2753
|
+
],
|
|
2754
|
+
"composition": [
|
|
2755
|
+
"Tooltip",
|
|
2756
|
+
"ButtonGroup",
|
|
2757
|
+
"Field",
|
|
2758
|
+
"Kbd"
|
|
2759
|
+
],
|
|
2760
|
+
"antiPatterns": [
|
|
2761
|
+
"Do not use ToggleGroup for long option labels; use RadioGroup or Select.",
|
|
2762
|
+
"Do not use it for primary navigation across pages.",
|
|
2763
|
+
"Do not mix single and multiple selection behavior in one group."
|
|
2764
|
+
],
|
|
2765
|
+
"agentHints": [
|
|
2766
|
+
"Choose ToggleGroup for compact view modes, alignment controls, density controls, and formatting groups.",
|
|
2767
|
+
"Use RadioGroup when labels and descriptions need more space."
|
|
2768
|
+
]
|
|
2769
|
+
},
|
|
2770
|
+
"typography": {
|
|
2771
|
+
"id": "typography",
|
|
2772
|
+
"name": "Typography",
|
|
2773
|
+
"category": "basic",
|
|
2774
|
+
"status": "stable",
|
|
2775
|
+
"intent": "Tokenized prose, headings, lists, quotes, tables, inline code, and muted text primitives.",
|
|
2776
|
+
"packageImport": "import { TypographyH1, TypographyH2, TypographyH3, TypographyP, TypographyMuted } from 'sparkdesign'",
|
|
2777
|
+
"cliAdd": "npx sparkdesign@latest add typography",
|
|
2778
|
+
"slots": [
|
|
2779
|
+
"TypographyH1",
|
|
2780
|
+
"TypographyH2",
|
|
2781
|
+
"TypographyH3",
|
|
2782
|
+
"TypographyH4",
|
|
2783
|
+
"TypographyP",
|
|
2784
|
+
"TypographyBlockquote",
|
|
2785
|
+
"TypographyList",
|
|
2786
|
+
"TypographyInlineCode",
|
|
2787
|
+
"TypographyLead",
|
|
2788
|
+
"TypographyMuted"
|
|
2789
|
+
],
|
|
2790
|
+
"states": [
|
|
2791
|
+
"heading",
|
|
2792
|
+
"body",
|
|
2793
|
+
"lead",
|
|
2794
|
+
"muted",
|
|
2795
|
+
"quote",
|
|
2796
|
+
"inline code",
|
|
2797
|
+
"list"
|
|
2798
|
+
],
|
|
2799
|
+
"a11y": [
|
|
2800
|
+
"Preserve heading hierarchy instead of choosing headings by visual size only.",
|
|
2801
|
+
"Keep long prose readable with appropriate line length.",
|
|
2802
|
+
"Do not use muted text for required labels or critical warnings."
|
|
2803
|
+
],
|
|
2804
|
+
"composition": [
|
|
2805
|
+
"Card",
|
|
2806
|
+
"Alert",
|
|
2807
|
+
"Markdown",
|
|
2808
|
+
"Empty"
|
|
2809
|
+
],
|
|
2810
|
+
"antiPatterns": [
|
|
2811
|
+
"Do not use Typography components as generic layout wrappers.",
|
|
2812
|
+
"Do not skip heading levels for visual effect.",
|
|
2813
|
+
"Do not use inline code styling for emphasis that is not code-like."
|
|
2814
|
+
],
|
|
2815
|
+
"agentHints": [
|
|
2816
|
+
"Choose Typography primitives for documentation, settings descriptions, and static prose.",
|
|
2817
|
+
"Use Markdown for generated or user-authored rich text content."
|
|
2818
|
+
]
|
|
2819
|
+
},
|
|
2820
|
+
"toast": {
|
|
2821
|
+
"id": "toast",
|
|
2822
|
+
"name": "Toast",
|
|
2823
|
+
"category": "basic",
|
|
2824
|
+
"status": "stable",
|
|
2825
|
+
"intent": "Ephemeral notification for short-lived success, failure, or status feedback outside the main layout.",
|
|
2826
|
+
"packageImport": "import { Toaster, toast } from 'sparkdesign'",
|
|
2827
|
+
"cliAdd": "npx sparkdesign@latest add toast",
|
|
2828
|
+
"slots": [
|
|
2829
|
+
"Toaster",
|
|
2830
|
+
"toast function",
|
|
2831
|
+
"title",
|
|
2832
|
+
"description",
|
|
2833
|
+
"action by composition"
|
|
2834
|
+
],
|
|
2835
|
+
"states": [
|
|
2836
|
+
"success",
|
|
2837
|
+
"error",
|
|
2838
|
+
"warning",
|
|
2839
|
+
"info",
|
|
2840
|
+
"loading by composition",
|
|
2841
|
+
"dismissed"
|
|
2842
|
+
],
|
|
2843
|
+
"a11y": [
|
|
2844
|
+
"Use concise notification text.",
|
|
2845
|
+
"Do not put required decisions only in Toast.",
|
|
2846
|
+
"Ensure critical errors also appear inline when users need to recover."
|
|
2847
|
+
],
|
|
2848
|
+
"composition": [
|
|
2849
|
+
"Button",
|
|
2850
|
+
"Alert",
|
|
2851
|
+
"Form",
|
|
2852
|
+
"ToolInvocationCard"
|
|
2853
|
+
],
|
|
2854
|
+
"antiPatterns": [
|
|
2855
|
+
"Do not use Toast for persistent validation or destructive confirmation.",
|
|
2856
|
+
"Do not stack noisy success toasts for every small state change.",
|
|
2857
|
+
"Do not hide important recovery actions inside an auto-dismissing toast."
|
|
2858
|
+
],
|
|
2859
|
+
"agentHints": [
|
|
2860
|
+
"Choose Toast for transient acknowledgement after an action.",
|
|
2861
|
+
"Use Alert for feedback that must remain visible."
|
|
2862
|
+
]
|
|
2863
|
+
},
|
|
2864
|
+
"sonner": {
|
|
2865
|
+
"id": "sonner",
|
|
2866
|
+
"name": "Sonner",
|
|
2867
|
+
"category": "basic",
|
|
2868
|
+
"status": "stable",
|
|
2869
|
+
"intent": "Sonner toaster entry using Spark token styling and theme/style portal inheritance.",
|
|
2870
|
+
"packageImport": "import { Toaster, toast } from 'sparkdesign'",
|
|
2871
|
+
"cliAdd": "npx sparkdesign@latest add sonner",
|
|
2872
|
+
"slots": [
|
|
2873
|
+
"Toaster",
|
|
2874
|
+
"toast function",
|
|
2875
|
+
"toast options",
|
|
2876
|
+
"icons",
|
|
2877
|
+
"portal wrapper"
|
|
2878
|
+
],
|
|
2879
|
+
"states": [
|
|
2880
|
+
"success",
|
|
2881
|
+
"error",
|
|
2882
|
+
"warning",
|
|
2883
|
+
"info",
|
|
2884
|
+
"loading",
|
|
2885
|
+
"dismissed"
|
|
2886
|
+
],
|
|
2887
|
+
"a11y": [
|
|
2888
|
+
"Use concise notification text.",
|
|
2889
|
+
"Do not put required decisions only in sonner toasts.",
|
|
2890
|
+
"Ensure critical errors also appear inline when users need to recover."
|
|
2891
|
+
],
|
|
2892
|
+
"composition": [
|
|
2893
|
+
"Button",
|
|
2894
|
+
"Alert",
|
|
2895
|
+
"Form",
|
|
2896
|
+
"ToolInvocationCard"
|
|
2897
|
+
],
|
|
2898
|
+
"antiPatterns": [
|
|
2899
|
+
"Do not use Sonner for persistent validation or destructive confirmation.",
|
|
2900
|
+
"Do not stack noisy success toasts for every small state change.",
|
|
2901
|
+
"Do not hide important recovery actions inside an auto-dismissing toast."
|
|
2902
|
+
],
|
|
2903
|
+
"agentHints": [
|
|
2904
|
+
"Choose Sonner when the target explicitly asks for the sonner toaster API.",
|
|
2905
|
+
"Choose Toast when describing the semantic notification pattern."
|
|
2906
|
+
]
|
|
2907
|
+
},
|
|
2908
|
+
"tooltip": {
|
|
2909
|
+
"id": "tooltip",
|
|
2910
|
+
"name": "Tooltip",
|
|
2911
|
+
"category": "basic",
|
|
2912
|
+
"status": "stable",
|
|
2913
|
+
"intent": "Short contextual help for icon buttons, dense controls, or unfamiliar affordances.",
|
|
2914
|
+
"packageImport": "import { Tooltip } from 'sparkdesign'",
|
|
2915
|
+
"cliAdd": "npx sparkdesign@latest add tooltip",
|
|
2916
|
+
"slots": [
|
|
2917
|
+
"Tooltip",
|
|
2918
|
+
"trigger",
|
|
2919
|
+
"content",
|
|
2920
|
+
"portal"
|
|
2921
|
+
],
|
|
2922
|
+
"states": [
|
|
2923
|
+
"closed",
|
|
2924
|
+
"open on hover",
|
|
2925
|
+
"open on focus",
|
|
2926
|
+
"delayed",
|
|
2927
|
+
"disabled by composition"
|
|
2928
|
+
],
|
|
2929
|
+
"a11y": [
|
|
2930
|
+
"Do not put essential instructions only in Tooltip.",
|
|
2931
|
+
"Use Tooltip to clarify an already focusable or hoverable trigger.",
|
|
2932
|
+
"Keep content short enough to be read quickly."
|
|
2933
|
+
],
|
|
2934
|
+
"composition": [
|
|
2935
|
+
"IconButton",
|
|
2936
|
+
"Button",
|
|
2937
|
+
"DropdownMenu",
|
|
2938
|
+
"ChatInput"
|
|
2939
|
+
],
|
|
2940
|
+
"antiPatterns": [
|
|
2941
|
+
"Do not use Tooltip for long documentation or validation errors.",
|
|
2942
|
+
"Do not use Tooltip as the only accessible name for a control.",
|
|
2943
|
+
"Do not attach tooltips to non-interactive decorative elements."
|
|
2944
|
+
],
|
|
2945
|
+
"agentHints": [
|
|
2946
|
+
"Add Tooltip to icon-only actions when the icon may be ambiguous.",
|
|
2947
|
+
"Use Alert or FieldDescription for persistent guidance."
|
|
2948
|
+
]
|
|
2949
|
+
},
|
|
2950
|
+
"card": {
|
|
2951
|
+
"id": "card",
|
|
2952
|
+
"name": "Card",
|
|
2953
|
+
"category": "basic",
|
|
2954
|
+
"status": "stable",
|
|
2955
|
+
"intent": "Bounded surface for grouped content, settings, forms, summaries, or preview blocks.",
|
|
2956
|
+
"packageImport": "import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from 'sparkdesign'",
|
|
2957
|
+
"cliAdd": "npx sparkdesign@latest add card",
|
|
2958
|
+
"slots": [
|
|
2959
|
+
"Card",
|
|
2960
|
+
"CardHeader",
|
|
2961
|
+
"CardTitle",
|
|
2962
|
+
"CardDescription",
|
|
2963
|
+
"CardAction",
|
|
2964
|
+
"CardContent",
|
|
2965
|
+
"CardFooter"
|
|
2966
|
+
],
|
|
2967
|
+
"states": [
|
|
2968
|
+
"static",
|
|
2969
|
+
"interactive by composition",
|
|
2970
|
+
"empty",
|
|
2971
|
+
"loading by composition"
|
|
2972
|
+
],
|
|
2973
|
+
"a11y": [
|
|
2974
|
+
"Use heading hierarchy intentionally inside CardTitle.",
|
|
2975
|
+
"Avoid making the full card clickable when nested controls exist.",
|
|
2976
|
+
"Keep focus order aligned with visual order."
|
|
2977
|
+
],
|
|
2978
|
+
"composition": [
|
|
2979
|
+
"Button",
|
|
2980
|
+
"Alert",
|
|
2981
|
+
"Input",
|
|
2982
|
+
"Textarea",
|
|
2983
|
+
"Skeleton",
|
|
2984
|
+
"Badge"
|
|
2985
|
+
],
|
|
2986
|
+
"antiPatterns": [
|
|
2987
|
+
"Do not use Card only to add decoration around unrelated content.",
|
|
2988
|
+
"Do not nest cards more than one level deep unless the information architecture requires it."
|
|
2989
|
+
],
|
|
2990
|
+
"agentHints": [
|
|
2991
|
+
"Use Card to create scan-friendly groups, not as the default wrapper for every element."
|
|
2992
|
+
]
|
|
2993
|
+
},
|
|
2994
|
+
"chat-input": {
|
|
2995
|
+
"id": "chat-input",
|
|
2996
|
+
"name": "ChatInput",
|
|
2997
|
+
"category": "chat",
|
|
2998
|
+
"status": "stable",
|
|
2999
|
+
"intent": "Agent prompt composer with attachments, actions, model/status affordances, and send behavior.",
|
|
3000
|
+
"packageImport": "import { ChatInput } from 'sparkdesign'",
|
|
3001
|
+
"cliAdd": "npx sparkdesign@latest add chat-input",
|
|
3002
|
+
"slots": [
|
|
3003
|
+
"ChatInputRoot",
|
|
3004
|
+
"ChatInputAbove",
|
|
3005
|
+
"ChatInputBox",
|
|
3006
|
+
"ChatInputAttachments",
|
|
3007
|
+
"ChatInputInput",
|
|
3008
|
+
"ChatInputActions",
|
|
3009
|
+
"ChatInputActionsLeft",
|
|
3010
|
+
"ChatInputActionsRight",
|
|
3011
|
+
"ChatInputSendButton",
|
|
3012
|
+
"ChatInputFooterLeft"
|
|
3013
|
+
],
|
|
3014
|
+
"states": [
|
|
3015
|
+
"idle",
|
|
3016
|
+
"focused",
|
|
3017
|
+
"composing",
|
|
3018
|
+
"disabled",
|
|
3019
|
+
"streaming",
|
|
3020
|
+
"attachments-present",
|
|
3021
|
+
"permission-required"
|
|
3022
|
+
],
|
|
3023
|
+
"a11y": [
|
|
3024
|
+
"Preserve textarea semantics and keyboard submission behavior.",
|
|
3025
|
+
"Keep send action reachable by keyboard.",
|
|
3026
|
+
"Expose attachment removal with accessible labels.",
|
|
3027
|
+
"Do not hide status text from assistive technology when it communicates task state."
|
|
3028
|
+
],
|
|
3029
|
+
"composition": [
|
|
3030
|
+
"SendButton",
|
|
3031
|
+
"FileAttachment",
|
|
3032
|
+
"ImageAttachment",
|
|
3033
|
+
"GenerationStatusBar",
|
|
3034
|
+
"PermissionCard",
|
|
3035
|
+
"Tooltip"
|
|
3036
|
+
],
|
|
3037
|
+
"antiPatterns": [
|
|
3038
|
+
"Do not use ChatInput as a generic form textarea.",
|
|
3039
|
+
"Do not hard-code model labels or footer actions into the component when they are product state.",
|
|
3040
|
+
"Do not place unrelated navigation controls inside ChatInputActions."
|
|
3041
|
+
],
|
|
3042
|
+
"agentHints": [
|
|
3043
|
+
"Choose ChatInput for conversational or agent command entry.",
|
|
3044
|
+
"Use the compound API when the generated layout needs custom action placement."
|
|
3045
|
+
]
|
|
3046
|
+
},
|
|
3047
|
+
"ask-user-part": {
|
|
3048
|
+
"id": "ask-user-part",
|
|
3049
|
+
"name": "AskUserPart",
|
|
3050
|
+
"category": "chat",
|
|
3051
|
+
"status": "stable",
|
|
3052
|
+
"intent": "Agent-to-user question card with explicit skip/run actions and optional ask-timing control.",
|
|
3053
|
+
"packageImport": "import { AskUserPart } from 'sparkdesign'",
|
|
3054
|
+
"cliAdd": "npx sparkdesign@latest add ask-user-part",
|
|
3055
|
+
"slots": [
|
|
3056
|
+
"AskUserPart",
|
|
3057
|
+
"title",
|
|
3058
|
+
"question",
|
|
3059
|
+
"skip action",
|
|
3060
|
+
"run action",
|
|
3061
|
+
"ask timing control"
|
|
3062
|
+
],
|
|
3063
|
+
"states": [
|
|
3064
|
+
"expanded",
|
|
3065
|
+
"collapsed",
|
|
3066
|
+
"waiting for user",
|
|
3067
|
+
"skipped",
|
|
3068
|
+
"run requested"
|
|
3069
|
+
],
|
|
3070
|
+
"a11y": [
|
|
3071
|
+
"Keep the question text readable and specific.",
|
|
3072
|
+
"Expose skip and run actions as real buttons.",
|
|
3073
|
+
"Do not make keyboard shortcut text the only action label."
|
|
3074
|
+
],
|
|
3075
|
+
"composition": [
|
|
3076
|
+
"CollapsibleCard",
|
|
3077
|
+
"Button",
|
|
3078
|
+
"UserQuestion",
|
|
3079
|
+
"UserQuestionAnswer"
|
|
3080
|
+
],
|
|
3081
|
+
"antiPatterns": [
|
|
3082
|
+
"Do not use AskUserPart for passive status messages.",
|
|
3083
|
+
"Do not ask multiple unrelated questions in one card.",
|
|
3084
|
+
"Do not hide a required user decision in collapsed content."
|
|
3085
|
+
],
|
|
3086
|
+
"agentHints": [
|
|
3087
|
+
"Choose AskUserPart when an agent needs a focused user decision before continuing.",
|
|
3088
|
+
"Use UserQuestion for structured multi-question option flows."
|
|
3089
|
+
]
|
|
3090
|
+
},
|
|
3091
|
+
"browser-action-part": {
|
|
3092
|
+
"id": "browser-action-part",
|
|
3093
|
+
"name": "BrowserActionPart",
|
|
3094
|
+
"category": "chat",
|
|
3095
|
+
"status": "stable",
|
|
3096
|
+
"intent": "Agent browser action approval/status card with run, skip, permission preference, and failure states.",
|
|
3097
|
+
"packageImport": "import { BrowserActionPart } from 'sparkdesign'",
|
|
3098
|
+
"cliAdd": "npx sparkdesign@latest add browser-action-part",
|
|
3099
|
+
"slots": [
|
|
3100
|
+
"BrowserActionPart",
|
|
3101
|
+
"description",
|
|
3102
|
+
"content",
|
|
3103
|
+
"permission select",
|
|
3104
|
+
"skip action",
|
|
3105
|
+
"run action",
|
|
3106
|
+
"detail action"
|
|
3107
|
+
],
|
|
3108
|
+
"states": [
|
|
3109
|
+
"normal",
|
|
3110
|
+
"failed",
|
|
3111
|
+
"skipped",
|
|
3112
|
+
"expanded",
|
|
3113
|
+
"collapsible",
|
|
3114
|
+
"permission selected"
|
|
3115
|
+
],
|
|
3116
|
+
"a11y": [
|
|
3117
|
+
"Keep browser action descriptions explicit about what will happen.",
|
|
3118
|
+
"Expose failed/skipped status in text, not only icon color.",
|
|
3119
|
+
"Do not hide permission choices behind unlabeled controls."
|
|
3120
|
+
],
|
|
3121
|
+
"composition": [
|
|
3122
|
+
"CollapsibleCard",
|
|
3123
|
+
"Button",
|
|
3124
|
+
"Select",
|
|
3125
|
+
"Alert",
|
|
3126
|
+
"ToolInvocationCard"
|
|
3127
|
+
],
|
|
3128
|
+
"antiPatterns": [
|
|
3129
|
+
"Do not use BrowserActionPart for non-browser tools.",
|
|
3130
|
+
"Do not run risky browser actions without an explicit product-level policy.",
|
|
3131
|
+
"Do not bury failure detail when the user needs recovery."
|
|
3132
|
+
],
|
|
3133
|
+
"agentHints": [
|
|
3134
|
+
"Choose BrowserActionPart for browser automation steps that need approval or auditability.",
|
|
3135
|
+
"Use ToolInvocationCard for generic tool execution status."
|
|
3136
|
+
]
|
|
3137
|
+
},
|
|
3138
|
+
"conversation-anchor-nav": {
|
|
3139
|
+
"id": "conversation-anchor-nav",
|
|
3140
|
+
"name": "ConversationAnchorNav",
|
|
3141
|
+
"category": "chat",
|
|
3142
|
+
"status": "stable",
|
|
3143
|
+
"intent": "Floating anchor navigation for long conversation streams with message summaries and visible-section tracking.",
|
|
3144
|
+
"packageImport": "import { ConversationAnchorNav } from 'sparkdesign'",
|
|
3145
|
+
"cliAdd": "npx sparkdesign@latest add conversation-anchor-nav",
|
|
3146
|
+
"slots": [
|
|
3147
|
+
"ConversationAnchorNav",
|
|
3148
|
+
"anchor items",
|
|
3149
|
+
"tooltip summary",
|
|
3150
|
+
"active marker",
|
|
3151
|
+
"custom anchor render"
|
|
3152
|
+
],
|
|
3153
|
+
"states": [
|
|
3154
|
+
"hidden",
|
|
3155
|
+
"visible",
|
|
3156
|
+
"active anchor",
|
|
3157
|
+
"bar variant",
|
|
3158
|
+
"punch variant",
|
|
3159
|
+
"controlled active index"
|
|
3160
|
+
],
|
|
3161
|
+
"a11y": [
|
|
3162
|
+
"Provide a clear aria-label for the anchor nav.",
|
|
3163
|
+
"Keep summaries concise and useful for navigation.",
|
|
3164
|
+
"Do not replace normal scroll behavior with anchor-only navigation."
|
|
3165
|
+
],
|
|
3166
|
+
"composition": [
|
|
3167
|
+
"Tooltip",
|
|
3168
|
+
"Response",
|
|
3169
|
+
"UserMessage",
|
|
3170
|
+
"ScrollArea"
|
|
3171
|
+
],
|
|
3172
|
+
"antiPatterns": [
|
|
3173
|
+
"Do not show anchors for very short conversations.",
|
|
3174
|
+
"Do not use it for page-level site navigation.",
|
|
3175
|
+
"Do not create anchors without stable target elements."
|
|
3176
|
+
],
|
|
3177
|
+
"agentHints": [
|
|
3178
|
+
"Choose ConversationAnchorNav for long AI transcripts where users need to jump between user turns.",
|
|
3179
|
+
"Use SidebarMenu or NavigationMenu for app navigation."
|
|
3180
|
+
]
|
|
3181
|
+
},
|
|
3182
|
+
"file-attachment": {
|
|
3183
|
+
"id": "file-attachment",
|
|
3184
|
+
"name": "FileAttachment",
|
|
3185
|
+
"category": "chat",
|
|
3186
|
+
"status": "stable",
|
|
3187
|
+
"intent": "Compact removable file attachment token for chat composers and message metadata.",
|
|
3188
|
+
"packageImport": "import { FileAttachment } from 'sparkdesign'",
|
|
3189
|
+
"cliAdd": "npx sparkdesign@latest add file-attachment",
|
|
3190
|
+
"slots": [
|
|
3191
|
+
"FileAttachment",
|
|
3192
|
+
"file icon",
|
|
3193
|
+
"filename",
|
|
3194
|
+
"remove action"
|
|
3195
|
+
],
|
|
3196
|
+
"states": [
|
|
3197
|
+
"default",
|
|
3198
|
+
"removable",
|
|
3199
|
+
"custom icon",
|
|
3200
|
+
"icon filename override"
|
|
3201
|
+
],
|
|
3202
|
+
"a11y": [
|
|
3203
|
+
"Keep filenames readable and distinguishable.",
|
|
3204
|
+
"Provide a clear remove label when onRemove is available.",
|
|
3205
|
+
"Do not rely only on file icon color to communicate file type."
|
|
3206
|
+
],
|
|
3207
|
+
"composition": [
|
|
3208
|
+
"Tag",
|
|
3209
|
+
"ChatInput",
|
|
3210
|
+
"FileCard",
|
|
3211
|
+
"Tooltip"
|
|
3212
|
+
],
|
|
3213
|
+
"antiPatterns": [
|
|
3214
|
+
"Do not use FileAttachment for full file review states; use FileCard or FileReviewPart.",
|
|
3215
|
+
"Do not truncate filenames without another way to inspect the full name.",
|
|
3216
|
+
"Do not make removal ambiguous in multi-file composers."
|
|
3217
|
+
],
|
|
3218
|
+
"agentHints": [
|
|
3219
|
+
"Choose FileAttachment for files attached to a prompt or compact message row.",
|
|
3220
|
+
"Use FileCard when file details, status, or actions are needed."
|
|
3221
|
+
]
|
|
3222
|
+
},
|
|
3223
|
+
"folder-button": {
|
|
3224
|
+
"id": "folder-button",
|
|
3225
|
+
"name": "FolderButton",
|
|
3226
|
+
"category": "chat",
|
|
3227
|
+
"status": "stable",
|
|
3228
|
+
"intent": "Chat composer folder/workspace permission button with compact states and optional notification dot.",
|
|
3229
|
+
"packageImport": "import { FolderButton } from 'sparkdesign'",
|
|
3230
|
+
"cliAdd": "npx sparkdesign@latest add folder-button",
|
|
3231
|
+
"slots": [
|
|
3232
|
+
"FolderButton",
|
|
3233
|
+
"icon",
|
|
3234
|
+
"status dot",
|
|
3235
|
+
"tooltip by composition"
|
|
3236
|
+
],
|
|
3237
|
+
"states": [
|
|
3238
|
+
"idle",
|
|
3239
|
+
"active",
|
|
3240
|
+
"disabled",
|
|
3241
|
+
"has notification",
|
|
3242
|
+
"focused"
|
|
3243
|
+
],
|
|
3244
|
+
"a11y": [
|
|
3245
|
+
"Provide an aria-label or visible context for the folder action.",
|
|
3246
|
+
"Do not communicate permission state only through a dot.",
|
|
3247
|
+
"Keep disabled state explainable in surrounding UI."
|
|
3248
|
+
],
|
|
3249
|
+
"composition": [
|
|
3250
|
+
"ChatInput",
|
|
3251
|
+
"Tooltip",
|
|
3252
|
+
"PermissionCard",
|
|
3253
|
+
"IconButton"
|
|
3254
|
+
],
|
|
3255
|
+
"antiPatterns": [
|
|
3256
|
+
"Do not use FolderButton as a generic file picker button outside chat context.",
|
|
3257
|
+
"Do not show a notification dot without a meaningful reason.",
|
|
3258
|
+
"Do not replace visible permission flows with this button alone."
|
|
3259
|
+
],
|
|
3260
|
+
"agentHints": [
|
|
3261
|
+
"Choose FolderButton inside ChatInput or agent composer toolbars for workspace/folder access.",
|
|
3262
|
+
"Use Button or IconButton for non-chat file actions."
|
|
3263
|
+
]
|
|
3264
|
+
},
|
|
3265
|
+
"generation-status-bar": {
|
|
3266
|
+
"id": "generation-status-bar",
|
|
3267
|
+
"name": "GenerationStatusBar",
|
|
3268
|
+
"category": "chat",
|
|
3269
|
+
"status": "stable",
|
|
3270
|
+
"intent": "Inline generation status strip for active AI output, timed work, or streaming response phases.",
|
|
3271
|
+
"packageImport": "import { GenerationStatusBar } from 'sparkdesign'",
|
|
3272
|
+
"cliAdd": "npx sparkdesign@latest add generation-status-bar",
|
|
3273
|
+
"slots": [
|
|
3274
|
+
"GenerationStatusBar",
|
|
3275
|
+
"icon",
|
|
3276
|
+
"status",
|
|
3277
|
+
"children",
|
|
3278
|
+
"time"
|
|
3279
|
+
],
|
|
3280
|
+
"states": [
|
|
3281
|
+
"idle hidden",
|
|
3282
|
+
"generating",
|
|
3283
|
+
"with icon",
|
|
3284
|
+
"with time",
|
|
3285
|
+
"custom content"
|
|
3286
|
+
],
|
|
3287
|
+
"a11y": [
|
|
3288
|
+
"Use readable status text for long-running generation.",
|
|
3289
|
+
"Do not rely on animated dots alone to explain progress.",
|
|
3290
|
+
"Avoid noisy repeated status changes that are not useful."
|
|
3291
|
+
],
|
|
3292
|
+
"composition": [
|
|
3293
|
+
"ChatInput",
|
|
3294
|
+
"Response",
|
|
3295
|
+
"Progress",
|
|
3296
|
+
"ThinkingIndicator"
|
|
3297
|
+
],
|
|
3298
|
+
"antiPatterns": [
|
|
3299
|
+
"Do not use GenerationStatusBar for non-AI page loading.",
|
|
3300
|
+
"Do not show fake elapsed time.",
|
|
3301
|
+
"Do not keep the bar visible after the response has settled unless status still matters."
|
|
3302
|
+
],
|
|
3303
|
+
"agentHints": [
|
|
3304
|
+
"Choose GenerationStatusBar for active AI generation or streaming status.",
|
|
3305
|
+
"Use Progress when completion percentage is meaningful."
|
|
3306
|
+
]
|
|
3307
|
+
},
|
|
3308
|
+
"hint-banner": {
|
|
3309
|
+
"id": "hint-banner",
|
|
3310
|
+
"name": "HintBanner",
|
|
3311
|
+
"category": "chat",
|
|
3312
|
+
"status": "stable",
|
|
3313
|
+
"intent": "Compact chat guidance banner for warnings, tips, or contextual next steps inside agent flows.",
|
|
3314
|
+
"packageImport": "import { HintBanner } from 'sparkdesign'",
|
|
3315
|
+
"cliAdd": "npx sparkdesign@latest add hint-banner",
|
|
3316
|
+
"slots": [
|
|
3317
|
+
"HintBanner",
|
|
3318
|
+
"icon",
|
|
3319
|
+
"title",
|
|
3320
|
+
"description",
|
|
3321
|
+
"action by composition"
|
|
3322
|
+
],
|
|
3323
|
+
"states": [
|
|
3324
|
+
"info",
|
|
3325
|
+
"warning by composition",
|
|
3326
|
+
"dismissible by composition",
|
|
3327
|
+
"with action",
|
|
3328
|
+
"hidden when no content"
|
|
3329
|
+
],
|
|
3330
|
+
"a11y": [
|
|
3331
|
+
"Keep banner text concise and actionable.",
|
|
3332
|
+
"Do not hide required errors in a low-emphasis hint.",
|
|
3333
|
+
"Make any action control keyboard reachable."
|
|
3334
|
+
],
|
|
3335
|
+
"composition": [
|
|
3336
|
+
"Alert",
|
|
3337
|
+
"Button",
|
|
3338
|
+
"ChatInput",
|
|
3339
|
+
"RelatedPrompts"
|
|
3340
|
+
],
|
|
3341
|
+
"antiPatterns": [
|
|
3342
|
+
"Do not use HintBanner for destructive confirmation.",
|
|
3343
|
+
"Do not stack multiple hint banners in one chat turn.",
|
|
3344
|
+
"Do not use generic hints that do not change user behavior."
|
|
3345
|
+
],
|
|
3346
|
+
"agentHints": [
|
|
3347
|
+
"Choose HintBanner for contextual AI workflow guidance.",
|
|
3348
|
+
"Use Alert for persistent errors or warnings that require attention."
|
|
3349
|
+
]
|
|
3350
|
+
},
|
|
3351
|
+
"image-attachment": {
|
|
3352
|
+
"id": "image-attachment",
|
|
3353
|
+
"name": "ImageAttachment",
|
|
3354
|
+
"category": "chat",
|
|
3355
|
+
"status": "stable",
|
|
3356
|
+
"intent": "Chat image attachment thumbnail with optional preview dialog and remove action.",
|
|
3357
|
+
"packageImport": "import { ImageAttachment } from 'sparkdesign'",
|
|
3358
|
+
"cliAdd": "npx sparkdesign@latest add image-attachment",
|
|
3359
|
+
"slots": [
|
|
3360
|
+
"ImageAttachment",
|
|
3361
|
+
"thumbnail",
|
|
3362
|
+
"preview dialog",
|
|
3363
|
+
"remove action",
|
|
3364
|
+
"alt text"
|
|
3365
|
+
],
|
|
3366
|
+
"states": [
|
|
3367
|
+
"previewable",
|
|
3368
|
+
"not previewable",
|
|
3369
|
+
"preview open",
|
|
3370
|
+
"removable",
|
|
3371
|
+
"small",
|
|
3372
|
+
"medium",
|
|
3373
|
+
"large"
|
|
3374
|
+
],
|
|
3375
|
+
"a11y": [
|
|
3376
|
+
"Provide useful alt text when the image content matters.",
|
|
3377
|
+
"Keep preview close action keyboard reachable.",
|
|
3378
|
+
"Do not make preview the only way to understand the attachment."
|
|
3379
|
+
],
|
|
3380
|
+
"composition": [
|
|
3381
|
+
"ChatInput",
|
|
3382
|
+
"IconButton",
|
|
3383
|
+
"GeneratedImagesGrid",
|
|
3384
|
+
"FileCard"
|
|
3385
|
+
],
|
|
3386
|
+
"antiPatterns": [
|
|
3387
|
+
"Do not use ImageAttachment for generated image galleries; use GeneratedImagesGrid.",
|
|
3388
|
+
"Do not omit alt text for meaningful images.",
|
|
3389
|
+
"Do not hide remove actions when attachments can be edited."
|
|
3390
|
+
],
|
|
3391
|
+
"agentHints": [
|
|
3392
|
+
"Choose ImageAttachment for images attached to prompts or messages.",
|
|
3393
|
+
"Use GeneratedImagesGrid for AI output image sets."
|
|
3394
|
+
]
|
|
3395
|
+
},
|
|
3396
|
+
"image-generating": {
|
|
3397
|
+
"id": "image-generating",
|
|
3398
|
+
"name": "ImageGenerating",
|
|
3399
|
+
"category": "chat",
|
|
3400
|
+
"status": "stable",
|
|
3401
|
+
"intent": "AI image generation placeholder card for pending image output before final assets arrive.",
|
|
3402
|
+
"packageImport": "import { ImageGenerating } from 'sparkdesign'",
|
|
3403
|
+
"cliAdd": "npx sparkdesign@latest add image-generating",
|
|
3404
|
+
"slots": [
|
|
3405
|
+
"ImageGenerating",
|
|
3406
|
+
"status text",
|
|
3407
|
+
"animated placeholder",
|
|
3408
|
+
"container"
|
|
3409
|
+
],
|
|
3410
|
+
"states": [
|
|
3411
|
+
"generating",
|
|
3412
|
+
"queued",
|
|
3413
|
+
"failed by composition",
|
|
3414
|
+
"completed by replacement"
|
|
3415
|
+
],
|
|
3416
|
+
"a11y": [
|
|
3417
|
+
"Provide readable generation status text.",
|
|
3418
|
+
"Do not rely on animation alone to communicate that work is ongoing.",
|
|
3419
|
+
"Replace with actual generated assets when ready."
|
|
3420
|
+
],
|
|
3421
|
+
"composition": [
|
|
3422
|
+
"GeneratedImagesGrid",
|
|
3423
|
+
"Skeleton",
|
|
3424
|
+
"GenerationStatusBar",
|
|
3425
|
+
"Alert"
|
|
3426
|
+
],
|
|
3427
|
+
"antiPatterns": [
|
|
3428
|
+
"Do not use ImageGenerating after the image result exists.",
|
|
3429
|
+
"Do not use for non-image loading states.",
|
|
3430
|
+
"Do not show multiple competing animated loaders for the same generation."
|
|
3431
|
+
],
|
|
3432
|
+
"agentHints": [
|
|
3433
|
+
"Choose ImageGenerating for pending AI image results.",
|
|
3434
|
+
"Use Skeleton for generic media loading and GeneratedImagesGrid for completed image output."
|
|
3435
|
+
]
|
|
3436
|
+
},
|
|
3437
|
+
"mermaid-part": {
|
|
3438
|
+
"id": "mermaid-part",
|
|
3439
|
+
"name": "MermaidPart",
|
|
3440
|
+
"category": "chat",
|
|
3441
|
+
"status": "stable",
|
|
3442
|
+
"intent": "Collapsible rendered Mermaid diagram block inside AI responses or tool output.",
|
|
3443
|
+
"packageImport": "import { MermaidPart } from 'sparkdesign'",
|
|
3444
|
+
"cliAdd": "npx sparkdesign@latest add mermaid-part",
|
|
3445
|
+
"slots": [
|
|
3446
|
+
"MermaidPart",
|
|
3447
|
+
"diagram content",
|
|
3448
|
+
"header icon",
|
|
3449
|
+
"rendered diagram",
|
|
3450
|
+
"error by composition"
|
|
3451
|
+
],
|
|
3452
|
+
"states": [
|
|
3453
|
+
"rendering",
|
|
3454
|
+
"rendered",
|
|
3455
|
+
"empty",
|
|
3456
|
+
"error",
|
|
3457
|
+
"collapsed by composition"
|
|
3458
|
+
],
|
|
3459
|
+
"a11y": [
|
|
3460
|
+
"Provide surrounding text that explains the diagram purpose.",
|
|
3461
|
+
"Do not rely on the diagram alone for critical instructions.",
|
|
3462
|
+
"Keep fallback/error text readable when rendering fails."
|
|
3463
|
+
],
|
|
3464
|
+
"composition": [
|
|
3465
|
+
"CollapsibleCard",
|
|
3466
|
+
"ScrollArea",
|
|
3467
|
+
"Alert",
|
|
3468
|
+
"Markdown"
|
|
3469
|
+
],
|
|
3470
|
+
"antiPatterns": [
|
|
3471
|
+
"Do not use MermaidPart for arbitrary code blocks; use CodeBlockPart.",
|
|
3472
|
+
"Do not pass untrusted diagram text without the product's sanitization policy.",
|
|
3473
|
+
"Do not hide critical workflow details only inside a diagram."
|
|
3474
|
+
],
|
|
3475
|
+
"agentHints": [
|
|
3476
|
+
"Choose MermaidPart for AI-generated flowcharts, sequence diagrams, and state diagrams.",
|
|
3477
|
+
"Use Markdown for prose and CodeBlockPart for source code."
|
|
3478
|
+
]
|
|
3479
|
+
},
|
|
3480
|
+
"queue-indicator": {
|
|
3481
|
+
"id": "queue-indicator",
|
|
3482
|
+
"name": "QueueIndicator",
|
|
3483
|
+
"category": "chat",
|
|
3484
|
+
"status": "stable",
|
|
3485
|
+
"intent": "Compact queue/status indicator for pending agent tasks, tool calls, or background work items.",
|
|
3486
|
+
"packageImport": "import { QueueIndicator } from 'sparkdesign'",
|
|
3487
|
+
"cliAdd": "npx sparkdesign@latest add queue-indicator",
|
|
3488
|
+
"slots": [
|
|
3489
|
+
"QueueIndicator",
|
|
3490
|
+
"queue items",
|
|
3491
|
+
"labels",
|
|
3492
|
+
"active item",
|
|
3493
|
+
"count"
|
|
3494
|
+
],
|
|
3495
|
+
"states": [
|
|
3496
|
+
"empty hidden",
|
|
3497
|
+
"queued",
|
|
3498
|
+
"running",
|
|
3499
|
+
"completed",
|
|
3500
|
+
"failed",
|
|
3501
|
+
"expanded by composition"
|
|
3502
|
+
],
|
|
3503
|
+
"a11y": [
|
|
3504
|
+
"Expose queue counts and active labels as readable text.",
|
|
3505
|
+
"Do not use color alone for item status.",
|
|
3506
|
+
"Keep updates calm and avoid excessive live-region noise."
|
|
3507
|
+
],
|
|
3508
|
+
"composition": [
|
|
3509
|
+
"TaskPart",
|
|
3510
|
+
"Progress",
|
|
3511
|
+
"Spinner",
|
|
3512
|
+
"Tooltip"
|
|
3513
|
+
],
|
|
3514
|
+
"antiPatterns": [
|
|
3515
|
+
"Do not use QueueIndicator for static lists.",
|
|
3516
|
+
"Do not show stale queued items after work has finished.",
|
|
3517
|
+
"Do not hide failure state when user action is needed."
|
|
3518
|
+
],
|
|
3519
|
+
"agentHints": [
|
|
3520
|
+
"Choose QueueIndicator for queued or background agent work.",
|
|
3521
|
+
"Use TaskPart for detailed per-task status."
|
|
3522
|
+
]
|
|
3523
|
+
},
|
|
3524
|
+
"related-prompts": {
|
|
3525
|
+
"id": "related-prompts",
|
|
3526
|
+
"name": "RelatedPrompts",
|
|
3527
|
+
"category": "chat",
|
|
3528
|
+
"status": "stable",
|
|
3529
|
+
"intent": "Small set of clickable suggested prompts that help users continue an AI conversation.",
|
|
3530
|
+
"packageImport": "import { RelatedPrompts } from 'sparkdesign'",
|
|
3531
|
+
"cliAdd": "npx sparkdesign@latest add related-prompts",
|
|
3532
|
+
"slots": [
|
|
3533
|
+
"RelatedPrompts",
|
|
3534
|
+
"prompt item",
|
|
3535
|
+
"item icon",
|
|
3536
|
+
"tooltip in single-line mode"
|
|
3537
|
+
],
|
|
3538
|
+
"states": [
|
|
3539
|
+
"empty hidden",
|
|
3540
|
+
"up to three prompts",
|
|
3541
|
+
"single-line",
|
|
3542
|
+
"multi-line",
|
|
3543
|
+
"clickable",
|
|
3544
|
+
"read-only"
|
|
3545
|
+
],
|
|
3546
|
+
"a11y": [
|
|
3547
|
+
"Use prompt text that describes the resulting action.",
|
|
3548
|
+
"Keep clickable suggestions keyboard reachable.",
|
|
3549
|
+
"Do not rely on icons alone to explain suggestions."
|
|
3550
|
+
],
|
|
3551
|
+
"composition": [
|
|
3552
|
+
"ChatInput",
|
|
3553
|
+
"Empty",
|
|
3554
|
+
"Response",
|
|
3555
|
+
"Tooltip"
|
|
3556
|
+
],
|
|
3557
|
+
"antiPatterns": [
|
|
3558
|
+
"Do not show too many suggestions at once.",
|
|
3559
|
+
"Do not use RelatedPrompts for primary navigation.",
|
|
3560
|
+
"Do not generate vague prompts that do not help users proceed."
|
|
3561
|
+
],
|
|
3562
|
+
"agentHints": [
|
|
3563
|
+
"Choose RelatedPrompts after empty states, answers, or task completion to guide the next AI turn.",
|
|
3564
|
+
"Use OptionList when the user must choose one of several structured options."
|
|
3565
|
+
]
|
|
3566
|
+
},
|
|
3567
|
+
"send-button": {
|
|
3568
|
+
"id": "send-button",
|
|
3569
|
+
"name": "SendButton",
|
|
3570
|
+
"category": "chat",
|
|
3571
|
+
"status": "stable",
|
|
3572
|
+
"intent": "Chat composer send/stop action button with loading, disabled, and icon states.",
|
|
3573
|
+
"packageImport": "import { SendButton } from 'sparkdesign'",
|
|
3574
|
+
"cliAdd": "npx sparkdesign@latest add send-button",
|
|
3575
|
+
"slots": [
|
|
3576
|
+
"SendButton",
|
|
3577
|
+
"send icon",
|
|
3578
|
+
"stop icon by composition",
|
|
3579
|
+
"loading indicator"
|
|
3580
|
+
],
|
|
3581
|
+
"states": [
|
|
3582
|
+
"ready",
|
|
3583
|
+
"disabled",
|
|
3584
|
+
"loading",
|
|
3585
|
+
"streaming by composition",
|
|
3586
|
+
"focused"
|
|
3587
|
+
],
|
|
3588
|
+
"a11y": [
|
|
3589
|
+
"Provide a clear aria-label such as Send message or Stop generation.",
|
|
3590
|
+
"Do not rely only on icon shape to communicate send versus stop.",
|
|
3591
|
+
"Keep disabled state aligned with composer validity."
|
|
3592
|
+
],
|
|
3593
|
+
"composition": [
|
|
3594
|
+
"ChatInput",
|
|
3595
|
+
"Tooltip",
|
|
3596
|
+
"Spinner",
|
|
3597
|
+
"IconButton"
|
|
3598
|
+
],
|
|
3599
|
+
"antiPatterns": [
|
|
3600
|
+
"Do not use SendButton for ordinary form submission outside chat.",
|
|
3601
|
+
"Do not show enabled send state when the prompt cannot be submitted.",
|
|
3602
|
+
"Do not omit stop/cancel affordance when streaming can be interrupted."
|
|
3603
|
+
],
|
|
3604
|
+
"agentHints": [
|
|
3605
|
+
"Choose SendButton inside ChatInput or custom agent composers.",
|
|
3606
|
+
"Use Button for non-chat submit actions."
|
|
3607
|
+
]
|
|
3608
|
+
},
|
|
3609
|
+
"thinking-indicator": {
|
|
3610
|
+
"id": "thinking-indicator",
|
|
3611
|
+
"name": "ThinkingIndicator",
|
|
3612
|
+
"category": "chat",
|
|
3613
|
+
"status": "stable",
|
|
3614
|
+
"intent": "Subtle AI thinking indicator for brief reasoning or response preparation states.",
|
|
3615
|
+
"packageImport": "import { ThinkingIndicator } from 'sparkdesign'",
|
|
3616
|
+
"cliAdd": "npx sparkdesign@latest add thinking-indicator",
|
|
3617
|
+
"slots": [
|
|
3618
|
+
"ThinkingIndicator",
|
|
3619
|
+
"text",
|
|
3620
|
+
"animated dots",
|
|
3621
|
+
"icon by composition"
|
|
3622
|
+
],
|
|
3623
|
+
"states": [
|
|
3624
|
+
"thinking",
|
|
3625
|
+
"hidden",
|
|
3626
|
+
"inline",
|
|
3627
|
+
"with custom label"
|
|
3628
|
+
],
|
|
3629
|
+
"a11y": [
|
|
3630
|
+
"Use readable text when the wait is meaningful.",
|
|
3631
|
+
"Do not rely on animation alone.",
|
|
3632
|
+
"Avoid leaving thinking state visible after output starts."
|
|
3633
|
+
],
|
|
3634
|
+
"composition": [
|
|
3635
|
+
"Response",
|
|
3636
|
+
"GenerationStatusBar",
|
|
3637
|
+
"ShimmeringText",
|
|
3638
|
+
"Spinner"
|
|
3639
|
+
],
|
|
3640
|
+
"antiPatterns": [
|
|
3641
|
+
"Do not use ThinkingIndicator for long determinate tasks; use Progress or TaskPart.",
|
|
3642
|
+
"Do not show multiple thinking indicators for one response.",
|
|
3643
|
+
"Do not use as decorative ambient motion."
|
|
3644
|
+
],
|
|
3645
|
+
"agentHints": [
|
|
3646
|
+
"Choose ThinkingIndicator for short AI preparation states before text appears.",
|
|
3647
|
+
"Use GenerationStatusBar for more prominent generation status."
|
|
3648
|
+
]
|
|
3649
|
+
},
|
|
3650
|
+
"user-question-answer": {
|
|
3651
|
+
"id": "user-question-answer",
|
|
3652
|
+
"name": "UserQuestionAnswer",
|
|
3653
|
+
"category": "chat",
|
|
3654
|
+
"status": "stable",
|
|
3655
|
+
"intent": "Compact summary card of user-provided answers to agent questions.",
|
|
3656
|
+
"packageImport": "import { UserQuestionAnswer } from 'sparkdesign'",
|
|
3657
|
+
"cliAdd": "npx sparkdesign@latest add user-question-answer",
|
|
3658
|
+
"slots": [
|
|
3659
|
+
"UserQuestionAnswer",
|
|
3660
|
+
"header",
|
|
3661
|
+
"question label",
|
|
3662
|
+
"answer text",
|
|
3663
|
+
"icon"
|
|
3664
|
+
],
|
|
3665
|
+
"states": [
|
|
3666
|
+
"single answer",
|
|
3667
|
+
"multiple answers",
|
|
3668
|
+
"header hidden",
|
|
3669
|
+
"empty hidden"
|
|
3670
|
+
],
|
|
3671
|
+
"a11y": [
|
|
3672
|
+
"Keep question and answer text visible in the same reading order.",
|
|
3673
|
+
"Do not use icon-only headers without text.",
|
|
3674
|
+
"Avoid hiding answers that affect subsequent agent behavior."
|
|
3675
|
+
],
|
|
3676
|
+
"composition": [
|
|
3677
|
+
"UserQuestion",
|
|
3678
|
+
"AskUserPart",
|
|
3679
|
+
"Response",
|
|
3680
|
+
"Card"
|
|
3681
|
+
],
|
|
3682
|
+
"antiPatterns": [
|
|
3683
|
+
"Do not use UserQuestionAnswer for editable question forms.",
|
|
3684
|
+
"Do not collapse answer summaries when they explain why the agent acted.",
|
|
3685
|
+
"Do not use for generic key-value details unrelated to agent questions."
|
|
3686
|
+
],
|
|
3687
|
+
"agentHints": [
|
|
3688
|
+
"Choose UserQuestionAnswer after the user has responded to an agent question.",
|
|
3689
|
+
"Use UserQuestion for collecting the answers."
|
|
3690
|
+
]
|
|
3691
|
+
},
|
|
3692
|
+
"user-question-part": {
|
|
3693
|
+
"id": "user-question-part",
|
|
3694
|
+
"name": "UserQuestion",
|
|
3695
|
+
"category": "chat",
|
|
3696
|
+
"status": "stable",
|
|
3697
|
+
"intent": "Structured multi-question agent form with option cards, keyboard navigation, and submit behavior.",
|
|
3698
|
+
"packageImport": "import { UserQuestion } from 'sparkdesign'",
|
|
3699
|
+
"cliAdd": "npx sparkdesign@latest add user-question-part",
|
|
206
3700
|
"slots": [
|
|
207
|
-
"
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
"
|
|
213
|
-
"ChatInputActionsLeft",
|
|
214
|
-
"ChatInputActionsRight",
|
|
215
|
-
"ChatInputSendButton",
|
|
216
|
-
"ChatInputFooterLeft"
|
|
3701
|
+
"UserQuestion",
|
|
3702
|
+
"UserQuestion.Header",
|
|
3703
|
+
"UserQuestion.Cards",
|
|
3704
|
+
"UserQuestion.Card",
|
|
3705
|
+
"UserQuestion.Footer",
|
|
3706
|
+
"options"
|
|
217
3707
|
],
|
|
218
3708
|
"states": [
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"permission-required"
|
|
3709
|
+
"unanswered",
|
|
3710
|
+
"answered",
|
|
3711
|
+
"focused option",
|
|
3712
|
+
"submitting",
|
|
3713
|
+
"skipped",
|
|
3714
|
+
"keyboard navigation"
|
|
226
3715
|
],
|
|
227
3716
|
"a11y": [
|
|
228
|
-
"
|
|
229
|
-
"Keep
|
|
230
|
-
"
|
|
231
|
-
"Do not hide status text from assistive technology when it communicates task state."
|
|
3717
|
+
"Use clear question text and option labels.",
|
|
3718
|
+
"Keep keyboard selection and submit paths available.",
|
|
3719
|
+
"Do not make option meaning depend only on visual styling."
|
|
232
3720
|
],
|
|
233
3721
|
"composition": [
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"
|
|
238
|
-
"PermissionCard",
|
|
239
|
-
"Tooltip"
|
|
3722
|
+
"OptionList",
|
|
3723
|
+
"Button",
|
|
3724
|
+
"UserQuestionAnswer",
|
|
3725
|
+
"AskUserPart"
|
|
240
3726
|
],
|
|
241
3727
|
"antiPatterns": [
|
|
242
|
-
"Do not use
|
|
243
|
-
"Do not
|
|
244
|
-
"Do not
|
|
3728
|
+
"Do not use UserQuestion for ordinary product settings forms.",
|
|
3729
|
+
"Do not ask too many unrelated questions in one step.",
|
|
3730
|
+
"Do not auto-submit ambiguous choices without user confirmation."
|
|
245
3731
|
],
|
|
246
3732
|
"agentHints": [
|
|
247
|
-
"Choose
|
|
248
|
-
"Use
|
|
3733
|
+
"Choose UserQuestion when an agent needs structured answers before continuing.",
|
|
3734
|
+
"Use AskUserPart for one focused question with simple run/skip actions."
|
|
249
3735
|
]
|
|
250
3736
|
},
|
|
251
3737
|
"dialog": {
|
|
@@ -397,6 +3883,396 @@
|
|
|
397
3883
|
"Pair with PermissionCard when applying changes needs explicit approval."
|
|
398
3884
|
]
|
|
399
3885
|
},
|
|
3886
|
+
"code-block-part": {
|
|
3887
|
+
"id": "code-block-part",
|
|
3888
|
+
"name": "CodeBlockPart",
|
|
3889
|
+
"category": "chat",
|
|
3890
|
+
"status": "stable",
|
|
3891
|
+
"intent": "Syntax-highlighted code block card for generated, reviewed, or referenced source code.",
|
|
3892
|
+
"packageImport": "import { CodeBlockPart } from 'sparkdesign'",
|
|
3893
|
+
"cliAdd": "npx sparkdesign@latest add code-block-part",
|
|
3894
|
+
"slots": [
|
|
3895
|
+
"filename",
|
|
3896
|
+
"language",
|
|
3897
|
+
"code",
|
|
3898
|
+
"diff summary",
|
|
3899
|
+
"header icon"
|
|
3900
|
+
],
|
|
3901
|
+
"states": [
|
|
3902
|
+
"expanded",
|
|
3903
|
+
"collapsed",
|
|
3904
|
+
"generating",
|
|
3905
|
+
"diff-add",
|
|
3906
|
+
"diff-remove",
|
|
3907
|
+
"empty"
|
|
3908
|
+
],
|
|
3909
|
+
"a11y": [
|
|
3910
|
+
"Keep code selectable and readable as text.",
|
|
3911
|
+
"Expose filename and language in the header.",
|
|
3912
|
+
"Do not rely on syntax color alone to communicate meaning."
|
|
3913
|
+
],
|
|
3914
|
+
"composition": [
|
|
3915
|
+
"Response",
|
|
3916
|
+
"ToolInvocationCard",
|
|
3917
|
+
"FileReviewPart",
|
|
3918
|
+
"CollapsibleCard"
|
|
3919
|
+
],
|
|
3920
|
+
"antiPatterns": [
|
|
3921
|
+
"Do not use CodeBlockPart for terminal output; use TerminalCodeBlockPart.",
|
|
3922
|
+
"Do not collapse security-relevant code changes without a visible summary.",
|
|
3923
|
+
"Do not use for short inline code snippets inside prose."
|
|
3924
|
+
],
|
|
3925
|
+
"agentHints": [
|
|
3926
|
+
"Choose CodeBlockPart for source code or config files.",
|
|
3927
|
+
"Set filename when the code belongs to a specific file."
|
|
3928
|
+
]
|
|
3929
|
+
},
|
|
3930
|
+
"file-card": {
|
|
3931
|
+
"id": "file-card",
|
|
3932
|
+
"name": "FileCard",
|
|
3933
|
+
"category": "chat",
|
|
3934
|
+
"status": "stable",
|
|
3935
|
+
"intent": "Compact file preview or attachment card for conversational surfaces.",
|
|
3936
|
+
"packageImport": "import { FileCard } from 'sparkdesign'",
|
|
3937
|
+
"cliAdd": "npx sparkdesign@latest add file-card",
|
|
3938
|
+
"slots": [
|
|
3939
|
+
"file icon",
|
|
3940
|
+
"file name",
|
|
3941
|
+
"metadata",
|
|
3942
|
+
"status",
|
|
3943
|
+
"action by composition"
|
|
3944
|
+
],
|
|
3945
|
+
"states": [
|
|
3946
|
+
"default",
|
|
3947
|
+
"loading",
|
|
3948
|
+
"selected",
|
|
3949
|
+
"error",
|
|
3950
|
+
"disabled"
|
|
3951
|
+
],
|
|
3952
|
+
"a11y": [
|
|
3953
|
+
"Expose file name and type as text.",
|
|
3954
|
+
"Do not use file icon color as the only type signal.",
|
|
3955
|
+
"Keep remove or open actions keyboard reachable when present."
|
|
3956
|
+
],
|
|
3957
|
+
"composition": [
|
|
3958
|
+
"ChatInput",
|
|
3959
|
+
"FileAttachment",
|
|
3960
|
+
"FileReviewPart",
|
|
3961
|
+
"Button"
|
|
3962
|
+
],
|
|
3963
|
+
"antiPatterns": [
|
|
3964
|
+
"Do not use FileCard for agent-proposed file diffs; use FileReviewPart.",
|
|
3965
|
+
"Do not hide upload or processing errors.",
|
|
3966
|
+
"Do not truncate the only distinguishing part of a filename without Tooltip or title."
|
|
3967
|
+
],
|
|
3968
|
+
"agentHints": [
|
|
3969
|
+
"Use FileCard for static file references or previews.",
|
|
3970
|
+
"Use FileAttachment when composing attachments inside ChatInput."
|
|
3971
|
+
]
|
|
3972
|
+
},
|
|
3973
|
+
"generated-images-grid": {
|
|
3974
|
+
"id": "generated-images-grid",
|
|
3975
|
+
"name": "GeneratedImagesGrid",
|
|
3976
|
+
"category": "chat",
|
|
3977
|
+
"status": "stable",
|
|
3978
|
+
"intent": "Grid display for AI-generated image results, variants, or selectable visual outputs.",
|
|
3979
|
+
"packageImport": "import { GeneratedImagesGrid } from 'sparkdesign'",
|
|
3980
|
+
"cliAdd": "npx sparkdesign@latest add generated-images-grid",
|
|
3981
|
+
"slots": [
|
|
3982
|
+
"image grid",
|
|
3983
|
+
"image item",
|
|
3984
|
+
"caption by composition",
|
|
3985
|
+
"selection action by composition"
|
|
3986
|
+
],
|
|
3987
|
+
"states": [
|
|
3988
|
+
"loading",
|
|
3989
|
+
"complete",
|
|
3990
|
+
"empty",
|
|
3991
|
+
"selectable",
|
|
3992
|
+
"error by composition"
|
|
3993
|
+
],
|
|
3994
|
+
"a11y": [
|
|
3995
|
+
"Provide meaningful alt text or adjacent descriptions for generated images.",
|
|
3996
|
+
"Keep image actions keyboard reachable.",
|
|
3997
|
+
"Do not rely on thumbnails alone when a result needs status or provenance."
|
|
3998
|
+
],
|
|
3999
|
+
"composition": [
|
|
4000
|
+
"Response",
|
|
4001
|
+
"ImageGenerating",
|
|
4002
|
+
"Button",
|
|
4003
|
+
"Alert"
|
|
4004
|
+
],
|
|
4005
|
+
"antiPatterns": [
|
|
4006
|
+
"Do not use for arbitrary product card grids.",
|
|
4007
|
+
"Do not omit loading or failure states during image generation.",
|
|
4008
|
+
"Do not make image selection depend only on hover UI."
|
|
4009
|
+
],
|
|
4010
|
+
"agentHints": [
|
|
4011
|
+
"Use inside Response when an agent returns generated image candidates.",
|
|
4012
|
+
"Pair with ImageGenerating while generation is still in progress."
|
|
4013
|
+
]
|
|
4014
|
+
},
|
|
4015
|
+
"plan-part": {
|
|
4016
|
+
"id": "plan-part",
|
|
4017
|
+
"name": "PlanPart",
|
|
4018
|
+
"category": "chat",
|
|
4019
|
+
"status": "stable",
|
|
4020
|
+
"intent": "Structured plan display for agent steps, checkpoints, or proposed execution phases.",
|
|
4021
|
+
"packageImport": "import { PlanPart } from 'sparkdesign'",
|
|
4022
|
+
"cliAdd": "npx sparkdesign@latest add plan-part",
|
|
4023
|
+
"slots": [
|
|
4024
|
+
"title",
|
|
4025
|
+
"summary",
|
|
4026
|
+
"plan steps",
|
|
4027
|
+
"step status",
|
|
4028
|
+
"actions by composition"
|
|
4029
|
+
],
|
|
4030
|
+
"states": [
|
|
4031
|
+
"draft",
|
|
4032
|
+
"active",
|
|
4033
|
+
"completed",
|
|
4034
|
+
"blocked",
|
|
4035
|
+
"expanded",
|
|
4036
|
+
"collapsed"
|
|
4037
|
+
],
|
|
4038
|
+
"a11y": [
|
|
4039
|
+
"Expose each plan step as readable text.",
|
|
4040
|
+
"Do not communicate progress through color alone.",
|
|
4041
|
+
"Keep approve, revise, or continue actions keyboard reachable when present."
|
|
4042
|
+
],
|
|
4043
|
+
"composition": [
|
|
4044
|
+
"Response",
|
|
4045
|
+
"TaskPart",
|
|
4046
|
+
"PermissionCard",
|
|
4047
|
+
"Button",
|
|
4048
|
+
"Alert"
|
|
4049
|
+
],
|
|
4050
|
+
"antiPatterns": [
|
|
4051
|
+
"Do not replace a plan with an unstructured Markdown paragraph when steps need status.",
|
|
4052
|
+
"Do not use PlanPart for completed task logs; use TaskPart or ToolInvocationCard.",
|
|
4053
|
+
"Do not hide blockers in a collapsed-only state."
|
|
4054
|
+
],
|
|
4055
|
+
"agentHints": [
|
|
4056
|
+
"Use PlanPart when an agent needs to show intended future work.",
|
|
4057
|
+
"Pair with PermissionCard when the plan needs explicit approval before execution."
|
|
4058
|
+
]
|
|
4059
|
+
},
|
|
4060
|
+
"reasoning-step": {
|
|
4061
|
+
"id": "reasoning-step",
|
|
4062
|
+
"name": "ReasoningStep",
|
|
4063
|
+
"category": "chat",
|
|
4064
|
+
"status": "stable",
|
|
4065
|
+
"intent": "Readable reasoning or progress step for assistant thinking, analysis phases, or multi-step response construction.",
|
|
4066
|
+
"packageImport": "import { ReasoningStep } from 'sparkdesign'",
|
|
4067
|
+
"cliAdd": "npx sparkdesign@latest add reasoning-step",
|
|
4068
|
+
"slots": [
|
|
4069
|
+
"header",
|
|
4070
|
+
"status",
|
|
4071
|
+
"summary",
|
|
4072
|
+
"details",
|
|
4073
|
+
"detail row"
|
|
4074
|
+
],
|
|
4075
|
+
"states": [
|
|
4076
|
+
"thinking",
|
|
4077
|
+
"running",
|
|
4078
|
+
"complete",
|
|
4079
|
+
"error",
|
|
4080
|
+
"expanded",
|
|
4081
|
+
"collapsed"
|
|
4082
|
+
],
|
|
4083
|
+
"a11y": [
|
|
4084
|
+
"Expose status text, not only spinner or color.",
|
|
4085
|
+
"Keep details reachable by keyboard.",
|
|
4086
|
+
"Do not over-announce every token-level reasoning update."
|
|
4087
|
+
],
|
|
4088
|
+
"composition": [
|
|
4089
|
+
"Response",
|
|
4090
|
+
"ToolInvocationCard",
|
|
4091
|
+
"ThinkingIndicator",
|
|
4092
|
+
"Alert"
|
|
4093
|
+
],
|
|
4094
|
+
"antiPatterns": [
|
|
4095
|
+
"Do not expose private chain-of-thought or hidden system reasoning.",
|
|
4096
|
+
"Do not use ReasoningStep for final answer prose; use Response or MarkdownBody.",
|
|
4097
|
+
"Do not show a completed state before the step has actually resolved."
|
|
4098
|
+
],
|
|
4099
|
+
"agentHints": [
|
|
4100
|
+
"Use for high-level progress summaries, not raw internal reasoning.",
|
|
4101
|
+
"Prefer short, inspectable details that explain what happened."
|
|
4102
|
+
]
|
|
4103
|
+
},
|
|
4104
|
+
"streaming-markdown-block": {
|
|
4105
|
+
"id": "streaming-markdown-block",
|
|
4106
|
+
"name": "StreamingMarkdownBlock",
|
|
4107
|
+
"category": "chat",
|
|
4108
|
+
"status": "stable",
|
|
4109
|
+
"intent": "Animated Markdown renderer for active assistant text streaming with token-level reveal behavior.",
|
|
4110
|
+
"packageImport": "import { StreamingMarkdownBlock } from 'sparkdesign'",
|
|
4111
|
+
"cliAdd": "npx sparkdesign@latest add streaming-markdown-block",
|
|
4112
|
+
"slots": [
|
|
4113
|
+
"content",
|
|
4114
|
+
"active streaming state",
|
|
4115
|
+
"token delay",
|
|
4116
|
+
"completion callback"
|
|
4117
|
+
],
|
|
4118
|
+
"states": [
|
|
4119
|
+
"idle",
|
|
4120
|
+
"streaming",
|
|
4121
|
+
"complete",
|
|
4122
|
+
"interrupted",
|
|
4123
|
+
"empty"
|
|
4124
|
+
],
|
|
4125
|
+
"a11y": [
|
|
4126
|
+
"Avoid excessive live announcements during token streaming.",
|
|
4127
|
+
"Render final content as semantic Markdown.",
|
|
4128
|
+
"Respect reduced-motion preferences when adding streaming effects around the component."
|
|
4129
|
+
],
|
|
4130
|
+
"composition": [
|
|
4131
|
+
"Response",
|
|
4132
|
+
"MarkdownBody",
|
|
4133
|
+
"ThinkingIndicator"
|
|
4134
|
+
],
|
|
4135
|
+
"antiPatterns": [
|
|
4136
|
+
"Do not use for static documentation that is not streaming.",
|
|
4137
|
+
"Do not restart the stream on unrelated parent re-renders.",
|
|
4138
|
+
"Do not use streaming animation to hide slow tool or network states."
|
|
4139
|
+
],
|
|
4140
|
+
"agentHints": [
|
|
4141
|
+
"Use inside Response.Content when assistant answer text is arriving incrementally.",
|
|
4142
|
+
"Use MarkdownBody directly for already-complete content."
|
|
4143
|
+
]
|
|
4144
|
+
},
|
|
4145
|
+
"task-part": {
|
|
4146
|
+
"id": "task-part",
|
|
4147
|
+
"name": "TaskPart",
|
|
4148
|
+
"category": "chat",
|
|
4149
|
+
"status": "stable",
|
|
4150
|
+
"intent": "Task progress card for agent work items, substeps, status, and completion state.",
|
|
4151
|
+
"packageImport": "import { TaskPart } from 'sparkdesign'",
|
|
4152
|
+
"cliAdd": "npx sparkdesign@latest add task-part",
|
|
4153
|
+
"slots": [
|
|
4154
|
+
"task title",
|
|
4155
|
+
"task list",
|
|
4156
|
+
"task status",
|
|
4157
|
+
"progress summary",
|
|
4158
|
+
"actions by composition"
|
|
4159
|
+
],
|
|
4160
|
+
"states": [
|
|
4161
|
+
"todo",
|
|
4162
|
+
"running",
|
|
4163
|
+
"completed",
|
|
4164
|
+
"failed",
|
|
4165
|
+
"cancelled",
|
|
4166
|
+
"expanded",
|
|
4167
|
+
"collapsed"
|
|
4168
|
+
],
|
|
4169
|
+
"a11y": [
|
|
4170
|
+
"Expose task status as text.",
|
|
4171
|
+
"Keep task order logical and chronological.",
|
|
4172
|
+
"Do not rely on progress color as the only state indicator."
|
|
4173
|
+
],
|
|
4174
|
+
"composition": [
|
|
4175
|
+
"Response",
|
|
4176
|
+
"PlanPart",
|
|
4177
|
+
"ToolInvocationCard",
|
|
4178
|
+
"Progress",
|
|
4179
|
+
"Alert"
|
|
4180
|
+
],
|
|
4181
|
+
"antiPatterns": [
|
|
4182
|
+
"Do not use TaskPart for a proposed future plan; use PlanPart.",
|
|
4183
|
+
"Do not hide failed tasks behind a collapsed summary.",
|
|
4184
|
+
"Do not use for generic checklist forms where Checkbox is the actual control."
|
|
4185
|
+
],
|
|
4186
|
+
"agentHints": [
|
|
4187
|
+
"Use TaskPart to show execution progress after work has started.",
|
|
4188
|
+
"Pair with ToolInvocationCard when tasks correspond to concrete tool calls."
|
|
4189
|
+
]
|
|
4190
|
+
},
|
|
4191
|
+
"terminal-code-block-part": {
|
|
4192
|
+
"id": "terminal-code-block-part",
|
|
4193
|
+
"name": "TerminalCodeBlockPart",
|
|
4194
|
+
"category": "chat",
|
|
4195
|
+
"status": "stable",
|
|
4196
|
+
"intent": "Terminal-style command or log block for shell commands, process output, and agent execution traces.",
|
|
4197
|
+
"packageImport": "import { TerminalCodeBlockPart } from 'sparkdesign'",
|
|
4198
|
+
"cliAdd": "npx sparkdesign@latest add terminal-code-block-part",
|
|
4199
|
+
"slots": [
|
|
4200
|
+
"command",
|
|
4201
|
+
"output",
|
|
4202
|
+
"status",
|
|
4203
|
+
"exit code by composition",
|
|
4204
|
+
"header"
|
|
4205
|
+
],
|
|
4206
|
+
"states": [
|
|
4207
|
+
"running",
|
|
4208
|
+
"success",
|
|
4209
|
+
"error",
|
|
4210
|
+
"empty",
|
|
4211
|
+
"expanded",
|
|
4212
|
+
"collapsed"
|
|
4213
|
+
],
|
|
4214
|
+
"a11y": [
|
|
4215
|
+
"Keep terminal output selectable as text.",
|
|
4216
|
+
"Expose running, success, and error states in readable text.",
|
|
4217
|
+
"Avoid dumping extremely large logs without summary or truncation."
|
|
4218
|
+
],
|
|
4219
|
+
"composition": [
|
|
4220
|
+
"ToolInvocationCard",
|
|
4221
|
+
"Response",
|
|
4222
|
+
"CodeBlockPart",
|
|
4223
|
+
"Alert"
|
|
4224
|
+
],
|
|
4225
|
+
"antiPatterns": [
|
|
4226
|
+
"Do not use TerminalCodeBlockPart for source code; use CodeBlockPart.",
|
|
4227
|
+
"Do not mark output as successful before the command exits.",
|
|
4228
|
+
"Do not hide dangerous commands from the visible header or summary."
|
|
4229
|
+
],
|
|
4230
|
+
"agentHints": [
|
|
4231
|
+
"Use for shell commands and process output.",
|
|
4232
|
+
"Pair with PermissionCard before risky command execution."
|
|
4233
|
+
]
|
|
4234
|
+
},
|
|
4235
|
+
"user-message": {
|
|
4236
|
+
"id": "user-message",
|
|
4237
|
+
"name": "UserMessage",
|
|
4238
|
+
"category": "chat",
|
|
4239
|
+
"status": "stable",
|
|
4240
|
+
"intent": "Human-authored message bubble or prompt display in a conversation thread.",
|
|
4241
|
+
"packageImport": "import { UserMessage } from 'sparkdesign'",
|
|
4242
|
+
"cliAdd": "npx sparkdesign@latest add user-message",
|
|
4243
|
+
"slots": [
|
|
4244
|
+
"message text",
|
|
4245
|
+
"avatar by composition",
|
|
4246
|
+
"metadata by composition",
|
|
4247
|
+
"attachments by composition"
|
|
4248
|
+
],
|
|
4249
|
+
"states": [
|
|
4250
|
+
"default",
|
|
4251
|
+
"with attachments",
|
|
4252
|
+
"edited by composition",
|
|
4253
|
+
"pending by composition"
|
|
4254
|
+
],
|
|
4255
|
+
"a11y": [
|
|
4256
|
+
"Preserve the message text as readable content.",
|
|
4257
|
+
"Do not encode author identity only through alignment or color.",
|
|
4258
|
+
"Keep attachment names accessible when attachments are shown."
|
|
4259
|
+
],
|
|
4260
|
+
"composition": [
|
|
4261
|
+
"Response",
|
|
4262
|
+
"FileCard",
|
|
4263
|
+
"ImageAttachment",
|
|
4264
|
+
"MarkdownBody"
|
|
4265
|
+
],
|
|
4266
|
+
"antiPatterns": [
|
|
4267
|
+
"Do not use UserMessage for assistant output; use Response.",
|
|
4268
|
+
"Do not put tool execution details in UserMessage.",
|
|
4269
|
+
"Do not hide long user prompts behind hover-only UI."
|
|
4270
|
+
],
|
|
4271
|
+
"agentHints": [
|
|
4272
|
+
"Use UserMessage for the user's side of an AI conversation.",
|
|
4273
|
+
"Use Response for assistant messages even when the content is short."
|
|
4274
|
+
]
|
|
4275
|
+
},
|
|
400
4276
|
"markdown": {
|
|
401
4277
|
"id": "markdown",
|
|
402
4278
|
"name": "MarkdownBody",
|
|
@@ -524,7 +4400,9 @@
|
|
|
524
4400
|
"FileReviewPart",
|
|
525
4401
|
"TaskPart",
|
|
526
4402
|
"PlanPart",
|
|
527
|
-
"CodeBlockPart"
|
|
4403
|
+
"CodeBlockPart",
|
|
4404
|
+
"TerminalCodeBlockPart",
|
|
4405
|
+
"GeneratedImagesGrid"
|
|
528
4406
|
],
|
|
529
4407
|
"antiPatterns": [
|
|
530
4408
|
"Do not use Response for user-authored messages.",
|
|
@@ -585,6 +4463,41 @@
|
|
|
585
4463
|
}
|
|
586
4464
|
},
|
|
587
4465
|
"recipes": {
|
|
4466
|
+
"structured-form": {
|
|
4467
|
+
"id": "structured-form",
|
|
4468
|
+
"intent": "Build a tokenized form or settings section with accessible labels, helper text, validation, and clear submission actions.",
|
|
4469
|
+
"useWhen": [
|
|
4470
|
+
"The UI collects structured values from the user.",
|
|
4471
|
+
"The task needs labeled fields, selection controls, validation, and submit/cancel actions.",
|
|
4472
|
+
"The flow is deterministic rather than conversational."
|
|
4473
|
+
],
|
|
4474
|
+
"components": [
|
|
4475
|
+
"input",
|
|
4476
|
+
"textarea",
|
|
4477
|
+
"label",
|
|
4478
|
+
"select",
|
|
4479
|
+
"checkbox",
|
|
4480
|
+
"radio-group",
|
|
4481
|
+
"switch",
|
|
4482
|
+
"button",
|
|
4483
|
+
"alert"
|
|
4484
|
+
],
|
|
4485
|
+
"layout": [
|
|
4486
|
+
"Pair each field with Label or Field-style composition.",
|
|
4487
|
+
"Group related controls by task, not by component type.",
|
|
4488
|
+
"Use one primary Button for submission and keep validation feedback close to the field or form section."
|
|
4489
|
+
],
|
|
4490
|
+
"accessibility": [
|
|
4491
|
+
"Every control needs a visible label or accessible name.",
|
|
4492
|
+
"Use native form semantics where possible.",
|
|
4493
|
+
"Do not rely on placeholder text as the only instruction or label."
|
|
4494
|
+
],
|
|
4495
|
+
"antiPatterns": [
|
|
4496
|
+
"Do not use ChatInput for deterministic forms.",
|
|
4497
|
+
"Do not use DropdownMenu as a form select.",
|
|
4498
|
+
"Do not hide validation feedback in Tooltip."
|
|
4499
|
+
]
|
|
4500
|
+
},
|
|
588
4501
|
"assistant-composer": {
|
|
589
4502
|
"id": "assistant-composer",
|
|
590
4503
|
"intent": "Build the bottom or inline prompt entry area for an AI assistant.",
|
|
@@ -621,14 +4534,24 @@
|
|
|
621
4534
|
],
|
|
622
4535
|
"components": [
|
|
623
4536
|
"response",
|
|
4537
|
+
"streaming-markdown-block",
|
|
4538
|
+
"reasoning-step",
|
|
624
4539
|
"markdown",
|
|
625
4540
|
"tool-invocation-card",
|
|
4541
|
+
"code-block-part",
|
|
4542
|
+
"terminal-code-block-part",
|
|
4543
|
+
"plan-part",
|
|
4544
|
+
"task-part",
|
|
4545
|
+
"generated-images-grid",
|
|
626
4546
|
"permission-card",
|
|
627
4547
|
"alert"
|
|
628
4548
|
],
|
|
629
4549
|
"layout": [
|
|
630
4550
|
"Use Response as the parent renderer for assistant output.",
|
|
4551
|
+
"Use StreamingMarkdownBlock for active answer text and MarkdownBody for complete static content.",
|
|
631
4552
|
"Use ToolInvocationCard for each tool step rather than plain text logs.",
|
|
4553
|
+
"Use CodeBlockPart for source code and TerminalCodeBlockPart for command output.",
|
|
4554
|
+
"Use PlanPart for proposed work and TaskPart for execution progress.",
|
|
632
4555
|
"Use Alert for inline errors that belong to the response."
|
|
633
4556
|
],
|
|
634
4557
|
"accessibility": [
|
|
@@ -651,6 +4574,8 @@
|
|
|
651
4574
|
"dialog",
|
|
652
4575
|
"button",
|
|
653
4576
|
"card",
|
|
4577
|
+
"input",
|
|
4578
|
+
"textarea",
|
|
654
4579
|
"alert"
|
|
655
4580
|
],
|
|
656
4581
|
"layout": [
|
|
@@ -680,6 +4605,10 @@
|
|
|
680
4605
|
"drawer",
|
|
681
4606
|
"button",
|
|
682
4607
|
"card",
|
|
4608
|
+
"input",
|
|
4609
|
+
"select",
|
|
4610
|
+
"switch",
|
|
4611
|
+
"tabs",
|
|
683
4612
|
"alert"
|
|
684
4613
|
],
|
|
685
4614
|
"layout": [
|