@tempoxyz/ds 0.3.14 → 0.3.15

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 (131) hide show
  1. package/dist/docs/AGENTS.md +73 -10
  2. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +28 -20
  3. package/dist/docs/product/components/actions.md +2058 -0
  4. package/dist/docs/product/components/blockchain.md +3825 -0
  5. package/dist/docs/product/components/data-display.md +5901 -0
  6. package/dist/docs/product/components/feedback-and-status.md +4008 -0
  7. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  8. package/dist/docs/product/components/layout.md +3339 -0
  9. package/dist/docs/product/components/navigation.md +2914 -0
  10. package/dist/docs/product/components/overlays.md +4917 -0
  11. package/dist/docs/product/components.md +125 -125
  12. package/dist/docs/product/foundations.md +4596 -0
  13. package/dist/docs/product/patterns.md +10129 -0
  14. package/package.json +1 -1
  15. package/dist/docs/index.md +0 -145
  16. package/dist/docs/product/components/accordion.md +0 -489
  17. package/dist/docs/product/components/address-card.md +0 -147
  18. package/dist/docs/product/components/agent-logo.md +0 -194
  19. package/dist/docs/product/components/alert-dialog.md +0 -631
  20. package/dist/docs/product/components/alert.md +0 -448
  21. package/dist/docs/product/components/amount-input.md +0 -305
  22. package/dist/docs/product/components/amount.md +0 -794
  23. package/dist/docs/product/components/app-shell.md +0 -559
  24. package/dist/docs/product/components/asset-chip.md +0 -294
  25. package/dist/docs/product/components/autocomplete.md +0 -620
  26. package/dist/docs/product/components/avatar.md +0 -321
  27. package/dist/docs/product/components/badge.md +0 -339
  28. package/dist/docs/product/components/badged-logo.md +0 -116
  29. package/dist/docs/product/components/banner.md +0 -379
  30. package/dist/docs/product/components/bar-chart.md +0 -208
  31. package/dist/docs/product/components/breadcrumbs.md +0 -380
  32. package/dist/docs/product/components/button-group.md +0 -286
  33. package/dist/docs/product/components/button.md +0 -650
  34. package/dist/docs/product/components/calendar.md +0 -375
  35. package/dist/docs/product/components/callout.md +0 -96
  36. package/dist/docs/product/components/checkbox-group.md +0 -521
  37. package/dist/docs/product/components/checkbox.md +0 -467
  38. package/dist/docs/product/components/choice-group.md +0 -516
  39. package/dist/docs/product/components/choicebox.md +0 -641
  40. package/dist/docs/product/components/code.md +0 -100
  41. package/dist/docs/product/components/combobox.md +0 -939
  42. package/dist/docs/product/components/container.md +0 -257
  43. package/dist/docs/product/components/copy-button.md +0 -642
  44. package/dist/docs/product/components/date-picker.md +0 -514
  45. package/dist/docs/product/components/dialog.md +0 -1332
  46. package/dist/docs/product/components/drawer.md +0 -966
  47. package/dist/docs/product/components/empty.md +0 -340
  48. package/dist/docs/product/components/field.md +0 -570
  49. package/dist/docs/product/components/fieldset.md +0 -398
  50. package/dist/docs/product/components/frame.md +0 -434
  51. package/dist/docs/product/components/gauge.md +0 -299
  52. package/dist/docs/product/components/get-started-visual.md +0 -117
  53. package/dist/docs/product/components/grid.md +0 -288
  54. package/dist/docs/product/components/hero-visual.md +0 -155
  55. package/dist/docs/product/components/hex.md +0 -487
  56. package/dist/docs/product/components/icon-tile.md +0 -292
  57. package/dist/docs/product/components/identicon.md +0 -371
  58. package/dist/docs/product/components/inline.md +0 -233
  59. package/dist/docs/product/components/inset.md +0 -225
  60. package/dist/docs/product/components/kbd.md +0 -423
  61. package/dist/docs/product/components/list-group.md +0 -981
  62. package/dist/docs/product/components/loading-dots.md +0 -237
  63. package/dist/docs/product/components/menu.md +0 -934
  64. package/dist/docs/product/components/native-select.md +0 -204
  65. package/dist/docs/product/components/network-logo.md +0 -248
  66. package/dist/docs/product/components/number-field.md +0 -543
  67. package/dist/docs/product/components/otp-field.md +0 -616
  68. package/dist/docs/product/components/pagination.md +0 -516
  69. package/dist/docs/product/components/popover.md +0 -544
  70. package/dist/docs/product/components/progress.md +0 -388
  71. package/dist/docs/product/components/qr.md +0 -314
  72. package/dist/docs/product/components/radio-group.md +0 -528
  73. package/dist/docs/product/components/secret-value.md +0 -406
  74. package/dist/docs/product/components/select.md +0 -751
  75. package/dist/docs/product/components/separator.md +0 -379
  76. package/dist/docs/product/components/sidebar-menu.md +0 -922
  77. package/dist/docs/product/components/skeleton.md +0 -517
  78. package/dist/docs/product/components/slider.md +0 -539
  79. package/dist/docs/product/components/snippet.md +0 -424
  80. package/dist/docs/product/components/spinner.md +0 -216
  81. package/dist/docs/product/components/split-bar.md +0 -139
  82. package/dist/docs/product/components/split-button.md +0 -464
  83. package/dist/docs/product/components/stack.md +0 -299
  84. package/dist/docs/product/components/status-chip.md +0 -226
  85. package/dist/docs/product/components/status-indicator.md +0 -119
  86. package/dist/docs/product/components/status-row.md +0 -174
  87. package/dist/docs/product/components/stepper.md +0 -451
  88. package/dist/docs/product/components/success-hero.md +0 -157
  89. package/dist/docs/product/components/surface.md +0 -639
  90. package/dist/docs/product/components/switch.md +0 -472
  91. package/dist/docs/product/components/table.md +0 -968
  92. package/dist/docs/product/components/tabs.md +0 -627
  93. package/dist/docs/product/components/tempo-logo.md +0 -185
  94. package/dist/docs/product/components/text-input.md +0 -624
  95. package/dist/docs/product/components/textarea.md +0 -352
  96. package/dist/docs/product/components/toast.md +0 -535
  97. package/dist/docs/product/components/token-logo.md +0 -371
  98. package/dist/docs/product/components/token.md +0 -247
  99. package/dist/docs/product/components/tooltip.md +0 -490
  100. package/dist/docs/product/components/verification-code.md +0 -116
  101. package/dist/docs/product/components/visual.md +0 -249
  102. package/dist/docs/product/foundations/accessibility.md +0 -377
  103. package/dist/docs/product/foundations/agents.md +0 -159
  104. package/dist/docs/product/foundations/color.md +0 -522
  105. package/dist/docs/product/foundations/content/tone.md +0 -194
  106. package/dist/docs/product/foundations/content/voice.md +0 -194
  107. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  108. package/dist/docs/product/foundations/iconography.md +0 -282
  109. package/dist/docs/product/foundations/intent.md +0 -360
  110. package/dist/docs/product/foundations/layout.md +0 -508
  111. package/dist/docs/product/foundations/linter.md +0 -523
  112. package/dist/docs/product/foundations/motion.md +0 -151
  113. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  114. package/dist/docs/product/foundations/typography.md +0 -331
  115. package/dist/docs/product/introduction/faq.md +0 -133
  116. package/dist/docs/product/introduction/getting-started.md +0 -377
  117. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  118. package/dist/docs/product/patterns/dashboards.md +0 -638
  119. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  120. package/dist/docs/product/patterns/empty-states.md +0 -612
  121. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  122. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  123. package/dist/docs/product/patterns/forms.md +0 -679
  124. package/dist/docs/product/patterns/loading.md +0 -630
  125. package/dist/docs/product/patterns/navigation.md +0 -397
  126. package/dist/docs/product/patterns/payments.md +0 -765
  127. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  128. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  129. package/dist/docs/product/products/tempo-console.md +0 -671
  130. package/dist/docs/product/products/tempo-performance.md +0 -435
  131. 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.