@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,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.