@tempoxyz/ds 0.3.9 → 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.
- package/dist/docs/AGENTS.md +9 -0
- package/dist/docs/components/accordion.md +489 -0
- package/dist/docs/components/address-card.md +147 -0
- package/dist/docs/components/agent-logo.md +194 -0
- package/dist/docs/components/alert-dialog.md +631 -0
- package/dist/docs/components/alert.md +448 -0
- package/dist/docs/components/amount-input.md +305 -0
- package/dist/docs/components/amount.md +794 -0
- package/dist/docs/components/app-shell.md +559 -0
- package/dist/docs/components/asset-chip.md +294 -0
- package/dist/docs/components/autocomplete.md +619 -0
- package/dist/docs/components/avatar.md +321 -0
- package/dist/docs/components/badge.md +339 -0
- package/dist/docs/components/badged-logo.md +116 -0
- package/dist/docs/components/banner.md +379 -0
- package/dist/docs/components/bar-chart.md +208 -0
- package/dist/docs/components/breadcrumbs.md +380 -0
- package/dist/docs/components/button-group.md +286 -0
- package/dist/docs/components/button.md +650 -0
- package/dist/docs/components/calendar.md +375 -0
- package/dist/docs/components/callout.md +96 -0
- package/dist/docs/components/checkbox-group.md +521 -0
- package/dist/docs/components/checkbox.md +467 -0
- package/dist/docs/components/choice-group.md +516 -0
- package/dist/docs/components/choicebox.md +641 -0
- package/dist/docs/components/code.md +100 -0
- package/dist/docs/components/combobox.md +939 -0
- package/dist/docs/components/container.md +257 -0
- package/dist/docs/components/copy-button.md +642 -0
- package/dist/docs/components/date-picker.md +514 -0
- package/dist/docs/components/dialog.md +1332 -0
- package/dist/docs/components/drawer.md +966 -0
- package/dist/docs/components/empty.md +340 -0
- package/dist/docs/components/field.md +570 -0
- package/dist/docs/components/fieldset.md +398 -0
- package/dist/docs/components/frame.md +434 -0
- package/dist/docs/components/gauge.md +299 -0
- package/dist/docs/components/get-started-visual.md +117 -0
- package/dist/docs/components/grid.md +288 -0
- package/dist/docs/components/hero-visual.md +155 -0
- package/dist/docs/components/hex.md +487 -0
- package/dist/docs/components/icon-tile.md +292 -0
- package/dist/docs/components/identicon.md +371 -0
- package/dist/docs/components/inline.md +233 -0
- package/dist/docs/components/inset.md +225 -0
- package/dist/docs/components/kbd.md +423 -0
- package/dist/docs/components/list-group.md +981 -0
- package/dist/docs/components/loading-dots.md +237 -0
- package/dist/docs/components/menu.md +934 -0
- package/dist/docs/components/native-select.md +204 -0
- package/dist/docs/components/network-logo.md +248 -0
- package/dist/docs/components/number-field.md +543 -0
- package/dist/docs/components/otp-field.md +616 -0
- package/dist/docs/components/pagination.md +516 -0
- package/dist/docs/components/popover.md +544 -0
- package/dist/docs/components/progress.md +388 -0
- package/dist/docs/components/qr.md +314 -0
- package/dist/docs/components/radio-group.md +528 -0
- package/dist/docs/components/secret-value.md +406 -0
- package/dist/docs/components/select.md +751 -0
- package/dist/docs/components/separator.md +379 -0
- package/dist/docs/components/sidebar-menu.md +922 -0
- package/dist/docs/components/skeleton.md +517 -0
- package/dist/docs/components/slider.md +539 -0
- package/dist/docs/components/snippet.md +424 -0
- package/dist/docs/components/spinner.md +216 -0
- package/dist/docs/components/split-bar.md +139 -0
- package/dist/docs/components/split-button.md +464 -0
- package/dist/docs/components/stack.md +299 -0
- package/dist/docs/components/status-chip.md +226 -0
- package/dist/docs/components/status-indicator.md +119 -0
- package/dist/docs/components/status-row.md +174 -0
- package/dist/docs/components/stepper.md +451 -0
- package/dist/docs/components/success-hero.md +157 -0
- package/dist/docs/components/surface.md +639 -0
- package/dist/docs/components/switch.md +472 -0
- package/dist/docs/components/table.md +967 -0
- package/dist/docs/components/tabs.md +627 -0
- package/dist/docs/components/tempo-logo.md +185 -0
- package/dist/docs/components/text-input.md +624 -0
- package/dist/docs/components/textarea.md +352 -0
- package/dist/docs/components/toast.md +535 -0
- package/dist/docs/components/token-logo.md +371 -0
- package/dist/docs/components/token.md +247 -0
- package/dist/docs/components/tooltip.md +490 -0
- package/dist/docs/components/verification-code.md +116 -0
- package/dist/docs/components/visual.md +249 -0
- package/dist/docs/components.md +203 -0
- package/dist/docs/foundations/accessibility.md +377 -0
- package/dist/docs/foundations/agents.md +150 -0
- package/dist/docs/foundations/color.md +522 -0
- package/dist/docs/foundations/content/tone.md +194 -0
- package/dist/docs/foundations/content/voice.md +194 -0
- package/dist/docs/foundations/content/writing-style.md +406 -0
- package/dist/docs/foundations/iconography.md +282 -0
- package/dist/docs/foundations/intent.md +360 -0
- package/dist/docs/foundations/layout.md +508 -0
- package/dist/docs/foundations/linter.md +296 -0
- package/dist/docs/foundations/motion.md +151 -0
- package/dist/docs/foundations/radius-and-padding.md +86 -0
- package/dist/docs/foundations/typography.md +266 -0
- package/dist/docs/index.md +137 -0
- package/dist/docs/introduction/faq.md +132 -0
- package/dist/docs/introduction/getting-started.md +377 -0
- package/dist/docs/patterns/blockchain-values.md +709 -0
- package/dist/docs/patterns/dashboards.md +638 -0
- package/dist/docs/patterns/destructive-actions.md +626 -0
- package/dist/docs/patterns/empty-states.md +612 -0
- package/dist/docs/patterns/errors-and-validation.md +808 -0
- package/dist/docs/patterns/feedback-and-status.md +518 -0
- package/dist/docs/patterns/forms.md +679 -0
- package/dist/docs/patterns/loading.md +630 -0
- package/dist/docs/patterns/navigation.md +397 -0
- package/dist/docs/patterns/payments.md +765 -0
- package/dist/docs/patterns/responsive-layout.md +997 -0
- package/dist/docs/patterns/tables-and-lists.md +964 -0
- package/dist/docs/products/tempo-console.md +671 -0
- package/dist/docs/products/tempo-performance.md +437 -0
- package/dist/docs/products/tempo-wallet.md +438 -0
- package/dist/web/components/OtpField.css +1 -1
- package/dist/web/components/OtpField.d.ts +1 -1
- package/dist/web/components/OtpField.d.ts.map +1 -1
- package/dist/web/components/OtpField.js +3 -4
- package/dist/web/components/OtpField.js.map +1 -1
- package/dist/web/components/OtpField.js.zyzz.json +1 -1
- package/dist/web/index.js.zyzz.json +1 -1
- package/package.json +1 -1
- package/src/web/components/OtpField.tsx +2 -24
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# Building From Intent
|
|
2
|
+
|
|
3
|
+
Choose each component by the job of its content, not by the markup it replaces.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Every part of a screen does a job, such as a list of records to compare, a status to read, or an identifier to check. Each component page documents one job, so the right component follows from the job and not from the look of the old markup.
|
|
8
|
+
|
|
9
|
+
## The Method
|
|
10
|
+
|
|
11
|
+
### Inventory the Screen by Job
|
|
12
|
+
|
|
13
|
+
Name the job of each part before you open the catalog: records, details, status, identifier, amount, metric, message, action, choice, or navigation.
|
|
14
|
+
|
|
15
|
+
### Choose by Documented Job
|
|
16
|
+
|
|
17
|
+
Find the job in [Common Intents](#common-intents) or the comparisons on [Components](/docs/components#choosing-a-component). Then read the When to Use section of the component page.
|
|
18
|
+
|
|
19
|
+
### Check When Not to Use
|
|
20
|
+
|
|
21
|
+
Read the When Not to Use section of the same page. If it names your case, use the component that the section links instead.
|
|
22
|
+
|
|
23
|
+
### Write the Labels
|
|
24
|
+
|
|
25
|
+
Write every label from the [Writing Style](/docs/foundations/content/writing-style) rules. Map a raw API value, such as `payment_failed`, to a word, such as Failed.
|
|
26
|
+
|
|
27
|
+
### Check the Fit
|
|
28
|
+
|
|
29
|
+
Render the result at the narrowest width that its column or container reaches, and confirm that nothing overlaps or clips. In a table, follow [Keep Multi-Line Rows Readable](/docs/patterns/tables-and-lists#keep-multi-line-rows-readable).
|
|
30
|
+
|
|
31
|
+
## Common Intents
|
|
32
|
+
|
|
33
|
+
Each tile names a job, the component for it, and the question that tells it apart from similar components.
|
|
34
|
+
|
|
35
|
+
### Data
|
|
36
|
+
|
|
37
|
+
* **Records (Table):** Do people compare many records across the same fields? Use a [Table](/docs/components/table), one row per record.
|
|
38
|
+
* **One Record (ListGroup):** Does the view show the fields of one record? Use [ListGroup](/docs/components/list-group) rows with `ListGroup.Label`.
|
|
39
|
+
* **Identifier (Hex):** Is it an address or a hash outside a table? Use [Hex](/docs/components/hex) with `copy`. A table column uses a `mono` cell.
|
|
40
|
+
* **Amount (Amount):** Is it money or a token balance? Use [Amount](/docs/components/amount) with a `currency` or a `symbol`.
|
|
41
|
+
* **Metric (Surface):** Is it a headline number on a dashboard? Use a small [Surface](/docs/components/surface) tile, as [Dashboards](/docs/patterns/dashboards) shows.
|
|
42
|
+
|
|
43
|
+
### Status
|
|
44
|
+
|
|
45
|
+
* **Status in a Table (status):** Does the status sit in a table row? Set `status` on its [Table](/docs/components/table) cell, and keep the status word beside the color.
|
|
46
|
+
* **Status of a Payment (StatusChip):** Does a payment, an authorization, or a network have a status outside a table? Use a [StatusChip](/docs/components/status-chip).
|
|
47
|
+
* **Live System Status (StatusIndicator):** Does a service or a connection report its live state? Use a [StatusIndicator](/docs/components/status-indicator).
|
|
48
|
+
* **Running Task (StatusRow):** Does a person wait on one task that finishes within minutes? Follow it with a [StatusRow](/docs/components/status-row).
|
|
49
|
+
* **Attribute (Badge):** Does a word name a category or an attribute, such as Testnet? Use a [Badge](/docs/components/badge) beside the title.
|
|
50
|
+
|
|
51
|
+
### Interaction
|
|
52
|
+
|
|
53
|
+
* **Message (Alert):** Does a sentence explain a condition? Use an [Alert](/docs/components/alert) for a section and a [Banner](/docs/components/banner) for the page.
|
|
54
|
+
* **Action (Button):** Does it start something in the current view? Use a [Button](/docs/components/button) with a verb label, such as Send payment.
|
|
55
|
+
* **Choice (RadioGroup):** Does a person pick one option? Compare [RadioGroup](/docs/components/radio-group) and the others on [Components](/docs/components#choosing-one-option).
|
|
56
|
+
* **Navigation (SidebarMenu):** Does it open another page? Use a link, or a [SidebarMenu](/docs/components/sidebar-menu) for the main destinations of an app.
|
|
57
|
+
|
|
58
|
+
## Porting an Existing Interface
|
|
59
|
+
|
|
60
|
+
A port replaces old markup with library components. Map the job of each part instead, since the old screen can already use the wrong element for it.
|
|
61
|
+
|
|
62
|
+
### Show Records as Rows
|
|
63
|
+
|
|
64
|
+
**Do:** Show records that share fields as the rows of a [Table](/docs/components/table).
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
/**
|
|
68
|
+
* Do example for "Show Records as Rows" on the Building From Intent page.
|
|
69
|
+
* Show records that share fields as the rows of a Table.
|
|
70
|
+
* @module
|
|
71
|
+
*/
|
|
72
|
+
import { Table } from '@tempoxyz/ds'
|
|
73
|
+
|
|
74
|
+
const payouts = [
|
|
75
|
+
['Ada Lovelace', 'Oct 19', '120.00'],
|
|
76
|
+
['Alan Turing', 'Oct 19', '80.00'],
|
|
77
|
+
['Grace Hopper', 'Oct 18', '45.50'],
|
|
78
|
+
] as const
|
|
79
|
+
|
|
80
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
81
|
+
export function Demo() {
|
|
82
|
+
return (
|
|
83
|
+
<Table size="small">
|
|
84
|
+
<Table.Head>
|
|
85
|
+
<Table.Row>
|
|
86
|
+
<Table.HeaderCell>Recipient</Table.HeaderCell>
|
|
87
|
+
<Table.HeaderCell>Date</Table.HeaderCell>
|
|
88
|
+
<Table.HeaderCell>Amount (USDC)</Table.HeaderCell>
|
|
89
|
+
</Table.Row>
|
|
90
|
+
</Table.Head>
|
|
91
|
+
<Table.Body>
|
|
92
|
+
{payouts.map(([recipient, date, amount]) => (
|
|
93
|
+
<Table.Row key={recipient}>
|
|
94
|
+
<Table.Cell>{recipient}</Table.Cell>
|
|
95
|
+
<Table.Cell>{date}</Table.Cell>
|
|
96
|
+
<Table.Cell numeric>{amount}</Table.Cell>
|
|
97
|
+
</Table.Row>
|
|
98
|
+
))}
|
|
99
|
+
</Table.Body>
|
|
100
|
+
</Table>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Don't:** Wrap each record in a [Surface](/docs/components/surface) card because the old screen drew
|
|
106
|
+
cards.
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
/**
|
|
110
|
+
* Don't example for "Show Records as Rows" on the Building From Intent page.
|
|
111
|
+
* A card per record repeats each label and breaks the columns that people compare.
|
|
112
|
+
* @module
|
|
113
|
+
*/
|
|
114
|
+
import { Grid, style, Surface } from '@tempoxyz/ds'
|
|
115
|
+
|
|
116
|
+
const payouts = [
|
|
117
|
+
['Ada Lovelace', 'Oct 19', '120.00 USDC'],
|
|
118
|
+
['Alan Turing', 'Oct 19', '80.00 USDC'],
|
|
119
|
+
['Grace Hopper', 'Oct 18', '45.50 USDC'],
|
|
120
|
+
] as const
|
|
121
|
+
|
|
122
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
123
|
+
export function Demo() {
|
|
124
|
+
return (
|
|
125
|
+
<Grid fit="small" gap="8" {...styles.grid()}>
|
|
126
|
+
{payouts.map(([recipient, date, amount]) => (
|
|
127
|
+
<Surface key={recipient} size="small" {...styles.card()}>
|
|
128
|
+
<p {...styles.title()}>{recipient}</p>
|
|
129
|
+
<p {...styles.meta()}>Date: {date}</p>
|
|
130
|
+
<p {...styles.meta()}>Amount: {amount}</p>
|
|
131
|
+
</Surface>
|
|
132
|
+
))}
|
|
133
|
+
</Grid>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
namespace styles {
|
|
138
|
+
export const card = style({
|
|
139
|
+
boxShadow: '0 0 0 1px light-dark(#0000001a, #ffffff1f) !custom',
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
export const grid = style({ width: '100% !custom' })
|
|
143
|
+
|
|
144
|
+
export const meta = style({ color: 'content.secondary', margin: '0', typography: 'body.b3' })
|
|
145
|
+
|
|
146
|
+
export const title = style({ margin: '0', typography: 'body.b2' })
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Write Status Words, Not API Values
|
|
151
|
+
|
|
152
|
+
**Do:** Color a status word in sentence case with the `status` of its [Table](/docs/components/table)
|
|
153
|
+
cell.
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
/**
|
|
157
|
+
* Do example for "Write Status Words, Not API Values" on the Building From Intent page.
|
|
158
|
+
* Color a status word in sentence case with the `status` of its Table cell.
|
|
159
|
+
* @module
|
|
160
|
+
*/
|
|
161
|
+
import { Table } from '@tempoxyz/ds'
|
|
162
|
+
|
|
163
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
164
|
+
export function Demo() {
|
|
165
|
+
return (
|
|
166
|
+
<Table size="small">
|
|
167
|
+
<Table.Head>
|
|
168
|
+
<Table.Row>
|
|
169
|
+
<Table.HeaderCell>Recipient</Table.HeaderCell>
|
|
170
|
+
<Table.HeaderCell>Status</Table.HeaderCell>
|
|
171
|
+
</Table.Row>
|
|
172
|
+
</Table.Head>
|
|
173
|
+
<Table.Body>
|
|
174
|
+
<Table.Row>
|
|
175
|
+
<Table.Cell>Ada Lovelace</Table.Cell>
|
|
176
|
+
<Table.Cell status="positive">Confirmed</Table.Cell>
|
|
177
|
+
</Table.Row>
|
|
178
|
+
<Table.Row>
|
|
179
|
+
<Table.Cell>Alan Turing</Table.Cell>
|
|
180
|
+
<Table.Cell status="warning">Pending</Table.Cell>
|
|
181
|
+
</Table.Row>
|
|
182
|
+
<Table.Row>
|
|
183
|
+
<Table.Cell>Grace Hopper</Table.Cell>
|
|
184
|
+
<Table.Cell status="negative">Failed</Table.Cell>
|
|
185
|
+
</Table.Row>
|
|
186
|
+
</Table.Body>
|
|
187
|
+
</Table>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Don't:** Copy a grey pill into a [Badge](/docs/components/badge) with the raw value from the API.
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
/**
|
|
196
|
+
* Don't example for "Write Status Words, Not API Values" on the Building From Intent page.
|
|
197
|
+
* A grey pill copied from the old screen shows raw API values and no status color.
|
|
198
|
+
* @module
|
|
199
|
+
*/
|
|
200
|
+
import { Badge, Table } from '@tempoxyz/ds'
|
|
201
|
+
|
|
202
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
203
|
+
export function Demo() {
|
|
204
|
+
return (
|
|
205
|
+
<Table size="small">
|
|
206
|
+
<Table.Head>
|
|
207
|
+
<Table.Row>
|
|
208
|
+
<Table.HeaderCell>Recipient</Table.HeaderCell>
|
|
209
|
+
<Table.HeaderCell>Status</Table.HeaderCell>
|
|
210
|
+
</Table.Row>
|
|
211
|
+
</Table.Head>
|
|
212
|
+
<Table.Body>
|
|
213
|
+
<Table.Row>
|
|
214
|
+
<Table.Cell>Ada Lovelace</Table.Cell>
|
|
215
|
+
<Table.Cell>
|
|
216
|
+
<Badge size="small">confirmed</Badge>
|
|
217
|
+
</Table.Cell>
|
|
218
|
+
</Table.Row>
|
|
219
|
+
<Table.Row>
|
|
220
|
+
<Table.Cell>Alan Turing</Table.Cell>
|
|
221
|
+
<Table.Cell>
|
|
222
|
+
<Badge size="small">PENDING</Badge>
|
|
223
|
+
</Table.Cell>
|
|
224
|
+
</Table.Row>
|
|
225
|
+
<Table.Row>
|
|
226
|
+
<Table.Cell>Grace Hopper</Table.Cell>
|
|
227
|
+
<Table.Cell>
|
|
228
|
+
<Badge size="small">payment_failed</Badge>
|
|
229
|
+
</Table.Cell>
|
|
230
|
+
</Table.Row>
|
|
231
|
+
</Table.Body>
|
|
232
|
+
</Table>
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Fit Identifiers to Their Column
|
|
238
|
+
|
|
239
|
+
[Hex](/docs/components/hex) truncates to its container, down to the prefix, one character on each side, and its copy button. A narrower column lets it overflow into the next cell.
|
|
240
|
+
|
|
241
|
+
**Do:** Set `mono` on the cell and shorten the value with `formatHex` from `@tempoxyz/ds`, which keeps
|
|
242
|
+
four characters on each side. Show the full value with `copy` on the details view.
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
/**
|
|
246
|
+
* Do example for "Fit Identifiers to Their Column" on the Building From Intent page.
|
|
247
|
+
* Shorten an address in a table column with a `mono` cell and `formatHex`.
|
|
248
|
+
* @module
|
|
249
|
+
*/
|
|
250
|
+
import { formatHex, Table } from '@tempoxyz/ds'
|
|
251
|
+
|
|
252
|
+
const accounts = [
|
|
253
|
+
['Ada Lovelace', '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc', '120.00'],
|
|
254
|
+
['Alan Turing', '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', '80.00'],
|
|
255
|
+
] as const
|
|
256
|
+
|
|
257
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
258
|
+
export function Demo() {
|
|
259
|
+
return (
|
|
260
|
+
<Table size="small">
|
|
261
|
+
<Table.Head>
|
|
262
|
+
<Table.Row>
|
|
263
|
+
<Table.HeaderCell>Recipient</Table.HeaderCell>
|
|
264
|
+
<Table.HeaderCell>Address</Table.HeaderCell>
|
|
265
|
+
<Table.HeaderCell>Amount</Table.HeaderCell>
|
|
266
|
+
</Table.Row>
|
|
267
|
+
</Table.Head>
|
|
268
|
+
<Table.Body>
|
|
269
|
+
{accounts.map(([recipient, address, amount]) => (
|
|
270
|
+
<Table.Row key={address}>
|
|
271
|
+
<Table.Cell>{recipient}</Table.Cell>
|
|
272
|
+
<Table.Cell mono>{formatHex(address)}</Table.Cell>
|
|
273
|
+
<Table.Cell numeric>{amount}</Table.Cell>
|
|
274
|
+
</Table.Row>
|
|
275
|
+
))}
|
|
276
|
+
</Table.Body>
|
|
277
|
+
</Table>
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Don't:** Place a [Hex](/docs/components/hex) with `copy` in a column narrower than its minimum
|
|
283
|
+
width.
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
/**
|
|
287
|
+
* Don't example for "Fit Identifiers to Their Column" on the Building From Intent page.
|
|
288
|
+
* A Hex with `copy` in a narrow column stops at its minimum width and overlaps the next cell.
|
|
289
|
+
* @module
|
|
290
|
+
*/
|
|
291
|
+
import { Hex, style, Table } from '@tempoxyz/ds'
|
|
292
|
+
|
|
293
|
+
const accounts = [
|
|
294
|
+
['Ada Lovelace', '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc', '120.00'],
|
|
295
|
+
['Alan Turing', '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', '80.00'],
|
|
296
|
+
] as const
|
|
297
|
+
|
|
298
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
299
|
+
export function Demo() {
|
|
300
|
+
return (
|
|
301
|
+
<Table size="small" {...styles.table()}>
|
|
302
|
+
<Table.Head>
|
|
303
|
+
<Table.Row>
|
|
304
|
+
<Table.HeaderCell>Recipient</Table.HeaderCell>
|
|
305
|
+
<Table.HeaderCell {...styles.narrow()}>Address</Table.HeaderCell>
|
|
306
|
+
<Table.HeaderCell>Amount</Table.HeaderCell>
|
|
307
|
+
</Table.Row>
|
|
308
|
+
</Table.Head>
|
|
309
|
+
<Table.Body>
|
|
310
|
+
{accounts.map(([recipient, address, amount]) => (
|
|
311
|
+
<Table.Row key={address}>
|
|
312
|
+
<Table.Cell>{recipient}</Table.Cell>
|
|
313
|
+
<Table.Cell>
|
|
314
|
+
<Hex copy size="small" value={address} />
|
|
315
|
+
</Table.Cell>
|
|
316
|
+
<Table.Cell numeric>{amount}</Table.Cell>
|
|
317
|
+
</Table.Row>
|
|
318
|
+
))}
|
|
319
|
+
</Table.Body>
|
|
320
|
+
</Table>
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
namespace styles {
|
|
325
|
+
export const narrow = style({ width: '3rem !custom' })
|
|
326
|
+
|
|
327
|
+
export const table = style({ tableLayout: 'fixed !custom' })
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## Checklist
|
|
332
|
+
|
|
333
|
+
Before you ship a screen, confirm each item.
|
|
334
|
+
|
|
335
|
+
* **Jobs Named:** Each part of the screen has a named job, and each component matches that job.
|
|
336
|
+
* **Exclusions Checked:** No component appears in a case that its When Not to Use section excludes.
|
|
337
|
+
* **Labels Written:** Labels are words in sentence case, with one word per status and no raw API values.
|
|
338
|
+
* **Fit Checked:** Every cell and tile fits at the narrowest width of its layout, without overlap or clipping.
|
|
339
|
+
|
|
340
|
+
## Related
|
|
341
|
+
|
|
342
|
+
[Components](/docs/components)
|
|
343
|
+
|
|
344
|
+
Covers the catalog and the comparisons between similar components.
|
|
345
|
+
|
|
346
|
+
[Agents](/docs/foundations/agents)
|
|
347
|
+
|
|
348
|
+
Covers the rules that coding agents follow.
|
|
349
|
+
|
|
350
|
+
[Tables and Lists](/docs/patterns/tables-and-lists)
|
|
351
|
+
|
|
352
|
+
Covers tables, lists, and the details of one record.
|
|
353
|
+
|
|
354
|
+
[Feedback and Status](/docs/patterns/feedback-and-status)
|
|
355
|
+
|
|
356
|
+
Covers status words and the channel for each message.
|
|
357
|
+
|
|
358
|
+
[Writing Style](/docs/foundations/content/writing-style)
|
|
359
|
+
|
|
360
|
+
Covers labels, status words, and sentence case.
|