@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,641 +0,0 @@
1
- # Choicebox
2
-
3
- A selectable tile with an optional icon, title, and description.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Choicebox.tsx)
6
-
7
- ## Overview
8
-
9
- A tile form of a radio, checkbox, or button. Pressing anywhere on the tile operates its control.
10
-
11
- ## Examples
12
-
13
- ### Basic
14
-
15
- ```tsx
16
- import { Choicebox } from '@tempoxyz/ds'
17
-
18
- export function Demo() {
19
- return (
20
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="instant">
21
- <Choicebox.Radio value="standard">
22
- <Choicebox.Title>Standard</Choicebox.Title>
23
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
24
- </Choicebox.Radio>
25
- <Choicebox.Radio value="instant">
26
- <Choicebox.Title>Instant</Choicebox.Title>
27
- <Choicebox.Description>Settles in seconds for a small fee</Choicebox.Description>
28
- </Choicebox.Radio>
29
- </Choicebox.RadioGroup>
30
- )
31
- }
32
- ```
33
-
34
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Choicebox/Basic.tsx)
35
-
36
- ### Size
37
-
38
- Set `size` on the group to `small`, `medium` (default), or `large`.
39
-
40
- ```tsx
41
- import { Choicebox, style } from '@tempoxyz/ds'
42
-
43
- export function Demo() {
44
- return (
45
- <div {...styles.row()}>
46
- {(['small', 'large'] as const).map((size) => (
47
- <Choicebox.RadioGroup
48
- aria-label={`Settlement ${size}`}
49
- defaultValue="instant"
50
- key={size}
51
- size={size}
52
- >
53
- <Choicebox.Radio value="standard">
54
- <Choicebox.Title>Standard ({size})</Choicebox.Title>
55
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
56
- </Choicebox.Radio>
57
- <Choicebox.Radio value="instant">
58
- <Choicebox.Title>Instant ({size})</Choicebox.Title>
59
- <Choicebox.Description>Settles in seconds for a small fee</Choicebox.Description>
60
- </Choicebox.Radio>
61
- </Choicebox.RadioGroup>
62
- ))}
63
- </div>
64
- )
65
- }
66
-
67
- namespace styles {
68
- export const row = style({
69
- alignItems: 'flex-start',
70
- display: 'grid',
71
- gap: '24',
72
- gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 360px)) !custom',
73
- })
74
- }
75
- ```
76
-
77
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Choicebox/Size.tsx)
78
-
79
- ### Disabled
80
-
81
- Set `disabled` on a tile to make one option unavailable.
82
-
83
- ```tsx
84
- import { Choicebox } from '@tempoxyz/ds'
85
-
86
- export function Demo() {
87
- return (
88
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="instant">
89
- <Choicebox.Radio value="standard">
90
- <Choicebox.Title>Standard</Choicebox.Title>
91
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
92
- </Choicebox.Radio>
93
- <Choicebox.Radio value="instant">
94
- <Choicebox.Title>Instant</Choicebox.Title>
95
- <Choicebox.Description>Settles in seconds for a small fee</Choicebox.Description>
96
- </Choicebox.Radio>
97
- <Choicebox.Radio disabled value="wire">
98
- <Choicebox.Title>Wire</Choicebox.Title>
99
- <Choicebox.Description>Unavailable in your region</Choicebox.Description>
100
- </Choicebox.Radio>
101
- </Choicebox.RadioGroup>
102
- )
103
- }
104
- ```
105
-
106
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Choicebox/Disabled.tsx)
107
-
108
- ### Icon
109
-
110
- Add a `Choicebox.Icon` before the title.
111
-
112
- ```tsx
113
- import { Choicebox } from '@tempoxyz/ds'
114
- import { Bank, CreditCard } from '@tempoxyz/ds/icons'
115
-
116
- export function Demo() {
117
- return (
118
- <Choicebox.RadioGroup aria-label="Method" defaultValue="bank">
119
- <Choicebox.Radio value="bank">
120
- <Choicebox.Icon>
121
- <Bank />
122
- </Choicebox.Icon>
123
- <Choicebox.Title>Bank transfer</Choicebox.Title>
124
- <Choicebox.Description>One to two business days</Choicebox.Description>
125
- </Choicebox.Radio>
126
- <Choicebox.Radio value="card">
127
- <Choicebox.Icon>
128
- <CreditCard />
129
- </Choicebox.Icon>
130
- <Choicebox.Title>Card</Choicebox.Title>
131
- <Choicebox.Description>Instant, 2.9% fee</Choicebox.Description>
132
- </Choicebox.Radio>
133
- </Choicebox.RadioGroup>
134
- )
135
- }
136
- ```
137
-
138
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Choicebox/Icon.tsx)
139
-
140
- ### ButtonGroup
141
-
142
- Use `Choicebox.ButtonGroup` and `Choicebox.Button` for tiles that run an action and hold no value.
143
-
144
- ```tsx
145
- import { Choicebox } from '@tempoxyz/ds'
146
- import { Bank, Wallet } from '@tempoxyz/ds/icons'
147
-
148
- export function Demo() {
149
- return (
150
- <Choicebox.ButtonGroup aria-label="Add funds">
151
- <Choicebox.Button onClick={() => alert('Bank transfer')}>
152
- <Choicebox.Icon>
153
- <Bank />
154
- </Choicebox.Icon>
155
- <Choicebox.Title>Bank transfer</Choicebox.Title>
156
- <Choicebox.Description>Opens your deposit details</Choicebox.Description>
157
- </Choicebox.Button>
158
- <Choicebox.Button onClick={() => alert('Wallet')}>
159
- <Choicebox.Icon>
160
- <Wallet />
161
- </Choicebox.Icon>
162
- <Choicebox.Title>From a wallet</Choicebox.Title>
163
- </Choicebox.Button>
164
- </Choicebox.ButtonGroup>
165
- )
166
- }
167
- ```
168
-
169
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Choicebox/ButtonGroup.tsx)
170
-
171
- ### CheckboxGroup
172
-
173
- Use `Choicebox.CheckboxGroup` and `Choicebox.Checkbox` for tiles that allow several selections.
174
-
175
- ```tsx
176
- import { Choicebox } from '@tempoxyz/ds'
177
-
178
- export function Demo() {
179
- return (
180
- <Choicebox.CheckboxGroup aria-label="Alerts" defaultValue={['email']}>
181
- <Choicebox.Checkbox value="email">
182
- <Choicebox.Title>Email</Choicebox.Title>
183
- <Choicebox.Description>Receipts and weekly summaries</Choicebox.Description>
184
- </Choicebox.Checkbox>
185
- <Choicebox.Checkbox value="push">
186
- <Choicebox.Title>Push</Choicebox.Title>
187
- <Choicebox.Description>Transfers and security events</Choicebox.Description>
188
- </Choicebox.Checkbox>
189
- </Choicebox.CheckboxGroup>
190
- )
191
- }
192
- ```
193
-
194
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Choicebox/CheckboxGroup.tsx)
195
-
196
- ## Anatomy
197
-
198
- Import the component and assemble its parts.
199
-
200
- ```tsx
201
- import { Choicebox } from '@tempoxyz/ds'
202
-
203
- <Choicebox.RadioGroup>
204
- <Choicebox.Radio>
205
- <Choicebox.Icon />
206
- <Choicebox.Title />
207
- <Choicebox.Description />
208
- </Choicebox.Radio>
209
- </Choicebox.RadioGroup>
210
-
211
- <Choicebox.CheckboxGroup>
212
- <Choicebox.Checkbox>
213
- <Choicebox.Icon />
214
- <Choicebox.Title />
215
- <Choicebox.Description />
216
- </Choicebox.Checkbox>
217
- </Choicebox.CheckboxGroup>
218
-
219
- <Choicebox.ButtonGroup>
220
- <Choicebox.Button>
221
- <Choicebox.Icon />
222
- <Choicebox.Title />
223
- <Choicebox.Description />
224
- </Choicebox.Button>
225
- </Choicebox.ButtonGroup>
226
- ```
227
-
228
- ## Guidelines
229
-
230
- ### When to Use
231
-
232
- * Choose between a few options that each need a description, such as Standard or Instant settlement with time and fee.
233
- * Choose how to start a flow with `Choicebox.ButtonGroup`, such as Bank transfer or From a wallet.
234
- * Choose several described options with `Choicebox.CheckboxGroup`, such as alert channels.
235
-
236
- ### When Not to Use
237
-
238
- * If a label alone tells the options apart, use [RadioGroup](radio-group.md).
239
- * Use [ChoiceGroup](choice-group.md) for a short mode switch, such as a chart's time range.
240
- * Use [Select](select.md) for more options than fit on screen.
241
- * Use [Button](button.md) for a single action, and [Menu](menu.md) for actions that need no description.
242
-
243
- ### Pick the Group by What a Tile Does
244
-
245
- * **Radio Tiles (Choicebox.RadioGroup):** Hold one value, such as a settlement speed.
246
- * **Checkbox Tiles (Choicebox.CheckboxGroup):** Hold several values, such as alert channels.
247
- * **Button Tiles (Choicebox.ButtonGroup):** Run an action, such as opening the next step.
248
-
249
- ### Keep Tile Text Short
250
-
251
- The whole tile's text becomes the accessible name, so long text slows every option for screen reader users.
252
-
253
- **Do:** Give each tile a title of one to three words and a one-line description.
254
-
255
- ```tsx
256
- /**
257
- * Do example for "Keep Tile Text Short" on the Choicebox page.
258
- * Give each tile a title of one to three words and a one-line description.
259
- * @module
260
- */
261
- import { Choicebox, style } from '@tempoxyz/ds'
262
-
263
- /** Renders the static preview, which the guideline card shows inert. */
264
- export function Demo() {
265
- return (
266
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
267
- <Choicebox.Radio value="standard">
268
- <Choicebox.Title>Standard</Choicebox.Title>
269
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
270
- </Choicebox.Radio>
271
- <Choicebox.Radio value="instant">
272
- <Choicebox.Title>Instant</Choicebox.Title>
273
- <Choicebox.Description>Settles in seconds for a 1% fee</Choicebox.Description>
274
- </Choicebox.Radio>
275
- </Choicebox.RadioGroup>
276
- )
277
- }
278
-
279
- namespace styles {
280
- export const group = style({ width: '100% !custom' })
281
- }
282
- ```
283
-
284
- **Don't:** Repeat the question in each title or write paragraphs in the description.
285
-
286
- ```tsx
287
- /**
288
- * Don't example for "Keep Tile Text Short" on the Choicebox page.
289
- * Don't repeat the question in each title or write paragraphs in the description.
290
- * @module
291
- */
292
- import { Choicebox, style } from '@tempoxyz/ds'
293
-
294
- /** Renders the static preview, which the guideline card shows inert. */
295
- export function Demo() {
296
- return (
297
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
298
- <Choicebox.Radio value="standard">
299
- <Choicebox.Title>Standard settlement for this payment</Choicebox.Title>
300
- <Choicebox.Description>
301
- Your payment is processed with our standard settlement option, which usually takes about
302
- one business day depending on your bank.
303
- </Choicebox.Description>
304
- </Choicebox.Radio>
305
- <Choicebox.Radio value="instant">
306
- <Choicebox.Title>Instant settlement for this payment</Choicebox.Title>
307
- <Choicebox.Description>
308
- Your payment settles in seconds. A fee applies, shown on the review screen.
309
- </Choicebox.Description>
310
- </Choicebox.Radio>
311
- </Choicebox.RadioGroup>
312
- )
313
- }
314
-
315
- namespace styles {
316
- export const group = style({ width: '100% !custom' })
317
- }
318
- ```
319
-
320
- ### Describe What Sets Each Option Apart
321
-
322
- **Do:** Put the deciding difference, such as time or fee, in the same place on every tile.
323
-
324
- ```tsx
325
- /**
326
- * Do example for "Keep Tile Text Short" on the Choicebox page.
327
- * Give each tile a title of one to three words and a one-line description.
328
- * @module
329
- */
330
- import { Choicebox, style } from '@tempoxyz/ds'
331
-
332
- /** Renders the static preview, which the guideline card shows inert. */
333
- export function Demo() {
334
- return (
335
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
336
- <Choicebox.Radio value="standard">
337
- <Choicebox.Title>Standard</Choicebox.Title>
338
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
339
- </Choicebox.Radio>
340
- <Choicebox.Radio value="instant">
341
- <Choicebox.Title>Instant</Choicebox.Title>
342
- <Choicebox.Description>Settles in seconds for a 1% fee</Choicebox.Description>
343
- </Choicebox.Radio>
344
- </Choicebox.RadioGroup>
345
- )
346
- }
347
-
348
- namespace styles {
349
- export const group = style({ width: '100% !custom' })
350
- }
351
- ```
352
-
353
- **Don't:** Write descriptions that vary in structure or leave out the difference.
354
-
355
- ```tsx
356
- /**
357
- * Don't example for "Describe What Sets Each Option Apart" on the Choicebox page.
358
- * Don't write descriptions that vary in structure or leave out the difference.
359
- * @module
360
- */
361
- import { Choicebox, style } from '@tempoxyz/ds'
362
-
363
- /** Renders the static preview, which the guideline card shows inert. */
364
- export function Demo() {
365
- return (
366
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
367
- <Choicebox.Radio value="standard">
368
- <Choicebox.Title>Standard</Choicebox.Title>
369
- <Choicebox.Description>Our most popular option</Choicebox.Description>
370
- </Choicebox.Radio>
371
- <Choicebox.Radio value="instant">
372
- <Choicebox.Title>Instant</Choicebox.Title>
373
- <Choicebox.Description>For a 1% fee, settles in seconds</Choicebox.Description>
374
- </Choicebox.Radio>
375
- </Choicebox.RadioGroup>
376
- )
377
- }
378
-
379
- namespace styles {
380
- export const group = style({ width: '100% !custom' })
381
- }
382
- ```
383
-
384
- ### Use Icons on Every Tile or None
385
-
386
- **Do:** Add a `Choicebox.Icon` from one icon set to every tile.
387
-
388
- ```tsx
389
- /**
390
- * Do example for "Use Icons on Every Tile or None" on the Choicebox page.
391
- * Add a `Choicebox.Icon` from one icon set to every tile.
392
- * @module
393
- */
394
- import { Choicebox, style } from '@tempoxyz/ds'
395
- import { Bank, Wallet } from '@tempoxyz/ds/icons'
396
-
397
- /** Renders the static preview, which the guideline card shows inert. */
398
- export function Demo() {
399
- return (
400
- <Choicebox.ButtonGroup aria-label="Add funds" {...styles.group()}>
401
- <Choicebox.Button>
402
- <Choicebox.Icon>
403
- <Bank />
404
- </Choicebox.Icon>
405
- <Choicebox.Title>Bank transfer</Choicebox.Title>
406
- <Choicebox.Description>Arrives in one business day</Choicebox.Description>
407
- </Choicebox.Button>
408
- <Choicebox.Button>
409
- <Choicebox.Icon>
410
- <Wallet />
411
- </Choicebox.Icon>
412
- <Choicebox.Title>From a wallet</Choicebox.Title>
413
- <Choicebox.Description>Send USDC from any address</Choicebox.Description>
414
- </Choicebox.Button>
415
- </Choicebox.ButtonGroup>
416
- )
417
- }
418
-
419
- namespace styles {
420
- export const group = style({ width: '100% !custom' })
421
- }
422
- ```
423
-
424
- **Don't:** Give icons to only some tiles in a group.
425
-
426
- ```tsx
427
- /**
428
- * Don't example for "Use Icons on Every Tile or None" on the Choicebox page.
429
- * Don't give icons to only some tiles in a group.
430
- * @module
431
- */
432
- import { Choicebox, style } from '@tempoxyz/ds'
433
- import { Bank } from '@tempoxyz/ds/icons'
434
-
435
- /** Renders the static preview, which the guideline card shows inert. */
436
- export function Demo() {
437
- return (
438
- <Choicebox.ButtonGroup aria-label="Add funds" {...styles.group()}>
439
- <Choicebox.Button>
440
- <Choicebox.Icon>
441
- <Bank />
442
- </Choicebox.Icon>
443
- <Choicebox.Title>Bank transfer</Choicebox.Title>
444
- <Choicebox.Description>Arrives in one business day</Choicebox.Description>
445
- </Choicebox.Button>
446
- <Choicebox.Button>
447
- <Choicebox.Title>From a wallet</Choicebox.Title>
448
- <Choicebox.Description>Send USDC from any address</Choicebox.Description>
449
- </Choicebox.Button>
450
- </Choicebox.ButtonGroup>
451
- )
452
- }
453
-
454
- namespace styles {
455
- export const group = style({ width: '100% !custom' })
456
- }
457
- ```
458
-
459
- ### Preselect a Safe Default
460
-
461
- **Do:** Preselect an option only if it costs nothing extra, such as Standard settlement.
462
-
463
- ```tsx
464
- /**
465
- * Do example for "Keep Tile Text Short" on the Choicebox page.
466
- * Give each tile a title of one to three words and a one-line description.
467
- * @module
468
- */
469
- import { Choicebox, style } from '@tempoxyz/ds'
470
-
471
- /** Renders the static preview, which the guideline card shows inert. */
472
- export function Demo() {
473
- return (
474
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
475
- <Choicebox.Radio value="standard">
476
- <Choicebox.Title>Standard</Choicebox.Title>
477
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
478
- </Choicebox.Radio>
479
- <Choicebox.Radio value="instant">
480
- <Choicebox.Title>Instant</Choicebox.Title>
481
- <Choicebox.Description>Settles in seconds for a 1% fee</Choicebox.Description>
482
- </Choicebox.Radio>
483
- </Choicebox.RadioGroup>
484
- )
485
- }
486
-
487
- namespace styles {
488
- export const group = style({ width: '100% !custom' })
489
- }
490
- ```
491
-
492
- **Don't:** Preselect an option with a fee.
493
-
494
- ```tsx
495
- /**
496
- * Don't example for "Preselect a Safe Default" on the Choicebox page.
497
- * Don't preselect an option with a fee.
498
- * @module
499
- */
500
- import { Choicebox, style } from '@tempoxyz/ds'
501
-
502
- /** Renders the static preview, which the guideline card shows inert. */
503
- export function Demo() {
504
- return (
505
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="instant" {...styles.group()}>
506
- <Choicebox.Radio value="standard">
507
- <Choicebox.Title>Standard</Choicebox.Title>
508
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
509
- </Choicebox.Radio>
510
- <Choicebox.Radio value="instant">
511
- <Choicebox.Title>Instant</Choicebox.Title>
512
- <Choicebox.Description>Settles in seconds for a 1% fee</Choicebox.Description>
513
- </Choicebox.Radio>
514
- </Choicebox.RadioGroup>
515
- )
516
- }
517
-
518
- namespace styles {
519
- export const group = style({ width: '100% !custom' })
520
- }
521
- ```
522
-
523
- ### Explain Unavailable Options
524
-
525
- Leave out options that never apply to the account.
526
-
527
- **Do:** If a tile is `disabled`, say why in its description.
528
-
529
- ```tsx
530
- /**
531
- * Do example for "Explain Unavailable Options" on the Choicebox page.
532
- * If a tile is `disabled`, say why in its description.
533
- * @module
534
- */
535
- import { Choicebox, style } from '@tempoxyz/ds'
536
-
537
- /** Renders the static preview, which the guideline card shows inert. */
538
- export function Demo() {
539
- return (
540
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
541
- <Choicebox.Radio value="standard">
542
- <Choicebox.Title>Standard</Choicebox.Title>
543
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
544
- </Choicebox.Radio>
545
- <Choicebox.Radio disabled value="wire">
546
- <Choicebox.Title>Wire</Choicebox.Title>
547
- <Choicebox.Description>Unavailable in your region</Choicebox.Description>
548
- </Choicebox.Radio>
549
- </Choicebox.RadioGroup>
550
- )
551
- }
552
-
553
- namespace styles {
554
- export const group = style({ width: '100% !custom' })
555
- }
556
- ```
557
-
558
- **Don't:** Disable a tile without a reason.
559
-
560
- ```tsx
561
- /**
562
- * Don't example for "Explain Unavailable Options" on the Choicebox page.
563
- * Don't disable a tile without a reason.
564
- * @module
565
- */
566
- import { Choicebox, style } from '@tempoxyz/ds'
567
-
568
- /** Renders the static preview, which the guideline card shows inert. */
569
- export function Demo() {
570
- return (
571
- <Choicebox.RadioGroup aria-label="Settlement" defaultValue="standard" {...styles.group()}>
572
- <Choicebox.Radio value="standard">
573
- <Choicebox.Title>Standard</Choicebox.Title>
574
- <Choicebox.Description>Settles in one business day</Choicebox.Description>
575
- </Choicebox.Radio>
576
- <Choicebox.Radio disabled value="wire">
577
- <Choicebox.Title>Wire</Choicebox.Title>
578
- <Choicebox.Description>Settles the same day for a $15 fee</Choicebox.Description>
579
- </Choicebox.Radio>
580
- </Choicebox.RadioGroup>
581
- )
582
- }
583
-
584
- namespace styles {
585
- export const group = style({ width: '100% !custom' })
586
- }
587
- ```
588
-
589
- ## Content
590
-
591
- * **Descriptions:** Fragments without a trailing period, such as Settles in one business day.
592
- * **Numbers:** Exact fees and times, such as 1% fee, not a small fee.
593
-
594
- ## Accessibility
595
-
596
- Radio tiles follow the [WAI-ARIA radio group pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/), and checkbox tiles the [checkbox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/).
597
-
598
- ### Semantics
599
-
600
- * **Choicebox.RadioGroup (radiogroup):** Pressing anywhere on a tile selects it.
601
- * **Choicebox.CheckboxGroup (group):** Pressing anywhere on a tile toggles it.
602
- * **Choicebox.ButtonGroup (group):** Each tile is a native button. Enter and Space run it.
603
- * **Name (aria-labelledby):** The tile's title and description together name its control.
604
- * **Icon and Disabled Tiles (aria-disabled):** Icons are hidden from screen readers. A disabled tile marks its control disabled.
605
-
606
- ### Keyboard
607
-
608
- * **Move to a Tile (Tab):** Focuses the checked tile in a radio group. In other groups, each tile is a tab stop.
609
- * **Select the Next or Previous Tile (Arrow keys):** In a radio group, selects the next or previous enabled tile.
610
- * **Toggle a Checkbox Tile (Space):** Toggles a checkbox tile.
611
- * **Activate a Button Tile (Enter or Space):** Activates a button tile.
612
-
613
- ### Motion
614
-
615
- Pressed tiles scale to `scale.press` (0.98), except under `prefers-reduced-motion: reduce`.
616
-
617
- ### Your Responsibilities
618
-
619
- * **Name Each Group (aria-label):** Phrase it as a question, such as "How should this payment settle?"
620
-
621
- ## Related
622
-
623
- [RadioGroup](radio-group.md)
624
-
625
- Use for one choice with short labels.
626
-
627
- [CheckboxGroup](checkbox-group.md)
628
-
629
- Use for several choices with short labels.
630
-
631
- [ChoiceGroup](choice-group.md)
632
-
633
- Use for switching a view or mode.
634
-
635
- [Fieldset](fieldset.md)
636
-
637
- Use for naming a group with a legend.
638
-
639
- [Payments](../patterns/payments.md)
640
-
641
- Covers choosing a funding or settlement method.