@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,467 +0,0 @@
1
- # Checkbox
2
-
3
- Turns a single independent option on or off.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Checkbox.tsx)
6
-
7
- Figma: [Checkbox](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=3086-1190)
8
-
9
- ## Overview
10
-
11
- A hidden native input submits its value with the form.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- import { Checkbox, Field } from '@tempoxyz/ds'
19
-
20
- export function Demo() {
21
- return (
22
- <Field.Root>
23
- <Field.Item>
24
- <Checkbox defaultChecked />
25
- <Field.Label>Email me receipts</Field.Label>
26
- </Field.Item>
27
- </Field.Root>
28
- )
29
- }
30
- ```
31
-
32
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Checkbox/Basic.tsx)
33
-
34
- ### Checked
35
-
36
- Set `defaultChecked` for an uncontrolled checkbox, or `checked` with `onCheckedChange` to control it.
37
-
38
- ```tsx
39
- import { Checkbox, Field, style } from '@tempoxyz/ds'
40
-
41
- function Item(props: Checkbox.Props & { label: string }) {
42
- const { label, ...checkbox } = props
43
-
44
- return (
45
- <Field.Root>
46
- <Field.Item>
47
- <Checkbox {...checkbox} />
48
- <Field.Label>{label}</Field.Label>
49
- </Field.Item>
50
- </Field.Root>
51
- )
52
- }
53
-
54
- export function Demo() {
55
- return (
56
- <div {...styles.column()}>
57
- <Item label="Unchecked" />
58
- <Item defaultChecked label="Checked" />
59
- </div>
60
- )
61
- }
62
-
63
- namespace styles {
64
- export const column = style({ display: 'flex', flexDirection: 'column', gap: '16' })
65
- }
66
- ```
67
-
68
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Checkbox/Checked.tsx)
69
-
70
- ### Indeterminate
71
-
72
- Set `indeterminate` to show a minus and expose the mixed state.
73
-
74
- ```tsx
75
- import { Checkbox, Field } from '@tempoxyz/ds'
76
-
77
- function Item(props: Checkbox.Props & { label: string }) {
78
- const { label, ...checkbox } = props
79
-
80
- return (
81
- <Field.Root>
82
- <Field.Item>
83
- <Checkbox {...checkbox} />
84
- <Field.Label>{label}</Field.Label>
85
- </Field.Item>
86
- </Field.Root>
87
- )
88
- }
89
-
90
- export function Demo() {
91
- return <Item indeterminate label="Indeterminate" />
92
- }
93
- ```
94
-
95
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Checkbox/Indeterminate.tsx)
96
-
97
- ### Disabled
98
-
99
- ```tsx
100
- import { Checkbox, Field, style } from '@tempoxyz/ds'
101
-
102
- function Item(props: Checkbox.Props & { label: string }) {
103
- const { label, ...checkbox } = props
104
-
105
- return (
106
- <Field.Root>
107
- <Field.Item>
108
- <Checkbox {...checkbox} />
109
- <Field.Label>{label}</Field.Label>
110
- </Field.Item>
111
- </Field.Root>
112
- )
113
- }
114
-
115
- export function Demo() {
116
- return (
117
- <div {...styles.column()}>
118
- <Item disabled label="Disabled" />
119
- <Item defaultChecked disabled label="Disabled checked" />
120
- </div>
121
- )
122
- }
123
-
124
- namespace styles {
125
- export const column = style({ display: 'flex', flexDirection: 'column', gap: '16' })
126
- }
127
- ```
128
-
129
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Checkbox/Disabled.tsx)
130
-
131
- ### Size
132
-
133
- Set `size` to `small`, `medium` (default), or `large`.
134
-
135
- ```tsx
136
- import { Checkbox, Field, style } from '@tempoxyz/ds'
137
-
138
- function Item(props: Checkbox.Props & { label: string }) {
139
- const { label, ...checkbox } = props
140
-
141
- return (
142
- <Field.Root>
143
- <Field.Item>
144
- <Checkbox {...checkbox} />
145
- <Field.Label>{label}</Field.Label>
146
- </Field.Item>
147
- </Field.Root>
148
- )
149
- }
150
-
151
- export function Demo() {
152
- return (
153
- <div {...styles.column()}>
154
- {(['small', 'medium', 'large'] as const).map((size) => (
155
- <Item defaultChecked key={size} label={size} size={size} />
156
- ))}
157
- </div>
158
- )
159
- }
160
-
161
- namespace styles {
162
- export const column = style({ display: 'flex', flexDirection: 'column', gap: '16' })
163
- }
164
- ```
165
-
166
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Checkbox/Size.tsx)
167
-
168
- ## Anatomy
169
-
170
- Import the component and assemble its parts.
171
-
172
- ```tsx
173
- import { Checkbox } from '@tempoxyz/ds'
174
-
175
- <Checkbox />
176
- ```
177
-
178
- ## Guidelines
179
-
180
- ### When to Use
181
-
182
- * Offer one independent choice that applies on form submit, such as Email me a receipt for each payment.
183
- * Ask for agreement before a step, such as accepting the API terms before creating a key.
184
- * Select table rows for a bulk action, such as revoking several API keys.
185
-
186
- ### When Not to Use
187
-
188
- * Use [Switch](switch.md) for a setting that applies immediately.
189
- * Use [CheckboxGroup](checkbox-group.md) for several related options that share one value array.
190
- * If only one of several options can be chosen, use [RadioGroup](radio-group.md) or [ChoiceGroup](choice-group.md).
191
- * If each option needs an icon or a description, use `Choicebox.Checkbox` from [Choicebox](choicebox.md).
192
-
193
- ### Choose Checkbox or Switch by When It Applies
194
-
195
- * **Checkbox (on submit):** Applies when the form is submitted.
196
- * **Switch (on change):** Applies immediately, such as Payment notifications.
197
-
198
- Don't put a [Switch](switch.md) in a form that ends with Save, or a checkbox in a settings list that saves on change.
199
-
200
- ### Write the Label as the Checked Statement
201
-
202
- **Do:** Describe what happens when the box is checked.
203
-
204
- ```tsx
205
- /**
206
- * Do example for "Write the Label as the Checked Statement" on the Checkbox page.
207
- * Describe what happens when the box is checked.
208
- * @module
209
- */
210
- import { Checkbox, Field } from '@tempoxyz/ds'
211
-
212
- /** Renders the static preview, which the guideline card shows inert. */
213
- export function Demo() {
214
- return (
215
- <Field.Root>
216
- <Field.Item>
217
- <Checkbox defaultChecked />
218
- <Field.Label>Email me a receipt for each payment</Field.Label>
219
- </Field.Item>
220
- </Field.Root>
221
- )
222
- }
223
- ```
224
-
225
- **Don't:** Write a negative label, where checking the box means don't.
226
-
227
- ```tsx
228
- /**
229
- * Don't example for "Write the Label as the Checked Statement" on the Checkbox page.
230
- * Don't write a negative label, where checking the box means don't.
231
- * @module
232
- */
233
- import { Checkbox, Field } from '@tempoxyz/ds'
234
-
235
- /** Renders the static preview, which the guideline card shows inert. */
236
- export function Demo() {
237
- return (
238
- <Field.Root>
239
- <Field.Item>
240
- <Checkbox />
241
- <Field.Label>Don't email me payment receipts</Field.Label>
242
- </Field.Item>
243
- </Field.Root>
244
- )
245
- }
246
- ```
247
-
248
- ### Make the Label Toggle the Box
249
-
250
- Pair the checkbox with `Field.Item` and `Field.Label` from [Field](field.md), or wrap both in a `<label>`. Pressing the text then toggles the box.
251
-
252
- **Do:** Put the checkbox and its `Field.Label` in one `Field.Item`.
253
-
254
- ```tsx
255
- /**
256
- * Do example for "Make the Label Toggle the Box" on the Checkbox page.
257
- * Put the checkbox and its `Field.Label` in one `Field.Item`.
258
- * @module
259
- */
260
- import { Checkbox, Field } from '@tempoxyz/ds'
261
-
262
- /** Renders the static preview, which the guideline card shows inert. */
263
- export function Demo() {
264
- return (
265
- <Field.Root>
266
- <Field.Item>
267
- <Checkbox />
268
- <Field.Label>Email me a receipt for each payment</Field.Label>
269
- </Field.Item>
270
- </Field.Root>
271
- )
272
- }
273
- ```
274
-
275
- **Don't:** Place plain text beside the box. It neither names nor toggles it.
276
-
277
- ```tsx
278
- /**
279
- * Don't example for "Make the Label Toggle the Box" on the Checkbox page.
280
- * Don't place plain text beside the box. It neither names nor toggles it.
281
- * @module
282
- */
283
- import { Checkbox, style } from '@tempoxyz/ds'
284
-
285
- /** Renders the static preview, which the guideline card shows inert. */
286
- export function Demo() {
287
- return (
288
- <div {...styles.row()}>
289
- <Checkbox />
290
- <span>Email me a receipt for each payment</span>
291
- </div>
292
- )
293
- }
294
-
295
- namespace styles {
296
- export const row = style({ alignItems: 'center', display: 'flex', gap: '8' })
297
- }
298
- ```
299
-
300
- ### Use Indeterminate for Partial Selection Only
301
-
302
- Inside a [CheckboxGroup](checkbox-group.md), set `parent` instead and let the group manage the state.
303
-
304
- **Do:** Set `indeterminate` on a box that controls others while only some are checked.
305
-
306
- ```tsx
307
- /**
308
- * Do example for "Use Indeterminate for Partial Selection Only" on the Checkbox page.
309
- * Set `indeterminate` on a box that controls others while only some are checked.
310
- * @module
311
- */
312
- import { Checkbox, Field, style } from '@tempoxyz/ds'
313
-
314
- /** Renders the static preview, which the guideline card shows inert. */
315
- export function Demo() {
316
- return (
317
- <div {...styles.list()}>
318
- <Field.Root>
319
- <Field.Item>
320
- <Checkbox indeterminate />
321
- <Field.Label>Select all keys</Field.Label>
322
- </Field.Item>
323
- </Field.Root>
324
- <Field.Root>
325
- <Field.Item>
326
- <Checkbox defaultChecked />
327
- <Field.Label>prod-api-01</Field.Label>
328
- </Field.Item>
329
- </Field.Root>
330
- <Field.Root>
331
- <Field.Item>
332
- <Checkbox />
333
- <Field.Label>staging-api-02</Field.Label>
334
- </Field.Item>
335
- </Field.Root>
336
- </div>
337
- )
338
- }
339
-
340
- namespace styles {
341
- export const list = style({ display: 'flex', flexDirection: 'column', gap: '12' })
342
- }
343
- ```
344
-
345
- **Don't:** Set `indeterminate` on a box that controls no other boxes.
346
-
347
- ```tsx
348
- /**
349
- * Don't example for "Use Indeterminate for Partial Selection Only" on the Checkbox page.
350
- * Don't set `indeterminate` on a box that controls no other boxes.
351
- * @module
352
- */
353
- import { Checkbox, Field } from '@tempoxyz/ds'
354
-
355
- /** Renders the static preview, which the guideline card shows inert. */
356
- export function Demo() {
357
- return (
358
- <Field.Root>
359
- <Field.Item>
360
- <Checkbox indeterminate />
361
- <Field.Label>Email me a receipt for each payment</Field.Label>
362
- </Field.Item>
363
- </Field.Root>
364
- )
365
- }
366
- ```
367
-
368
- ### Leave Consent Unchecked
369
-
370
- If a box must be checked to continue, set `required` and show a `Field.Error` when it is unchecked.
371
-
372
- **Do:** Leave boxes that record agreement or opt in to email unchecked.
373
-
374
- ```tsx
375
- /**
376
- * Do example for "Leave Consent Unchecked" on the Checkbox page.
377
- * Leave boxes that record agreement or opt in to email unchecked.
378
- * @module
379
- */
380
- import { Checkbox, Field } from '@tempoxyz/ds'
381
-
382
- /** Renders the static preview, which the guideline card shows inert. */
383
- export function Demo() {
384
- return (
385
- <Field.Root>
386
- <Field.Item>
387
- <Checkbox />
388
- <Field.Label>Email me product updates</Field.Label>
389
- </Field.Item>
390
- </Field.Root>
391
- )
392
- }
393
- ```
394
-
395
- **Don't:** Preselect consent.
396
-
397
- ```tsx
398
- /** Don't example for "Leave Consent Unchecked" on the Checkbox page. Don't preselect consent. @module */
399
- import { Checkbox, Field } from '@tempoxyz/ds'
400
-
401
- /** Renders the static preview, which the guideline card shows inert. */
402
- export function Demo() {
403
- return (
404
- <Field.Root>
405
- <Field.Item>
406
- <Checkbox defaultChecked />
407
- <Field.Label>Email me product updates</Field.Label>
408
- </Field.Item>
409
- </Field.Root>
410
- )
411
- }
412
- ```
413
-
414
- ## Content
415
-
416
- * **Explanation:** Put it in a `Field.Description` after the `Field.Item`, in the same `Field.Root`.
417
- * **Links:** Keep them out of the label, where they compete with its press target. Link to terms from the description.
418
-
419
- ## Accessibility
420
-
421
- Follows the [WAI-ARIA checkbox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/).
422
-
423
- ### Semantics
424
-
425
- * **Control (checkbox):** Reports a checked, unchecked, or mixed state to assistive technology.
426
- * **Native TextInput (input):** A hidden native input submits the value under `name`. Screen readers and Tab skip it.
427
- * **Indeterminate (mixed):** Shows a minus in the box and exposes the mixed state to assistive technology.
428
- * **Disabled (aria-disabled):** Dims the box, blocks changes, and removes it from the tab order.
429
- * **Target Size (36 to 44px):** An invisible hit area extends each indicator past the 24px WCAG 2.2 minimum.
430
-
431
- ### Keyboard
432
-
433
- * **Move to the Checkbox (Tab):** Moves focus to the checkbox. Each one is its own tab stop.
434
- * **Toggle the Checkbox (Space):** Toggles the checkbox between the checked and unchecked states.
435
- * **Submit the Form (Enter):** Submits the owning form without toggling, as a native checkbox does.
436
-
437
- ### Motion
438
-
439
- The check animates in with a slight overshoot. Under `prefers-reduced-motion: reduce`, it fades.
440
-
441
- ### Your Responsibilities
442
-
443
- * **Use ARIA Labels Sparingly (aria-label):** Use it only if the layout already shows the label, such as a table row selector.
444
- * **Explain Disabled Checkboxes:** Say why in nearby text. A disabled checkbox cannot take focus.
445
- * **Pair Invalid With an Error (Field.Error):** An invalid field outlines the box in red. Add an error message to explain it.
446
-
447
- ## Related
448
-
449
- [CheckboxGroup](checkbox-group.md)
450
-
451
- Use for several related checkboxes.
452
-
453
- [Switch](switch.md)
454
-
455
- Use for settings that apply immediately.
456
-
457
- [Field](field.md)
458
-
459
- Use for the label and description.
460
-
461
- [Choicebox](choicebox.md)
462
-
463
- Use for options that need descriptions.
464
-
465
- [Forms](../patterns/forms.md)
466
-
467
- Covers placing checkboxes in a form.