@viraui/react 2026.5.0 → 2026.6.1
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/catalog.json +5 -5
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/stack/stack.d.ts +4 -1
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/text/text.css +1 -1
- package/dist/components/text/text.d.ts +16 -5
- package/dist/components/text/text.js +2 -1
- package/dist/components/textfield/textfield.d.ts +1 -0
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.d.ts +12 -2
- package/dist/components/title/title.js +2 -1
- package/dist/preflight.css +4 -1
- package/dist/specs/PROTOCOL.md +23 -19
- package/dist/specs/activity-hints.xml +18 -3
- package/dist/specs/components/accordion/patterns.xml +69 -5
- package/dist/specs/components/accordion/props.xml +4 -4
- package/dist/specs/components/accordion/usage.xml +8 -4
- package/dist/specs/components/annotate/patterns.xml +50 -3
- package/dist/specs/components/annotate/props.xml +22 -22
- package/dist/specs/components/annotate/usage.xml +7 -6
- package/dist/specs/components/autocomplete/patterns.xml +123 -7
- package/dist/specs/components/autocomplete/props.xml +14 -14
- package/dist/specs/components/autocomplete/usage.xml +11 -6
- package/dist/specs/components/avatar/patterns.xml +78 -3
- package/dist/specs/components/avatar/props.xml +8 -8
- package/dist/specs/components/avatar/usage.xml +9 -3
- package/dist/specs/components/avatar-group/patterns.xml +65 -3
- package/dist/specs/components/avatar-group/props.xml +8 -8
- package/dist/specs/components/avatar-group/usage.xml +10 -7
- package/dist/specs/components/badge/patterns.xml +57 -3
- package/dist/specs/components/badge/props.xml +8 -8
- package/dist/specs/components/badge/usage.xml +5 -3
- package/dist/specs/components/beam/meta.xml +1 -1
- package/dist/specs/components/beam/patterns.xml +68 -3
- package/dist/specs/components/beam/props.xml +22 -22
- package/dist/specs/components/beam/usage.xml +7 -7
- package/dist/specs/components/bleed/patterns.xml +54 -3
- package/dist/specs/components/bleed/props.xml +2 -2
- package/dist/specs/components/bleed/usage.xml +6 -3
- package/dist/specs/components/breakpoints/meta.xml +1 -1
- package/dist/specs/components/breakpoints/patterns.xml +1 -6
- package/dist/specs/components/breakpoints/props.xml +4 -2
- package/dist/specs/components/breakpoints/usage.xml +10 -2
- package/dist/specs/components/button/patterns.xml +124 -6
- package/dist/specs/components/button/props.xml +33 -32
- package/dist/specs/components/button/usage.xml +13 -13
- package/dist/specs/components/checkbox/patterns.xml +83 -3
- package/dist/specs/components/checkbox/props.xml +10 -10
- package/dist/specs/components/checkbox/usage.xml +11 -6
- package/dist/specs/components/chip/patterns.xml +74 -3
- package/dist/specs/components/chip/props.xml +14 -14
- package/dist/specs/components/chip/usage.xml +10 -6
- package/dist/specs/components/clamp-text/patterns.xml +1 -4
- package/dist/specs/components/clamp-text/props.xml +2 -2
- package/dist/specs/components/clamp-text/usage.xml +8 -5
- package/dist/specs/components/dialog/patterns.xml +136 -15
- package/dist/specs/components/dialog/props.xml +2 -2
- package/dist/specs/components/dialog/usage.xml +9 -7
- package/dist/specs/components/elevator/patterns.xml +54 -3
- package/dist/specs/components/elevator/usage.xml +8 -5
- package/dist/specs/components/fieldset/patterns.xml +97 -3
- package/dist/specs/components/fieldset/usage.xml +7 -5
- package/dist/specs/components/fit-text/patterns.xml +1 -4
- package/dist/specs/components/fit-text/props.xml +2 -2
- package/dist/specs/components/fit-text/usage.xml +8 -6
- package/dist/specs/components/glow/meta.xml +1 -1
- package/dist/specs/components/glow/patterns.xml +74 -3
- package/dist/specs/components/glow/props.xml +16 -16
- package/dist/specs/components/glow/usage.xml +8 -7
- package/dist/specs/components/grid/patterns.xml +88 -5
- package/dist/specs/components/grid/props.xml +23 -23
- package/dist/specs/components/grid/usage.xml +9 -5
- package/dist/specs/components/icon-button/patterns.xml +97 -6
- package/dist/specs/components/icon-button/props.xml +32 -32
- package/dist/specs/components/icon-button/usage.xml +11 -9
- package/dist/specs/components/linear-progress/patterns.xml +58 -3
- package/dist/specs/components/linear-progress/props.xml +6 -6
- package/dist/specs/components/linear-progress/usage.xml +9 -8
- package/dist/specs/components/masonry/patterns.xml +68 -5
- package/dist/specs/components/masonry/props.xml +2 -2
- package/dist/specs/components/masonry/usage.xml +9 -4
- package/dist/specs/components/menu/patterns.xml +179 -15
- package/dist/specs/components/menu/usage.xml +8 -7
- package/dist/specs/components/meter/patterns.xml +49 -3
- package/dist/specs/components/meter/props.xml +6 -6
- package/dist/specs/components/meter/usage.xml +10 -7
- package/dist/specs/components/popover/patterns.xml +118 -9
- package/dist/specs/components/popover/props.xml +2 -2
- package/dist/specs/components/popover/usage.xml +9 -8
- package/dist/specs/components/progressive-blur/meta.xml +1 -1
- package/dist/specs/components/progressive-blur/patterns.xml +1 -4
- package/dist/specs/components/progressive-blur/props.xml +2 -2
- package/dist/specs/components/progressive-blur/usage.xml +7 -6
- package/dist/specs/components/radio/patterns.xml +55 -5
- package/dist/specs/components/radio/props.xml +8 -8
- package/dist/specs/components/radio/usage.xml +9 -6
- package/dist/specs/components/select/patterns.xml +124 -8
- package/dist/specs/components/select/props.xml +18 -18
- package/dist/specs/components/select/usage.xml +11 -10
- package/dist/specs/components/separator/patterns.xml +121 -3
- package/dist/specs/components/separator/props.xml +4 -4
- package/dist/specs/components/separator/usage.xml +8 -5
- package/dist/specs/components/shimmer/patterns.xml +23 -3
- package/dist/specs/components/shimmer/props.xml +8 -8
- package/dist/specs/components/shimmer/usage.xml +7 -5
- package/dist/specs/components/skeleton/patterns.xml +172 -4
- package/dist/specs/components/skeleton/props.xml +14 -14
- package/dist/specs/components/skeleton/usage.xml +11 -7
- package/dist/specs/components/slider/patterns.xml +111 -3
- package/dist/specs/components/slider/props.xml +10 -10
- package/dist/specs/components/slider/usage.xml +11 -5
- package/dist/specs/components/spinner/patterns.xml +35 -3
- package/dist/specs/components/spinner/props.xml +2 -2
- package/dist/specs/components/spinner/usage.xml +8 -5
- package/dist/specs/components/stack/patterns.xml +359 -3
- package/dist/specs/components/stack/props.xml +24 -22
- package/dist/specs/components/stack/usage.xml +16 -10
- package/dist/specs/components/static-noise/meta.xml +1 -1
- package/dist/specs/components/static-noise/patterns.xml +20 -3
- package/dist/specs/components/static-noise/usage.xml +5 -5
- package/dist/specs/components/surface/patterns.xml +188 -3
- package/dist/specs/components/surface/props.xml +26 -26
- package/dist/specs/components/surface/usage.xml +15 -12
- package/dist/specs/components/switch/patterns.xml +73 -3
- package/dist/specs/components/switch/props.xml +12 -12
- package/dist/specs/components/switch/usage.xml +10 -5
- package/dist/specs/components/tabs/patterns.xml +111 -6
- package/dist/specs/components/tabs/props.xml +2 -2
- package/dist/specs/components/tabs/usage.xml +7 -3
- package/dist/specs/components/text/patterns.xml +97 -3
- package/dist/specs/components/text/props.xml +48 -43
- package/dist/specs/components/text/usage.xml +11 -4
- package/dist/specs/components/textarea/patterns.xml +49 -3
- package/dist/specs/components/textarea/props.xml +7 -6
- package/dist/specs/components/textarea/usage.xml +8 -5
- package/dist/specs/components/textfield/patterns.xml +163 -3
- package/dist/specs/components/textfield/props.xml +12 -11
- package/dist/specs/components/textfield/usage.xml +9 -3
- package/dist/specs/components/title/patterns.xml +74 -3
- package/dist/specs/components/title/props.xml +48 -43
- package/dist/specs/components/title/usage.xml +10 -7
- package/dist/specs/components/toast/patterns.xml +85 -8
- package/dist/specs/components/toast/usage.xml +8 -5
- package/dist/specs/components/toggle-button/patterns.xml +101 -3
- package/dist/specs/components/toggle-button/props.xml +16 -16
- package/dist/specs/components/toggle-button/usage.xml +9 -5
- package/dist/specs/components/toggle-group/patterns.xml +34 -5
- package/dist/specs/components/toggle-group/usage.xml +9 -5
- package/dist/specs/components/tooltip/patterns.xml +110 -6
- package/dist/specs/components/tooltip/props.xml +2 -2
- package/dist/specs/components/tooltip/usage.xml +8 -5
- package/dist/specs/components/typewriter/patterns.xml +18 -3
- package/dist/specs/components/typewriter/props.xml +2 -2
- package/dist/specs/components/typewriter/usage.xml +9 -8
- package/dist/specs/foundation/attributes.xml +67 -37
- package/dist/specs/foundation/bootstrap.xml +6 -6
- package/dist/specs/foundation/elevation.xml +51 -3
- package/dist/specs/foundation/modules.xml +117 -40
- package/dist/specs/foundation/theme-topics.xml +62 -27
- package/dist/specs/foundation/toggles.xml +2 -2
- package/dist/specs/index.xml +42 -6
- package/dist/specs/patterns/card-grid.xml +35 -0
- package/dist/specs/patterns/compose-layout-first.xml +32 -0
- package/dist/specs/patterns/equal-width-actions.xml +22 -0
- package/dist/specs/patterns/page-chrome.xml +34 -0
- package/dist/specs/patterns/settings-panel.xml +30 -0
- package/dist/specs/patterns/settings-row.xml +9 -7
- package/dist/specs/patterns/stack-as-surface.xml +37 -0
- package/package.json +2 -2
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
<prop name="renderValue" kind="react">
|
|
20
20
|
<description>Shows the current value beside the label. Pass `true` for Base UI default formatting, or a function matching `Meter.Value` `children` to customize the printed label.</description>
|
|
21
21
|
</prop>
|
|
22
|
-
<
|
|
22
|
+
<prop name="indicator-color" kind="css">
|
|
23
23
|
<description>Determinate meter indicator color.</description>
|
|
24
|
-
</
|
|
25
|
-
<
|
|
24
|
+
</prop>
|
|
25
|
+
<prop name="track-background" kind="css">
|
|
26
26
|
<description>Meter track background color.</description>
|
|
27
|
-
</
|
|
28
|
-
<
|
|
27
|
+
</prop>
|
|
28
|
+
<prop name="track-size" kind="css">
|
|
29
29
|
<description>Meter track thickness on the root.</description>
|
|
30
|
-
</
|
|
30
|
+
</prop>
|
|
31
31
|
</props>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="meter">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<dont>
|
|
9
|
-
<dont>
|
|
3
|
+
<do>Static capacity / level / score within a known range: storage, battery, quota, health — always a numeric `value`</do>
|
|
4
|
+
<do>Labeled metrics: `label` + `renderValue` + optional `description`; tune print with Base UI `format` / `locale`</do>
|
|
5
|
+
<do>Workspace stacks: Stack `rowGap` of Meters — or nest one Meter inside Surface for sheet / tip chrome</do>
|
|
6
|
+
<do>Rich labels: pass a Stack row (icon + text) as `label` when needed — no custom label CSS</do>
|
|
7
|
+
<do>Prefer LinearProgress for in-progress or indeterminate tasks (`value={null}`) — Meter has no indeterminate mode</do>
|
|
8
|
+
<dont>Using Meter as an interactive value control — use Slider</dont>
|
|
9
|
+
<dont>Using Meter for indeterminate or in-progress work — use LinearProgress</dont>
|
|
10
|
+
<dont>Modeling invalid or disabled meter state — Base UI Meter exposes neither</dont>
|
|
11
|
+
<dont>Hiding the metric name when multiple meters share a view</dont>
|
|
12
|
+
<dont>Passing `value={null}` — Meter `value` is required `number`</dont>
|
|
10
13
|
</usage>
|
|
@@ -1,15 +1,124 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="popover">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
3
|
+
<!-- Sources: viraui-app/components + design-kitchen preview-grid — cleaned (no handlers, no portal/preview chrome). -->
|
|
4
|
+
|
|
5
|
+
<example title="Notifications sheet">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Popover>
|
|
8
|
+
<Popover.Trigger render={<Button variant="secondary">Options</Button>} />
|
|
9
|
+
<Popover.Sheet title="Options" description="Choose an action">
|
|
10
|
+
<Stack rowGap="m">
|
|
11
|
+
<Text render={<p />}>Notification preferences and workspace shortcuts live here.</Text>
|
|
12
|
+
<Popover.Close render={<Button variant="flat">Done</Button>} />
|
|
13
|
+
</Stack>
|
|
14
|
+
</Popover.Sheet>
|
|
15
|
+
</Popover>
|
|
16
|
+
]]></tsx>
|
|
17
|
+
<notes>Default styled Sheet: Trigger + titled Sheet + body + `Popover.Close`. Portal/Positioner/Popup stay inside Sheet.</notes>
|
|
18
|
+
</example>
|
|
19
|
+
|
|
20
|
+
<example title="Color field picker">
|
|
21
|
+
<tsx><![CDATA[
|
|
22
|
+
<Popover>
|
|
23
|
+
<Popover.Trigger
|
|
24
|
+
nativeButton={false}
|
|
25
|
+
render={
|
|
26
|
+
<Textfield
|
|
27
|
+
readOnly
|
|
28
|
+
label="Primary"
|
|
29
|
+
value="oklch(0.55 0.18 250)"
|
|
30
|
+
fullWidth
|
|
31
|
+
startAddon={<span aria-hidden style={{ background: 'oklch(0.55 0.18 250)' }} />}
|
|
32
|
+
/>
|
|
33
|
+
}
|
|
34
|
+
/>
|
|
35
|
+
<Popover.Sheet title="Pick a color" side="right" align="start">
|
|
36
|
+
<Stack rowGap="m">
|
|
37
|
+
{/* ColorArea / HueSlider / format inputs */}
|
|
38
|
+
<Text size="s" tone="muted">
|
|
39
|
+
Adjust hue, then commit from the inputs.
|
|
40
|
+
</Text>
|
|
41
|
+
</Stack>
|
|
42
|
+
</Popover.Sheet>
|
|
43
|
+
</Popover>
|
|
44
|
+
]]></tsx>
|
|
45
|
+
<notes>From `common/color-picker`. Non-button trigger via `nativeButton={false}` + Textfield `render`. Drop chromakit / module CSS from this hint.</notes>
|
|
46
|
+
</example>
|
|
47
|
+
|
|
48
|
+
<example title="Team directory (shared handle)">
|
|
49
|
+
<tsx><![CDATA[
|
|
50
|
+
const handle = Popover.createHandle<{ name: string; role: string; bio: string; email: string }>();
|
|
51
|
+
|
|
52
|
+
{/* …row triggers… */}
|
|
53
|
+
<Popover.Trigger
|
|
54
|
+
handle={handle}
|
|
55
|
+
openOnHover
|
|
56
|
+
closeDelay={100}
|
|
57
|
+
nativeButton={false}
|
|
58
|
+
payload={member}
|
|
59
|
+
render={<Avatar alt={member.name} fallback="SC" size="s" src={member.src} />}
|
|
60
|
+
/>
|
|
61
|
+
<Popover.Trigger
|
|
62
|
+
handle={handle}
|
|
63
|
+
payload={member}
|
|
64
|
+
render={
|
|
65
|
+
<Button size="s" variant="secondary">
|
|
66
|
+
Details
|
|
67
|
+
</Button>
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
<Popover handle={handle} open={true}>
|
|
72
|
+
{({ payload }) => {
|
|
73
|
+
if (!payload) return null;
|
|
74
|
+
return (
|
|
75
|
+
<Popover.Sheet
|
|
76
|
+
description={payload.role}
|
|
77
|
+
side="inline-end"
|
|
78
|
+
title={payload.name}
|
|
79
|
+
headerAlign="center"
|
|
80
|
+
>
|
|
81
|
+
<Stack rowGap="m" hAlign="center">
|
|
82
|
+
<Avatar alt={payload.name} fallback="SC" size="l" />
|
|
83
|
+
<Text align="center" tone="muted" size="s" lineHeight="s" maxWidth="25ch">
|
|
84
|
+
{payload.bio}
|
|
85
|
+
</Text>
|
|
86
|
+
<Text align="center" family="mono" size="s">
|
|
87
|
+
{payload.email}
|
|
88
|
+
</Text>
|
|
89
|
+
<Popover.Close
|
|
90
|
+
render={
|
|
91
|
+
<Button size="s" variant="secondary">
|
|
92
|
+
View profile
|
|
93
|
+
</Button>
|
|
94
|
+
}
|
|
95
|
+
/>
|
|
96
|
+
</Stack>
|
|
97
|
+
</Popover.Sheet>
|
|
98
|
+
);
|
|
99
|
+
}}
|
|
100
|
+
</Popover>
|
|
101
|
+
]]></tsx>
|
|
102
|
+
<notes>From preview-grid `team-directory`. One `createHandle` + trigger `payload` morphs Sheet content. `open={true}` for demo structure.</notes>
|
|
103
|
+
</example>
|
|
104
|
+
|
|
105
|
+
<example title="Unstyled sheet chrome">
|
|
106
|
+
<tsx><![CDATA[
|
|
107
|
+
<Popover open={true}>
|
|
108
|
+
<Popover.Trigger render={<Button>Custom chrome</Button>} />
|
|
6
109
|
<Popover.Sheet unstyled>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
110
|
+
<Surface color={1} border="all" radius="l" hPadding="m" vPadding="m" data-vibrant>
|
|
111
|
+
<Stack rowGap="s">
|
|
112
|
+
<Popover.Title render={<Title size="6" lineHeight="xs" />}>Alpha panel</Popover.Title>
|
|
113
|
+
<Popover.Description render={<Text tone="muted" render={<p />} />}>
|
|
114
|
+
With `unstyled`, the consumer owns the popup chrome.
|
|
115
|
+
</Popover.Description>
|
|
116
|
+
<Popover.Close render={<Button size="s" variant="secondary">Close</Button>} />
|
|
117
|
+
</Stack>
|
|
118
|
+
</Surface>
|
|
11
119
|
</Popover.Sheet>
|
|
12
|
-
</Popover>
|
|
13
|
-
|
|
120
|
+
</Popover>
|
|
121
|
+
]]></tsx>
|
|
122
|
+
<notes>From Popover stories `Unstyled`. `unstyled` skips built-in Surface/header — compose `Popover.Title` / `Popover.Description` for the accessible name.</notes>
|
|
14
123
|
</example>
|
|
15
124
|
</patterns>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<prop name="Sheet.unstyled" kind="react">
|
|
32
32
|
<description>Whether to skip the built-in Surface, header, and close chrome and render only the positioning/animation shell (Portal + Positioner + Popup + Viewport).</description>
|
|
33
33
|
</prop>
|
|
34
|
-
<
|
|
34
|
+
<prop name="content-fade-duration" kind="css">
|
|
35
35
|
<description>content fade duration custom property on the component root.</description>
|
|
36
|
-
</
|
|
36
|
+
</prop>
|
|
37
37
|
</props>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="popover">
|
|
3
|
-
<do>Anchored quick actions or contextual hints
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<do>
|
|
7
|
-
<do>
|
|
8
|
-
<do>Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on
|
|
9
|
-
<dont>Opening a popover without `title` copy for assistive technologies</dont>
|
|
10
|
-
<dont>Rendering heavy
|
|
3
|
+
<do>Anchored quick actions, lightweight forms, or contextual hints beside a trigger — not page-blocking sheets (Dialog) or command lists (Menu)</do>
|
|
4
|
+
<do>Compose `Popover.Trigger` + titled `Popover.Sheet` + body Stack / Text / Button; close with `Popover.Close`</do>
|
|
5
|
+
<do>Non-button triggers via `nativeButton={false}` + `render` (e.g. Textfield or Avatar)</do>
|
|
6
|
+
<do>Multi-trigger content morph: `Popover.createHandle` + trigger `payload` (optional `openOnHover` / `delay` / `closeDelay`)</do>
|
|
7
|
+
<do>Custom popup chrome with `Sheet` `unstyled` + consumer Surface/Stack + `Popover.Title` / `Popover.Description`</do>
|
|
8
|
+
<do>Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on `Popover.Sheet`</do>
|
|
9
|
+
<dont>Opening a popover without `title` copy (styled Sheet) or `Popover.Title` (`unstyled`) for assistive technologies</dont>
|
|
10
|
+
<dont>Rendering heavy, scroll-bound, or nested drill-down content that belongs in Dialog</dont>
|
|
11
|
+
<dont>Wrapping Menu for account/action lists — Menu already owns portal, positioning, and list keyboard behavior</dont>
|
|
11
12
|
<dont>Expecting `Popover.Arrow` (it is intentionally not exported or rendered)</dont>
|
|
12
13
|
</usage>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<meta id="progressive-blur" title="ProgressiveBlur" category="effect" shared_contract="progressive-blur">
|
|
3
|
-
<summary>Decorative stacked backdrop-filter overlay that ramps blur from one edge toward the opposite edge.</summary>
|
|
3
|
+
<summary>Decorative stacked backdrop-filter overlay that ramps blur from one edge toward the opposite edge. GPU/memory-heavy — use sparingly; prefer one focal instance per view.</summary>
|
|
4
4
|
<exports>
|
|
5
5
|
<export name="ProgressiveBlur" />
|
|
6
6
|
</exports>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="progressive-blur">
|
|
3
|
-
|
|
4
|
-
<tsx><![CDATA[<ProgressiveBlur />]]></tsx>
|
|
5
|
-
<notes>Public assembly hint from legacy guide; not API authority.</notes>
|
|
6
|
-
</example>
|
|
3
|
+
<!-- Skip: zero viraui-app and design-kitchen usage. Stories are fixed overlay / prop matrix demos — no teachable Vira composition extract. -->
|
|
7
4
|
</patterns>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<prop name="steps" kind="react">
|
|
23
23
|
<description>Sets the number of internal blur layers. Values are clamped to `2..16`.</description>
|
|
24
24
|
</prop>
|
|
25
|
-
<
|
|
25
|
+
<prop name="amount" kind="css">
|
|
26
26
|
<description>Sets the maximum blur radius applied to the first layer at the selected edge.</description>
|
|
27
|
-
</
|
|
27
|
+
</prop>
|
|
28
28
|
</props>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="progressive-blur">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<
|
|
7
|
-
<dont>Driving layout size or scroll behavior from inside the overlay component</dont>
|
|
8
|
-
<dont>Embedding layout positioning rules inside the component stylesheet</dont>
|
|
3
|
+
<do>Overlay on a Surface or Stack region the parent owns — parent sets non-static `position`, inset, size, and z-index; ProgressiveBlur does not create a containing block</do>
|
|
4
|
+
<do>Edge scrim on glass / `data-vibrant` Surface heroes, sheets, or scroll regions where content should fade into blur</do>
|
|
5
|
+
<do>Keep semantics and layout on Surface/Stack/Title/Text children underneath — ProgressiveBlur is decorative atmosphere only</do>
|
|
6
|
+
<do>Use sparingly — stacked `backdrop-filter` is GPU/memory-heavy; prefer one focal overlay per view</do>
|
|
9
7
|
<dont>Leaving the ProgressiveBlur root `position: static` so absolute layers escape the intended overlay box</dont>
|
|
8
|
+
<dont>Driving layout size or scroll behavior from inside the overlay</dont>
|
|
9
|
+
<dont>Scattering ProgressiveBlur across many cards or stacking full-viewport instances</dont>
|
|
10
|
+
<dont>Using ProgressiveBlur as standalone loading or status feedback without a labeled parent region</dont>
|
|
10
11
|
</usage>
|
|
@@ -1,9 +1,59 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="radio">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
3
|
+
<!-- Sources: viraui-app / design-kitchen preview-grid — cleaned (no handlers, no selection-driven color CSS). -->
|
|
4
|
+
<!-- Compound: Radio lives inside RadioGroup (exported from this folder). Group legend/copy → Field.Root + Fieldset render={<RadioGroup />}. -->
|
|
5
|
+
|
|
6
|
+
<example title="Card option RadioGroup">
|
|
7
|
+
<tsx><![CDATA[
|
|
8
|
+
<Field.Root name="receiving-method">
|
|
9
|
+
<Fieldset label="Receiving Method" render={<RadioGroup value="bank-transfer" />}>
|
|
10
|
+
<Stack columnGap="m" vAlign="start" direction="row" expandChildren>
|
|
11
|
+
<Surface border="all" radius="s" color={2}>
|
|
12
|
+
<Radio
|
|
13
|
+
description="SWIFT / IBAN"
|
|
14
|
+
label="Bank Transfer"
|
|
15
|
+
value="bank-transfer"
|
|
16
|
+
hPadding="m"
|
|
17
|
+
vPadding="m"
|
|
18
|
+
/>
|
|
19
|
+
</Surface>
|
|
20
|
+
<Surface border="all" radius="s">
|
|
21
|
+
<Radio
|
|
22
|
+
description="Instant Payout"
|
|
23
|
+
label="PayPal"
|
|
24
|
+
value="paypal"
|
|
25
|
+
hPadding="m"
|
|
26
|
+
vPadding="m"
|
|
27
|
+
/>
|
|
28
|
+
</Surface>
|
|
29
|
+
</Stack>
|
|
30
|
+
</Fieldset>
|
|
31
|
+
</Field.Root>
|
|
32
|
+
]]></tsx>
|
|
33
|
+
<notes>From `editor/preview-grid/blocks/payout-preferences`. `Fieldset render={<RadioGroup />}` owns the group; each `Radio` sits in a Surface card with `hPadding`/`vPadding`. App may tint the selected card — pattern shows the selected Surface already `color={2}`.</notes>
|
|
34
|
+
</example>
|
|
35
|
+
|
|
36
|
+
<example title="Compact Fieldset group">
|
|
37
|
+
<tsx><![CDATA[
|
|
38
|
+
<Field.Root name="mode">
|
|
39
|
+
<Fieldset label="Mode" render={<RadioGroup value="manual" />}>
|
|
40
|
+
<Radio label="Auto" value="auto" />
|
|
41
|
+
<Radio label="Manual" value="manual" />
|
|
42
|
+
</Fieldset>
|
|
43
|
+
</Field.Root>
|
|
44
|
+
]]></tsx>
|
|
45
|
+
<notes>From `editor/preview-grid/blocks/disabled-surface-contrast` (enabled shape). Shared legend via Fieldset; RadioGroup stacks options with default `rowGap`. Add `disabled` on Field.Root / Fieldset / RadioGroup together when showing disabled contrast.</notes>
|
|
46
|
+
</example>
|
|
47
|
+
|
|
48
|
+
<example title="Disabled Fieldset RadioGroup">
|
|
49
|
+
<tsx><![CDATA[
|
|
50
|
+
<Field.Root disabled name="mode">
|
|
51
|
+
<Fieldset disabled label="Mode" render={<RadioGroup disabled value="manual" />}>
|
|
52
|
+
<Radio label="Auto" value="auto" />
|
|
53
|
+
<Radio label="Manual" value="manual" />
|
|
54
|
+
</Fieldset>
|
|
55
|
+
</Field.Root>
|
|
56
|
+
]]></tsx>
|
|
57
|
+
<notes>From `editor/preview-grid/blocks/disabled-surface-contrast`. Mirror `disabled` on Field.Root, Fieldset, and RadioGroup so the whole set greys out on nested Surfaces.</notes>
|
|
8
58
|
</example>
|
|
9
59
|
</patterns>
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
<prop name="vPadding" kind="react">
|
|
30
30
|
<description>Sets block padding using one token for both sides or a `[start, end]` tuple.</description>
|
|
31
31
|
</prop>
|
|
32
|
-
<
|
|
32
|
+
<prop name="background" kind="css">
|
|
33
33
|
<description>Radio control background color.</description>
|
|
34
|
-
</
|
|
35
|
-
<
|
|
34
|
+
</prop>
|
|
35
|
+
<prop name="border-color" kind="css">
|
|
36
36
|
<description>Radio control border color; resting default is transparent (same as Checkbox); checked, invalid, and disabled states override.</description>
|
|
37
|
-
</
|
|
38
|
-
<
|
|
37
|
+
</prop>
|
|
38
|
+
<prop name="indicator-color" kind="css">
|
|
39
39
|
<description>Radio selected-disk indicator color.</description>
|
|
40
|
-
</
|
|
41
|
-
<
|
|
40
|
+
</prop>
|
|
41
|
+
<prop name="size" kind="css">
|
|
42
42
|
<description>Radio control size; size presets adjust footprint.</description>
|
|
43
|
-
</
|
|
43
|
+
</prop>
|
|
44
44
|
</props>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="radio">
|
|
3
|
-
<do>Single selection from a small set
|
|
3
|
+
<do>Single selection from a small related set — always nest Radio inside RadioGroup</do>
|
|
4
4
|
<do>RadioGroup alone inside Field.Root when each Radio has its own label and no shared group legend is needed</do>
|
|
5
|
-
<do>Field.Root > Fieldset render={<RadioGroup<Value> />}
|
|
6
|
-
<do>Card-style
|
|
5
|
+
<do>Shared legend, group description, or group error — Field.Root > Fieldset render={<RadioGroup<Value> />} with Radio children</do>
|
|
6
|
+
<do>Card-style options — wrap each Radio in Surface `border="all"` (optional `color` on the selected card); Radio owns `hPadding`/`vPadding`; lay cards in Stack `direction="row"` `expandChildren`</do>
|
|
7
7
|
<do>Typed option unions with RadioGroup<'ssd' | 'hdd'> for value, defaultValue, and onValueChange safety</do>
|
|
8
8
|
<dont>Rendering Radio outside RadioGroup</dont>
|
|
9
|
-
<dont>Putting invalid or error on a single Radio
|
|
10
|
-
<dont>Omitting the RadioGroup generic when option
|
|
11
|
-
<dont>
|
|
9
|
+
<dont>Putting `invalid` or group `error` on a single Radio — use enclosing Field.Root and Fieldset</dont>
|
|
10
|
+
<dont>Omitting the RadioGroup generic when option values form a restricted union</dont>
|
|
11
|
+
<dont>Assuming Fieldset is mandatory for every RadioGroup — add it only for shared legend or group copy</dont>
|
|
12
|
+
<dont>Independent booleans or multi-select — use Checkbox / CheckboxGroup or Switch</dont>
|
|
13
|
+
<dont>Inventing card border/gap CSS when Surface `border` and Stack gap/`expandChildren` cover the layout</dont>
|
|
14
|
+
<dont>Importing `@viraui/react/radio/radio.css` or other component CSS subpaths in consumer bootstrap</dont>
|
|
12
15
|
</usage>
|
|
@@ -1,13 +1,129 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="select">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</Select.
|
|
3
|
+
<!-- Sources: viraui-app controls + preview-grid — cleaned (no handlers, Controllers, i18n). Trigger/Portal baked in root — use Select.Option / Group / Separator only. -->
|
|
4
|
+
|
|
5
|
+
<example title="Labeled currency list">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Select label="Preferred Currency" defaultValue="usd" items={currencyOptions}>
|
|
8
|
+
<Select.Option value="usd">United States Dollar</Select.Option>
|
|
9
|
+
<Select.Option value="eur">Euro</Select.Option>
|
|
10
|
+
<Select.Option value="gbp">British Pound</Select.Option>
|
|
11
|
+
</Select>
|
|
12
|
+
]]></tsx>
|
|
13
|
+
<notes>From preview-grid `payout-threshold`. Flat options under root; no `Select.Trigger` — chrome is baked.</notes>
|
|
14
|
+
</example>
|
|
15
|
+
|
|
16
|
+
<example title="Address pair with Textfield">
|
|
17
|
+
<tsx><![CDATA[
|
|
18
|
+
<Stack columnGap="m" direction="row" expandChildren>
|
|
19
|
+
<Textfield label="City" defaultValue="San Francisco" />
|
|
20
|
+
<Select label="State" defaultValue="california" items={stateOptions}>
|
|
21
|
+
<Select.Option value="california">California</Select.Option>
|
|
22
|
+
<Select.Option value="new-york">New York</Select.Option>
|
|
23
|
+
<Select.Option value="texas">Texas</Select.Option>
|
|
24
|
+
</Select>
|
|
25
|
+
</Stack>
|
|
26
|
+
]]></tsx>
|
|
27
|
+
<notes>From preview-grid `shipping-address`. Row `expandChildren` shares width with sibling Textfield.</notes>
|
|
28
|
+
</example>
|
|
29
|
+
|
|
30
|
+
<example title="Invite role beside email">
|
|
31
|
+
<tsx><![CDATA[
|
|
32
|
+
<Stack columnGap="s" direction="row" vAlign="end" expandChildren>
|
|
33
|
+
<Textfield aria-label="Invite email" defaultValue="alex@example.com" />
|
|
34
|
+
<Select aria-label="Invite role" defaultValue="editor" alignListWithTrigger items={teamRoleOptions}>
|
|
35
|
+
<Select.Option value="editor">Editor</Select.Option>
|
|
36
|
+
<Select.Option value="viewer">Viewer</Select.Option>
|
|
37
|
+
<Select.Option value="admin">Admin</Select.Option>
|
|
38
|
+
</Select>
|
|
39
|
+
</Stack>
|
|
40
|
+
]]></tsx>
|
|
41
|
+
<notes>From preview-grid `invite-team`. `alignListWithTrigger` keeps popup width with trigger; `vAlign="end"` lines up with unlabeled Textfield.</notes>
|
|
42
|
+
</example>
|
|
43
|
+
|
|
44
|
+
<example title="Order type with description">
|
|
45
|
+
<tsx><![CDATA[
|
|
46
|
+
<Select
|
|
47
|
+
label="Order Type"
|
|
48
|
+
defaultValue="market-order"
|
|
49
|
+
items={orderTypeOptions}
|
|
50
|
+
alignListWithTrigger
|
|
51
|
+
description="Market orders execute at the current price."
|
|
52
|
+
>
|
|
53
|
+
<Select.Option value="market-order">Market Order</Select.Option>
|
|
54
|
+
<Select.Option value="limit-order">Limit Order</Select.Option>
|
|
55
|
+
</Select>
|
|
56
|
+
]]></tsx>
|
|
57
|
+
<notes>From preview-grid `buy-investment`. Field helper via `description` prop.</notes>
|
|
58
|
+
</example>
|
|
59
|
+
|
|
60
|
+
<example title="Corner shape with custom trigger addon">
|
|
61
|
+
<tsx><![CDATA[
|
|
62
|
+
<Select
|
|
63
|
+
label="Corner shape"
|
|
64
|
+
defaultValue="round"
|
|
65
|
+
items={cornerShapeItems}
|
|
66
|
+
alignListWithTrigger={false}
|
|
67
|
+
addon={<ChevronExpandY aria-hidden size="1rem" />}
|
|
68
|
+
>
|
|
69
|
+
<Select.Option value="round">Round</Select.Option>
|
|
70
|
+
<Select.Option value="squircle">Squircle</Select.Option>
|
|
71
|
+
<Select.Option value="bevel">Bevel</Select.Option>
|
|
72
|
+
</Select>
|
|
73
|
+
]]></tsx>
|
|
74
|
+
<notes>From `editor/controls/corner-shape-select`. Root `addon` replaces default chevron chrome; prefer `alignListWithTrigger={false}` when options get leading adornment.</notes>
|
|
75
|
+
</example>
|
|
76
|
+
|
|
77
|
+
<example title="Scale list with Separator">
|
|
78
|
+
<tsx><![CDATA[
|
|
79
|
+
<Select label="Radius scale" defaultValue="default" items={scaleItems} alignListWithTrigger={false}>
|
|
80
|
+
<Select.Option value="default">Default</Select.Option>
|
|
9
81
|
<Select.Separator />
|
|
10
|
-
</Select>
|
|
11
|
-
|
|
82
|
+
<Select.Option value="compact">Compact</Select.Option>
|
|
83
|
+
<Select.Option value="comfortable">Comfortable</Select.Option>
|
|
84
|
+
<Select.Option value="spacious">Spacious</Select.Option>
|
|
85
|
+
</Select>
|
|
86
|
+
]]></tsx>
|
|
87
|
+
<notes>From `editor/controls/scale-control`. `Select.Separator` after the theme-default option.</notes>
|
|
88
|
+
</example>
|
|
89
|
+
|
|
90
|
+
<example title="Grouped regions">
|
|
91
|
+
<tsx><![CDATA[
|
|
92
|
+
<Select label="Preferred currency" placeholder="Select currency" items={currencyItems}>
|
|
93
|
+
<Select.Group label="Europe">
|
|
94
|
+
<Select.Option value="eur">Euro</Select.Option>
|
|
95
|
+
<Select.Option value="gbp">British Pound</Select.Option>
|
|
96
|
+
</Select.Group>
|
|
97
|
+
<Select.Group label="Americas">
|
|
98
|
+
<Select.Option value="usd">US Dollar</Select.Option>
|
|
99
|
+
<Select.Option value="cad">Canadian Dollar</Select.Option>
|
|
100
|
+
</Select.Group>
|
|
101
|
+
</Select>
|
|
102
|
+
]]></tsx>
|
|
103
|
+
<notes>From Select stories `Grouped`. `Select.Group` takes required `label`; options nest inside.</notes>
|
|
104
|
+
</example>
|
|
105
|
+
|
|
106
|
+
<example title="Option with leading addon">
|
|
107
|
+
<tsx><![CDATA[
|
|
108
|
+
<Select label="Primary color" defaultValue="blue" items={primaryItems} alignListWithTrigger={false}>
|
|
109
|
+
<Select.Option value="blue" addon={<Stack direction="row" columnGap="2xs">{/* swatches */}</Stack>}>
|
|
110
|
+
Blue
|
|
111
|
+
</Select.Option>
|
|
112
|
+
<Select.Option value="custom" addon={<EyeDropper aria-hidden size={10} />}>
|
|
113
|
+
Custom
|
|
114
|
+
</Select.Option>
|
|
115
|
+
</Select>
|
|
116
|
+
]]></tsx>
|
|
117
|
+
<notes>From `editor/controls/primary-color-select` (+ option). Leading `Select.Option` `addon` is decorative; keep `alignListWithTrigger={false}`.</notes>
|
|
118
|
+
</example>
|
|
119
|
+
|
|
120
|
+
<example title="Disabled on surface">
|
|
121
|
+
<tsx><![CDATA[
|
|
122
|
+
<Select disabled label="Role" defaultValue="editor">
|
|
123
|
+
<Select.Option value="editor">Editor</Select.Option>
|
|
124
|
+
<Select.Option value="viewer">Viewer</Select.Option>
|
|
125
|
+
</Select>
|
|
126
|
+
]]></tsx>
|
|
127
|
+
<notes>From preview-grid `disabled-surface-contrast`. Disabled root + options; no portal props in the hint.</notes>
|
|
12
128
|
</example>
|
|
13
129
|
</patterns>
|
|
@@ -53,31 +53,31 @@
|
|
|
53
53
|
<prop name="ref" kind="react">
|
|
54
54
|
<description>Ref forwarded to the select trigger button.</description>
|
|
55
55
|
</prop>
|
|
56
|
-
<
|
|
56
|
+
<prop name="control-group-background" kind="css">
|
|
57
57
|
<description>Trigger background fill.</description>
|
|
58
|
-
</
|
|
59
|
-
<
|
|
58
|
+
</prop>
|
|
59
|
+
<prop name="control-group-border-color" kind="css">
|
|
60
60
|
<description>Trigger border color; invalid state overrides.</description>
|
|
61
|
-
</
|
|
62
|
-
<
|
|
61
|
+
</prop>
|
|
62
|
+
<prop name="control-group-border-radius" kind="css">
|
|
63
63
|
<description>Trigger corner radius.</description>
|
|
64
|
-
</
|
|
65
|
-
<
|
|
64
|
+
</prop>
|
|
65
|
+
<prop name="control-group-color" kind="css">
|
|
66
66
|
<description>Trigger text and icon color.</description>
|
|
67
|
-
</
|
|
68
|
-
<
|
|
67
|
+
</prop>
|
|
68
|
+
<prop name="input-height" kind="css">
|
|
69
69
|
<description>Select trigger block size.</description>
|
|
70
|
-
</
|
|
71
|
-
<
|
|
70
|
+
</prop>
|
|
71
|
+
<prop name="list-border-radius" kind="css">
|
|
72
72
|
<description>list border radius custom property on the component root.</description>
|
|
73
|
-
</
|
|
74
|
-
<
|
|
73
|
+
</prop>
|
|
74
|
+
<prop name="list-padding" kind="css">
|
|
75
75
|
<description>list padding custom property on the component root.</description>
|
|
76
|
-
</
|
|
77
|
-
<
|
|
76
|
+
</prop>
|
|
77
|
+
<prop name="trigger-padding-inline-end" kind="css">
|
|
78
78
|
<description>Trigger inline-end padding.</description>
|
|
79
|
-
</
|
|
80
|
-
<
|
|
79
|
+
</prop>
|
|
80
|
+
<prop name="trigger-padding-inline-start" kind="css">
|
|
81
81
|
<description>Trigger inline-start padding.</description>
|
|
82
|
-
</
|
|
82
|
+
</prop>
|
|
83
83
|
</props>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="select">
|
|
3
|
-
<do>Choose one value from a predefined list with label and helper copy</do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<do>
|
|
7
|
-
<do>
|
|
3
|
+
<do>Choose one value from a predefined closed list with label and helper copy</do>
|
|
4
|
+
<do>Prefer Select over Autocomplete when the value must be one of the options (no free-form text)</do>
|
|
5
|
+
<do>Form section: Fieldset legend + Select beside Textfield/Textarea siblings — Stack owns gap</do>
|
|
6
|
+
<do>Equal-width rows with Textfield (city/state, email + role): parent Stack `direction="row"` + `expandChildren` — Select has no `fullWidth` prop</do>
|
|
7
|
+
<do>Span a form column via a parent Stack `fullWidth` — not CSS `width: 100%` on the Select root</do>
|
|
8
|
+
<do>Grouped or separated option lists via `Select.Group` / `Select.Separator`; rich rows via `Select.Option` `addon`</do>
|
|
8
9
|
<do>Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part</do>
|
|
9
|
-
<dont>Expecting multi-select or combobox behavior</dont>
|
|
10
|
-
<dont>Leaving the trigger without label or aria-label
|
|
11
|
-
<dont>
|
|
12
|
-
<dont>
|
|
13
|
-
<dont>
|
|
10
|
+
<dont>Expecting multi-select, free-form filter, or combobox behavior — use Autocomplete for suggest + free text</dont>
|
|
11
|
+
<dont>Leaving the trigger without `label` or `aria-label`</dont>
|
|
12
|
+
<dont>Inventing `width: 100%` / `w-full` CSS on Select when a parent Stack `fullWidth` / `expandChildren` can own the fill</dont>
|
|
13
|
+
<dont>Leaving `alignListWithTrigger` enabled when options have a leading addon — prefer `alignListWithTrigger={false}`</dont>
|
|
14
|
+
<dont>Wrapping a lone Select in Fieldset when its own label is enough</dont>
|
|
14
15
|
</usage>
|