@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
@@ -0,0 +1,4597 @@
1
+ # Product Foundations
2
+
3
+ Each section below is one page of the documentation at ds.tehq.dev.
4
+
5
+ ## Contents
6
+
7
+ - [Getting Started](#getting-started): Install Tempo Design System and render your first component.
8
+ - [Accessibility](#accessibility): The accessibility baseline for every Tempo component, and what you still own.
9
+ - [Agents](#agents): How coding agents read these docs and the source, and the rules they follow.
10
+ - [Color](#color): Color tokens for text, surfaces, borders, and status, with contrast rules.
11
+ - [Tone](#tone): How Tempo's voice adjusts to the reader, from a first visit to an error.
12
+ - [Voice](#voice): Tempo's personality in words, consistent across every product.
13
+ - [Writing Style](#writing-style): How Tempo writes interface text: sentence case, a verb first, and plain words.
14
+ - [Iconography](#iconography): Icons from the Tempo catalog, and how to size, color, and label them.
15
+ - [Building From Intent](#building-from-intent): Choose each component by the job of its content, not by the markup it replaces.
16
+ - [Layout](#layout): Page structure, grid, spacing, radius, and elevation.
17
+ - [Linter](#linter): Oxlint rules that check how your app uses Tempo Design System.
18
+ - [Motion](#motion-1): Easing curves, durations, and reduced-motion rules for state changes.
19
+ - [Radius and Padding](#radius-and-padding): How corner radius and padding pair, from fields to modals.
20
+ - [Typography](#typography): Type sets for titles, body text, values, and code.
21
+ - [FAQ](#faq): Common questions about building with, and contributing to, Tempo Design System.
22
+
23
+ ## Getting Started
24
+
25
+ Install Tempo Design System and render your first component.
26
+
27
+ ### Overview
28
+
29
+ Tempo Design System is the shared design language of Tempo products. `@tempoxyz/ds` ships it as components and variables for web and React Native.
30
+
31
+ The APIs accept only design system values. Zyzz compiles the components and your styles ahead of time for each platform.
32
+
33
+ ### Agent Prompt
34
+
35
+ Paste this prompt into your coding agent:
36
+
37
+ Read ds.tehq.dev and help me build my project with Tempo Design System.
38
+
39
+ ### Setup
40
+
41
+ #### Install the Library
42
+
43
+ Install `@tempoxyz/ds` and its Zyzz peer.
44
+
45
+ ```sh
46
+ npm install @tempoxyz/ds zyzz
47
+ ```
48
+
49
+ #### Choose Framework
50
+
51
+ Choose a compilation target and a variable mode:
52
+
53
+ * **TDS Variables (Quick):** Uses the components and variables as they ship.
54
+ * **Custom Variables (Advanced):** Extends the TDS variables with app tokens.
55
+
56
+ #### Vite
57
+
58
+ #### Configure Vite
59
+
60
+ Add Zyzz beside the existing framework plugin.
61
+
62
+ ```ts title="vite.config.ts"
63
+ import { defineConfig } from 'vite'
64
+ import { zyzz } from 'zyzz/vite'
65
+
66
+ export default defineConfig({
67
+ plugins: [zyzz()],
68
+ ssr: { noExternal: ['@tempoxyz/ds', 'zyzz'] },
69
+ })
70
+ ```
71
+
72
+ Run the existing dev or build command. The plugin emits the TDS variables, the Inter, Pilat, and JetBrains Mono fonts, and keyframes once, and each component emits its own rules. You import no stylesheet.
73
+
74
+ With `ssr.noExternal`, the plugin reads the library's contracts in a server build.
75
+
76
+ ##### TDS Variables (Quick)
77
+
78
+ #### Use a Component
79
+
80
+ Import components from `@tempoxyz/ds`. Style your own markup with TDS tokens through `style`.
81
+
82
+ ```tsx title="Checkout.tsx"
83
+ import { Button, style } from '@tempoxyz/ds'
84
+
85
+ export function Checkout() {
86
+ return (
87
+ <section {...styles.card()}>
88
+ <p>Ready to continue?</p>
89
+ <Button>Continue</Button>
90
+ </section>
91
+ )
92
+ }
93
+
94
+ namespace styles {
95
+ export const card = style({
96
+ backgroundColor: 'background.elevated',
97
+ borderRadius: 'sm',
98
+ color: 'content.primary',
99
+ padding: '24',
100
+ typography: 'body.b2',
101
+ })
102
+ }
103
+ ```
104
+
105
+ Tokens such as `content.primary`, `'24'`, and `body.b2` type-check against the TDS variables. Light and dark values follow the inherited `color-scheme`.
106
+
107
+ ##### Custom Variables (Advanced)
108
+
109
+ #### Define Config
110
+
111
+ Extend the TDS variables with app tokens, and export the bound helpers.
112
+
113
+ ```ts title="zyzz.config.ts"
114
+ import { variables } from '@tempoxyz/ds'
115
+ import { Config, Vars } from 'zyzz'
116
+
117
+ export const { style, vars } = Config.create({
118
+ id: 'app',
119
+ vars: Vars.extend(variables, { spacing: { bleed: '-0.75rem' } }, { id: 'app/vars' }),
120
+ })
121
+ ```
122
+
123
+ Place `zyzz.config.ts` at the root of the application source, such as `src/zyzz.config.ts`. The Vite plugin scans its directory for global styles.
124
+
125
+ #### Use a Component
126
+
127
+ Apply `vars()` to the app root. Style your markup with the bound `style` helper, which accepts TDS and app tokens.
128
+
129
+ ```tsx title="Checkout.tsx"
130
+ import { Button } from '@tempoxyz/ds'
131
+ import { style, vars } from './zyzz.config.js'
132
+
133
+ export function App() {
134
+ return (
135
+ <main {...vars()}>
136
+ <Checkout />
137
+ </main>
138
+ )
139
+ }
140
+
141
+ function Checkout() {
142
+ return (
143
+ <section {...styles.card()}>
144
+ <p>Ready to continue?</p>
145
+ <Button>Continue</Button>
146
+ </section>
147
+ )
148
+ }
149
+
150
+ namespace styles {
151
+ export const card = style({
152
+ backgroundColor: 'background.elevated',
153
+ color: 'content.primary',
154
+ marginInline: 'bleed',
155
+ padding: '24',
156
+ })
157
+ }
158
+ ```
159
+
160
+ #### Other Bundlers
161
+
162
+ #### Configure the Bundler
163
+
164
+ Add the matching unplugin adapter to the bundler configuration. Keep the existing TypeScript and JSX transforms.
165
+
166
+ ```ts title="rollup.config.ts"
167
+ import { zyzz } from 'zyzz/unplugin'
168
+
169
+ const plugins = [zyzz.rollup()]
170
+ // Use zyzz.webpack() or zyzz.esbuild() for those bundlers.
171
+ ```
172
+
173
+ Load the emitted stylesheet and script in the document. Adjust the paths to the deployment base.
174
+
175
+ ```html title="index.html"
176
+ <link rel="stylesheet" href="/zyzz.css" />
177
+ <script src="/zyzz.js"></script>
178
+ ```
179
+
180
+ Run the existing build command. [Bundler Setup](https://zyzz.style/docs/api/unplugin) lists the configuration for each bundler.
181
+
182
+ ##### TDS Variables (Quick)
183
+
184
+ #### Use a Component
185
+
186
+ Import components from `@tempoxyz/ds`. Style your own markup with TDS tokens through `style`.
187
+
188
+ ```tsx title="Checkout.tsx"
189
+ import { Button, style } from '@tempoxyz/ds'
190
+
191
+ export function Checkout() {
192
+ return (
193
+ <section {...styles.card()}>
194
+ <p>Ready to continue?</p>
195
+ <Button>Continue</Button>
196
+ </section>
197
+ )
198
+ }
199
+
200
+ namespace styles {
201
+ export const card = style({
202
+ backgroundColor: 'background.elevated',
203
+ borderRadius: 'sm',
204
+ color: 'content.primary',
205
+ padding: '24',
206
+ typography: 'body.b2',
207
+ })
208
+ }
209
+ ```
210
+
211
+ Tokens such as `content.primary`, `'24'`, and `body.b2` type-check against the TDS variables. Light and dark values follow the inherited `color-scheme`.
212
+
213
+ ##### Custom Variables (Advanced)
214
+
215
+ #### Define Config
216
+
217
+ Extend the TDS variables with app tokens, and export the bound helpers.
218
+
219
+ ```ts title="zyzz.config.ts"
220
+ import { variables } from '@tempoxyz/ds'
221
+ import { Config, Vars } from 'zyzz'
222
+
223
+ export const { style, vars } = Config.create({
224
+ id: 'app',
225
+ vars: Vars.extend(variables, { spacing: { bleed: '-0.75rem' } }, { id: 'app/vars' }),
226
+ })
227
+ ```
228
+
229
+ #### Use a Component
230
+
231
+ Apply `vars()` to the app root. Style your markup with the bound `style` helper, which accepts TDS and app tokens.
232
+
233
+ ```tsx title="Checkout.tsx"
234
+ import { Button } from '@tempoxyz/ds'
235
+ import { style, vars } from './zyzz.config.js'
236
+
237
+ export function App() {
238
+ return (
239
+ <main {...vars()}>
240
+ <Checkout />
241
+ </main>
242
+ )
243
+ }
244
+
245
+ function Checkout() {
246
+ return (
247
+ <section {...styles.card()}>
248
+ <p>Ready to continue?</p>
249
+ <Button>Continue</Button>
250
+ </section>
251
+ )
252
+ }
253
+
254
+ namespace styles {
255
+ export const card = style({
256
+ backgroundColor: 'background.elevated',
257
+ color: 'content.primary',
258
+ marginInline: 'bleed',
259
+ padding: '24',
260
+ })
261
+ }
262
+ ```
263
+
264
+ #### React Native
265
+
266
+ #### Configure Metro
267
+
268
+ Install the React Native peers, then wrap the Expo Metro configuration with Zyzz. Keep the existing transformer and Expo settings.
269
+
270
+ ```sh
271
+ npx expo install expo-haptics react-native-reanimated react-native-svg react-native-worklets
272
+ ```
273
+
274
+ ```ts title="metro.config.ts"
275
+ import { getDefaultConfig } from 'expo/metro-config'
276
+ import { zyzz } from 'zyzz/metro'
277
+
278
+ export default zyzz(getDefaultConfig(import.meta.dirname), {
279
+ fonts: { 'HB Set v0.96': 'HBSet', Inter: 'Inter', 'JetBrains Mono': 'JetBrainsMono' },
280
+ units: { px: 1, rem: 16 },
281
+ })
282
+ ```
283
+
284
+ `fonts` maps each Figma family to a font that your app registers. The library bundles no font files. To preview with iOS system fonts, map a family to `System`.
285
+
286
+ ##### TDS Variables (Quick)
287
+
288
+ #### Use a Component
289
+
290
+ Render components from `@tempoxyz/ds/mobile` below a `Provider` at the app root. Styles resolve against the nearest `Provider` above them.
291
+
292
+ ```tsx title="App.tsx"
293
+ import { Button, Provider, style } from '@tempoxyz/ds/mobile'
294
+ import { Text, View } from 'react-native'
295
+
296
+ export function App() {
297
+ return (
298
+ <Provider colorScheme="system">
299
+ <Checkout />
300
+ </Provider>
301
+ )
302
+ }
303
+
304
+ function Checkout() {
305
+ return (
306
+ <View {...styles.card()}>
307
+ <Text {...styles.label()}>Ready to continue?</Text>
308
+ <Button onPress={() => {}}>Continue</Button>
309
+ </View>
310
+ )
311
+ }
312
+
313
+ namespace styles {
314
+ export const card = style({
315
+ backgroundColor: 'background.elevated',
316
+ gap: '12',
317
+ paddingHorizontal: '20',
318
+ paddingVertical: '16',
319
+ })
320
+
321
+ export const label = style({ color: 'content.primary', typography: 'body.b2' })
322
+ }
323
+ ```
324
+
325
+ `colorScheme="system"` follows the device setting. To override it, pass `light` or `dark`.
326
+
327
+ ##### Custom Variables (Advanced)
328
+
329
+ #### Define Config
330
+
331
+ Define app tokens in sets named `base` and `inverse`. Every Zyzz config reads the set that `Provider` selects. Reference TDS values through `variables` and `inverse`.
332
+
333
+ ```ts title="zyzz.config.ts"
334
+ import { inverse as tdsInverse, variables } from '@tempoxyz/ds/mobile'
335
+ import { Vars } from 'zyzz'
336
+ import { defineConfig } from 'zyzz/react-native'
337
+
338
+ export const base = Vars.define({
339
+ color: {
340
+ caption: { light: variables.color.content.secondary, dark: variables.color.content.secondary },
341
+ },
342
+ })
343
+
344
+ export const inverse = Vars.extend(base, {
345
+ color: {
346
+ caption: {
347
+ light: tdsInverse.color.content.secondary,
348
+ dark: tdsInverse.color.content.secondary,
349
+ },
350
+ },
351
+ })
352
+
353
+ export const { style } = defineConfig({ defaultVars: 'base', id: 'app', vars: { base, inverse } })
354
+ ```
355
+
356
+ Zyzz extensions only replace existing tokens. Put app tokens in your own sets, not in extensions of the TDS sets.
357
+
358
+ #### Use a Component
359
+
360
+ Render TDS components below a `Provider`. Style your own elements with the bound `style` helper.
361
+
362
+ ```tsx title="App.tsx"
363
+ import { Button, Provider } from '@tempoxyz/ds/mobile'
364
+ import { Text, View } from 'react-native'
365
+ import { style } from './zyzz.config.js'
366
+
367
+ export function App() {
368
+ return (
369
+ <Provider colorScheme="system">
370
+ <View>
371
+ <Text {...styles.caption()}>Ready to continue?</Text>
372
+ <Button onPress={() => {}}>Continue</Button>
373
+ </View>
374
+ </Provider>
375
+ )
376
+ }
377
+
378
+ namespace styles {
379
+ export const caption = style({ color: 'caption' })
380
+ }
381
+ ```
382
+
383
+ ### Next Steps
384
+
385
+ [Build a Layout](components/layout.md#appshell)
386
+
387
+ Place a sticky sidebar beside the main content column.
388
+
389
+ [Trigger Actions](components/actions.md#button)
390
+
391
+ Submit forms, send payments, and run other actions.
392
+
393
+ [Collect TextInput](components/forms-and-inputs.md#field-1)
394
+
395
+ Link labels, descriptions, and errors to form controls.
396
+
397
+ [Show Feedback](components/feedback-and-status.md#toast)
398
+
399
+ Confirm results with brief notifications.
400
+
401
+ ## Accessibility
402
+
403
+ The accessibility baseline for every Tempo component, and what you still own.
404
+
405
+ ### Overview
406
+
407
+ 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.
408
+
409
+ 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).
410
+
411
+ ### Color and Contrast
412
+
413
+ Every foreground and background pair meets these ratios in both schemes, and [Color](#contrast) lists the pairs that pass.
414
+
415
+ * **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)).
416
+ * **Large Text (3:1):** For large text, at least 24px in regular weight or 18.66px in bold.
417
+ * **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)).
418
+ * **Exempt Content:** Logos, decorative graphics, and disabled controls, which must still look disabled.
419
+
420
+ #### Never Use Color Alone
421
+
422
+ 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](#never-use-color-alone-1) shows.
423
+
424
+ * **Statuses:** Pair each status color with an icon and a label.
425
+ * **Errors:** Pair the invalid fill with an error message.
426
+ * **Selection:** Mark a selected item with a check or indicator.
427
+ * **Links:** Underline links that sit in body text.
428
+
429
+ ### Keyboard and Focus
430
+
431
+ 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.
432
+
433
+ #### Focus Order
434
+
435
+ Focus follows the reading order ([SC 2.4.3](https://www.w3.org/WAI/WCAG22/Understanding/focus-order.html)).
436
+
437
+ * **Match the Visual Order:** Keep the DOM in reading order. Don't reorder content with CSS.
438
+ * **Avoid Positive Tabindex (tabindex):** Never use a positive value. Use `-1` only on an element you focus with a script.
439
+ * **One Stop per Widget (Tab):** Tabs, radio groups, and menus take one stop. Arrow keys move within them.
440
+
441
+ #### Common Keys
442
+
443
+ Components use the keys the Authoring Practices define for each widget.
444
+
445
+ * **Move Between Controls (Tab and Shift+Tab):** Moves focus to the next or previous control in the tab order.
446
+ * **Activate or Submit (Enter):** Activates a button or a link, and submits a form from a text field.
447
+ * **Activate or Toggle (Space):** Activates a button, and toggles a checkbox or a switch.
448
+ * **Move Within a Widget (Arrow keys):** Move within tabs, radio groups, menus, listboxes, and calendar grids.
449
+ * **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.
450
+ * **Close an Overlay (Escape):** Closes the open overlay, and returns focus to the control that opened it.
451
+
452
+ #### Shortcuts
453
+
454
+ * **Reserved Keys:** Don't take over keys that browsers or assistive technology use.
455
+ * **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)).
456
+ * **Show Shortcuts (Kbd):** Show them with [Kbd](components/data-display.md#kbd), which reads modifiers by name, such as Command K.
457
+
458
+ #### Visible Focus
459
+
460
+ Controls show an outline on keyboard focus ([SC 2.4.7](https://www.w3.org/WAI/WCAG22/Understanding/focus-visible.html)).
461
+
462
+ ```tsx
463
+ import { Button, Checkbox, Field, style, TextInput } from '@tempoxyz/ds'
464
+
465
+ export function Demo() {
466
+ return (
467
+ <div {...styles.stack()}>
468
+ <Field.Root>
469
+ <Field.Label>Recipient</Field.Label>
470
+ <TextInput.Group>
471
+ <TextInput.Control placeholder="0x…" />
472
+ </TextInput.Group>
473
+ </Field.Root>
474
+ <Field.Root>
475
+ <Field.Item>
476
+ <Checkbox />
477
+ <Field.Label>Save as contact</Field.Label>
478
+ </Field.Item>
479
+ </Field.Root>
480
+ <div {...styles.row()}>
481
+ <Button variant="secondary">Cancel</Button>
482
+ <Button>Continue</Button>
483
+ </div>
484
+ </div>
485
+ )
486
+ }
487
+
488
+ namespace styles {
489
+ export const row = style({ display: 'flex', gap: '12', justifyContent: 'flex-end' })
490
+
491
+ export const stack = style({
492
+ display: 'grid',
493
+ gap: '16',
494
+ maxWidth: '20rem !custom',
495
+ width: '100% !custom',
496
+ })
497
+ }
498
+ ```
499
+
500
+ [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Foundations/FocusVisible.tsx)
501
+
502
+ * **Outline (border.focus):** Buttons, fields, and other standalone controls draw a 2px solid outline.
503
+ * **Outline Contrast (3:1):** Measures 5.7:1 on the dark page, but 2.8:1 on the light page, below the minimum.
504
+ * **Invalid Fields (border.negative):** An invalid field draws its focus outline in the negative border color.
505
+ * **Keyboard Only (:focus-visible):** Shows for keyboard focus only, and stays hidden on a pointer press.
506
+ * **Menus and Listboxes:** The highlighted item takes a tinted background instead of an outline.
507
+ * **Keep the Outline:** Do not remove it with `outline: none`. A restyled control still needs one.
508
+ * **Leave Room (2px offset):** Leave room for the outline. A parent with `overflow: hidden` can clip it.
509
+
510
+ #### Focus Not Obscured
511
+
512
+ 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)).
513
+
514
+ * **Sticky Bars (scroll-padding):** Set it on the scroll container to the height of sticky bars.
515
+ * **Toasts:** Keep toasts clear of the next focused control. F6 reaches them, and focus pauses their timers.
516
+
517
+ #### Overlays
518
+
519
+ Modal overlays, such as [Dialog](components/overlays.md#dialog), [AlertDialog](components/overlays.md#alertdialog), and [Drawer](components/overlays.md#drawer), manage focus from open to close. Anchored popups, such as [Popover](components/overlays.md#popover), [Menu](components/overlays.md#menu), and [Tooltip](components/overlays.md#tooltip), follow their own rules.
520
+
521
+ * **On Open:** Focus moves into the overlay, so the reader starts inside it.
522
+ * **While Open (Tab and Shift+Tab):** Focus cycles within the overlay. The page behind is inert and locked. Escape closes it.
523
+ * **On Close:** Focus returns to the control that opened it, so the reader keeps their place.
524
+ * **Popover:** Moves focus inside without a trap, and the page behind stays interactive.
525
+ * **Menu:** Returns focus to the trigger on Escape or an outside press, as [Popover](components/overlays.md#popover) does.
526
+ * **Tooltip:** Never moves focus. It opens on hover and keyboard focus, and Escape dismisses it.
527
+ * **Removed Trigger:** If the trigger is gone on close, such as a deleted row, move focus to a logical place.
528
+
529
+ ### Screen Readers
530
+
531
+ #### Name, Role, and Value
532
+
533
+ 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.
534
+
535
+ * **Prefer Visible Labels:** Use a visible label where you can. Voice control users speak the visible text.
536
+ * **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)).
537
+ * **Use Aria-Label Sparingly (aria-label):** Use it only when a control has no visible text. Name the action.
538
+ * **Leave the Role Out:** Don't put the role in the name. A screen reader already announces "button".
539
+
540
+ #### States and Values
541
+
542
+ * **Loading (aria-busy):** A loading button sets it for you. Add an `aria-label` to a standalone spinner.
543
+ * **Truncated Values (Hex):** Screen readers receive the full value behind the truncated text.
544
+ * **Struck Amounts (strikethrough):** Screen readers skip the strike, so say in text that the amount is replaced.
545
+ * **Tooltips (Tooltip):** Adds no ARIA to its trigger. Name the trigger itself, and keep essential content out.
546
+
547
+ #### Structure
548
+
549
+ Screen reader users navigate by headings and landmarks ([SC 1.3.1](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)).
550
+
551
+ * **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)).
552
+ * **Heading Levels:** Use headings in order, without skipping levels, and pick each level for the outline.
553
+ * **Landmarks (main):** [AppShell](components/layout.md#appshell) and [SidebarMenu](components/navigation.md#sidebarmenu) render them. Layout primitives take one through `render`.
554
+ * **Named Regions (aria-label):** Name tab lists and the sidebar, and give each landmark a distinct label.
555
+ * **Skip Link:** If the sidebar holds many links, add a skip link to the main content.
556
+ * **Lists and Tables (list):** Mark up lists as lists and tabular data as a [Table](components/data-display.md#table), not as styled divs.
557
+
558
+ #### Status Messages
559
+
560
+ 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)).
561
+
562
+ * **Polite (polite):** Waits until the reader is idle. Use it for confirmations, progress, and result counts.
563
+ * **Assertive (assertive):** Interrupts the reader. Use it only for a failure the reader must handle now.
564
+ * **Render the Region First:** Render the region before its message, then update it. A new region can stay silent.
565
+ * **Alert (intent):** Negative and warning alerts interrupt as alerts. Info and positive alerts announce politely.
566
+ * **Toast (priority):** Announces politely. Set `'high'` only for urgent toasts, which interrupt.
567
+ * **Banner (role):** Has no live region. Add `status` or `alert` when it appears after the page loads.
568
+
569
+ ### Forms
570
+
571
+ #### Labels and Instructions
572
+
573
+ 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)).
574
+
575
+ **Do:** Label every field with a visible `Field.Label`, with hints in `Field.Description`.
576
+
577
+ ```tsx
578
+ /**
579
+ * Do example for "Labels and Instructions" on the Accessibility page.
580
+ * Label every field with a visible `Field.Label`, with hints in `Field.Description`.
581
+ * @module
582
+ */
583
+ import { Field, style, TextInput } from '@tempoxyz/ds'
584
+
585
+ /** Renders the static preview, which the guideline card shows inert. */
586
+ export function Demo() {
587
+ return (
588
+ <div {...styles.frame()}>
589
+ <Field.Root>
590
+ <Field.Label>Recipient</Field.Label>
591
+ <TextInput.Group>
592
+ <TextInput.Control placeholder="0x…" />
593
+ </TextInput.Group>
594
+ <Field.Description>An address or contact name.</Field.Description>
595
+ </Field.Root>
596
+ </div>
597
+ )
598
+ }
599
+
600
+ namespace styles {
601
+ export const frame = style({ maxWidth: '100% !custom', width: '16rem !custom' })
602
+ }
603
+ ```
604
+
605
+ **Don't:** Use a placeholder as the only label. It disappears on input.
606
+
607
+ ```tsx
608
+ /**
609
+ * Don't example for "Labels and Instructions" on the Accessibility page.
610
+ * Don't use a placeholder as the only label. It disappears on input and sits below 4.5:1 contrast.
611
+ * @module
612
+ */
613
+ import { style, TextInput } from '@tempoxyz/ds'
614
+
615
+ /** Renders the static preview, which the guideline card shows inert. */
616
+ export function Demo() {
617
+ return (
618
+ <div {...styles.frame()}>
619
+ <TextInput.Group>
620
+ <TextInput.Control aria-label="Recipient" placeholder="Recipient address or contact" />
621
+ </TextInput.Group>
622
+ </div>
623
+ )
624
+ }
625
+
626
+ namespace styles {
627
+ export const frame = style({ maxWidth: '100% !custom', width: '16rem !custom' })
628
+ }
629
+ ```
630
+
631
+ * **Linked Label (Field.Label):** [Field](components/forms-and-inputs.md#field-1) links the label to its control, which takes it as its name.
632
+ * **Hints and Errors (aria-describedby):** `Field.Description` and a shown `Field.Error` read after the control's name.
633
+ * **Required and Optional:** Mark required or optional fields in text, not by color or an asterisk alone.
634
+ * **Group Related Controls (legend):** Group radios in a [Fieldset](components/forms-and-inputs.md#fieldset) whose legend asks one question.
635
+ * **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)).
636
+
637
+ #### Errors
638
+
639
+ * **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)).
640
+ * **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)).
641
+
642
+ #### Entry and Authentication
643
+
644
+ * **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)).
645
+ * **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)).
646
+
647
+ ### Touch and Pointer
648
+
649
+ #### Target Size
650
+
651
+ 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.
652
+
653
+ * **Minimum (24 by 24px):** Every pointer target on Web, in CSS pixels. Links inside text are exempt.
654
+ * **Touch Screens (44 by 44):** Aim for this size on touch screens, including iOS and Android.
655
+ * **Button (32 to 56px):** Every size meets the minimum. The large size meets the touch target.
656
+ * **Checkbox and RadioGroup (36px):** The hit area around the indicator. Pair it with `Field.Label` so the label toggles it.
657
+ * **Slider (24px):** The height of the interactive track, which meets the minimum target size.
658
+ * **Smaller Targets:** Grow a small target, such as a row icon, or keep clear space around it.
659
+
660
+ #### Gestures and Dragging
661
+
662
+ * **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)).
663
+ * **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)).
664
+ * **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)).
665
+
666
+ ### Zoom and Reflow
667
+
668
+ #### Reflow
669
+
670
+ 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)).
671
+
672
+ * **Narrow Viewport (320px):** Reflow to this width, which a 1280px window reaches at 400% zoom.
673
+ * **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)).
674
+ * **Columns:** Stack columns at narrow widths. Fitted grids, wrapping rows, and containers reflow by default.
675
+ * **Long Values:** Wrap long values, or truncate them with a way to view and copy the full value.
676
+ * **Wide Content:** Tables, code blocks, and charts may scroll horizontally inside their own container.
677
+
678
+ #### Text Spacing
679
+
680
+ 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)).
681
+
682
+ * **Line Height (1.5):** A multiple of the font size, on every line.
683
+ * **Paragraph Spacing (2):** A multiple of the font size, after paragraphs.
684
+ * **Letter Spacing (0.12em):** Added between letters.
685
+ * **Word Spacing (0.16em):** Added between words.
686
+
687
+ **Do:** Size text containers with `min-height` and padding, so they grow with their content.
688
+
689
+ ```tsx
690
+ <Surface
691
+ size="small"
692
+ style={{ letterSpacing: '0.12em', lineHeight: 1.5, minHeight: 40, width: 200 }}
693
+ >
694
+ Alice sent you 25.00 USDC.
695
+ </Surface>
696
+ ```
697
+
698
+ **Don't:** Set a fixed `height` on a text container. Spacing overrides clip its text.
699
+
700
+ ```tsx
701
+ <Surface
702
+ size="small"
703
+ style={{
704
+ height: 40,
705
+ letterSpacing: '0.12em',
706
+ lineHeight: 1.5,
707
+ overflow: 'hidden',
708
+ width: 200,
709
+ }}
710
+ >
711
+ Alice sent you 25.00 USDC.
712
+ </Surface>
713
+ ```
714
+
715
+ ### User Preferences
716
+
717
+ * **Forced Colors (forced-colors):** In contrast themes, buttons and fields keep a system focus outline. Icons use text color.
718
+ * **Text Size (rem):** Spacing scales with the default font size. Test with a larger one.
719
+
720
+ ### Motion
721
+
722
+ [Motion](#reduced-motion) shows how to apply the reduced-motion preference to your own styles.
723
+
724
+ * **Reduced Motion (prefers-reduced-motion):** Components remove movement and scaling, but keep color changes and brief fades.
725
+ * **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)).
726
+ * **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)).
727
+
728
+ ### Content
729
+
730
+ * **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](#links).
731
+ * **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)).
732
+ * **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)).
733
+ * **Toast Actions (timeout: 0):** Offer a toast's action elsewhere too, or keep the toast open until dismissed.
734
+ * **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)).
735
+
736
+ ### Testing
737
+
738
+ 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.
739
+
740
+ * **Automated Checks:** Run a checker on each screen, then confirm each result by hand.
741
+ * **Keyboard:** Use every control by keyboard alone. Focus stays visible and never hides behind a sticky bar.
742
+ * **Screen Reader (VoiceOver or NVDA):** Use VoiceOver with Safari and NVDA with Firefox or Chrome, and check each name and state.
743
+
744
+ ### Checklist
745
+
746
+ Before you ship a screen, confirm each item.
747
+
748
+ * **Structure:** One h1, headings in order, landmarks, and a DOM that matches the visual order.
749
+ * **Keyboard:** Every action works by keyboard, without traps, and focus stays visible and returns on close.
750
+ * **Names:** Visible field labels, named icon buttons, and links that make sense out of context.
751
+ * **Messages:** Errors state the fix, and status messages announce without moving focus.
752
+ * **Contrast:** Text at 4.5:1 and outlines at 3:1 in both schemes, with nothing shown by color alone.
753
+ * **Zoom and Targets:** Works at 320px wide and 200% zoom, with 24px targets on Web and 44pt on mobile.
754
+ * **Motion:** Respects reduced motion, and nothing flashes more than three times a second.
755
+ * **Time:** Action toasts stay until dismissed, and sessions warn before they expire.
756
+
757
+ ### Related
758
+
759
+ [Color](#color)
760
+
761
+ Covers contrast and color use.
762
+
763
+ [Motion](#motion-1)
764
+
765
+ Covers reduced motion.
766
+
767
+ [Forms](patterns.md#forms)
768
+
769
+ Covers labels and grouping.
770
+
771
+ [Errors and Validation](patterns.md#errors-and-validation)
772
+
773
+ Covers writing and announcing errors.
774
+
775
+ [Button](components/actions.md#button)
776
+
777
+ Use for icon buttons and loading states.
778
+
779
+ ## Agents
780
+
781
+ How coding agents read these docs and the source, and the rules they follow.
782
+
783
+ ### Overview
784
+
785
+ Coding agents read the same guidance as people. This site serves every page as Markdown, and the library source documents every export, so an agent can work from the docs or from your codebase.
786
+
787
+ The rules on this page turn that guidance into requirements for generated UI, and type checks and lint rules verify what a tool can check.
788
+
789
+ ### Point Your Agent at the Docs
790
+
791
+ Give your agent one of these entry points.
792
+
793
+ * **Agent Prompt:** The [Getting Started](#agent-prompt) prompt points your agent at the home page, which returns the page index.
794
+ * **Page Index (/llms.txt):** [The index](/llms.txt) lists every page in sidebar order, with its Markdown link and description.
795
+ * **Full Text (/llms-full.txt):** [One file](/llms-full.txt) holds every page's Markdown, each after a `---` line and a `Source:` URL.
796
+ * **Copy Page:** On wide screens, Copy page copies the page's Markdown, and View markdown opens it.
797
+ * **In the Package (dist/docs):** The package ships the Markdown for its version in a few files by topic, with an agent guide that holds these rules.
798
+
799
+ #### Markdown Twins
800
+
801
+ Every page has a Markdown twin. The page URL returns the twin or the HTML page, depending on the request.
802
+
803
+ ```sh
804
+ curl https://ds.tehq.dev/docs/components/button
805
+ ```
806
+
807
+ * **Markdown Path:** A page path that ends in `.md` returns the twin, such as `/docs/components/button.md`.
808
+ * **Terminal Clients:** Requests from curl, Wget, HTTPie, and xh receive the twin at the page URL.
809
+ * **Agents and Crawlers:** Requests from a known AI agent or crawler receive the twin at the page URL.
810
+ * **Accept Header:** Ranking `text/markdown` or `text/plain` at or above `text/html` returns the twin.
811
+ * **Search and Previews:** Search engine crawlers and link previews still receive the HTML page.
812
+ * **Canonical Link:** Each Markdown response carries a canonical `Link` header to the HTML page.
813
+
814
+ #### What Changes in Markdown
815
+
816
+ A twin keeps the page's text, headings, and tables, and turns interactive parts into plain text.
817
+
818
+ * **Do and Don't:** Each Do and Don't card becomes a plain paragraph in the twin, starting with **Do:** or **Don't:**.
819
+ * **Live Examples (tsx):** Each live example becomes a code block with its full source and a link to the example.
820
+ * **Source Links:** Component pages link to the source on GitHub, whose TSDoc documents every prop.
821
+ * **Setup Options:** Each setup option on Getting Started takes its own heading, so the agent reads every one.
822
+
823
+ ### Documentation in the Source
824
+
825
+ Each public component and part carries TSDoc with its purpose, accessibility behavior, and a short example, so an agent in your codebase reads it without fetching this site. Check the type declarations too, since prop and default coverage is still growing.
826
+
827
+ ```tsx
828
+ /**
829
+ * An inline message tinted by `intent`. The `negative` and `warning`
830
+ * intents render `role="alert"` and interrupt screen readers.
831
+ */
832
+ export function Alert(props: Alert.Props) {}
833
+ ```
834
+
835
+ ### Rules for Generating Tempo UI
836
+
837
+ The rules are in [AGENTS.md](../AGENTS.md).
838
+
839
+ ### Checks
840
+
841
+ If a tool can check a rule, run it as a check.
842
+
843
+ * **Types (tsc):** Token names are typed, so an unknown token fails to compile.
844
+ * **Lint (@tempoxyz/ds/oxlint):** Checks styles, imports, accessible names, and hand-built components, as [Linter](#linter) lists.
845
+
846
+ ### Add Rules to Your Project
847
+
848
+ Add instructions like these to your project's AGENTS.md or CLAUDE.md file, so every agent session starts from the docs.
849
+
850
+ ```md title="AGENTS.md"
851
+ ## UI
852
+
853
+ - Build UI with Tempo Design System: `@tempoxyz/ds` on web, `@tempoxyz/ds/mobile` in React Native.
854
+ - Read https://ds.tehq.dev/llms.txt first. Before using a component, read its page as Markdown, such as https://ds.tehq.dev/docs/components/button.md.
855
+ - Treat each page's Guidelines, Content, and Accessibility sections as requirements.
856
+ - Choose each component by what its content means, not by the markup it replaces. Read https://ds.tehq.dev/docs/foundations/intent.md before you port a screen.
857
+ - Style with `style` and TDS tokens. Don't hardcode colors or spacing.
858
+ - Set text with one `typography` set, and let components set the type of their own parts. Use Pilat only for titles, and at most five styles on a screen. Read https://ds.tehq.dev/docs/foundations/typography.md before you style text.
859
+ - Read the pattern pages that a screen uses, such as https://ds.tehq.dev/docs/patterns/forms.md and https://ds.tehq.dev/docs/patterns/tables-and-lists.md.
860
+ - Write interface copy with the Content foundations, such as Writing Style.
861
+ ```
862
+
863
+ ### Writing for Agents
864
+
865
+ Keep documentation readable for both audiences.
866
+
867
+ * **Title and Description:** Start each page with a title and a one-sentence description of the page.
868
+ * **Shared Headings:** Use the same headings across pages, such as Overview, Guidelines, and Accessibility.
869
+ * **One Rule per Sentence:** Put each rule in its own sentence, so an agent can quote it on its own.
870
+ * **Do and Don't Cards:** Use Do and Don't cards for guidance, so their verdict survives in Markdown.
871
+
872
+ ### Related
873
+
874
+ [Getting Started](#getting-started)
875
+
876
+ Covers setup and the agent prompt.
877
+
878
+ [FAQ](#faq)
879
+
880
+ Covers common questions.
881
+
882
+ [Components](components.md#overview)
883
+
884
+ Covers the component catalog.
885
+
886
+ [Building From Intent](#building-from-intent)
887
+
888
+ Covers choosing a component by the job of its content.
889
+
890
+ [Linter](#linter)
891
+
892
+ Covers the lint rules that check library use.
893
+
894
+ [Voice](#voice)
895
+
896
+ Covers how Tempo UI copy sounds.
897
+
898
+ ## Color
899
+
900
+ Color tokens for text, surfaces, borders, and status, with contrast rules.
901
+
902
+ ### Overview
903
+
904
+ Color in Tempo is mostly black and white. Text, fills, and edges are neutrals at different strengths, so a screen reads through contrast and hierarchy rather than hue. A white card on a light gray page, black text, and one black primary action carry most of the interface.
905
+
906
+ Hue is the exception. Green, orange, and red report status in alerts, banners, and field states, and never decorate. Blue and violet mark tips and announcements.
907
+
908
+ Every color is a token named for its role. Backgrounds and containers fill, content colors text and icons, and lines and borders draw edges. Each token holds a light and a dark value, so one token works in both schemes.
909
+
910
+ ### Scales
911
+
912
+ Scales hold the raw colors that tokens draw from. Use a scale step directly only for charts and categories.
913
+
914
+ #### Neutral
915
+
916
+ | TokenLogo | Value |
917
+ | --- | --- |
918
+ | `neutral.000` | `#fff` |
919
+ | `neutral.003` | `#f7f7f7` |
920
+ | `neutral.004` | `#f5f5f5` |
921
+ | `neutral.006` | `#f0f0f0` |
922
+ | `neutral.008` | `#ebebeb` |
923
+ | `neutral.012` | `#e0e0e0` |
924
+ | `neutral.016` | `#d6d6d6` |
925
+ | `neutral.020` | `#ccc` |
926
+ | `neutral.024` | `#c2c2c2` |
927
+ | `neutral.028` | `#b8b8b8` |
928
+ | `neutral.032` | `#adadad` |
929
+ | `neutral.036` | `#a3a3a3` |
930
+ | `neutral.040` | `#999` |
931
+ | `neutral.044` | `#8f8f8f` |
932
+ | `neutral.048` | `#858585` |
933
+ | `neutral.052` | `#7a7a7a` |
934
+ | `neutral.056` | `#707070` |
935
+ | `neutral.060` | `#666` |
936
+ | `neutral.064` | `#5c5c5c` |
937
+ | `neutral.068` | `#525252` |
938
+ | `neutral.072` | `#474747` |
939
+ | `neutral.076` | `#3d3d3d` |
940
+ | `neutral.080` | `#333` |
941
+ | `neutral.084` | `#292929` |
942
+ | `neutral.088` | `#1f1f1f` |
943
+ | `neutral.092` | `#141414` |
944
+ | `neutral.096` | `#0a0a0a` |
945
+ | `neutral.100` | `#000` |
946
+
947
+ Each step names a percentage of black, from white to black.
948
+
949
+ #### Shade and Tint
950
+
951
+ | TokenLogo | Value |
952
+ | --- | --- |
953
+ | `neutral.shade.000` | `#00000000` |
954
+ | `neutral.shade.003` | `#00000008` |
955
+ | `neutral.shade.004` | `#0000000a` |
956
+ | `neutral.shade.008` | `#00000014` |
957
+ | `neutral.shade.012` | `#0000001f` |
958
+ | `neutral.shade.016` | `#00000029` |
959
+ | `neutral.shade.020` | `#00000033` |
960
+ | `neutral.shade.032` | `#00000052` |
961
+ | `neutral.shade.040` | `#00000066` |
962
+ | `neutral.shade.056` | `#0000008f` |
963
+ | `neutral.shade.060` | `#00000099` |
964
+ | `neutral.shade.080` | `#000000cc` |
965
+
966
+ | TokenLogo | Value |
967
+ | --- | --- |
968
+ | `neutral.tint.000` | `#ffffff00` |
969
+ | `neutral.tint.008` | `#ffffff14` |
970
+ | `neutral.tint.012` | `#ffffff1f` |
971
+ | `neutral.tint.016` | `#ffffff29` |
972
+ | `neutral.tint.020` | `#ffffff33` |
973
+ | `neutral.tint.024` | `#ffffff3d` |
974
+ | `neutral.tint.040` | `#ffffff66` |
975
+ | `neutral.tint.048` | `#ffffff7a` |
976
+ | `neutral.tint.052` | `#ffffff85` |
977
+ | `neutral.tint.056` | `#ffffff8f` |
978
+ | `neutral.tint.064` | `#ffffffa3` |
979
+ | `neutral.tint.080` | `#ffffffcc` |
980
+
981
+ Shades are black and tints are white, at the opacity the step names, so a fill keeps the same relative step on any background.
982
+
983
+ #### Accent
984
+
985
+ | Hue | Background | Foreground |
986
+ | --- | --- | --- |
987
+ | blue | `accent.blue.background` (`#4471ed` light, `#7498fb` dark) | `accent.blue.foreground` (`#3059d3` light, `#7498fb` dark) |
988
+ | cyan | `accent.cyan.background` (`#00aacb` light, `#48cce6` dark) | `accent.cyan.foreground` (`#056e85` light, `#48cce6` dark) |
989
+ | green | `accent.green.background` (`#13a963` light, `#59e5a4` dark) | `accent.green.foreground` (`#007441` light, `#59e5a4` dark) |
990
+ | magenta | `accent.magenta.background` (`#cc055b` light, `#e54088` dark) | `accent.magenta.foreground` (`#ba0352` light, `#e54088` dark) |
991
+ | olive | `accent.olive.background` (`#95b226` light, `#c4dc65` dark) | `accent.olive.foreground` (`#596d01` light, `#c4dc65` dark) |
992
+ | orange | `accent.orange.background` (`#e06f12` light, `#fa8e36` dark) | `accent.orange.foreground` (`#a14d04` light, `#fa8e36` dark) |
993
+ | purple | `accent.purple.background` (`#ba59dd` light, `#cf79ef` dark) | `accent.purple.foreground` (`#9835ba` light, `#cf79ef` dark) |
994
+ | red | `accent.red.background` (`#eb3417` light, `#f55c45` dark) | `accent.red.foreground` (`#bf1d00` light, `#f55c45` dark) |
995
+ | violet | `accent.violet.background` (`#7e59e4` light, `#9877f1` dark) | `accent.violet.foreground` (`#6f47d1` light, `#9877f1` dark) |
996
+
997
+ Each hue has a background, which switches with the scheme, and a foreground for accent text that stays readable on every surface.
998
+
999
+ ### Backgrounds
1000
+
1001
+ Two backgrounds sit below every component, and a third fills small chips on a visual. Components on them take their fills, borders, and text from the tokens that follow.
1002
+
1003
+ * `background.primary` (`#f5f5f5` light, `#141414` dark): The page behind cards, tables, and the app shell.
1004
+ * `background.elevated` (`#fff` light, `#1a1a1a` dark): Cards, dialogs, menus, and popovers above the page.
1005
+ * `background.secondary` (`#fff` light, `#141414` dark): Badges and chips that sit on a visual or a tint.
1006
+
1007
+ ### Containers
1008
+
1009
+ Containers fill components such as menu items, badges, and selected rows. They are translucent, so a fill keeps the same relative step on the page and on an elevated surface.
1010
+
1011
+ * `container.subtle` (`#00000008` light, `#ffffff14` dark): The faintest fill, such as a disabled field.
1012
+ * `container.regular` (`#0000000a` light, `#ffffff14` dark): Secondary buttons, filled fields, and tags.
1013
+ * `container.strong` (`#00000014` light, `#ffffff29` dark): Hovered and pressed controls, and slider tracks.
1014
+ * `container.positive` (`rgb(19 169 99 / 0.08)` light, `rgb(89 229 164 / 0.16)` dark): Positive alerts and tags, and copied values.
1015
+ * `container.warning` (`rgb(224 111 18 / 0.08)` light, `rgb(250 142 54 / 0.16)` dark): Warning alerts, banners, and tags.
1016
+ * `container.negative` (`rgb(235 52 23 / 0.08)` light, `rgb(245 92 69 / 0.16)` dark): Negative alerts, banners, and tags.
1017
+
1018
+ ### Borders
1019
+
1020
+ Lines outline edges and divide content, and borders mark focus and validation.
1021
+
1022
+ * `line.secondary` (`#00000014` light, `#ffffff14` dark): Dividers, table borders, and resting outlined fields.
1023
+ * `line.primary` (`#00000029` light, `#ffffff3d` dark): Outlined fields on hover, and unchecked choices.
1024
+ * `border.focus` (`#00000066` light, `#ffffff85` dark): The 2px outline that controls draw on keyboard focus.
1025
+ * `border.positive` (`rgb(19 169 99 / 0.16)` light, `rgb(89 229 164 / 0.32)` dark): The ring around a field that passed validation.
1026
+ * `border.warning` (`rgb(224 111 18 / 0.16)` light, `rgb(250 142 54 / 0.32)` dark): A ring that flags a field the reader should check.
1027
+ * `border.negative` (`rgb(235 52 23 / 0.16)` light, `rgb(245 92 69 / 0.32)` dark): The ring around an invalid field, checkbox, or switch.
1028
+
1029
+ ### Content
1030
+
1031
+ Content tokens color text and icons. Pick one by how much the reader needs it.
1032
+
1033
+ * `content.primary` (`#000` light, `#fff` dark): Titles, values, body text, and primary fills.
1034
+ * `content.secondary` (`#0000008f` light, `#ffffffa3` dark): Descriptions, captions, table cells, and placeholders.
1035
+ * `content.tertiary` (`#00000066` light, `#ffffff85` dark): Icons, chevrons, and separators beside a label.
1036
+ * `content.subtle` (`#00000033` light, `#ffffff33` dark): Tracks and marks that carry no text, such as a gauge.
1037
+ * `content.positive` (`#13a963` light, `#59e5a4` dark): Success text and icons, such as a confirmed payment.
1038
+ * `content.warning` (`#e06f12` light, `#fa8e36` dark): Caution text and icons, such as a fee warning.
1039
+ * `content.negative` (`#eb3417` light, `#f55c45` dark): Error text, field errors, and negative button fills.
1040
+
1041
+ ### Materials and Scrims
1042
+
1043
+ Materials are translucent layers in five strengths, and scrims dim the page behind an overlay. No component uses them yet.
1044
+
1045
+ * `material.ultrathin` (`#00000014` light, `#ffffff29` dark): The lightest translucent layer.
1046
+ * `material.thin` (`#00000033` light, `#ffffff3d` dark): A light translucent layer.
1047
+ * `material.regular` (`#00000066` light, `#ffffff7a` dark): A translucent layer of medium strength.
1048
+ * `material.thick` (`#00000099` light, `#ffffffa3` dark): A dense translucent layer.
1049
+ * `material.ultrathick` (`#000000cc` light, `#ffffffcc` dark): The densest translucent layer.
1050
+
1051
+ * `scrim.regular` (`#00000029`): Dims the page behind an overlay, at 16% black.
1052
+ * `scrim.strong` (`#00000052`): Dims the page further, at 32% black.
1053
+
1054
+ ### Intents
1055
+
1056
+ Components that report status take an intent, not a hue, so a status looks the same everywhere. Choose the intent by the message. An [Alert](components/feedback-and-status.md#alert) tints its container and colors its indicator by intent.
1057
+
1058
+ * **Neutral (content.subtle):** Default states and features, such as a payment that is still pending.
1059
+ * **Positive (content.positive):** Success, completion, and incoming funds, such as a confirmed payment.
1060
+ * **Warning (content.warning):** A risk that the reader must know about before they confirm an action.
1061
+ * **Negative (content.negative):** Errors, failures, and destructive actions, such as a payment that failed.
1062
+ * **Tip (accent.blue.background):** Optional context, such as the token that pays the network fee for a payment.
1063
+ * **Special (accent.violet.background):** A new feature to announce, such as a vault that earns on idle USDC balances.
1064
+
1065
+ Cyan, magenta, olive, and purple have no intent, so keep them for charts and categories.
1066
+
1067
+ ### Guidelines
1068
+
1069
+ #### Choose Tokens by Role
1070
+
1071
+ Pick the token that names the role, not a scale step that looks right in one scheme. Never write a raw color into product styles, and propose a token in the Design System project when none fits.
1072
+
1073
+ **Do:** Use tokens, which switch value with the scheme.
1074
+
1075
+ ```tsx
1076
+ /**
1077
+ * Do example for "Choose Tokens by Job" on the Color page.
1078
+ * Use tokens, which switch value with the scheme.
1079
+ * @module
1080
+ */
1081
+ import { style, variants } from '@tempoxyz/ds'
1082
+
1083
+ /** Renders the static preview, which the guideline card shows inert. */
1084
+ export function Demo() {
1085
+ return (
1086
+ <div {...styles.row()}>
1087
+ <div {...styles.panel({ scheme: 'light' })}>
1088
+ <span {...styles.label()}>Balance</span>
1089
+ <span {...styles.value()}>1,250.00 USDC</span>
1090
+ </div>
1091
+ <div {...styles.panel({ scheme: 'dark' })}>
1092
+ <span {...styles.label()}>Balance</span>
1093
+ <span {...styles.value()}>1,250.00 USDC</span>
1094
+ </div>
1095
+ </div>
1096
+ )
1097
+ }
1098
+
1099
+ namespace styles {
1100
+ export const label = style({ color: 'content.secondary', typography: 'body.b3' })
1101
+
1102
+ export const panel = variants({
1103
+ base: {
1104
+ backgroundColor: 'background.elevated',
1105
+ borderColor: 'line.secondary',
1106
+ borderRadius: 'xs',
1107
+ borderStyle: 'solid',
1108
+ borderWidth: 'regular',
1109
+ display: 'grid',
1110
+ gap: '4',
1111
+ padding: '16',
1112
+ },
1113
+ variants: {
1114
+ scheme: {
1115
+ dark: { colorScheme: 'dark !custom' },
1116
+ light: { colorScheme: 'light !custom' },
1117
+ },
1118
+ },
1119
+ })
1120
+
1121
+ export const row = style({ display: 'flex', flexWrap: 'wrap', gap: '12' })
1122
+
1123
+ export const value = style({ color: 'content.primary', typography: 'body.b1Strong' })
1124
+ }
1125
+ ```
1126
+
1127
+ **Don't:** Fix a color that only passes in one scheme.
1128
+
1129
+ ```tsx
1130
+ /**
1131
+ * Don't example for "Choose Tokens by Job" on the Color page.
1132
+ * Don't fix a color that only passes in one scheme.
1133
+ * @module
1134
+ */
1135
+ import { style, variants } from '@tempoxyz/ds'
1136
+
1137
+ /** Renders the static preview, which the guideline card shows inert. */
1138
+ export function Demo() {
1139
+ return (
1140
+ <div {...styles.row()}>
1141
+ <div {...styles.panel({ scheme: 'light' })}>
1142
+ <span {...styles.label()}>Balance</span>
1143
+ <span {...styles.value()}>1,250.00 USDC</span>
1144
+ </div>
1145
+ <div {...styles.panel({ scheme: 'dark' })}>
1146
+ <span {...styles.label()}>Balance</span>
1147
+ <span {...styles.value()}>1,250.00 USDC</span>
1148
+ </div>
1149
+ </div>
1150
+ )
1151
+ }
1152
+
1153
+ namespace styles {
1154
+ export const label = style({ color: '#666666 !custom', typography: 'body.b3' })
1155
+
1156
+ export const panel = variants({
1157
+ base: {
1158
+ backgroundColor: 'background.elevated',
1159
+ borderColor: 'line.secondary',
1160
+ borderRadius: 'xs',
1161
+ borderStyle: 'solid',
1162
+ borderWidth: 'regular',
1163
+ display: 'grid',
1164
+ gap: '4',
1165
+ padding: '16',
1166
+ },
1167
+ variants: {
1168
+ scheme: {
1169
+ dark: { colorScheme: 'dark !custom' },
1170
+ light: { colorScheme: 'light !custom' },
1171
+ },
1172
+ },
1173
+ })
1174
+
1175
+ export const row = style({ display: 'flex', flexWrap: 'wrap', gap: '12' })
1176
+
1177
+ export const value = style({ color: '#171717 !custom', typography: 'body.b1Strong' })
1178
+ }
1179
+ ```
1180
+
1181
+ #### Keep Text at Readable Contrast
1182
+
1183
+ Set text in the primary or secondary content color, since WCAG counts it as text. Field placeholders are the exception: they take the tertiary color, as the design draws them, below 4.5:1. Otherwise keep the tertiary color for glyphs, such as chevrons and separators.
1184
+
1185
+ **Do:** Set descriptions in `content.secondary`, which stays above 4.5:1 on both backgrounds.
1186
+
1187
+ ```tsx
1188
+ /**
1189
+ * Do example for "Keep Text at Readable Contrast" on the Color page.
1190
+ * Set descriptions in `content.secondary`, which stays above 4.5:1 on both backgrounds.
1191
+ * @module
1192
+ */
1193
+ import { style } from '@tempoxyz/ds'
1194
+
1195
+ /** Renders the static preview, which the guideline card shows inert. */
1196
+ export function Demo() {
1197
+ return (
1198
+ <div {...styles.stack()}>
1199
+ <span {...styles.title()}>Network fee</span>
1200
+ <span {...styles.description()}>Paid in PathUSD. Settles with the payment.</span>
1201
+ </div>
1202
+ )
1203
+ }
1204
+
1205
+ namespace styles {
1206
+ export const description = style({ color: 'content.secondary', typography: 'body.b2' })
1207
+
1208
+ export const stack = style({ display: 'grid', gap: '4' })
1209
+
1210
+ export const title = style({ color: 'content.primary', typography: 'body.b1Strong' })
1211
+ }
1212
+ ```
1213
+
1214
+ **Don't:** Set text people need to read in `content.tertiary`.
1215
+
1216
+ ```tsx
1217
+ /**
1218
+ * Don't example for "Keep Text at Readable Contrast" on the Color page.
1219
+ * Don't set text people need to read in `content.tertiary`.
1220
+ * @module
1221
+ */
1222
+ import { style } from '@tempoxyz/ds'
1223
+
1224
+ /** Renders the static preview, which the guideline card shows inert. */
1225
+ export function Demo() {
1226
+ return (
1227
+ <div {...styles.stack()}>
1228
+ <span {...styles.title()}>Network fee</span>
1229
+ <span {...styles.description()}>Paid in PathUSD. Settles with the payment.</span>
1230
+ </div>
1231
+ )
1232
+ }
1233
+
1234
+ namespace styles {
1235
+ export const description = style({ color: 'content.tertiary', typography: 'body.b2' })
1236
+
1237
+ export const stack = style({ display: 'grid', gap: '4' })
1238
+
1239
+ export const title = style({ color: 'content.primary', typography: 'body.b1Strong' })
1240
+ }
1241
+ ```
1242
+
1243
+ #### Reserve Accents for Meaning
1244
+
1245
+ Blue marks information, green success, orange caution, and red errors and destructive actions. Focus and selection stay neutral.
1246
+
1247
+ **Do:** Use red for an error or a removal.
1248
+
1249
+ ```tsx
1250
+ <Alert intent="negative">
1251
+ <Alert.Icon />
1252
+ <Alert.Content>This access key was revoked.</Alert.Content>
1253
+ </Alert>
1254
+ ```
1255
+
1256
+ **Don't:** Use red to draw attention to a safe event.
1257
+
1258
+ ```tsx
1259
+ <Alert intent="negative">
1260
+ <Alert.Icon />
1261
+ <Alert.Content>Your funds arrived.</Alert.Content>
1262
+ </Alert>
1263
+ ```
1264
+
1265
+ #### Use One Intent per Message
1266
+
1267
+ **Do:** Use a single warning for a single risk.
1268
+
1269
+ ```tsx
1270
+ <Alert intent="warning">
1271
+ <Alert.Icon />
1272
+ <Alert.Content>This address has never received a payment from you.</Alert.Content>
1273
+ </Alert>
1274
+ ```
1275
+
1276
+ **Don't:** Stack alerts of different intents for one risk.
1277
+
1278
+ ```tsx
1279
+ <Alert>
1280
+ <Alert.Icon />
1281
+ <Alert.Content>New address.</Alert.Content>
1282
+ </Alert>
1283
+ <Alert intent="warning">
1284
+ <Alert.Icon />
1285
+ <Alert.Content>Check the address.</Alert.Content>
1286
+ </Alert>
1287
+ <Alert intent="negative">
1288
+ <Alert.Icon />
1289
+ <Alert.Content>Payments cannot be reversed.</Alert.Content>
1290
+ </Alert>
1291
+ ```
1292
+
1293
+ #### Never Use Color Alone
1294
+
1295
+ Pair every status color with text or an icon. In charts, name each series in a label or a legend.
1296
+
1297
+ **Do:** Name each status in text beside its color.
1298
+
1299
+ ```tsx
1300
+ /** Do example for "Never Use Color Alone" on the Color page: name each status in text beside its color. @module */
1301
+ import { Alert, style } from '@tempoxyz/ds'
1302
+
1303
+ /** Renders the static preview, which the guideline card shows inert. */
1304
+ export function Demo() {
1305
+ return (
1306
+ <div {...styles.stack()}>
1307
+ <Alert intent="positive">
1308
+ <Alert.Icon />
1309
+ <Alert.Content>Confirmed</Alert.Content>
1310
+ </Alert>
1311
+ <Alert intent="warning">
1312
+ <Alert.Icon />
1313
+ <Alert.Content>Pending</Alert.Content>
1314
+ </Alert>
1315
+ <Alert intent="negative">
1316
+ <Alert.Icon />
1317
+ <Alert.Content>Failed</Alert.Content>
1318
+ </Alert>
1319
+ </div>
1320
+ )
1321
+ }
1322
+
1323
+ namespace styles {
1324
+ export const stack = style({
1325
+ display: 'flex',
1326
+ flexDirection: 'column',
1327
+ gap: '8',
1328
+ width: '100% !custom',
1329
+ })
1330
+ }
1331
+ ```
1332
+
1333
+ **Don't:** Rely on colored dots to tell Confirmed from Failed.
1334
+
1335
+ ```tsx
1336
+ /**
1337
+ * Don't example for "Never Use Color Alone" on the Color page.
1338
+ * Don't rely on colored dots to tell Confirmed from Failed.
1339
+ * @module
1340
+ */
1341
+ import { style, variants } from '@tempoxyz/ds'
1342
+
1343
+ /** Renders the static preview, which the guideline card shows inert. */
1344
+ export function Demo() {
1345
+ return (
1346
+ <div {...styles.row()}>
1347
+ <span {...styles.dot({ intent: 'positive' })} />
1348
+ <span {...styles.dot({ intent: 'warning' })} />
1349
+ <span {...styles.dot({ intent: 'negative' })} />
1350
+ </div>
1351
+ )
1352
+ }
1353
+
1354
+ namespace styles {
1355
+ export const dot = variants({
1356
+ base: { borderRadius: 'full', cornerShape: 'round', height: '12', width: '12' },
1357
+ variants: {
1358
+ intent: {
1359
+ negative: { backgroundColor: 'content.negative' },
1360
+ positive: { backgroundColor: 'content.positive' },
1361
+ warning: { backgroundColor: 'content.warning' },
1362
+ },
1363
+ },
1364
+ })
1365
+
1366
+ export const row = style({ alignItems: 'center', display: 'flex', gap: '16' })
1367
+ }
1368
+ ```
1369
+
1370
+ ### Contrast
1371
+
1372
+ Tempo targets WCAG 2.2 AA in both schemes.
1373
+
1374
+ * **Body Text (4.5:1):** Body text against its background.
1375
+ * **Large Text (3:1):** Text from 24px, or bold text from 18.66px.
1376
+ * **Non-Text (3:1):** Focus outlines, state borders, and icons.
1377
+
1378
+ Each ratio lists light mode first. Several pairs fall below these targets.
1379
+
1380
+ * **Primary on Elevated (21:1 and 18.4:1):** `content.primary` on `background.elevated`. Passes for any text, in light and dark.
1381
+ * **Secondary on Elevated (4.9:1 and 6.4:1):** `content.secondary` on `background.elevated`. Passes for body text, such as card descriptions.
1382
+ * **Secondary on Page (4.8:1 and 6.5:1):** `content.secondary` on `background.primary`. Passes for body text, such as page captions.
1383
+ * **Tertiary on Elevated (2.9:1 and 3.8:1):** `content.tertiary` glyphs, such as breadcrumb separators. Too faint for text in either scheme.
1384
+ * **Status Text on Status Fill (2.8:1+ and 4.7:1+):** `content.positive`, `warning`, and `negative` on their containers. Below 4.5:1 in light mode.
1385
+ * **Focus Outline (2.8:1 and 5.7:1):** The `border.focus` outline against the page. Below the 3:1 minimum in light mode.
1386
+ * **Invalid Border (1.3:1 and 1.6:1):** The `border.negative` ring against a surface. Below 3:1, so pair it with `Field.Error` text.
1387
+
1388
+ Lines measure below 3:1, so they divide content but never identify a control alone. Disabled controls are exempt, but must still look disabled.
1389
+
1390
+ ### Accessibility
1391
+
1392
+ * **Visible Focus (border.focus):** Components draw a 2px outline on keyboard focus. Don't replace it with a color change alone.
1393
+ * **Forced Colors (forced-colors):** Fields and buttons swap their resting outline for a system color outline on keyboard focus.
1394
+
1395
+ ### Related
1396
+
1397
+ [Typography](#typography)
1398
+
1399
+ Covers text sizes that change contrast thresholds.
1400
+
1401
+ [Accessibility](#accessibility)
1402
+
1403
+ Covers the full WCAG 2.2 AA checklist.
1404
+
1405
+ [Feedback and Status](patterns.md#feedback-and-status)
1406
+
1407
+ Covers choosing an intent.
1408
+
1409
+ [Banner](components/feedback-and-status.md#banner)
1410
+
1411
+ Use for status text on a status fill.
1412
+
1413
+ [Alert](components/feedback-and-status.md#alert)
1414
+
1415
+ Use for intent colors in context.
1416
+
1417
+ [Banner](components/feedback-and-status.md#banner)
1418
+
1419
+ Use for intent colors in context.
1420
+
1421
+ ## Tone
1422
+
1423
+ How Tempo's voice adjusts to the reader, from a first visit to an error.
1424
+
1425
+ ### Overview
1426
+
1427
+ [Voice](#voice) stays the same everywhere. Tone shifts with what the reader is doing and how they feel, and grows plainer and more specific as more money or access is at stake.
1428
+
1429
+ ### Situations
1430
+
1431
+ #### Onboarding
1432
+
1433
+ Welcome a new reader, and explain each new term once, in one sentence.
1434
+
1435
+ **Do:** Explain the first step and why it matters.
1436
+
1437
+ ```tsx
1438
+ <Empty.Root>
1439
+ <Empty.Icon>
1440
+ <Wallet />
1441
+ </Empty.Icon>
1442
+ <Empty.Title>Add funds to start</Empty.Title>
1443
+ <Empty.Description>Deposit dollars or stablecoins to send your first payment.</Empty.Description>
1444
+ <Empty.Actions>
1445
+ <Button size="small">Add funds</Button>
1446
+ </Empty.Actions>
1447
+ </Empty.Root>
1448
+ ```
1449
+
1450
+ **Don't:** Assume crypto vocabulary.
1451
+
1452
+ ```tsx
1453
+ <Empty.Root>
1454
+ <Empty.Icon>
1455
+ <Wallet />
1456
+ </Empty.Icon>
1457
+ <Empty.Title>Bridge assets</Empty.Title>
1458
+ <Empty.Description>Bridge ERC-20s to the L1 to bootstrap liquidity.</Empty.Description>
1459
+ </Empty.Root>
1460
+ ```
1461
+
1462
+ #### Success
1463
+
1464
+ State what finished in a positive [Toast](components/feedback-and-status.md#toast) when nothing is left to do, then stop.
1465
+
1466
+ * **Name the Result:** Use a noun and a past-tense verb.
1467
+ * **Add the Detail:** Add the amount or recipient as confirmation.
1468
+ * **Skip the Celebration:** Leave out praise, exclamation marks, and emoji.
1469
+ * **Wait for the Network:** Show a pending state until the network confirms.
1470
+
1471
+ #### In Progress
1472
+
1473
+ Be calm and specific about what happens next and how long it takes.
1474
+
1475
+ * **Name the Step:** End a status label with an ellipsis (…).
1476
+ * **Explain Long Waits:** Name the wait, and whether to stay on the page.
1477
+
1478
+ **Do:** State what the system does and set an expectation.
1479
+
1480
+ ```tsx
1481
+ <Progress.Root value={60}>
1482
+ <Progress.Label>Confirming payment</Progress.Label>
1483
+ <Progress.Track>
1484
+ <Progress.Indicator />
1485
+ </Progress.Track>
1486
+ </Progress.Root>
1487
+ <p>This usually takes less than a second.</p>
1488
+ ```
1489
+
1490
+ **Don't:** Leave the reader with an open-ended wait.
1491
+
1492
+ ```tsx
1493
+ <Spinner />
1494
+ <p>Please wait…</p>
1495
+ ```
1496
+
1497
+ #### Warnings
1498
+
1499
+ State a risk once, beside the content it affects, and only if the reader can act on it.
1500
+
1501
+ **Do:** State the risk and what to check in one or two plain sentences.
1502
+
1503
+ ```tsx
1504
+ /**
1505
+ * Do example for "Warnings" on the Tone page.
1506
+ * State the risk and what to check in one or two plain sentences.
1507
+ * @module
1508
+ */
1509
+ import { Alert, style } from '@tempoxyz/ds'
1510
+
1511
+ /** Renders the static preview, which the guideline card shows inert. */
1512
+ export function Demo() {
1513
+ return (
1514
+ <Alert intent="warning" {...styles.alert()}>
1515
+ <Alert.Icon />
1516
+ <Alert.Content>
1517
+ Payments are final. Check that the address matches the one you were given.
1518
+ </Alert.Content>
1519
+ </Alert>
1520
+ )
1521
+ }
1522
+
1523
+ namespace styles {
1524
+ export const alert = style({ maxWidth: '20rem !custom' })
1525
+ }
1526
+ ```
1527
+
1528
+ **Don't:** Shout, stack exclamation marks, or use the `negative` intent for a warning.
1529
+
1530
+ ```tsx
1531
+ /**
1532
+ * Don't example for "Warnings" on the Tone page.
1533
+ * Don't shout, stack exclamation marks, or use the `negative` intent for a warning.
1534
+ * @module
1535
+ */
1536
+ import { Alert, style } from '@tempoxyz/ds'
1537
+
1538
+ /** Renders the static preview, which the guideline card shows inert. */
1539
+ export function Demo() {
1540
+ return (
1541
+ <Alert intent="negative" {...styles.alert()}>
1542
+ <Alert.Icon />
1543
+ <Alert.Content>
1544
+ WARNING!! Double-check everything or your money is GONE forever!
1545
+ </Alert.Content>
1546
+ </Alert>
1547
+ )
1548
+ }
1549
+
1550
+ namespace styles {
1551
+ export const alert = style({ maxWidth: '20rem !custom' })
1552
+ }
1553
+ ```
1554
+
1555
+ * **Local Risk (Alert):** Use a warning [Alert](components/feedback-and-status.md#alert) for a field or section.
1556
+ * **Product-Wide Condition (Banner):** Use a warning [Banner](components/feedback-and-status.md#banner) for the whole product.
1557
+
1558
+ #### Errors
1559
+
1560
+ Stay neutral and direct, and follow the [error message structure](#structure-error-messages).
1561
+
1562
+ * **Lead With the Fix:** Add the cause only if it helps the reader act.
1563
+ * **Show It Inline:** Show a blocking error inline, not in a [Toast](components/feedback-and-status.md#toast).
1564
+ * **Keep the TextInput:** Keep the input, and state what to change.
1565
+ * **Skip Blame and Jokes:** Don't apologize at length, blame, or joke.
1566
+
1567
+ #### Security and Keys
1568
+
1569
+ **Do:** State the exact consequence and who is responsible.
1570
+
1571
+ ```tsx
1572
+ <Empty.Root>
1573
+ <Empty.Icon>
1574
+ <Key />
1575
+ </Empty.Icon>
1576
+ <Empty.Title>Save your recovery key</Empty.Title>
1577
+ <Empty.Description>Anyone with this key can move your funds. Tempo cannot recover it for you.</Empty.Description>
1578
+ </Empty.Root>
1579
+ ```
1580
+
1581
+ **Don't:** Use humor for a security step.
1582
+
1583
+ ```tsx
1584
+ <Empty.Root>
1585
+ <Empty.Icon>
1586
+ <Key />
1587
+ </Empty.Icon>
1588
+ <Empty.Title>Your secret sauce 🤫</Empty.Title>
1589
+ <Empty.Description>Keep it somewhere safe-ish!</Empty.Description>
1590
+ </Empty.Root>
1591
+ ```
1592
+
1593
+ #### Sending Money
1594
+
1595
+ Repeat the exact amount, recipient, and fee on every step.
1596
+
1597
+ **Do:** Put the exact amount on the final action.
1598
+
1599
+ ```tsx
1600
+ <Button><Send />Send 25.00 USDC</Button>
1601
+ ```
1602
+
1603
+ **Don't:** Use a playful label for a payment.
1604
+
1605
+ ```tsx
1606
+ <Button>Let's go</Button>
1607
+ ```
1608
+
1609
+ #### Irreversible Actions
1610
+
1611
+ Use a serious, explicit tone, as [Destructive Actions](patterns.md#destructive-actions) shows.
1612
+
1613
+ * **Name the Consequence:** Name exactly what the action removes or ends.
1614
+ * **Confirm Payments on Review:** On review, state once that payments are final.
1615
+
1616
+ ## Voice
1617
+
1618
+ Tempo's personality in words, consistent across every product.
1619
+
1620
+ ### Overview
1621
+
1622
+ Voice is how Tempo sounds in every product: a knowledgeable colleague who explains plainly and wastes no time, as on [tempo.xyz](https://tempo.xyz) and in the [developer docs](https://tempo.xyz/developers). [Tone](#tone) adapts it to each situation, such as a first visit or a failed payment.
1623
+
1624
+ ### How Tempo Writes
1625
+
1626
+ * **Cover Three Points:** State what is happening, what it costs, and what happens next.
1627
+ * **Define Before Explaining:** Open with one sentence that defines the thing, then list its parts.
1628
+ * **State Rules as Facts:** State limits and protections as what Tempo enforces, not as warnings.
1629
+ * **Name Availability Plainly (Testnet only):** Name a stage, such as beta or devnet only, with where it applies and what changes it.
1630
+ * **State What an Operation Doesn't Do:** State plainly that a refund is a new payment, not a reversal.
1631
+
1632
+ ### Traits
1633
+
1634
+ Each trait names the line it must not cross.
1635
+
1636
+ #### Clear, Not Simplistic
1637
+
1638
+ **Do:** Describe a payment in everyday money words, and format each value with
1639
+ [Amount](components/blockchain.md#amount) or [Hex](components/blockchain.md#hex).
1640
+
1641
+ ```tsx
1642
+ /**
1643
+ * Do example for "Clear, Not Simplistic" on the Voice page.
1644
+ * Describe a payment in everyday money words, and format each value with Amount or Hex.
1645
+ * @module
1646
+ */
1647
+ import { Amount, Hex, ListGroup, style } from '@tempoxyz/ds'
1648
+
1649
+ /** Renders the static preview, which the guideline card shows inert. */
1650
+ export function Demo() {
1651
+ return (
1652
+ <ListGroup.Root {...styles.rows()}>
1653
+ <ListGroup.Row>
1654
+ <ListGroup.Label>To</ListGroup.Label>
1655
+ <Hex value="0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc" />
1656
+ </ListGroup.Row>
1657
+ <ListGroup.Row>
1658
+ <ListGroup.Label>Amount</ListGroup.Label>
1659
+ <Amount symbol="USDC" value="250.00" />
1660
+ </ListGroup.Row>
1661
+ <ListGroup.Row>
1662
+ <ListGroup.Label>Network fee</ListGroup.Label>
1663
+ <Amount currency="USD" precise value="0.0003" />
1664
+ </ListGroup.Row>
1665
+ </ListGroup.Root>
1666
+ )
1667
+ }
1668
+
1669
+ namespace styles {
1670
+ export const rows = style({ maxWidth: '18rem !custom', width: '100% !custom' })
1671
+ }
1672
+ ```
1673
+
1674
+ **Don't:** Show protocol fields, base units, or gas parameters on a payment review.
1675
+
1676
+ ```tsx
1677
+ /**
1678
+ * Don't example for "Clear, Not Simplistic" on the Voice page.
1679
+ * Don't show protocol fields, base units, or gas parameters on a payment review.
1680
+ * @module
1681
+ */
1682
+ import { ListGroup, style } from '@tempoxyz/ds'
1683
+
1684
+ /** Renders the static preview, which the guideline card shows inert. */
1685
+ export function Demo() {
1686
+ return (
1687
+ <ListGroup.Root {...styles.rows()}>
1688
+ <ListGroup.Row>
1689
+ <ListGroup.Label>Recipient EOA</ListGroup.Label>
1690
+ <span {...styles.value()}>0x3c44cddd…</span>
1691
+ </ListGroup.Row>
1692
+ <ListGroup.Row>
1693
+ <ListGroup.Label>Value</ListGroup.Label>
1694
+ <span {...styles.value()}>250000000</span>
1695
+ </ListGroup.Row>
1696
+ <ListGroup.Row>
1697
+ <ListGroup.Label>Gas limit</ListGroup.Label>
1698
+ <span {...styles.value()}>21000</span>
1699
+ </ListGroup.Row>
1700
+ </ListGroup.Root>
1701
+ )
1702
+ }
1703
+
1704
+ namespace styles {
1705
+ export const rows = style({ maxWidth: '18rem !custom', width: '100% !custom' })
1706
+
1707
+ export const value = style({ typography: 'mono.m1' })
1708
+ }
1709
+ ```
1710
+
1711
+ #### Precise, Not Approximate
1712
+
1713
+ **Do:** State the exact amount, time, or limit.
1714
+
1715
+ ```tsx
1716
+ <Alert>
1717
+ <Alert.Icon />
1718
+ <Alert.Content>This quote expires in 10 minutes.</Alert.Content>
1719
+ </Alert>
1720
+ ```
1721
+
1722
+ **Don't:** Use vague words such as soon or shortly.
1723
+
1724
+ ```tsx
1725
+ <Alert>
1726
+ <Alert.Icon />
1727
+ <Alert.Content>This quote expires soon.</Alert.Content>
1728
+ </Alert>
1729
+ ```
1730
+
1731
+ #### Confident, Not Boastful
1732
+
1733
+ **Do:** Confirm the result as a fact, and stop.
1734
+
1735
+ ```tsx
1736
+ <Empty.Root>
1737
+ <Empty.Icon>
1738
+ <Receipt />
1739
+ </Empty.Icon>
1740
+ <Empty.Title>Payment sent</Empty.Title>
1741
+ <Empty.Description>Alice received 25.00 USDC.</Empty.Description>
1742
+ </Empty.Root>
1743
+ ```
1744
+
1745
+ **Don't:** Use hype, hedging, exclamation marks, or emoji for a routine result.
1746
+
1747
+ ```tsx
1748
+ <Empty.Root>
1749
+ <Empty.Icon>
1750
+ <Receipt />
1751
+ </Empty.Icon>
1752
+ <Empty.Title>Woohoo! 🎉</Empty.Title>
1753
+ <Empty.Description>Your lightning-fast payment is on its way!</Empty.Description>
1754
+ </Empty.Root>
1755
+ ```
1756
+
1757
+ #### Calm, Not Casual
1758
+
1759
+ **Do:** State what failed, and reassure the reader with a fact.
1760
+
1761
+ ```tsx
1762
+ <Alert intent="negative">
1763
+ <Alert.Icon />
1764
+ <Alert.Content>The payment did not go through. Your balance has not changed.</Alert.Content>
1765
+ </Alert>
1766
+ ```
1767
+
1768
+ **Don't:** Joke about a failure that involves money.
1769
+
1770
+ ```tsx
1771
+ <Alert intent="negative">
1772
+ <Alert.Icon />
1773
+ <Alert.Content>Oops! Something broke. Our bad.</Alert.Content>
1774
+ </Alert>
1775
+ ```
1776
+
1777
+ #### Respectful, Not Condescending
1778
+
1779
+ **Do:** Address the reader as you, and describe the problem and the fix.
1780
+
1781
+ ```tsx
1782
+ <Alert intent="negative">
1783
+ <Alert.Icon />
1784
+ <Alert.Content>This address isn't valid. Check it and try again.</Alert.Content>
1785
+ </Alert>
1786
+ ```
1787
+
1788
+ **Don't:** Blame the reader for an error.
1789
+
1790
+ ```tsx
1791
+ <Alert intent="negative">
1792
+ <Alert.Icon />
1793
+ <Alert.Content>You entered an invalid address.</Alert.Content>
1794
+ </Alert>
1795
+ ```
1796
+
1797
+ #### Helpful, Not Pushy
1798
+
1799
+ **Do:** Offer the next step plainly, and let the reader decide.
1800
+
1801
+ ```tsx
1802
+ <Button variant="secondary">Turn on notifications</Button>
1803
+ ```
1804
+
1805
+ **Don't:** Use fear or urgency to drive a choice.
1806
+
1807
+ ```tsx
1808
+ <Button variant="secondary">Don't miss out</Button>
1809
+ ```
1810
+
1811
+ ## Writing Style
1812
+
1813
+ How Tempo writes interface text: sentence case, a verb first, and plain words.
1814
+
1815
+ ### Overview
1816
+
1817
+ Tempo's interface text is short, specific, and plain. It names the thing and the action in words that a reader new to crypto knows.
1818
+
1819
+ The rules follow [tempo.xyz](https://tempo.xyz) and the [developer docs](https://tempo.xyz/developers). [Where the Sources Differ](#where-the-sources-differ) records the choice for product screens.
1820
+
1821
+ ### Principles
1822
+
1823
+ * **Clear Before Clever:** State what happens, in familiar words.
1824
+ * **Short:** Cut each word that doesn't change the meaning.
1825
+ * **Specific:** Name the action and its object, not Continue.
1826
+ * **Consistent:** Call one thing by one name everywhere.
1827
+
1828
+ ### Capitalization
1829
+
1830
+ Use sentence case everywhere, capitalizing only the first word and proper nouns.
1831
+
1832
+ **Do:** Capitalize the first word of each heading, sentence, and label.
1833
+
1834
+ ```tsx
1835
+ /**
1836
+ * Do example for "Writing Style" on the Writing Style page.
1837
+ * Capitalize the first word of each heading, sentence, and label.
1838
+ * @module
1839
+ */
1840
+ import { Button, style } from '@tempoxyz/ds'
1841
+
1842
+ /** Renders the static preview, which the guideline card shows inert. */
1843
+ export function Demo() {
1844
+ return (
1845
+ <div {...styles.card()}>
1846
+ <p {...styles.title()}>Add funds</p>
1847
+ <p {...styles.text()}>Deposit USDC from another wallet or an exchange.</p>
1848
+ <Button size="small">Copy deposit address</Button>
1849
+ </div>
1850
+ )
1851
+ }
1852
+
1853
+ namespace styles {
1854
+ export const card = style({
1855
+ alignItems: 'flex-start',
1856
+ display: 'flex',
1857
+ flexDirection: 'column',
1858
+ gap: '8',
1859
+ maxWidth: '18rem !custom',
1860
+ })
1861
+
1862
+ export const text = style({
1863
+ color: 'content.secondary',
1864
+ margin: '0 !custom',
1865
+ typography: 'body.b2',
1866
+ })
1867
+
1868
+ export const title = style({
1869
+ color: 'content.primary',
1870
+ margin: '0 !custom',
1871
+ typography: 'body.b1Strong',
1872
+ })
1873
+ }
1874
+ ```
1875
+
1876
+ **Don't:** Capitalize every word, in headings or anywhere else in the interface.
1877
+
1878
+ ```tsx
1879
+ /**
1880
+ * Don't example for "Writing Style" on the Writing Style page.
1881
+ * Don't capitalize every word, in headings or anywhere else in the interface.
1882
+ * @module
1883
+ */
1884
+ import { Button, style } from '@tempoxyz/ds'
1885
+
1886
+ /** Renders the static preview, which the guideline card shows inert. */
1887
+ export function Demo() {
1888
+ return (
1889
+ <div {...styles.card()}>
1890
+ <p {...styles.title()}>Add Funds</p>
1891
+ <p {...styles.text()}>Deposit USDC From Another Wallet or an Exchange.</p>
1892
+ <Button size="small">Copy Deposit Address</Button>
1893
+ </div>
1894
+ )
1895
+ }
1896
+
1897
+ namespace styles {
1898
+ export const card = style({
1899
+ alignItems: 'flex-start',
1900
+ display: 'flex',
1901
+ flexDirection: 'column',
1902
+ gap: '8',
1903
+ maxWidth: '18rem !custom',
1904
+ })
1905
+
1906
+ export const text = style({
1907
+ color: 'content.secondary',
1908
+ margin: '0 !custom',
1909
+ typography: 'body.b2',
1910
+ })
1911
+
1912
+ export const title = style({
1913
+ color: 'content.primary',
1914
+ margin: '0 !custom',
1915
+ typography: 'body.b1Strong',
1916
+ })
1917
+ }
1918
+ ```
1919
+
1920
+ #### Proper Nouns
1921
+
1922
+ * **Tempo Products and Standards:** Tempo Wallet, Tempo Explorer, and TIP-20.
1923
+ * **Companies and Networks:** Other companies, products, and networks.
1924
+ * **People, Places, and Languages:** Including currencies named after a place.
1925
+ * **Symbols and Values:** Keep USDC, iOS, and 0x1a2b… exactly as written.
1926
+ * **Lowercase Symbols:** Rewrite a sentence that starts with pathUSD.
1927
+ * **Features and Concepts:** Keep access key and passkey lowercase in titles.
1928
+
1929
+ **Do:** Capitalize the product name and nothing else.
1930
+
1931
+ ```tsx
1932
+ <Field.Root>
1933
+ <Field.Label>Recipient address</Field.Label>
1934
+ <TextInput.Group>
1935
+ <TextInput.Control placeholder="0x…" />
1936
+ </TextInput.Group>
1937
+ <Field.Description>Paste a Tempo address or choose a saved contact.</Field.Description>
1938
+ </Field.Root>
1939
+ ```
1940
+
1941
+ **Don't:** Capitalize common words or lowercase a product name.
1942
+
1943
+ ```tsx
1944
+ <Field.Root>
1945
+ <Field.Label>Recipient Address</Field.Label>
1946
+ <TextInput.Group>
1947
+ <TextInput.Control placeholder="0x…" />
1948
+ </TextInput.Group>
1949
+ <Field.Description>Paste a tempo address or choose a saved Contact.</Field.Description>
1950
+ </Field.Root>
1951
+ ```
1952
+
1953
+ #### Never All Caps
1954
+
1955
+ **Do:** Choose clearer words, or use size and weight sparingly.
1956
+
1957
+ ```tsx
1958
+ <Alert intent="warning">
1959
+ <Alert.Icon />
1960
+ <Alert.Content>This quote expires in 10 minutes.</Alert.Content>
1961
+ </Alert>
1962
+ ```
1963
+
1964
+ **Don't:** Set text in all caps or use capitals for emphasis.
1965
+
1966
+ ```tsx
1967
+ <Alert intent="warning">
1968
+ <Alert.Icon />
1969
+ <Alert.Content>THIS QUOTE EXPIRES IN 10 MINUTES.</Alert.Content>
1970
+ </Alert>
1971
+ ```
1972
+
1973
+ ### Write Labels
1974
+
1975
+ #### Buttons
1976
+
1977
+ * **Verb First:** Start each button and menu item with a verb.
1978
+ * **Short Labels:** Use one to three words, such as Add funds.
1979
+ * **One Label per Action:** Use the same label for an action everywhere.
1980
+
1981
+ **Do:** Name the action and the object it affects.
1982
+
1983
+ ```tsx
1984
+ <Button>Delete access key</Button>
1985
+ ```
1986
+
1987
+ **Don't:** Use generic labels such as "OK", "Yes", or "Submit".
1988
+
1989
+ ```tsx
1990
+ <Button>OK</Button>
1991
+ ```
1992
+
1993
+ #### Form Labels
1994
+
1995
+ * **Name the Value:** Use a noun phrase, with no colon or Enter your.
1996
+ * **Hints in the Description:** Put format hints in the field's description.
1997
+ * **Example Placeholders:** Use a placeholder only for an example value.
1998
+ * **Mark the Minority:** Mark optional fields when most are required.
1999
+
2000
+ #### Headings and Titles
2001
+
2002
+ * **Name the Page:** Name the page or task, such as API keys.
2003
+ * **Verb for a Task:** Start a task title with its verb.
2004
+ * **Question to Confirm:** Write a confirmation title as a question.
2005
+ * **One Phrase:** Use one phrase, with no end punctuation.
2006
+
2007
+ #### Links
2008
+
2009
+ * **Name the Destination:** Name where the link goes.
2010
+ * **No Typed Arrows:** Leave out →, and let [ListGroup](components/data-display.md#listgroup) draw a chevron.
2011
+
2012
+ #### Tooltips
2013
+
2014
+ * **A Few Words:** Name or clarify the trigger of a [Tooltip](components/overlays.md#tooltip).
2015
+ * **Definitions:** A definition can be one full sentence.
2016
+ * **Nothing Essential:** Keep actions and essential details on the page.
2017
+
2018
+ #### Status Labels
2019
+
2020
+ * **Short Status:** Use one or two words in a [Badge](components/data-display.md#badge) or status column.
2021
+ * **One Name per Status:** Keep one name for each status on every screen.
2022
+
2023
+ ### Write Messages
2024
+
2025
+ #### Structure Error Messages
2026
+
2027
+ Most errors state three things, in this order.
2028
+
2029
+ * **What Happened:** State the outcome first, in plain words.
2030
+ * **Why:** State the cause if it helps the reader act.
2031
+ * **What to Do:** End with the action that resolves it.
2032
+ * **Beside a Field:** Lead with the fix when context shows the issue.
2033
+ * **Unknown Cause:** Say what to try, not only Something went wrong.
2034
+ * **Support Reference:** Add a support reference as secondary text.
2035
+
2036
+ **Do:** State how to fix the value, with the limit that applies.
2037
+
2038
+ ```tsx
2039
+ /**
2040
+ * Do example for "Structure Error Messages" on the Writing Style page.
2041
+ * State how to fix the value, with the limit that applies.
2042
+ * @module
2043
+ */
2044
+ import { AmountInput, Field, style, Token } from '@tempoxyz/ds'
2045
+
2046
+ /** Renders the static preview, which the guideline card shows inert. */
2047
+ export function Demo() {
2048
+ return (
2049
+ <Field.Root invalid {...styles.field()}>
2050
+ <AmountInput.Root defaultValue="1500">
2051
+ <Field.Label>Amount</Field.Label>
2052
+ <AmountInput.Control />
2053
+ <Token readOnly symbol="USDC" />
2054
+ <Field.Error match>Enter an amount up to your balance of 1,250.00 USDC.</Field.Error>
2055
+ </AmountInput.Root>
2056
+ </Field.Root>
2057
+ )
2058
+ }
2059
+
2060
+ namespace styles {
2061
+ export const field = style({ maxWidth: '18rem !custom', width: '100% !custom' })
2062
+ }
2063
+ ```
2064
+
2065
+ **Don't:** Show raw error names, codes, or RPC messages as the message.
2066
+
2067
+ ```tsx
2068
+ /**
2069
+ * Don't example for "Structure Error Messages" on the Writing Style page.
2070
+ * Don't show raw error names, codes, or RPC messages as the message.
2071
+ * @module
2072
+ */
2073
+ import { AmountInput, Field, style, Token } from '@tempoxyz/ds'
2074
+
2075
+ /** Renders the static preview, which the guideline card shows inert. */
2076
+ export function Demo() {
2077
+ return (
2078
+ <Field.Root invalid {...styles.field()}>
2079
+ <AmountInput.Root defaultValue="1500">
2080
+ <Field.Label>Amount</Field.Label>
2081
+ <AmountInput.Control />
2082
+ <Token readOnly symbol="USDC" />
2083
+ <Field.Error match>Error: InsufficientBalance</Field.Error>
2084
+ </AmountInput.Root>
2085
+ </Field.Root>
2086
+ )
2087
+ }
2088
+
2089
+ namespace styles {
2090
+ export const field = style({ maxWidth: '18rem !custom', width: '100% !custom' })
2091
+ }
2092
+ ```
2093
+
2094
+ #### Empty States
2095
+
2096
+ * **Why It's Empty:** Say why the area has nothing to show.
2097
+ * **What to Do Next:** Offer the next step, as [Empty States](patterns.md#empty-states) shows.
2098
+
2099
+ #### Confirmations
2100
+
2101
+ * **Two to Four Words:** Title a [Toast](components/feedback-and-status.md#toast) with the outcome.
2102
+ * **Needed Detail Only:** Describe only needed detail, such as the amount.
2103
+ * **Shortcut Actions:** Make each toast action reachable elsewhere too.
2104
+
2105
+ ### Put the Important Words First
2106
+
2107
+ Readers scan the first few words of a line.
2108
+
2109
+ **Do:** Start with the subject, and put conditions after it.
2110
+
2111
+ ```tsx
2112
+ <Alert intent="warning">
2113
+ <Alert.Icon />
2114
+ <Alert.Content>Transfers over $10,000 need a second approval.</Alert.Content>
2115
+ </Alert>
2116
+ ```
2117
+
2118
+ **Don't:** Open with filler or bury the rule at the end.
2119
+
2120
+ ```tsx
2121
+ <Alert intent="warning">
2122
+ <Alert.Icon />
2123
+ <Alert.Content>Please note that, depending on the amount, a second approval may be needed.</Alert.Content>
2124
+ </Alert>
2125
+ ```
2126
+
2127
+ ### Use Plain Words
2128
+
2129
+ Write for a reader new to crypto.
2130
+
2131
+ * **Everyday Words:** Say network fee, not gas.
2132
+ * **Define at First Use:** Explain a technical term at its first use.
2133
+
2134
+ ### Address the Reader as You
2135
+
2136
+ * **Your, Not My:** Use your for what belongs to the reader, not my.
2137
+ * **We for Tempo:** Use we only for Tempo as a company, and rarely.
2138
+
2139
+ **Do:** Address the reader and state what happens next.
2140
+
2141
+ ```tsx
2142
+ <Empty.Root>
2143
+ <Empty.Icon>
2144
+ <Wallet />
2145
+ </Empty.Icon>
2146
+ <Empty.Title>No payments yet</Empty.Title>
2147
+ <Empty.Description>Payments you send or receive appear here.</Empty.Description>
2148
+ </Empty.Root>
2149
+ ```
2150
+
2151
+ **Don't:** Describe the reader in the third person.
2152
+
2153
+ ```tsx
2154
+ <Empty.Root>
2155
+ <Empty.Icon>
2156
+ <Wallet />
2157
+ </Empty.Icon>
2158
+ <Empty.Title>No payments yet</Empty.Title>
2159
+ <Empty.Description>The user has not made any payments.</Empty.Description>
2160
+ </Empty.Root>
2161
+ ```
2162
+
2163
+ ### Keep It Short
2164
+
2165
+ * **Buttons (1 to 3 words):** A verb and its object.
2166
+ * **Headings (under 6 words):** The page or the task.
2167
+ * **Descriptions (1 sentence):** The detail that the title leaves out.
2168
+ * **Error Messages (1 or 2 sentences):** The outcome, then the fix.
2169
+ * **Sentences (under 20 words):** Split a longer sentence in two.
2170
+
2171
+ **Do:** Cut filler such as please, simply, just, and successfully.
2172
+
2173
+ ```tsx
2174
+ <Alert intent="positive">
2175
+ <Alert.Icon />
2176
+ <Alert.Content>Payment sent</Alert.Content>
2177
+ </Alert>
2178
+ ```
2179
+
2180
+ **Don't:** Pad a message with words that add nothing.
2181
+
2182
+ ```tsx
2183
+ <Alert intent="positive">
2184
+ <Alert.Icon />
2185
+ <Alert.Content>Your payment was sent successfully</Alert.Content>
2186
+ </Alert>
2187
+ ```
2188
+
2189
+ ### Write for Everyone
2190
+
2191
+ * **Name the Control:** Name the control, not below, above, or click.
2192
+ * **Prefer Common Words:** Skip idioms, which translate poorly.
2193
+
2194
+ ### Where the Sources Differ
2195
+
2196
+ | Topic | What the sources do | Product screens |
2197
+ | --------------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------- |
2198
+ | Heading case | Site and docs headings use sentence case. The docs home and one docs heading use Title Case. Tempo Performance mixes both. | Sentence case. |
2199
+ | Contractions | The docs mix can't with cannot, and doesn't with does not. Tempo Wallet errors use Cannot. | Contractions. |
2200
+ | Repeated labels | The marketing site words one contact button two ways. | One label per action. |
2201
+ | Link arrows | Some docs links end with →. | No typed arrows. |
2202
+ | Colon titles | Some docs and site titles join two phrases with a colon. | One phrase per title. |
2203
+
2204
+ ### Related
2205
+
2206
+ [Button](components/actions.md#button)
2207
+
2208
+ Use for button labels.
2209
+
2210
+ [Field](components/forms-and-inputs.md#field-1)
2211
+
2212
+ Use for labels, descriptions, and errors.
2213
+
2214
+ [Errors and Validation](patterns.md#errors-and-validation)
2215
+
2216
+ Covers when and where to show errors.
2217
+
2218
+ ## Iconography
2219
+
2220
+ Icons from the Tempo catalog, and how to size, color, and label them.
2221
+
2222
+ ### Overview
2223
+
2224
+ Icons support a label rather than replace it. Every icon in the catalog shares one grid and stroke weight, so any group of icons reads as one family.
2225
+
2226
+
2227
+
2228
+ * **Grid (16 by 16):** Every icon draws on the same square grid.
2229
+ * **Size (1em):** An icon matches the font size of its text.
2230
+ * **Color (currentColor):** An icon fills with the color of its text.
2231
+ * **Imports (one module each):** A build carries only the icons it imports.
2232
+
2233
+ ```tsx
2234
+ import { Send } from '@tempoxyz/ds/icons'
2235
+
2236
+ export function SendButton() {
2237
+ return (
2238
+ <Button>
2239
+ <Send />
2240
+ Send payment
2241
+ </Button>
2242
+ )
2243
+ }
2244
+ ```
2245
+
2246
+ ### Size and Color
2247
+
2248
+ Components size and color their own icons, so inside a [Button](components/actions.md#button) you add only the icon as a child.
2249
+
2250
+ #### Size
2251
+
2252
+ * **Beside Text (1em):** The default in buttons, links, and running text.
2253
+ * **Beside Titles (20px):** A larger icon beside a section or card title.
2254
+ * **Status Icons (20px):** A status icon beside a message, as in a [Toast](components/feedback-and-status.md#toast).
2255
+ * **Alert Indicator (16px):** An [Alert](components/feedback-and-status.md#alert) marks its tone with a square in a 16px box.
2256
+ * **Modal Icons (24px):** An [IconTile](components/data-display.md#icontile) frames the icon above a modal title.
2257
+ * **Standalone Icons (fontSize):** Set its font size, not its width and height.
2258
+
2259
+ #### Color
2260
+
2261
+ Set the color on the icon or its parent, with the same roles as text.
2262
+
2263
+ * **Primary (content.primary):** The default, beside primary labels and text.
2264
+ * **Secondary (content.secondary):** Beside metadata, such as an update time.
2265
+ * **Status (content.warning):** Only for an icon that reports a status.
2266
+
2267
+ ### Guidelines
2268
+
2269
+ #### Pair Icons With Text
2270
+
2271
+ Drop the label only for actions that are familiar without words, such as Close, Copy, and More. Don't give an icon to only one of several buttons, since it draws attention to that action.
2272
+
2273
+ **Do:** Use icon-only buttons for actions with a universal icon.
2274
+
2275
+ ```tsx
2276
+ <Button aria-label="Copy address" shape="icon" variant="secondary">
2277
+ <Copy />
2278
+ </Button>
2279
+ <Button aria-label="Delete contact" shape="icon" variant="secondary">
2280
+ <Delete />
2281
+ </Button>
2282
+ ```
2283
+
2284
+ **Don't:** Drop the label from actions that have no universal icon.
2285
+
2286
+ ```tsx
2287
+ <Button aria-label="Wallets" shape="icon" variant="secondary">
2288
+ <Wallet />
2289
+ </Button>
2290
+ <Button aria-label="Access keys" shape="icon" variant="secondary">
2291
+ <Key />
2292
+ </Button>
2293
+ ```
2294
+
2295
+ #### Match Icons to Their Text
2296
+
2297
+ An icon that inherits from its label scales with the type and stays aligned. Any other color reads as a status.
2298
+
2299
+ **Do:** Let an inline icon inherit the size and color of its label.
2300
+
2301
+ ```tsx
2302
+ /**
2303
+ * Do example for "Match Icons to Their Text" on the Iconography page.
2304
+ * Let an inline icon inherit the size and color of its label.
2305
+ * @module
2306
+ */
2307
+ import { Copy } from '@tempoxyz/ds/icons'
2308
+ import { style } from '@tempoxyz/ds'
2309
+
2310
+ /** Renders the static preview, which the guideline card shows inert. */
2311
+ export function Demo() {
2312
+ return (
2313
+ <span {...styles.label()}>
2314
+ <Copy />
2315
+ Copy address
2316
+ </span>
2317
+ )
2318
+ }
2319
+
2320
+ namespace styles {
2321
+ export const label = style({
2322
+ alignItems: 'center',
2323
+ color: 'content.primary',
2324
+ display: 'inline-flex',
2325
+ gap: '4',
2326
+ typography: 'body.b2Strong',
2327
+ })
2328
+ }
2329
+ ```
2330
+
2331
+ **Don't:** Enlarge or recolor an inline icon apart from its text.
2332
+
2333
+ ```tsx
2334
+ /**
2335
+ * Don't example for "Match Icons to Their Text" on the Iconography page.
2336
+ * Don't enlarge or recolor an inline icon apart from its text.
2337
+ * @module
2338
+ */
2339
+ import { Copy } from '@tempoxyz/ds/icons'
2340
+ import { style } from '@tempoxyz/ds'
2341
+
2342
+ /** Renders the static preview, which the guideline card shows inert. */
2343
+ export function Demo() {
2344
+ return (
2345
+ <span {...styles.label()}>
2346
+ <Copy {...styles.icon()} />
2347
+ Copy address
2348
+ </span>
2349
+ )
2350
+ }
2351
+
2352
+ namespace styles {
2353
+ export const icon = style({ color: 'accent.blue.background', fontSize: '30' })
2354
+
2355
+ export const label = style({
2356
+ alignItems: 'center',
2357
+ color: 'content.primary',
2358
+ display: 'inline-flex',
2359
+ gap: '4',
2360
+ typography: 'body.b2Strong',
2361
+ })
2362
+ }
2363
+ ```
2364
+
2365
+ #### Use Catalog Icons Only
2366
+
2367
+ Icons from another set break the shared grid and stroke weight. If the catalog lacks an icon, propose one with its use case in the Design System project.
2368
+
2369
+ **Do:** Draw every icon in a group from the catalog.
2370
+
2371
+ ```tsx
2372
+ /**
2373
+ * Do example for "Use Catalog Icons Only" on the Iconography page.
2374
+ * Draw every icon in a group from the catalog.
2375
+ * @module
2376
+ */
2377
+ import { Button, style } from '@tempoxyz/ds'
2378
+ import { ArrowDownLeft, Send, SwapHorizontal } from '@tempoxyz/ds/icons'
2379
+
2380
+ /** Renders the static preview, which the guideline card shows inert. */
2381
+ export function Demo() {
2382
+ return (
2383
+ <div {...styles.row()}>
2384
+ <Button size="small" variant="secondary">
2385
+ <Send />
2386
+ Send
2387
+ </Button>
2388
+ <Button size="small" variant="secondary">
2389
+ <ArrowDownLeft />
2390
+ Receive
2391
+ </Button>
2392
+ <Button size="small" variant="secondary">
2393
+ <SwapHorizontal />
2394
+ Swap
2395
+ </Button>
2396
+ </div>
2397
+ )
2398
+ }
2399
+
2400
+ namespace styles {
2401
+ export const row = style({ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '8' })
2402
+ }
2403
+ ```
2404
+
2405
+ **Don't:** Mix in an icon from another set.
2406
+
2407
+ ```tsx
2408
+ /**
2409
+ * Don't example for "Use Catalog Icons Only" on the Iconography page.
2410
+ * Don't mix in an icon from another set.
2411
+ * @module
2412
+ */
2413
+ import { Button, style } from '@tempoxyz/ds'
2414
+ import { ArrowDownLeft, Send } from '@tempoxyz/ds/icons'
2415
+
2416
+ /** Renders the static preview, which the guideline card shows inert. */
2417
+ export function Demo() {
2418
+ return (
2419
+ <div {...styles.row()}>
2420
+ <Button size="small" variant="secondary">
2421
+ <Send />
2422
+ Send
2423
+ </Button>
2424
+ <Button size="small" variant="secondary">
2425
+ <ArrowDownLeft />
2426
+ Receive
2427
+ </Button>
2428
+ <Button size="small" variant="secondary">
2429
+ {/* A heavier, rounded stroke on a 24 by 24 grid, as another icon set draws it. */}
2430
+ <svg
2431
+ aria-hidden="true"
2432
+ fill="none"
2433
+ stroke="currentColor"
2434
+ strokeLinecap="round"
2435
+ strokeLinejoin="round"
2436
+ strokeWidth="3"
2437
+ viewBox="0 0 24 24"
2438
+ {...styles.icon()}
2439
+ >
2440
+ <path d="M4 8h14l-4-4M20 16H6l4 4" />
2441
+ </svg>
2442
+ Swap
2443
+ </Button>
2444
+ </div>
2445
+ )
2446
+ }
2447
+
2448
+ namespace styles {
2449
+ export const icon = style({ height: '1.25em !custom', width: '1.25em !custom' })
2450
+
2451
+ export const row = style({ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '8' })
2452
+ }
2453
+ ```
2454
+
2455
+ * **Token Logos (TokenLogo):** Render token and network logos with [TokenLogo](components/blockchain.md#tokenlogo).
2456
+ * **Account Images (Identicon):** Render accounts with [Avatar](components/data-display.md#avatar) or [Identicon](components/blockchain.md#identicon).
2457
+
2458
+ ### Accessibility
2459
+
2460
+ * **Decorative by Default (aria-hidden):** An icon without `aria-label` or `aria-labelledby` is hidden, so screen readers skip it.
2461
+ * **Meaningful Icons (role=img):** Add `aria-label` only if no nearby text states its meaning, such as a lone status icon.
2462
+ * **Icon-Only Buttons (aria-label):** Label the button, not the icon. Name the action, such as Close dialog rather than X.
2463
+ * **Tooltips (Tooltip):** Pair an icon-only button with a [Tooltip](components/overlays.md#tooltip) that repeats its label for sighted mouse users.
2464
+ * **Contrast (3:1):** Applies to meaningful icons. Both `content.primary` and `content.secondary` pass.
2465
+ * **Forced Colors (currentColor):** Icons follow the system text color in forced colors mode, with no extra styles.
2466
+
2467
+ ### Catalog
2468
+
2469
+ * **Names (PascalCase):** Names match the design, such as `QRCode`.
2470
+ * **Reserved Names (InfinityIcon):** Avoids the JavaScript global `Infinity`.
2471
+ * **Shared Names (2):** A second icon with a taken name ends in `2`.
2472
+ * **Component Names (as):** Rename on import, such as `TableIcon`.
2473
+ * **Raw SVGs (.svg):** The original exports, for use outside React.
2474
+
2475
+ ```tsx
2476
+ import { Table } from '@tempoxyz/ds'
2477
+ import { Table as TableIcon } from '@tempoxyz/ds/icons'
2478
+ import copyUrl from '@tempoxyz/ds/icons/Copy.svg'
2479
+ ```
2480
+
2481
+ ### Related
2482
+
2483
+ [Button](components/actions.md#button)
2484
+
2485
+ Use for icon buttons and icons beside labels.
2486
+
2487
+ [IconTile](components/data-display.md#icontile)
2488
+
2489
+ Use for framed icons in headers and lists.
2490
+
2491
+ [Tooltip](components/overlays.md#tooltip)
2492
+
2493
+ Use for labelling icon buttons.
2494
+
2495
+ [Color](#color)
2496
+
2497
+ Covers icon colors.
2498
+
2499
+ ## Building From Intent
2500
+
2501
+ Choose each component by the job of its content, not by the markup it replaces.
2502
+
2503
+ ### Overview
2504
+
2505
+ Every part of a screen does a job, such as a list of records to compare, a status to read, or an identifier to check. Each component page documents one job, so the right component follows from the job and not from the look of the old markup.
2506
+
2507
+ ### The Method
2508
+
2509
+ #### Inventory the Screen by Job
2510
+
2511
+ Name the job of each part before you open the catalog: records, details, status, identifier, amount, metric, message, action, choice, or navigation.
2512
+
2513
+ #### Choose by Documented Job
2514
+
2515
+ Find the job in [Common Intents](#common-intents) or the comparisons on [Components](components.md#choosing-a-component). Then read the When to Use section of the component page.
2516
+
2517
+ #### Check When Not to Use
2518
+
2519
+ Read the When Not to Use section of the same page. If it names your case, use the component that the section links instead.
2520
+
2521
+ #### Write the Labels
2522
+
2523
+ Write every label from the [Writing Style](#writing-style) rules. Map a raw API value, such as `payment_failed`, to a word, such as Failed.
2524
+
2525
+ #### Check the Fit
2526
+
2527
+ Render the result at the narrowest width that its column or container reaches, and confirm that nothing overlaps or clips. In a table, follow [Keep Multi-Line Rows Readable](patterns.md#keep-multi-line-rows-readable).
2528
+
2529
+ ### Common Intents
2530
+
2531
+ Each tile names a job, the component for it, and the question that tells it apart from similar components.
2532
+
2533
+ #### Data
2534
+
2535
+ * **Records (Table):** Do people compare many records across the same fields? Use a [Table](components/data-display.md#table), one row per record.
2536
+ * **One Record (ListGroup):** Does the view show the fields of one record? Use [ListGroup](components/data-display.md#listgroup) rows with `ListGroup.Label`.
2537
+ * **Identifier (Hex):** Is it an address or a hash outside a table? Use [Hex](components/blockchain.md#hex) with `copy`. A table column uses a `mono` cell.
2538
+ * **Amount (Amount):** Is it money or a token balance? Use [Amount](components/blockchain.md#amount) with a `currency` or a `symbol`.
2539
+ * **Metric (Surface):** Is it a headline number on a dashboard? Use a small [Surface](components/layout.md#surface) tile, as [Dashboards](patterns.md#dashboards) shows.
2540
+
2541
+ #### Status
2542
+
2543
+ * **Status in a Table (status):** Does the status sit in a table row? Set `status` on its [Table](components/data-display.md#table) cell, and keep the status word beside the color.
2544
+ * **Status of a Payment (StatusChip):** Does a payment, an authorization, or a network have a status outside a table? Use a [StatusChip](components/feedback-and-status.md#statuschip).
2545
+ * **Live System Status (StatusIndicator):** Does a service or a connection report its live state? Use a [StatusIndicator](components/feedback-and-status.md#statusindicator).
2546
+ * **Running Task (StatusRow):** Does a person wait on one task that finishes within minutes? Follow it with a [StatusRow](components/feedback-and-status.md#statusrow).
2547
+ * **Attribute (Badge):** Does a word name a category or an attribute, such as Testnet? Use a [Badge](components/data-display.md#badge) beside the title.
2548
+
2549
+ #### Interaction
2550
+
2551
+ * **Message (Alert):** Does a sentence explain a condition? Use an [Alert](components/feedback-and-status.md#alert) for a section and a [Banner](components/feedback-and-status.md#banner) for the page.
2552
+ * **Action (Button):** Does it start something in the current view? Use a [Button](components/actions.md#button) with a verb label, such as Send payment.
2553
+ * **Choice (RadioGroup):** Does a person pick one option? Compare [RadioGroup](components/forms-and-inputs.md#radiogroup) and the others on [Components](components.md#choosing-one-option).
2554
+ * **Navigation (SidebarMenu):** Does it open another page? Use a link, or a [SidebarMenu](components/navigation.md#sidebarmenu) for the main destinations of an app.
2555
+
2556
+ ### Porting an Existing Interface
2557
+
2558
+ A port replaces old markup with library components. Map the job of each part instead, since the old screen can already use the wrong element for it.
2559
+
2560
+ #### Show Records as Rows
2561
+
2562
+ **Do:** Show records that share fields as the rows of a [Table](components/data-display.md#table).
2563
+
2564
+ ```tsx
2565
+ /**
2566
+ * Do example for "Show Records as Rows" on the Building From Intent page.
2567
+ * Show records that share fields as the rows of a Table.
2568
+ * @module
2569
+ */
2570
+ import { Table } from '@tempoxyz/ds'
2571
+
2572
+ const payouts = [
2573
+ ['Ada Lovelace', 'Oct 19', '120.00'],
2574
+ ['Alan Turing', 'Oct 19', '80.00'],
2575
+ ['Grace Hopper', 'Oct 18', '45.50'],
2576
+ ] as const
2577
+
2578
+ /** Renders the static preview, which the guideline card shows inert. */
2579
+ export function Demo() {
2580
+ return (
2581
+ <Table size="small">
2582
+ <Table.Head>
2583
+ <Table.Row>
2584
+ <Table.HeaderCell>Recipient</Table.HeaderCell>
2585
+ <Table.HeaderCell>Date</Table.HeaderCell>
2586
+ <Table.HeaderCell>Amount (USDC)</Table.HeaderCell>
2587
+ </Table.Row>
2588
+ </Table.Head>
2589
+ <Table.Body>
2590
+ {payouts.map(([recipient, date, amount]) => (
2591
+ <Table.Row key={recipient}>
2592
+ <Table.Cell>{recipient}</Table.Cell>
2593
+ <Table.Cell>{date}</Table.Cell>
2594
+ <Table.Cell numeric>{amount}</Table.Cell>
2595
+ </Table.Row>
2596
+ ))}
2597
+ </Table.Body>
2598
+ </Table>
2599
+ )
2600
+ }
2601
+ ```
2602
+
2603
+ **Don't:** Wrap each record in a [Surface](components/layout.md#surface) card because the old screen drew
2604
+ cards.
2605
+
2606
+ ```tsx
2607
+ /**
2608
+ * Don't example for "Show Records as Rows" on the Building From Intent page.
2609
+ * A card per record repeats each label and breaks the columns that people compare.
2610
+ * @module
2611
+ */
2612
+ import { Grid, style, Surface } from '@tempoxyz/ds'
2613
+
2614
+ const payouts = [
2615
+ ['Ada Lovelace', 'Oct 19', '120.00 USDC'],
2616
+ ['Alan Turing', 'Oct 19', '80.00 USDC'],
2617
+ ['Grace Hopper', 'Oct 18', '45.50 USDC'],
2618
+ ] as const
2619
+
2620
+ /** Renders the static preview, which the guideline card shows inert. */
2621
+ export function Demo() {
2622
+ return (
2623
+ <Grid fit="small" gap="8" {...styles.grid()}>
2624
+ {payouts.map(([recipient, date, amount]) => (
2625
+ <Surface key={recipient} size="small" {...styles.card()}>
2626
+ <p {...styles.title()}>{recipient}</p>
2627
+ <p {...styles.meta()}>Date: {date}</p>
2628
+ <p {...styles.meta()}>Amount: {amount}</p>
2629
+ </Surface>
2630
+ ))}
2631
+ </Grid>
2632
+ )
2633
+ }
2634
+
2635
+ namespace styles {
2636
+ export const card = style({
2637
+ boxShadow: '0 0 0 1px light-dark(#0000001a, #ffffff1f) !custom',
2638
+ })
2639
+
2640
+ export const grid = style({ width: '100% !custom' })
2641
+
2642
+ export const meta = style({ color: 'content.secondary', margin: '0', typography: 'body.b3' })
2643
+
2644
+ export const title = style({ margin: '0', typography: 'body.b2' })
2645
+ }
2646
+ ```
2647
+
2648
+ #### Write Status Words, Not API Values
2649
+
2650
+ **Do:** Color a status word in sentence case with the `status` of its [Table](components/data-display.md#table)
2651
+ cell.
2652
+
2653
+ ```tsx
2654
+ /**
2655
+ * Do example for "Write Status Words, Not API Values" on the Building From Intent page.
2656
+ * Color a status word in sentence case with the `status` of its Table cell.
2657
+ * @module
2658
+ */
2659
+ import { Table } from '@tempoxyz/ds'
2660
+
2661
+ /** Renders the static preview, which the guideline card shows inert. */
2662
+ export function Demo() {
2663
+ return (
2664
+ <Table size="small">
2665
+ <Table.Head>
2666
+ <Table.Row>
2667
+ <Table.HeaderCell>Recipient</Table.HeaderCell>
2668
+ <Table.HeaderCell>Status</Table.HeaderCell>
2669
+ </Table.Row>
2670
+ </Table.Head>
2671
+ <Table.Body>
2672
+ <Table.Row>
2673
+ <Table.Cell>Ada Lovelace</Table.Cell>
2674
+ <Table.Cell status="positive">Confirmed</Table.Cell>
2675
+ </Table.Row>
2676
+ <Table.Row>
2677
+ <Table.Cell>Alan Turing</Table.Cell>
2678
+ <Table.Cell status="warning">Pending</Table.Cell>
2679
+ </Table.Row>
2680
+ <Table.Row>
2681
+ <Table.Cell>Grace Hopper</Table.Cell>
2682
+ <Table.Cell status="negative">Failed</Table.Cell>
2683
+ </Table.Row>
2684
+ </Table.Body>
2685
+ </Table>
2686
+ )
2687
+ }
2688
+ ```
2689
+
2690
+ **Don't:** Copy a grey pill into a [Badge](components/data-display.md#badge) with the raw value from the API.
2691
+
2692
+ ```tsx
2693
+ /**
2694
+ * Don't example for "Write Status Words, Not API Values" on the Building From Intent page.
2695
+ * A grey pill copied from the old screen shows raw API values and no status color.
2696
+ * @module
2697
+ */
2698
+ import { Badge, Table } from '@tempoxyz/ds'
2699
+
2700
+ /** Renders the static preview, which the guideline card shows inert. */
2701
+ export function Demo() {
2702
+ return (
2703
+ <Table size="small">
2704
+ <Table.Head>
2705
+ <Table.Row>
2706
+ <Table.HeaderCell>Recipient</Table.HeaderCell>
2707
+ <Table.HeaderCell>Status</Table.HeaderCell>
2708
+ </Table.Row>
2709
+ </Table.Head>
2710
+ <Table.Body>
2711
+ <Table.Row>
2712
+ <Table.Cell>Ada Lovelace</Table.Cell>
2713
+ <Table.Cell>
2714
+ <Badge size="small">confirmed</Badge>
2715
+ </Table.Cell>
2716
+ </Table.Row>
2717
+ <Table.Row>
2718
+ <Table.Cell>Alan Turing</Table.Cell>
2719
+ <Table.Cell>
2720
+ <Badge size="small">PENDING</Badge>
2721
+ </Table.Cell>
2722
+ </Table.Row>
2723
+ <Table.Row>
2724
+ <Table.Cell>Grace Hopper</Table.Cell>
2725
+ <Table.Cell>
2726
+ <Badge size="small">payment_failed</Badge>
2727
+ </Table.Cell>
2728
+ </Table.Row>
2729
+ </Table.Body>
2730
+ </Table>
2731
+ )
2732
+ }
2733
+ ```
2734
+
2735
+ #### Fit Identifiers to Their Column
2736
+
2737
+ [Hex](components/blockchain.md#hex) truncates to its container, down to the prefix, one character on each side, and its copy button. A narrower column lets it overflow into the next cell.
2738
+
2739
+ **Do:** Set `mono` on the cell and shorten the value with `formatHex` from `@tempoxyz/ds`, which keeps
2740
+ four characters on each side. Show the full value with `copy` on the details view.
2741
+
2742
+ ```tsx
2743
+ /**
2744
+ * Do example for "Fit Identifiers to Their Column" on the Building From Intent page.
2745
+ * Shorten an address in a table column with a `mono` cell and `formatHex`.
2746
+ * @module
2747
+ */
2748
+ import { formatHex, Table } from '@tempoxyz/ds'
2749
+
2750
+ const accounts = [
2751
+ ['Ada Lovelace', '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc', '120.00'],
2752
+ ['Alan Turing', '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', '80.00'],
2753
+ ] as const
2754
+
2755
+ /** Renders the static preview, which the guideline card shows inert. */
2756
+ export function Demo() {
2757
+ return (
2758
+ <Table size="small">
2759
+ <Table.Head>
2760
+ <Table.Row>
2761
+ <Table.HeaderCell>Recipient</Table.HeaderCell>
2762
+ <Table.HeaderCell>Address</Table.HeaderCell>
2763
+ <Table.HeaderCell>Amount</Table.HeaderCell>
2764
+ </Table.Row>
2765
+ </Table.Head>
2766
+ <Table.Body>
2767
+ {accounts.map(([recipient, address, amount]) => (
2768
+ <Table.Row key={address}>
2769
+ <Table.Cell>{recipient}</Table.Cell>
2770
+ <Table.Cell mono>{formatHex(address)}</Table.Cell>
2771
+ <Table.Cell numeric>{amount}</Table.Cell>
2772
+ </Table.Row>
2773
+ ))}
2774
+ </Table.Body>
2775
+ </Table>
2776
+ )
2777
+ }
2778
+ ```
2779
+
2780
+ **Don't:** Place a [Hex](components/blockchain.md#hex) with `copy` in a column narrower than its minimum
2781
+ width.
2782
+
2783
+ ```tsx
2784
+ /**
2785
+ * Don't example for "Fit Identifiers to Their Column" on the Building From Intent page.
2786
+ * A Hex with `copy` in a narrow column stops at its minimum width and overlaps the next cell.
2787
+ * @module
2788
+ */
2789
+ import { Hex, style, Table } from '@tempoxyz/ds'
2790
+
2791
+ const accounts = [
2792
+ ['Ada Lovelace', '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc', '120.00'],
2793
+ ['Alan Turing', '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', '80.00'],
2794
+ ] as const
2795
+
2796
+ /** Renders the static preview, which the guideline card shows inert. */
2797
+ export function Demo() {
2798
+ return (
2799
+ <Table size="small" {...styles.table()}>
2800
+ <Table.Head>
2801
+ <Table.Row>
2802
+ <Table.HeaderCell>Recipient</Table.HeaderCell>
2803
+ <Table.HeaderCell {...styles.narrow()}>Address</Table.HeaderCell>
2804
+ <Table.HeaderCell>Amount</Table.HeaderCell>
2805
+ </Table.Row>
2806
+ </Table.Head>
2807
+ <Table.Body>
2808
+ {accounts.map(([recipient, address, amount]) => (
2809
+ <Table.Row key={address}>
2810
+ <Table.Cell>{recipient}</Table.Cell>
2811
+ <Table.Cell>
2812
+ <Hex copy size="small" value={address} />
2813
+ </Table.Cell>
2814
+ <Table.Cell numeric>{amount}</Table.Cell>
2815
+ </Table.Row>
2816
+ ))}
2817
+ </Table.Body>
2818
+ </Table>
2819
+ )
2820
+ }
2821
+
2822
+ namespace styles {
2823
+ export const narrow = style({ width: '3rem !custom' })
2824
+
2825
+ export const table = style({ tableLayout: 'fixed !custom' })
2826
+ }
2827
+ ```
2828
+
2829
+ ### Checklist
2830
+
2831
+ Before you ship a screen, confirm each item.
2832
+
2833
+ * **Jobs Named:** Each part of the screen has a named job, and each component matches that job.
2834
+ * **Exclusions Checked:** No component appears in a case that its When Not to Use section excludes.
2835
+ * **Labels Written:** Labels are words in sentence case, with one word per status and no raw API values.
2836
+ * **Fit Checked:** Every cell and tile fits at the narrowest width of its layout, without overlap or clipping.
2837
+
2838
+ ### Related
2839
+
2840
+ [Components](components.md#overview)
2841
+
2842
+ Covers the catalog and the comparisons between similar components.
2843
+
2844
+ [Agents](#agents)
2845
+
2846
+ Covers the rules that coding agents follow.
2847
+
2848
+ [Tables and Lists](patterns.md#tables-and-lists)
2849
+
2850
+ Covers tables, lists, and the details of one record.
2851
+
2852
+ [Feedback and Status](patterns.md#feedback-and-status)
2853
+
2854
+ Covers status words and the channel for each message.
2855
+
2856
+ [Writing Style](#writing-style)
2857
+
2858
+ Covers labels, status words, and sentence case.
2859
+
2860
+ ## Layout
2861
+
2862
+ Page structure, grid, spacing, radius, and elevation.
2863
+
2864
+ ### Overview
2865
+
2866
+ Tempo pages are calm and orderly. Flat cards sit on a tinted page, line up on a twelve-column grid, and keep generous space between groups, so the content stands out more than its frame.
2867
+
2868
+ Space follows relationships. Elements sit close within a group, further apart between groups, and furthest apart between sections. As the screen widens, the margins grow and the sidebar opens, while the content keeps a comfortable width.
2869
+
2870
+ For page frames and width changes, see [Responsive Layout](patterns.md#responsive-layout).
2871
+
2872
+ ### Page Structure
2873
+
2874
+ Every page shares one frame, which [App Shell](components/layout.md#appshell) provides.
2875
+
2876
+ * **Sidebar:** Navigation on the start edge, which moves into a drawer on small screens.
2877
+ * **Top Bar:** The page title and its main action, in one bar above the content.
2878
+ * **Content:** Cards, charts, and tables, arranged on the page grid below the bar.
2879
+
2880
+ ### Grid
2881
+
2882
+ Wide pages divide into twelve columns. Each card, chart, and table takes a share of them, and every row keeps the same gutters. [Grid](components/layout.md#grid) lays out the columns.
2883
+
2884
+ * **Summary Cards (3 of 12):** Key figures in a row of equal cards.
2885
+ * **Chart and Panel (8 and 4):** A wide chart beside a narrow panel.
2886
+ * **Tables (12 of 12):** Lists and tables across the full width.
2887
+ * **Small Screens (phone):** Cards pair up, and panels stack.
2888
+
2889
+ ### Spacing
2890
+
2891
+ Spacing comes from one scale of steps. Pick a step by how closely the elements relate: the closer the relationship, the smaller the gap.
2892
+
2893
+ * **Related Elements (4 to 8):** An icon and its label, or a label and its value.
2894
+ * **Items and Fields (12 to 16):** Items in a list, fields in a form, and buttons.
2895
+ * **Groups and Cards (24 to 32):** Groups within a section, such as cards in a grid.
2896
+ * **Page Sections (40 to 64):** The sections of a page, such as a table.
2897
+
2898
+ ### Radius
2899
+
2900
+ Larger elements get rounder corners, from fields at 12px to modals at 32px. [Radius and Padding](#radius-and-padding) covers each role and its padding.
2901
+
2902
+ * `none`: `0rem`
2903
+ * `3xs`: `calc(0.25rem * var(--tds-corner-scale, 1))`
2904
+ * `2xs`: `calc(0.5rem * var(--tds-corner-scale, 1))`
2905
+ * `xs`: `calc(0.75rem * var(--tds-corner-scale, 1))`
2906
+ * `sm`: `calc(1rem * var(--tds-corner-scale, 1))`
2907
+ * `md`: `calc(1.5rem * var(--tds-corner-scale, 1))`
2908
+ * `lg`: `calc(2rem * var(--tds-corner-scale, 1))`
2909
+ * `xl`: `calc(2.5rem * var(--tds-corner-scale, 1))`
2910
+ * `2xl`: `calc(4rem * var(--tds-corner-scale, 1))`
2911
+ * `full`: `62.4375rem`
2912
+
2913
+ ### Elevation
2914
+
2915
+ Shadows mark layers that float above the page, and most surfaces need none. In dark mode, a layer lifts with a lighter surface rather than a deeper shadow.
2916
+
2917
+ * **Flat (none):** Cards and panels, which sit flat on the page.
2918
+ * **Small (shadow.small):** Controls that lift off a track, such as a switch thumb.
2919
+ * **Regular (shadow.regular):** Menus, toasts, and other popups over the page.
2920
+ * **Large (shadow.large):** Dialogs and drawers, above the dimmed page.
2921
+
2922
+ ### Widths
2923
+
2924
+ [Container](components/layout.md#container) centers content at a maximum width, with side gutters that grow on larger screens. Pick its size by the content, not by the screen.
2925
+
2926
+ * **Narrow (48rem):** Forms, settings, and single-task flows.
2927
+ * **Medium (64rem):** Detail pages, such as a transaction or an API key.
2928
+ * **Wide (80rem):** The default, for dashboards, tables, and card grids.
2929
+ * **Full (none):** Charts and canvases that manage their own width.
2930
+
2931
+ ### Breakpoints
2932
+
2933
+ Design for the smallest screen first, then let content spread into more columns as space allows. Components change layout at the same widths, so a layout that shifts beside one should switch with it.
2934
+
2935
+ * **Phone (0 to 639px):** One column, with the sidebar in a drawer.
2936
+ * **Tablet (640 to 1023px):** Two columns, where the content allows.
2937
+ * **Desktop (1024px and up):** The sidebar opens, and grids gain columns.
2938
+
2939
+ Write a breakpoint as a query inside a style.
2940
+
2941
+ ```tsx
2942
+ import { style } from '@tempoxyz/ds'
2943
+
2944
+ namespace styles {
2945
+ export const metrics = style({
2946
+ display: 'grid',
2947
+ gap: '16',
2948
+ '@media >=768': { gridTemplateColumns: 'repeat(3, minmax(0, 1fr)) !custom' },
2949
+ })
2950
+ }
2951
+ ```
2952
+
2953
+ ### Layout Primitives
2954
+
2955
+ Primitives arrange content without adding meaning. When a region needs meaning, render the primitive as a semantic element, such as a list or the main landmark.
2956
+
2957
+ * **Stack (gap 16):** [Stack](components/layout.md#stack) spaces a vertical run, such as fields in a form.
2958
+ * **Inline (gap 8):** [Inline](components/layout.md#inline) spaces a horizontal run, such as actions or badges.
2959
+ * **Grid (gap 24):** [Grid](components/layout.md#grid) arranges similar items, such as metric tiles.
2960
+ * **Container (size):** [Container](components/layout.md#container) sets the page width and side gutters.
2961
+ * **Inset (space):** [Inset](components/layout.md#inset) pads a region without drawing a container.
2962
+ * **Surface (size):** [Surface](components/layout.md#surface) is a visible card that groups related content.
2963
+
2964
+ ### Guidelines
2965
+
2966
+ #### Space Siblings With Gap
2967
+
2968
+ Space siblings from their parent. Margins on each child collapse, double up when items reorder, and leave stray space after the last item.
2969
+
2970
+ **Do:** Space the items of a list from their parent.
2971
+
2972
+ ```tsx
2973
+ /**
2974
+ * Do example for "Space Siblings With Gap" on the Layout page.
2975
+ * Space the items of a list with `gap` on the parent.
2976
+ * @module
2977
+ */
2978
+ import { style } from '@tempoxyz/ds'
2979
+
2980
+ /** Renders the static preview, which the guideline card shows inert. */
2981
+ export function Demo() {
2982
+ return (
2983
+ <div {...styles.list()}>
2984
+ <span {...styles.item()}>Sent 25.00 USDC to 0x3c44…93bc</span>
2985
+ <span {...styles.item()}>Received 120.00 USDC</span>
2986
+ <span {...styles.item()}>Sent 8.50 USDC to 0x90f7…b906</span>
2987
+ </div>
2988
+ )
2989
+ }
2990
+
2991
+ namespace styles {
2992
+ export const item = style({
2993
+ backgroundColor: 'container.regular',
2994
+ borderRadius: '2xs',
2995
+ color: 'content.primary',
2996
+ paddingBlock: '8',
2997
+ paddingInline: '12',
2998
+ typography: 'body.b2',
2999
+ })
3000
+
3001
+ export const list = style({
3002
+ borderColor: 'line.secondary',
3003
+ borderRadius: 'xs',
3004
+ borderStyle: 'dashed',
3005
+ borderWidth: 'regular',
3006
+ display: 'flex',
3007
+ flexDirection: 'column',
3008
+ gap: '12',
3009
+ maxWidth: '100% !custom',
3010
+ padding: '12',
3011
+ width: '18rem !custom',
3012
+ })
3013
+ }
3014
+ ```
3015
+
3016
+ **Don't:** Add a margin to each child, which leaves space after the last one.
3017
+
3018
+ ```tsx
3019
+ /**
3020
+ * Don't example for "Space Siblings With Gap" on the Layout page.
3021
+ * Don't add a margin to each child, which leaves space after the last one.
3022
+ * @module
3023
+ */
3024
+ import { style } from '@tempoxyz/ds'
3025
+
3026
+ /** Renders the static preview, which the guideline card shows inert. */
3027
+ export function Demo() {
3028
+ return (
3029
+ <div {...styles.list()}>
3030
+ <span {...styles.item()}>Sent 25.00 USDC to 0x3c44…93bc</span>
3031
+ <span {...styles.item()}>Received 120.00 USDC</span>
3032
+ <span {...styles.item()}>Sent 8.50 USDC to 0x90f7…b906</span>
3033
+ </div>
3034
+ )
3035
+ }
3036
+
3037
+ namespace styles {
3038
+ export const item = style({
3039
+ backgroundColor: 'container.regular',
3040
+ borderRadius: '2xs',
3041
+ color: 'content.primary',
3042
+ marginBottom: '12',
3043
+ paddingBlock: '8',
3044
+ paddingInline: '12',
3045
+ typography: 'body.b2',
3046
+ })
3047
+
3048
+ export const list = style({
3049
+ borderColor: 'line.secondary',
3050
+ borderRadius: 'xs',
3051
+ borderStyle: 'dashed',
3052
+ borderWidth: 'regular',
3053
+ display: 'flex',
3054
+ flexDirection: 'column',
3055
+ maxWidth: '100% !custom',
3056
+ padding: '12',
3057
+ width: '18rem !custom',
3058
+ })
3059
+ }
3060
+ ```
3061
+
3062
+ #### Group Related Content by Proximity
3063
+
3064
+ Put less space inside a group than between groups. A label sits close to its value, and separate pairs sit well apart, so they need no dividers.
3065
+
3066
+ **Do:** Keep each label close to its value and leave more space between pairs.
3067
+
3068
+ ```tsx
3069
+ /**
3070
+ * Do example for "Group Related Content by Proximity" on the Layout page.
3071
+ * Keep each label close to its value and leave more space between pairs.
3072
+ * @module
3073
+ */
3074
+ import { Stack, style } from '@tempoxyz/ds'
3075
+
3076
+ /** Renders the static preview, which the guideline card shows inert. */
3077
+ export function Demo() {
3078
+ return (
3079
+ <Stack gap="24">
3080
+ <Stack gap="4">
3081
+ <span {...styles.label()}>Recipient</span>
3082
+ <span {...styles.value()}>0x3c44…93bc</span>
3083
+ </Stack>
3084
+ <Stack gap="4">
3085
+ <span {...styles.label()}>Amount</span>
3086
+ <span {...styles.value()}>250.00 PathUSD</span>
3087
+ </Stack>
3088
+ <Stack gap="4">
3089
+ <span {...styles.label()}>Network fee</span>
3090
+ <span {...styles.value()}>0.01 PathUSD</span>
3091
+ </Stack>
3092
+ </Stack>
3093
+ )
3094
+ }
3095
+
3096
+ namespace styles {
3097
+ export const label = style({ color: 'content.secondary', typography: 'body.b3' })
3098
+
3099
+ export const value = style({ color: 'content.primary', typography: 'body.b1Strong' })
3100
+ }
3101
+ ```
3102
+
3103
+ **Don't:** Space every line equally, which makes labels and values hard to pair.
3104
+
3105
+ ```tsx
3106
+ /**
3107
+ * Don't example for "Group Related Content by Proximity" on the Layout page.
3108
+ * Don't space every line equally, which makes labels and values hard to pair.
3109
+ * @module
3110
+ */
3111
+ import { Stack, style } from '@tempoxyz/ds'
3112
+
3113
+ /** Renders the static preview, which the guideline card shows inert. */
3114
+ export function Demo() {
3115
+ return (
3116
+ <Stack gap="12">
3117
+ <span {...styles.label()}>Recipient</span>
3118
+ <span {...styles.value()}>0x3c44…93bc</span>
3119
+ <span {...styles.label()}>Amount</span>
3120
+ <span {...styles.value()}>250.00 PathUSD</span>
3121
+ <span {...styles.label()}>Network fee</span>
3122
+ <span {...styles.value()}>0.01 PathUSD</span>
3123
+ </Stack>
3124
+ )
3125
+ }
3126
+
3127
+ namespace styles {
3128
+ export const label = style({ color: 'content.secondary', typography: 'body.b3' })
3129
+
3130
+ export const value = style({ color: 'content.primary', typography: 'body.b1Strong' })
3131
+ }
3132
+ ```
3133
+
3134
+ #### Keep Cards Flat
3135
+
3136
+ Separate a [Surface](components/layout.md#surface) from the page with its lighter background, not a shadow. Keep shadows for content that floats over other content.
3137
+
3138
+ **Do:** Keep cards flat, and add a shadow only to the layer above them.
3139
+
3140
+ ```tsx
3141
+ <LayoutDemo kind="elevated" />
3142
+ ```
3143
+
3144
+ **Don't:** Give every card a shadow.
3145
+
3146
+ ```tsx
3147
+ <LayoutDemo kind="shadowed" />
3148
+ ```
3149
+
3150
+ #### Use One Surface per Group
3151
+
3152
+ **Do:** Use one surface with a title for one group.
3153
+
3154
+ ```tsx
3155
+ <Surface>
3156
+ <Surface.Header>
3157
+ <Surface.Title>Balances</Surface.Title>
3158
+ <Button size="small" variant="tertiary">View all</Button>
3159
+ </Surface.Header>
3160
+ <span>120.00 USDC</span>
3161
+ </Surface>
3162
+ ```
3163
+
3164
+ **Don't:** Nest surfaces to create structure.
3165
+
3166
+ ```tsx
3167
+ <Surface>
3168
+ <Surface>
3169
+ <Surface>
3170
+ <span>120.00 USDC</span>
3171
+ </Surface>
3172
+ </Surface>
3173
+ </Surface>
3174
+ ```
3175
+
3176
+ #### Size Containers by Content
3177
+
3178
+ Pick the narrowest [Container](components/layout.md#container) that fits the content.
3179
+
3180
+ **Do:** Keep a form in a narrow container, so each field is as wide as its content needs.
3181
+
3182
+ ```tsx
3183
+ <Field.Root>
3184
+ <Field.Label>Recipient</Field.Label>
3185
+ <TextInput.Group>
3186
+ <TextInput.Control placeholder="Address or username" />
3187
+ </TextInput.Group>
3188
+ </Field.Root>
3189
+ ```
3190
+
3191
+ **Don't:** Stretch a form across a wide page.
3192
+
3193
+ ```tsx
3194
+ <LayoutDemo kind="container" width="full" />
3195
+ ```
3196
+
3197
+ #### Let Collections Reflow
3198
+
3199
+ For cards and metric tiles, let the grid fit as many columns as the width allows. A fitted grid collapses to one column on a phone without extra breakpoints.
3200
+
3201
+ **Do:** Let a collection reflow to one column at 320px.
3202
+
3203
+ ```tsx
3204
+ <LayoutDemo kind="columns" width="phone" />
3205
+ ```
3206
+
3207
+ **Don't:** Fix a column count that runs past a narrow screen.
3208
+
3209
+ ```tsx
3210
+ <LayoutDemo kind="overflow" />
3211
+ ```
3212
+
3213
+ #### Keep Source Order Visual Order
3214
+
3215
+ Don't reorder content visually. Keyboard focus and screen readers follow the source, so a reordered layout makes focus jump.
3216
+
3217
+ **Do:** Write elements in the order they appear, so focus moves left to right.
3218
+
3219
+ ```tsx
3220
+ /**
3221
+ * Do example for "Keep Source Order Visual Order" on the Layout page.
3222
+ * Write elements in the order they appear, so focus moves left to right.
3223
+ * @module
3224
+ */
3225
+ import { Button, style } from '@tempoxyz/ds'
3226
+
3227
+ /** Renders the static preview, which the guideline card shows inert. */
3228
+ export function Demo() {
3229
+ return (
3230
+ <div {...styles.row()}>
3231
+ <span {...styles.item()}>
3232
+ <span {...styles.step()}>1</span>
3233
+ <Button variant="secondary">Cancel</Button>
3234
+ </span>
3235
+ <span {...styles.item()}>
3236
+ <span {...styles.step()}>2</span>
3237
+ <Button>Send payment</Button>
3238
+ </span>
3239
+ </div>
3240
+ )
3241
+ }
3242
+
3243
+ namespace styles {
3244
+ export const item = style({
3245
+ alignItems: 'center',
3246
+ display: 'flex',
3247
+ flexDirection: 'column',
3248
+ gap: '8',
3249
+ })
3250
+
3251
+ export const row = style({ alignItems: 'flex-end', display: 'flex', gap: '12' })
3252
+
3253
+ export const step = style({
3254
+ alignItems: 'center',
3255
+ backgroundColor: 'accent.blue.background',
3256
+ borderRadius: 'full',
3257
+ color: 'white !custom',
3258
+ cornerShape: 'round',
3259
+ display: 'inline-flex',
3260
+ height: '20',
3261
+ justifyContent: 'center',
3262
+ typography: 'body.b3Strong',
3263
+ width: '20',
3264
+ })
3265
+ }
3266
+ ```
3267
+
3268
+ **Don't:** Reverse the visual order, which makes focus jump backward.
3269
+
3270
+ ```tsx
3271
+ /**
3272
+ * Don't example for "Keep Source Order Visual Order" on the Layout page.
3273
+ * Don't reverse the visual order, which makes focus jump backward.
3274
+ * @module
3275
+ */
3276
+ import { Button, style } from '@tempoxyz/ds'
3277
+
3278
+ /** Renders the static preview, which the guideline card shows inert. */
3279
+ export function Demo() {
3280
+ return (
3281
+ <div {...styles.row()}>
3282
+ <span {...styles.item()}>
3283
+ <span {...styles.step()}>1</span>
3284
+ <Button>Send payment</Button>
3285
+ </span>
3286
+ <span {...styles.item()}>
3287
+ <span {...styles.step()}>2</span>
3288
+ <Button variant="secondary">Cancel</Button>
3289
+ </span>
3290
+ </div>
3291
+ )
3292
+ }
3293
+
3294
+ namespace styles {
3295
+ export const item = style({
3296
+ alignItems: 'center',
3297
+ display: 'flex',
3298
+ flexDirection: 'column',
3299
+ gap: '8',
3300
+ })
3301
+
3302
+ export const row = style({
3303
+ alignItems: 'flex-end',
3304
+ display: 'flex',
3305
+ flexDirection: 'row-reverse',
3306
+ gap: '12',
3307
+ justifyContent: 'flex-end',
3308
+ })
3309
+
3310
+ export const step = style({
3311
+ alignItems: 'center',
3312
+ backgroundColor: 'accent.blue.background',
3313
+ borderRadius: 'full',
3314
+ color: 'white !custom',
3315
+ cornerShape: 'round',
3316
+ display: 'inline-flex',
3317
+ height: '20',
3318
+ justifyContent: 'center',
3319
+ typography: 'body.b3Strong',
3320
+ width: '20',
3321
+ })
3322
+ }
3323
+ ```
3324
+
3325
+ ### Accessibility
3326
+
3327
+ * **Reflow (320px):** Content reflows without sideways scrolling, as fitted grids do by default.
3328
+ * **Regions (render):** Primitives add no roles, so render regions as meaningful elements.
3329
+ * **Text Size (200%):** Spacing grows with larger default text, so check layouts at 200%.
3330
+
3331
+ ### Related
3332
+
3333
+ [Responsive Layout](patterns.md#responsive-layout)
3334
+
3335
+ Covers page frames and width changes.
3336
+
3337
+ [Stack](components/layout.md#stack)
3338
+
3339
+ Use for arranging content.
3340
+
3341
+ [Inline](components/layout.md#inline)
3342
+
3343
+ Use for arranging content.
3344
+
3345
+ [Grid](components/layout.md#grid)
3346
+
3347
+ Use for arranging content.
3348
+
3349
+ [Container](components/layout.md#container)
3350
+
3351
+ Use for width and padding.
3352
+
3353
+ [Inset](components/layout.md#inset)
3354
+
3355
+ Use for width and padding.
3356
+
3357
+ [Surface](components/layout.md#surface)
3358
+
3359
+ Use for cards.
3360
+
3361
+ [App Shell](components/layout.md#appshell)
3362
+
3363
+ Use for the application frame.
3364
+
3365
+ [Radius and Padding](#radius-and-padding)
3366
+
3367
+ Covers how padding pairs with each radius.
3368
+
3369
+ ## Linter
3370
+
3371
+ Oxlint rules that check how your app uses Tempo Design System.
3372
+
3373
+ ### Overview
3374
+
3375
+ The library ships an Oxlint plugin that reports the mistakes types cannot catch, such as an unnamed icon-only [Button](components/actions.md#button), an import from an internal path, or a native control or hand-built card that a component replaces.
3376
+
3377
+ ### Set Up the Linter
3378
+
3379
+ Spread the configuration for your surface, web, mobile, or marketing, into the lint options of Vite Plus, then run the linter.
3380
+
3381
+ ```ts title="vite.config.ts"
3382
+ import { web } from '@tempoxyz/ds/oxlint'
3383
+ import { defineConfig } from 'vite-plus'
3384
+
3385
+ export default defineConfig({ lint: web })
3386
+ ```
3387
+
3388
+ ```sh
3389
+ vp lint
3390
+ ```
3391
+
3392
+ To change a severity, spread the rules and override one.
3393
+
3394
+ ```ts title="vite.config.ts"
3395
+ import { web } from '@tempoxyz/ds/oxlint'
3396
+ import { defineConfig } from 'vite-plus'
3397
+
3398
+ export default defineConfig({
3399
+ lint: { ...web, rules: { ...web.rules, 'tds/no-raw-values': 'error' } },
3400
+ })
3401
+ ```
3402
+
3403
+ Without Vite Plus, register both plugins and enable the rules in an Oxlint configuration file.
3404
+
3405
+ ```json title=".oxlintrc.json"
3406
+ {
3407
+ "jsPlugins": [
3408
+ { "name": "tds", "specifier": "@tempoxyz/ds/oxlint" },
3409
+ { "name": "zyzz", "specifier": "zyzz/oxlint" }
3410
+ ],
3411
+ "rules": {
3412
+ "tds/no-cross-surface": ["error", { "surface": "web" }],
3413
+ "tds/no-custom-values": "warn",
3414
+ "tds/no-internal-imports": "error",
3415
+ "tds/no-raw-values": "warn",
3416
+ "tds/no-single-key-shortcuts": "warn",
3417
+ "tds/prefer-component": "warn",
3418
+ "tds/prefer-layout": "warn",
3419
+ "tds/prefer-progress": "warn",
3420
+ "tds/prefer-surface": "warn",
3421
+ "tds/prefer-typography": "warn",
3422
+ "tds/require-accessible-name": "error",
3423
+ "tds/require-scroll-region": "warn"
3424
+ }
3425
+ }
3426
+ ```
3427
+
3428
+ ### Rules
3429
+
3430
+ #### Import From Public Entrypoints
3431
+
3432
+ Reports a library import from a path that the package does not publish. The root, icons, mobile, and oxlint entrypoints pass, and so do icon SVG and font files.
3433
+
3434
+ ```json
3435
+ { "rules": { "tds/no-internal-imports": "error" } }
3436
+ ```
3437
+
3438
+ **Do:** Import components from `@tempoxyz/ds` and icons from `@tempoxyz/ds/icons`.
3439
+
3440
+ ````tsx
3441
+ ```tsx
3442
+ import { Spinner } from '@tempoxyz/ds'
3443
+ import { Copy } from '@tempoxyz/ds/icons'
3444
+ ```
3445
+ ````
3446
+
3447
+ **Don't:** Import from `src` or `dist`. Internal paths change without a release note.
3448
+
3449
+ ````tsx
3450
+ ```tsx
3451
+ import { Spinner } from '@tempoxyz/ds/src/web'
3452
+ // @lint: tds/no-internal-imports: '@tempoxyz/ds/src/web' is not a published entrypoint. Import from '@tempoxyz/ds', '@tempoxyz/ds/mobile', or their `icons` subpaths.
3453
+ import { Copy } from '@tempoxyz/ds/dist/icons'
3454
+ // @lint: tds/no-internal-imports: '@tempoxyz/ds/dist/icons' is not a published entrypoint. Import from '@tempoxyz/ds', '@tempoxyz/ds/mobile', or their `icons` subpaths.
3455
+ ```
3456
+ ````
3457
+
3458
+ #### Stay on One Surface
3459
+
3460
+ Reports an import from the surface that your app does not render. Without a surface option, it reports a file that imports from both surfaces.
3461
+
3462
+ ```json
3463
+ { "rules": { "tds/no-cross-surface": ["error", { "surface": "web" }] } }
3464
+ ```
3465
+
3466
+ **Do:** Import every component and icon of a React Native app from the Mobile entrypoints.
3467
+
3468
+ ````tsx
3469
+ ```tsx
3470
+ import { Toggle } from '@tempoxyz/ds/mobile'
3471
+ import { Copy } from '@tempoxyz/ds/mobile/icons'
3472
+ ```
3473
+ ````
3474
+
3475
+ **Don't:** Mix surfaces in one app. Each surface owns its variables, and a Web component does not render in React Native.
3476
+
3477
+ ````tsx
3478
+ ```tsx
3479
+ import { Toggle } from '@tempoxyz/ds/mobile'
3480
+ import { Switch } from '@tempoxyz/ds'
3481
+ // @lint: tds/no-cross-surface: '@tempoxyz/ds' belongs to the web surface, but this app uses the mobile surface.
3482
+ ```
3483
+ ````
3484
+
3485
+ #### Name Controls Without Text
3486
+
3487
+ Reports a library component that renders no text and has no accessible name, such as an icon-only [Button](components/actions.md#button) or a [Gauge](components/feedback-and-status.md#gauge).
3488
+
3489
+ ```json
3490
+ { "rules": { "tds/require-accessible-name": "error" } }
3491
+ ```
3492
+
3493
+ **Do:** Name the action in `aria-label`, on the button or on the trigger that renders it.
3494
+
3495
+ ````tsx
3496
+ ```tsx
3497
+ <Button aria-label="Copy address" shape="icon">
3498
+ <Copy />
3499
+ </Button>
3500
+ ```
3501
+ ````
3502
+
3503
+ **Don't:** Leave an icon-only button or a [Gauge](components/feedback-and-status.md#gauge) unnamed. Screen readers announce only its role.
3504
+
3505
+ ````tsx
3506
+ ```tsx
3507
+ <Button shape="icon">
3508
+ <Copy />
3509
+ </Button>
3510
+ // @lint: tds/require-accessible-name: 'Button' renders no text. Name it with `aria-label` or `aria-labelledby`.
3511
+ ```
3512
+ ````
3513
+
3514
+ #### Name Scroll Regions
3515
+
3516
+ Reports a native element that scrolls without a role, a tab stop, and a name. A container whose content holds a link, a button, or a field passes, since its content takes focus.
3517
+
3518
+ ```json
3519
+ { "rules": { "tds/require-scroll-region": "warn" } }
3520
+ ```
3521
+
3522
+ **Do:** Name the region and give it a tab stop, so keyboards can scroll it.
3523
+
3524
+ ````tsx
3525
+ ```tsx
3526
+ <div aria-label="Fee schedule" role="region" {...styles.scroll()} tabIndex={0}>
3527
+ <Table.Root>{rows}</Table.Root>
3528
+ </div>
3529
+ ```
3530
+ ````
3531
+
3532
+ **Don't:** Leave a scroll container without a tab stop. Keyboard users cannot reach the hidden content.
3533
+
3534
+ ````tsx
3535
+ ```tsx
3536
+ <div style={{ overflowX: 'auto' }}>
3537
+ // @lint: tds/require-scroll-region: This scrolling <div> needs role="region", tabIndex={0}, and an aria-label, so keyboard and screen reader users can reach and identify it.
3538
+ <Table.Root>{rows}</Table.Root>
3539
+ </div>
3540
+ ```
3541
+ ````
3542
+
3543
+ #### Require a Modifier on Shortcuts
3544
+
3545
+ Warns on a key listener on the window or the document that matches one printable character, such as G or /, and reads no modifier. A character key on the whole page fires while people type or dictate ([SC 2.1.4](https://www.w3.org/WAI/WCAG22/Understanding/character-key-shortcuts.html)).
3546
+
3547
+ ```json
3548
+ { "rules": { "tds/no-single-key-shortcuts": "warn" } }
3549
+ ```
3550
+
3551
+ A single-key shortcut is valid when people can turn it off or remap it, or when it works only while a component has focus. The rule cannot detect either case. If a shortcut meets one of them, disable the rule on that line and state the reason.
3552
+
3553
+ ```tsx
3554
+ window.addEventListener('keydown', (event) => {
3555
+ // oxlint-disable-next-line tds/no-single-key-shortcuts -- Settings turn this shortcut off.
3556
+ if (shortcuts.enabled && event.key === '/') open()
3557
+ })
3558
+ ```
3559
+
3560
+ **Do:** Require Command or Control, and show the shortcut with [Kbd](components/data-display.md#kbd).
3561
+
3562
+ ````tsx
3563
+ ```tsx
3564
+ window.addEventListener('keydown', (event) => {
3565
+ if (event.key === 'k' && (event.metaKey || event.ctrlKey)) open()
3566
+ })
3567
+ ```
3568
+ ````
3569
+
3570
+ **Don't:** Bind a lone character key on the whole page, unless people can turn it off or remap it.
3571
+
3572
+ ````tsx
3573
+ ```tsx
3574
+ window.addEventListener('keydown', (event) => {
3575
+ if (event.key === '/') open()
3576
+ // @lint: tds/no-single-key-shortcuts: '/' is a single-key shortcut on the whole page. Require a modifier, such as metaKey or ctrlKey, or let people turn it off or remap it (WCAG 2.1.4).
3577
+ })
3578
+ ```
3579
+ ````
3580
+
3581
+ #### Prefer Library Components
3582
+
3583
+ Warns on a native element that a library component replaces, such as a button, a checkbox, a dialog, a table, or a description list. The message links the docs page of the component. Elements in a render prop pass, and an allow list skips the elements you name.
3584
+
3585
+ ```json
3586
+ { "rules": { "tds/prefer-component": ["warn", { "allow": ["table"] }] } }
3587
+ ```
3588
+
3589
+ **Do:** Use [Checkbox](components/forms-and-inputs.md#checkbox) and [Button](components/actions.md#button), which bring Tempo states, focus rings, and motion.
3590
+
3591
+ ````tsx
3592
+ ```tsx
3593
+ <Checkbox defaultChecked />
3594
+ <Button variant="secondary">Cancel</Button>
3595
+ ```
3596
+ ````
3597
+
3598
+ **Don't:** Restyle a native control that the library already ships.
3599
+
3600
+ ````tsx
3601
+ ```tsx
3602
+ <input defaultChecked type="checkbox" />
3603
+ // @lint: tds/prefer-component: Use 'Checkbox' from '@tempoxyz/ds' instead of <input>. See https://ds.tehq.dev/docs/components/checkbox
3604
+ <button type="button">Cancel</button>
3605
+ // @lint: tds/prefer-component: Use 'Button' from '@tempoxyz/ds' instead of <button>. See https://ds.tehq.dev/docs/components/button
3606
+ ```
3607
+ ````
3608
+
3609
+ #### Use Surface for Cards
3610
+
3611
+ Warns on an article, aside, div, list item, or section whose styles draw a card: a corner radius and padding with a border or a background. Pills and positioned layers pass.
3612
+
3613
+ ```json
3614
+ { "rules": { "tds/prefer-surface": "warn" } }
3615
+ ```
3616
+
3617
+ **Do:** Use [Surface](components/layout.md#surface), which sets the radius and padding together.
3618
+
3619
+ ````tsx
3620
+ ```tsx
3621
+ <Surface>
3622
+ <Surface.Title>Balance</Surface.Title>
3623
+ </Surface>
3624
+ ```
3625
+ ````
3626
+
3627
+ **Don't:** Rebuild a card from tokens. The radius and padding drift apart.
3628
+
3629
+ ````tsx
3630
+ ```tsx
3631
+ namespace styles {
3632
+ export const card = style({
3633
+ backgroundColor: 'background.elevated',
3634
+ borderRadius: 'sm',
3635
+ padding: '16',
3636
+ })
3637
+ }
3638
+
3639
+ ;<div {...styles.card()} />
3640
+ // @lint: tds/prefer-surface: Use 'Surface' from '@tempoxyz/ds' instead of styling <div> as a card. It sets the radius and padding together.
3641
+ ```
3642
+ ````
3643
+
3644
+ #### Use Layout Components
3645
+
3646
+ Warns on a block element whose only styles lay out its children with flex or grid and a gap. A column maps to [Stack](components/layout.md#stack), a row to [Inline](components/layout.md#inline), and equal tracks to [Grid](components/layout.md#grid). An element with any other declaration or a class name passes.
3647
+
3648
+ ```json
3649
+ { "rules": { "tds/prefer-layout": "warn" } }
3650
+ ```
3651
+
3652
+ **Do:** Space siblings with a layout component and its gap token.
3653
+
3654
+ ````tsx
3655
+ ```tsx
3656
+ <Stack gap="16">
3657
+ <Field.Root />
3658
+ <Field.Root />
3659
+ </Stack>
3660
+ ```
3661
+ ````
3662
+
3663
+ **Don't:** Hand-build a flex or grid wrapper that a layout component replaces.
3664
+
3665
+ ````tsx
3666
+ ```tsx
3667
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
3668
+ // @lint: tds/prefer-layout: Use 'Stack' from '@tempoxyz/ds' instead of laying out <div> with flex and a gap.
3669
+ <Field.Root />
3670
+ <Field.Root />
3671
+ </div>
3672
+ ```
3673
+ ````
3674
+
3675
+ #### Use Progress for Bars
3676
+
3677
+ Warns on an empty div or span whose inline width is a computed percentage, which draws the fill of a hand-built bar. An element with children passes, since a resizable pane sets its width the same way.
3678
+
3679
+ ```json
3680
+ { "rules": { "tds/prefer-progress": "warn" } }
3681
+ ```
3682
+
3683
+ **Do:** Use [Progress](components/feedback-and-status.md#progress-1), or `ListGroup.Meter` in a [ListGroup](components/data-display.md#listgroup) row, which announce the value.
3684
+
3685
+ ````tsx
3686
+ ```tsx
3687
+ <Progress.Root value={66}>
3688
+ <Progress.Track>
3689
+ <Progress.Indicator />
3690
+ </Progress.Track>
3691
+ </Progress.Root>
3692
+ ```
3693
+ ````
3694
+
3695
+ **Don't:** Draw a bar from a sized element. Screen readers announce nothing.
3696
+
3697
+ ````tsx
3698
+ ```tsx
3699
+ <div {...styles.track()}>
3700
+ <div style={{ width: `${used}%` }} />
3701
+ // @lint: tds/prefer-progress: Use 'Progress' from '@tempoxyz/ds', or 'ListGroup.Meter' in a ListGroup row, instead of drawing a bar with <div> and a percentage width.
3702
+ </div>
3703
+ ```
3704
+ ````
3705
+
3706
+ #### Set Type With a Typography Set
3707
+
3708
+ Warns when one `style` or `variants` object sets two or more of `fontFamily`, `fontSize`, `fontWeight`, `letterSpacing`, and `lineHeight`, or one of them beside `typography`. These build a type style that no set defines. One property alone passes, such as a `fontSize` that sizes an icon.
3709
+
3710
+ ```json
3711
+ { "rules": { "tds/prefer-typography": "warn" } }
3712
+ ```
3713
+
3714
+ **Do:** Set type with one set, as [Typography](#set-type-with-one-set) describes.
3715
+
3716
+ ````tsx
3717
+ ```tsx
3718
+ style({ color: 'content.secondary', typography: 'body.b2' })
3719
+ ```
3720
+ ````
3721
+
3722
+ **Don't:** Combine a family and a size from different sets.
3723
+
3724
+ ````tsx
3725
+ ```tsx
3726
+ style({ fontFamily: 'heading', fontSize: '14' })
3727
+ // @lint: tds/prefer-typography: 'fontFamily' composes a type style outside a typography set. Use one `typography` set, such as 'body.b2'.
3728
+ // @lint: tds/prefer-typography: 'fontSize' composes a type style outside a typography set. Use one `typography` set, such as 'body.b2'.
3729
+ ```
3730
+ ````
3731
+
3732
+ #### Style With Tokens
3733
+
3734
+ Warns on a raw color, length, or font family in an inline style. A value that reads a custom property passes.
3735
+
3736
+ ```json
3737
+ { "rules": { "tds/no-raw-values": "warn" } }
3738
+ ```
3739
+
3740
+ **Do:** Set colors and spacing with tokens in a `style` definition.
3741
+
3742
+ ````tsx
3743
+ ```tsx
3744
+ namespace styles {
3745
+ export const card = style({ padding: '16' })
3746
+ }
3747
+
3748
+ ;<div {...styles.card()} />
3749
+ ```
3750
+ ````
3751
+
3752
+ **Don't:** Hardcode colors and lengths in inline styles. They do not follow the scheme or the token scale.
3753
+
3754
+ ````tsx
3755
+ ```tsx
3756
+ <div style={{ color: '#000', padding: 16 }} />
3757
+ // @lint: tds/no-raw-values: 'color' sets the raw value '#000'. Use a token through a Zyzz style instead.
3758
+ // @lint: tds/no-raw-values: 'padding' sets the raw value 16. Use a token through a Zyzz style instead.
3759
+ ```
3760
+ ````
3761
+
3762
+ #### Use Tokens for Custom Values
3763
+
3764
+ Warns on a `!custom` value in a `style` or `variants` definition that equals a token: a px or rem length that equals a spacing, radius, size, or container step, or a `zIndex` number that equals a layer. The message names the token. A value that no token fits, such as `'13px !custom'`, passes.
3765
+
3766
+ ```json
3767
+ { "rules": { "tds/no-custom-values": "warn" } }
3768
+ ```
3769
+
3770
+ * **Spacing ('16'):** Padding, margins, and gaps, with keys in px.
3771
+ * **Radius ('xs'):** Corners, from `3xs` at 4px to `2xl` at 64px.
3772
+ * **Layers ('popover'):** `overlay` 40, `popover` 50, `modal` 60, and `toast` 1000.
3773
+
3774
+ **Do:** Set lengths and layers with tokens.
3775
+
3776
+ ````tsx
3777
+ ```tsx
3778
+ style({ borderRadius: 'xs', padding: '16', zIndex: 'popover' })
3779
+ ```
3780
+ ````
3781
+
3782
+ **Don't:** Mark a value with `!custom` when a token equals it.
3783
+
3784
+ ````tsx
3785
+ ```tsx
3786
+ style({ borderRadius: '12px !custom', zIndex: '50 !custom' })
3787
+ // @lint: tds/no-custom-values: 'borderRadius' sets the custom value '12px !custom', which equals a token. Use the radius token 'xs'.
3788
+ // @lint: tds/no-custom-values: 'zIndex' sets the custom value '50 !custom', which equals a token. Use the zIndex token 'popover'.
3789
+ ```
3790
+ ````
3791
+
3792
+ ### Zyzz Rules
3793
+
3794
+ Both configurations also turn on the rules of the Zyzz plugin, which check style definitions and their use.
3795
+
3796
+ #### Merge Styling Props Into the Style
3797
+
3798
+ Reports a className or style prop that would overwrite a style spread.
3799
+
3800
+ ```json
3801
+ { "rules": { "zyzz/no-conflicting-props": "error" } }
3802
+ ```
3803
+
3804
+ **Do:** Pass the caller's class into the style call, which merges it.
3805
+
3806
+ ````tsx
3807
+ ```tsx
3808
+ <div {...styles.card({ className: props.className })} />
3809
+ ```
3810
+ ````
3811
+
3812
+ **Don't:** Set a class beside a style spread. One overwrites the other.
3813
+
3814
+ ````tsx
3815
+ ```tsx
3816
+ <div className="card" {...styles.card()} />
3817
+ // @lint: zyzz/no-conflicting-props: Pass 'className' into the Zyzz style call to merge styling props.
3818
+ ```
3819
+ ````
3820
+
3821
+ #### Remove Unused Styles
3822
+
3823
+ Warns on a style in a styles namespace that nothing applies.
3824
+
3825
+ ```json
3826
+ { "rules": { "zyzz/no-unused": "warn" } }
3827
+ ```
3828
+
3829
+ **Do:** Keep only the styles that the module applies.
3830
+
3831
+ ````tsx
3832
+ ```tsx
3833
+ namespace styles {
3834
+ export const card = style({ padding: '16' })
3835
+ }
3836
+
3837
+ ;<div {...styles.card()} />
3838
+ ```
3839
+ ````
3840
+
3841
+ **Don't:** Leave a style that nothing applies. It still ships in the stylesheet.
3842
+
3843
+ ````tsx
3844
+ ```tsx
3845
+ namespace styles {
3846
+ export const card = style({ padding: '16' })
3847
+
3848
+ export const legacy = style({ padding: '8' })
3849
+ // @lint: zyzz/no-unused: Style 'styles.legacy' is never used.
3850
+ }
3851
+ ```
3852
+ ````
3853
+
3854
+ #### Write Scalar Declarations
3855
+
3856
+ Reports a declaration whose value is not a string, a number, or a fallback array.
3857
+
3858
+ ```json
3859
+ { "rules": { "zyzz/valid-styles": "error" } }
3860
+ ```
3861
+
3862
+ **Do:** Set each side with its own property.
3863
+
3864
+ ````tsx
3865
+ ```tsx
3866
+ style({ paddingTop: '8' })
3867
+ ```
3868
+ ````
3869
+
3870
+ **Don't:** Nest an object inside a declaration.
3871
+
3872
+ ````tsx
3873
+ ```tsx
3874
+ style({ padding: { top: '8' } })
3875
+ // @lint: zyzz/valid-styles: CSS declarations require scalar values or fallback arrays.
3876
+ ```
3877
+ ````
3878
+
3879
+ ### Related
3880
+
3881
+ [Agents](#agents)
3882
+
3883
+ Covers the rules that coding agents follow and the checks they run.
3884
+
3885
+ [Accessibility](#accessibility)
3886
+
3887
+ Covers the accessible names that the linter checks.
3888
+
3889
+ [Getting Started](#getting-started)
3890
+
3891
+ Covers the install and the Zyzz setup that the linter builds on.
3892
+
3893
+ ## Motion
3894
+
3895
+ Easing curves, durations, and reduced-motion rules for state changes.
3896
+
3897
+ ### Overview
3898
+
3899
+ Motion in Tempo shows where something came from, confirms a press, and marks what is new. It is short, eases out, and never delays input, both in components and in anything you style yourself.
3900
+
3901
+ ### Easing
3902
+
3903
+ Three ease-out curves cover interface motion, so each response starts at full speed. Use them by name instead of the browser default or a custom curve.
3904
+
3905
+ * `ease.snappy`: `cubic-bezier(0.23, 1, 0.32, 1)`
3906
+ * `ease.spring`: `cubic-bezier(0.32, 0.72, 0, 1)`
3907
+ * `ease.overshoot`: `cubic-bezier(0.34, 1.36, 0.64, 1)`
3908
+
3909
+ * **Snappy (ease.snappy):** Short changes, such as hover, focus, presses, popovers, and menus.
3910
+ * **Overshoot (ease.overshoot):** Only physical feedback, such as switch thumbs and check marks. A dialog or menu would wobble.
3911
+ * **Spring (ease.spring):** Larger travel, such as dialogs, drawers, toasts, and tabs.
3912
+ * **Constant Rate (linear):** Continuous indicators only, such as [Spinner](components/feedback-and-status.md#spinner), which would pulse with easing.
3913
+
3914
+ ### Durations
3915
+
3916
+ Small state changes finish fastest, overlays that travel farther run longer, and every overlay leaves faster than it enters.
3917
+
3918
+ #### Micro Interactions
3919
+
3920
+ * **Press (100ms in, 160ms out):** Buttons scale down slightly and return on release.
3921
+ * **Item Highlight (120ms):** Menu, select, and combobox items highlight.
3922
+ * **Hover, Focus, and Color (160ms):** Buttons, tabs, and checkboxes change color.
3923
+ * **Check Indicators (200ms):** Checkbox and radio indicators overshoot slightly.
3924
+ * **Switch Thumb (240ms):** The switch thumb slides with a slight overshoot.
3925
+ * **Selection Indicator (240ms):** The tabs indicator slides to the selected tab.
3926
+
3927
+ #### Overlays and Content
3928
+
3929
+ * **Tooltip (160ms in, 100ms out):** Tooltips fade in, and leave faster than they enter.
3930
+ * **Popover and Menu (200ms in, 140ms out):** Popovers and menus grow from their trigger.
3931
+ * **Select and Combobox List (240ms in, 150ms out):** Lists open on the spring curve and close on snappy.
3932
+ * **Expanding Content (240ms in, 180ms out):** Accordion panels expand and collapse.
3933
+ * **Dialog (280ms in, 180ms out):** Dialogs enter over a fading backdrop.
3934
+ * **Drawer and Toast (320ms in, 200 to 240ms out):** Drawers and toasts travel farthest and run longest.
3935
+
3936
+ ### Guidelines
3937
+
3938
+ #### Animate Every State Change
3939
+
3940
+ Give every state change a transition, from hover and focus to checked, disabled, and invalid states. Animate overlays, toasts, expanding content, and changing values in and out.
3941
+
3942
+ * **Press:** Scale the control to `scale.press` (0.98).
3943
+ * **Popover and Menu:** Fade and grow from `scale.enter` (0.96).
3944
+ * **Dialog and Drawer:** Fade the backdrop and slide or scale the panel.
3945
+ * **Value Change:** Fade or slide the new value in.
3946
+
3947
+ #### Use Transitions for State, Keyframes for Feedback
3948
+
3949
+ A transition reverses from its current point when the state flips back, so a quick hover in and out never jumps. Keep keyframes for feedback that plays once.
3950
+
3951
+ * **State Changes (transition):** Hover, press, checked, and open states, such as the switch thumb.
3952
+ * **One-Shot Feedback (keyframes):** The 360ms nudge of an invalid [TextInput](components/forms-and-inputs.md#textinput) or [OtpField](components/forms-and-inputs.md#otpfield), and the 240ms pop of a [CopyButton](components/actions.md#copybutton) check.
3953
+
3954
+ #### Animate Transform and Opacity
3955
+
3956
+ Animate transforms, opacity, colors, shadows, and outlines, which change without a new layout. Animate size only when no transform produces the effect, as the components below do.
3957
+
3958
+ **Do:** Scale a pressed control to `scale: 'press'` with `ease.snappy`.
3959
+
3960
+ **Don't:** Animate `width`, `height`, or `margin` when a transform produces the same effect.
3961
+
3962
+ * **Accordion (height):** Panels grow to a measured height, not a transform.
3963
+ * **SidebarMenu (height):** Nested items grow as a group expands.
3964
+ * **Progress (width):** The indicator grows and keeps its rounded ends.
3965
+ * **Tabs (size):** The indicator stretches to match each tab.
3966
+ * **Switch (width):** The pressed thumb stretches to keep its round ends.
3967
+ * **Toast (height):** Toasts shrink as their stack collapses.
3968
+
3969
+ #### Never Delay Input
3970
+
3971
+ Controls respond on the first frame of a press. Don't hold an action until an animation finishes, and don't block the next interaction during an exit animation.
3972
+
3973
+ **Do:** Use short transitions that respond on the first frame, such as the library's press feedback.
3974
+
3975
+ ```tsx
3976
+ <MotionDemo kind="press" />
3977
+ ```
3978
+
3979
+ **Don't:** Make the reader wait for an animation to finish before they can act.
3980
+
3981
+ ```tsx
3982
+ <MotionDemo kind="slow" />
3983
+ ```
3984
+
3985
+ ### Authoring Motion
3986
+
3987
+ Set each curve and duration by its token, and pair each transition with a reduced-motion override that removes movement and keeps color changes.
3988
+
3989
+ ```tsx
3990
+ import { style } from '@tempoxyz/ds'
3991
+
3992
+ namespace styles {
3993
+ export const row = style({
3994
+ transitionDuration: '160',
3995
+ transitionProperty: 'background-color, scale',
3996
+ transitionTimingFunction: 'snappy',
3997
+ selectors: {
3998
+ '&:active': { scale: 'press' },
3999
+ '&:hover': { backgroundColor: 'container.regular' },
4000
+ },
4001
+ '@media (prefers-reduced-motion: reduce)': {
4002
+ transitionProperty: 'background-color',
4003
+ selectors: { '&:active': { scale: 'none !custom' } },
4004
+ },
4005
+ })
4006
+ }
4007
+ ```
4008
+
4009
+ * **Durations (transitionDuration):** Name a duration in ms, such as `'160'`.
4010
+ * **Curves (transitionTimingFunction):** Name a curve, such as `'snappy'`.
4011
+ * **Keyframes (vars.ease):** A keyframe shorthand reads its curve from `vars`.
4012
+
4013
+ ### Reduced Motion
4014
+
4015
+ When the system asks for reduced motion, components remove movement and scaling, and keep instant changes or brief opacity fades. Apply the same rule in your own styles, and honor Reduce Motion on iOS and Android.
4016
+
4017
+ #### What Components Change
4018
+
4019
+ * **Pressable Controls:** Buttons, surfaces, and other pressable controls stop scaling and keep their color transitions.
4020
+ * **Overlays:** Popovers, menus, dialogs, and toasts fade in place, including the narrow-screen dialog sheet.
4021
+ * **Moving Indicators:** The tabs indicator and the switch thumb jump straight to their final position.
4022
+ * **Loading Indicators:** Spinners stop rotating, skeletons stop their sweep, and loading dots stop pulsing.
4023
+ * **Feedback:** [CopyButton](components/actions.md#copybutton) skips its pop, and invalid fields skip their nudge.
4024
+
4025
+ ### Accessibility
4026
+
4027
+ [Accessibility](#motion) sets the limits for flashing and for content that moves on its own.
4028
+
4029
+ * **Never Motion Alone (Field.Error):** Never convey information through motion alone. Pair a nudge on an invalid field with an error message.
4030
+
4031
+ ### Related
4032
+
4033
+ [Loading](patterns.md#loading)
4034
+
4035
+ Covers spinners, skeletons, and progress.
4036
+
4037
+ [Feedback and Status](patterns.md#feedback-and-status)
4038
+
4039
+ Covers toasts and confirmations.
4040
+
4041
+ [Accessibility](#accessibility)
4042
+
4043
+ Covers reduced motion and other preferences.
4044
+
4045
+ ## Radius and Padding
4046
+
4047
+ How corner radius and padding pair, from fields to modals.
4048
+
4049
+ ### Overview
4050
+
4051
+ Corners in Tempo are squircles that ease into each edge. Each kind of element has its own radius, from fields and buttons up to modals, and the radius stays the same at every size of that element.
4052
+
4053
+ Padding keeps content clear of the curve. Boxes and modals pad by their own radius, and corners step down the scale as layers nest.
4054
+
4055
+ ### Scale
4056
+
4057
+ * **Fields, Buttons, and Alerts (xs):** A 12px corner at every size, padded by at least 16px.
4058
+ * **Boxes and Tiles (sm):** A 16px corner, padded by 16px, as in a list group.
4059
+ * **Small Modals (md):** A 24px corner, padded by 24px, for one decision.
4060
+ * **Medium and Large Modals (lg):** A 32px corner, padded by 32px, for longer tasks.
4061
+ * **Pills (full):** Icon buttons, avatars, and token chips.
4062
+
4063
+ **Do:** Pad a corner by at least its radius, so content sits clear of the curve.
4064
+
4065
+ ```tsx
4066
+ <RadiusDemo kind="padded" />
4067
+ ```
4068
+
4069
+ **Don't:** Pad a container by less than its radius.
4070
+
4071
+ ```tsx
4072
+ <RadiusDemo kind="cramped" />
4073
+ ```
4074
+
4075
+ ### Squircles
4076
+
4077
+ Every corner is a squircle where the browser supports it, and a round corner of the same radius everywhere else.
4078
+
4079
+ * **Squircle (corner-shape):** Supporting browsers draw each radius token as a squircle.
4080
+ * **Fallback (border-radius):** Other browsers draw the same token as a round corner.
4081
+ * **Circles and Pills (full):** Full radius stays round, so circles keep their shape.
4082
+
4083
+ To keep your own circle or pill round, set the round corner shape beside the full radius.
4084
+
4085
+ ```tsx
4086
+ import { style } from '@tempoxyz/ds'
4087
+
4088
+ namespace styles {
4089
+ export const badge = style({ borderRadius: 'full', cornerShape: 'round' })
4090
+ }
4091
+ ```
4092
+
4093
+ ### Nested Corners
4094
+
4095
+ A layer inside another takes a smaller radius: a modal at 32px holds boxes at 16px, which hold fields at 12px.
4096
+
4097
+ **Do:** Step the radius down at each layer, from modal to box to field.
4098
+
4099
+ ```tsx
4100
+ <RadiusDemo kind="nested" />
4101
+ ```
4102
+
4103
+ **Don't:** Repeat the outer radius on the layers inside it.
4104
+
4105
+ ```tsx
4106
+ <RadiusDemo kind="repeated" />
4107
+ ```
4108
+
4109
+ ### Corner Controls
4110
+
4111
+ * **Close and Back Buttons (First line):** Align with the title beside them, not with the corner.
4112
+
4113
+ ### Bleed
4114
+
4115
+ * **Edge-Aligned Controls (Up to the padding):** Lines a text button's label up with the content edge.
4116
+ * **Full-Bleed Content (Exactly the padding):** Lets rows and tables reach both edges of the box.
4117
+
4118
+ ### Related
4119
+
4120
+ [Layout](#layout)
4121
+
4122
+ Covers the radius, spacing, and shadow scales.
4123
+
4124
+ [Surface](components/layout.md#surface)
4125
+
4126
+ Use for padded boxes and cards.
4127
+
4128
+ [Dialog](components/overlays.md#dialog)
4129
+
4130
+ Use for modals.
4131
+
4132
+ ## Typography
4133
+
4134
+ Type sets for titles, body text, values, and code.
4135
+
4136
+ ### Overview
4137
+
4138
+ Type in Tempo is quiet and direct. Inter carries the interface and its numbers, Pilat gives titles their character, and JetBrains Mono keeps addresses and code legible.
4139
+
4140
+ Each set bundles a family, size, weight, line height, and tracking into one token, so you choose a role instead of tuning properties. A set keeps one size at every screen width.
4141
+
4142
+ ```tsx
4143
+ import { style } from '@tempoxyz/ds'
4144
+
4145
+ namespace styles {
4146
+ export const title = style({ typography: 'heading.h2' })
4147
+
4148
+ export const body = style({ color: 'content.secondary', typography: 'body.b2' })
4149
+ }
4150
+ ```
4151
+
4152
+ ### Typefaces
4153
+
4154
+ Three bundled families cover every set.
4155
+
4156
+ * **Inter (100 to 900):** Body text, labels, buttons, table cells, and numbers.
4157
+ * **Pilat (100 to 900):** Page, dialog, section, card, and hero titles only.
4158
+ * **JetBrains Mono (400 to 700):** Addresses, hashes, keys, and code.
4159
+
4160
+ ### Type Sets
4161
+
4162
+ Six sets cover the interface, from hero titles down to small labels.
4163
+
4164
+ #### Display
4165
+
4166
+ Hero titles in Pilat, in light and regular weights that let size carry the emphasis.
4167
+
4168
+ * `display.d1`: Pilat, 44px, weight 300, line height 41.8px
4169
+ * `display.d2`: Pilat, 36px, weight 400, line height 34.2px
4170
+
4171
+ #### Value
4172
+
4173
+ Large readings in Inter, such as a balance, with tight tracking so the digits read as one figure.
4174
+
4175
+ * `value.v1`: Inter, 80px, weight 400, line height normal
4176
+ * `value.v2`: Inter, 52px, weight 400, line height normal
4177
+ * `value.v3`: Inter, 40px, weight 400, line height normal
4178
+
4179
+ #### Heading
4180
+
4181
+ Page, dialog, section, and card titles, in Pilat at a medium weight. Only the heading and display sets use Pilat. Tracking tightens as the size grows, so large titles stay compact.
4182
+
4183
+ * `heading.h1`: Pilat, 32px, weight 500, line height 36.8px
4184
+ * `heading.h2`: Pilat, 24px, weight 500, line height 27.6px
4185
+ * `heading.h3`: Pilat, 20px, weight 500, line height 23px
4186
+ * `heading.h4`: Pilat, 18px, weight 500, line height 20.7px
4187
+
4188
+ #### Body
4189
+
4190
+ Paragraphs, descriptions, labels, buttons, and table cells, in a regular and a strong weight at each size.
4191
+
4192
+ * `body.b1`: Inter, 16px, weight 400, line height 22px
4193
+ * `body.b1Strong`: Inter, 16px, weight 500, line height 22px
4194
+ * `body.b2`: Inter, 14px, weight 400, line height 20px
4195
+ * `body.b2Strong`: Inter, 14px, weight 500, line height 20px
4196
+ * `body.b3`: Inter, 12px, weight 400, line height 16px
4197
+ * `body.b3Strong`: Inter, 12px, weight 500, line height 16px
4198
+
4199
+ * **Weight (400 and 500):** Strong sets add emphasis without a larger size.
4200
+ * **Default (body.b1):** The page default, a size down on dense screens.
4201
+ * **Inputs (body.b1):** Large fields keep 16px, so iOS Safari won't zoom.
4202
+ * **Buttons (body.b2Strong):** Buttons set their own labels, one size per button.
4203
+
4204
+ #### Mono
4205
+
4206
+ Addresses, hashes, keys, and code, in one size.
4207
+
4208
+ * **Addresses and Hashes (mono.m1):** Hex values and monospace table cells.
4209
+ * **Commands and Keys (mono.m1):** Snippets and secret values.
4210
+
4211
+ #### Utility
4212
+
4213
+ Short metadata labels in the mono family, with wide tracking. The design sets them in uppercase, which a component applies itself, since the sets keep the text's case.
4214
+
4215
+ * `utility.m1`: JetBrains Mono, 12px, weight 400, line height 16px
4216
+ * `utility.m2`: JetBrains Mono, 10px, weight 400, line height 12px
4217
+
4218
+ * **Label (utility.m1):** Metadata labels above or beside a value.
4219
+ * **Small Label (utility.m2):** The smaller size, for labels in tight spaces.
4220
+
4221
+ ### Guidelines
4222
+
4223
+ #### Build Hierarchy With Few Sizes
4224
+
4225
+ Build hierarchy with size and weight, not color. Most screens need a page title, section titles, and body text.
4226
+
4227
+ * **Page Title (heading.h2):** One per page, including app shell and dialog titles.
4228
+ * **Section and Card Title (heading.h3):** Section, surface, and popover titles.
4229
+ * **Small Title (body.b1Strong):** Compact titles, such as empty states and legends.
4230
+ * **Body and Secondary Text (body.b1):** Reading text, in the primary or secondary color.
4231
+
4232
+ Keep headings in order. Choose the element by its place in the outline and the set by its look.
4233
+
4234
+ **Do:** Let the component set the label and description sizes.
4235
+
4236
+ ```tsx
4237
+ <Field.Root>
4238
+ <Field.Label>Amount</Field.Label>
4239
+ <TextInput.Group>
4240
+ <TextInput.Control defaultValue="25.00" />
4241
+ </TextInput.Group>
4242
+ <Field.Description>Available balance: 120.00 USDC.</Field.Description>
4243
+ </Field.Root>
4244
+ ```
4245
+
4246
+ **Don't:** Use all caps or bold every line to create hierarchy. Write in [sentence case](#capitalization).
4247
+
4248
+ ```tsx
4249
+ <p>
4250
+ <strong>AMOUNT</strong>
4251
+ </p>
4252
+ <p>
4253
+ <strong>Available balance: 120.00 USDC.</strong>
4254
+ </p>
4255
+ ```
4256
+
4257
+ #### Match Sets to Their Role
4258
+
4259
+ * **Wrapping Text (body):** Anything that can wrap.
4260
+ * **Labels (body.b2Strong):** Field labels and short lines beside controls.
4261
+ * **Titles (heading):** Page, dialog, section, and card titles.
4262
+ * **Hero Numbers (value):** One balance or reading per screen, in Inter.
4263
+
4264
+ #### Reserve Pilat for Titles
4265
+
4266
+ Pilat sets titles only: page, dialog, section, and card titles in the heading sets, and hero titles in the display sets, from 18px up. Inter sets everything else, including labels, tabs, toasts, buttons, and numbers.
4267
+
4268
+ **Do:** Set the title in Pilat and the text below it in Inter.
4269
+
4270
+ ```tsx
4271
+ <Surface.Title>Recent payments</Surface.Title>
4272
+ <TypeDemo kind="body" />
4273
+ ```
4274
+
4275
+ **Don't:** Set Pilat on labels, tabs, toasts, or numbers, or below 18px.
4276
+
4277
+ ```tsx
4278
+ <Snippet size="small">{"fontFamily: 'heading'"}</Snippet>
4279
+ ```
4280
+
4281
+ #### Use Five Styles per Screen
4282
+
4283
+ Dense screens, such as consoles and internal tools, use at most five styles. Add `mono.m1` as a sixth only where the screen shows hex values or code.
4284
+
4285
+ * **Page Title (heading.h2):** One per screen, in Pilat.
4286
+ * **Section Title (heading.h3):** Sections, cards, and dialogs, in Pilat.
4287
+ * **Body (body.b2):** Text, table cells, and descriptions.
4288
+ * **Strong (body.b2Strong):** Labels, buttons, and emphasis.
4289
+ * **Meta (body.b3):** Timestamps, hints, and secondary details.
4290
+ * **Hex and Code (mono.m1):** The sixth style, only for hex values and code.
4291
+
4292
+ * **Families (2 per screen):** Inter and Pilat, plus mono only for hex and code.
4293
+ * **Content Sizes (3 per screen):** Below the titles, use weight and color before size.
4294
+
4295
+ #### Let Components Set Their Type
4296
+
4297
+ Components set the type of their own parts, such as a field label, a table cell, or a button. Pass text as children, and don't restyle it.
4298
+
4299
+ * **Component Text (children):** Pass plain text. The component applies its set and color.
4300
+ * **Your Own Text (typography):** Choose a set by role, from the five styles above.
4301
+
4302
+ #### Set Type With One Set
4303
+
4304
+ Set your own text with one `typography` set. Don't combine a family, size, or weight from different sets, which renders a style that the designs don't define. The [Linter](#set-type-with-a-typography-set) reports these.
4305
+
4306
+ **Do:** Set the role as one set.
4307
+
4308
+ ```tsx
4309
+ <Snippet size="small" style={{ width: 240 }}>
4310
+ {"typography: 'body.b2'"}
4311
+ </Snippet>
4312
+ ```
4313
+
4314
+ **Don't:** Build or adjust a style with separate type properties.
4315
+
4316
+ ```tsx
4317
+ <Snippet size="small" style={{ width: 240 }}>
4318
+ {"fontWeight: '600 !custom'"}
4319
+ </Snippet>
4320
+ ```
4321
+
4322
+ #### Reserve the Expressive Sets
4323
+
4324
+ * **Display (display):** One hero title per screen, in Pilat. Never in cards, tables, or dialogs.
4325
+ * **Value (value):** One headline reading per screen, in Inter. Not for a row of metrics.
4326
+ * **Utility (utility):** A metadata label above a value. No other text uses all caps.
4327
+ * **Mono (mono):** Hex values and code only. Not for numbers, amounts, dates, or labels.
4328
+
4329
+ #### Use Tabular Figures for Numbers
4330
+
4331
+ Tabular figures align digits in columns and keep live values from shifting. [Amount](components/blockchain.md#amount), [NumberField](components/forms-and-inputs.md#numberfield), [Slider](components/forms-and-inputs.md#slider), and numeric table cells already set them.
4332
+
4333
+ **Do:** Align amounts with tabular figures, such as `Amount` with `align="right"`.
4334
+
4335
+ ```tsx
4336
+ /**
4337
+ * Do example for "Use Tabular Figures for Numbers" on the Typography page.
4338
+ * Align amounts with tabular figures, such as `Amount` with `align="right"`.
4339
+ * @module
4340
+ */
4341
+ import { Amount, style } from '@tempoxyz/ds'
4342
+
4343
+ /** Renders the static preview, which the guideline card shows inert. */
4344
+ export function Demo() {
4345
+ return (
4346
+ <div {...styles.column()}>
4347
+ <Amount align="right" symbol="PathUSD" value="1111.11" />
4348
+ <Amount align="right" symbol="PathUSD" value="8808.80" />
4349
+ <Amount align="right" symbol="PathUSD" value="4170.25" />
4350
+ </div>
4351
+ )
4352
+ }
4353
+
4354
+ namespace styles {
4355
+ export const column = style({ display: 'grid', gap: '8', width: '12rem !custom' })
4356
+ }
4357
+ ```
4358
+
4359
+ **Don't:** Stack amounts in proportional figures, where digits drift out of line.
4360
+
4361
+ ```tsx
4362
+ /**
4363
+ * Don't example for "Use Tabular Figures for Numbers" on the Typography page.
4364
+ * Don't stack amounts in proportional figures, where digits drift out of line.
4365
+ * @module
4366
+ */
4367
+ import { style } from '@tempoxyz/ds'
4368
+
4369
+ /** Renders the static preview, which the guideline card shows inert. */
4370
+ export function Demo() {
4371
+ return (
4372
+ <div {...styles.column()}>
4373
+ <span {...styles.amount()}>1,111.11 PathUSD</span>
4374
+ <span {...styles.amount()}>8,808.80 PathUSD</span>
4375
+ <span {...styles.amount()}>4,170.25 PathUSD</span>
4376
+ </div>
4377
+ )
4378
+ }
4379
+
4380
+ namespace styles {
4381
+ export const amount = style({
4382
+ color: 'content.primary',
4383
+ fontVariantNumeric: 'proportional-nums !custom',
4384
+ textAlign: 'right',
4385
+ typography: 'body.b2Strong',
4386
+ })
4387
+
4388
+ export const column = style({ display: 'grid', gap: '8', width: '12rem !custom' })
4389
+ }
4390
+ ```
4391
+
4392
+ If you render a number yourself, such as a metric tile, set tabular figures in its style.
4393
+
4394
+ ```tsx
4395
+ style({ fontVariantNumeric: 'tabular-nums !custom' })
4396
+ ```
4397
+
4398
+ #### Use Monospace for Hashes and Code
4399
+
4400
+ Set addresses, hashes, keys, and code in monospace, so similar characters stay distinct and equal-length values align. [Hex](components/blockchain.md#hex), [Snippet](components/data-display.md#snippet), and [SecretValue](components/blockchain.md#secretvalue) apply it. Labels and prose stay out of it.
4401
+
4402
+ **Do:** Set hashes in `mono.m1`, so they align and `I`, `l`, `0`, and `O` stay distinct.
4403
+
4404
+ ```tsx
4405
+ /**
4406
+ * Do example for "Use Monospace for Hashes and Code" on the Typography page.
4407
+ * Set hashes in a `.mono` set, so they align and `I`, `l`, `0`, and `O` stay distinct.
4408
+ * @module
4409
+ */
4410
+ import { style } from '@tempoxyz/ds'
4411
+
4412
+ /** Renders the static preview, which the guideline card shows inert. */
4413
+ export function Demo() {
4414
+ return (
4415
+ <div {...styles.column()}>
4416
+ <span {...styles.value()}>0x1f0a9c3e7b11d4e0</span>
4417
+ <span {...styles.value()}>0x8d1Il0O4e2b7a96c</span>
4418
+ <span {...styles.value()}>0x7777a1b2c3d4e5f6</span>
4419
+ </div>
4420
+ )
4421
+ }
4422
+
4423
+ namespace styles {
4424
+ export const column = style({ display: 'grid', gap: '8' })
4425
+
4426
+ export const value = style({ color: 'content.primary', typography: 'mono.m1' })
4427
+ }
4428
+ ```
4429
+
4430
+ **Don't:** Set hashes in a proportional set, where equal-length values drift apart.
4431
+
4432
+ ```tsx
4433
+ /**
4434
+ * Don't example for "Use Monospace for Hashes and Code" on the Typography page.
4435
+ * Don't set hashes in a proportional set, where equal-length values drift apart.
4436
+ * @module
4437
+ */
4438
+ import { style } from '@tempoxyz/ds'
4439
+
4440
+ /** Renders the static preview, which the guideline card shows inert. */
4441
+ export function Demo() {
4442
+ return (
4443
+ <div {...styles.column()}>
4444
+ <span {...styles.value()}>0x1f0a9c3e7b11d4e0</span>
4445
+ <span {...styles.value()}>0x8d1Il0O4e2b7a96c</span>
4446
+ <span {...styles.value()}>0x7777a1b2c3d4e5f6</span>
4447
+ </div>
4448
+ )
4449
+ }
4450
+
4451
+ namespace styles {
4452
+ export const column = style({ display: 'grid', gap: '8' })
4453
+
4454
+ export const value = style({ color: 'content.primary', typography: 'body.b3' })
4455
+ }
4456
+ ```
4457
+
4458
+ #### Keep Lines Readable
4459
+
4460
+ * **Line Length (45 to 75 characters):** Cap paragraphs with `maxWidth: '65ch !custom'`. Dialogs already cap their width.
4461
+ * **Alignment:** Left-align text. Center only short text, such as an empty state title.
4462
+ * **Minimum Size (12px):** Don't set interface text smaller. The smallest body set, `body.b3`, stops here.
4463
+
4464
+ ## FAQ
4465
+
4466
+ Common questions about building with, and contributing to, Tempo Design System.
4467
+
4468
+ ### Getting Started
4469
+
4470
+ #### Which Surface Should I Use?
4471
+
4472
+ Choose the surface by the platform you ship to. The surfaces share a design language but not code, so don't import one from the other.
4473
+
4474
+ | I am building... | Surface | Import |
4475
+ | ------------------------- | --------- | ------------------------ |
4476
+ | A web application | Web | `@tempoxyz/ds` |
4477
+ | A React Native mobile app | Mobile | `@tempoxyz/ds/mobile` |
4478
+ | A marketing website | Marketing | `@tempoxyz/ds/marketing` |
4479
+
4480
+ Web components render DOM elements and compile with a Zyzz bundler plugin. Mobile components render React Native views and compile with Metro. [Getting Started](#getting-started) shows each setup.
4481
+
4482
+ #### Do I Need to Import a Stylesheet?
4483
+
4484
+ No. The library publishes no stylesheet.
4485
+
4486
+ * **Vite:** The [Vite plugin](#setup) emits the variables, the Inter, Pilat, and JetBrains Mono fonts, and keyframes once. Each component emits its own rules, so a build carries only the styles it uses.
4487
+ * **Rollup, Webpack, and esbuild:** The adapters emit a generated `/zyzz.css` that you load once.
4488
+ * **Mobile:** Metro compiles library and app styles during the bundle.
4489
+
4490
+ The Zyzz plugin is the only supported web setup.
4491
+
4492
+ #### How Do I Style My Own Markup?
4493
+
4494
+ Use `style` and `variants` from `@tempoxyz/ds` with TDS tokens, such as `content.primary`, `background.elevated`, `'24'`, and `body.b2`. Group the definitions in a `namespace styles` block.
4495
+
4496
+ If your app needs its own tokens, extend `variables` in your own Zyzz config, as the Custom Variables setup in [Getting Started](#setup) shows.
4497
+
4498
+ ### Components
4499
+
4500
+ #### Can I Change How a Component Looks?
4501
+
4502
+ Use the component's props first, such as `variant` and `size`.
4503
+
4504
+ * **Web:** Components accept `className` and `style`, and keep your classes beside their own.
4505
+ * **Mobile:** Components accept React Native `style`. Import variables from `@tempoxyz/ds/mobile`.
4506
+
4507
+ If you need a token the library does not have, extend `variables` as [How Do I Style My Own Markup?](#how-do-i-style-my-own-markup) shows.
4508
+
4509
+ #### What If the Library Doesn't Have the Component I Need?
4510
+
4511
+ Build it in your app from library components and `style`, with TDS tokens. Keep that code in your app. If other products need it too, propose it for the library.
4512
+
4513
+ #### How Do I Request a Component, Variant, or Token?
4514
+
4515
+ Open an issue in the Design System project in Linear. Include:
4516
+
4517
+ * The use case.
4518
+ * The proposed contract, such as props, variants, or token names.
4519
+ * Links to the relevant Figma designs.
4520
+ * Consumer code or a pull request that shows the need.
4521
+
4522
+ If an issue already covers the proposal, reuse it. A proposal joins `@tempoxyz/ds` after designer approval and an approved Figma definition.
4523
+
4524
+ #### Why Isn't a Figma Component in the Library?
4525
+
4526
+ The library includes only components with a verified production family in Figma. Archived and experimental Figma components stay out until a production version exists.
4527
+
4528
+ The [Components](components.md#overview) overview lists what ships today. Sidebar pages marked 🚧 are not written yet.
4529
+
4530
+ #### Which Components Exist on Mobile?
4531
+
4532
+ `@tempoxyz/ds/mobile` has a smaller set, and some names differ from web.
4533
+
4534
+ | Mobile | Web counterpart |
4535
+ | ------------ | --------------------------------------------------------------------------------- |
4536
+ | `Avatar` | [Avatar](components/data-display.md#avatar) |
4537
+ | `Badge` | [Badge](components/data-display.md#badge) |
4538
+ | `Button` | [Button](components/actions.md#button) |
4539
+ | `CodeInput` | [OtpField](components/forms-and-inputs.md#otpfield) |
4540
+ | `IconButton` | [Button](components/actions.md#button) with `shape="icon"` |
4541
+ | `Skeleton` | [Skeleton](components/feedback-and-status.md#skeleton) |
4542
+ | `Spinner` | [Spinner](components/feedback-and-status.md#spinner) |
4543
+ | `TextButton` | [Button](components/actions.md#button) with `variant="tertiary"` |
4544
+ | `TextInput` | [TextInput](components/forms-and-inputs.md#textinput) inside a [Field](components/forms-and-inputs.md#field-1) |
4545
+ | `Toast` | [Toast](components/feedback-and-status.md#toast) |
4546
+ | `Toggle` | [Switch](components/forms-and-inputs.md#switch) |
4547
+
4548
+ #### Do Web Components Work in Mobile Browsers?
4549
+
4550
+ Yes. [Responsive Layout](patterns.md#responsive-layout) shows how to adapt a layout from a phone to a desktop.
4551
+
4552
+ ### Design
4553
+
4554
+ #### How Do Light and Dark Schemes Work?
4555
+
4556
+ Every color has a light and a dark value, so you write each color once.
4557
+
4558
+ * **Web:** Values follow the inherited CSS `color-scheme`. Set `color-scheme: light dark` on the root to follow the system, or apply `vars({ colorScheme: 'dark' })` to fix one region.
4559
+ * **Mobile:** `Provider colorScheme="system"` follows the device setting. To override it, pass `light` or `dark`. To render a subtree with inverse variables, pass `vars="inverse"`.
4560
+
4561
+ The library does not store a scheme preference. If your app offers a theme setting, persist the choice yourself.
4562
+
4563
+ #### Which Is Right When Figma and Code Disagree?
4564
+
4565
+ Figma is the design reference. Variables, icons, and components are maintained by hand, so the two can drift.
4566
+
4567
+ If a component does not match its production Figma design, use Report issue on its page and include the Figma link. If you need the change before the library has it, keep the implementation in your app.
4568
+
4569
+ #### Where Are the Figma Files?
4570
+
4571
+ The Figma files define every variable, icon, and component:
4572
+
4573
+ * [TPDS 1.0 Platform](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs/TPDS-1.0-Platform) for Web variables and components
4574
+ * [TDS Platform](https://www.figma.com/design/pcO4NIuw8wx9U2nGJOcjzE) for Web icons
4575
+ * [DS Marketing](https://www.figma.com/design/EzqxuHd13VX6h1pGsch9hu/DS-Marketing) for Marketing variables
4576
+ * [TDS App](https://www.figma.com/design/8iu5856rBEI3pnZ6YaIBgw) for Mobile, whose families the mobile components implement
4577
+
4578
+ ### Docs
4579
+
4580
+ #### How Do I Report a Docs Issue?
4581
+
4582
+ On wide screens, On this page includes two actions:
4583
+
4584
+ * **Report issue:** Opens a GitHub issue titled with the page name and its path.
4585
+ * **Edit page:** Opens the MDX source of the page on GitHub.
4586
+
4587
+ On narrower screens, use the GitHub link at the bottom of the sidebar.
4588
+
4589
+ #### How Should Coding Agents Use These Docs?
4590
+
4591
+ Every page has a Markdown twin, `/llms.txt` indexes them all, and the library documents each export in its source. [Agents](#agents) lists the files and the rules an agent follows when it generates Tempo UI.
4592
+
4593
+ ### License
4594
+
4595
+ #### How Is the Library Licensed?
4596
+
4597
+ The library is open source under the [MIT license](https://github.com/tempoxyz/ds/blob/main/LICENSE-MIT).