@tempoxyz/ds 0.3.14 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/docs/AGENTS.md +75 -10
  2. package/dist/docs/arsenal.md +44 -0
  3. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +32 -24
  4. package/dist/docs/product/components/actions.md +2110 -0
  5. package/dist/docs/product/components/blockchain.md +3969 -0
  6. package/dist/docs/product/components/data-display.md +5901 -0
  7. package/dist/docs/product/components/feedback-and-status.md +4138 -0
  8. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  9. package/dist/docs/product/components/layout.md +3339 -0
  10. package/dist/docs/product/components/navigation.md +2914 -0
  11. package/dist/docs/product/components/overlays.md +4917 -0
  12. package/dist/docs/product/components.md +125 -125
  13. package/dist/docs/product/foundations.md +4597 -0
  14. package/dist/docs/product/patterns.md +10110 -0
  15. package/dist/marketing/index.js.zyzz.json +1 -1
  16. package/dist/marketing/vars.d.ts +618 -758
  17. package/dist/marketing/vars.d.ts.map +1 -1
  18. package/dist/marketing/vars.js +8 -5
  19. package/dist/marketing/vars.js.map +1 -1
  20. package/dist/marketing/vars.js.zyzz.json +1 -1
  21. package/dist/marketing/zyzz.config.d.ts +3042 -3757
  22. package/dist/marketing/zyzz.config.d.ts.map +1 -1
  23. package/dist/marketing/zyzz.config.js +1 -1
  24. package/dist/marketing/zyzz.config.js.map +1 -1
  25. package/dist/marketing/zyzz.config.js.zyzz.json +1 -1
  26. package/dist/mobile/components/Button.d.ts +115 -15
  27. package/dist/mobile/components/Button.d.ts.map +1 -1
  28. package/dist/mobile/components/Button.js +85 -14
  29. package/dist/mobile/components/Button.js.map +1 -1
  30. package/dist/mobile/components/IconButton.d.ts +129 -40
  31. package/dist/mobile/components/IconButton.d.ts.map +1 -1
  32. package/dist/mobile/components/IconButton.js +97 -28
  33. package/dist/mobile/components/IconButton.js.map +1 -1
  34. package/dist/mobile/components/TextInput.d.ts +132 -11
  35. package/dist/mobile/components/TextInput.d.ts.map +1 -1
  36. package/dist/mobile/components/TextInput.js +115 -14
  37. package/dist/mobile/components/TextInput.js.map +1 -1
  38. package/dist/mobile/index.d.ts +1 -0
  39. package/dist/mobile/index.d.ts.map +1 -1
  40. package/dist/mobile/index.js +1 -0
  41. package/dist/mobile/index.js.map +1 -1
  42. package/dist/mobile/vars.d.ts +103 -0
  43. package/dist/mobile/vars.d.ts.map +1 -1
  44. package/dist/mobile/vars.js +74 -0
  45. package/dist/mobile/vars.js.map +1 -1
  46. package/dist/mobile/zyzz.config.d.ts +408 -0
  47. package/dist/mobile/zyzz.config.d.ts.map +1 -1
  48. package/dist/web/components/AddressCard.js.zyzz.json +1 -1
  49. package/dist/web/components/Amount.css +1 -1
  50. package/dist/web/components/Amount.d.ts +9 -0
  51. package/dist/web/components/Amount.d.ts.map +1 -1
  52. package/dist/web/components/Amount.js +8 -5
  53. package/dist/web/components/Amount.js.map +1 -1
  54. package/dist/web/components/Amount.js.zyzz.json +1 -1
  55. package/dist/web/components/CopyButton.d.ts +6 -0
  56. package/dist/web/components/CopyButton.d.ts.map +1 -1
  57. package/dist/web/components/CopyButton.js +4 -1
  58. package/dist/web/components/CopyButton.js.map +1 -1
  59. package/dist/web/components/CopyButton.js.zyzz.json +1 -1
  60. package/dist/web/components/Hex.css +1 -1
  61. package/dist/web/components/Hex.d.ts +84 -3
  62. package/dist/web/components/Hex.d.ts.map +1 -1
  63. package/dist/web/components/Hex.js +20 -13
  64. package/dist/web/components/Hex.js.map +1 -1
  65. package/dist/web/components/Hex.js.zyzz.json +1 -1
  66. package/dist/web/components/Progress.css +1 -1
  67. package/dist/web/components/Progress.d.ts +12 -2
  68. package/dist/web/components/Progress.d.ts.map +1 -1
  69. package/dist/web/components/Progress.js +9 -5
  70. package/dist/web/components/Progress.js.map +1 -1
  71. package/dist/web/components/Progress.js.zyzz.json +1 -1
  72. package/dist/web/components/SecretValue.js.zyzz.json +1 -1
  73. package/dist/web/components/SidebarMenu.d.ts +4 -4
  74. package/dist/web/components/SidebarMenu.js +6 -6
  75. package/dist/web/components/SidebarMenu.js.map +1 -1
  76. package/dist/web/components/Snippet.js.zyzz.json +1 -1
  77. package/dist/web/index.js.zyzz.json +1 -1
  78. package/package.json +1 -1
  79. package/src/marketing/README.md +1 -1
  80. package/src/marketing/vars.ts +526 -604
  81. package/src/marketing/zyzz.config.ts +5 -4
  82. package/src/mobile/README.md +19 -6
  83. package/src/mobile/components/Button.tsx +94 -17
  84. package/src/mobile/components/IconButton.tsx +122 -30
  85. package/src/mobile/components/TextInput.tsx +139 -24
  86. package/src/mobile/index.ts +1 -0
  87. package/src/mobile/vars.ts +74 -0
  88. package/src/web/components/Amount.tsx +37 -3
  89. package/src/web/components/CopyButton.tsx +8 -0
  90. package/src/web/components/Hex.tsx +79 -13
  91. package/src/web/components/Progress.tsx +8 -2
  92. package/src/web/components/SidebarMenu.tsx +6 -6
  93. package/dist/docs/index.md +0 -145
  94. package/dist/docs/product/components/accordion.md +0 -489
  95. package/dist/docs/product/components/address-card.md +0 -147
  96. package/dist/docs/product/components/agent-logo.md +0 -194
  97. package/dist/docs/product/components/alert-dialog.md +0 -631
  98. package/dist/docs/product/components/alert.md +0 -448
  99. package/dist/docs/product/components/amount-input.md +0 -305
  100. package/dist/docs/product/components/amount.md +0 -794
  101. package/dist/docs/product/components/app-shell.md +0 -559
  102. package/dist/docs/product/components/asset-chip.md +0 -294
  103. package/dist/docs/product/components/autocomplete.md +0 -620
  104. package/dist/docs/product/components/avatar.md +0 -321
  105. package/dist/docs/product/components/badge.md +0 -339
  106. package/dist/docs/product/components/badged-logo.md +0 -116
  107. package/dist/docs/product/components/banner.md +0 -379
  108. package/dist/docs/product/components/bar-chart.md +0 -208
  109. package/dist/docs/product/components/breadcrumbs.md +0 -380
  110. package/dist/docs/product/components/button-group.md +0 -286
  111. package/dist/docs/product/components/button.md +0 -650
  112. package/dist/docs/product/components/calendar.md +0 -375
  113. package/dist/docs/product/components/callout.md +0 -96
  114. package/dist/docs/product/components/checkbox-group.md +0 -521
  115. package/dist/docs/product/components/checkbox.md +0 -467
  116. package/dist/docs/product/components/choice-group.md +0 -516
  117. package/dist/docs/product/components/choicebox.md +0 -641
  118. package/dist/docs/product/components/code.md +0 -100
  119. package/dist/docs/product/components/combobox.md +0 -939
  120. package/dist/docs/product/components/container.md +0 -257
  121. package/dist/docs/product/components/copy-button.md +0 -642
  122. package/dist/docs/product/components/date-picker.md +0 -514
  123. package/dist/docs/product/components/dialog.md +0 -1332
  124. package/dist/docs/product/components/drawer.md +0 -966
  125. package/dist/docs/product/components/empty.md +0 -340
  126. package/dist/docs/product/components/field.md +0 -570
  127. package/dist/docs/product/components/fieldset.md +0 -398
  128. package/dist/docs/product/components/frame.md +0 -434
  129. package/dist/docs/product/components/gauge.md +0 -299
  130. package/dist/docs/product/components/get-started-visual.md +0 -117
  131. package/dist/docs/product/components/grid.md +0 -288
  132. package/dist/docs/product/components/hero-visual.md +0 -155
  133. package/dist/docs/product/components/hex.md +0 -487
  134. package/dist/docs/product/components/icon-tile.md +0 -292
  135. package/dist/docs/product/components/identicon.md +0 -371
  136. package/dist/docs/product/components/inline.md +0 -233
  137. package/dist/docs/product/components/inset.md +0 -225
  138. package/dist/docs/product/components/kbd.md +0 -423
  139. package/dist/docs/product/components/list-group.md +0 -981
  140. package/dist/docs/product/components/loading-dots.md +0 -237
  141. package/dist/docs/product/components/menu.md +0 -934
  142. package/dist/docs/product/components/native-select.md +0 -204
  143. package/dist/docs/product/components/network-logo.md +0 -248
  144. package/dist/docs/product/components/number-field.md +0 -543
  145. package/dist/docs/product/components/otp-field.md +0 -616
  146. package/dist/docs/product/components/pagination.md +0 -516
  147. package/dist/docs/product/components/popover.md +0 -544
  148. package/dist/docs/product/components/progress.md +0 -388
  149. package/dist/docs/product/components/qr.md +0 -314
  150. package/dist/docs/product/components/radio-group.md +0 -528
  151. package/dist/docs/product/components/secret-value.md +0 -406
  152. package/dist/docs/product/components/select.md +0 -751
  153. package/dist/docs/product/components/separator.md +0 -379
  154. package/dist/docs/product/components/sidebar-menu.md +0 -922
  155. package/dist/docs/product/components/skeleton.md +0 -517
  156. package/dist/docs/product/components/slider.md +0 -539
  157. package/dist/docs/product/components/snippet.md +0 -424
  158. package/dist/docs/product/components/spinner.md +0 -216
  159. package/dist/docs/product/components/split-bar.md +0 -139
  160. package/dist/docs/product/components/split-button.md +0 -464
  161. package/dist/docs/product/components/stack.md +0 -299
  162. package/dist/docs/product/components/status-chip.md +0 -226
  163. package/dist/docs/product/components/status-indicator.md +0 -119
  164. package/dist/docs/product/components/status-row.md +0 -174
  165. package/dist/docs/product/components/stepper.md +0 -451
  166. package/dist/docs/product/components/success-hero.md +0 -157
  167. package/dist/docs/product/components/surface.md +0 -639
  168. package/dist/docs/product/components/switch.md +0 -472
  169. package/dist/docs/product/components/table.md +0 -968
  170. package/dist/docs/product/components/tabs.md +0 -627
  171. package/dist/docs/product/components/tempo-logo.md +0 -185
  172. package/dist/docs/product/components/text-input.md +0 -624
  173. package/dist/docs/product/components/textarea.md +0 -352
  174. package/dist/docs/product/components/toast.md +0 -535
  175. package/dist/docs/product/components/token-logo.md +0 -371
  176. package/dist/docs/product/components/token.md +0 -247
  177. package/dist/docs/product/components/tooltip.md +0 -490
  178. package/dist/docs/product/components/verification-code.md +0 -116
  179. package/dist/docs/product/components/visual.md +0 -249
  180. package/dist/docs/product/foundations/accessibility.md +0 -377
  181. package/dist/docs/product/foundations/agents.md +0 -159
  182. package/dist/docs/product/foundations/color.md +0 -522
  183. package/dist/docs/product/foundations/content/tone.md +0 -194
  184. package/dist/docs/product/foundations/content/voice.md +0 -194
  185. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  186. package/dist/docs/product/foundations/iconography.md +0 -282
  187. package/dist/docs/product/foundations/intent.md +0 -360
  188. package/dist/docs/product/foundations/layout.md +0 -508
  189. package/dist/docs/product/foundations/linter.md +0 -523
  190. package/dist/docs/product/foundations/motion.md +0 -151
  191. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  192. package/dist/docs/product/foundations/typography.md +0 -331
  193. package/dist/docs/product/introduction/faq.md +0 -133
  194. package/dist/docs/product/introduction/getting-started.md +0 -377
  195. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  196. package/dist/docs/product/patterns/dashboards.md +0 -638
  197. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  198. package/dist/docs/product/patterns/empty-states.md +0 -612
  199. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  200. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  201. package/dist/docs/product/patterns/forms.md +0 -679
  202. package/dist/docs/product/patterns/loading.md +0 -630
  203. package/dist/docs/product/patterns/navigation.md +0 -397
  204. package/dist/docs/product/patterns/payments.md +0 -765
  205. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  206. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  207. package/dist/docs/product/products/tempo-console.md +0 -671
  208. package/dist/docs/product/products/tempo-performance.md +0 -435
  209. package/dist/docs/product/products/tempo-wallet.md +0 -438
@@ -1,490 +0,0 @@
1
- # Tooltip
2
-
3
- Shows a short label for a control on hover or focus.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Tooltip.tsx)
6
-
7
- Figma: [Tooltip](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=3084-1076) (`Tooltip.Popup`)
8
-
9
- ## Overview
10
-
11
- A tooltip is a visual label that opens on hover and keyboard focus.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- import { Button, Tooltip } from '@tempoxyz/ds'
19
- import { Plus } from '@tempoxyz/ds/icons'
20
-
21
- export function Demo() {
22
- return (
23
- <Tooltip.Provider>
24
- <Tooltip.Root>
25
- <Tooltip.Trigger
26
- render={<Button aria-label="Add funds" shape="icon" variant="secondary" />}
27
- >
28
- <Plus />
29
- </Tooltip.Trigger>
30
- <Tooltip.Popup>Add funds</Tooltip.Popup>
31
- </Tooltip.Root>
32
- </Tooltip.Provider>
33
- )
34
- }
35
- ```
36
-
37
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Tooltip/Basic.tsx)
38
-
39
- ### Side
40
-
41
- Set `side` on `Tooltip.Popup` to `top` (default), `bottom`, `left`, or `right`.
42
-
43
- ```tsx
44
- import { Button, Tooltip } from '@tempoxyz/ds'
45
-
46
- export function Demo() {
47
- return (
48
- <Tooltip.Provider>
49
- <Tooltip.Root>
50
- <Tooltip.Trigger render={<Button variant="secondary" />}>Bottom</Tooltip.Trigger>
51
- <Tooltip.Popup side="bottom">Shown below the trigger</Tooltip.Popup>
52
- </Tooltip.Root>
53
- </Tooltip.Provider>
54
- )
55
- }
56
- ```
57
-
58
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Tooltip/Side.tsx)
59
-
60
- ### Disabled
61
-
62
- Wrap a disabled control in a focusable trigger. Disabled elements receive no pointer or focus events.
63
-
64
- ```tsx
65
- import { Button, Tooltip } from '@tempoxyz/ds'
66
- import { Refresh } from '@tempoxyz/ds/icons'
67
-
68
- export function Demo() {
69
- return (
70
- <Tooltip.Provider>
71
- <Tooltip.Root>
72
- <Tooltip.Trigger render={<span tabIndex={0} />}>
73
- <Button aria-label="Refresh balances" disabled shape="icon" variant="secondary">
74
- <Refresh />
75
- </Button>
76
- </Tooltip.Trigger>
77
- <Tooltip.Popup>Refresh balances</Tooltip.Popup>
78
- </Tooltip.Root>
79
- </Tooltip.Provider>
80
- )
81
- }
82
- ```
83
-
84
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Tooltip/Disabled.tsx)
85
-
86
- ## Anatomy
87
-
88
- Import the component and assemble its parts.
89
-
90
- ```tsx
91
- import { Tooltip } from '@tempoxyz/ds'
92
-
93
- <Tooltip.Provider>
94
- <Tooltip.Root>
95
- <Tooltip.Trigger />
96
- <Tooltip.Popup />
97
- </Tooltip.Root>
98
- </Tooltip.Provider>
99
- ```
100
-
101
- ## Guidelines
102
-
103
- ### When to Use
104
-
105
- * Label an icon-only button, such as Refresh balances, Filter activity, or Settings.
106
- * Name a control whose icon is ambiguous, such as an arrow that could mean Send or Export.
107
-
108
- ### When Not to Use
109
-
110
- * Use a [Popover](popover.md) with `openOnHover` on `Popover.Trigger` for info icons, such as the explanation beside a dashboard metric.
111
- * Use visible text, such as a `Field.Description` from [Field](field.md), for fees, limits, requirements, and errors.
112
- * Use an [Alert](alert.md) for warnings.
113
- * Write the reason for a disabled [Button](button.md) in nearby text, not in a tooltip.
114
- * Don't add a tooltip to a [Button](button.md) with a visible label. It repeats the label and covers nearby content.
115
-
116
- ### Use Tooltips as Labels Only
117
-
118
- Focus stays on the trigger while the tooltip is open, so Tab can't reach a link or button inside it.
119
-
120
- **Do:** Name the action of an icon-only button in a few words.
121
-
122
- ```tsx
123
- /**
124
- * Do example for "Use Tooltips as Labels Only" on the Tooltip page.
125
- * Name the action of an icon-only button in a few words.
126
- * @module
127
- */
128
- import { Button, style } from '@tempoxyz/ds'
129
- import { Filter } from '@tempoxyz/ds/icons'
130
-
131
- /** Renders the static preview, which the guideline card shows inert. */
132
- export function Demo() {
133
- return (
134
- <div {...styles.stack()}>
135
- <div {...styles.tooltip()}>Filter activity</div>
136
- <Button aria-label="Filter activity" shape="icon" variant="secondary">
137
- <Filter />
138
- </Button>
139
- </div>
140
- )
141
- }
142
-
143
- namespace styles {
144
- export const stack = style({
145
- alignItems: 'center',
146
- display: 'flex',
147
- flexDirection: 'column',
148
- rowGap: '8',
149
- })
150
-
151
- export const tooltip = style({
152
- backgroundColor: 'content.primary',
153
- borderRadius: 'xs',
154
- color: 'background.primary',
155
- paddingBlock: '6px !custom',
156
- paddingInline: '12',
157
- typography: 'body.b3',
158
- })
159
- }
160
- ```
161
-
162
- **Don't:** Put links, buttons, or other controls in a tooltip. Use a
163
- [Popover](popover.md).
164
-
165
- ```tsx
166
- /**
167
- * Don't example for "Use Tooltips as Labels Only" on the Tooltip page.
168
- * Don't put links, buttons, or other controls in a tooltip. Use a Popover.
169
- * @module
170
- */
171
- import { Button, style } from '@tempoxyz/ds'
172
- import { InfoCircle } from '@tempoxyz/ds/icons'
173
-
174
- /** Renders the static preview, which the guideline card shows inert. */
175
- export function Demo() {
176
- return (
177
- <div {...styles.stack()}>
178
- <div {...styles.tooltip()}>
179
- Fees depend on network load. <span {...styles.link()}>Learn more</span>
180
- </div>
181
- <Button aria-label="About network fees" shape="icon" size="small" variant="tertiary">
182
- <InfoCircle />
183
- </Button>
184
- </div>
185
- )
186
- }
187
-
188
- namespace styles {
189
- export const link = style({ textDecorationLine: 'underline !custom' })
190
-
191
- export const stack = style({
192
- alignItems: 'center',
193
- display: 'flex',
194
- flexDirection: 'column',
195
- rowGap: '8',
196
- })
197
-
198
- export const tooltip = style({
199
- backgroundColor: 'content.primary',
200
- borderRadius: 'xs',
201
- color: 'background.primary',
202
- maxWidth: '14rem !custom',
203
- paddingBlock: '6px !custom',
204
- paddingInline: '12',
205
- typography: 'body.b3',
206
- })
207
- }
208
- ```
209
-
210
- ### Keep Essential Information Visible
211
-
212
- Touch input never opens a tooltip, and screen readers don't announce it. Show amounts, fees, and requirements as text on the page.
213
-
214
- **Do:** Show the fee and its explanation as visible text.
215
-
216
- ```tsx
217
- /**
218
- * Do example for "Keep Essential Information Visible" on the Tooltip page.
219
- * Show the fee and its explanation as visible text.
220
- * @module
221
- */
222
- import { style } from '@tempoxyz/ds'
223
-
224
- /** Renders the static preview, which the guideline card shows inert. */
225
- export function Demo() {
226
- return (
227
- <div {...styles.row()}>
228
- <div {...styles.text()}>
229
- <span {...styles.label()}>Network fee</span>
230
- <span {...styles.hint()}>Paid in the token you send</span>
231
- </div>
232
- <span {...styles.value()}>0.001 USDC</span>
233
- </div>
234
- )
235
- }
236
-
237
- namespace styles {
238
- export const hint = style({ color: 'content.secondary', typography: 'body.b3' })
239
-
240
- export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
241
-
242
- export const row = style({
243
- alignItems: 'center',
244
- columnGap: '24',
245
- display: 'flex',
246
- justifyContent: 'space-between',
247
- width: '16rem !custom',
248
- })
249
-
250
- export const text = style({ display: 'flex', flexDirection: 'column', rowGap: '4' })
251
-
252
- export const value = style({ color: 'content.primary', typography: 'body.b2' })
253
- }
254
- ```
255
-
256
- **Don't:** Hide a value you need to decide behind a tooltip.
257
-
258
- ```tsx
259
- /**
260
- * Don't example for "Keep Essential Information Visible" on the Tooltip page.
261
- * Don't hide a value you need to decide behind a tooltip.
262
- * @module
263
- */
264
- import { Button, style } from '@tempoxyz/ds'
265
- import { InfoCircle } from '@tempoxyz/ds/icons'
266
-
267
- /** Renders the static preview, which the guideline card shows inert. */
268
- export function Demo() {
269
- return (
270
- <div {...styles.stack()}>
271
- <div {...styles.tooltip()}>0.001 USDC, paid in the token you send</div>
272
- <div {...styles.row()}>
273
- <span {...styles.label()}>Network fee</span>
274
- <Button aria-label="Network fee" shape="icon" size="small" variant="tertiary">
275
- <InfoCircle />
276
- </Button>
277
- </div>
278
- </div>
279
- )
280
- }
281
-
282
- namespace styles {
283
- export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
284
-
285
- export const row = style({ alignItems: 'center', columnGap: '4', display: 'flex' })
286
-
287
- export const stack = style({
288
- alignItems: 'flex-end',
289
- display: 'flex',
290
- flexDirection: 'column',
291
- rowGap: '8',
292
- })
293
-
294
- export const tooltip = style({
295
- backgroundColor: 'content.primary',
296
- borderRadius: 'xs',
297
- color: 'background.primary',
298
- paddingBlock: '6px !custom',
299
- paddingInline: '12',
300
- typography: 'body.b3',
301
- })
302
- }
303
- ```
304
-
305
- ### Group Tooltips With a Provider
306
-
307
- * **Toolbars (Tooltip.Provider):** Wrap a row of icon buttons, so once one tooltip opens, its neighbors open instantly.
308
- * **Single Triggers (600ms):** Keep the default `delay`. Shorter delays flash tooltips as the pointer passes.
309
-
310
- ### Place Tooltips Clear of Related Content
311
-
312
- `Tooltip.Popup` flips when it would overflow the viewport. Set `side="bottom"` for triggers in a header or top toolbar.
313
-
314
- **Do:** Choose a side that keeps the value the control acts on visible.
315
-
316
- ```tsx
317
- /**
318
- * Do example for "Place Tooltips Clear of Related Content" on the Tooltip page.
319
- * Choose a side that keeps the value the control acts on visible.
320
- * @module
321
- */
322
- import { Button, style } from '@tempoxyz/ds'
323
- import { Refresh } from '@tempoxyz/ds/icons'
324
-
325
- /** Renders the static preview, which the guideline card shows inert. */
326
- export function Demo() {
327
- return (
328
- <div {...styles.card()}>
329
- <span {...styles.label()}>Balance</span>
330
- <div {...styles.row()}>
331
- <span {...styles.value()}>1,250.00 USDC</span>
332
- <span {...styles.anchor()}>
333
- <Button aria-label="Refresh balance" shape="icon" size="small" variant="secondary">
334
- <Refresh />
335
- </Button>
336
- <span {...styles.tooltip()}>Refresh balance</span>
337
- </span>
338
- </div>
339
- </div>
340
- )
341
- }
342
-
343
- namespace styles {
344
- export const anchor = style({ display: 'flex', position: 'relative' })
345
-
346
- export const card = style({
347
- display: 'flex',
348
- flexDirection: 'column',
349
- height: '7rem !custom',
350
- rowGap: '4',
351
- width: '17rem !custom',
352
- })
353
-
354
- export const label = style({ color: 'content.secondary', typography: 'body.b3' })
355
-
356
- export const row = style({ alignItems: 'center', columnGap: '8', display: 'flex' })
357
-
358
- // Tooltips render in a portal, so this preview places one with the popup's styles, below the trigger.
359
- export const tooltip = style({
360
- backgroundColor: 'content.primary',
361
- borderRadius: 'xs',
362
- color: 'background.primary',
363
- paddingBlock: '6px !custom',
364
- paddingInline: '12',
365
- position: 'absolute',
366
- right: '0',
367
- top: 'calc(100% + 8px) !custom',
368
- typography: 'body.b3',
369
- whiteSpace: 'nowrap',
370
- })
371
-
372
- export const value = style({ color: 'content.primary', typography: 'heading.h2' })
373
- }
374
- ```
375
-
376
- **Don't:** Let the tooltip cover the value beside its trigger.
377
-
378
- ```tsx
379
- /**
380
- * Don't example for "Place Tooltips Clear of Related Content" on the Tooltip page.
381
- * Don't let the tooltip cover the value beside its trigger.
382
- * @module
383
- */
384
- import { Button, style } from '@tempoxyz/ds'
385
- import { Refresh } from '@tempoxyz/ds/icons'
386
-
387
- /** Renders the static preview, which the guideline card shows inert. */
388
- export function Demo() {
389
- return (
390
- <div {...styles.card()}>
391
- <span {...styles.label()}>Balance</span>
392
- <div {...styles.row()}>
393
- <span {...styles.value()}>1,250.00 USDC</span>
394
- <span {...styles.anchor()}>
395
- <Button aria-label="Refresh balance" shape="icon" size="small" variant="secondary">
396
- <Refresh />
397
- </Button>
398
- <span {...styles.tooltip()}>Refresh balance</span>
399
- </span>
400
- </div>
401
- </div>
402
- )
403
- }
404
-
405
- namespace styles {
406
- export const anchor = style({ display: 'flex', position: 'relative' })
407
-
408
- export const card = style({
409
- display: 'flex',
410
- flexDirection: 'column',
411
- height: '7rem !custom',
412
- rowGap: '4',
413
- width: '17rem !custom',
414
- })
415
-
416
- export const label = style({ color: 'content.secondary', typography: 'body.b3' })
417
-
418
- export const row = style({ alignItems: 'center', columnGap: '8', display: 'flex' })
419
-
420
- // Tooltips render in a portal, so this preview places one with the popup's styles, left of the trigger.
421
- export const tooltip = style({
422
- backgroundColor: 'content.primary',
423
- borderRadius: 'xs',
424
- color: 'background.primary',
425
- paddingBlock: '6px !custom',
426
- paddingInline: '12',
427
- position: 'absolute',
428
- right: 'calc(100% + 8px) !custom',
429
- top: '50% !custom',
430
- transform: 'translateY(-50%) !custom',
431
- typography: 'body.b3',
432
- whiteSpace: 'nowrap',
433
- })
434
-
435
- export const value = style({ color: 'content.primary', typography: 'heading.h2' })
436
- }
437
- ```
438
-
439
- ## Content
440
-
441
- ### Write a Few Words
442
-
443
- Use one to four words. Name the action, such as Refresh balances, not the icon, such as Circular arrows.
444
-
445
- ## Accessibility
446
-
447
- A tooltip is visual only, so the trigger needs its own accessible name.
448
-
449
- ### Semantics
450
-
451
- * **Tooltip.Trigger (button):** Keeps the role of the element it renders.
452
- * **Tooltip.Popup:** Has no role and isn't linked to the trigger, so it neither names nor describes it. Mounts only while open.
453
- * **Contrast (elevated):** Sets primary text on the elevated fill in both schemes.
454
-
455
- ### Keyboard
456
-
457
- * **Open on Focus (Tab):** Focus on the trigger opens the tooltip at once.
458
- * **Close the Tooltip (Escape):** Closes the tooltip while focus stays on the trigger.
459
-
460
- ### Focus
461
-
462
- * **No Focus:** The tooltip never takes focus and holds no interactive content.
463
- * **Pointer:** Opens after 600ms of hover. The pointer can move onto the popup without closing it.
464
- * **Touch:** Touch input never opens it, so no task may depend on one.
465
-
466
- ### Your Responsibilities
467
-
468
- * **Name Icon-Only Triggers (aria-label):** Name an icon-only trigger with the tooltip text.
469
-
470
- ## Related
471
-
472
- [Popover](popover.md)
473
-
474
- Use for info icons and interactive content.
475
-
476
- [Button](button.md)
477
-
478
- Use for icon-only buttons.
479
-
480
- [CopyButton](copy-button.md)
481
-
482
- Use for a copy action that names itself.
483
-
484
- [Field](field.md)
485
-
486
- Use for descriptions that stay visible.
487
-
488
- [Dashboards](../patterns/dashboards.md)
489
-
490
- Covers metric explanations.
@@ -1,116 +0,0 @@
1
- # VerificationCode
2
-
3
- Shows a code that a person compares with the one another app shows.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/VerificationCode.tsx)
6
-
7
- Figma: [Content/Verification Code](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-3952) (`VerificationCode.Root`)
8
-
9
- ## Overview
10
-
11
- A verification code renders a centered box with a label above a large code. A person reads the code and checks that it matches the code on another device or app, such as in a device sign-in.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- import { VerificationCode } from '@tempoxyz/ds'
19
-
20
- export function Demo() {
21
- return (
22
- <VerificationCode.Root>
23
- <VerificationCode.Label>Confirm this code matches Claude</VerificationCode.Label>
24
- <VerificationCode.Value>WXYZ-4821</VerificationCode.Value>
25
- </VerificationCode.Root>
26
- )
27
- }
28
- ```
29
-
30
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/VerificationCode/Basic.tsx)
31
-
32
- ## Anatomy
33
-
34
- Import the component and assemble its parts.
35
-
36
- ```tsx
37
- import { VerificationCode } from '@tempoxyz/ds'
38
-
39
- <VerificationCode.Root>
40
- <VerificationCode.Label />
41
- <VerificationCode.Value />
42
- </VerificationCode.Root>
43
- ```
44
-
45
- ## Guidelines
46
-
47
- ### When to Use
48
-
49
- * Confirm a device sign-in by matching the code that an app or a terminal shows.
50
- * Pair two devices by a code that both show.
51
-
52
- ### When Not to Use
53
-
54
- * Use [OtpField](otp-field.md) when the person types a code.
55
- * Use [Snippet](snippet.md) for a command or a value to copy.
56
-
57
- ### Match the Other Device
58
-
59
- **Do:** Name the app that shows the code, and keep its grouping.
60
-
61
- ```tsx
62
- import { VerificationCode } from '@tempoxyz/ds'
63
-
64
- export function Demo() {
65
- return (
66
- <VerificationCode.Root>
67
- <VerificationCode.Label>Confirm this code matches Claude</VerificationCode.Label>
68
- <VerificationCode.Value>WXYZ-4821</VerificationCode.Value>
69
- </VerificationCode.Root>
70
- )
71
- }
72
- ```
73
-
74
- **Don't:** Regroup the code, or leave out where it comes from.
75
-
76
- ```tsx
77
- import { VerificationCode } from '@tempoxyz/ds'
78
-
79
- export function Demo() {
80
- return (
81
- <VerificationCode.Root>
82
- <VerificationCode.Label>Your code</VerificationCode.Label>
83
- <VerificationCode.Value>WX YZ 48 21</VerificationCode.Value>
84
- </VerificationCode.Root>
85
- )
86
- }
87
- ```
88
-
89
- ## Content
90
-
91
- ### Write the Label
92
-
93
- Start the label with the action, such as Confirm this code matches Claude. Name the app or device that shows the other code.
94
-
95
- ## Accessibility
96
-
97
- A verification code renders a `<div>` with the label in a `<p>` and the code in a `<span>`. Screen readers read the label, then the code.
98
-
99
- ### Semantics
100
-
101
- * **Label (p):** Screen readers read the label before the code.
102
- * **Value (translate=no):** Browsers do not translate the code, and a click selects all of it.
103
-
104
- ### Your Responsibilities
105
-
106
- * **Keep the Code on Screen (SC 3.3.8):** Show the code until the sign-in finishes, so people can compare it.
107
-
108
- ## Related
109
-
110
- [OtpField](otp-field.md)
111
-
112
- Use for a code that a person types.
113
-
114
- [Snippet](snippet.md)
115
-
116
- Use for a command or a value to copy.