@tempoxyz/ds 0.3.10 → 0.3.13
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.
- package/README.md +7 -6
- package/dist/docs/AGENTS.md +12 -0
- package/dist/docs/index.md +145 -0
- package/dist/docs/marketing/introduction/getting-started.md +241 -0
- package/dist/docs/product/components/accordion.md +489 -0
- package/dist/docs/product/components/address-card.md +147 -0
- package/dist/docs/product/components/agent-logo.md +194 -0
- package/dist/docs/product/components/alert-dialog.md +631 -0
- package/dist/docs/product/components/alert.md +448 -0
- package/dist/docs/product/components/amount-input.md +305 -0
- package/dist/docs/product/components/amount.md +794 -0
- package/dist/docs/product/components/app-shell.md +559 -0
- package/dist/docs/product/components/asset-chip.md +294 -0
- package/dist/docs/product/components/autocomplete.md +620 -0
- package/dist/docs/product/components/avatar.md +321 -0
- package/dist/docs/product/components/badge.md +339 -0
- package/dist/docs/product/components/badged-logo.md +116 -0
- package/dist/docs/product/components/banner.md +379 -0
- package/dist/docs/product/components/bar-chart.md +208 -0
- package/dist/docs/product/components/breadcrumbs.md +380 -0
- package/dist/docs/product/components/button-group.md +286 -0
- package/dist/docs/product/components/button.md +650 -0
- package/dist/docs/product/components/calendar.md +375 -0
- package/dist/docs/product/components/callout.md +96 -0
- package/dist/docs/product/components/checkbox-group.md +521 -0
- package/dist/docs/product/components/checkbox.md +467 -0
- package/dist/docs/product/components/choice-group.md +516 -0
- package/dist/docs/product/components/choicebox.md +641 -0
- package/dist/docs/product/components/code.md +100 -0
- package/dist/docs/product/components/combobox.md +939 -0
- package/dist/docs/product/components/container.md +257 -0
- package/dist/docs/product/components/copy-button.md +642 -0
- package/dist/docs/product/components/date-picker.md +514 -0
- package/dist/docs/product/components/dialog.md +1332 -0
- package/dist/docs/product/components/drawer.md +966 -0
- package/dist/docs/product/components/empty.md +340 -0
- package/dist/docs/product/components/field.md +570 -0
- package/dist/docs/product/components/fieldset.md +398 -0
- package/dist/docs/product/components/frame.md +434 -0
- package/dist/docs/product/components/gauge.md +299 -0
- package/dist/docs/product/components/get-started-visual.md +117 -0
- package/dist/docs/product/components/grid.md +288 -0
- package/dist/docs/product/components/hero-visual.md +155 -0
- package/dist/docs/product/components/hex.md +487 -0
- package/dist/docs/product/components/icon-tile.md +292 -0
- package/dist/docs/product/components/identicon.md +371 -0
- package/dist/docs/product/components/inline.md +233 -0
- package/dist/docs/product/components/inset.md +225 -0
- package/dist/docs/product/components/kbd.md +423 -0
- package/dist/docs/product/components/list-group.md +981 -0
- package/dist/docs/product/components/loading-dots.md +237 -0
- package/dist/docs/product/components/menu.md +934 -0
- package/dist/docs/product/components/native-select.md +204 -0
- package/dist/docs/product/components/network-logo.md +248 -0
- package/dist/docs/product/components/number-field.md +543 -0
- package/dist/docs/product/components/otp-field.md +616 -0
- package/dist/docs/product/components/pagination.md +516 -0
- package/dist/docs/product/components/popover.md +544 -0
- package/dist/docs/product/components/progress.md +388 -0
- package/dist/docs/product/components/qr.md +314 -0
- package/dist/docs/product/components/radio-group.md +528 -0
- package/dist/docs/product/components/secret-value.md +406 -0
- package/dist/docs/product/components/select.md +751 -0
- package/dist/docs/product/components/separator.md +379 -0
- package/dist/docs/product/components/sidebar-menu.md +922 -0
- package/dist/docs/product/components/skeleton.md +517 -0
- package/dist/docs/product/components/slider.md +539 -0
- package/dist/docs/product/components/snippet.md +424 -0
- package/dist/docs/product/components/spinner.md +216 -0
- package/dist/docs/product/components/split-bar.md +139 -0
- package/dist/docs/product/components/split-button.md +464 -0
- package/dist/docs/product/components/stack.md +299 -0
- package/dist/docs/product/components/status-chip.md +226 -0
- package/dist/docs/product/components/status-indicator.md +119 -0
- package/dist/docs/product/components/status-row.md +174 -0
- package/dist/docs/product/components/stepper.md +451 -0
- package/dist/docs/product/components/success-hero.md +157 -0
- package/dist/docs/product/components/surface.md +639 -0
- package/dist/docs/product/components/switch.md +472 -0
- package/dist/docs/product/components/table.md +967 -0
- package/dist/docs/product/components/tabs.md +627 -0
- package/dist/docs/product/components/tempo-logo.md +185 -0
- package/dist/docs/product/components/text-input.md +624 -0
- package/dist/docs/product/components/textarea.md +352 -0
- package/dist/docs/product/components/toast.md +535 -0
- package/dist/docs/product/components/token-logo.md +371 -0
- package/dist/docs/product/components/token.md +247 -0
- package/dist/docs/product/components/tooltip.md +490 -0
- package/dist/docs/product/components/verification-code.md +116 -0
- package/dist/docs/product/components/visual.md +249 -0
- package/dist/docs/product/components.md +203 -0
- package/dist/docs/product/foundations/accessibility.md +377 -0
- package/dist/docs/product/foundations/agents.md +150 -0
- package/dist/docs/product/foundations/color.md +522 -0
- package/dist/docs/product/foundations/content/tone.md +194 -0
- package/dist/docs/product/foundations/content/voice.md +194 -0
- package/dist/docs/product/foundations/content/writing-style.md +406 -0
- package/dist/docs/product/foundations/iconography.md +282 -0
- package/dist/docs/product/foundations/intent.md +360 -0
- package/dist/docs/product/foundations/layout.md +508 -0
- package/dist/docs/product/foundations/linter.md +496 -0
- package/dist/docs/product/foundations/motion.md +151 -0
- package/dist/docs/product/foundations/radius-and-padding.md +86 -0
- package/dist/docs/product/foundations/typography.md +266 -0
- package/dist/docs/product/introduction/faq.md +133 -0
- package/dist/docs/product/introduction/getting-started.md +377 -0
- package/dist/docs/product/patterns/blockchain-values.md +709 -0
- package/dist/docs/product/patterns/dashboards.md +638 -0
- package/dist/docs/product/patterns/destructive-actions.md +626 -0
- package/dist/docs/product/patterns/empty-states.md +612 -0
- package/dist/docs/product/patterns/errors-and-validation.md +808 -0
- package/dist/docs/product/patterns/feedback-and-status.md +518 -0
- package/dist/docs/product/patterns/forms.md +679 -0
- package/dist/docs/product/patterns/loading.md +630 -0
- package/dist/docs/product/patterns/navigation.md +397 -0
- package/dist/docs/product/patterns/payments.md +765 -0
- package/dist/docs/product/patterns/responsive-layout.md +997 -0
- package/dist/docs/product/patterns/tables-and-lists.md +964 -0
- package/dist/docs/product/products/tempo-console.md +671 -0
- package/dist/docs/product/products/tempo-performance.md +437 -0
- package/dist/docs/product/products/tempo-wallet.md +438 -0
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.d.ts.map +1 -0
- package/dist/marketing/index.js +4 -0
- package/dist/marketing/index.js.map +1 -0
- package/dist/marketing/index.js.zyzz.json +1 -0
- package/dist/marketing/vars.d.ts +907 -0
- package/dist/marketing/vars.d.ts.map +1 -0
- package/dist/marketing/vars.js +15 -0
- package/dist/marketing/vars.js.map +1 -0
- package/dist/marketing/vars.js.zyzz.json +1 -0
- package/dist/marketing/zyzz.config.d.ts +4512 -0
- package/dist/marketing/zyzz.config.d.ts.map +1 -0
- package/dist/marketing/zyzz.config.js +63 -0
- package/dist/marketing/zyzz.config.js.map +1 -0
- package/dist/marketing/zyzz.config.js.zyzz.json +1 -0
- package/dist/oxlint/index.d.ts +12 -1
- package/dist/oxlint/index.d.ts.map +1 -1
- package/dist/oxlint/index.js +39 -1
- package/dist/oxlint/index.js.map +1 -1
- package/dist/oxlint/internal/Docs.d.ts +9 -0
- package/dist/oxlint/internal/Docs.d.ts.map +1 -0
- package/dist/oxlint/internal/Docs.js +15 -0
- package/dist/oxlint/internal/Docs.js.map +1 -0
- package/dist/oxlint/internal/Imports.d.ts +1 -1
- package/dist/oxlint/internal/Imports.d.ts.map +1 -1
- package/dist/oxlint/internal/Imports.js +2 -0
- package/dist/oxlint/internal/Imports.js.map +1 -1
- package/dist/oxlint/internal/Styles.d.ts +40 -0
- package/dist/oxlint/internal/Styles.d.ts.map +1 -0
- package/dist/oxlint/internal/Styles.js +194 -0
- package/dist/oxlint/internal/Styles.js.map +1 -0
- package/dist/oxlint/internal/Tokens.d.ts +16 -0
- package/dist/oxlint/internal/Tokens.d.ts.map +1 -0
- package/dist/oxlint/internal/Tokens.js +39 -0
- package/dist/oxlint/internal/Tokens.js.map +1 -0
- package/dist/oxlint/rules/NoCrossSurface.d.ts +2 -2
- package/dist/oxlint/rules/NoCrossSurface.js +3 -3
- package/dist/oxlint/rules/NoCrossSurface.js.map +1 -1
- package/dist/oxlint/rules/NoCustomValues.d.ts +11 -0
- package/dist/oxlint/rules/NoCustomValues.d.ts.map +1 -0
- package/dist/oxlint/rules/NoCustomValues.js +150 -0
- package/dist/oxlint/rules/NoCustomValues.js.map +1 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.d.ts +11 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.d.ts.map +1 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.js +158 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.js.map +1 -0
- package/dist/oxlint/rules/PreferComponent.d.ts +3 -2
- package/dist/oxlint/rules/PreferComponent.d.ts.map +1 -1
- package/dist/oxlint/rules/PreferComponent.js +11 -4
- package/dist/oxlint/rules/PreferComponent.js.map +1 -1
- package/dist/oxlint/rules/PreferLayout.d.ts +9 -0
- package/dist/oxlint/rules/PreferLayout.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferLayout.js +90 -0
- package/dist/oxlint/rules/PreferLayout.js.map +1 -0
- package/dist/oxlint/rules/PreferProgress.d.ts +9 -0
- package/dist/oxlint/rules/PreferProgress.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferProgress.js +43 -0
- package/dist/oxlint/rules/PreferProgress.js.map +1 -0
- package/dist/oxlint/rules/PreferSurface.d.ts +9 -0
- package/dist/oxlint/rules/PreferSurface.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferSurface.js +55 -0
- package/dist/oxlint/rules/PreferSurface.js.map +1 -0
- package/dist/oxlint/rules/RequireAccessibleName.d.ts.map +1 -1
- package/dist/oxlint/rules/RequireAccessibleName.js +3 -1
- package/dist/oxlint/rules/RequireAccessibleName.js.map +1 -1
- package/dist/oxlint/rules/RequireScrollRegion.d.ts +11 -0
- package/dist/oxlint/rules/RequireScrollRegion.d.ts.map +1 -0
- package/dist/oxlint/rules/RequireScrollRegion.js +71 -0
- package/dist/oxlint/rules/RequireScrollRegion.js.map +1 -0
- package/dist/web/icons/index.js.zyzz.json +1 -0
- package/package.json +6 -1
- package/src/marketing/README.md +21 -0
- package/src/marketing/index.ts +3 -0
- package/src/marketing/vars.ts +751 -0
- package/src/marketing/zyzz.config.ts +376 -0
- package/src/oxlint/index.ts +40 -1
- package/src/oxlint/internal/Docs.ts +18 -0
- package/src/oxlint/internal/Imports.ts +2 -1
- package/src/oxlint/internal/Styles.ts +240 -0
- package/src/oxlint/internal/Tokens.ts +43 -0
- package/src/oxlint/rules/NoCrossSurface.ts +3 -3
- package/src/oxlint/rules/NoCustomValues.ts +170 -0
- package/src/oxlint/rules/NoSingleKeyShortcuts.ts +190 -0
- package/src/oxlint/rules/PreferComponent.ts +11 -4
- package/src/oxlint/rules/PreferLayout.ts +96 -0
- package/src/oxlint/rules/PreferProgress.ts +49 -0
- package/src/oxlint/rules/PreferSurface.ts +70 -0
- package/src/oxlint/rules/RequireAccessibleName.ts +3 -1
- package/src/oxlint/rules/RequireScrollRegion.ts +92 -0
|
@@ -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](snippet.md) for commands and values that are not secret, such as a webhook URL.
|
|
111
|
+
* Use [Hex](hex.md) with `copy` for public addresses and transaction hashes.
|
|
112
|
+
* Use [TextInput](text-input.md) 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](snippet.md)
|
|
389
|
+
|
|
390
|
+
Use for values that aren't secret.
|
|
391
|
+
|
|
392
|
+
[CopyButton](copy-button.md)
|
|
393
|
+
|
|
394
|
+
Use for copying beside your own layout.
|
|
395
|
+
|
|
396
|
+
[TextInput](text-input.md)
|
|
397
|
+
|
|
398
|
+
Use for entering a secret.
|
|
399
|
+
|
|
400
|
+
[Destructive Actions](../patterns/destructive-actions.md)
|
|
401
|
+
|
|
402
|
+
Covers revoking and rotating keys.
|
|
403
|
+
|
|
404
|
+
[Tempo Console](../products/tempo-console.md)
|
|
405
|
+
|
|
406
|
+
Covers API key screens.
|