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