@tempoxyz/ds 0.3.10 → 0.3.11

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 (120) hide show
  1. package/dist/docs/AGENTS.md +9 -0
  2. package/dist/docs/components/accordion.md +489 -0
  3. package/dist/docs/components/address-card.md +147 -0
  4. package/dist/docs/components/agent-logo.md +194 -0
  5. package/dist/docs/components/alert-dialog.md +631 -0
  6. package/dist/docs/components/alert.md +448 -0
  7. package/dist/docs/components/amount-input.md +305 -0
  8. package/dist/docs/components/amount.md +794 -0
  9. package/dist/docs/components/app-shell.md +559 -0
  10. package/dist/docs/components/asset-chip.md +294 -0
  11. package/dist/docs/components/autocomplete.md +619 -0
  12. package/dist/docs/components/avatar.md +321 -0
  13. package/dist/docs/components/badge.md +339 -0
  14. package/dist/docs/components/badged-logo.md +116 -0
  15. package/dist/docs/components/banner.md +379 -0
  16. package/dist/docs/components/bar-chart.md +208 -0
  17. package/dist/docs/components/breadcrumbs.md +380 -0
  18. package/dist/docs/components/button-group.md +286 -0
  19. package/dist/docs/components/button.md +650 -0
  20. package/dist/docs/components/calendar.md +375 -0
  21. package/dist/docs/components/callout.md +96 -0
  22. package/dist/docs/components/checkbox-group.md +521 -0
  23. package/dist/docs/components/checkbox.md +467 -0
  24. package/dist/docs/components/choice-group.md +516 -0
  25. package/dist/docs/components/choicebox.md +641 -0
  26. package/dist/docs/components/code.md +100 -0
  27. package/dist/docs/components/combobox.md +939 -0
  28. package/dist/docs/components/container.md +257 -0
  29. package/dist/docs/components/copy-button.md +642 -0
  30. package/dist/docs/components/date-picker.md +514 -0
  31. package/dist/docs/components/dialog.md +1332 -0
  32. package/dist/docs/components/drawer.md +966 -0
  33. package/dist/docs/components/empty.md +340 -0
  34. package/dist/docs/components/field.md +570 -0
  35. package/dist/docs/components/fieldset.md +398 -0
  36. package/dist/docs/components/frame.md +434 -0
  37. package/dist/docs/components/gauge.md +299 -0
  38. package/dist/docs/components/get-started-visual.md +117 -0
  39. package/dist/docs/components/grid.md +288 -0
  40. package/dist/docs/components/hero-visual.md +155 -0
  41. package/dist/docs/components/hex.md +487 -0
  42. package/dist/docs/components/icon-tile.md +292 -0
  43. package/dist/docs/components/identicon.md +371 -0
  44. package/dist/docs/components/inline.md +233 -0
  45. package/dist/docs/components/inset.md +225 -0
  46. package/dist/docs/components/kbd.md +423 -0
  47. package/dist/docs/components/list-group.md +981 -0
  48. package/dist/docs/components/loading-dots.md +237 -0
  49. package/dist/docs/components/menu.md +934 -0
  50. package/dist/docs/components/native-select.md +204 -0
  51. package/dist/docs/components/network-logo.md +248 -0
  52. package/dist/docs/components/number-field.md +543 -0
  53. package/dist/docs/components/otp-field.md +616 -0
  54. package/dist/docs/components/pagination.md +516 -0
  55. package/dist/docs/components/popover.md +544 -0
  56. package/dist/docs/components/progress.md +388 -0
  57. package/dist/docs/components/qr.md +314 -0
  58. package/dist/docs/components/radio-group.md +528 -0
  59. package/dist/docs/components/secret-value.md +406 -0
  60. package/dist/docs/components/select.md +751 -0
  61. package/dist/docs/components/separator.md +379 -0
  62. package/dist/docs/components/sidebar-menu.md +922 -0
  63. package/dist/docs/components/skeleton.md +517 -0
  64. package/dist/docs/components/slider.md +539 -0
  65. package/dist/docs/components/snippet.md +424 -0
  66. package/dist/docs/components/spinner.md +216 -0
  67. package/dist/docs/components/split-bar.md +139 -0
  68. package/dist/docs/components/split-button.md +464 -0
  69. package/dist/docs/components/stack.md +299 -0
  70. package/dist/docs/components/status-chip.md +226 -0
  71. package/dist/docs/components/status-indicator.md +119 -0
  72. package/dist/docs/components/status-row.md +174 -0
  73. package/dist/docs/components/stepper.md +451 -0
  74. package/dist/docs/components/success-hero.md +157 -0
  75. package/dist/docs/components/surface.md +639 -0
  76. package/dist/docs/components/switch.md +472 -0
  77. package/dist/docs/components/table.md +967 -0
  78. package/dist/docs/components/tabs.md +627 -0
  79. package/dist/docs/components/tempo-logo.md +185 -0
  80. package/dist/docs/components/text-input.md +624 -0
  81. package/dist/docs/components/textarea.md +352 -0
  82. package/dist/docs/components/toast.md +535 -0
  83. package/dist/docs/components/token-logo.md +371 -0
  84. package/dist/docs/components/token.md +247 -0
  85. package/dist/docs/components/tooltip.md +490 -0
  86. package/dist/docs/components/verification-code.md +116 -0
  87. package/dist/docs/components/visual.md +249 -0
  88. package/dist/docs/components.md +203 -0
  89. package/dist/docs/foundations/accessibility.md +377 -0
  90. package/dist/docs/foundations/agents.md +150 -0
  91. package/dist/docs/foundations/color.md +522 -0
  92. package/dist/docs/foundations/content/tone.md +194 -0
  93. package/dist/docs/foundations/content/voice.md +194 -0
  94. package/dist/docs/foundations/content/writing-style.md +406 -0
  95. package/dist/docs/foundations/iconography.md +282 -0
  96. package/dist/docs/foundations/intent.md +360 -0
  97. package/dist/docs/foundations/layout.md +508 -0
  98. package/dist/docs/foundations/linter.md +296 -0
  99. package/dist/docs/foundations/motion.md +151 -0
  100. package/dist/docs/foundations/radius-and-padding.md +86 -0
  101. package/dist/docs/foundations/typography.md +266 -0
  102. package/dist/docs/index.md +137 -0
  103. package/dist/docs/introduction/faq.md +132 -0
  104. package/dist/docs/introduction/getting-started.md +377 -0
  105. package/dist/docs/patterns/blockchain-values.md +709 -0
  106. package/dist/docs/patterns/dashboards.md +638 -0
  107. package/dist/docs/patterns/destructive-actions.md +626 -0
  108. package/dist/docs/patterns/empty-states.md +612 -0
  109. package/dist/docs/patterns/errors-and-validation.md +808 -0
  110. package/dist/docs/patterns/feedback-and-status.md +518 -0
  111. package/dist/docs/patterns/forms.md +679 -0
  112. package/dist/docs/patterns/loading.md +630 -0
  113. package/dist/docs/patterns/navigation.md +397 -0
  114. package/dist/docs/patterns/payments.md +765 -0
  115. package/dist/docs/patterns/responsive-layout.md +997 -0
  116. package/dist/docs/patterns/tables-and-lists.md +964 -0
  117. package/dist/docs/products/tempo-console.md +671 -0
  118. package/dist/docs/products/tempo-performance.md +437 -0
  119. package/dist/docs/products/tempo-wallet.md +438 -0
  120. package/package.json +1 -1
@@ -0,0 +1,406 @@
1
+ # SecretValue
2
+
3
+ Masks a secret and adds reveal and copy buttons.
4
+
5
+ [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/SecretValue.tsx)
6
+
7
+ ## Overview
8
+
9
+ SecretValue masks a secret behind 16 dots and adds reveal and copy buttons. A click anywhere on the block copies the value without revealing it.
10
+
11
+ ## Examples
12
+
13
+ ### Basic
14
+
15
+ ```tsx
16
+ import { SecretValue, style } from '@tempoxyz/ds'
17
+
18
+ export const fill = true
19
+ export function Demo() {
20
+ return (
21
+ <SecretValue label="API key" value="sk_demo_4eC39HqLyjWDarjtT1zdp7dc" {...styles.value()} />
22
+ )
23
+ }
24
+
25
+ namespace styles {
26
+ export const value = style({ maxWidth: '28rem !custom' })
27
+ }
28
+ ```
29
+
30
+ [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/SecretValue/Basic.tsx)
31
+
32
+ ### Size
33
+
34
+ Set `size` to `small`, `medium` (default), or `large`.
35
+
36
+ ```tsx
37
+ import { SecretValue, style } from '@tempoxyz/ds'
38
+
39
+ export function Demo() {
40
+ return (
41
+ <div {...styles.column()}>
42
+ {(['small', 'medium', 'large'] as const).map((size) => (
43
+ <SecretValue
44
+ key={size}
45
+ label="API key"
46
+ size={size}
47
+ value="sk_demo_4eC39HqLyjWDarjtT1zdp7dc"
48
+ />
49
+ ))}
50
+ </div>
51
+ )
52
+ }
53
+
54
+ namespace styles {
55
+ export const column = style({
56
+ display: 'grid',
57
+ gap: '12',
58
+ gridTemplateColumns: 'minmax(0, 28rem) !custom',
59
+ })
60
+ }
61
+ ```
62
+
63
+ [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/SecretValue/Size.tsx)
64
+
65
+ ### DefaultRevealed
66
+
67
+ Set `defaultRevealed` to start with the value shown.
68
+
69
+ ```tsx
70
+ import { SecretValue, style } from '@tempoxyz/ds'
71
+
72
+ export const fill = true
73
+ export function Demo() {
74
+ return (
75
+ <SecretValue
76
+ defaultRevealed
77
+ label="API key"
78
+ value="sk_demo_4eC39HqLyjWDarjtT1zdp7dc"
79
+ {...styles.value()}
80
+ />
81
+ )
82
+ }
83
+
84
+ namespace styles {
85
+ export const value = style({ maxWidth: '28rem !custom' })
86
+ }
87
+ ```
88
+
89
+ [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/SecretValue/DefaultRevealed.tsx)
90
+
91
+ ## Anatomy
92
+
93
+ Import the component and assemble its parts.
94
+
95
+ ```tsx
96
+ import { SecretValue } from '@tempoxyz/ds'
97
+
98
+ <SecretValue />
99
+ ```
100
+
101
+ ## Guidelines
102
+
103
+ ### When to Use
104
+
105
+ * Show an API key, webhook signing secret, or access key that people copy into another system.
106
+ * Show a recovery key that people must store, behind an explicit reveal.
107
+
108
+ ### When Not to Use
109
+
110
+ * Use [Snippet](/docs/components/snippet) for commands and values that are not secret, such as a webhook URL.
111
+ * Use [Hex](/docs/components/hex) with `copy` for public addresses and transaction hashes.
112
+ * Use [TextInput](/docs/components/text-input) with `type="password"` when people enter a secret.
113
+
114
+ ### Start Masked
115
+
116
+ Keep the value hidden until someone presses Reveal. Copy works without a reveal, and anyone near the screen or in a screen share can read a revealed value.
117
+
118
+ * **`defaultRevealed`:** Set it only on a screen that exists to show the value, such as a key creation confirmation.
119
+ * **Mask again:** Control `revealed` with `onRevealedChange` to mask the value again, such as when the tab is hidden or after a minute.
120
+
121
+ **Do:** Show the secret masked, with its name above it.
122
+
123
+ ```tsx
124
+ /** Do example for "Start Masked" on the SecretValue page: show the secret masked, with its name above it. @module */
125
+ import { SecretValue, style } from '@tempoxyz/ds'
126
+
127
+ /** Renders the static preview, which the guideline card shows inert. */
128
+ export function Demo() {
129
+ return (
130
+ <div {...styles.field()}>
131
+ <span {...styles.label()}>Production API key</span>
132
+ <SecretValue label="Production API key" value="tk_live_9fA2c81bE07d4c55a3e6" />
133
+ </div>
134
+ )
135
+ }
136
+
137
+ namespace styles {
138
+ export const field = style({ display: 'grid', gap: '8', width: '100% !custom' })
139
+
140
+ export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
141
+ }
142
+ ```
143
+
144
+ **Don't:** Reveal a secret by default on a page people return to, such as a key list.
145
+
146
+ ```tsx
147
+ /**
148
+ * Don't example for "Start Masked" on the SecretValue page.
149
+ * Don't reveal a secret by default on a page people return to, such as a key list.
150
+ * @module
151
+ */
152
+ import { SecretValue, style } from '@tempoxyz/ds'
153
+
154
+ /** Renders the static preview, which the guideline card shows inert. */
155
+ export function Demo() {
156
+ return (
157
+ <div {...styles.field()}>
158
+ <span {...styles.label()}>Production API key</span>
159
+ <SecretValue
160
+ defaultRevealed
161
+ label="Production API key"
162
+ value="tk_live_9fA2c81bE07d4c55a3e6"
163
+ />
164
+ </div>
165
+ )
166
+ }
167
+
168
+ namespace styles {
169
+ export const field = style({ display: 'grid', gap: '8', width: '100% !custom' })
170
+
171
+ export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
172
+ }
173
+ ```
174
+
175
+ ### Name Every Secret
176
+
177
+ `label` sets the group's `aria-label`, which gives each button context. It is not visible. The mask is always 16 dots, so it can't tell keys apart either.
178
+
179
+ **Do:** Show what each key unlocks above it, with a creation or last used date.
180
+
181
+ ```tsx
182
+ /**
183
+ * Do example for "Name Every Secret" on the SecretValue page.
184
+ * Show what each key unlocks above it, with a creation or last used date.
185
+ * @module
186
+ */
187
+ import { SecretValue, style } from '@tempoxyz/ds'
188
+
189
+ /** Renders the static preview, which the guideline card shows inert. */
190
+ export function Demo() {
191
+ return (
192
+ <div {...styles.list()}>
193
+ <div {...styles.field()}>
194
+ <div {...styles.header()}>
195
+ <span {...styles.label()}>Production API key</span>
196
+ <span {...styles.meta()}>Last used 2 hours ago</span>
197
+ </div>
198
+ <SecretValue label="Production API key" size="small" value="tk_live_9fA2c81bE07d4c55a3e6" />
199
+ </div>
200
+ <div {...styles.field()}>
201
+ <div {...styles.header()}>
202
+ <span {...styles.label()}>Staging API key</span>
203
+ <span {...styles.meta()}>Created Oct 2</span>
204
+ </div>
205
+ <SecretValue label="Staging API key" size="small" value="tk_test_41bD7e0aC93f2d18b6c5" />
206
+ </div>
207
+ </div>
208
+ )
209
+ }
210
+
211
+ namespace styles {
212
+ export const field = style({ display: 'grid', gap: '8' })
213
+
214
+ export const header = style({
215
+ alignItems: 'baseline',
216
+ display: 'flex',
217
+ gap: '12',
218
+ justifyContent: 'space-between',
219
+ })
220
+
221
+ export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
222
+
223
+ export const list = style({ display: 'grid', gap: '16', width: '100% !custom' })
224
+
225
+ export const meta = style({ color: 'content.secondary', typography: 'body.b3' })
226
+ }
227
+ ```
228
+
229
+ **Don't:** Leave people to tell keys apart by revealing them.
230
+
231
+ ```tsx
232
+ /**
233
+ * Don't example for "Name Every Secret" on the SecretValue page.
234
+ * Don't leave people to tell keys apart by revealing them.
235
+ * @module
236
+ */
237
+ import { SecretValue, style } from '@tempoxyz/ds'
238
+
239
+ /** Renders the static preview, which the guideline card shows inert. */
240
+ export function Demo() {
241
+ return (
242
+ <div {...styles.list()}>
243
+ <SecretValue label="Production API key" size="small" value="tk_live_9fA2c81bE07d4c55a3e6" />
244
+ <SecretValue label="Staging API key" size="small" value="tk_test_41bD7e0aC93f2d18b6c5" />
245
+ </div>
246
+ )
247
+ }
248
+
249
+ namespace styles {
250
+ export const list = style({ display: 'grid', gap: '16', width: '100% !custom' })
251
+ }
252
+ ```
253
+
254
+ ### Keep Each Secret on One Line
255
+
256
+ The value does not wrap, and a long revealed value scrolls horizontally.
257
+
258
+ **Do:** Give a recovery phrase of 12 or 24 words its own numbered layout, behind the same explicit
259
+ reveal.
260
+
261
+ ```tsx
262
+ /**
263
+ * Do example for "Keep Each Secret on One Line" on the SecretValue page.
264
+ * Give a recovery phrase of 12 or 24 words its own numbered layout, behind the same explicit reveal.
265
+ * @module
266
+ */
267
+ import { style } from '@tempoxyz/ds'
268
+
269
+ const words = [
270
+ 'orbit',
271
+ 'maple',
272
+ 'ledger',
273
+ 'canyon',
274
+ 'velvet',
275
+ 'harbor',
276
+ 'quartz',
277
+ 'ember',
278
+ 'signal',
279
+ 'meadow',
280
+ 'falcon',
281
+ 'summit',
282
+ ] as const
283
+
284
+ /** Renders the static preview, which the guideline card shows inert. */
285
+ export function Demo() {
286
+ return (
287
+ <div {...styles.field()}>
288
+ <span {...styles.label()}>Recovery phrase</span>
289
+ <ol {...styles.grid()}>
290
+ {words.map((word, index) => (
291
+ <li key={word} {...styles.word()}>
292
+ <span {...styles.index()}>{index + 1}</span>
293
+ {word}
294
+ </li>
295
+ ))}
296
+ </ol>
297
+ </div>
298
+ )
299
+ }
300
+
301
+ namespace styles {
302
+ export const field = style({ display: 'grid', gap: '8', width: '100% !custom' })
303
+
304
+ export const grid = style({
305
+ display: 'grid',
306
+ gap: '8',
307
+ gridTemplateColumns: 'repeat(3, 1fr) !custom',
308
+ listStyle: 'none',
309
+ margin: '0',
310
+ padding: '0',
311
+ })
312
+
313
+ export const index = style({ color: 'content.secondary', minWidth: '1.25rem !custom' })
314
+
315
+ export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
316
+
317
+ export const word = style({
318
+ backgroundColor: 'container.regular',
319
+ borderRadius: '2xs',
320
+ color: 'content.primary',
321
+ display: 'flex',
322
+ gap: '4',
323
+ padding: '8',
324
+ typography: 'mono.m1',
325
+ })
326
+ }
327
+ ```
328
+
329
+ **Don't:** Put a recovery phrase in one scrolling line.
330
+
331
+ ```tsx
332
+ /**
333
+ * Don't example for "Keep Each Secret on One Line" on the SecretValue page.
334
+ * Don't put a recovery phrase in one scrolling line.
335
+ * @module
336
+ */
337
+ import { SecretValue, style } from '@tempoxyz/ds'
338
+
339
+ /** Renders the static preview, which the guideline card shows inert. */
340
+ export function Demo() {
341
+ return (
342
+ <div {...styles.field()}>
343
+ <span {...styles.label()}>Recovery phrase</span>
344
+ <SecretValue
345
+ defaultRevealed
346
+ label="Recovery phrase"
347
+ value="orbit maple ledger canyon velvet harbor quartz ember signal meadow falcon summit"
348
+ />
349
+ </div>
350
+ )
351
+ }
352
+
353
+ namespace styles {
354
+ export const field = style({ display: 'grid', gap: '8', width: '100% !custom' })
355
+
356
+ export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
357
+ }
358
+ ```
359
+
360
+ ## Content
361
+
362
+ * **Visibility:** If a key is shown once, write Store this key now. You can't view it again.
363
+ * **Leaks:** Link to the replacement action, such as Rotate key.
364
+
365
+ ## Accessibility
366
+
367
+ SecretValue renders a named `group` with a masked `<code>` value, a reveal toggle, and a copy button. Both buttons follow the [WAI-ARIA Authoring Practices button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/).
368
+
369
+ ### Semantics
370
+
371
+ * **Root (group):** Takes its name from the `label` prop.
372
+ * **Value (16 dots):** Screen readers read the dots, never the secret. The mask hides the length and blocks selection.
373
+ * **Reveal Button (aria-pressed):** A native button named "Reveal" that reports whether the secret is shown.
374
+ * **Copy Button (button):** A native button named "Copy". It reads "Copied" for two seconds, and a polite status region announces each copy.
375
+ * **Pointer Shortcut (click):** A click on the block copies without a reveal. Keyboard users use the copy button.
376
+
377
+ ### Keyboard
378
+
379
+ * **Move Between Buttons (Tab):** Moves focus to the reveal button, then to the copy button. The value takes no focus.
380
+ * **Reveal or Copy (Enter or Space):** The reveal button shows or hides the secret. The copy button copies it. Focus stays on the pressed button.
381
+
382
+ ### Your Responsibilities
383
+
384
+ * **Allow Paste (SC 3.3.8):** Do not block paste where people use the secret. [Accessible authentication](https://www.w3.org/WAI/WCAG22/Understanding/accessible-authentication-minimum.html) relies on it.
385
+
386
+ ## Related
387
+
388
+ [Snippet](/docs/components/snippet)
389
+
390
+ Use for values that aren't secret.
391
+
392
+ [CopyButton](/docs/components/copy-button)
393
+
394
+ Use for copying beside your own layout.
395
+
396
+ [TextInput](/docs/components/text-input)
397
+
398
+ Use for entering a secret.
399
+
400
+ [Destructive Actions](/docs/patterns/destructive-actions)
401
+
402
+ Covers revoking and rotating keys.
403
+
404
+ [Tempo Console](/docs/products/tempo-console)
405
+
406
+ Covers API key screens.