@viraui/react 2026.6.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/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 +12 -2
- 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/specs/PROTOCOL.md +1 -1
- 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
|
@@ -44,52 +44,52 @@
|
|
|
44
44
|
<prop name="variant" kind="react">
|
|
45
45
|
<description>Selects the visual treatment matching Button. (icon-button-link)</description>
|
|
46
46
|
</prop>
|
|
47
|
-
<
|
|
47
|
+
<prop name="background" kind="css">
|
|
48
48
|
<description>Button fill; variant and state selectors preset this.</description>
|
|
49
|
-
</
|
|
50
|
-
<
|
|
49
|
+
</prop>
|
|
50
|
+
<prop name="color" kind="css">
|
|
51
51
|
<description>Button label and icon color.</description>
|
|
52
|
-
</
|
|
53
|
-
<
|
|
52
|
+
</prop>
|
|
53
|
+
<prop name="height" kind="css">
|
|
54
54
|
<description>Button block size; size prop presets via data attributes.</description>
|
|
55
|
-
</
|
|
56
|
-
<
|
|
55
|
+
</prop>
|
|
56
|
+
<prop name="icon-size" kind="css">
|
|
57
57
|
<description>Addon icon size inside the button.</description>
|
|
58
|
-
</
|
|
59
|
-
<
|
|
58
|
+
</prop>
|
|
59
|
+
<prop name="padding-block" kind="css">
|
|
60
60
|
<description>Vertical padding inside the button.</description>
|
|
61
|
-
</
|
|
62
|
-
<
|
|
61
|
+
</prop>
|
|
62
|
+
<prop name="padding-inline" kind="css">
|
|
63
63
|
<description>Horizontal padding inside the button.</description>
|
|
64
|
-
</
|
|
65
|
-
<
|
|
64
|
+
</prop>
|
|
65
|
+
<prop name="radius" kind="css">
|
|
66
66
|
<description>Corner radius; pill sets full radius via data-pill.</description>
|
|
67
|
-
</
|
|
68
|
-
<
|
|
67
|
+
</prop>
|
|
68
|
+
<prop name="spinner-color" kind="css">
|
|
69
69
|
<description>Loading spinner color on the root.</description>
|
|
70
|
-
</
|
|
71
|
-
<
|
|
70
|
+
</prop>
|
|
71
|
+
<prop name="background" kind="css">
|
|
72
72
|
<description>Button fill; variant and state selectors preset this. (icon-button-link)</description>
|
|
73
|
-
</
|
|
74
|
-
<
|
|
73
|
+
</prop>
|
|
74
|
+
<prop name="color" kind="css">
|
|
75
75
|
<description>Button label and icon color. (icon-button-link)</description>
|
|
76
|
-
</
|
|
77
|
-
<
|
|
76
|
+
</prop>
|
|
77
|
+
<prop name="height" kind="css">
|
|
78
78
|
<description>Button block size; size prop presets via data attributes. (icon-button-link)</description>
|
|
79
|
-
</
|
|
80
|
-
<
|
|
79
|
+
</prop>
|
|
80
|
+
<prop name="icon-size" kind="css">
|
|
81
81
|
<description>Addon icon size inside the button. (icon-button-link)</description>
|
|
82
|
-
</
|
|
83
|
-
<
|
|
82
|
+
</prop>
|
|
83
|
+
<prop name="padding-block" kind="css">
|
|
84
84
|
<description>Vertical padding inside the button. (icon-button-link)</description>
|
|
85
|
-
</
|
|
86
|
-
<
|
|
85
|
+
</prop>
|
|
86
|
+
<prop name="padding-inline" kind="css">
|
|
87
87
|
<description>Horizontal padding inside the button. (icon-button-link)</description>
|
|
88
|
-
</
|
|
89
|
-
<
|
|
88
|
+
</prop>
|
|
89
|
+
<prop name="radius" kind="css">
|
|
90
90
|
<description>Corner radius; pill sets full radius via data-pill. (icon-button-link)</description>
|
|
91
|
-
</
|
|
92
|
-
<
|
|
91
|
+
</prop>
|
|
92
|
+
<prop name="spinner-color" kind="css">
|
|
93
93
|
<description>Loading spinner color on the root. (icon-button-link)</description>
|
|
94
|
-
</
|
|
94
|
+
</prop>
|
|
95
95
|
</props>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="icon-button">
|
|
3
3
|
<do>Compact toolbar or chrome actions identified only by icon</do>
|
|
4
|
-
<do>Same size, variant, and loading model as Button without visible label</do>
|
|
5
|
-
<do>Decorative glyph with explicit accessible
|
|
6
|
-
<do>
|
|
7
|
-
<do>
|
|
8
|
-
<do>
|
|
9
|
-
<
|
|
4
|
+
<do>Same size, variant, and loading model as Button without a visible label</do>
|
|
5
|
+
<do>Decorative glyph with an explicit accessible name on the root (`aria-label` / `aria-labelledby`)</do>
|
|
6
|
+
<do>Toolbar / zoom / chrome clusters: Stack row of IconButtons inside Surface — gap via Stack, not per-control CSS</do>
|
|
7
|
+
<do>Textfield `endAddon` / `startAddon` for compact field chrome (e.g. copy) — keep addon control `size="s"`</do>
|
|
8
|
+
<do>Menu / overlay triggers via `Menu.Trigger render={<IconButton … />}` (and peers with the same pattern)</do>
|
|
9
|
+
<do>Icon-only navigation — use IconButtonLink (framework Link via `render`)</do>
|
|
10
|
+
<dont>Passing `children`, `addon`, or `addonPosition` — not part of the public API; use `icon`</dont>
|
|
10
11
|
<dont>Using icon-only Button instead of IconButton</dont>
|
|
11
|
-
<dont>Using IconButton
|
|
12
|
-
<dont>
|
|
13
|
-
<dont>
|
|
12
|
+
<dont>Using IconButton for persistent or temporal pressed state — use ToggleButton</dont>
|
|
13
|
+
<dont>Using IconButton with `render={<a />}` for links — use IconButtonLink</dont>
|
|
14
|
+
<dont>Omitting both `aria-label` and `aria-labelledby`</dont>
|
|
15
|
+
<dont>Inventing `width: 100%` / `w-full` CSS on IconButton when a parent Stack `fullWidth` / `expandChildren` can own the fill</dont>
|
|
14
16
|
</usage>
|
|
@@ -1,7 +1,62 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="linear-progress">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: preview-grid blocks — cleaned (no handlers, no kitchen chrome). -->
|
|
4
|
+
|
|
5
|
+
<example title="Goal card track + caption row">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Surface color={2} radius="m" hPadding="m" vPadding="m">
|
|
8
|
+
<Stack rowGap="m">
|
|
9
|
+
<Text family="mono" size="xs" tone="muted">
|
|
10
|
+
RETIREMENT
|
|
11
|
+
</Text>
|
|
12
|
+
<Text size="2xl">$420,000</Text>
|
|
13
|
+
<LinearProgress aria-label="RETIREMENT progress" max={100} min={0} value={65} />
|
|
14
|
+
<Stack columnGap="s" direction="row" hAlign="space-between" vAlign="center">
|
|
15
|
+
<Text tone="muted">65% achieved</Text>
|
|
16
|
+
<Text weight="semibold">$273,000</Text>
|
|
17
|
+
</Stack>
|
|
18
|
+
</Stack>
|
|
19
|
+
</Surface>
|
|
20
|
+
]]></tsx>
|
|
21
|
+
<notes>From preview-grid `savings-targets` goal card. Track-only LinearProgress + Stack captions for human-readable progress — do not invent custom track CSS.</notes>
|
|
22
|
+
</example>
|
|
23
|
+
|
|
24
|
+
<example title="Intake vs daily goal">
|
|
25
|
+
<tsx><![CDATA[
|
|
26
|
+
<Surface border="all" radius="auto" hPadding="m" vPadding="m">
|
|
27
|
+
<Stack rowGap="m" hAlign="center">
|
|
28
|
+
<Stack hAlign="center" rowGap="2xs">
|
|
29
|
+
<Title align="center" size="display" lineHeight="s" whiteSpace="nowrap">
|
|
30
|
+
350
|
|
31
|
+
</Title>
|
|
32
|
+
<Text align="center" size="xs" tone="muted">
|
|
33
|
+
CALORIES/DAY
|
|
34
|
+
</Text>
|
|
35
|
+
</Stack>
|
|
36
|
+
|
|
37
|
+
<LinearProgress aria-label="Today's calorie intake" max={350} min={0} value={220} />
|
|
38
|
+
|
|
39
|
+
<Stack columnGap="s" direction="row" hAlign="space-between" vAlign="center">
|
|
40
|
+
<Text tone="muted">Today</Text>
|
|
41
|
+
<Text weight="semibold">220 cal</Text>
|
|
42
|
+
</Stack>
|
|
43
|
+
</Stack>
|
|
44
|
+
</Surface>
|
|
45
|
+
]]></tsx>
|
|
46
|
+
<notes>From preview-grid `daily-activity-goal`. `max` matches the goal; `value` is today's intake. Drop Beam/Dialog kitchen chrome from this hint.</notes>
|
|
47
|
+
</example>
|
|
48
|
+
|
|
49
|
+
<example title="Labeled progress with value">
|
|
50
|
+
<tsx><![CDATA[
|
|
51
|
+
<LinearProgress
|
|
52
|
+
label="Upload"
|
|
53
|
+
description="Compressing assets before publish."
|
|
54
|
+
max={100}
|
|
55
|
+
min={0}
|
|
56
|
+
renderValue
|
|
57
|
+
value={42}
|
|
58
|
+
/>
|
|
59
|
+
]]></tsx>
|
|
60
|
+
<notes>API pattern from props/`linear-progress` stories. `label` + `renderValue` + optional `description`. Use `value={null}` for indeterminate when percent is unknown.</notes>
|
|
6
61
|
</example>
|
|
7
62
|
</patterns>
|
|
@@ -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 `Progress.Value` `children` to customize the printed label.</description>
|
|
21
21
|
</prop>
|
|
22
|
-
<
|
|
22
|
+
<prop name="indicator-color" kind="css">
|
|
23
23
|
<description>Progress indicator color for determinate fill and indeterminate sweep.</description>
|
|
24
|
-
</
|
|
25
|
-
<
|
|
24
|
+
</prop>
|
|
25
|
+
<prop name="track-background" kind="css">
|
|
26
26
|
<description>Progress track background color.</description>
|
|
27
|
-
</
|
|
28
|
-
<
|
|
27
|
+
</prop>
|
|
28
|
+
<prop name="track-size" kind="css">
|
|
29
29
|
<description>Progress track thickness on the root.</description>
|
|
30
|
-
</
|
|
30
|
+
</prop>
|
|
31
31
|
</props>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="linear-progress">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<dont>
|
|
9
|
-
<dont>
|
|
10
|
-
<dont>
|
|
3
|
+
<do>Task completion with known percent or bounded `value` / `min` / `max` (upload, export, goal progress)</do>
|
|
4
|
+
<do>Indeterminate work: `value={null}` — do not invent fake percentages</do>
|
|
5
|
+
<do>Labeled track: `label` + optional `renderValue` + `description` — root already renders as Stack, so nest captions without custom flex CSS</do>
|
|
6
|
+
<do>Goal cards: Surface + Stack headlines / captions around a track-only LinearProgress (`aria-label` when no `label` prop)</do>
|
|
7
|
+
<do>Prefer Meter for static capacity / score within a range (storage, quota, battery) — LinearProgress for in-progress tasks</do>
|
|
8
|
+
<dont>Using LinearProgress as an interactive value control — use Slider</dont>
|
|
9
|
+
<dont>Using LinearProgress for layout placeholders — use Skeleton; for tiny busy chrome use Spinner / Button `loading`</dont>
|
|
10
|
+
<dont>Modeling invalid or disabled progress — Base UI Progress exposes neither</dont>
|
|
11
|
+
<dont>Hiding the task name when multiple progress indicators share a view</dont>
|
|
11
12
|
</usage>
|
|
@@ -1,9 +1,72 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="masonry">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<!-- Sources: packages/react/src/components/masonry/masonry.stories.tsx — cleaned (no ResizeObserver mocks, no play harness). -->
|
|
4
|
+
|
|
5
|
+
<example title="Responsive card wall">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Masonry gap="l">
|
|
8
|
+
<Masonry.Item>
|
|
9
|
+
<Elevator resting={1}>
|
|
10
|
+
<Surface border="all" hoverColor={3} color={2} radius="m">
|
|
11
|
+
<Stack expandChildren hPadding="l" vPadding="l" rowGap="s">
|
|
12
|
+
<Text weight="semibold">Atlas</Text>
|
|
13
|
+
<Text tone="muted">Short block for baseline column packing.</Text>
|
|
14
|
+
</Stack>
|
|
15
|
+
</Surface>
|
|
16
|
+
</Elevator>
|
|
17
|
+
</Masonry.Item>
|
|
18
|
+
<Masonry.Item>
|
|
19
|
+
<Elevator resting={1}>
|
|
20
|
+
<Surface border="all" hoverColor={3} color={2} radius="m">
|
|
21
|
+
<Stack expandChildren hPadding="l" vPadding="l" rowGap="s">
|
|
22
|
+
<Text weight="semibold">Beacon</Text>
|
|
23
|
+
<Text tone="muted">
|
|
24
|
+
Longer copy to stretch item height and make the column flow visible.
|
|
25
|
+
</Text>
|
|
26
|
+
</Stack>
|
|
27
|
+
</Surface>
|
|
28
|
+
</Elevator>
|
|
29
|
+
</Masonry.Item>
|
|
30
|
+
<Masonry.Item>
|
|
31
|
+
<Elevator resting={1}>
|
|
32
|
+
<Surface border="all" hoverColor={3} color={2} radius="m">
|
|
33
|
+
<Stack expandChildren hPadding="l" vPadding="l" rowGap="s">
|
|
34
|
+
<Text weight="semibold">Comet</Text>
|
|
35
|
+
<Text tone="muted">Compact card.</Text>
|
|
36
|
+
</Stack>
|
|
37
|
+
</Surface>
|
|
38
|
+
</Elevator>
|
|
39
|
+
</Masonry.Item>
|
|
40
|
+
</Masonry>
|
|
41
|
+
]]></tsx>
|
|
42
|
+
<notes>From `DefaultResponsiveLayout`. Default `breakpointCols` pack uneven Surface cards; `gap` owns column + within-column spacing. Presentational wall only — DOM order follows columns.</notes>
|
|
43
|
+
</example>
|
|
44
|
+
|
|
45
|
+
<example title="Custom column breakpoints">
|
|
46
|
+
<tsx><![CDATA[
|
|
47
|
+
<Masonry gap="l" breakpointCols={{ default: 1, 640: 2, 1152: 3 }}>
|
|
48
|
+
<Masonry.Item>
|
|
49
|
+
<Elevator resting={1}>
|
|
50
|
+
<Surface border="all" color={2} radius="m">
|
|
51
|
+
<Stack expandChildren hPadding="l" vPadding="l" rowGap="s">
|
|
52
|
+
<Text weight="semibold">North</Text>
|
|
53
|
+
<Text tone="muted">Custom min-width keys are CSS px against the Masonry root.</Text>
|
|
54
|
+
</Stack>
|
|
55
|
+
</Surface>
|
|
56
|
+
</Elevator>
|
|
57
|
+
</Masonry.Item>
|
|
58
|
+
<Masonry.Item>
|
|
59
|
+
<Elevator resting={1}>
|
|
60
|
+
<Surface border="all" color={2} radius="m">
|
|
61
|
+
<Stack expandChildren hPadding="l" vPadding="l" rowGap="s">
|
|
62
|
+
<Text weight="semibold">South</Text>
|
|
63
|
+
<Text tone="muted">Neighbor item for multi-column layout.</Text>
|
|
64
|
+
</Stack>
|
|
65
|
+
</Surface>
|
|
66
|
+
</Elevator>
|
|
67
|
+
</Masonry.Item>
|
|
68
|
+
</Masonry>
|
|
69
|
+
]]></tsx>
|
|
70
|
+
<notes>From `CustomBreakpoints`. Keys may be unsorted; largest matching px wins. Not viewport media — root content-box inline size.</notes>
|
|
8
71
|
</example>
|
|
9
72
|
</patterns>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<prop name="render" kind="react">
|
|
27
27
|
<description>Replaces the default `div` root using Base UI render semantics.</description>
|
|
28
28
|
</prop>
|
|
29
|
-
<
|
|
29
|
+
<prop name="gap" kind="css">
|
|
30
30
|
<description>Column gap only (`--vui-masonry-gap` on the flex root). Within-column item spacing uses Stack `rowGap`, not this custom property.</description>
|
|
31
|
-
</
|
|
31
|
+
</prop>
|
|
32
32
|
</props>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="masonry">
|
|
3
3
|
<do>Card walls, gallery-like collections, and editorial layouts with uneven item heights</do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<do>
|
|
4
|
+
<do>Compose each `Masonry.Item` as Elevator → Surface → Stack → Text (title + muted body) — Masonry packs columns; Surface/Stack own chrome and spacing</do>
|
|
5
|
+
<do>Presentational walls where responsive column count (`breakpointCols`) matters more than source-order reading</do>
|
|
6
|
+
<do>Set `gap` from the density profile — open props; do not invent CSS `gap` / column margins</do>
|
|
7
|
+
<do>Style descendants with `@container masonry` when layout should respond to this root's inline-size (peer of Surface/Stack named containers)</do>
|
|
7
8
|
<dont>Treating React columns as a true interactive grid with predictable source-order keyboard traversal</dont>
|
|
8
|
-
<dont>Using
|
|
9
|
+
<dont>Using Grid when you only need ragged uneven-height packing — and conversely: use Grid (not Masonry) when you need row/column spans or placement</dont>
|
|
10
|
+
<dont>Using arbitrary child margins or CSS `gap` instead of the public `gap` prop</dont>
|
|
11
|
+
<dont>Using CSS `columns` / `column-count` instead of Masonry for ragged packing</dont>
|
|
12
|
+
<dont>Inventing `width: 100%` on masonry children when the column track already owns the inline size</dont>
|
|
13
|
+
<dont>Enabling Stack/Surface `enableContainer` on cards inside Masonry unless you need those queries — inline-size containment can change nested packing</dont>
|
|
9
14
|
</usage>
|
|
@@ -1,25 +1,189 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="menu">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
<!-- Sources: viraui-app/components + design-kitchen preview-grid — cleaned (no handlers, no portal/preview chrome). -->
|
|
4
|
+
|
|
5
|
+
<example title="Account menu">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Menu>
|
|
8
|
+
<Menu.Trigger
|
|
9
|
+
render={
|
|
10
|
+
<Stack hPadding="s" render={<button type="button" />} vPadding="s" expandChildren>
|
|
11
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
|
|
12
|
+
<Stack columnGap="s" direction="row" vAlign="center">
|
|
13
|
+
<Avatar alt="Maya Chen" fallback="MC" size="s" />
|
|
14
|
+
<Stack rowGap="s">
|
|
15
|
+
<Text weight="semibold">Maya Chen</Text>
|
|
16
|
+
<Text size="s" tone="muted">
|
|
17
|
+
maya@ledger.io
|
|
18
|
+
</Text>
|
|
19
|
+
</Stack>
|
|
20
|
+
</Stack>
|
|
21
|
+
<ChevronExpandY aria-hidden size={16} />
|
|
22
|
+
</Stack>
|
|
23
|
+
</Stack>
|
|
24
|
+
}
|
|
25
|
+
/>
|
|
26
|
+
<Menu.Popup align="start" side="bottom">
|
|
27
|
+
<Stack hPadding="s" rowGap="2xs" vPadding="s">
|
|
28
|
+
<Stack columnGap="s" direction="row" vAlign="center">
|
|
29
|
+
<Avatar alt="Maya Chen" fallback="MC" size="m" />
|
|
30
|
+
<Stack rowGap="s">
|
|
31
|
+
<Text weight="semibold">Maya Chen</Text>
|
|
32
|
+
<Text size="s" tone="muted">
|
|
33
|
+
maya@ledger.io
|
|
34
|
+
</Text>
|
|
35
|
+
</Stack>
|
|
36
|
+
</Stack>
|
|
37
|
+
</Stack>
|
|
38
|
+
<Menu.Separator />
|
|
39
|
+
<Menu.Item addon={<StarUpgrade aria-hidden size={16} />}>Upgrade to Pro</Menu.Item>
|
|
40
|
+
<Menu.Separator />
|
|
41
|
+
<Menu.Group label="Settings">
|
|
42
|
+
<Menu.Item addon={<BadgeCheck aria-hidden size={16} />}>Account</Menu.Item>
|
|
43
|
+
<Menu.Item addon={<CreditCards aria-hidden size={16} />}>Billing</Menu.Item>
|
|
44
|
+
<Menu.Item addon={<Bell aria-hidden size={16} />}>Notifications</Menu.Item>
|
|
45
|
+
</Menu.Group>
|
|
46
|
+
<Menu.Separator />
|
|
47
|
+
<Menu.Item addon={<ArrowDoorOut aria-hidden size={16} />} sentiment="destructive">
|
|
48
|
+
Log out
|
|
49
|
+
</Menu.Item>
|
|
50
|
+
</Menu.Popup>
|
|
51
|
+
</Menu>
|
|
52
|
+
]]></tsx>
|
|
53
|
+
<notes>From preview-grid `menu-account`. Surface-chip Trigger + static profile header inside Popup + Group/Separator/destructive Item. Do not wrap Menu in Popover.</notes>
|
|
54
|
+
</example>
|
|
55
|
+
|
|
56
|
+
<example title="Report actions (check / radio / submenu)">
|
|
57
|
+
<tsx><![CDATA[
|
|
58
|
+
<Menu>
|
|
59
|
+
<Menu.Trigger
|
|
60
|
+
render={
|
|
61
|
+
<Button size="s" addon={<ChevronDown aria-hidden size={16} />} variant="secondary">
|
|
62
|
+
Actions
|
|
63
|
+
</Button>
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
<Menu.Popup align="end" side="bottom">
|
|
67
|
+
<Menu.Group label="Edit">
|
|
68
|
+
<Menu.Item addon={<Pencil aria-hidden size={16} />} note="⌘E">
|
|
69
|
+
Rename report
|
|
70
|
+
</Menu.Item>
|
|
71
|
+
<Menu.Item addon={<Duplicate aria-hidden size={16} />} note="⌘D">
|
|
72
|
+
Duplicate
|
|
73
|
+
</Menu.Item>
|
|
74
|
+
<Menu.Item addon={<Archive aria-hidden size={16} />}>Archive</Menu.Item>
|
|
75
|
+
</Menu.Group>
|
|
76
|
+
<Menu.Separator />
|
|
77
|
+
<Menu.Group label="View">
|
|
78
|
+
<Menu.CheckboxItem addon={<Eye aria-hidden size={16} />} checked>
|
|
79
|
+
Show totals row
|
|
80
|
+
</Menu.CheckboxItem>
|
|
81
|
+
<Menu.CheckboxItem>Compact table rows</Menu.CheckboxItem>
|
|
12
82
|
</Menu.Group>
|
|
13
|
-
<Menu.
|
|
14
|
-
|
|
83
|
+
<Menu.Separator />
|
|
84
|
+
<Menu.RadioGroup label="Sort by" value="date">
|
|
85
|
+
<Menu.RadioItem value="date">Date</Menu.RadioItem>
|
|
86
|
+
<Menu.RadioItem value="amount">Amount</Menu.RadioItem>
|
|
87
|
+
<Menu.RadioItem value="recipient">Recipient</Menu.RadioItem>
|
|
15
88
|
</Menu.RadioGroup>
|
|
16
89
|
<Menu.Separator />
|
|
17
90
|
<Menu.Submenu>
|
|
18
|
-
<Menu.SubmenuTrigger />
|
|
19
|
-
<Menu.Popup
|
|
91
|
+
<Menu.SubmenuTrigger addon={<Link aria-hidden size={16} />}>Share</Menu.SubmenuTrigger>
|
|
92
|
+
<Menu.Popup side="inline-end">
|
|
93
|
+
<Menu.LinkItem href="#">Copy link</Menu.LinkItem>
|
|
94
|
+
<Menu.Item note="⌘⇧E">Export PDF</Menu.Item>
|
|
95
|
+
<Menu.Item>Send to team</Menu.Item>
|
|
96
|
+
</Menu.Popup>
|
|
20
97
|
</Menu.Submenu>
|
|
98
|
+
<Menu.Separator />
|
|
99
|
+
<Menu.Item addon={<Trash aria-hidden size={16} />} sentiment="destructive">
|
|
100
|
+
Delete report
|
|
101
|
+
</Menu.Item>
|
|
102
|
+
</Menu.Popup>
|
|
103
|
+
</Menu>
|
|
104
|
+
]]></tsx>
|
|
105
|
+
<notes>From preview-grid `menu-actions`. Full item surface: Group, CheckboxItem, RadioGroup, Submenu + LinkItem, destructive. Drop checked-change handlers.</notes>
|
|
106
|
+
</example>
|
|
107
|
+
|
|
108
|
+
<example title="Row more-menu">
|
|
109
|
+
<tsx><![CDATA[
|
|
110
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
|
|
111
|
+
<Stack rowGap="s">
|
|
112
|
+
<Text weight="semibold">Q2 payout report</Text>
|
|
113
|
+
<Text size="s" tone="muted">
|
|
114
|
+
PDF · Updated 2 hours ago
|
|
115
|
+
</Text>
|
|
116
|
+
</Stack>
|
|
117
|
+
<Menu>
|
|
118
|
+
<Menu.Trigger
|
|
119
|
+
render={
|
|
120
|
+
<IconButton
|
|
121
|
+
aria-label="More actions for Q2 payout report"
|
|
122
|
+
icon={<DotsVertical size={16} />}
|
|
123
|
+
pill
|
|
124
|
+
size="s"
|
|
125
|
+
variant="flat"
|
|
126
|
+
/>
|
|
127
|
+
}
|
|
128
|
+
/>
|
|
129
|
+
<Menu.Popup align="end" side="bottom">
|
|
130
|
+
<Menu.Item addon={<Pencil aria-hidden size={16} />}>Rename</Menu.Item>
|
|
131
|
+
<Menu.Item addon={<Duplicate aria-hidden size={16} />}>Duplicate</Menu.Item>
|
|
132
|
+
<Menu.Item addon={<Archive aria-hidden size={16} />}>Archive</Menu.Item>
|
|
133
|
+
<Menu.Separator />
|
|
134
|
+
<Menu.Item addon={<Trash aria-hidden size={16} />} sentiment="destructive">
|
|
135
|
+
Delete
|
|
136
|
+
</Menu.Item>
|
|
137
|
+
</Menu.Popup>
|
|
138
|
+
</Menu>
|
|
139
|
+
</Stack>
|
|
140
|
+
]]></tsx>
|
|
141
|
+
<notes>From preview-grid `menu-more`. IconButton Trigger on a list row. Drop Glow kitchen wrapper.</notes>
|
|
142
|
+
</example>
|
|
143
|
+
|
|
144
|
+
<example title="Base theme radio menu">
|
|
145
|
+
<tsx><![CDATA[
|
|
146
|
+
<Menu>
|
|
147
|
+
<Menu.Trigger
|
|
148
|
+
aria-labelledby="base-theme-label base-theme-value"
|
|
149
|
+
render={
|
|
150
|
+
<Surface
|
|
151
|
+
color={2}
|
|
152
|
+
hPadding="m"
|
|
153
|
+
radius="m"
|
|
154
|
+
hoverColor={3}
|
|
155
|
+
render={<Stack render={<button type="button" />} />}
|
|
156
|
+
vPadding="m"
|
|
157
|
+
/>
|
|
158
|
+
}
|
|
159
|
+
>
|
|
160
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
|
|
161
|
+
<Stack rowGap="s">
|
|
162
|
+
<Text id="base-theme-label" size="s" tone="muted">
|
|
163
|
+
Base theme
|
|
164
|
+
</Text>
|
|
165
|
+
<Title id="base-theme-value" lineHeight="xs" size="6">
|
|
166
|
+
Vira
|
|
167
|
+
</Title>
|
|
168
|
+
</Stack>
|
|
169
|
+
<ChevronExpandY aria-hidden size={24} />
|
|
170
|
+
</Stack>
|
|
171
|
+
</Menu.Trigger>
|
|
172
|
+
<Menu.Popup align="start" side="right">
|
|
173
|
+
<Menu.RadioGroup value="vira">
|
|
174
|
+
<Menu.RadioItem closeOnClick value="vira">
|
|
175
|
+
Vira
|
|
176
|
+
</Menu.RadioItem>
|
|
177
|
+
<Menu.RadioItem closeOnClick value="sunburst">
|
|
178
|
+
Sunburst
|
|
179
|
+
</Menu.RadioItem>
|
|
180
|
+
<Menu.RadioItem closeOnClick value="cinder">
|
|
181
|
+
Cinder
|
|
182
|
+
</Menu.RadioItem>
|
|
183
|
+
</Menu.RadioGroup>
|
|
21
184
|
</Menu.Popup>
|
|
22
|
-
</Menu>
|
|
23
|
-
|
|
185
|
+
</Menu>
|
|
186
|
+
]]></tsx>
|
|
187
|
+
<notes>From `editor/controls/base-theme-selector`. Surface-as-button Trigger + RadioGroup of themes. Drop preview-dwell handlers.</notes>
|
|
24
188
|
</example>
|
|
25
189
|
</patterns>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="menu">
|
|
3
|
-
<do>Action menus anchored to
|
|
4
|
-
<do>Nested command lists with
|
|
5
|
-
<do>
|
|
3
|
+
<do>Action menus anchored to Button or IconButton — not page-blocking flows (Dialog) or rich free-layout panels (Popover)</do>
|
|
4
|
+
<do>Nested command lists with `Menu.CheckboxItem` / `Menu.RadioGroup`+`Menu.RadioItem` (stay open on toggle by default) and `Menu.Submenu` + nested `Menu.Popup`</do>
|
|
5
|
+
<do>Mix `Menu.LinkItem` with action `Menu.Item` rows; group with `Menu.Group` / `Menu.Separator`</do>
|
|
6
|
+
<do>Account / user chip: `Menu.Trigger` as Surface/Stack (Avatar + Text) opening `Menu.Popup` with static profile header plus Items</do>
|
|
6
7
|
<do>Detached or multi-trigger menus via `Menu.createHandle`</do>
|
|
7
|
-
<do>
|
|
8
|
-
<do>Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part</do>
|
|
8
|
+
<do>Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on `Menu.Popup`</do>
|
|
9
9
|
<dont>Expecting `Menu.Arrow`, `Menu.Backdrop`, or public Portal/Positioner/Viewport exports</dont>
|
|
10
|
-
<dont>Closing checkbox/radio items on click by default when the menu should stay open for multi-toggle</dont>
|
|
10
|
+
<dont>Closing checkbox/radio items on click by default when the menu should stay open for multi-toggle — pass `closeOnClick` only when a single pick should dismiss</dont>
|
|
11
11
|
<dont>Using physical left/right CSS that breaks RTL submenu chevrons</dont>
|
|
12
12
|
<dont>Expecting RTL item rows / left-opening submenus without Base UI `DirectionProvider direction="rtl"` plus app `dir="rtl"` on a portal ancestor (usually `<html>` / document root — a local wrapper alone does not reach body-mounted popups)</dont>
|
|
13
13
|
<dont>Nesting Menu inside Popover for an account menu — Menu already owns portal, positioning, and listbox keyboard behavior</dont>
|
|
14
|
-
<dont>Putting focusable controls (inputs, nested buttons) in `Menu.Popup` outside `Menu.Item` / `Menu.LinkItem` / checkbox / radio / submenu trigger parts</dont>
|
|
14
|
+
<dont>Putting focusable controls (inputs, nested buttons) in `Menu.Popup` outside `Menu.Item` / `Menu.LinkItem` / checkbox / radio / submenu trigger parts — use Popover or Dialog for forms</dont>
|
|
15
|
+
<dont>Using Menu for form-field single-select from a long list — use Select</dont>
|
|
15
16
|
</usage>
|
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="meter">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: preview-grid blocks — cleaned (no handlers, no kitchen chrome). -->
|
|
4
|
+
|
|
5
|
+
<example title="Workspace usage stack">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Stack rowGap="l">
|
|
8
|
+
<Meter label="Storage" renderValue value={74} description="74 GB of 100 GB" />
|
|
9
|
+
<Meter
|
|
10
|
+
label="API quota"
|
|
11
|
+
renderValue
|
|
12
|
+
value={18400}
|
|
13
|
+
min={0}
|
|
14
|
+
max={25000}
|
|
15
|
+
locale="en-US"
|
|
16
|
+
format={{ maximumFractionDigits: 0 }}
|
|
17
|
+
description={
|
|
18
|
+
<>
|
|
19
|
+
<code>18,400</code> of <code>25,000</code> requests this month
|
|
20
|
+
</>
|
|
21
|
+
}
|
|
22
|
+
/>
|
|
23
|
+
<Meter
|
|
24
|
+
renderValue
|
|
25
|
+
value={91}
|
|
26
|
+
label={
|
|
27
|
+
<Stack direction="row" columnGap="xs" vAlign="center">
|
|
28
|
+
<Sun aria-hidden size={16} />
|
|
29
|
+
<span>Backup health</span>
|
|
30
|
+
</Stack>
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
</Stack>
|
|
34
|
+
]]></tsx>
|
|
35
|
+
<notes>From preview-grid `workspace-usage`. Capacity metrics use Meter (not LinearProgress). `label` may be a Stack with decorative icon; `format`/`locale` tune printed `renderValue`.</notes>
|
|
36
|
+
</example>
|
|
37
|
+
|
|
38
|
+
<example title="Pace check in nested sheet">
|
|
39
|
+
<tsx><![CDATA[
|
|
40
|
+
<Surface color={2} radius="l" hPadding="m" vPadding="m">
|
|
41
|
+
<Meter
|
|
42
|
+
description="Today's intake against the draft goal."
|
|
43
|
+
label="Pace check"
|
|
44
|
+
max={350}
|
|
45
|
+
min={0}
|
|
46
|
+
renderValue
|
|
47
|
+
value={220}
|
|
48
|
+
/>
|
|
49
|
+
</Surface>
|
|
50
|
+
]]></tsx>
|
|
51
|
+
<notes>From preview-grid `daily-activity-goal` nested tips sheet. Meter for score-within-range; LinearProgress stays on the live activity track outside the dialog.</notes>
|
|
6
52
|
</example>
|
|
7
53
|
</patterns>
|