@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,8 +1,14 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="slider">
|
|
3
|
-
<do>Numeric
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
3
|
+
<do>Numeric single-thumb or two-thumb range selection — public `Slider` wraps Field.Root; pass `label` / `description` / `error` like Textfield</do>
|
|
4
|
+
<do>Show the live value with `renderValue` (`true` for default Text formatting, or a function that owns the value slot)</do>
|
|
5
|
+
<do>Min/max captions under a labeled Slider — sibling Text in a Stack row (`hAlign="space-between"`); do not invent track length CSS</do>
|
|
6
|
+
<do>External label beside the track — Stack `direction="row"` `expandChildren` + labeled Text + Slider with `aria-label` / `thumbAriaLabel`</do>
|
|
7
|
+
<do>Bracketed continuum — Text endcaps with `data-shrink={false}` and Slider filling the middle via parent Stack</do>
|
|
8
|
+
<do>Vertical bands — `orientation="vertical"` inside a sized Stack host (`blockSize` / flex grow); band name as sibling Text</do>
|
|
9
|
+
<dont>Fixed pixel track lengths — Slider fills its container; grow via Stack `expandChildren` or a sized host</dont>
|
|
10
|
+
<dont>Custom size or variant props — single medium treatment</dont>
|
|
11
|
+
<dont>Leaving thumbs unnamed when `label` is omitted — pass `thumbAriaLabel` (and usually `aria-label`)</dont>
|
|
12
|
+
<dont>Overriding Slider Indicator position in CSS</dont>
|
|
13
|
+
<dont>Reassembling internal Control/Value parts — use the public `Slider` export only</dont>
|
|
8
14
|
</usage>
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="spinner">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: viraui-app/components + preview-grid — cleaned (no handlers, no app-only chrome). -->
|
|
4
|
+
|
|
5
|
+
<example title="Inline search status (autocomplete)">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Stack columnGap="s" direction="row" vAlign="center">
|
|
8
|
+
<Spinner aria-hidden size="s" />
|
|
9
|
+
<Text size="xs" tone="muted">
|
|
10
|
+
Searching help center…
|
|
11
|
+
</Text>
|
|
12
|
+
</Stack>
|
|
13
|
+
]]></tsx>
|
|
14
|
+
<notes>From preview-grid `autocomplete-search` help-field `status`. Spinner is decorative (`aria-hidden`); visible text (or parent Autocomplete status) announces progress.</notes>
|
|
15
|
+
</example>
|
|
16
|
+
|
|
17
|
+
<example title="Chip end addon (deploying)">
|
|
18
|
+
<tsx><![CDATA[
|
|
19
|
+
<Chip addon={<Spinner size="s" />} addonPosition="end" variant="blue">
|
|
20
|
+
Deploying
|
|
21
|
+
</Chip>
|
|
22
|
+
]]></tsx>
|
|
23
|
+
<notes>From preview-grid `environment-variables` deploy statuses. Small Spinner as Chip addon; Chip label carries the accessible name.</notes>
|
|
24
|
+
</example>
|
|
25
|
+
|
|
26
|
+
<example title="Footer status with Shimmer copy">
|
|
27
|
+
<tsx><![CDATA[
|
|
28
|
+
<Surface color={2} hPadding="l" vPadding="m">
|
|
29
|
+
<Stack direction="row" vAlign="center" hAlign="start" columnGap="s">
|
|
30
|
+
<Spinner variant="dot-grid" size="s" aria-hidden />
|
|
31
|
+
<Text tone="muted" size="s">
|
|
32
|
+
<Shimmer>You have not met your targets yet.</Shimmer>
|
|
33
|
+
</Text>
|
|
34
|
+
</Stack>
|
|
35
|
+
</Surface>
|
|
36
|
+
]]></tsx>
|
|
37
|
+
<notes>From preview-grid `savings-targets` footer. Pair `variant="dot-grid"` with muted Shimmer text. Region/parent owns busy semantics — not the Spinner.</notes>
|
|
6
38
|
</example>
|
|
7
39
|
</patterns>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<prop name="variant" kind="react">
|
|
19
19
|
<description>Visual animation style.</description>
|
|
20
20
|
</prop>
|
|
21
|
-
<
|
|
21
|
+
<prop name="size" kind="css">
|
|
22
22
|
<description>Spinner glyph size on the root.</description>
|
|
23
|
-
</
|
|
23
|
+
</prop>
|
|
24
24
|
</props>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="spinner">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<
|
|
7
|
-
<dont>
|
|
3
|
+
<do>Button / IconButton async chrome: set `loading` on the control — it owns the Spinner overlay, width lock, and `aria-busy`</do>
|
|
4
|
+
<do>Standalone status: Stack row with Spinner `aria-hidden` + visible Text (or Autocomplete status) that names the work</do>
|
|
5
|
+
<do>Chip in-progress affordance: small Spinner as Chip `addon` (`addonPosition="end"`) — Chip label stays the accessible name</do>
|
|
6
|
+
<do>Pair `variant="dot-grid"` or `bars` / `dots` with muted Text / Shimmer in Surface footers when the parent region owns busy semantics</do>
|
|
7
|
+
<dont>Nesting a manual Spinner inside Button / IconButton when `loading` already injects one</dont>
|
|
8
|
+
<dont>Using Spinner alone as the only page-level loading announcement</dont>
|
|
9
|
+
<dont>Omitting `aria-hidden` on decorative standalone Spinners — the component does not hide itself</dont>
|
|
10
|
+
<dont>Expecting Spinner to expose accessible status without parent `aria-busy` or visible status text</dont>
|
|
8
11
|
</usage>
|
|
@@ -1,7 +1,363 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="stack">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: viraui-app/components — cleaned (no handlers, no app-only chrome, no CSS that reinvents Stack props). -->
|
|
4
|
+
|
|
5
|
+
<example title="App header (hub)">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Stack
|
|
8
|
+
render={<header />}
|
|
9
|
+
direction="row"
|
|
10
|
+
vAlign="center"
|
|
11
|
+
hAlign="space-between"
|
|
12
|
+
hPadding="m"
|
|
13
|
+
vPadding="m"
|
|
14
|
+
columnGap="s"
|
|
15
|
+
>
|
|
16
|
+
<Stack direction="row" vAlign="center" columnGap="s">
|
|
17
|
+
{/* brand / logo */}
|
|
18
|
+
</Stack>
|
|
19
|
+
|
|
20
|
+
<Surface hPadding="xs" vPadding="xs" radius="m" border="all" data-vibrant>
|
|
21
|
+
<Surface radius="auto" color={1} hPadding="xs" vPadding="xs">
|
|
22
|
+
<Stack render={<nav />} direction="row" vAlign="center" columnGap="xs">
|
|
23
|
+
<ButtonLink size="s" variant="secondary" href="/hub">
|
|
24
|
+
Hub
|
|
25
|
+
</ButtonLink>
|
|
26
|
+
<ButtonLink size="s" variant="flat" href="/studio">
|
|
27
|
+
Studio
|
|
28
|
+
</ButtonLink>
|
|
29
|
+
<ButtonLink size="s" variant="flat" href="/prompts">
|
|
30
|
+
Prompts
|
|
31
|
+
</ButtonLink>
|
|
32
|
+
</Stack>
|
|
33
|
+
</Surface>
|
|
34
|
+
</Surface>
|
|
35
|
+
|
|
36
|
+
<Stack direction="row" vAlign="center" columnGap="s">
|
|
37
|
+
<Button size="s" variant="secondary">
|
|
38
|
+
Sign out
|
|
39
|
+
</Button>
|
|
40
|
+
</Stack>
|
|
41
|
+
</Stack>
|
|
42
|
+
]]></tsx>
|
|
43
|
+
<notes>From `common/hub-header` (+ `hub-nav`). Row `space-between` + nested row clusters. Nav lives in Surface chrome; Stack owns flex/gap. No custom CSS.</notes>
|
|
44
|
+
</example>
|
|
45
|
+
|
|
46
|
+
<example title="Inline form row (login)">
|
|
47
|
+
<tsx><![CDATA[
|
|
48
|
+
<form>
|
|
49
|
+
<Stack direction="row" columnGap="m" rowGap="m" hAlign="start" vAlign="start" wrap>
|
|
50
|
+
<Textfield type="email" placeholder="your@email.com" size={30} aria-label="Email" />
|
|
51
|
+
<Stack direction="row" vAlign="center" columnGap="m">
|
|
52
|
+
<Button type="submit">Send magic link</Button>
|
|
53
|
+
or
|
|
54
|
+
<ButtonLink variant="secondary" href="#">
|
|
55
|
+
Get ViraUI Pro
|
|
56
|
+
</ButtonLink>
|
|
57
|
+
</Stack>
|
|
58
|
+
</Stack>
|
|
59
|
+
</form>
|
|
60
|
+
]]></tsx>
|
|
61
|
+
<notes>From `auth/login-form`. Wrap row for field + CTA cluster. Pure Stack props — no module CSS.</notes>
|
|
62
|
+
</example>
|
|
63
|
+
|
|
64
|
+
<example title="Auth panel copy + form slot">
|
|
65
|
+
<tsx><![CDATA[
|
|
66
|
+
<Stack
|
|
67
|
+
render={<section />}
|
|
68
|
+
hPadding="2xl"
|
|
69
|
+
vPadding="l"
|
|
70
|
+
hAlign="start"
|
|
71
|
+
expandChildren
|
|
72
|
+
>
|
|
73
|
+
{/* brand */}
|
|
74
|
+
<Stack rowGap="xl" vAlign="center">
|
|
75
|
+
<Stack vPadding={[0, 'l']} rowGap="xl">
|
|
76
|
+
<Title size="1" render={<h1 />} maxWidth="32rem" lineHeight="s">
|
|
77
|
+
Design systems that ship
|
|
78
|
+
</Title>
|
|
79
|
+
<Text size="2xl" tone="muted" maxWidth="32rem">
|
|
80
|
+
Sign in to continue to the studio.
|
|
81
|
+
</Text>
|
|
82
|
+
</Stack>
|
|
83
|
+
{/* form */}
|
|
84
|
+
</Stack>
|
|
85
|
+
{/* footer chrome */}
|
|
86
|
+
</Stack>
|
|
87
|
+
]]></tsx>
|
|
88
|
+
<notes>From `auth/login-view` panel Stack. Layout/spacing via props; app keeps `min-block-size` / scroll on a module class — not flex/gap. Drop viewport grid shell from this hint.</notes>
|
|
89
|
+
</example>
|
|
90
|
+
|
|
91
|
+
<example title="Document shell (header + grow body)">
|
|
92
|
+
<tsx><![CDATA[
|
|
93
|
+
<Stack>
|
|
94
|
+
<Stack>
|
|
95
|
+
{/* header */}
|
|
96
|
+
<Separator variant="dashed" size="m" />
|
|
97
|
+
</Stack>
|
|
98
|
+
<Stack data-grow="true" expandChildren>
|
|
99
|
+
{/* page content */}
|
|
100
|
+
</Stack>
|
|
101
|
+
</Stack>
|
|
102
|
+
]]></tsx>
|
|
103
|
+
<notes>From `layout/document-shell`. `expandChildren` + `data-grow` grow the body. Sticky / `100dvh` stay in CSS if needed — never reinvent flex or gap there.</notes>
|
|
104
|
+
</example>
|
|
105
|
+
|
|
106
|
+
<example title="Sidebar section">
|
|
107
|
+
<tsx><![CDATA[
|
|
108
|
+
<Stack hPadding="m">
|
|
109
|
+
<Surface color={2} hoverColor={3} radius="m" vPadding="s">
|
|
110
|
+
<Stack rowGap="s" hPadding="m" vPadding={[0, 's']}>
|
|
111
|
+
<Stack direction="row" vAlign="center" hAlign="space-between" columnGap="s">
|
|
112
|
+
<Stack direction="row" vAlign="center" columnGap="s">
|
|
113
|
+
{/* section icon */}
|
|
114
|
+
<Text size="xs" weight="semibold">
|
|
115
|
+
Colors
|
|
116
|
+
</Text>
|
|
117
|
+
</Stack>
|
|
118
|
+
{/* trailing addon */}
|
|
119
|
+
</Stack>
|
|
120
|
+
<Text tone="muted" size="s">
|
|
121
|
+
Brand seed and highlight scales.
|
|
122
|
+
</Text>
|
|
123
|
+
</Stack>
|
|
124
|
+
<Stack rowGap="m" hPadding="s" vPadding="xs">
|
|
125
|
+
{/* controls */}
|
|
126
|
+
</Stack>
|
|
127
|
+
</Surface>
|
|
128
|
+
</Stack>
|
|
129
|
+
]]></tsx>
|
|
130
|
+
<notes>From `editor/sidebar/sidebar-section`. Header row + muted description + body stack. Optional `min-block-size` on header only — not gap/padding CSS.</notes>
|
|
131
|
+
</example>
|
|
132
|
+
|
|
133
|
+
<example title="Dialog form (import)">
|
|
134
|
+
<tsx><![CDATA[
|
|
135
|
+
<Dialog.Sheet title="Import preset" description="Paste preset code." showCloseButton headerAlign="center">
|
|
136
|
+
<Stack rowGap="m" hAlign="center" hPadding="m" vPadding={['s', 0]}>
|
|
137
|
+
<Textfield size={40} placeholder="Paste preset…" aria-label="Preset code" />
|
|
138
|
+
<Stack direction="row" hAlign="end" columnGap="s">
|
|
139
|
+
<Button>Apply</Button>
|
|
140
|
+
<Dialog.Close render={<Button variant="secondary">Cancel</Button>} />
|
|
141
|
+
</Stack>
|
|
142
|
+
</Stack>
|
|
143
|
+
</Dialog.Sheet>
|
|
144
|
+
]]></tsx>
|
|
145
|
+
<notes>From `editor/import-preset-dialog`. Centered column + trailing action row. No CSS.</notes>
|
|
146
|
+
</example>
|
|
147
|
+
|
|
148
|
+
<example title="Dialog action strip (export)">
|
|
149
|
+
<tsx><![CDATA[
|
|
150
|
+
<Stack rowGap="m" hPadding="m" vPadding={['s', 0]}>
|
|
151
|
+
<Stack direction="row" hAlign="center" columnGap="m">
|
|
152
|
+
<Button size="l">Download</Button>
|
|
153
|
+
<ButtonLink size="l" variant="secondary" href="#">
|
|
154
|
+
Share
|
|
155
|
+
</ButtonLink>
|
|
156
|
+
<Button size="l" variant="secondary">
|
|
157
|
+
View code
|
|
158
|
+
</Button>
|
|
159
|
+
</Stack>
|
|
160
|
+
{/* optional preview / tabs below */}
|
|
161
|
+
</Stack>
|
|
162
|
+
]]></tsx>
|
|
163
|
+
<notes>From `editor/export-dialog` body. Centered equal-feeling action row via Stack alignment + gap — not per-button width CSS.</notes>
|
|
164
|
+
</example>
|
|
165
|
+
|
|
166
|
+
<example title="Toolbar chip (canvas zoom)">
|
|
167
|
+
<tsx><![CDATA[
|
|
168
|
+
<Surface color={1} border="all" radius="m" vPadding="2xs" hPadding="2xs">
|
|
169
|
+
<Stack direction="row" vAlign="center">
|
|
170
|
+
<IconButton aria-label="Zoom out" icon={<Minus />} variant="flat" />
|
|
171
|
+
<IconButton aria-label="Reset zoom" icon={<FocusCenter />} variant="flat" />
|
|
172
|
+
<IconButton aria-label="Zoom in" icon={<Plus />} variant="flat" />
|
|
173
|
+
</Stack>
|
|
174
|
+
</Surface>
|
|
175
|
+
]]></tsx>
|
|
176
|
+
<notes>From `editor/canvas/canvas-zoom`. Dense IconButton row inside Surface. Absolute overlay position is shell CSS — Stack only owns the row.</notes>
|
|
177
|
+
</example>
|
|
178
|
+
|
|
179
|
+
<example title="Empty / info state">
|
|
180
|
+
<tsx><![CDATA[
|
|
181
|
+
<Stack hAlign="center" vAlign="center" rowGap="l" render={<div role="status" />}>
|
|
182
|
+
<Surface color={1} border="all" hPadding="m" vPadding="m" radius="full">
|
|
183
|
+
{/* icon */}
|
|
184
|
+
</Surface>
|
|
185
|
+
<Stack hAlign="center" maxWidth="36ch" rowGap="s">
|
|
186
|
+
<Title align="center" render={<h2 />} size="3">
|
|
187
|
+
No prompts yet
|
|
188
|
+
</Title>
|
|
189
|
+
<Text align="center" render={<p />} maxWidth="28ch" tone="muted">
|
|
190
|
+
Generate or import a prompt to get started.
|
|
191
|
+
</Text>
|
|
192
|
+
</Stack>
|
|
193
|
+
</Stack>
|
|
194
|
+
]]></tsx>
|
|
195
|
+
<notes>From `prompts/prompts-info-state` foreground. Centered column + capped text stack. Drop decorative backdrop Grid/absolute CSS from this hint — that is shell, not Stack layout.</notes>
|
|
196
|
+
</example>
|
|
197
|
+
|
|
198
|
+
<example title="Empty team card">
|
|
199
|
+
<tsx><![CDATA[
|
|
200
|
+
<Surface border="all" color={1} radius="l" hPadding="m" vPadding="m">
|
|
201
|
+
<Stack
|
|
202
|
+
rowGap="m"
|
|
203
|
+
hPadding="l"
|
|
204
|
+
vPadding="2xl"
|
|
205
|
+
hAlign="center"
|
|
206
|
+
render={<Surface border="all" borderStyle="dashed" radius="l" />}
|
|
207
|
+
>
|
|
208
|
+
<AvatarGroup
|
|
209
|
+
avatars={[
|
|
210
|
+
{ alt: '', fallback: 'AL' },
|
|
211
|
+
{ alt: '', fallback: 'MR' },
|
|
212
|
+
{ alt: '', fallback: 'EV' },
|
|
213
|
+
]}
|
|
214
|
+
size="m"
|
|
215
|
+
/>
|
|
216
|
+
<Title align="center" size="5" render={<h3 />}>
|
|
217
|
+
No Team Members
|
|
218
|
+
</Title>
|
|
219
|
+
<Text size="s" align="center" maxWidth="14rem" tone="muted">
|
|
220
|
+
Invite your team to collaborate on this project.
|
|
221
|
+
</Text>
|
|
222
|
+
<Button>Invite Members</Button>
|
|
223
|
+
</Stack>
|
|
224
|
+
</Surface>
|
|
225
|
+
]]></tsx>
|
|
226
|
+
<notes>From `editor/preview-grid/blocks/empty-team`. Replaced inline dashed `style` with `Stack render={<Surface borderStyle="dashed" …/>}`. Drop Annotate/Badge kitchen chrome.</notes>
|
|
227
|
+
</example>
|
|
228
|
+
|
|
229
|
+
<example title="Preferences panel">
|
|
230
|
+
<tsx><![CDATA[
|
|
231
|
+
<Surface overflow="hidden" border="all" color={1} radius="l">
|
|
232
|
+
<Stack rowGap="m">
|
|
233
|
+
<Stack rowGap="m" hPadding="m" vPadding="m">
|
|
234
|
+
<Stack columnGap="s" direction="row" hAlign="space-between" vAlign="start">
|
|
235
|
+
<Stack rowGap="xs">
|
|
236
|
+
<Title size="6" render={<h2 />}>
|
|
237
|
+
Preferences
|
|
238
|
+
</Title>
|
|
239
|
+
<Text size="s" maxWidth="18rem" tone="muted">
|
|
240
|
+
Manage your account settings and notifications.
|
|
241
|
+
</Text>
|
|
242
|
+
</Stack>
|
|
243
|
+
<IconButton aria-label="Close" icon={<Xmark />} size="s" variant="secondary" />
|
|
244
|
+
</Stack>
|
|
245
|
+
|
|
246
|
+
<Select label="Default Currency" value="usd">
|
|
247
|
+
<Select.Option value="usd">United States Dollar</Select.Option>
|
|
248
|
+
<Select.Option value="eur">Euro</Select.Option>
|
|
249
|
+
</Select>
|
|
250
|
+
|
|
251
|
+
<Surface vPadding="m">
|
|
252
|
+
<Switch label="Public Statistics" description="Allow others to see activity" />
|
|
253
|
+
</Surface>
|
|
254
|
+
<Surface vPadding="m">
|
|
255
|
+
<Switch label="Email Notifications" description="Monthly reports and updates" />
|
|
256
|
+
</Surface>
|
|
257
|
+
</Stack>
|
|
258
|
+
|
|
259
|
+
<Surface color={2} hPadding="l" vPadding="m">
|
|
260
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
|
|
261
|
+
<Button variant="secondary">Reset</Button>
|
|
262
|
+
<Button>Save Preferences</Button>
|
|
263
|
+
</Stack>
|
|
264
|
+
</Surface>
|
|
265
|
+
</Stack>
|
|
266
|
+
</Surface>
|
|
267
|
+
]]></tsx>
|
|
268
|
+
<notes>From `editor/preview-grid/blocks/preferences`. Header row + stacked controls + footer action row. Prefer Surface `overflow` prop over inline `style`.</notes>
|
|
269
|
+
</example>
|
|
270
|
+
|
|
271
|
+
<example title="Form panel (payout threshold)">
|
|
272
|
+
<tsx><![CDATA[
|
|
273
|
+
<Surface border="all" color={1} radius="l" hPadding="s" vPadding="s">
|
|
274
|
+
<Stack rowGap="l" hPadding="s" vPadding="s">
|
|
275
|
+
<Stack rowGap="xs">
|
|
276
|
+
<Title size="6" render={<h2 />}>
|
|
277
|
+
Payout Threshold
|
|
278
|
+
</Title>
|
|
279
|
+
<Text tone="muted" size="s">
|
|
280
|
+
Set the minimum balance required before a payout is triggered.
|
|
281
|
+
</Text>
|
|
282
|
+
</Stack>
|
|
283
|
+
|
|
284
|
+
<Select label="Preferred Currency" value="usd">
|
|
285
|
+
<Select.Option value="usd">United States Dollar</Select.Option>
|
|
286
|
+
<Select.Option value="eur">Euro</Select.Option>
|
|
287
|
+
</Select>
|
|
288
|
+
|
|
289
|
+
<Stack rowGap="m">
|
|
290
|
+
<Slider label="Minimum Payout Amount" min={50} max={10000} step={50} value={2500} />
|
|
291
|
+
<Stack columnGap="s" direction="row" hAlign="space-between" vAlign="center">
|
|
292
|
+
<Text family="mono" size="xs" tone="muted">
|
|
293
|
+
$50 (MIN)
|
|
294
|
+
</Text>
|
|
295
|
+
<Text family="mono" size="xs" tone="muted">
|
|
296
|
+
$10,000 (MAX)
|
|
297
|
+
</Text>
|
|
298
|
+
</Stack>
|
|
299
|
+
</Stack>
|
|
300
|
+
|
|
301
|
+
<Textarea label="Notes" rows={4} resize="vertical" fitContent />
|
|
302
|
+
<Button variant="secondary">Save Threshold</Button>
|
|
303
|
+
</Stack>
|
|
304
|
+
</Surface>
|
|
305
|
+
]]></tsx>
|
|
306
|
+
<notes>From `editor/preview-grid/blocks/payout-threshold`. Nested Stacks for section gaps + min/max caption row. No custom layout CSS.</notes>
|
|
307
|
+
</example>
|
|
308
|
+
|
|
309
|
+
<example title="Directory list row">
|
|
310
|
+
<tsx><![CDATA[
|
|
311
|
+
<Surface color={2} radius="m" hPadding="m" vPadding="m">
|
|
312
|
+
<Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
|
|
313
|
+
<Stack columnGap="m" direction="row" vAlign="center">
|
|
314
|
+
<Avatar alt="Sarah Chen" fallback="SC" size="s" />
|
|
315
|
+
<Stack rowGap="xs">
|
|
316
|
+
<Text weight="semibold">Sarah Chen</Text>
|
|
317
|
+
<Text size="s" tone="muted">
|
|
318
|
+
Product Design
|
|
319
|
+
</Text>
|
|
320
|
+
</Stack>
|
|
321
|
+
</Stack>
|
|
322
|
+
<Button size="s" variant="secondary">
|
|
323
|
+
Details
|
|
324
|
+
</Button>
|
|
325
|
+
</Stack>
|
|
326
|
+
</Surface>
|
|
327
|
+
]]></tsx>
|
|
328
|
+
<notes>From `editor/preview-grid/blocks/team-directory` row. Leading media + text column + trailing action — all Stack spacing/align.</notes>
|
|
329
|
+
</example>
|
|
330
|
+
|
|
331
|
+
<example title="Equal-width field pair (shipping)">
|
|
332
|
+
<tsx><![CDATA[
|
|
333
|
+
<Stack rowGap="l" hPadding="m" vPadding="m">
|
|
334
|
+
<Stack rowGap="xs">
|
|
335
|
+
<Title size="6" render={<h2 />}>
|
|
336
|
+
Shipping Address
|
|
337
|
+
</Title>
|
|
338
|
+
<Text size="s" tone="muted">
|
|
339
|
+
Where should we deliver?
|
|
340
|
+
</Text>
|
|
341
|
+
</Stack>
|
|
342
|
+
|
|
343
|
+
<Textfield label="Street address" required />
|
|
344
|
+
<Textfield label="Apt / Suite" />
|
|
345
|
+
|
|
346
|
+
<Stack columnGap="m" direction="row" expandChildren>
|
|
347
|
+
<Textfield label="City" />
|
|
348
|
+
<Select label="State" value="california">
|
|
349
|
+
<Select.Option value="california">California</Select.Option>
|
|
350
|
+
</Select>
|
|
351
|
+
</Stack>
|
|
352
|
+
|
|
353
|
+
<Stack columnGap="m" direction="row" expandChildren>
|
|
354
|
+
<Textfield label="ZIP Code" />
|
|
355
|
+
<Select label="Country" value="united-states">
|
|
356
|
+
<Select.Option value="united-states">United States</Select.Option>
|
|
357
|
+
</Select>
|
|
358
|
+
</Stack>
|
|
359
|
+
</Stack>
|
|
360
|
+
]]></tsx>
|
|
361
|
+
<notes>From `editor/preview-grid/blocks/shipping-address`. `expandChildren` on row Stacks shares width across field pairs — do not invent per-field `flex`/`width` CSS.</notes>
|
|
6
362
|
</example>
|
|
7
363
|
</patterns>
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
<item>Custom native root through render while keeping data-stack hooks</item>
|
|
7
7
|
<item>Style descendants with `@container stack` queries when layout, gap, or typography should respond to the Stack's own inline-size instead of the viewport (set `enableContainer` on the Stack you're querying)</item>
|
|
8
8
|
<item>Centered max-width shells: parent `hAlign="center"` + child `fullWidth` + `maxWidth`</item>
|
|
9
|
+
<item>Full-bleed or equal-width action clusters (Buttons, etc.): `fullWidth` and/or `expandChildren` instead of per-child width CSS</item>
|
|
9
10
|
</when_to_use>
|
|
10
11
|
<when_not_to_use>
|
|
11
12
|
<item>Cases where a single component already owns required flex chrome</item>
|
|
12
13
|
<item>Expecting direct children to grow on the main axis without setting `expandChildren`</item>
|
|
13
14
|
<item>Expecting this stack to fill parent inline size under non-stretch alignment without `fullWidth` (or an explicit `inlineSize`)</item>
|
|
15
|
+
<item>Inventing `width: 100%` / `w-full` on content-sized children (Button, Chip, …) when this Stack can own fill via `fullWidth` / `expandChildren`</item>
|
|
14
16
|
<item>Using `enableContainer` inside complex masonry-like layouts when you don't need container queries (inline-size containment can change nested layout)</item>
|
|
15
17
|
</when_not_to_use>
|
|
16
18
|
<prop name="columnGap" kind="react">
|
|
@@ -23,10 +25,10 @@
|
|
|
23
25
|
<description>Renders children across rows or columns using the chosen flex direction.</description>
|
|
24
26
|
</prop>
|
|
25
27
|
<prop name="expandChildren" kind="react">
|
|
26
|
-
<description>Makes direct children grow along the flex main axis (`flex-grow`). Default `false`. Orthogonal to `fullWidth` (children grow vs this root's inline size). A child opts out with its own `data-grow="false"`; ancestor `data-grow` does not inherit into nested stacks.</description>
|
|
28
|
+
<description>Makes direct children grow along the flex main axis (`flex-grow`). Default `false`. Use for equal-width row actions (Buttons, etc.) instead of inventing `width`/`flex` CSS on each child. Orthogonal to `fullWidth` (children grow vs this root's inline size). A child opts out with its own `data-grow="false"`; ancestor `data-grow` does not inherit into nested stacks.</description>
|
|
27
29
|
</prop>
|
|
28
30
|
<prop name="fullWidth" kind="react">
|
|
29
|
-
<description>Sets `inline-size: 100%` on the stack root so it fills the parent's inline size. Default `false`. Use with `maxWidth` under a parent `hAlign="center"` for a fluid capped centered shell. Does not grow children — use `expandChildren` for that.</description>
|
|
31
|
+
<description>Sets `inline-size: 100%` on the stack root so it fills the parent's inline size. Default `false`. Prefer this (plus cross-axis stretch) so content-sized children like Button span a panel — do not add `width: 100%` CSS on those children. Use with `maxWidth` under a parent `hAlign="center"` for a fluid capped centered shell. Does not grow children — use `expandChildren` for that.</description>
|
|
30
32
|
</prop>
|
|
31
33
|
<prop name="hAlign" kind="react">
|
|
32
34
|
<description>Aligns content on the horizontal axis from the consumer point of view.</description>
|
|
@@ -61,34 +63,34 @@
|
|
|
61
63
|
<prop name="wrap" kind="react">
|
|
62
64
|
<description>Allows direct children to wrap onto additional lines when space is constrained.</description>
|
|
63
65
|
</prop>
|
|
64
|
-
<
|
|
66
|
+
<prop name="column-gap" kind="css">
|
|
65
67
|
<description>Flex column gap on the root.</description>
|
|
66
|
-
</
|
|
67
|
-
<
|
|
68
|
+
</prop>
|
|
69
|
+
<prop name="h-align" kind="css">
|
|
68
70
|
<description>Logical horizontal flex alignment hook.</description>
|
|
69
|
-
</
|
|
70
|
-
<
|
|
71
|
+
</prop>
|
|
72
|
+
<prop name="max-width" kind="css">
|
|
71
73
|
<description>Max inline size of the stack root.</description>
|
|
72
|
-
</
|
|
73
|
-
<
|
|
74
|
+
</prop>
|
|
75
|
+
<prop name="min-width" kind="css">
|
|
74
76
|
<description>Min inline size of the stack root.</description>
|
|
75
|
-
</
|
|
76
|
-
<
|
|
77
|
+
</prop>
|
|
78
|
+
<prop name="padding-block-end" kind="css">
|
|
77
79
|
<description>Block-end padding when padding is enabled.</description>
|
|
78
|
-
</
|
|
79
|
-
<
|
|
80
|
+
</prop>
|
|
81
|
+
<prop name="padding-block-start" kind="css">
|
|
80
82
|
<description>Block-start padding when padding is enabled.</description>
|
|
81
|
-
</
|
|
82
|
-
<
|
|
83
|
+
</prop>
|
|
84
|
+
<prop name="padding-inline-end" kind="css">
|
|
83
85
|
<description>Inline-end padding when padding is enabled.</description>
|
|
84
|
-
</
|
|
85
|
-
<
|
|
86
|
+
</prop>
|
|
87
|
+
<prop name="padding-inline-start" kind="css">
|
|
86
88
|
<description>Inline-start padding when padding is enabled.</description>
|
|
87
|
-
</
|
|
88
|
-
<
|
|
89
|
+
</prop>
|
|
90
|
+
<prop name="row-gap" kind="css">
|
|
89
91
|
<description>Flex row gap on the root.</description>
|
|
90
|
-
</
|
|
91
|
-
<
|
|
92
|
+
</prop>
|
|
93
|
+
<prop name="v-align" kind="css">
|
|
92
94
|
<description>Logical vertical flex alignment hook.</description>
|
|
93
|
-
</
|
|
95
|
+
</prop>
|
|
94
96
|
</props>
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="stack">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<do>
|
|
7
|
-
<do>
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
<dont>
|
|
12
|
-
<dont>
|
|
3
|
+
<do>Default structural box instead of a bare wrapper `div` — Stack owns flex + token gap/padding/align/`fullWidth`/`render`</do>
|
|
4
|
+
<do>Login/signup (or similar auth swap): host Tabs + Textfield(s) + Button (+ optional Fieldset) inside a Stack or `Stack render={<Surface … />}` shell — props only, 0 custom CSS</do>
|
|
5
|
+
<do>Flex + Surface chrome on one node via `render={<Surface … />}` — prefer over a CSS border class or an extra wrapper (see package pattern `stack-as-surface`)</do>
|
|
6
|
+
<do>Equal-width action or field clusters (Button, Chip, Textfield): `fullWidth` and/or `expandChildren` on this Stack — never per-child width CSS</do>
|
|
7
|
+
<do>Settings rows: Stack `direction="row"` + Text (label/description column) + Switch or Checkbox — nest in Surface for panel chrome</do>
|
|
8
|
+
<do>Centered capped shells: parent `hAlign="center"` + child Stack `fullWidth` + `maxWidth`</do>
|
|
9
|
+
<do>Semantic/native roots via `render` (`header`, `main`, `nav`, `section`, …) while keeping Stack as the layout engine</do>
|
|
10
|
+
<do>Opt into `@container stack` with `enableContainer` when layout should follow this Stack's inline-size, not the viewport</do>
|
|
11
|
+
<dont>Reaching for a plain wrapper `div` when Stack (optionally with `render` for a semantic tag) can own the box</dont>
|
|
12
|
+
<dont>Assuming Stack expands direct children by default — pass `expandChildren` when children should grow on the flex main axis</dont>
|
|
13
|
+
<dont>Using `expandChildren` to fill parent width under `hAlign="center"` — that is `fullWidth` on the child Stack (self `inline-size`), not child flex-grow</dont>
|
|
14
|
+
<dont>Inventing `width: 100%` / `w-full` / `.fullWidth` CSS on content-sized children when this Stack can own the fill</dont>
|
|
15
|
+
<dont>Inventing CSS `gap` / `padding` on this root when public spacing props cover it</dont>
|
|
16
|
+
<dont>Putting `data-grow="false"` on an ancestor to control nested `expandChildren` — set it on the child that should not grow</dont>
|
|
13
17
|
<dont>Combining `fullWidth` with `inline` — prefer block flex when the root must fill parent inline size</dont>
|
|
18
|
+
<dont>Using viewport media queries when `@container stack` against this Stack's inline-size matches the design intent</dont>
|
|
19
|
+
<dont>Wrapping Fieldset.Root in Stack `render` — breaks Base UI render merge with RadioGroup / CheckboxGroup</dont>
|
|
14
20
|
</usage>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<meta id="static-noise" title="StaticNoise" category="effect" shared_contract="static-noise">
|
|
3
|
-
<summary>Decorative SVG turbulence noise overlay for textured surfaces and hero sections. Memory-heavy — use sparingly
|
|
3
|
+
<summary>Decorative SVG turbulence noise overlay for textured surfaces and hero sections. Memory-heavy — use sparingly; prefer one focal instance per view.</summary>
|
|
4
4
|
<exports>
|
|
5
5
|
<export name="StaticNoise" />
|
|
6
6
|
</exports>
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<patterns surface="static-noise">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<!-- Sources: packages/react/src/components/static-noise/static-noise.stories.tsx — cleaned (no gradient demo frame). -->
|
|
4
|
+
|
|
5
|
+
<example title="Grain on vibrant Surface">
|
|
6
|
+
<tsx><![CDATA[
|
|
7
|
+
<Surface
|
|
8
|
+
border="all"
|
|
9
|
+
radius="xl"
|
|
10
|
+
data-vibrant
|
|
11
|
+
style={{ position: 'relative', inlineSize: 'min(22rem, 100%)' }}
|
|
12
|
+
>
|
|
13
|
+
<Stack expandChildren hPadding="l" vPadding="l" rowGap="m">
|
|
14
|
+
<Title size="2" render={<h3 />}>
|
|
15
|
+
Atmospheric card
|
|
16
|
+
</Title>
|
|
17
|
+
<Text>Static noise adds subtle grain without affecting layout semantics.</Text>
|
|
18
|
+
</Stack>
|
|
19
|
+
<StaticNoise style={{ position: 'absolute', inset: 0, zIndex: 10 }} />
|
|
20
|
+
</Surface>
|
|
21
|
+
]]></tsx>
|
|
22
|
+
<notes>From `SurfaceOverlay`. Parent owns positioning (`relative` + absolute overlay). `StaticNoise` is decorative (`aria-hidden`); keep instances few.</notes>
|
|
6
23
|
</example>
|
|
7
24
|
</patterns>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="static-noise">
|
|
3
|
-
<do>
|
|
4
|
-
<do>
|
|
5
|
-
<do>
|
|
6
|
-
<dont>Treating StaticNoise as cheap wallpaper
|
|
3
|
+
<do>Absolute overlay on a Surface (often `data-vibrant`) whose parent owns `position: relative` / inset / z-index — nest Title/Text in a Stack underneath for real content</do>
|
|
4
|
+
<do>Subtle grain on a focal card, panel, or hero — StaticNoise is decorative atmosphere, not chrome</do>
|
|
5
|
+
<do>Use sparingly — SVG turbulence is memory-heavy; prefer one focal overlay per view</do>
|
|
6
|
+
<dont>Treating StaticNoise as cheap wallpaper on every card</dont>
|
|
7
7
|
<dont>Stacking many full-viewport StaticNoise instances on one screen</dont>
|
|
8
8
|
<dont>Using StaticNoise as the only loading announcement for a page</dont>
|
|
9
|
-
<dont>
|
|
9
|
+
<dont>Expecting StaticNoise to own layout sizing or positioning — parent Surface/Stack owns the box</dont>
|
|
10
10
|
</usage>
|