@alexgorbatchev/shadcn 0.0.72 → 0.0.74
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/README.md +13 -11
- package/dist/{chunk-8sktrf74.js → chunk-074ehhx1.js} +1 -1
- package/dist/{chunk-0bwg27nq.js → chunk-336c0c3z.js} +3 -3
- package/dist/{chunk-3qrvksfh.js → chunk-78ntbpa4.js} +1 -1
- package/dist/{chunk-16qrkr8k.js → chunk-8t11333k.js} +1 -1
- package/dist/{chunk-6pj5fxa2.js → chunk-bshdrjwh.js} +8 -8
- package/dist/{chunk-3b15harp.js → chunk-da67wbm4.js} +1 -1
- package/dist/{chunk-qff5s98n.js → chunk-ga3h6738.js} +1 -1
- package/dist/{chunk-pr5s27j8.js → chunk-jdvyr7tw.js} +550 -471
- package/dist/{chunk-fjw7yyt3.js → chunk-jrf138sy.js} +1 -1
- package/dist/{chunk-vqgw4xab.js → chunk-q3jmy8bv.js} +4 -4
- package/dist/{chunk-5bq2j907.js → chunk-v0bv70xv.js} +119 -3
- package/dist/{chunk-zthc8ajd.js → chunk-wh8gdhc7.js} +1 -1
- package/dist/{chunk-xywttk96.js → chunk-yxwtpq9d.js} +1 -1
- package/dist/{chunk-10vjajh7.js → chunk-yywr1jgk.js} +19 -3
- package/dist/{chunk-d1z748rn.js → chunk-zz072pjn.js} +1 -1
- package/dist/components/MenuParts.d.ts +2 -2
- package/dist/components/OptionCardGroup.d.ts +27 -0
- package/dist/components/assistant-ui/elements/CommandPalette.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelector.js +8 -8
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +7 -7
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +4 -4
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +2 -2
- package/dist/components/assistant-ui/elements/RegenerateMenu.js +2 -2
- package/dist/components/assistant-ui/index.js +13 -13
- package/dist/components/assistant-ui/native/ModelSelector.js +10 -10
- package/dist/components/assistant-ui/native/index.js +10 -10
- package/dist/components/command/Command.d.ts +12 -3
- package/dist/components/command/index.js +1 -1
- package/dist/components/json-render/index.js +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -2
- package/dist/menu/types.d.ts +5 -0
- package/dist/prototype.js +1 -1
- package/llms/components/forms/OptionCardGroup.md +194 -0
- package/llms/components/navigation/Command.md +72 -0
- package/llms/components/navigation/DropdownMenu.md +29 -0
- package/llms/setup.md +13 -11
- package/llms.txt +1 -0
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IAnalyticsProps } from "../../analytics/types.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ComponentProps, type ReactElement } from "react";
|
|
3
3
|
import type { IDensityProps } from "../../density/types.js";
|
|
4
4
|
import { Command as CommandPrimitive } from "cmdk";
|
|
5
5
|
import { Dialog } from "../Dialog.js";
|
|
6
6
|
type CommandProps = ComponentProps<typeof CommandPrimitive> & IDensityProps;
|
|
7
|
-
declare function Command({ density, className, ...props }: CommandProps): ReactElement;
|
|
7
|
+
declare function Command({ density, className, value: valueProp, defaultValue, onValueChange, onKeyDown, loop, ref, ...props }: CommandProps): ReactElement;
|
|
8
8
|
type CommandDialogProps<Payload> = ComponentProps<typeof Dialog<Payload>> & IDensityProps & {
|
|
9
9
|
title?: string;
|
|
10
10
|
description?: string;
|
|
@@ -17,6 +17,15 @@ declare function CommandList({ className, ...props }: ComponentProps<typeof Comm
|
|
|
17
17
|
declare function CommandEmpty({ className, ...props }: ComponentProps<typeof CommandPrimitive.Empty>): ReactElement;
|
|
18
18
|
declare function CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>): ReactElement;
|
|
19
19
|
declare function CommandSeparator({ className, ...props }: ComponentProps<typeof CommandPrimitive.Separator>): ReactElement;
|
|
20
|
-
|
|
20
|
+
type CommandItemProps = ComponentProps<typeof CommandPrimitive.Item> & IAnalyticsProps & {
|
|
21
|
+
/**
|
|
22
|
+
* Disables the item while keeping it reachable with the arrow keys, and shows why as visible secondary text that
|
|
23
|
+
* the item references through `aria-describedby`.
|
|
24
|
+
*/
|
|
25
|
+
disabledReason?: string;
|
|
26
|
+
/** Runs instead of `onSelect` when Enter or a click selects an item with a disabled reason, to announce it. */
|
|
27
|
+
onDisabledSelect?: () => void;
|
|
28
|
+
};
|
|
29
|
+
declare function CommandItem({ analytics, className, children, disabledReason, onDisabledSelect, ref, ...props }: CommandItemProps): ReactElement;
|
|
21
30
|
declare function CommandShortcut({ className, ...props }: ComponentProps<"span">): ReactElement;
|
|
22
31
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut, };
|
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
DrawerHeader2,
|
|
32
32
|
DrawerTitle2,
|
|
33
33
|
DrawerDescription2
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-jdvyr7tw.js";
|
|
35
35
|
import {
|
|
36
36
|
MenuPopup,
|
|
37
37
|
MenuItem2,
|
|
38
38
|
DropdownMenu2,
|
|
39
39
|
DropdownMenuTrigger2
|
|
40
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-yywr1jgk.js";
|
|
41
41
|
import {
|
|
42
42
|
Alert2,
|
|
43
43
|
AlertTitle2,
|
|
@@ -86,6 +86,9 @@ import {
|
|
|
86
86
|
RadioGroup2,
|
|
87
87
|
RadioGroupItem2
|
|
88
88
|
} from "../../chunk-kgqe8gpb.js";
|
|
89
|
+
import {
|
|
90
|
+
Badge2
|
|
91
|
+
} from "../../chunk-9t530p75.js";
|
|
89
92
|
import {
|
|
90
93
|
Card2,
|
|
91
94
|
CardHeader2,
|
|
@@ -100,9 +103,6 @@ import {
|
|
|
100
103
|
TabsList2,
|
|
101
104
|
TabsTrigger2
|
|
102
105
|
} from "../../chunk-k45r2rz0.js";
|
|
103
|
-
import {
|
|
104
|
-
Badge2
|
|
105
|
-
} from "../../chunk-9t530p75.js";
|
|
106
106
|
import"../../chunk-4e96tpw0.js";
|
|
107
107
|
import {
|
|
108
108
|
Checkbox2
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export { Textarea } from "./components/Textarea.js";
|
|
|
18
18
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "./components/Tooltip.js";
|
|
19
19
|
export { Label } from "./components/Label.js";
|
|
20
20
|
export { RadioGroup, RadioGroupItem } from "./components/RadioGroup.js";
|
|
21
|
+
export { OptionCardGroup, OptionCard } from "./components/OptionCardGroup.js";
|
|
22
|
+
export type { OptionCardGroupProps, OptionCardProps } from "./components/OptionCardGroup.js";
|
|
21
23
|
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from "./components/Card.js";
|
|
22
24
|
export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, } from "./components/Combobox.js";
|
|
23
25
|
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants } from "./components/Tabs.js";
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
AccordionItem2,
|
|
14
14
|
AccordionTrigger2,
|
|
15
15
|
AccordionContent2,
|
|
16
|
+
OptionCardGroup2,
|
|
17
|
+
OptionCard2,
|
|
16
18
|
EmptyState3,
|
|
17
19
|
PageMessage2,
|
|
18
20
|
formatDataLabel2,
|
|
@@ -171,7 +173,7 @@ import {
|
|
|
171
173
|
StatusTracker2,
|
|
172
174
|
DashboardLayout2,
|
|
173
175
|
BillingUsage2
|
|
174
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-jdvyr7tw.js";
|
|
175
177
|
import {
|
|
176
178
|
Combobox2,
|
|
177
179
|
ComboboxValue2,
|
|
@@ -240,7 +242,7 @@ import {
|
|
|
240
242
|
MenuShortcut2,
|
|
241
243
|
DropdownMenu2,
|
|
242
244
|
DropdownMenuTrigger2
|
|
243
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-yywr1jgk.js";
|
|
244
246
|
import {
|
|
245
247
|
Empty2,
|
|
246
248
|
EmptyHeader2,
|
|
@@ -721,6 +723,8 @@ export {
|
|
|
721
723
|
NumberFieldInput2 as NumberFieldInput,
|
|
722
724
|
NumberFieldScrubArea2 as NumberFieldScrubArea,
|
|
723
725
|
NumberFieldScrubAreaCursor2 as NumberFieldScrubAreaCursor,
|
|
726
|
+
OptionCard2 as OptionCard,
|
|
727
|
+
OptionCardGroup2 as OptionCardGroup,
|
|
724
728
|
OptionSelect2 as OptionSelect,
|
|
725
729
|
PageHeader2 as PageHeader,
|
|
726
730
|
PageIntro2 as PageIntro,
|
package/dist/menu/types.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ interface IMenuInsetProps extends IDensityProps {
|
|
|
5
5
|
}
|
|
6
6
|
interface IMenuItemOptions extends IMenuInsetProps {
|
|
7
7
|
variant?: "default" | "destructive";
|
|
8
|
+
/**
|
|
9
|
+
* Disables the item while keeping it reachable with the arrow keys, and shows why as visible secondary text that
|
|
10
|
+
* the item references through `aria-describedby`.
|
|
11
|
+
*/
|
|
12
|
+
disabledReason?: string;
|
|
8
13
|
}
|
|
9
14
|
export type MenuLabelProps = Menu.GroupLabel.Props & IMenuInsetProps;
|
|
10
15
|
export type MenuItemProps = Menu.Item.Props & IMenuItemOptions;
|
package/dist/prototype.js
CHANGED
|
@@ -2051,7 +2051,7 @@ var program = new Command;
|
|
|
2051
2051
|
// package.json
|
|
2052
2052
|
var package_default = {
|
|
2053
2053
|
name: "@alexgorbatchev/shadcn",
|
|
2054
|
-
version: "0.0.
|
|
2054
|
+
version: "0.0.74",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# OptionCardGroup
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/OptionCardGroup
|
|
4
|
+
Source: src/components/stories/forms/OptionCardGroup.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/OptionCardGroup.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { OptionCard, OptionCardGroup, Field, FieldError, FieldLegend, FieldSet, Button } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useId, useState } from "react";
|
|
18
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Default component
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
OptionCardGroup
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Default args
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
{ onValueChange: fn() }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Default render
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
(args) => (<FieldSet className="max-w-xl">
|
|
37
|
+
<FieldLegend>Deployment strategy</FieldLegend>
|
|
38
|
+
<OptionCardGroup aria-label="Deployment strategy" {...args}>
|
|
39
|
+
<StrategyOptions disabled={args.disabled}/>
|
|
40
|
+
</OptionCardGroup>
|
|
41
|
+
</FieldSet>)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
Storybook CSF excerpts. Default args and render apply unless overridden. Local helpers, fixtures, decorators, and providers may be required; these are reference excerpts, not standalone consumer modules. Interaction tests are omitted.
|
|
47
|
+
|
|
48
|
+
### Default
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
{}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### RecommendedOption
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
{
|
|
58
|
+
args: { defaultValue: "blue-green" }
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### KeyboardSelection
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
{}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Disabled
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
{
|
|
72
|
+
args: { disabled: true, defaultValue: "rolling" }
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### DisabledOption
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
{
|
|
80
|
+
render: (args) => (<OptionCardGroup aria-label="Deployment strategy" {...args}>
|
|
81
|
+
<OptionCard value="rolling" label="Rolling update"/>
|
|
82
|
+
<OptionCard value="blue-green" label="Blue-green" description="Needs twice the capacity." disabled/>
|
|
83
|
+
<OptionCard value="recreate" label="Recreate"/>
|
|
84
|
+
</OptionCardGroup>)
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### ReadOnly
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
{
|
|
92
|
+
args: { readOnly: true, defaultValue: "recreate" }
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Controlled
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
{
|
|
100
|
+
render: function Render(args) {
|
|
101
|
+
const [value, setValue] = useState("rolling");
|
|
102
|
+
return (<FieldSet className="max-w-xl">
|
|
103
|
+
<FieldLegend>Deployment strategy</FieldLegend>
|
|
104
|
+
<OptionCardGroup {...args} aria-label="Deployment strategy" value={value} onValueChange={setValue}>
|
|
105
|
+
<StrategyOptions />
|
|
106
|
+
</OptionCardGroup>
|
|
107
|
+
<output aria-label="Chosen strategy">{value}</output>
|
|
108
|
+
</FieldSet>);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### CustomMarkers
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
{
|
|
117
|
+
render: (args) => (<OptionCardGroup aria-label="Release window" {...args}>
|
|
118
|
+
<OptionCard value="tonight" marker="1" label="Tonight" description="Fewest users online."/>
|
|
119
|
+
<OptionCard value="weekend" marker="2" label="This weekend" description="More time to watch it."/>
|
|
120
|
+
</OptionCardGroup>)
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### RequiredForm
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
{
|
|
128
|
+
args: { required: true, name: "strategy" },
|
|
129
|
+
render: function Render(args) {
|
|
130
|
+
const [result, setResult] = useState("");
|
|
131
|
+
const [value, setValue] = useState<string | null>(null);
|
|
132
|
+
return (<form aria-label="Strategy form" onReset={() => setValue(null)} onSubmit={(event) => {
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
setResult(JSON.stringify(Object.fromEntries(new FormData(event.currentTarget))));
|
|
135
|
+
}}>
|
|
136
|
+
<FieldSet className="max-w-xl">
|
|
137
|
+
<FieldLegend>Deployment strategy</FieldLegend>
|
|
138
|
+
<OptionCardGroup {...args} aria-label="Deployment strategy" value={value} onValueChange={setValue}>
|
|
139
|
+
<StrategyOptions />
|
|
140
|
+
</OptionCardGroup>
|
|
141
|
+
<Field orientation="horizontal">
|
|
142
|
+
<Button type="submit">Save strategy</Button>
|
|
143
|
+
<Button type="reset">Reset strategy</Button>
|
|
144
|
+
</Field>
|
|
145
|
+
</FieldSet>
|
|
146
|
+
<output aria-label="Saved strategy">{result}</output>
|
|
147
|
+
</form>);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Invalid
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
{
|
|
156
|
+
render: function Render(args) {
|
|
157
|
+
const id = useId();
|
|
158
|
+
return (<FieldSet className="max-w-xl">
|
|
159
|
+
<FieldLegend>Deployment strategy</FieldLegend>
|
|
160
|
+
<OptionCardGroup {...args} aria-label="Deployment strategy" aria-invalid>
|
|
161
|
+
<OptionCard value="rolling" label="Rolling update" aria-invalid aria-errormessage={`${id}-error`}/>
|
|
162
|
+
<OptionCard value="blue-green" label="Blue-green" recommended aria-invalid aria-errormessage={`${id}-error`}/>
|
|
163
|
+
</OptionCardGroup>
|
|
164
|
+
<FieldError id={`${id}-error`}>Choose a deployment strategy.</FieldError>
|
|
165
|
+
</FieldSet>);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### NativeStateCallbacks
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
{
|
|
174
|
+
args: { disabled: false, className: (state) => (state.disabled ? "gap-2" : "gap-6") },
|
|
175
|
+
render: (args) => (<OptionCardGroup aria-label="Deployment strategy" {...args}>
|
|
176
|
+
<OptionCard value="rolling" label="Rolling update" className={(state) => (state.checked ? "min-h-24" : "min-h-16")}/>
|
|
177
|
+
<OptionCard value="recreate" label="Recreate"/>
|
|
178
|
+
</OptionCardGroup>)
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### NarrowWidth
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
{
|
|
186
|
+
args: { defaultValue: "blue-green" },
|
|
187
|
+
render: (args) => (<div className="w-72">
|
|
188
|
+
<OptionCardGroup aria-label="Deployment strategy" {...args}>
|
|
189
|
+
<StrategyOptions />
|
|
190
|
+
<OptionCard value="canary-with-a-very-long-unbroken-identifier" label="Canary-release-to-one-percent-of-traffic-first" description="A long label wraps inside its card instead of widening the group."/>
|
|
191
|
+
</OptionCardGroup>
|
|
192
|
+
</div>)
|
|
193
|
+
}
|
|
194
|
+
```
|
|
@@ -469,3 +469,75 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
469
469
|
decorators: RightToLeft.decorators
|
|
470
470
|
}
|
|
471
471
|
```
|
|
472
|
+
|
|
473
|
+
### DisabledReasons
|
|
474
|
+
|
|
475
|
+
```tsx
|
|
476
|
+
{
|
|
477
|
+
args: { loop: false },
|
|
478
|
+
render: function Render(args) {
|
|
479
|
+
const [action, setAction] = useState("None");
|
|
480
|
+
const [announced, setAnnounced] = useState("");
|
|
481
|
+
return (<div className="w-80 border border-border">
|
|
482
|
+
<Command {...args} label="Search commands">
|
|
483
|
+
<CommandInput placeholder="Search commands" aria-label="Search commands"/>
|
|
484
|
+
<CommandList label="Commands">
|
|
485
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
486
|
+
<CommandGroup heading="Commands for 2 tracks">
|
|
487
|
+
<CommandItem value="analyze" onSelect={setAction}>
|
|
488
|
+
Analyze…
|
|
489
|
+
</CommandItem>
|
|
490
|
+
<CommandItem value="move" keywords={["relocate"]} disabledReason="One track only" onSelect={setAction} onDisabledSelect={() => setAnnounced("One track only")}>
|
|
491
|
+
Move audio file…<CommandShortcut>M</CommandShortcut>
|
|
492
|
+
</CommandItem>
|
|
493
|
+
<CommandItem value="delete" disabled>
|
|
494
|
+
Delete workspace
|
|
495
|
+
</CommandItem>
|
|
496
|
+
<CommandItem value="tags" onSelect={setAction}>
|
|
497
|
+
Tags…
|
|
498
|
+
</CommandItem>
|
|
499
|
+
</CommandGroup>
|
|
500
|
+
</CommandList>
|
|
501
|
+
</Command>
|
|
502
|
+
<output aria-label="Executed command">{action}</output>
|
|
503
|
+
<output aria-label="Announced reason">{announced}</output>
|
|
504
|
+
</div>);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
### LoopingDisabledReasons
|
|
510
|
+
|
|
511
|
+
```tsx
|
|
512
|
+
{
|
|
513
|
+
args: { loop: true },
|
|
514
|
+
render: function Render(args) {
|
|
515
|
+
const [action, setAction] = useState("None");
|
|
516
|
+
const [announced, setAnnounced] = useState("");
|
|
517
|
+
return (<div className="w-80 border border-border">
|
|
518
|
+
<Command {...args} label="Search commands">
|
|
519
|
+
<CommandInput placeholder="Search commands" aria-label="Search commands"/>
|
|
520
|
+
<CommandList label="Commands">
|
|
521
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
522
|
+
<CommandGroup heading="Commands for 2 tracks">
|
|
523
|
+
<CommandItem value="analyze" onSelect={setAction}>
|
|
524
|
+
Analyze…
|
|
525
|
+
</CommandItem>
|
|
526
|
+
<CommandItem value="move" keywords={["relocate"]} disabledReason="One track only" onSelect={setAction} onDisabledSelect={() => setAnnounced("One track only")}>
|
|
527
|
+
Move audio file…<CommandShortcut>M</CommandShortcut>
|
|
528
|
+
</CommandItem>
|
|
529
|
+
<CommandItem value="delete" disabled>
|
|
530
|
+
Delete workspace
|
|
531
|
+
</CommandItem>
|
|
532
|
+
<CommandItem value="tags" onSelect={setAction}>
|
|
533
|
+
Tags…
|
|
534
|
+
</CommandItem>
|
|
535
|
+
</CommandGroup>
|
|
536
|
+
</CommandList>
|
|
537
|
+
</Command>
|
|
538
|
+
<output aria-label="Executed command">{action}</output>
|
|
539
|
+
<output aria-label="Announced reason">{announced}</output>
|
|
540
|
+
</div>);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
```
|
|
@@ -600,3 +600,32 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
600
600
|
decorators: RightToLeft.decorators
|
|
601
601
|
}
|
|
602
602
|
```
|
|
603
|
+
|
|
604
|
+
### DisabledReasons
|
|
605
|
+
|
|
606
|
+
```tsx
|
|
607
|
+
{
|
|
608
|
+
render: function Render() {
|
|
609
|
+
const [action, setAction] = useState("None");
|
|
610
|
+
return (<>
|
|
611
|
+
<DropdownMenu>
|
|
612
|
+
<DropdownMenuTrigger render={<Button variant="outline"/>}>Track actions</DropdownMenuTrigger>
|
|
613
|
+
<DropdownMenuContent>
|
|
614
|
+
<DropdownMenuGroup>
|
|
615
|
+
<DropdownMenuItem onClick={() => setAction("Edit")}>
|
|
616
|
+
<FileIcon />
|
|
617
|
+
Edit track info…
|
|
618
|
+
</DropdownMenuItem>
|
|
619
|
+
<DropdownMenuItem disabledReason="One track only" onClick={() => setAction("Move")}>
|
|
620
|
+
<SaveIcon />
|
|
621
|
+
Move audio file…
|
|
622
|
+
</DropdownMenuItem>
|
|
623
|
+
<DropdownMenuItem onClick={() => setAction("Analyze")}>Analyze…</DropdownMenuItem>
|
|
624
|
+
</DropdownMenuGroup>
|
|
625
|
+
</DropdownMenuContent>
|
|
626
|
+
</DropdownMenu>
|
|
627
|
+
<output aria-label="Menu action">{action}</output>
|
|
628
|
+
</>);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
```
|
package/llms/setup.md
CHANGED
|
@@ -264,17 +264,17 @@ The npm package includes the same index at `llms.txt` in its root and its linked
|
|
|
264
264
|
|
|
265
265
|
# Component Catalog
|
|
266
266
|
|
|
267
|
-
| Area | Components
|
|
268
|
-
| :----------------------- |
|
|
269
|
-
| Actions and status | Alert, Badge, Button, ButtonGroup, ButtonLink, Sonner, Toast, Toggle, ToggleGroup
|
|
270
|
-
| Forms and selections | AuthForm, Calendar, Checkbox, Combobox, Command, EmailCodeAuthForm, Field, Input, InputGroup, InputOTP, Label, OptionSelect, Questionnaire, RadioGroup, Select, Slider, Switch, Textarea
|
|
271
|
-
| Structure and navigation | Accordion, AspectRatio, Avatar, Breadcrumb, Card, Carousel, Chart, Collapsible, Empty, Item, Kbd, Menubar, NavigationMenu, Pagination, Resizable, ScrollArea, Separator, Sidebar, Table, Tabs
|
|
272
|
-
| Layout and typography | AppShell, Container, Grid, GridItem, Heading, PageHeader, PageIntro, Stack, Text
|
|
273
|
-
| Data display | ImageComparison, ImageViewer, WeatherForecast, WeatherSummary
|
|
274
|
-
| Overlays | AlertDialog, ContextMenu, Dialog, Drawer, DropdownMenu, HoverCard, Popover, Sheet, Tooltip
|
|
275
|
-
| Loading | Progress, Skeleton, Spinner
|
|
276
|
-
| Conversations | Attachment, Bubble, Marker, Message, MessageScroller
|
|
277
|
-
| App configuration | DensityProvider, DirectionProvider, ThemeProvider
|
|
267
|
+
| Area | Components |
|
|
268
|
+
| :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
269
|
+
| Actions and status | Alert, Badge, Button, ButtonGroup, ButtonLink, Sonner, Toast, Toggle, ToggleGroup |
|
|
270
|
+
| Forms and selections | AuthForm, Calendar, Checkbox, Combobox, Command, EmailCodeAuthForm, Field, Input, InputGroup, InputOTP, Label, OptionCardGroup, OptionSelect, Questionnaire, RadioGroup, Select, Slider, Switch, Textarea |
|
|
271
|
+
| Structure and navigation | Accordion, AspectRatio, Avatar, Breadcrumb, Card, Carousel, Chart, Collapsible, Empty, Item, Kbd, Menubar, NavigationMenu, Pagination, Resizable, ScrollArea, Separator, Sidebar, Table, Tabs |
|
|
272
|
+
| Layout and typography | AppShell, Container, Grid, GridItem, Heading, PageHeader, PageIntro, Stack, Text |
|
|
273
|
+
| Data display | ImageComparison, ImageViewer, WeatherForecast, WeatherSummary |
|
|
274
|
+
| Overlays | AlertDialog, ContextMenu, Dialog, Drawer, DropdownMenu, HoverCard, Popover, Sheet, Tooltip |
|
|
275
|
+
| Loading | Progress, Skeleton, Spinner |
|
|
276
|
+
| Conversations | Attachment, Bubble, Marker, Message, MessageScroller |
|
|
277
|
+
| App configuration | DensityProvider, DirectionProvider, ThemeProvider |
|
|
278
278
|
|
|
279
279
|
Use the composed parts exported from the package root, such as `DialogTrigger`, `DialogContent`, and `DialogTitle`. Storybook provides working compositions, variants, disabled states, and action callbacks. The local preview starts with `just storybook` and binds to `127.0.0.1:6006`.
|
|
280
280
|
|
|
@@ -308,6 +308,8 @@ Compose grouped controls with InputGroupInput or InputGroupTextarea, then place
|
|
|
308
308
|
|
|
309
309
|
`RadioGroup` uses `value`/`onValueChange` for controlled selection and `defaultValue` for initial selection. Name the group and each option; use `FieldSet`/`FieldLegend` and `Field`/`FieldLabel` for visible labels. Arrow keys select options and skip disabled items; Space selects a focused option. Both the group and `RadioGroupItem` preserve native state-based className and style callbacks. Use `nativeButton` with `render={<button type="button" />}` for sibling labels on button-rendered items. `name`, `required`, and `form` connect selection to browser form submission and validation, including an external form. The required-form story restores controlled selection through `onReset`.
|
|
310
310
|
|
|
311
|
+
`OptionCardGroup` is a single-choice group for decisions. Each `OptionCard` is a bordered radio card with a leading letter (a, b, c by position, or `marker`), a bold `label`, an optional muted `description`, and an optional `recommended` flag that adds a success-colored tag after the label and tints the unselected card's border. The selected card takes the primary border, or the system highlight color in forced-colors mode, and keyboard focus draws an offset outline. Mark cards `aria-invalid` with `aria-errormessage` to show an error; unselected invalid cards take the destructive border instead of the recommended tint. It shares `RadioGroup`'s Base UI behavior: `value`/`onValueChange`/`defaultValue`, arrow keys that select and skip disabled cards, Space to select, `disabled` and `readOnly`, and `name`/`required`/`form` for native submission and validation. The label and tag name each card; the description describes it. Use `RadioGroup` for short plain lists.
|
|
312
|
+
|
|
311
313
|
`Select` supports single, multiple, and object values through its native generic props. Pass `items` to display labels instead of raw values; provide object comparison and serialization through `isItemEqualToValue` and `itemToStringValue`. Disabled options remain focusable while rejecting selection. Read-only selection permits browsing and blocks value changes. The composed parts preserve state-based className callbacks, and portaled content follows density and DirectionProvider context. Named multiple selects submit repeated form entries. Restore controlled values in your form's reset handler. Bun-built RTL menus currently place the selection checkmark on the wrong side; verify that layout in consuming apps. See the [Base UI Select reference](https://base-ui.com/react/components/select).
|
|
312
314
|
|
|
313
315
|
`Combobox` retains native filtering, single/multiple selection, cancellation, controlled values, object identity comparison, and keyboard focus. Give its input an accessible name; an input inside the popup uses a named trigger. `ComboboxInput.className` belongs to the native input and accepts its state callback; use `frameClassName` for the surrounding InputGroup. Built-in controls use “Open popup” and “Clear selection”; customize them with `triggerLabel` and `clearLabel`. Chips use density metrics, and their removal button is named “Remove item”. Keep `ComboboxEmpty` mounted so its polite live region can announce results. In grouped lists, pass `items={group.items}` to each `ComboboxGroup`. Popup density and direction follow their providers, including through portals; reduced motion disables popup animations. See the [Base UI Combobox reference](https://base-ui.com/react/components/combobox).
|
package/llms.txt
CHANGED
|
@@ -401,6 +401,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
401
401
|
- [InputOTP](./llms/components/forms/InputOTP.md)
|
|
402
402
|
- [Label](./llms/components/forms/Label.md)
|
|
403
403
|
- [NumberField](./llms/components/forms/NumberField.md)
|
|
404
|
+
- [OptionCardGroup](./llms/components/forms/OptionCardGroup.md)
|
|
404
405
|
- [OptionSelect](./llms/components/forms/OptionSelect.md)
|
|
405
406
|
- [Questionnaire](./llms/components/forms/Questionnaire.md)
|
|
406
407
|
- [RadioGroup](./llms/components/forms/RadioGroup.md)
|