@slotted/react 0.1.0-beta.30 → 0.1.0-beta.32

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 (136) hide show
  1. package/dist/{chart-CbOswR3s.js → chart-BXwHG9tX.js} +339 -339
  2. package/dist/chart.js +1 -1
  3. package/dist/dashboard-grid-YMoSW5C1.js +1178 -0
  4. package/dist/dashboard-grid.js +1 -1
  5. package/dist/docs/alert.json +1 -1
  6. package/dist/docs/alert.md +1 -1
  7. package/dist/docs/app-shell.json +1 -1
  8. package/dist/docs/app-shell.md +1 -1
  9. package/dist/docs/card.json +1 -0
  10. package/dist/docs/card.md +1 -1
  11. package/dist/docs/cascader.json +1 -0
  12. package/dist/docs/cascader.md +1 -1
  13. package/dist/docs/chart.examples.md +21 -1
  14. package/dist/docs/chart.json +36 -2
  15. package/dist/docs/chart.md +7 -3
  16. package/dist/docs/collapsible.json +1 -0
  17. package/dist/docs/collapsible.md +1 -1
  18. package/dist/docs/combobox.json +1 -0
  19. package/dist/docs/combobox.md +1 -1
  20. package/dist/docs/dashboard-grid.json +21 -0
  21. package/dist/docs/dashboard-grid.md +3 -0
  22. package/dist/docs/dialog.json +2 -0
  23. package/dist/docs/dialog.md +1 -1
  24. package/dist/docs/drawer.json +1 -0
  25. package/dist/docs/drawer.md +1 -1
  26. package/dist/docs/entity-picker.json +1 -0
  27. package/dist/docs/entity-picker.md +1 -1
  28. package/dist/docs/form.json +1 -1
  29. package/dist/docs/form.md +1 -1
  30. package/dist/docs/import-export-center.json +1 -0
  31. package/dist/docs/import-export-center.md +1 -1
  32. package/dist/docs/index.md +1 -1
  33. package/dist/docs/list.examples.md +721 -0
  34. package/dist/docs/list.json +120 -32
  35. package/dist/docs/list.md +58 -140
  36. package/dist/docs/menu.json +1 -0
  37. package/dist/docs/menu.md +1 -1
  38. package/dist/docs/multi-select.json +1 -0
  39. package/dist/docs/multi-select.md +1 -1
  40. package/dist/docs/navigation-menu.json +1 -0
  41. package/dist/docs/navigation-menu.md +1 -1
  42. package/dist/docs/notification-center.json +1 -0
  43. package/dist/docs/notification-center.md +1 -1
  44. package/dist/docs/page-header.json +1 -1
  45. package/dist/docs/page-header.md +1 -1
  46. package/dist/docs/popover.json +1 -0
  47. package/dist/docs/popover.md +1 -1
  48. package/dist/docs/result-state.json +1 -0
  49. package/dist/docs/result-state.md +1 -1
  50. package/dist/docs/section.json +1 -1
  51. package/dist/docs/section.md +1 -1
  52. package/dist/docs/select.json +1 -0
  53. package/dist/docs/select.md +1 -1
  54. package/dist/docs/skills/compose-screen/SKILL.md +5 -0
  55. package/dist/docs/skills/review-screen/SKILL.md +23 -22
  56. package/dist/docs/table.json +7 -0
  57. package/dist/docs/table.md +1 -0
  58. package/dist/docs/toast.json +1 -0
  59. package/dist/docs/toast.md +1 -1
  60. package/dist/docs/tokens.md +8 -0
  61. package/dist/docs/tour.json +1 -0
  62. package/dist/docs/tour.md +1 -1
  63. package/dist/{import-export-center-Do0zrdSV.js → import-export-center-CV11dYvN.js} +1 -1
  64. package/dist/import-export-center.js +1 -1
  65. package/dist/index.js +4 -4
  66. package/dist/styles/action-bar.css +1 -1
  67. package/dist/styles/action-sheet.css +1 -1
  68. package/dist/styles/alert.css +1 -1
  69. package/dist/styles/app-shell.css +1 -1
  70. package/dist/styles/card.css +1 -1
  71. package/dist/styles/cascader.css +1 -1
  72. package/dist/styles/chart.css +1 -1
  73. package/dist/styles/code-block.css +1 -1
  74. package/dist/styles/collapsible.css +1 -1
  75. package/dist/styles/color-picker.css +2 -2
  76. package/dist/styles/column-manager.css +3 -3
  77. package/dist/styles/combobox.css +1 -1
  78. package/dist/styles/command-palette.css +1 -1
  79. package/dist/styles/context-menu.css +1 -1
  80. package/dist/styles/dashboard-grid.css +6 -4
  81. package/dist/styles/data-grid.css +5 -5
  82. package/dist/styles/data-list.css +2 -2
  83. package/dist/styles/detail-panel.css +2 -2
  84. package/dist/styles/dialog.css +1 -1
  85. package/dist/styles/drawer.css +1 -1
  86. package/dist/styles/entity-picker.css +2 -2
  87. package/dist/styles/event-calendar.css +3 -3
  88. package/dist/styles/filter-bar.css +5 -5
  89. package/dist/styles/form.css +1 -1
  90. package/dist/styles/hover-card.css +1 -1
  91. package/dist/styles/import-export-center.css +6 -6
  92. package/dist/styles/index.css +27 -27
  93. package/dist/styles/markdown.css +2 -2
  94. package/dist/styles/media-viewer.css +1 -1
  95. package/dist/styles/menu.css +1 -1
  96. package/dist/styles/menubar.css +1 -1
  97. package/dist/styles/message.css +1 -1
  98. package/dist/styles/multi-select.css +1 -1
  99. package/dist/styles/navigation-menu.css +1 -1
  100. package/dist/styles/notification-center.css +1 -1
  101. package/dist/styles/page-header.css +1 -1
  102. package/dist/styles/popover.css +1 -1
  103. package/dist/styles/result-state.css +1 -1
  104. package/dist/styles/saved-views.css +2 -2
  105. package/dist/styles/scroll-area.css +1 -1
  106. package/dist/styles/section.css +1 -1
  107. package/dist/styles/select.css +1 -1
  108. package/dist/styles/side-navigation.css +2 -2
  109. package/dist/styles/split-button.css +1 -1
  110. package/dist/styles/table.css +3 -3
  111. package/dist/styles/toast.css +1 -1
  112. package/dist/styles/toolbar.css +1 -1
  113. package/dist/styles/top-navigation.css +2 -2
  114. package/dist/styles/tour.css +1 -1
  115. package/dist/styles/upload.css +1 -1
  116. package/dist/styles/wizard.css +2 -2
  117. package/dist/styles.css +1 -1
  118. package/dist/{table-Bm-PAtCn.js → table-CAhIaFxs.js} +259 -258
  119. package/dist/table.js +1 -1
  120. package/dist/types/chart/chart.d.ts +2 -1
  121. package/dist/types/chart/chart.d.ts.map +1 -1
  122. package/dist/types/dashboard-grid/dashboard-grid.types.d.ts +5 -0
  123. package/dist/types/dashboard-grid/dashboard-grid.types.d.ts.map +1 -1
  124. package/dist/types/dashboard-grid/dashboard-widget-help.d.ts +12 -0
  125. package/dist/types/dashboard-grid/dashboard-widget-help.d.ts.map +1 -0
  126. package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
  127. package/dist/types/dialog/dialog.types.d.ts +6 -2
  128. package/dist/types/dialog/dialog.types.d.ts.map +1 -1
  129. package/dist/types/drawer/drawer.types.d.ts +6 -2
  130. package/dist/types/drawer/drawer.types.d.ts.map +1 -1
  131. package/dist/types/table/table-parts.d.ts +1 -1
  132. package/dist/types/table/table-parts.d.ts.map +1 -1
  133. package/dist/types/table/table.types.d.ts +6 -0
  134. package/dist/types/table/table.types.d.ts.map +1 -1
  135. package/package.json +6 -6
  136. package/dist/dashboard-grid-De6al1Mj.js +0 -1149
@@ -0,0 +1,721 @@
1
+ <!-- index: ./index.md -->
2
+ # list
3
+
4
+ `data-ui="list"` · Vertical list of items with sections.
5
+
6
+ ## Examples
7
+
8
+ ### Playground
9
+
10
+ One set with every axis on it, driven by the controls below the canvas. The rows are ListItem, a family of its own; what this page decides is how they are told apart.
11
+
12
+ Excerpt — not a complete module
13
+
14
+ ```tsx
15
+ <List aria-label="Folders" variant="ruled">
16
+ <ListItem>
17
+ <ListItemLink href="/photos">
18
+ <ListItemBody>
19
+ <ListItemLabel>Photos</ListItemLabel>
20
+ </ListItemBody>
21
+ <ListItemEnd>128</ListItemEnd>
22
+ </ListItemLink>
23
+ </ListItem>
24
+ </List>;
25
+ ```
26
+
27
+ ### Telling the rows apart
28
+
29
+ Four words, and they are accordion’s four so that two families cannot mean different things by one of them. Only separated spends a gap; the other three separate with a line or with nothing.
30
+
31
+ Excerpt — not a complete module
32
+
33
+ ```tsx
34
+ <List variant="plain" />;
35
+ <List variant="ruled" />;
36
+ <List variant="framed" />;
37
+ <List variant="separated" />;
38
+ ```
39
+
40
+ ### The mark, and the order
41
+
42
+ The element carries the reading order and the axis carries the painted mark, which is why an ordered set can paint its own badges and still read in order. The bullet is drawn geometry rather than a character.
43
+
44
+ Excerpt — not a complete module
45
+
46
+ ```tsx
47
+ <List marker="bullet" />;
48
+ <List marker="number" ordered />;
49
+ <List ordered />;
50
+ ```
51
+
52
+ ### Groups
53
+
54
+ A group is an li holding a heading and a nested list, and the nested list names itself by that heading. sticky keeps the name in place while its own rows scroll past it.
55
+
56
+ Example
57
+
58
+ ```tsx
59
+ import { List, ListSection } from '@slotted/react/list';
60
+ import {
61
+ ListItem,
62
+ ListItemBody,
63
+ ListItemContent,
64
+ ListItemDescription,
65
+ ListItemEnd,
66
+ ListItemLabel,
67
+ } from '@slotted/react/list-item';
68
+
69
+ const DAYS = [
70
+ {
71
+ day: 'Today',
72
+ total: '$4,820.00',
73
+ payouts: [
74
+ { id: 'PO-2291', customer: 'Contoso Foods', amount: '$3,150.00' },
75
+ { id: 'PO-2290', customer: 'Aster Bakery', amount: '$1,670.00' },
76
+ ],
77
+ },
78
+ {
79
+ day: 'Yesterday',
80
+ total: '$3,115.50',
81
+ payouts: [
82
+ { id: 'PO-2289', customer: 'Bluefin Market', amount: '$2,240.50' },
83
+ { id: 'PO-2288', customer: 'Driftwood Inn', amount: '$875.00' },
84
+ ],
85
+ },
86
+ ];
87
+
88
+ export default function ListSections() {
89
+ return (
90
+ <List aria-label="Payouts" variant="ruled">
91
+ {DAYS.map((group) => (
92
+ <ListSection end={group.total} key={group.day} label={group.day}>
93
+ {group.payouts.map((payout) => (
94
+ <ListItem key={payout.id}>
95
+ <ListItemContent>
96
+ <ListItemBody>
97
+ <ListItemLabel>{payout.customer}</ListItemLabel>
98
+ <ListItemDescription>{payout.id}</ListItemDescription>
99
+ </ListItemBody>
100
+ <ListItemEnd>{payout.amount}</ListItemEnd>
101
+ </ListItemContent>
102
+ </ListItem>
103
+ ))}
104
+ </ListSection>
105
+ ))}
106
+ </List>
107
+ );
108
+ }
109
+ ```
110
+
111
+ ### A set inside a padded box
112
+
113
+ inset takes the rows inline padding away so the titles line up with the box around them. The rule and the hover fill still run edge to edge, which is the half disableGutters leaves out elsewhere.
114
+
115
+ Example
116
+
117
+ ```tsx
118
+ import { Card, CardBody, CardHeader } from '@slotted/react/card';
119
+ import { List } from '@slotted/react/list';
120
+ import {
121
+ ListItem,
122
+ ListItemBody,
123
+ ListItemContent,
124
+ ListItemDescription,
125
+ ListItemLabel,
126
+ } from '@slotted/react/list-item';
127
+ import { Heading } from '@slotted/react/typography';
128
+
129
+ const CREW = [
130
+ { name: 'Amara Nwosu', role: 'Shift lead, receiving' },
131
+ { name: 'Diego Morales', role: 'Picker, aisles 1 to 6' },
132
+ { name: 'Ingrid Holm', role: 'Packer, station 2' },
133
+ ];
134
+
135
+ export default function ListInset() {
136
+ return (
137
+ <Card>
138
+ <CardHeader>
139
+ <Heading level={3} size="md">
140
+ On shift in Reno
141
+ </Heading>
142
+ </CardHeader>
143
+ <CardBody>
144
+ <List aria-label="On shift in Reno" inset variant="ruled">
145
+ {CREW.map((person) => (
146
+ <ListItem key={person.name}>
147
+ <ListItemContent>
148
+ <ListItemBody>
149
+ <ListItemLabel>{person.name}</ListItemLabel>
150
+ <ListItemDescription>{person.role}</ListItemDescription>
151
+ </ListItemBody>
152
+ </ListItemContent>
153
+ </ListItem>
154
+ ))}
155
+ </List>
156
+ </CardBody>
157
+ </Card>
158
+ );
159
+ }
160
+ ```
161
+
162
+ ### Loading, and empty
163
+
164
+ loading writes aria-busy and draws nothing: Skeleton stands in for the rows. The empty message is an li inside the set, so a reader hears it rather than hearing zero items and then silence.
165
+
166
+ Excerpt — not a complete module
167
+
168
+ ```tsx
169
+ <List aria-label="Folders" loading variant="ruled">
170
+ {placeholderRows}
171
+ </List>;
172
+
173
+ <List aria-label="Results" variant="framed">
174
+ <ListEmpty>No matches</ListEmpty>
175
+ </List>;
176
+ ```
177
+
178
+ ### Content the family did not choose
179
+
180
+ A page of a larger set says where the reader is with position and setSize, and only then. A set in another script mirrors its marker column, its inset and its metadata, because every rule is a logical property.
181
+
182
+ Excerpt — not a complete module
183
+
184
+ ```tsx
185
+ <List aria-label="Results 41 to 43 of 128" variant="ruled">
186
+ <ListItem position={41} setSize={128} />
187
+ </List>;
188
+ ```
189
+
190
+ ### The families beside it
191
+
192
+ The set supplies the box and the rhythm. Checkbox announces the selection a row paints, Badge carries a count, and ListDefaultsProvider sets the four axes once for a whole application.
193
+
194
+ Excerpt — not a complete module
195
+
196
+ ```tsx
197
+ <ListDefaultsProvider size="sm" variant="ruled">
198
+ <Inbox />
199
+ </ListDefaultsProvider>;
200
+ ```
201
+
202
+ ### The role, and the landmark
203
+
204
+ The family writes role="list" because it draws its own marker, and never over a role the page wrote itself. A nav is the page decision, so the family writes none and the row says which one is current.
205
+
206
+ Excerpt — not a complete module
207
+
208
+ ```tsx
209
+ <nav aria-label="Sections">
210
+ <List>
211
+ <ListItem current="page">
212
+ <ListItemLink href="/billing">Billing</ListItemLink>
213
+ </ListItem>
214
+ </List>
215
+ </nav>;
216
+ ```
217
+
218
+ ### defaults.tsx
219
+
220
+ Example
221
+
222
+ ```tsx
223
+ import { List, ListDefaultsProvider } from '@slotted/react/list';
224
+ import { ListItem, ListItemBody, ListItemContent, ListItemLabel } from '@slotted/react/list-item';
225
+ import { Stack } from '@slotted/react/stack';
226
+
227
+ const ROWS = {
228
+ carriers: ['UPS Ground', 'FedEx Express'],
229
+ docks: ['Dock 1, inbound', 'Dock 3, outbound'],
230
+ };
231
+
232
+ export default function ListDefaultsExample() {
233
+ return (
234
+ <ListDefaultsProvider size="sm" variant="ruled">
235
+ <Stack gap={5}>
236
+ <List aria-label="Carriers">
237
+ {ROWS.carriers.map((name) => (
238
+ <ListItem key={name}>
239
+ <ListItemContent>
240
+ <ListItemBody>
241
+ <ListItemLabel>{name}</ListItemLabel>
242
+ </ListItemBody>
243
+ </ListItemContent>
244
+ </ListItem>
245
+ ))}
246
+ </List>
247
+ <List aria-label="Docks" variant="framed">
248
+ {ROWS.docks.map((name) => (
249
+ <ListItem key={name}>
250
+ <ListItemContent>
251
+ <ListItemBody>
252
+ <ListItemLabel>{name}</ListItemLabel>
253
+ </ListItemBody>
254
+ </ListItemContent>
255
+ </ListItem>
256
+ ))}
257
+ </List>
258
+ </Stack>
259
+ </ListDefaultsProvider>
260
+ );
261
+ }
262
+ ```
263
+
264
+ ### empty.tsx
265
+
266
+ Example
267
+
268
+ ```tsx
269
+ import { List, ListEmpty } from '@slotted/react/list';
270
+ import { Heading, Text } from '@slotted/react/typography';
271
+
272
+ export default function ListEmptyExample() {
273
+ return (
274
+ <List aria-label="Returns" variant="framed">
275
+ <ListEmpty>
276
+ <Heading level={3} size="md">
277
+ No returns waiting
278
+ </Heading>
279
+ <Text tone="muted">A return appears here once the customer ships the parcel back.</Text>
280
+ </ListEmpty>
281
+ </List>
282
+ );
283
+ }
284
+ ```
285
+
286
+ ### loading.tsx
287
+
288
+ Example
289
+
290
+ ```tsx
291
+ import { useEffect, useState } from 'react';
292
+
293
+ import { Button } from '@slotted/react/button';
294
+ import { List } from '@slotted/react/list';
295
+ import {
296
+ ListItem,
297
+ ListItemBody,
298
+ ListItemContent,
299
+ ListItemDescription,
300
+ ListItemEnd,
301
+ ListItemLabel,
302
+ } from '@slotted/react/list-item';
303
+ import { Skeleton, SkeletonRegion } from '@slotted/react/skeleton';
304
+ import { Stack } from '@slotted/react/stack';
305
+
306
+ const CARRIERS = [
307
+ { name: 'UPS Ground', cutoff: 'Pickup at 16:30', parcels: '142', widths: ['6rem', '7rem'] },
308
+ { name: 'FedEx Express', cutoff: 'Pickup at 17:00', parcels: '38', widths: ['7.5rem', '7rem'] },
309
+ { name: 'USPS Priority', cutoff: 'Drop-off by 18:00', parcels: '61', widths: ['7rem', '8rem'] },
310
+ ];
311
+
312
+ export default function ListLoading() {
313
+ const [loading, setLoading] = useState(true);
314
+
315
+ useEffect(() => {
316
+ if (!loading) return;
317
+ const timer = setTimeout(() => setLoading(false), 1500);
318
+ return () => clearTimeout(timer);
319
+ }, [loading]);
320
+
321
+ return (
322
+ <Stack align="start" gap={3}>
323
+ <Button onClick={() => setLoading(true)} size="sm" variant="outline">
324
+ Refresh carriers
325
+ </Button>
326
+ <SkeletonRegion
327
+ delay={200}
328
+ loading={loading}
329
+ messages={{ label: 'Loading carriers' }}
330
+ minDuration={400}
331
+ >
332
+ <List aria-label="Carriers" loading={loading} variant="ruled">
333
+ {CARRIERS.map((carrier) => (
334
+ <ListItem key={carrier.name} loading={loading}>
335
+ <ListItemContent>
336
+ <ListItemBody>
337
+ <ListItemLabel>
338
+ {loading ? <Skeleton inlineSize={carrier.widths[0]} /> : carrier.name}
339
+ </ListItemLabel>
340
+ <ListItemDescription>
341
+ {loading ? <Skeleton inlineSize={carrier.widths[1]} /> : carrier.cutoff}
342
+ </ListItemDescription>
343
+ </ListItemBody>
344
+ <ListItemEnd>
345
+ {loading ? <Skeleton inlineSize="2rem" /> : carrier.parcels}
346
+ </ListItemEnd>
347
+ </ListItemContent>
348
+ </ListItem>
349
+ ))}
350
+ </List>
351
+ </SkeletonRegion>
352
+ </Stack>
353
+ );
354
+ }
355
+ ```
356
+
357
+ ### markers.tsx
358
+
359
+ Example
360
+
361
+ ```tsx
362
+ import { List } from '@slotted/react/list';
363
+ import { ListItem, ListItemBody, ListItemContent, ListItemLabel } from '@slotted/react/list-item';
364
+ import { Stack } from '@slotted/react/stack';
365
+ import { Text } from '@slotted/react/typography';
366
+
367
+ const RULES = [
368
+ 'Lithium batteries ship by ground only',
369
+ 'Parcels over 30 kg need a two-person lift label',
370
+ ];
371
+
372
+ const STEPS = ['Receive the pallet at dock 3', 'Scan every carton', 'Put each carton away by bin'];
373
+
374
+ export default function ListMarkers() {
375
+ return (
376
+ <Stack gap={5}>
377
+ <Stack gap={2}>
378
+ <Text size="sm" tone="muted">
379
+ bullet
380
+ </Text>
381
+ <List aria-label="Shipping rules" marker="bullet">
382
+ {RULES.map((rule) => (
383
+ <ListItem key={rule}>
384
+ <ListItemContent>
385
+ <ListItemBody>
386
+ <ListItemLabel>{rule}</ListItemLabel>
387
+ </ListItemBody>
388
+ </ListItemContent>
389
+ </ListItem>
390
+ ))}
391
+ </List>
392
+ </Stack>
393
+
394
+ <Stack gap={2}>
395
+ <Text size="sm" tone="muted">
396
+ number, ordered
397
+ </Text>
398
+ <List aria-label="Receiving steps" marker="number" ordered>
399
+ {STEPS.map((step) => (
400
+ <ListItem key={step}>
401
+ <ListItemContent>
402
+ <ListItemBody>
403
+ <ListItemLabel>{step}</ListItemLabel>
404
+ </ListItemBody>
405
+ </ListItemContent>
406
+ </ListItem>
407
+ ))}
408
+ </List>
409
+ </Stack>
410
+ </Stack>
411
+ );
412
+ }
413
+ ```
414
+
415
+ ### navigation.tsx
416
+
417
+ Example
418
+
419
+ ```tsx
420
+ import { type MouseEvent, useState } from 'react';
421
+
422
+ import { List } from '@slotted/react/list';
423
+ import { ListItem, ListItemBody, ListItemLabel, ListItemLink } from '@slotted/react/list-item';
424
+
425
+ const SECTIONS = [
426
+ { href: '#general', name: 'General' },
427
+ { href: '#warehouses', name: 'Warehouses' },
428
+ { href: '#carriers', name: 'Carriers' },
429
+ { href: '#billing', name: 'Billing' },
430
+ ];
431
+
432
+ export default function ListNavigation() {
433
+ const [here, setHere] = useState('#warehouses');
434
+
435
+ function handleNavigate(event: MouseEvent<HTMLAnchorElement>, href: string) {
436
+ event.preventDefault();
437
+ setHere(href);
438
+ }
439
+
440
+ return (
441
+ <nav aria-label="Settings">
442
+ <List>
443
+ {SECTIONS.map((section) => (
444
+ <ListItem current={section.href === here ? 'page' : false} key={section.href}>
445
+ <ListItemLink
446
+ href={section.href}
447
+ onClick={(event) => handleNavigate(event, section.href)}
448
+ >
449
+ <ListItemBody>
450
+ <ListItemLabel>{section.name}</ListItemLabel>
451
+ </ListItemBody>
452
+ </ListItemLink>
453
+ </ListItem>
454
+ ))}
455
+ </List>
456
+ </nav>
457
+ );
458
+ }
459
+ ```
460
+
461
+ ### page-of-set.tsx
462
+
463
+ Example
464
+
465
+ ```tsx
466
+ import { List } from '@slotted/react/list';
467
+ import {
468
+ ListItem,
469
+ ListItemBody,
470
+ ListItemContent,
471
+ ListItemDescription,
472
+ ListItemEnd,
473
+ ListItemLabel,
474
+ } from '@slotted/react/list-item';
475
+
476
+ const ORDERS = [
477
+ { position: 41, id: 'SO-1141', customer: 'Granite Outfitters', total: '$612.40' },
478
+ { position: 42, id: 'SO-1142', customer: 'Cobalt Fitness', total: '$1,208.00' },
479
+ { position: 43, id: 'SO-1143', customer: 'Fernhill School', total: '$94.75' },
480
+ ];
481
+
482
+ export default function ListPageOfSet() {
483
+ return (
484
+ <List aria-label="Orders 41 to 43 of 128" variant="ruled">
485
+ {ORDERS.map((order) => (
486
+ <ListItem key={order.id} position={order.position} setSize={128}>
487
+ <ListItemContent>
488
+ <ListItemBody>
489
+ <ListItemLabel>{order.id}</ListItemLabel>
490
+ <ListItemDescription>{order.customer}</ListItemDescription>
491
+ </ListItemBody>
492
+ <ListItemEnd>{order.total}</ListItemEnd>
493
+ </ListItemContent>
494
+ </ListItem>
495
+ ))}
496
+ </List>
497
+ );
498
+ }
499
+ ```
500
+
501
+ ### selection.tsx
502
+
503
+ Example
504
+
505
+ ```tsx
506
+ import { useState } from 'react';
507
+
508
+ import { Badge } from '@slotted/react/badge';
509
+ import { Checkbox } from '@slotted/react/checkbox';
510
+ import { List } from '@slotted/react/list';
511
+ import {
512
+ ListItem,
513
+ ListItemBody,
514
+ ListItemContent,
515
+ ListItemDescription,
516
+ ListItemEnd,
517
+ ListItemLabel,
518
+ ListItemStart,
519
+ } from '@slotted/react/list-item';
520
+ import { Stack } from '@slotted/react/stack';
521
+ import { Text } from '@slotted/react/typography';
522
+ import { VisuallyHidden } from '@slotted/react/visually-hidden';
523
+
524
+ const ORDERS = [
525
+ { id: 'SO-1182', customer: 'Contoso Foods', lines: 6 },
526
+ { id: 'SO-1183', customer: 'Atlas Freight', lines: 2 },
527
+ { id: 'SO-1184', customer: 'Ember Goods', lines: 11 },
528
+ ];
529
+
530
+ export default function ListSelection() {
531
+ const [picked, setPicked] = useState<string[]>(['SO-1182']);
532
+
533
+ function handlePick(id: string, checked: boolean) {
534
+ setPicked((current) => (checked ? [...current, id] : current.filter((entry) => entry !== id)));
535
+ }
536
+
537
+ return (
538
+ <Stack gap={3}>
539
+ <List aria-label="Orders to pick" variant="ruled">
540
+ {ORDERS.map((order) => (
541
+ <ListItem key={order.id} selected={picked.includes(order.id)}>
542
+ <ListItemContent>
543
+ <ListItemStart>
544
+ <Checkbox
545
+ checked={picked.includes(order.id)}
546
+ onCheckedChange={(checked) => handlePick(order.id, checked)}
547
+ >
548
+ <VisuallyHidden>Pick {order.id}</VisuallyHidden>
549
+ </Checkbox>
550
+ </ListItemStart>
551
+ <ListItemBody>
552
+ <ListItemLabel>{order.id}</ListItemLabel>
553
+ <ListItemDescription>{order.customer}</ListItemDescription>
554
+ </ListItemBody>
555
+ <ListItemEnd>
556
+ <Badge variant="soft">{order.lines} lines</Badge>
557
+ </ListItemEnd>
558
+ </ListItemContent>
559
+ </ListItem>
560
+ ))}
561
+ </List>
562
+ <Text size="sm" tone="muted">
563
+ {picked.length} of {ORDERS.length} orders on the pick list
564
+ </Text>
565
+ </Stack>
566
+ );
567
+ }
568
+ ```
569
+
570
+ ### sizes.tsx
571
+
572
+ Example
573
+
574
+ ```tsx
575
+ import { List, type ListSize } from '@slotted/react/list';
576
+ import { ListItem, ListItemBody, ListItemContent, ListItemLabel } from '@slotted/react/list-item';
577
+ import { Stack } from '@slotted/react/stack';
578
+ import { Text } from '@slotted/react/typography';
579
+
580
+ const SIZES: ListSize[] = ['sm', 'md', 'lg'];
581
+
582
+ export default function ListSizes() {
583
+ return (
584
+ <Stack gap={5}>
585
+ {SIZES.map((size) => (
586
+ <Stack gap={2} key={size}>
587
+ <Text size="sm" tone="muted">
588
+ {size}
589
+ </Text>
590
+ <List aria-label={`Bins, ${size}`} size={size} variant="ruled">
591
+ {['Aisle 4, bin 12', 'Aisle 4, bin 13'].map((bin) => (
592
+ <ListItem key={bin}>
593
+ <ListItemContent>
594
+ <ListItemBody>
595
+ <ListItemLabel>{bin}</ListItemLabel>
596
+ </ListItemBody>
597
+ </ListItemContent>
598
+ </ListItem>
599
+ ))}
600
+ </List>
601
+ </Stack>
602
+ ))}
603
+ </Stack>
604
+ );
605
+ }
606
+ ```
607
+
608
+ ### sticky.tsx
609
+
610
+ Example
611
+
612
+ ```tsx
613
+ import { List, ListSection } from '@slotted/react/list';
614
+ import {
615
+ ListItem,
616
+ ListItemBody,
617
+ ListItemContent,
618
+ ListItemEnd,
619
+ ListItemLabel,
620
+ } from '@slotted/react/list-item';
621
+ import { ScrollArea } from '@slotted/react/scroll-area';
622
+
623
+ const DAYS = [
624
+ {
625
+ day: 'Monday',
626
+ moves: [
627
+ { id: 'MV-801', sku: 'Oat flour, 25 kg', quantity: '+40' },
628
+ { id: 'MV-802', sku: 'Rye flour, 25 kg', quantity: '+24' },
629
+ { id: 'MV-803', sku: 'Sea salt, 5 kg', quantity: '−12' },
630
+ { id: 'MV-804', sku: 'Cane sugar, 10 kg', quantity: '−30' },
631
+ ],
632
+ },
633
+ {
634
+ day: 'Tuesday',
635
+ moves: [
636
+ { id: 'MV-805', sku: 'Oat flour, 25 kg', quantity: '−18' },
637
+ { id: 'MV-806', sku: 'Dried yeast, 500 g', quantity: '+60' },
638
+ { id: 'MV-807', sku: 'Butter, 10 kg', quantity: '−8' },
639
+ { id: 'MV-808', sku: 'Sea salt, 5 kg', quantity: '+20' },
640
+ ],
641
+ },
642
+ {
643
+ day: 'Wednesday',
644
+ moves: [
645
+ { id: 'MV-809', sku: 'Rye flour, 25 kg', quantity: '−16' },
646
+ { id: 'MV-810', sku: 'Cane sugar, 10 kg', quantity: '+45' },
647
+ { id: 'MV-811', sku: 'Butter, 10 kg', quantity: '+12' },
648
+ { id: 'MV-812', sku: 'Dried yeast, 500 g', quantity: '−22' },
649
+ ],
650
+ },
651
+ ];
652
+
653
+ export default function ListSticky() {
654
+ return (
655
+ <ScrollArea maxBlockSize="16rem" messages={{ label: 'Stock movements' }}>
656
+ <ScrollArea.Content>
657
+ <List aria-label="Stock movements" variant="ruled">
658
+ {DAYS.map((group) => (
659
+ <ListSection
660
+ end={`${group.moves.length} moves`}
661
+ key={group.day}
662
+ label={group.day}
663
+ labelVariant="ruled"
664
+ sticky
665
+ >
666
+ {group.moves.map((move) => (
667
+ <ListItem key={move.id}>
668
+ <ListItemContent>
669
+ <ListItemBody>
670
+ <ListItemLabel>{move.sku}</ListItemLabel>
671
+ </ListItemBody>
672
+ <ListItemEnd>{move.quantity}</ListItemEnd>
673
+ </ListItemContent>
674
+ </ListItem>
675
+ ))}
676
+ </ListSection>
677
+ ))}
678
+ </List>
679
+ </ScrollArea.Content>
680
+ </ScrollArea>
681
+ );
682
+ }
683
+ ```
684
+
685
+ ### variants.tsx
686
+
687
+ Example
688
+
689
+ ```tsx
690
+ import { List, type ListVariant } from '@slotted/react/list';
691
+ import { ListItem, ListItemBody, ListItemContent, ListItemLabel } from '@slotted/react/list-item';
692
+ import { Stack } from '@slotted/react/stack';
693
+ import { Text } from '@slotted/react/typography';
694
+
695
+ const VARIANTS: ListVariant[] = ['plain', 'ruled', 'framed', 'separated'];
696
+
697
+ export default function ListVariants() {
698
+ return (
699
+ <Stack gap={5}>
700
+ {VARIANTS.map((variant) => (
701
+ <Stack gap={2} key={variant}>
702
+ <Text size="sm" tone="muted">
703
+ {variant}
704
+ </Text>
705
+ <List aria-label={`Carriers, ${variant}`} variant={variant}>
706
+ {['UPS Ground', 'FedEx Express'].map((carrier) => (
707
+ <ListItem key={carrier}>
708
+ <ListItemContent>
709
+ <ListItemBody>
710
+ <ListItemLabel>{carrier}</ListItemLabel>
711
+ </ListItemBody>
712
+ </ListItemContent>
713
+ </ListItem>
714
+ ))}
715
+ </List>
716
+ </Stack>
717
+ ))}
718
+ </Stack>
719
+ );
720
+ }
721
+ ```