@viraui/react 2026.6.0 → 2026.6.2
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/radio/radio-group.d.ts +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 +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 +9 -9
|
@@ -1,65 +1,142 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<modules>
|
|
3
|
-
<summary>
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<summary>What @viraui/react/preflight.css provides at runtime. Capability map for consumers and agents — not a source-tree inventory. Full attr contracts: attributes.xml; elevation compose: elevation.xml; effect gates: toggles.xml; theme token groups: theme-topics.xml.</summary>
|
|
4
|
+
|
|
5
|
+
<distributed>
|
|
6
|
+
<import>@viraui/react/preflight.css</import>
|
|
7
|
+
<layer>viraui.preflight (declared by the published entry; components use viraui.components; app overrides prefer viraui.overrides or unlayered CSS)</layer>
|
|
8
|
+
<prerequisite>Compatible theme CSS and consumer fonts must load before preflight. Order and providers: bootstrap.xml.</prerequisite>
|
|
9
|
+
</distributed>
|
|
10
|
+
|
|
11
|
+
<agent_rules>
|
|
12
|
+
<use>Import the single published preflight entry. Drive UI via documented data-* hooks, Elevator / getElevationProps, and theme tokens.</use>
|
|
13
|
+
<use>Open this unit to learn which preflight capability owns a behavior, then follow the linked foundation unit for values and when/when_not.</use>
|
|
14
|
+
<use>Consume surface="derived" tokens (e.g. --font-scale-*) with var(…); change them by overriding theme inputs (typescale), not by redefining the derived vars.</use>
|
|
15
|
+
<do_not>Patch, fork, or import individual files from inside the preflight bundle.</do_not>
|
|
16
|
+
<do_not>Invent data-* names or --__* vars. Public hooks live in attributes.xml / this map; internals are not app API.</do_not>
|
|
17
|
+
<do_not>Hand-roll box-shadow, backdrop-filter, or corner-shape when preflight + theme gates already cover the need.</do_not>
|
|
18
|
+
<do_not>Set surface="internal" custom properties from app markup or style.</do_not>
|
|
19
|
+
</agent_rules>
|
|
20
|
+
|
|
21
|
+
<module id="baseline">
|
|
22
|
+
<purpose>Root document baseline after theme load: rem root from --font-root-size, color/background from --global-*, polarity --is-light-mode, scrollbar and focus-visible ring, reduced-motion, corner-shape gate.</purpose>
|
|
23
|
+
<provides>--is-light-mode; focus ring via --outline*; scrollbar via --scrollbar-*; corner-shape application</provides>
|
|
24
|
+
<use>Theme tokens + data-mode. Query polarity with @container root style(--is-light-mode: black|white). Details: toggles.xml.</use>
|
|
25
|
+
<do_not>Replace preflight reset with a second framework reboot. Prefer omitting third-party preflight/reset (setup skill coexistence).</do_not>
|
|
6
26
|
</module>
|
|
7
|
-
<module id="
|
|
8
|
-
<purpose>
|
|
27
|
+
<module id="font-scale">
|
|
28
|
+
<purpose>Derives --font-scale-* from theme --font-heading-typescale / --font-body-typescale (pow + round). body-m = 1rem; smaller body steps floored; larger body and display from continuous powers.</purpose>
|
|
29
|
+
<provides>--font-scale-body-*, --font-scale-h*, --font-scale-display</provides>
|
|
30
|
+
<use>Read var(--font-scale-*) in components/app CSS. To change sizes, override typescale theme tokens (theme-topics.xml font-typescale).</use>
|
|
31
|
+
<do_not>Author --font-scale-* in theme CSS. Preflight owns derivation; theme ships ratios only.</do_not>
|
|
9
32
|
</module>
|
|
10
|
-
<module id="
|
|
11
|
-
<purpose>
|
|
33
|
+
<module id="modes">
|
|
34
|
+
<purpose>Runtime light / dark / inverted color-scheme via data-mode.</purpose>
|
|
35
|
+
<provides>data-mode</provides>
|
|
36
|
+
<use>Set on html, body, or a layout wrapper. Values and when/when_not: attributes.xml. Mode flag ≠ swapping brand theme sheets.</use>
|
|
37
|
+
<do_not>Use data-mode as a substitute for loading compatible theme CSS.</do_not>
|
|
12
38
|
</module>
|
|
13
|
-
<module id="
|
|
14
|
-
<purpose>
|
|
39
|
+
<module id="elevations">
|
|
40
|
+
<purpose>Theme-gated box-shadow depth stacks for raised surfaces (not z-index).</purpose>
|
|
41
|
+
<provides>data-elevation, data-elevation-hover, data-elevation-direction; --shadow-color, --extra-shadow, --elevation-transition-*</provides>
|
|
42
|
+
<use>Prefer Elevator or getElevationProps on React hosts; raw data-elevation* only when those do not fit. Full compose: elevation.xml. Gate: --effect-shadows (toggles.xml).</use>
|
|
43
|
+
<do_not>Hand-roll box-shadow. Do not expect elevation attrs to change stacking / z-index.</do_not>
|
|
15
44
|
</module>
|
|
16
|
-
<module id="
|
|
17
|
-
<purpose>
|
|
45
|
+
<module id="layout">
|
|
46
|
+
<purpose>Local flex grow/shrink signals for Stack and flex children.</purpose>
|
|
47
|
+
<provides>data-grow, data-shrink (drive --vira-flex-grow / --vira-flex-shrink; non-inheriting)</provides>
|
|
48
|
+
<use>Set data-grow / data-shrink on the flex child (attributes.xml). Stack expandChildren reads the grow signal.</use>
|
|
49
|
+
<do_not>Assign --vira-flex-grow / --vira-flex-shrink directly in app CSS — use the data-* attrs.</do_not>
|
|
18
50
|
</module>
|
|
19
|
-
<module id="
|
|
20
|
-
<purpose>
|
|
51
|
+
<module id="typography">
|
|
52
|
+
<purpose>Semantic HTML element typography defaults and link chrome opt-out.</purpose>
|
|
53
|
+
<provides>element type defaults; data-no-link-style</provides>
|
|
54
|
+
<use>Leave default prose links alone. Add data-no-link-style when component or custom link chrome must win (attributes.xml).</use>
|
|
55
|
+
<do_not>Fight preflight link styles without the opt-out attr.</do_not>
|
|
21
56
|
</module>
|
|
22
|
-
<module id="vibrancy"
|
|
23
|
-
<purpose>Theme-gated backdrop-filter
|
|
57
|
+
<module id="vibrancy">
|
|
58
|
+
<purpose>Theme-gated backdrop-filter glass on opt-in hosts.</purpose>
|
|
59
|
+
<provides>data-vibrant</provides>
|
|
60
|
+
<use>Set data-vibrant when --effect-vibrancy is on; still set a background fill as needed (Surface translucifies fill when present). Params: --vibrancy-* (theme-topics). Attr contract: attributes.xml.</use>
|
|
61
|
+
<do_not>Hand-roll backdrop-filter for the same effect.</do_not>
|
|
24
62
|
</module>
|
|
25
|
-
|
|
26
|
-
|
|
63
|
+
|
|
64
|
+
<custom_property name="--is-light-mode" surface="public">
|
|
65
|
+
<purpose>Theme polarity for @container root queries; data-mode="inverted" flips color-scheme against this value (black = light theme, white = dark theme).</purpose>
|
|
27
66
|
<default>black</default>
|
|
28
|
-
<set_by>
|
|
67
|
+
<set_by>Preflight on html from contrast-color(var(--global-background)); data-mode light/dark may force black/white</set_by>
|
|
68
|
+
<use>Branch with @container root style(--is-light-mode: black|white). Do not invent alternate light/dark hooks.</use>
|
|
29
69
|
</custom_property>
|
|
30
|
-
<custom_property name="--shadow-color">
|
|
31
|
-
<purpose>Shadow tint for
|
|
70
|
+
<custom_property name="--shadow-color" surface="public">
|
|
71
|
+
<purpose>Shadow tint for elevation stacks.</purpose>
|
|
32
72
|
<default>oklch(0% 0 0)</default>
|
|
33
|
-
<set_by>
|
|
73
|
+
<set_by>Elevator / getElevationProps (shadowColor) or equivalent style on the elevated host</set_by>
|
|
74
|
+
<use>Prefer getElevationProps({ shadowColor }). Pair with data-elevation*.</use>
|
|
34
75
|
</custom_property>
|
|
35
|
-
<custom_property name="--extra-shadow">
|
|
36
|
-
<purpose>
|
|
76
|
+
<custom_property name="--extra-shadow" surface="public">
|
|
77
|
+
<purpose>Extra box-shadow layer appended to elevation stacks (e.g. hairline border).</purpose>
|
|
37
78
|
<default>0 0 0 1px transparent</default>
|
|
38
|
-
<set_by>
|
|
79
|
+
<set_by>Elevator / getElevationProps (extraShadow) or equivalent style on the elevated host</set_by>
|
|
80
|
+
<use>Prefer getElevationProps({ extraShadow }).</use>
|
|
39
81
|
</custom_property>
|
|
40
|
-
<custom_property name="--elevation-transition-duration">
|
|
82
|
+
<custom_property name="--elevation-transition-duration" surface="public">
|
|
41
83
|
<purpose>Duration for data-elevation box-shadow transitions.</purpose>
|
|
42
84
|
<default>160ms</default>
|
|
43
|
-
<set_by>
|
|
85
|
+
<set_by>Optional style on the elevated host or theme override</set_by>
|
|
86
|
+
<use>Override only when product motion needs differ; default is fine for most UI.</use>
|
|
44
87
|
</custom_property>
|
|
45
|
-
<custom_property name="--elevation-transition-easing">
|
|
88
|
+
<custom_property name="--elevation-transition-easing" surface="public">
|
|
46
89
|
<purpose>Timing function for data-elevation box-shadow transitions.</purpose>
|
|
47
90
|
<default>ease</default>
|
|
48
|
-
<set_by>
|
|
91
|
+
<set_by>Optional style on the elevated host or theme override</set_by>
|
|
92
|
+
<use>Optional; default is fine for most UI.</use>
|
|
49
93
|
</custom_property>
|
|
50
|
-
<custom_property name="--vira-flex-grow">
|
|
51
|
-
<purpose>Local grow signal for Stack expandChildren / child flex defaults; does not inherit
|
|
52
|
-
<default>1
|
|
53
|
-
<set_by>data-grow="true"
|
|
94
|
+
<custom_property name="--vira-flex-grow" surface="public">
|
|
95
|
+
<purpose>Local grow signal for Stack expandChildren / child flex defaults; does not inherit.</purpose>
|
|
96
|
+
<default>1; inherits: false</default>
|
|
97
|
+
<set_by>data-grow="true" | data-grow="false"</set_by>
|
|
98
|
+
<use>Set via data-grow only.</use>
|
|
54
99
|
</custom_property>
|
|
55
|
-
<custom_property name="--vira-flex-shrink">
|
|
56
|
-
<purpose>Local shrink signal for flex defaults; does not inherit
|
|
57
|
-
<default>1
|
|
58
|
-
<set_by>data-shrink="true"
|
|
100
|
+
<custom_property name="--vira-flex-shrink" surface="public">
|
|
101
|
+
<purpose>Local shrink signal for flex defaults; does not inherit.</purpose>
|
|
102
|
+
<default>1; inherits: false</default>
|
|
103
|
+
<set_by>data-shrink="true" | data-shrink="false"</set_by>
|
|
104
|
+
<use>Set via data-shrink only.</use>
|
|
59
105
|
</custom_property>
|
|
60
|
-
<custom_property name="--
|
|
61
|
-
<purpose>
|
|
62
|
-
<default>
|
|
63
|
-
<set_by>
|
|
106
|
+
<custom_property name="--scrollbar-thumb" surface="public">
|
|
107
|
+
<purpose>Scrollbar thumb color for preflight scrollbar-color.</purpose>
|
|
108
|
+
<default>Derived on html from --global-contrast (semi-transparent)</default>
|
|
109
|
+
<set_by>Preflight on html; optional root override</set_by>
|
|
110
|
+
<use>Override on html/root when product needs a custom scrollbar tint.</use>
|
|
111
|
+
</custom_property>
|
|
112
|
+
<custom_property name="--scrollbar-track" surface="public">
|
|
113
|
+
<purpose>Scrollbar track color for preflight scrollbar-color.</purpose>
|
|
114
|
+
<default>transparent</default>
|
|
115
|
+
<set_by>Preflight on html; optional root override</set_by>
|
|
116
|
+
<use>Optional root override.</use>
|
|
117
|
+
</custom_property>
|
|
118
|
+
<custom_property name="--outline" surface="public">
|
|
119
|
+
<purpose>Focus-visible outline shorthand.</purpose>
|
|
120
|
+
<default>2px solid var(--outline-color) on html</default>
|
|
121
|
+
<set_by>Preflight on html; optional root override</set_by>
|
|
122
|
+
<use>Override at root for brand focus ring. Do not remove *:focus-visible affordance.</use>
|
|
123
|
+
</custom_property>
|
|
124
|
+
<custom_property name="--outline-color" surface="public">
|
|
125
|
+
<purpose>Focus ring color wired into --outline.</purpose>
|
|
126
|
+
<default>var(--global-outline) on html</default>
|
|
127
|
+
<set_by>Preflight from theme --global-outline; optional root override</set_by>
|
|
128
|
+
<use>Prefer overriding theme --global-outline first.</use>
|
|
129
|
+
</custom_property>
|
|
130
|
+
<custom_property name="--outline-offset" surface="public">
|
|
131
|
+
<purpose>Focus-visible outline-offset.</purpose>
|
|
132
|
+
<default>2px</default>
|
|
133
|
+
<set_by>Preflight on html; optional root override</set_by>
|
|
134
|
+
<use>Optional root override.</use>
|
|
135
|
+
</custom_property>
|
|
136
|
+
<custom_property name="--__corner-shape" surface="internal">
|
|
137
|
+
<purpose>Preflight-owned override so full/pill radius keeps round arcs when --effect-corner-shape is on. Not a consumer data-* or theme recipe.</purpose>
|
|
138
|
+
<default>guaranteed-invalid (falls through to --corner-shape)</default>
|
|
139
|
+
<set_by>ViraUI components on the same element as full / pill radius</set_by>
|
|
140
|
+
<use>Do not set from app markup. Need true pills on raw CSS: unset local corner-shape or turn --effect-corner-shape off. Theme token remains --corner-shape (theme-topics / toggles).</use>
|
|
64
141
|
</custom_property>
|
|
65
142
|
</modules>
|
|
@@ -1,64 +1,99 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<theme_topics>
|
|
3
|
-
<summary>Public semantic CSS custom
|
|
4
|
-
<compatibility>Custom and builder-generated themes must keep documented semantic variable names
|
|
5
|
-
|
|
3
|
+
<summary>Public semantic CSS custom-property groups required by @viraui/react. Short routing map — not a Style Dictionary dump. Names stay stable; values may change.</summary>
|
|
4
|
+
<compatibility>Custom and builder-generated themes must keep documented semantic variable names. Override surface="theme" groups after a complete theme sheet. Do not author surface="derived" vars in theme CSS.</compatibility>
|
|
5
|
+
|
|
6
|
+
<audience>
|
|
7
|
+
<consumer>Ship or override surface="theme" topics. Prefer semantic aliases over surface="raw" primitives. Never bake surface="derived" tokens (e.g. --font-scale-*) into theme sheets — preflight owns those.</consumer>
|
|
8
|
+
<maintainer>When adding or renaming a public theme group: update this map, docs/theme-contract.md, foundation brand sources, and viraui-setup theme.md in the same change. Derived outputs are preflight-owned (modules.xml), not brand JSON.</maintainer>
|
|
9
|
+
</audience>
|
|
10
|
+
|
|
11
|
+
<agent_rules>
|
|
12
|
+
<use>Override --global-*, --base-*, --highlight-*, --space-*, --radius-*, --corner-shape, --effect-*, --vibrancy-*, --font-root-size, --font-*-typescale, --font-leading-*, --font-family-*, --duration-*, --easing-* after a complete compatible theme sheet.</use>
|
|
13
|
+
<use>Change live typography scale via --font-heading-typescale / --font-body-typescale; preflight re-derives --font-scale-*.</use>
|
|
14
|
+
<use>Read surface="derived" tokens (var(--font-scale-*)) in component/app CSS — consume, do not redefine in theme.</use>
|
|
15
|
+
<do_not>Author --font-scale-* in theme CSS or brand typography.json. Theme ships typescale ratios only.</do_not>
|
|
16
|
+
<do_not>Ship theme CSS without @viraui/react/preflight.css — --font-scale-* come from preflight only.</do_not>
|
|
17
|
+
<do_not>Use raw --color-{palette}-{step} as the primary consumer override API; prefer --global-* / --base-* / --highlight-*. Use --color-* when the same color value must be the same across modes (and has enought contrast).</do_not>
|
|
18
|
+
<do_not>Rename documented semantic vars between preset and custom paths.</do_not>
|
|
19
|
+
<do_not>Treat --__corner-shape as a public theme recipe (component/preflight-owned; see modules.xml).</do_not>
|
|
20
|
+
</agent_rules>
|
|
21
|
+
|
|
22
|
+
<topic id="bootstrap-order" surface="bootstrap">
|
|
6
23
|
<summary>Load compatible theme CSS, then consumer fonts, then @viraui/react/preflight.css via JS side-effect imports.</summary>
|
|
24
|
+
<agent>Theme before preflight so typescale inputs exist when font-scale.css derives sizes. Full rules: bootstrap.xml.</agent>
|
|
7
25
|
</topic>
|
|
8
|
-
|
|
26
|
+
|
|
27
|
+
<topic id="base" surface="theme">
|
|
9
28
|
<pattern>--base-*</pattern>
|
|
10
29
|
<summary>Semantic neutral ramp for surfaces and text on themed backgrounds.</summary>
|
|
30
|
+
<agent>Safe override target. Keep step count and lightness progression unless the user asks to rebuild the ramp.</agent>
|
|
11
31
|
</topic>
|
|
12
|
-
<topic id="global">
|
|
32
|
+
<topic id="global" surface="theme">
|
|
13
33
|
<pattern>--global-*</pattern>
|
|
14
34
|
<summary>App-facing foreground, background, primary, muted, interactive, disabled, and contrast colors.</summary>
|
|
35
|
+
<agent>Primary brand/accent override surface.</agent>
|
|
15
36
|
</topic>
|
|
16
|
-
<topic id="
|
|
37
|
+
<topic id="highlight" surface="theme">
|
|
38
|
+
<pattern>--highlight-*</pattern>
|
|
39
|
+
<summary>Status and decorative highlight palette.</summary>
|
|
40
|
+
<agent>Override for status/decorative semantics; leave untouched groups at theme defaults.</agent>
|
|
41
|
+
</topic>
|
|
42
|
+
<topic id="effects" surface="theme">
|
|
17
43
|
<pattern>--effect-vibrancy | --effect-corner-shape | --effect-holofoil | --effect-shadows | --effect-fluid-typography</pattern>
|
|
18
|
-
<summary>Optional effect toggles; empty/unset = on, initial = off. Brand holofoil defaults to initial (off); vibrancy, corner-shape, shadows, and fluid-typography default empty (on). Holofoil on paints a fixed body::after foil overlay; shadows off disables preflight data-elevation box-shadow stacks; fluid-typography off locks Text/Title to each size’s theme scale token.</summary>
|
|
44
|
+
<summary>Optional effect toggles; empty/unset = on, initial = off. Brand holofoil defaults to initial (off); vibrancy, corner-shape, shadows, and fluid-typography default empty (on). Holofoil on paints a fixed body::after foil overlay; shadows off disables preflight data-elevation box-shadow stacks; fluid-typography off locks Text/Title to each size’s theme scale token (Text defaults `fluid` false; Title defaults true; both expose per-instance `fluid`).</summary>
|
|
45
|
+
<agent>Theme-level gates. Runtime polarity/details: toggles.xml. Do not invent alternate effect hooks.</agent>
|
|
19
46
|
</topic>
|
|
20
|
-
<topic id="vibrancy">
|
|
47
|
+
<topic id="vibrancy" surface="theme">
|
|
21
48
|
<pattern>--vibrancy-blur | --vibrancy-brightness</pattern>
|
|
22
49
|
<summary>Vibrancy glass params; blur is a numeric amount consumed as pixels, brightness is a percent string.</summary>
|
|
50
|
+
<agent>Theme params for data-vibrant hosts when --effect-vibrancy is on. Do not hand-roll backdrop-filter.</agent>
|
|
23
51
|
</topic>
|
|
24
|
-
<topic id="
|
|
25
|
-
<pattern>--highlight-*</pattern>
|
|
26
|
-
<summary>Status and decorative highlight palette.</summary>
|
|
27
|
-
</topic>
|
|
28
|
-
<topic id="radius">
|
|
52
|
+
<topic id="radius" surface="theme">
|
|
29
53
|
<pattern>--radius-* | --corner-shape</pattern>
|
|
30
54
|
<summary>Semantic radius scale plus corner-shape value for component chrome. Full/pill radius with --effect-corner-shape on can cap true pills; ViraUI sets internal --__corner-shape (preflight-owned, not a consumer data-*) beside full radius.</summary>
|
|
55
|
+
<agent>Override --radius-* / --corner-shape. Never set --__corner-shape from app markup. Raw CSS pills: local corner-shape: unset when effect is on.</agent>
|
|
31
56
|
</topic>
|
|
32
|
-
<topic id="space">
|
|
57
|
+
<topic id="space" surface="theme">
|
|
33
58
|
<pattern>--space-*</pattern>
|
|
34
59
|
<summary>Semantic spacing scale for layout and component padding.</summary>
|
|
60
|
+
<agent>Safe override target. Keep relative ratios unless the user asks to rebuild the scale.</agent>
|
|
35
61
|
</topic>
|
|
36
|
-
<topic id="font-root-size">
|
|
62
|
+
<topic id="font-root-size" surface="theme">
|
|
37
63
|
<pattern>--font-root-size</pattern>
|
|
38
64
|
<summary>Root html font-size as a percentage of the user-agent default; preflight applies it on html so rem-based scales inherit the brand baseline.</summary>
|
|
65
|
+
<agent>Theme lever for rem baseline. Preflight applies it on html (modules.xml baseline).</agent>
|
|
39
66
|
</topic>
|
|
40
|
-
<topic id="font-typescale">
|
|
67
|
+
<topic id="font-typescale" surface="theme">
|
|
41
68
|
<pattern>--font-heading-typescale | --font-body-typescale</pattern>
|
|
42
69
|
<summary>Editable modular ratios from theme CSS. Preflight derives --font-scale-* from these with pow + round(down). Override these (not baked sizes) for live typography scale changes.</summary>
|
|
70
|
+
<agent>Only editable typography-scale levers. Changing these updates derived --font-scale-* live once preflight is loaded.</agent>
|
|
43
71
|
</topic>
|
|
44
|
-
<topic id="font-
|
|
45
|
-
<pattern>--font-scale-*</pattern>
|
|
46
|
-
<summary>Semantic typography sizes (display, headings, body steps) derived by preflight from typescale ratios — not theme source tokens. body-m is always 1rem; body-s/body-xs use modular 1/pow with max() floors (0.875rem/0.75rem) and min() caps so they never shrink under chrome mins but can rise toward body-m; body-l…body-4xl are continuous powers n=1…5; display uses heading ratio at n=8. Text/Title fluid clamp between scale tokens is gated by --effect-fluid-typography (off → fixed at that size’s scale token).</summary>
|
|
47
|
-
</topic>
|
|
48
|
-
<topic id="font-family">
|
|
72
|
+
<topic id="font-family" surface="theme">
|
|
49
73
|
<pattern>--font-family-heading | --font-family-body | --font-family-mono</pattern>
|
|
50
74
|
<summary>Semantic font-family touchpoints; consumers must provide matching @font-face rules.</summary>
|
|
75
|
+
<agent>Theme publishes family strings only. Load matching fonts separately — theme never loads remote fonts.</agent>
|
|
51
76
|
</topic>
|
|
52
|
-
<topic id="font-leading">
|
|
77
|
+
<topic id="font-leading" surface="theme">
|
|
53
78
|
<pattern>--font-leading-*</pattern>
|
|
54
79
|
<summary>Semantic line-height scale for text and title components.</summary>
|
|
80
|
+
<agent>Safe theme override for leading tokens.</agent>
|
|
55
81
|
</topic>
|
|
56
|
-
<topic id="
|
|
57
|
-
<pattern>--color-{palette}-{step}</pattern>
|
|
58
|
-
<summary>Raw palette steps 0–70 by tens referenced by semantic aliases; not the primary consumer override API.</summary>
|
|
59
|
-
</topic>
|
|
60
|
-
<topic id="motion">
|
|
82
|
+
<topic id="motion" surface="theme">
|
|
61
83
|
<pattern>--duration-* | --easing-*</pattern>
|
|
62
84
|
<summary>Duration and easing tokens for component motion.</summary>
|
|
85
|
+
<agent>Theme motion primitives. Compose guidance: viraui-motion.</agent>
|
|
86
|
+
</topic>
|
|
87
|
+
|
|
88
|
+
<topic id="font-scale" surface="derived" set_by="preflight">
|
|
89
|
+
<pattern>--font-scale-*</pattern>
|
|
90
|
+
<summary>Semantic typography sizes (display, headings, body steps) derived by preflight from typescale ratios — not theme source tokens. body-m is always 1rem; body-s/body-xs use modular 1/pow with max() floors (0.875rem/0.75rem) and min() caps so they never shrink under chrome mins but can rise toward body-m; body-l…body-4xl are continuous powers n=1…5; display uses heading ratio at n=8. Text/Title fluid clamp between scale tokens is gated by --effect-fluid-typography and per-instance `fluid` (Text defaults false / locked; Title defaults true; off → fixed at that size’s scale token).</summary>
|
|
91
|
+
<agent>INTERNAL derivation — do not modify. Consume via var(--font-scale-*). To change sizes, override font-typescale. Capability map: modules.xml id=font-scale.</agent>
|
|
92
|
+
</topic>
|
|
93
|
+
|
|
94
|
+
<topic id="color-primitives" surface="raw">
|
|
95
|
+
<pattern>--color-{palette}-{step}</pattern>
|
|
96
|
+
<summary>Raw palette steps 0–70 by tens referenced by semantic aliases; not the primary consumer override API.</summary>
|
|
97
|
+
<agent>Preset build input. Prefer overriding --global-* / --base-* / --highlight-*. Do not theme an app by editing only --color-*.</agent>
|
|
63
98
|
</topic>
|
|
64
99
|
</theme_topics>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<toggles>
|
|
3
|
-
<summary>Core polarity and theme effect gates shipped with preflight. Polarity: --is-light-mode is a <color> on the root container (black = light theme, white = dark theme); query it with @container root style(--is-light-mode: black|white). Effect toggles: empty/unset = on, initial = off; brand holofoil defaults to initial (off); vibrancy, corner-shape, shadows, and fluid-typography default empty (on). Gate effects with @container root not style(--effect-*: initial). Holofoil on paints a fixed body::after foil overlay; shadows off disables preflight data-elevation box-shadow stacks; fluid-typography off locks Text/Title font-size to each size’s theme scale token.</summary>
|
|
3
|
+
<summary>Core polarity and theme effect gates shipped with preflight. Polarity: --is-light-mode is a <color> on the root container (black = light theme, white = dark theme); query it with @container root style(--is-light-mode: black|white). Effect toggles: empty/unset = on, initial = off; brand holofoil defaults to initial (off); vibrancy, corner-shape, shadows, and fluid-typography default empty (on). Gate effects with @container root not style(--effect-*: initial). Holofoil on paints a fixed body::after foil overlay; shadows off disables preflight data-elevation box-shadow stacks; fluid-typography off locks Text/Title font-size to each size’s theme scale token (Text defaults `fluid` false; Title defaults true; both expose per-instance `fluid`).</summary>
|
|
4
4
|
<toggle name="--is-light-mode">
|
|
5
5
|
<when>html registers polarity via contrast-color(var(--global-background)) so light backgrounds resolve to black and dark backgrounds to white; container name is root (see core.css).</when>
|
|
6
6
|
<when>data-mode="light" forces --is-light-mode: black and color-scheme: light; data-mode="dark" forces white and color-scheme: dark.</when>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<when>Brand default is initial (off). When on, paints a fixed body::after foil overlay gated by @container root not style(--effect-holofoil: initial); foil blend adjusts under @container root style(--is-light-mode: white). Do not invent alternate foil hooks.</when>
|
|
21
21
|
</toggle>
|
|
22
22
|
<toggle name="--effect-fluid-typography">
|
|
23
|
-
<when>Empty/unset enables Text/Title fluid clamp sizing (prev scale step→step via
|
|
23
|
+
<when>Empty/unset enables Text/Title fluid clamp sizing (prev scale step→step via viewport progress) when the instance `fluid` prop is true. Text defaults `fluid` false (locked at --font-scale-body-*); Title defaults true. Set theme to initial to lock each size at its theme scale token (--font-scale-body-* / --font-scale-display / --font-scale-h*). Per-instance: Text/Title `fluid={false}` → data-*-fluid=false locks that node to its size max token; Text `fluid` opts in. Module CSS also gates with @container root style(--effect-fluid-typography: initial). Text size xs stays fixed (min=max). At full fluid progress, on and off resolve to the same token.</when>
|
|
24
24
|
</toggle>
|
|
25
25
|
<toggle name="--corner-shape">
|
|
26
26
|
<when>Theme corner shape token; preflight may set internal --__corner-shape beside full radius. Not a consumer data-*.</when>
|
package/dist/specs/index.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<index package="@viraui/react" version="2026.6.
|
|
2
|
+
<index package="@viraui/react" version="2026.6.2" generated="2026-09-25T10:54:01.336Z">
|
|
3
3
|
<categories>
|
|
4
4
|
<category id="layout" />
|
|
5
5
|
<category id="action" />
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
</units>
|
|
93
93
|
</entry>
|
|
94
94
|
<entry id="breakpoints" category="layout" title="BreakpointsProvider">
|
|
95
|
-
<summary>Client provider plus `useBreakpoints` for mobile-first viewport min-width matches. Defaults are hardcoded em thresholds, not theme tokens.</summary>
|
|
95
|
+
<summary>Client provider plus `useBreakpoints` for mobile-first viewport min-width matches. Defaults are hardcoded em thresholds, not theme tokens. Style-only CSS should reuse the same map lengths.</summary>
|
|
96
96
|
<units>
|
|
97
97
|
<unit kind="meta" href="components/breakpoints/meta.xml" />
|
|
98
98
|
<unit kind="a11y" href="components/breakpoints/a11y.xml" />
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
</units>
|
|
183
183
|
</entry>
|
|
184
184
|
<entry id="glow" category="effect" title="Glow">
|
|
185
|
-
<summary>Decorative pointer-driven border highlight on a transparent Surface shell (radius only). Put the visual card as children; a shared rAF tracker paints CSS variables without React re-renders. Memory
|
|
185
|
+
<summary>Decorative pointer-driven border highlight on a transparent Surface shell (radius only). Put the visual card as children; a shared rAF tracker paints CSS variables without React re-renders. Memory/CP…</summary>
|
|
186
186
|
<units>
|
|
187
187
|
<unit kind="meta" href="components/glow/meta.xml" />
|
|
188
188
|
<unit kind="a11y" href="components/glow/a11y.xml" />
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
</units>
|
|
263
263
|
</entry>
|
|
264
264
|
<entry id="progressive-blur" category="effect" title="ProgressiveBlur">
|
|
265
|
-
<summary>Decorative stacked backdrop-filter overlay that ramps blur from one edge toward the opposite edge.</summary>
|
|
265
|
+
<summary>Decorative stacked backdrop-filter overlay that ramps blur from one edge toward the opposite edge. GPU/memory-heavy — use sparingly; prefer one focal instance per view.</summary>
|
|
266
266
|
<units>
|
|
267
267
|
<unit kind="meta" href="components/progressive-blur/meta.xml" />
|
|
268
268
|
<unit kind="a11y" href="components/progressive-blur/a11y.xml" />
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
</units>
|
|
353
353
|
</entry>
|
|
354
354
|
<entry id="static-noise" category="effect" title="StaticNoise">
|
|
355
|
-
<summary>Decorative SVG turbulence noise overlay for textured surfaces and hero sections. Memory-heavy — use sparingly
|
|
355
|
+
<summary>Decorative SVG turbulence noise overlay for textured surfaces and hero sections. Memory-heavy — use sparingly; prefer one focal instance per view.</summary>
|
|
356
356
|
<units>
|
|
357
357
|
<unit kind="meta" href="components/static-noise/meta.xml" />
|
|
358
358
|
<unit kind="a11y" href="components/static-noise/a11y.xml" />
|
|
@@ -529,10 +529,46 @@
|
|
|
529
529
|
<unit kind="foundation" href="foundation/modules.xml" />
|
|
530
530
|
</units>
|
|
531
531
|
</entry>
|
|
532
|
+
<entry id="card-grid" category="pattern" title="Card grid">
|
|
533
|
+
<summary>Use Grid for CSS grid tracks (auto-fill/fit or fixed columns). Put token `rowGap` / `columnGap` on Grid; put card chrome on Surface; nest Stack inside each card for content gaps.</summary>
|
|
534
|
+
<units>
|
|
535
|
+
<unit kind="pattern" href="patterns/card-grid.xml" />
|
|
536
|
+
</units>
|
|
537
|
+
</entry>
|
|
538
|
+
<entry id="compose-layout-first" category="pattern" title="Compose layout primitives first">
|
|
539
|
+
<summary>Prefer Vira layout roots (`Stack`, `Grid`, `Masonry`, `Bleed`, `Surface`) and their public props for every consumer layout. Treat `Stack` as the default box: an enriched `div` (flex + gap/padding/ali…</summary>
|
|
540
|
+
<units>
|
|
541
|
+
<unit kind="pattern" href="patterns/compose-layout-first.xml" />
|
|
542
|
+
</units>
|
|
543
|
+
</entry>
|
|
544
|
+
<entry id="equal-width-actions" category="pattern" title="Equal-width action row">
|
|
545
|
+
<summary>Span or share space with Stack `fullWidth` and/or `expandChildren` (and control `fullWidth` when the surface owns it). Orthogonal: `fullWidth` sizes the Stack; `expandChildren` grows direct children …</summary>
|
|
546
|
+
<units>
|
|
547
|
+
<unit kind="pattern" href="patterns/equal-width-actions.xml" />
|
|
548
|
+
</units>
|
|
549
|
+
</entry>
|
|
550
|
+
<entry id="page-chrome" category="pattern" title="Page chrome with Stack render">
|
|
551
|
+
<summary>Own page/section flex with Stack. Pick semantic tags (`header`, `main`, `nav`, `section`, …) via `render={&lt;tag /&gt;}` — keep Stack as the layout engine. CSS modules may set min-block-size / scrol…</summary>
|
|
552
|
+
<units>
|
|
553
|
+
<unit kind="pattern" href="patterns/page-chrome.xml" />
|
|
554
|
+
</units>
|
|
555
|
+
</entry>
|
|
556
|
+
<entry id="settings-panel" category="pattern" title="Settings panel (Surface + Stack)">
|
|
557
|
+
<summary>Wrap a settings block in Surface for fill/border/radius/padding; nest Stack for child gaps and rows. Compose the settings-row pattern inside for label+control rows. Prefer props over CSS for spacing …</summary>
|
|
558
|
+
<units>
|
|
559
|
+
<unit kind="pattern" href="patterns/settings-panel.xml" />
|
|
560
|
+
</units>
|
|
561
|
+
</entry>
|
|
532
562
|
<entry id="settings-row" category="pattern" title="Settings row">
|
|
533
|
-
<summary>Use Stack for the row flex layout and token
|
|
563
|
+
<summary>Use Stack for the row flex layout and token `columnGap`; put label copy in a nested column Stack with `expandChildren`; put the control at the trailing edge.</summary>
|
|
534
564
|
<units>
|
|
535
565
|
<unit kind="pattern" href="patterns/settings-row.xml" />
|
|
536
566
|
</units>
|
|
537
567
|
</entry>
|
|
568
|
+
<entry id="stack-as-surface" category="pattern" title="Stack as Surface (avoid extra DOM)">
|
|
569
|
+
<summary>When a flex cluster also needs Surface chrome (border, color, radius, padding), prefer `Stack render={&lt;Surface … /&gt;}` so layout + chrome share one root. Put gap/align/`fullWidth`/`expandChildre…</summary>
|
|
570
|
+
<units>
|
|
571
|
+
<unit kind="pattern" href="patterns/stack-as-surface.xml" />
|
|
572
|
+
</units>
|
|
573
|
+
</entry>
|
|
538
574
|
</index>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<pattern id="card-grid" title="Card grid">
|
|
3
|
+
<uses>
|
|
4
|
+
<ref id="grid" units="meta,usage,props" />
|
|
5
|
+
<ref id="surface" units="meta,usage" />
|
|
6
|
+
<ref id="stack" units="meta,usage" />
|
|
7
|
+
<ref id="text" units="meta" />
|
|
8
|
+
</uses>
|
|
9
|
+
<do>Use Grid for CSS grid tracks (auto-fill/fit or fixed columns). Put token `rowGap` / `columnGap` on Grid; put card chrome on Surface; nest Stack inside each card for content gaps.</do>
|
|
10
|
+
<dont>Do not invent `display:grid` / `grid-template-*` / CSS `gap` on plain HTML when Grid can own the layout. Do not use Masonry when you need explicit tracks or full-width spans.</dont>
|
|
11
|
+
<tsx><![CDATA[
|
|
12
|
+
<Grid filling="fill" colMinWidth="16rem" rowGap="m" columnGap="m">
|
|
13
|
+
<Grid.Item>
|
|
14
|
+
<Surface color={1} border="all" radius="m" hPadding="m" vPadding="m">
|
|
15
|
+
<Stack rowGap="s">
|
|
16
|
+
<Text weight="m">Inbox</Text>
|
|
17
|
+
<Text size="sm" color="muted">
|
|
18
|
+
Unread threads
|
|
19
|
+
</Text>
|
|
20
|
+
</Stack>
|
|
21
|
+
</Surface>
|
|
22
|
+
</Grid.Item>
|
|
23
|
+
<Grid.Item>
|
|
24
|
+
<Surface color={1} border="all" radius="m" hPadding="m" vPadding="m">
|
|
25
|
+
<Stack rowGap="s">
|
|
26
|
+
<Text weight="m">Archive</Text>
|
|
27
|
+
<Text size="sm" color="muted">
|
|
28
|
+
Stored mail
|
|
29
|
+
</Text>
|
|
30
|
+
</Stack>
|
|
31
|
+
</Surface>
|
|
32
|
+
</Grid.Item>
|
|
33
|
+
</Grid>
|
|
34
|
+
]]></tsx>
|
|
35
|
+
</pattern>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<pattern id="compose-layout-first" title="Compose layout primitives first">
|
|
3
|
+
<uses>
|
|
4
|
+
<ref id="stack" units="meta,usage,props" />
|
|
5
|
+
<ref id="surface" units="meta,usage,props" />
|
|
6
|
+
<ref id="text" units="meta" />
|
|
7
|
+
<ref id="button" units="meta" />
|
|
8
|
+
<ref id="grid" units="meta,usage" />
|
|
9
|
+
<ref id="masonry" units="meta,usage" />
|
|
10
|
+
<ref id="bleed" units="meta,usage" />
|
|
11
|
+
</uses>
|
|
12
|
+
<do>Prefer Vira layout roots (`Stack`, `Grid`, `Masonry`, `Bleed`, `Surface`) and their public props for every consumer layout. Treat `Stack` as the default box: an enriched `div` (flex + gap/padding/align/`fullWidth`/`render`/…) — prefer it over bare wrapper `div`s even for simple nesting. Compose and nest components; add custom CSS only when props cannot express size/scroll/basis. Prefer another Vira component (e.g. `Surface` for border/fill/radius) or `render` merge over a CSS class for chrome the library already owns.</do>
|
|
13
|
+
<dont>Do not invent bare wrapper `div`s (or `display:flex` / `display:grid` / CSS `gap` / `padding` / border/radius chrome on raw tags) when `Stack` or another layout primitive / `Surface` covers it. Do not skip composition to reach for a one-off stylesheet.</dont>
|
|
14
|
+
<tsx><![CDATA[
|
|
15
|
+
{/* Flex row + panel chrome: one DOM node via Stack render={<Surface />} */}
|
|
16
|
+
<Stack
|
|
17
|
+
direction="row"
|
|
18
|
+
columnGap="m"
|
|
19
|
+
vAlign="center"
|
|
20
|
+
fullWidth
|
|
21
|
+
expandChildren
|
|
22
|
+
render={
|
|
23
|
+
<Surface border="all" color={1} radius="m" hPadding="m" vPadding="m" />
|
|
24
|
+
}
|
|
25
|
+
>
|
|
26
|
+
<Text weight="m">Profile</Text>
|
|
27
|
+
<Button variant="secondary" data-grow="false">
|
|
28
|
+
Edit
|
|
29
|
+
</Button>
|
|
30
|
+
</Stack>
|
|
31
|
+
]]></tsx>
|
|
32
|
+
</pattern>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<pattern id="equal-width-actions" title="Equal-width action row">
|
|
3
|
+
<uses>
|
|
4
|
+
<ref id="stack" units="meta,usage,props" />
|
|
5
|
+
<ref id="button" units="meta,props" />
|
|
6
|
+
</uses>
|
|
7
|
+
<do>Span or share space with Stack `fullWidth` and/or `expandChildren` (and control `fullWidth` when the surface owns it). Orthogonal: `fullWidth` sizes the Stack; `expandChildren` grows direct children on the main axis.</do>
|
|
8
|
+
<dont>Do not invent `width: 100%` / `w-full` / per-child `flex: 1` CSS on Button (or other content-sized controls) when Stack can own the fill.</dont>
|
|
9
|
+
<tsx><![CDATA[
|
|
10
|
+
{/* Full-bleed column CTAs */}
|
|
11
|
+
<Stack fullWidth rowGap="s">
|
|
12
|
+
<Button>Continue</Button>
|
|
13
|
+
<Button variant="secondary">Cancel</Button>
|
|
14
|
+
</Stack>
|
|
15
|
+
|
|
16
|
+
{/* Equal-width row actions — children grow on the main axis. Add fullWidth when the Stack itself should fill its parent width */}
|
|
17
|
+
<Stack expandChildren direction="row" columnGap="s">
|
|
18
|
+
<Button>Continue</Button>
|
|
19
|
+
<Button variant="secondary">Cancel</Button>
|
|
20
|
+
</Stack>
|
|
21
|
+
]]></tsx>
|
|
22
|
+
</pattern>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<pattern id="page-chrome" title="Page chrome with Stack render">
|
|
3
|
+
<uses>
|
|
4
|
+
<ref id="stack" units="meta,usage,props" />
|
|
5
|
+
<ref id="title" units="meta" />
|
|
6
|
+
<ref id="button" units="meta" />
|
|
7
|
+
</uses>
|
|
8
|
+
<do>Own page/section flex with Stack. Pick semantic tags (`header`, `main`, `nav`, `section`, …) via `render={<tag />}` — keep Stack as the layout engine. CSS modules may set min-block-size / scroll; never `display:flex`.</do>
|
|
9
|
+
<dont>Do not use raw `header`/`main`/`nav` + `display:flex` / CSS gap for jobs Stack owns. Tag choice ≠ layout engine.</dont>
|
|
10
|
+
<tsx><![CDATA[
|
|
11
|
+
<Stack rowGap="m" expandChildren>
|
|
12
|
+
<Stack
|
|
13
|
+
direction="row"
|
|
14
|
+
hAlign="space-between"
|
|
15
|
+
vAlign="center"
|
|
16
|
+
columnGap="m"
|
|
17
|
+
hPadding="m"
|
|
18
|
+
vPadding="m"
|
|
19
|
+
render={<header />}
|
|
20
|
+
>
|
|
21
|
+
<Title render={<h1 />}>Settings</Title>
|
|
22
|
+
<Button>Save</Button>
|
|
23
|
+
</Stack>
|
|
24
|
+
<Stack direction="row" columnGap="m" expandChildren render={<main />}>
|
|
25
|
+
<Stack rowGap="xs" hPadding="s" vPadding="s" render={<nav aria-label="Settings" />}>
|
|
26
|
+
{/* nav links */}
|
|
27
|
+
</Stack>
|
|
28
|
+
<Stack rowGap="l" expandChildren>
|
|
29
|
+
{/* content */}
|
|
30
|
+
</Stack>
|
|
31
|
+
</Stack>
|
|
32
|
+
</Stack>
|
|
33
|
+
]]></tsx>
|
|
34
|
+
</pattern>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<pattern id="settings-panel" title="Settings panel (Surface + Stack)">
|
|
3
|
+
<uses>
|
|
4
|
+
<ref id="stack" units="meta,usage" />
|
|
5
|
+
<ref id="surface" units="meta,usage,props" />
|
|
6
|
+
<ref id="textfield" units="meta" />
|
|
7
|
+
<ref id="switch" units="meta" />
|
|
8
|
+
<ref id="text" units="meta" />
|
|
9
|
+
</uses>
|
|
10
|
+
<do>Wrap a settings block in Surface for fill/border/radius/padding; nest Stack for child gaps and rows. Compose the settings-row pattern inside for label+control rows. Prefer props over CSS for spacing and chrome.</do>
|
|
11
|
+
<dont>Do not reimplement card chrome or row flex in app CSS when Surface + Stack cover it.</dont>
|
|
12
|
+
<tsx><![CDATA[
|
|
13
|
+
<Stack rowGap="m" hPadding="m" vPadding="m">
|
|
14
|
+
<Surface color={1} border="all" radius="m" hPadding="m" vPadding="m">
|
|
15
|
+
<Stack rowGap="m">
|
|
16
|
+
<Textfield label="Display name" fullWidth />
|
|
17
|
+
<Stack direction="row" vAlign="center" columnGap="m" fullWidth>
|
|
18
|
+
<Stack rowGap="2xs" expandChildren>
|
|
19
|
+
<Text weight="m">Notifications</Text>
|
|
20
|
+
<Text size="sm" color="muted">
|
|
21
|
+
Email digests for account activity
|
|
22
|
+
</Text>
|
|
23
|
+
</Stack>
|
|
24
|
+
<Switch aria-label="Notifications" />
|
|
25
|
+
</Stack>
|
|
26
|
+
</Stack>
|
|
27
|
+
</Surface>
|
|
28
|
+
</Stack>
|
|
29
|
+
]]></tsx>
|
|
30
|
+
</pattern>
|