@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
@@ -5,71 +5,293 @@
5
5
 
6
6
  ## Examples
7
7
 
8
+ ### Playground
9
+
10
+ Every axis on one upload, driven by the controls below the canvas. Drop a file on it, or press Browse files — nothing is sent here, because no adapter is given and a family without one selects and holds.
11
+
12
+ Excerpt — not a complete module
13
+
14
+ ```tsx
15
+ <Upload
16
+ accept="application/pdf,image/*"
17
+ description="PDF, JPEG or PNG, up to 10 MB each."
18
+ label="Supporting documents"
19
+ multiple
20
+ />;
21
+ ```
22
+
8
23
  ### The three shapes one family has
9
24
 
10
25
  A drop region, a bare trigger and a control-height row. They are one axis rather than three families: the list, the summary and every per-row control below them are the same parts in all three, and only the region changes shape.
11
26
 
12
- Excerpt — not a complete module
27
+ Example
13
28
 
14
29
  ```tsx
15
- <Upload label="Supporting documents" multiple variant="dropzone" />;
16
- <Upload label="Attach a file" variant="button" />;
17
- <Upload label="Proof of ownership" variant="field" />;
30
+ import { Upload } from '@slotted/react/upload';
31
+ import { Stack } from '@slotted/react/stack';
32
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
33
+
34
+ const dropzoneFiles: UploadFile[] = [claimFile('purchase-order-4417.pdf', 248_000, 'pdf')];
35
+ const fieldFiles: UploadFile[] = [claimFile('signed-delivery-note-5120.pdf', 512_000, 'pdf')];
36
+
37
+ export default function UploadVariantsExample() {
38
+ return (
39
+ <Stack gap={5}>
40
+ <Upload
41
+ defaultFiles={dropzoneFiles}
42
+ label="Supporting documents"
43
+ multiple
44
+ variant="dropzone"
45
+ />
46
+
47
+ <Upload label="Attach a file" variant="button" />
48
+
49
+ <Upload defaultFiles={fieldFiles} label="Proof of delivery" variant="field" />
50
+ </Stack>
51
+ );
52
+ }
53
+
54
+ function claimFile(
55
+ name: string,
56
+ size: number,
57
+ kind: FileKind,
58
+ status: UploadFile['status'] = 'success',
59
+ loaded = status === 'success' ? size : 0,
60
+ reason?: UploadFile['reason'],
61
+ ): UploadFile {
62
+ return {
63
+ key: `${name}:${size}`,
64
+ name,
65
+ size,
66
+ type: '',
67
+ kind,
68
+ status,
69
+ loaded,
70
+ total: size,
71
+ attempts: status === 'ready' ? 0 : 1,
72
+ ...(reason === undefined ? {} : { reason }),
73
+ };
74
+ }
18
75
  ```
19
76
 
20
77
  ### A column of rows, or a wall of pictures
21
78
 
22
79
  The same rows, arranged. An image set is read by looking rather than by reading, so the grid gives the preview the card, moves the controls onto the corner of the picture and puts the name underneath — and a file with no thumbnail shows its extension in words on the tile.
23
80
 
24
- Excerpt — not a complete module
81
+ Example
25
82
 
26
83
  ```tsx
27
- <Upload accept="image/*" label="Photographs of the damage" layout="grid" multiple />;
84
+ import { Upload } from '@slotted/react/upload';
85
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
86
+
87
+ const files: UploadFile[] = [
88
+ claimFile('dock-photo-pallet-6.jpg', 4_100_000, 'image'),
89
+ claimFile('dock-photo-pallet-7.jpg', 3_200_000, 'image'),
90
+ claimFile('damaged-carton-label.jpg', 2_800_000, 'image'),
91
+ claimFile('carrier-damage-report.pdf', 640_000, 'pdf'),
92
+ claimFile('scan0001', 18_600_000, 'other'),
93
+ ];
94
+
95
+ export default function UploadLayoutExample() {
96
+ return (
97
+ <Upload
98
+ accept="image/*"
99
+ defaultFiles={files}
100
+ label="Photographs of the shipment"
101
+ layout="grid"
102
+ multiple
103
+ />
104
+ );
105
+ }
106
+
107
+ function claimFile(
108
+ name: string,
109
+ size: number,
110
+ kind: FileKind,
111
+ status: UploadFile['status'] = 'success',
112
+ loaded = status === 'success' ? size : 0,
113
+ reason?: UploadFile['reason'],
114
+ ): UploadFile {
115
+ return {
116
+ key: `${name}:${size}`,
117
+ name,
118
+ size,
119
+ type: '',
120
+ kind,
121
+ status,
122
+ loaded,
123
+ total: size,
124
+ attempts: status === 'ready' ? 0 : 1,
125
+ ...(reason === undefined ? {} : { reason }),
126
+ };
127
+ }
28
128
  ```
29
129
 
30
130
  ### Three steps, and what moves with them
31
131
 
32
132
  The trigger height, the type, the glyphs, the chip and the row’s controls all step together, because every one of them reads a control token the theme restates per density. The insets come from the space scale and do not move, which is the cost card and alert both accepted.
33
133
 
34
- Excerpt — not a complete module
134
+ Example
35
135
 
36
136
  ```tsx
37
- <Upload size="sm" />;
38
- <Upload size="md" />;
39
- <Upload size="lg" />;
137
+ import { Upload } from '@slotted/react/upload';
138
+ import { Stack } from '@slotted/react/stack';
139
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
140
+
141
+ const small: UploadFile[] = [claimFile('pick-list-0914.csv', 48_000, 'spreadsheet')];
142
+ const medium: UploadFile[] = [claimFile('receiving-note-4417.docx', 86_000, 'document')];
143
+ const large: UploadFile[] = [claimFile('carrier-contract-2026.pdf', 1_900_000, 'pdf')];
144
+
145
+ export default function UploadSizesExample() {
146
+ return (
147
+ <Stack gap={5}>
148
+ <Upload defaultFiles={small} label="sm: a row in a dense table" size="sm" variant="field" />
149
+
150
+ <Upload defaultFiles={medium} label="md: a form" size="md" variant="field" />
151
+
152
+ <Upload defaultFiles={large} label="lg: a page of its own" size="lg" variant="field" />
153
+ </Stack>
154
+ );
155
+ }
156
+
157
+ function claimFile(
158
+ name: string,
159
+ size: number,
160
+ kind: FileKind,
161
+ status: UploadFile['status'] = 'success',
162
+ loaded = status === 'success' ? size : 0,
163
+ reason?: UploadFile['reason'],
164
+ ): UploadFile {
165
+ return {
166
+ key: `${name}:${size}`,
167
+ name,
168
+ size,
169
+ type: '',
170
+ kind,
171
+ status,
172
+ loaded,
173
+ total: size,
174
+ attempts: status === 'ready' ? 0 : 1,
175
+ ...(reason === undefined ? {} : { reason }),
176
+ };
177
+ }
40
178
  ```
41
179
 
42
180
  ### What is refused, and what the reader is told
43
181
 
44
182
  Nine reasons, each with its own sentence. accept filters the picker’s dialog and nothing else, so the family applies it to a drop as well — otherwise the same region accepts by drop what it refuses by picker. A refused file stays in the list rather than vanishing, because silence leaves the reader hunting for a file that never appeared.
45
183
 
46
- Excerpt — not a complete module
184
+ Example
47
185
 
48
186
  ```tsx
49
- <Upload
50
- accept="application/pdf,image/*"
51
- maxFiles={10}
52
- maxSize={10 * 1024 * 1024}
53
- maxTotalSize={50 * 1024 * 1024}
54
- minSize={1}
55
- multiple
56
- onReject={(files) => console.warn(files.map((file) => file.reason))}
57
- />;
187
+ import { Upload } from '@slotted/react/upload';
188
+ import { Stack } from '@slotted/react/stack';
189
+ import { useState } from 'react';
190
+ import { Text } from '@slotted/react/typography';
191
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
192
+
193
+ const files: UploadFile[] = [
194
+ claimFile('inventory-export-full.csv', 52_000_000, 'spreadsheet', 'rejected', 0, 'size'),
195
+ ];
196
+
197
+ export default function UploadRestrictionsExample() {
198
+ const [refused, setRefused] = useState(0);
199
+
200
+ return (
201
+ <Stack gap={3}>
202
+ <Upload
203
+ accept="application/pdf,image/*"
204
+ defaultFiles={files}
205
+ label="Supplier documents"
206
+ maxFiles={3}
207
+ maxSize={10 * 1024 * 1024}
208
+ maxTotalSize={25 * 1024 * 1024}
209
+ minSize={1}
210
+ multiple
211
+ onReject={(rejected) => setRefused((count) => count + rejected.length)}
212
+ />
213
+
214
+ <Text size="sm" tone="muted">
215
+ {`Refused in this session: ${refused}`}
216
+ </Text>
217
+ </Stack>
218
+ );
219
+ }
220
+
221
+ function claimFile(
222
+ name: string,
223
+ size: number,
224
+ kind: FileKind,
225
+ status: UploadFile['status'] = 'success',
226
+ loaded = status === 'success' ? size : 0,
227
+ reason?: UploadFile['reason'],
228
+ ): UploadFile {
229
+ return {
230
+ key: `${name}:${size}`,
231
+ name,
232
+ size,
233
+ type: '',
234
+ kind,
235
+ status,
236
+ loaded,
237
+ total: size,
238
+ attempts: status === 'ready' ? 0 : 1,
239
+ ...(reason === undefined ? {} : { reason }),
240
+ };
241
+ }
58
242
  ```
59
243
 
60
244
  ### The same file, twice
61
245
 
62
246
  Identity is the name, the size and the modification time, and it is replaceable — because whether two files are the same file is a question about an application. reject refuses the second copy, allow keeps both, replace puts the new one in the old one’s place.
63
247
 
64
- Excerpt — not a complete module
248
+ Example
65
249
 
66
250
  ```tsx
67
- <Upload duplicates="replace" fileKey={(file) => `${file.name}:${file.size}`} multiple />;
251
+ import { Upload } from '@slotted/react/upload';
252
+ import { Stack } from '@slotted/react/stack';
253
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
254
+
255
+ const held: UploadFile[] = [claimFile('purchase-order-4417.pdf', 248_000, 'pdf')];
256
+
257
+ export default function UploadDuplicatesExample() {
258
+ return (
259
+ <Stack gap={5}>
260
+ <Upload defaultFiles={held} label="reject (default)" multiple variant="field" />
261
+
262
+ <Upload defaultFiles={held} duplicates="allow" label="allow" multiple variant="field" />
263
+
264
+ <Upload defaultFiles={held} duplicates="replace" label="replace" multiple variant="field" />
265
+ </Stack>
266
+ );
267
+ }
268
+
269
+ function claimFile(
270
+ name: string,
271
+ size: number,
272
+ kind: FileKind,
273
+ status: UploadFile['status'] = 'success',
274
+ loaded = status === 'success' ? size : 0,
275
+ reason?: UploadFile['reason'],
276
+ ): UploadFile {
277
+ return {
278
+ key: `${name}:${size}`,
279
+ name,
280
+ size,
281
+ type: '',
282
+ kind,
283
+ status,
284
+ loaded,
285
+ total: size,
286
+ attempts: status === 'ready' ? 0 : 1,
287
+ ...(reason === undefined ? {} : { reason }),
288
+ };
289
+ }
68
290
  ```
69
291
 
70
292
  ### A whole folder
71
293
 
72
- webkitdirectory reaches the input untouched and every file keeps its webkitRelativePath. A folder dropped into a region that does not accept folders is refused with the directory reason rather than added as a zero-byte row with the folder’s name on it, which is what the surveyed implementations do.
294
+ webkitdirectory reaches the input untouched and every file keeps its webkitRelativePath. A folder dropped into a region that does not accept folders is refused with the directory reason rather than added as a zero-byte row with the folder’s name on it, which is what a zero-length file with the folder’s name would otherwise look like.
73
295
 
74
296
  Excerpt — not a complete module
75
297
 
@@ -121,22 +343,86 @@ Excerpt — not a complete module
121
343
 
122
344
  The family calls an adapter and reports what it says — it holds no URL, no method, no header and no credential. createXhrUpload is the one this library ships, and it is XMLHttpRequest rather than fetch because fetch reports no upload progress in any browser this library supports.
123
345
 
124
- Excerpt — not a complete module
346
+ Example
125
347
 
126
348
  ```tsx
127
- const adapter = createXhrUpload({
128
- url: '/api/claims/CLM-2026-0914/attachments',
129
- headers: () => ({ Authorization: `Bearer ${token()}` }),
130
- });
131
-
132
- <UploadDefaultsProvider adapter={adapter}>
133
- <Upload label="Supporting documents" multiple />
134
- </UploadDefaultsProvider>;
349
+ import { Upload } from '@slotted/react/upload';
350
+ import { useRef } from 'react';
351
+ import { Button } from '@slotted/react/button';
352
+ import { Inline } from '@slotted/react/inline';
353
+ import { Stack } from '@slotted/react/stack';
354
+ import { fileKind } from '@slotted/core/upload';
355
+ import type { UploadAdapter } from '@slotted/core/upload';
356
+ import type { UploadFile, UploadHandle } from '@slotted/react/upload';
357
+
358
+ const files: UploadFile[] = [
359
+ heldFile(heldPdf('supplier-invoices-0914.pdf', 640_000), 'ready'),
360
+ heldFile(heldPdf('receiving-photos-0914.zip', 1_200_000), 'ready'),
361
+ heldFile(heldPdf('supplier-invoices-corrupt.csv', 52_000), 'ready'),
362
+ ];
363
+
364
+ const adapter: UploadAdapter = {
365
+ async send(file, { progress, signal }) {
366
+ for (let step = 1; step <= 10; step += 1) {
367
+ await new Promise((resolve) => setTimeout(resolve, 300));
368
+ if (signal.aborted) throw new DOMException('Aborted', 'AbortError');
369
+ progress((file.size * step) / 10, file.size);
370
+ }
371
+ if (file.name.includes('corrupt')) throw new Error('The server refused the file.');
372
+ },
373
+ };
374
+
375
+ export default function UploadTransferExample() {
376
+ const upload = useRef<UploadHandle>(null);
377
+
378
+ function handleSend() {
379
+ upload.current?.upload();
380
+ }
381
+
382
+ return (
383
+ <Stack gap={4}>
384
+ <Upload
385
+ adapter={adapter}
386
+ autoUpload={false}
387
+ concurrency={2}
388
+ defaultFiles={files}
389
+ handleRef={upload}
390
+ label="Supplier documents"
391
+ multiple
392
+ retries={1}
393
+ retryDelay={500}
394
+ />
395
+
396
+ <Inline>
397
+ <Button onClick={handleSend}>Send the documents</Button>
398
+ </Inline>
399
+ </Stack>
400
+ );
401
+ }
402
+
403
+ function heldFile(file: File, status: UploadFile['status'] = 'success'): UploadFile {
404
+ return {
405
+ key: `${file.name}:${file.size}`,
406
+ file,
407
+ name: file.name,
408
+ size: file.size,
409
+ type: file.type,
410
+ kind: fileKind(file),
411
+ status,
412
+ loaded: status === 'success' ? file.size : 0,
413
+ total: file.size,
414
+ attempts: status === 'ready' ? 0 : 1,
415
+ };
416
+ }
417
+
418
+ function heldPdf(name: string, size: number): File {
419
+ return new File([new Uint8Array(size)], name, { lastModified: 1_757_500_000_000, type: '' });
420
+ }
135
421
  ```
136
422
 
137
423
  ### The reader decides when it goes
138
424
 
139
- autoUpload off leaves every accepted file in ready with its own start control, for a form where the attachments should go with the submit rather than before it. Vaadin is the one surveyed implementation that ships the same switch.
425
+ autoUpload off leaves every accepted file in ready with its own start control, for a form where the attachments should go with the submit rather than before it. Files wait in the list until a start control or the handle sends them.
140
426
 
141
427
  Excerpt — not a complete module
142
428
 
@@ -149,7 +435,7 @@ const upload = useRef<UploadHandle>(null);
149
435
 
150
436
  ### Nine files and three at a time
151
437
 
152
- Uppy alone among the surveyed implementations limits how many transfers run at once; Ant Design and Vaadin start every file together, which is how twelve files on a slow uplink all stall at the same moment. What is waiting says queued, and the summary carries the count and the time left.
438
+ At most concurrency transfers run at once, so twelve files on a slow uplink do not all stall at the same moment. A file that waits says Queued, and the summary carries the count and the time left.
153
439
 
154
440
  Excerpt — not a complete module
155
441
 
@@ -190,7 +476,7 @@ const resumable = {
190
476
 
191
477
  ### Stopping one, and taking one away
192
478
 
193
- Two different actions, kept apart. Cancel aborts the run through the adapter’s own AbortSignal and leaves the file in the list so it can be sent again; remove aborts it and takes the row out. Every surveyed implementation collapses the two into one control and one red row.
479
+ Two different actions, kept apart. Cancel aborts the run through the adapter’s own AbortSignal and leaves the file in the list so it can be sent again; remove aborts it and takes the row out. Both stay available on the same row, so a reader can stop one file without losing its place.
194
480
 
195
481
  Excerpt — not a complete module
196
482
 
@@ -208,7 +494,7 @@ const adapter = {
208
494
 
209
495
  ### A transfer that stops without failing
210
496
 
211
- Vaadin has the word stalled in its i18n object and nothing that produces it. Here the runner marks a run stalled when no progress arrives inside stallAfter and clears it on the next byte, so a bar sitting at 43% has something to read beside it.
497
+ The runner marks a run stalled when no progress arrives inside stallAfter and clears the mark on the next byte, so a bar sitting at 43% has a word beside it.
212
498
 
213
499
  Excerpt — not a complete module
214
500
 
@@ -218,7 +504,7 @@ Excerpt — not a complete module
218
504
 
219
505
  ### What the reader sees before they open anything
220
506
 
221
- An image gets a thumbnail from an object URL the family creates and revokes; everything else gets its kind’s tile. §14 of the feature guide requires the revocation by name, and two of the nine surveyed implementations leave it to the consumer.
507
+ An image gets a thumbnail from an object URL the family creates and revokes; everything else gets its kind’s tile. The family creates the URL and revokes it when the row is removed and when the control unmounts.
222
508
 
223
509
  Excerpt — not a complete module
224
510
 
@@ -231,17 +517,68 @@ Excerpt — not a complete module
231
517
 
232
518
  Click a file’s name. The viewer is a modal Dialog with the file rendered inside it — an img, a video, an audio, or an iframe for a PDF and for text — and arrow keys move through the set, skipping what it cannot draw. A preview that opened a new tab was the first answer and it lost the form the reader was filling in.
233
519
 
234
- Excerpt — not a complete module
520
+ Example
235
521
 
236
522
  ```tsx
237
- // The reader opens it from the name. A page that deep-links to an
238
- // attachment opens it too, because which file is being looked at is state.
239
- <Upload defaultViewing="claim-form-2026-0914.pdf:248000:1" multiple />;
523
+ import { Upload } from '@slotted/react/upload';
524
+ import { Stack } from '@slotted/react/stack';
525
+ import { fileKind } from '@slotted/core/upload';
526
+ import type { UploadFile } from '@slotted/react/upload';
527
+
528
+ const files: UploadFile[] = [
529
+ heldFile(
530
+ new File(
531
+ ['Receiving note 4417\nPO 4417: 24 of 24 cartons received, none damaged.\n'],
532
+ 'receiving-note-4417.txt',
533
+ {
534
+ lastModified: 1_757_500_000_000,
535
+ type: 'text/plain',
536
+ },
537
+ ),
538
+ ),
539
+ heldFile(
540
+ new File(['Dock log 0914\n07:40 Bay 2 opened.\n08:15 Bay 2 unloaded.\n'], 'dock-log-0914.txt', {
541
+ lastModified: 1_757_500_000_000,
542
+ type: 'text/plain',
543
+ }),
544
+ ),
545
+ ];
546
+
547
+ export default function UploadViewerExample() {
548
+ return (
549
+ <Stack gap={5}>
550
+ <Upload defaultFiles={files} label="Name opens the viewer" multiple variant="field" />
551
+
552
+ <Upload
553
+ defaultFiles={files}
554
+ label='view="none": the name is text'
555
+ multiple
556
+ variant="field"
557
+ view="none"
558
+ />
559
+ </Stack>
560
+ );
561
+ }
562
+
563
+ function heldFile(file: File, status: UploadFile['status'] = 'success'): UploadFile {
564
+ return {
565
+ key: `${file.name}:${file.size}`,
566
+ file,
567
+ name: file.name,
568
+ size: file.size,
569
+ type: file.type,
570
+ kind: fileKind(file),
571
+ status,
572
+ loaded: status === 'success' ? file.size : 0,
573
+ total: file.size,
574
+ attempts: status === 'ready' ? 0 : 1,
575
+ };
576
+ }
240
577
  ```
241
578
 
242
579
  ### Nine kinds, nine colors
243
580
 
244
- A PDF red, a word-processed document blue, a spreadsheet green, a deck orange, a picture teal, a film indigo, a recording magenta, an archive amber. The colors are a scale of the theme’s rather than five tones stretched over nine kinds, because the tones hold no second blue and no indigo at all.
581
+ A PDF red, a word-processed document blue, a spreadsheet green, a deck orange, a picture teal, a film indigo, a recording magenta, an archive amber, and every other file in a tile of its own. The colors are a scale of the theme’s rather than the six tones stretched over nine kinds.
245
582
 
246
583
  Excerpt — not a complete module
247
584
 
@@ -256,7 +593,7 @@ Excerpt — not a complete module
256
593
 
257
594
  ### Names the family did not choose
258
595
 
259
- A name two hundred characters long truncates in the middle so the extension survives; an Arabic name reads in its own direction inside a left-to-right page, because the name and its extension are one bidi-isolated run; and a refusal’s sentence wraps under the row without moving the chip or the controls.
596
+ A long name truncates before its extension so the extension survives; an Arabic name reads in its own direction inside a left-to-right page, because the name and its extension are one bidi-isolated run; and a refusal’s sentence wraps under the row without moving the chip or the controls.
260
597
 
261
598
  Excerpt — not a complete module
262
599
 
@@ -271,7 +608,7 @@ Excerpt — not a complete module
271
608
 
272
609
  ### In the middle of a form
273
610
 
274
- A Field above owns the label, the necessity mark, the description and the error slot, so the upload draws none of its own — two labels on one control is what a form gets otherwise. And a form submitted while the bytes are still moving is refused, which none of the nine surveyed implementations answers.
611
+ A Field above owns the label, the necessity mark, the description and the error slot, so the upload draws none of its own — two labels on one control is what a form gets otherwise. And a form submitted while the bytes are still moving is refused, because pendingBlocksSubmit makes the control invalid until the transfer ends.
275
612
 
276
613
  Excerpt — not a complete module
277
614
 
@@ -287,17 +624,52 @@ Excerpt — not a complete module
287
624
 
288
625
  Disabled refuses the picker and the drop alike, because a drag is not routed through the input at all. Read-only keeps the list readable and takes every control away. Invalid retargets the focus ring to the danger color. Loading and complete are the queue’s own two, and they are on the root.
289
626
 
290
- Excerpt — not a complete module
627
+ Example
291
628
 
292
629
  ```tsx
293
- <Upload disabled />;
294
- <Upload readOnly />;
295
- <Upload invalid required />;
630
+ import { Upload } from '@slotted/react/upload';
631
+ import { Stack } from '@slotted/react/stack';
632
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
633
+
634
+ const disabledFiles: UploadFile[] = [claimFile('purchase-order-4417.pdf', 248_000, 'pdf')];
635
+ const readOnlyFiles: UploadFile[] = [
636
+ claimFile('purchase-order-4417.pdf', 248_000, 'pdf'),
637
+ claimFile('supplier-invoice-8812.pdf', 312_000, 'pdf'),
638
+ ];
639
+
640
+ export default function UploadStatesExample() {
641
+ return (
642
+ <Stack gap={5}>
643
+ <Upload defaultFiles={disabledFiles} disabled label="Disabled" multiple />
644
+
645
+ <Upload defaultFiles={readOnlyFiles} label="Read-only" multiple readOnly />
646
+
647
+ <Upload invalid label="Invalid and required" required />
648
+ </Stack>
649
+ );
650
+ }
296
651
 
297
- // Unstated, all four defer to the Field above.
298
- <Field disabled invalid required>
299
- <Upload />
300
- </Field>;
652
+ function claimFile(
653
+ name: string,
654
+ size: number,
655
+ kind: FileKind,
656
+ status: UploadFile['status'] = 'success',
657
+ loaded = status === 'success' ? size : 0,
658
+ reason?: UploadFile['reason'],
659
+ ): UploadFile {
660
+ return {
661
+ key: `${name}:${size}`,
662
+ name,
663
+ size,
664
+ type: '',
665
+ kind,
666
+ status,
667
+ loaded,
668
+ total: size,
669
+ attempts: status === 'ready' ? 0 : 1,
670
+ ...(reason === undefined ? {} : { reason }),
671
+ };
672
+ }
301
673
  ```
302
674
 
303
675
  ### Everything, without a pointer
@@ -315,7 +687,7 @@ Excerpt — not a complete module
315
687
 
316
688
  ### Substituting what the family draws
317
689
 
318
- render replaces the root element and keeps the identity, the axes and every state on it. Children are appended inside the root, which is where an application puts its own note or its own control. The handle reaches the five actions a consumer cannot write declaratively, and no more.
690
+ render replaces the root element and keeps the identity, the axes and every state on it. Children are appended inside the root, which is where an application puts its own note or its own control. The handle reaches the six actions a consumer cannot write declaratively, and no more.
319
691
 
320
692
  Excerpt — not a complete module
321
693
 
@@ -372,3 +744,133 @@ type UploadAdapter = {
372
744
  // A bare function is accepted and normalized to { send, pausable: false }.
373
745
  <Upload adapter={(file, { signal }) => put(file, { signal })} />;
374
746
  ```
747
+
748
+ ### field.tsx
749
+
750
+ Example
751
+
752
+ ```tsx
753
+ import { Upload } from '@slotted/react/upload';
754
+ import { Field, FieldDescription, FieldError, FieldLabel } from '@slotted/react/field';
755
+ import { Stack } from '@slotted/react/stack';
756
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
757
+
758
+ const held: UploadFile[] = [claimFile('signed-delivery-note-5120.pdf', 512_000, 'pdf')];
759
+
760
+ export default function UploadFieldExample() {
761
+ return (
762
+ <Stack gap={5}>
763
+ <Field required>
764
+ <FieldLabel>Proof of delivery</FieldLabel>
765
+ <Upload defaultFiles={held} minFiles={1} variant="field" />
766
+ <FieldDescription>The delivery note signed by the receiving clerk.</FieldDescription>
767
+ </Field>
768
+
769
+ <Field invalid required>
770
+ <FieldLabel>Customs declaration</FieldLabel>
771
+ <Upload minFiles={1} variant="field" />
772
+ <FieldError>Attach the declaration before the shipment is released.</FieldError>
773
+ </Field>
774
+ </Stack>
775
+ );
776
+ }
777
+
778
+ function claimFile(
779
+ name: string,
780
+ size: number,
781
+ kind: FileKind,
782
+ status: UploadFile['status'] = 'success',
783
+ loaded = status === 'success' ? size : 0,
784
+ reason?: UploadFile['reason'],
785
+ ): UploadFile {
786
+ return {
787
+ key: `${name}:${size}`,
788
+ name,
789
+ size,
790
+ type: '',
791
+ kind,
792
+ status,
793
+ loaded,
794
+ total: size,
795
+ attempts: status === 'ready' ? 0 : 1,
796
+ ...(reason === undefined ? {} : { reason }),
797
+ };
798
+ }
799
+ ```
800
+
801
+ ### sources.tsx
802
+
803
+ Example
804
+
805
+ ```tsx
806
+ import { Upload } from '@slotted/react/upload';
807
+ import { Stack } from '@slotted/react/stack';
808
+
809
+ export default function UploadSourcesExample() {
810
+ return (
811
+ <Stack gap={5}>
812
+ <Upload directory label="Scanned receiving folder" maxFiles={400} multiple />
813
+
814
+ <Upload
815
+ accept="image/*"
816
+ capture="environment"
817
+ label="Photograph the damaged pallet"
818
+ variant="button"
819
+ />
820
+
821
+ <Upload allowDrop={false} label="Picker and paste only" />
822
+
823
+ <Upload allowPaste={false} label="Picker and drop only" />
824
+
825
+ <Upload clickToBrowse={false} label="Only the trigger opens the picker" />
826
+ </Stack>
827
+ );
828
+ }
829
+ ```
830
+
831
+ ### statuses.tsx
832
+
833
+ Example
834
+
835
+ ```tsx
836
+ import { Upload } from '@slotted/react/upload';
837
+ import type { FileKind, UploadFile } from '@slotted/react/upload';
838
+
839
+ const files: UploadFile[] = [
840
+ claimFile('scan0001', 18_600_000, 'other', 'rejected', 0, 'size'),
841
+ claimFile('cycle-count-0914.xlsx', 96_000, 'spreadsheet', 'ready'),
842
+ claimFile('receiving-notes-0914.docx', 86_000, 'document', 'queued'),
843
+ claimFile('dock-photo-pallet-6.jpg', 4_100_000, 'image', 'uploading', 2_542_000),
844
+ claimFile('bay-2-unloading.mp4', 88_400_000, 'video', 'paused', 35_000_000),
845
+ claimFile('forklift-audit-call.m4a', 11_200_000, 'audio', 'stalled', 4_800_000),
846
+ claimFile('purchase-order-4417.pdf', 248_000, 'pdf'),
847
+ claimFile('supplier-invoices-2026.zip', 41_800_000, 'archive', 'error', 12_000_000),
848
+ claimFile('pallet-labels-review.pptx', 2_400_000, 'presentation', 'canceled', 600_000),
849
+ ];
850
+
851
+ export default function UploadStatusesExample() {
852
+ return <Upload defaultFiles={files} label="Warehouse documents" maxRows={9} multiple />;
853
+ }
854
+
855
+ function claimFile(
856
+ name: string,
857
+ size: number,
858
+ kind: FileKind,
859
+ status: UploadFile['status'] = 'success',
860
+ loaded = status === 'success' ? size : 0,
861
+ reason?: UploadFile['reason'],
862
+ ): UploadFile {
863
+ return {
864
+ key: `${name}:${size}`,
865
+ name,
866
+ size,
867
+ type: '',
868
+ kind,
869
+ status,
870
+ loaded,
871
+ total: size,
872
+ attempts: status === 'ready' ? 0 : 1,
873
+ ...(reason === undefined ? {} : { reason }),
874
+ };
875
+ }
876
+ ```