sparkdesign 0.4.8 → 0.4.10
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/AGENT_COMPONENT_LIBRARY_QUICKREF.md +117 -0
- package/AI_README.md +7 -2
- package/README.md +4 -1
- package/cli/registry/AGENTS.md +1 -1
- package/cli/registry/agent-manifest.json +4040 -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/calendar.tsx +16 -16
- package/cli/registry/basic/collapsible-card.tsx +10 -1
- package/cli/registry/basic/combobox.tsx +11 -2
- package/cli/registry/basic/date-picker.tsx +3 -2
- 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/popover.tsx +19 -2
- package/cli/registry/basic/rating.tsx +161 -0
- package/cli/registry/basic/sidebar.tsx +665 -0
- package/cli/registry/basic/sonner.tsx +10 -10
- package/cli/registry/basic/stepper.tsx +163 -0
- package/cli/registry/basic/timeline.tsx +129 -0
- package/cli/registry/chat/chat-input/compound.tsx +1 -0
- package/cli/registry/chat/permission-card.tsx +1 -1
- package/cli/registry/chat/user-question/compound.tsx +2 -0
- package/cli/registry/meta.json +171 -13
- package/dist/registry/basic/accordion.d.ts +15 -0
- package/dist/registry/basic/badge.d.ts +23 -0
- package/dist/registry/basic/calendar.d.ts +1 -1
- package/dist/registry/basic/combobox.d.ts +2 -1
- package/dist/registry/basic/date-picker.d.ts +2 -2
- 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/popover.d.ts +2 -0
- package/dist/registry/basic/rating.d.ts +31 -0
- package/dist/registry/basic/sidebar.d.ts +72 -0
- package/dist/registry/basic/stepper.d.ts +36 -0
- package/dist/registry/basic/tag.d.ts +1 -1
- package/dist/registry/basic/timeline.d.ts +34 -0
- package/dist/spark-design.cjs.js +27 -30
- package/dist/spark-design.es.js +6398 -5130
- 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/Rating/index.d.ts +13 -0
- package/dist/src/components/basic/Sidebar/index.d.ts +13 -0
- package/dist/src/components/basic/Stepper/index.d.ts +13 -0
- package/dist/src/components/basic/Timeline/index.d.ts +13 -0
- package/dist/src/components/index.d.ts +12 -4
- package/docs/agent/component-selection.md +104 -4
- package/docs/agent/prompt-recipes.md +167 -0
- package/docs/guides/agent-usage.md +213 -0
- package/docs/guides/system-operating-model.md +148 -0
- package/package.json +20 -3
- package/registry/agent-manifest.json +4040 -67
- package/cli/registry/basic/sheet.tsx +0 -18
- 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/basic/sheet.d.ts +0 -13
- 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/basic/Sheet/index.d.ts +0 -13
- package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +0 -12
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Accordion and sub-parts re-export from registry.
|
|
3
|
+
* [FROM]: registry/basic/accordion.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Accordion/index.tsx — published Accordion wrapper.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from '../../../../registry/basic/accordion';
|
|
13
|
+
export type { AccordionProps, AccordionItemProps, AccordionTriggerProps, AccordionContentProps, } from '../../../../registry/basic/accordion';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Badge re-export from registry.
|
|
3
|
+
* [FROM]: registry/basic/badge.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Badge/index.tsx — published Badge wrapper.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { Badge, badgeVariants } from '../../../../registry/basic/badge';
|
|
13
|
+
export type { BadgeProps } from '../../../../registry/basic/badge';
|
|
@@ -1,45 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* [WHO]: Public exports from this file (see implementation below).
|
|
3
|
-
* [FROM]:
|
|
3
|
+
* [FROM]: registry/basic/ellipsis-text.
|
|
4
4
|
* [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
|
|
5
|
-
* [HERE]: src/components/basic/EllipsisText/index.tsx —
|
|
5
|
+
* [HERE]: src/components/basic/EllipsisText/index.tsx — packaged wrapper for EllipsisText.
|
|
6
6
|
*
|
|
7
7
|
* [PROTOCOL]:
|
|
8
8
|
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
9
|
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
10
|
* 3. Follow design tokens and explicit type exports.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
/** 要显示的文本内容 */
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* 最大显示行数,超出会显示省略号
|
|
18
|
-
* @default 1
|
|
19
|
-
*/
|
|
20
|
-
lines?: number;
|
|
21
|
-
/** 容器额外类名 */
|
|
22
|
-
className?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Tooltip 弹出方向
|
|
25
|
-
* @default 'top'
|
|
26
|
-
*/
|
|
27
|
-
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
28
|
-
/** Tooltip 内容额外类名 */
|
|
29
|
-
tooltipClassName?: string;
|
|
30
|
-
/** 自定义 tooltip 内容,默认使用 children */
|
|
31
|
-
tooltipContent?: ReactNode;
|
|
32
|
-
/**
|
|
33
|
-
* 是否禁用 tooltip
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
/** 容器行内样式 */
|
|
38
|
-
style?: CSSProperties;
|
|
39
|
-
/**
|
|
40
|
-
* 文本元素的标签类型
|
|
41
|
-
* @default 'span'
|
|
42
|
-
*/
|
|
43
|
-
as?: 'span' | 'div' | 'p';
|
|
44
|
-
}
|
|
45
|
-
export declare const EllipsisText: import("react").ForwardRefExoticComponent<EllipsisTextProps & import("react").RefAttributes<HTMLElement>>;
|
|
12
|
+
export { EllipsisText } from '../../../../registry/basic/ellipsis-text';
|
|
13
|
+
export type { EllipsisTextProps } from '../../../../registry/basic/ellipsis-text';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Form helpers re-export from registry.
|
|
3
|
+
* [FROM]: registry/basic/form.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Form/index.tsx — published React Hook Form helper wrapper.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from '../../../../registry/basic/form';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Public Rating re-export.
|
|
3
|
+
* [FROM]: registry/basic/rating.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components/index.ts barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Rating/index.tsx — package-facing Rating entrypoint.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { Rating, ratingVariants } from '../../../../registry/basic/rating';
|
|
13
|
+
export type { RatingProps, RatingPrecision } from '../../../../registry/basic/rating';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Sidebar primitives re-export from registry.
|
|
3
|
+
* [FROM]: registry/basic/sidebar.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Sidebar/index.tsx — published Sidebar wrapper.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, sidebarMenuButtonVariants, useSidebar, } from '../../../../registry/basic/sidebar';
|
|
13
|
+
export { SidebarMenu as SidebarNavMenu, SidebarMenuItem as SidebarNavMenuItem, } from '../../../../registry/basic/sidebar';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Public Stepper re-export.
|
|
3
|
+
* [FROM]: registry/basic/stepper.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components/index.ts barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Stepper/index.tsx — package-facing Stepper entrypoint.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { Stepper, StepperItem, StepperIndicator, StepperContent, StepperTitle, StepperDescription, StepperSeparator, } from '../../../../registry/basic/stepper';
|
|
13
|
+
export type { StepperProps, StepperItemProps, StepperIndicatorProps, StepperContentProps, StepperTitleProps, StepperDescriptionProps, StepperSeparatorProps, StepStatus, } from '../../../../registry/basic/stepper';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Public Timeline re-export.
|
|
3
|
+
* [FROM]: registry/basic/timeline.
|
|
4
|
+
* [TO]: sparkdesign package consumers; src/components/index.ts barrel.
|
|
5
|
+
* [HERE]: src/components/basic/Timeline/index.tsx — package-facing Timeline entrypoint.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
export { Timeline, TimelineItem, TimelineMarker, TimelineConnector, TimelineContent, TimelineTitle, TimelineDescription, TimelineTime, timelineMarkerVariants, } from '../../../../registry/basic/timeline';
|
|
13
|
+
export type { TimelineProps, TimelineItemProps, TimelineMarkerProps, TimelineConnectorProps, TimelineContentProps, TimelineTitleProps, TimelineDescriptionProps, TimelineTimeProps, } from '../../../../registry/basic/timeline';
|
|
@@ -13,6 +13,8 @@ export { Button } from './basic/Button';
|
|
|
13
13
|
export type { ButtonProps } from './basic/Button';
|
|
14
14
|
export { ButtonGroup, ButtonGroupText, ButtonGroupSeparator, buttonGroupVariants, } from './basic/ButtonGroup';
|
|
15
15
|
export type { ButtonGroupProps, ButtonGroupTextProps, ButtonGroupSeparatorProps, } from './basic/ButtonGroup';
|
|
16
|
+
export { Badge, badgeVariants } from './basic/Badge';
|
|
17
|
+
export type { BadgeProps } from './basic/Badge';
|
|
16
18
|
export { IconButton } from './basic/IconButton';
|
|
17
19
|
export type { IconButtonProps } from './basic/IconButton';
|
|
18
20
|
export { Tooltip } from './basic/Tooltip';
|
|
@@ -33,8 +35,6 @@ export { Toggle, ToggleGroup, ToggleGroupItem } from './basic/Toggle';
|
|
|
33
35
|
export type { ToggleProps, ToggleGroupProps, ToggleGroupItemProps } from './basic/Toggle';
|
|
34
36
|
export { RadioGroup, RadioGroupItem } from './basic/RadioGroup';
|
|
35
37
|
export type { RadioGroupProps, RadioGroupItemProps } from './basic/RadioGroup';
|
|
36
|
-
export { CollapsibleSection } from './basic/CollapsibleSection';
|
|
37
|
-
export type { CollapsibleSectionProps } from './basic/CollapsibleSection';
|
|
38
38
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './basic/Collapsible';
|
|
39
39
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle, } from './basic/Resizable';
|
|
40
40
|
export type { ResizablePanelGroupProps, ResizablePanelProps, ResizableHandleProps, } from './basic/Resizable';
|
|
@@ -56,6 +56,8 @@ export { Select, SelectTrigger, SelectValue, SelectContent, SelectLabel, SelectS
|
|
|
56
56
|
export type { SelectProps, SelectTriggerProps, SelectValueProps, SelectContentProps, SelectLabelProps, SelectSeparatorProps, SelectGroupProps, SelectItemProps, } from './basic/Select';
|
|
57
57
|
export { Tabs, TabsList, TabsTrigger, TabsContent, } from './basic/Tabs';
|
|
58
58
|
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps, } from './basic/Tabs';
|
|
59
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from './basic/Accordion';
|
|
60
|
+
export type { AccordionProps, AccordionItemProps, AccordionTriggerProps, AccordionContentProps, } from './basic/Accordion';
|
|
59
61
|
export { Collapse, CollapseItem, CollapseTrigger, CollapseContent, } from './basic/Collapse';
|
|
60
62
|
export type { CollapseProps, CollapseItemProps, CollapseTriggerProps, CollapseContentProps, } from './basic/Collapse';
|
|
61
63
|
export { TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyP, TypographyBlockquote, TypographyTable, TypographyList, TypographyInlineCode, TypographyLead, TypographyLarge, TypographySmall, TypographyMuted, } from './basic/Typography';
|
|
@@ -68,10 +70,17 @@ export { Tag, tagVariants } from './basic/Tag';
|
|
|
68
70
|
export type { TagProps } from './basic/Tag';
|
|
69
71
|
export { Progress } from './basic/Progress';
|
|
70
72
|
export type { ProgressProps } from './basic/Progress';
|
|
73
|
+
export { Rating, ratingVariants } from './basic/Rating';
|
|
74
|
+
export type { RatingProps, RatingPrecision } from './basic/Rating';
|
|
75
|
+
export { Stepper, StepperItem, StepperIndicator, StepperContent, StepperTitle, StepperDescription, StepperSeparator, } from './basic/Stepper';
|
|
76
|
+
export type { StepperProps, StepperItemProps, StepperIndicatorProps, StepperContentProps, StepperTitleProps, StepperDescriptionProps, StepperSeparatorProps, StepStatus, } from './basic/Stepper';
|
|
77
|
+
export { Timeline, TimelineItem, TimelineMarker, TimelineConnector, TimelineContent, TimelineTitle, TimelineDescription, TimelineTime, timelineMarkerVariants, } from './basic/Timeline';
|
|
78
|
+
export type { TimelineProps, TimelineItemProps, TimelineMarkerProps, TimelineConnectorProps, TimelineContentProps, TimelineTitleProps, TimelineDescriptionProps, TimelineTimeProps, } from './basic/Timeline';
|
|
71
79
|
export { CollapsibleCard } from './basic/CollapsibleCard';
|
|
72
80
|
export type { CollapsibleCardProps } from './basic/CollapsibleCard';
|
|
73
81
|
export { SidebarMenu } from './basic/SidebarMenu';
|
|
74
82
|
export type { SidebarMenuProps, SidebarMenuItem, SidebarMenuItemAction } from './basic/SidebarMenu';
|
|
83
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SidebarNavMenu, SidebarNavMenuItem, sidebarMenuButtonVariants, useSidebar, } from './basic/Sidebar';
|
|
75
84
|
export { Input } from './basic/Input';
|
|
76
85
|
export type { InputProps } from './basic/Input';
|
|
77
86
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupTextarea, InputGroupText, } from './basic/InputGroup';
|
|
@@ -79,6 +88,7 @@ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, } from './bas
|
|
|
79
88
|
export { Textarea } from './basic/Textarea';
|
|
80
89
|
export type { TextareaProps } from './basic/Textarea';
|
|
81
90
|
export { Field, FieldLabel, FieldDescription, FieldError, FieldContent, FieldTitle, FieldSeparator, FieldSet, FieldLegend, FieldGroup, } from './basic/Field';
|
|
91
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from './basic/Form';
|
|
82
92
|
export { Label } from './basic/Label';
|
|
83
93
|
export type { LabelProps } from './basic/Label';
|
|
84
94
|
export { Checkbox, checkboxVariants } from './basic/Checkbox';
|
|
@@ -98,8 +108,6 @@ export { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogClose, Dialog
|
|
|
98
108
|
export type { DialogContentProps, DialogHeaderProps, DialogFooterProps, } from './basic/Dialog';
|
|
99
109
|
export { Drawer, DrawerTrigger, DrawerClose, DrawerPortal, DrawerOverlay, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from './basic/Drawer';
|
|
100
110
|
export type { DrawerContentProps, DrawerHeaderProps, DrawerFooterProps, } from './basic/Drawer';
|
|
101
|
-
export { Sheet, SheetTrigger, SheetClose, SheetPortal, SheetOverlay, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, sheetVariants, } from './basic/Sheet';
|
|
102
|
-
export type { SheetContentProps, SheetHeaderProps, SheetFooterProps, } from './basic/Sheet';
|
|
103
111
|
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, } from './basic/Popover';
|
|
104
112
|
export type { PopoverContentProps } from './basic/Popover';
|
|
105
113
|
export { HoverCard, HoverCardTrigger, HoverCardContent } from './basic/HoverCard';
|
|
@@ -8,7 +8,10 @@ details are needed.
|
|
|
8
8
|
|
|
9
9
|
- `sparkdesign/agent-manifest.json` — package export for agent-facing component semantics.
|
|
10
10
|
- `registry/agent-manifest.json` — source of truth in this repository.
|
|
11
|
+
- Showcase route `#/agent-component-selection` — visible companion page for the same decision model.
|
|
11
12
|
- `npm run check:agent-manifest` — validates required semantic fields and recipe references.
|
|
13
|
+
- `npm run report:agent-coverage` — reports manifest coverage against `registry/meta.json`.
|
|
14
|
+
- `npm run check:agent-coverage` — fails if manifest coverage drops below 100%.
|
|
12
15
|
|
|
13
16
|
## Decision Order
|
|
14
17
|
|
|
@@ -18,28 +21,123 @@ details are needed.
|
|
|
18
21
|
4. Use `cliAdd` when the target app should own copied component source.
|
|
19
22
|
5. Use `packageImport` only when the app already consumes `sparkdesign` as a package.
|
|
20
23
|
|
|
24
|
+
## Common Name Boundaries
|
|
25
|
+
|
|
26
|
+
- `sidebar` is the full app-shell primitive set: provider state, trigger, responsive collapse, mobile sheet, and inset content. Package imports expose its menu list as `SidebarNavMenu` / `SidebarNavMenuItem`.
|
|
27
|
+
- `sidebar-menu` is the lightweight data-driven list component exported as `SidebarMenu`; use it when a full app shell would be overkill.
|
|
28
|
+
- `form` is for React Hook Form validation wiring; `field` is for layout-only form rows.
|
|
29
|
+
|
|
21
30
|
## Current High-Confidence Coverage
|
|
22
31
|
|
|
23
|
-
The
|
|
24
|
-
|
|
32
|
+
The manifest covers the components most likely to be selected by design/coding
|
|
33
|
+
agents. Use `npm run report:agent-coverage` for the current full coverage
|
|
34
|
+
snapshot.
|
|
25
35
|
|
|
26
36
|
- `button`
|
|
27
37
|
- `alert`
|
|
38
|
+
- `alert-dialog`
|
|
39
|
+
- `accordion`
|
|
40
|
+
- `aspect-ratio`
|
|
41
|
+
- `avatar`
|
|
42
|
+
- `badge`
|
|
43
|
+
- `breadcrumb`
|
|
44
|
+
- `button-group`
|
|
45
|
+
- `calendar`
|
|
28
46
|
- `card`
|
|
47
|
+
- `carousel`
|
|
48
|
+
- `chart`
|
|
49
|
+
- `checkbox`
|
|
50
|
+
- `collapse`
|
|
51
|
+
- `collapsible`
|
|
52
|
+
- `collapsible-card`
|
|
53
|
+
- `combobox`
|
|
54
|
+
- `command`
|
|
55
|
+
- `context-menu`
|
|
56
|
+
- `data-table`
|
|
57
|
+
- `date-picker`
|
|
29
58
|
- `dialog`
|
|
59
|
+
- `direction`
|
|
60
|
+
- `dropdown-menu`
|
|
30
61
|
- `drawer`
|
|
31
|
-
- `
|
|
62
|
+
- `ellipsis-text`
|
|
63
|
+
- `empty`
|
|
64
|
+
- `field`
|
|
65
|
+
- `form`
|
|
66
|
+
- `hover-card`
|
|
67
|
+
- `icon-button`
|
|
68
|
+
- `input`
|
|
69
|
+
- `input-group`
|
|
70
|
+
- `input-otp`
|
|
71
|
+
- `item`
|
|
72
|
+
- `kbd`
|
|
73
|
+
- `label`
|
|
74
|
+
- `menubar`
|
|
75
|
+
- `native-select`
|
|
76
|
+
- `navigation-menu`
|
|
77
|
+
- `option-list`
|
|
78
|
+
- `pagination`
|
|
79
|
+
- `popover`
|
|
80
|
+
- `progress`
|
|
81
|
+
- `radio-group`
|
|
82
|
+
- `resizable`
|
|
83
|
+
- `scroll-area`
|
|
84
|
+
- `scrollbar`
|
|
85
|
+
- `select`
|
|
86
|
+
- `separator`
|
|
87
|
+
- `sidebar`
|
|
88
|
+
- `sidebar-menu`
|
|
89
|
+
- `shimmering-text`
|
|
90
|
+
- `slider`
|
|
91
|
+
- `skeleton`
|
|
92
|
+
- `spinner`
|
|
93
|
+
- `switch`
|
|
94
|
+
- `table`
|
|
95
|
+
- `tag`
|
|
96
|
+
- `tabs`
|
|
97
|
+
- `textarea`
|
|
98
|
+
- `toast`
|
|
99
|
+
- `tooltip`
|
|
100
|
+
- `toggle`
|
|
101
|
+
- `toggle-group`
|
|
102
|
+
- `typography`
|
|
103
|
+
- `ask-user-part`
|
|
104
|
+
- `browser-action-part`
|
|
32
105
|
- `chat-input`
|
|
33
|
-
- `
|
|
106
|
+
- `code-block-part`
|
|
107
|
+
- `conversation-anchor-nav`
|
|
108
|
+
- `file-attachment`
|
|
109
|
+
- `file-card`
|
|
110
|
+
- `file-review-part`
|
|
111
|
+
- `folder-button`
|
|
112
|
+
- `generation-status-bar`
|
|
113
|
+
- `generated-images-grid`
|
|
114
|
+
- `hint-banner`
|
|
115
|
+
- `image-attachment`
|
|
116
|
+
- `image-generating`
|
|
34
117
|
- `markdown`
|
|
118
|
+
- `mermaid-part`
|
|
35
119
|
- `permission-card`
|
|
120
|
+
- `plan-part`
|
|
121
|
+
- `queue-indicator`
|
|
122
|
+
- `reasoning-step`
|
|
123
|
+
- `related-prompts`
|
|
124
|
+
- `response`
|
|
125
|
+
- `send-button`
|
|
126
|
+
- `streaming-markdown-block`
|
|
127
|
+
- `task-part`
|
|
128
|
+
- `terminal-code-block-part`
|
|
129
|
+
- `thinking-indicator`
|
|
36
130
|
- `tool-invocation-card`
|
|
131
|
+
- `user-message`
|
|
132
|
+
- `user-question-answer`
|
|
133
|
+
- `user-question-part`
|
|
37
134
|
|
|
38
135
|
## Recipe Usage
|
|
39
136
|
|
|
40
137
|
Recipes are intended to prevent agents from flattening rich AI interfaces into
|
|
41
138
|
generic cards and Markdown.
|
|
42
139
|
|
|
140
|
+
- `structured-form` — deterministic forms/settings with labels, controls, validation, and actions.
|
|
43
141
|
- `assistant-composer` — prompt entry, attachments, send, and permissions.
|
|
44
142
|
- `assistant-response-stream` — generated answer, tools, Markdown, and errors.
|
|
45
143
|
- `focused-task-modal` — compact blocking task or confirmation flow.
|
|
@@ -58,3 +156,5 @@ When adding a component to the manifest:
|
|
|
58
156
|
4. Ensure `cliAdd` installs the same component id as the manifest key.
|
|
59
157
|
5. Add or update recipes if the component changes how agents should compose screens.
|
|
60
158
|
6. Run `npm run check:agent-manifest`.
|
|
159
|
+
7. Run `npm run check:agent-coverage` so new registry components cannot ship without agent semantics.
|
|
160
|
+
8. Run `npm run report:agent-coverage` when planning broader semantic coverage or reviewing drift.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Spark Design Prompt Recipes
|
|
2
|
+
|
|
3
|
+
These prompts are for AI coding agents that need to build with Spark Design
|
|
4
|
+
without flattening the system into generic UI. They assume the agent can inspect
|
|
5
|
+
files, run commands, and edit code.
|
|
6
|
+
|
|
7
|
+
Showcase companion: `#/agent-prompt-recipes`.
|
|
8
|
+
|
|
9
|
+
## How To Use
|
|
10
|
+
|
|
11
|
+
1. Pick the recipe closest to the task.
|
|
12
|
+
2. Paste it into the agent with the product-specific requirements.
|
|
13
|
+
3. Keep the hard rules intact.
|
|
14
|
+
4. Ask the agent to report which Spark surfaces it verified.
|
|
15
|
+
|
|
16
|
+
## Universal Spark Contract
|
|
17
|
+
|
|
18
|
+
Add this block to any prompt when quality matters:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Use Spark Design as a system, not as loose components.
|
|
22
|
+
|
|
23
|
+
Before implementation:
|
|
24
|
+
- Read registry/agent-manifest.json and choose components by intent, states,
|
|
25
|
+
accessibility, composition, and antiPatterns.
|
|
26
|
+
- Read registry/tokens/ontology.json before writing styles.
|
|
27
|
+
- Prefer npx sparkdesign@latest add <component> for business apps that should
|
|
28
|
+
own copied source.
|
|
29
|
+
- Use package imports only if the app already consumes sparkdesign as a runtime.
|
|
30
|
+
|
|
31
|
+
Hard rules:
|
|
32
|
+
- Do not invent duplicate components when Spark already covers the intent.
|
|
33
|
+
- Do not hard-code hex colors, raw rgba overlays, arbitrary radii, or one-off
|
|
34
|
+
spacing in published UI.
|
|
35
|
+
- Preserve data-theme for color and data-style for layout density/radius/rhythm.
|
|
36
|
+
- Keep portal UI consistent with the active theme/style.
|
|
37
|
+
- For AI workflows, prefer chat components such as ChatInput, Response,
|
|
38
|
+
ToolInvocationCard, PermissionCard, ReasoningStep, TaskPart, PlanPart,
|
|
39
|
+
FileReviewPart, and RelatedPrompts instead of plain cards and Markdown.
|
|
40
|
+
|
|
41
|
+
Before handoff:
|
|
42
|
+
- Run the narrow checks that prove the changed surfaces.
|
|
43
|
+
- Report changed files, validation commands, and any remaining risk.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Recipe 1: Install Spark In A New App
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
Set up Spark Design in this React app.
|
|
50
|
+
|
|
51
|
+
Requirements:
|
|
52
|
+
- Determine whether this project should use CLI copied source or package imports.
|
|
53
|
+
- Prefer CLI copied source unless the project already uses sparkdesign as a
|
|
54
|
+
runtime dependency or I explicitly ask for package mode.
|
|
55
|
+
- If using CLI mode, run npx sparkdesign@latest init and add only the components
|
|
56
|
+
needed for the screen.
|
|
57
|
+
- Configure Tailwind CSS 4 correctly, including @tailwindcss/vite and @source
|
|
58
|
+
for copied Spark components.
|
|
59
|
+
- Set data-theme and data-style on the root or document element.
|
|
60
|
+
- Verify dark mode and at least one portal component if the screen uses overlays.
|
|
61
|
+
|
|
62
|
+
Do not mix CLI copied-source imports with package imports.
|
|
63
|
+
Do not leave Vite starter CSS fighting Spark tokens.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Recipe 2: Select Components For A Product Screen
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
Design and implement this product screen using Spark Design.
|
|
70
|
+
|
|
71
|
+
Task:
|
|
72
|
+
[Describe the screen, users, data density, and primary workflow.]
|
|
73
|
+
|
|
74
|
+
Process:
|
|
75
|
+
1. Read registry/agent-manifest.json.
|
|
76
|
+
2. List the Spark components selected by intent and explain why each one fits.
|
|
77
|
+
3. Check antiPatterns for every selected component before composing the screen.
|
|
78
|
+
4. Read registry/tokens/ontology.json and choose token families before styling.
|
|
79
|
+
5. Implement the screen with tokenized classes and existing Spark primitives.
|
|
80
|
+
6. Keep workflows efficient: use icons for tools, segmented controls for modes,
|
|
81
|
+
toggles for binary settings, and menus for option sets.
|
|
82
|
+
|
|
83
|
+
Verification:
|
|
84
|
+
- No duplicate local component that Spark already provides.
|
|
85
|
+
- No hard-coded hex/rgb, arbitrary radii, or arbitrary spacing unless explained.
|
|
86
|
+
- Text fits on desktop and mobile.
|
|
87
|
+
- Keyboard/focus behavior remains intact for controls and overlays.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Recipe 3: Build An AI Workflow
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
Build this AI workflow with Spark Design chat components.
|
|
94
|
+
|
|
95
|
+
Workflow:
|
|
96
|
+
[Describe prompt entry, tool calls, files, approvals, reasoning, generated
|
|
97
|
+
content, error handling, and follow-up prompts.]
|
|
98
|
+
|
|
99
|
+
Use Spark chat components where they match intent:
|
|
100
|
+
- ChatInput for prompt composition and attachments.
|
|
101
|
+
- Response or Markdown for generated answers.
|
|
102
|
+
- ToolInvocationCard for tool execution visibility.
|
|
103
|
+
- PermissionCard or AskUserPart for approval/confirmation.
|
|
104
|
+
- ReasoningStep, PlanPart, TaskPart, or BrowserActionPart for structured agent
|
|
105
|
+
progress.
|
|
106
|
+
- FileCard, FileAttachment, FileReviewPart, and GeneratedImagesGrid for files.
|
|
107
|
+
- RelatedPrompts for next actions.
|
|
108
|
+
|
|
109
|
+
Do not flatten tool calls, approvals, or reasoning into plain Markdown.
|
|
110
|
+
Expose state clearly: pending, streaming, success, blocked, skipped, failed.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Recipe 4: Add Or Change A Component
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
Add or change this Spark component while keeping the system isomorphic.
|
|
117
|
+
|
|
118
|
+
Component intent:
|
|
119
|
+
[Describe what user problem the component solves and what it should not solve.]
|
|
120
|
+
|
|
121
|
+
Required sequence:
|
|
122
|
+
1. Search existing registry/basic, registry/chat, and registry/agent-manifest.json
|
|
123
|
+
to confirm this component is not a duplicate.
|
|
124
|
+
2. Implement source of truth in registry/.
|
|
125
|
+
3. Keep dependencies public and copy-safe for CLI users.
|
|
126
|
+
4. Export component and prop types through src/components/.
|
|
127
|
+
5. Regenerate or validate registry/meta.json and sync cli/registry if needed.
|
|
128
|
+
6. Add showcase demo blocks with production-like examples and matching snippets.
|
|
129
|
+
7. Add props metadata and localized labels.
|
|
130
|
+
8. Update registry/agent-manifest.json with intent, slots, states, a11y,
|
|
131
|
+
composition, antiPatterns, and agentHints.
|
|
132
|
+
9. Update P3 headers and P2 AGENTS.md maps.
|
|
133
|
+
10. Run component, registry, showcase, token, and manifest checks.
|
|
134
|
+
|
|
135
|
+
Do not call the component complete until registry, CLI, package exports,
|
|
136
|
+
showcase, docs, and agent manifest agree.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Recipe 5: Audit A Spark Change
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
Review this Spark Design change as a maintainer.
|
|
143
|
+
|
|
144
|
+
Prioritize:
|
|
145
|
+
- Behavioral bugs and regressions.
|
|
146
|
+
- Drift between registry, CLI, package exports, showcase, docs, and manifest.
|
|
147
|
+
- Token misuse: hard-coded colors, raw rgba, arbitrary spacing/radius, theme
|
|
148
|
+
inheritance failures, and one-off visual language.
|
|
149
|
+
- Accessibility gaps: labels, roles, focus states, keyboard behavior, status
|
|
150
|
+
text, and color-only meaning.
|
|
151
|
+
- Showcase quality: examples should teach real usage and snippets should compile.
|
|
152
|
+
- AI friendliness: manifest intent and antiPatterns should prevent bad agent
|
|
153
|
+
choices.
|
|
154
|
+
|
|
155
|
+
Return findings first with file/line references, then open questions, then a
|
|
156
|
+
short verification summary.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Maintainer Checklist
|
|
160
|
+
|
|
161
|
+
- Prompt picked the correct consumption path: CLI copied source or package import.
|
|
162
|
+
- Prompt forced manifest and ontology reads before implementation.
|
|
163
|
+
- Prompt preserved theme/style axes and portal inheritance.
|
|
164
|
+
- Prompt required showcase and docs updates when public behavior changed.
|
|
165
|
+
- Prompt required agent manifest updates for new or changed components.
|
|
166
|
+
- Prompt kept AI-facing docs package-visible when guidance changed.
|
|
167
|
+
- Prompt included concrete verification commands and evidence.
|