@alexgorbatchev/shadcn 0.0.66 → 0.0.68
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 +2 -0
- package/dist/{chunk-p56he2j7.js → chunk-9n617bte.js} +5 -3
- package/dist/{chunk-7gjmprwx.js → chunk-c3e28a4k.js} +1 -1
- package/dist/{chunk-g975kjdm.js → chunk-c94nwxaf.js} +1 -1
- package/dist/{chunk-efm3b1py.js → chunk-dnnxz673.js} +1 -1
- package/dist/{chunk-hz08pzsc.js → chunk-pr5s27j8.js} +63 -50
- package/dist/components/ToggleGroup.d.ts +3 -1
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/MessageActions.js +2 -2
- package/dist/components/assistant-ui/elements/ReasoningEffort.js +2 -2
- package/dist/components/assistant-ui/index.js +4 -4
- package/dist/components/json-render/index.js +2 -2
- package/dist/index.js +2 -2
- package/dist/prototype.js +1 -1
- package/dist/toggle-group/types.d.ts +1 -0
- package/llms/components/actions/ToggleGroup.md +27 -0
- package/llms/components/forms/InlineEdit.md +12 -0
- package/llms/setup.md +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -281,6 +281,8 @@ Set `wrap` on `ItemTitle` to keep complete titles visible in narrow items, inclu
|
|
|
281
281
|
|
|
282
282
|
`ToggleGroup` supports optional single selection by default and independent selections with `multiple`. Set `required` for a single selection that stays pressed when activated again by pointer, Space, or Enter. Required groups accept exactly one initial item through the controlled `value` or uncontrolled `defaultValue` tuple and cannot use `multiple`. Empty selection requests are canceled through Base UI before consumer callbacks or analytics run; accepted changes retain the native array value and event-details API. This selection rule does not add form submission or validation behavior.
|
|
283
283
|
|
|
284
|
+
`ToggleGroup` defaults to `layout="content"`, fitting its items. Set `layout="fill"` to fill the parent width and give horizontal items equal flexible widths. Items inherit the layout automatically; vertical groups fill the width while retaining their control heights. Use `spacing={0}` for joined items. Layout does not change selection, keyboard navigation, density or disabled behavior.
|
|
285
|
+
|
|
284
286
|
`ScrollArea` supplies a native scroll viewport and one vertical `ScrollBar` by default. Set `scrollbars={<ScrollBar orientation="horizontal" />}` for a wide horizontal layout, or supply a fragment containing vertical and horizontal parts for both axes. The tracks stay outside the viewport and reserve their shared corner. `keepMounted` belongs to `ScrollBar`; root and track className callbacks receive native overflow/scroll state. Focus the viewport for native keyboard scrolling.
|
|
285
287
|
|
|
286
288
|
Scrolling is intentional: cards, panels, dialogs, sheets, and floating surfaces carry `data-scroll="none"`. Put long content in a nested `ScrollArea` or an explicitly styled native scroll viewport; the outer surface stays stationary. `DialogContent` bounds its height to the viewport and uses a flex column, so give a nested `ScrollArea` `className="min-h-0"` to let it shrink within the dialog. Headers and footers stay outside that scroll area when they need to remain visible.
|
|
@@ -59,6 +59,7 @@ function ToggleGroup2({
|
|
|
59
59
|
variant,
|
|
60
60
|
size,
|
|
61
61
|
spacing = 2,
|
|
62
|
+
layout = "content",
|
|
62
63
|
orientation = "horizontal",
|
|
63
64
|
children,
|
|
64
65
|
style,
|
|
@@ -72,12 +73,13 @@ function ToggleGroup2({
|
|
|
72
73
|
"data-variant": variant,
|
|
73
74
|
"data-size": size,
|
|
74
75
|
"data-spacing": spacing,
|
|
76
|
+
"data-layout": layout,
|
|
75
77
|
orientation,
|
|
76
78
|
style: (state) => ({
|
|
77
79
|
gap: `calc(var(--spacing) * ${spacing})`,
|
|
78
80
|
...typeof style === "function" ? style(state) : style
|
|
79
81
|
}),
|
|
80
|
-
className: (state) => cn2("group/toggle-group flex w-fit flex-row items-center rounded-sm data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", typeof className === "function" ? className(state) : className),
|
|
82
|
+
className: (state) => cn2("group/toggle-group flex w-fit flex-row items-center rounded-sm data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", layout === "fill" && "w-full", typeof className === "function" ? className(state) : className),
|
|
81
83
|
...props,
|
|
82
84
|
onValueChange: (value, details) => {
|
|
83
85
|
if (required && value.length === 0) {
|
|
@@ -87,7 +89,7 @@ function ToggleGroup2({
|
|
|
87
89
|
trackedOnValueChange(value, details);
|
|
88
90
|
},
|
|
89
91
|
children: /* @__PURE__ */ jsx2(ToggleGroupContext.Provider, {
|
|
90
|
-
value: { variant, size, spacing },
|
|
92
|
+
value: { variant, size, spacing, layout },
|
|
91
93
|
children
|
|
92
94
|
})
|
|
93
95
|
});
|
|
@@ -106,7 +108,7 @@ function ToggleGroupItem2({
|
|
|
106
108
|
"data-variant": context.variant ?? variant,
|
|
107
109
|
"data-size": context.size ?? size,
|
|
108
110
|
"data-spacing": context.spacing,
|
|
109
|
-
className: (state) => cn2("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none focus:relative focus:z-10 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-s-sm group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-sm group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-e-sm group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-sm group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-s-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-s group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants2({ variant: context.variant ?? variant, size: context.size ?? size }), typeof className === "function" ? className(state) : className),
|
|
111
|
+
className: (state) => cn2("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none focus:relative focus:z-10 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-s-sm group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-sm group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-e-sm group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-sm group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-s-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-s group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants2({ variant: context.variant ?? variant, size: context.size ?? size }), context.layout === "fill" && "min-w-0 group-data-[orientation=horizontal]/toggle-group:flex-1", typeof className === "function" ? className(state) : className),
|
|
110
112
|
...props
|
|
111
113
|
});
|
|
112
114
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
ToggleGroup2,
|
|
6
6
|
ToggleGroupItem2
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-9n617bte.js";
|
|
8
8
|
|
|
9
9
|
// src/components/assistant-ui/elements/MessageActions.tsx
|
|
10
10
|
import { CheckIcon, CopyIcon, EllipsisIcon, RefreshCwIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
|
|
@@ -2565,6 +2565,7 @@ function InlineEdit2({
|
|
|
2565
2565
|
const shouldCancel = useRef2(false);
|
|
2566
2566
|
const [isSaving, setSaving] = useState2(false);
|
|
2567
2567
|
const [error, setError] = useState2(null);
|
|
2568
|
+
const [isErrorOpen, setErrorOpen] = useState2(false);
|
|
2568
2569
|
useEffect2(() => {
|
|
2569
2570
|
input.current?.focus();
|
|
2570
2571
|
if (shouldSelectOnMount)
|
|
@@ -2580,73 +2581,85 @@ function InlineEdit2({
|
|
|
2580
2581
|
}
|
|
2581
2582
|
setSaving(true);
|
|
2582
2583
|
setError("");
|
|
2584
|
+
setErrorOpen(false);
|
|
2583
2585
|
try {
|
|
2584
2586
|
await onCommit(value);
|
|
2585
2587
|
track({ name: "ui.commit" });
|
|
2586
2588
|
} catch (error) {
|
|
2587
2589
|
isFinished.current = false;
|
|
2588
2590
|
setError(renderError ? renderError(error) : "Could not save this edit.");
|
|
2591
|
+
setErrorOpen(true);
|
|
2589
2592
|
} finally {
|
|
2590
2593
|
setSaving(false);
|
|
2591
2594
|
}
|
|
2592
2595
|
};
|
|
2593
|
-
return /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ jsxs15("form", {
|
|
2594
2597
|
className: "min-w-0",
|
|
2595
2598
|
onSubmit: (event) => {
|
|
2596
2599
|
event.preventDefault();
|
|
2597
2600
|
save();
|
|
2598
2601
|
},
|
|
2599
|
-
children:
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2602
|
+
children: [
|
|
2603
|
+
/* @__PURE__ */ jsxs15(Tooltip2, {
|
|
2604
|
+
open: Boolean(error) && isErrorOpen,
|
|
2605
|
+
onOpenChange: setErrorOpen,
|
|
2606
|
+
disableHoverablePopup: true,
|
|
2607
|
+
triggerId,
|
|
2608
|
+
children: [
|
|
2609
|
+
/* @__PURE__ */ jsx26(TooltipTrigger2, {
|
|
2610
|
+
id: triggerId,
|
|
2611
|
+
render: /* @__PURE__ */ jsx26(Input2, {
|
|
2612
|
+
analytics: false,
|
|
2613
|
+
ref: input,
|
|
2614
|
+
density,
|
|
2615
|
+
className: "h-[1lh] rounded-none border-0 px-0 py-0 text-[length:inherit] leading-[inherit]",
|
|
2616
|
+
"aria-label": label,
|
|
2617
|
+
"aria-invalid": Boolean(error),
|
|
2618
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
2619
|
+
"aria-description": "Enter saves. Escape cancels.",
|
|
2620
|
+
value,
|
|
2621
|
+
disabled: isDisabled || isSaving,
|
|
2622
|
+
onChange: (event) => onValueChange(event.target.value),
|
|
2623
|
+
onBlur: () => {
|
|
2624
|
+
if (shouldCancel.current && !isFinished.current) {
|
|
2625
|
+
isFinished.current = true;
|
|
2626
|
+
onCancel();
|
|
2627
|
+
} else
|
|
2628
|
+
save();
|
|
2629
|
+
},
|
|
2630
|
+
onKeyDown: (event) => {
|
|
2631
|
+
if (event.key === "Escape") {
|
|
2632
|
+
event.preventDefault();
|
|
2633
|
+
event.stopPropagation();
|
|
2634
|
+
shouldCancel.current = true;
|
|
2635
|
+
event.currentTarget.blur();
|
|
2636
|
+
} else if (event.key === "Enter") {
|
|
2637
|
+
event.preventDefault();
|
|
2638
|
+
event.currentTarget.blur();
|
|
2639
|
+
}
|
|
2633
2640
|
}
|
|
2634
|
-
}
|
|
2635
|
-
})
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2641
|
+
})
|
|
2642
|
+
}),
|
|
2643
|
+
error && /* @__PURE__ */ jsx26(TooltipContent2, {
|
|
2644
|
+
density,
|
|
2645
|
+
side: "bottom",
|
|
2646
|
+
align: "start",
|
|
2647
|
+
"data-testid": "InlineEdit--error-popup",
|
|
2648
|
+
"aria-hidden": true,
|
|
2649
|
+
children: /* @__PURE__ */ jsx26("p", {
|
|
2650
|
+
className: "text-destructive",
|
|
2651
|
+
children: error
|
|
2652
|
+
})
|
|
2646
2653
|
})
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2654
|
+
]
|
|
2655
|
+
}),
|
|
2656
|
+
error && /* @__PURE__ */ jsx26("p", {
|
|
2657
|
+
id: errorId,
|
|
2658
|
+
role: "alert",
|
|
2659
|
+
className: "sr-only",
|
|
2660
|
+
children: error
|
|
2661
|
+
})
|
|
2662
|
+
]
|
|
2650
2663
|
});
|
|
2651
2664
|
}
|
|
2652
2665
|
// src/components/StarRating.tsx
|
|
@@ -21,7 +21,9 @@ type RequiredToggleGroupSelection = {
|
|
|
21
21
|
});
|
|
22
22
|
interface IToggleGroupLayout {
|
|
23
23
|
spacing?: number;
|
|
24
|
+
/** Fill the parent width and distribute horizontal items equally. */
|
|
25
|
+
layout?: "content" | "fill";
|
|
24
26
|
}
|
|
25
|
-
export declare function ToggleGroup({ analytics, density, className, variant, size, spacing, orientation, children, style, required, ...props }: ToggleGroupProps): ReactElement;
|
|
27
|
+
export declare function ToggleGroup({ analytics, density, className, variant, size, spacing, layout, orientation, children, style, required, ...props }: ToggleGroupProps): ReactElement;
|
|
26
28
|
export declare function ToggleGroupItem({ density, className, variant, size, ...props }: ToggleProps): ReactElement;
|
|
27
29
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FeedbackDialog2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-c3e28a4k.js";
|
|
4
|
+
import"../../../chunk-9n617bte.js";
|
|
5
5
|
import"../../../chunk-9n0axzd5.js";
|
|
6
6
|
import"../../../chunk-k1f35j55.js";
|
|
7
7
|
import"../../../chunk-m32ptxf3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MessageActions2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-c94nwxaf.js";
|
|
4
|
+
import"../../../chunk-9n617bte.js";
|
|
5
5
|
import"../../../chunk-bd09gygt.js";
|
|
6
6
|
import"../../../chunk-x90xmrba.js";
|
|
7
7
|
import"../../../chunk-jpvw9xqy.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReasoningEffort2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-dnnxz673.js";
|
|
4
|
+
import"../../../chunk-9n617bte.js";
|
|
5
5
|
import"../../../chunk-bcwbh20z.js";
|
|
6
6
|
import"../../../chunk-5mydsjp3.js";
|
|
7
7
|
import"../../../chunk-8ssktt4b.js";
|
|
@@ -259,10 +259,10 @@ import"../../chunk-2b5f37wj.js";
|
|
|
259
259
|
import {
|
|
260
260
|
EveAskQuestion2
|
|
261
261
|
} from "../../chunk-t5e0s8q6.js";
|
|
262
|
-
import"../../chunk-
|
|
262
|
+
import"../../chunk-9n617bte.js";
|
|
263
263
|
import {
|
|
264
264
|
FeedbackDialog2
|
|
265
|
-
} from "../../chunk-
|
|
265
|
+
} from "../../chunk-c3e28a4k.js";
|
|
266
266
|
import {
|
|
267
267
|
FileRoot2,
|
|
268
268
|
FileIconDisplay2,
|
|
@@ -352,7 +352,7 @@ import {
|
|
|
352
352
|
} from "../../chunk-4zm4dn1a.js";
|
|
353
353
|
import {
|
|
354
354
|
MessageActions2
|
|
355
|
-
} from "../../chunk-
|
|
355
|
+
} from "../../chunk-c94nwxaf.js";
|
|
356
356
|
import {
|
|
357
357
|
MessageAttachments2
|
|
358
358
|
} from "../../chunk-tw8f1ew4.js";
|
|
@@ -462,7 +462,7 @@ import {
|
|
|
462
462
|
} from "../../chunk-x0p3g392.js";
|
|
463
463
|
import {
|
|
464
464
|
ReasoningEffort2
|
|
465
|
-
} from "../../chunk-
|
|
465
|
+
} from "../../chunk-dnnxz673.js";
|
|
466
466
|
import {
|
|
467
467
|
SwapLabel2
|
|
468
468
|
} from "../../chunk-39q6906v.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
DrawerHeader2,
|
|
32
32
|
DrawerTitle2,
|
|
33
33
|
DrawerDescription2
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-pr5s27j8.js";
|
|
35
35
|
import {
|
|
36
36
|
MenuPopup,
|
|
37
37
|
MenuItem2,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
Toggle2,
|
|
121
121
|
ToggleGroup2,
|
|
122
122
|
ToggleGroupItem2
|
|
123
|
-
} from "../../chunk-
|
|
123
|
+
} from "../../chunk-9n617bte.js";
|
|
124
124
|
import {
|
|
125
125
|
Avatar2,
|
|
126
126
|
AvatarImage2,
|
package/dist/index.js
CHANGED
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
StatusTracker2,
|
|
172
172
|
DashboardLayout2,
|
|
173
173
|
BillingUsage2
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-pr5s27j8.js";
|
|
175
175
|
import {
|
|
176
176
|
Tabs2,
|
|
177
177
|
tabsListVariants2,
|
|
@@ -274,7 +274,7 @@ import {
|
|
|
274
274
|
Toggle2,
|
|
275
275
|
ToggleGroup2,
|
|
276
276
|
ToggleGroupItem2
|
|
277
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-9n617bte.js";
|
|
278
278
|
import {
|
|
279
279
|
Checkbox2
|
|
280
280
|
} from "./chunk-b5s5y5wq.js";
|
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.68",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -31,6 +31,7 @@ ToggleGroup
|
|
|
31
31
|
variant: { control: "select", options: ["default", "outline"] },
|
|
32
32
|
orientation: { control: "select", options: ["horizontal", "vertical"] },
|
|
33
33
|
spacing: { control: "number" },
|
|
34
|
+
layout: { control: "select", options: ["content", "fill"] },
|
|
34
35
|
}
|
|
35
36
|
```
|
|
36
37
|
|
|
@@ -124,6 +125,32 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
124
125
|
}
|
|
125
126
|
```
|
|
126
127
|
|
|
128
|
+
### Fill
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
{
|
|
132
|
+
args: { layout: "fill", spacing: 0, variant: "outline", size: "sm" },
|
|
133
|
+
decorators: [
|
|
134
|
+
(Story) => (<div style={{ width: 360, maxWidth: "100%" }}>
|
|
135
|
+
<Story />
|
|
136
|
+
</div>),
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### FillVertical
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
{
|
|
145
|
+
args: { ...Fill.args, orientation: "vertical" },
|
|
146
|
+
decorators: [
|
|
147
|
+
(Story) => (<div style={{ width: 360, maxWidth: "100%" }}>
|
|
148
|
+
<Story />
|
|
149
|
+
</div>),
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
127
154
|
### Vertical
|
|
128
155
|
|
|
129
156
|
```tsx
|
|
@@ -66,6 +66,18 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
### DismissedValidation
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
{
|
|
73
|
+
args: {
|
|
74
|
+
onCommit: async () => {
|
|
75
|
+
throw new Error("Private storage diagnostic");
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
69
81
|
### UnchangedEnter
|
|
70
82
|
|
|
71
83
|
```tsx
|
package/llms/setup.md
CHANGED
|
@@ -281,6 +281,8 @@ Set `wrap` on `ItemTitle` to keep complete titles visible in narrow items, inclu
|
|
|
281
281
|
|
|
282
282
|
`ToggleGroup` supports optional single selection by default and independent selections with `multiple`. Set `required` for a single selection that stays pressed when activated again by pointer, Space, or Enter. Required groups accept exactly one initial item through the controlled `value` or uncontrolled `defaultValue` tuple and cannot use `multiple`. Empty selection requests are canceled through Base UI before consumer callbacks or analytics run; accepted changes retain the native array value and event-details API. This selection rule does not add form submission or validation behavior.
|
|
283
283
|
|
|
284
|
+
`ToggleGroup` defaults to `layout="content"`, fitting its items. Set `layout="fill"` to fill the parent width and give horizontal items equal flexible widths. Items inherit the layout automatically; vertical groups fill the width while retaining their control heights. Use `spacing={0}` for joined items. Layout does not change selection, keyboard navigation, density or disabled behavior.
|
|
285
|
+
|
|
284
286
|
`ScrollArea` supplies a native scroll viewport and one vertical `ScrollBar` by default. Set `scrollbars={<ScrollBar orientation="horizontal" />}` for a wide horizontal layout, or supply a fragment containing vertical and horizontal parts for both axes. The tracks stay outside the viewport and reserve their shared corner. `keepMounted` belongs to `ScrollBar`; root and track className callbacks receive native overflow/scroll state. Focus the viewport for native keyboard scrolling.
|
|
285
287
|
|
|
286
288
|
Scrolling is intentional: cards, panels, dialogs, sheets, and floating surfaces carry `data-scroll="none"`. Put long content in a nested `ScrollArea` or an explicitly styled native scroll viewport; the outer surface stays stationary. `DialogContent` bounds its height to the viewport and uses a flex column, so give a nested `ScrollArea` `className="min-h-0"` to let it shrink within the dialog. Headers and footers stay outside that scroll area when they need to remain visible.
|