@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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tempoxyz/ds",
3
3
  "type": "module",
4
- "version": "0.3.14",
4
+ "version": "0.3.15",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "DESIGN.md",
@@ -1,145 +0,0 @@
1
- # Tempo Design System
2
-
3
- > Foundations, guidelines, and components for Tempo products and websites.
4
-
5
- Each page is the Markdown of the documentation at ds.tehq.dev for this version of the package, at the path of its page on the site. [AGENTS.md](AGENTS.md) names the page to read first.
6
-
7
- ## Product
8
-
9
- ### Introduction
10
-
11
- - [FAQ](product/introduction/faq.md): Common questions about building with, and contributing to, Tempo Design System.
12
- - [Getting Started](product/introduction/getting-started.md): Install Tempo Design System and render your first component.
13
-
14
- ### Foundations
15
-
16
- - [Accessibility](product/foundations/accessibility.md): The accessibility baseline for every Tempo component, and what you still own.
17
- - [Agents](product/foundations/agents.md): How coding agents read these docs and the source, and the rules they follow.
18
- - [Color](product/foundations/color.md): Color tokens for text, surfaces, borders, and status, with contrast rules.
19
- - [Tone](product/foundations/content/tone.md): How Tempo's voice adjusts to the reader, from a first visit to an error.
20
- - [Voice](product/foundations/content/voice.md): Tempo's personality in words, consistent across every product.
21
- - [Writing Style](product/foundations/content/writing-style.md): How Tempo writes interface text: sentence case, a verb first, and plain words.
22
- - [Iconography](product/foundations/iconography.md): Icons from the Tempo catalog, and how to size, color, and label them.
23
- - [Building From Intent](product/foundations/intent.md): Choose each component by the job of its content, not by the markup it replaces.
24
- - [Layout](product/foundations/layout.md): Page structure, grid, spacing, radius, and elevation.
25
- - [Linter](product/foundations/linter.md): Oxlint rules that check how your app uses Tempo Design System.
26
- - [Motion](product/foundations/motion.md): Easing curves, durations, and reduced-motion rules for state changes.
27
- - [Radius and Padding](product/foundations/radius-and-padding.md): How corner radius and padding pair, from fields to modals.
28
- - [Typography](product/foundations/typography.md): Type sets for titles, body text, values, and code.
29
-
30
- ### Products
31
-
32
- - [Tempo Console](product/products/tempo-console.md): Tempo Console is the web app for Tempo API projects, keys, usage, and billing.
33
- - [Tempo Performance](product/products/tempo-performance.md): Tempo Performance is the public benchmark dashboard for the Tempo network.
34
- - [Tempo Wallet](product/products/tempo-wallet.md): Tempo Wallet is the first-party wallet for balances, transfers, and deposits.
35
-
36
- ### Patterns
37
-
38
- - [Blockchain Values](product/patterns/blockchain-values.md): Formats addresses, hashes, amounts, and timestamps so people can verify them.
39
- - [Dashboards](product/patterns/dashboards.md): Summarizes system metrics, such as throughput, in tiles, filters, and charts.
40
- - [Destructive Actions](product/patterns/destructive-actions.md): Match the safeguard on a destructive action to its impact and its reversibility.
41
- - [Empty States](product/patterns/empty-states.md): Explain why a region has nothing to show, and offer the next step that fills it.
42
- - [Errors and Validation](product/patterns/errors-and-validation.md): Check values at the right moment, and state how to fix each problem.
43
- - [Feedback and Status](product/patterns/feedback-and-status.md): Name each system state once, and choose Toast, Alert, or Banner by urgency.
44
- - [Forms](product/patterns/forms.md): Order fields, labels, and actions so a person completes a form in one pass.
45
- - [Loading](product/patterns/loading.md): Show that content or an action is on its way, with an indicator to fit the wait.
46
- - [Navigation](product/patterns/navigation.md): Move between product areas, page views, and nested pages in one shared frame.
47
- - [Payments](product/patterns/payments.md): Build send, receive, and deposit flows, from the amount to the receipt.
48
- - [Responsive Layout](product/patterns/responsive-layout.md): Adapt layouts from a 320px phone to a wide desktop with shared breakpoints.
49
- - [Tables and Lists](product/patterns/tables-and-lists.md): Present records, such as payments and API keys, to scan, compare, and act on.
50
-
51
- ### Components
52
-
53
- - [Overview](product/components.md): Components for building Tempo products, grouped by the job each one does.
54
- - [Accordion](product/components/accordion.md): Stacks collapsible sections that each reveal a labelled panel.
55
- - [AddressCard](product/components/address-card.md): Shows a wallet address to receive funds, with its QR code and networks.
56
- - [AgentLogo](product/components/agent-logo.md): Shows the logo of an AI agent that works with a wallet.
57
- - [AlertDialog](product/components/alert-dialog.md): Asks you to confirm a critical action before it happens.
58
- - [Alert](product/components/alert.md): Shows an inline message tied to nearby content.
59
- - [AmountInput](product/components/amount-input.md): Accepts a decimal amount, such as a payment or transfer value.
60
- - [Amount](product/components/amount.md): Formats a number as money or a token amount.
61
- - [AppShell](product/components/app-shell.md): Places a sticky sidebar beside the main content column.
62
- - [AssetChip](product/components/asset-chip.md): Labels a supported asset or network in a small chip, which can also pick one.
63
- - [Autocomplete](product/components/autocomplete.md): A text input that suggests values while people type.
64
- - [Avatar](product/components/avatar.md): Represents a person, contact, or wallet with an image, initials, or an icon.
65
- - [Badge](product/components/badge.md): Labels a status or category in a compact chip.
66
- - [BadgedLogo](product/components/badged-logo.md): Marks a token or an app with a small badge on the corner of its logo.
67
- - [Banner](product/components/banner.md): Shows a full-width message about the system or page.
68
- - [BarChart](product/components/bar-chart.md): Shows values over time as stacked bars, such as the daily spend of each agent.
69
- - [Breadcrumbs](product/components/breadcrumbs.md): Shows where the current page sits in the site hierarchy.
70
- - [ButtonGroup](product/components/button-group.md): Lays out the actions at the foot of a dialog or focused flow.
71
- - [Button](product/components/button.md): Triggers an action, such as submitting a form or sending a payment.
72
- - [Calendar](product/components/calendar.md): A month grid for picking one date or a date range.
73
- - [Callout](product/components/callout.md): Sets a short passage of body text apart in a subtle box.
74
- - [CheckboxGroup](product/components/checkbox-group.md): Shares one value array across a group of checkboxes.
75
- - [Checkbox](product/components/checkbox.md): Turns a single independent option on or off.
76
- - [ChoiceGroup](product/components/choice-group.md): A segmented control for a few mutually exclusive options.
77
- - [Choicebox](product/components/choicebox.md): A selectable tile with an optional icon, title, and description.
78
- - [Code](product/components/code.md): Sets a command, identifier, or value apart inside a sentence.
79
- - [Combobox](product/components/combobox.md): A text input that filters a list of fixed options while people type.
80
- - [Container](product/components/container.md): Centers content at a maximum width.
81
- - [CopyButton](product/components/copy-button.md): Copies a value to the clipboard and confirms the copy.
82
- - [DatePicker](product/components/date-picker.md): Shows the selected date and opens a calendar in a popup.
83
- - [Dialog](product/components/dialog.md): Opens a modal popup over the page.
84
- - [Drawer](product/components/drawer.md): Slides a modal panel in from an edge of the viewport.
85
- - [Empty](product/components/empty.md): Fills a region that has nothing to show yet.
86
- - [Field](product/components/field.md): Links a label, description, and error message to a control.
87
- - [Fieldset](product/components/fieldset.md): Groups related fields under a shared legend.
88
- - [Frame](product/components/frame.md): Lays out a header, body, and footer in a column.
89
- - [Gauge](product/components/gauge.md): Shows a measurement within a range as a ring.
90
- - [GetStartedVisual](product/components/get-started-visual.md): Illustrates one step of a get started flow at the top of its card.
91
- - [Grid](product/components/grid.md): Lays out children on a responsive grid.
92
- - [HeroVisual](product/components/hero-visual.md): Shows animated streaks and a title beside the steps of a setup flow.
93
- - [Hex](product/components/hex.md): Shows a hex string, such as an address, truncated to fit.
94
- - [IconTile](product/components/icon-tile.md): Anchors a centered modal with one icon in a rounded square.
95
- - [Identicon](product/components/identicon.md): Shows a unique gradient avatar derived from an address.
96
- - [Inline](product/components/inline.md): Lays out children in a horizontal row.
97
- - [Inset](product/components/inset.md): Pads content with spacing tokens.
98
- - [Kbd](product/components/kbd.md): Shows a keyboard key or shortcut.
99
- - [ListGroup](product/components/list-group.md): Stacks rows for details, pickers, checklists, and settings.
100
- - [LoadingDots](product/components/loading-dots.md): Shows three pulsing dots for inline loading.
101
- - [Menu](product/components/menu.md): Opens a list of actions from a button.
102
- - [NativeSelect](product/components/native-select.md): A native select styled as a field, which opens the browser's own picker.
103
- - [NetworkLogo](product/components/network-logo.md): Shows the logo of the network a token lives on.
104
- - [NumberField](product/components/number-field.md): A numeric input with increment and decrement buttons.
105
- - [OtpField](product/components/otp-field.md): Accepts a one-time passcode, one character per slot.
106
- - [Pagination](product/components/pagination.md): Moves between pages of a long list.
107
- - [Popover](product/components/popover.md): Opens a non-modal popup anchored to a trigger.
108
- - [Progress](product/components/progress.md): Shows how far a task has advanced.
109
- - [Qr](product/components/qr.md): Renders a value as a QR code.
110
- - [RadioGroup](product/components/radio-group.md): Lets you pick a single option from a short list.
111
- - [SecretValue](product/components/secret-value.md): Masks a secret and adds reveal and copy buttons.
112
- - [Select](product/components/select.md): Opens a list of options for choosing one value.
113
- - [Separator](product/components/separator.md): Draws a rule between groups of content.
114
- - [SidebarMenu](product/components/sidebar-menu.md): Vertical navigation for sidebars and drawers.
115
- - [Skeleton](product/components/skeleton.md): Holds the place of content while it loads.
116
- - [Slider](product/components/slider.md): Picks a single value or a range by dragging.
117
- - [Snippet](product/components/snippet.md): Shows a command or value with a copy button.
118
- - [Spinner](product/components/spinner.md): Shows that something is loading.
119
- - [SplitBar](product/components/split-bar.md): Splits one total between two parts, with a legend under the bar.
120
- - [SplitButton](product/components/split-button.md): Pairs a primary action with a menu of alternatives.
121
- - [Stack](product/components/stack.md): Lays out children in a vertical column.
122
- - [StatusChip](product/components/status-chip.md): Names the status of a payment, an authorization, or a network.
123
- - [StatusIndicator](product/components/status-indicator.md): Names the status of a system or a service with a dot and a label.
124
- - [StatusRow](product/components/status-row.md): Follows the status of one payment or task while it runs.
125
- - [Stepper](product/components/stepper.md): Shows progress through a fixed sequence of steps.
126
- - [SuccessHero](product/components/success-hero.md): Confirms that a setup flow finished, on a dark card of animated streaks.
127
- - [Surface](product/components/surface.md): A card container for grouping related content.
128
- - [Switch](product/components/switch.md): Toggles a setting that applies immediately.
129
- - [Table](product/components/table.md): Displays tabular data in rows and columns.
130
- - [Tabs](product/components/tabs.md): Switches between related views.
131
- - [TempoLogo](product/components/tempo-logo.md): Shows the Tempo brand logo.
132
- - [TextInput](product/components/text-input.md): A text field with optional prefix, suffix, and clear button.
133
- - [Textarea](product/components/textarea.md): A multi-line text field.
134
- - [Toast](product/components/toast.md): Shows a brief notification that dismisses itself.
135
- - [TokenLogo](product/components/token-logo.md): Shows a token logo by contract address or symbol.
136
- - [Token](product/components/token.md): Shows which token an amount is in, and opens a picker to change it.
137
- - [Tooltip](product/components/tooltip.md): Shows a short label for a control on hover or focus.
138
- - [VerificationCode](product/components/verification-code.md): Shows a code that a person compares with the one another app shows.
139
- - [Visual](product/components/visual.md): Illustrates the top of an onboarding or feature modal.
140
-
141
- ## Marketing
142
-
143
- ### Introduction
144
-
145
- - [Getting Started](marketing/introduction/getting-started.md): Install the Marketing system and style your first section.
@@ -1,489 +0,0 @@
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.