@tempoxyz/ds 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/package.json +1 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Container
|
|
2
|
+
|
|
3
|
+
Centers content at a maximum width.
|
|
4
|
+
|
|
5
|
+
[View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Container.tsx)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
A container centers content at a maximum width, with inline padding that grows on wider viewports. It sets width only.
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Container, Inline, Inset, Stack, style } from '@tempoxyz/ds'
|
|
17
|
+
|
|
18
|
+
export const fill = true
|
|
19
|
+
export function Demo() {
|
|
20
|
+
return (
|
|
21
|
+
<Container size="narrow">
|
|
22
|
+
<Stack gap="24">
|
|
23
|
+
<Inline justify="between">
|
|
24
|
+
<span>Stack, Inline and Container</span>
|
|
25
|
+
<Inline gap="8">
|
|
26
|
+
<span {...styles.chip()}>Public</span>
|
|
27
|
+
<span {...styles.chip()}>Private</span>
|
|
28
|
+
</Inline>
|
|
29
|
+
</Inline>
|
|
30
|
+
<Inset space="24" {...styles.card()}>
|
|
31
|
+
<Stack gap="12">
|
|
32
|
+
<span>Card content</span>
|
|
33
|
+
<span>Second line</span>
|
|
34
|
+
</Stack>
|
|
35
|
+
</Inset>
|
|
36
|
+
</Stack>
|
|
37
|
+
</Container>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
namespace styles {
|
|
42
|
+
export const card = style({ backgroundColor: 'background.elevated', borderRadius: 'sm' })
|
|
43
|
+
|
|
44
|
+
export const chip = style({
|
|
45
|
+
backgroundColor: 'container.regular',
|
|
46
|
+
borderRadius: 'full',
|
|
47
|
+
cornerShape: 'round',
|
|
48
|
+
paddingBlock: '4',
|
|
49
|
+
paddingInline: '12',
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Container/Basic.tsx)
|
|
55
|
+
|
|
56
|
+
### Size
|
|
57
|
+
|
|
58
|
+
Set `size` to `narrow`, `medium`, `wide` (default), or `full`.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { Container, Inset, Stack, style } from '@tempoxyz/ds'
|
|
62
|
+
|
|
63
|
+
export const fill = true
|
|
64
|
+
export function Demo() {
|
|
65
|
+
return (
|
|
66
|
+
<Stack gap="12">
|
|
67
|
+
{(['narrow', 'medium', 'wide', 'full'] as const).map((size) => (
|
|
68
|
+
<Container key={size} size={size}>
|
|
69
|
+
<Inset space="16" {...styles.card()}>
|
|
70
|
+
{size}
|
|
71
|
+
</Inset>
|
|
72
|
+
</Container>
|
|
73
|
+
))}
|
|
74
|
+
</Stack>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
namespace styles {
|
|
79
|
+
export const card = style({ backgroundColor: 'background.elevated', borderRadius: 'sm' })
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Container/Size.tsx)
|
|
84
|
+
|
|
85
|
+
### Gutter
|
|
86
|
+
|
|
87
|
+
Set `gutter={false}` to remove the inline padding.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { Container, Inset, Stack, style } from '@tempoxyz/ds'
|
|
91
|
+
|
|
92
|
+
export const fill = true
|
|
93
|
+
export function Demo() {
|
|
94
|
+
return (
|
|
95
|
+
<Stack gap="12">
|
|
96
|
+
<Container size="narrow">
|
|
97
|
+
<Inset space="16" {...styles.card()}>
|
|
98
|
+
With gutter
|
|
99
|
+
</Inset>
|
|
100
|
+
</Container>
|
|
101
|
+
<Container gutter={false} size="narrow">
|
|
102
|
+
<Inset space="16" {...styles.card()}>
|
|
103
|
+
Without gutter
|
|
104
|
+
</Inset>
|
|
105
|
+
</Container>
|
|
106
|
+
</Stack>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
namespace styles {
|
|
111
|
+
export const card = style({ backgroundColor: 'background.elevated', borderRadius: 'sm' })
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Container/Gutter.tsx)
|
|
116
|
+
|
|
117
|
+
## Anatomy
|
|
118
|
+
|
|
119
|
+
Import the component and assemble its parts.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { Container } from '@tempoxyz/ds'
|
|
123
|
+
|
|
124
|
+
<Container />
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Guidelines
|
|
128
|
+
|
|
129
|
+
### When to Use
|
|
130
|
+
|
|
131
|
+
* Center content on pages without a sidebar, such as sign-in or a receipt.
|
|
132
|
+
* Cap the width of a full-width band, such as a header, to line it up with the page.
|
|
133
|
+
|
|
134
|
+
### When Not to Use
|
|
135
|
+
|
|
136
|
+
* Use [AppShell](/docs/components/app-shell) for pages with persistent navigation. `AppShell.Main` already caps and pads the content column.
|
|
137
|
+
* Use [Inset](/docs/components/inset) to pad content inside a region, and [Surface](/docs/components/surface) for a card.
|
|
138
|
+
* Use [Stack](/docs/components/stack) or [Grid](/docs/components/grid) to arrange the content inside the container.
|
|
139
|
+
|
|
140
|
+
### Pick a Size by Content
|
|
141
|
+
|
|
142
|
+
* **Narrow (48rem):** Forms, settings, sign-in, and a send flow.
|
|
143
|
+
* **Medium (64rem):** Detail pages, such as a transaction or API key.
|
|
144
|
+
* **Wide (80rem):** The default, for dashboards and tables.
|
|
145
|
+
* **Full (none):** Edge-to-edge charts and maps.
|
|
146
|
+
|
|
147
|
+
Give body text in a `wide` container its own narrower column.
|
|
148
|
+
|
|
149
|
+
### Keep the Gutter on Page Containers
|
|
150
|
+
|
|
151
|
+
Keep the gutter on any container that touches the viewport edge. If a parent already pads the content, set `gutter={false}`.
|
|
152
|
+
|
|
153
|
+
**Do:** Keep the gutter, so content stays off the screen edge.
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
/**
|
|
157
|
+
* Do example for "Keep the Gutter on Page Containers" on the Container page.
|
|
158
|
+
* Keep the gutter, so content stays off the screen edge.
|
|
159
|
+
* @module
|
|
160
|
+
*/
|
|
161
|
+
import { Container, style, Surface } from '@tempoxyz/ds'
|
|
162
|
+
|
|
163
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
164
|
+
export function Demo() {
|
|
165
|
+
return (
|
|
166
|
+
<div {...styles.viewport()}>
|
|
167
|
+
<Container size="narrow" {...styles.page()}>
|
|
168
|
+
<h1 {...styles.title()}>Send payment</h1>
|
|
169
|
+
<Surface size="medium">Recipient 0x71C7…976F</Surface>
|
|
170
|
+
</Container>
|
|
171
|
+
</div>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
namespace styles {
|
|
176
|
+
export const page = style({ display: 'flex', flexDirection: 'column', gap: '12' })
|
|
177
|
+
|
|
178
|
+
export const title = style({ margin: '0', typography: 'heading.h3' })
|
|
179
|
+
|
|
180
|
+
export const viewport = style({
|
|
181
|
+
backgroundColor: 'background.primary',
|
|
182
|
+
borderRadius: 'sm',
|
|
183
|
+
boxSizing: 'border-box',
|
|
184
|
+
paddingBlock: '24',
|
|
185
|
+
width: '100% !custom',
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Don't:** Remove the gutter from a container at the viewport edge.
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
/**
|
|
194
|
+
* Don't example for "Keep the Gutter on Page Containers" on the Container page.
|
|
195
|
+
* Don't remove the gutter from a container at the viewport edge.
|
|
196
|
+
* @module
|
|
197
|
+
*/
|
|
198
|
+
import { Container, style, Surface } from '@tempoxyz/ds'
|
|
199
|
+
|
|
200
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
201
|
+
export function Demo() {
|
|
202
|
+
return (
|
|
203
|
+
<div {...styles.viewport()}>
|
|
204
|
+
<Container gutter={false} size="narrow" {...styles.page()}>
|
|
205
|
+
<h1 {...styles.title()}>Send payment</h1>
|
|
206
|
+
<Surface size="medium">Recipient 0x71C7…976F</Surface>
|
|
207
|
+
</Container>
|
|
208
|
+
</div>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
namespace styles {
|
|
213
|
+
export const page = style({ display: 'flex', flexDirection: 'column', gap: '12' })
|
|
214
|
+
|
|
215
|
+
export const title = style({ margin: '0', typography: 'heading.h3' })
|
|
216
|
+
|
|
217
|
+
export const viewport = style({
|
|
218
|
+
backgroundColor: 'background.primary',
|
|
219
|
+
borderRadius: 'sm',
|
|
220
|
+
boxSizing: 'border-box',
|
|
221
|
+
paddingBlock: '24',
|
|
222
|
+
width: '100% !custom',
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Accessibility
|
|
228
|
+
|
|
229
|
+
A container has no role, name, or keyboard behavior.
|
|
230
|
+
|
|
231
|
+
### Semantics
|
|
232
|
+
|
|
233
|
+
* **Default Element (div):** Carries no role by default.
|
|
234
|
+
* **Semantic Element (render):** Set a landmark with `render={<main />}`.
|
|
235
|
+
|
|
236
|
+
### Your Responsibilities
|
|
237
|
+
|
|
238
|
+
* **Render Landmarks Directly (render):** Render `main` on the container, not on an extra wrapper, and don't nest a second `main` inside it.
|
|
239
|
+
* **Reflow at 320px (SC 1.4.10):** Content must [reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html) without horizontal scrolling. Check addresses and hashes.
|
|
240
|
+
|
|
241
|
+
## Related
|
|
242
|
+
|
|
243
|
+
[AppShell](/docs/components/app-shell)
|
|
244
|
+
|
|
245
|
+
Use for pages with a sidebar.
|
|
246
|
+
|
|
247
|
+
[Stack](/docs/components/stack)
|
|
248
|
+
|
|
249
|
+
Use for spacing content inside the container.
|
|
250
|
+
|
|
251
|
+
[Layout](/docs/foundations/layout)
|
|
252
|
+
|
|
253
|
+
Covers widths, spacing, and breakpoints.
|
|
254
|
+
|
|
255
|
+
[Responsive Layout](/docs/patterns/responsive-layout)
|
|
256
|
+
|
|
257
|
+
Covers adapting pages across breakpoints.
|