@usevyre/ai-context 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  # useVyre Design System Context
2
- # Version: 1.2.0
2
+ # Version: 1.6.0
3
3
 
4
4
  You are working in a codebase that uses the useVyre design system.
5
5
  Follow the rules below strictly when writing any UI code.
@@ -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.
@@ -306,6 +345,7 @@ import { Button } from "@usevyre/react"
306
345
  - ❌ `color="..."` → Use variant prop instead
307
346
  - ❌ `icon={...}` → Use leftIcon={...} or rightIcon={...}
308
347
  - ❌ `size="icon" without aria-label` → Add aria-label describing the action
348
+ - ❌ `padding / margin / marginTop (any spacing prop) on a useVyre component` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
309
349
 
310
350
  ---
311
351
 
@@ -391,6 +431,7 @@ import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
391
431
 
392
432
  **Common mistakes:**
393
433
  - ❌ `variant="primary"` → Use variant="elevated" | "outlined" | "ghost" | "accent"
434
+ - ❌ `padding / margin / marginTop (any spacing prop) on a useVyre component` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
394
435
 
395
436
  ---
396
437
 
@@ -602,6 +643,7 @@ import { Input } from "@usevyre/react"
602
643
  - ❌ `size="icon"` → Use size="sm" | "md" | "lg"
603
644
  - ❌ `type="search" for search UI` → Import Command from @usevyre/react for search palettes
604
645
  - ❌ `Vue: binding Input/Textarea value without v-model` → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
646
+ - ❌ `padding / margin / marginTop (any spacing prop) on a useVyre component` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
605
647
 
606
648
  ---
607
649
 
@@ -1344,6 +1386,157 @@ const messages = [
1344
1386
 
1345
1387
  ---
1346
1388
 
1389
+ ### Stack
1390
+
1391
+ Full one-dimensional flex layout primitive. USE INSTEAD OF <div style={{display:'flex'}}>. Covers the whole CSS flexbox surface (direction incl. reverse, wrap, align/justify/alignContent/alignSelf, grow/shrink/basis, per-axis gap) with token-locked spacing. Renders a plain <div> (or `as`).
1392
+
1393
+ ```tsx
1394
+ import { Stack } from "@usevyre/react"
1395
+
1396
+ // Props:
1397
+ // direction = "row" | "column" | "row-reverse" | "column-reverse" (default: row)
1398
+ // inline = boolean (default: false)
1399
+ // gap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" (default: md)
1400
+ // rowGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1401
+ // columnGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1402
+ // align = "start" | "center" | "end" | "stretch" | "baseline" (default: stretch)
1403
+ // justify = "start" | "center" | "end" | "between" | "around" | "evenly" (default: start)
1404
+ // alignContent = "start" | "center" | "end" | "stretch" | "between" | "around" | "evenly"
1405
+ // alignSelf = "auto" | "start" | "center" | "end" | "stretch" | "baseline"
1406
+ // wrap = "nowrap" | "wrap" | "wrap-reverse" (default: nowrap)
1407
+ // grow = number
1408
+ // shrink = number
1409
+ // basis = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "auto" | "content" | "0"
1410
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1411
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1412
+ // as = string (default: div)
1413
+
1414
+ // Examples:
1415
+ <Stack direction="row" gap="md" align="center" justify="between">
1416
+ <Avatar src={user.avatar} />
1417
+ <Text>{user.name}</Text>
1418
+ <Button>Edit</Button>
1419
+ </Stack>
1420
+ <Stack wrap="wrap" rowGap="lg" columnGap="md">
1421
+ {tags.map((t) => <Tag key={t}>{t}</Tag>)}
1422
+ </Stack>
1423
+ ```
1424
+
1425
+ **Common mistakes:**
1426
+ - ❌ `<div style={{ display: 'flex', gap: 12 }}>` → Use <Stack gap="md"> — gap is a token
1427
+ - ❌ `gap={12} or gap="12px"` → Use gap="none|xs|sm|md|lg|xl|2xl"
1428
+ - ❌ `direction="vertical" / "horizontal"` → Use direction="row" or "column" (also row-reverse / column-reverse)
1429
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1430
+
1431
+ ---
1432
+
1433
+ ### Grid
1434
+
1435
+ Two-dimensional CSS grid primitive. Explicit column/row counts (or auto-fit), auto-flow control, token gap. Pair with GridItem for cell spanning/placement. Renders a plain <div> (or `as`).
1436
+
1437
+ ```tsx
1438
+ import { Grid, GridItem } from "@usevyre/react"
1439
+
1440
+ // Props:
1441
+ // columns = number | "auto-fit" (default: 1)
1442
+ // rows = number | "auto"
1443
+ // flow = "row" | "column" | "dense" | "row-dense" | "column-dense"
1444
+ // gap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" (default: md)
1445
+ // rowGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1446
+ // columnGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1447
+ // align = "start" | "center" | "end" | "stretch" (default: stretch)
1448
+ // justify = "start" | "center" | "end" | "stretch"
1449
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1450
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1451
+ // as = string (default: div)
1452
+
1453
+ // Examples:
1454
+ <Grid columns={3} gap="lg">
1455
+ <GridItem colSpan={2}><Card>Wide</Card></GridItem>
1456
+ <Card>Two</Card>
1457
+ <Card>Three</Card>
1458
+ </Grid>
1459
+ <Grid columns="auto-fit" gap="md">
1460
+ {items.map((i) => <Card key={i.id}>{i.title}</Card>)}
1461
+ </Grid>
1462
+ ```
1463
+
1464
+ **Common mistakes:**
1465
+ - ❌ `<div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr' }}>` → Use <Grid columns={3} gap="md">
1466
+ - ❌ `columns="3" (string)` → Use columns={3} or columns="auto-fit"
1467
+ - ❌ `Nested div with inline grid-column for spanning` → Wrap the cell in <GridItem colSpan={2}>
1468
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1469
+
1470
+ ---
1471
+
1472
+ ### GridItem
1473
+
1474
+ Child placement inside <Grid>. Sets column/row span and start lines. Renders a plain <div> (or `as`).
1475
+
1476
+ ```tsx
1477
+ import { GridItem } from "@usevyre/react"
1478
+
1479
+ // Props:
1480
+ // colSpan = number
1481
+ // rowSpan = number
1482
+ // colStart = number
1483
+ // rowStart = number
1484
+ // as = string (default: div)
1485
+
1486
+ // Examples:
1487
+ <Grid columns={4} gap="md">
1488
+ <GridItem colSpan={2}>Featured</GridItem>
1489
+ <div>a</div>
1490
+ <div>b</div>
1491
+ </Grid>
1492
+ ```
1493
+
1494
+ **Common mistakes:**
1495
+ - ❌ `GridItem outside a Grid` → Place <GridItem> directly inside <Grid>
1496
+
1497
+ ---
1498
+
1499
+ ### Box
1500
+
1501
+ Spacing-only container plus a controlled escape hatch. Token padding/margin with shorthand, per-axis (X/Y) and per-side (Top/Right/Bottom/Left) overrides. The `style` prop is an explicit anti-pattern escape hatch. Renders a plain <div> (or `as`).
1502
+
1503
+ ```tsx
1504
+ import { Box } from "@usevyre/react"
1505
+
1506
+ // Props:
1507
+ // padding = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1508
+ // paddingX = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1509
+ // paddingY = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1510
+ // paddingTop = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1511
+ // paddingRight = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1512
+ // paddingBottom = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1513
+ // paddingLeft = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1514
+ // margin = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1515
+ // marginX = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1516
+ // marginY = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1517
+ // marginTop = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1518
+ // marginRight = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1519
+ // marginBottom = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1520
+ // marginLeft = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1521
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1522
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1523
+ // as = string (default: div)
1524
+ // style = React.CSSProperties
1525
+
1526
+ // Examples:
1527
+ <Box as="section" paddingX="lg" paddingY="md">
1528
+ <Heading>Settings</Heading>
1529
+ </Box>
1530
+ <Box marginTop="xl"><Separator /></Box>
1531
+ ```
1532
+
1533
+ **Common mistakes:**
1534
+ - ❌ `<Box style={{ padding: 16 }}>` → Use <Box padding="md"> (or paddingX/paddingTop/...)
1535
+ - ❌ `Using Box for flex/grid layout` → Use <Stack> or <Grid>
1536
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1537
+
1538
+ ---
1539
+
1347
1540
  ### DateRangePicker
1348
1541
 
1349
1542
  Start/end date range picker. Built on Calendar (mode=range) with a friendlier { from, to } object API, a two-month side-by-side view, and preset shortcuts. Use this for report/filter date ranges; use DatePicker for a single date.
@@ -1383,6 +1576,9 @@ If you generate these, you are hallucinating.
1383
1576
  - ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
1384
1577
  - ❌ `<Alert variant="error">` → Use variant="danger"
1385
1578
  - ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
1579
+ - ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
1580
+ - ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
1581
+ - ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
1386
1582
  - ❌ `<Avatar size="xs">` → Use size="sm"
1387
1583
  - ❌ `<Avatar size="2xl">` → Use size="xl"
1388
1584
  - ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
@@ -1394,11 +1590,13 @@ If you generate these, you are hallucinating.
1394
1590
  - ❌ `<Button color="...">` → Use variant prop instead
1395
1591
  - ❌ `<Button icon={...}>` → Use leftIcon={...} or rightIcon={...}
1396
1592
  - ❌ `<Button size="icon" without aria-label>` → Add aria-label describing the action
1593
+ - ❌ `<Button padding / margin / marginTop (any spacing prop) on a useVyre component>` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
1397
1594
  - ❌ `<Calendar Calendar for an input field that opens a popover>` → Use <DatePicker /> (single date) or <DateRangePicker /> (range)
1398
1595
  - ❌ `<Calendar value as tuple for mode="single">` → Pass value matching mode; use mode="range" for [start,end]
1399
1596
  - ❌ `<DatePicker DatePicker mode="range" for { from, to } object>` → Use <DateRangePicker /> for the { from, to } object API + presets + dual month
1400
1597
  - ❌ `<DatePicker DatePicker without value/onChange>` → Provide value and onChange (e.g. from useState)
1401
1598
  - ❌ `<Card variant="primary">` → Use variant="elevated" | "outlined" | "ghost" | "accent"
1599
+ - ❌ `<Card padding / margin / marginTop (any spacing prop) on a useVyre component>` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
1402
1600
  - ❌ `<Checkbox size="lg">` → Use size="md"
1403
1601
  - ❌ `<RadioGroup <Radio> used outside a <RadioGroup>>` → Always wrap <Radio> in <RadioGroup>
1404
1602
  - ❌ `<RadioGroup RadioGroup without value/onChange (React) or v-model (Vue)>` → Bind value + onChange (React) or v-model (Vue); or defaultValue for uncontrolled in React
@@ -1413,6 +1611,7 @@ If you generate these, you are hallucinating.
1413
1611
  - ❌ `<Input size="icon">` → Use size="sm" | "md" | "lg"
1414
1612
  - ❌ `<Input type="search" for search UI>` → Import Command from @usevyre/react for search palettes
1415
1613
  - ❌ `<Input Vue: binding Input/Textarea value without v-model>` → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
1614
+ - ❌ `<Input padding / margin / marginTop (any spacing prop) on a useVyre component>` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
1416
1615
  - ❌ `<Modal size="xl">` → Use size="lg" or size="full"
1417
1616
  - ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
1418
1617
  - ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
@@ -1449,6 +1648,18 @@ If you generate these, you are hallucinating.
1449
1648
  - ❌ `<Conversation Expecting Conversation to store/append messages>` → Append to your own state in onSend (or @send) and pass it back via value
1450
1649
  - ❌ `<Conversation composer without onSend (React) / @send (Vue)>` → Provide onSend / @send to append the message to value
1451
1650
  - ❌ `<Conversation Treating onSend as (text) only when using allowAttachments>` → Handle onSend(text, files) — map files to message attachments and append
1651
+ - ❌ `<Stack <div style={{ display: 'flex', gap: 12 }}>>` → Use <Stack gap="md"> — gap is a token
1652
+ - ❌ `<Stack gap={12} or gap="12px">` → Use gap="none|xs|sm|md|lg|xl|2xl"
1653
+ - ❌ `<Stack direction="vertical" / "horizontal">` → Use direction="row" or "column" (also row-reverse / column-reverse)
1654
+ - ❌ `<Stack style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1655
+ - ❌ `<Grid <div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr' }}>>` → Use <Grid columns={3} gap="md">
1656
+ - ❌ `<Grid columns="3" (string)>` → Use columns={3} or columns="auto-fit"
1657
+ - ❌ `<Grid Nested div with inline grid-column for spanning>` → Wrap the cell in <GridItem colSpan={2}>
1658
+ - ❌ `<Grid style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1659
+ - ❌ `<GridItem GridItem outside a Grid>` → Place <GridItem> directly inside <Grid>
1660
+ - ❌ `<Box <Box style={{ padding: 16 }}>>` → Use <Box padding="md"> (or paddingX/paddingTop/...)
1661
+ - ❌ `<Box Using Box for flex/grid layout>` → Use <Stack> or <Grid>
1662
+ - ❌ `<Box style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1452
1663
  - ❌ `<DateRangePicker value={[from, to]}>` → Use value={{ from, to }} and read range.from / range.to
1453
1664
  - ❌ `<DateRangePicker DateRangePicker for a single date>` → Use <DatePicker /> for a single date
1454
1665
  - ❌ `<DateRangePicker presets="true" (string)>` → Use the bare prop: presets (or presets={true})
@@ -1,5 +1,5 @@
1
1
  # useVyre Copilot Instructions
2
- # Version: 1.2.0
2
+ # Version: 1.6.0
3
3
 
4
4
  When generating UI code in this project, follow the useVyre design system rules below.
5
5
 
@@ -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.
@@ -305,6 +344,7 @@ import { Button } from "@usevyre/react"
305
344
  - ❌ `color="..."` → Use variant prop instead
306
345
  - ❌ `icon={...}` → Use leftIcon={...} or rightIcon={...}
307
346
  - ❌ `size="icon" without aria-label` → Add aria-label describing the action
347
+ - ❌ `padding / margin / marginTop (any spacing prop) on a useVyre component` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
308
348
 
309
349
  ---
310
350
 
@@ -390,6 +430,7 @@ import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
390
430
 
391
431
  **Common mistakes:**
392
432
  - ❌ `variant="primary"` → Use variant="elevated" | "outlined" | "ghost" | "accent"
433
+ - ❌ `padding / margin / marginTop (any spacing prop) on a useVyre component` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
393
434
 
394
435
  ---
395
436
 
@@ -601,6 +642,7 @@ import { Input } from "@usevyre/react"
601
642
  - ❌ `size="icon"` → Use size="sm" | "md" | "lg"
602
643
  - ❌ `type="search" for search UI` → Import Command from @usevyre/react for search palettes
603
644
  - ❌ `Vue: binding Input/Textarea value without v-model` → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
645
+ - ❌ `padding / margin / marginTop (any spacing prop) on a useVyre component` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
604
646
 
605
647
  ---
606
648
 
@@ -1343,6 +1385,157 @@ const messages = [
1343
1385
 
1344
1386
  ---
1345
1387
 
1388
+ ### Stack
1389
+
1390
+ Full one-dimensional flex layout primitive. USE INSTEAD OF <div style={{display:'flex'}}>. Covers the whole CSS flexbox surface (direction incl. reverse, wrap, align/justify/alignContent/alignSelf, grow/shrink/basis, per-axis gap) with token-locked spacing. Renders a plain <div> (or `as`).
1391
+
1392
+ ```tsx
1393
+ import { Stack } from "@usevyre/react"
1394
+
1395
+ // Props:
1396
+ // direction = "row" | "column" | "row-reverse" | "column-reverse" (default: row)
1397
+ // inline = boolean (default: false)
1398
+ // gap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" (default: md)
1399
+ // rowGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1400
+ // columnGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1401
+ // align = "start" | "center" | "end" | "stretch" | "baseline" (default: stretch)
1402
+ // justify = "start" | "center" | "end" | "between" | "around" | "evenly" (default: start)
1403
+ // alignContent = "start" | "center" | "end" | "stretch" | "between" | "around" | "evenly"
1404
+ // alignSelf = "auto" | "start" | "center" | "end" | "stretch" | "baseline"
1405
+ // wrap = "nowrap" | "wrap" | "wrap-reverse" (default: nowrap)
1406
+ // grow = number
1407
+ // shrink = number
1408
+ // basis = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "auto" | "content" | "0"
1409
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1410
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1411
+ // as = string (default: div)
1412
+
1413
+ // Examples:
1414
+ <Stack direction="row" gap="md" align="center" justify="between">
1415
+ <Avatar src={user.avatar} />
1416
+ <Text>{user.name}</Text>
1417
+ <Button>Edit</Button>
1418
+ </Stack>
1419
+ <Stack wrap="wrap" rowGap="lg" columnGap="md">
1420
+ {tags.map((t) => <Tag key={t}>{t}</Tag>)}
1421
+ </Stack>
1422
+ ```
1423
+
1424
+ **Common mistakes:**
1425
+ - ❌ `<div style={{ display: 'flex', gap: 12 }}>` → Use <Stack gap="md"> — gap is a token
1426
+ - ❌ `gap={12} or gap="12px"` → Use gap="none|xs|sm|md|lg|xl|2xl"
1427
+ - ❌ `direction="vertical" / "horizontal"` → Use direction="row" or "column" (also row-reverse / column-reverse)
1428
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1429
+
1430
+ ---
1431
+
1432
+ ### Grid
1433
+
1434
+ Two-dimensional CSS grid primitive. Explicit column/row counts (or auto-fit), auto-flow control, token gap. Pair with GridItem for cell spanning/placement. Renders a plain <div> (or `as`).
1435
+
1436
+ ```tsx
1437
+ import { Grid, GridItem } from "@usevyre/react"
1438
+
1439
+ // Props:
1440
+ // columns = number | "auto-fit" (default: 1)
1441
+ // rows = number | "auto"
1442
+ // flow = "row" | "column" | "dense" | "row-dense" | "column-dense"
1443
+ // gap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" (default: md)
1444
+ // rowGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1445
+ // columnGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1446
+ // align = "start" | "center" | "end" | "stretch" (default: stretch)
1447
+ // justify = "start" | "center" | "end" | "stretch"
1448
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1449
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1450
+ // as = string (default: div)
1451
+
1452
+ // Examples:
1453
+ <Grid columns={3} gap="lg">
1454
+ <GridItem colSpan={2}><Card>Wide</Card></GridItem>
1455
+ <Card>Two</Card>
1456
+ <Card>Three</Card>
1457
+ </Grid>
1458
+ <Grid columns="auto-fit" gap="md">
1459
+ {items.map((i) => <Card key={i.id}>{i.title}</Card>)}
1460
+ </Grid>
1461
+ ```
1462
+
1463
+ **Common mistakes:**
1464
+ - ❌ `<div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr' }}>` → Use <Grid columns={3} gap="md">
1465
+ - ❌ `columns="3" (string)` → Use columns={3} or columns="auto-fit"
1466
+ - ❌ `Nested div with inline grid-column for spanning` → Wrap the cell in <GridItem colSpan={2}>
1467
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1468
+
1469
+ ---
1470
+
1471
+ ### GridItem
1472
+
1473
+ Child placement inside <Grid>. Sets column/row span and start lines. Renders a plain <div> (or `as`).
1474
+
1475
+ ```tsx
1476
+ import { GridItem } from "@usevyre/react"
1477
+
1478
+ // Props:
1479
+ // colSpan = number
1480
+ // rowSpan = number
1481
+ // colStart = number
1482
+ // rowStart = number
1483
+ // as = string (default: div)
1484
+
1485
+ // Examples:
1486
+ <Grid columns={4} gap="md">
1487
+ <GridItem colSpan={2}>Featured</GridItem>
1488
+ <div>a</div>
1489
+ <div>b</div>
1490
+ </Grid>
1491
+ ```
1492
+
1493
+ **Common mistakes:**
1494
+ - ❌ `GridItem outside a Grid` → Place <GridItem> directly inside <Grid>
1495
+
1496
+ ---
1497
+
1498
+ ### Box
1499
+
1500
+ Spacing-only container plus a controlled escape hatch. Token padding/margin with shorthand, per-axis (X/Y) and per-side (Top/Right/Bottom/Left) overrides. The `style` prop is an explicit anti-pattern escape hatch. Renders a plain <div> (or `as`).
1501
+
1502
+ ```tsx
1503
+ import { Box } from "@usevyre/react"
1504
+
1505
+ // Props:
1506
+ // padding = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1507
+ // paddingX = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1508
+ // paddingY = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1509
+ // paddingTop = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1510
+ // paddingRight = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1511
+ // paddingBottom = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1512
+ // paddingLeft = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1513
+ // margin = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1514
+ // marginX = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1515
+ // marginY = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1516
+ // marginTop = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1517
+ // marginRight = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1518
+ // marginBottom = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1519
+ // marginLeft = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1520
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1521
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1522
+ // as = string (default: div)
1523
+ // style = React.CSSProperties
1524
+
1525
+ // Examples:
1526
+ <Box as="section" paddingX="lg" paddingY="md">
1527
+ <Heading>Settings</Heading>
1528
+ </Box>
1529
+ <Box marginTop="xl"><Separator /></Box>
1530
+ ```
1531
+
1532
+ **Common mistakes:**
1533
+ - ❌ `<Box style={{ padding: 16 }}>` → Use <Box padding="md"> (or paddingX/paddingTop/...)
1534
+ - ❌ `Using Box for flex/grid layout` → Use <Stack> or <Grid>
1535
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1536
+
1537
+ ---
1538
+
1346
1539
  ### DateRangePicker
1347
1540
 
1348
1541
  Start/end date range picker. Built on Calendar (mode=range) with a friendlier { from, to } object API, a two-month side-by-side view, and preset shortcuts. Use this for report/filter date ranges; use DatePicker for a single date.
@@ -1382,6 +1575,9 @@ If you generate these, you are hallucinating.
1382
1575
  - ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
1383
1576
  - ❌ `<Alert variant="error">` → Use variant="danger"
1384
1577
  - ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
1578
+ - ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
1579
+ - ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
1580
+ - ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
1385
1581
  - ❌ `<Avatar size="xs">` → Use size="sm"
1386
1582
  - ❌ `<Avatar size="2xl">` → Use size="xl"
1387
1583
  - ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
@@ -1393,11 +1589,13 @@ If you generate these, you are hallucinating.
1393
1589
  - ❌ `<Button color="...">` → Use variant prop instead
1394
1590
  - ❌ `<Button icon={...}>` → Use leftIcon={...} or rightIcon={...}
1395
1591
  - ❌ `<Button size="icon" without aria-label>` → Add aria-label describing the action
1592
+ - ❌ `<Button padding / margin / marginTop (any spacing prop) on a useVyre component>` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
1396
1593
  - ❌ `<Calendar Calendar for an input field that opens a popover>` → Use <DatePicker /> (single date) or <DateRangePicker /> (range)
1397
1594
  - ❌ `<Calendar value as tuple for mode="single">` → Pass value matching mode; use mode="range" for [start,end]
1398
1595
  - ❌ `<DatePicker DatePicker mode="range" for { from, to } object>` → Use <DateRangePicker /> for the { from, to } object API + presets + dual month
1399
1596
  - ❌ `<DatePicker DatePicker without value/onChange>` → Provide value and onChange (e.g. from useState)
1400
1597
  - ❌ `<Card variant="primary">` → Use variant="elevated" | "outlined" | "ghost" | "accent"
1598
+ - ❌ `<Card padding / margin / marginTop (any spacing prop) on a useVyre component>` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
1401
1599
  - ❌ `<Checkbox size="lg">` → Use size="md"
1402
1600
  - ❌ `<RadioGroup <Radio> used outside a <RadioGroup>>` → Always wrap <Radio> in <RadioGroup>
1403
1601
  - ❌ `<RadioGroup RadioGroup without value/onChange (React) or v-model (Vue)>` → Bind value + onChange (React) or v-model (Vue); or defaultValue for uncontrolled in React
@@ -1412,6 +1610,7 @@ If you generate these, you are hallucinating.
1412
1610
  - ❌ `<Input size="icon">` → Use size="sm" | "md" | "lg"
1413
1611
  - ❌ `<Input type="search" for search UI>` → Import Command from @usevyre/react for search palettes
1414
1612
  - ❌ `<Input Vue: binding Input/Textarea value without v-model>` → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
1613
+ - ❌ `<Input padding / margin / marginTop (any spacing prop) on a useVyre component>` → Space BETWEEN components with <Stack gap> / <Grid gap>; space AROUND a block with <Box padding/margin> wrapping it
1415
1614
  - ❌ `<Modal size="xl">` → Use size="lg" or size="full"
1416
1615
  - ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
1417
1616
  - ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
@@ -1448,6 +1647,18 @@ If you generate these, you are hallucinating.
1448
1647
  - ❌ `<Conversation Expecting Conversation to store/append messages>` → Append to your own state in onSend (or @send) and pass it back via value
1449
1648
  - ❌ `<Conversation composer without onSend (React) / @send (Vue)>` → Provide onSend / @send to append the message to value
1450
1649
  - ❌ `<Conversation Treating onSend as (text) only when using allowAttachments>` → Handle onSend(text, files) — map files to message attachments and append
1650
+ - ❌ `<Stack <div style={{ display: 'flex', gap: 12 }}>>` → Use <Stack gap="md"> — gap is a token
1651
+ - ❌ `<Stack gap={12} or gap="12px">` → Use gap="none|xs|sm|md|lg|xl|2xl"
1652
+ - ❌ `<Stack direction="vertical" / "horizontal">` → Use direction="row" or "column" (also row-reverse / column-reverse)
1653
+ - ❌ `<Stack style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1654
+ - ❌ `<Grid <div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr' }}>>` → Use <Grid columns={3} gap="md">
1655
+ - ❌ `<Grid columns="3" (string)>` → Use columns={3} or columns="auto-fit"
1656
+ - ❌ `<Grid Nested div with inline grid-column for spanning>` → Wrap the cell in <GridItem colSpan={2}>
1657
+ - ❌ `<Grid style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1658
+ - ❌ `<GridItem GridItem outside a Grid>` → Place <GridItem> directly inside <Grid>
1659
+ - ❌ `<Box <Box style={{ padding: 16 }}>>` → Use <Box padding="md"> (or paddingX/paddingTop/...)
1660
+ - ❌ `<Box Using Box for flex/grid layout>` → Use <Stack> or <Grid>
1661
+ - ❌ `<Box style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1451
1662
  - ❌ `<DateRangePicker value={[from, to]}>` → Use value={{ from, to }} and read range.from / range.to
1452
1663
  - ❌ `<DateRangePicker DateRangePicker for a single date>` → Use <DatePicker /> for a single date
1453
1664
  - ❌ `<DateRangePicker presets="true" (string)>` → Use the bare prop: presets (or presets={true})