@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 Rules for Windsurf
2
- # Version: 1.2.0
2
+ # Version: 1.6.0
3
3
 
4
4
  # useVyre Design System — AI Context
5
5
  # Version: 0.2.0
@@ -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.
@@ -303,6 +342,7 @@ import { Button } from "@usevyre/react"
303
342
  - ❌ `color="..."` → Use variant prop instead
304
343
  - ❌ `icon={...}` → Use leftIcon={...} or rightIcon={...}
305
344
  - ❌ `size="icon" without aria-label` → Add aria-label describing the action
345
+ - ❌ `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
306
346
 
307
347
  ---
308
348
 
@@ -388,6 +428,7 @@ import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
388
428
 
389
429
  **Common mistakes:**
390
430
  - ❌ `variant="primary"` → Use variant="elevated" | "outlined" | "ghost" | "accent"
431
+ - ❌ `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
391
432
 
392
433
  ---
393
434
 
@@ -599,6 +640,7 @@ import { Input } from "@usevyre/react"
599
640
  - ❌ `size="icon"` → Use size="sm" | "md" | "lg"
600
641
  - ❌ `type="search" for search UI` → Import Command from @usevyre/react for search palettes
601
642
  - ❌ `Vue: binding Input/Textarea value without v-model` → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
643
+ - ❌ `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
602
644
 
603
645
  ---
604
646
 
@@ -1341,6 +1383,157 @@ const messages = [
1341
1383
 
1342
1384
  ---
1343
1385
 
1386
+ ### Stack
1387
+
1388
+ 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`).
1389
+
1390
+ ```tsx
1391
+ import { Stack } from "@usevyre/react"
1392
+
1393
+ // Props:
1394
+ // direction = "row" | "column" | "row-reverse" | "column-reverse" (default: row)
1395
+ // inline = boolean (default: false)
1396
+ // gap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" (default: md)
1397
+ // rowGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1398
+ // columnGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1399
+ // align = "start" | "center" | "end" | "stretch" | "baseline" (default: stretch)
1400
+ // justify = "start" | "center" | "end" | "between" | "around" | "evenly" (default: start)
1401
+ // alignContent = "start" | "center" | "end" | "stretch" | "between" | "around" | "evenly"
1402
+ // alignSelf = "auto" | "start" | "center" | "end" | "stretch" | "baseline"
1403
+ // wrap = "nowrap" | "wrap" | "wrap-reverse" (default: nowrap)
1404
+ // grow = number
1405
+ // shrink = number
1406
+ // basis = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "auto" | "content" | "0"
1407
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1408
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1409
+ // as = string (default: div)
1410
+
1411
+ // Examples:
1412
+ <Stack direction="row" gap="md" align="center" justify="between">
1413
+ <Avatar src={user.avatar} />
1414
+ <Text>{user.name}</Text>
1415
+ <Button>Edit</Button>
1416
+ </Stack>
1417
+ <Stack wrap="wrap" rowGap="lg" columnGap="md">
1418
+ {tags.map((t) => <Tag key={t}>{t}</Tag>)}
1419
+ </Stack>
1420
+ ```
1421
+
1422
+ **Common mistakes:**
1423
+ - ❌ `<div style={{ display: 'flex', gap: 12 }}>` → Use <Stack gap="md"> — gap is a token
1424
+ - ❌ `gap={12} or gap="12px"` → Use gap="none|xs|sm|md|lg|xl|2xl"
1425
+ - ❌ `direction="vertical" / "horizontal"` → Use direction="row" or "column" (also row-reverse / column-reverse)
1426
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1427
+
1428
+ ---
1429
+
1430
+ ### Grid
1431
+
1432
+ 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`).
1433
+
1434
+ ```tsx
1435
+ import { Grid, GridItem } from "@usevyre/react"
1436
+
1437
+ // Props:
1438
+ // columns = number | "auto-fit" (default: 1)
1439
+ // rows = number | "auto"
1440
+ // flow = "row" | "column" | "dense" | "row-dense" | "column-dense"
1441
+ // gap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" (default: md)
1442
+ // rowGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1443
+ // columnGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1444
+ // align = "start" | "center" | "end" | "stretch" (default: stretch)
1445
+ // justify = "start" | "center" | "end" | "stretch"
1446
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1447
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1448
+ // as = string (default: div)
1449
+
1450
+ // Examples:
1451
+ <Grid columns={3} gap="lg">
1452
+ <GridItem colSpan={2}><Card>Wide</Card></GridItem>
1453
+ <Card>Two</Card>
1454
+ <Card>Three</Card>
1455
+ </Grid>
1456
+ <Grid columns="auto-fit" gap="md">
1457
+ {items.map((i) => <Card key={i.id}>{i.title}</Card>)}
1458
+ </Grid>
1459
+ ```
1460
+
1461
+ **Common mistakes:**
1462
+ - ❌ `<div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr' }}>` → Use <Grid columns={3} gap="md">
1463
+ - ❌ `columns="3" (string)` → Use columns={3} or columns="auto-fit"
1464
+ - ❌ `Nested div with inline grid-column for spanning` → Wrap the cell in <GridItem colSpan={2}>
1465
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1466
+
1467
+ ---
1468
+
1469
+ ### GridItem
1470
+
1471
+ Child placement inside <Grid>. Sets column/row span and start lines. Renders a plain <div> (or `as`).
1472
+
1473
+ ```tsx
1474
+ import { GridItem } from "@usevyre/react"
1475
+
1476
+ // Props:
1477
+ // colSpan = number
1478
+ // rowSpan = number
1479
+ // colStart = number
1480
+ // rowStart = number
1481
+ // as = string (default: div)
1482
+
1483
+ // Examples:
1484
+ <Grid columns={4} gap="md">
1485
+ <GridItem colSpan={2}>Featured</GridItem>
1486
+ <div>a</div>
1487
+ <div>b</div>
1488
+ </Grid>
1489
+ ```
1490
+
1491
+ **Common mistakes:**
1492
+ - ❌ `GridItem outside a Grid` → Place <GridItem> directly inside <Grid>
1493
+
1494
+ ---
1495
+
1496
+ ### Box
1497
+
1498
+ 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`).
1499
+
1500
+ ```tsx
1501
+ import { Box } from "@usevyre/react"
1502
+
1503
+ // Props:
1504
+ // padding = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1505
+ // paddingX = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1506
+ // paddingY = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1507
+ // paddingTop = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1508
+ // paddingRight = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1509
+ // paddingBottom = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1510
+ // paddingLeft = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1511
+ // margin = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1512
+ // marginX = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1513
+ // marginY = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1514
+ // marginTop = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1515
+ // marginRight = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1516
+ // marginBottom = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1517
+ // marginLeft = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1518
+ // width = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1519
+ // height = "auto" | "full" | "fit" | "screen" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
1520
+ // as = string (default: div)
1521
+ // style = React.CSSProperties
1522
+
1523
+ // Examples:
1524
+ <Box as="section" paddingX="lg" paddingY="md">
1525
+ <Heading>Settings</Heading>
1526
+ </Box>
1527
+ <Box marginTop="xl"><Separator /></Box>
1528
+ ```
1529
+
1530
+ **Common mistakes:**
1531
+ - ❌ `<Box style={{ padding: 16 }}>` → Use <Box padding="md"> (or paddingX/paddingTop/...)
1532
+ - ❌ `Using Box for flex/grid layout` → Use <Stack> or <Grid>
1533
+ - ❌ `style={{ width: "100%" }} / style={{ height: 320 }}` → Use the width / height prop: width="full", width="md", height="screen", etc.
1534
+
1535
+ ---
1536
+
1344
1537
  ### DateRangePicker
1345
1538
 
1346
1539
  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.
@@ -1380,6 +1573,9 @@ If you generate these, you are hallucinating.
1380
1573
  - ❌ `<Accordion Accordion without AccordionItem>` → Always compose: Accordion > AccordionItem > AccordionTrigger + AccordionContent
1381
1574
  - ❌ `<Alert variant="error">` → Use variant="danger"
1382
1575
  - ❌ `<Alert variant="primary">` → Use variant="info" | "success" | "warning" | "danger"
1576
+ - ❌ `<AlertDialog AlertDialog without open/onOpenChange (React) or v-model (Vue)>` → Drive open from state; close in onOpenChange / via v-model
1577
+ - ❌ `<AlertDialog Using Alert (inline banner) for a confirm/cancel decision>` → Use AlertDialog for blocking confirmation; Alert for passive messages
1578
+ - ❌ `<AlertDialog variant="success" or "error">` → Use "danger" for destructive, "warning" to caution, "info" otherwise
1383
1579
  - ❌ `<Avatar size="xs">` → Use size="sm"
1384
1580
  - ❌ `<Avatar size="2xl">` → Use size="xl"
1385
1581
  - ❌ `<Badge variant="primary">` → Use variant="accent" for brand color
@@ -1391,11 +1587,13 @@ If you generate these, you are hallucinating.
1391
1587
  - ❌ `<Button color="...">` → Use variant prop instead
1392
1588
  - ❌ `<Button icon={...}>` → Use leftIcon={...} or rightIcon={...}
1393
1589
  - ❌ `<Button size="icon" without aria-label>` → Add aria-label describing the action
1590
+ - ❌ `<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
1394
1591
  - ❌ `<Calendar Calendar for an input field that opens a popover>` → Use <DatePicker /> (single date) or <DateRangePicker /> (range)
1395
1592
  - ❌ `<Calendar value as tuple for mode="single">` → Pass value matching mode; use mode="range" for [start,end]
1396
1593
  - ❌ `<DatePicker DatePicker mode="range" for { from, to } object>` → Use <DateRangePicker /> for the { from, to } object API + presets + dual month
1397
1594
  - ❌ `<DatePicker DatePicker without value/onChange>` → Provide value and onChange (e.g. from useState)
1398
1595
  - ❌ `<Card variant="primary">` → Use variant="elevated" | "outlined" | "ghost" | "accent"
1596
+ - ❌ `<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
1399
1597
  - ❌ `<Checkbox size="lg">` → Use size="md"
1400
1598
  - ❌ `<RadioGroup <Radio> used outside a <RadioGroup>>` → Always wrap <Radio> in <RadioGroup>
1401
1599
  - ❌ `<RadioGroup RadioGroup without value/onChange (React) or v-model (Vue)>` → Bind value + onChange (React) or v-model (Vue); or defaultValue for uncontrolled in React
@@ -1410,6 +1608,7 @@ If you generate these, you are hallucinating.
1410
1608
  - ❌ `<Input size="icon">` → Use size="sm" | "md" | "lg"
1411
1609
  - ❌ `<Input type="search" for search UI>` → Import Command from @usevyre/react for search palettes
1412
1610
  - ❌ `<Input Vue: binding Input/Textarea value without v-model>` → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
1611
+ - ❌ `<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
1413
1612
  - ❌ `<Modal size="xl">` → Use size="lg" or size="full"
1414
1613
  - ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
1415
1614
  - ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
@@ -1446,6 +1645,18 @@ If you generate these, you are hallucinating.
1446
1645
  - ❌ `<Conversation Expecting Conversation to store/append messages>` → Append to your own state in onSend (or @send) and pass it back via value
1447
1646
  - ❌ `<Conversation composer without onSend (React) / @send (Vue)>` → Provide onSend / @send to append the message to value
1448
1647
  - ❌ `<Conversation Treating onSend as (text) only when using allowAttachments>` → Handle onSend(text, files) — map files to message attachments and append
1648
+ - ❌ `<Stack <div style={{ display: 'flex', gap: 12 }}>>` → Use <Stack gap="md"> — gap is a token
1649
+ - ❌ `<Stack gap={12} or gap="12px">` → Use gap="none|xs|sm|md|lg|xl|2xl"
1650
+ - ❌ `<Stack direction="vertical" / "horizontal">` → Use direction="row" or "column" (also row-reverse / column-reverse)
1651
+ - ❌ `<Stack style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1652
+ - ❌ `<Grid <div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr' }}>>` → Use <Grid columns={3} gap="md">
1653
+ - ❌ `<Grid columns="3" (string)>` → Use columns={3} or columns="auto-fit"
1654
+ - ❌ `<Grid Nested div with inline grid-column for spanning>` → Wrap the cell in <GridItem colSpan={2}>
1655
+ - ❌ `<Grid style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1656
+ - ❌ `<GridItem GridItem outside a Grid>` → Place <GridItem> directly inside <Grid>
1657
+ - ❌ `<Box <Box style={{ padding: 16 }}>>` → Use <Box padding="md"> (or paddingX/paddingTop/...)
1658
+ - ❌ `<Box Using Box for flex/grid layout>` → Use <Stack> or <Grid>
1659
+ - ❌ `<Box style={{ width: "100%" }} / style={{ height: 320 }}>` → Use the width / height prop: width="full", width="md", height="screen", etc.
1449
1660
  - ❌ `<DateRangePicker value={[from, to]}>` → Use value={{ from, to }} and read range.from / range.to
1450
1661
  - ❌ `<DateRangePicker DateRangePicker for a single date>` → Use <DatePicker /> for a single date
1451
1662
  - ❌ `<DateRangePicker presets="true" (string)>` → Use the bare prop: presets (or presets={true})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usevyre/ai-context",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "useVyre AI context — inject into LLM system prompts to eliminate UI hallucinations",
5
5
  "keywords": [
6
6
  "design-system",