@tempoxyz/ds 0.3.14 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/docs/AGENTS.md +73 -10
  2. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +28 -20
  3. package/dist/docs/product/components/actions.md +2058 -0
  4. package/dist/docs/product/components/blockchain.md +3825 -0
  5. package/dist/docs/product/components/data-display.md +5901 -0
  6. package/dist/docs/product/components/feedback-and-status.md +4008 -0
  7. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  8. package/dist/docs/product/components/layout.md +3339 -0
  9. package/dist/docs/product/components/navigation.md +2914 -0
  10. package/dist/docs/product/components/overlays.md +4917 -0
  11. package/dist/docs/product/components.md +125 -125
  12. package/dist/docs/product/foundations.md +4596 -0
  13. package/dist/docs/product/patterns.md +10129 -0
  14. package/package.json +1 -1
  15. package/dist/docs/index.md +0 -145
  16. package/dist/docs/product/components/accordion.md +0 -489
  17. package/dist/docs/product/components/address-card.md +0 -147
  18. package/dist/docs/product/components/agent-logo.md +0 -194
  19. package/dist/docs/product/components/alert-dialog.md +0 -631
  20. package/dist/docs/product/components/alert.md +0 -448
  21. package/dist/docs/product/components/amount-input.md +0 -305
  22. package/dist/docs/product/components/amount.md +0 -794
  23. package/dist/docs/product/components/app-shell.md +0 -559
  24. package/dist/docs/product/components/asset-chip.md +0 -294
  25. package/dist/docs/product/components/autocomplete.md +0 -620
  26. package/dist/docs/product/components/avatar.md +0 -321
  27. package/dist/docs/product/components/badge.md +0 -339
  28. package/dist/docs/product/components/badged-logo.md +0 -116
  29. package/dist/docs/product/components/banner.md +0 -379
  30. package/dist/docs/product/components/bar-chart.md +0 -208
  31. package/dist/docs/product/components/breadcrumbs.md +0 -380
  32. package/dist/docs/product/components/button-group.md +0 -286
  33. package/dist/docs/product/components/button.md +0 -650
  34. package/dist/docs/product/components/calendar.md +0 -375
  35. package/dist/docs/product/components/callout.md +0 -96
  36. package/dist/docs/product/components/checkbox-group.md +0 -521
  37. package/dist/docs/product/components/checkbox.md +0 -467
  38. package/dist/docs/product/components/choice-group.md +0 -516
  39. package/dist/docs/product/components/choicebox.md +0 -641
  40. package/dist/docs/product/components/code.md +0 -100
  41. package/dist/docs/product/components/combobox.md +0 -939
  42. package/dist/docs/product/components/container.md +0 -257
  43. package/dist/docs/product/components/copy-button.md +0 -642
  44. package/dist/docs/product/components/date-picker.md +0 -514
  45. package/dist/docs/product/components/dialog.md +0 -1332
  46. package/dist/docs/product/components/drawer.md +0 -966
  47. package/dist/docs/product/components/empty.md +0 -340
  48. package/dist/docs/product/components/field.md +0 -570
  49. package/dist/docs/product/components/fieldset.md +0 -398
  50. package/dist/docs/product/components/frame.md +0 -434
  51. package/dist/docs/product/components/gauge.md +0 -299
  52. package/dist/docs/product/components/get-started-visual.md +0 -117
  53. package/dist/docs/product/components/grid.md +0 -288
  54. package/dist/docs/product/components/hero-visual.md +0 -155
  55. package/dist/docs/product/components/hex.md +0 -487
  56. package/dist/docs/product/components/icon-tile.md +0 -292
  57. package/dist/docs/product/components/identicon.md +0 -371
  58. package/dist/docs/product/components/inline.md +0 -233
  59. package/dist/docs/product/components/inset.md +0 -225
  60. package/dist/docs/product/components/kbd.md +0 -423
  61. package/dist/docs/product/components/list-group.md +0 -981
  62. package/dist/docs/product/components/loading-dots.md +0 -237
  63. package/dist/docs/product/components/menu.md +0 -934
  64. package/dist/docs/product/components/native-select.md +0 -204
  65. package/dist/docs/product/components/network-logo.md +0 -248
  66. package/dist/docs/product/components/number-field.md +0 -543
  67. package/dist/docs/product/components/otp-field.md +0 -616
  68. package/dist/docs/product/components/pagination.md +0 -516
  69. package/dist/docs/product/components/popover.md +0 -544
  70. package/dist/docs/product/components/progress.md +0 -388
  71. package/dist/docs/product/components/qr.md +0 -314
  72. package/dist/docs/product/components/radio-group.md +0 -528
  73. package/dist/docs/product/components/secret-value.md +0 -406
  74. package/dist/docs/product/components/select.md +0 -751
  75. package/dist/docs/product/components/separator.md +0 -379
  76. package/dist/docs/product/components/sidebar-menu.md +0 -922
  77. package/dist/docs/product/components/skeleton.md +0 -517
  78. package/dist/docs/product/components/slider.md +0 -539
  79. package/dist/docs/product/components/snippet.md +0 -424
  80. package/dist/docs/product/components/spinner.md +0 -216
  81. package/dist/docs/product/components/split-bar.md +0 -139
  82. package/dist/docs/product/components/split-button.md +0 -464
  83. package/dist/docs/product/components/stack.md +0 -299
  84. package/dist/docs/product/components/status-chip.md +0 -226
  85. package/dist/docs/product/components/status-indicator.md +0 -119
  86. package/dist/docs/product/components/status-row.md +0 -174
  87. package/dist/docs/product/components/stepper.md +0 -451
  88. package/dist/docs/product/components/success-hero.md +0 -157
  89. package/dist/docs/product/components/surface.md +0 -639
  90. package/dist/docs/product/components/switch.md +0 -472
  91. package/dist/docs/product/components/table.md +0 -968
  92. package/dist/docs/product/components/tabs.md +0 -627
  93. package/dist/docs/product/components/tempo-logo.md +0 -185
  94. package/dist/docs/product/components/text-input.md +0 -624
  95. package/dist/docs/product/components/textarea.md +0 -352
  96. package/dist/docs/product/components/toast.md +0 -535
  97. package/dist/docs/product/components/token-logo.md +0 -371
  98. package/dist/docs/product/components/token.md +0 -247
  99. package/dist/docs/product/components/tooltip.md +0 -490
  100. package/dist/docs/product/components/verification-code.md +0 -116
  101. package/dist/docs/product/components/visual.md +0 -249
  102. package/dist/docs/product/foundations/accessibility.md +0 -377
  103. package/dist/docs/product/foundations/agents.md +0 -159
  104. package/dist/docs/product/foundations/color.md +0 -522
  105. package/dist/docs/product/foundations/content/tone.md +0 -194
  106. package/dist/docs/product/foundations/content/voice.md +0 -194
  107. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  108. package/dist/docs/product/foundations/iconography.md +0 -282
  109. package/dist/docs/product/foundations/intent.md +0 -360
  110. package/dist/docs/product/foundations/layout.md +0 -508
  111. package/dist/docs/product/foundations/linter.md +0 -523
  112. package/dist/docs/product/foundations/motion.md +0 -151
  113. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  114. package/dist/docs/product/foundations/typography.md +0 -331
  115. package/dist/docs/product/introduction/faq.md +0 -133
  116. package/dist/docs/product/introduction/getting-started.md +0 -377
  117. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  118. package/dist/docs/product/patterns/dashboards.md +0 -638
  119. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  120. package/dist/docs/product/patterns/empty-states.md +0 -612
  121. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  122. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  123. package/dist/docs/product/patterns/forms.md +0 -679
  124. package/dist/docs/product/patterns/loading.md +0 -630
  125. package/dist/docs/product/patterns/navigation.md +0 -397
  126. package/dist/docs/product/patterns/payments.md +0 -765
  127. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  128. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  129. package/dist/docs/product/products/tempo-console.md +0 -671
  130. package/dist/docs/product/products/tempo-performance.md +0 -435
  131. package/dist/docs/product/products/tempo-wallet.md +0 -438
@@ -1,544 +0,0 @@
1
- # Popover
2
-
3
- Opens a non-modal popup anchored to a trigger.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Popover.tsx)
6
-
7
- ## Overview
8
-
9
- Popover renders a non-modal dialog anchored to a trigger, opened on click, for interactive or longer content.
10
-
11
- ## Examples
12
-
13
- ### Basic
14
-
15
- ```tsx
16
- import { Button, Popover, style } from '@tempoxyz/ds'
17
-
18
- export function Demo() {
19
- return (
20
- <Popover.Root>
21
- <Popover.Trigger render={<Button variant="secondary" />}>Network fee</Popover.Trigger>
22
- <Popover.Popup>
23
- <Popover.Title>Network fee</Popover.Title>
24
- <Popover.Description>Paid in the token you send.</Popover.Description>
25
- <div {...styles.actions()}>
26
- <Popover.Close render={<Button size="small" variant="secondary" />}>Got it</Popover.Close>
27
- </div>
28
- </Popover.Popup>
29
- </Popover.Root>
30
- )
31
- }
32
-
33
- namespace styles {
34
- export const actions = style({ marginTop: '16' })
35
- }
36
- ```
37
-
38
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Popover/Basic.tsx)
39
-
40
- ### Side
41
-
42
- Set `side` on `Popover.Popup` to `top`, `right`, `bottom` (default), or `left`. Add `Popover.Arrow` to point toward the trigger.
43
-
44
- ```tsx
45
- import { Button, Popover } from '@tempoxyz/ds'
46
-
47
- export function Demo() {
48
- return (
49
- <Popover.Root>
50
- <Popover.Trigger render={<Button variant="secondary" />}>With arrow</Popover.Trigger>
51
- <Popover.Popup side="right">
52
- <Popover.Arrow />
53
- <Popover.Title>Estimated arrival</Popover.Title>
54
- <Popover.Description>About one minute.</Popover.Description>
55
- </Popover.Popup>
56
- </Popover.Root>
57
- )
58
- }
59
- ```
60
-
61
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Popover/Side.tsx)
62
-
63
- ## Anatomy
64
-
65
- Import the component and assemble its parts.
66
-
67
- ```tsx
68
- import { Popover } from '@tempoxyz/ds'
69
-
70
- <Popover.Root>
71
- <Popover.Trigger />
72
- <Popover.Popup>
73
- <Popover.Arrow />
74
- <Popover.Title />
75
- <Popover.Description />
76
- <Popover.Close />
77
- </Popover.Popup>
78
- </Popover.Root>
79
- ```
80
-
81
- ## Guidelines
82
-
83
- ### When to Use
84
-
85
- * Explain a value with a sentence and a link, such as the methodology behind a throughput tile.
86
- * Show details on demand, such as the breakdown of a network fee.
87
- * Edit one setting in place, such as the label of a saved address.
88
-
89
- ### When Not to Use
90
-
91
- * Use a [Tooltip](tooltip.md) for a short label on an icon button.
92
- * Use a [Menu](menu.md) for a list of actions.
93
- * Use [Select](select.md), [Combobox](combobox.md), or [DatePicker](date-picker.md) to choose a value.
94
- * Use a [Dialog](dialog.md) for a task with several fields or full attention.
95
- * Use a [Drawer](drawer.md) for long content.
96
- * Use visible text for information everyone needs, such as an error or a required step.
97
-
98
- ### Keep Content Small
99
-
100
- A popover holds a title, a sentence or two, and at most two controls. `Popover.Popup` grows up to the available width, so give text popovers a `maxWidth`, such as 20rem.
101
-
102
- **Do:** Explain a metric with a title, one sentence, and a link.
103
-
104
- ```tsx
105
- /**
106
- * Do example for "Keep Content Small" on the Popover page.
107
- * Explain a metric with a title, one sentence, and a link.
108
- * @module
109
- */
110
- import { Button, style } from '@tempoxyz/ds'
111
- import { InfoCircle } from '@tempoxyz/ds/icons'
112
-
113
- /** Renders the static preview, which the guideline card shows inert. */
114
- export function Demo() {
115
- return (
116
- <div {...styles.stack()}>
117
- <div {...styles.header()}>
118
- <span {...styles.label()}>Throughput</span>
119
- <Button aria-label="About throughput" shape="icon" size="small" variant="tertiary">
120
- <InfoCircle />
121
- </Button>
122
- </div>
123
- <div {...styles.popup()}>
124
- <span {...styles.title()}>Throughput</span>
125
- <p {...styles.description()}>Transactions per second, averaged over each block.</p>
126
- <span {...styles.link()}>View methodology</span>
127
- </div>
128
- </div>
129
- )
130
- }
131
-
132
- namespace styles {
133
- export const description = style({
134
- color: 'content.secondary',
135
- margin: '0 !custom',
136
- typography: 'body.b2',
137
- })
138
-
139
- export const header = style({ alignItems: 'center', columnGap: '4', display: 'flex' })
140
-
141
- export const label = style({ color: 'content.primary', typography: 'body.b2Strong' })
142
-
143
- export const link = style({
144
- color: 'content.primary',
145
- textDecorationLine: 'underline !custom',
146
- typography: 'body.b2Strong',
147
- })
148
-
149
- export const popup = style({
150
- backgroundColor: 'background.elevated',
151
- borderRadius: 'sm',
152
- boxShadow: 'regular',
153
- boxSizing: 'border-box',
154
- display: 'flex',
155
- flexDirection: 'column',
156
- padding: '20',
157
- rowGap: '8',
158
- width: '15rem !custom',
159
- })
160
-
161
- export const stack = style({
162
- alignItems: 'flex-start',
163
- display: 'flex',
164
- flexDirection: 'column',
165
- rowGap: '8',
166
- })
167
-
168
- export const title = style({ color: 'content.primary', typography: 'body.b1Strong' })
169
- }
170
- ```
171
-
172
- **Don't:** Build a multi-field form in a popover. Use a [Dialog](dialog.md).
173
-
174
- ```tsx
175
- /**
176
- * Don't example for "Keep Content Small" on the Popover page.
177
- * Don't build a multi-field form in a popover. Use a Dialog.
178
- * @module
179
- */
180
- import { Button, style, TextInput } from '@tempoxyz/ds'
181
-
182
- /** Renders the static preview, which the guideline card shows inert. */
183
- export function Demo() {
184
- return (
185
- <div {...styles.popup()}>
186
- <span {...styles.title()}>New webhook</span>
187
- <TextInput.Group>
188
- <TextInput.Control aria-label="Endpoint URL" placeholder="Endpoint URL" />
189
- </TextInput.Group>
190
- <TextInput.Group>
191
- <TextInput.Control aria-label="Events" placeholder="Events" />
192
- </TextInput.Group>
193
- <TextInput.Group>
194
- <TextInput.Control aria-label="Signing secret" placeholder="Signing secret" />
195
- </TextInput.Group>
196
- <div {...styles.actions()}>
197
- <Button size="small" variant="secondary">
198
- Cancel
199
- </Button>
200
- <Button size="small">Create webhook</Button>
201
- </div>
202
- </div>
203
- )
204
- }
205
-
206
- namespace styles {
207
- export const actions = style({
208
- columnGap: '8',
209
- display: 'flex',
210
- justifyContent: 'flex-end',
211
- marginTop: '4',
212
- })
213
-
214
- export const popup = style({
215
- backgroundColor: 'background.elevated',
216
- borderRadius: 'sm',
217
- boxShadow: 'regular',
218
- boxSizing: 'border-box',
219
- display: 'flex',
220
- flexDirection: 'column',
221
- padding: '20',
222
- rowGap: '8',
223
- width: '16rem !custom',
224
- })
225
-
226
- export const title = style({ color: 'content.primary', typography: 'body.b1Strong' })
227
- }
228
- ```
229
-
230
- ### Add Hover Without Replacing Click
231
-
232
- * **Click (default):** `Popover.Trigger` toggles on click, which covers a mouse, a tap, and Enter or Space.
233
- * **Hover and Click (openOnHover):** For info icons on dashboards. Opens after 300ms of hover, and click still works.
234
-
235
- ### Offer a Close Action for Controls
236
-
237
- Escape and an outside press close a popover. If it holds controls, add a `Popover.Close` button, such as Cancel or Done, for touch screens.
238
-
239
- **Do:** Add a `Popover.Close` action beside the controls.
240
-
241
- ```tsx
242
- /**
243
- * Do example for "Offer a Close Action for Controls" on the Popover page.
244
- * Add a `Popover.Close` action beside the controls.
245
- * @module
246
- */
247
- import { Button, style, TextInput } from '@tempoxyz/ds'
248
-
249
- /** Renders the static preview, which the guideline card shows inert. */
250
- export function Demo() {
251
- return (
252
- <div {...styles.popup()}>
253
- <span {...styles.title()}>Address label</span>
254
- <TextInput.Group>
255
- <TextInput.Control aria-label="Label" defaultValue="Alex, main wallet" />
256
- </TextInput.Group>
257
- <div {...styles.actions()}>
258
- <Button size="small" variant="secondary">
259
- Cancel
260
- </Button>
261
- <Button size="small">Save label</Button>
262
- </div>
263
- </div>
264
- )
265
- }
266
-
267
- namespace styles {
268
- export const actions = style({
269
- columnGap: '8',
270
- display: 'flex',
271
- justifyContent: 'flex-end',
272
- marginTop: '4',
273
- })
274
-
275
- export const popup = style({
276
- backgroundColor: 'background.elevated',
277
- borderRadius: 'sm',
278
- boxShadow: 'regular',
279
- boxSizing: 'border-box',
280
- display: 'flex',
281
- flexDirection: 'column',
282
- padding: '20',
283
- rowGap: '8',
284
- width: '16rem !custom',
285
- })
286
-
287
- export const title = style({ color: 'content.primary', typography: 'body.b1Strong' })
288
- }
289
- ```
290
-
291
- **Don't:** Rely on Escape or an outside press to leave a popover with controls.
292
-
293
- ```tsx
294
- /**
295
- * Don't example for "Offer a Close Action for Controls" on the Popover page.
296
- * Don't rely on Escape or an outside press to leave a popover with controls.
297
- * @module
298
- */
299
- import { style, TextInput } from '@tempoxyz/ds'
300
-
301
- /** Renders the static preview, which the guideline card shows inert. */
302
- export function Demo() {
303
- return (
304
- <div {...styles.popup()}>
305
- <span {...styles.title()}>Address label</span>
306
- <TextInput.Group>
307
- <TextInput.Control aria-label="Label" defaultValue="Alex, main wallet" />
308
- </TextInput.Group>
309
- </div>
310
- )
311
- }
312
-
313
- namespace styles {
314
- export const popup = style({
315
- backgroundColor: 'background.elevated',
316
- borderRadius: 'sm',
317
- boxShadow: 'regular',
318
- boxSizing: 'border-box',
319
- display: 'flex',
320
- flexDirection: 'column',
321
- padding: '20',
322
- rowGap: '8',
323
- width: '16rem !custom',
324
- })
325
-
326
- export const title = style({ color: 'content.primary', typography: 'body.b1Strong' })
327
- }
328
- ```
329
-
330
- ### Point at Small Triggers
331
-
332
- `Popover.Popup` opens 8px from its trigger. If the trigger is small, such as an info icon in a table header, add `Popover.Arrow`.
333
-
334
- **Do:** Add `Popover.Arrow` to point at a small trigger.
335
-
336
- ```tsx
337
- /**
338
- * Do example for "Point at Small Triggers" on the Popover page.
339
- * Add `Popover.Arrow` to point at a small trigger.
340
- * @module
341
- */
342
- import { Button, style } from '@tempoxyz/ds'
343
- import { InfoCircle } from '@tempoxyz/ds/icons'
344
-
345
- /** Renders the static preview, which the guideline card shows inert. */
346
- export function Demo() {
347
- return (
348
- <div {...styles.stack()}>
349
- <div {...styles.header()}>
350
- <span {...styles.column()}>
351
- Fee
352
- <Button aria-label="About fee" shape="icon" size="small" variant="tertiary">
353
- <InfoCircle />
354
- </Button>
355
- </span>
356
- <span {...styles.column()}>
357
- Throughput
358
- <Button aria-label="About throughput" shape="icon" size="small" variant="tertiary">
359
- <InfoCircle />
360
- </Button>
361
- </span>
362
- </div>
363
- <div {...styles.popup()}>
364
- {/* Popover.Arrow needs an open popup, so this preview draws its shape in place. */}
365
- <svg
366
- aria-hidden="true"
367
- fill="currentColor"
368
- height="10"
369
- viewBox="0 0 20 10"
370
- width="20"
371
- {...styles.arrow()}
372
- >
373
- <path d="M0 10C4 10 7 7 8.6 4.6a2 2 0 0 1 2.8 0C13 7 16 10 20 10Z" />
374
- </svg>
375
- <p {...styles.description()}>Paid in the token you send, about 0.01 USDC.</p>
376
- </div>
377
- </div>
378
- )
379
- }
380
-
381
- namespace styles {
382
- export const arrow = style({
383
- color: 'background.elevated',
384
- left: '4.25rem !custom',
385
- position: 'absolute',
386
- top: '-10px !custom',
387
- })
388
-
389
- export const column = style({
390
- alignItems: 'center',
391
- color: 'content.secondary',
392
- columnGap: '2px !custom',
393
- display: 'flex',
394
- typography: 'body.b3',
395
- })
396
-
397
- export const description = style({
398
- color: 'content.secondary',
399
- margin: '0 !custom',
400
- typography: 'body.b2',
401
- })
402
-
403
- export const header = style({ columnGap: '24', display: 'flex', paddingInlineStart: '24' })
404
-
405
- export const popup = style({
406
- backgroundColor: 'background.elevated',
407
- borderRadius: 'sm',
408
- boxShadow: 'regular',
409
- boxSizing: 'border-box',
410
- padding: '16',
411
- position: 'relative',
412
- width: '15rem !custom',
413
- })
414
-
415
- export const stack = style({ display: 'flex', flexDirection: 'column', rowGap: '8' })
416
- }
417
- ```
418
-
419
- **Don't:** Leave the popup's trigger unclear among small icons.
420
-
421
- ```tsx
422
- /**
423
- * Don't example for "Point at Small Triggers" on the Popover page.
424
- * Don't leave the popup's trigger unclear among small icons.
425
- * @module
426
- */
427
- import { Button, style } from '@tempoxyz/ds'
428
- import { InfoCircle } from '@tempoxyz/ds/icons'
429
-
430
- /** Renders the static preview, which the guideline card shows inert. */
431
- export function Demo() {
432
- return (
433
- <div {...styles.stack()}>
434
- <div {...styles.header()}>
435
- <span {...styles.column()}>
436
- Fee
437
- <Button aria-label="About fee" shape="icon" size="small" variant="tertiary">
438
- <InfoCircle />
439
- </Button>
440
- </span>
441
- <span {...styles.column()}>
442
- Throughput
443
- <Button aria-label="About throughput" shape="icon" size="small" variant="tertiary">
444
- <InfoCircle />
445
- </Button>
446
- </span>
447
- </div>
448
- <div {...styles.popup()}>
449
- <p {...styles.description()}>Paid in the token you send, about 0.01 USDC.</p>
450
- </div>
451
- </div>
452
- )
453
- }
454
-
455
- namespace styles {
456
- export const column = style({
457
- alignItems: 'center',
458
- color: 'content.secondary',
459
- columnGap: '2px !custom',
460
- display: 'flex',
461
- typography: 'body.b3',
462
- })
463
-
464
- export const description = style({
465
- color: 'content.secondary',
466
- margin: '0 !custom',
467
- typography: 'body.b2',
468
- })
469
-
470
- export const header = style({ columnGap: '24', display: 'flex', paddingInlineStart: '24' })
471
-
472
- export const popup = style({
473
- backgroundColor: 'background.elevated',
474
- borderRadius: 'sm',
475
- boxShadow: 'regular',
476
- boxSizing: 'border-box',
477
- padding: '16',
478
- width: '15rem !custom',
479
- })
480
-
481
- export const stack = style({ display: 'flex', flexDirection: 'column', rowGap: '8' })
482
- }
483
- ```
484
-
485
- ## Content
486
-
487
- ### Title With the Subject
488
-
489
- Name the value or setting, such as Network fee, with no question. Put the explanation in `Popover.Description`.
490
-
491
- ### Lead With the Answer
492
-
493
- Start with the explanation, such as Transactions per second, averaged over each block. Keep it under about 25 words.
494
-
495
- ## Accessibility
496
-
497
- ### Semantics
498
-
499
- * **Popover.Trigger (button):** Announces a dialog that click and keyboard open.
500
- * **Popover.Popup (dialog):** A non-modal dialog, named by its title.
501
- * **Popover.Title (h2):** Names the popup.
502
- * **Popover.Description (p):** Describes the popup to screen readers.
503
- * **Popover.Arrow (aria-hidden):** Decorative and hidden from assistive technology.
504
-
505
- ### Keyboard
506
-
507
- * **Open and Activate (Enter or Space):** Opens the popover from the trigger, and activates the focused control in it.
508
- * **Move Through the Popup (Tab):** Moves through the controls in the popup. Past the last control, the popover closes.
509
- * **Return to the Trigger (Shift+Tab):** From the first control, moves focus back to the trigger.
510
- * **Close the Popover (Escape):** Closes the popover.
511
-
512
- ### Focus
513
-
514
- * **Opening (initialFocus):** Focus moves to the first control, or to the popup on touch. Pass `initialFocus` to change it.
515
- * **Non-Modal (modal):** Focus is not trapped, and the page stays interactive unless you set `modal`.
516
- * **Outside Press:** A press outside the popup closes it.
517
- * **Closing (finalFocus):** Escape or an outside press returns focus to the trigger. If the trigger is gone, pass `finalFocus`.
518
-
519
- ### Your Responsibilities
520
-
521
- * **Render Popover.Title:** Always render a title, so the dialog has an accessible name.
522
- * **Name Icon-Only Triggers (aria-label):** Name the trigger's subject, such as "About throughput".
523
-
524
- ## Related
525
-
526
- [Tooltip](tooltip.md)
527
-
528
- Use for short labels on icon buttons.
529
-
530
- [Dialog](dialog.md)
531
-
532
- Use for focused tasks that block the page.
533
-
534
- [Drawer](drawer.md)
535
-
536
- Use for long content and bottom sheets.
537
-
538
- [Menu](menu.md)
539
-
540
- Use for lists of actions.
541
-
542
- [Dashboards](../patterns/dashboards.md)
543
-
544
- Covers explaining metrics.