@usevyre/ai-context 1.2.2 → 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.
- package/dist/anti-patterns.json +106 -1
- package/dist/cheat-sheets/box.md +52 -0
- package/dist/cheat-sheets/button.md +2 -0
- package/dist/cheat-sheets/card.md +2 -0
- package/dist/cheat-sheets/grid.md +50 -0
- package/dist/cheat-sheets/griditem.md +24 -0
- package/dist/cheat-sheets/index.md +4 -0
- package/dist/cheat-sheets/input.md +2 -0
- package/dist/cheat-sheets/stack.md +55 -0
- package/dist/claude-context.md +170 -1
- package/dist/copilot-instructions.md +170 -1
- package/dist/cursor-rules.md +84 -1
- package/dist/full-context.md +169 -0
- package/dist/index.js +1734 -113
- package/dist/schema.json +708 -3
- package/dist/tokens.json +1 -1
- package/dist/tokens.md +1 -1
- package/dist/version-info.json +139 -91
- package/dist/windsurf-rules.md +170 -1
- package/package.json +1 -1
package/dist/windsurf-rules.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# useVyre Rules for Windsurf
|
|
2
|
-
# Version: 1.
|
|
2
|
+
# Version: 1.6.0
|
|
3
3
|
|
|
4
4
|
# useVyre Design System — AI Context
|
|
5
5
|
# Version: 0.2.0
|
|
@@ -342,6 +342,7 @@ import { Button } from "@usevyre/react"
|
|
|
342
342
|
- ❌ `color="..."` → Use variant prop instead
|
|
343
343
|
- ❌ `icon={...}` → Use leftIcon={...} or rightIcon={...}
|
|
344
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
|
|
345
346
|
|
|
346
347
|
---
|
|
347
348
|
|
|
@@ -427,6 +428,7 @@ import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
|
|
|
427
428
|
|
|
428
429
|
**Common mistakes:**
|
|
429
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
|
|
430
432
|
|
|
431
433
|
---
|
|
432
434
|
|
|
@@ -638,6 +640,7 @@ import { Input } from "@usevyre/react"
|
|
|
638
640
|
- ❌ `size="icon"` → Use size="sm" | "md" | "lg"
|
|
639
641
|
- ❌ `type="search" for search UI` → Import Command from @usevyre/react for search palettes
|
|
640
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
|
|
641
644
|
|
|
642
645
|
---
|
|
643
646
|
|
|
@@ -1380,6 +1383,157 @@ const messages = [
|
|
|
1380
1383
|
|
|
1381
1384
|
---
|
|
1382
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
|
+
|
|
1383
1537
|
### DateRangePicker
|
|
1384
1538
|
|
|
1385
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.
|
|
@@ -1433,11 +1587,13 @@ If you generate these, you are hallucinating.
|
|
|
1433
1587
|
- ❌ `<Button color="...">` → Use variant prop instead
|
|
1434
1588
|
- ❌ `<Button icon={...}>` → Use leftIcon={...} or rightIcon={...}
|
|
1435
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
|
|
1436
1591
|
- ❌ `<Calendar Calendar for an input field that opens a popover>` → Use <DatePicker /> (single date) or <DateRangePicker /> (range)
|
|
1437
1592
|
- ❌ `<Calendar value as tuple for mode="single">` → Pass value matching mode; use mode="range" for [start,end]
|
|
1438
1593
|
- ❌ `<DatePicker DatePicker mode="range" for { from, to } object>` → Use <DateRangePicker /> for the { from, to } object API + presets + dual month
|
|
1439
1594
|
- ❌ `<DatePicker DatePicker without value/onChange>` → Provide value and onChange (e.g. from useState)
|
|
1440
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
|
|
1441
1597
|
- ❌ `<Checkbox size="lg">` → Use size="md"
|
|
1442
1598
|
- ❌ `<RadioGroup <Radio> used outside a <RadioGroup>>` → Always wrap <Radio> in <RadioGroup>
|
|
1443
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
|
|
@@ -1452,6 +1608,7 @@ If you generate these, you are hallucinating.
|
|
|
1452
1608
|
- ❌ `<Input size="icon">` → Use size="sm" | "md" | "lg"
|
|
1453
1609
|
- ❌ `<Input type="search" for search UI>` → Import Command from @usevyre/react for search palettes
|
|
1454
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
|
|
1455
1612
|
- ❌ `<Modal size="xl">` → Use size="lg" or size="full"
|
|
1456
1613
|
- ❌ `<Popover placement="top-center">` → Use placement="top" for centered placement
|
|
1457
1614
|
- ❌ `<Progress value > 100>` → Normalize your value to 0–100 range before passing
|
|
@@ -1488,6 +1645,18 @@ If you generate these, you are hallucinating.
|
|
|
1488
1645
|
- ❌ `<Conversation Expecting Conversation to store/append messages>` → Append to your own state in onSend (or @send) and pass it back via value
|
|
1489
1646
|
- ❌ `<Conversation composer without onSend (React) / @send (Vue)>` → Provide onSend / @send to append the message to value
|
|
1490
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.
|
|
1491
1660
|
- ❌ `<DateRangePicker value={[from, to]}>` → Use value={{ from, to }} and read range.from / range.to
|
|
1492
1661
|
- ❌ `<DateRangePicker DateRangePicker for a single date>` → Use <DatePicker /> for a single date
|
|
1493
1662
|
- ❌ `<DateRangePicker presets="true" (string)>` → Use the bare prop: presets (or presets={true})
|