@usevyre/ai-context 1.0.1 → 1.2.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.
@@ -8,12 +8,15 @@ Quick reference for AI agents — one file per component.
8
8
  - [Badge](badge.md) — Small label for status, category, or count. Use dot prop for live status indicator.
9
9
  - [Breadcrumb](breadcrumb.md) — Navigation trail showing current page location in hierarchy.
10
10
  - [Button](button.md) — Triggers actions and navigation. The most commonly used interactive element.
11
- - [Calendar](calendar.md) — Date picker calendar widget for selecting single dates or ranges.
11
+ - [Calendar](calendar.md) — Inline date-grid widget (always visible, no input). mode: single | range | multiple, optional time picker. For an input + popover use DatePicker; for start/end ranges with presets use DateRangePicker.
12
+ - [DatePicker](datepicker.md) — Input trigger that opens a Calendar in a popover. Same modes as Calendar (single | range | multiple) plus a placeholder. Use this for a compact date field; use Calendar for an always-visible grid, or DateRangePicker for start/end ranges with presets.
12
13
  - [Card](card.md) — Content container with optional header, body, and footer sections.
13
14
  - [Checkbox](checkbox.md) — Binary toggle for boolean form values.
15
+ - [RadioGroup](radiogroup.md) — Controlled single-choice group. RadioGroup owns the selected value; render it data-driven via the options array OR with composable <Radio> children for custom content. role=radiogroup with proper labelling. For multi-select use Checkbox; for a compact dropdown use Select.
16
+ - [RichTextEditor](richtexteditor.md) — Controlled WYSIWYG editor. value is an HTML string; you own it in state and set it in onChange (React) / v-model (Vue). Native contentEditable + execCommand — zero dependencies. Toolbar: bold, italic, underline, strike, h1-h3, ordered/unordered lists, quote, code block, link, clear formatting.
14
17
  - [Command](command.md) — Command palette / search dialog. Use for search-first navigation or quick actions.
15
18
  - [DropdownMenu](dropdownmenu.md) — Contextual menu triggered by a button. Supports items, separators, checkbox items, radio groups, and sub-menus.
16
- - [Field](field.md) — Form field wrapper providing label, hint text, and validation state for Input or Textarea.
19
+ - [Field](field.md) — Form field wrapper. Two ways to use it (both supported): (1) props-based — pass label/hint/state/required for the common case; (2) composable — use the parts FieldLabel, FieldDescription, FieldError, FieldGroup, FieldSet for richer layouts (multiple controls, custom error placement). The props-based API is unchanged and still works.
17
20
  - [Input](input.md) — Text input field. Wrap in Field for labels and validation. Use leftElement/rightElement for icons.
18
21
  - [Label](label.md) — Accessible form label. Associate with input via htmlFor.
19
22
  - [Modal](modal.md) — Dialog overlay for confirmations, forms, or focused content.
@@ -32,3 +35,13 @@ Quick reference for AI agents — one file per component.
32
35
  - [Toast](toast.md) — Transient notification. Use the useToast hook to trigger toasts imperatively. React: wrap app in <ToastProvider>. Vue: place <ToastViewport /> once in app root.
33
36
  - [Tooltip](tooltip.md) — Short label that appears on hover/focus. For rich content use Popover instead.
34
37
  - [Typography](typography.md) — Text rendering components with semantic scale. Includes Text, Heading, Lead, Code, Blockquote.
38
+ - [ButtonGroup](buttongroup.md) — Groups multiple Button components into one visual unit (toolbar, segmented control). Pure layout — no internal state.
39
+ - [TagsInput](tagsinput.md) — Multi-tag input. Type and press Enter or comma to add a tag, click x to remove, Backspace on empty input removes the last tag. Controlled.
40
+ - [Combobox](combobox.md) — Searchable single-select dropdown with typeahead filtering and keyboard navigation. Use when the list is long enough to need search. Differs from Select (no search) and Command (palette).
41
+ - [DataGrid](datagrid.md) — Table with built-in column sorting, loading skeletons, and empty state. Filtering and pagination are out of scope — compose with the Pagination component.
42
+ - [Tag](tag.md) — Standalone display tag/chip for categories, labels, or filter chips. NOT an input — for tag input use TagsInput. Group multiple with TagGroup.
43
+ - [TagGroup](taggroup.md) — Read-only container that lays out multiple Tag elements with automatic wrapping and consistent spacing. For tag input use TagsInput.
44
+ - [Item](item.md) — Layout primitive for list rows, settings rows, and notification rows. Denser than Card — use Item (not Card) for repeated list rows.
45
+ - [Kanban](kanban.md) — Drag-and-drop board: cards move between columns (or reorder within a column). CONTROLLED & data-driven like DataGrid. While dragging, a placeholder shows the exact drop position. Each card is wrapped in a Card (variant="outlined"); renderCard (React) / #card slot (Vue) can render ANY content incl. complex components (Avatar/Badge/Progress). Columns and cards accept an optional semantic color tint. Native HTML5 DnD, zero deps.
46
+ - [Conversation](conversation.md) — Chat / inbox message thread. CONTROLLED & data-driven like Kanban — you own `value` (messages array) and append in your own send handler; Conversation holds no message state. Consecutive messages from the same author are grouped (avatar + name shown once), day separators are inserted on date change, and outgoing messages (authorId === currentUserId) align right.
47
+ - [DateRangePicker](daterangepicker.md) — 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.
@@ -19,6 +19,8 @@ import { Input } from "@usevyre/react"
19
19
  → Use size="sm" | "md" | "lg"
20
20
  - ❌ `type="search" for search UI`
21
21
  → Import Command from @usevyre/react for search palettes
22
+ - ❌ `Vue: binding Input/Textarea value without v-model`
23
+ → Use v-model on <Input>/<Textarea> in Vue; in React use value + onChange
22
24
 
23
25
  ## Examples
24
26
 
@@ -0,0 +1,53 @@
1
+ # Item — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Layout primitive for list rows, settings rows, and notification rows. Denser than Card — use Item (not Card) for repeated list rows.**
5
+
6
+ ```ts
7
+ import { Item, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, ItemGroup } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Valid Props
11
+
12
+ | Prop | Values | Default |
13
+ |------|--------|---------|
14
+ | `variant` | `"default"` \| `"outlined"` \| `"muted"` \| `"plain"` | `default` |
15
+ | `size` | `"sm"` \| `"md"` \| `"lg"` | `md` |
16
+ | `clickable` | `true` \| `false` | `false` |
17
+
18
+ ## Common AI Mistakes
19
+
20
+ - ❌ `Card used for repeated list rows`
21
+ → Use <Item> (optionally inside <ItemGroup separated>) for list/settings rows
22
+ - ❌ `Item variant="primary"`
23
+ → Use variant="default" | "outlined" | "muted"
24
+ - ❌ `raw text directly inside Item`
25
+ → Wrap text in <ItemContent><ItemTitle>…</ItemTitle></ItemContent>
26
+
27
+ ## Examples
28
+
29
+ **Settings row with media, content and a trailing switch**
30
+ ```tsx
31
+ <Item>
32
+ <ItemMedia><BellIcon /></ItemMedia>
33
+ <ItemContent>
34
+ <ItemTitle>Notifications</ItemTitle>
35
+ <ItemDescription>Receive an email when someone mentions you.</ItemDescription>
36
+ </ItemContent>
37
+ <ItemActions>
38
+ <Switch defaultChecked />
39
+ </ItemActions>
40
+ </Item>
41
+ ```
42
+
43
+ **Grouped clickable list with dividers**
44
+ ```tsx
45
+ <ItemGroup separated>
46
+ <Item clickable>
47
+ <ItemContent><ItemTitle>Profile</ItemTitle></ItemContent>
48
+ </Item>
49
+ <Item clickable>
50
+ <ItemContent><ItemTitle>Billing</ItemTitle></ItemContent>
51
+ </Item>
52
+ </ItemGroup>
53
+ ```
@@ -0,0 +1,59 @@
1
+ # Kanban — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Drag-and-drop board: cards move between columns (or reorder within a column). CONTROLLED & data-driven like DataGrid. While dragging, a placeholder shows the exact drop position. Each card is wrapped in a Card (variant="outlined"); renderCard (React) / #card slot (Vue) can render ANY content incl. complex components (Avatar/Badge/Progress). Columns and cards accept an optional semantic color tint. Native HTML5 DnD, zero deps.**
5
+
6
+ ```ts
7
+ import { Kanban } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Common AI Mistakes
11
+
12
+ - ❌ `Kanban without onChange (or ignoring it)`
13
+ → Store columns in state and setColumns in onChange (v-model in Vue)
14
+ - ❌ `Duplicate card ids across columns`
15
+ → Use globally-unique card ids across the entire board
16
+ - ❌ `Mutating value in place then calling onChange`
17
+ → Pass the new array Kanban gives you straight to setState / v-model
18
+ - ❌ `color="blue" (or any non-semantic value)`
19
+ → Use one of: "default" | "accent" | "teal" | "success" | "warning" | "danger"
20
+
21
+ ## Examples
22
+
23
+ **Controlled board**
24
+ ```tsx
25
+ const [columns, setColumns] = useState([
26
+ { id: "todo", title: "To Do", cards: [{ id: "1", title: "Spec API" }] },
27
+ { id: "doing", title: "In Progress", cards: [] },
28
+ { id: "done", title: "Done", cards: [{ id: "2", title: "Kickoff" }] },
29
+ ]);
30
+ <Kanban value={columns} onChange={setColumns} />
31
+ ```
32
+
33
+ **Custom card body + click handler**
34
+ ```tsx
35
+ <Kanban
36
+ value={columns}
37
+ onChange={setColumns}
38
+ onCardClick={(card) => openDetail(card.id)}
39
+ renderCard={(card) => (
40
+ <><strong>{card.title}</strong><Badge>{card.id}</Badge></>
41
+ )}
42
+ />
43
+ ```
44
+
45
+ **Tinted columns/cards + complex card content**
46
+ ```tsx
47
+ const [cols, setCols] = useState([
48
+ { id: "doing", title: "In Progress", color: "teal", cards: [
49
+ { id: "t1", title: "OAuth", assignee: "AK", progress: 60, color: "warning" },
50
+ ]},
51
+ ]);
52
+ <Kanban
53
+ value={cols}
54
+ onChange={setCols}
55
+ renderCard={(card) => (
56
+ <><strong>{card.title}</strong><Progress value={card.progress} /></>
57
+ )}
58
+ />
59
+ ```
@@ -0,0 +1,47 @@
1
+ # RadioGroup — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Controlled single-choice group. RadioGroup owns the selected value; render it data-driven via the options array OR with composable <Radio> children for custom content. role=radiogroup with proper labelling. For multi-select use Checkbox; for a compact dropdown use Select.**
5
+
6
+ ```ts
7
+ import { RadioGroup, Radio } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Valid Props
11
+
12
+ | Prop | Values | Default |
13
+ |------|--------|---------|
14
+ | `size` | `"sm"` \| `"md"` | `md` |
15
+ | `orientation` | `"vertical"` \| `"horizontal"` | `vertical` |
16
+ | `disabled` | `true` \| `false` | `false` |
17
+
18
+ ## Common AI Mistakes
19
+
20
+ - ❌ `<Radio> used outside a <RadioGroup>`
21
+ → Always wrap <Radio> in <RadioGroup>
22
+ - ❌ `RadioGroup without value/onChange (React) or v-model (Vue)`
23
+ → Bind value + onChange (React) or v-model (Vue); or defaultValue for uncontrolled in React
24
+ - ❌ `Using Checkbox for mutually-exclusive choices`
25
+ → Use RadioGroup + Radio (or options) for one-of-many
26
+
27
+ ## Examples
28
+
29
+ **Data-driven**
30
+ ```tsx
31
+ <RadioGroup
32
+ value={plan}
33
+ onChange={setPlan}
34
+ options={[
35
+ { value: "free", label: "Free", description: "For hobby projects" },
36
+ { value: "pro", label: "Pro", description: "For teams" },
37
+ ]}
38
+ />
39
+ ```
40
+
41
+ **Composable children**
42
+ ```tsx
43
+ <RadioGroup value={plan} onChange={setPlan} orientation="horizontal">
44
+ <Radio value="free" label="Free" />
45
+ <Radio value="pro" label="Pro" />
46
+ </RadioGroup>
47
+ ```
@@ -0,0 +1,41 @@
1
+ # RichTextEditor — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Controlled WYSIWYG editor. value is an HTML string; you own it in state and set it in onChange (React) / v-model (Vue). Native contentEditable + execCommand — zero dependencies. Toolbar: bold, italic, underline, strike, h1-h3, ordered/unordered lists, quote, code block, link, clear formatting.**
5
+
6
+ ```ts
7
+ import { RichTextEditor } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Valid Props
11
+
12
+ | Prop | Values | Default |
13
+ |------|--------|---------|
14
+ | `disabled` | `true` \| `false` | `false` |
15
+ | `readOnly` | `true` \| `false` | `false` |
16
+
17
+ ## Common AI Mistakes
18
+
19
+ - ❌ `RichTextEditor without value/onChange (React) or v-model (Vue)`
20
+ → Keep the HTML string in state and update it in onChange / v-model
21
+ - ❌ `Rendering value as text or with dangerouslySetInnerHTML elsewhere without sanitising`
22
+ → Sanitise (e.g. DOMPurify) before re-rendering untrusted RTE output
23
+ - ❌ `toolbar="bold" (string)`
24
+ → Pass an array, e.g. toolbar={["bold","italic","link"]}
25
+
26
+ ## Examples
27
+
28
+ **Controlled editor**
29
+ ```tsx
30
+ const [html, setHtml] = useState("<p>Hello <strong>world</strong></p>");
31
+ <RichTextEditor value={html} onChange={setHtml} placeholder="Write…" />
32
+ ```
33
+
34
+ **Minimal toolbar**
35
+ ```tsx
36
+ <RichTextEditor
37
+ value={html}
38
+ onChange={setHtml}
39
+ toolbar={["bold", "italic", "link"]}
40
+ />
41
+ ```
@@ -0,0 +1,46 @@
1
+ # Tag — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Standalone display tag/chip for categories, labels, or filter chips. NOT an input — for tag input use TagsInput. Group multiple with TagGroup.**
5
+
6
+ ```ts
7
+ import { Tag } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Valid Props
11
+
12
+ | Prop | Values | Default |
13
+ |------|--------|---------|
14
+ | `variant` | `"default"` \| `"accent"` \| `"danger"` | `default` |
15
+ | `size` | `"sm"` \| `"md"` \| `"lg"` | `md` |
16
+ | `disabled` | `true` \| `false` | `false` |
17
+
18
+ ## Common AI Mistakes
19
+
20
+ - ❌ `Tag variant="success"`
21
+ → Use Badge for success/warning/teal status colors; Tag is for categories/filters
22
+ - ❌ `Using Tag for tag input`
23
+ → Use TagsInput for adding/removing tags via keyboard
24
+ - ❌ `Tag size="xl"`
25
+ → Use size="lg"
26
+
27
+ ## Examples
28
+
29
+ **Category tags in a group**
30
+ ```tsx
31
+ <TagGroup>
32
+ <Tag>Design</Tag>
33
+ <Tag variant="accent">Featured</Tag>
34
+ <Tag>Engineering</Tag>
35
+ </TagGroup>
36
+ ```
37
+
38
+ **Removable filter chip (React)**
39
+ ```tsx
40
+ <Tag onRemove={() => removeFilter("react")}>react</Tag>
41
+ ```
42
+
43
+ **Clickable toggle tag (React)**
44
+ ```tsx
45
+ <Tag onClick={() => toggleFilter("vue")}>vue</Tag>
46
+ ```
@@ -0,0 +1,33 @@
1
+ # TagGroup — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Read-only container that lays out multiple Tag elements with automatic wrapping and consistent spacing. For tag input use TagsInput.**
5
+
6
+ ```ts
7
+ import { TagGroup, Tag } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Valid Props
11
+
12
+ | Prop | Values | Default |
13
+ |------|--------|---------|
14
+ | `gap` | `"sm"` \| `"md"` \| `"lg"` | `md` |
15
+ | `wrap` | `true` \| `false` | `true` |
16
+
17
+ ## Common AI Mistakes
18
+
19
+ - ❌ `TagGroup without Tag children`
20
+ → Place <Tag> elements as direct children
21
+ - ❌ `Using TagGroup for tag input`
22
+ → Use TagsInput for an editable tag field
23
+
24
+ ## Examples
25
+
26
+ **Tag group with mixed variants**
27
+ ```tsx
28
+ <TagGroup gap="sm">
29
+ <Tag>React</Tag>
30
+ <Tag>Vue</Tag>
31
+ <Tag variant="accent">TypeScript</Tag>
32
+ </TagGroup>
33
+ ```
@@ -0,0 +1,35 @@
1
+ # TagsInput — AI Cheat Sheet
2
+ > Quick reference for Claude / Cursor / Copilot
3
+
4
+ **Multi-tag input. Type and press Enter or comma to add a tag, click x to remove, Backspace on empty input removes the last tag. Controlled.**
5
+
6
+ ```ts
7
+ import { TagsInput } from "@usevyre/react"
8
+ ```
9
+
10
+ ## Valid Props
11
+
12
+ | Prop | Values | Default |
13
+ |------|--------|---------|
14
+ | `size` | `"sm"` \| `"md"` \| `"lg"` | `md` |
15
+ | `disabled` | `true` \| `false` | `false` |
16
+
17
+ ## Common AI Mistakes
18
+
19
+ - ❌ `TagsInput value={string}`
20
+ → Pass an array: value={['react','vue']}
21
+ - ❌ `TagsInput without onChange`
22
+ → Provide value and onChange (React) or v-model (Vue)
23
+
24
+ ## Examples
25
+
26
+ **Basic tags input**
27
+ ```tsx
28
+ const [tags, setTags] = useState<string[]>([]);
29
+ <TagsInput value={tags} onChange={setTags} placeholder="Add a tag…" />
30
+ ```
31
+
32
+ **Limited to 5 tags**
33
+ ```tsx
34
+ <TagsInput value={tags} onChange={setTags} max={5} />
35
+ ```