@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43

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 (298) hide show
  1. package/dist/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
  2. package/dist/app-shell.js +1 -1
  3. package/dist/attachment-TZykYNu5.js +300 -0
  4. package/dist/attachment.js +2 -2
  5. package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
  6. package/dist/avatar-group.js +1 -1
  7. package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
  8. package/dist/carousel.js +1 -1
  9. package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
  10. package/dist/command-palette.js +1 -1
  11. package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
  12. package/dist/data-grid.js +1 -1
  13. package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
  14. package/dist/data-list.js +1 -1
  15. package/dist/detail-panel-Cke3ZFU3.js +342 -0
  16. package/dist/detail-panel.js +2 -2
  17. package/dist/docs/action-bar.examples.md +768 -0
  18. package/dist/docs/action-bar.json +74 -50
  19. package/dist/docs/action-bar.md +49 -311
  20. package/dist/docs/app-shell.examples.md +1221 -64
  21. package/dist/docs/app-shell.json +92 -60
  22. package/dist/docs/app-shell.md +92 -57
  23. package/dist/docs/attachment.examples.md +689 -0
  24. package/dist/docs/attachment.json +69 -37
  25. package/dist/docs/attachment.md +44 -203
  26. package/dist/docs/avatar-group.json +111 -23
  27. package/dist/docs/avatar-group.md +487 -28
  28. package/dist/docs/button-group.json +98 -2
  29. package/dist/docs/button-group.md +411 -8
  30. package/dist/docs/calendar.examples.md +512 -0
  31. package/dist/docs/calendar.json +72 -24
  32. package/dist/docs/calendar.md +18 -147
  33. package/dist/docs/carousel.examples.md +868 -0
  34. package/dist/docs/carousel.json +58 -50
  35. package/dist/docs/carousel.md +66 -300
  36. package/dist/docs/cascader.examples.md +1269 -0
  37. package/dist/docs/cascader.json +72 -16
  38. package/dist/docs/cascader.md +78 -154
  39. package/dist/docs/chart.examples.md +734 -24
  40. package/dist/docs/chart.json +93 -13
  41. package/dist/docs/chart.md +28 -7
  42. package/dist/docs/clock.json +71 -15
  43. package/dist/docs/clock.md +326 -21
  44. package/dist/docs/code-block.json +79 -55
  45. package/dist/docs/code-block.md +417 -74
  46. package/dist/docs/color-picker.json +60 -12
  47. package/dist/docs/color-picker.md +245 -22
  48. package/dist/docs/column-manager.examples.md +764 -0
  49. package/dist/docs/column-manager.json +68 -12
  50. package/dist/docs/column-manager.md +44 -203
  51. package/dist/docs/command-palette.examples.md +747 -0
  52. package/dist/docs/command-palette.json +48 -24
  53. package/dist/docs/command-palette.md +60 -339
  54. package/dist/docs/currency-field.examples.md +355 -73
  55. package/dist/docs/currency-field.json +96 -64
  56. package/dist/docs/currency-field.md +57 -50
  57. package/dist/docs/dashboard-grid.examples.md +629 -0
  58. package/dist/docs/dashboard-grid.json +64 -16
  59. package/dist/docs/dashboard-grid.md +34 -152
  60. package/dist/docs/data-list.examples.md +1556 -0
  61. package/dist/docs/data-list.json +58 -18
  62. package/dist/docs/data-list.md +139 -224
  63. package/dist/docs/date-field.examples.md +543 -0
  64. package/dist/docs/date-field.json +64 -24
  65. package/dist/docs/date-field.md +22 -168
  66. package/dist/docs/datetime-field.examples.md +699 -0
  67. package/dist/docs/datetime-field.json +79 -31
  68. package/dist/docs/datetime-field.md +24 -269
  69. package/dist/docs/datetime-range-picker.examples.md +682 -0
  70. package/dist/docs/datetime-range-picker.json +117 -61
  71. package/dist/docs/datetime-range-picker.md +59 -224
  72. package/dist/docs/description-list.examples.md +652 -0
  73. package/dist/docs/description-list.json +49 -25
  74. package/dist/docs/description-list.md +33 -188
  75. package/dist/docs/detail-panel.examples.md +1177 -0
  76. package/dist/docs/detail-panel.json +69 -53
  77. package/dist/docs/detail-panel.md +114 -324
  78. package/dist/docs/entity-picker.examples.md +1037 -0
  79. package/dist/docs/entity-picker.json +66 -18
  80. package/dist/docs/entity-picker.md +56 -246
  81. package/dist/docs/event-calendar.examples.md +749 -49
  82. package/dist/docs/event-calendar.json +46 -22
  83. package/dist/docs/event-calendar.md +81 -11
  84. package/dist/docs/field-group.examples.md +554 -0
  85. package/dist/docs/field-group.json +98 -34
  86. package/dist/docs/field-group.md +55 -133
  87. package/dist/docs/filter-bar.examples.md +772 -0
  88. package/dist/docs/filter-bar.json +41 -25
  89. package/dist/docs/filter-bar.md +42 -246
  90. package/dist/docs/form.examples.md +579 -0
  91. package/dist/docs/form.json +87 -39
  92. package/dist/docs/form.md +53 -177
  93. package/dist/docs/fullscreen.examples.md +558 -0
  94. package/dist/docs/fullscreen.json +58 -18
  95. package/dist/docs/fullscreen.md +50 -169
  96. package/dist/docs/highlight.json +57 -25
  97. package/dist/docs/highlight.md +402 -50
  98. package/dist/docs/icon.json +85 -5
  99. package/dist/docs/icon.md +401 -10
  100. package/dist/docs/image.examples.md +670 -0
  101. package/dist/docs/image.json +44 -28
  102. package/dist/docs/image.md +24 -176
  103. package/dist/docs/import-export-center.examples.md +1280 -0
  104. package/dist/docs/import-export-center.json +67 -27
  105. package/dist/docs/import-export-center.md +121 -226
  106. package/dist/docs/list-item.examples.md +769 -0
  107. package/dist/docs/list-item.json +110 -38
  108. package/dist/docs/list-item.md +84 -201
  109. package/dist/docs/listbox.examples.md +858 -0
  110. package/dist/docs/listbox.json +76 -28
  111. package/dist/docs/listbox.md +41 -263
  112. package/dist/docs/markdown.json +79 -55
  113. package/dist/docs/markdown.md +581 -85
  114. package/dist/docs/media-viewer.examples.md +1038 -0
  115. package/dist/docs/media-viewer.json +70 -15
  116. package/dist/docs/media-viewer.md +84 -135
  117. package/dist/docs/message-scroller.examples.md +1193 -0
  118. package/dist/docs/message-scroller.json +41 -17
  119. package/dist/docs/message-scroller.md +80 -134
  120. package/dist/docs/message.examples.md +944 -0
  121. package/dist/docs/message.json +64 -16
  122. package/dist/docs/message.md +34 -326
  123. package/dist/docs/meter.json +58 -26
  124. package/dist/docs/meter.md +312 -32
  125. package/dist/docs/navigation-menu.examples.md +1107 -0
  126. package/dist/docs/navigation-menu.json +57 -41
  127. package/dist/docs/navigation-menu.md +105 -298
  128. package/dist/docs/notification-center.examples.md +1045 -0
  129. package/dist/docs/notification-center.json +71 -15
  130. package/dist/docs/notification-center.md +76 -266
  131. package/dist/docs/otp-input.examples.md +490 -0
  132. package/dist/docs/otp-input.json +65 -25
  133. package/dist/docs/otp-input.md +20 -191
  134. package/dist/docs/page-header.examples.md +1041 -0
  135. package/dist/docs/page-header.json +75 -43
  136. package/dist/docs/page-header.md +79 -291
  137. package/dist/docs/page.examples.md +633 -0
  138. package/dist/docs/page.json +48 -16
  139. package/dist/docs/page.md +62 -129
  140. package/dist/docs/prompt-composer.examples.md +630 -0
  141. package/dist/docs/prompt-composer.json +66 -18
  142. package/dist/docs/prompt-composer.md +35 -161
  143. package/dist/docs/prose.json +69 -37
  144. package/dist/docs/prose.md +393 -75
  145. package/dist/docs/rating.examples.md +525 -0
  146. package/dist/docs/rating.json +92 -28
  147. package/dist/docs/rating.md +27 -241
  148. package/dist/docs/saved-views.examples.md +1108 -0
  149. package/dist/docs/saved-views.json +53 -21
  150. package/dist/docs/saved-views.md +86 -171
  151. package/dist/docs/scroll-area.examples.md +837 -0
  152. package/dist/docs/scroll-area.json +64 -24
  153. package/dist/docs/scroll-area.md +57 -140
  154. package/dist/docs/section.examples.md +676 -0
  155. package/dist/docs/section.json +68 -20
  156. package/dist/docs/section.md +39 -162
  157. package/dist/docs/segmented-control.examples.md +480 -0
  158. package/dist/docs/segmented-control.json +76 -28
  159. package/dist/docs/segmented-control.md +20 -191
  160. package/dist/docs/side-navigation.examples.md +1468 -0
  161. package/dist/docs/side-navigation.json +53 -53
  162. package/dist/docs/side-navigation.md +79 -354
  163. package/dist/docs/slider.examples.md +505 -0
  164. package/dist/docs/slider.json +91 -51
  165. package/dist/docs/slider.md +47 -212
  166. package/dist/docs/sparkline.json +60 -36
  167. package/dist/docs/sparkline.md +447 -71
  168. package/dist/docs/split-button.examples.md +509 -0
  169. package/dist/docs/split-button.json +73 -41
  170. package/dist/docs/split-button.md +64 -194
  171. package/dist/docs/splitter.examples.md +921 -0
  172. package/dist/docs/splitter.json +94 -46
  173. package/dist/docs/splitter.md +75 -182
  174. package/dist/docs/stat-card.examples.md +725 -0
  175. package/dist/docs/stat-card.json +89 -41
  176. package/dist/docs/stat-card.md +55 -227
  177. package/dist/docs/status-indicator.json +80 -32
  178. package/dist/docs/status-indicator.md +409 -65
  179. package/dist/docs/stepper.json +53 -21
  180. package/dist/docs/stepper.md +369 -48
  181. package/dist/docs/table-of-contents.examples.md +550 -0
  182. package/dist/docs/table-of-contents.json +60 -28
  183. package/dist/docs/table-of-contents.md +70 -205
  184. package/dist/docs/tags-input.examples.md +541 -0
  185. package/dist/docs/tags-input.json +64 -16
  186. package/dist/docs/tags-input.md +15 -262
  187. package/dist/docs/time-field.examples.md +587 -0
  188. package/dist/docs/time-field.json +69 -29
  189. package/dist/docs/time-field.md +21 -223
  190. package/dist/docs/time-picker.json +117 -53
  191. package/dist/docs/time-picker.md +499 -54
  192. package/dist/docs/time-range-picker.examples.md +750 -0
  193. package/dist/docs/time-range-picker.json +139 -75
  194. package/dist/docs/time-range-picker.md +63 -225
  195. package/dist/docs/timeline.examples.md +617 -0
  196. package/dist/docs/timeline.json +44 -28
  197. package/dist/docs/timeline.md +34 -208
  198. package/dist/docs/toolbar.json +56 -16
  199. package/dist/docs/toolbar.md +357 -63
  200. package/dist/docs/top-navigation.examples.md +1206 -140
  201. package/dist/docs/top-navigation.json +49 -33
  202. package/dist/docs/top-navigation.md +87 -36
  203. package/dist/docs/tour.examples.md +960 -0
  204. package/dist/docs/tour.json +57 -25
  205. package/dist/docs/tour.md +60 -244
  206. package/dist/docs/transfer.examples.md +631 -0
  207. package/dist/docs/transfer.json +80 -16
  208. package/dist/docs/transfer.md +41 -170
  209. package/dist/docs/typography.json +96 -0
  210. package/dist/docs/typography.md +352 -4
  211. package/dist/docs/upload.examples.md +555 -53
  212. package/dist/docs/upload.json +62 -30
  213. package/dist/docs/upload.md +46 -11
  214. package/dist/docs/wizard.examples.md +1389 -0
  215. package/dist/docs/wizard.json +89 -49
  216. package/dist/docs/wizard.md +122 -263
  217. package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
  218. package/dist/entity-picker.js +1 -1
  219. package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
  220. package/dist/event-calendar.js +1 -1
  221. package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
  222. package/dist/filter-bar.js +1 -1
  223. package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
  224. package/dist/import-export-center.js +1 -1
  225. package/dist/index.js +58 -58
  226. package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
  227. package/dist/markdown.js +1 -1
  228. package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
  229. package/dist/media-viewer.js +2 -2
  230. package/dist/message-P91bEGyV.js +455 -0
  231. package/dist/message.js +2 -2
  232. package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
  233. package/dist/page-header.js +1 -1
  234. package/dist/section-CVTQdWBl.js +216 -0
  235. package/dist/section.js +2 -2
  236. package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
  237. package/dist/segmented-control.js +1 -1
  238. package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
  239. package/dist/side-navigation.js +1 -1
  240. package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
  241. package/dist/stat-card.js +1 -1
  242. package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
  243. package/dist/stepper.js +2 -2
  244. package/dist/styles/carousel.css +1 -1
  245. package/dist/styles/index.css +1 -1
  246. package/dist/styles.css +1 -1
  247. package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
  248. package/dist/timeline.js +1 -1
  249. package/dist/top-navigation-YSEQzBhD.js +744 -0
  250. package/dist/top-navigation.js +2 -2
  251. package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
  252. package/dist/transfer.js +1 -1
  253. package/dist/types/attachment/attachment-parts.d.ts +24 -11
  254. package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
  255. package/dist/types/attachment/attachment.d.ts +3 -3
  256. package/dist/types/attachment/attachment.d.ts.map +1 -1
  257. package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
  258. package/dist/types/carousel/carousel-parts.d.ts +2 -2
  259. package/dist/types/command-palette/command-palette.d.ts.map +1 -1
  260. package/dist/types/data-list/data-list.d.ts.map +1 -1
  261. package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
  262. package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
  263. package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
  264. package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
  265. package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
  266. package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
  267. package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
  268. package/dist/types/media-viewer/index.d.ts +2 -2
  269. package/dist/types/media-viewer/index.d.ts.map +1 -1
  270. package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
  271. package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
  272. package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
  273. package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
  274. package/dist/types/message/message-parts.d.ts +7 -0
  275. package/dist/types/message/message-parts.d.ts.map +1 -1
  276. package/dist/types/message/message.d.ts.map +1 -1
  277. package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
  278. package/dist/types/section/section-parts.d.ts +16 -8
  279. package/dist/types/section/section-parts.d.ts.map +1 -1
  280. package/dist/types/section/section.d.ts.map +1 -1
  281. package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
  282. package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
  283. package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
  284. package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
  285. package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
  286. package/dist/types/stepper/stepper-parts.d.ts +11 -2
  287. package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
  288. package/dist/types/stepper/stepper.d.ts.map +1 -1
  289. package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
  290. package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
  291. package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
  292. package/dist/wizard.js +1 -1
  293. package/package.json +6 -6
  294. package/dist/attachment-MqczA38F.js +0 -292
  295. package/dist/detail-panel-EImAtksY.js +0 -327
  296. package/dist/message-D1Dd6Y2k.js +0 -452
  297. package/dist/section-D_qOfdxR.js +0 -213
  298. package/dist/top-navigation-D8IHPOmm.js +0 -744
@@ -0,0 +1,769 @@
1
+ <!-- index: ./index.md -->
2
+ # list-item
3
+
4
+ `data-ui="list-item"` · Row with media, text, metadata and actions.
5
+
6
+ ## Examples
7
+
8
+ ### Playground
9
+
10
+ One row with every axis on it, driven by the controls below the canvas. Tab lands on the box and then on the control beside it; the row binds no key of its own.
11
+
12
+ Excerpt — not a complete module
13
+
14
+ ```tsx
15
+ <ListItem>
16
+ <ListItemLink href="/photos">
17
+ <ListItemBody>
18
+ <ListItemLabel>Photos</ListItemLabel>
19
+ </ListItemBody>
20
+ <ListItemEnd>Yesterday</ListItemEnd>
21
+ </ListItemLink>
22
+ </ListItem>;
23
+ ```
24
+
25
+ ### Three boxes, three trees
26
+
27
+ A static row answers no pointer state because it promises no interaction. The other two are a real button and a real anchor, so Enter, Space and a modified click are the platform’s.
28
+
29
+ Excerpt — not a complete module
30
+
31
+ ```tsx
32
+ <ListItemContent />;
33
+ <ListItemButton onClick={publish} />;
34
+ <ListItemLink href="/photos" />;
35
+ ```
36
+
37
+ ### Every part, and a row with almost none
38
+
39
+ Every part but the box is optional, and an absent one leaves no column behind: each gap is a margin on the part rather than a track on the grid. ListItemEnd takes metadata, inside the box; ListItemActions takes controls, beside it.
40
+
41
+ Excerpt — not a complete module
42
+
43
+ ```tsx
44
+ <ListItem>
45
+ <ListItemContent>
46
+ <ListItemStart>{icon}</ListItemStart>
47
+ <ListItemBody>
48
+ <ListItemLabel>Photos</ListItemLabel>
49
+ <ListItemDescription>128 files</ListItemDescription>
50
+ </ListItemBody>
51
+ <ListItemEnd>Yesterday</ListItemEnd>
52
+ </ListItemContent>
53
+ <ListItemActions>
54
+ <Button size="sm" variant="ghost" onClick={rename}>
55
+ Rename
56
+ </Button>
57
+ <Button size="sm" variant="ghost" onClick={remove}>
58
+ Remove
59
+ </Button>
60
+ </ListItemActions>
61
+ </ListItem>;
62
+ ```
63
+
64
+ ### Where the leading visual sits
65
+
66
+ center is right while the block is one line and wrong as soon as it is three. start returns the mark and the metadata to the title’s own line, so a row of three lines reads from one corner.
67
+
68
+ Excerpt — not a complete module
69
+
70
+ ```tsx
71
+ <ListItem align="center" />;
72
+ <ListItem align="start" />;
73
+ ```
74
+
75
+ ### Six tones
76
+
77
+ A tone moves the ink, the wash under the pointer and the ground of a selected row. It never fills a resting row.
78
+
79
+ Example
80
+
81
+ ```tsx
82
+ import { useState } from 'react';
83
+
84
+ import { List } from '@slotted/react/list';
85
+ import { ListItem, ListItemBody, ListItemButton, ListItemLabel } from '@slotted/react/list-item';
86
+ import { Stack } from '@slotted/react/stack';
87
+ import { Text } from '@slotted/react/typography';
88
+
89
+ const COMMANDS = [
90
+ { tone: 'secondary', label: 'Archive the 2023 price list' },
91
+ { tone: 'accent', label: 'Publish the autumn price list' },
92
+ { tone: 'info', label: 'Share the carrier scorecard' },
93
+ { tone: 'success', label: 'Approve invoice INV-3081' },
94
+ { tone: 'warning', label: 'Release the held order SO-1190' },
95
+ { tone: 'danger', label: 'Cancel shipment SH-7712' },
96
+ ] as const;
97
+
98
+ export default function ListItemToneExample() {
99
+ const [last, setLast] = useState('None yet');
100
+
101
+ return (
102
+ <Stack gap={3}>
103
+ <List aria-label="Commands" variant="ruled">
104
+ {COMMANDS.map((command) => (
105
+ <ListItem key={command.tone} tone={command.tone}>
106
+ <ListItemButton onClick={() => setLast(command.label)}>
107
+ <ListItemBody>
108
+ <ListItemLabel>{command.label}</ListItemLabel>
109
+ </ListItemBody>
110
+ </ListItemButton>
111
+ </ListItem>
112
+ ))}
113
+ </List>
114
+ <Text size="sm" tone="muted">
115
+ Last command: {last}
116
+ </Text>
117
+ </Stack>
118
+ );
119
+ }
120
+ ```
121
+
122
+ ### Every state the row paints
123
+
124
+ Selection is the accent ground, the accent ink and a one-pixel edge together, because every tone surface is white in the high-contrast scheme. Current is the neutral ground with its own edge, so a row can be both at once and the selection is what shows without either of them being lost.
125
+
126
+ Example
127
+
128
+ ```tsx
129
+ import { useState } from 'react';
130
+ import type { MouseEvent } from 'react';
131
+
132
+ import { Checkbox } from '@slotted/react/checkbox';
133
+ import { List } from '@slotted/react/list';
134
+ import {
135
+ ListItem,
136
+ ListItemBody,
137
+ ListItemDescription,
138
+ ListItemLabel,
139
+ ListItemLink,
140
+ ListItemSelect,
141
+ } from '@slotted/react/list-item';
142
+ import { VisuallyHidden } from '@slotted/react/visually-hidden';
143
+
144
+ const STAGES = [
145
+ { id: 'receiving', name: 'Receiving', detail: '14 inbound pallets' },
146
+ { id: 'putaway', name: 'Putaway', detail: '9 pallets to shelve' },
147
+ { id: 'picking', name: 'Picking', detail: '312 orders to ship today' },
148
+ { id: 'packing', name: 'Packing', detail: '74 parcels waiting' },
149
+ ];
150
+
151
+ export default function ListItemStatesExample() {
152
+ const [here, setHere] = useState('picking');
153
+ const [picked, setPicked] = useState<string[]>(['putaway', 'picking']);
154
+
155
+ function handleVisit(event: MouseEvent<HTMLAnchorElement>, id: string) {
156
+ event.preventDefault();
157
+ setHere(id);
158
+ }
159
+
160
+ function handlePick(id: string, checked: boolean) {
161
+ setPicked((current) => (checked ? [...current, id] : current.filter((entry) => entry !== id)));
162
+ }
163
+
164
+ return (
165
+ <List aria-label="Warehouse stages" variant="ruled">
166
+ {STAGES.map((stage) => (
167
+ <ListItem
168
+ key={stage.id}
169
+ current={stage.id === here ? 'page' : false}
170
+ selected={picked.includes(stage.id)}
171
+ >
172
+ <ListItemSelect>
173
+ <Checkbox
174
+ checked={picked.includes(stage.id)}
175
+ onCheckedChange={(checked) => handlePick(stage.id, checked)}
176
+ >
177
+ <VisuallyHidden>Select {stage.name}</VisuallyHidden>
178
+ </Checkbox>
179
+ </ListItemSelect>
180
+ <ListItemLink href={`#${stage.id}`} onClick={(event) => handleVisit(event, stage.id)}>
181
+ <ListItemBody>
182
+ <ListItemLabel>{stage.name}</ListItemLabel>
183
+ <ListItemDescription>{stage.detail}</ListItemDescription>
184
+ </ListItemBody>
185
+ </ListItemLink>
186
+ </ListItem>
187
+ ))}
188
+ </List>
189
+ );
190
+ }
191
+ ```
192
+
193
+ ### Independent targets
194
+
195
+ The two targets are siblings, so the hit area of the row stops before the button. A disabled row refuses its own box and nothing else: the control beside it is the page’s own to disable.
196
+
197
+ Example
198
+
199
+ ```tsx
200
+ import { useState } from 'react';
201
+
202
+ import { Button } from '@slotted/react/button';
203
+ import { List } from '@slotted/react/list';
204
+ import {
205
+ ListItem,
206
+ ListItemActions,
207
+ ListItemBody,
208
+ ListItemDescription,
209
+ ListItemLabel,
210
+ ListItemLink,
211
+ } from '@slotted/react/list-item';
212
+
213
+ const CARRIERS = [
214
+ { id: 'ups', name: 'UPS Ground', pickup: 'Pickup at 16:30' },
215
+ { id: 'fedex', name: 'FedEx Express', pickup: 'Pickup at 17:00' },
216
+ { id: 'usps', name: 'USPS Priority', pickup: 'Drop-off by 18:00' },
217
+ ];
218
+
219
+ export default function ListItemActionsExample() {
220
+ const [paused, setPaused] = useState<string[]>(['fedex']);
221
+
222
+ function handleToggle(id: string) {
223
+ setPaused((current) =>
224
+ current.includes(id) ? current.filter((entry) => entry !== id) : [...current, id],
225
+ );
226
+ }
227
+
228
+ return (
229
+ <List aria-label="Carriers" variant="ruled">
230
+ {CARRIERS.map((carrier) => (
231
+ <ListItem key={carrier.id} disabled={paused.includes(carrier.id)}>
232
+ <ListItemLink href={`#${carrier.id}`}>
233
+ <ListItemBody>
234
+ <ListItemLabel>{carrier.name}</ListItemLabel>
235
+ <ListItemDescription>{carrier.pickup}</ListItemDescription>
236
+ </ListItemBody>
237
+ </ListItemLink>
238
+ <ListItemActions>
239
+ <Button
240
+ aria-label={`${paused.includes(carrier.id) ? 'Resume' : 'Pause'} ${carrier.name}`}
241
+ size="sm"
242
+ variant="ghost"
243
+ onClick={() => handleToggle(carrier.id)}
244
+ >
245
+ {paused.includes(carrier.id) ? 'Resume' : 'Pause'}
246
+ </Button>
247
+ </ListItemActions>
248
+ </ListItem>
249
+ ))}
250
+ </List>
251
+ );
252
+ }
253
+ ```
254
+
255
+ ### The row answers its own width
256
+
257
+ Below 22rem the metadata sits under the title and the independent targets take a line of their own, because a target never shrinks and the box beside it would shrink instead. The container is the row and not the set.
258
+
259
+ Excerpt — not a complete module
260
+
261
+ ```css
262
+ @container slotted-list-item (max-inline-size: 22rem) {
263
+ /* the metadata moves under the title */
264
+ }
265
+ ```
266
+
267
+ ### Content the row did not choose
268
+
269
+ An unbroken token breaks inside the row; a translated title gives way and the timestamp does not; a title in another script keeps its own direction and leaves the row around it alone.
270
+
271
+ Excerpt — not a complete module
272
+
273
+ ```tsx
274
+ <ListItem truncate>
275
+ <ListItemContent>
276
+ <ListItemBody>
277
+ <ListItemLabel>{message.subject}</ListItemLabel>
278
+ </ListItemBody>
279
+ </ListItemContent>
280
+ </ListItem>;
281
+ ```
282
+
283
+ ### The families beside it
284
+
285
+ Checkbox announces the selection the row paints, Badge carries the count, Button is the independent target, Icon is the leading visual. The row draws none of the four. A row whose box is a link takes its checkbox in ListItemSelect, before the link, because an anchor may not hold a checkbox.
286
+
287
+ Excerpt — not a complete module
288
+
289
+ ```tsx
290
+ <>
291
+ <ListItem selected>
292
+ <ListItemContent>
293
+ <ListItemStart>
294
+ <Checkbox aria-label="Select" checked />
295
+ </ListItemStart>
296
+ <ListItemBody>
297
+ <ListItemLabel>Quarterly report</ListItemLabel>
298
+ </ListItemBody>
299
+ <ListItemEnd>
300
+ <Badge tone="accent">3</Badge>
301
+ </ListItemEnd>
302
+ </ListItemContent>
303
+ </ListItem>
304
+ <ListItem selected>
305
+ <ListItemSelect>
306
+ <Checkbox aria-label="Select" checked />
307
+ </ListItemSelect>
308
+ <ListItemLink href="/reports/annual">
309
+ <ListItemBody>
310
+ <ListItemLabel>Annual report</ListItemLabel>
311
+ </ListItemBody>
312
+ </ListItemLink>
313
+ </ListItem>
314
+ </>;
315
+ ```
316
+
317
+ ### What the platform already does
318
+
319
+ The row binds no key. A disabled button leaves the tab sequence, while a disabled link stays in it and refuses the activation — which is what keeps its description reachable to a reader.
320
+
321
+ Excerpt — not a complete module
322
+
323
+ ```tsx
324
+ <ListItem disabled>
325
+ <ListItemLink href="/exports">
326
+ <ListItemBody>
327
+ <ListItemLabel>Exports</ListItemLabel>
328
+ <ListItemDescription>Unavailable while the index rebuilds</ListItemDescription>
329
+ </ListItemBody>
330
+ </ListItemLink>
331
+ </ListItem>;
332
+ ```
333
+
334
+ ### align.tsx
335
+
336
+ Example
337
+
338
+ ```tsx
339
+ import { Glyph, Icon } from '@slotted/react/icon';
340
+ import { List } from '@slotted/react/list';
341
+ import {
342
+ ListItem,
343
+ ListItemBody,
344
+ ListItemContent,
345
+ ListItemDescription,
346
+ ListItemEnd,
347
+ ListItemLabel,
348
+ ListItemStart,
349
+ } from '@slotted/react/list-item';
350
+
351
+ const NOTE =
352
+ 'Two pallets arrived with crushed corners. The carrier signed the damage report and a claim is open.';
353
+
354
+ export default function ListItemAlignExample() {
355
+ return (
356
+ <List aria-label="Receiving notes" variant="ruled">
357
+ <ListItem align="center">
358
+ <ListItemContent>
359
+ <ListItemStart>
360
+ <Icon>
361
+ <Glyph name="file-text" />
362
+ </Icon>
363
+ </ListItemStart>
364
+ <ListItemBody>
365
+ <ListItemLabel>Damage report, PO-4471</ListItemLabel>
366
+ <ListItemDescription>{NOTE}</ListItemDescription>
367
+ </ListItemBody>
368
+ <ListItemEnd>14:10</ListItemEnd>
369
+ </ListItemContent>
370
+ </ListItem>
371
+ <ListItem align="start">
372
+ <ListItemContent>
373
+ <ListItemStart>
374
+ <Icon>
375
+ <Glyph name="file-text" />
376
+ </Icon>
377
+ </ListItemStart>
378
+ <ListItemBody>
379
+ <ListItemLabel>Damage report, PO-4475</ListItemLabel>
380
+ <ListItemDescription>{NOTE}</ListItemDescription>
381
+ </ListItemBody>
382
+ <ListItemEnd>15:45</ListItemEnd>
383
+ </ListItemContent>
384
+ </ListItem>
385
+ </List>
386
+ );
387
+ }
388
+ ```
389
+
390
+ ### busy.tsx
391
+
392
+ Example
393
+
394
+ ```tsx
395
+ import { useEffect, useState } from 'react';
396
+
397
+ import { List } from '@slotted/react/list';
398
+ import {
399
+ ListItem,
400
+ ListItemBody,
401
+ ListItemButton,
402
+ ListItemDescription,
403
+ ListItemLabel,
404
+ ListItemLink,
405
+ } from '@slotted/react/list-item';
406
+
407
+ export default function ListItemBusyExample() {
408
+ const [publishing, setPublishing] = useState(false);
409
+
410
+ useEffect(() => {
411
+ if (!publishing) return;
412
+ const timer = setTimeout(() => setPublishing(false), 2500);
413
+ return () => clearTimeout(timer);
414
+ }, [publishing]);
415
+
416
+ function handlePublish() {
417
+ setPublishing(true);
418
+ }
419
+
420
+ return (
421
+ <List aria-label="Finance commands" variant="ruled">
422
+ <ListItem loading={publishing}>
423
+ <ListItemButton onClick={handlePublish}>
424
+ <ListItemBody>
425
+ <ListItemLabel>Publish the autumn price list</ListItemLabel>
426
+ <ListItemDescription>Takes 2.5 seconds</ListItemDescription>
427
+ </ListItemBody>
428
+ </ListItemButton>
429
+ </ListItem>
430
+ <ListItem disabled>
431
+ <ListItemLink href="#exports">
432
+ <ListItemBody>
433
+ <ListItemLabel>Exports</ListItemLabel>
434
+ <ListItemDescription>Unavailable while the index rebuilds</ListItemDescription>
435
+ </ListItemBody>
436
+ </ListItemLink>
437
+ </ListItem>
438
+ <ListItem disabled>
439
+ <ListItemButton>
440
+ <ListItemBody>
441
+ <ListItemLabel>Close the fiscal period</ListItemLabel>
442
+ <ListItemDescription>Open invoices remain</ListItemDescription>
443
+ </ListItemBody>
444
+ </ListItemButton>
445
+ </ListItem>
446
+ </List>
447
+ );
448
+ }
449
+ ```
450
+
451
+ ### defaults.tsx
452
+
453
+ Example
454
+
455
+ ```tsx
456
+ import { List } from '@slotted/react/list';
457
+ import {
458
+ ListItem,
459
+ ListItemBody,
460
+ ListItemContent,
461
+ ListItemDefaultsProvider,
462
+ ListItemDescription,
463
+ ListItemEnd,
464
+ ListItemLabel,
465
+ } from '@slotted/react/list-item';
466
+
467
+ const NOTE = 'The carrier signed the damage report and a claim is open for two pallets.';
468
+
469
+ export default function ListItemDefaultsExample() {
470
+ return (
471
+ <ListItemDefaultsProvider align="start">
472
+ <List aria-label="Receiving notes" variant="ruled">
473
+ <ListItem>
474
+ <ListItemContent>
475
+ <ListItemBody>
476
+ <ListItemLabel>Damage report, PO-4471</ListItemLabel>
477
+ <ListItemDescription>{NOTE}</ListItemDescription>
478
+ </ListItemBody>
479
+ <ListItemEnd>14:10</ListItemEnd>
480
+ </ListItemContent>
481
+ </ListItem>
482
+ <ListItem>
483
+ <ListItemContent>
484
+ <ListItemBody>
485
+ <ListItemLabel>Damage report, PO-4475</ListItemLabel>
486
+ <ListItemDescription>{NOTE}</ListItemDescription>
487
+ </ListItemBody>
488
+ <ListItemEnd>15:45</ListItemEnd>
489
+ </ListItemContent>
490
+ </ListItem>
491
+ <ListItem align="center">
492
+ <ListItemContent>
493
+ <ListItemBody>
494
+ <ListItemLabel>Damage report, RT-0932</ListItemLabel>
495
+ <ListItemDescription>{NOTE}</ListItemDescription>
496
+ </ListItemBody>
497
+ <ListItemEnd>16:30</ListItemEnd>
498
+ </ListItemContent>
499
+ </ListItem>
500
+ </List>
501
+ </ListItemDefaultsProvider>
502
+ );
503
+ }
504
+ ```
505
+
506
+ ### elements.tsx
507
+
508
+ Example
509
+
510
+ ```tsx
511
+ import { useState } from 'react';
512
+ import type { MouseEvent } from 'react';
513
+
514
+ import { List } from '@slotted/react/list';
515
+ import {
516
+ ListItem,
517
+ ListItemBody,
518
+ ListItemButton,
519
+ ListItemContent,
520
+ ListItemDescription,
521
+ ListItemLabel,
522
+ ListItemLink,
523
+ } from '@slotted/react/list-item';
524
+ import { Stack } from '@slotted/react/stack';
525
+ import { Text } from '@slotted/react/typography';
526
+
527
+ export default function ListItemElementsExample() {
528
+ const [last, setLast] = useState('None yet');
529
+
530
+ function handlePrint() {
531
+ setLast('Pick list sent to the printer');
532
+ }
533
+
534
+ function handleOpen(event: MouseEvent<HTMLAnchorElement>) {
535
+ event.preventDefault();
536
+ setLast('Opened the carrier schedule');
537
+ }
538
+
539
+ return (
540
+ <Stack gap={3}>
541
+ <List aria-label="Dock office" variant="ruled">
542
+ <ListItem>
543
+ <ListItemContent>
544
+ <ListItemBody>
545
+ <ListItemLabel>Dock 3 closes at 18:00</ListItemLabel>
546
+ <ListItemDescription>Read only, no interaction</ListItemDescription>
547
+ </ListItemBody>
548
+ </ListItemContent>
549
+ </ListItem>
550
+ <ListItem>
551
+ <ListItemButton onClick={handlePrint}>
552
+ <ListItemBody>
553
+ <ListItemLabel>Print the pick list</ListItemLabel>
554
+ <ListItemDescription>One command</ListItemDescription>
555
+ </ListItemBody>
556
+ </ListItemButton>
557
+ </ListItem>
558
+ <ListItem>
559
+ <ListItemLink href="#schedule" onClick={handleOpen}>
560
+ <ListItemBody>
561
+ <ListItemLabel>Carrier schedule</ListItemLabel>
562
+ <ListItemDescription>One destination</ListItemDescription>
563
+ </ListItemBody>
564
+ </ListItemLink>
565
+ </ListItem>
566
+ </List>
567
+ <Text size="sm" tone="muted">
568
+ Last action: {last}
569
+ </Text>
570
+ </Stack>
571
+ );
572
+ }
573
+ ```
574
+
575
+ ### end-placement.tsx
576
+
577
+ Example
578
+
579
+ ```tsx
580
+ import { Grid } from '@slotted/react/grid';
581
+ import { List } from '@slotted/react/list';
582
+ import {
583
+ ListItem,
584
+ ListItemBody,
585
+ ListItemContent,
586
+ ListItemEnd,
587
+ ListItemLabel,
588
+ } from '@slotted/react/list-item';
589
+
590
+ export default function ListItemEndPlacementExample() {
591
+ return (
592
+ <Grid columns={2} gap={3} minItemWidth="xs">
593
+ <List aria-label="Metadata under the title" variant="framed">
594
+ <ListItem endPlacement="auto">
595
+ <ListItemContent>
596
+ <ListItemBody>
597
+ <ListItemLabel>Invoice INV-3081</ListItemLabel>
598
+ </ListItemBody>
599
+ <ListItemEnd>$4,280.00</ListItemEnd>
600
+ </ListItemContent>
601
+ </ListItem>
602
+ </List>
603
+ <List aria-label="Metadata beside the title" variant="framed">
604
+ <ListItem endPlacement="beside">
605
+ <ListItemContent>
606
+ <ListItemBody>
607
+ <ListItemLabel>Invoice INV-3082</ListItemLabel>
608
+ </ListItemBody>
609
+ <ListItemEnd>$912.40</ListItemEnd>
610
+ </ListItemContent>
611
+ </ListItem>
612
+ </List>
613
+ </Grid>
614
+ );
615
+ }
616
+ ```
617
+
618
+ ### select.tsx
619
+
620
+ Example
621
+
622
+ ```tsx
623
+ import { useState } from 'react';
624
+
625
+ import { Checkbox } from '@slotted/react/checkbox';
626
+ import { List } from '@slotted/react/list';
627
+ import {
628
+ ListItem,
629
+ ListItemBody,
630
+ ListItemDescription,
631
+ ListItemLabel,
632
+ ListItemLink,
633
+ ListItemSelect,
634
+ } from '@slotted/react/list-item';
635
+ import { Stack } from '@slotted/react/stack';
636
+ import { Text } from '@slotted/react/typography';
637
+ import { VisuallyHidden } from '@slotted/react/visually-hidden';
638
+
639
+ const REPORTS = [
640
+ { id: 'q3-freight', name: 'Q3 freight costs', detail: 'Finance, 18 pages' },
641
+ { id: 'cycle-counts', name: 'Cycle count variances', detail: 'Operations, 6 pages' },
642
+ { id: 'returns', name: 'Returns by reason', detail: 'Commerce, 11 pages' },
643
+ ];
644
+
645
+ export default function ListItemSelectExample() {
646
+ const [picked, setPicked] = useState<string[]>(['cycle-counts']);
647
+
648
+ function handlePick(id: string, checked: boolean) {
649
+ setPicked((current) => (checked ? [...current, id] : current.filter((entry) => entry !== id)));
650
+ }
651
+
652
+ return (
653
+ <Stack gap={3}>
654
+ <List aria-label="Reports" variant="ruled">
655
+ {REPORTS.map((report) => (
656
+ <ListItem key={report.id} selected={picked.includes(report.id)}>
657
+ <ListItemSelect>
658
+ <Checkbox
659
+ checked={picked.includes(report.id)}
660
+ onCheckedChange={(checked) => handlePick(report.id, checked)}
661
+ >
662
+ <VisuallyHidden>Select {report.name}</VisuallyHidden>
663
+ </Checkbox>
664
+ </ListItemSelect>
665
+ <ListItemLink href={`#${report.id}`}>
666
+ <ListItemBody>
667
+ <ListItemLabel>{report.name}</ListItemLabel>
668
+ <ListItemDescription>{report.detail}</ListItemDescription>
669
+ </ListItemBody>
670
+ </ListItemLink>
671
+ </ListItem>
672
+ ))}
673
+ </List>
674
+ <Text size="sm" tone="muted">
675
+ {picked.length} of {REPORTS.length} reports selected
676
+ </Text>
677
+ </Stack>
678
+ );
679
+ }
680
+ ```
681
+
682
+ ### size.tsx
683
+
684
+ Example
685
+
686
+ ```tsx
687
+ import { List } from '@slotted/react/list';
688
+ import {
689
+ ListItem,
690
+ ListItemBody,
691
+ ListItemContent,
692
+ ListItemDescription,
693
+ ListItemEnd,
694
+ ListItemLabel,
695
+ } from '@slotted/react/list-item';
696
+
697
+ const DOCKS = [
698
+ { size: 'sm', name: 'Dock 1', detail: 'Refrigerated', load: '6 of 8 bays' },
699
+ { size: 'md', name: 'Dock 2', detail: 'Ambient', load: '3 of 12 bays' },
700
+ { size: 'lg', name: 'Dock 3', detail: 'Oversize freight', load: '2 of 4 bays' },
701
+ ] as const;
702
+
703
+ export default function ListItemSizeExample() {
704
+ return (
705
+ <List aria-label="Docks" variant="ruled">
706
+ {DOCKS.map((dock) => (
707
+ <ListItem key={dock.size} size={dock.size}>
708
+ <ListItemContent>
709
+ <ListItemBody>
710
+ <ListItemLabel>{dock.name}</ListItemLabel>
711
+ <ListItemDescription>{dock.detail}</ListItemDescription>
712
+ </ListItemBody>
713
+ <ListItemEnd>{dock.load}</ListItemEnd>
714
+ </ListItemContent>
715
+ </ListItem>
716
+ ))}
717
+ </List>
718
+ );
719
+ }
720
+ ```
721
+
722
+ ### truncate.tsx
723
+
724
+ Example
725
+
726
+ ```tsx
727
+ import { List } from '@slotted/react/list';
728
+ import {
729
+ ListItem,
730
+ ListItemBody,
731
+ ListItemContent,
732
+ ListItemDescription,
733
+ ListItemEnd,
734
+ ListItemLabel,
735
+ } from '@slotted/react/list-item';
736
+ import { Stack } from '@slotted/react/stack';
737
+
738
+ const TITLE = 'Freight reconciliation for the Reno, Columbus and Savannah warehouses';
739
+ const TRACKING = 'Tracking 1Z999AA10123456784-RENO-DOCK3-PALLET-0042';
740
+
741
+ export default function ListItemTruncateExample() {
742
+ return (
743
+ <Stack gap={3}>
744
+ <List aria-label="Wrapped" variant="framed">
745
+ <ListItem>
746
+ <ListItemContent>
747
+ <ListItemBody>
748
+ <ListItemLabel>{TITLE}</ListItemLabel>
749
+ <ListItemDescription>{TRACKING}</ListItemDescription>
750
+ </ListItemBody>
751
+ <ListItemEnd>Nov 3</ListItemEnd>
752
+ </ListItemContent>
753
+ </ListItem>
754
+ </List>
755
+ <List aria-label="Truncated" variant="framed">
756
+ <ListItem truncate>
757
+ <ListItemContent>
758
+ <ListItemBody>
759
+ <ListItemLabel>{TITLE}</ListItemLabel>
760
+ <ListItemDescription>{TRACKING}</ListItemDescription>
761
+ </ListItemBody>
762
+ <ListItemEnd>Nov 3</ListItemEnd>
763
+ </ListItemContent>
764
+ </ListItem>
765
+ </List>
766
+ </Stack>
767
+ );
768
+ }
769
+ ```