@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
|
@@ -1,7 +1,192 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="surface">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: viraui-app/components — cleaned (no handlers, no i18n, no app-only chrome). -->
|
|
4
|
+
|
|
5
|
+
<example title="Nested vibrant chrome (hub nav)">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Surface hPadding="xs" vPadding="xs" radius="m" border="all" data-vibrant>
|
|
8
|
+
<Surface radius="auto" color={1} hPadding="xs" vPadding="xs">
|
|
9
|
+
<Stack render={<nav />} direction="row" vAlign="center" columnGap="xs">
|
|
10
|
+
<ButtonLink size="s" variant="secondary" href="/hub">
|
|
11
|
+
Hub
|
|
12
|
+
</ButtonLink>
|
|
13
|
+
<ButtonLink size="s" variant="flat" href="/studio">
|
|
14
|
+
Studio
|
|
15
|
+
</ButtonLink>
|
|
16
|
+
<ButtonLink size="s" variant="flat" href="/prompts">
|
|
17
|
+
Prompts
|
|
18
|
+
</ButtonLink>
|
|
19
|
+
</Stack>
|
|
20
|
+
</Surface>
|
|
21
|
+
</Surface>
|
|
22
|
+
]]></tsx>
|
|
23
|
+
<notes>From `common/hub-header`. Outer frosted shell (`data-vibrant`) + inner tinted Surface with `radius="auto"` for concentric corners. Nest Surfaces for chrome; Stack owns the row.</notes>
|
|
24
|
+
</example>
|
|
25
|
+
|
|
26
|
+
<example title="Dense control chrome (mode switcher)">
|
|
27
|
+
<tsx><![CDATA[
|
|
28
|
+
<Surface border="all" radius="m" vPadding="2xs" hPadding="2xs">
|
|
29
|
+
<ToggleGroup aria-label="Color mode" value={['system']}>
|
|
30
|
+
<ToggleButton
|
|
31
|
+
value="light"
|
|
32
|
+
aria-label="Light"
|
|
33
|
+
restingIcon={<Sun aria-hidden size="1rem" />}
|
|
34
|
+
variant="flat"
|
|
35
|
+
size="s"
|
|
36
|
+
pressedVariant="secondary"
|
|
37
|
+
/>
|
|
38
|
+
<ToggleButton
|
|
39
|
+
value="dark"
|
|
40
|
+
aria-label="Dark"
|
|
41
|
+
restingIcon={<MoonStars aria-hidden size="1rem" />}
|
|
42
|
+
variant="flat"
|
|
43
|
+
size="s"
|
|
44
|
+
pressedVariant="secondary"
|
|
45
|
+
/>
|
|
46
|
+
<ToggleButton
|
|
47
|
+
value="system"
|
|
48
|
+
aria-label="System"
|
|
49
|
+
restingIcon={<DarkLight aria-hidden size="1rem" />}
|
|
50
|
+
variant="flat"
|
|
51
|
+
size="s"
|
|
52
|
+
pressedVariant="secondary"
|
|
53
|
+
/>
|
|
54
|
+
</ToggleGroup>
|
|
55
|
+
</Surface>
|
|
56
|
+
]]></tsx>
|
|
57
|
+
<notes>From `common/mode-switcher`. Tight padding tokens on Surface host a ToggleGroup — no custom chrome CSS.</notes>
|
|
58
|
+
</example>
|
|
59
|
+
|
|
60
|
+
<example title="Editor shell (aside + canvas)">
|
|
61
|
+
<tsx><![CDATA[
|
|
62
|
+
<Stack direction="row" hPadding="m" vPadding={[0, 'm']} columnGap="l" expandChildren>
|
|
63
|
+
<Surface
|
|
64
|
+
render={<Stack render={<aside aria-label="Theme controls" />} maxWidth="22rem" expandChildren />}
|
|
65
|
+
border="all"
|
|
66
|
+
overflow="hidden"
|
|
67
|
+
color={1}
|
|
68
|
+
radius="l"
|
|
69
|
+
>
|
|
70
|
+
{/* sidebar sections */}
|
|
71
|
+
<Surface color={2} data-grow="false">
|
|
72
|
+
<Separator />
|
|
73
|
+
<Stack vPadding="s" hPadding="m" rowGap="s" expandChildren>
|
|
74
|
+
<Stack direction="row" columnGap="s" expandChildren>
|
|
75
|
+
<Button size="s" variant="secondary">
|
|
76
|
+
Shuffle
|
|
77
|
+
</Button>
|
|
78
|
+
<Button size="s" variant="secondary">
|
|
79
|
+
Import
|
|
80
|
+
</Button>
|
|
81
|
+
</Stack>
|
|
82
|
+
<Button size="s">Export</Button>
|
|
83
|
+
</Stack>
|
|
84
|
+
<Separator />
|
|
85
|
+
<Stack vPadding="xs" hPadding="m">
|
|
86
|
+
<Button size="s" variant="flat">
|
|
87
|
+
Reset all
|
|
88
|
+
</Button>
|
|
89
|
+
</Stack>
|
|
90
|
+
</Surface>
|
|
91
|
+
</Surface>
|
|
92
|
+
|
|
93
|
+
<Surface render={<main />} overflow="hidden" border="all" radius="l">
|
|
94
|
+
{/* canvas / preview */}
|
|
95
|
+
</Surface>
|
|
96
|
+
</Stack>
|
|
97
|
+
]]></tsx>
|
|
98
|
+
<notes>From `editor/editor`. `render` merges Surface chrome onto Stack/`aside`/`main`. Nested `color={2}` footer strip; Separators divide actions. Prefer Surface `overflow` over inline style.</notes>
|
|
99
|
+
</example>
|
|
100
|
+
|
|
101
|
+
<example title="Hover section card (sidebar)">
|
|
102
|
+
<tsx><![CDATA[
|
|
103
|
+
<Stack hPadding="m">
|
|
104
|
+
<Surface color={2} hoverColor={3} radius="m" vPadding="s">
|
|
105
|
+
<Stack rowGap="s" hPadding="m" vPadding={[0, 's']}>
|
|
106
|
+
<Stack direction="row" vAlign="center" hAlign="space-between" columnGap="s">
|
|
107
|
+
<Stack direction="row" vAlign="center" columnGap="s">
|
|
108
|
+
{/* section icon */}
|
|
109
|
+
<Text size="xs" weight="semibold">
|
|
110
|
+
Colors
|
|
111
|
+
</Text>
|
|
112
|
+
</Stack>
|
|
113
|
+
{/* trailing addon */}
|
|
114
|
+
</Stack>
|
|
115
|
+
<Text tone="muted" size="s">
|
|
116
|
+
Brand seed and highlight scales.
|
|
117
|
+
</Text>
|
|
118
|
+
</Stack>
|
|
119
|
+
<Stack rowGap="m" hPadding="s" vPadding="xs">
|
|
120
|
+
{/* controls */}
|
|
121
|
+
</Stack>
|
|
122
|
+
</Surface>
|
|
123
|
+
</Stack>
|
|
124
|
+
]]></tsx>
|
|
125
|
+
<notes>From `editor/sidebar/sidebar-section`. Resting `color={2}` + `hoverColor={3}` for pointer hover. Stack owns header/body spacing.</notes>
|
|
126
|
+
</example>
|
|
127
|
+
|
|
128
|
+
<example title="Preferences panel">
|
|
129
|
+
<tsx><![CDATA[
|
|
130
|
+
<Surface overflow="hidden" border="all" color={1} radius="l">
|
|
131
|
+
<Stack rowGap="m">
|
|
132
|
+
<Stack rowGap="m" hPadding="m" vPadding="m">
|
|
133
|
+
<Stack columnGap="s" direction="row" hAlign="space-between" vAlign="start">
|
|
134
|
+
<Stack rowGap="xs">
|
|
135
|
+
<Title size="6" render={<h2 />}>
|
|
136
|
+
Preferences
|
|
137
|
+
</Title>
|
|
138
|
+
<Text size="s" maxWidth="18rem" tone="muted">
|
|
139
|
+
Manage your account settings and notifications.
|
|
140
|
+
</Text>
|
|
141
|
+
</Stack>
|
|
142
|
+
<IconButton aria-label="Close" icon={<Xmark />} size="s" variant="secondary" />
|
|
143
|
+
</Stack>
|
|
144
|
+
|
|
145
|
+
<Select label="Default Currency" value="usd">
|
|
146
|
+
<Select.Option value="usd">United States Dollar</Select.Option>
|
|
147
|
+
<Select.Option value="eur">Euro</Select.Option>
|
|
148
|
+
</Select>
|
|
149
|
+
|
|
150
|
+
<Surface vPadding="m">
|
|
151
|
+
<Switch label="Public Statistics" description="Allow others to see activity" />
|
|
152
|
+
</Surface>
|
|
153
|
+
<Surface vPadding="m">
|
|
154
|
+
<Switch label="Email Notifications" description="Monthly reports and updates" />
|
|
155
|
+
</Surface>
|
|
156
|
+
</Stack>
|
|
157
|
+
|
|
158
|
+
<Surface color={2} hPadding="l" vPadding="m">
|
|
159
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
|
|
160
|
+
<Button variant="secondary">Reset</Button>
|
|
161
|
+
<Button>Save Preferences</Button>
|
|
162
|
+
</Stack>
|
|
163
|
+
</Surface>
|
|
164
|
+
</Stack>
|
|
165
|
+
</Surface>
|
|
166
|
+
]]></tsx>
|
|
167
|
+
<notes>From `editor/preview-grid/blocks/preferences`. Card shell + padded body + tinted footer strip. Inner Surfaces pad Switch rows without inventing layout CSS.</notes>
|
|
168
|
+
</example>
|
|
169
|
+
|
|
170
|
+
<example title="Code block chrome">
|
|
171
|
+
<tsx><![CDATA[
|
|
172
|
+
<Surface data-vibrant radius="m" border="all" overflow="hidden">
|
|
173
|
+
<Stack direction="row" hAlign="end" hPadding="xs" vPadding="xs">
|
|
174
|
+
<ToggleButton
|
|
175
|
+
aria-label="Copy to clipboard"
|
|
176
|
+
restingIcon={<Duplicate aria-hidden />}
|
|
177
|
+
pressedIcon={<CircleCheck aria-hidden color="var(--highlight-green)" />}
|
|
178
|
+
interpolateIcons
|
|
179
|
+
data-vibrant
|
|
180
|
+
variant="secondary"
|
|
181
|
+
/>
|
|
182
|
+
</Stack>
|
|
183
|
+
<pre>
|
|
184
|
+
<code>{`button {
|
|
185
|
+
border-radius: var(--radius-m);
|
|
186
|
+
}`}</code>
|
|
187
|
+
</pre>
|
|
188
|
+
</Surface>
|
|
189
|
+
]]></tsx>
|
|
190
|
+
<notes>From `common/code-block`. Frosted bordered shell; toolbar is Stack. Drop highlighter/theme state — Surface owns chrome only.</notes>
|
|
6
191
|
</example>
|
|
7
192
|
</patterns>
|
|
@@ -50,43 +50,43 @@
|
|
|
50
50
|
<prop name="vPadding" kind="react">
|
|
51
51
|
<description>Sets block padding using one token for both sides or a `[start, end]` tuple.</description>
|
|
52
52
|
</prop>
|
|
53
|
-
<
|
|
53
|
+
<prop name="background" kind="css">
|
|
54
54
|
<description>Resting surface background on the root.</description>
|
|
55
|
-
</
|
|
56
|
-
<
|
|
55
|
+
</prop>
|
|
56
|
+
<prop name="background-hover" kind="css">
|
|
57
57
|
<description>Hover surface background on the root.</description>
|
|
58
|
-
</
|
|
59
|
-
<
|
|
58
|
+
</prop>
|
|
59
|
+
<prop name="border-radius" kind="css">
|
|
60
60
|
<description>Uniform corner radius when radius is a single token.</description>
|
|
61
|
-
</
|
|
62
|
-
<
|
|
61
|
+
</prop>
|
|
62
|
+
<prop name="border-radius-bottom-left" kind="css">
|
|
63
63
|
<description>Bottom-left corner radius; radius tuple or auto resolves per corner.</description>
|
|
64
|
-
</
|
|
65
|
-
<
|
|
64
|
+
</prop>
|
|
65
|
+
<prop name="border-radius-bottom-right" kind="css">
|
|
66
66
|
<description>Bottom-right corner radius; radius tuple or auto resolves per corner.</description>
|
|
67
|
-
</
|
|
68
|
-
<
|
|
67
|
+
</prop>
|
|
68
|
+
<prop name="border-radius-top-left" kind="css">
|
|
69
69
|
<description>Top-left corner radius; radius tuple or auto resolves per corner.</description>
|
|
70
|
-
</
|
|
71
|
-
<
|
|
70
|
+
</prop>
|
|
71
|
+
<prop name="border-radius-top-right" kind="css">
|
|
72
72
|
<description>Top-right corner radius; radius tuple or auto resolves per corner.</description>
|
|
73
|
-
</
|
|
74
|
-
<
|
|
73
|
+
</prop>
|
|
74
|
+
<prop name="border-style" kind="css">
|
|
75
75
|
<description>Border style when border is enabled.</description>
|
|
76
|
-
</
|
|
77
|
-
<
|
|
76
|
+
</prop>
|
|
77
|
+
<prop name="overflow" kind="css">
|
|
78
78
|
<description>Root overflow behavior.</description>
|
|
79
|
-
</
|
|
80
|
-
<
|
|
79
|
+
</prop>
|
|
80
|
+
<prop name="padding-block-end" kind="css">
|
|
81
81
|
<description>Block-end padding when padding is enabled.</description>
|
|
82
|
-
</
|
|
83
|
-
<
|
|
82
|
+
</prop>
|
|
83
|
+
<prop name="padding-block-start" kind="css">
|
|
84
84
|
<description>Block-start padding when padding is enabled.</description>
|
|
85
|
-
</
|
|
86
|
-
<
|
|
85
|
+
</prop>
|
|
86
|
+
<prop name="padding-inline-end" kind="css">
|
|
87
87
|
<description>Inline-end padding when padding is enabled.</description>
|
|
88
|
-
</
|
|
89
|
-
<
|
|
88
|
+
</prop>
|
|
89
|
+
<prop name="padding-inline-start" kind="css">
|
|
90
90
|
<description>Inline-start padding when padding is enabled.</description>
|
|
91
|
-
</
|
|
91
|
+
</prop>
|
|
92
92
|
</props>
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="surface">
|
|
3
|
-
<do>Group content with base-level background and contrast border</do>
|
|
3
|
+
<do>Group content with base-level background and contrast border — nest Stack for child gaps (Surface has no gap prop)</do>
|
|
4
|
+
<do>Login/signup shell: Surface (or `Stack render={<Surface … />}`) hosts Tabs + Textfield(s) + Button (+ optional Fieldset) — chrome + layout via props, 0 custom CSS</do>
|
|
5
|
+
<do>Accept Stack as host via their `render={<Surface … />}` so border/fill/radius share one DOM node — prefer over inventing chrome CSS (see package pattern `stack-as-surface`)</do>
|
|
6
|
+
<do>Settings / preferences panels: Surface card + Stack body + Switch/Checkbox rows (optionally padded inner Surfaces) + Button footer strip</do>
|
|
4
7
|
<do>Frosted glass panels with `data-vibrant` — omit `color` for page-level shell or pass `color` for a tinted fill</do>
|
|
5
|
-
<do>
|
|
6
|
-
<do>
|
|
7
|
-
<do>Set radius to a token on the outermost Surface that needs rounded corners</do>
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
<dont>Overwriting transition shorthand without composing box-shadow when data-elevation is present</dont>
|
|
12
|
-
<dont>Assuming hoverColor applies on touch devices</dont>
|
|
13
|
-
<dont>Reusing the parent token radius on nested Surfaces instead of radius="auto"
|
|
14
|
-
<dont>Expecting radius="auto"
|
|
15
|
-
<dont>Using viewport media queries when
|
|
8
|
+
<do>Compose with Elevator for animated elevation — Surface has no `elevation` prop</do>
|
|
9
|
+
<do>Inset content with `hPadding` / `vPadding` — nest Stack/Grid for child gaps</do>
|
|
10
|
+
<do>Set `radius` to a token (or four-value tuple) on the outermost Surface that needs rounded corners; `radius="auto"` on nested Surfaces for concentric corners</do>
|
|
11
|
+
<dont>Passing `elevation={…}` on Surface — wrap with Elevator / `getElevationProps`</dont>
|
|
12
|
+
<dont>Inventing CSS `padding` / `gap` on this root when public padding props (and nested Stack) cover it</dont>
|
|
13
|
+
<dont>Inventing `width: 100%` on Surface when a parent Stack `fullWidth` can own the fill</dont>
|
|
14
|
+
<dont>Overwriting transition shorthand without composing box-shadow when `data-elevation` is present</dont>
|
|
15
|
+
<dont>Assuming `hoverColor` applies on touch devices</dont>
|
|
16
|
+
<dont>Reusing the parent token radius on nested Surfaces instead of `radius="auto"` when concentric corners are required</dont>
|
|
17
|
+
<dont>Expecting `radius="auto"` to inherit a token when the nearest ancestor Surface has no radius set</dont>
|
|
18
|
+
<dont>Using viewport media queries when `@container surface` against this Surface's inline-size matches the design intent</dont>
|
|
16
19
|
</usage>
|
|
@@ -1,7 +1,77 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="switch">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: viraui-app / design-kitchen preview-grid — cleaned (no handlers, no studio store). -->
|
|
4
|
+
|
|
5
|
+
<example title="Preferences rows">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Surface overflow="hidden" border="all" color={1} radius="l">
|
|
8
|
+
<Stack rowGap="m" hPadding="m" vPadding="m">
|
|
9
|
+
<Stack rowGap="xs">
|
|
10
|
+
<Title size="6" render={<h2 />}>
|
|
11
|
+
Preferences
|
|
12
|
+
</Title>
|
|
13
|
+
<Text size="s" maxWidth="18rem" tone="muted">
|
|
14
|
+
Manage your account settings and notifications.
|
|
15
|
+
</Text>
|
|
16
|
+
</Stack>
|
|
17
|
+
|
|
18
|
+
<Surface vPadding="m">
|
|
19
|
+
<Switch
|
|
20
|
+
checked
|
|
21
|
+
label="Public Statistics"
|
|
22
|
+
description="Allow others to see activity"
|
|
23
|
+
/>
|
|
24
|
+
</Surface>
|
|
25
|
+
<Surface vPadding="m">
|
|
26
|
+
<Switch
|
|
27
|
+
checked
|
|
28
|
+
label="Email Notifications"
|
|
29
|
+
description="Monthly reports and updates"
|
|
30
|
+
/>
|
|
31
|
+
</Surface>
|
|
32
|
+
</Stack>
|
|
33
|
+
</Surface>
|
|
34
|
+
]]></tsx>
|
|
35
|
+
<notes>From `editor/preview-grid/blocks/preferences`. Labeled Switch with `description` in a padded Surface row — settings on/off, not a toolbar toggle.</notes>
|
|
36
|
+
</example>
|
|
37
|
+
|
|
38
|
+
<example title="Effect card (padded small)">
|
|
39
|
+
<tsx><![CDATA[
|
|
40
|
+
<Surface border="all" radius="s" color={1}>
|
|
41
|
+
<Switch
|
|
42
|
+
label="Shadows"
|
|
43
|
+
description="Elevate interactive surfaces"
|
|
44
|
+
checked
|
|
45
|
+
vPadding="m"
|
|
46
|
+
hPadding="m"
|
|
47
|
+
size="s"
|
|
48
|
+
/>
|
|
49
|
+
</Surface>
|
|
50
|
+
]]></tsx>
|
|
51
|
+
<notes>From `editor/controls/effect-toggles/effect-toggle`. Switch owns padding via `hPadding`/`vPadding`; Surface is border chrome only. Prefer `size="s"` for dense editor lists.</notes>
|
|
52
|
+
</example>
|
|
53
|
+
|
|
54
|
+
<example title="Header power switch">
|
|
55
|
+
<tsx><![CDATA[
|
|
56
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="start">
|
|
57
|
+
<Stack rowGap="xs">
|
|
58
|
+
<Title size="6" render={<h2 />}>
|
|
59
|
+
Studio EQ
|
|
60
|
+
</Title>
|
|
61
|
+
<Text size="s" tone="muted">
|
|
62
|
+
7-band output equalizer
|
|
63
|
+
</Text>
|
|
64
|
+
</Stack>
|
|
65
|
+
<Switch aria-label="Enable equalizer" checked />
|
|
66
|
+
</Stack>
|
|
67
|
+
]]></tsx>
|
|
68
|
+
<notes>From `editor/preview-grid/blocks/equalizer` (+ `kitchen-island`). Icon-free header control — unlabeled Switch needs `aria-label`. Kitchen Island omits aria-label in app (prefer always naming unlabeled switches).</notes>
|
|
69
|
+
</example>
|
|
70
|
+
|
|
71
|
+
<example title="Disabled on nested surface">
|
|
72
|
+
<tsx><![CDATA[
|
|
73
|
+
<Switch checked disabled label="Dark shipping mode" />
|
|
74
|
+
]]></tsx>
|
|
75
|
+
<notes>From `editor/preview-grid/blocks/disabled-surface-contrast`. Pair with surrounding Surface color steps to verify disabled contrast.</notes>
|
|
6
76
|
</example>
|
|
7
77
|
</patterns>
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
<prop name="vPadding" kind="react">
|
|
28
28
|
<description>Sets block padding using one token for both sides or a `[start, end]` tuple.</description>
|
|
29
29
|
</prop>
|
|
30
|
-
<
|
|
30
|
+
<prop name="thumb-background" kind="css">
|
|
31
31
|
<description>Switch thumb background color.</description>
|
|
32
|
-
</
|
|
33
|
-
<
|
|
32
|
+
</prop>
|
|
33
|
+
<prop name="thumb-inset" kind="css">
|
|
34
34
|
<description>Inset between thumb and track edges.</description>
|
|
35
|
-
</
|
|
36
|
-
<
|
|
35
|
+
</prop>
|
|
36
|
+
<prop name="thumb-size" kind="css">
|
|
37
37
|
<description>Switch thumb size derived from track block size.</description>
|
|
38
|
-
</
|
|
39
|
-
<
|
|
38
|
+
</prop>
|
|
39
|
+
<prop name="track-background" kind="css">
|
|
40
40
|
<description>Switch track background color.</description>
|
|
41
|
-
</
|
|
42
|
-
<
|
|
41
|
+
</prop>
|
|
42
|
+
<prop name="track-block-size" kind="css">
|
|
43
43
|
<description>Switch track block size; size presets adjust track and thumb.</description>
|
|
44
|
-
</
|
|
45
|
-
<
|
|
44
|
+
</prop>
|
|
45
|
+
<prop name="track-radius" kind="css">
|
|
46
46
|
<description>Switch track corner radius.</description>
|
|
47
|
-
</
|
|
47
|
+
</prop>
|
|
48
48
|
</props>
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="switch">
|
|
3
|
-
<do>Boolean on/off settings with
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
3
|
+
<do>Boolean on/off settings with Switch `label` and optional `description` — Switch owns its Field.Root (name/invalid/disabled pass through)</do>
|
|
4
|
+
<do>Preferences panels — Surface + Stack rows of labeled Switches (padding via Switch `hPadding`/`vPadding` or a padded Surface host)</do>
|
|
5
|
+
<do>Settings row with external copy — Stack `direction="row"` `hAlign="space-between"` + Text/Title stack + Switch; unlabeled Switch needs `aria-label`</do>
|
|
6
|
+
<do>Compact tracks with `size="s"` or `size="m"` (default `s`)</do>
|
|
7
|
+
<do>Pair with Checkbox when the choice is multi-select or a form boolean, not an immediate on/off setting</do>
|
|
8
|
+
<dont>Rendering a switch without `label` and without `aria-label`</dont>
|
|
9
|
+
<dont>Expecting `description` to stay visible when invalid without an `error` message</dont>
|
|
10
|
+
<dont>Expecting size or variant beyond medium and small</dont>
|
|
11
|
+
<dont>Wrapping Switch in another Field.Root — Switch already renders Field.Root</dont>
|
|
12
|
+
<dont>Inventing row layout CSS when Stack `direction="row"` / `hAlign="space-between"` covers the settings row</dont>
|
|
8
13
|
</usage>
|
|
@@ -1,14 +1,119 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="tabs">
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
<!-- Sources: viraui-app/components + preview-grid — cleaned (no handlers, no app-only chrome). Compound parts: Tabs, Tabs.List, Tabs.Tab, Tabs.Viewport, Tabs.Panel. -->
|
|
4
|
+
|
|
5
|
+
<example title="Export preview tabs (CSS / JSONC)">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Tabs defaultValue="css">
|
|
5
8
|
<Tabs.List>
|
|
6
|
-
<Tabs.Tab value="
|
|
9
|
+
<Tabs.Tab value="css">CSS</Tabs.Tab>
|
|
10
|
+
<Tabs.Tab value="jsonc">JSONC</Tabs.Tab>
|
|
7
11
|
</Tabs.List>
|
|
8
12
|
<Tabs.Viewport>
|
|
9
|
-
<Tabs.Panel value="
|
|
13
|
+
<Tabs.Panel value="css">
|
|
14
|
+
<Stack vPadding="m">{/* code preview */}</Stack>
|
|
15
|
+
</Tabs.Panel>
|
|
16
|
+
<Tabs.Panel value="jsonc">
|
|
17
|
+
<Stack vPadding="m">{/* code preview */}</Stack>
|
|
18
|
+
</Tabs.Panel>
|
|
10
19
|
</Tabs.Viewport>
|
|
11
|
-
</Tabs>
|
|
12
|
-
|
|
20
|
+
</Tabs>
|
|
21
|
+
]]></tsx>
|
|
22
|
+
<notes>From `editor/export-dialog`. Canonical compound order: List → Tab(s), then Viewport → Panel(s) with matching `value`. Drop Suspense/`inert`/snap-point chrome from this hint.</notes>
|
|
23
|
+
</example>
|
|
24
|
+
|
|
25
|
+
<example title="Clone repository (stretch list)">
|
|
26
|
+
<tsx><![CDATA[
|
|
27
|
+
<Surface border="all" color={1} radius="xl" hPadding="m" vPadding="m" overflow="hidden">
|
|
28
|
+
<Tabs defaultValue="local" listAlignment="stretch">
|
|
29
|
+
<Tabs.List>
|
|
30
|
+
<Tabs.Tab value="codespaces">Codespaces</Tabs.Tab>
|
|
31
|
+
<Tabs.Tab value="local">Local</Tabs.Tab>
|
|
32
|
+
</Tabs.List>
|
|
33
|
+
|
|
34
|
+
<Tabs.Viewport>
|
|
35
|
+
<Tabs.Panel value="codespaces">
|
|
36
|
+
<Stack vPadding="m" expandChildren>
|
|
37
|
+
<Surface border="all" color={2} radius="l" hPadding="m" vPadding="l">
|
|
38
|
+
<Text tone="muted">Create a cloud workspace from this repository.</Text>
|
|
39
|
+
</Surface>
|
|
40
|
+
</Stack>
|
|
41
|
+
</Tabs.Panel>
|
|
42
|
+
|
|
43
|
+
<Tabs.Panel value="local">
|
|
44
|
+
<Stack vPadding={['m', 0]} rowGap="m" expandChildren>
|
|
45
|
+
<Surface border="all" radius="m" hPadding="m" vPadding="m">
|
|
46
|
+
<Stack rowGap="m">
|
|
47
|
+
<Textfield
|
|
48
|
+
aria-label="Repository clone URL"
|
|
49
|
+
readOnly
|
|
50
|
+
value="https://github.com/vira-soft/vira-ui.git"
|
|
51
|
+
endAddon={<Duplicate size={16} />}
|
|
52
|
+
/>
|
|
53
|
+
<Text tone="muted">Clone using the web URL.</Text>
|
|
54
|
+
</Stack>
|
|
55
|
+
</Surface>
|
|
56
|
+
|
|
57
|
+
<Stack hAlign="start" rowGap="2xs">
|
|
58
|
+
<Button addon={<CircleImage size={18} />} variant="flat" size="s">
|
|
59
|
+
Open with GitHub Desktop
|
|
60
|
+
</Button>
|
|
61
|
+
<Button addon={<ArrowDown size={18} />} variant="flat" size="s">
|
|
62
|
+
Download ZIP
|
|
63
|
+
</Button>
|
|
64
|
+
</Stack>
|
|
65
|
+
</Stack>
|
|
66
|
+
</Tabs.Panel>
|
|
67
|
+
</Tabs.Viewport>
|
|
68
|
+
</Tabs>
|
|
69
|
+
</Surface>
|
|
70
|
+
]]></tsx>
|
|
71
|
+
<notes>From preview-grid `clone-repository`. `listAlignment="stretch"` fills the list chrome. Prefer Surface `overflow` prop over inline style.</notes>
|
|
72
|
+
</example>
|
|
73
|
+
|
|
74
|
+
<example title="Category tabs (prompts)">
|
|
75
|
+
<tsx><![CDATA[
|
|
76
|
+
<Tabs defaultValue="landing">
|
|
77
|
+
<Tabs.List>
|
|
78
|
+
<Tabs.Tab value="landing">Landing pages</Tabs.Tab>
|
|
79
|
+
<Tabs.Tab value="application">Applications</Tabs.Tab>
|
|
80
|
+
<Tabs.Tab value="ecommerce">E-Commerce</Tabs.Tab>
|
|
81
|
+
</Tabs.List>
|
|
82
|
+
<Tabs.Viewport>
|
|
83
|
+
<Tabs.Panel value="landing">{/* info / empty state */}</Tabs.Panel>
|
|
84
|
+
<Tabs.Panel value="application">
|
|
85
|
+
<Text>Applications</Text>
|
|
86
|
+
</Tabs.Panel>
|
|
87
|
+
<Tabs.Panel value="ecommerce">
|
|
88
|
+
<Text>E-Commerce</Text>
|
|
89
|
+
</Tabs.Panel>
|
|
90
|
+
</Tabs.Viewport>
|
|
91
|
+
</Tabs>
|
|
92
|
+
]]></tsx>
|
|
93
|
+
<notes>From `prompts/prompts-tabs`. Same List/Viewport/Panel assembly. Drop `disabled` demo flags unless the product truly locks a tab.</notes>
|
|
94
|
+
</example>
|
|
95
|
+
|
|
96
|
+
<example title="Tab addons (start / end)">
|
|
97
|
+
<tsx><![CDATA[
|
|
98
|
+
<Tabs defaultValue="general">
|
|
99
|
+
<Tabs.List>
|
|
100
|
+
<Tabs.Tab addon={<Quickstart />} value="general">
|
|
101
|
+
General
|
|
102
|
+
</Tabs.Tab>
|
|
103
|
+
<Tabs.Tab addon={<Chip variant="green">New</Chip>} addonPosition="end" value="billing">
|
|
104
|
+
Billing
|
|
105
|
+
</Tabs.Tab>
|
|
106
|
+
<Tabs.Tab addon={<MoonStars />} value="goals">
|
|
107
|
+
Goals
|
|
108
|
+
</Tabs.Tab>
|
|
109
|
+
</Tabs.List>
|
|
110
|
+
<Tabs.Viewport>
|
|
111
|
+
<Tabs.Panel value="general">{/* … */}</Tabs.Panel>
|
|
112
|
+
<Tabs.Panel value="billing">{/* … */}</Tabs.Panel>
|
|
113
|
+
<Tabs.Panel value="goals">{/* … */}</Tabs.Panel>
|
|
114
|
+
</Tabs.Viewport>
|
|
115
|
+
</Tabs>
|
|
116
|
+
]]></tsx>
|
|
117
|
+
<notes>From `tabs` stories (addon coverage). `Tab.addon` / `addonPosition` are decorative — keep visible text as the accessible label; do not use addon-only tabs.</notes>
|
|
13
118
|
</example>
|
|
14
119
|
</patterns>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<prop name="Tab.addonPosition" kind="react">
|
|
19
19
|
<description>Controls whether the addon appears before or after the label.</description>
|
|
20
20
|
</prop>
|
|
21
|
-
<
|
|
21
|
+
<prop name="translate-amount" kind="css">
|
|
22
22
|
<description>Panel entry translate distance for tab transitions.</description>
|
|
23
|
-
</
|
|
23
|
+
</prop>
|
|
24
24
|
</props>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="tabs">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
3
|
+
<do>Switch related views in one surface — not primary app routes or link nav</do>
|
|
4
|
+
<do>Login/signup (or similar) form swap: wrap Tabs in Surface; panels hold Stack with Textfield(s) + Button (+ optional Fieldset) — use Stack `rowGap` / `fullWidth` / `expandChildren` and Textfield `fullWidth`; invent 0 width/gap CSS</do>
|
|
5
|
+
<do>Compound order: `Tabs.List` → `Tabs.Tab`(s), then `Tabs.Viewport` → `Tabs.Panel`(s) with matching `value`</do>
|
|
6
|
+
<do>Fill list chrome with `listAlignment="stretch"`; center/end via `listAlignment` on the root</do>
|
|
7
|
+
<do>Decorative `Tab` `addon` / `addonPosition` beside a visible text label</do>
|
|
6
8
|
<dont>Using addons as the only visible label for a tab</dont>
|
|
7
9
|
<dont>Trying to compose a separate public `Tabs.Indicator`; the indicator is owned by `Tabs.List`</dont>
|
|
10
|
+
<dont>Inventing panel width/gap/padding CSS when Stack inside `Tabs.Panel` can own spacing and fill</dont>
|
|
11
|
+
<dont>Vertical tab layouts in v1 styled targets</dont>
|
|
8
12
|
</usage>
|