@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,249 +0,0 @@
1
- # Visual
2
-
3
- Illustrates the top of an onboarding or feature modal.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Visual.tsx)
6
-
7
- Figma: [Content/Visual](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-2662)
8
-
9
- ## Overview
10
-
11
- A visual is a 208px illustrated panel that sits above a centered modal title. `kind` selects the artwork, and `passkey` is the only kind today.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- Set `kind` to `passkey` (default). The panel fills its container, and the artwork stays 374px wide and centered.
18
-
19
- ```tsx
20
- import { style, Visual } from '@tempoxyz/ds'
21
-
22
- export function Demo() {
23
- return (
24
- <div {...styles.frame()}>
25
- <Visual kind="passkey" />
26
- </div>
27
- )
28
- }
29
-
30
- namespace styles {
31
- export const frame = style({ maxWidth: '24rem !custom', width: '100% !custom' })
32
- }
33
- ```
34
-
35
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Visual/Basic.tsx)
36
-
37
- ### Chip
38
-
39
- Add `Visual.Chip` for a short instruction. It sits 24px from the top and 12px from the end.
40
-
41
- ```tsx
42
- import { style, Visual } from '@tempoxyz/ds'
43
-
44
- export function Demo() {
45
- return (
46
- <div {...styles.frame()}>
47
- <Visual kind="passkey">
48
- <Visual.Chip>Touch to sign in</Visual.Chip>
49
- </Visual>
50
- </div>
51
- )
52
- }
53
-
54
- namespace styles {
55
- export const frame = style({ maxWidth: '24rem !custom', width: '100% !custom' })
56
- }
57
- ```
58
-
59
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Visual/Chip.tsx)
60
-
61
- ## Anatomy
62
-
63
- Import the component and assemble its parts.
64
-
65
- ```tsx
66
- import { Visual } from '@tempoxyz/ds'
67
-
68
- <Visual>
69
- <Visual.Chip />
70
- </Visual>
71
- ```
72
-
73
- ## Guidelines
74
-
75
- ### When to Use
76
-
77
- * Open an onboarding or feature modal, such as adding a passkey, above a centered title.
78
-
79
- ### When Not to Use
80
-
81
- * Use [IconTile](icon-tile.md) for acknowledgment, success, and destructive confirmation modals.
82
- * Use a [Dialog](dialog.md) without a visual for form and review modals.
83
-
84
- ### Use One Visual Above the Title
85
-
86
- **Do:** Place one visual above a centered title.
87
-
88
- ```tsx
89
- /**
90
- * Do example for "Use One Visual Above the Title" on the Visual page.
91
- * Place one visual above a centered title.
92
- * @module
93
- */
94
- import { style, Visual } from '@tempoxyz/ds'
95
-
96
- /** Renders the static preview, which the guideline card shows inert. */
97
- export function Demo() {
98
- return (
99
- <div {...styles.stack()}>
100
- <Visual kind="passkey" />
101
- <span {...styles.title()}>Add a passkey</span>
102
- <span {...styles.description()}>Sign in with your fingerprint or face.</span>
103
- </div>
104
- )
105
- }
106
-
107
- namespace styles {
108
- export const description = style({ color: 'content.secondary', typography: 'body.b2' })
109
-
110
- export const stack = style({
111
- alignItems: 'center',
112
- display: 'flex',
113
- flexDirection: 'column',
114
- gap: '8',
115
- maxWidth: '24rem !custom',
116
- textAlign: 'center',
117
- width: '100% !custom',
118
- })
119
-
120
- export const title = style({
121
- color: 'content.primary',
122
- marginBlockStart: '16',
123
- typography: 'heading.h4',
124
- })
125
- }
126
- ```
127
-
128
- **Don't:** Stack a visual and an [IconTile](icon-tile.md).
129
-
130
- ```tsx
131
- /**
132
- * Don't example for "Use One Visual Above the Title" on the Visual page.
133
- * Don't stack a visual and an icon chip.
134
- * @module
135
- */
136
- import { IconTile, style, Visual } from '@tempoxyz/ds'
137
- import { Passkey } from '@tempoxyz/ds/icons'
138
-
139
- /** Renders the static preview, which the guideline card shows inert. */
140
- export function Demo() {
141
- return (
142
- <div {...styles.stack()}>
143
- <IconTile>
144
- <Passkey />
145
- </IconTile>
146
- <Visual kind="passkey" />
147
- <span {...styles.title()}>Add a passkey</span>
148
- </div>
149
- )
150
- }
151
-
152
- namespace styles {
153
- export const stack = style({
154
- alignItems: 'center',
155
- display: 'flex',
156
- flexDirection: 'column',
157
- gap: '16',
158
- maxWidth: '24rem !custom',
159
- textAlign: 'center',
160
- width: '100% !custom',
161
- })
162
-
163
- export const title = style({ color: 'content.primary', typography: 'heading.h4' })
164
- }
165
- ```
166
-
167
- ### Keep the Chip to a Few Words
168
-
169
- The chip stays on one line, so a long label runs past the panel edge.
170
-
171
- **Do:** Write one short instruction in the chip.
172
-
173
- ```tsx
174
- /**
175
- * Do example for "Keep the Chip to a Few Words" on the Visual page.
176
- * Write one short instruction in the chip.
177
- * @module
178
- */
179
- import { style, Visual } from '@tempoxyz/ds'
180
-
181
- /** Renders the static preview, which the guideline card shows inert. */
182
- export function Demo() {
183
- return (
184
- <div {...styles.frame()}>
185
- <Visual kind="passkey">
186
- <Visual.Chip>Touch to sign in</Visual.Chip>
187
- </Visual>
188
- </div>
189
- )
190
- }
191
-
192
- namespace styles {
193
- export const frame = style({ maxWidth: '24rem !custom', width: '100% !custom' })
194
- }
195
- ```
196
-
197
- **Don't:** Write a sentence in the chip.
198
-
199
- ```tsx
200
- /**
201
- * Don't example for "Keep the Chip to a Few Words" on the Visual page.
202
- * Don't write a sentence in the chip.
203
- * @module
204
- */
205
- import { style, Visual } from '@tempoxyz/ds'
206
-
207
- /** Renders the static preview, which the guideline card shows inert. */
208
- export function Demo() {
209
- return (
210
- <div {...styles.frame()}>
211
- <Visual kind="passkey">
212
- <Visual.Chip>Place your finger on the sensor to finish signing in</Visual.Chip>
213
- </Visual>
214
- </div>
215
- )
216
- }
217
-
218
- namespace styles {
219
- export const frame = style({ maxWidth: '24rem !custom', width: '100% !custom' })
220
- }
221
- ```
222
-
223
- ## Content
224
-
225
- * **Chip:** Write an instruction of two to four words in sentence case, such as Touch to sign in, with no end punctuation.
226
-
227
- ## Accessibility
228
-
229
- A visual renders a `<div>` with no role and takes no focus. Screen readers skip the artwork and read the chip text in place.
230
-
231
- ### Semantics
232
-
233
- * **Artwork (aria-hidden):** Decorative, so screen readers skip it.
234
- * **Visual.Chip (span):** Plain text, read in place. The dot is hidden.
235
-
236
- ### Your Responsibilities
237
-
238
- * **Name the Feature in the Title:** The artwork has no text alternative, so the modal title names the feature.
239
- * **Label a Meaningful Visual (aria-label):** If the visual carries meaning alone, set `role="img"` and an `aria-label`.
240
-
241
- ## Related
242
-
243
- [IconTile](icon-tile.md)
244
-
245
- Use for icons at the top of other centered modals.
246
-
247
- [Dialog](dialog.md)
248
-
249
- Use for the modal that holds the visual.
@@ -1,377 +0,0 @@
1
- # Accessibility
2
-
3
- The accessibility baseline for every Tempo component, and what you still own.
4
-
5
- ## Overview
6
-
7
- Tempo products target [WCAG 2.2](https://www.w3.org/TR/WCAG22/) level AA on Web, in light and dark schemes, and follow the platform guidelines on iOS and Android. A screen conforms only when every part does, so one unlabelled button fails the page.
8
-
9
- Components render native elements, follow the [WAI-ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/), manage focus, and announce changes. You own names, content, page structure, composition, and testing. Rules below link their success criteria (SC).
10
-
11
- ## Color and Contrast
12
-
13
- Every foreground and background pair meets these ratios in both schemes, and [Color](color.md#contrast) lists the pairs that pass.
14
-
15
- * **Body Text (4.5:1):** For readable text, such as `content.primary` or `content.secondary` ([SC 1.4.3](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)).
16
- * **Large Text (3:1):** For large text, at least 24px in regular weight or 18.66px in bold.
17
- * **Non-Text Contrast (3:1):** For control borders, focus outlines, and meaningful graphics such as status icons ([SC 1.4.11](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html)).
18
- * **Exempt Content:** Logos, decorative graphics, and disabled controls, which must still look disabled.
19
-
20
- ### Never Use Color Alone
21
-
22
- Pair color with text, an icon, or a shape ([SC 1.4.1](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html)), as [Color](color.md#never-use-color-alone) shows.
23
-
24
- * **Statuses:** Pair each status color with an icon and a label.
25
- * **Errors:** Pair the invalid fill with an error message.
26
- * **Selection:** Mark a selected item with a check or indicator.
27
- * **Links:** Underline links that sit in body text.
28
-
29
- ## Keyboard and Focus
30
-
31
- Every action works with the keyboard alone, with no timing requirement ([SC 2.1.1](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html)), and focus never stays in a region the keyboard cannot leave ([SC 2.1.2](https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html)). Modal overlays are the exception, and Escape closes them.
32
-
33
- ### Focus Order
34
-
35
- Focus follows the reading order ([SC 2.4.3](https://www.w3.org/WAI/WCAG22/Understanding/focus-order.html)).
36
-
37
- * **Match the Visual Order:** Keep the DOM in reading order. Don't reorder content with CSS.
38
- * **Avoid Positive Tabindex (tabindex):** Never use a positive value. Use `-1` only on an element you focus with a script.
39
- * **One Stop per Widget (Tab):** Tabs, radio groups, and menus take one stop. Arrow keys move within them.
40
-
41
- ### Common Keys
42
-
43
- Components use the keys the Authoring Practices define for each widget.
44
-
45
- * **Move Between Controls (Tab and Shift+Tab):** Moves focus to the next or previous control in the tab order.
46
- * **Activate or Submit (Enter):** Activates a button or a link, and submits a form from a text field.
47
- * **Activate or Toggle (Space):** Activates a button, and toggles a checkbox or a switch.
48
- * **Move Within a Widget (Arrow keys):** Move within tabs, radio groups, menus, listboxes, and calendar grids.
49
- * **Jump to the First or Last Item (Home and End):** Jump to the first or last item in a list or menu, or to either end of a slider.
50
- * **Close an Overlay (Escape):** Closes the open overlay, and returns focus to the control that opened it.
51
-
52
- ### Shortcuts
53
-
54
- * **Reserved Keys:** Don't take over keys that browsers or assistive technology use.
55
- * **Single-Key Shortcuts:** Let the reader turn off or remap them, or limit them to a focused control ([SC 2.1.4](https://www.w3.org/WAI/WCAG22/Understanding/character-key-shortcuts.html)).
56
- * **Show Shortcuts (Kbd):** Show them with [Kbd](../components/kbd.md), which reads modifiers by name, such as Command K.
57
-
58
- ### Visible Focus
59
-
60
- Controls show an outline on keyboard focus ([SC 2.4.7](https://www.w3.org/WAI/WCAG22/Understanding/focus-visible.html)).
61
-
62
- ```tsx
63
- import { Button, Checkbox, Field, style, TextInput } from '@tempoxyz/ds'
64
-
65
- export function Demo() {
66
- return (
67
- <div {...styles.stack()}>
68
- <Field.Root>
69
- <Field.Label>Recipient</Field.Label>
70
- <TextInput.Group>
71
- <TextInput.Control placeholder="0x…" />
72
- </TextInput.Group>
73
- </Field.Root>
74
- <Field.Root>
75
- <Field.Item>
76
- <Checkbox />
77
- <Field.Label>Save as contact</Field.Label>
78
- </Field.Item>
79
- </Field.Root>
80
- <div {...styles.row()}>
81
- <Button variant="secondary">Cancel</Button>
82
- <Button>Continue</Button>
83
- </div>
84
- </div>
85
- )
86
- }
87
-
88
- namespace styles {
89
- export const row = style({ display: 'flex', gap: '12', justifyContent: 'flex-end' })
90
-
91
- export const stack = style({
92
- display: 'grid',
93
- gap: '16',
94
- maxWidth: '20rem !custom',
95
- width: '100% !custom',
96
- })
97
- }
98
- ```
99
-
100
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Foundations/FocusVisible.tsx)
101
-
102
- * **Outline (border.focus):** Buttons, fields, and other standalone controls draw a 2px solid outline.
103
- * **Outline Contrast (3:1):** Measures 5.7:1 on the dark page, but 2.8:1 on the light page, below the minimum.
104
- * **Invalid Fields (border.negative):** An invalid field draws its focus outline in the negative border color.
105
- * **Keyboard Only (:focus-visible):** Shows for keyboard focus only, and stays hidden on a pointer press.
106
- * **Menus and Listboxes:** The highlighted item takes a tinted background instead of an outline.
107
- * **Keep the Outline:** Do not remove it with `outline: none`. A restyled control still needs one.
108
- * **Leave Room (2px offset):** Leave room for the outline. A parent with `overflow: hidden` can clip it.
109
-
110
- ### Focus Not Obscured
111
-
112
- Never let sticky bars, banners, or toasts fully hide a focused control ([SC 2.4.11](https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum.html)).
113
-
114
- * **Sticky Bars (scroll-padding):** Set it on the scroll container to the height of sticky bars.
115
- * **Toasts:** Keep toasts clear of the next focused control. F6 reaches them, and focus pauses their timers.
116
-
117
- ### Overlays
118
-
119
- Modal overlays, such as [Dialog](../components/dialog.md), [AlertDialog](../components/alert-dialog.md), and [Drawer](../components/drawer.md), manage focus from open to close. Anchored popups, such as [Popover](../components/popover.md), [Menu](../components/menu.md), and [Tooltip](../components/tooltip.md), follow their own rules.
120
-
121
- * **On Open:** Focus moves into the overlay, so the reader starts inside it.
122
- * **While Open (Tab and Shift+Tab):** Focus cycles within the overlay. The page behind is inert and locked. Escape closes it.
123
- * **On Close:** Focus returns to the control that opened it, so the reader keeps their place.
124
- * **Popover:** Moves focus inside without a trap, and the page behind stays interactive.
125
- * **Menu:** Returns focus to the trigger on Escape or an outside press, as [Popover](../components/popover.md) does.
126
- * **Tooltip:** Never moves focus. It opens on hover and keyboard focus, and Escape dismisses it.
127
- * **Removed Trigger:** If the trigger is gone on close, such as a deleted row, move focus to a logical place.
128
-
129
- ## Screen Readers
130
-
131
- ### Name, Role, and Value
132
-
133
- Every control exposes a name, a role, and its state ([SC 4.1.2](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html)). Components set the role and state, and you supply the name.
134
-
135
- * **Prefer Visible Labels:** Use a visible label where you can. Voice control users speak the visible text.
136
- * **Match the Label:** Start the accessible name with the visible label text ([SC 2.5.3](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)).
137
- * **Use Aria-Label Sparingly (aria-label):** Use it only when a control has no visible text. Name the action.
138
- * **Leave the Role Out:** Don't put the role in the name. A screen reader already announces "button".
139
-
140
- ### States and Values
141
-
142
- * **Loading (aria-busy):** A loading button sets it for you. Add an `aria-label` to a standalone spinner.
143
- * **Truncated Values (Hex):** Screen readers receive the full value behind the truncated text.
144
- * **Struck Amounts (strikethrough):** Screen readers skip the strike, so say in text that the amount is replaced.
145
- * **Tooltips (Tooltip):** Adds no ARIA to its trigger. Name the trigger itself, and keep essential content out.
146
-
147
- ### Structure
148
-
149
- Screen reader users navigate by headings and landmarks ([SC 1.3.1](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)).
150
-
151
- * **Title and H1 (h1):** Use one main heading per page, and a unique title that names it ([SC 2.4.2](https://www.w3.org/WAI/WCAG22/Understanding/page-titled.html)).
152
- * **Heading Levels:** Use headings in order, without skipping levels, and pick each level for the outline.
153
- * **Landmarks (main):** [AppShell](../components/app-shell.md) and [SidebarMenu](../components/sidebar-menu.md) render them. Layout primitives take one through `render`.
154
- * **Named Regions (aria-label):** Name tab lists and the sidebar, and give each landmark a distinct label.
155
- * **Skip Link:** If the sidebar holds many links, add a skip link to the main content.
156
- * **Lists and Tables (list):** Mark up lists as lists and tabular data as a [Table](../components/table.md), not as styled divs.
157
-
158
- ### Status Messages
159
-
160
- A message that appears after page load needs a live region, which announces it without moving focus ([SC 4.1.3](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html)).
161
-
162
- * **Polite (polite):** Waits until the reader is idle. Use it for confirmations, progress, and result counts.
163
- * **Assertive (assertive):** Interrupts the reader. Use it only for a failure the reader must handle now.
164
- * **Render the Region First:** Render the region before its message, then update it. A new region can stay silent.
165
- * **Alert (intent):** Negative and warning alerts interrupt as alerts. Info and positive alerts announce politely.
166
- * **Toast (priority):** Announces politely. Set `'high'` only for urgent toasts, which interrupt.
167
- * **Banner (role):** Has no live region. Add `status` or `alert` when it appears after the page loads.
168
-
169
- ## Forms
170
-
171
- ### Labels and Instructions
172
-
173
- Label every field visibly, and state any format or requirement before the reader types ([SC 3.3.2](https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html)).
174
-
175
- **Do:** Label every field with a visible `Field.Label`, with hints in `Field.Description`.
176
-
177
- ```tsx
178
- /**
179
- * Do example for "Labels and Instructions" on the Accessibility page.
180
- * Label every field with a visible `Field.Label`, with hints in `Field.Description`.
181
- * @module
182
- */
183
- import { Field, style, TextInput } from '@tempoxyz/ds'
184
-
185
- /** Renders the static preview, which the guideline card shows inert. */
186
- export function Demo() {
187
- return (
188
- <div {...styles.frame()}>
189
- <Field.Root>
190
- <Field.Label>Recipient</Field.Label>
191
- <TextInput.Group>
192
- <TextInput.Control placeholder="0x…" />
193
- </TextInput.Group>
194
- <Field.Description>An address or contact name.</Field.Description>
195
- </Field.Root>
196
- </div>
197
- )
198
- }
199
-
200
- namespace styles {
201
- export const frame = style({ maxWidth: '100% !custom', width: '16rem !custom' })
202
- }
203
- ```
204
-
205
- **Don't:** Use a placeholder as the only label. It disappears on input.
206
-
207
- ```tsx
208
- /**
209
- * Don't example for "Labels and Instructions" on the Accessibility page.
210
- * Don't use a placeholder as the only label. It disappears on input and sits below 4.5:1 contrast.
211
- * @module
212
- */
213
- import { style, TextInput } from '@tempoxyz/ds'
214
-
215
- /** Renders the static preview, which the guideline card shows inert. */
216
- export function Demo() {
217
- return (
218
- <div {...styles.frame()}>
219
- <TextInput.Group>
220
- <TextInput.Control aria-label="Recipient" placeholder="Recipient address or contact" />
221
- </TextInput.Group>
222
- </div>
223
- )
224
- }
225
-
226
- namespace styles {
227
- export const frame = style({ maxWidth: '100% !custom', width: '16rem !custom' })
228
- }
229
- ```
230
-
231
- * **Linked Label (Field.Label):** [Field](../components/field.md) links the label to its control, which takes it as its name.
232
- * **Hints and Errors (aria-describedby):** `Field.Description` and a shown `Field.Error` read after the control's name.
233
- * **Required and Optional:** Mark required or optional fields in text, not by color or an asterisk alone.
234
- * **Group Related Controls (legend):** Group radios in a [Fieldset](../components/fieldset.md) whose legend asks one question.
235
- * **Autocomplete (autocomplete):** Set it on fields that collect personal data, such as email or name ([SC 1.3.5](https://www.w3.org/WAI/WCAG22/Understanding/identify-input-purpose.html)).
236
-
237
- ### Errors
238
-
239
- * **Error Text:** Describe the error and its fix in text next to the field ([SC 3.3.1](https://www.w3.org/WAI/WCAG22/Understanding/error-identification.html) and [SC 3.3.3](https://www.w3.org/WAI/WCAG22/Understanding/error-suggestion.html)).
240
- * **Review Before Payment:** Before an action that cannot be undone, such as a payment, show a review step ([SC 3.3.4](https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html)).
241
-
242
- ### Entry and Authentication
243
-
244
- * **Redundant Entry:** Fill in or offer information the reader already entered in this flow ([SC 3.3.7](https://www.w3.org/WAI/WCAG22/Understanding/redundant-entry.html)).
245
- * **Accessible Authentication (Paste):** Allow paste, passkeys, and password managers instead of a memory test ([SC 3.3.8](https://www.w3.org/WAI/WCAG22/Understanding/accessible-authentication-minimum.html)).
246
-
247
- ## Touch and Pointer
248
-
249
- ### Target Size
250
-
251
- Every pointer target meets a minimum size ([SC 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)), and touch screens need larger targets.
252
-
253
- * **Minimum (24 by 24px):** Every pointer target on Web, in CSS pixels. Links inside text are exempt.
254
- * **Touch Screens (44 by 44):** Aim for this size on touch screens, including iOS and Android.
255
- * **Button (32 to 56px):** Every size meets the minimum. The large size meets the touch target.
256
- * **Checkbox and RadioGroup (36px):** The hit area around the indicator. Pair it with `Field.Label` so the label toggles it.
257
- * **Slider (24px):** The height of the interactive track, which meets the minimum target size.
258
- * **Smaller Targets:** Grow a small target, such as a row icon, or keep clear space around it.
259
-
260
- ### Gestures and Dragging
261
-
262
- * **Dragging:** Offer a single-pointer alternative to each drag, such as a press on the track ([SC 2.5.7](https://www.w3.org/WAI/WCAG22/Understanding/dragging-movements.html)).
263
- * **Gestures:** Provide a single tap alternative to multi-finger and swipe gestures ([SC 2.5.1](https://www.w3.org/WAI/WCAG22/Understanding/pointer-gestures.html)).
264
- * **Pointer Cancellation:** Trigger actions on pointer up, so the reader can slide away to cancel ([SC 2.5.2](https://www.w3.org/WAI/WCAG22/Understanding/pointer-cancellation.html)).
265
-
266
- ## Zoom and Reflow
267
-
268
- ### Reflow
269
-
270
- Content reflows to a narrow viewport without loss and without scrolling in two directions ([SC 1.4.10](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html)).
271
-
272
- * **Narrow Viewport (320px):** Reflow to this width, which a 1280px window reaches at 400% zoom.
273
- * **Text Resize (200%):** Text resizes to this size without loss of content or function ([SC 1.4.4](https://www.w3.org/WAI/WCAG22/Understanding/resize-text.html)).
274
- * **Columns:** Stack columns at narrow widths. Fitted grids, wrapping rows, and containers reflow by default.
275
- * **Long Values:** Wrap long values, or truncate them with a way to view and copy the full value.
276
- * **Wide Content:** Tables, code blocks, and charts may scroll horizontally inside their own container.
277
-
278
- ### Text Spacing
279
-
280
- Content must survive these spacing overrides at once, without clipping or overlap ([SC 1.4.12](https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html)).
281
-
282
- * **Line Height (1.5):** A multiple of the font size, on every line.
283
- * **Paragraph Spacing (2):** A multiple of the font size, after paragraphs.
284
- * **Letter Spacing (0.12em):** Added between letters.
285
- * **Word Spacing (0.16em):** Added between words.
286
-
287
- **Do:** Size text containers with `min-height` and padding, so they grow with their content.
288
-
289
- ```tsx
290
- <Surface
291
- size="small"
292
- style={{ letterSpacing: '0.12em', lineHeight: 1.5, minHeight: 40, width: 200 }}
293
- >
294
- Alice sent you 25.00 USDC.
295
- </Surface>
296
- ```
297
-
298
- **Don't:** Set a fixed `height` on a text container. Spacing overrides clip its text.
299
-
300
- ```tsx
301
- <Surface
302
- size="small"
303
- style={{
304
- height: 40,
305
- letterSpacing: '0.12em',
306
- lineHeight: 1.5,
307
- overflow: 'hidden',
308
- width: 200,
309
- }}
310
- >
311
- Alice sent you 25.00 USDC.
312
- </Surface>
313
- ```
314
-
315
- ## User Preferences
316
-
317
- * **Forced Colors (forced-colors):** In contrast themes, buttons and fields keep a system focus outline. Icons use text color.
318
- * **Text Size (rem):** Spacing scales with the default font size. Test with a larger one.
319
-
320
- ## Motion
321
-
322
- [Motion](motion.md#reduced-motion) shows how to apply the reduced-motion preference to your own styles.
323
-
324
- * **Reduced Motion (prefers-reduced-motion):** Components remove movement and scaling, but keep color changes and brief fades.
325
- * **Moving Content (5 seconds):** Let the reader pause, stop, or hide anything that moves on its own for longer ([SC 2.2.2](https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html)).
326
- * **Flashing (3 per second):** Never flash content more often than this, even for a short alert ([SC 2.3.1](https://www.w3.org/WAI/WCAG22/Understanding/three-flashes-or-below-threshold.html)).
327
-
328
- ## Content
329
-
330
- * **Link Text:** Describe the destination, even out of context ([SC 2.4.4](https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.html)). See [Writing Style](content/writing-style.md#links).
331
- * **Alt Text (alt):** Describe meaningful images, and leave it empty on decorative ones ([SC 1.1.1](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html)).
332
- * **Time Limits:** Announce a time limit before it starts, and let the reader extend it ([SC 2.2.1](https://www.w3.org/WAI/WCAG22/Understanding/timing-adjustable.html)).
333
- * **Toast Actions (timeout: 0):** Offer a toast's action elsewhere too, or keep the toast open until dismissed.
334
- * **Page Language (lang):** Set the page language on the `<html>` element ([SC 3.1.1](https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html)).
335
-
336
- ## Testing
337
-
338
- Components run their tests in real Chromium at desktop and mobile widths, with real pointer and keyboard input, in both schemes and with reduced motion. Automated checks catch only some problems, so test each screen by hand.
339
-
340
- * **Automated Checks:** Run a checker on each screen, then confirm each result by hand.
341
- * **Keyboard:** Use every control by keyboard alone. Focus stays visible and never hides behind a sticky bar.
342
- * **Screen Reader (VoiceOver or NVDA):** Use VoiceOver with Safari and NVDA with Firefox or Chrome, and check each name and state.
343
-
344
- ## Checklist
345
-
346
- Before you ship a screen, confirm each item.
347
-
348
- * **Structure:** One h1, headings in order, landmarks, and a DOM that matches the visual order.
349
- * **Keyboard:** Every action works by keyboard, without traps, and focus stays visible and returns on close.
350
- * **Names:** Visible field labels, named icon buttons, and links that make sense out of context.
351
- * **Messages:** Errors state the fix, and status messages announce without moving focus.
352
- * **Contrast:** Text at 4.5:1 and outlines at 3:1 in both schemes, with nothing shown by color alone.
353
- * **Zoom and Targets:** Works at 320px wide and 200% zoom, with 24px targets on Web and 44pt on mobile.
354
- * **Motion:** Respects reduced motion, and nothing flashes more than three times a second.
355
- * **Time:** Action toasts stay until dismissed, and sessions warn before they expire.
356
-
357
- ## Related
358
-
359
- [Color](color.md)
360
-
361
- Covers contrast and color use.
362
-
363
- [Motion](motion.md)
364
-
365
- Covers reduced motion.
366
-
367
- [Forms](../patterns/forms.md)
368
-
369
- Covers labels and grouping.
370
-
371
- [Errors and Validation](../patterns/errors-and-validation.md)
372
-
373
- Covers writing and announcing errors.
374
-
375
- [Button](../components/button.md)
376
-
377
- Use for icon buttons and loading states.