@viraui/react 2026.6.0 → 2026.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/catalog.json +5 -5
  2. package/dist/components/stack/stack.d.ts +4 -1
  3. package/dist/components/tabs/tabs.css +1 -1
  4. package/dist/components/text/text.css +1 -1
  5. package/dist/components/text/text.d.ts +12 -2
  6. package/dist/components/text/text.js +2 -1
  7. package/dist/components/textfield/textfield.d.ts +1 -0
  8. package/dist/components/title/title.css +1 -1
  9. package/dist/components/title/title.d.ts +12 -2
  10. package/dist/components/title/title.js +2 -1
  11. package/dist/specs/PROTOCOL.md +1 -1
  12. package/dist/specs/activity-hints.xml +18 -3
  13. package/dist/specs/components/accordion/patterns.xml +69 -5
  14. package/dist/specs/components/accordion/props.xml +4 -4
  15. package/dist/specs/components/accordion/usage.xml +8 -4
  16. package/dist/specs/components/annotate/patterns.xml +50 -3
  17. package/dist/specs/components/annotate/props.xml +22 -22
  18. package/dist/specs/components/annotate/usage.xml +7 -6
  19. package/dist/specs/components/autocomplete/patterns.xml +123 -7
  20. package/dist/specs/components/autocomplete/props.xml +14 -14
  21. package/dist/specs/components/autocomplete/usage.xml +11 -6
  22. package/dist/specs/components/avatar/patterns.xml +78 -3
  23. package/dist/specs/components/avatar/props.xml +8 -8
  24. package/dist/specs/components/avatar/usage.xml +9 -3
  25. package/dist/specs/components/avatar-group/patterns.xml +65 -3
  26. package/dist/specs/components/avatar-group/props.xml +8 -8
  27. package/dist/specs/components/avatar-group/usage.xml +10 -7
  28. package/dist/specs/components/badge/patterns.xml +57 -3
  29. package/dist/specs/components/badge/props.xml +8 -8
  30. package/dist/specs/components/badge/usage.xml +5 -3
  31. package/dist/specs/components/beam/meta.xml +1 -1
  32. package/dist/specs/components/beam/patterns.xml +68 -3
  33. package/dist/specs/components/beam/props.xml +22 -22
  34. package/dist/specs/components/beam/usage.xml +7 -7
  35. package/dist/specs/components/bleed/patterns.xml +54 -3
  36. package/dist/specs/components/bleed/props.xml +2 -2
  37. package/dist/specs/components/bleed/usage.xml +6 -3
  38. package/dist/specs/components/breakpoints/meta.xml +1 -1
  39. package/dist/specs/components/breakpoints/patterns.xml +1 -6
  40. package/dist/specs/components/breakpoints/props.xml +4 -2
  41. package/dist/specs/components/breakpoints/usage.xml +10 -2
  42. package/dist/specs/components/button/patterns.xml +124 -6
  43. package/dist/specs/components/button/props.xml +33 -32
  44. package/dist/specs/components/button/usage.xml +13 -13
  45. package/dist/specs/components/checkbox/patterns.xml +83 -3
  46. package/dist/specs/components/checkbox/props.xml +10 -10
  47. package/dist/specs/components/checkbox/usage.xml +11 -6
  48. package/dist/specs/components/chip/patterns.xml +74 -3
  49. package/dist/specs/components/chip/props.xml +14 -14
  50. package/dist/specs/components/chip/usage.xml +10 -6
  51. package/dist/specs/components/clamp-text/patterns.xml +1 -4
  52. package/dist/specs/components/clamp-text/props.xml +2 -2
  53. package/dist/specs/components/clamp-text/usage.xml +8 -5
  54. package/dist/specs/components/dialog/patterns.xml +136 -15
  55. package/dist/specs/components/dialog/props.xml +2 -2
  56. package/dist/specs/components/dialog/usage.xml +9 -7
  57. package/dist/specs/components/elevator/patterns.xml +54 -3
  58. package/dist/specs/components/elevator/usage.xml +8 -5
  59. package/dist/specs/components/fieldset/patterns.xml +97 -3
  60. package/dist/specs/components/fieldset/usage.xml +7 -5
  61. package/dist/specs/components/fit-text/patterns.xml +1 -4
  62. package/dist/specs/components/fit-text/props.xml +2 -2
  63. package/dist/specs/components/fit-text/usage.xml +8 -6
  64. package/dist/specs/components/glow/meta.xml +1 -1
  65. package/dist/specs/components/glow/patterns.xml +74 -3
  66. package/dist/specs/components/glow/props.xml +16 -16
  67. package/dist/specs/components/glow/usage.xml +8 -7
  68. package/dist/specs/components/grid/patterns.xml +88 -5
  69. package/dist/specs/components/grid/props.xml +23 -23
  70. package/dist/specs/components/grid/usage.xml +9 -5
  71. package/dist/specs/components/icon-button/patterns.xml +97 -6
  72. package/dist/specs/components/icon-button/props.xml +32 -32
  73. package/dist/specs/components/icon-button/usage.xml +11 -9
  74. package/dist/specs/components/linear-progress/patterns.xml +58 -3
  75. package/dist/specs/components/linear-progress/props.xml +6 -6
  76. package/dist/specs/components/linear-progress/usage.xml +9 -8
  77. package/dist/specs/components/masonry/patterns.xml +68 -5
  78. package/dist/specs/components/masonry/props.xml +2 -2
  79. package/dist/specs/components/masonry/usage.xml +9 -4
  80. package/dist/specs/components/menu/patterns.xml +179 -15
  81. package/dist/specs/components/menu/usage.xml +8 -7
  82. package/dist/specs/components/meter/patterns.xml +49 -3
  83. package/dist/specs/components/meter/props.xml +6 -6
  84. package/dist/specs/components/meter/usage.xml +10 -7
  85. package/dist/specs/components/popover/patterns.xml +118 -9
  86. package/dist/specs/components/popover/props.xml +2 -2
  87. package/dist/specs/components/popover/usage.xml +9 -8
  88. package/dist/specs/components/progressive-blur/meta.xml +1 -1
  89. package/dist/specs/components/progressive-blur/patterns.xml +1 -4
  90. package/dist/specs/components/progressive-blur/props.xml +2 -2
  91. package/dist/specs/components/progressive-blur/usage.xml +7 -6
  92. package/dist/specs/components/radio/patterns.xml +55 -5
  93. package/dist/specs/components/radio/props.xml +8 -8
  94. package/dist/specs/components/radio/usage.xml +9 -6
  95. package/dist/specs/components/select/patterns.xml +124 -8
  96. package/dist/specs/components/select/props.xml +18 -18
  97. package/dist/specs/components/select/usage.xml +11 -10
  98. package/dist/specs/components/separator/patterns.xml +121 -3
  99. package/dist/specs/components/separator/props.xml +4 -4
  100. package/dist/specs/components/separator/usage.xml +8 -5
  101. package/dist/specs/components/shimmer/patterns.xml +23 -3
  102. package/dist/specs/components/shimmer/props.xml +8 -8
  103. package/dist/specs/components/shimmer/usage.xml +7 -5
  104. package/dist/specs/components/skeleton/patterns.xml +172 -4
  105. package/dist/specs/components/skeleton/props.xml +14 -14
  106. package/dist/specs/components/skeleton/usage.xml +11 -7
  107. package/dist/specs/components/slider/patterns.xml +111 -3
  108. package/dist/specs/components/slider/props.xml +10 -10
  109. package/dist/specs/components/slider/usage.xml +11 -5
  110. package/dist/specs/components/spinner/patterns.xml +35 -3
  111. package/dist/specs/components/spinner/props.xml +2 -2
  112. package/dist/specs/components/spinner/usage.xml +8 -5
  113. package/dist/specs/components/stack/patterns.xml +359 -3
  114. package/dist/specs/components/stack/props.xml +24 -22
  115. package/dist/specs/components/stack/usage.xml +16 -10
  116. package/dist/specs/components/static-noise/meta.xml +1 -1
  117. package/dist/specs/components/static-noise/patterns.xml +20 -3
  118. package/dist/specs/components/static-noise/usage.xml +5 -5
  119. package/dist/specs/components/surface/patterns.xml +188 -3
  120. package/dist/specs/components/surface/props.xml +26 -26
  121. package/dist/specs/components/surface/usage.xml +15 -12
  122. package/dist/specs/components/switch/patterns.xml +73 -3
  123. package/dist/specs/components/switch/props.xml +12 -12
  124. package/dist/specs/components/switch/usage.xml +10 -5
  125. package/dist/specs/components/tabs/patterns.xml +111 -6
  126. package/dist/specs/components/tabs/props.xml +2 -2
  127. package/dist/specs/components/tabs/usage.xml +7 -3
  128. package/dist/specs/components/text/patterns.xml +97 -3
  129. package/dist/specs/components/text/props.xml +48 -43
  130. package/dist/specs/components/text/usage.xml +11 -4
  131. package/dist/specs/components/textarea/patterns.xml +49 -3
  132. package/dist/specs/components/textarea/props.xml +7 -6
  133. package/dist/specs/components/textarea/usage.xml +8 -5
  134. package/dist/specs/components/textfield/patterns.xml +163 -3
  135. package/dist/specs/components/textfield/props.xml +12 -11
  136. package/dist/specs/components/textfield/usage.xml +9 -3
  137. package/dist/specs/components/title/patterns.xml +74 -3
  138. package/dist/specs/components/title/props.xml +48 -43
  139. package/dist/specs/components/title/usage.xml +10 -7
  140. package/dist/specs/components/toast/patterns.xml +85 -8
  141. package/dist/specs/components/toast/usage.xml +8 -5
  142. package/dist/specs/components/toggle-button/patterns.xml +101 -3
  143. package/dist/specs/components/toggle-button/props.xml +16 -16
  144. package/dist/specs/components/toggle-button/usage.xml +9 -5
  145. package/dist/specs/components/toggle-group/patterns.xml +34 -5
  146. package/dist/specs/components/toggle-group/usage.xml +9 -5
  147. package/dist/specs/components/tooltip/patterns.xml +110 -6
  148. package/dist/specs/components/tooltip/props.xml +2 -2
  149. package/dist/specs/components/tooltip/usage.xml +8 -5
  150. package/dist/specs/components/typewriter/patterns.xml +18 -3
  151. package/dist/specs/components/typewriter/props.xml +2 -2
  152. package/dist/specs/components/typewriter/usage.xml +9 -8
  153. package/dist/specs/foundation/attributes.xml +67 -37
  154. package/dist/specs/foundation/bootstrap.xml +6 -6
  155. package/dist/specs/foundation/elevation.xml +51 -3
  156. package/dist/specs/foundation/modules.xml +117 -40
  157. package/dist/specs/foundation/theme-topics.xml +62 -27
  158. package/dist/specs/foundation/toggles.xml +2 -2
  159. package/dist/specs/index.xml +42 -6
  160. package/dist/specs/patterns/card-grid.xml +35 -0
  161. package/dist/specs/patterns/compose-layout-first.xml +32 -0
  162. package/dist/specs/patterns/equal-width-actions.xml +22 -0
  163. package/dist/specs/patterns/page-chrome.xml +34 -0
  164. package/dist/specs/patterns/settings-panel.xml +30 -0
  165. package/dist/specs/patterns/settings-row.xml +9 -7
  166. package/dist/specs/patterns/stack-as-surface.xml +37 -0
  167. package/package.json +2 -2
@@ -1,7 +1,72 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <patterns surface="beam">
3
- <example title="Beam structure">
4
- <tsx><![CDATA[<Beam>{children}</Beam>]]></tsx>
5
- <notes>Public assembly hint from legacy guide; not API authority.</notes>
3
+ <!-- Sources: viraui-app/components — cleaned (no form handlers, no i18n, no backdrop Grid CSS). -->
4
+
5
+ <example title="CTA line beam (login)">
6
+ <tsx><![CDATA[
7
+ <form>
8
+ <Stack direction="row" columnGap="m" rowGap="m" hAlign="start" vAlign="start" wrap>
9
+ <Textfield type="email" placeholder="your@email.com" size={30} aria-label="Email" />
10
+ <Stack direction="row" vAlign="center" columnGap="m">
11
+ <Button type="submit">Send magic link</Button>
12
+ or
13
+ <Beam variant="line" radius="m" strength={0.8} duration="5s">
14
+ <ButtonLink variant="secondary" href="#">
15
+ Get ViraUI Pro
16
+ </ButtonLink>
17
+ </Beam>
18
+ </Stack>
19
+ </Stack>
20
+ </form>
21
+ ]]></tsx>
22
+ <notes>From `auth/login-form`. Beam wraps the secondary CTA only — line travel under the link. Drop react-hook-form / toast wiring.</notes>
23
+ </example>
24
+
25
+ <example title="Icon card beam (distribute)">
26
+ <tsx><![CDATA[
27
+ <Surface overflow="hidden" border="all" color={1} radius="l">
28
+ <Stack rowGap="l" hPadding="l" vPadding={['2xl', '2xl']} hAlign="center">
29
+ <Beam radius="m" variant="line" color="primary">
30
+ <Surface color={2} border="all" radius="auto" hPadding="m" vPadding="m">
31
+ {/* leading icon */}
32
+ </Surface>
33
+ </Beam>
34
+
35
+ <Stack rowGap="s" hAlign="center">
36
+ <Title align="center" size="4" render={<h4 />}>
37
+ Distribute Track
38
+ </Title>
39
+ <Text size="s" align="center" maxWidth="18rem" tone="muted">
40
+ Upload your first master to start reaching listeners on Spotify, Apple Music, and more.
41
+ </Text>
42
+ </Stack>
43
+
44
+ <Button>Create Release</Button>
45
+ </Stack>
46
+ </Surface>
47
+ ]]></tsx>
48
+ <notes>From `editor/preview-grid/blocks/distribute-track`. Beam around a nested Surface icon tile; `color="primary"` + `variant="line"`. Compose Surface as children — Beam is decoration only.</notes>
49
+ </example>
50
+
51
+ <example title="Empty-state icon beam">
52
+ <tsx><![CDATA[
53
+ <Stack hAlign="center" vAlign="center" rowGap="l" render={<div role="status" />}>
54
+ <Beam radius="full" variant="line">
55
+ <Surface aria-hidden color={1} border="all" hPadding="m" radius="full" vPadding="m">
56
+ {/* icon */}
57
+ </Surface>
58
+ </Beam>
59
+
60
+ <Stack hAlign="center" maxWidth="36ch" rowGap="s">
61
+ <Title align="center" render={<h2 />} size="3">
62
+ No prompts yet
63
+ </Title>
64
+ <Text align="center" render={<p />} maxWidth="28ch" tone="muted">
65
+ Generate or import a prompt to get started.
66
+ </Text>
67
+ </Stack>
68
+ </Stack>
69
+ ]]></tsx>
70
+ <notes>From `prompts/prompts-info-state` foreground. Full-radius Beam around the empty-state icon Surface. Drop decorative backdrop Grid / absolute CSS from this hint.</notes>
6
71
  </example>
7
72
  </patterns>
@@ -54,37 +54,37 @@
54
54
  <prop name="onDeactivate" kind="react">
55
55
  <description>Fired when the fade-out animation completes.</description>
56
56
  </prop>
57
- <css_var suffix="angle">
57
+ <prop name="angle" kind="css">
58
58
  <description>Conic / travel start angle animated by border and line variants.</description>
59
- </css_var>
60
- <css_var suffix="opacity">
59
+ </prop>
60
+ <prop name="opacity" kind="css">
61
61
  <description>Fade opacity driven by fade-in / fade-out keyframes.</description>
62
- </css_var>
63
- <css_var suffix="duration">
62
+ </prop>
63
+ <prop name="duration" kind="css">
64
64
  <description>Spin / travel duration (and pulse period scale input).</description>
65
- </css_var>
66
- <css_var suffix="strength">
65
+ </prop>
66
+ <prop name="strength" kind="css">
67
67
  <description>Overall beam layer strength multiplier.</description>
68
- </css_var>
69
- <css_var suffix="brightness">
68
+ </prop>
69
+ <prop name="brightness" kind="css">
70
70
  <description>Brightness filter multiplier.</description>
71
- </css_var>
72
- <css_var suffix="saturation">
71
+ </prop>
72
+ <prop name="saturation" kind="css">
73
73
  <description>Saturation filter multiplier.</description>
74
- </css_var>
75
- <css_var suffix="hue-range">
74
+ </prop>
75
+ <prop name="hue-range" kind="css">
76
76
  <description>Hue-rotate oscillation range for non-static colors.</description>
77
- </css_var>
78
- <css_var suffix="color">
77
+ </prop>
78
+ <prop name="color" kind="css">
79
79
  <description>Resolved beam token color (primary or highlight). Colorful mode uses multi-stop internals.</description>
80
- </css_var>
81
- <css_var suffix="hue">
80
+ </prop>
81
+ <prop name="hue" kind="css">
82
82
  <description>Pulse hue drift angle written by the shared pulse driver.</description>
83
- </css_var>
84
- <css_var suffix="pulse-glow-sx">
83
+ </prop>
84
+ <prop name="pulse-glow-sx" kind="css">
85
85
  <description>Per-axis X scale for pulse-outside glow geometry relative to a 350×140 reference.</description>
86
- </css_var>
87
- <css_var suffix="pulse-glow-sy">
86
+ </prop>
87
+ <prop name="pulse-glow-sy" kind="css">
88
88
  <description>Per-axis Y scale for pulse-outside glow geometry relative to a 350×140 reference.</description>
89
- </css_var>
89
+ </prop>
90
90
  </props>
@@ -1,11 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <usage surface="beam">
3
- <do>Highlight a focal Surface with a traveling border beam</do>
4
- <do>Bottom-edge line travel under a card or panel</do>
5
- <do>Breathing pulse glow inside or outside a Surface</do>
6
- <do>Token-colored or colorful multi-stop decorative emphasis</do>
7
- <dont>Relying on Beam for keyboard focus visibility</dont>
8
- <dont>Treating Beam as the visual card instead of composing Surface children</dont>
3
+ <do>Wrap a visual Surface (often with `radius=&quot;auto&quot;`) or CTA as children — Beam is a transparent Surface shell (`radius` only), never the card chrome</do>
4
+ <do>Compose inside Stack/Surface layouts: line beam under a ButtonLink, or around an icon Surface in an empty-state / distribute card</do>
5
+ <do>Pick `variant` for the job: `border` spin, `line` travel, `pulse-outside` / `pulse-inside` breathe — use Glow instead when the highlight should follow the pointer</do>
6
+ <do>Use sparingly as a focal accent — shared pulse rAF still paints per instance; prefer one Beam per view</do>
7
+ <dont>Treating Beam as Surface color/padding/border chrome — nest Surface/Stack children for the real card</dont>
8
+ <dont>Relying on Beam for keyboard focus or status — decorative only</dont>
9
9
  <dont>Expecting theme light/dark auto-tuning — colors are token-driven and theme-agnostic</dont>
10
- <dont>Using many pulse Beam instances on one page — shared rAF still paints per instance</dont>
10
+ <dont>Scattering many Beam instances on one page</dont>
11
11
  </usage>
@@ -1,7 +1,58 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <patterns surface="bleed">
3
- <example title="Bleed structure">
4
- <tsx><![CDATA[<Bleed>…</Bleed>]]></tsx>
5
- <notes>Public assembly hint from legacy guide; not API authority.</notes>
3
+ <!-- Sources: viraui-app/components — cleaned (no handlers, no i18n, no app-only chrome). -->
4
+
5
+ <example title="Bleed divider between controls">
6
+ <tsx><![CDATA[
7
+ <Stack rowGap="m" hPadding="s" vPadding="xs">
8
+ {/* control A */}
9
+ <Bleed amount="s">
10
+ <Separator />
11
+ </Bleed>
12
+ {/* control B */}
13
+ </Stack>
14
+ ]]></tsx>
15
+ <notes>From `editor/sidebar/sidebar`. `amount="s"` cancels parent `hPadding="s"` so the Separator spans edge-to-edge inside the section body.</notes>
16
+ </example>
17
+
18
+ <example title="Full-width double rule (prompts)">
19
+ <tsx><![CDATA[
20
+ <Stack rowGap="4xl" hPadding="m" vPadding="3xl">
21
+ <Stack rowGap="l" hPadding="l">
22
+ <Text tone="muted" size="s" transform="uppercase" tracking="0.2rem">
23
+ Prompts
24
+ </Text>
25
+ <Title size="1" render={<h1 />} maxWidth="20ch" lineHeight="s">
26
+ Generate and reuse prompt packs
27
+ </Title>
28
+ <Text maxWidth="60ch" tone="muted" render={<p />}>
29
+ Keep intro copy inset while the rule below breaks out of page padding.
30
+ </Text>
31
+ </Stack>
32
+ <Bleed amount="m">
33
+ <Separator variant="double" size="l" />
34
+ </Bleed>
35
+ <Stack hPadding="l">{/* tabs */}</Stack>
36
+ </Stack>
37
+ ]]></tsx>
38
+ <notes>From `app/(hub)/prompts/page`. `amount="m"` matches outer Stack `hPadding="m"` so the double Separator hits the page edges.</notes>
39
+ </example>
40
+
41
+ <example title="Bleed trailing addon">
42
+ <tsx><![CDATA[
43
+ <Surface color={2} hoverColor={3} radius="m" vPadding="s">
44
+ <Stack direction="row" vAlign="center" hAlign="space-between" columnGap="s" hPadding="m" vPadding={[0, 's']}>
45
+ <Text size="xs" weight="semibold">
46
+ Colors
47
+ </Text>
48
+ <Bleed amount="s">
49
+ <Button variant="flat" size="s">
50
+ Reset
51
+ </Button>
52
+ </Bleed>
53
+ </Stack>
54
+ </Surface>
55
+ ]]></tsx>
56
+ <notes>From `editor/sidebar/sidebar` section `addon`. Bleed lets the reset control sit flush toward the Surface edge without shrinking header padding for the title.</notes>
6
57
  </example>
7
58
  </patterns>
@@ -16,7 +16,7 @@
16
16
  <prop name="full" kind="react">
17
17
  <description>Bleeds content to the viewport edges and ignores `amount`.</description>
18
18
  </prop>
19
- <css_var suffix="amount">
19
+ <prop name="amount" kind="css">
20
20
  <description>Bleed distance on the root via `margin: 0 calc(var(--vui-bleed-amount, 0) * -1)` (negative inline, zero block).</description>
21
- </css_var>
21
+ </prop>
22
22
  </props>
@@ -1,10 +1,13 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <usage surface="bleed">
3
- <do>Edge-to-edge media or dividers inside padded Surface or Stack containers</do>
3
+ <do>Edge-to-edge media or dividers inside padded Surface or Stack — match `amount` to the parent&apos;s `hPadding` token</do>
4
+ <do>Bleed a Separator across a padded Stack/Surface section so the rule hits the chrome edges without dropping parent padding for siblings</do>
5
+ <do>Flush trailing controls (e.g. flat Button) toward a Surface edge via Bleed while keeping title Stack padding intact</do>
4
6
  <do>Hero bands or callouts that should break out of card padding</do>
5
- <do>Full-bleed sections that span the viewport width from a centered layout</do>
7
+ <do>Full-bleed sections that span the viewport width from a centered layout — `full` ignores `amount`</do>
6
8
  <dont>Nesting multiple full bleeds without checking ancestor overflow</dont>
7
- <dont>Using Bleed to compensate for missing Stack padding instead of fixing layout composition</dont>
9
+ <dont>Using Bleed to compensate for missing Stack/Surface padding instead of fixing layout composition</dont>
8
10
  <dont>Applying full bleed inside narrow overflow-hidden cards without testing clipping</dont>
9
11
  <dont>Expecting full bleed `margin-left` to flip automatically in RTL</dont>
12
+ <dont>Inventing negative-margin CSS on Separator/Button when Bleed `amount` covers the breakout</dont>
10
13
  </usage>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <meta id="breakpoints" title="BreakpointsProvider" category="layout" shared_contract="breakpoints">
3
- <summary>Client provider plus `useBreakpoints` for mobile-first viewport min-width matches. Defaults are hardcoded em thresholds, not theme tokens.</summary>
3
+ <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>
4
4
  <exports>
5
5
  <export name="BreakpointsProvider" />
6
6
  </exports>
@@ -1,9 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <patterns surface="breakpoints">
3
- <example title="BreakpointsProvider structure">
4
- <tsx><![CDATA[<BreakpointsProvider>
5
- {children}
6
- </BreakpointsProvider>]]></tsx>
7
- <notes>Public assembly hint from legacy guide; not API authority.</notes>
8
- </example>
3
+ <!-- Skip: zero viraui-app and design-kitchen usage. Stories are MatchesProbe / matchMedia harness only — no consumer compose to promote. -->
9
4
  </patterns>
@@ -1,12 +1,14 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <props surface="breakpoints">
3
3
  <when_to_use>
4
- <item>Swap or hide React markup when the viewport crosses named breakpoints</item>
4
+ <item>Mobile-first viewport work: narrow base, enhance at larger min-width matches</item>
5
+ <item>Swap or hide React markup, or change Vira props, when the viewport crosses named breakpoints</item>
5
6
  <item>Read one flag with `useBreakpoints(&apos;small&apos;)` so unrelated breakpoint flips skip work</item>
6
7
  <item>Override the full map with the `breakpoints` prop for product-specific thresholds</item>
7
8
  </when_to_use>
8
9
  <when_not_to_use>
9
- <item>Layout that CSS `@media` or container queries can own without branching markup</item>
10
+ <item>Style-only changes CSS `@media (min-width)` can own — still use this map’s em lengths, not a parallel px system</item>
11
+ <item>Container-sized layout — use CSS `@container`, not this hook</item>
10
12
  <item>Calling `useBreakpoints` outside this provider</item>
11
13
  <item>Reading design-token CSS variables for breakpoint widths</item>
12
14
  </when_not_to_use>
@@ -1,9 +1,17 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <usage surface="breakpoints">
3
- <do>Swap or hide React markup when the viewport crosses named breakpoints</do>
3
+ <do>Wrap the app (or subtree) in `BreakpointsProvider`; call `useBreakpoints` inside to swap/hide React trees or change Vira props by viewport</do>
4
+ <do>Compose mobile-first: narrow Stack/Surface/Grid layout as the base; enhance when a min-width flag becomes true</do>
4
5
  <do>Read one flag with `useBreakpoints(&apos;small&apos;)` so unrelated breakpoint flips skip work</do>
5
- <do>Override the full map with the `breakpoints` prop for product-specific thresholds</do>
6
+ <do>For layout that follows a Stack&apos;s own inline-size, use Stack `enableContainer` + `@container stack` — not this viewport hook</do>
7
+ <do>For CSS-only style changes, write `@media (min-width: …)` using the same em lengths as this provider map</do>
8
+ <do>Override the full map with the `breakpoints` prop for product-specific thresholds (replaces defaults entirely)</do>
6
9
  <dont>Using `useBreakpoints` without wrapping the tree in `BreakpointsProvider`</dont>
10
+ <dont>Using this hook for container-sized layout — that is Stack/Surface `@container`, not viewport matches</dont>
7
11
  <dont>Merging a sparse custom map onto defaults — the `breakpoints` prop replaces the whole map</dont>
8
12
  <dont>Putting the provider in a Server Component module — wrap it in a Client Component (`&apos;use client&apos;`)</dont>
13
+ <dont>Inventing parallel px breakpoints (`768px`, `1024px`) or ad-hoc `matchMedia` beside this map</dont>
14
+ <dont>Desktop-first `max-width` media as the primary responsive strategy</dont>
15
+ <dont>Reading theme design-token widths as breakpoint thresholds</dont>
16
+ <dont>Branching React markup with CSS `@media` alone when props or tree structure must change — use the hook</dont>
9
17
  </usage>
@@ -1,11 +1,129 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <patterns surface="button">
3
- <example title="Button structure">
4
- <tsx><![CDATA[<Button>Save</Button>]]></tsx>
5
- <notes>Public assembly hint from legacy guide; not API authority.</notes>
3
+ <!-- Sources: viraui-app/components — cleaned (no handlers, no app-only chrome, no CSS that reinvents Stack props). -->
4
+
5
+ <example title="Hub nav (ButtonLink)">
6
+ <tsx><![CDATA[
7
+ <Stack render={<nav />} direction="row" vAlign="center" columnGap="xs">
8
+ <ButtonLink size="s" variant="secondary" href="/hub">
9
+ Hub
10
+ </ButtonLink>
11
+ <ButtonLink size="s" variant="flat" href="/studio">
12
+ Studio
13
+ </ButtonLink>
14
+ <ButtonLink size="s" variant="flat" href="/prompts">
15
+ Prompts
16
+ </ButtonLink>
17
+ </Stack>
18
+ ]]></tsx>
19
+ <notes>From `common/hub-header/hub-nav`. Active route uses `variant="secondary"`; others `flat`. App wraps Next `Link` via `render` — plain `href` fine for this hint.</notes>
6
20
  </example>
7
- <example title="ButtonLink structure">
8
- <tsx><![CDATA[<ButtonLink href="#">Save</ButtonLink>]]></tsx>
9
- <notes>Public assembly hint from legacy guide; not API authority.</notes>
21
+
22
+ <example title="Login form CTA + ButtonLink">
23
+ <tsx><![CDATA[
24
+ <form>
25
+ <Stack direction="row" columnGap="m" rowGap="m" hAlign="start" vAlign="start" wrap>
26
+ <Textfield type="email" placeholder="your@email.com" size={30} aria-label="Email" />
27
+ <Stack direction="row" vAlign="center" columnGap="m">
28
+ <Button type="submit">Send magic link</Button>
29
+ or
30
+ <ButtonLink variant="secondary" href="#">
31
+ Get ViraUI Pro
32
+ </ButtonLink>
33
+ </Stack>
34
+ </Stack>
35
+ </form>
36
+ ]]></tsx>
37
+ <notes>From `auth/login-form`. Submit `Button` beside secondary `ButtonLink`. Drop Beam / RHF / loading chrome from this hint.</notes>
38
+ </example>
39
+
40
+ <example title="Sign out (loading)">
41
+ <tsx><![CDATA[
42
+ <Button type="button" variant="secondary" loading>
43
+ Sign out
44
+ </Button>
45
+ ]]></tsx>
46
+ <notes>From `auth/sign-out-button`. `loading` keeps width while async work runs. No handler in the pattern.</notes>
47
+ </example>
48
+
49
+ <example title="Dialog action strip (export)">
50
+ <tsx><![CDATA[
51
+ <Stack direction="row" hAlign="center" columnGap="m">
52
+ <Button size="l" addon={<FileDownload />}>
53
+ Download
54
+ </Button>
55
+ <ButtonLink size="l" variant="secondary" href="#" addon={<ShareUpRight />}>
56
+ Share
57
+ </ButtonLink>
58
+ <Button size="l" variant="secondary" addon={<Code2 />}>
59
+ View code
60
+ </Button>
61
+ </Stack>
62
+ ]]></tsx>
63
+ <notes>From `editor/export-dialog`. Centered equal-feeling action row — Button + ButtonLink + Button. Gap via Stack, not per-button width CSS.</notes>
64
+ </example>
65
+
66
+ <example title="Dialog form actions (import)">
67
+ <tsx><![CDATA[
68
+ <Dialog.Sheet title="Import preset" description="Paste preset code." showCloseButton headerAlign="center">
69
+ <Stack rowGap="m" hAlign="center" hPadding="m" vPadding={['s', 0]}>
70
+ <Textfield size={40} placeholder="Paste preset…" aria-label="Preset code" />
71
+ <Stack direction="row" hAlign="end" columnGap="s">
72
+ <Button>Apply</Button>
73
+ <Dialog.Close render={<Button variant="secondary">Cancel</Button>} />
74
+ </Stack>
75
+ </Stack>
76
+ </Dialog.Sheet>
77
+ ]]></tsx>
78
+ <notes>From `editor/import-preset-dialog`. Trailing action row; Cancel via `Dialog.Close render={&lt;Button /&gt;}`. Trigger elsewhere uses `addon` + secondary.</notes>
79
+ </example>
80
+
81
+ <example title="Flat addon links (clone)">
82
+ <tsx><![CDATA[
83
+ <Stack hAlign="start" rowGap="2xs">
84
+ <Button addon={<CircleImage size={18} />} variant="flat" size="s">
85
+ Open with GitHub Desktop
86
+ </Button>
87
+ <Button addon={<ArrowDown size={18} />} variant="flat" size="s">
88
+ Download ZIP
89
+ </Button>
90
+ </Stack>
91
+ ]]></tsx>
92
+ <notes>From `editor/preview-grid/blocks/clone-repository`. Leading `addon` + flat small buttons stacked with Stack gap.</notes>
93
+ </example>
94
+
95
+ <example title="Full-width primary CTA">
96
+ <tsx><![CDATA[
97
+ <Surface color={2} hPadding="l" vPadding="m" radius="auto">
98
+ <Stack rowGap="m" expandChildren>
99
+ <Button>Review Order</Button>
100
+ <Text align="center" tone="muted" size="s">
101
+ Trades are typically executed within minutes during market hours.
102
+ </Text>
103
+ </Stack>
104
+ </Surface>
105
+ ]]></tsx>
106
+ <notes>From `editor/preview-grid/blocks/buy-investment`. `expandChildren` stretches Button — never `width: 100%` / `w-full` on the button.</notes>
107
+ </example>
108
+
109
+ <example title="Footer secondary + primary">
110
+ <tsx><![CDATA[
111
+ <Surface color={2} hPadding="l" vPadding="m">
112
+ <Stack columnGap="m" direction="row" hAlign="space-between" vAlign="center">
113
+ <Button variant="secondary">Reset</Button>
114
+ <Button>Save Preferences</Button>
115
+ </Stack>
116
+ </Surface>
117
+ ]]></tsx>
118
+ <notes>From `editor/preview-grid/blocks/preferences` footer. Opposite ends via `space-between`.</notes>
119
+ </example>
120
+
121
+ <example title="Chip addon (inverted on primary)">
122
+ <tsx><![CDATA[
123
+ <Button variant="primary" addon={<Chip data-mode="inverted">New</Chip>} addonPosition="end" pill>
124
+ Notifications
125
+ </Button>
126
+ ]]></tsx>
127
+ <notes>From button stories + `props.xml` / `usage.xml`. Primary Chip on primary Button needs `data-mode="inverted"` so chip fill contrasts the button.</notes>
10
128
  </example>
11
129
  </patterns>
@@ -10,6 +10,7 @@
10
10
  <when_not_to_use>
11
11
  <item>Icon-only actions without a visible label — use IconButton</item>
12
12
  <item>Navigation or non-button semantics — use ButtonLink</item>
13
+ <item>Forcing full panel width with CSS `width: 100%` / `w-full` — wrap in Stack with `fullWidth` and/or `expandChildren` (see stack units)</item>
13
14
  </when_not_to_use>
14
15
  <prop name="addon" kind="react">
15
16
  <description>Decorative addon rendered alongside the button label. Pass any React element; use a named icon from `@viraui/icons/react` or `&lt;Chip /&gt;` for status chips.</description>
@@ -50,52 +51,52 @@
50
51
  <prop name="variant" kind="react">
51
52
  <description>Selects the visual treatment matching Button. (button-link)</description>
52
53
  </prop>
53
- <css_var suffix="background">
54
+ <prop name="background" kind="css">
54
55
  <description>Button fill; variant and state selectors preset this.</description>
55
- </css_var>
56
- <css_var suffix="color">
56
+ </prop>
57
+ <prop name="color" kind="css">
57
58
  <description>Button label and icon color.</description>
58
- </css_var>
59
- <css_var suffix="height">
59
+ </prop>
60
+ <prop name="height" kind="css">
60
61
  <description>Button block size; size prop presets via data attributes.</description>
61
- </css_var>
62
- <css_var suffix="icon-size">
62
+ </prop>
63
+ <prop name="icon-size" kind="css">
63
64
  <description>Addon icon size inside the button.</description>
64
- </css_var>
65
- <css_var suffix="padding-block">
65
+ </prop>
66
+ <prop name="padding-block" kind="css">
66
67
  <description>Vertical padding inside the button.</description>
67
- </css_var>
68
- <css_var suffix="padding-inline">
68
+ </prop>
69
+ <prop name="padding-inline" kind="css">
69
70
  <description>Horizontal padding inside the button.</description>
70
- </css_var>
71
- <css_var suffix="radius">
71
+ </prop>
72
+ <prop name="radius" kind="css">
72
73
  <description>Corner radius; pill sets full radius via data-pill.</description>
73
- </css_var>
74
- <css_var suffix="spinner-color">
74
+ </prop>
75
+ <prop name="spinner-color" kind="css">
75
76
  <description>Loading spinner color on the root.</description>
76
- </css_var>
77
- <css_var suffix="background">
77
+ </prop>
78
+ <prop name="background" kind="css">
78
79
  <description>Button fill; variant and state selectors preset this. (button-link)</description>
79
- </css_var>
80
- <css_var suffix="color">
80
+ </prop>
81
+ <prop name="color" kind="css">
81
82
  <description>Button label and icon color. (button-link)</description>
82
- </css_var>
83
- <css_var suffix="height">
83
+ </prop>
84
+ <prop name="height" kind="css">
84
85
  <description>Button block size; size prop presets via data attributes. (button-link)</description>
85
- </css_var>
86
- <css_var suffix="icon-size">
86
+ </prop>
87
+ <prop name="icon-size" kind="css">
87
88
  <description>Addon icon size inside the button. (button-link)</description>
88
- </css_var>
89
- <css_var suffix="padding-block">
89
+ </prop>
90
+ <prop name="padding-block" kind="css">
90
91
  <description>Vertical padding inside the button. (button-link)</description>
91
- </css_var>
92
- <css_var suffix="padding-inline">
92
+ </prop>
93
+ <prop name="padding-inline" kind="css">
93
94
  <description>Horizontal padding inside the button. (button-link)</description>
94
- </css_var>
95
- <css_var suffix="radius">
95
+ </prop>
96
+ <prop name="radius" kind="css">
96
97
  <description>Corner radius; pill sets full radius via data-pill. (button-link)</description>
97
- </css_var>
98
- <css_var suffix="spinner-color">
98
+ </prop>
99
+ <prop name="spinner-color" kind="css">
99
100
  <description>Loading spinner color on the root. (button-link)</description>
100
- </css_var>
101
+ </prop>
101
102
  </props>
@@ -1,18 +1,18 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <usage surface="button">
3
- <do>Labeled actions with text and optional leading or trailing addon</do>
4
- <do>Primary, secondary, flat, or destructive visual treatments</do>
5
- <do>Capsule-shaped actions via pill when a fully rounded button fits the layout</do>
6
- <do>Async actions that need a stable width while loading</do>
7
- <do>Primary Chip addons inside a primary Button — set data-mode=&quot;inverted&quot; on the Chip so its background contrasts the button fill</do>
8
- <do>Actions that navigate (href or router Link) but should look like Button</do>
9
- <do>Same size, variant, addon, pill, and loading chrome as Button without button semantics</do>
10
- <do>Compose with Next.js Link or React Router Link via the render prop</do>
3
+ <do>Labeled actions with text and optional leading or trailing `addon`</do>
4
+ <do>Primary, secondary, flat, or destructive treatments; use `pill` for capsule shape</do>
5
+ <do>Async actions that need stable width while `loading`</do>
6
+ <do>Login / signup / form submit rows: Stack + Textfield(s) (+ optional Tabs / Fieldset) + submit Button — gap and align via Stack, no custom CSS</do>
7
+ <do>Full-bleed or equal-width Buttons: wrap in Stack with `fullWidth` and/or `expandChildren` — never per-Button width CSS</do>
8
+ <do>Dialog / sheet action strips: Stack row of Button + ButtonLink; Cancel via `Dialog.Close render={&lt;Button variant=&quot;secondary&quot; /&gt;}`</do>
9
+ <do>Primary Chip addons inside a primary Button — set `data-mode=&quot;inverted&quot;` on the Chip so its fill contrasts</do>
10
+ <do>Navigation that should look like Button — use ButtonLink (framework Link via `render`)</do>
11
11
  <dont>Using Button without children as icon-only — prefer IconButton</dont>
12
- <dont>Using Button with render={&lt;a /&gt;} for links — Base UI enforces button semantics; use ButtonLink</dont>
12
+ <dont>Using Button with `render={&lt;a /&gt;}` for links — Base UI enforces button semantics; use ButtonLink</dont>
13
+ <dont>Inventing `width: 100%` / `w-full` / `.fullWidth` / `flex: 1` CSS on Button when a parent Stack can own the fill</dont>
13
14
  <dont>Duplicating icon size on every addon slot — Button CSS sizes SVG descendants</dont>
14
- <dont>Mixing pill with custom border-radius overrides that fight data-pill styling</dont>
15
- <dont>Primary Chip addon inside a primary Button without data-mode=&quot;inverted&quot; — chip background matches the button fill and disappears</dont>
16
- <dont>Using Button with render={&lt;a /&gt;} instead of ButtonLink</dont>
17
- <dont>Forcing role=button on a link</dont>
15
+ <dont>Mixing `pill` with custom border-radius overrides that fight `data-pill` styling</dont>
16
+ <dont>Primary Chip addon inside a primary Button without `data-mode=&quot;inverted&quot;` — chip fill matches the button and disappears</dont>
17
+ <dont>Forcing `role=&quot;button&quot;` on a link</dont>
18
18
  </usage>