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