@tempoxyz/ds 0.3.14 → 0.3.16

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 (209) hide show
  1. package/dist/docs/AGENTS.md +75 -10
  2. package/dist/docs/arsenal.md +44 -0
  3. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +32 -24
  4. package/dist/docs/product/components/actions.md +2110 -0
  5. package/dist/docs/product/components/blockchain.md +3969 -0
  6. package/dist/docs/product/components/data-display.md +5901 -0
  7. package/dist/docs/product/components/feedback-and-status.md +4138 -0
  8. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  9. package/dist/docs/product/components/layout.md +3339 -0
  10. package/dist/docs/product/components/navigation.md +2914 -0
  11. package/dist/docs/product/components/overlays.md +4917 -0
  12. package/dist/docs/product/components.md +125 -125
  13. package/dist/docs/product/foundations.md +4597 -0
  14. package/dist/docs/product/patterns.md +10110 -0
  15. package/dist/marketing/index.js.zyzz.json +1 -1
  16. package/dist/marketing/vars.d.ts +618 -758
  17. package/dist/marketing/vars.d.ts.map +1 -1
  18. package/dist/marketing/vars.js +8 -5
  19. package/dist/marketing/vars.js.map +1 -1
  20. package/dist/marketing/vars.js.zyzz.json +1 -1
  21. package/dist/marketing/zyzz.config.d.ts +3042 -3757
  22. package/dist/marketing/zyzz.config.d.ts.map +1 -1
  23. package/dist/marketing/zyzz.config.js +1 -1
  24. package/dist/marketing/zyzz.config.js.map +1 -1
  25. package/dist/marketing/zyzz.config.js.zyzz.json +1 -1
  26. package/dist/mobile/components/Button.d.ts +115 -15
  27. package/dist/mobile/components/Button.d.ts.map +1 -1
  28. package/dist/mobile/components/Button.js +85 -14
  29. package/dist/mobile/components/Button.js.map +1 -1
  30. package/dist/mobile/components/IconButton.d.ts +129 -40
  31. package/dist/mobile/components/IconButton.d.ts.map +1 -1
  32. package/dist/mobile/components/IconButton.js +97 -28
  33. package/dist/mobile/components/IconButton.js.map +1 -1
  34. package/dist/mobile/components/TextInput.d.ts +132 -11
  35. package/dist/mobile/components/TextInput.d.ts.map +1 -1
  36. package/dist/mobile/components/TextInput.js +115 -14
  37. package/dist/mobile/components/TextInput.js.map +1 -1
  38. package/dist/mobile/index.d.ts +1 -0
  39. package/dist/mobile/index.d.ts.map +1 -1
  40. package/dist/mobile/index.js +1 -0
  41. package/dist/mobile/index.js.map +1 -1
  42. package/dist/mobile/vars.d.ts +103 -0
  43. package/dist/mobile/vars.d.ts.map +1 -1
  44. package/dist/mobile/vars.js +74 -0
  45. package/dist/mobile/vars.js.map +1 -1
  46. package/dist/mobile/zyzz.config.d.ts +408 -0
  47. package/dist/mobile/zyzz.config.d.ts.map +1 -1
  48. package/dist/web/components/AddressCard.js.zyzz.json +1 -1
  49. package/dist/web/components/Amount.css +1 -1
  50. package/dist/web/components/Amount.d.ts +9 -0
  51. package/dist/web/components/Amount.d.ts.map +1 -1
  52. package/dist/web/components/Amount.js +8 -5
  53. package/dist/web/components/Amount.js.map +1 -1
  54. package/dist/web/components/Amount.js.zyzz.json +1 -1
  55. package/dist/web/components/CopyButton.d.ts +6 -0
  56. package/dist/web/components/CopyButton.d.ts.map +1 -1
  57. package/dist/web/components/CopyButton.js +4 -1
  58. package/dist/web/components/CopyButton.js.map +1 -1
  59. package/dist/web/components/CopyButton.js.zyzz.json +1 -1
  60. package/dist/web/components/Hex.css +1 -1
  61. package/dist/web/components/Hex.d.ts +84 -3
  62. package/dist/web/components/Hex.d.ts.map +1 -1
  63. package/dist/web/components/Hex.js +20 -13
  64. package/dist/web/components/Hex.js.map +1 -1
  65. package/dist/web/components/Hex.js.zyzz.json +1 -1
  66. package/dist/web/components/Progress.css +1 -1
  67. package/dist/web/components/Progress.d.ts +12 -2
  68. package/dist/web/components/Progress.d.ts.map +1 -1
  69. package/dist/web/components/Progress.js +9 -5
  70. package/dist/web/components/Progress.js.map +1 -1
  71. package/dist/web/components/Progress.js.zyzz.json +1 -1
  72. package/dist/web/components/SecretValue.js.zyzz.json +1 -1
  73. package/dist/web/components/SidebarMenu.d.ts +4 -4
  74. package/dist/web/components/SidebarMenu.js +6 -6
  75. package/dist/web/components/SidebarMenu.js.map +1 -1
  76. package/dist/web/components/Snippet.js.zyzz.json +1 -1
  77. package/dist/web/index.js.zyzz.json +1 -1
  78. package/package.json +1 -1
  79. package/src/marketing/README.md +1 -1
  80. package/src/marketing/vars.ts +526 -604
  81. package/src/marketing/zyzz.config.ts +5 -4
  82. package/src/mobile/README.md +19 -6
  83. package/src/mobile/components/Button.tsx +94 -17
  84. package/src/mobile/components/IconButton.tsx +122 -30
  85. package/src/mobile/components/TextInput.tsx +139 -24
  86. package/src/mobile/index.ts +1 -0
  87. package/src/mobile/vars.ts +74 -0
  88. package/src/web/components/Amount.tsx +37 -3
  89. package/src/web/components/CopyButton.tsx +8 -0
  90. package/src/web/components/Hex.tsx +79 -13
  91. package/src/web/components/Progress.tsx +8 -2
  92. package/src/web/components/SidebarMenu.tsx +6 -6
  93. package/dist/docs/index.md +0 -145
  94. package/dist/docs/product/components/accordion.md +0 -489
  95. package/dist/docs/product/components/address-card.md +0 -147
  96. package/dist/docs/product/components/agent-logo.md +0 -194
  97. package/dist/docs/product/components/alert-dialog.md +0 -631
  98. package/dist/docs/product/components/alert.md +0 -448
  99. package/dist/docs/product/components/amount-input.md +0 -305
  100. package/dist/docs/product/components/amount.md +0 -794
  101. package/dist/docs/product/components/app-shell.md +0 -559
  102. package/dist/docs/product/components/asset-chip.md +0 -294
  103. package/dist/docs/product/components/autocomplete.md +0 -620
  104. package/dist/docs/product/components/avatar.md +0 -321
  105. package/dist/docs/product/components/badge.md +0 -339
  106. package/dist/docs/product/components/badged-logo.md +0 -116
  107. package/dist/docs/product/components/banner.md +0 -379
  108. package/dist/docs/product/components/bar-chart.md +0 -208
  109. package/dist/docs/product/components/breadcrumbs.md +0 -380
  110. package/dist/docs/product/components/button-group.md +0 -286
  111. package/dist/docs/product/components/button.md +0 -650
  112. package/dist/docs/product/components/calendar.md +0 -375
  113. package/dist/docs/product/components/callout.md +0 -96
  114. package/dist/docs/product/components/checkbox-group.md +0 -521
  115. package/dist/docs/product/components/checkbox.md +0 -467
  116. package/dist/docs/product/components/choice-group.md +0 -516
  117. package/dist/docs/product/components/choicebox.md +0 -641
  118. package/dist/docs/product/components/code.md +0 -100
  119. package/dist/docs/product/components/combobox.md +0 -939
  120. package/dist/docs/product/components/container.md +0 -257
  121. package/dist/docs/product/components/copy-button.md +0 -642
  122. package/dist/docs/product/components/date-picker.md +0 -514
  123. package/dist/docs/product/components/dialog.md +0 -1332
  124. package/dist/docs/product/components/drawer.md +0 -966
  125. package/dist/docs/product/components/empty.md +0 -340
  126. package/dist/docs/product/components/field.md +0 -570
  127. package/dist/docs/product/components/fieldset.md +0 -398
  128. package/dist/docs/product/components/frame.md +0 -434
  129. package/dist/docs/product/components/gauge.md +0 -299
  130. package/dist/docs/product/components/get-started-visual.md +0 -117
  131. package/dist/docs/product/components/grid.md +0 -288
  132. package/dist/docs/product/components/hero-visual.md +0 -155
  133. package/dist/docs/product/components/hex.md +0 -487
  134. package/dist/docs/product/components/icon-tile.md +0 -292
  135. package/dist/docs/product/components/identicon.md +0 -371
  136. package/dist/docs/product/components/inline.md +0 -233
  137. package/dist/docs/product/components/inset.md +0 -225
  138. package/dist/docs/product/components/kbd.md +0 -423
  139. package/dist/docs/product/components/list-group.md +0 -981
  140. package/dist/docs/product/components/loading-dots.md +0 -237
  141. package/dist/docs/product/components/menu.md +0 -934
  142. package/dist/docs/product/components/native-select.md +0 -204
  143. package/dist/docs/product/components/network-logo.md +0 -248
  144. package/dist/docs/product/components/number-field.md +0 -543
  145. package/dist/docs/product/components/otp-field.md +0 -616
  146. package/dist/docs/product/components/pagination.md +0 -516
  147. package/dist/docs/product/components/popover.md +0 -544
  148. package/dist/docs/product/components/progress.md +0 -388
  149. package/dist/docs/product/components/qr.md +0 -314
  150. package/dist/docs/product/components/radio-group.md +0 -528
  151. package/dist/docs/product/components/secret-value.md +0 -406
  152. package/dist/docs/product/components/select.md +0 -751
  153. package/dist/docs/product/components/separator.md +0 -379
  154. package/dist/docs/product/components/sidebar-menu.md +0 -922
  155. package/dist/docs/product/components/skeleton.md +0 -517
  156. package/dist/docs/product/components/slider.md +0 -539
  157. package/dist/docs/product/components/snippet.md +0 -424
  158. package/dist/docs/product/components/spinner.md +0 -216
  159. package/dist/docs/product/components/split-bar.md +0 -139
  160. package/dist/docs/product/components/split-button.md +0 -464
  161. package/dist/docs/product/components/stack.md +0 -299
  162. package/dist/docs/product/components/status-chip.md +0 -226
  163. package/dist/docs/product/components/status-indicator.md +0 -119
  164. package/dist/docs/product/components/status-row.md +0 -174
  165. package/dist/docs/product/components/stepper.md +0 -451
  166. package/dist/docs/product/components/success-hero.md +0 -157
  167. package/dist/docs/product/components/surface.md +0 -639
  168. package/dist/docs/product/components/switch.md +0 -472
  169. package/dist/docs/product/components/table.md +0 -968
  170. package/dist/docs/product/components/tabs.md +0 -627
  171. package/dist/docs/product/components/tempo-logo.md +0 -185
  172. package/dist/docs/product/components/text-input.md +0 -624
  173. package/dist/docs/product/components/textarea.md +0 -352
  174. package/dist/docs/product/components/toast.md +0 -535
  175. package/dist/docs/product/components/token-logo.md +0 -371
  176. package/dist/docs/product/components/token.md +0 -247
  177. package/dist/docs/product/components/tooltip.md +0 -490
  178. package/dist/docs/product/components/verification-code.md +0 -116
  179. package/dist/docs/product/components/visual.md +0 -249
  180. package/dist/docs/product/foundations/accessibility.md +0 -377
  181. package/dist/docs/product/foundations/agents.md +0 -159
  182. package/dist/docs/product/foundations/color.md +0 -522
  183. package/dist/docs/product/foundations/content/tone.md +0 -194
  184. package/dist/docs/product/foundations/content/voice.md +0 -194
  185. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  186. package/dist/docs/product/foundations/iconography.md +0 -282
  187. package/dist/docs/product/foundations/intent.md +0 -360
  188. package/dist/docs/product/foundations/layout.md +0 -508
  189. package/dist/docs/product/foundations/linter.md +0 -523
  190. package/dist/docs/product/foundations/motion.md +0 -151
  191. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  192. package/dist/docs/product/foundations/typography.md +0 -331
  193. package/dist/docs/product/introduction/faq.md +0 -133
  194. package/dist/docs/product/introduction/getting-started.md +0 -377
  195. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  196. package/dist/docs/product/patterns/dashboards.md +0 -638
  197. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  198. package/dist/docs/product/patterns/empty-states.md +0 -612
  199. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  200. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  201. package/dist/docs/product/patterns/forms.md +0 -679
  202. package/dist/docs/product/patterns/loading.md +0 -630
  203. package/dist/docs/product/patterns/navigation.md +0 -397
  204. package/dist/docs/product/patterns/payments.md +0 -765
  205. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  206. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  207. package/dist/docs/product/products/tempo-console.md +0 -671
  208. package/dist/docs/product/products/tempo-performance.md +0 -435
  209. package/dist/docs/product/products/tempo-wallet.md +0 -438
@@ -1,174 +0,0 @@
1
- # StatusRow
2
-
3
- Follows the status of one payment or task while it runs.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/StatusRow.tsx)
6
-
7
- Figma: [Messaging/Status Row](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-3981)
8
-
9
- ## Overview
10
-
11
- A status row renders a tinted row with a leading mark, a title over a description, and an optional trailing [StatusChip](status-chip.md). It announces a change of its text to screen readers, so it can update in place as the task moves on.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- import { Spinner, StatusChip, StatusRow } from '@tempoxyz/ds'
19
-
20
- export function Demo() {
21
- return (
22
- <StatusRow>
23
- <StatusRow.Icon>
24
- <Spinner />
25
- </StatusRow.Icon>
26
- <StatusRow.Content>
27
- <StatusRow.Title>Waiting for $10.00</StatusRow.Title>
28
- <StatusRow.Description>
29
- Usually under a minute on Tempo. You can leave this page.
30
- </StatusRow.Description>
31
- </StatusRow.Content>
32
- <StatusChip intent="warning" size="small">
33
- Pending
34
- </StatusChip>
35
- </StatusRow>
36
- )
37
- }
38
- ```
39
-
40
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/StatusRow/Basic.tsx)
41
-
42
- ### Intent
43
-
44
- Set `intent` to `neutral` (default) while the task runs, or `positive` once it is done.
45
-
46
- ```tsx
47
- import { StatusRow } from '@tempoxyz/ds'
48
- import { CheckCircle } from '@tempoxyz/ds/icons'
49
-
50
- export function Demo() {
51
- return (
52
- <StatusRow intent="positive">
53
- <StatusRow.Icon>
54
- <CheckCircle />
55
- </StatusRow.Icon>
56
- <StatusRow.Content>
57
- <StatusRow.Title>Received $10.00</StatusRow.Title>
58
- <StatusRow.Description>The funds are in your wallet.</StatusRow.Description>
59
- </StatusRow.Content>
60
- </StatusRow>
61
- )
62
- }
63
- ```
64
-
65
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/StatusRow/Intent.tsx)
66
-
67
- ## Anatomy
68
-
69
- Import the component and assemble its parts.
70
-
71
- ```tsx
72
- import { StatusRow } from '@tempoxyz/ds'
73
-
74
- <StatusRow>
75
- <StatusRow.Icon />
76
- <StatusRow.Content>
77
- <StatusRow.Title />
78
- <StatusRow.Description />
79
- </StatusRow.Content>
80
- </StatusRow>
81
- ```
82
-
83
- ## Guidelines
84
-
85
- ### When to Use
86
-
87
- * Follow a deposit, a payment, or an authorization that completes within minutes.
88
- * Confirm in place that the task finished.
89
-
90
- ### When Not to Use
91
-
92
- * Use [Alert](alert.md) for guidance that is not tied to a running task.
93
- * Use [Toast](toast.md) to confirm an action briefly and out of the flow.
94
- * Use [ListGroup](list-group.md) for a list of finished payments.
95
-
96
- ### Match the Mark to the State
97
-
98
- * **Running (neutral):** A spinner, with a chip that names the step.
99
- * **Done (positive):** A check in the positive color, without a chip.
100
-
101
- ### State the Task and the Wait
102
-
103
- **Do:** Name the amount in the title and the expected wait in the description.
104
-
105
- ```tsx
106
- import { Spinner, StatusRow } from '@tempoxyz/ds'
107
-
108
- export function Demo() {
109
- return (
110
- <StatusRow>
111
- <StatusRow.Icon>
112
- <Spinner />
113
- </StatusRow.Icon>
114
- <StatusRow.Content>
115
- <StatusRow.Title>Waiting for $10.00</StatusRow.Title>
116
- <StatusRow.Description>Usually under a minute on Tempo.</StatusRow.Description>
117
- </StatusRow.Content>
118
- </StatusRow>
119
- )
120
- }
121
- ```
122
-
123
- **Don't:** Ask people to wait without saying for what or for how long.
124
-
125
- ```tsx
126
- import { Spinner, StatusRow } from '@tempoxyz/ds'
127
-
128
- export function Demo() {
129
- return (
130
- <StatusRow>
131
- <StatusRow.Icon>
132
- <Spinner />
133
- </StatusRow.Icon>
134
- <StatusRow.Content>
135
- <StatusRow.Title>Please wait</StatusRow.Title>
136
- <StatusRow.Description>Something is happening.</StatusRow.Description>
137
- </StatusRow.Content>
138
- </StatusRow>
139
- )
140
- }
141
- ```
142
-
143
- ## Content
144
-
145
- ### Write the Title and the Description
146
-
147
- Start the title with the state and the amount, such as Waiting for $10.00. In the description, give the expected wait and whether people can leave the page.
148
-
149
- ## Accessibility
150
-
151
- A status row renders a `<div>` with the `status` role, so screen readers announce a change of its text politely. The leading mark is hidden.
152
-
153
- ### Semantics
154
-
155
- * **Root (status):** Screen readers announce a change of the text without moving focus.
156
- * **Icon (aria-hidden):** The spinner and the check are hidden, so the title carries the state.
157
-
158
- ### Your Responsibilities
159
-
160
- * **Update the Row in Place (SC 4.1.3):** Change the text of the mounted row, so the status role announces it.
161
-
162
- ## Related
163
-
164
- [StatusChip](status-chip.md)
165
-
166
- Use for the status at the end of the row.
167
-
168
- [Spinner](spinner.md)
169
-
170
- Use for the leading mark while the task runs.
171
-
172
- [Alert](alert.md)
173
-
174
- Use for guidance that is not tied to a running task.
@@ -1,451 +0,0 @@
1
- # Stepper
2
-
3
- Shows progress through a fixed sequence of steps.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Stepper.tsx)
6
-
7
- Figma: [Controls/Stepper](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-1489) (`Stepper.Root`)
8
-
9
- ## Overview
10
-
11
- A stepper renders the steps as a row of 24px segments, 4px apart. Pass `aria-label` to name the flow, such as Account setup.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- import { Stepper, style } from '@tempoxyz/ds'
19
-
20
- export const fill = true
21
- export function Demo() {
22
- return <Stepper.Root aria-label="Account setup" count={3} value={1} {...styles.stepper()} />
23
- }
24
-
25
- namespace styles {
26
- export const stepper = style({ maxWidth: '24rem !custom' })
27
- }
28
- ```
29
-
30
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Stepper/Basic.tsx)
31
-
32
- ### Value
33
-
34
- Set `count` to the number of steps and `value` to the current step, from `1` to `count`.
35
-
36
- ```tsx
37
- import { Stepper, style } from '@tempoxyz/ds'
38
-
39
- export const fill = true
40
- export function Demo() {
41
- return (
42
- <div {...styles.stack()}>
43
- {[1, 2, 3].map((value) => (
44
- <Stepper.Root aria-label="Account setup" count={3} key={value} value={value} />
45
- ))}
46
- </div>
47
- )
48
- }
49
-
50
- namespace styles {
51
- export const stack = style({
52
- display: 'flex',
53
- flexDirection: 'column',
54
- gap: '16',
55
- maxWidth: '24rem !custom',
56
- })
57
- }
58
- ```
59
-
60
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Stepper/Value.tsx)
61
-
62
- ## Anatomy
63
-
64
- Import the component and assemble its parts.
65
-
66
- ```tsx
67
- import { Stepper } from '@tempoxyz/ds'
68
-
69
- <Stepper.Root />
70
- ```
71
-
72
- ## Guidelines
73
-
74
- ### When to Use
75
-
76
- * Show a multi-step flow with a fixed number of steps, such as onboarding (Create passkey, Back up, Add funds) or a send flow (Recipient, Amount, Review).
77
- * Split one long setup form into short screens, such as business verification before API key access.
78
-
79
- ### When Not to Use
80
-
81
- * Use [Progress](progress.md) for measurable work, such as a file upload or a sync to the latest block.
82
- * Use [Tabs](tabs.md) for sections in any order. A stepper is not interactive, and its segments don't link to steps.
83
- * Use [Breadcrumbs](breadcrumbs.md) to show where a page sits in the hierarchy.
84
- * Use one form, laid out with [Field](field.md) and [Fieldset](fieldset.md), when the task fits on one screen.
85
-
86
- ### Keep the Step Count Fixed
87
-
88
- Set `count` once for the whole flow, and aim for three to five steps. Merge short steps before you add segments. If an answer skips a step, keep its segment and move past it.
89
-
90
- **Do:** Keep the same total on every step.
91
-
92
- ```tsx
93
- /** Do example for "Keep the Step Count Fixed" on the Stepper page: keep the same total on every step. @module */
94
- import { Stepper, style } from '@tempoxyz/ds'
95
-
96
- /** Renders the static preview, which the guideline card shows inert. */
97
- export function Demo() {
98
- return (
99
- <div {...styles.flow()}>
100
- <div {...styles.screen()}>
101
- <Stepper.Root aria-label="Account setup" count={4} value={1} />
102
- <span {...styles.step()}>Step 1 of 4</span>
103
- </div>
104
- <div {...styles.screen()}>
105
- <Stepper.Root aria-label="Account setup" count={4} value={2} />
106
- <span {...styles.step()}>Step 2 of 4</span>
107
- </div>
108
- </div>
109
- )
110
- }
111
-
112
- namespace styles {
113
- export const flow = style({
114
- display: 'flex',
115
- flexDirection: 'column',
116
- rowGap: '24',
117
- width: '100% !custom',
118
- })
119
-
120
- export const screen = style({ display: 'flex', flexDirection: 'column', rowGap: '8' })
121
-
122
- export const step = style({ color: 'content.secondary', typography: 'body.b3' })
123
- }
124
- ```
125
-
126
- **Don't:** Change the total partway, which makes the progress look wrong.
127
-
128
- ```tsx
129
- /**
130
- * Don't example for "Keep the Step Count Fixed" on the Stepper page.
131
- * Don't change the total partway, which makes the progress look wrong.
132
- * @module
133
- */
134
- import { Stepper, style } from '@tempoxyz/ds'
135
-
136
- /** Renders the static preview, which the guideline card shows inert. */
137
- export function Demo() {
138
- return (
139
- <div {...styles.flow()}>
140
- <div {...styles.screen()}>
141
- <Stepper.Root aria-label="Account setup" count={3} value={1} />
142
- <span {...styles.step()}>Step 1 of 3</span>
143
- </div>
144
- <div {...styles.screen()}>
145
- <Stepper.Root aria-label="Account setup" count={5} value={2} />
146
- <span {...styles.step()}>Step 2 of 5</span>
147
- </div>
148
- </div>
149
- )
150
- }
151
-
152
- namespace styles {
153
- export const flow = style({
154
- display: 'flex',
155
- flexDirection: 'column',
156
- rowGap: '24',
157
- width: '100% !custom',
158
- })
159
-
160
- export const screen = style({ display: 'flex', flexDirection: 'column', rowGap: '8' })
161
-
162
- export const step = style({ color: 'content.secondary', typography: 'body.b3' })
163
- }
164
- ```
165
-
166
- ### Label the Current Step in Text
167
-
168
- The segments carry no text. Place a visible step number and a heading above the stepper, such as Step 2 of 3 above Enter amount.
169
-
170
- **Do:** Pair the stepper with the step number and the step's title.
171
-
172
- ```tsx
173
- /**
174
- * Do example for "Label the Current Step in Text" on the Stepper page.
175
- * Pair the stepper with the step number and the step's title.
176
- * @module
177
- */
178
- import { Stepper, style } from '@tempoxyz/ds'
179
-
180
- /** Renders the static preview, which the guideline card shows inert. */
181
- export function Demo() {
182
- return (
183
- <div {...styles.flow()}>
184
- <Stepper.Root aria-label="Send payment" count={3} value={2} />
185
- <span {...styles.step()}>Step 2 of 3</span>
186
- <span {...styles.title()}>Enter amount</span>
187
- </div>
188
- )
189
- }
190
-
191
- namespace styles {
192
- export const flow = style({
193
- display: 'flex',
194
- flexDirection: 'column',
195
- rowGap: '8',
196
- width: '100% !custom',
197
- })
198
-
199
- export const step = style({
200
- color: 'content.secondary',
201
- marginBlockStart: '8',
202
- typography: 'body.b3',
203
- })
204
-
205
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
206
- }
207
- ```
208
-
209
- **Don't:** Show the segments without any text.
210
-
211
- ```tsx
212
- /**
213
- * Don't example for "Label the Current Step in Text" on the Stepper page.
214
- * Don't show the segments without any text.
215
- * @module
216
- */
217
- import { Stepper, style } from '@tempoxyz/ds'
218
-
219
- /** Renders the static preview, which the guideline card shows inert. */
220
- export function Demo() {
221
- return (
222
- <div {...styles.flow()}>
223
- <Stepper.Root count={3} value={2} />
224
- </div>
225
- )
226
- }
227
-
228
- namespace styles {
229
- export const flow = style({ width: '100% !custom' })
230
- }
231
- ```
232
-
233
- ### Let People Go Back
234
-
235
- Give every step after the first a Back button before the primary action, and keep the values already entered. Make the last step a review with a specific primary action, such as Confirm payment, and set `value` to `count` there.
236
-
237
- **Do:** Offer Back before the primary action.
238
-
239
- ```tsx
240
- /** Do example for "Let People Go Back" on the Stepper page: offer Back before the primary action. @module */
241
- import { Button, Stepper, style } from '@tempoxyz/ds'
242
-
243
- /** Renders the static preview, which the guideline card shows inert. */
244
- export function Demo() {
245
- return (
246
- <div {...styles.flow()}>
247
- <Stepper.Root aria-label="Send payment" count={3} value={2} />
248
- <span {...styles.step()}>Step 2 of 3</span>
249
- <span {...styles.title()}>Enter amount</span>
250
- <div {...styles.actions()}>
251
- <Button variant="secondary">Back</Button>
252
- <Button>Continue</Button>
253
- </div>
254
- </div>
255
- )
256
- }
257
-
258
- namespace styles {
259
- export const actions = style({
260
- columnGap: '8',
261
- display: 'flex',
262
- justifyContent: 'flex-end',
263
- marginBlockStart: '16',
264
- })
265
-
266
- export const flow = style({
267
- display: 'flex',
268
- flexDirection: 'column',
269
- rowGap: '8',
270
- width: '100% !custom',
271
- })
272
-
273
- export const step = style({
274
- color: 'content.secondary',
275
- marginBlockStart: '8',
276
- typography: 'body.b3',
277
- })
278
-
279
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
280
- }
281
- ```
282
-
283
- **Don't:** Leave a step with only a way forward.
284
-
285
- ```tsx
286
- /**
287
- * Don't example for "Let People Go Back" on the Stepper page.
288
- * Don't leave a step with only a way forward.
289
- * @module
290
- */
291
- import { Button, Stepper, style } from '@tempoxyz/ds'
292
-
293
- /** Renders the static preview, which the guideline card shows inert. */
294
- export function Demo() {
295
- return (
296
- <div {...styles.flow()}>
297
- <Stepper.Root aria-label="Send payment" count={3} value={2} />
298
- <span {...styles.step()}>Step 2 of 3</span>
299
- <span {...styles.title()}>Enter amount</span>
300
- <div {...styles.actions()}>
301
- <Button>Continue</Button>
302
- </div>
303
- </div>
304
- )
305
- }
306
-
307
- namespace styles {
308
- export const actions = style({
309
- columnGap: '8',
310
- display: 'flex',
311
- justifyContent: 'flex-end',
312
- marginBlockStart: '16',
313
- })
314
-
315
- export const flow = style({
316
- display: 'flex',
317
- flexDirection: 'column',
318
- rowGap: '8',
319
- width: '100% !custom',
320
- })
321
-
322
- export const step = style({
323
- color: 'content.secondary',
324
- marginBlockStart: '8',
325
- typography: 'body.b3',
326
- })
327
-
328
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
329
- }
330
- ```
331
-
332
- ### Keep It in One Place
333
-
334
- Place the stepper in the same spot on every step. In a [Dialog](dialog.md) or a [Frame](frame.md), center it in the header, with the Back button on the left from the second step.
335
-
336
- **Do:** Place the stepper at the top, above the step's heading.
337
-
338
- ```tsx
339
- /**
340
- * Do example for "Label the Current Step in Text" on the Stepper page.
341
- * Pair the stepper with the step number and the step's title.
342
- * @module
343
- */
344
- import { Stepper, style } from '@tempoxyz/ds'
345
-
346
- /** Renders the static preview, which the guideline card shows inert. */
347
- export function Demo() {
348
- return (
349
- <div {...styles.flow()}>
350
- <Stepper.Root aria-label="Send payment" count={3} value={2} />
351
- <span {...styles.step()}>Step 2 of 3</span>
352
- <span {...styles.title()}>Enter amount</span>
353
- </div>
354
- )
355
- }
356
-
357
- namespace styles {
358
- export const flow = style({
359
- display: 'flex',
360
- flexDirection: 'column',
361
- rowGap: '8',
362
- width: '100% !custom',
363
- })
364
-
365
- export const step = style({
366
- color: 'content.secondary',
367
- marginBlockStart: '8',
368
- typography: 'body.b3',
369
- })
370
-
371
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
372
- }
373
- ```
374
-
375
- **Don't:** Place the stepper below the step's content.
376
-
377
- ```tsx
378
- /**
379
- * Don't example for "Keep It in One Place" on the Stepper page.
380
- * Don't place the stepper below the step's content.
381
- * @module
382
- */
383
- import { Stepper, style } from '@tempoxyz/ds'
384
-
385
- /** Renders the static preview, which the guideline card shows inert. */
386
- export function Demo() {
387
- return (
388
- <div {...styles.flow()}>
389
- <span {...styles.step()}>Step 2 of 3</span>
390
- <span {...styles.title()}>Enter amount</span>
391
- <Stepper.Root aria-label="Send payment" count={3} value={2} {...styles.stepper()} />
392
- </div>
393
- )
394
- }
395
-
396
- namespace styles {
397
- export const flow = style({
398
- display: 'flex',
399
- flexDirection: 'column',
400
- rowGap: '8',
401
- width: '100% !custom',
402
- })
403
-
404
- export const step = style({ color: 'content.secondary', typography: 'body.b3' })
405
-
406
- export const stepper = style({ marginBlockStart: '16' })
407
-
408
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
409
- }
410
- ```
411
-
412
- ## Content
413
-
414
- * Write step titles as short tasks or nouns, such as Recipient, Amount, and Review.
415
- * Match the visible step text to the announced value, Step 2 of 3.
416
- * Before the first step, list what people need, such as an ID or a funded wallet.
417
-
418
- ## Accessibility
419
-
420
- A stepper renders a `progressbar` whose value is the current step. The segments are visual only.
421
-
422
- ### Semantics
423
-
424
- * **Root (progressbar):** Its value is the current step, 1 to `count`.
425
- * **Value Text (aria-valuetext):** Reads as "Step 2 of 4".
426
- * **Name (aria-label):** Named "Progress" by default.
427
- * **No Focus Stop (not focusable):** Tab moves past it to the next control.
428
-
429
- ### Your Responsibilities
430
-
431
- * **Name the Flow (aria-label):** Name the flow, such as "Account setup". Don't repeat the step text, which is already read.
432
- * **Label Each Step (SC 1.3.1):** Name the current step in visible text, so progress doesn't rely on color alone.
433
- * **Move Focus on Advance:** When the step changes, move focus to the new step's heading, so screen readers announce the new step.
434
-
435
- ## Related
436
-
437
- [Progress](progress.md)
438
-
439
- Use for measurable work.
440
-
441
- [Dialog](dialog.md)
442
-
443
- Use for flows that open over the page.
444
-
445
- [Forms](../patterns/forms.md)
446
-
447
- Covers laying out each step.
448
-
449
- [Payments](../patterns/payments.md)
450
-
451
- Covers send and review flows.