@usevyre/ai-context 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -0
- package/dist/anti-patterns.json +222 -0
- package/dist/cheat-sheets/accordion.md +25 -0
- package/dist/cheat-sheets/alert.md +35 -0
- package/dist/cheat-sheets/avatar.md +34 -0
- package/dist/cheat-sheets/badge.md +41 -0
- package/dist/cheat-sheets/breadcrumb.md +26 -0
- package/dist/cheat-sheets/button.md +63 -0
- package/dist/cheat-sheets/calendar.md +27 -0
- package/dist/cheat-sheets/card.md +37 -0
- package/dist/cheat-sheets/checkbox.md +32 -0
- package/dist/cheat-sheets/command.md +29 -0
- package/dist/cheat-sheets/dropdownmenu.md +25 -0
- package/dist/cheat-sheets/field.md +36 -0
- package/dist/cheat-sheets/index.md +34 -0
- package/dist/cheat-sheets/input.md +28 -0
- package/dist/cheat-sheets/label.md +22 -0
- package/dist/cheat-sheets/modal.md +33 -0
- package/dist/cheat-sheets/pagination.md +15 -0
- package/dist/cheat-sheets/popover.md +32 -0
- package/dist/cheat-sheets/progress.md +27 -0
- package/dist/cheat-sheets/select.md +32 -0
- package/dist/cheat-sheets/separator.md +26 -0
- package/dist/cheat-sheets/sheet.md +28 -0
- package/dist/cheat-sheets/sidebar.md +33 -0
- package/dist/cheat-sheets/skeleton.md +27 -0
- package/dist/cheat-sheets/slider.md +22 -0
- package/dist/cheat-sheets/switch.md +26 -0
- package/dist/cheat-sheets/table.md +28 -0
- package/dist/cheat-sheets/tabs.md +24 -0
- package/dist/cheat-sheets/toast.md +41 -0
- package/dist/cheat-sheets/tooltip.md +30 -0
- package/dist/cheat-sheets/typography.md +22 -0
- package/dist/claude-context.md +716 -40
- package/dist/copilot-instructions.md +716 -40
- package/dist/cursor-rules.md +255 -261
- package/dist/full-context.md +715 -40
- package/dist/index.js +5054 -584
- package/dist/schema.json +1278 -0
- package/dist/version-info.json +233 -0
- package/dist/windsurf-rules.md +716 -40
- package/package.json +11 -2
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @usevyre/ai-context
|
|
2
|
+
|
|
3
|
+
> Inject useVyre design system context into your AI agent — eliminates UI hallucinations in Cursor, Claude, Windsurf, and Copilot.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@usevyre/ai-context)
|
|
6
|
+
[](../../LICENSE)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @usevyre/ai-context
|
|
12
|
+
# or
|
|
13
|
+
pnpm add @usevyre/ai-context
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Cursor — `.cursor/rules/usevyre.mdc`
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
node -e "
|
|
22
|
+
const { cursorRules } = require('@usevyre/ai-context');
|
|
23
|
+
require('fs').writeFileSync('.cursor/rules/usevyre.mdc', cursorRules);
|
|
24
|
+
"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Claude — `CLAUDE.md`
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node -e "
|
|
31
|
+
const { claudeContext } = require('@usevyre/ai-context');
|
|
32
|
+
require('fs').appendFileSync('CLAUDE.md', '\n\n' + claudeContext);
|
|
33
|
+
"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Windsurf — `.windsurf/rules/usevyre.md`
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
node -e "
|
|
40
|
+
const { windsurfRules } = require('@usevyre/ai-context');
|
|
41
|
+
require('fs').writeFileSync('.windsurf/rules/usevyre.md', windsurfRules);
|
|
42
|
+
"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### GitHub Copilot — `.github/copilot-instructions.md`
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
node -e "
|
|
49
|
+
const { copilotInstructions } = require('@usevyre/ai-context');
|
|
50
|
+
require('fs').writeFileSync('.github/copilot-instructions.md', copilotInstructions);
|
|
51
|
+
"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### JavaScript / TypeScript — inject into system prompt
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { fullContext } from "@usevyre/ai-context";
|
|
58
|
+
|
|
59
|
+
const response = await anthropic.messages.create({
|
|
60
|
+
model: "claude-opus-4-7",
|
|
61
|
+
system: fullContext,
|
|
62
|
+
messages: [{ role: "user", content: "Build a login form" }],
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Exports
|
|
67
|
+
|
|
68
|
+
| Export | Path | Description |
|
|
69
|
+
|--------|------|-------------|
|
|
70
|
+
| `fullContext` | `@usevyre/ai-context` | Full context string for system prompts |
|
|
71
|
+
| Cursor rules file | `@usevyre/ai-context/cursor` | `.cursor/rules` formatted markdown |
|
|
72
|
+
| Claude context file | `@usevyre/ai-context/claude` | `CLAUDE.md` formatted markdown |
|
|
73
|
+
| Windsurf rules file | `@usevyre/ai-context/windsurf` | `.windsurf/rules` formatted markdown |
|
|
74
|
+
| Copilot instructions file | `@usevyre/ai-context/copilot` | `.github/copilot-instructions.md` formatted markdown |
|
|
75
|
+
| Full context file | `@usevyre/ai-context/full` | Raw markdown file |
|
|
76
|
+
|
|
77
|
+
Full setup guide → [usevyre.com/docs/ai-context](https://usevyre.com/docs/ai-context)
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT © [Gapra](https://gapra.dev)
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"rules": [
|
|
4
|
+
{
|
|
5
|
+
"component": "Accordion",
|
|
6
|
+
"pattern": "Accordion without AccordionItem",
|
|
7
|
+
"reason": "Accordion requires AccordionItem as direct child",
|
|
8
|
+
"fix": "Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent",
|
|
9
|
+
"severity": "error"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"component": "Alert",
|
|
13
|
+
"pattern": "variant=\"error\"",
|
|
14
|
+
"reason": "No 'error' variant exists",
|
|
15
|
+
"fix": "Use variant=\"danger\"",
|
|
16
|
+
"severity": "error"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"component": "Alert",
|
|
20
|
+
"pattern": "variant=\"primary\"",
|
|
21
|
+
"reason": "Alert uses severity variants, not brand variants",
|
|
22
|
+
"fix": "Use variant=\"info\" | \"success\" | \"warning\" | \"danger\"",
|
|
23
|
+
"severity": "error"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"component": "Avatar",
|
|
27
|
+
"pattern": "size=\"xs\"",
|
|
28
|
+
"reason": "Minimum size is 'sm'",
|
|
29
|
+
"fix": "Use size=\"sm\"",
|
|
30
|
+
"severity": "error"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"component": "Avatar",
|
|
34
|
+
"pattern": "size=\"2xl\"",
|
|
35
|
+
"reason": "Maximum size is 'xl'",
|
|
36
|
+
"fix": "Use size=\"xl\"",
|
|
37
|
+
"severity": "error"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"component": "Badge",
|
|
41
|
+
"pattern": "variant=\"primary\"",
|
|
42
|
+
"reason": "Badge has no 'primary' variant",
|
|
43
|
+
"fix": "Use variant=\"accent\" for brand color",
|
|
44
|
+
"severity": "error"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"component": "Badge",
|
|
48
|
+
"pattern": "variant=\"error\"",
|
|
49
|
+
"reason": "No 'error' variant exists",
|
|
50
|
+
"fix": "Use variant=\"danger\"",
|
|
51
|
+
"severity": "error"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"component": "Badge",
|
|
55
|
+
"pattern": "variant=\"info\"",
|
|
56
|
+
"reason": "No 'info' variant on Badge (use Alert for info messages)",
|
|
57
|
+
"fix": "Use variant=\"teal\" for info-like styling",
|
|
58
|
+
"severity": "error"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"component": "Breadcrumb",
|
|
62
|
+
"pattern": "Using plain <a> tags inside Breadcrumb",
|
|
63
|
+
"reason": "Use BreadcrumbLink for correct styling and accessibility",
|
|
64
|
+
"fix": "Use BreadcrumbItem > BreadcrumbLink for each crumb",
|
|
65
|
+
"severity": "error"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"component": "Button",
|
|
69
|
+
"pattern": "variant=\"blue\"",
|
|
70
|
+
"reason": "No 'blue' variant exists",
|
|
71
|
+
"fix": "Use variant=\"accent\" for brand amber, or variant=\"teal\" for teal",
|
|
72
|
+
"severity": "error"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"component": "Button",
|
|
76
|
+
"pattern": "size=\"xl\"",
|
|
77
|
+
"reason": "Maximum size is 'lg'",
|
|
78
|
+
"fix": "Use size=\"lg\"",
|
|
79
|
+
"severity": "error"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"component": "Button",
|
|
83
|
+
"pattern": "color=\"...\"",
|
|
84
|
+
"reason": "No color prop exists on Button",
|
|
85
|
+
"fix": "Use variant prop instead",
|
|
86
|
+
"severity": "error"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"component": "Button",
|
|
90
|
+
"pattern": "icon={...}",
|
|
91
|
+
"reason": "No 'icon' prop for inserting icons",
|
|
92
|
+
"fix": "Use leftIcon={...} or rightIcon={...}",
|
|
93
|
+
"severity": "error"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"component": "Button",
|
|
97
|
+
"pattern": "size=\"icon\" without aria-label",
|
|
98
|
+
"reason": "Icon-only buttons have no visible text — screen readers need aria-label",
|
|
99
|
+
"fix": "Add aria-label describing the action",
|
|
100
|
+
"severity": "error"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"component": "Calendar",
|
|
104
|
+
"pattern": "Using Calendar for time selection",
|
|
105
|
+
"reason": "Calendar handles date only, not time",
|
|
106
|
+
"fix": "Combine with a separate time Input if time selection is needed",
|
|
107
|
+
"severity": "error"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"component": "Card",
|
|
111
|
+
"pattern": "variant=\"primary\"",
|
|
112
|
+
"reason": "Card has no 'primary' variant",
|
|
113
|
+
"fix": "Use variant=\"elevated\" | \"outlined\" | \"ghost\" | \"accent\"",
|
|
114
|
+
"severity": "error"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"component": "Checkbox",
|
|
118
|
+
"pattern": "size=\"lg\"",
|
|
119
|
+
"reason": "Maximum size is 'md'",
|
|
120
|
+
"fix": "Use size=\"md\"",
|
|
121
|
+
"severity": "error"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"component": "Command",
|
|
125
|
+
"pattern": "Using Input type=\"search\" for search UI",
|
|
126
|
+
"reason": "Command component is the correct pattern for search-first UI",
|
|
127
|
+
"fix": "Use Command + CommandInput + CommandList + CommandItem",
|
|
128
|
+
"severity": "error"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"component": "DropdownMenu",
|
|
132
|
+
"pattern": "DropdownItem variant=\"primary\"",
|
|
133
|
+
"reason": "DropdownItem only has 'default' and 'danger' variants",
|
|
134
|
+
"fix": "Use variant=\"danger\" for destructive items only",
|
|
135
|
+
"severity": "error"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"component": "Field",
|
|
139
|
+
"pattern": "Applying state prop directly to Input",
|
|
140
|
+
"reason": "state belongs on Field, not on the Input itself",
|
|
141
|
+
"fix": "Wrap Input in <Field state=\"error\"> to apply validation styling",
|
|
142
|
+
"severity": "error"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"component": "Input",
|
|
146
|
+
"pattern": "size=\"icon\"",
|
|
147
|
+
"reason": "'icon' size is only valid for Button, not Input",
|
|
148
|
+
"fix": "Use size=\"sm\" | \"md\" | \"lg\"",
|
|
149
|
+
"severity": "error"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"component": "Input",
|
|
153
|
+
"pattern": "type=\"search\" for search UI",
|
|
154
|
+
"reason": "Use Command component for search-first interfaces",
|
|
155
|
+
"fix": "Import Command from @usevyre/react for search palettes",
|
|
156
|
+
"severity": "error"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"component": "Modal",
|
|
160
|
+
"pattern": "size=\"xl\"",
|
|
161
|
+
"reason": "Maximum size is 'full'",
|
|
162
|
+
"fix": "Use size=\"lg\" or size=\"full\"",
|
|
163
|
+
"severity": "error"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"component": "Popover",
|
|
167
|
+
"pattern": "placement=\"top-center\"",
|
|
168
|
+
"reason": "No 'top-center' — center alignment is the default when no suffix is given",
|
|
169
|
+
"fix": "Use placement=\"top\" for centered placement",
|
|
170
|
+
"severity": "error"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"component": "Progress",
|
|
174
|
+
"pattern": "value > 100",
|
|
175
|
+
"reason": "Value is clamped to 0–100",
|
|
176
|
+
"fix": "Normalize your value to 0–100 range before passing",
|
|
177
|
+
"severity": "error"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"component": "Select",
|
|
181
|
+
"pattern": "Passing strings directly as children",
|
|
182
|
+
"reason": "Select uses options prop, not children",
|
|
183
|
+
"fix": "Pass options={[{ value: 'a', label: 'Option A' }]}",
|
|
184
|
+
"severity": "error"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"component": "Toast",
|
|
188
|
+
"pattern": "Rendering <Toast> directly in JSX",
|
|
189
|
+
"reason": "Toast is triggered via the useToast hook, not rendered directly",
|
|
190
|
+
"fix": "Use: const { toast } = useToast(); then toast({ title, variant })",
|
|
191
|
+
"severity": "error"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"component": "Toast",
|
|
195
|
+
"pattern": "variant=\"error\"",
|
|
196
|
+
"reason": "No 'error' variant",
|
|
197
|
+
"fix": "Use variant=\"danger\"",
|
|
198
|
+
"severity": "error"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"component": "Toast",
|
|
202
|
+
"pattern": "variant=\"info\"",
|
|
203
|
+
"reason": "No 'info' variant on Toast",
|
|
204
|
+
"fix": "Use variant=\"default\"",
|
|
205
|
+
"severity": "error"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"component": "Tooltip",
|
|
209
|
+
"pattern": "Using Tooltip for rich content (forms, buttons, etc.)",
|
|
210
|
+
"reason": "Tooltip is for short text labels only",
|
|
211
|
+
"fix": "Use Popover for rich interactive content",
|
|
212
|
+
"severity": "error"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"component": "Typography",
|
|
216
|
+
"pattern": "Using raw <h1>, <p> tags instead of Typography components",
|
|
217
|
+
"reason": "Typography components apply the correct token-based styles",
|
|
218
|
+
"fix": "Use <Heading>, <Text>, <Lead> from @usevyre/react",
|
|
219
|
+
"severity": "error"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Accordion — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Vertically stacked collapsible sections. Compose with AccordionItem, AccordionTrigger, AccordionContent.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `Accordion without AccordionItem`
|
|
13
|
+
→ Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
**Basic accordion**
|
|
18
|
+
```tsx
|
|
19
|
+
<Accordion>
|
|
20
|
+
<AccordionItem value="item-1">
|
|
21
|
+
<AccordionTrigger>Section Title</AccordionTrigger>
|
|
22
|
+
<AccordionContent>Content goes here.</AccordionContent>
|
|
23
|
+
</AccordionItem>
|
|
24
|
+
</Accordion>
|
|
25
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Alert — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Inline feedback message for info, success, warning, or danger states.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Alert } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `variant` | `"info"` \| `"success"` \| `"warning"` \| `"danger"` | `info` |
|
|
15
|
+
|
|
16
|
+
## Common AI Mistakes
|
|
17
|
+
|
|
18
|
+
- ❌ `variant="error"`
|
|
19
|
+
→ Use variant="danger"
|
|
20
|
+
- ❌ `variant="primary"`
|
|
21
|
+
→ Use variant="info" | "success" | "warning" | "danger"
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
**Warning with close button**
|
|
26
|
+
```tsx
|
|
27
|
+
<Alert variant="warning" title="Heads up" onClose={() => setOpen(false)}>
|
|
28
|
+
This action cannot be undone.
|
|
29
|
+
</Alert>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Success state**
|
|
33
|
+
```tsx
|
|
34
|
+
<Alert variant="success" title="Saved!">Your changes have been saved.</Alert>
|
|
35
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Avatar — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**User profile image with fallback initials or icon.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Avatar } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `size` | `"sm"` \| `"md"` \| `"lg"` \| `"xl"` | `md` |
|
|
15
|
+
| `status` | `"online"` \| `"offline"` \| `"busy"` \| `"away"` | — |
|
|
16
|
+
|
|
17
|
+
## Common AI Mistakes
|
|
18
|
+
|
|
19
|
+
- ❌ `size="xs"`
|
|
20
|
+
→ Use size="sm"
|
|
21
|
+
- ❌ `size="2xl"`
|
|
22
|
+
→ Use size="xl"
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
**Avatar with image and online status**
|
|
27
|
+
```tsx
|
|
28
|
+
<Avatar src="/user.png" alt="Jane Doe" size="lg" status="online" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Fallback initials**
|
|
32
|
+
```tsx
|
|
33
|
+
<Avatar fallback="JD" size="md" />
|
|
34
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Badge — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Small label for status, category, or count. Use dot prop for live status indicator.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Badge } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `variant` | `"default"` \| `"accent"` \| `"teal"` \| `"success"` \| `"warning"` \| `"danger"` | `default` |
|
|
15
|
+
| `dot` | `true` \| `false` | `false` |
|
|
16
|
+
|
|
17
|
+
## Common AI Mistakes
|
|
18
|
+
|
|
19
|
+
- ❌ `variant="primary"`
|
|
20
|
+
→ Use variant="accent" for brand color
|
|
21
|
+
- ❌ `variant="error"`
|
|
22
|
+
→ Use variant="danger"
|
|
23
|
+
- ❌ `variant="info"`
|
|
24
|
+
→ Use variant="teal" for info-like styling
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
**Live status with dot**
|
|
29
|
+
```tsx
|
|
30
|
+
<Badge variant="success" dot>Online</Badge>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Warning badge**
|
|
34
|
+
```tsx
|
|
35
|
+
<Badge variant="warning">Beta</Badge>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Danger badge**
|
|
39
|
+
```tsx
|
|
40
|
+
<Badge variant="danger">Error</Badge>
|
|
41
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Breadcrumb — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Navigation trail showing current page location in hierarchy.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `Using plain <a> tags inside Breadcrumb`
|
|
13
|
+
→ Use BreadcrumbItem > BreadcrumbLink for each crumb
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
**Basic breadcrumb**
|
|
18
|
+
```tsx
|
|
19
|
+
<Breadcrumb>
|
|
20
|
+
<BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
|
|
21
|
+
<BreadcrumbSeparator />
|
|
22
|
+
<BreadcrumbItem><BreadcrumbLink href="/docs">Docs</BreadcrumbLink></BreadcrumbItem>
|
|
23
|
+
<BreadcrumbSeparator />
|
|
24
|
+
<BreadcrumbItem aria-current="page">Button</BreadcrumbItem>
|
|
25
|
+
</Breadcrumb>
|
|
26
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Button — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Triggers actions and navigation. The most commonly used interactive element.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Button } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `variant` | `"primary"` \| `"secondary"` \| `"ghost"` \| `"accent"` \| `"teal"` \| `"danger"` | `secondary` |
|
|
15
|
+
| `size` | `"sm"` \| `"md"` \| `"lg"` \| `"icon"` | `md` |
|
|
16
|
+
| `loading` | `true` \| `false` | `false` |
|
|
17
|
+
| `disabled` | `true` \| `false` | `false` |
|
|
18
|
+
|
|
19
|
+
## Common AI Mistakes
|
|
20
|
+
|
|
21
|
+
- ❌ `variant="blue"`
|
|
22
|
+
→ Use variant="accent" for brand amber, or variant="teal" for teal
|
|
23
|
+
- ❌ `size="xl"`
|
|
24
|
+
→ Use size="lg"
|
|
25
|
+
- ❌ `color="..."`
|
|
26
|
+
→ Use variant prop instead
|
|
27
|
+
- ❌ `icon={...}`
|
|
28
|
+
→ Use leftIcon={...} or rightIcon={...}
|
|
29
|
+
- ❌ `size="icon" without aria-label`
|
|
30
|
+
→ Add aria-label describing the action
|
|
31
|
+
|
|
32
|
+
## Examples
|
|
33
|
+
|
|
34
|
+
**Primary CTA**
|
|
35
|
+
```tsx
|
|
36
|
+
<Button variant="primary">Get Started</Button>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Large accent button**
|
|
40
|
+
```tsx
|
|
41
|
+
<Button variant="accent" size="lg">Launch App</Button>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Loading state**
|
|
45
|
+
```tsx
|
|
46
|
+
<Button variant="danger" loading>Deleting...</Button>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Link button**
|
|
50
|
+
```tsx
|
|
51
|
+
<Button as="a" href="/docs" variant="secondary">Read Docs</Button>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Icon-only button**
|
|
55
|
+
```tsx
|
|
56
|
+
<Button variant="ghost" size="icon" aria-label="Close">
|
|
57
|
+
<X size={16} />
|
|
58
|
+
</Button>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Accessibility
|
|
62
|
+
|
|
63
|
+
- Always add aria-label when using size='icon' (no visible text)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Calendar — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Date picker calendar widget for selecting single dates or ranges.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Calendar } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `disabled` | `true` \| `false` | `false` |
|
|
15
|
+
|
|
16
|
+
## Common AI Mistakes
|
|
17
|
+
|
|
18
|
+
- ❌ `Using Calendar for time selection`
|
|
19
|
+
→ Combine with a separate time Input if time selection is needed
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
**Controlled date picker**
|
|
24
|
+
```tsx
|
|
25
|
+
const [date, setDate] = useState(null);
|
|
26
|
+
<Calendar value={date} onChange={setDate} />
|
|
27
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Card — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Content container with optional header, body, and footer sections.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `variant` | `"default"` \| `"elevated"` \| `"outlined"` \| `"ghost"` \| `"accent"` | `default` |
|
|
15
|
+
| `hoverable` | `true` \| `false` | `false` |
|
|
16
|
+
| `clickable` | `true` \| `false` | `false` |
|
|
17
|
+
|
|
18
|
+
## Common AI Mistakes
|
|
19
|
+
|
|
20
|
+
- ❌ `variant="primary"`
|
|
21
|
+
→ Use variant="elevated" | "outlined" | "ghost" | "accent"
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
**Elevated card with sections**
|
|
26
|
+
```tsx
|
|
27
|
+
<Card variant="elevated">
|
|
28
|
+
<CardHeader><Badge variant="teal">New</Badge></CardHeader>
|
|
29
|
+
<CardBody>
|
|
30
|
+
<h3>Card Title</h3>
|
|
31
|
+
<p>Description text.</p>
|
|
32
|
+
</CardBody>
|
|
33
|
+
<CardFooter>
|
|
34
|
+
<Button variant="ghost" size="sm">Learn more</Button>
|
|
35
|
+
</CardFooter>
|
|
36
|
+
</Card>
|
|
37
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Checkbox — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Binary toggle for boolean form values.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Checkbox } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `size` | `"sm"` \| `"md"` | `md` |
|
|
15
|
+
| `checked` | `true` \| `false` | — |
|
|
16
|
+
| `disabled` | `true` \| `false` | `false` |
|
|
17
|
+
| `indeterminate` | `true` \| `false` | `false` |
|
|
18
|
+
|
|
19
|
+
## Common AI Mistakes
|
|
20
|
+
|
|
21
|
+
- ❌ `size="lg"`
|
|
22
|
+
→ Use size="md"
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
**Labeled checkbox**
|
|
27
|
+
```tsx
|
|
28
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 'var(--vyre-spacing-2)' }}>
|
|
29
|
+
<Checkbox checked={agreed} onChange={e => setAgreed(e.target.checked)} />
|
|
30
|
+
I agree to the terms
|
|
31
|
+
</label>
|
|
32
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Command — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Command palette / search dialog. Use for search-first navigation or quick actions.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandDialog } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `Using Input type="search" for search UI`
|
|
13
|
+
→ Use Command + CommandInput + CommandList + CommandItem
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
**Basic command palette**
|
|
18
|
+
```tsx
|
|
19
|
+
<Command>
|
|
20
|
+
<CommandInput placeholder="Search..." />
|
|
21
|
+
<CommandList>
|
|
22
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
23
|
+
<CommandGroup heading="Suggestions">
|
|
24
|
+
<CommandItem onSelect={() => handleSelect('dashboard')}>Dashboard</CommandItem>
|
|
25
|
+
<CommandItem onSelect={() => handleSelect('settings')}>Settings</CommandItem>
|
|
26
|
+
</CommandGroup>
|
|
27
|
+
</CommandList>
|
|
28
|
+
</Command>
|
|
29
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DropdownMenu — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Contextual menu triggered by a button. Supports items, separators, checkbox items, radio groups, and sub-menus.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { DropdownMenu, DropdownItem, DropdownSeparator, DropdownCheckboxItem, DropdownRadioGroup, DropdownRadioItem, DropdownSub } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `DropdownItem variant="primary"`
|
|
13
|
+
→ Use variant="danger" for destructive items only
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
**Dropdown with danger item**
|
|
18
|
+
```tsx
|
|
19
|
+
<DropdownMenu trigger={<Button variant="secondary">Options</Button>}>
|
|
20
|
+
<DropdownItem onSelect={() => handleEdit()}>Edit</DropdownItem>
|
|
21
|
+
<DropdownItem onSelect={() => handleDuplicate()}>Duplicate</DropdownItem>
|
|
22
|
+
<DropdownSeparator />
|
|
23
|
+
<DropdownItem variant="danger" onSelect={() => handleDelete()}>Delete</DropdownItem>
|
|
24
|
+
</DropdownMenu>
|
|
25
|
+
```
|