@usevyre/ai-context 1.2.0 → 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 +28 -0
- package/dist/cheat-sheets/alertdialog.md +41 -0
- package/dist/cheat-sheets/index.md +1 -0
- package/dist/cheat-sheets/sidebar.md +16 -0
- package/dist/claude-context.md +55 -0
- package/dist/copilot-instructions.md +55 -0
- package/dist/cursor-rules.md +15 -0
- package/dist/full-context.md +55 -0
- package/dist/index.js +367 -3
- package/dist/schema.json +94 -1
- package/dist/tokens.json +1 -1
- package/dist/version-info.json +8 -1
- package/dist/windsurf-rules.md +55 -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\"",
|
|
@@ -260,6 +281,13 @@
|
|
|
260
281
|
"fix": "Pass options={[{ value: 'a', label: 'Option A' }]}",
|
|
261
282
|
"severity": "error"
|
|
262
283
|
},
|
|
284
|
+
{
|
|
285
|
+
"component": "Sidebar",
|
|
286
|
+
"pattern": "Vue: passing icon/collapsedIcon as props on SidebarTrigger",
|
|
287
|
+
"reason": "Vue SidebarTrigger customises icons via slots, not props (consistent with SidebarItem)",
|
|
288
|
+
"fix": "Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props",
|
|
289
|
+
"severity": "error"
|
|
290
|
+
},
|
|
263
291
|
{
|
|
264
292
|
"component": "Toast",
|
|
265
293
|
"pattern": "Rendering <Toast> directly in JSX",
|
|
@@ -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.
|
|
@@ -13,6 +13,11 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
13
13
|
|------|--------|---------|
|
|
14
14
|
| `variant` | `"default"` \| `"floating"` | `default` |
|
|
15
15
|
|
|
16
|
+
## Common AI Mistakes
|
|
17
|
+
|
|
18
|
+
- ❌ `Vue: passing icon/collapsedIcon as props on SidebarTrigger`
|
|
19
|
+
→ Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
20
|
+
|
|
16
21
|
## Examples
|
|
17
22
|
|
|
18
23
|
**App layout with sidebar**
|
|
@@ -31,3 +36,14 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
31
36
|
<main>Page content</main>
|
|
32
37
|
</AppLayout>
|
|
33
38
|
```
|
|
39
|
+
|
|
40
|
+
**SidebarTrigger with distinct open/collapsed icons**
|
|
41
|
+
```tsx
|
|
42
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
43
|
+
|
|
44
|
+
// Vue:
|
|
45
|
+
// <SidebarTrigger>
|
|
46
|
+
// <template #icon><PanelLeftClose /></template>
|
|
47
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
48
|
+
// </SidebarTrigger>
|
|
49
|
+
```
|
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.
|
|
@@ -797,6 +836,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
797
836
|
|
|
798
837
|
// Props:
|
|
799
838
|
// variant = "default" | "floating" (default: default)
|
|
839
|
+
// SidebarTrigger.icon = ReactNode
|
|
840
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
800
841
|
|
|
801
842
|
// Examples:
|
|
802
843
|
<AppLayout>
|
|
@@ -812,8 +853,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
812
853
|
</Sidebar>
|
|
813
854
|
<main>Page content</main>
|
|
814
855
|
</AppLayout>
|
|
856
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
857
|
+
|
|
858
|
+
// Vue:
|
|
859
|
+
// <SidebarTrigger>
|
|
860
|
+
// <template #icon><PanelLeftClose /></template>
|
|
861
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
862
|
+
// </SidebarTrigger>
|
|
815
863
|
```
|
|
816
864
|
|
|
865
|
+
**Common mistakes:**
|
|
866
|
+
- ❌ `Vue: passing icon/collapsedIcon as props on SidebarTrigger` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
867
|
+
|
|
817
868
|
---
|
|
818
869
|
|
|
819
870
|
### Skeleton
|
|
@@ -1371,6 +1422,9 @@ If you generate these, you are hallucinating.
|
|
|
1371
1422
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1372
1423
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1373
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
|
|
1374
1428
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1375
1429
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1376
1430
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
|
@@ -1405,6 +1459,7 @@ If you generate these, you are hallucinating.
|
|
|
1405
1459
|
- ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
|
|
1406
1460
|
- ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
|
|
1407
1461
|
- ❌ `<Select Passing strings directly as children>` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
1462
|
+
- ❌ `<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
1408
1463
|
- ❌ `<Toast Rendering <Toast> directly in JSX>` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
1409
1464
|
- ❌ `<Toast variant="error">` → Use variant="danger"
|
|
1410
1465
|
- ❌ `<Toast variant="info">` → Use variant="default"
|
|
@@ -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.
|
|
@@ -796,6 +835,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
796
835
|
|
|
797
836
|
// Props:
|
|
798
837
|
// variant = "default" | "floating" (default: default)
|
|
838
|
+
// SidebarTrigger.icon = ReactNode
|
|
839
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
799
840
|
|
|
800
841
|
// Examples:
|
|
801
842
|
<AppLayout>
|
|
@@ -811,8 +852,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
811
852
|
</Sidebar>
|
|
812
853
|
<main>Page content</main>
|
|
813
854
|
</AppLayout>
|
|
855
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
856
|
+
|
|
857
|
+
// Vue:
|
|
858
|
+
// <SidebarTrigger>
|
|
859
|
+
// <template #icon><PanelLeftClose /></template>
|
|
860
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
861
|
+
// </SidebarTrigger>
|
|
814
862
|
```
|
|
815
863
|
|
|
864
|
+
**Common mistakes:**
|
|
865
|
+
- ❌ `Vue: passing icon/collapsedIcon as props on SidebarTrigger` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
866
|
+
|
|
816
867
|
---
|
|
817
868
|
|
|
818
869
|
### Skeleton
|
|
@@ -1370,6 +1421,9 @@ If you generate these, you are hallucinating.
|
|
|
1370
1421
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1371
1422
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1372
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
|
|
1373
1427
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1374
1428
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1375
1429
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
|
@@ -1404,6 +1458,7 @@ If you generate these, you are hallucinating.
|
|
|
1404
1458
|
- ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
|
|
1405
1459
|
- ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
|
|
1406
1460
|
- ❌ `<Select Passing strings directly as children>` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
1461
|
+
- ❌ `<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
1407
1462
|
- ❌ `<Toast Rendering <Toast> directly in JSX>` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
1408
1463
|
- ❌ `<Toast variant="error">` → Use variant="danger"
|
|
1409
1464
|
- ❌ `<Toast variant="info">` → Use variant="default"
|
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"`
|
|
@@ -262,6 +274,9 @@ Import: `import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSect
|
|
|
262
274
|
Valid props:
|
|
263
275
|
- variant: "default" | "floating" [default: default]
|
|
264
276
|
|
|
277
|
+
Never do:
|
|
278
|
+
- ❌ Vue: passing icon/collapsedIcon as props on SidebarTrigger → ✅ Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
279
|
+
|
|
265
280
|
## Skeleton
|
|
266
281
|
Loading placeholder that mimics the shape of content while data loads.
|
|
267
282
|
Import: `import { Skeleton } 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.
|
|
@@ -791,6 +830,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
791
830
|
|
|
792
831
|
// Props:
|
|
793
832
|
// variant = "default" | "floating" (default: default)
|
|
833
|
+
// SidebarTrigger.icon = ReactNode
|
|
834
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
794
835
|
|
|
795
836
|
// Examples:
|
|
796
837
|
<AppLayout>
|
|
@@ -806,8 +847,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
806
847
|
</Sidebar>
|
|
807
848
|
<main>Page content</main>
|
|
808
849
|
</AppLayout>
|
|
850
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
851
|
+
|
|
852
|
+
// Vue:
|
|
853
|
+
// <SidebarTrigger>
|
|
854
|
+
// <template #icon><PanelLeftClose /></template>
|
|
855
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
856
|
+
// </SidebarTrigger>
|
|
809
857
|
```
|
|
810
858
|
|
|
859
|
+
**Common mistakes:**
|
|
860
|
+
- ❌ `Vue: passing icon/collapsedIcon as props on SidebarTrigger` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
861
|
+
|
|
811
862
|
---
|
|
812
863
|
|
|
813
864
|
### Skeleton
|
|
@@ -1365,6 +1416,9 @@ If you generate these, you are hallucinating.
|
|
|
1365
1416
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1366
1417
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1367
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
|
|
1368
1422
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1369
1423
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1370
1424
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
|
@@ -1399,6 +1453,7 @@ If you generate these, you are hallucinating.
|
|
|
1399
1453
|
- ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
|
|
1400
1454
|
- ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
|
|
1401
1455
|
- ❌ `<Select Passing strings directly as children>` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
1456
|
+
- ❌ `<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
1402
1457
|
- ❌ `<Toast Rendering <Toast> directly in JSX>` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
1403
1458
|
- ❌ `<Toast variant="error">` → Use variant="danger"
|
|
1404
1459
|
- ❌ `<Toast variant="info">` → Use variant="default"
|
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.
|
|
@@ -796,6 +835,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
796
835
|
|
|
797
836
|
// Props:
|
|
798
837
|
// variant = "default" | "floating" (default: default)
|
|
838
|
+
// SidebarTrigger.icon = ReactNode
|
|
839
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
799
840
|
|
|
800
841
|
// Examples:
|
|
801
842
|
<AppLayout>
|
|
@@ -811,8 +852,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
811
852
|
</Sidebar>
|
|
812
853
|
<main>Page content</main>
|
|
813
854
|
</AppLayout>
|
|
855
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
856
|
+
|
|
857
|
+
// Vue:
|
|
858
|
+
// <SidebarTrigger>
|
|
859
|
+
// <template #icon><PanelLeftClose /></template>
|
|
860
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
861
|
+
// </SidebarTrigger>
|
|
814
862
|
\`\`\`
|
|
815
863
|
|
|
864
|
+
**Common mistakes:**
|
|
865
|
+
- ❌ \`Vue: passing icon/collapsedIcon as props on SidebarTrigger\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
866
|
+
|
|
816
867
|
---
|
|
817
868
|
|
|
818
869
|
### Skeleton
|
|
@@ -1370,6 +1421,9 @@ If you generate these, you are hallucinating.
|
|
|
1370
1421
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1371
1422
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
1372
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
|
|
1373
1427
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
1374
1428
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
1375
1429
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -1404,6 +1458,7 @@ If you generate these, you are hallucinating.
|
|
|
1404
1458
|
- ❌ \`<Popover placement="top-center">\` → Use placement="top" for centered placement
|
|
1405
1459
|
- ❌ \`<Progress value > 100>\` → Normalize your value to 0–100 range before passing
|
|
1406
1460
|
- ❌ \`<Select Passing strings directly as children>\` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
1461
|
+
- ❌ \`<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
1407
1462
|
- ❌ \`<Toast Rendering <Toast> directly in JSX>\` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
1408
1463
|
- ❌ \`<Toast variant="error">\` → Use variant="danger"
|
|
1409
1464
|
- ❌ \`<Toast variant="info">\` → Use variant="default"
|
|
@@ -1524,6 +1579,18 @@ Never do:
|
|
|
1524
1579
|
- ❌ variant="error" → ✅ Use variant="danger"
|
|
1525
1580
|
- ❌ variant="primary" → ✅ Use variant="info" | "success" | "warning" | "danger"
|
|
1526
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
|
+
|
|
1527
1594
|
## Avatar
|
|
1528
1595
|
User profile image with fallback initials or icon.
|
|
1529
1596
|
Import: \`import { Avatar } from "@usevyre/react"\`
|
|
@@ -1750,6 +1817,9 @@ Import: \`import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSec
|
|
|
1750
1817
|
Valid props:
|
|
1751
1818
|
- variant: "default" | "floating" [default: default]
|
|
1752
1819
|
|
|
1820
|
+
Never do:
|
|
1821
|
+
- ❌ Vue: passing icon/collapsedIcon as props on SidebarTrigger → ✅ Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
1822
|
+
|
|
1753
1823
|
## Skeleton
|
|
1754
1824
|
Loading placeholder that mimics the shape of content while data loads.
|
|
1755
1825
|
Import: \`import { Skeleton } from "@usevyre/react"\`
|
|
@@ -2141,6 +2211,45 @@ import { Alert } from "@usevyre/react"
|
|
|
2141
2211
|
|
|
2142
2212
|
---
|
|
2143
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
|
+
|
|
2144
2253
|
### Avatar
|
|
2145
2254
|
|
|
2146
2255
|
User profile image with fallback initials or icon.
|
|
@@ -2735,6 +2844,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
2735
2844
|
|
|
2736
2845
|
// Props:
|
|
2737
2846
|
// variant = "default" | "floating" (default: default)
|
|
2847
|
+
// SidebarTrigger.icon = ReactNode
|
|
2848
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
2738
2849
|
|
|
2739
2850
|
// Examples:
|
|
2740
2851
|
<AppLayout>
|
|
@@ -2750,8 +2861,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
2750
2861
|
</Sidebar>
|
|
2751
2862
|
<main>Page content</main>
|
|
2752
2863
|
</AppLayout>
|
|
2864
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
2865
|
+
|
|
2866
|
+
// Vue:
|
|
2867
|
+
// <SidebarTrigger>
|
|
2868
|
+
// <template #icon><PanelLeftClose /></template>
|
|
2869
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
2870
|
+
// </SidebarTrigger>
|
|
2753
2871
|
\`\`\`
|
|
2754
2872
|
|
|
2873
|
+
**Common mistakes:**
|
|
2874
|
+
- ❌ \`Vue: passing icon/collapsedIcon as props on SidebarTrigger\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
2875
|
+
|
|
2755
2876
|
---
|
|
2756
2877
|
|
|
2757
2878
|
### Skeleton
|
|
@@ -3309,6 +3430,9 @@ If you generate these, you are hallucinating.
|
|
|
3309
3430
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
3310
3431
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
3311
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
|
|
3312
3436
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
3313
3437
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
3314
3438
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -3343,6 +3467,7 @@ If you generate these, you are hallucinating.
|
|
|
3343
3467
|
- ❌ \`<Popover placement="top-center">\` → Use placement="top" for centered placement
|
|
3344
3468
|
- ❌ \`<Progress value > 100>\` → Normalize your value to 0–100 range before passing
|
|
3345
3469
|
- ❌ \`<Select Passing strings directly as children>\` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
3470
|
+
- ❌ \`<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
3346
3471
|
- ❌ \`<Toast Rendering <Toast> directly in JSX>\` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
3347
3472
|
- ❌ \`<Toast variant="error">\` → Use variant="danger"
|
|
3348
3473
|
- ❌ \`<Toast variant="info">\` → Use variant="default"
|
|
@@ -3627,6 +3752,45 @@ import { Alert } from "@usevyre/react"
|
|
|
3627
3752
|
|
|
3628
3753
|
---
|
|
3629
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
|
+
|
|
3630
3794
|
### Avatar
|
|
3631
3795
|
|
|
3632
3796
|
User profile image with fallback initials or icon.
|
|
@@ -4221,6 +4385,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
4221
4385
|
|
|
4222
4386
|
// Props:
|
|
4223
4387
|
// variant = "default" | "floating" (default: default)
|
|
4388
|
+
// SidebarTrigger.icon = ReactNode
|
|
4389
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
4224
4390
|
|
|
4225
4391
|
// Examples:
|
|
4226
4392
|
<AppLayout>
|
|
@@ -4236,8 +4402,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
4236
4402
|
</Sidebar>
|
|
4237
4403
|
<main>Page content</main>
|
|
4238
4404
|
</AppLayout>
|
|
4405
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
4406
|
+
|
|
4407
|
+
// Vue:
|
|
4408
|
+
// <SidebarTrigger>
|
|
4409
|
+
// <template #icon><PanelLeftClose /></template>
|
|
4410
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
4411
|
+
// </SidebarTrigger>
|
|
4239
4412
|
\`\`\`
|
|
4240
4413
|
|
|
4414
|
+
**Common mistakes:**
|
|
4415
|
+
- ❌ \`Vue: passing icon/collapsedIcon as props on SidebarTrigger\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
4416
|
+
|
|
4241
4417
|
---
|
|
4242
4418
|
|
|
4243
4419
|
### Skeleton
|
|
@@ -4795,6 +4971,9 @@ If you generate these, you are hallucinating.
|
|
|
4795
4971
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
4796
4972
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
4797
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
|
|
4798
4977
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
4799
4978
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
4800
4979
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -4829,6 +5008,7 @@ If you generate these, you are hallucinating.
|
|
|
4829
5008
|
- ❌ \`<Popover placement="top-center">\` → Use placement="top" for centered placement
|
|
4830
5009
|
- ❌ \`<Progress value > 100>\` → Normalize your value to 0–100 range before passing
|
|
4831
5010
|
- ❌ \`<Select Passing strings directly as children>\` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
5011
|
+
- ❌ \`<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
4832
5012
|
- ❌ \`<Toast Rendering <Toast> directly in JSX>\` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
4833
5013
|
- ❌ \`<Toast variant="error">\` → Use variant="danger"
|
|
4834
5014
|
- ❌ \`<Toast variant="info">\` → Use variant="default"
|
|
@@ -5115,6 +5295,45 @@ import { Alert } from "@usevyre/react"
|
|
|
5115
5295
|
|
|
5116
5296
|
---
|
|
5117
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
|
+
|
|
5118
5337
|
### Avatar
|
|
5119
5338
|
|
|
5120
5339
|
User profile image with fallback initials or icon.
|
|
@@ -5709,6 +5928,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
5709
5928
|
|
|
5710
5929
|
// Props:
|
|
5711
5930
|
// variant = "default" | "floating" (default: default)
|
|
5931
|
+
// SidebarTrigger.icon = ReactNode
|
|
5932
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
5712
5933
|
|
|
5713
5934
|
// Examples:
|
|
5714
5935
|
<AppLayout>
|
|
@@ -5724,8 +5945,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
5724
5945
|
</Sidebar>
|
|
5725
5946
|
<main>Page content</main>
|
|
5726
5947
|
</AppLayout>
|
|
5948
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
5949
|
+
|
|
5950
|
+
// Vue:
|
|
5951
|
+
// <SidebarTrigger>
|
|
5952
|
+
// <template #icon><PanelLeftClose /></template>
|
|
5953
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
5954
|
+
// </SidebarTrigger>
|
|
5727
5955
|
\`\`\`
|
|
5728
5956
|
|
|
5957
|
+
**Common mistakes:**
|
|
5958
|
+
- ❌ \`Vue: passing icon/collapsedIcon as props on SidebarTrigger\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
5959
|
+
|
|
5729
5960
|
---
|
|
5730
5961
|
|
|
5731
5962
|
### Skeleton
|
|
@@ -6283,6 +6514,9 @@ If you generate these, you are hallucinating.
|
|
|
6283
6514
|
- ❌ \`<Accordion Accordion without AccordionItem>\` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
6284
6515
|
- ❌ \`<Alert variant="error">\` → Use variant="danger"
|
|
6285
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
|
|
6286
6520
|
- ❌ \`<Avatar size="xs">\` → Use size="sm"
|
|
6287
6521
|
- ❌ \`<Avatar size="2xl">\` → Use size="xl"
|
|
6288
6522
|
- ❌ \`<Badge variant="primary">\` → Use variant="accent" for brand color
|
|
@@ -6317,6 +6551,7 @@ If you generate these, you are hallucinating.
|
|
|
6317
6551
|
- ❌ \`<Popover placement="top-center">\` → Use placement="top" for centered placement
|
|
6318
6552
|
- ❌ \`<Progress value > 100>\` → Normalize your value to 0–100 range before passing
|
|
6319
6553
|
- ❌ \`<Select Passing strings directly as children>\` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
6554
|
+
- ❌ \`<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>\` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
6320
6555
|
- ❌ \`<Toast Rendering <Toast> directly in JSX>\` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
6321
6556
|
- ❌ \`<Toast variant="error">\` → Use variant="danger"
|
|
6322
6557
|
- ❌ \`<Toast variant="info">\` → Use variant="default"
|
|
@@ -6508,6 +6743,79 @@ export const schema = {
|
|
|
6508
6743
|
}
|
|
6509
6744
|
]
|
|
6510
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
|
+
},
|
|
6511
6819
|
"Avatar": {
|
|
6512
6820
|
"description": "User profile image with fallback initials or icon.",
|
|
6513
6821
|
"import": "import { Avatar } from \"@usevyre/react\"",
|
|
@@ -7613,7 +7921,8 @@ export const schema = {
|
|
|
7613
7921
|
"SidebarContent",
|
|
7614
7922
|
"SidebarSection",
|
|
7615
7923
|
"SidebarItem",
|
|
7616
|
-
"SidebarFooter"
|
|
7924
|
+
"SidebarFooter",
|
|
7925
|
+
"SidebarTrigger"
|
|
7617
7926
|
],
|
|
7618
7927
|
"props": {
|
|
7619
7928
|
"variant": {
|
|
@@ -7623,12 +7932,31 @@ export const schema = {
|
|
|
7623
7932
|
"floating"
|
|
7624
7933
|
],
|
|
7625
7934
|
"default": "default"
|
|
7935
|
+
},
|
|
7936
|
+
"SidebarTrigger.icon": {
|
|
7937
|
+
"type": "ReactNode",
|
|
7938
|
+
"description": "Icon shown when the sidebar is expanded. Optional — defaults to the built-in menu icon. Vue: #icon slot."
|
|
7939
|
+
},
|
|
7940
|
+
"SidebarTrigger.collapsedIcon": {
|
|
7941
|
+
"type": "ReactNode",
|
|
7942
|
+
"description": "Icon shown when the sidebar is collapsed. Optional — falls back to icon, then the built-in icon. Vue: #collapsed-icon slot. Use a different glyph here to signal collapsed state (common UX pattern)."
|
|
7626
7943
|
}
|
|
7627
7944
|
},
|
|
7628
7945
|
"examples": [
|
|
7629
7946
|
{
|
|
7630
7947
|
"description": "App layout with sidebar",
|
|
7631
7948
|
"code": "<AppLayout>\n <Sidebar>\n <SidebarHeader>Logo</SidebarHeader>\n <SidebarContent>\n <SidebarSection heading=\"Main\">\n <SidebarItem href=\"/\" active>Dashboard</SidebarItem>\n <SidebarItem href=\"/settings\">Settings</SidebarItem>\n </SidebarSection>\n </SidebarContent>\n <SidebarFooter><Avatar fallback=\"JD\" size=\"sm\" /></SidebarFooter>\n </Sidebar>\n <main>Page content</main>\n</AppLayout>"
|
|
7949
|
+
},
|
|
7950
|
+
{
|
|
7951
|
+
"description": "SidebarTrigger with distinct open/collapsed icons",
|
|
7952
|
+
"code": "<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />\n\n// Vue:\n// <SidebarTrigger>\n// <template #icon><PanelLeftClose /></template>\n// <template #collapsed-icon><PanelLeftOpen /></template>\n// </SidebarTrigger>"
|
|
7953
|
+
}
|
|
7954
|
+
],
|
|
7955
|
+
"antiPatterns": [
|
|
7956
|
+
{
|
|
7957
|
+
"pattern": "Vue: passing icon/collapsedIcon as props on SidebarTrigger",
|
|
7958
|
+
"reason": "Vue SidebarTrigger customises icons via slots, not props (consistent with SidebarItem)",
|
|
7959
|
+
"fix": "Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props"
|
|
7632
7960
|
}
|
|
7633
7961
|
]
|
|
7634
7962
|
},
|
|
@@ -8627,6 +8955,27 @@ export const antiPatterns = {
|
|
|
8627
8955
|
"fix": "Use variant=\"info\" | \"success\" | \"warning\" | \"danger\"",
|
|
8628
8956
|
"severity": "error"
|
|
8629
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
|
+
},
|
|
8630
8979
|
{
|
|
8631
8980
|
"component": "Avatar",
|
|
8632
8981
|
"pattern": "size=\"xs\"",
|
|
@@ -8865,6 +9214,13 @@ export const antiPatterns = {
|
|
|
8865
9214
|
"fix": "Pass options={[{ value: 'a', label: 'Option A' }]}",
|
|
8866
9215
|
"severity": "error"
|
|
8867
9216
|
},
|
|
9217
|
+
{
|
|
9218
|
+
"component": "Sidebar",
|
|
9219
|
+
"pattern": "Vue: passing icon/collapsedIcon as props on SidebarTrigger",
|
|
9220
|
+
"reason": "Vue SidebarTrigger customises icons via slots, not props (consistent with SidebarItem)",
|
|
9221
|
+
"fix": "Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props",
|
|
9222
|
+
"severity": "error"
|
|
9223
|
+
},
|
|
8868
9224
|
{
|
|
8869
9225
|
"component": "Toast",
|
|
8870
9226
|
"pattern": "Rendering <Toast> directly in JSX",
|
|
@@ -9109,7 +9465,7 @@ export const antiPatterns = {
|
|
|
9109
9465
|
export const versionInfo = {
|
|
9110
9466
|
"version": "1.2.0",
|
|
9111
9467
|
"packageVersion": "1.1.0",
|
|
9112
|
-
"generatedAt": "2026-05-
|
|
9468
|
+
"generatedAt": "2026-05-17T14:01:21.768Z",
|
|
9113
9469
|
"validFor": [
|
|
9114
9470
|
"@usevyre/react@1.1.0+",
|
|
9115
9471
|
"@usevyre/vue@1.1.0+"
|
|
@@ -9156,6 +9512,13 @@ export const versionInfo = {
|
|
|
9156
9512
|
"stable": true,
|
|
9157
9513
|
"changelog": null
|
|
9158
9514
|
},
|
|
9515
|
+
"AlertDialog": {
|
|
9516
|
+
"version": "1.1.0",
|
|
9517
|
+
"lastUpdated": "2026-05-16",
|
|
9518
|
+
"breaking": false,
|
|
9519
|
+
"stable": true,
|
|
9520
|
+
"changelog": null
|
|
9521
|
+
},
|
|
9159
9522
|
"Avatar": {
|
|
9160
9523
|
"version": "1.1.0",
|
|
9161
9524
|
"lastUpdated": "2026-05-16",
|
|
@@ -9449,6 +9812,7 @@ export const versionInfo = {
|
|
|
9449
9812
|
export const cheatSheets = {
|
|
9450
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",
|
|
9451
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",
|
|
9452
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",
|
|
9453
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",
|
|
9454
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",
|
|
@@ -9471,7 +9835,7 @@ export const cheatSheets = {
|
|
|
9471
9835
|
"Select": "# Select — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Dropdown for selecting one option from a list.**\n\n```ts\nimport { Select } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `size` | `\"sm\"` \\| `\"md\"` \\| `\"lg\"` | `md` |\n| `disabled` | `true` \\| `false` | `false` |\n\n## Common AI Mistakes\n\n- ❌ `Passing strings directly as children`\n → Pass options={[{ value: 'a', label: 'Option A' }]}\n\n## Examples\n\n**Controlled select**\n```tsx\n<Select\n options={[{ value: 'react', label: 'React' }, { value: 'vue', label: 'Vue' }]}\n value={framework}\n onChange={setFramework}\n placeholder=\"Choose framework\"\n/>\n```\n",
|
|
9472
9836
|
"Separator": "# Separator — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Horizontal or vertical divider line.**\n\n```ts\nimport { Separator } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `orientation` | `\"horizontal\"` \\| `\"vertical\"` | `horizontal` |\n\n## Examples\n\n**Horizontal separator**\n```tsx\n<Separator />\n```\n\n**Vertical separator**\n```tsx\n<Separator orientation=\"vertical\" />\n```\n",
|
|
9473
9837
|
"Sheet": "# Sheet — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Side panel (drawer) that slides in from the edge. For forms, detail views, or settings.**\n\n```ts\nimport { Sheet, SheetHeader, SheetBody, SheetFooter } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `size` | `\"sm\"` \\| `\"md\"` \\| `\"lg\"` \\| `\"full\"` | `md` |\n| `side` | `\"left\"` \\| `\"right\"` | `right` |\n| `open` | `true` \\| `false` | — |\n\n## Examples\n\n**Settings sheet from the right**\n```tsx\n<Sheet open={isOpen} onClose={() => setIsOpen(false)} title=\"Settings\" side=\"right\">\n <SheetBody>Settings content here.</SheetBody>\n <SheetFooter>\n <Button variant=\"accent\">Save</Button>\n </SheetFooter>\n</Sheet>\n```\n",
|
|
9474
|
-
"Sidebar": "# Sidebar — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**App navigation sidebar. Use AppLayout as the root layout wrapper.**\n\n```ts\nimport { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, SidebarItem, SidebarFooter } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `variant` | `\"default\"` \\| `\"floating\"` | `default` |\n\n## Examples\n\n**App layout with sidebar**\n```tsx\n<AppLayout>\n <Sidebar>\n <SidebarHeader>Logo</SidebarHeader>\n <SidebarContent>\n <SidebarSection heading=\"Main\">\n <SidebarItem href=\"/\" active>Dashboard</SidebarItem>\n <SidebarItem href=\"/settings\">Settings</SidebarItem>\n </SidebarSection>\n </SidebarContent>\n <SidebarFooter><Avatar fallback=\"JD\" size=\"sm\" /></SidebarFooter>\n </Sidebar>\n <main>Page content</main>\n</AppLayout>\n```\n",
|
|
9838
|
+
"Sidebar": "# Sidebar — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**App navigation sidebar. Use AppLayout as the root layout wrapper.**\n\n```ts\nimport { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, SidebarItem, SidebarFooter } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `variant` | `\"default\"` \\| `\"floating\"` | `default` |\n\n## Common AI Mistakes\n\n- ❌ `Vue: passing icon/collapsedIcon as props on SidebarTrigger`\n → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props\n\n## Examples\n\n**App layout with sidebar**\n```tsx\n<AppLayout>\n <Sidebar>\n <SidebarHeader>Logo</SidebarHeader>\n <SidebarContent>\n <SidebarSection heading=\"Main\">\n <SidebarItem href=\"/\" active>Dashboard</SidebarItem>\n <SidebarItem href=\"/settings\">Settings</SidebarItem>\n </SidebarSection>\n </SidebarContent>\n <SidebarFooter><Avatar fallback=\"JD\" size=\"sm\" /></SidebarFooter>\n </Sidebar>\n <main>Page content</main>\n</AppLayout>\n```\n\n**SidebarTrigger with distinct open/collapsed icons**\n```tsx\n<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />\n\n// Vue:\n// <SidebarTrigger>\n// <template #icon><PanelLeftClose /></template>\n// <template #collapsed-icon><PanelLeftOpen /></template>\n// </SidebarTrigger>\n```\n",
|
|
9475
9839
|
"Skeleton": "# Skeleton — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Loading placeholder that mimics the shape of content while data loads.**\n\n```ts\nimport { Skeleton } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `variant` | `\"rect\"` \\| `\"circle\"` \\| `\"text\"` | `rect` |\n\n## Examples\n\n**Avatar skeleton**\n```tsx\n<Skeleton variant=\"circle\" width={40} height={40} />\n```\n\n**Text line skeletons**\n```tsx\n<Skeleton variant=\"text\" width=\"100%\" />\n<Skeleton variant=\"text\" width=\"60%\" />\n```\n",
|
|
9476
9840
|
"Slider": "# Slider — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Range input for selecting a numeric value within a range.**\n\n```ts\nimport { Slider } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `size` | `\"sm\"` \\| `\"md\"` | `md` |\n| `disabled` | `true` \\| `false` | `false` |\n\n## Examples\n\n**Volume slider**\n```tsx\n<Slider value={volume} onChange={setVolume} min={0} max={100} step={5} />\n```\n",
|
|
9477
9841
|
"Switch": "# Switch — AI Cheat Sheet\n> Quick reference for Claude / Cursor / Copilot\n\n**Toggle switch for boolean on/off settings.**\n\n```ts\nimport { Switch } from \"@usevyre/react\"\n```\n\n## Valid Props\n\n| Prop | Values | Default |\n|------|--------|---------|\n| `size` | `\"sm\"` \\| `\"md\"` | `md` |\n| `checked` | `true` \\| `false` | — |\n| `disabled` | `true` \\| `false` | `false` |\n\n## Examples\n\n**Notifications toggle**\n```tsx\n<label style={{ display: 'flex', alignItems: 'center', gap: 'var(--vyre-spacing-2)' }}>\n <Switch checked={notifications} onChange={setNotifications} />\n Enable notifications\n</label>\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\"",
|
|
@@ -1211,7 +1284,8 @@
|
|
|
1211
1284
|
"SidebarContent",
|
|
1212
1285
|
"SidebarSection",
|
|
1213
1286
|
"SidebarItem",
|
|
1214
|
-
"SidebarFooter"
|
|
1287
|
+
"SidebarFooter",
|
|
1288
|
+
"SidebarTrigger"
|
|
1215
1289
|
],
|
|
1216
1290
|
"props": {
|
|
1217
1291
|
"variant": {
|
|
@@ -1221,12 +1295,31 @@
|
|
|
1221
1295
|
"floating"
|
|
1222
1296
|
],
|
|
1223
1297
|
"default": "default"
|
|
1298
|
+
},
|
|
1299
|
+
"SidebarTrigger.icon": {
|
|
1300
|
+
"type": "ReactNode",
|
|
1301
|
+
"description": "Icon shown when the sidebar is expanded. Optional — defaults to the built-in menu icon. Vue: #icon slot."
|
|
1302
|
+
},
|
|
1303
|
+
"SidebarTrigger.collapsedIcon": {
|
|
1304
|
+
"type": "ReactNode",
|
|
1305
|
+
"description": "Icon shown when the sidebar is collapsed. Optional — falls back to icon, then the built-in icon. Vue: #collapsed-icon slot. Use a different glyph here to signal collapsed state (common UX pattern)."
|
|
1224
1306
|
}
|
|
1225
1307
|
},
|
|
1226
1308
|
"examples": [
|
|
1227
1309
|
{
|
|
1228
1310
|
"description": "App layout with sidebar",
|
|
1229
1311
|
"code": "<AppLayout>\n <Sidebar>\n <SidebarHeader>Logo</SidebarHeader>\n <SidebarContent>\n <SidebarSection heading=\"Main\">\n <SidebarItem href=\"/\" active>Dashboard</SidebarItem>\n <SidebarItem href=\"/settings\">Settings</SidebarItem>\n </SidebarSection>\n </SidebarContent>\n <SidebarFooter><Avatar fallback=\"JD\" size=\"sm\" /></SidebarFooter>\n </Sidebar>\n <main>Page content</main>\n</AppLayout>"
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
"description": "SidebarTrigger with distinct open/collapsed icons",
|
|
1315
|
+
"code": "<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />\n\n// Vue:\n// <SidebarTrigger>\n// <template #icon><PanelLeftClose /></template>\n// <template #collapsed-icon><PanelLeftOpen /></template>\n// </SidebarTrigger>"
|
|
1316
|
+
}
|
|
1317
|
+
],
|
|
1318
|
+
"antiPatterns": [
|
|
1319
|
+
{
|
|
1320
|
+
"pattern": "Vue: passing icon/collapsedIcon as props on SidebarTrigger",
|
|
1321
|
+
"reason": "Vue SidebarTrigger customises icons via slots, not props (consistent with SidebarItem)",
|
|
1322
|
+
"fix": "Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props"
|
|
1230
1323
|
}
|
|
1231
1324
|
]
|
|
1232
1325
|
},
|
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-
|
|
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.
|
|
@@ -794,6 +833,8 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
794
833
|
|
|
795
834
|
// Props:
|
|
796
835
|
// variant = "default" | "floating" (default: default)
|
|
836
|
+
// SidebarTrigger.icon = ReactNode
|
|
837
|
+
// SidebarTrigger.collapsedIcon = ReactNode
|
|
797
838
|
|
|
798
839
|
// Examples:
|
|
799
840
|
<AppLayout>
|
|
@@ -809,8 +850,18 @@ import { AppLayout, Sidebar, SidebarHeader, SidebarContent, SidebarSection, Side
|
|
|
809
850
|
</Sidebar>
|
|
810
851
|
<main>Page content</main>
|
|
811
852
|
</AppLayout>
|
|
853
|
+
<SidebarTrigger icon={<PanelLeftClose />} collapsedIcon={<PanelLeftOpen />} />
|
|
854
|
+
|
|
855
|
+
// Vue:
|
|
856
|
+
// <SidebarTrigger>
|
|
857
|
+
// <template #icon><PanelLeftClose /></template>
|
|
858
|
+
// <template #collapsed-icon><PanelLeftOpen /></template>
|
|
859
|
+
// </SidebarTrigger>
|
|
812
860
|
```
|
|
813
861
|
|
|
862
|
+
**Common mistakes:**
|
|
863
|
+
- ❌ `Vue: passing icon/collapsedIcon as props on SidebarTrigger` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
864
|
+
|
|
814
865
|
---
|
|
815
866
|
|
|
816
867
|
### Skeleton
|
|
@@ -1368,6 +1419,9 @@ If you generate these, you are hallucinating.
|
|
|
1368
1419
|
- ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
|
|
1369
1420
|
- ❌ `<Alert variant="error">` → Use variant="danger"
|
|
1370
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
|
|
1371
1425
|
- ❌ `<Avatar size="xs">` → Use size="sm"
|
|
1372
1426
|
- ❌ `<Avatar size="2xl">` → Use size="xl"
|
|
1373
1427
|
- ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
|
|
@@ -1402,6 +1456,7 @@ If you generate these, you are hallucinating.
|
|
|
1402
1456
|
- ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
|
|
1403
1457
|
- ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
|
|
1404
1458
|
- ❌ `<Select Passing strings directly as children>` → Pass options={[{ value: 'a', label: 'Option A' }]}
|
|
1459
|
+
- ❌ `<Sidebar Vue: passing icon/collapsedIcon as props on SidebarTrigger>` → Use <template #icon> and <template #collapsed-icon>; React uses icon / collapsedIcon props
|
|
1405
1460
|
- ❌ `<Toast Rendering <Toast> directly in JSX>` → Use: const { toast } = useToast(); then toast({ title, variant })
|
|
1406
1461
|
- ❌ `<Toast variant="error">` → Use variant="danger"
|
|
1407
1462
|
- ❌ `<Toast variant="info">` → Use variant="default"
|