@usevyre/ai-context 0.1.1 → 0.2.1
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/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/tokens.json +1388 -0
- package/dist/tokens.md +180 -0
- package/dist/version-info.json +233 -0
- package/dist/windsurf-rules.md +716 -40
- package/package.json +9 -3
- package/LICENSE +0 -21
package/dist/windsurf-rules.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# useVyre Rules for Windsurf
|
|
2
|
+
# Version: 0.2.0
|
|
2
3
|
|
|
3
4
|
# useVyre Design System — AI Context
|
|
4
|
-
# Version: 0.
|
|
5
|
+
# Version: 0.2.0
|
|
5
6
|
# Include this file in your AI agent's system prompt, .cursor/rules, or CLAUDE.md
|
|
6
7
|
# Source: https://usevyre.com/ai-context
|
|
7
8
|
|
|
@@ -153,35 +154,87 @@ Examples:
|
|
|
153
154
|
|
|
154
155
|
## Component API Reference
|
|
155
156
|
|
|
156
|
-
###
|
|
157
|
+
### Accordion
|
|
158
|
+
|
|
159
|
+
Vertically stacked collapsible sections. Compose with AccordionItem, AccordionTrigger, AccordionContent.
|
|
157
160
|
|
|
158
161
|
```tsx
|
|
159
|
-
import {
|
|
162
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@usevyre/react"
|
|
163
|
+
|
|
164
|
+
// Examples:
|
|
165
|
+
<Accordion>
|
|
166
|
+
<AccordionItem value="item-1">
|
|
167
|
+
<AccordionTrigger>Section Title</AccordionTrigger>
|
|
168
|
+
<AccordionContent>Content goes here.</AccordionContent>
|
|
169
|
+
</AccordionItem>
|
|
170
|
+
</Accordion>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Common mistakes:**
|
|
174
|
+
- ❌ `Accordion without AccordionItem` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### Alert
|
|
179
|
+
|
|
180
|
+
Inline feedback message for info, success, warning, or danger states.
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { Alert } from "@usevyre/react"
|
|
160
184
|
|
|
161
185
|
// Props:
|
|
162
|
-
// variant
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
// disabled = boolean
|
|
166
|
-
// as = React.ElementType (default: "button")
|
|
167
|
-
// leftIcon = ReactNode
|
|
168
|
-
// rightIcon = ReactNode
|
|
186
|
+
// variant = "info" | "success" | "warning" | "danger" (default: info)
|
|
187
|
+
// title = string
|
|
188
|
+
// onClose = function
|
|
169
189
|
|
|
170
190
|
// Examples:
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
191
|
+
<Alert variant="warning" title="Heads up" onClose={() => setOpen(false)}>
|
|
192
|
+
This action cannot be undone.
|
|
193
|
+
</Alert>
|
|
194
|
+
<Alert variant="success" title="Saved!">Your changes have been saved.</Alert>
|
|
175
195
|
```
|
|
176
196
|
|
|
197
|
+
**Common mistakes:**
|
|
198
|
+
- ❌ `variant="error"` → Use variant="danger"
|
|
199
|
+
- ❌ `variant="primary"` → Use variant="info" | "success" | "warning" | "danger"
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### Avatar
|
|
204
|
+
|
|
205
|
+
User profile image with fallback initials or icon.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
import { Avatar } from "@usevyre/react"
|
|
209
|
+
|
|
210
|
+
// Props:
|
|
211
|
+
// src = string
|
|
212
|
+
// alt = string (default: "")
|
|
213
|
+
// fallback = string
|
|
214
|
+
// size = "sm" | "md" | "lg" | "xl" (default: md)
|
|
215
|
+
// status = "online" | "offline" | "busy" | "away"
|
|
216
|
+
|
|
217
|
+
// Examples:
|
|
218
|
+
<Avatar src="/user.png" alt="Jane Doe" size="lg" status="online" />
|
|
219
|
+
<Avatar fallback="JD" size="md" />
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Common mistakes:**
|
|
223
|
+
- ❌ `size="xs"` → Use size="sm"
|
|
224
|
+
- ❌ `size="2xl"` → Use size="xl"
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
177
228
|
### Badge
|
|
178
229
|
|
|
230
|
+
Small label for status, category, or count. Use dot prop for live status indicator.
|
|
231
|
+
|
|
179
232
|
```tsx
|
|
180
233
|
import { Badge } from "@usevyre/react"
|
|
181
234
|
|
|
182
235
|
// Props:
|
|
183
|
-
// variant
|
|
184
|
-
// dot
|
|
236
|
+
// variant = "default" | "accent" | "teal" | "success" | "warning" | "danger" (default: default)
|
|
237
|
+
// dot = boolean (default: false)
|
|
185
238
|
|
|
186
239
|
// Examples:
|
|
187
240
|
<Badge variant="success" dot>Online</Badge>
|
|
@@ -189,21 +242,107 @@ import { Badge } from "@usevyre/react"
|
|
|
189
242
|
<Badge variant="danger">Error</Badge>
|
|
190
243
|
```
|
|
191
244
|
|
|
245
|
+
**Common mistakes:**
|
|
246
|
+
- ❌ `variant="primary"` → Use variant="accent" for brand color
|
|
247
|
+
- ❌ `variant="error"` → Use variant="danger"
|
|
248
|
+
- ❌ `variant="info"` → Use variant="teal" for info-like styling
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### Breadcrumb
|
|
253
|
+
|
|
254
|
+
Navigation trail showing current page location in hierarchy.
|
|
255
|
+
|
|
256
|
+
```tsx
|
|
257
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from "@usevyre/react"
|
|
258
|
+
|
|
259
|
+
// Examples:
|
|
260
|
+
<Breadcrumb>
|
|
261
|
+
<BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
|
|
262
|
+
<BreadcrumbSeparator />
|
|
263
|
+
<BreadcrumbItem><BreadcrumbLink href="/docs">Docs</BreadcrumbLink></BreadcrumbItem>
|
|
264
|
+
<BreadcrumbSeparator />
|
|
265
|
+
<BreadcrumbItem aria-current="page">Button</BreadcrumbItem>
|
|
266
|
+
</Breadcrumb>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Common mistakes:**
|
|
270
|
+
- ❌ `Using plain <a> tags inside Breadcrumb` → Use BreadcrumbItem > BreadcrumbLink for each crumb
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
### Button
|
|
275
|
+
|
|
276
|
+
Triggers actions and navigation. The most commonly used interactive element.
|
|
277
|
+
|
|
278
|
+
```tsx
|
|
279
|
+
import { Button } from "@usevyre/react"
|
|
280
|
+
|
|
281
|
+
// Props:
|
|
282
|
+
// variant = "primary" | "secondary" | "ghost" | "accent" | "teal" | "danger" (default: secondary)
|
|
283
|
+
// size = "sm" | "md" | "lg" | "icon" (default: md)
|
|
284
|
+
// loading = boolean (default: false)
|
|
285
|
+
// disabled = boolean (default: false)
|
|
286
|
+
// as = React.ElementType (default: "button")
|
|
287
|
+
// leftIcon = ReactNode
|
|
288
|
+
// rightIcon = ReactNode
|
|
289
|
+
|
|
290
|
+
// Examples:
|
|
291
|
+
<Button variant="primary">Get Started</Button>
|
|
292
|
+
<Button variant="accent" size="lg">Launch App</Button>
|
|
293
|
+
<Button variant="danger" loading>Deleting...</Button>
|
|
294
|
+
<Button as="a" href="/docs" variant="secondary">Read Docs</Button>
|
|
295
|
+
<Button variant="ghost" size="icon" aria-label="Close">
|
|
296
|
+
<X size={16} />
|
|
297
|
+
</Button>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Common mistakes:**
|
|
301
|
+
- ❌ `variant="blue"` → Use variant="accent" for brand amber, or variant="teal" for teal
|
|
302
|
+
- ❌ `size="xl"` → Use size="lg"
|
|
303
|
+
- ❌ `color="..."` → Use variant prop instead
|
|
304
|
+
- ❌ `icon={...}` → Use leftIcon={...} or rightIcon={...}
|
|
305
|
+
- ❌ `size="icon" without aria-label` → Add aria-label describing the action
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### Calendar
|
|
310
|
+
|
|
311
|
+
Date picker calendar widget for selecting single dates or ranges.
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { Calendar } from "@usevyre/react"
|
|
315
|
+
|
|
316
|
+
// Props:
|
|
317
|
+
// value = Date | null
|
|
318
|
+
// onChange = function
|
|
319
|
+
// disabled = boolean (default: false)
|
|
320
|
+
|
|
321
|
+
// Examples:
|
|
322
|
+
const [date, setDate] = useState(null);
|
|
323
|
+
<Calendar value={date} onChange={setDate} />
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Common mistakes:**
|
|
327
|
+
- ❌ `Using Calendar for time selection` → Combine with a separate time Input if time selection is needed
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
192
331
|
### Card
|
|
193
332
|
|
|
333
|
+
Content container with optional header, body, and footer sections.
|
|
334
|
+
|
|
194
335
|
```tsx
|
|
195
336
|
import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
|
|
196
337
|
|
|
197
|
-
//
|
|
198
|
-
// variant
|
|
199
|
-
// hoverable
|
|
200
|
-
// clickable
|
|
338
|
+
// Props:
|
|
339
|
+
// variant = "default" | "elevated" | "outlined" | "ghost" | "accent" (default: default)
|
|
340
|
+
// hoverable = boolean (default: false)
|
|
341
|
+
// clickable = boolean (default: false)
|
|
201
342
|
|
|
202
343
|
// Examples:
|
|
203
344
|
<Card variant="elevated">
|
|
204
|
-
<CardHeader>
|
|
205
|
-
<Badge variant="teal">New</Badge>
|
|
206
|
-
</CardHeader>
|
|
345
|
+
<CardHeader><Badge variant="teal">New</Badge></CardHeader>
|
|
207
346
|
<CardBody>
|
|
208
347
|
<h3>Card Title</h3>
|
|
209
348
|
<p>Description text.</p>
|
|
@@ -214,39 +353,576 @@ import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
|
|
|
214
353
|
</Card>
|
|
215
354
|
```
|
|
216
355
|
|
|
217
|
-
|
|
356
|
+
**Common mistakes:**
|
|
357
|
+
- ❌ `variant="primary"` → Use variant="elevated" | "outlined" | "ghost" | "accent"
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### Checkbox
|
|
362
|
+
|
|
363
|
+
Binary toggle for boolean form values.
|
|
218
364
|
|
|
219
365
|
```tsx
|
|
220
|
-
import {
|
|
366
|
+
import { Checkbox } from "@usevyre/react"
|
|
221
367
|
|
|
222
|
-
//
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
//
|
|
368
|
+
// Props:
|
|
369
|
+
// size = "sm" | "md" (default: md)
|
|
370
|
+
// checked = boolean
|
|
371
|
+
// onChange = function
|
|
372
|
+
// disabled = boolean (default: false)
|
|
373
|
+
// indeterminate = boolean (default: false)
|
|
227
374
|
|
|
228
|
-
//
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
375
|
+
// Examples:
|
|
376
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 'var(--vyre-spacing-2)' }}>
|
|
377
|
+
<Checkbox checked={agreed} onChange={e => setAgreed(e.target.checked)} />
|
|
378
|
+
I agree to the terms
|
|
379
|
+
</label>
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Common mistakes:**
|
|
383
|
+
- ❌ `size="lg"` → Use size="md"
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
### Command
|
|
388
|
+
|
|
389
|
+
Command palette / search dialog. Use for search-first navigation or quick actions.
|
|
390
|
+
|
|
391
|
+
```tsx
|
|
392
|
+
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandDialog } from "@usevyre/react"
|
|
393
|
+
|
|
394
|
+
// Examples:
|
|
395
|
+
<Command>
|
|
396
|
+
<CommandInput placeholder="Search..." />
|
|
397
|
+
<CommandList>
|
|
398
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
399
|
+
<CommandGroup heading="Suggestions">
|
|
400
|
+
<CommandItem onSelect={() => handleSelect('dashboard')}>Dashboard</CommandItem>
|
|
401
|
+
<CommandItem onSelect={() => handleSelect('settings')}>Settings</CommandItem>
|
|
402
|
+
</CommandGroup>
|
|
403
|
+
</CommandList>
|
|
404
|
+
</Command>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Common mistakes:**
|
|
408
|
+
- ❌ `Using Input type="search" for search UI` → Use Command + CommandInput + CommandList + CommandItem
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
### DropdownMenu
|
|
413
|
+
|
|
414
|
+
Contextual menu triggered by a button. Supports items, separators, checkbox items, radio groups, and sub-menus.
|
|
415
|
+
|
|
416
|
+
```tsx
|
|
417
|
+
import { DropdownMenu, DropdownItem, DropdownSeparator, DropdownCheckboxItem, DropdownRadioGroup, DropdownRadioItem, DropdownSub } from "@usevyre/react"
|
|
418
|
+
|
|
419
|
+
// Props:
|
|
420
|
+
// trigger = ReactElement
|
|
233
421
|
|
|
234
422
|
// Examples:
|
|
235
|
-
<
|
|
423
|
+
<DropdownMenu trigger={<Button variant="secondary">Options</Button>}>
|
|
424
|
+
<DropdownItem onSelect={() => handleEdit()}>Edit</DropdownItem>
|
|
425
|
+
<DropdownItem onSelect={() => handleDuplicate()}>Duplicate</DropdownItem>
|
|
426
|
+
<DropdownSeparator />
|
|
427
|
+
<DropdownItem variant="danger" onSelect={() => handleDelete()}>Delete</DropdownItem>
|
|
428
|
+
</DropdownMenu>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
**Common mistakes:**
|
|
432
|
+
- ❌ `DropdownItem variant="primary"` → Use variant="danger" for destructive items only
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
### Field
|
|
437
|
+
|
|
438
|
+
Form field wrapper providing label, hint text, and validation state for Input or Textarea.
|
|
439
|
+
|
|
440
|
+
```tsx
|
|
441
|
+
import { Field, Input, Textarea } from "@usevyre/react"
|
|
442
|
+
|
|
443
|
+
// Props:
|
|
444
|
+
// label = string
|
|
445
|
+
// hint = string
|
|
446
|
+
// state = "idle" | "error" | "success" | "warning" (default: idle)
|
|
447
|
+
// required = boolean (default: false)
|
|
448
|
+
|
|
449
|
+
// Examples:
|
|
450
|
+
<Field label="Email" state="error" hint="Invalid email format">
|
|
236
451
|
<Input type="email" placeholder="you@example.com" />
|
|
237
452
|
</Field>
|
|
238
|
-
|
|
239
453
|
<Field label="Search">
|
|
240
454
|
<Input leftElement={<SearchIcon />} placeholder="Search..." />
|
|
241
455
|
</Field>
|
|
456
|
+
```
|
|
242
457
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
458
|
+
**Common mistakes:**
|
|
459
|
+
- ❌ `Applying state prop directly to Input` → Wrap Input in <Field state="error"> to apply validation styling
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
### Input
|
|
464
|
+
|
|
465
|
+
Text input field. Wrap in Field for labels and validation. Use leftElement/rightElement for icons.
|
|
466
|
+
|
|
467
|
+
```tsx
|
|
468
|
+
import { Input } from "@usevyre/react"
|
|
469
|
+
|
|
470
|
+
// Props:
|
|
471
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
472
|
+
// leftElement = ReactNode
|
|
473
|
+
// rightElement = ReactNode
|
|
474
|
+
|
|
475
|
+
// Examples:
|
|
476
|
+
<Input type="password" rightElement={<EyeIcon />} placeholder="Password" />
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**Common mistakes:**
|
|
480
|
+
- ❌ `size="icon"` → Use size="sm" | "md" | "lg"
|
|
481
|
+
- ❌ `type="search" for search UI` → Import Command from @usevyre/react for search palettes
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
### Label
|
|
486
|
+
|
|
487
|
+
Accessible form label. Associate with input via htmlFor.
|
|
488
|
+
|
|
489
|
+
```tsx
|
|
490
|
+
import { Label } from "@usevyre/react"
|
|
491
|
+
|
|
492
|
+
// Props:
|
|
493
|
+
// htmlFor = string
|
|
494
|
+
// required = boolean (default: false)
|
|
495
|
+
|
|
496
|
+
// Examples:
|
|
497
|
+
<Label htmlFor="email">Email address</Label>
|
|
498
|
+
<Input id="email" type="email" />
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
### Modal
|
|
504
|
+
|
|
505
|
+
Dialog overlay for confirmations, forms, or focused content.
|
|
506
|
+
|
|
507
|
+
```tsx
|
|
508
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter } from "@usevyre/react"
|
|
509
|
+
|
|
510
|
+
// Props:
|
|
511
|
+
// open = boolean
|
|
512
|
+
// onClose = function
|
|
513
|
+
// size = "sm" | "md" | "lg" | "full" (default: md)
|
|
514
|
+
// title = string
|
|
515
|
+
|
|
516
|
+
// Examples:
|
|
517
|
+
<Modal open={isOpen} onClose={() => setIsOpen(false)} title="Confirm Delete" size="sm">
|
|
518
|
+
<ModalBody>Are you sure you want to delete this item?</ModalBody>
|
|
519
|
+
<ModalFooter>
|
|
520
|
+
<Button variant="ghost" onClick={() => setIsOpen(false)}>Cancel</Button>
|
|
521
|
+
<Button variant="danger" onClick={handleDelete}>Delete</Button>
|
|
522
|
+
</ModalFooter>
|
|
523
|
+
</Modal>
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
**Common mistakes:**
|
|
527
|
+
- ❌ `size="xl"` → Use size="lg" or size="full"
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
### Pagination
|
|
532
|
+
|
|
533
|
+
Page navigation for paginated lists or tables.
|
|
534
|
+
|
|
535
|
+
```tsx
|
|
536
|
+
import { Pagination } from "@usevyre/react"
|
|
537
|
+
|
|
538
|
+
// Props:
|
|
539
|
+
// page = number
|
|
540
|
+
// total = number
|
|
541
|
+
// onChange = function
|
|
542
|
+
|
|
543
|
+
// Examples:
|
|
544
|
+
<Pagination page={currentPage} total={totalPages} onChange={setCurrentPage} />
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
### Popover
|
|
550
|
+
|
|
551
|
+
Floating content panel anchored to a trigger element. For simple labels use Tooltip instead.
|
|
552
|
+
|
|
553
|
+
```tsx
|
|
554
|
+
import { Popover } from "@usevyre/react"
|
|
555
|
+
|
|
556
|
+
// Props:
|
|
557
|
+
// trigger = ReactElement
|
|
558
|
+
// placement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" (default: bottom)
|
|
559
|
+
// open = boolean
|
|
560
|
+
// onOpenChange = function
|
|
561
|
+
// closeOnOutside = boolean (default: true)
|
|
562
|
+
|
|
563
|
+
// Examples:
|
|
564
|
+
<Popover trigger={<Button variant="secondary">More info</Button>} placement="bottom-start">
|
|
565
|
+
<div style={{ padding: 'var(--vyre-spacing-4)' }}>
|
|
566
|
+
<p>Detailed information here.</p>
|
|
567
|
+
</div>
|
|
568
|
+
</Popover>
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
**Common mistakes:**
|
|
572
|
+
- ❌ `placement="top-center"` → Use placement="top" for centered placement
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
### Progress
|
|
577
|
+
|
|
578
|
+
Visual progress indicator for tasks, uploads, or completion status.
|
|
579
|
+
|
|
580
|
+
```tsx
|
|
581
|
+
import { Progress } from "@usevyre/react"
|
|
582
|
+
|
|
583
|
+
// Props:
|
|
584
|
+
// value = number
|
|
585
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
586
|
+
// variant = "default" | "accent" | "teal" | "success" | "danger" (default: default)
|
|
587
|
+
|
|
588
|
+
// Examples:
|
|
589
|
+
<Progress value={uploadPercent} variant="accent" size="sm" />
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
**Common mistakes:**
|
|
593
|
+
- ❌ `value > 100` → Normalize your value to 0–100 range before passing
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
597
|
+
### Select
|
|
598
|
+
|
|
599
|
+
Dropdown for selecting one option from a list.
|
|
600
|
+
|
|
601
|
+
```tsx
|
|
602
|
+
import { Select } from "@usevyre/react"
|
|
603
|
+
|
|
604
|
+
// Props:
|
|
605
|
+
// options = SelectOption[]
|
|
606
|
+
// value = string
|
|
607
|
+
// onChange = function
|
|
608
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
609
|
+
// placeholder = string
|
|
610
|
+
// disabled = boolean (default: false)
|
|
611
|
+
|
|
612
|
+
// Examples:
|
|
613
|
+
<Select
|
|
614
|
+
options={[{ value: 'react', label: 'React' }, { value: 'vue', label: 'Vue' }]}
|
|
615
|
+
value={framework}
|
|
616
|
+
onChange={setFramework}
|
|
617
|
+
placeholder="Choose framework"
|
|
618
|
+
/>
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
**Common mistakes:**
|
|
622
|
+
- ❌ `Passing strings directly as children` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
### Separator
|
|
627
|
+
|
|
628
|
+
Horizontal or vertical divider line.
|
|
629
|
+
|
|
630
|
+
```tsx
|
|
631
|
+
import { Separator } from "@usevyre/react"
|
|
632
|
+
|
|
633
|
+
// Props:
|
|
634
|
+
// orientation = "horizontal" | "vertical" (default: horizontal)
|
|
635
|
+
|
|
636
|
+
// Examples:
|
|
637
|
+
<Separator />
|
|
638
|
+
<Separator orientation="vertical" />
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
---
|
|
642
|
+
|
|
643
|
+
### Sheet
|
|
644
|
+
|
|
645
|
+
Side panel (drawer) that slides in from the edge. For forms, detail views, or settings.
|
|
646
|
+
|
|
647
|
+
```tsx
|
|
648
|
+
import { Sheet, SheetHeader, SheetBody, SheetFooter } from "@usevyre/react"
|
|
649
|
+
|
|
650
|
+
// Props:
|
|
651
|
+
// open = boolean
|
|
652
|
+
// onClose = function
|
|
653
|
+
// size = "sm" | "md" | "lg" | "full" (default: md)
|
|
654
|
+
// side = "left" | "right" (default: right)
|
|
655
|
+
// title = string
|
|
656
|
+
|
|
657
|
+
// Examples:
|
|
658
|
+
<Sheet open={isOpen} onClose={() => setIsOpen(false)} title="Settings" side="right">
|
|
659
|
+
<SheetBody>Settings content here.</SheetBody>
|
|
660
|
+
<SheetFooter>
|
|
661
|
+
<Button variant="accent">Save</Button>
|
|
662
|
+
</SheetFooter>
|
|
663
|
+
</Sheet>
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
---
|
|
667
|
+
|
|
668
|
+
### Sidebar
|
|
669
|
+
|
|
670
|
+
App navigation sidebar. Use AppLayout as the root layout wrapper.
|
|
671
|
+
|
|
672
|
+
```tsx
|
|
673
|
+
import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, SidebarItem, SidebarFooter } from "@usevyre/react"
|
|
674
|
+
|
|
675
|
+
// Props:
|
|
676
|
+
// variant = "default" | "floating" (default: default)
|
|
677
|
+
|
|
678
|
+
// Examples:
|
|
679
|
+
<AppLayout>
|
|
680
|
+
<Sidebar>
|
|
681
|
+
<SidebarHeader>Logo</SidebarHeader>
|
|
682
|
+
<SidebarContent>
|
|
683
|
+
<SidebarSection heading="Main">
|
|
684
|
+
<SidebarItem href="/" active>Dashboard</SidebarItem>
|
|
685
|
+
<SidebarItem href="/settings">Settings</SidebarItem>
|
|
686
|
+
</SidebarSection>
|
|
687
|
+
</SidebarContent>
|
|
688
|
+
<SidebarFooter><Avatar fallback="JD" size="sm" /></SidebarFooter>
|
|
689
|
+
</Sidebar>
|
|
690
|
+
<main>Page content</main>
|
|
691
|
+
</AppLayout>
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
---
|
|
695
|
+
|
|
696
|
+
### Skeleton
|
|
697
|
+
|
|
698
|
+
Loading placeholder that mimics the shape of content while data loads.
|
|
699
|
+
|
|
700
|
+
```tsx
|
|
701
|
+
import { Skeleton } from "@usevyre/react"
|
|
702
|
+
|
|
703
|
+
// Props:
|
|
704
|
+
// variant = "rect" | "circle" | "text" (default: rect)
|
|
705
|
+
// width = string | number
|
|
706
|
+
// height = string | number
|
|
707
|
+
|
|
708
|
+
// Examples:
|
|
709
|
+
<Skeleton variant="circle" width={40} height={40} />
|
|
710
|
+
<Skeleton variant="text" width="100%" />
|
|
711
|
+
<Skeleton variant="text" width="60%" />
|
|
246
712
|
```
|
|
247
713
|
|
|
248
714
|
---
|
|
249
715
|
|
|
716
|
+
### Slider
|
|
717
|
+
|
|
718
|
+
Range input for selecting a numeric value within a range.
|
|
719
|
+
|
|
720
|
+
```tsx
|
|
721
|
+
import { Slider } from "@usevyre/react"
|
|
722
|
+
|
|
723
|
+
// Props:
|
|
724
|
+
// value = number
|
|
725
|
+
// onChange = function
|
|
726
|
+
// min = number (default: 0)
|
|
727
|
+
// max = number (default: 100)
|
|
728
|
+
// step = number (default: 1)
|
|
729
|
+
// size = "sm" | "md" (default: md)
|
|
730
|
+
// disabled = boolean (default: false)
|
|
731
|
+
|
|
732
|
+
// Examples:
|
|
733
|
+
<Slider value={volume} onChange={setVolume} min={0} max={100} step={5} />
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
### Switch
|
|
739
|
+
|
|
740
|
+
Toggle switch for boolean on/off settings.
|
|
741
|
+
|
|
742
|
+
```tsx
|
|
743
|
+
import { Switch } from "@usevyre/react"
|
|
744
|
+
|
|
745
|
+
// Props:
|
|
746
|
+
// checked = boolean
|
|
747
|
+
// onChange = function
|
|
748
|
+
// size = "sm" | "md" (default: md)
|
|
749
|
+
// disabled = boolean (default: false)
|
|
750
|
+
|
|
751
|
+
// Examples:
|
|
752
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 'var(--vyre-spacing-2)' }}>
|
|
753
|
+
<Switch checked={notifications} onChange={setNotifications} />
|
|
754
|
+
Enable notifications
|
|
755
|
+
</label>
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
### Table
|
|
761
|
+
|
|
762
|
+
Data table with optional sorting. Compose with TableHeader, TableRow, TableCell.
|
|
763
|
+
|
|
764
|
+
```tsx
|
|
765
|
+
import { Table, TableHead, TableBody, TableRow, TableHeader, TableCell } from "@usevyre/react"
|
|
766
|
+
|
|
767
|
+
// Examples:
|
|
768
|
+
<Table>
|
|
769
|
+
<TableHead>
|
|
770
|
+
<TableRow>
|
|
771
|
+
<TableHeader>Name</TableHeader>
|
|
772
|
+
<TableHeader>Status</TableHeader>
|
|
773
|
+
</TableRow>
|
|
774
|
+
</TableHead>
|
|
775
|
+
<TableBody>
|
|
776
|
+
<TableRow>
|
|
777
|
+
<TableCell>Alice</TableCell>
|
|
778
|
+
<TableCell><Badge variant="success">Active</Badge></TableCell>
|
|
779
|
+
</TableRow>
|
|
780
|
+
</TableBody>
|
|
781
|
+
</Table>
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
### Tabs
|
|
787
|
+
|
|
788
|
+
Tabbed navigation for switching between content panels.
|
|
789
|
+
|
|
790
|
+
```tsx
|
|
791
|
+
import { Tabs, TabList, Tab, TabPanels, TabPanel } from "@usevyre/react"
|
|
792
|
+
|
|
793
|
+
// Props:
|
|
794
|
+
// defaultIndex = number (default: 0)
|
|
795
|
+
// index = number
|
|
796
|
+
// onChange = function
|
|
797
|
+
|
|
798
|
+
// Examples:
|
|
799
|
+
<Tabs defaultIndex={0}>
|
|
800
|
+
<TabList>
|
|
801
|
+
<Tab>Overview</Tab>
|
|
802
|
+
<Tab>Settings</Tab>
|
|
803
|
+
</TabList>
|
|
804
|
+
<TabPanels>
|
|
805
|
+
<TabPanel>Overview content</TabPanel>
|
|
806
|
+
<TabPanel>Settings content</TabPanel>
|
|
807
|
+
</TabPanels>
|
|
808
|
+
</Tabs>
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
---
|
|
812
|
+
|
|
813
|
+
### Toast
|
|
814
|
+
|
|
815
|
+
Transient notification. Use the useToast hook to trigger toasts imperatively.
|
|
816
|
+
|
|
817
|
+
```tsx
|
|
818
|
+
import { useToast, ToastProvider } from "@usevyre/react"
|
|
819
|
+
|
|
820
|
+
// Props:
|
|
821
|
+
// variant = "default" | "success" | "warning" | "danger" (default: default)
|
|
822
|
+
// title = string
|
|
823
|
+
// description = string
|
|
824
|
+
// duration = number (default: 4000)
|
|
825
|
+
|
|
826
|
+
// Examples:
|
|
827
|
+
const { toast } = useToast();
|
|
828
|
+
|
|
829
|
+
<Button onClick={() => toast({ title: 'Saved!', variant: 'success', duration: 3000 })}>
|
|
830
|
+
Save
|
|
831
|
+
</Button>
|
|
832
|
+
<ToastProvider>
|
|
833
|
+
<App />
|
|
834
|
+
</ToastProvider>
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
**Common mistakes:**
|
|
838
|
+
- ❌ `Rendering <Toast> directly in JSX` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
839
|
+
- ❌ `variant="error"` → Use variant="danger"
|
|
840
|
+
- ❌ `variant="info"` → Use variant="default"
|
|
841
|
+
|
|
842
|
+
---
|
|
843
|
+
|
|
844
|
+
### Tooltip
|
|
845
|
+
|
|
846
|
+
Short label that appears on hover/focus. For rich content use Popover instead.
|
|
847
|
+
|
|
848
|
+
```tsx
|
|
849
|
+
import { Tooltip } from "@usevyre/react"
|
|
850
|
+
|
|
851
|
+
// Props:
|
|
852
|
+
// content = string | ReactNode
|
|
853
|
+
// placement = "top" | "bottom" | "left" | "right" (default: top)
|
|
854
|
+
// delay = number (default: 300)
|
|
855
|
+
|
|
856
|
+
// Examples:
|
|
857
|
+
<Tooltip content="Close dialog" placement="bottom">
|
|
858
|
+
<Button variant="ghost" size="icon" aria-label="Close">
|
|
859
|
+
<X size={16} />
|
|
860
|
+
</Button>
|
|
861
|
+
</Tooltip>
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
**Common mistakes:**
|
|
865
|
+
- ❌ `Using Tooltip for rich content (forms, buttons, etc.)` → Use Popover for rich interactive content
|
|
866
|
+
|
|
867
|
+
---
|
|
868
|
+
|
|
869
|
+
### Typography
|
|
870
|
+
|
|
871
|
+
Text rendering components with semantic scale. Includes Text, Heading, Lead, Code, Blockquote.
|
|
872
|
+
|
|
873
|
+
```tsx
|
|
874
|
+
import { Text, Heading, Lead, Code, Blockquote } from "@usevyre/react"
|
|
875
|
+
|
|
876
|
+
// Examples:
|
|
877
|
+
<Heading size="2xl" as="h1">Dashboard</Heading>
|
|
878
|
+
<Lead>Welcome back. Here's what's happening today.</Lead>
|
|
879
|
+
<Text size="sm" style={{ color: 'var(--vyre-color-semantic-text-muted)' }}>Last updated 5 minutes ago.</Text>
|
|
880
|
+
```
|
|
881
|
+
|
|
882
|
+
**Common mistakes:**
|
|
883
|
+
- ❌ `Using raw <h1>, <p> tags instead of Typography components` → Use <Heading>, <Text>, <Lead> from @usevyre/react
|
|
884
|
+
|
|
885
|
+
---
|
|
886
|
+
|
|
887
|
+
## Hallucination Guard — Common AI Mistakes
|
|
888
|
+
|
|
889
|
+
The following prop values and patterns do NOT exist in useVyre.
|
|
890
|
+
If you generate these, you are hallucinating.
|
|
891
|
+
|
|
892
|
+
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
893
|
+
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
894
|
+
- ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
|
|
895
|
+
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
896
|
+
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
897
|
+
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
|
898
|
+
- ❌ `<Badge variant="error">` → Use variant="danger"
|
|
899
|
+
- ❌ `<Badge variant="info">` → Use variant="teal" for info-like styling
|
|
900
|
+
- ❌ `<Breadcrumb Using plain <a> tags inside Breadcrumb>` → Use BreadcrumbItem > BreadcrumbLink for each crumb
|
|
901
|
+
- ❌ `<Button variant="blue">` → Use variant="accent" for brand amber, or variant="teal" for teal
|
|
902
|
+
- ❌ `<Button size="xl">` → Use size="lg"
|
|
903
|
+
- ❌ `<Button color="...">` → Use variant prop instead
|
|
904
|
+
- ❌ `<Button icon={...}>` → Use leftIcon={...} or rightIcon={...}
|
|
905
|
+
- ❌ `<Button size="icon" without aria-label>` → Add aria-label describing the action
|
|
906
|
+
- ❌ `<Calendar Using Calendar for time selection>` → Combine with a separate time Input if time selection is needed
|
|
907
|
+
- ❌ `<Card variant="primary">` → Use variant="elevated" | "outlined" | "ghost" | "accent"
|
|
908
|
+
- ❌ `<Checkbox size="lg">` → Use size="md"
|
|
909
|
+
- ❌ `<Command Using Input type="search" for search UI>` → Use Command + CommandInput + CommandList + CommandItem
|
|
910
|
+
- ❌ `<DropdownMenu DropdownItem variant="primary">` → Use variant="danger" for destructive items only
|
|
911
|
+
- ❌ `<Field Applying state prop directly to Input>` → Wrap Input in <Field state="error"> to apply validation styling
|
|
912
|
+
- ❌ `<Input size="icon">` → Use size="sm" | "md" | "lg"
|
|
913
|
+
- ❌ `<Input type="search" for search UI>` → Import Command from @usevyre/react for search palettes
|
|
914
|
+
- ❌ `<Modal size="xl">` → Use size="lg" or size="full"
|
|
915
|
+
- ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
|
|
916
|
+
- ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
|
|
917
|
+
- ❌ `<Select Passing strings directly as children>` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
918
|
+
- ❌ `<Toast Rendering <Toast> directly in JSX>` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
919
|
+
- ❌ `<Toast variant="error">` → Use variant="danger"
|
|
920
|
+
- ❌ `<Toast variant="info">` → Use variant="default"
|
|
921
|
+
- ❌ `<Tooltip Using Tooltip for rich content (forms, buttons, etc.)>` → Use Popover for rich interactive content
|
|
922
|
+
- ❌ `<Typography Using raw <h1>, <p> tags instead of Typography components>` → Use <Heading>, <Text>, <Lead> from @usevyre/react
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
250
926
|
## Styling Rules for AI Agents
|
|
251
927
|
|
|
252
928
|
1. ALWAYS use semantic tokens (`--vyre-color-semantic-*`), never primitive tokens
|