@usevyre/ai-context 1.2.1 → 1.2.2
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 +21 -0
- package/dist/cheat-sheets/alertdialog.md +41 -0
- package/dist/cheat-sheets/index.md +1 -0
- package/dist/claude-context.md +42 -0
- package/dist/copilot-instructions.md +42 -0
- package/dist/cursor-rules.md +12 -0
- package/dist/full-context.md +42 -0
- package/dist/index.js +283 -1
- package/dist/schema.json +73 -0
- package/dist/tokens.json +1 -1
- package/dist/version-info.json +8 -1
- package/dist/windsurf-rules.md +42 -0
- package/package.json +1 -1
package/dist/anti-patterns.json
CHANGED
|
@@ -22,6 +22,27 @@
|
|
|
22
22
|
"fix": "Use variant=\"info\" | \"success\" | \"warning\" | \"danger\"",
|
|
23
23
|
"severity": "error"
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
"component": "AlertDialog",
|
|
27
|
+
"pattern": "AlertDialog without open/onOpenChange (React) or v-model (Vue)",
|
|
28
|
+
"reason": "It is controlled; it never shows/closes without state",
|
|
29
|
+
"fix": "Drive open from state; close in onOpenChange / via v-model",
|
|
30
|
+
"severity": "error"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"component": "AlertDialog",
|
|
34
|
+
"pattern": "Using Alert (inline banner) for a confirm/cancel decision",
|
|
35
|
+
"reason": "Alert is non-blocking inline feedback, has no confirm flow",
|
|
36
|
+
"fix": "Use AlertDialog for blocking confirmation; Alert for passive messages",
|
|
37
|
+
"severity": "error"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"component": "AlertDialog",
|
|
41
|
+
"pattern": "variant=\"success\" or \"error\"",
|
|
42
|
+
"reason": "AlertDialog variant is \"danger\" | \"warning\" | \"info\" only",
|
|
43
|
+
"fix": "Use \"danger\" for destructive, \"warning\" to caution, \"info\" otherwise",
|
|
44
|
+
"severity": "error"
|
|
45
|
+
},
|
|
25
46
|
{
|
|
26
47
|
"component": "Avatar",
|
|
27
48
|
"pattern": "size=\"xs\"",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# AlertDialog — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { AlertDialog } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `variant` | `"danger"` \| `"warning"` \| `"info"` | `info` |
|
|
15
|
+
| `open` | `true` \| `false` | — |
|
|
16
|
+
|
|
17
|
+
## Common AI Mistakes
|
|
18
|
+
|
|
19
|
+
- ❌ `AlertDialog without open/onOpenChange (React) or v-model (Vue)`
|
|
20
|
+
→ Drive open from state; close in onOpenChange / via v-model
|
|
21
|
+
- ❌ `Using Alert (inline banner) for a confirm/cancel decision`
|
|
22
|
+
→ Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
23
|
+
- ❌ `variant="success" or "error"`
|
|
24
|
+
→ Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
**Destructive confirmation**
|
|
29
|
+
```tsx
|
|
30
|
+
const [open, setOpen] = useState(false);
|
|
31
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
32
|
+
<AlertDialog
|
|
33
|
+
open={open}
|
|
34
|
+
onOpenChange={setOpen}
|
|
35
|
+
variant="danger"
|
|
36
|
+
title="Delete project?"
|
|
37
|
+
description="This cannot be undone."
|
|
38
|
+
confirmLabel="Delete"
|
|
39
|
+
onConfirm={() => deleteProject()}
|
|
40
|
+
/>
|
|
41
|
+
```
|
|
@@ -4,6 +4,7 @@ Quick reference for AI agents — one file per component.
|
|
|
4
4
|
|
|
5
5
|
- [Accordion](accordion.md) — Vertically stacked collapsible sections. Compose with AccordionItem, AccordionTrigger, AccordionContent.
|
|
6
6
|
- [Alert](alert.md) — Inline feedback message for info, success, warning, or danger states.
|
|
7
|
+
- [AlertDialog](alertdialog.md) — Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
7
8
|
- [Avatar](avatar.md) — User profile image with fallback initials or icon.
|
|
8
9
|
- [Badge](badge.md) — Small label for status, category, or count. Use dot prop for live status indicator.
|
|
9
10
|
- [Breadcrumb](breadcrumb.md) — Navigation trail showing current page location in hierarchy.
|
package/dist/claude-context.md
CHANGED
|
@@ -203,6 +203,45 @@ import { Alert } from "@usevyre/react"
|
|
|
203
203
|
|
|
204
204
|
---
|
|
205
205
|
|
|
206
|
+
### AlertDialog
|
|
207
|
+
|
|
208
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import { AlertDialog } from "@usevyre/react"
|
|
212
|
+
|
|
213
|
+
// Props:
|
|
214
|
+
// open = boolean
|
|
215
|
+
// onOpenChange = function
|
|
216
|
+
// title = string
|
|
217
|
+
// description = string
|
|
218
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
219
|
+
// confirmLabel = string (default: Confirm)
|
|
220
|
+
// cancelLabel = string (default: Cancel)
|
|
221
|
+
// onConfirm = function
|
|
222
|
+
// onCancel = function
|
|
223
|
+
|
|
224
|
+
// Examples:
|
|
225
|
+
const [open, setOpen] = useState(false);
|
|
226
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
227
|
+
<AlertDialog
|
|
228
|
+
open={open}
|
|
229
|
+
onOpenChange={setOpen}
|
|
230
|
+
variant="danger"
|
|
231
|
+
title="Delete project?"
|
|
232
|
+
description="This cannot be undone."
|
|
233
|
+
confirmLabel="Delete"
|
|
234
|
+
onConfirm={() => deleteProject()}
|
|
235
|
+
/>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Common mistakes:**
|
|
239
|
+
- ❌ `AlertDialog without open/onOpenChange (React) or v-model (Vue)` → Drive open from state; close in onOpenChange / via v-model
|
|
240
|
+
- ❌ `Using Alert (inline banner) for a confirm/cancel decision` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
241
|
+
- ❌ `variant="success" or "error"` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
206
245
|
### Avatar
|
|
207
246
|
|
|
208
247
|
User profile image with fallback initials or icon.
|
|
@@ -1383,6 +1422,9 @@ If you generate these, you are hallucinating.
|
|
|
1383
1422
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1384
1423
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1385
1424
|
- ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
|
|
1425
|
+
- ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
|
|
1426
|
+
- ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
1427
|
+
- ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
1386
1428
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1387
1429
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1388
1430
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
|
@@ -202,6 +202,45 @@ import { Alert } from "@usevyre/react"
|
|
|
202
202
|
|
|
203
203
|
---
|
|
204
204
|
|
|
205
|
+
### AlertDialog
|
|
206
|
+
|
|
207
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { AlertDialog } from "@usevyre/react"
|
|
211
|
+
|
|
212
|
+
// Props:
|
|
213
|
+
// open = boolean
|
|
214
|
+
// onOpenChange = function
|
|
215
|
+
// title = string
|
|
216
|
+
// description = string
|
|
217
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
218
|
+
// confirmLabel = string (default: Confirm)
|
|
219
|
+
// cancelLabel = string (default: Cancel)
|
|
220
|
+
// onConfirm = function
|
|
221
|
+
// onCancel = function
|
|
222
|
+
|
|
223
|
+
// Examples:
|
|
224
|
+
const [open, setOpen] = useState(false);
|
|
225
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
226
|
+
<AlertDialog
|
|
227
|
+
open={open}
|
|
228
|
+
onOpenChange={setOpen}
|
|
229
|
+
variant="danger"
|
|
230
|
+
title="Delete project?"
|
|
231
|
+
description="This cannot be undone."
|
|
232
|
+
confirmLabel="Delete"
|
|
233
|
+
onConfirm={() => deleteProject()}
|
|
234
|
+
/>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Common mistakes:**
|
|
238
|
+
- ❌ `AlertDialog without open/onOpenChange (React) or v-model (Vue)` → Drive open from state; close in onOpenChange / via v-model
|
|
239
|
+
- ❌ `Using Alert (inline banner) for a confirm/cancel decision` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
240
|
+
- ❌ `variant="success" or "error"` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
205
244
|
### Avatar
|
|
206
245
|
|
|
207
246
|
User profile image with fallback initials or icon.
|
|
@@ -1382,6 +1421,9 @@ If you generate these, you are hallucinating.
|
|
|
1382
1421
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1383
1422
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1384
1423
|
- ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
|
|
1424
|
+
- ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
|
|
1425
|
+
- ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
1426
|
+
- ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
1385
1427
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1386
1428
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1387
1429
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
package/dist/cursor-rules.md
CHANGED
|
@@ -36,6 +36,18 @@ Never do:
|
|
|
36
36
|
- ❌ variant="error" → ✅ Use variant="danger"
|
|
37
37
|
- ❌ variant="primary" → ✅ Use variant="info" | "success" | "warning" | "danger"
|
|
38
38
|
|
|
39
|
+
## AlertDialog
|
|
40
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
41
|
+
Import: `import { AlertDialog } from "@usevyre/react"`
|
|
42
|
+
|
|
43
|
+
Valid props:
|
|
44
|
+
- variant: "danger" | "warning" | "info" [default: info]
|
|
45
|
+
|
|
46
|
+
Never do:
|
|
47
|
+
- ❌ AlertDialog without open/onOpenChange (React) or v-model (Vue) → ✅ Drive open from state; close in onOpenChange / via v-model
|
|
48
|
+
- ❌ Using Alert (inline banner) for a confirm/cancel decision → ✅ Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
49
|
+
- ❌ variant="success" or "error" → ✅ Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
50
|
+
|
|
39
51
|
## Avatar
|
|
40
52
|
User profile image with fallback initials or icon.
|
|
41
53
|
Import: `import { Avatar } from "@usevyre/react"`
|
package/dist/full-context.md
CHANGED
|
@@ -197,6 +197,45 @@ import { Alert } from "@usevyre/react"
|
|
|
197
197
|
|
|
198
198
|
---
|
|
199
199
|
|
|
200
|
+
### AlertDialog
|
|
201
|
+
|
|
202
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
import { AlertDialog } from "@usevyre/react"
|
|
206
|
+
|
|
207
|
+
// Props:
|
|
208
|
+
// open = boolean
|
|
209
|
+
// onOpenChange = function
|
|
210
|
+
// title = string
|
|
211
|
+
// description = string
|
|
212
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
213
|
+
// confirmLabel = string (default: Confirm)
|
|
214
|
+
// cancelLabel = string (default: Cancel)
|
|
215
|
+
// onConfirm = function
|
|
216
|
+
// onCancel = function
|
|
217
|
+
|
|
218
|
+
// Examples:
|
|
219
|
+
const [open, setOpen] = useState(false);
|
|
220
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
221
|
+
<AlertDialog
|
|
222
|
+
open={open}
|
|
223
|
+
onOpenChange={setOpen}
|
|
224
|
+
variant="danger"
|
|
225
|
+
title="Delete project?"
|
|
226
|
+
description="This cannot be undone."
|
|
227
|
+
confirmLabel="Delete"
|
|
228
|
+
onConfirm={() => deleteProject()}
|
|
229
|
+
/>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Common mistakes:**
|
|
233
|
+
- ❌ `AlertDialog without open/onOpenChange (React) or v-model (Vue)` → Drive open from state; close in onOpenChange / via v-model
|
|
234
|
+
- ❌ `Using Alert (inline banner) for a confirm/cancel decision` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
235
|
+
- ❌ `variant="success" or "error"` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
200
239
|
### Avatar
|
|
201
240
|
|
|
202
241
|
User profile image with fallback initials or icon.
|
|
@@ -1377,6 +1416,9 @@ If you generate these, you are hallucinating.
|
|
|
1377
1416
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1378
1417
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1379
1418
|
- ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
|
|
1419
|
+
- ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
|
|
1420
|
+
- ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
1421
|
+
- ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
1380
1422
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1381
1423
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1382
1424
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
package/dist/index.js
CHANGED
|
@@ -202,6 +202,45 @@ import { Alert } from "@usevyre/react"
|
|
|
202
202
|
|
|
203
203
|
---
|
|
204
204
|
|
|
205
|
+
### AlertDialog
|
|
206
|
+
|
|
207
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
208
|
+
|
|
209
|
+
\`\`\`tsx
|
|
210
|
+
import { AlertDialog } from "@usevyre/react"
|
|
211
|
+
|
|
212
|
+
// Props:
|
|
213
|
+
// open = boolean
|
|
214
|
+
// onOpenChange = function
|
|
215
|
+
// title = string
|
|
216
|
+
// description = string
|
|
217
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
218
|
+
// confirmLabel = string (default: Confirm)
|
|
219
|
+
// cancelLabel = string (default: Cancel)
|
|
220
|
+
// onConfirm = function
|
|
221
|
+
// onCancel = function
|
|
222
|
+
|
|
223
|
+
// Examples:
|
|
224
|
+
const [open, setOpen] = useState(false);
|
|
225
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
226
|
+
<AlertDialog
|
|
227
|
+
open={open}
|
|
228
|
+
onOpenChange={setOpen}
|
|
229
|
+
variant="danger"
|
|
230
|
+
title="Delete project?"
|
|
231
|
+
description="This cannot be undone."
|
|
232
|
+
confirmLabel="Delete"
|
|
233
|
+
onConfirm={() => deleteProject()}
|
|
234
|
+
/>
|
|
235
|
+
\`\`\`
|
|
236
|
+
|
|
237
|
+
**Common mistakes:**
|
|
238
|
+
- ❌ \`AlertDialog without open/onOpenChange (React) or v-model (Vue)\` → Drive open from state; close in onOpenChange / via v-model
|
|
239
|
+
- ❌ \`Using Alert (inline banner) for a confirm/cancel decision\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
240
|
+
- ❌ \`variant="success" or "error"\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
205
244
|
### Avatar
|
|
206
245
|
|
|
207
246
|
User profile image with fallback initials or icon.
|
|
@@ -1382,6 +1421,9 @@ If you generate these, you are hallucinating.
|
|
|
1382
1421
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1383
1422
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
1384
1423
|
- ❌ \`<Alert variant="primary">\` → Use variant="info" | "success" | "warning" | "danger"
|
|
1424
|
+
- ❌ \`<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>\` → Drive open from state; close in onOpenChange / via v-model
|
|
1425
|
+
- ❌ \`<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
1426
|
+
- ❌ \`<AlertDialog variant="success" or "error">\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
1385
1427
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
1386
1428
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
1387
1429
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -1537,6 +1579,18 @@ Never do:
|
|
|
1537
1579
|
- ❌ variant="error" → ✅ Use variant="danger"
|
|
1538
1580
|
- ❌ variant="primary" → ✅ Use variant="info" | "success" | "warning" | "danger"
|
|
1539
1581
|
|
|
1582
|
+
## AlertDialog
|
|
1583
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
1584
|
+
Import: \`import { AlertDialog } from "@usevyre/react"\`
|
|
1585
|
+
|
|
1586
|
+
Valid props:
|
|
1587
|
+
- variant: "danger" | "warning" | "info" [default: info]
|
|
1588
|
+
|
|
1589
|
+
Never do:
|
|
1590
|
+
- ❌ AlertDialog without open/onOpenChange (React) or v-model (Vue) → ✅ Drive open from state; close in onOpenChange / via v-model
|
|
1591
|
+
- ❌ Using Alert (inline banner) for a confirm/cancel decision → ✅ Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
1592
|
+
- ❌ variant="success" or "error" → ✅ Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
1593
|
+
|
|
1540
1594
|
## Avatar
|
|
1541
1595
|
User profile image with fallback initials or icon.
|
|
1542
1596
|
Import: \`import { Avatar } from "@usevyre/react"\`
|
|
@@ -2157,6 +2211,45 @@ import { Alert } from "@usevyre/react"
|
|
|
2157
2211
|
|
|
2158
2212
|
---
|
|
2159
2213
|
|
|
2214
|
+
### AlertDialog
|
|
2215
|
+
|
|
2216
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
2217
|
+
|
|
2218
|
+
\`\`\`tsx
|
|
2219
|
+
import { AlertDialog } from "@usevyre/react"
|
|
2220
|
+
|
|
2221
|
+
// Props:
|
|
2222
|
+
// open = boolean
|
|
2223
|
+
// onOpenChange = function
|
|
2224
|
+
// title = string
|
|
2225
|
+
// description = string
|
|
2226
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
2227
|
+
// confirmLabel = string (default: Confirm)
|
|
2228
|
+
// cancelLabel = string (default: Cancel)
|
|
2229
|
+
// onConfirm = function
|
|
2230
|
+
// onCancel = function
|
|
2231
|
+
|
|
2232
|
+
// Examples:
|
|
2233
|
+
const [open, setOpen] = useState(false);
|
|
2234
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
2235
|
+
<AlertDialog
|
|
2236
|
+
open={open}
|
|
2237
|
+
onOpenChange={setOpen}
|
|
2238
|
+
variant="danger"
|
|
2239
|
+
title="Delete project?"
|
|
2240
|
+
description="This cannot be undone."
|
|
2241
|
+
confirmLabel="Delete"
|
|
2242
|
+
onConfirm={() => deleteProject()}
|
|
2243
|
+
/>
|
|
2244
|
+
\`\`\`
|
|
2245
|
+
|
|
2246
|
+
**Common mistakes:**
|
|
2247
|
+
- ❌ \`AlertDialog without open/onOpenChange (React) or v-model (Vue)\` → Drive open from state; close in onOpenChange / via v-model
|
|
2248
|
+
- ❌ \`Using Alert (inline banner) for a confirm/cancel decision\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
2249
|
+
- ❌ \`variant="success" or "error"\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
2250
|
+
|
|
2251
|
+
---
|
|
2252
|
+
|
|
2160
2253
|
### Avatar
|
|
2161
2254
|
|
|
2162
2255
|
User profile image with fallback initials or icon.
|
|
@@ -3337,6 +3430,9 @@ If you generate these, you are hallucinating.
|
|
|
3337
3430
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
3338
3431
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
3339
3432
|
- ❌ \`<Alert variant="primary">\` → Use variant="info" | "success" | "warning" | "danger"
|
|
3433
|
+
- ❌ \`<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>\` → Drive open from state; close in onOpenChange / via v-model
|
|
3434
|
+
- ❌ \`<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
3435
|
+
- ❌ \`<AlertDialog variant="success" or "error">\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
3340
3436
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
3341
3437
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
3342
3438
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -3656,6 +3752,45 @@ import { Alert } from "@usevyre/react"
|
|
|
3656
3752
|
|
|
3657
3753
|
---
|
|
3658
3754
|
|
|
3755
|
+
### AlertDialog
|
|
3756
|
+
|
|
3757
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
3758
|
+
|
|
3759
|
+
\`\`\`tsx
|
|
3760
|
+
import { AlertDialog } from "@usevyre/react"
|
|
3761
|
+
|
|
3762
|
+
// Props:
|
|
3763
|
+
// open = boolean
|
|
3764
|
+
// onOpenChange = function
|
|
3765
|
+
// title = string
|
|
3766
|
+
// description = string
|
|
3767
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
3768
|
+
// confirmLabel = string (default: Confirm)
|
|
3769
|
+
// cancelLabel = string (default: Cancel)
|
|
3770
|
+
// onConfirm = function
|
|
3771
|
+
// onCancel = function
|
|
3772
|
+
|
|
3773
|
+
// Examples:
|
|
3774
|
+
const [open, setOpen] = useState(false);
|
|
3775
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
3776
|
+
<AlertDialog
|
|
3777
|
+
open={open}
|
|
3778
|
+
onOpenChange={setOpen}
|
|
3779
|
+
variant="danger"
|
|
3780
|
+
title="Delete project?"
|
|
3781
|
+
description="This cannot be undone."
|
|
3782
|
+
confirmLabel="Delete"
|
|
3783
|
+
onConfirm={() => deleteProject()}
|
|
3784
|
+
/>
|
|
3785
|
+
\`\`\`
|
|
3786
|
+
|
|
3787
|
+
**Common mistakes:**
|
|
3788
|
+
- ❌ \`AlertDialog without open/onOpenChange (React) or v-model (Vue)\` → Drive open from state; close in onOpenChange / via v-model
|
|
3789
|
+
- ❌ \`Using Alert (inline banner) for a confirm/cancel decision\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
3790
|
+
- ❌ \`variant="success" or "error"\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
3791
|
+
|
|
3792
|
+
---
|
|
3793
|
+
|
|
3659
3794
|
### Avatar
|
|
3660
3795
|
|
|
3661
3796
|
User profile image with fallback initials or icon.
|
|
@@ -4836,6 +4971,9 @@ If you generate these, you are hallucinating.
|
|
|
4836
4971
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
4837
4972
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
4838
4973
|
- ❌ \`<Alert variant="primary">\` → Use variant="info" | "success" | "warning" | "danger"
|
|
4974
|
+
- ❌ \`<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>\` → Drive open from state; close in onOpenChange / via v-model
|
|
4975
|
+
- ❌ \`<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
4976
|
+
- ❌ \`<AlertDialog variant="success" or "error">\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
4839
4977
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
4840
4978
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
4841
4979
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -5157,6 +5295,45 @@ import { Alert } from "@usevyre/react"
|
|
|
5157
5295
|
|
|
5158
5296
|
---
|
|
5159
5297
|
|
|
5298
|
+
### AlertDialog
|
|
5299
|
+
|
|
5300
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
5301
|
+
|
|
5302
|
+
\`\`\`tsx
|
|
5303
|
+
import { AlertDialog } from "@usevyre/react"
|
|
5304
|
+
|
|
5305
|
+
// Props:
|
|
5306
|
+
// open = boolean
|
|
5307
|
+
// onOpenChange = function
|
|
5308
|
+
// title = string
|
|
5309
|
+
// description = string
|
|
5310
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
5311
|
+
// confirmLabel = string (default: Confirm)
|
|
5312
|
+
// cancelLabel = string (default: Cancel)
|
|
5313
|
+
// onConfirm = function
|
|
5314
|
+
// onCancel = function
|
|
5315
|
+
|
|
5316
|
+
// Examples:
|
|
5317
|
+
const [open, setOpen] = useState(false);
|
|
5318
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
5319
|
+
<AlertDialog
|
|
5320
|
+
open={open}
|
|
5321
|
+
onOpenChange={setOpen}
|
|
5322
|
+
variant="danger"
|
|
5323
|
+
title="Delete project?"
|
|
5324
|
+
description="This cannot be undone."
|
|
5325
|
+
confirmLabel="Delete"
|
|
5326
|
+
onConfirm={() => deleteProject()}
|
|
5327
|
+
/>
|
|
5328
|
+
\`\`\`
|
|
5329
|
+
|
|
5330
|
+
**Common mistakes:**
|
|
5331
|
+
- ❌ \`AlertDialog without open/onOpenChange (React) or v-model (Vue)\` → Drive open from state; close in onOpenChange / via v-model
|
|
5332
|
+
- ❌ \`Using Alert (inline banner) for a confirm/cancel decision\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
5333
|
+
- ❌ \`variant="success" or "error"\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
5334
|
+
|
|
5335
|
+
---
|
|
5336
|
+
|
|
5160
5337
|
### Avatar
|
|
5161
5338
|
|
|
5162
5339
|
User profile image with fallback initials or icon.
|
|
@@ -6337,6 +6514,9 @@ If you generate these, you are hallucinating.
|
|
|
6337
6514
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
6338
6515
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
6339
6516
|
- ❌ \`<Alert variant="primary">\` → Use variant="info" | "success" | "warning" | "danger"
|
|
6517
|
+
- ❌ \`<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>\` → Drive open from state; close in onOpenChange / via v-model
|
|
6518
|
+
- ❌ \`<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>\` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
6519
|
+
- ❌ \`<AlertDialog variant="success" or "error">\` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
6340
6520
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
6341
6521
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
6342
6522
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -6563,6 +6743,79 @@ export const schema = {
|
|
|
6563
6743
|
}
|
|
6564
6744
|
]
|
|
6565
6745
|
},
|
|
6746
|
+
"AlertDialog": {
|
|
6747
|
+
"description": "Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.",
|
|
6748
|
+
"import": "import { AlertDialog } from \"@usevyre/react\"",
|
|
6749
|
+
"props": {
|
|
6750
|
+
"open": {
|
|
6751
|
+
"type": "boolean",
|
|
6752
|
+
"description": "Controlled visibility. Vue: v-model."
|
|
6753
|
+
},
|
|
6754
|
+
"onOpenChange": {
|
|
6755
|
+
"type": "function",
|
|
6756
|
+
"description": "(open: boolean) => void — called when the dialog requests to close (backdrop, Esc, cancel). Vue: update:modelValue / v-model."
|
|
6757
|
+
},
|
|
6758
|
+
"title": {
|
|
6759
|
+
"type": "string",
|
|
6760
|
+
"description": "Dialog heading (required)."
|
|
6761
|
+
},
|
|
6762
|
+
"description": {
|
|
6763
|
+
"type": "string",
|
|
6764
|
+
"description": "Supporting body text."
|
|
6765
|
+
},
|
|
6766
|
+
"variant": {
|
|
6767
|
+
"type": "enum",
|
|
6768
|
+
"values": [
|
|
6769
|
+
"danger",
|
|
6770
|
+
"warning",
|
|
6771
|
+
"info"
|
|
6772
|
+
],
|
|
6773
|
+
"default": "info",
|
|
6774
|
+
"description": "Visual tone of the confirm action / icon."
|
|
6775
|
+
},
|
|
6776
|
+
"confirmLabel": {
|
|
6777
|
+
"type": "string",
|
|
6778
|
+
"default": "Confirm",
|
|
6779
|
+
"description": "Confirm button text."
|
|
6780
|
+
},
|
|
6781
|
+
"cancelLabel": {
|
|
6782
|
+
"type": "string",
|
|
6783
|
+
"default": "Cancel",
|
|
6784
|
+
"description": "Cancel button text."
|
|
6785
|
+
},
|
|
6786
|
+
"onConfirm": {
|
|
6787
|
+
"type": "function",
|
|
6788
|
+
"description": "Called when the confirm button is pressed."
|
|
6789
|
+
},
|
|
6790
|
+
"onCancel": {
|
|
6791
|
+
"type": "function",
|
|
6792
|
+
"description": "Called when cancelled (button, Esc, backdrop)."
|
|
6793
|
+
}
|
|
6794
|
+
},
|
|
6795
|
+
"antiPatterns": [
|
|
6796
|
+
{
|
|
6797
|
+
"pattern": "AlertDialog without open/onOpenChange (React) or v-model (Vue)",
|
|
6798
|
+
"reason": "It is controlled; it never shows/closes without state",
|
|
6799
|
+
"fix": "Drive open from state; close in onOpenChange / via v-model"
|
|
6800
|
+
},
|
|
6801
|
+
{
|
|
6802
|
+
"pattern": "Using Alert (inline banner) for a confirm/cancel decision",
|
|
6803
|
+
"reason": "Alert is non-blocking inline feedback, has no confirm flow",
|
|
6804
|
+
"fix": "Use AlertDialog for blocking confirmation; Alert for passive messages"
|
|
6805
|
+
},
|
|
6806
|
+
{
|
|
6807
|
+
"pattern": "variant=\"success\" or \"error\"",
|
|
6808
|
+
"reason": "AlertDialog variant is \"danger\" | \"warning\" | \"info\" only",
|
|
6809
|
+
"fix": "Use \"danger\" for destructive, \"warning\" to caution, \"info\" otherwise"
|
|
6810
|
+
}
|
|
6811
|
+
],
|
|
6812
|
+
"examples": [
|
|
6813
|
+
{
|
|
6814
|
+
"description": "Destructive confirmation",
|
|
6815
|
+
"code": "const [open, setOpen] = useState(false);\n<Button variant=\"danger\" onClick={() => setOpen(true)}>Delete</Button>\n<AlertDialog\n open={open}\n onOpenChange={setOpen}\n variant=\"danger\"\n title=\"Delete project?\"\n description=\"This cannot be undone.\"\n confirmLabel=\"Delete\"\n onConfirm={() => deleteProject()}\n/>"
|
|
6816
|
+
}
|
|
6817
|
+
]
|
|
6818
|
+
},
|
|
6566
6819
|
"Avatar": {
|
|
6567
6820
|
"description": "User profile image with fallback initials or icon.",
|
|
6568
6821
|
"import": "import { Avatar } from \"@usevyre/react\"",
|
|
@@ -8702,6 +8955,27 @@ export const antiPatterns = {
|
|
|
8702
8955
|
"fix": "Use variant=\"info\" | \"success\" | \"warning\" | \"danger\"",
|
|
8703
8956
|
"severity": "error"
|
|
8704
8957
|
},
|
|
8958
|
+
{
|
|
8959
|
+
"component": "AlertDialog",
|
|
8960
|
+
"pattern": "AlertDialog without open/onOpenChange (React) or v-model (Vue)",
|
|
8961
|
+
"reason": "It is controlled; it never shows/closes without state",
|
|
8962
|
+
"fix": "Drive open from state; close in onOpenChange / via v-model",
|
|
8963
|
+
"severity": "error"
|
|
8964
|
+
},
|
|
8965
|
+
{
|
|
8966
|
+
"component": "AlertDialog",
|
|
8967
|
+
"pattern": "Using Alert (inline banner) for a confirm/cancel decision",
|
|
8968
|
+
"reason": "Alert is non-blocking inline feedback, has no confirm flow",
|
|
8969
|
+
"fix": "Use AlertDialog for blocking confirmation; Alert for passive messages",
|
|
8970
|
+
"severity": "error"
|
|
8971
|
+
},
|
|
8972
|
+
{
|
|
8973
|
+
"component": "AlertDialog",
|
|
8974
|
+
"pattern": "variant=\"success\" or \"error\"",
|
|
8975
|
+
"reason": "AlertDialog variant is \"danger\" | \"warning\" | \"info\" only",
|
|
8976
|
+
"fix": "Use \"danger\" for destructive, \"warning\" to caution, \"info\" otherwise",
|
|
8977
|
+
"severity": "error"
|
|
8978
|
+
},
|
|
8705
8979
|
{
|
|
8706
8980
|
"component": "Avatar",
|
|
8707
8981
|
"pattern": "size=\"xs\"",
|
|
@@ -9191,7 +9465,7 @@ export const antiPatterns = {
|
|
|
9191
9465
|
export const versionInfo = {
|
|
9192
9466
|
"version": "1.2.0",
|
|
9193
9467
|
"packageVersion": "1.1.0",
|
|
9194
|
-
"generatedAt": "2026-05-
|
|
9468
|
+
"generatedAt": "2026-05-17T14:01:21.768Z",
|
|
9195
9469
|
"validFor": [
|
|
9196
9470
|
"@usevyre/react@1.1.0+",
|
|
9197
9471
|
"@usevyre/vue@1.1.0+"
|
|
@@ -9238,6 +9512,13 @@ export const versionInfo = {
|
|
|
9238
9512
|
"stable": true,
|
|
9239
9513
|
"changelog": null
|
|
9240
9514
|
},
|
|
9515
|
+
"AlertDialog": {
|
|
9516
|
+
"version": "1.1.0",
|
|
9517
|
+
"lastUpdated": "2026-05-16",
|
|
9518
|
+
"breaking": false,
|
|
9519
|
+
"stable": true,
|
|
9520
|
+
"changelog": null
|
|
9521
|
+
},
|
|
9241
9522
|
"Avatar": {
|
|
9242
9523
|
"version": "1.1.0",
|
|
9243
9524
|
"lastUpdated": "2026-05-16",
|
|
@@ -9531,6 +9812,7 @@ export const versionInfo = {
|
|
|
9531
9812
|
export const cheatSheets = {
|
|
9532
9813
|
"Accordion": "# Accordion — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Vertically stacked collapsible sections. Compose with AccordionItem, AccordionTrigger, AccordionContent.**\n\n```ts\nimport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from \"@usevyre/react\"\n```\n\n## Common AI Mistakes\n\n- ❌ `Accordion without AccordionItem`\n → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent\n\n## Examples\n\n**Basic accordion**\n```tsx\n<Accordion>\n <AccordionItem value=\"item-1\">\n <AccordionTrigger>Section Title</AccordionTrigger>\n <AccordionContent>Content goes here.</AccordionContent>\n </AccordionItem>\n</Accordion>\n```\n",
|
|
9533
9814
|
"Alert": "# Alert — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Inline feedback message for info, success, warning, or danger states.**\n\n```ts\nimport { Alert } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `variant` | `\"info\"` \\| `\"success\"` \\| `\"warning\"` \\| `\"danger\"` | `info` |\n\n## Common AI Mistakes\n\n- ❌ `variant=\"error\"`\n → Use variant=\"danger\"\n- ❌ `variant=\"primary\"`\n → Use variant=\"info\" | \"success\" | \"warning\" | \"danger\"\n\n## Examples\n\n**Warning with close button**\n```tsx\n<Alert variant=\"warning\" title=\"Heads up\" onClose={() => setOpen(false)}>\n This action cannot be undone.\n</Alert>\n```\n\n**Success state**\n```tsx\n<Alert variant=\"success\" title=\"Saved!\">Your changes have been saved.</Alert>\n```\n",
|
|
9815
|
+
"AlertDialog": "# AlertDialog — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.**\n\n```ts\nimport { AlertDialog } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `variant` | `\"danger\"` \\| `\"warning\"` \\| `\"info\"` | `info` |\n| `open` | `true` \\| `false` | — |\n\n## Common AI Mistakes\n\n- ❌ `AlertDialog without open/onOpenChange (React) or v-model (Vue)`\n → Drive open from state; close in onOpenChange / via v-model\n- ❌ `Using Alert (inline banner) for a confirm/cancel decision`\n → Use AlertDialog for blocking confirmation; Alert for passive messages\n- ❌ `variant=\"success\" or \"error\"`\n → Use \"danger\" for destructive, \"warning\" to caution, \"info\" otherwise\n\n## Examples\n\n**Destructive confirmation**\n```tsx\nconst [open, setOpen] = useState(false);\n<Button variant=\"danger\" onClick={() => setOpen(true)}>Delete</Button>\n<AlertDialog\n open={open}\n onOpenChange={setOpen}\n variant=\"danger\"\n title=\"Delete project?\"\n description=\"This cannot be undone.\"\n confirmLabel=\"Delete\"\n onConfirm={() => deleteProject()}\n/>\n```\n",
|
|
9534
9816
|
"Avatar": "# Avatar — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**User profile image with fallback initials or icon.**\n\n```ts\nimport { Avatar } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `size` | `\"sm\"` \\| `\"md\"` \\| `\"lg\"` \\| `\"xl\"` | `md` |\n| `status` | `\"online\"` \\| `\"offline\"` \\| `\"busy\"` \\| `\"away\"` | — |\n\n## Common AI Mistakes\n\n- ❌ `size=\"xs\"`\n → Use size=\"sm\"\n- ❌ `size=\"2xl\"`\n → Use size=\"xl\"\n\n## Examples\n\n**Avatar with image and online status**\n```tsx\n<Avatar src=\"/user.png\" alt=\"Jane Doe\" size=\"lg\" status=\"online\" />\n```\n\n**Fallback initials**\n```tsx\n<Avatar fallback=\"JD\" size=\"md\" />\n```\n",
|
|
9535
9817
|
"Badge": "# Badge — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Small label for status, category, or count. Use dot prop for live status indicator.**\n\n```ts\nimport { Badge } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `variant` | `\"default\"` \\| `\"accent\"` \\| `\"teal\"` \\| `\"success\"` \\| `\"warning\"` \\| `\"danger\"` | `default` |\n| `dot` | `true` \\| `false` | `false` |\n\n## Common AI Mistakes\n\n- ❌ `variant=\"primary\"`\n → Use variant=\"accent\" for brand color\n- ❌ `variant=\"error\"`\n → Use variant=\"danger\"\n- ❌ `variant=\"info\"`\n → Use variant=\"teal\" for info-like styling\n\n## Examples\n\n**Live status with dot**\n```tsx\n<Badge variant=\"success\" dot>Online</Badge>\n```\n\n**Warning badge**\n```tsx\n<Badge variant=\"warning\">Beta</Badge>\n```\n\n**Danger badge**\n```tsx\n<Badge variant=\"danger\">Error</Badge>\n```\n",
|
|
9536
9818
|
"Breadcrumb": "# Breadcrumb — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Navigation trail showing current page location in hierarchy.**\n\n```ts\nimport { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from \"@usevyre/react\"\n```\n\n## Common AI Mistakes\n\n- ❌ `Using plain <a> tags inside Breadcrumb`\n → Use BreadcrumbItem > BreadcrumbLink for each crumb\n\n## Examples\n\n**Basic breadcrumb**\n```tsx\n<Breadcrumb>\n <BreadcrumbItem><BreadcrumbLink href=\"/\">Home</BreadcrumbLink></BreadcrumbItem>\n <BreadcrumbSeparator />\n <BreadcrumbItem><BreadcrumbLink href=\"/docs\">Docs</BreadcrumbLink></BreadcrumbItem>\n <BreadcrumbSeparator />\n <BreadcrumbItem aria-current=\"page\">Button</BreadcrumbItem>\n</Breadcrumb>\n```\n",
|
package/dist/schema.json
CHANGED
|
@@ -106,6 +106,79 @@
|
|
|
106
106
|
}
|
|
107
107
|
]
|
|
108
108
|
},
|
|
109
|
+
"AlertDialog": {
|
|
110
|
+
"description": "Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.",
|
|
111
|
+
"import": "import { AlertDialog } from \"@usevyre/react\"",
|
|
112
|
+
"props": {
|
|
113
|
+
"open": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"description": "Controlled visibility. Vue: v-model."
|
|
116
|
+
},
|
|
117
|
+
"onOpenChange": {
|
|
118
|
+
"type": "function",
|
|
119
|
+
"description": "(open: boolean) => void — called when the dialog requests to close (backdrop, Esc, cancel). Vue: update:modelValue / v-model."
|
|
120
|
+
},
|
|
121
|
+
"title": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "Dialog heading (required)."
|
|
124
|
+
},
|
|
125
|
+
"description": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Supporting body text."
|
|
128
|
+
},
|
|
129
|
+
"variant": {
|
|
130
|
+
"type": "enum",
|
|
131
|
+
"values": [
|
|
132
|
+
"danger",
|
|
133
|
+
"warning",
|
|
134
|
+
"info"
|
|
135
|
+
],
|
|
136
|
+
"default": "info",
|
|
137
|
+
"description": "Visual tone of the confirm action / icon."
|
|
138
|
+
},
|
|
139
|
+
"confirmLabel": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"default": "Confirm",
|
|
142
|
+
"description": "Confirm button text."
|
|
143
|
+
},
|
|
144
|
+
"cancelLabel": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"default": "Cancel",
|
|
147
|
+
"description": "Cancel button text."
|
|
148
|
+
},
|
|
149
|
+
"onConfirm": {
|
|
150
|
+
"type": "function",
|
|
151
|
+
"description": "Called when the confirm button is pressed."
|
|
152
|
+
},
|
|
153
|
+
"onCancel": {
|
|
154
|
+
"type": "function",
|
|
155
|
+
"description": "Called when cancelled (button, Esc, backdrop)."
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"antiPatterns": [
|
|
159
|
+
{
|
|
160
|
+
"pattern": "AlertDialog without open/onOpenChange (React) or v-model (Vue)",
|
|
161
|
+
"reason": "It is controlled; it never shows/closes without state",
|
|
162
|
+
"fix": "Drive open from state; close in onOpenChange / via v-model"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"pattern": "Using Alert (inline banner) for a confirm/cancel decision",
|
|
166
|
+
"reason": "Alert is non-blocking inline feedback, has no confirm flow",
|
|
167
|
+
"fix": "Use AlertDialog for blocking confirmation; Alert for passive messages"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"pattern": "variant=\"success\" or \"error\"",
|
|
171
|
+
"reason": "AlertDialog variant is \"danger\" | \"warning\" | \"info\" only",
|
|
172
|
+
"fix": "Use \"danger\" for destructive, \"warning\" to caution, \"info\" otherwise"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"examples": [
|
|
176
|
+
{
|
|
177
|
+
"description": "Destructive confirmation",
|
|
178
|
+
"code": "const [open, setOpen] = useState(false);\n<Button variant=\"danger\" onClick={() => setOpen(true)}>Delete</Button>\n<AlertDialog\n open={open}\n onOpenChange={setOpen}\n variant=\"danger\"\n title=\"Delete project?\"\n description=\"This cannot be undone.\"\n confirmLabel=\"Delete\"\n onConfirm={() => deleteProject()}\n/>"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
109
182
|
"Avatar": {
|
|
110
183
|
"description": "User profile image with fallback initials or icon.",
|
|
111
184
|
"import": "import { Avatar } from \"@usevyre/react\"",
|
package/dist/tokens.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usevyre.com/schemas/ai-tokens-v1.json",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"generatedAt": "2026-05-17T13:
|
|
4
|
+
"generatedAt": "2026-05-17T13:59:11.602Z",
|
|
5
5
|
"description": "useVyre design tokens — machine-readable reference for AI agents. Use semantic color tokens; never use primitive tokens directly in components.",
|
|
6
6
|
"naming": {
|
|
7
7
|
"convention": "--vyre-[category]-[subcategory]-[variant]",
|
package/dist/version-info.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.2.0",
|
|
3
3
|
"packageVersion": "1.1.0",
|
|
4
|
-
"generatedAt": "2026-05-
|
|
4
|
+
"generatedAt": "2026-05-17T14:01:21.768Z",
|
|
5
5
|
"validFor": [
|
|
6
6
|
"@usevyre/react@1.1.0+",
|
|
7
7
|
"@usevyre/vue@1.1.0+"
|
|
@@ -48,6 +48,13 @@
|
|
|
48
48
|
"stable": true,
|
|
49
49
|
"changelog": null
|
|
50
50
|
},
|
|
51
|
+
"AlertDialog": {
|
|
52
|
+
"version": "1.1.0",
|
|
53
|
+
"lastUpdated": "2026-05-16",
|
|
54
|
+
"breaking": false,
|
|
55
|
+
"stable": true,
|
|
56
|
+
"changelog": null
|
|
57
|
+
},
|
|
51
58
|
"Avatar": {
|
|
52
59
|
"version": "1.1.0",
|
|
53
60
|
"lastUpdated": "2026-05-16",
|
package/dist/windsurf-rules.md
CHANGED
|
@@ -200,6 +200,45 @@ import { Alert } from "@usevyre/react"
|
|
|
200
200
|
|
|
201
201
|
---
|
|
202
202
|
|
|
203
|
+
### AlertDialog
|
|
204
|
+
|
|
205
|
+
Blocking confirmation modal (focus-trapped). Controlled via open + onOpenChange (React) / v-model (Vue). Use for destructive or irreversible actions that need explicit confirm/cancel. For non-blocking inline feedback use Alert; for general dialogs use Modal.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
import { AlertDialog } from "@usevyre/react"
|
|
209
|
+
|
|
210
|
+
// Props:
|
|
211
|
+
// open = boolean
|
|
212
|
+
// onOpenChange = function
|
|
213
|
+
// title = string
|
|
214
|
+
// description = string
|
|
215
|
+
// variant = "danger" | "warning" | "info" (default: info)
|
|
216
|
+
// confirmLabel = string (default: Confirm)
|
|
217
|
+
// cancelLabel = string (default: Cancel)
|
|
218
|
+
// onConfirm = function
|
|
219
|
+
// onCancel = function
|
|
220
|
+
|
|
221
|
+
// Examples:
|
|
222
|
+
const [open, setOpen] = useState(false);
|
|
223
|
+
<Button variant="danger" onClick={() => setOpen(true)}>Delete</Button>
|
|
224
|
+
<AlertDialog
|
|
225
|
+
open={open}
|
|
226
|
+
onOpenChange={setOpen}
|
|
227
|
+
variant="danger"
|
|
228
|
+
title="Delete project?"
|
|
229
|
+
description="This cannot be undone."
|
|
230
|
+
confirmLabel="Delete"
|
|
231
|
+
onConfirm={() => deleteProject()}
|
|
232
|
+
/>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Common mistakes:**
|
|
236
|
+
- ❌ `AlertDialog without open/onOpenChange (React) or v-model (Vue)` → Drive open from state; close in onOpenChange / via v-model
|
|
237
|
+
- ❌ `Using Alert (inline banner) for a confirm/cancel decision` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
238
|
+
- ❌ `variant="success" or "error"` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
203
242
|
### Avatar
|
|
204
243
|
|
|
205
244
|
User profile image with fallback initials or icon.
|
|
@@ -1380,6 +1419,9 @@ If you generate these, you are hallucinating.
|
|
|
1380
1419
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1381
1420
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1382
1421
|
- ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
|
|
1422
|
+
- ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
|
|
1423
|
+
- ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
|
|
1424
|
+
- ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
|
|
1383
1425
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1384
1426
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1385
1427
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|