@usevyre/ai-context 1.0.1 → 1.1.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/buttongroup.md +42 -0
- package/dist/cheat-sheets/combobox.md +37 -0
- package/dist/cheat-sheets/datagrid.md +44 -0
- package/dist/cheat-sheets/index.md +6 -0
- package/dist/cheat-sheets/tag.md +46 -0
- package/dist/cheat-sheets/taggroup.md +33 -0
- package/dist/cheat-sheets/tagsinput.md +35 -0
- package/dist/claude-context.md +198 -1
- package/dist/copilot-instructions.md +198 -1
- package/dist/cursor-rules.md +72 -1
- package/dist/full-context.md +197 -0
- package/dist/index.js +1493 -113
- package/dist/schema.json +368 -5
- package/dist/version-info.json +112 -65
- package/dist/windsurf-rules.md +198 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# useVyre Copilot Instructions
|
|
2
|
-
# Version: 1.
|
|
2
|
+
# Version: 1.1.0
|
|
3
3
|
|
|
4
4
|
When generating UI code in this project, follow the useVyre design system rules below.
|
|
5
5
|
|
|
@@ -886,6 +886,188 @@ import { Text, Heading, Lead, Code, Blockquote } from "@usevyre/react"
|
|
|
886
886
|
|
|
887
887
|
---
|
|
888
888
|
|
|
889
|
+
### ButtonGroup
|
|
890
|
+
|
|
891
|
+
Groups multiple Button components into one visual unit (toolbar, segmented control). Pure layout — no internal state.
|
|
892
|
+
|
|
893
|
+
```tsx
|
|
894
|
+
import { ButtonGroup, Button } from "@usevyre/react"
|
|
895
|
+
|
|
896
|
+
// Props:
|
|
897
|
+
// orientation = "horizontal" | "vertical" (default: horizontal)
|
|
898
|
+
// attached = boolean (default: false)
|
|
899
|
+
// size = "sm" | "md" | "lg" | "icon"
|
|
900
|
+
|
|
901
|
+
// Examples:
|
|
902
|
+
<ButtonGroup attached>
|
|
903
|
+
<Button variant="secondary">Day</Button>
|
|
904
|
+
<Button variant="secondary">Week</Button>
|
|
905
|
+
<Button variant="secondary">Month</Button>
|
|
906
|
+
</ButtonGroup>
|
|
907
|
+
<ButtonGroup orientation="vertical" attached>
|
|
908
|
+
<Button variant="secondary">Top</Button>
|
|
909
|
+
<Button variant="secondary">Bottom</Button>
|
|
910
|
+
</ButtonGroup>
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
**Common mistakes:**
|
|
914
|
+
- ❌ `ButtonGroup variant="..."` → Set variant on each <Button> inside the group
|
|
915
|
+
- ❌ `ButtonGroup without Button children` → Place <Button> elements as direct children
|
|
916
|
+
|
|
917
|
+
---
|
|
918
|
+
|
|
919
|
+
### TagsInput
|
|
920
|
+
|
|
921
|
+
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.
|
|
922
|
+
|
|
923
|
+
```tsx
|
|
924
|
+
import { TagsInput } from "@usevyre/react"
|
|
925
|
+
|
|
926
|
+
// Props:
|
|
927
|
+
// value = string[]
|
|
928
|
+
// onChange = (tags: string[]) => void
|
|
929
|
+
// placeholder = string
|
|
930
|
+
// disabled = boolean (default: false)
|
|
931
|
+
// max = number
|
|
932
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
933
|
+
|
|
934
|
+
// Examples:
|
|
935
|
+
const [tags, setTags] = useState<string[]>([]);
|
|
936
|
+
<TagsInput value={tags} onChange={setTags} placeholder="Add a tag…" />
|
|
937
|
+
<TagsInput value={tags} onChange={setTags} max={5} />
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
**Common mistakes:**
|
|
941
|
+
- ❌ `TagsInput value={string}` → Pass an array: value={['react','vue']}
|
|
942
|
+
- ❌ `TagsInput without onChange` → Provide value and onChange (React) or v-model (Vue)
|
|
943
|
+
|
|
944
|
+
---
|
|
945
|
+
|
|
946
|
+
### Combobox
|
|
947
|
+
|
|
948
|
+
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).
|
|
949
|
+
|
|
950
|
+
```tsx
|
|
951
|
+
import { Combobox } from "@usevyre/react"
|
|
952
|
+
|
|
953
|
+
// Props:
|
|
954
|
+
// options = { value: string; label: string; disabled?: boolean }[]
|
|
955
|
+
// value = string | null
|
|
956
|
+
// onChange = (value: string | null) => void
|
|
957
|
+
// placeholder = string (default: "Search…")
|
|
958
|
+
// disabled = boolean (default: false)
|
|
959
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
960
|
+
// emptyText = string (default: "No results")
|
|
961
|
+
|
|
962
|
+
// Examples:
|
|
963
|
+
const [lang, setLang] = useState<string | null>(null);
|
|
964
|
+
<Combobox
|
|
965
|
+
options={[{ value: "ts", label: "TypeScript" }, { value: "go", label: "Go" }]}
|
|
966
|
+
value={lang}
|
|
967
|
+
onChange={setLang}
|
|
968
|
+
placeholder="Search language…"
|
|
969
|
+
/>
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
**Common mistakes:**
|
|
973
|
+
- ❌ `Combobox value=""` → Use value={null} for no selection
|
|
974
|
+
- ❌ `Combobox options={string[]}` → Use [{ value: 'ts', label: 'TypeScript' }]
|
|
975
|
+
- ❌ `Using Combobox for command palette` → Use Command for command palettes
|
|
976
|
+
|
|
977
|
+
---
|
|
978
|
+
|
|
979
|
+
### DataGrid
|
|
980
|
+
|
|
981
|
+
Table with built-in column sorting, loading skeletons, and empty state. Filtering and pagination are out of scope — compose with the Pagination component.
|
|
982
|
+
|
|
983
|
+
```tsx
|
|
984
|
+
import { DataGrid } from "@usevyre/react"
|
|
985
|
+
|
|
986
|
+
// Props:
|
|
987
|
+
// columns = { key: string; label: string; sortable?: boolean; width?: string }[]
|
|
988
|
+
// rows = Record<string, unknown>[]
|
|
989
|
+
// sortKey = string
|
|
990
|
+
// sortDir = "asc" | "desc"
|
|
991
|
+
// onSort = (key: string, dir: 'asc' | 'desc') => void
|
|
992
|
+
// loading = boolean (default: false)
|
|
993
|
+
// emptyText = string (default: "No data")
|
|
994
|
+
// stickyHeader = boolean (default: false)
|
|
995
|
+
|
|
996
|
+
// Examples:
|
|
997
|
+
const cols = [{ key: "name", label: "Name", sortable: true }];
|
|
998
|
+
<DataGrid
|
|
999
|
+
columns={cols}
|
|
1000
|
+
rows={people}
|
|
1001
|
+
sortKey={sortKey}
|
|
1002
|
+
sortDir={sortDir}
|
|
1003
|
+
onSort={(k, d) => { setSortKey(k); setSortDir(d); }}
|
|
1004
|
+
/>
|
|
1005
|
+
<DataGrid columns={cols} rows={[]} loading />
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
**Common mistakes:**
|
|
1009
|
+
- ❌ `DataGrid expecting built-in pagination` → Slice rows yourself and use the Pagination component
|
|
1010
|
+
- ❌ `DataGrid expecting built-in filtering` → Filter the rows array before passing it in
|
|
1011
|
+
- ❌ `sortable without onSort` → Handle onSort and sort the rows array in your state
|
|
1012
|
+
|
|
1013
|
+
---
|
|
1014
|
+
|
|
1015
|
+
### Tag
|
|
1016
|
+
|
|
1017
|
+
Standalone display tag/chip for categories, labels, or filter chips. NOT an input — for tag input use TagsInput. Group multiple with TagGroup.
|
|
1018
|
+
|
|
1019
|
+
```tsx
|
|
1020
|
+
import { Tag } from "@usevyre/react"
|
|
1021
|
+
|
|
1022
|
+
// Props:
|
|
1023
|
+
// variant = "default" | "accent" | "danger" (default: default)
|
|
1024
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
1025
|
+
// onRemove = () => void
|
|
1026
|
+
// onClick = () => void
|
|
1027
|
+
// disabled = boolean (default: false)
|
|
1028
|
+
|
|
1029
|
+
// Examples:
|
|
1030
|
+
<TagGroup>
|
|
1031
|
+
<Tag>Design</Tag>
|
|
1032
|
+
<Tag variant="accent">Featured</Tag>
|
|
1033
|
+
<Tag>Engineering</Tag>
|
|
1034
|
+
</TagGroup>
|
|
1035
|
+
<Tag onRemove={() => removeFilter("react")}>react</Tag>
|
|
1036
|
+
<Tag onClick={() => toggleFilter("vue")}>vue</Tag>
|
|
1037
|
+
```
|
|
1038
|
+
|
|
1039
|
+
**Common mistakes:**
|
|
1040
|
+
- ❌ `Tag variant="success"` → Use Badge for success/warning/teal status colors; Tag is for categories/filters
|
|
1041
|
+
- ❌ `Using Tag for tag input` → Use TagsInput for adding/removing tags via keyboard
|
|
1042
|
+
- ❌ `Tag size="xl"` → Use size="lg"
|
|
1043
|
+
|
|
1044
|
+
---
|
|
1045
|
+
|
|
1046
|
+
### TagGroup
|
|
1047
|
+
|
|
1048
|
+
Read-only container that lays out multiple Tag elements with automatic wrapping and consistent spacing. For tag input use TagsInput.
|
|
1049
|
+
|
|
1050
|
+
```tsx
|
|
1051
|
+
import { TagGroup, Tag } from "@usevyre/react"
|
|
1052
|
+
|
|
1053
|
+
// Props:
|
|
1054
|
+
// gap = "sm" | "md" | "lg" (default: md)
|
|
1055
|
+
// wrap = boolean (default: true)
|
|
1056
|
+
|
|
1057
|
+
// Examples:
|
|
1058
|
+
<TagGroup gap="sm">
|
|
1059
|
+
<Tag>React</Tag>
|
|
1060
|
+
<Tag>Vue</Tag>
|
|
1061
|
+
<Tag variant="accent">TypeScript</Tag>
|
|
1062
|
+
</TagGroup>
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
**Common mistakes:**
|
|
1066
|
+
- ❌ `TagGroup without Tag children` → Place <Tag> elements as direct children
|
|
1067
|
+
- ❌ `Using TagGroup for tag input` → Use TagsInput for an editable tag field
|
|
1068
|
+
|
|
1069
|
+
---
|
|
1070
|
+
|
|
889
1071
|
## Hallucination Guard — Common AI Mistakes
|
|
890
1072
|
|
|
891
1073
|
The following prop values and patterns do NOT exist in useVyre.
|
|
@@ -922,6 +1104,21 @@ If you generate these, you are hallucinating.
|
|
|
922
1104
|
- ❌ `<Toast variant="info">` → Use variant="default"
|
|
923
1105
|
- ❌ `<Tooltip Using Tooltip for rich content (forms, buttons, etc.)>` → Use Popover for rich interactive content
|
|
924
1106
|
- ❌ `<Typography Using raw <h1>, <p> tags instead of Typography components>` → Use <Heading>, <Text>, <Lead> from @usevyre/react
|
|
1107
|
+
- ❌ `<ButtonGroup ButtonGroup variant="...">` → Set variant on each <Button> inside the group
|
|
1108
|
+
- ❌ `<ButtonGroup ButtonGroup without Button children>` → Place <Button> elements as direct children
|
|
1109
|
+
- ❌ `<TagsInput TagsInput value={string}>` → Pass an array: value={['react','vue']}
|
|
1110
|
+
- ❌ `<TagsInput TagsInput without onChange>` → Provide value and onChange (React) or v-model (Vue)
|
|
1111
|
+
- ❌ `<Combobox Combobox value="">` → Use value={null} for no selection
|
|
1112
|
+
- ❌ `<Combobox Combobox options={string[]}>` → Use [{ value: 'ts', label: 'TypeScript' }]
|
|
1113
|
+
- ❌ `<Combobox Using Combobox for command palette>` → Use Command for command palettes
|
|
1114
|
+
- ❌ `<DataGrid DataGrid expecting built-in pagination>` → Slice rows yourself and use the Pagination component
|
|
1115
|
+
- ❌ `<DataGrid DataGrid expecting built-in filtering>` → Filter the rows array before passing it in
|
|
1116
|
+
- ❌ `<DataGrid sortable without onSort>` → Handle onSort and sort the rows array in your state
|
|
1117
|
+
- ❌ `<Tag Tag variant="success">` → Use Badge for success/warning/teal status colors; Tag is for categories/filters
|
|
1118
|
+
- ❌ `<Tag Using Tag for tag input>` → Use TagsInput for adding/removing tags via keyboard
|
|
1119
|
+
- ❌ `<Tag Tag size="xl">` → Use size="lg"
|
|
1120
|
+
- ❌ `<TagGroup TagGroup without Tag children>` → Place <Tag> elements as direct children
|
|
1121
|
+
- ❌ `<TagGroup Using TagGroup for tag input>` → Use TagsInput for an editable tag field
|
|
925
1122
|
|
|
926
1123
|
---
|
|
927
1124
|
|
package/dist/cursor-rules.md
CHANGED
|
@@ -4,7 +4,7 @@ alwaysApply: true
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# useVyre Design System — Cursor Rules
|
|
7
|
-
# Version: 1.
|
|
7
|
+
# Version: 1.1.0
|
|
8
8
|
|
|
9
9
|
You are working in a project using the useVyre design system (@usevyre/react).
|
|
10
10
|
Follow these rules strictly when generating any UI code.
|
|
@@ -283,6 +283,77 @@ Import: `import { Text, Heading, Lead, Code, Blockquote } from "@usevyre/react"`
|
|
|
283
283
|
Never do:
|
|
284
284
|
- ❌ Using raw <h1>, <p> tags instead of Typography components → ✅ Use <Heading>, <Text>, <Lead> from @usevyre/react
|
|
285
285
|
|
|
286
|
+
## ButtonGroup
|
|
287
|
+
Groups multiple Button components into one visual unit (toolbar, segmented control). Pure layout — no internal state.
|
|
288
|
+
Import: `import { ButtonGroup, Button } from "@usevyre/react"`
|
|
289
|
+
|
|
290
|
+
Valid props:
|
|
291
|
+
- orientation: "horizontal" | "vertical" [default: horizontal]
|
|
292
|
+
- size: "sm" | "md" | "lg" | "icon"
|
|
293
|
+
|
|
294
|
+
Never do:
|
|
295
|
+
- ❌ ButtonGroup variant="..." → ✅ Set variant on each <Button> inside the group
|
|
296
|
+
- ❌ ButtonGroup without Button children → ✅ Place <Button> elements as direct children
|
|
297
|
+
|
|
298
|
+
## TagsInput
|
|
299
|
+
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.
|
|
300
|
+
Import: `import { TagsInput } from "@usevyre/react"`
|
|
301
|
+
|
|
302
|
+
Valid props:
|
|
303
|
+
- size: "sm" | "md" | "lg" [default: md]
|
|
304
|
+
|
|
305
|
+
Never do:
|
|
306
|
+
- ❌ TagsInput value={string} → ✅ Pass an array: value={['react','vue']}
|
|
307
|
+
- ❌ TagsInput without onChange → ✅ Provide value and onChange (React) or v-model (Vue)
|
|
308
|
+
|
|
309
|
+
## Combobox
|
|
310
|
+
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).
|
|
311
|
+
Import: `import { Combobox } from "@usevyre/react"`
|
|
312
|
+
|
|
313
|
+
Valid props:
|
|
314
|
+
- size: "sm" | "md" | "lg" [default: md]
|
|
315
|
+
|
|
316
|
+
Never do:
|
|
317
|
+
- ❌ Combobox value="" → ✅ Use value={null} for no selection
|
|
318
|
+
- ❌ Combobox options={string[]} → ✅ Use [{ value: 'ts', label: 'TypeScript' }]
|
|
319
|
+
- ❌ Using Combobox for command palette → ✅ Use Command for command palettes
|
|
320
|
+
|
|
321
|
+
## DataGrid
|
|
322
|
+
Table with built-in column sorting, loading skeletons, and empty state. Filtering and pagination are out of scope — compose with the Pagination component.
|
|
323
|
+
Import: `import { DataGrid } from "@usevyre/react"`
|
|
324
|
+
|
|
325
|
+
Valid props:
|
|
326
|
+
- sortDir: "asc" | "desc"
|
|
327
|
+
|
|
328
|
+
Never do:
|
|
329
|
+
- ❌ DataGrid expecting built-in pagination → ✅ Slice rows yourself and use the Pagination component
|
|
330
|
+
- ❌ DataGrid expecting built-in filtering → ✅ Filter the rows array before passing it in
|
|
331
|
+
- ❌ sortable without onSort → ✅ Handle onSort and sort the rows array in your state
|
|
332
|
+
|
|
333
|
+
## Tag
|
|
334
|
+
Standalone display tag/chip for categories, labels, or filter chips. NOT an input — for tag input use TagsInput. Group multiple with TagGroup.
|
|
335
|
+
Import: `import { Tag } from "@usevyre/react"`
|
|
336
|
+
|
|
337
|
+
Valid props:
|
|
338
|
+
- variant: "default" | "accent" | "danger" [default: default]
|
|
339
|
+
- size: "sm" | "md" | "lg" [default: md]
|
|
340
|
+
|
|
341
|
+
Never do:
|
|
342
|
+
- ❌ Tag variant="success" → ✅ Use Badge for success/warning/teal status colors; Tag is for categories/filters
|
|
343
|
+
- ❌ Using Tag for tag input → ✅ Use TagsInput for adding/removing tags via keyboard
|
|
344
|
+
- ❌ Tag size="xl" → ✅ Use size="lg"
|
|
345
|
+
|
|
346
|
+
## TagGroup
|
|
347
|
+
Read-only container that lays out multiple Tag elements with automatic wrapping and consistent spacing. For tag input use TagsInput.
|
|
348
|
+
Import: `import { TagGroup, Tag } from "@usevyre/react"`
|
|
349
|
+
|
|
350
|
+
Valid props:
|
|
351
|
+
- gap: "sm" | "md" | "lg" [default: md]
|
|
352
|
+
|
|
353
|
+
Never do:
|
|
354
|
+
- ❌ TagGroup without Tag children → ✅ Place <Tag> elements as direct children
|
|
355
|
+
- ❌ Using TagGroup for tag input → ✅ Use TagsInput for an editable tag field
|
|
356
|
+
|
|
286
357
|
## Token Rules
|
|
287
358
|
|
|
288
359
|
Use --vyre-color-semantic-* for all colors. Never use primitive tokens.
|
package/dist/full-context.md
CHANGED
|
@@ -881,6 +881,188 @@ import { Text, Heading, Lead, Code, Blockquote } from "@usevyre/react"
|
|
|
881
881
|
|
|
882
882
|
---
|
|
883
883
|
|
|
884
|
+
### ButtonGroup
|
|
885
|
+
|
|
886
|
+
Groups multiple Button components into one visual unit (toolbar, segmented control). Pure layout — no internal state.
|
|
887
|
+
|
|
888
|
+
```tsx
|
|
889
|
+
import { ButtonGroup, Button } from "@usevyre/react"
|
|
890
|
+
|
|
891
|
+
// Props:
|
|
892
|
+
// orientation = "horizontal" | "vertical" (default: horizontal)
|
|
893
|
+
// attached = boolean (default: false)
|
|
894
|
+
// size = "sm" | "md" | "lg" | "icon"
|
|
895
|
+
|
|
896
|
+
// Examples:
|
|
897
|
+
<ButtonGroup attached>
|
|
898
|
+
<Button variant="secondary">Day</Button>
|
|
899
|
+
<Button variant="secondary">Week</Button>
|
|
900
|
+
<Button variant="secondary">Month</Button>
|
|
901
|
+
</ButtonGroup>
|
|
902
|
+
<ButtonGroup orientation="vertical" attached>
|
|
903
|
+
<Button variant="secondary">Top</Button>
|
|
904
|
+
<Button variant="secondary">Bottom</Button>
|
|
905
|
+
</ButtonGroup>
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
**Common mistakes:**
|
|
909
|
+
- ❌ `ButtonGroup variant="..."` → Set variant on each <Button> inside the group
|
|
910
|
+
- ❌ `ButtonGroup without Button children` → Place <Button> elements as direct children
|
|
911
|
+
|
|
912
|
+
---
|
|
913
|
+
|
|
914
|
+
### TagsInput
|
|
915
|
+
|
|
916
|
+
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.
|
|
917
|
+
|
|
918
|
+
```tsx
|
|
919
|
+
import { TagsInput } from "@usevyre/react"
|
|
920
|
+
|
|
921
|
+
// Props:
|
|
922
|
+
// value = string[]
|
|
923
|
+
// onChange = (tags: string[]) => void
|
|
924
|
+
// placeholder = string
|
|
925
|
+
// disabled = boolean (default: false)
|
|
926
|
+
// max = number
|
|
927
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
928
|
+
|
|
929
|
+
// Examples:
|
|
930
|
+
const [tags, setTags] = useState<string[]>([]);
|
|
931
|
+
<TagsInput value={tags} onChange={setTags} placeholder="Add a tag…" />
|
|
932
|
+
<TagsInput value={tags} onChange={setTags} max={5} />
|
|
933
|
+
```
|
|
934
|
+
|
|
935
|
+
**Common mistakes:**
|
|
936
|
+
- ❌ `TagsInput value={string}` → Pass an array: value={['react','vue']}
|
|
937
|
+
- ❌ `TagsInput without onChange` → Provide value and onChange (React) or v-model (Vue)
|
|
938
|
+
|
|
939
|
+
---
|
|
940
|
+
|
|
941
|
+
### Combobox
|
|
942
|
+
|
|
943
|
+
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).
|
|
944
|
+
|
|
945
|
+
```tsx
|
|
946
|
+
import { Combobox } from "@usevyre/react"
|
|
947
|
+
|
|
948
|
+
// Props:
|
|
949
|
+
// options = { value: string; label: string; disabled?: boolean }[]
|
|
950
|
+
// value = string | null
|
|
951
|
+
// onChange = (value: string | null) => void
|
|
952
|
+
// placeholder = string (default: "Search…")
|
|
953
|
+
// disabled = boolean (default: false)
|
|
954
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
955
|
+
// emptyText = string (default: "No results")
|
|
956
|
+
|
|
957
|
+
// Examples:
|
|
958
|
+
const [lang, setLang] = useState<string | null>(null);
|
|
959
|
+
<Combobox
|
|
960
|
+
options={[{ value: "ts", label: "TypeScript" }, { value: "go", label: "Go" }]}
|
|
961
|
+
value={lang}
|
|
962
|
+
onChange={setLang}
|
|
963
|
+
placeholder="Search language…"
|
|
964
|
+
/>
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
**Common mistakes:**
|
|
968
|
+
- ❌ `Combobox value=""` → Use value={null} for no selection
|
|
969
|
+
- ❌ `Combobox options={string[]}` → Use [{ value: 'ts', label: 'TypeScript' }]
|
|
970
|
+
- ❌ `Using Combobox for command palette` → Use Command for command palettes
|
|
971
|
+
|
|
972
|
+
---
|
|
973
|
+
|
|
974
|
+
### DataGrid
|
|
975
|
+
|
|
976
|
+
Table with built-in column sorting, loading skeletons, and empty state. Filtering and pagination are out of scope — compose with the Pagination component.
|
|
977
|
+
|
|
978
|
+
```tsx
|
|
979
|
+
import { DataGrid } from "@usevyre/react"
|
|
980
|
+
|
|
981
|
+
// Props:
|
|
982
|
+
// columns = { key: string; label: string; sortable?: boolean; width?: string }[]
|
|
983
|
+
// rows = Record<string, unknown>[]
|
|
984
|
+
// sortKey = string
|
|
985
|
+
// sortDir = "asc" | "desc"
|
|
986
|
+
// onSort = (key: string, dir: 'asc' | 'desc') => void
|
|
987
|
+
// loading = boolean (default: false)
|
|
988
|
+
// emptyText = string (default: "No data")
|
|
989
|
+
// stickyHeader = boolean (default: false)
|
|
990
|
+
|
|
991
|
+
// Examples:
|
|
992
|
+
const cols = [{ key: "name", label: "Name", sortable: true }];
|
|
993
|
+
<DataGrid
|
|
994
|
+
columns={cols}
|
|
995
|
+
rows={people}
|
|
996
|
+
sortKey={sortKey}
|
|
997
|
+
sortDir={sortDir}
|
|
998
|
+
onSort={(k, d) => { setSortKey(k); setSortDir(d); }}
|
|
999
|
+
/>
|
|
1000
|
+
<DataGrid columns={cols} rows={[]} loading />
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
**Common mistakes:**
|
|
1004
|
+
- ❌ `DataGrid expecting built-in pagination` → Slice rows yourself and use the Pagination component
|
|
1005
|
+
- ❌ `DataGrid expecting built-in filtering` → Filter the rows array before passing it in
|
|
1006
|
+
- ❌ `sortable without onSort` → Handle onSort and sort the rows array in your state
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
1010
|
+
### Tag
|
|
1011
|
+
|
|
1012
|
+
Standalone display tag/chip for categories, labels, or filter chips. NOT an input — for tag input use TagsInput. Group multiple with TagGroup.
|
|
1013
|
+
|
|
1014
|
+
```tsx
|
|
1015
|
+
import { Tag } from "@usevyre/react"
|
|
1016
|
+
|
|
1017
|
+
// Props:
|
|
1018
|
+
// variant = "default" | "accent" | "danger" (default: default)
|
|
1019
|
+
// size = "sm" | "md" | "lg" (default: md)
|
|
1020
|
+
// onRemove = () => void
|
|
1021
|
+
// onClick = () => void
|
|
1022
|
+
// disabled = boolean (default: false)
|
|
1023
|
+
|
|
1024
|
+
// Examples:
|
|
1025
|
+
<TagGroup>
|
|
1026
|
+
<Tag>Design</Tag>
|
|
1027
|
+
<Tag variant="accent">Featured</Tag>
|
|
1028
|
+
<Tag>Engineering</Tag>
|
|
1029
|
+
</TagGroup>
|
|
1030
|
+
<Tag onRemove={() => removeFilter("react")}>react</Tag>
|
|
1031
|
+
<Tag onClick={() => toggleFilter("vue")}>vue</Tag>
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
**Common mistakes:**
|
|
1035
|
+
- ❌ `Tag variant="success"` → Use Badge for success/warning/teal status colors; Tag is for categories/filters
|
|
1036
|
+
- ❌ `Using Tag for tag input` → Use TagsInput for adding/removing tags via keyboard
|
|
1037
|
+
- ❌ `Tag size="xl"` → Use size="lg"
|
|
1038
|
+
|
|
1039
|
+
---
|
|
1040
|
+
|
|
1041
|
+
### TagGroup
|
|
1042
|
+
|
|
1043
|
+
Read-only container that lays out multiple Tag elements with automatic wrapping and consistent spacing. For tag input use TagsInput.
|
|
1044
|
+
|
|
1045
|
+
```tsx
|
|
1046
|
+
import { TagGroup, Tag } from "@usevyre/react"
|
|
1047
|
+
|
|
1048
|
+
// Props:
|
|
1049
|
+
// gap = "sm" | "md" | "lg" (default: md)
|
|
1050
|
+
// wrap = boolean (default: true)
|
|
1051
|
+
|
|
1052
|
+
// Examples:
|
|
1053
|
+
<TagGroup gap="sm">
|
|
1054
|
+
<Tag>React</Tag>
|
|
1055
|
+
<Tag>Vue</Tag>
|
|
1056
|
+
<Tag variant="accent">TypeScript</Tag>
|
|
1057
|
+
</TagGroup>
|
|
1058
|
+
```
|
|
1059
|
+
|
|
1060
|
+
**Common mistakes:**
|
|
1061
|
+
- ❌ `TagGroup without Tag children` → Place <Tag> elements as direct children
|
|
1062
|
+
- ❌ `Using TagGroup for tag input` → Use TagsInput for an editable tag field
|
|
1063
|
+
|
|
1064
|
+
---
|
|
1065
|
+
|
|
884
1066
|
## Hallucination Guard — Common AI Mistakes
|
|
885
1067
|
|
|
886
1068
|
The following prop values and patterns do NOT exist in useVyre.
|
|
@@ -917,6 +1099,21 @@ If you generate these, you are hallucinating.
|
|
|
917
1099
|
- ❌ `<Toast variant="info">` → Use variant="default"
|
|
918
1100
|
- ❌ `<Tooltip Using Tooltip for rich content (forms, buttons, etc.)>` → Use Popover for rich interactive content
|
|
919
1101
|
- ❌ `<Typography Using raw <h1>, <p> tags instead of Typography components>` → Use <Heading>, <Text>, <Lead> from @usevyre/react
|
|
1102
|
+
- ❌ `<ButtonGroup ButtonGroup variant="...">` → Set variant on each <Button> inside the group
|
|
1103
|
+
- ❌ `<ButtonGroup ButtonGroup without Button children>` → Place <Button> elements as direct children
|
|
1104
|
+
- ❌ `<TagsInput TagsInput value={string}>` → Pass an array: value={['react','vue']}
|
|
1105
|
+
- ❌ `<TagsInput TagsInput without onChange>` → Provide value and onChange (React) or v-model (Vue)
|
|
1106
|
+
- ❌ `<Combobox Combobox value="">` → Use value={null} for no selection
|
|
1107
|
+
- ❌ `<Combobox Combobox options={string[]}>` → Use [{ value: 'ts', label: 'TypeScript' }]
|
|
1108
|
+
- ❌ `<Combobox Using Combobox for command palette>` → Use Command for command palettes
|
|
1109
|
+
- ❌ `<DataGrid DataGrid expecting built-in pagination>` → Slice rows yourself and use the Pagination component
|
|
1110
|
+
- ❌ `<DataGrid DataGrid expecting built-in filtering>` → Filter the rows array before passing it in
|
|
1111
|
+
- ❌ `<DataGrid sortable without onSort>` → Handle onSort and sort the rows array in your state
|
|
1112
|
+
- ❌ `<Tag Tag variant="success">` → Use Badge for success/warning/teal status colors; Tag is for categories/filters
|
|
1113
|
+
- ❌ `<Tag Using Tag for tag input>` → Use TagsInput for adding/removing tags via keyboard
|
|
1114
|
+
- ❌ `<Tag Tag size="xl">` → Use size="lg"
|
|
1115
|
+
- ❌ `<TagGroup TagGroup without Tag children>` → Place <Tag> elements as direct children
|
|
1116
|
+
- ❌ `<TagGroup Using TagGroup for tag input>` → Use TagsInput for an editable tag field
|
|
920
1117
|
|
|
921
1118
|
---
|
|
922
1119
|
|