@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,489 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
Stacks collapsible sections that each reveal a labelled panel.
|
|
4
|
+
|
|
5
|
+
[View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Accordion.tsx)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Each trigger toggles a labelled panel. By default, one item is open at a time.
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Accordion, style } from '@tempoxyz/ds'
|
|
17
|
+
|
|
18
|
+
export const fill = true
|
|
19
|
+
export function Demo() {
|
|
20
|
+
return (
|
|
21
|
+
<Accordion.Root defaultValue={['one']} {...styles.root()}>
|
|
22
|
+
<Accordion.Item value="one">
|
|
23
|
+
<Accordion.Trigger>What is Tempo?</Accordion.Trigger>
|
|
24
|
+
<Accordion.Panel>A blockchain for payments.</Accordion.Panel>
|
|
25
|
+
</Accordion.Item>
|
|
26
|
+
<Accordion.Item value="two">
|
|
27
|
+
<Accordion.Trigger>How do fees work?</Accordion.Trigger>
|
|
28
|
+
<Accordion.Panel>Fees are paid in stablecoins.</Accordion.Panel>
|
|
29
|
+
</Accordion.Item>
|
|
30
|
+
</Accordion.Root>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
namespace styles {
|
|
35
|
+
export const root = style({ maxWidth: '28rem !custom' })
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Accordion/Basic.tsx)
|
|
40
|
+
|
|
41
|
+
### Size
|
|
42
|
+
|
|
43
|
+
Set `size` to `small`, `medium` (default), or `large`.
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import { Accordion, Stack, style } from '@tempoxyz/ds'
|
|
47
|
+
|
|
48
|
+
export const fill = true
|
|
49
|
+
function Items(props: Accordion.Root.Props) {
|
|
50
|
+
return (
|
|
51
|
+
<Accordion.Root {...props}>
|
|
52
|
+
<Accordion.Item value="one">
|
|
53
|
+
<Accordion.Trigger>What is Tempo?</Accordion.Trigger>
|
|
54
|
+
<Accordion.Panel>A blockchain for payments.</Accordion.Panel>
|
|
55
|
+
</Accordion.Item>
|
|
56
|
+
<Accordion.Item value="two">
|
|
57
|
+
<Accordion.Trigger>How do fees work?</Accordion.Trigger>
|
|
58
|
+
<Accordion.Panel>Fees are paid in stablecoins.</Accordion.Panel>
|
|
59
|
+
</Accordion.Item>
|
|
60
|
+
</Accordion.Root>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function Demo() {
|
|
65
|
+
return (
|
|
66
|
+
<Stack gap="32" {...styles.stack()}>
|
|
67
|
+
{(['small', 'medium', 'large'] as const).map((size) => (
|
|
68
|
+
<Items defaultValue={['one']} key={size} size={size} />
|
|
69
|
+
))}
|
|
70
|
+
</Stack>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
namespace styles {
|
|
75
|
+
export const stack = style({ maxWidth: '28rem !custom' })
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Accordion/Size.tsx)
|
|
80
|
+
|
|
81
|
+
### Multiple
|
|
82
|
+
|
|
83
|
+
Set `multiple` on `Accordion.Root` to keep several items open at once.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import { Accordion, style } from '@tempoxyz/ds'
|
|
87
|
+
|
|
88
|
+
export const fill = true
|
|
89
|
+
export function Demo() {
|
|
90
|
+
return (
|
|
91
|
+
<Accordion.Root multiple {...styles.root()}>
|
|
92
|
+
<Accordion.Item value="one">
|
|
93
|
+
<Accordion.Trigger>What is Tempo?</Accordion.Trigger>
|
|
94
|
+
<Accordion.Panel>A blockchain for payments.</Accordion.Panel>
|
|
95
|
+
</Accordion.Item>
|
|
96
|
+
<Accordion.Item value="two">
|
|
97
|
+
<Accordion.Trigger>How do fees work?</Accordion.Trigger>
|
|
98
|
+
<Accordion.Panel>Fees are paid in stablecoins.</Accordion.Panel>
|
|
99
|
+
</Accordion.Item>
|
|
100
|
+
</Accordion.Root>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
namespace styles {
|
|
105
|
+
export const root = style({ maxWidth: '28rem !custom' })
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Accordion/Multiple.tsx)
|
|
110
|
+
|
|
111
|
+
### Disabled
|
|
112
|
+
|
|
113
|
+
Set `disabled` on an `Accordion.Item` to block it from opening.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import { Accordion, style } from '@tempoxyz/ds'
|
|
117
|
+
|
|
118
|
+
export const fill = true
|
|
119
|
+
export function Demo() {
|
|
120
|
+
return (
|
|
121
|
+
<Accordion.Root {...styles.root()}>
|
|
122
|
+
<Accordion.Item value="one">
|
|
123
|
+
<Accordion.Trigger>What is Tempo?</Accordion.Trigger>
|
|
124
|
+
<Accordion.Panel>A blockchain for payments.</Accordion.Panel>
|
|
125
|
+
</Accordion.Item>
|
|
126
|
+
<Accordion.Item disabled value="three">
|
|
127
|
+
<Accordion.Trigger>Disabled</Accordion.Trigger>
|
|
128
|
+
<Accordion.Panel>Hidden.</Accordion.Panel>
|
|
129
|
+
</Accordion.Item>
|
|
130
|
+
</Accordion.Root>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
namespace styles {
|
|
135
|
+
export const root = style({ maxWidth: '28rem !custom' })
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Accordion/Disabled.tsx)
|
|
140
|
+
|
|
141
|
+
## Anatomy
|
|
142
|
+
|
|
143
|
+
Import the component and assemble its parts.
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
147
|
+
|
|
148
|
+
<Accordion.Root>
|
|
149
|
+
<Accordion.Item>
|
|
150
|
+
<Accordion.Trigger />
|
|
151
|
+
<Accordion.Panel />
|
|
152
|
+
</Accordion.Item>
|
|
153
|
+
</Accordion.Root>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Guidelines
|
|
157
|
+
|
|
158
|
+
### When to Use
|
|
159
|
+
|
|
160
|
+
* Shorten a page of related, optional content, such as fee help answers or advanced webhook settings.
|
|
161
|
+
* Let people scan summaries and open only the sections they need.
|
|
162
|
+
|
|
163
|
+
### When Not to Use
|
|
164
|
+
|
|
165
|
+
* Use [Tabs](tabs.md) to switch between views of equal weight, such as Balances and Activity.
|
|
166
|
+
* Use [ListGroup](list-group.md) for facts people check at a glance, such as the amount and fee of a payment.
|
|
167
|
+
* Use [Stepper](stepper.md) for steps people complete in order.
|
|
168
|
+
* If most people need the content, keep it visible in a [Surface](surface.md), such as the amount and fee on a payment review.
|
|
169
|
+
|
|
170
|
+
### Summarize the Panel in the Trigger
|
|
171
|
+
|
|
172
|
+
A closed panel shows only its trigger. Write each trigger so people can tell what the panel holds before they open it.
|
|
173
|
+
|
|
174
|
+
**Do:** Write triggers that say what each panel contains.
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
/**
|
|
178
|
+
* Do example for "Summarize the Panel in the Trigger" on the Accordion page.
|
|
179
|
+
* Write triggers that say what each panel contains.
|
|
180
|
+
* @module
|
|
181
|
+
*/
|
|
182
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
183
|
+
|
|
184
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
185
|
+
export function Demo() {
|
|
186
|
+
return (
|
|
187
|
+
<Accordion.Root>
|
|
188
|
+
<Accordion.Item value="cost">
|
|
189
|
+
<Accordion.Trigger>What does a transfer cost?</Accordion.Trigger>
|
|
190
|
+
<Accordion.Panel>Each transfer pays a network fee in a stablecoin.</Accordion.Panel>
|
|
191
|
+
</Accordion.Item>
|
|
192
|
+
<Accordion.Item value="settle">
|
|
193
|
+
<Accordion.Trigger>When does a payment settle?</Accordion.Trigger>
|
|
194
|
+
<Accordion.Panel>A payment settles when its block is final.</Accordion.Panel>
|
|
195
|
+
</Accordion.Item>
|
|
196
|
+
<Accordion.Item value="tokens">
|
|
197
|
+
<Accordion.Trigger>Which tokens can pay fees?</Accordion.Trigger>
|
|
198
|
+
<Accordion.Panel>Supported stablecoins, such as PathUSD and USDC.</Accordion.Panel>
|
|
199
|
+
</Accordion.Item>
|
|
200
|
+
</Accordion.Root>
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Don't:** Use labels such as Details, More info, or Other.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
/**
|
|
209
|
+
* Don't example for "Summarize the Panel in the Trigger" on the Accordion page.
|
|
210
|
+
* Don't use labels such as Details, More info, or Other.
|
|
211
|
+
* @module
|
|
212
|
+
*/
|
|
213
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
214
|
+
|
|
215
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
216
|
+
export function Demo() {
|
|
217
|
+
return (
|
|
218
|
+
<Accordion.Root>
|
|
219
|
+
<Accordion.Item value="details">
|
|
220
|
+
<Accordion.Trigger>Details</Accordion.Trigger>
|
|
221
|
+
<Accordion.Panel>Each transfer pays a network fee in a stablecoin.</Accordion.Panel>
|
|
222
|
+
</Accordion.Item>
|
|
223
|
+
<Accordion.Item value="more">
|
|
224
|
+
<Accordion.Trigger>More info</Accordion.Trigger>
|
|
225
|
+
<Accordion.Panel>A payment settles when its block is final.</Accordion.Panel>
|
|
226
|
+
</Accordion.Item>
|
|
227
|
+
<Accordion.Item value="other">
|
|
228
|
+
<Accordion.Trigger>Other</Accordion.Trigger>
|
|
229
|
+
<Accordion.Panel>Supported stablecoins, such as PathUSD and USDC.</Accordion.Panel>
|
|
230
|
+
</Accordion.Item>
|
|
231
|
+
</Accordion.Root>
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Open the Item Most People Need
|
|
237
|
+
|
|
238
|
+
Opening one item closes the others. Open the item most people need with `defaultValue`. If people compare panels, such as two groups of webhook settings, set `multiple`.
|
|
239
|
+
|
|
240
|
+
**Do:** Open one item by default, the one most people need.
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
/**
|
|
244
|
+
* Do example for "Open the Item Most People Need" on the Accordion page.
|
|
245
|
+
* Open one item by default, the one most people need.
|
|
246
|
+
* @module
|
|
247
|
+
*/
|
|
248
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
249
|
+
|
|
250
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
251
|
+
export function Demo() {
|
|
252
|
+
return (
|
|
253
|
+
<Accordion.Root defaultValue={['cost']}>
|
|
254
|
+
<Accordion.Item value="cost">
|
|
255
|
+
<Accordion.Trigger>What does a transfer cost?</Accordion.Trigger>
|
|
256
|
+
<Accordion.Panel>Each transfer pays a network fee in a stablecoin.</Accordion.Panel>
|
|
257
|
+
</Accordion.Item>
|
|
258
|
+
<Accordion.Item value="settle">
|
|
259
|
+
<Accordion.Trigger>When does a payment settle?</Accordion.Trigger>
|
|
260
|
+
<Accordion.Panel>A payment settles when its block is final.</Accordion.Panel>
|
|
261
|
+
</Accordion.Item>
|
|
262
|
+
<Accordion.Item value="tokens">
|
|
263
|
+
<Accordion.Trigger>Which tokens can pay fees?</Accordion.Trigger>
|
|
264
|
+
<Accordion.Panel>Supported stablecoins, such as PathUSD and USDC.</Accordion.Panel>
|
|
265
|
+
</Accordion.Item>
|
|
266
|
+
</Accordion.Root>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Don't:** Open every item when people read one at a time.
|
|
272
|
+
|
|
273
|
+
```tsx
|
|
274
|
+
/**
|
|
275
|
+
* Don't example for "Open the Item Most People Need" on the Accordion page.
|
|
276
|
+
* Don't open every item when people read one at a time.
|
|
277
|
+
* @module
|
|
278
|
+
*/
|
|
279
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
280
|
+
|
|
281
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
282
|
+
export function Demo() {
|
|
283
|
+
return (
|
|
284
|
+
<Accordion.Root defaultValue={['cost', 'settle', 'tokens']} multiple>
|
|
285
|
+
<Accordion.Item value="cost">
|
|
286
|
+
<Accordion.Trigger>What does a transfer cost?</Accordion.Trigger>
|
|
287
|
+
<Accordion.Panel>Each transfer pays a network fee in a stablecoin.</Accordion.Panel>
|
|
288
|
+
</Accordion.Item>
|
|
289
|
+
<Accordion.Item value="settle">
|
|
290
|
+
<Accordion.Trigger>When does a payment settle?</Accordion.Trigger>
|
|
291
|
+
<Accordion.Panel>A payment settles when its block is final.</Accordion.Panel>
|
|
292
|
+
</Accordion.Item>
|
|
293
|
+
<Accordion.Item value="tokens">
|
|
294
|
+
<Accordion.Trigger>Which tokens can pay fees?</Accordion.Trigger>
|
|
295
|
+
<Accordion.Panel>Supported stablecoins, such as PathUSD and USDC.</Accordion.Panel>
|
|
296
|
+
</Accordion.Item>
|
|
297
|
+
</Accordion.Root>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Keep Panels Short and Flat
|
|
303
|
+
|
|
304
|
+
Keep each panel to a few short paragraphs, a list, or a small form. Link to a separate page for more.
|
|
305
|
+
|
|
306
|
+
**Do:** Answer in a sentence or two inside the panel.
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
/**
|
|
310
|
+
* Do example for "Keep Panels Short and Flat" on the Accordion page.
|
|
311
|
+
* Answer in a sentence or two inside the panel.
|
|
312
|
+
* @module
|
|
313
|
+
*/
|
|
314
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
315
|
+
|
|
316
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
317
|
+
export function Demo() {
|
|
318
|
+
return (
|
|
319
|
+
<Accordion.Root defaultValue={['retry']}>
|
|
320
|
+
<Accordion.Item value="retry">
|
|
321
|
+
<Accordion.Trigger>Retry policy</Accordion.Trigger>
|
|
322
|
+
<Accordion.Panel>Failed deliveries retry 5 times over 24 hours.</Accordion.Panel>
|
|
323
|
+
</Accordion.Item>
|
|
324
|
+
<Accordion.Item value="signing">
|
|
325
|
+
<Accordion.Trigger>Signing secret</Accordion.Trigger>
|
|
326
|
+
<Accordion.Panel>Each delivery is signed with the webhook's secret.</Accordion.Panel>
|
|
327
|
+
</Accordion.Item>
|
|
328
|
+
</Accordion.Root>
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Don't:** Nest an accordion inside a panel.
|
|
334
|
+
|
|
335
|
+
```tsx
|
|
336
|
+
/**
|
|
337
|
+
* Don't example for "Keep Panels Short and Flat" on the Accordion page.
|
|
338
|
+
* Don't nest an accordion inside a panel.
|
|
339
|
+
* @module
|
|
340
|
+
*/
|
|
341
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
342
|
+
|
|
343
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
344
|
+
export function Demo() {
|
|
345
|
+
return (
|
|
346
|
+
<Accordion.Root defaultValue={['retry']}>
|
|
347
|
+
<Accordion.Item value="retry">
|
|
348
|
+
<Accordion.Trigger>Retry policy</Accordion.Trigger>
|
|
349
|
+
<Accordion.Panel>
|
|
350
|
+
<Accordion.Root defaultValue={['attempts']} size="small">
|
|
351
|
+
<Accordion.Item value="attempts">
|
|
352
|
+
<Accordion.Trigger>Attempts</Accordion.Trigger>
|
|
353
|
+
<Accordion.Panel>Failed deliveries retry 5 times over 24 hours.</Accordion.Panel>
|
|
354
|
+
</Accordion.Item>
|
|
355
|
+
</Accordion.Root>
|
|
356
|
+
</Accordion.Panel>
|
|
357
|
+
</Accordion.Item>
|
|
358
|
+
<Accordion.Item value="signing">
|
|
359
|
+
<Accordion.Trigger>Signing secret</Accordion.Trigger>
|
|
360
|
+
<Accordion.Panel>Each delivery is signed with the webhook's secret.</Accordion.Panel>
|
|
361
|
+
</Accordion.Item>
|
|
362
|
+
</Accordion.Root>
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Keep Collapsed Content Reachable
|
|
368
|
+
|
|
369
|
+
Closed panels unmount. Set the prop that matches the content, on `Accordion.Root` or an `Accordion.Panel`.
|
|
370
|
+
|
|
371
|
+
* **Searchable Text (hiddenUntilFound):** Lets find in page search closed panels and open the one that matches.
|
|
372
|
+
* **Form Inputs (keepMounted):** Keeps the values of form inputs when their panel closes.
|
|
373
|
+
|
|
374
|
+
### Explain Instead of Disabling
|
|
375
|
+
|
|
376
|
+
A disabled item hides content without a reason. Remove the item, or keep it enabled and explain in the panel what is unavailable.
|
|
377
|
+
|
|
378
|
+
**Do:** Keep the item enabled, and state in the panel when it becomes available.
|
|
379
|
+
|
|
380
|
+
```tsx
|
|
381
|
+
/**
|
|
382
|
+
* Do example for "Explain Instead of Disabling" on the Accordion page.
|
|
383
|
+
* Keep the item enabled, and state in the panel when it becomes available.
|
|
384
|
+
* @module
|
|
385
|
+
*/
|
|
386
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
387
|
+
|
|
388
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
389
|
+
export function Demo() {
|
|
390
|
+
return (
|
|
391
|
+
<Accordion.Root defaultValue={['withdraw']}>
|
|
392
|
+
<Accordion.Item value="deposit">
|
|
393
|
+
<Accordion.Trigger>Deposit funds</Accordion.Trigger>
|
|
394
|
+
<Accordion.Panel>Send USDC to your wallet address.</Accordion.Panel>
|
|
395
|
+
</Accordion.Item>
|
|
396
|
+
<Accordion.Item value="withdraw">
|
|
397
|
+
<Accordion.Trigger>Withdraw funds</Accordion.Trigger>
|
|
398
|
+
<Accordion.Panel>Withdrawals open after you verify your identity.</Accordion.Panel>
|
|
399
|
+
</Accordion.Item>
|
|
400
|
+
</Accordion.Root>
|
|
401
|
+
)
|
|
402
|
+
}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**Don't:** Disable an item without a reason.
|
|
406
|
+
|
|
407
|
+
```tsx
|
|
408
|
+
/**
|
|
409
|
+
* Don't example for "Explain Instead of Disabling" on the Accordion page.
|
|
410
|
+
* Don't disable an item without a reason.
|
|
411
|
+
* @module
|
|
412
|
+
*/
|
|
413
|
+
import { Accordion } from '@tempoxyz/ds'
|
|
414
|
+
|
|
415
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
416
|
+
export function Demo() {
|
|
417
|
+
return (
|
|
418
|
+
<Accordion.Root>
|
|
419
|
+
<Accordion.Item value="deposit">
|
|
420
|
+
<Accordion.Trigger>Deposit funds</Accordion.Trigger>
|
|
421
|
+
<Accordion.Panel>Send USDC to your wallet address.</Accordion.Panel>
|
|
422
|
+
</Accordion.Item>
|
|
423
|
+
<Accordion.Item disabled value="withdraw">
|
|
424
|
+
<Accordion.Trigger>Withdraw funds</Accordion.Trigger>
|
|
425
|
+
<Accordion.Panel>Withdrawals open after you verify your identity.</Accordion.Panel>
|
|
426
|
+
</Accordion.Item>
|
|
427
|
+
</Accordion.Root>
|
|
428
|
+
)
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
## Content
|
|
433
|
+
|
|
434
|
+
* Use questions for help content and nouns for settings groups, such as Retry policy.
|
|
435
|
+
* Keep one form across items: all questions or all nouns.
|
|
436
|
+
* Answer in the first sentence of the panel, then add detail.
|
|
437
|
+
* Don't repeat the trigger at the top of its panel.
|
|
438
|
+
|
|
439
|
+
## Accessibility
|
|
440
|
+
|
|
441
|
+
Each item pairs a heading button with its panel, following the [WAI-ARIA Accordion pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/) for required keys.
|
|
442
|
+
|
|
443
|
+
### Semantics
|
|
444
|
+
|
|
445
|
+
* **Accordion.Trigger (button):** A native button inside a heading, reachable by heading navigation.
|
|
446
|
+
* **Expanded State (aria-expanded):** Reports whether the panel is open. `aria-controls` points at the panel.
|
|
447
|
+
* **Accordion.Panel (region):** Each panel is labelled by its trigger.
|
|
448
|
+
* **Disabled Items (aria-disabled):** A disabled trigger stays in the tab order.
|
|
449
|
+
* **Chevron (aria-hidden):** Hidden from assistive technology.
|
|
450
|
+
|
|
451
|
+
### Keyboard
|
|
452
|
+
|
|
453
|
+
* **Move to the Next Trigger (Tab):** Moves focus to the next trigger or into the open panel.
|
|
454
|
+
* **Move to the Previous Control (Shift+Tab):** Moves focus to the previous trigger or control.
|
|
455
|
+
* **Open or Close the Item (Enter or Space):** Opens or closes the focused item. Without `multiple`, it also closes the open one.
|
|
456
|
+
|
|
457
|
+
The arrow keys do not move focus between triggers.
|
|
458
|
+
|
|
459
|
+
### Focus
|
|
460
|
+
|
|
461
|
+
* **Focus Stays Put:** Focus stays on the trigger when its panel opens or closes.
|
|
462
|
+
* **Closed Panels (keepMounted):** A closed panel unmounts by default and leaves the tab order.
|
|
463
|
+
|
|
464
|
+
### Motion
|
|
465
|
+
|
|
466
|
+
* **Reduced Motion (prefers-reduced-motion):** Panels fade without animating their height, and the chevron flips instantly.
|
|
467
|
+
|
|
468
|
+
### Your Responsibilities
|
|
469
|
+
|
|
470
|
+
* **Fit the Outline (h3):** Triggers render inside an `h3`, so place the accordion under an `h2`.
|
|
471
|
+
* **Keep Triggers Plain:** Don't put controls inside a trigger. It is already a button.
|
|
472
|
+
|
|
473
|
+
## Related
|
|
474
|
+
|
|
475
|
+
[Tabs](tabs.md)
|
|
476
|
+
|
|
477
|
+
Use for switching between views.
|
|
478
|
+
|
|
479
|
+
[ListGroup](list-group.md)
|
|
480
|
+
|
|
481
|
+
Use for expanding a detail under one row.
|
|
482
|
+
|
|
483
|
+
[Stepper](stepper.md)
|
|
484
|
+
|
|
485
|
+
Use for sequential steps.
|
|
486
|
+
|
|
487
|
+
[Surface](surface.md)
|
|
488
|
+
|
|
489
|
+
Use for content that stays visible.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# AddressCard
|
|
2
|
+
|
|
3
|
+
Shows a wallet address to receive funds, with its QR code and networks.
|
|
4
|
+
|
|
5
|
+
[View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/AddressCard.tsx)
|
|
6
|
+
|
|
7
|
+
Figma: [Content/Address Card](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-4005)
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
An address card renders a bordered receive card. A QR code of the address sits beside the shortened address, a copy button, and the networks that the address accepts.
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Basic
|
|
16
|
+
|
|
17
|
+
Pass the full `address`. The card shows its first and last four characters.
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
/** Demonstrates AddressCard in the documentation. @module */
|
|
21
|
+
import { AddressCard, style } from '@tempoxyz/ds'
|
|
22
|
+
|
|
23
|
+
export function Demo() {
|
|
24
|
+
return (
|
|
25
|
+
<div {...styles.frame()}>
|
|
26
|
+
<AddressCard address="0x7a3f2c9b1e4d8a6f0c5b3e7d9a1f4c8e2b6d91c2" />
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
namespace styles {
|
|
32
|
+
export const frame = style({ maxWidth: '28.75rem !custom', width: '100% !custom' })
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/AddressCard/Basic.tsx)
|
|
37
|
+
|
|
38
|
+
### Networks
|
|
39
|
+
|
|
40
|
+
Add `AddressCard.Networks` with one `AddressCard.Network` per network. Set `selected` on the picked one.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
/** Demonstrates AddressCard in the documentation. @module */
|
|
44
|
+
import { AddressCard, style } from '@tempoxyz/ds'
|
|
45
|
+
|
|
46
|
+
export function Demo() {
|
|
47
|
+
return (
|
|
48
|
+
<div {...styles.frame()}>
|
|
49
|
+
<AddressCard address="0x7a3f2c9b1e4d8a6f0c5b3e7d9a1f4c8e2b6d91c2">
|
|
50
|
+
<AddressCard.Networks>
|
|
51
|
+
<AddressCard.Network network="ethereum" selected>
|
|
52
|
+
Ethereum
|
|
53
|
+
</AddressCard.Network>
|
|
54
|
+
<AddressCard.Network network="base">Base</AddressCard.Network>
|
|
55
|
+
<AddressCard.Network network="solana">Solana</AddressCard.Network>
|
|
56
|
+
<AddressCard.Network network="tempo">Tempo</AddressCard.Network>
|
|
57
|
+
</AddressCard.Networks>
|
|
58
|
+
</AddressCard>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
namespace styles {
|
|
64
|
+
export const frame = style({ maxWidth: '28.75rem !custom', width: '100% !custom' })
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/AddressCard/Networks.tsx)
|
|
69
|
+
|
|
70
|
+
## Anatomy
|
|
71
|
+
|
|
72
|
+
Import the component and assemble its parts.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { AddressCard } from '@tempoxyz/ds'
|
|
76
|
+
|
|
77
|
+
<AddressCard>
|
|
78
|
+
<AddressCard.Networks>
|
|
79
|
+
<AddressCard.Network />
|
|
80
|
+
</AddressCard.Networks>
|
|
81
|
+
</AddressCard>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Guidelines
|
|
85
|
+
|
|
86
|
+
### When to Use
|
|
87
|
+
|
|
88
|
+
* Show the address that a person sends funds to, such as on a deposit screen.
|
|
89
|
+
* Let a person scan the address from another device or copy it.
|
|
90
|
+
|
|
91
|
+
### When Not to Use
|
|
92
|
+
|
|
93
|
+
* Use [Hex](hex.md) for an address inside a row or a sentence.
|
|
94
|
+
* Use [Qr](qr.md) alone for a code that encodes something other than an address.
|
|
95
|
+
|
|
96
|
+
### List Only the Accepted Networks
|
|
97
|
+
|
|
98
|
+
**Do:** List the networks that the address accepts.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
<AddressCard address="0x7a3f2c9b1e4d8a6f0c5b3e7d9a1f4c8e2b6d91c2">
|
|
102
|
+
<AddressCard.Networks>
|
|
103
|
+
<AddressCard.Network network="tempo" selected>
|
|
104
|
+
Tempo
|
|
105
|
+
</AddressCard.Network>
|
|
106
|
+
<AddressCard.Network network="base">Base</AddressCard.Network>
|
|
107
|
+
</AddressCard.Networks>
|
|
108
|
+
</AddressCard>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Don't:** Leave out the networks when the address accepts only some of them.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<AddressCard address="0x7a3f2c9b1e4d8a6f0c5b3e7d9a1f4c8e2b6d91c2" />
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Keep the Full Address
|
|
118
|
+
|
|
119
|
+
Pass the whole address. The card shortens the text, and the copy button and QR code use the full value.
|
|
120
|
+
|
|
121
|
+
## Content
|
|
122
|
+
|
|
123
|
+
* **Label:** Name the address from the reader's view, such as Your wallet address.
|
|
124
|
+
* **Networks:** Name each network as its brand does, such as Ethereum or Base.
|
|
125
|
+
|
|
126
|
+
## Accessibility
|
|
127
|
+
|
|
128
|
+
The card renders a `<div>` with no role. Screen readers read the full address, the named QR code, the copy button, and the network group.
|
|
129
|
+
|
|
130
|
+
* **Address (Full value):** Screen readers read every character, not the shortened text.
|
|
131
|
+
* **Copy (button):** The copy button announces Copied after a copy.
|
|
132
|
+
* **Networks (group):** The label names the group of network chips.
|
|
133
|
+
* **Pick a Network (aria-pressed):** A chip with an onClick announces its selected state.
|
|
134
|
+
|
|
135
|
+
## Related
|
|
136
|
+
|
|
137
|
+
[Hex](hex.md)
|
|
138
|
+
|
|
139
|
+
Use for an address inside a row or a sentence.
|
|
140
|
+
|
|
141
|
+
[Qr](qr.md)
|
|
142
|
+
|
|
143
|
+
Use for a QR code of another value.
|
|
144
|
+
|
|
145
|
+
[AssetChip](asset-chip.md)
|
|
146
|
+
|
|
147
|
+
Use for the chips of supported assets.
|