@tempoxyz/ds 0.3.14 → 0.3.16

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 (209) hide show
  1. package/dist/docs/AGENTS.md +75 -10
  2. package/dist/docs/arsenal.md +44 -0
  3. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +32 -24
  4. package/dist/docs/product/components/actions.md +2110 -0
  5. package/dist/docs/product/components/blockchain.md +3969 -0
  6. package/dist/docs/product/components/data-display.md +5901 -0
  7. package/dist/docs/product/components/feedback-and-status.md +4138 -0
  8. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  9. package/dist/docs/product/components/layout.md +3339 -0
  10. package/dist/docs/product/components/navigation.md +2914 -0
  11. package/dist/docs/product/components/overlays.md +4917 -0
  12. package/dist/docs/product/components.md +125 -125
  13. package/dist/docs/product/foundations.md +4597 -0
  14. package/dist/docs/product/patterns.md +10110 -0
  15. package/dist/marketing/index.js.zyzz.json +1 -1
  16. package/dist/marketing/vars.d.ts +618 -758
  17. package/dist/marketing/vars.d.ts.map +1 -1
  18. package/dist/marketing/vars.js +8 -5
  19. package/dist/marketing/vars.js.map +1 -1
  20. package/dist/marketing/vars.js.zyzz.json +1 -1
  21. package/dist/marketing/zyzz.config.d.ts +3042 -3757
  22. package/dist/marketing/zyzz.config.d.ts.map +1 -1
  23. package/dist/marketing/zyzz.config.js +1 -1
  24. package/dist/marketing/zyzz.config.js.map +1 -1
  25. package/dist/marketing/zyzz.config.js.zyzz.json +1 -1
  26. package/dist/mobile/components/Button.d.ts +115 -15
  27. package/dist/mobile/components/Button.d.ts.map +1 -1
  28. package/dist/mobile/components/Button.js +85 -14
  29. package/dist/mobile/components/Button.js.map +1 -1
  30. package/dist/mobile/components/IconButton.d.ts +129 -40
  31. package/dist/mobile/components/IconButton.d.ts.map +1 -1
  32. package/dist/mobile/components/IconButton.js +97 -28
  33. package/dist/mobile/components/IconButton.js.map +1 -1
  34. package/dist/mobile/components/TextInput.d.ts +132 -11
  35. package/dist/mobile/components/TextInput.d.ts.map +1 -1
  36. package/dist/mobile/components/TextInput.js +115 -14
  37. package/dist/mobile/components/TextInput.js.map +1 -1
  38. package/dist/mobile/index.d.ts +1 -0
  39. package/dist/mobile/index.d.ts.map +1 -1
  40. package/dist/mobile/index.js +1 -0
  41. package/dist/mobile/index.js.map +1 -1
  42. package/dist/mobile/vars.d.ts +103 -0
  43. package/dist/mobile/vars.d.ts.map +1 -1
  44. package/dist/mobile/vars.js +74 -0
  45. package/dist/mobile/vars.js.map +1 -1
  46. package/dist/mobile/zyzz.config.d.ts +408 -0
  47. package/dist/mobile/zyzz.config.d.ts.map +1 -1
  48. package/dist/web/components/AddressCard.js.zyzz.json +1 -1
  49. package/dist/web/components/Amount.css +1 -1
  50. package/dist/web/components/Amount.d.ts +9 -0
  51. package/dist/web/components/Amount.d.ts.map +1 -1
  52. package/dist/web/components/Amount.js +8 -5
  53. package/dist/web/components/Amount.js.map +1 -1
  54. package/dist/web/components/Amount.js.zyzz.json +1 -1
  55. package/dist/web/components/CopyButton.d.ts +6 -0
  56. package/dist/web/components/CopyButton.d.ts.map +1 -1
  57. package/dist/web/components/CopyButton.js +4 -1
  58. package/dist/web/components/CopyButton.js.map +1 -1
  59. package/dist/web/components/CopyButton.js.zyzz.json +1 -1
  60. package/dist/web/components/Hex.css +1 -1
  61. package/dist/web/components/Hex.d.ts +84 -3
  62. package/dist/web/components/Hex.d.ts.map +1 -1
  63. package/dist/web/components/Hex.js +20 -13
  64. package/dist/web/components/Hex.js.map +1 -1
  65. package/dist/web/components/Hex.js.zyzz.json +1 -1
  66. package/dist/web/components/Progress.css +1 -1
  67. package/dist/web/components/Progress.d.ts +12 -2
  68. package/dist/web/components/Progress.d.ts.map +1 -1
  69. package/dist/web/components/Progress.js +9 -5
  70. package/dist/web/components/Progress.js.map +1 -1
  71. package/dist/web/components/Progress.js.zyzz.json +1 -1
  72. package/dist/web/components/SecretValue.js.zyzz.json +1 -1
  73. package/dist/web/components/SidebarMenu.d.ts +4 -4
  74. package/dist/web/components/SidebarMenu.js +6 -6
  75. package/dist/web/components/SidebarMenu.js.map +1 -1
  76. package/dist/web/components/Snippet.js.zyzz.json +1 -1
  77. package/dist/web/index.js.zyzz.json +1 -1
  78. package/package.json +1 -1
  79. package/src/marketing/README.md +1 -1
  80. package/src/marketing/vars.ts +526 -604
  81. package/src/marketing/zyzz.config.ts +5 -4
  82. package/src/mobile/README.md +19 -6
  83. package/src/mobile/components/Button.tsx +94 -17
  84. package/src/mobile/components/IconButton.tsx +122 -30
  85. package/src/mobile/components/TextInput.tsx +139 -24
  86. package/src/mobile/index.ts +1 -0
  87. package/src/mobile/vars.ts +74 -0
  88. package/src/web/components/Amount.tsx +37 -3
  89. package/src/web/components/CopyButton.tsx +8 -0
  90. package/src/web/components/Hex.tsx +79 -13
  91. package/src/web/components/Progress.tsx +8 -2
  92. package/src/web/components/SidebarMenu.tsx +6 -6
  93. package/dist/docs/index.md +0 -145
  94. package/dist/docs/product/components/accordion.md +0 -489
  95. package/dist/docs/product/components/address-card.md +0 -147
  96. package/dist/docs/product/components/agent-logo.md +0 -194
  97. package/dist/docs/product/components/alert-dialog.md +0 -631
  98. package/dist/docs/product/components/alert.md +0 -448
  99. package/dist/docs/product/components/amount-input.md +0 -305
  100. package/dist/docs/product/components/amount.md +0 -794
  101. package/dist/docs/product/components/app-shell.md +0 -559
  102. package/dist/docs/product/components/asset-chip.md +0 -294
  103. package/dist/docs/product/components/autocomplete.md +0 -620
  104. package/dist/docs/product/components/avatar.md +0 -321
  105. package/dist/docs/product/components/badge.md +0 -339
  106. package/dist/docs/product/components/badged-logo.md +0 -116
  107. package/dist/docs/product/components/banner.md +0 -379
  108. package/dist/docs/product/components/bar-chart.md +0 -208
  109. package/dist/docs/product/components/breadcrumbs.md +0 -380
  110. package/dist/docs/product/components/button-group.md +0 -286
  111. package/dist/docs/product/components/button.md +0 -650
  112. package/dist/docs/product/components/calendar.md +0 -375
  113. package/dist/docs/product/components/callout.md +0 -96
  114. package/dist/docs/product/components/checkbox-group.md +0 -521
  115. package/dist/docs/product/components/checkbox.md +0 -467
  116. package/dist/docs/product/components/choice-group.md +0 -516
  117. package/dist/docs/product/components/choicebox.md +0 -641
  118. package/dist/docs/product/components/code.md +0 -100
  119. package/dist/docs/product/components/combobox.md +0 -939
  120. package/dist/docs/product/components/container.md +0 -257
  121. package/dist/docs/product/components/copy-button.md +0 -642
  122. package/dist/docs/product/components/date-picker.md +0 -514
  123. package/dist/docs/product/components/dialog.md +0 -1332
  124. package/dist/docs/product/components/drawer.md +0 -966
  125. package/dist/docs/product/components/empty.md +0 -340
  126. package/dist/docs/product/components/field.md +0 -570
  127. package/dist/docs/product/components/fieldset.md +0 -398
  128. package/dist/docs/product/components/frame.md +0 -434
  129. package/dist/docs/product/components/gauge.md +0 -299
  130. package/dist/docs/product/components/get-started-visual.md +0 -117
  131. package/dist/docs/product/components/grid.md +0 -288
  132. package/dist/docs/product/components/hero-visual.md +0 -155
  133. package/dist/docs/product/components/hex.md +0 -487
  134. package/dist/docs/product/components/icon-tile.md +0 -292
  135. package/dist/docs/product/components/identicon.md +0 -371
  136. package/dist/docs/product/components/inline.md +0 -233
  137. package/dist/docs/product/components/inset.md +0 -225
  138. package/dist/docs/product/components/kbd.md +0 -423
  139. package/dist/docs/product/components/list-group.md +0 -981
  140. package/dist/docs/product/components/loading-dots.md +0 -237
  141. package/dist/docs/product/components/menu.md +0 -934
  142. package/dist/docs/product/components/native-select.md +0 -204
  143. package/dist/docs/product/components/network-logo.md +0 -248
  144. package/dist/docs/product/components/number-field.md +0 -543
  145. package/dist/docs/product/components/otp-field.md +0 -616
  146. package/dist/docs/product/components/pagination.md +0 -516
  147. package/dist/docs/product/components/popover.md +0 -544
  148. package/dist/docs/product/components/progress.md +0 -388
  149. package/dist/docs/product/components/qr.md +0 -314
  150. package/dist/docs/product/components/radio-group.md +0 -528
  151. package/dist/docs/product/components/secret-value.md +0 -406
  152. package/dist/docs/product/components/select.md +0 -751
  153. package/dist/docs/product/components/separator.md +0 -379
  154. package/dist/docs/product/components/sidebar-menu.md +0 -922
  155. package/dist/docs/product/components/skeleton.md +0 -517
  156. package/dist/docs/product/components/slider.md +0 -539
  157. package/dist/docs/product/components/snippet.md +0 -424
  158. package/dist/docs/product/components/spinner.md +0 -216
  159. package/dist/docs/product/components/split-bar.md +0 -139
  160. package/dist/docs/product/components/split-button.md +0 -464
  161. package/dist/docs/product/components/stack.md +0 -299
  162. package/dist/docs/product/components/status-chip.md +0 -226
  163. package/dist/docs/product/components/status-indicator.md +0 -119
  164. package/dist/docs/product/components/status-row.md +0 -174
  165. package/dist/docs/product/components/stepper.md +0 -451
  166. package/dist/docs/product/components/success-hero.md +0 -157
  167. package/dist/docs/product/components/surface.md +0 -639
  168. package/dist/docs/product/components/switch.md +0 -472
  169. package/dist/docs/product/components/table.md +0 -968
  170. package/dist/docs/product/components/tabs.md +0 -627
  171. package/dist/docs/product/components/tempo-logo.md +0 -185
  172. package/dist/docs/product/components/text-input.md +0 -624
  173. package/dist/docs/product/components/textarea.md +0 -352
  174. package/dist/docs/product/components/toast.md +0 -535
  175. package/dist/docs/product/components/token-logo.md +0 -371
  176. package/dist/docs/product/components/token.md +0 -247
  177. package/dist/docs/product/components/tooltip.md +0 -490
  178. package/dist/docs/product/components/verification-code.md +0 -116
  179. package/dist/docs/product/components/visual.md +0 -249
  180. package/dist/docs/product/foundations/accessibility.md +0 -377
  181. package/dist/docs/product/foundations/agents.md +0 -159
  182. package/dist/docs/product/foundations/color.md +0 -522
  183. package/dist/docs/product/foundations/content/tone.md +0 -194
  184. package/dist/docs/product/foundations/content/voice.md +0 -194
  185. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  186. package/dist/docs/product/foundations/iconography.md +0 -282
  187. package/dist/docs/product/foundations/intent.md +0 -360
  188. package/dist/docs/product/foundations/layout.md +0 -508
  189. package/dist/docs/product/foundations/linter.md +0 -523
  190. package/dist/docs/product/foundations/motion.md +0 -151
  191. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  192. package/dist/docs/product/foundations/typography.md +0 -331
  193. package/dist/docs/product/introduction/faq.md +0 -133
  194. package/dist/docs/product/introduction/getting-started.md +0 -377
  195. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  196. package/dist/docs/product/patterns/dashboards.md +0 -638
  197. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  198. package/dist/docs/product/patterns/empty-states.md +0 -612
  199. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  200. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  201. package/dist/docs/product/patterns/forms.md +0 -679
  202. package/dist/docs/product/patterns/loading.md +0 -630
  203. package/dist/docs/product/patterns/navigation.md +0 -397
  204. package/dist/docs/product/patterns/payments.md +0 -765
  205. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  206. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  207. package/dist/docs/product/products/tempo-console.md +0 -671
  208. package/dist/docs/product/products/tempo-performance.md +0 -435
  209. package/dist/docs/product/products/tempo-wallet.md +0 -438
@@ -1,559 +0,0 @@
1
- # AppShell
2
-
3
- Places a sticky sidebar beside the main content column.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/AppShell.tsx)
6
-
7
- Figma: [Layout/App Shell](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-5593) (`AppShell.Root`), [Layout/Page Header](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-5633) (`AppShell.Header`), [Navigation/Tab Bar](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5265-2292) (`AppShell.Root`)
8
-
9
- ## Overview
10
-
11
- The outer frame of an application. Below 1024px, the sidebar moves into a drawer, which a menu button in a bottom bar opens. With `collapse`, the sidebar collapses to its icons until 768px instead. The bottom bar also repeats the items you choose.
12
-
13
- ## Examples
14
-
15
- ### Basic
16
-
17
- ```tsx
18
- /** Composes the Tempo Wallet shell: the account row, the wallet pages, the theme item and a page header. @module */
19
- import { AppShell, Avatar, Hex, Kbd, Menu, SidebarMenu, StatusChip, style, Surface } from '@tempoxyz/ds'
20
- import { Clock, DarkMode, Home, Link, LogOut, Plus, Wallet } from '@tempoxyz/ds/icons'
21
-
22
- export const fill = true
23
- const address = '0x7a3f2c19b0e4d85a6f1c3e9b2d7a40c58e6f91c2'
24
-
25
- const balances = ['pathUSD', 'USDC.e', 'AlphaUSD']
26
-
27
- export function Demo() {
28
- return (
29
- <div {...styles.frame()}>
30
- <AppShell.Root
31
- align="start"
32
- collapse
33
- style={{ height: '100%', minHeight: 0, overflowY: 'auto' }}
34
- >
35
- <AppShell.Sidebar aria-label="Wallet" style={{ height: '100%' }}>
36
- <AppShell.SidebarHeader>
37
- <Menu.Root>
38
- <Menu.Trigger
39
- render={<SidebarMenu.AccountRow description="Tempo Wallet" label="Piril Akay" />}
40
- >
41
- <Avatar size="32">
42
- <Avatar.Fallback>PA</Avatar.Fallback>
43
- </Avatar>
44
- </Menu.Trigger>
45
- <Menu.Popup>
46
- <Menu.Item>
47
- <Plus />
48
- Add account
49
- </Menu.Item>
50
- <Menu.Separator />
51
- <Menu.Item intent="negative">
52
- <LogOut />
53
- Sign out
54
- </Menu.Item>
55
- </Menu.Popup>
56
- </Menu.Root>
57
- </AppShell.SidebarHeader>
58
- <AppShell.SidebarBody>
59
- <SidebarMenu.Root>
60
- <SidebarMenu.Group aria-label="Wallet">
61
- <SidebarMenu.Item active href="#" tabBar="tab">
62
- <Home />
63
- Home
64
- </SidebarMenu.Item>
65
- <SidebarMenu.Item href="#" tabBar="tab">
66
- <Clock />
67
- Activity
68
- </SidebarMenu.Item>
69
- <SidebarMenu.Item href="#" tabBar="tab">
70
- <Wallet />
71
- Assets
72
- </SidebarMenu.Item>
73
- <SidebarMenu.Item href="#">
74
- <Link />
75
- Connections
76
- </SidebarMenu.Item>
77
- </SidebarMenu.Group>
78
- </SidebarMenu.Root>
79
- </AppShell.SidebarBody>
80
- <AppShell.SidebarFooter>
81
- <SidebarMenu.Root aria-label="Preferences">
82
- <SidebarMenu.Item render={<button type="button" />}>
83
- <DarkMode />
84
- <span {...styles.grow()}>Dark mode</span>
85
- <Kbd alt size="small">
86
- M
87
- </Kbd>
88
- </SidebarMenu.Item>
89
- </SidebarMenu.Root>
90
- </AppShell.SidebarFooter>
91
- </AppShell.Sidebar>
92
- <AppShell.Main>
93
- <AppShell.Header>
94
- <AppShell.Title>Home</AppShell.Title>
95
- <div {...styles.actions()}>
96
- <StatusChip intent="positive" network>
97
- Mainnet
98
- </StatusChip>
99
- <Hex.Root size="small" value={address} variant="filled" {...styles.address()}>
100
- <Hex.Text />
101
- <Hex.Copy aria-label="Copy wallet address" />
102
- </Hex.Root>
103
- </div>
104
- <AppShell.Trigger />
105
- </AppShell.Header>
106
- <div {...styles.list()}>
107
- {balances.map((balance) => (
108
- <Surface key={balance}>
109
- <p {...styles.name()}>{balance}</p>
110
- <p {...styles.caption()}>Available to send</p>
111
- </Surface>
112
- ))}
113
- </div>
114
- </AppShell.Main>
115
- </AppShell.Root>
116
- </div>
117
- )
118
- }
119
-
120
- namespace styles {
121
- // The bottom bar takes over below 768px, so the header keeps only its title.
122
- export const actions = style({
123
- alignItems: 'center',
124
- columnGap: '8',
125
- display: 'flex',
126
- '@media (max-width: 767px)': { display: 'none' },
127
- })
128
-
129
- export const address = style({ maxWidth: '10rem !custom' })
130
-
131
- export const caption = style({ color: 'content.secondary', margin: '0', typography: 'body.b3' })
132
-
133
- // The transform makes the frame the containing block for the mobile drawer.
134
- export const frame = style({
135
- borderRadius: 'sm',
136
- height: '32rem !custom',
137
- overflow: 'hidden',
138
- transform: 'translateZ(0) !custom',
139
- selectors: {
140
- // The maximized gallery preview shows the shell at full window height.
141
- ':root[data-maximized] &': { borderRadius: '0px !custom', height: '100vh !custom' },
142
- },
143
- })
144
-
145
- export const grow = style({ flex: '1 !custom', minWidth: '0 !custom' })
146
-
147
- export const list = style({ display: 'flex', flexDirection: 'column', rowGap: '12' })
148
-
149
- export const name = style({ margin: '0', typography: 'body.b2' })
150
- }
151
- ```
152
-
153
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/AppShell/Basic.tsx)
154
-
155
- ## Anatomy
156
-
157
- Import the component and assemble its parts.
158
-
159
- ```tsx
160
- import { AppShell } from '@tempoxyz/ds'
161
-
162
- <AppShell.Root>
163
- <AppShell.Sidebar>
164
- <AppShell.SidebarHeader />
165
- <AppShell.SidebarBody />
166
- <AppShell.SidebarFooter />
167
- </AppShell.Sidebar>
168
- <AppShell.Main>
169
- <AppShell.Header>
170
- <AppShell.Title />
171
- </AppShell.Header>
172
- </AppShell.Main>
173
- <AppShell.Trigger />
174
- </AppShell.Root>
175
- ```
176
-
177
- ## Guidelines
178
-
179
- ### When to Use
180
-
181
- * Frame a product with persistent navigation, such as Tempo Console or the web wallet. Render it once, in the root layout.
182
- * Pair a [SidebarMenu](sidebar-menu.md) with a content column of tables, cards, or settings.
183
-
184
- ### When Not to Use
185
-
186
- * Use [Container](container.md) for pages without persistent navigation, such as sign-in, onboarding, or a public receipt.
187
- * Use [Dialog](dialog.md), or a full-screen flow in a [Container](container.md), for focused tasks such as Send payment.
188
- * Use [Drawer](drawer.md) for a details or filter panel that opens on demand. The shell's drawer holds only primary navigation.
189
- * Use [Frame](frame.md) for a header, body, and footer inside a card or popup.
190
-
191
- ### Plan for Each Layout
192
-
193
- The shell switches layouts at 768px and 1024px (the `'768'` and `'1024'` breakpoints). Design and test each.
194
-
195
- * **Below 768px (Bottom bar):** The sidebar becomes a drawer from the right edge, and a bottom bar holds the chosen items and the menu button.
196
- * **768px to 1023px (collapse):** The drawer and bottom bar by default. With `collapse`, a 64px column of icons that keep their labels as names.
197
- * **1024px and Up (28px padding):** The sidebar sticks beside the content with its own scroll, and the bottom bar hides.
198
-
199
- The drawer is `min(18rem, 85vw)` wide. Server rendering emits the inline sidebar, and CSS hides it below 1024px, or collapses it until 768px with `collapse`.
200
-
201
- ### Always Render the Trigger
202
-
203
- Render `AppShell.Trigger` once inside `AppShell.Root`. It adds the menu button to the end of the bottom bar, so the header keeps its full width for the title and actions.
204
-
205
- **Do:** Render the trigger once in the shell.
206
-
207
- ```tsx
208
- /**
209
- * Do example for "Always Render the Trigger" on the AppShell page.
210
- * Render the trigger once in the shell.
211
- * @module
212
- */
213
- import { Button, style, Surface } from '@tempoxyz/ds'
214
- import { Menu } from '@tempoxyz/ds/icons'
215
-
216
- /** Renders the static preview, which the guideline card shows inert. */
217
- export function Demo() {
218
- return (
219
- <Surface size="small" {...styles.frame()}>
220
- <span {...styles.title()}>Balances</span>
221
- <div {...styles.bar()}>
222
- <Button aria-label="Open menu" shape="icon" size="small">
223
- <Menu />
224
- </Button>
225
- </div>
226
- </Surface>
227
- )
228
- }
229
-
230
- namespace styles {
231
- export const bar = style({ display: 'flex', justifyContent: 'flex-end' })
232
-
233
- export const frame = style({
234
- display: 'flex',
235
- flexDirection: 'column',
236
- gap: '24',
237
- width: '18rem !custom',
238
- })
239
-
240
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
241
- }
242
- ```
243
-
244
- **Don't:** Leave it out. Below 1024px, or 768px with `collapse`, it is the only way to reach every
245
- destination.
246
-
247
- ```tsx
248
- /**
249
- * Don't example for "Always Render the Trigger" on the AppShell page.
250
- * Don't leave it out. Below 1024px, it is the only way to reach navigation.
251
- * @module
252
- */
253
- import { style, Surface } from '@tempoxyz/ds'
254
-
255
- /** Renders the static preview, which the guideline card shows inert. */
256
- export function Demo() {
257
- return (
258
- <Surface size="small" {...styles.frame()}>
259
- <span {...styles.title()}>Balances</span>
260
- <div {...styles.bar()} />
261
- </Surface>
262
- )
263
- }
264
-
265
- namespace styles {
266
- // Matches the height of the bottom bar in the Do example, so only the missing button differs.
267
- export const bar = style({ minHeight: '32' })
268
-
269
- export const frame = style({
270
- display: 'flex',
271
- flexDirection: 'column',
272
- gap: '24',
273
- width: '18rem !custom',
274
- })
275
-
276
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
277
- }
278
- ```
279
-
280
- ### Choose an Alignment
281
-
282
- * **Centered (center):** The default. Centers the sidebar beside a content column up to 1024px wide.
283
- * **Start (start):** Pins the sidebar left, and the content fills the row. Use it for wide data views.
284
-
285
- ### Structure the Sidebar
286
-
287
- * **AppShell.SidebarHeader:** Holds the product or project switcher at the top of the sidebar.
288
- * **AppShell.SidebarBody:** Holds the sidebar menu. It scrolls on its own and fades the edge with more content.
289
- * **AppShell.SidebarFooter:** Holds the account row and other controls, pinned to the bottom edge.
290
-
291
- Keep the header and footer short so the menu keeps most of the height. Set `--sidebar-width` to change the width of the wide sidebar.
292
-
293
- ### Choose the Bottom Bar Items
294
-
295
- Wherever the drawer replaces the sidebar, a bottom bar repeats the [SidebarMenu](sidebar-menu.md) items that set `tabBar`, in sidebar order, and ends with the menu button. Keep the rest in the drawer.
296
-
297
- * **Tab (tabBar="tab"):** Shows the icon in the tab bar pill. Choose up to three top destinations.
298
- * **Action (tabBar="action"):** Shows the icon in a floating button beside the pill. Choose one main action.
299
-
300
- ```tsx
301
- <SidebarMenu.Item active href="/" tabBar="tab">
302
- <Home />
303
- Home
304
- </SidebarMenu.Item>
305
- ```
306
-
307
- ### Use One Title per Page
308
-
309
- `AppShell.Title` renders the page's `h1` in the header bar across the top of the content column. Keep one primary action in the header.
310
-
311
- **Do:** Put the title first, then page actions, such as a `small` [Button](button.md).
312
-
313
- ```tsx
314
- /**
315
- * Do example for "Use One Title per Page" on the AppShell page.
316
- * Put the title first, then page actions, such as a `small` Button.
317
- * @module
318
- */
319
- import { Button, style, Surface } from '@tempoxyz/ds'
320
-
321
- /** Renders the static preview, which the guideline card shows inert. */
322
- export function Demo() {
323
- return (
324
- <Surface size="small" {...styles.frame()}>
325
- <div {...styles.header()}>
326
- <span {...styles.title()}>API keys</span>
327
- <Button size="small">New key</Button>
328
- </div>
329
- </Surface>
330
- )
331
- }
332
-
333
- namespace styles {
334
- export const frame = style({ width: '18rem !custom' })
335
-
336
- export const header = style({ alignItems: 'center', display: 'flex', gap: '12' })
337
-
338
- export const title = style({
339
- color: 'content.primary',
340
- flex: '1 !custom',
341
- typography: 'heading.h3',
342
- })
343
- }
344
- ```
345
-
346
- **Don't:** Place actions before the title.
347
-
348
- ```tsx
349
- /** Don't example for "Use One Title per Page" on the AppShell page. Don't place actions before the title. @module */
350
- import { Button, style, Surface } from '@tempoxyz/ds'
351
-
352
- /** Renders the static preview, which the guideline card shows inert. */
353
- export function Demo() {
354
- return (
355
- <Surface size="small" {...styles.frame()}>
356
- <div {...styles.header()}>
357
- <Button size="small">New key</Button>
358
- <span {...styles.title()}>API keys</span>
359
- </div>
360
- </Surface>
361
- )
362
- }
363
-
364
- namespace styles {
365
- export const frame = style({ width: '18rem !custom' })
366
-
367
- export const header = style({ alignItems: 'center', display: 'flex', gap: '12' })
368
-
369
- export const title = style({
370
- color: 'content.primary',
371
- flex: '1 !custom',
372
- typography: 'heading.h3',
373
- })
374
- }
375
- ```
376
-
377
- ### Close the Drawer After Navigating
378
-
379
- With a client-side router, the drawer stays open when the route changes. Control `AppShell.Root` with `open` and `onOpenChange`, and set `open` to `false` when the location changes.
380
-
381
- **Do:** Close the drawer, so the new page shows.
382
-
383
- ```tsx
384
- /**
385
- * Do example for "Close the Drawer After Navigating" on the AppShell page.
386
- * Close the drawer, so the new page shows.
387
- * @module
388
- */
389
- import { Button, style } from '@tempoxyz/ds'
390
- import { Menu } from '@tempoxyz/ds/icons'
391
-
392
- /** Renders the static preview, which the guideline card shows inert. */
393
- export function Demo() {
394
- return (
395
- <div {...styles.screen()}>
396
- <div {...styles.header()}>
397
- <span {...styles.title()}>API keys</span>
398
- <Button aria-label="Open menu" shape="icon" size="small" variant="secondary">
399
- <Menu />
400
- </Button>
401
- </div>
402
- <span {...styles.meta()}>2 active keys</span>
403
- </div>
404
- )
405
- }
406
-
407
- namespace styles {
408
- export const header = style({
409
- alignItems: 'center',
410
- display: 'flex',
411
- gap: '12',
412
- justifyContent: 'space-between',
413
- })
414
-
415
- export const meta = style({ color: 'content.secondary', typography: 'body.b2' })
416
-
417
- export const screen = style({
418
- display: 'flex',
419
- flexDirection: 'column',
420
- height: '9rem !custom',
421
- position: 'relative',
422
- rowGap: '8',
423
- width: '18rem !custom',
424
- })
425
-
426
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
427
- }
428
- ```
429
-
430
- **Don't:** Leave the drawer over the new page.
431
-
432
- ```tsx
433
- /**
434
- * Don't example for "Close the Drawer After Navigating" on the AppShell page.
435
- * Don't leave the drawer over the new page.
436
- * @module
437
- */
438
- import { Button, SidebarMenu, style, Surface } from '@tempoxyz/ds'
439
- import { Home, Key, Menu } from '@tempoxyz/ds/icons'
440
-
441
- /** Renders the static preview, which the guideline card shows inert. */
442
- export function Demo() {
443
- return (
444
- <div {...styles.screen()}>
445
- <div {...styles.header()}>
446
- <span {...styles.title()}>API keys</span>
447
- <Button aria-label="Open menu" shape="icon" size="small" variant="secondary">
448
- <Menu />
449
- </Button>
450
- </div>
451
- <span {...styles.meta()}>2 active keys</span>
452
- <Surface size="small" {...styles.drawer()}>
453
- <SidebarMenu.Root aria-label="Primary" size="small">
454
- <SidebarMenu.Item href="#">
455
- <Home />
456
- Home
457
- </SidebarMenu.Item>
458
- <SidebarMenu.Item active href="#">
459
- <Key />
460
- API keys
461
- </SidebarMenu.Item>
462
- </SidebarMenu.Root>
463
- </Surface>
464
- </div>
465
- )
466
- }
467
-
468
- namespace styles {
469
- export const drawer = style({
470
- insetBlock: '0 !custom',
471
- insetInlineEnd: '0 !custom',
472
- position: 'absolute',
473
- width: '11rem !custom',
474
- })
475
-
476
- export const header = style({
477
- alignItems: 'center',
478
- display: 'flex',
479
- gap: '12',
480
- justifyContent: 'space-between',
481
- })
482
-
483
- export const meta = style({ color: 'content.secondary', typography: 'body.b2' })
484
-
485
- export const screen = style({
486
- display: 'flex',
487
- flexDirection: 'column',
488
- height: '9rem !custom',
489
- position: 'relative',
490
- rowGap: '8',
491
- width: '18rem !custom',
492
- })
493
-
494
- export const title = style({ color: 'content.primary', typography: 'heading.h3' })
495
- }
496
- ```
497
-
498
- ## Content
499
-
500
- * Match `AppShell.Title` to the label of the active [SidebarMenu](sidebar-menu.md) item, such as API keys.
501
- * Keep titles short enough to share the header row with its actions at 360px.
502
-
503
- ## Accessibility
504
-
505
- Provides the page landmarks and the `h1`. Below 1024px, the sidebar drawer follows the [WAI-ARIA Dialog (Modal) pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/).
506
-
507
- ### Semantics
508
-
509
- * **AppShell.Main (main):** The page's main landmark.
510
- * **AppShell.Header (header):** Holds the menu trigger and the page title.
511
- * **AppShell.Title (h1):** The page's top-level heading.
512
- * **Wide AppShell.Sidebar (complementary):** From 1024px, a landmark named by `aria-label`.
513
- * **Narrow AppShell.Sidebar (dialog):** Below 1024px, a dialog with the same name.
514
- * **AppShell.Trigger (button):** Named "Open menu" or "Close menu" by state.
515
-
516
- ### Keyboard
517
-
518
- * **Move Through the Shell (Tab):** Moves to the trigger, or cycles the open drawer.
519
- * **Open the Drawer (Enter or Space):** Opens the drawer from the trigger.
520
- * **Close the Drawer (Escape):** Closes the drawer.
521
-
522
- ### Focus
523
-
524
- * **Opening (Tab or Shift+Tab):** The drawer is modal. Opening it moves focus inside and traps it.
525
- * **While Open (aria-hidden):** Hides the rest of the page, including the trigger, from assistive technology.
526
- * **Closing:** Escape, the backdrop, or a swipe right closes the drawer and returns focus to the trigger.
527
-
528
- ### Motion and Size
529
-
530
- * **Reduced Motion (prefers-reduced-motion):** The drawer fades, and the trigger switches instantly.
531
- * **Minimum Width (360px):** The shell never shrinks below this width.
532
-
533
- ### Your Responsibilities
534
-
535
- * **Name the Sidebar (aria-label):** Name the sidebar, such as "Primary". The name labels the landmark and the drawer.
536
- * **Use One Title (h1):** Use one page title. Start the headings of the content at `h2`.
537
- * **Add a Skip Link (SC 2.4.1):** If the sidebar holds many links, add a [skip link](https://www.w3.org/WAI/WCAG22/Understanding/bypass-blocks.html). The shell adds none.
538
-
539
- ## Related
540
-
541
- [SidebarMenu](sidebar-menu.md)
542
-
543
- Use for the navigation inside the sidebar.
544
-
545
- [Container](container.md)
546
-
547
- Use for pages without a sidebar.
548
-
549
- [Drawer](drawer.md)
550
-
551
- Use for panels that open on demand.
552
-
553
- [Responsive Layout](../patterns/responsive-layout.md)
554
-
555
- Covers adapting pages across breakpoints.
556
-
557
- [Navigation](../patterns/navigation.md)
558
-
559
- Covers choosing between navigation components.