@tempoxyz/ds 0.3.14 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/docs/AGENTS.md +73 -10
  2. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +28 -20
  3. package/dist/docs/product/components/actions.md +2058 -0
  4. package/dist/docs/product/components/blockchain.md +3825 -0
  5. package/dist/docs/product/components/data-display.md +5901 -0
  6. package/dist/docs/product/components/feedback-and-status.md +4008 -0
  7. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  8. package/dist/docs/product/components/layout.md +3339 -0
  9. package/dist/docs/product/components/navigation.md +2914 -0
  10. package/dist/docs/product/components/overlays.md +4917 -0
  11. package/dist/docs/product/components.md +125 -125
  12. package/dist/docs/product/foundations.md +4596 -0
  13. package/dist/docs/product/patterns.md +10129 -0
  14. package/package.json +1 -1
  15. package/dist/docs/index.md +0 -145
  16. package/dist/docs/product/components/accordion.md +0 -489
  17. package/dist/docs/product/components/address-card.md +0 -147
  18. package/dist/docs/product/components/agent-logo.md +0 -194
  19. package/dist/docs/product/components/alert-dialog.md +0 -631
  20. package/dist/docs/product/components/alert.md +0 -448
  21. package/dist/docs/product/components/amount-input.md +0 -305
  22. package/dist/docs/product/components/amount.md +0 -794
  23. package/dist/docs/product/components/app-shell.md +0 -559
  24. package/dist/docs/product/components/asset-chip.md +0 -294
  25. package/dist/docs/product/components/autocomplete.md +0 -620
  26. package/dist/docs/product/components/avatar.md +0 -321
  27. package/dist/docs/product/components/badge.md +0 -339
  28. package/dist/docs/product/components/badged-logo.md +0 -116
  29. package/dist/docs/product/components/banner.md +0 -379
  30. package/dist/docs/product/components/bar-chart.md +0 -208
  31. package/dist/docs/product/components/breadcrumbs.md +0 -380
  32. package/dist/docs/product/components/button-group.md +0 -286
  33. package/dist/docs/product/components/button.md +0 -650
  34. package/dist/docs/product/components/calendar.md +0 -375
  35. package/dist/docs/product/components/callout.md +0 -96
  36. package/dist/docs/product/components/checkbox-group.md +0 -521
  37. package/dist/docs/product/components/checkbox.md +0 -467
  38. package/dist/docs/product/components/choice-group.md +0 -516
  39. package/dist/docs/product/components/choicebox.md +0 -641
  40. package/dist/docs/product/components/code.md +0 -100
  41. package/dist/docs/product/components/combobox.md +0 -939
  42. package/dist/docs/product/components/container.md +0 -257
  43. package/dist/docs/product/components/copy-button.md +0 -642
  44. package/dist/docs/product/components/date-picker.md +0 -514
  45. package/dist/docs/product/components/dialog.md +0 -1332
  46. package/dist/docs/product/components/drawer.md +0 -966
  47. package/dist/docs/product/components/empty.md +0 -340
  48. package/dist/docs/product/components/field.md +0 -570
  49. package/dist/docs/product/components/fieldset.md +0 -398
  50. package/dist/docs/product/components/frame.md +0 -434
  51. package/dist/docs/product/components/gauge.md +0 -299
  52. package/dist/docs/product/components/get-started-visual.md +0 -117
  53. package/dist/docs/product/components/grid.md +0 -288
  54. package/dist/docs/product/components/hero-visual.md +0 -155
  55. package/dist/docs/product/components/hex.md +0 -487
  56. package/dist/docs/product/components/icon-tile.md +0 -292
  57. package/dist/docs/product/components/identicon.md +0 -371
  58. package/dist/docs/product/components/inline.md +0 -233
  59. package/dist/docs/product/components/inset.md +0 -225
  60. package/dist/docs/product/components/kbd.md +0 -423
  61. package/dist/docs/product/components/list-group.md +0 -981
  62. package/dist/docs/product/components/loading-dots.md +0 -237
  63. package/dist/docs/product/components/menu.md +0 -934
  64. package/dist/docs/product/components/native-select.md +0 -204
  65. package/dist/docs/product/components/network-logo.md +0 -248
  66. package/dist/docs/product/components/number-field.md +0 -543
  67. package/dist/docs/product/components/otp-field.md +0 -616
  68. package/dist/docs/product/components/pagination.md +0 -516
  69. package/dist/docs/product/components/popover.md +0 -544
  70. package/dist/docs/product/components/progress.md +0 -388
  71. package/dist/docs/product/components/qr.md +0 -314
  72. package/dist/docs/product/components/radio-group.md +0 -528
  73. package/dist/docs/product/components/secret-value.md +0 -406
  74. package/dist/docs/product/components/select.md +0 -751
  75. package/dist/docs/product/components/separator.md +0 -379
  76. package/dist/docs/product/components/sidebar-menu.md +0 -922
  77. package/dist/docs/product/components/skeleton.md +0 -517
  78. package/dist/docs/product/components/slider.md +0 -539
  79. package/dist/docs/product/components/snippet.md +0 -424
  80. package/dist/docs/product/components/spinner.md +0 -216
  81. package/dist/docs/product/components/split-bar.md +0 -139
  82. package/dist/docs/product/components/split-button.md +0 -464
  83. package/dist/docs/product/components/stack.md +0 -299
  84. package/dist/docs/product/components/status-chip.md +0 -226
  85. package/dist/docs/product/components/status-indicator.md +0 -119
  86. package/dist/docs/product/components/status-row.md +0 -174
  87. package/dist/docs/product/components/stepper.md +0 -451
  88. package/dist/docs/product/components/success-hero.md +0 -157
  89. package/dist/docs/product/components/surface.md +0 -639
  90. package/dist/docs/product/components/switch.md +0 -472
  91. package/dist/docs/product/components/table.md +0 -968
  92. package/dist/docs/product/components/tabs.md +0 -627
  93. package/dist/docs/product/components/tempo-logo.md +0 -185
  94. package/dist/docs/product/components/text-input.md +0 -624
  95. package/dist/docs/product/components/textarea.md +0 -352
  96. package/dist/docs/product/components/toast.md +0 -535
  97. package/dist/docs/product/components/token-logo.md +0 -371
  98. package/dist/docs/product/components/token.md +0 -247
  99. package/dist/docs/product/components/tooltip.md +0 -490
  100. package/dist/docs/product/components/verification-code.md +0 -116
  101. package/dist/docs/product/components/visual.md +0 -249
  102. package/dist/docs/product/foundations/accessibility.md +0 -377
  103. package/dist/docs/product/foundations/agents.md +0 -159
  104. package/dist/docs/product/foundations/color.md +0 -522
  105. package/dist/docs/product/foundations/content/tone.md +0 -194
  106. package/dist/docs/product/foundations/content/voice.md +0 -194
  107. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  108. package/dist/docs/product/foundations/iconography.md +0 -282
  109. package/dist/docs/product/foundations/intent.md +0 -360
  110. package/dist/docs/product/foundations/layout.md +0 -508
  111. package/dist/docs/product/foundations/linter.md +0 -523
  112. package/dist/docs/product/foundations/motion.md +0 -151
  113. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  114. package/dist/docs/product/foundations/typography.md +0 -331
  115. package/dist/docs/product/introduction/faq.md +0 -133
  116. package/dist/docs/product/introduction/getting-started.md +0 -377
  117. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  118. package/dist/docs/product/patterns/dashboards.md +0 -638
  119. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  120. package/dist/docs/product/patterns/empty-states.md +0 -612
  121. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  122. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  123. package/dist/docs/product/patterns/forms.md +0 -679
  124. package/dist/docs/product/patterns/loading.md +0 -630
  125. package/dist/docs/product/patterns/navigation.md +0 -397
  126. package/dist/docs/product/patterns/payments.md +0 -765
  127. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  128. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  129. package/dist/docs/product/products/tempo-console.md +0 -671
  130. package/dist/docs/product/products/tempo-performance.md +0 -435
  131. package/dist/docs/product/products/tempo-wallet.md +0 -438
@@ -1,292 +0,0 @@
1
- # IconTile
2
-
3
- Anchors a centered modal with one icon in a rounded square.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/IconTile.tsx)
6
-
7
- Figma: [Elements/Icon Tile](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-1245)
8
-
9
- ## Overview
10
-
11
- An icon tile is a 56px rounded square with a 24px icon. It sits above the centered title of a modal, and `intent` tints it for the modal's outcome.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- import { IconTile } from '@tempoxyz/ds'
19
- import { Settings } from '@tempoxyz/ds/icons'
20
-
21
- export function Demo() {
22
- return (
23
- <IconTile>
24
- <Settings />
25
- </IconTile>
26
- )
27
- }
28
- ```
29
-
30
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/IconTile/Basic.tsx)
31
-
32
- ### Intent
33
-
34
- Set `intent` to `neutral` (default), `positive`, `warning`, or `negative`. Each tints the fill and the icon.
35
-
36
- ```tsx
37
- import { IconTile, style } from '@tempoxyz/ds'
38
- import { AlertTriangle, Check, Delete, Passkey } from '@tempoxyz/ds/icons'
39
-
40
- export function Demo() {
41
- return (
42
- <div {...styles.row()}>
43
- <IconTile intent="neutral">
44
- <Passkey />
45
- </IconTile>
46
- <IconTile intent="positive">
47
- <Check />
48
- </IconTile>
49
- <IconTile intent="warning">
50
- <AlertTriangle />
51
- </IconTile>
52
- <IconTile intent="negative">
53
- <Delete />
54
- </IconTile>
55
- </div>
56
- )
57
- }
58
-
59
- namespace styles {
60
- export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
61
- }
62
- ```
63
-
64
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/IconTile/Intent.tsx)
65
-
66
- ## Anatomy
67
-
68
- Import the component and assemble its parts.
69
-
70
- ```tsx
71
- import { IconTile } from '@tempoxyz/ds'
72
-
73
- <IconTile />
74
- ```
75
-
76
- ## Guidelines
77
-
78
- ### When to Use
79
-
80
- * Top a centered acknowledgment, onboarding, success, or destructive confirmation modal with one chip above the title.
81
-
82
- ### When Not to Use
83
-
84
- * Use [Avatar](avatar.md) with an icon to lead a list row, such as a wallet or app.
85
- * Use [Button](button.md) with `shape="icon"` for an icon that does something. The chip isn't interactive.
86
- * Use [Badge](badge.md) to show a status.
87
- * Use [Visual](visual.md) for an illustrated onboarding or feature modal. Never pair the two.
88
-
89
- ### Pair the Chip With a Title
90
-
91
- **Do:** Place the chip above a centered title that states the outcome.
92
-
93
- ```tsx
94
- /**
95
- * Do example for "Pair the Chip With a Title" on the IconTile page.
96
- * Place the chip above a centered title that states the outcome.
97
- * @module
98
- */
99
- import { IconTile, style } from '@tempoxyz/ds'
100
- import { Check } from '@tempoxyz/ds/icons'
101
-
102
- /** Renders the static preview, which the guideline card shows inert. */
103
- export function Demo() {
104
- return (
105
- <div {...styles.stack()}>
106
- <IconTile intent="positive">
107
- <Check />
108
- </IconTile>
109
- <span {...styles.title()}>Payment sent</span>
110
- <span {...styles.detail()}>Jane Cooper received 25.00 USDC.</span>
111
- </div>
112
- )
113
- }
114
-
115
- namespace styles {
116
- export const detail = style({ color: 'content.secondary', typography: 'body.b2' })
117
-
118
- export const stack = style({
119
- alignItems: 'center',
120
- display: 'flex',
121
- flexDirection: 'column',
122
- gap: '4',
123
- textAlign: 'center',
124
- width: '100% !custom',
125
- })
126
-
127
- export const title = style({
128
- color: 'content.primary',
129
- marginBlockStart: '20',
130
- typography: 'body.b1Strong',
131
- })
132
- }
133
- ```
134
-
135
- **Don't:** Rely on the chip alone to state the outcome.
136
-
137
- ```tsx
138
- /**
139
- * Don't example for "Pair the Chip With a Title" on the IconTile page.
140
- * Don't rely on the chip alone to state the outcome.
141
- * @module
142
- */
143
- import { IconTile, style } from '@tempoxyz/ds'
144
- import { Check } from '@tempoxyz/ds/icons'
145
-
146
- /** Renders the static preview, which the guideline card shows inert. */
147
- export function Demo() {
148
- return (
149
- <div {...styles.stack()}>
150
- <IconTile intent="positive">
151
- <Check />
152
- </IconTile>
153
- </div>
154
- )
155
- }
156
-
157
- namespace styles {
158
- export const stack = style({ display: 'flex', justifyContent: 'center', width: '100% !custom' })
159
- }
160
- ```
161
-
162
- ### Use One Icon From the Library
163
-
164
- The icon inherits the intent's color and the chip's 24px font size, so leave its size and color unset.
165
-
166
- **Do:** Pass one icon from `@tempoxyz/ds/icons`.
167
-
168
- ```tsx
169
- /**
170
- * Do example for "Pair the Chip With a Title" on the IconTile page.
171
- * Place the chip above a centered title that states the outcome.
172
- * @module
173
- */
174
- import { IconTile, style } from '@tempoxyz/ds'
175
- import { Check } from '@tempoxyz/ds/icons'
176
-
177
- /** Renders the static preview, which the guideline card shows inert. */
178
- export function Demo() {
179
- return (
180
- <div {...styles.stack()}>
181
- <IconTile intent="positive">
182
- <Check />
183
- </IconTile>
184
- <span {...styles.title()}>Payment sent</span>
185
- <span {...styles.detail()}>Jane Cooper received 25.00 USDC.</span>
186
- </div>
187
- )
188
- }
189
-
190
- namespace styles {
191
- export const detail = style({ color: 'content.secondary', typography: 'body.b2' })
192
-
193
- export const stack = style({
194
- alignItems: 'center',
195
- display: 'flex',
196
- flexDirection: 'column',
197
- gap: '4',
198
- textAlign: 'center',
199
- width: '100% !custom',
200
- })
201
-
202
- export const title = style({
203
- color: 'content.primary',
204
- marginBlockStart: '20',
205
- typography: 'body.b1Strong',
206
- })
207
- }
208
- ```
209
-
210
- **Don't:** Put text, numbers, or images in the chip.
211
-
212
- ```tsx
213
- /**
214
- * Don't example for "Use One Icon From the Library" on the IconTile page.
215
- * Don't put text, numbers, or images in the chip.
216
- * @module
217
- */
218
- import { IconTile, style } from '@tempoxyz/ds'
219
-
220
- /** Renders the static preview, which the guideline card shows inert. */
221
- export function Demo() {
222
- return (
223
- <div {...styles.stack()}>
224
- <IconTile intent="positive">OK</IconTile>
225
- <span {...styles.title()}>Payment sent</span>
226
- <span {...styles.detail()}>Jane Cooper received 25.00 USDC.</span>
227
- </div>
228
- )
229
- }
230
-
231
- namespace styles {
232
- export const detail = style({ color: 'content.secondary', typography: 'body.b2' })
233
-
234
- export const stack = style({
235
- alignItems: 'center',
236
- display: 'flex',
237
- flexDirection: 'column',
238
- gap: '4',
239
- textAlign: 'center',
240
- width: '100% !custom',
241
- })
242
-
243
- export const title = style({
244
- color: 'content.primary',
245
- marginBlockStart: '20',
246
- typography: 'body.b1Strong',
247
- })
248
- }
249
- ```
250
-
251
- ### Match the Intent to the Outcome
252
-
253
- Use one chip per modal, and leave it out of form and review modals.
254
-
255
- * **Feature (neutral):** Introduces a feature, such as passkeys.
256
- * **Done (positive):** Confirms a finished task, such as a payment.
257
- * **Risk (warning):** Flags a risk to read before you continue.
258
- * **Irreversible (negative):** Marks an action that can't be undone.
259
-
260
- ## Accessibility
261
-
262
- An icon tile renders a `<span>` with no role and takes no focus. The icon inside sets what assistive technology perceives.
263
-
264
- ### Semantics
265
-
266
- * **Chip (span):** Has no role of its own.
267
- * **Unnamed Icons (aria-hidden):** Icons without an `aria-label` are hidden, so the chip is silent.
268
- * **Named Icons (img):** An icon with an `aria-label` is announced as an image.
269
-
270
- ### Your Responsibilities
271
-
272
- * **Leave Decorative Icons Unnamed:** If the title below the chip names the outcome, leave the icon unnamed.
273
- * **Name Icons That Stand Alone (aria-label):** If the icon carries meaning alone, label it, such as "Wallet connected".
274
- * **State the Outcome in Text (intent):** The tint has no text alternative, so the modal title states the outcome.
275
-
276
- ## Related
277
-
278
- [Avatar](avatar.md)
279
-
280
- Use for people, contacts, and wallets in list rows.
281
-
282
- [Button](button.md)
283
-
284
- Use for icon actions.
285
-
286
- [Visual](visual.md)
287
-
288
- Use for illustrated onboarding and feature modals.
289
-
290
- [Iconography](../foundations/iconography.md)
291
-
292
- Covers choosing icons.
@@ -1,371 +0,0 @@
1
- # Identicon
2
-
3
- Shows a unique gradient avatar derived from an address.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Identicon.tsx)
6
-
7
- ## Overview
8
-
9
- An identicon is a round gradient avatar derived from an address. The same address always renders the same colors.
10
-
11
- ## Examples
12
-
13
- ### Basic
14
-
15
- ```tsx
16
- import { Identicon } from '@tempoxyz/ds'
17
-
18
- export function Demo() {
19
- return <Identicon address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" />
20
- }
21
- ```
22
-
23
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Identicon/Basic.tsx)
24
-
25
- ### Size
26
-
27
- Set `size` to `16`, `24`, `32`, `40` (default), `48`, or `64` pixels.
28
-
29
- ```tsx
30
- import { Identicon, style } from '@tempoxyz/ds'
31
-
32
- export function Demo() {
33
- return (
34
- <div {...styles.row()}>
35
- {(['16', '24', '32', '40', '48', '64'] as const).map((size) => (
36
- <Identicon address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" key={size} size={size} />
37
- ))}
38
- </div>
39
- )
40
- }
41
-
42
- namespace styles {
43
- export const row = style({ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '12' })
44
- }
45
- ```
46
-
47
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Identicon/Size.tsx)
48
-
49
- ### Address
50
-
51
- Each `address` derives its own colors.
52
-
53
- ```tsx
54
- import { Identicon, style } from '@tempoxyz/ds'
55
-
56
- const addresses = [
57
- '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
58
- '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
59
- '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe',
60
- '0x0000000000000000000000000000000000000000',
61
- '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984',
62
- '0x6B175474E89094C44Da98b954EedeAC495271d0F',
63
- '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
64
- '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
65
- ]
66
-
67
- export function Demo() {
68
- return (
69
- <div {...styles.row()}>
70
- {addresses.map((address) => (
71
- <Identicon address={address} key={address} size="64" />
72
- ))}
73
- </div>
74
- )
75
- }
76
-
77
- namespace styles {
78
- export const row = style({ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '12' })
79
- }
80
- ```
81
-
82
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Identicon/Address.tsx)
83
-
84
- ## Anatomy
85
-
86
- Import the component and assemble its parts.
87
-
88
- ```tsx
89
- import { Identicon } from '@tempoxyz/ds'
90
-
91
- <Identicon />
92
- ```
93
-
94
- ## Guidelines
95
-
96
- ### When to Use
97
-
98
- * Give an address an image beside its text, in recipient lists, activity rows, and account switchers.
99
- * Fill an `Avatar.Fallback` for an account known only by its address.
100
-
101
- ### When Not to Use
102
-
103
- * Use [Avatar](avatar.md) for people and organizations with a name.
104
- * Use [TokenLogo](token-logo.md) for a token contract, which has its own icon.
105
- * Use [Hex](hex.md) to read, compare, or copy the address.
106
-
107
- ### Always Show the Address Beside It
108
-
109
- Colors come from seven hue palettes, so addresses often look alike. Color alone doesn't identify an account ([SC 1.4.1](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html)).
110
-
111
- **Do:** Place the address, with `copy`, or the account name beside each identicon.
112
-
113
- ```tsx
114
- /**
115
- * Do example for "Always Show the Address Beside It" on the Identicon page.
116
- * Place the address, with `copy`, or the account name beside each identicon.
117
- * @module
118
- */
119
- import { Hex, Identicon, style } from '@tempoxyz/ds'
120
-
121
- const addresses = [
122
- '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
123
- '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
124
- ] as const
125
-
126
- /** Renders the static preview, which the guideline card shows inert. */
127
- export function Demo() {
128
- return (
129
- <div {...styles.list()}>
130
- {addresses.map((address) => (
131
- <div key={address} {...styles.row()}>
132
- <Identicon address={address} aria-hidden size="32" />
133
- <Hex copy value={address} />
134
- </div>
135
- ))}
136
- </div>
137
- )
138
- }
139
-
140
- namespace styles {
141
- export const list = style({ display: 'grid', gap: '12', minWidth: '0' })
142
-
143
- export const row = style({ alignItems: 'center', display: 'flex', gap: '12', minWidth: '0' })
144
- }
145
- ```
146
-
147
- **Don't:** Show identicons without the address or name they stand for.
148
-
149
- ```tsx
150
- /**
151
- * Don't example for "Always Show the Address Beside It" on the Identicon page.
152
- * Don't show identicons without the address or name they stand for.
153
- * @module
154
- */
155
- import { Identicon, style } from '@tempoxyz/ds'
156
-
157
- const addresses = [
158
- '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
159
- '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
160
- '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe',
161
- ] as const
162
-
163
- /** Renders the static preview, which the guideline card shows inert. */
164
- export function Demo() {
165
- return (
166
- <div {...styles.row()}>
167
- {addresses.map((address) => (
168
- <Identicon address={address} key={address} size="32" />
169
- ))}
170
- </div>
171
- )
172
- }
173
-
174
- namespace styles {
175
- export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
176
- }
177
- ```
178
-
179
- ### Don't Treat It as Verification
180
-
181
- An identicon doesn't prove an address is correct. Before a send, show the full address on the review step.
182
-
183
- **Do:** Ask people to compare characters.
184
-
185
- ```tsx
186
- /**
187
- * Do example for "Don't Treat It as Verification" on the Identicon page.
188
- * Ask people to compare characters.
189
- * @module
190
- */
191
- import { Hex, Identicon, style } from '@tempoxyz/ds'
192
-
193
- const address = '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'
194
-
195
- /** Renders the static preview, which the guideline card shows inert. */
196
- export function Demo() {
197
- return (
198
- <div {...styles.field()}>
199
- <span {...styles.label()}>Recipient</span>
200
- <div {...styles.row()}>
201
- <Identicon address={address} aria-hidden size="24" />
202
- <Hex size="small" value={address} />
203
- </div>
204
- <span {...styles.hint()}>Compare every character with the address you copied.</span>
205
- </div>
206
- )
207
- }
208
-
209
- namespace styles {
210
- export const field = style({ display: 'grid', gap: '8', width: '100% !custom' })
211
-
212
- export const hint = style({ color: 'content.secondary', typography: 'body.b3' })
213
-
214
- export const label = style({ color: 'content.secondary', typography: 'body.b2' })
215
-
216
- export const row = style({ alignItems: 'center', display: 'flex', gap: '8', minWidth: '0' })
217
- }
218
- ```
219
-
220
- **Don't:** Ask people to compare colors.
221
-
222
- ```tsx
223
- /**
224
- * Don't example for "Don't Treat It as Verification" on the Identicon page.
225
- * Don't ask people to compare colors.
226
- * @module
227
- */
228
- import { Hex, Identicon, style } from '@tempoxyz/ds'
229
-
230
- const address = '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'
231
-
232
- /** Renders the static preview, which the guideline card shows inert. */
233
- export function Demo() {
234
- return (
235
- <div {...styles.field()}>
236
- <span {...styles.label()}>Recipient</span>
237
- <div {...styles.row()}>
238
- <Identicon address={address} aria-hidden size="24" />
239
- <Hex size="small" value={address} />
240
- </div>
241
- <span {...styles.hint()}>Make sure the colors match your contact.</span>
242
- </div>
243
- )
244
- }
245
-
246
- namespace styles {
247
- export const field = style({ display: 'grid', gap: '8', width: '100% !custom' })
248
-
249
- export const hint = style({ color: 'content.secondary', typography: 'body.b3' })
250
-
251
- export const label = style({ color: 'content.secondary', typography: 'body.b2' })
252
-
253
- export const row = style({ alignItems: 'center', display: 'flex', gap: '8', minWidth: '0' })
254
- }
255
- ```
256
-
257
- ### Derive It From the Address
258
-
259
- Letter case doesn't change the colors, so checksummed and lowercase forms match.
260
-
261
- **Do:** Pass the address, so a rename keeps the same image.
262
-
263
- ```tsx
264
- /**
265
- * Do example for "Derive It From the Address" on the Identicon page.
266
- * Pass the address, so a rename keeps the same image.
267
- * @module
268
- */
269
- import { Identicon, style } from '@tempoxyz/ds'
270
-
271
- const address = '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'
272
-
273
- /** Renders the static preview, which the guideline card shows inert. */
274
- export function Demo() {
275
- return (
276
- <div {...styles.list()}>
277
- <div {...styles.row()}>
278
- <Identicon address={address} aria-hidden size="32" />
279
- <span {...styles.name()}>Alice</span>
280
- </div>
281
- <div {...styles.row()}>
282
- <Identicon address={address} aria-hidden size="32" />
283
- <span {...styles.name()}>Alice Chen</span>
284
- </div>
285
- </div>
286
- )
287
- }
288
-
289
- namespace styles {
290
- export const list = style({ display: 'grid', gap: '12' })
291
-
292
- export const name = style({ color: 'content.primary', typography: 'body.b2' })
293
-
294
- export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
295
- }
296
- ```
297
-
298
- **Don't:** Pass a display name. The image changes when the name does.
299
-
300
- ```tsx
301
- /**
302
- * Don't example for "Derive It From the Address" on the Identicon page.
303
- * Don't pass a display name. The image changes when the name does.
304
- * @module
305
- */
306
- import { Identicon, style } from '@tempoxyz/ds'
307
-
308
- /** Renders the static preview, which the guideline card shows inert. */
309
- export function Demo() {
310
- return (
311
- <div {...styles.list()}>
312
- <div {...styles.row()}>
313
- <Identicon address="Alice" aria-hidden size="32" />
314
- <span {...styles.name()}>Alice</span>
315
- </div>
316
- <div {...styles.row()}>
317
- <Identicon address="Alice Chen" aria-hidden size="32" />
318
- <span {...styles.name()}>Alice Chen</span>
319
- </div>
320
- </div>
321
- )
322
- }
323
-
324
- namespace styles {
325
- export const list = style({ display: 'grid', gap: '12' })
326
-
327
- export const name = style({ color: 'content.primary', typography: 'body.b2' })
328
-
329
- export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
330
- }
331
- ```
332
-
333
- ### Size It With the Text Beside It
334
-
335
- * **Inline (16):** Inline with body text.
336
- * **Dense Rows (24 or 32):** In dense rows and tables.
337
- * **List Rows (40):** The default, in list rows.
338
- * **Account Headers (48 or 64):** In account headers.
339
- * **Fill a Frame (fill):** Inside an avatar fallback or other sized frame.
340
-
341
- ## Accessibility
342
-
343
- An identicon renders an `<svg>` with the `img` role. It takes no focus.
344
-
345
- ### Semantics
346
-
347
- * **Root (img):** Announced as an image by name.
348
- * **Name (aria-label):** Defaults to the full address, all 42 characters.
349
-
350
- ### Your Responsibilities
351
-
352
- * **Hide a Duplicate (aria-hidden):** If the address is in nearby text, hide the identicon so it isn't announced twice.
353
- * **Name a Standalone Identicon (aria-label):** If it stands alone, name the account, such as "Savings account".
354
-
355
- ## Related
356
-
357
- [Avatar](avatar.md)
358
-
359
- Use for people and organizations.
360
-
361
- [Hex](hex.md)
362
-
363
- Use for showing and copying addresses.
364
-
365
- [TokenLogo](token-logo.md)
366
-
367
- Use for token icons.
368
-
369
- [Blockchain Values](../patterns/blockchain-values.md)
370
-
371
- Covers displaying addresses.