@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,516 +0,0 @@
1
- # Pagination
2
-
3
- Moves between pages of a long list.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/Pagination.tsx)
6
-
7
- ## Overview
8
-
9
- Pagination renders a navigation landmark with links to each page of a list, plus previous and next steps.
10
-
11
- ## Examples
12
-
13
- ### Basic
14
-
15
- ```tsx
16
- import { Pagination } from '@tempoxyz/ds'
17
-
18
- function Pages(props: { current: number; size?: Pagination.Props['size'] }) {
19
- return (
20
- <Pagination size={props.size}>
21
- <Pagination.Previous disabled={props.current === 1} href="#" />
22
- <Pagination.Page current={props.current === 1} href="#">
23
- 1
24
- </Pagination.Page>
25
- <Pagination.Ellipsis />
26
- <Pagination.Page current={props.current === 4} href="#">
27
- 4
28
- </Pagination.Page>
29
- <Pagination.Ellipsis />
30
- <Pagination.Page current={props.current === 9} href="#">
31
- 9
32
- </Pagination.Page>
33
- <Pagination.Next disabled={props.current === 9} href="#" />
34
- </Pagination>
35
- )
36
- }
37
-
38
- export function Demo() {
39
- return <Pages current={4} />
40
- }
41
- ```
42
-
43
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Pagination/Basic.tsx)
44
-
45
- ### Size
46
-
47
- Set `size` to `small`, `medium` (default), or `large`.
48
-
49
- ```tsx
50
- import { Pagination, Stack } from '@tempoxyz/ds'
51
-
52
- function Pages(props: { current: number; size?: Pagination.Props['size'] }) {
53
- return (
54
- <Pagination size={props.size}>
55
- <Pagination.Previous disabled={props.current === 1} href="#" />
56
- <Pagination.Page current={props.current === 1} href="#">
57
- 1
58
- </Pagination.Page>
59
- <Pagination.Ellipsis />
60
- <Pagination.Page current={props.current === 4} href="#">
61
- 4
62
- </Pagination.Page>
63
- <Pagination.Ellipsis />
64
- <Pagination.Page current={props.current === 9} href="#">
65
- 9
66
- </Pagination.Page>
67
- <Pagination.Next disabled={props.current === 9} href="#" />
68
- </Pagination>
69
- )
70
- }
71
-
72
- export function Demo() {
73
- return (
74
- <Stack gap="16">
75
- <Pages current={4} size="small" />
76
- <Pages current={4} size="medium" />
77
- <Pages current={4} size="large" />
78
- </Stack>
79
- )
80
- }
81
- ```
82
-
83
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Pagination/Size.tsx)
84
-
85
- ### Current
86
-
87
- Set `current` on exactly one `Pagination.Page`. `Pagination.Previous` and `Pagination.Next` take `disabled` at either end.
88
-
89
- ```tsx
90
- import { Pagination, Stack } from '@tempoxyz/ds'
91
-
92
- function Pages(props: { current: number; size?: Pagination.Props['size'] }) {
93
- return (
94
- <Pagination size={props.size}>
95
- <Pagination.Previous disabled={props.current === 1} href="#" />
96
- <Pagination.Page current={props.current === 1} href="#">
97
- 1
98
- </Pagination.Page>
99
- <Pagination.Ellipsis />
100
- <Pagination.Page current={props.current === 4} href="#">
101
- 4
102
- </Pagination.Page>
103
- <Pagination.Ellipsis />
104
- <Pagination.Page current={props.current === 9} href="#">
105
- 9
106
- </Pagination.Page>
107
- <Pagination.Next disabled={props.current === 9} href="#" />
108
- </Pagination>
109
- )
110
- }
111
-
112
- export function Demo() {
113
- return (
114
- <Stack gap="16">
115
- <Pages current={1} />
116
- <Pages current={4} />
117
- <Pages current={9} />
118
- </Stack>
119
- )
120
- }
121
- ```
122
-
123
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Pagination/Current.tsx)
124
-
125
- ## Anatomy
126
-
127
- Import the component and assemble its parts.
128
-
129
- ```tsx
130
- import { Pagination } from '@tempoxyz/ds'
131
-
132
- <Pagination>
133
- <Pagination.Previous />
134
- <Pagination.Page />
135
- <Pagination.Ellipsis />
136
- <Pagination.Next />
137
- </Pagination>
138
- ```
139
-
140
- ## Guidelines
141
-
142
- ### When to Use
143
-
144
- * Split long lists that people scan, sort, and revisit, such as transaction history or webhook deliveries.
145
- * Paginate tables where position matters, such as a shared link to page 3.
146
-
147
- ### When Not to Use
148
-
149
- * Use a `secondary` [Button](button.md) labelled Load more at the end of a feed, such as wallet Activity.
150
- * Use [Stepper](stepper.md) for progress through a flow.
151
- * Use [Tabs](tabs.md) to split a list by category, such as Incoming and Outgoing.
152
- * Use a [Table](table.md) or [ListGroup](list-group.md) without pagination when the list fits on one screen.
153
-
154
- ### Choose Pagination or Load More
155
-
156
- * **Pagination (Tables and logs):** Each page has a URL, readers jump to any page, and the footer stays reachable.
157
- * **Load More (Feeds):** New items append below the last one. The footer is reachable after each load.
158
-
159
- Avoid infinite scroll on the web. It pushes the footer out of reach and gives keyboard users no stopping point.
160
-
161
- ### Link Every Page
162
-
163
- Give each `Pagination.Page` an `href` with its number. Links then survive a reload, open in a new tab, and work with Back. Pass `render` to use your router's link.
164
-
165
- **Do:** Put the page number in the URL, such as `?page=3`.
166
-
167
- ```tsx
168
- /**
169
- * Do example for "Link Every Page" on the Pagination page.
170
- * Put the page number in the URL, such as `?page=3`.
171
- * @module
172
- */
173
- import { Pagination, style } from '@tempoxyz/ds'
174
-
175
- /** Renders the static preview, which the guideline card shows inert. */
176
- export function Demo() {
177
- return (
178
- <div {...styles.page()}>
179
- <span {...styles.address()}>console.tempo.xyz/activity?page=3</span>
180
- <Pagination size="small">
181
- <Pagination.Previous href="#" />
182
- <Pagination.Page href="#">2</Pagination.Page>
183
- <Pagination.Page current href="#">
184
- 3
185
- </Pagination.Page>
186
- <Pagination.Page href="#">4</Pagination.Page>
187
- <Pagination.Next href="#" />
188
- </Pagination>
189
- </div>
190
- )
191
- }
192
-
193
- namespace styles {
194
- export const address = style({
195
- backgroundColor: 'container.regular',
196
- borderRadius: 'full',
197
- color: 'content.secondary',
198
- cornerShape: 'round',
199
- paddingBlock: '4',
200
- paddingInline: '12',
201
- typography: 'body.b3',
202
- })
203
-
204
- export const page = style({
205
- alignItems: 'flex-start',
206
- display: 'flex',
207
- flexDirection: 'column',
208
- rowGap: '16',
209
- })
210
- }
211
- ```
212
-
213
- **Don't:** Change pages without changing the URL.
214
-
215
- ```tsx
216
- /**
217
- * Don't example for "Link Every Page" on the Pagination page.
218
- * Don't change pages without changing the URL.
219
- * @module
220
- */
221
- import { Pagination, style } from '@tempoxyz/ds'
222
-
223
- /** Renders the static preview, which the guideline card shows inert. */
224
- export function Demo() {
225
- return (
226
- <div {...styles.page()}>
227
- <span {...styles.address()}>console.tempo.xyz/activity</span>
228
- <Pagination size="small">
229
- <Pagination.Previous href="#" />
230
- <Pagination.Page href="#">2</Pagination.Page>
231
- <Pagination.Page current href="#">
232
- 3
233
- </Pagination.Page>
234
- <Pagination.Page href="#">4</Pagination.Page>
235
- <Pagination.Next href="#" />
236
- </Pagination>
237
- </div>
238
- )
239
- }
240
-
241
- namespace styles {
242
- export const address = style({
243
- backgroundColor: 'container.regular',
244
- borderRadius: 'full',
245
- color: 'content.secondary',
246
- cornerShape: 'round',
247
- paddingBlock: '4',
248
- paddingInline: '12',
249
- typography: 'body.b3',
250
- })
251
-
252
- export const page = style({
253
- alignItems: 'flex-start',
254
- display: 'flex',
255
- flexDirection: 'column',
256
- rowGap: '16',
257
- })
258
- }
259
- ```
260
-
261
- ### Truncate Long Ranges
262
-
263
- * **Always show:** The first, last, and current pages.
264
- * **Skipped ranges:** Replace each with a `Pagination.Ellipsis`.
265
- * **Limit:** Keep about seven page items, with the current page's neighbors when there is room.
266
-
267
- **Do:** Keep the first and last pages around the current one.
268
-
269
- ```tsx
270
- /**
271
- * Do example for "Truncate Long Ranges" on the Pagination page.
272
- * Keep the first and last pages around the current one.
273
- * @module
274
- */
275
- import { Pagination } from '@tempoxyz/ds'
276
-
277
- /** Renders the static preview, which the guideline card shows inert. */
278
- export function Demo() {
279
- return (
280
- <Pagination size="small">
281
- <Pagination.Previous href="#" />
282
- <Pagination.Page href="#">1</Pagination.Page>
283
- <Pagination.Ellipsis />
284
- <Pagination.Page href="#">4</Pagination.Page>
285
- <Pagination.Page current href="#">
286
- 5
287
- </Pagination.Page>
288
- <Pagination.Page href="#">6</Pagination.Page>
289
- <Pagination.Ellipsis />
290
- <Pagination.Page href="#">49</Pagination.Page>
291
- <Pagination.Next href="#" />
292
- </Pagination>
293
- )
294
- }
295
- ```
296
-
297
- **Don't:** Show only the pages next to the current one.
298
-
299
- ```tsx
300
- /**
301
- * Don't example for "Truncate Long Ranges" on the Pagination page.
302
- * Don't show only the pages next to the current one.
303
- * @module
304
- */
305
- import { Pagination } from '@tempoxyz/ds'
306
-
307
- /** Renders the static preview, which the guideline card shows inert. */
308
- export function Demo() {
309
- return (
310
- <Pagination size="small">
311
- <Pagination.Previous href="#" />
312
- <Pagination.Page href="#">4</Pagination.Page>
313
- <Pagination.Page current href="#">
314
- 5
315
- </Pagination.Page>
316
- <Pagination.Page href="#">6</Pagination.Page>
317
- <Pagination.Next href="#" />
318
- </Pagination>
319
- )
320
- }
321
- ```
322
-
323
- ### Keep Previous and Next in Place
324
-
325
- Render `Pagination.Previous` and `Pagination.Next` on every page. Set `disabled` at either end instead of removing them, so the page links do not shift.
326
-
327
- **Do:** Disable Previous on the first page.
328
-
329
- ```tsx
330
- /**
331
- * Do example for "Keep Previous and Next in Place" on the Pagination page.
332
- * Disable Previous on the first page.
333
- * @module
334
- */
335
- import { Pagination } from '@tempoxyz/ds'
336
-
337
- /** Renders the static preview, which the guideline card shows inert. */
338
- export function Demo() {
339
- return (
340
- <Pagination size="small">
341
- <Pagination.Previous disabled />
342
- <Pagination.Page current href="#">
343
- 1
344
- </Pagination.Page>
345
- <Pagination.Page href="#">2</Pagination.Page>
346
- <Pagination.Page href="#">3</Pagination.Page>
347
- <Pagination.Next href="#" />
348
- </Pagination>
349
- )
350
- }
351
- ```
352
-
353
- **Don't:** Remove Previous, which moves every page link when it returns.
354
-
355
- ```tsx
356
- /**
357
- * Don't example for "Keep Previous and Next in Place" on the Pagination page.
358
- * Don't remove Previous, which moves every page link when it returns.
359
- * @module
360
- */
361
- import { Pagination } from '@tempoxyz/ds'
362
-
363
- /** Renders the static preview, which the guideline card shows inert. */
364
- export function Demo() {
365
- return (
366
- <Pagination size="small">
367
- <Pagination.Page current href="#">
368
- 1
369
- </Pagination.Page>
370
- <Pagination.Page href="#">2</Pagination.Page>
371
- <Pagination.Page href="#">3</Pagination.Page>
372
- <Pagination.Next href="#" />
373
- </Pagination>
374
- )
375
- }
376
- ```
377
-
378
- ### Show the Range You're Viewing
379
-
380
- Place a count beside the control, directly below its list.
381
-
382
- **Do:** Show the rows on screen and the total, such as Showing 51–75 of 1,204 transactions.
383
-
384
- ```tsx
385
- /**
386
- * Do example for "Show the Range You're Viewing" on the Pagination page.
387
- * Show the rows on screen and the total, such as Showing 51–75 of 1,204 transactions.
388
- * @module
389
- */
390
- import { Pagination, style } from '@tempoxyz/ds'
391
-
392
- /** Renders the static preview, which the guideline card shows inert. */
393
- export function Demo() {
394
- return (
395
- <div {...styles.row()}>
396
- <span {...styles.count()}>Showing 51–75 of 1,204 transactions</span>
397
- <Pagination size="small">
398
- <Pagination.Previous href="#" />
399
- <Pagination.Page href="#">2</Pagination.Page>
400
- <Pagination.Page current href="#">
401
- 3
402
- </Pagination.Page>
403
- <Pagination.Page href="#">4</Pagination.Page>
404
- <Pagination.Next href="#" />
405
- </Pagination>
406
- </div>
407
- )
408
- }
409
-
410
- namespace styles {
411
- export const count = style({ color: 'content.secondary', typography: 'body.b3' })
412
-
413
- export const row = style({
414
- alignItems: 'center',
415
- display: 'flex',
416
- flexWrap: 'wrap',
417
- gap: '12',
418
- justifyContent: 'space-between',
419
- width: '100% !custom',
420
- })
421
- }
422
- ```
423
-
424
- **Don't:** Show page numbers without the count.
425
-
426
- ```tsx
427
- /**
428
- * Don't example for "Show the Range You're Viewing" on the Pagination page.
429
- * Don't show page numbers without the count.
430
- * @module
431
- */
432
- import { Pagination, style } from '@tempoxyz/ds'
433
-
434
- /** Renders the static preview, which the guideline card shows inert. */
435
- export function Demo() {
436
- return (
437
- <div {...styles.row()}>
438
- <Pagination size="small">
439
- <Pagination.Previous href="#" />
440
- <Pagination.Page href="#">2</Pagination.Page>
441
- <Pagination.Page current href="#">
442
- 3
443
- </Pagination.Page>
444
- <Pagination.Page href="#">4</Pagination.Page>
445
- <Pagination.Next href="#" />
446
- </Pagination>
447
- </div>
448
- )
449
- }
450
-
451
- namespace styles {
452
- export const row = style({
453
- alignItems: 'center',
454
- display: 'flex',
455
- flexWrap: 'wrap',
456
- gap: '12',
457
- justifyContent: 'space-between',
458
- width: '100% !custom',
459
- })
460
- }
461
- ```
462
-
463
- ### Match Size to the List
464
-
465
- * **Small (32px):** Under dense tables, like Tempo Performance runs.
466
- * **Medium (40px):** The default.
467
- * **Large (56px):** Touch-first layouts.
468
-
469
- ## Content
470
-
471
- * **Steps:** Keep the default Previous and Next. If children replace them, keep both descriptive, such as Newer and Older.
472
- * **Count:** Name the rows of the list, such as transactions or deliveries.
473
- * **Numbers:** Use numerals, and group the digits of large totals, such as 1,204.
474
-
475
- ## Accessibility
476
-
477
- The current page and disabled steps carry ARIA states.
478
-
479
- ### Semantics
480
-
481
- * **Root (navigation):** A landmark named "Pagination" that wraps a list of pages.
482
- * **Parts (li):** Each part is a list item. Pages and steps render links by default.
483
- * **Current Page (aria-current):** Set by `current`. Screen readers announce the page as current.
484
- * **Disabled Steps (aria-disabled):** Renders as text and leaves the tab order. With `render`, it keeps your element.
485
- * **Pagination.Ellipsis:** Plain text that takes no focus. The chevron icons are hidden from assistive technology.
486
-
487
- ### Keyboard
488
-
489
- * **Move Between Links (Tab):** Moves through the links in order. Skips ellipses and disabled steps without `render`.
490
- * **Follow a Link (Enter):** Follows the focused link.
491
-
492
- ### Your Responsibilities
493
-
494
- * **Mark One Current Page (current):** Set it on exactly one page.
495
- * **Block Disabled Custom Links (render):** For a custom disabled step, block navigation and remove it from the tab order yourself.
496
- * **Name Each Pagination (aria-label):** If a page holds more than one, give each a distinct name, such as "Deliveries pagination".
497
- * **Name Page Links (SC 2.4.4):** Consider an `aria-label` such as "Page 4". A bare number means little out of context.
498
- * **Handle In-Place Loads:** After a client-side page change, move focus to the start of the results, such as the heading.
499
-
500
- ## Related
501
-
502
- [Table](table.md)
503
-
504
- Use for the rows you paginate.
505
-
506
- [ListGroup](list-group.md)
507
-
508
- Use for lists of records.
509
-
510
- [Button](button.md)
511
-
512
- Use for a Load more action.
513
-
514
- [Tables and Lists](../patterns/tables-and-lists.md)
515
-
516
- Covers sorting, filtering, and paging data.