@usevyre/ai-context 1.3.0 → 1.4.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 +288 -1
- package/dist/cheat-sheets/carousel.md +50 -0
- package/dist/cheat-sheets/carouselslide.md +22 -0
- package/dist/cheat-sheets/emptystate.md +48 -0
- package/dist/cheat-sheets/form.md +50 -0
- package/dist/cheat-sheets/formfield.md +22 -0
- package/dist/cheat-sheets/index.md +18 -0
- package/dist/cheat-sheets/numberinput.md +41 -0
- package/dist/cheat-sheets/otpinput.md +51 -0
- package/dist/cheat-sheets/stat.md +41 -0
- package/dist/cheat-sheets/statgroup.md +23 -0
- package/dist/cheat-sheets/step.md +8 -0
- package/dist/cheat-sheets/steppanel.md +8 -0
- package/dist/cheat-sheets/stepper.md +59 -0
- package/dist/cheat-sheets/steppernav.md +8 -0
- package/dist/cheat-sheets/timeline.md +40 -0
- package/dist/cheat-sheets/timelineitem.md +28 -0
- package/dist/cheat-sheets/togglegroup.md +55 -0
- package/dist/cheat-sheets/toggleitem.md +29 -0
- package/dist/cheat-sheets/tree.md +48 -0
- package/dist/claude-context.md +601 -1
- package/dist/copilot-instructions.md +601 -1
- package/dist/cursor-rules.md +186 -1
- package/dist/full-context.md +600 -0
- package/dist/index.js +10049 -6006
- package/dist/schema.json +974 -2
- package/dist/tokens.json +1 -1
- package/dist/tokens.md +1 -1
- package/dist/version-info.json +232 -51
- package/dist/windsurf-rules.md +601 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# StatGroup — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Evenly-split row of <Stat> with subtle dividers between items. Each Stat flexes to equal width.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Stat, StatGroup } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `Putting non-Stat children in StatGroup`
|
|
13
|
+
→ Only place <Stat> elements inside StatGroup
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
**Three KPIs in a row**
|
|
18
|
+
```tsx
|
|
19
|
+
<StatGroup>
|
|
20
|
+
<Stat label="MRR" value="$9.6k" delta="+5%" trend="up" />
|
|
21
|
+
<Stat label="Refunds" value="32" delta="+8" trend="down" />
|
|
22
|
+
</StatGroup>
|
|
23
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Step — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**One step indicator inside <StepperNav>. State (completed/current/upcoming) derives from the Stepper's active index automatically.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Stepper, StepperNav, Step, StepPanel } from "@usevyre/react"
|
|
8
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# StepPanel — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Content for one step. Renders its children only when its index equals the Stepper's active step.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Stepper, StepperNav, Step, StepPanel } from "@usevyre/react"
|
|
8
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Stepper — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Multi-step flow indicator + controller (onboarding/checkout/wizard). CONTROLLED by a 0-based index. Compose StepperNav (with Step indicators) and StepPanel (content shown when its index == active). Step/StepPanel take an explicit 0-based `index`. Not Tabs — Stepper is an ORDERED linear flow with completed/current/upcoming states.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Stepper, StepperNav, Step, StepPanel } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `orientation` | `"horizontal"` \| `"vertical"` | `horizontal` |
|
|
15
|
+
| `clickable` | `true` \| `false` | `false` |
|
|
16
|
+
|
|
17
|
+
## Common AI Mistakes
|
|
18
|
+
|
|
19
|
+
- ❌ `Using Tabs for a wizard / checkout flow`
|
|
20
|
+
→ Use <Stepper> with StepperNav + Step + StepPanel
|
|
21
|
+
- ❌ `onChange={(e) => set(e.target.value)}`
|
|
22
|
+
→ onChange={(index) => setStep(index)}
|
|
23
|
+
- ❌ `Manually toggling which panel is visible`
|
|
24
|
+
→ Give each StepPanel an index; Stepper shows the active one
|
|
25
|
+
- ❌ `<Step> or <StepPanel> outside <Stepper>`
|
|
26
|
+
→ Nest Step inside StepperNav, StepPanel inside Stepper
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
**Three-step wizard with Back/Next**
|
|
31
|
+
```tsx
|
|
32
|
+
const [step, setStep] = useState(0);
|
|
33
|
+
|
|
34
|
+
<Stepper value={step} onChange={setStep}>
|
|
35
|
+
<StepperNav>
|
|
36
|
+
<Step index={0} label="Account" />
|
|
37
|
+
<Step index={1} label="Profile" />
|
|
38
|
+
<Step index={2} label="Done" />
|
|
39
|
+
</StepperNav>
|
|
40
|
+
<StepPanel index={0}><AccountForm /></StepPanel>
|
|
41
|
+
<StepPanel index={1}><ProfileForm /></StepPanel>
|
|
42
|
+
<StepPanel index={2}><Summary /></StepPanel>
|
|
43
|
+
<Stack direction="row" gap="sm" justify="between">
|
|
44
|
+
<Button onClick={() => setStep((s) => s - 1)} disabled={step === 0}>Back</Button>
|
|
45
|
+
<Button variant="primary" onClick={() => setStep((s) => s + 1)}>Next</Button>
|
|
46
|
+
</Stack>
|
|
47
|
+
</Stepper>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Vertical with descriptions**
|
|
51
|
+
```tsx
|
|
52
|
+
<Stepper orientation="vertical" defaultValue={1}>
|
|
53
|
+
<StepperNav>
|
|
54
|
+
<Step index={0} label="Cart" description="2 items" />
|
|
55
|
+
<Step index={1} label="Shipping" description="Enter address" />
|
|
56
|
+
<Step index={2} label="Payment" />
|
|
57
|
+
</StepperNav>
|
|
58
|
+
</Stepper>
|
|
59
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# StepperNav — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Container for Step indicators inside <Stepper>. Lays them out per the Stepper's orientation.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Stepper, StepperNav, Step, StepPanel } from "@usevyre/react"
|
|
8
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Timeline — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Vertical activity feed for audit logs and history. Presentational — a status dot per item plus a connector line. Pass `items` for plain logs, or TimelineItem children for rich per-item content. Timeline does NOT reorder; pass items in the order you want shown.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Timeline, TimelineItem } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `Building an activity log with a <ul> + manual dots/lines`
|
|
13
|
+
→ Use <Timeline items={[...]} /> or TimelineItem children
|
|
14
|
+
- ❌ `Using Stepper for a history/audit feed`
|
|
15
|
+
→ Use <Timeline> for logs/history; Stepper for wizards
|
|
16
|
+
- ❌ `Expecting Timeline to sort by time`
|
|
17
|
+
→ Sort the array yourself (newest- or oldest-first)
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
**Plain audit log via items**
|
|
22
|
+
```tsx
|
|
23
|
+
<Timeline
|
|
24
|
+
items={[
|
|
25
|
+
{ title: "Deployed v2.1", time: "2m ago", status: "success" },
|
|
26
|
+
{ title: "Build started", time: "5m ago", status: "info" },
|
|
27
|
+
{ title: "Push to main", time: "6m ago" },
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Rich content via children**
|
|
33
|
+
```tsx
|
|
34
|
+
<Timeline>
|
|
35
|
+
<TimelineItem title="Invoice paid" time="Apr 2" status="success">
|
|
36
|
+
<Text size="sm">$1,200 — <a href="#">view receipt</a></Text>
|
|
37
|
+
</TimelineItem>
|
|
38
|
+
<TimelineItem title="Invoice sent" time="Mar 28" status="info" />
|
|
39
|
+
</Timeline>
|
|
40
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# TimelineItem — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**One entry in a <Timeline>. Renders a status-colored dot (or a custom icon), a title, an optional time, and optional rich content.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Timeline, TimelineItem } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `status` | `"default"` \| `"success"` \| `"warning"` \| `"danger"` \| `"info"` | `default` |
|
|
15
|
+
|
|
16
|
+
## Common AI Mistakes
|
|
17
|
+
|
|
18
|
+
- ❌ `<TimelineItem> outside <Timeline>`
|
|
19
|
+
→ Always nest TimelineItem inside Timeline
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
**Item with rich content**
|
|
24
|
+
```tsx
|
|
25
|
+
<TimelineItem title="Comment added" time="1h ago" status="default">
|
|
26
|
+
<Text size="sm">“Looks good to me 👍”</Text>
|
|
27
|
+
</TimelineItem>
|
|
28
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ToggleGroup — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Segmented control. CONTROLLED — the group owns the value. onChange emits the VALUE (not an event). type=single → value:string|null; type=multiple → value:string[]. Provide options[] for simple lists or <ToggleItem value> children for custom content. Distinct from Switch (boolean), ButtonGroup (layout only), RadioGroup (form radios, single only).**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { ToggleGroup, ToggleItem } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `type` | `"single"` \| `"multiple"` | `single` |
|
|
15
|
+
| `size` | `"sm"` \| `"md"` \| `"lg"` | `md` |
|
|
16
|
+
| `orientation` | `"horizontal"` \| `"vertical"` | `horizontal` |
|
|
17
|
+
| `disabled` | `true` \| `false` | `false` |
|
|
18
|
+
|
|
19
|
+
## Common AI Mistakes
|
|
20
|
+
|
|
21
|
+
- ❌ `onChange={(e) => set(e.target.value)}`
|
|
22
|
+
→ onChange={(value) => set(value)} — string|null (single) or string[] (multiple)
|
|
23
|
+
- ❌ `Using ToggleGroup for a single on/off setting`
|
|
24
|
+
→ Use <Switch> for on/off; ToggleGroup is for choosing among options
|
|
25
|
+
- ❌ `type="multiple" with a string value`
|
|
26
|
+
→ value={['a','b']} and onChange receives string[]
|
|
27
|
+
- ❌ `<ToggleItem> outside <ToggleGroup>`
|
|
28
|
+
→ Always nest ToggleItem inside ToggleGroup (or use options)
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
**Single-select view switcher (options)**
|
|
33
|
+
```tsx
|
|
34
|
+
const [view, setView] = useState<string | null>("grid");
|
|
35
|
+
|
|
36
|
+
<ToggleGroup
|
|
37
|
+
value={view}
|
|
38
|
+
onChange={setView}
|
|
39
|
+
options={[
|
|
40
|
+
{ value: "grid", label: "Grid" },
|
|
41
|
+
{ value: "list", label: "List" },
|
|
42
|
+
]}
|
|
43
|
+
/>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Multiple-select formatting (composable)**
|
|
47
|
+
```tsx
|
|
48
|
+
const [fmt, setFmt] = useState<string[]>(["bold"]);
|
|
49
|
+
|
|
50
|
+
<ToggleGroup type="multiple" value={fmt} onChange={setFmt}>
|
|
51
|
+
<ToggleItem value="bold">B</ToggleItem>
|
|
52
|
+
<ToggleItem value="italic">I</ToggleItem>
|
|
53
|
+
<ToggleItem value="underline">U</ToggleItem>
|
|
54
|
+
</ToggleGroup>
|
|
55
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# ToggleItem — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**A single toggle button inside <ToggleGroup>. Reads selection state from the group via context.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { ToggleItem } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Valid Props
|
|
11
|
+
|
|
12
|
+
| Prop | Values | Default |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| `disabled` | `true` \| `false` | `false` |
|
|
15
|
+
|
|
16
|
+
## Common AI Mistakes
|
|
17
|
+
|
|
18
|
+
- ❌ `Tracking selected state on ToggleItem yourself`
|
|
19
|
+
→ Only set value; the group controls selected state
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
**Composable items**
|
|
24
|
+
```tsx
|
|
25
|
+
<ToggleGroup value={v} onChange={setV}>
|
|
26
|
+
<ToggleItem value="left">Left</ToggleItem>
|
|
27
|
+
<ToggleItem value="center">Center</ToggleItem>
|
|
28
|
+
</ToggleGroup>
|
|
29
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Tree — AI Cheat Sheet
|
|
2
|
+
> Quick reference for Claude / Cursor / Copilot
|
|
3
|
+
|
|
4
|
+
**Hierarchical tree view for file explorers and nested navigation. DATA-DRIVEN and CONTROLLED — pass a nested `data` array; the Tree renders recursively. Single selection. A node WITH children is a folder (click toggles expand); a leaf fires onSelect. Keyboard: ArrowUp/Down move, ArrowRight/Left expand/collapse, Enter/Space select.**
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { Tree } from "@usevyre/react"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Common AI Mistakes
|
|
11
|
+
|
|
12
|
+
- ❌ `Rendering a nested <ul> tree by hand with manual expand state`
|
|
13
|
+
→ Pass a nested `data` array to <Tree> and control expandedIds/selectedId
|
|
14
|
+
- ❌ `onSelect={(e) => ...}`
|
|
15
|
+
→ onSelect={(id) => setSelected(id)}
|
|
16
|
+
- ❌ `Mutating the data array to expand/collapse`
|
|
17
|
+
→ Track expandedIds in state (or use defaultExpandedIds)
|
|
18
|
+
- ❌ `Using DropdownMenu submenus for a file tree`
|
|
19
|
+
→ Use <Tree> for file explorers / nested nav
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
**File explorer, controlled selection**
|
|
24
|
+
```tsx
|
|
25
|
+
const [sel, setSel] = useState<string | null>("src/a.ts");
|
|
26
|
+
|
|
27
|
+
<Tree
|
|
28
|
+
data={[
|
|
29
|
+
{ id: "src", label: "src", children: [
|
|
30
|
+
{ id: "src/a.ts", label: "a.ts" },
|
|
31
|
+
{ id: "src/b", label: "b", children: [
|
|
32
|
+
{ id: "src/b/c.ts", label: "c.ts" },
|
|
33
|
+
]},
|
|
34
|
+
]},
|
|
35
|
+
{ id: "README.md", label: "README.md" },
|
|
36
|
+
]}
|
|
37
|
+
selectedId={sel}
|
|
38
|
+
onSelect={setSel}
|
|
39
|
+
defaultExpandedIds={["src"]}
|
|
40
|
+
/>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Fully controlled expansion**
|
|
44
|
+
```tsx
|
|
45
|
+
const [open, setOpen] = useState<string[]>(["root"]);
|
|
46
|
+
|
|
47
|
+
<Tree data={tree} expandedIds={open} onExpandedChange={setOpen} />
|
|
48
|
+
```
|