@ui-sdk/web 0.0.0-stage → 0.1.0-beta.1

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 (467) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +10 -2
  3. package/browser/web/accordion.js +1 -0
  4. package/browser/web/alert-dialog.js +1 -0
  5. package/browser/web/autocomplete.js +1 -0
  6. package/browser/web/avatar.js +1 -0
  7. package/browser/web/button.js +1 -0
  8. package/browser/web/calendar.js +1 -0
  9. package/browser/web/carousel.js +1 -0
  10. package/browser/web/checkbox.js +1 -0
  11. package/browser/web/chunks/0eRGibL6.js +1 -0
  12. package/browser/web/chunks/2bIEUO6_.js +1 -0
  13. package/browser/web/chunks/5A9w2ULz.js +1 -0
  14. package/browser/web/chunks/5RSyydjV.js +1 -0
  15. package/browser/web/chunks/9pWTy2wl.js +1 -0
  16. package/browser/web/chunks/B0f2j6zz.js +1 -0
  17. package/browser/web/chunks/B1rux6br.js +1 -0
  18. package/browser/web/chunks/B3-APaNf.js +1 -0
  19. package/browser/web/chunks/B7EgSgjQ.js +1 -0
  20. package/browser/web/chunks/B8QcOzJU.js +1 -0
  21. package/browser/web/chunks/BFueEkwm.js +3 -0
  22. package/browser/web/chunks/BJj3oS29.js +1 -0
  23. package/browser/web/chunks/BNSvTCpr.js +1 -0
  24. package/browser/web/chunks/BPD0kAZB.js +1 -0
  25. package/browser/web/chunks/BQeduZqT.js +1 -0
  26. package/browser/web/chunks/B_CVFyiz.js +1 -0
  27. package/browser/web/chunks/B_ns1YHO.js +1 -0
  28. package/browser/web/chunks/BcwkVTsR.js +1 -0
  29. package/browser/web/chunks/BeaQ6TYM.js +1 -0
  30. package/browser/web/chunks/BgBB013u.js +1 -0
  31. package/browser/web/chunks/BgsKhHDm.js +1 -0
  32. package/browser/web/chunks/BjMcbuhi.js +9 -0
  33. package/browser/web/chunks/Bjiy_F2N.js +1 -0
  34. package/browser/web/chunks/BqScCLwv.js +1 -0
  35. package/browser/web/chunks/BqX3Utqx.js +1 -0
  36. package/browser/web/chunks/BtVkQf3z.js +1 -0
  37. package/browser/web/chunks/By30h-7B.js +1 -0
  38. package/browser/web/chunks/C1zqYpy2.js +1 -0
  39. package/browser/web/chunks/C436juFf.js +1 -0
  40. package/browser/web/chunks/C4_bULs1.js +1 -0
  41. package/browser/web/chunks/C4omqJEz.js +1 -0
  42. package/browser/web/chunks/C7tt0T3n.js +1 -0
  43. package/browser/web/chunks/C8w7s5dg.js +1 -0
  44. package/browser/web/chunks/CElY4erO.js +1 -0
  45. package/browser/web/chunks/CFODo-m2.js +1 -0
  46. package/browser/web/chunks/CL4wjam9.js +1 -0
  47. package/browser/web/chunks/CMg-8UVf.js +1 -0
  48. package/browser/web/chunks/COWKfakj.js +1 -0
  49. package/browser/web/chunks/CQBU0qZ4.js +1 -0
  50. package/browser/web/chunks/CV6uABgc.js +1 -0
  51. package/browser/web/chunks/C_SWFpWQ.js +1 -0
  52. package/browser/web/chunks/C_Uanbrl.js +1 -0
  53. package/browser/web/chunks/Ce_CSanC.js +1 -0
  54. package/browser/web/chunks/Cg-ZmRhS.js +1 -0
  55. package/browser/web/chunks/Cgf2wPI_.js +1 -0
  56. package/browser/web/chunks/Cuep_3Vf.js +1 -0
  57. package/browser/web/chunks/D02PaHn6.js +1 -0
  58. package/browser/web/chunks/D5LiaI5R.js +1 -0
  59. package/browser/web/chunks/D9UgVYvF.js +1 -0
  60. package/browser/web/chunks/DC08tnkE.js +2 -0
  61. package/browser/web/chunks/DG8YGSvu.js +1 -0
  62. package/browser/web/chunks/DIQd0FYD.js +1 -0
  63. package/browser/web/chunks/DMLqacE8.js +1 -0
  64. package/browser/web/chunks/DSUI3yI-.js +1 -0
  65. package/browser/web/chunks/DT3Hb76X.js +1 -0
  66. package/browser/web/chunks/DY75g3-W.js +1 -0
  67. package/browser/web/chunks/DZpNQKZ9.js +1 -0
  68. package/browser/web/chunks/Db-W1wrC.js +1 -0
  69. package/browser/web/chunks/Dc1xK3Ii.js +1 -0
  70. package/browser/web/chunks/DdF6awFs.js +1 -0
  71. package/browser/web/chunks/DdaCLml8.js +1 -0
  72. package/browser/web/chunks/Dh8MLjQO.js +1 -0
  73. package/browser/web/chunks/DiuslJRy.js +1 -0
  74. package/browser/web/chunks/DjRcw3Y0.js +1 -0
  75. package/browser/web/chunks/Djdv-16J.js +1 -0
  76. package/browser/web/chunks/DnFXe_lF.js +1 -0
  77. package/browser/web/chunks/DneGv1oC.js +1 -0
  78. package/browser/web/chunks/DsVxP-p-.js +1 -0
  79. package/browser/web/chunks/DwDilCo2.js +1 -0
  80. package/browser/web/chunks/DwV48AXv.js +1 -0
  81. package/browser/web/chunks/F37aF4-L.js +1 -0
  82. package/browser/web/chunks/LyB6XIbN.js +1 -0
  83. package/browser/web/chunks/NKnbYGjC.js +1 -0
  84. package/browser/web/chunks/Vk-rVi16.js +1 -0
  85. package/browser/web/chunks/XsM0J1Ex.js +1 -0
  86. package/browser/web/chunks/asSN9iEp.js +1 -0
  87. package/browser/web/chunks/c-AjHfdF.js +1 -0
  88. package/browser/web/chunks/dR-12TPY.js +1 -0
  89. package/browser/web/chunks/hR4xM0EC.js +1 -0
  90. package/browser/web/chunks/hqOaBxAg.js +1 -0
  91. package/browser/web/chunks/kMKqqeG4.js +1 -0
  92. package/browser/web/chunks/kXboBcfi.js +1 -0
  93. package/browser/web/chunks/l4aQIg22.js +1 -0
  94. package/browser/web/chunks/tJC0JSU4.js +1 -0
  95. package/browser/web/chunks/wHdS_QYM.js +1 -0
  96. package/browser/web/chunks/yv8dTvNI.js +1 -0
  97. package/browser/web/chunks/yw9M3nfi.js +1 -0
  98. package/browser/web/collapsible.js +1 -0
  99. package/browser/web/color-picker.js +1 -0
  100. package/browser/web/combobox.js +2 -0
  101. package/browser/web/command.js +1 -0
  102. package/browser/web/core.js +5 -0
  103. package/browser/web/date-input.js +1 -0
  104. package/browser/web/date-picker.js +1 -0
  105. package/browser/web/dialog.js +1 -0
  106. package/browser/web/drawer.js +1 -0
  107. package/browser/web/field.js +1 -0
  108. package/browser/web/file-input.js +1 -0
  109. package/browser/web/hover-card.js +1 -0
  110. package/browser/web/image-cropper.js +1 -0
  111. package/browser/web/input.js +1 -0
  112. package/browser/web/label.js +1 -0
  113. package/browser/web/listbox.js +1 -0
  114. package/browser/web/menu.js +1 -0
  115. package/browser/web/menubar.js +1 -0
  116. package/browser/web/meter.js +1 -0
  117. package/browser/web/navigation-menu.js +1 -0
  118. package/browser/web/number-input.js +1 -0
  119. package/browser/web/otp-input.js +2 -0
  120. package/browser/web/overlays.js +1 -0
  121. package/browser/web/pagination.js +1 -0
  122. package/browser/web/password-input.js +1 -0
  123. package/browser/web/popover.js +1 -0
  124. package/browser/web/preferences.js +1 -0
  125. package/browser/web/progress.js +1 -0
  126. package/browser/web/radio.js +1 -0
  127. package/browser/web/rating.js +1 -0
  128. package/browser/web/resizable.js +1 -0
  129. package/browser/web/scroll-area.js +1 -0
  130. package/browser/web/segmented-control.js +1 -0
  131. package/browser/web/select.js +1 -0
  132. package/browser/web/separator.js +1 -0
  133. package/browser/web/slider.js +1 -0
  134. package/browser/web/switch.js +1 -0
  135. package/browser/web/tabs.js +1 -0
  136. package/browser/web/textarea.js +1 -0
  137. package/browser/web/time-input.js +1 -0
  138. package/browser/web/timeline.js +1 -0
  139. package/browser/web/toast.js +1 -0
  140. package/browser/web/toggle.js +1 -0
  141. package/browser/web/token-input.js +8 -0
  142. package/browser/web/toolbar.js +1 -0
  143. package/browser/web/tooltip.js +1 -0
  144. package/browser/web/tree.js +1 -0
  145. package/browser/web/trigger-menu.js +4 -0
  146. package/browser/web/waterfall.js +1 -0
  147. package/browser/web.css +3378 -0
  148. package/browser/web.js +3 -0
  149. package/custom-elements.json +32315 -0
  150. package/dist/accordion.d.ts +2 -0
  151. package/dist/accordion.js +57 -0
  152. package/dist/action.d.ts +16 -0
  153. package/dist/action.js +39 -0
  154. package/dist/agent.d.ts +2 -0
  155. package/dist/agent.js +7 -0
  156. package/dist/autocomplete.d.ts +2 -0
  157. package/dist/autocomplete.js +120 -0
  158. package/dist/autoload.d.ts +18 -0
  159. package/dist/autoload.js +63 -0
  160. package/dist/avatar.d.ts +2 -0
  161. package/dist/avatar.js +27 -0
  162. package/dist/browser-core.d.ts +2 -0
  163. package/dist/browser-core.js +8 -0
  164. package/dist/button.d.ts +2 -0
  165. package/dist/button.js +35 -0
  166. package/dist/calendar.d.ts +23 -0
  167. package/dist/calendar.js +429 -0
  168. package/dist/carousel.d.ts +2 -0
  169. package/dist/carousel.js +54 -0
  170. package/dist/checkbox.d.ts +4 -0
  171. package/dist/checkbox.js +75 -0
  172. package/dist/collapsible.d.ts +2 -0
  173. package/dist/collapsible.js +28 -0
  174. package/dist/color-picker.d.ts +2 -0
  175. package/dist/color-picker.js +64 -0
  176. package/dist/combobox.d.ts +2 -0
  177. package/dist/combobox.js +334 -0
  178. package/dist/command.d.ts +2 -0
  179. package/dist/command.js +122 -0
  180. package/dist/date-input.d.ts +3 -0
  181. package/dist/date-input.js +87 -0
  182. package/dist/date-picker.d.ts +2 -0
  183. package/dist/date-picker.js +174 -0
  184. package/dist/default-text.d.ts +3 -0
  185. package/dist/default-text.js +24 -0
  186. package/dist/define-element.d.ts +404 -0
  187. package/dist/define-element.js +1489 -0
  188. package/dist/dialog.d.ts +3 -0
  189. package/dist/dialog.js +94 -0
  190. package/dist/drawer.d.ts +2 -0
  191. package/dist/drawer.js +96 -0
  192. package/dist/entries/accordion.d.ts +3 -0
  193. package/dist/entries/accordion.js +7 -0
  194. package/dist/entries/alert-dialog.d.ts +3 -0
  195. package/dist/entries/alert-dialog.js +13 -0
  196. package/dist/entries/autocomplete.d.ts +3 -0
  197. package/dist/entries/autocomplete.js +7 -0
  198. package/dist/entries/avatar.d.ts +2 -0
  199. package/dist/entries/avatar.js +3 -0
  200. package/dist/entries/button.d.ts +2 -0
  201. package/dist/entries/button.js +3 -0
  202. package/dist/entries/calendar.d.ts +3 -0
  203. package/dist/entries/calendar.js +7 -0
  204. package/dist/entries/carousel.d.ts +3 -0
  205. package/dist/entries/carousel.js +7 -0
  206. package/dist/entries/checkbox.d.ts +3 -0
  207. package/dist/entries/checkbox.js +15 -0
  208. package/dist/entries/collapsible.d.ts +3 -0
  209. package/dist/entries/collapsible.js +7 -0
  210. package/dist/entries/color-picker.d.ts +3 -0
  211. package/dist/entries/color-picker.js +7 -0
  212. package/dist/entries/combobox.d.ts +3 -0
  213. package/dist/entries/combobox.js +7 -0
  214. package/dist/entries/command.d.ts +3 -0
  215. package/dist/entries/command.js +7 -0
  216. package/dist/entries/date-input.d.ts +3 -0
  217. package/dist/entries/date-input.js +7 -0
  218. package/dist/entries/date-picker.d.ts +3 -0
  219. package/dist/entries/date-picker.js +7 -0
  220. package/dist/entries/dialog.d.ts +3 -0
  221. package/dist/entries/dialog.js +7 -0
  222. package/dist/entries/drawer.d.ts +3 -0
  223. package/dist/entries/drawer.js +8 -0
  224. package/dist/entries/field.d.ts +2 -0
  225. package/dist/entries/field.js +3 -0
  226. package/dist/entries/file-input.d.ts +3 -0
  227. package/dist/entries/file-input.js +13 -0
  228. package/dist/entries/hover-card.d.ts +3 -0
  229. package/dist/entries/hover-card.js +7 -0
  230. package/dist/entries/image-cropper.d.ts +3 -0
  231. package/dist/entries/image-cropper.js +7 -0
  232. package/dist/entries/input.d.ts +3 -0
  233. package/dist/entries/input.js +8 -0
  234. package/dist/entries/label.d.ts +2 -0
  235. package/dist/entries/label.js +3 -0
  236. package/dist/entries/listbox.d.ts +3 -0
  237. package/dist/entries/listbox.js +7 -0
  238. package/dist/entries/menu.d.ts +3 -0
  239. package/dist/entries/menu.js +7 -0
  240. package/dist/entries/menubar.d.ts +3 -0
  241. package/dist/entries/menubar.js +7 -0
  242. package/dist/entries/meter.d.ts +2 -0
  243. package/dist/entries/meter.js +3 -0
  244. package/dist/entries/navigation-menu.d.ts +3 -0
  245. package/dist/entries/navigation-menu.js +7 -0
  246. package/dist/entries/number-input.d.ts +3 -0
  247. package/dist/entries/number-input.js +7 -0
  248. package/dist/entries/otp-input.d.ts +3 -0
  249. package/dist/entries/otp-input.js +7 -0
  250. package/dist/entries/overlays.d.ts +2 -0
  251. package/dist/entries/overlays.js +3 -0
  252. package/dist/entries/pagination.d.ts +3 -0
  253. package/dist/entries/pagination.js +11 -0
  254. package/dist/entries/password-input.d.ts +3 -0
  255. package/dist/entries/password-input.js +7 -0
  256. package/dist/entries/popover.d.ts +3 -0
  257. package/dist/entries/popover.js +7 -0
  258. package/dist/entries/preferences.d.ts +3 -0
  259. package/dist/entries/preferences.js +13 -0
  260. package/dist/entries/progress.d.ts +2 -0
  261. package/dist/entries/progress.js +3 -0
  262. package/dist/entries/radio.d.ts +3 -0
  263. package/dist/entries/radio.js +7 -0
  264. package/dist/entries/rating.d.ts +3 -0
  265. package/dist/entries/rating.js +8 -0
  266. package/dist/entries/resizable.d.ts +3 -0
  267. package/dist/entries/resizable.js +11 -0
  268. package/dist/entries/scroll-area.d.ts +3 -0
  269. package/dist/entries/scroll-area.js +7 -0
  270. package/dist/entries/segmented-control.d.ts +3 -0
  271. package/dist/entries/segmented-control.js +7 -0
  272. package/dist/entries/select.d.ts +3 -0
  273. package/dist/entries/select.js +7 -0
  274. package/dist/entries/separator.d.ts +2 -0
  275. package/dist/entries/separator.js +3 -0
  276. package/dist/entries/slider.d.ts +3 -0
  277. package/dist/entries/slider.js +7 -0
  278. package/dist/entries/switch.d.ts +3 -0
  279. package/dist/entries/switch.js +7 -0
  280. package/dist/entries/tabs.d.ts +3 -0
  281. package/dist/entries/tabs.js +7 -0
  282. package/dist/entries/textarea.d.ts +3 -0
  283. package/dist/entries/textarea.js +7 -0
  284. package/dist/entries/time-input.d.ts +3 -0
  285. package/dist/entries/time-input.js +7 -0
  286. package/dist/entries/timeline.d.ts +3 -0
  287. package/dist/entries/timeline.js +7 -0
  288. package/dist/entries/toast.d.ts +2 -0
  289. package/dist/entries/toast.js +3 -0
  290. package/dist/entries/toggle.d.ts +3 -0
  291. package/dist/entries/toggle.js +12 -0
  292. package/dist/entries/token-input.d.ts +3 -0
  293. package/dist/entries/token-input.js +17 -0
  294. package/dist/entries/toolbar.d.ts +3 -0
  295. package/dist/entries/toolbar.js +7 -0
  296. package/dist/entries/tooltip.d.ts +3 -0
  297. package/dist/entries/tooltip.js +7 -0
  298. package/dist/entries/tree.d.ts +3 -0
  299. package/dist/entries/tree.js +17 -0
  300. package/dist/entries/trigger-menu.d.ts +3 -0
  301. package/dist/entries/trigger-menu.js +11 -0
  302. package/dist/entries/waterfall.d.ts +3 -0
  303. package/dist/entries/waterfall.js +11 -0
  304. package/dist/events.d.ts +1658 -0
  305. package/dist/events.js +0 -0
  306. package/dist/field.d.ts +2 -0
  307. package/dist/field.js +101 -0
  308. package/dist/file-input.d.ts +2 -0
  309. package/dist/file-input.js +140 -0
  310. package/dist/forward-attributes.d.ts +2 -0
  311. package/dist/forward-attributes.js +22 -0
  312. package/dist/history.d.ts +2 -0
  313. package/dist/history.js +11 -0
  314. package/dist/hover-card.d.ts +2 -0
  315. package/dist/hover-card.js +31 -0
  316. package/dist/image-cropper.d.ts +2 -0
  317. package/dist/image-cropper.js +66 -0
  318. package/dist/index.d.ts +66 -0
  319. package/dist/index.js +269 -0
  320. package/dist/input.d.ts +3 -0
  321. package/dist/input.js +69 -0
  322. package/dist/label.d.ts +2 -0
  323. package/dist/label.js +11 -0
  324. package/dist/list.d.ts +40 -0
  325. package/dist/list.js +192 -0
  326. package/dist/listbox.d.ts +2 -0
  327. package/dist/listbox.js +84 -0
  328. package/dist/menu.d.ts +4 -0
  329. package/dist/menu.js +295 -0
  330. package/dist/menubar.d.ts +4 -0
  331. package/dist/menubar.js +30 -0
  332. package/dist/meter.d.ts +2 -0
  333. package/dist/meter.js +22 -0
  334. package/dist/navigation-menu.d.ts +2 -0
  335. package/dist/navigation-menu.js +114 -0
  336. package/dist/number-input.d.ts +2 -0
  337. package/dist/number-input.js +73 -0
  338. package/dist/observe.d.ts +2 -0
  339. package/dist/observe.js +7 -0
  340. package/dist/otp-input.d.ts +2 -0
  341. package/dist/otp-input.js +72 -0
  342. package/dist/overlays.d.ts +13 -0
  343. package/dist/overlays.js +156 -0
  344. package/dist/pagination.d.ts +2 -0
  345. package/dist/pagination.js +127 -0
  346. package/dist/password-input.d.ts +2 -0
  347. package/dist/password-input.js +57 -0
  348. package/dist/popover.d.ts +2 -0
  349. package/dist/popover.js +64 -0
  350. package/dist/popup.d.ts +40 -0
  351. package/dist/popup.js +112 -0
  352. package/dist/preferences.d.ts +2 -0
  353. package/dist/preferences.js +56 -0
  354. package/dist/progress.d.ts +2 -0
  355. package/dist/progress.js +22 -0
  356. package/dist/radio.d.ts +2 -0
  357. package/dist/radio.js +33 -0
  358. package/dist/rating.d.ts +2 -0
  359. package/dist/rating.js +64 -0
  360. package/dist/resizable.d.ts +2 -0
  361. package/dist/resizable.js +42 -0
  362. package/dist/scroll-area.d.ts +2 -0
  363. package/dist/scroll-area.js +45 -0
  364. package/dist/segmented-control.d.ts +2 -0
  365. package/dist/segmented-control.js +28 -0
  366. package/dist/select.d.ts +2 -0
  367. package/dist/select.js +239 -0
  368. package/dist/separator.d.ts +2 -0
  369. package/dist/separator.js +11 -0
  370. package/dist/slider.d.ts +2 -0
  371. package/dist/slider.js +77 -0
  372. package/dist/tabs.d.ts +2 -0
  373. package/dist/tabs.js +37 -0
  374. package/dist/timeline.d.ts +2 -0
  375. package/dist/timeline.js +27 -0
  376. package/dist/toast.d.ts +20 -0
  377. package/dist/toast.js +177 -0
  378. package/dist/toggle.d.ts +3 -0
  379. package/dist/toggle.js +64 -0
  380. package/dist/token-input.d.ts +2 -0
  381. package/dist/token-input.js +103 -0
  382. package/dist/toolbar.d.ts +2 -0
  383. package/dist/toolbar.js +36 -0
  384. package/dist/tooltip.d.ts +2 -0
  385. package/dist/tooltip.js +35 -0
  386. package/dist/tree.d.ts +2 -0
  387. package/dist/tree.js +147 -0
  388. package/dist/trigger-menu.d.ts +2 -0
  389. package/dist/trigger-menu.js +133 -0
  390. package/dist/waterfall.d.ts +2 -0
  391. package/dist/waterfall.js +140 -0
  392. package/docs/README.md +89 -0
  393. package/docs/agents.md +1523 -0
  394. package/docs/components/accordion.md +1401 -0
  395. package/docs/components/alert-dialog.md +788 -0
  396. package/docs/components/autocomplete.md +1692 -0
  397. package/docs/components/avatar.md +261 -0
  398. package/docs/components/button.md +441 -0
  399. package/docs/components/calendar.md +1536 -0
  400. package/docs/components/carousel.md +1055 -0
  401. package/docs/components/checkbox.md +1045 -0
  402. package/docs/components/collapsible.md +535 -0
  403. package/docs/components/color-picker.md +651 -0
  404. package/docs/components/combobox.md +3274 -0
  405. package/docs/components/command.md +1431 -0
  406. package/docs/components/date-input.md +563 -0
  407. package/docs/components/date-picker.md +1136 -0
  408. package/docs/components/dialog.md +1360 -0
  409. package/docs/components/drawer.md +1201 -0
  410. package/docs/components/field.md +519 -0
  411. package/docs/components/file-input.md +617 -0
  412. package/docs/components/hover-card.md +486 -0
  413. package/docs/components/image-cropper.md +489 -0
  414. package/docs/components/input.md +327 -0
  415. package/docs/components/label.md +208 -0
  416. package/docs/components/listbox.md +1015 -0
  417. package/docs/components/menu.md +1212 -0
  418. package/docs/components/menubar.md +460 -0
  419. package/docs/components/meter.md +298 -0
  420. package/docs/components/navigation-menu.md +1573 -0
  421. package/docs/components/number-input.md +1087 -0
  422. package/docs/components/otp-input.md +558 -0
  423. package/docs/components/pagination.md +639 -0
  424. package/docs/components/password-input.md +649 -0
  425. package/docs/components/popover.md +1433 -0
  426. package/docs/components/preferences.md +243 -0
  427. package/docs/components/progress.md +406 -0
  428. package/docs/components/radio.md +855 -0
  429. package/docs/components/rating.md +431 -0
  430. package/docs/components/resizable.md +866 -0
  431. package/docs/components/scroll-area.md +898 -0
  432. package/docs/components/segmented-control.md +421 -0
  433. package/docs/components/select.md +1957 -0
  434. package/docs/components/separator.md +238 -0
  435. package/docs/components/slider.md +1018 -0
  436. package/docs/components/switch.md +583 -0
  437. package/docs/components/tabs.md +948 -0
  438. package/docs/components/textarea.md +331 -0
  439. package/docs/components/time-input.md +235 -0
  440. package/docs/components/timeline.md +622 -0
  441. package/docs/components/toast.md +1223 -0
  442. package/docs/components/toggle.md +522 -0
  443. package/docs/components/token-input.md +854 -0
  444. package/docs/components/toolbar.md +815 -0
  445. package/docs/components/tooltip.md +860 -0
  446. package/docs/components/tree.md +1243 -0
  447. package/docs/components/trigger-menu.md +1110 -0
  448. package/docs/components/waterfall.md +709 -0
  449. package/docs/controllers.md +66 -0
  450. package/docs/core.md +8027 -0
  451. package/docs/custom-parts.md +91 -0
  452. package/docs/first-component.md +88 -0
  453. package/docs/forms.md +125 -0
  454. package/docs/installation.md +141 -0
  455. package/docs/introduction.md +32 -0
  456. package/docs/lists-and-menus.md +166 -0
  457. package/docs/llms.txt +1566 -0
  458. package/docs/parts-and-composition.md +57 -0
  459. package/docs/popups.md +92 -0
  460. package/docs/rendering.md +71 -0
  461. package/docs/server-rendering.md +118 -0
  462. package/docs/state-and-events.md +134 -0
  463. package/docs/styling-and-animation.md +104 -0
  464. package/docs/utilities/async-options.md +332 -0
  465. package/docs/utilities/shortcuts.md +184 -0
  466. package/html-custom-data.json +14792 -0
  467. package/package.json +302 -3
@@ -0,0 +1,617 @@
1
+ # File Input
2
+
3
+ Choose, drop, or paste files, validate them, and submit them with a form.
4
+
5
+ A file input holds the files someone chooses, drops, or pastes, checks them against your rules, and submits them with a form. Uploading them to a server is up to your app.
6
+
7
+ ```ts title="basic.ts"
8
+ import "@ui-sdk/web/file-input"
9
+ import { createElement, File as FileIcon, Upload, X } from "lucide"
10
+
11
+ function mount(root: HTMLElement) {
12
+ root.innerHTML = `
13
+ <ui-file-input multiple>
14
+ <ui-file-input-dropzone>
15
+ ${createElement(Upload, { "aria-hidden": "true" }).outerHTML}
16
+ <p>Drag and drop files here</p>
17
+ <p data-slot="hint">Or paste them from your clipboard.</p>
18
+ <ui-file-input-trigger><button>Browse Files</button></ui-file-input-trigger>
19
+ </ui-file-input-dropzone>
20
+ <ui-file-input-list aria-label="Files">
21
+ <template>
22
+ <ui-file-input-item>
23
+ ${createElement(FileIcon, { "aria-hidden": "true" }).outerHTML}
24
+ <span data-file="name"></span>
25
+ <span data-file="size" data-slot="hint"></span>
26
+ <ui-file-input-item-remove><button type="button">${createElement(X, { "aria-hidden": "true" }).outerHTML}</button></ui-file-input-item-remove>
27
+ </ui-file-input-item>
28
+ </template>
29
+ </ui-file-input-list>
30
+ </ui-file-input>
31
+ `
32
+ }
33
+
34
+ export { mount }
35
+ ```
36
+
37
+ Browse Files or drop a few files on the zone, then remove one. Tab to the list to move between files with the arrow keys, and press Delete to remove the focused one.
38
+
39
+ ## Installation
40
+
41
+ ```bash
42
+ npm install @ui-sdk/web @ui-sdk/core
43
+ ```
44
+
45
+ Import the component to register its elements. The import is safe on the server.
46
+
47
+ ```ts
48
+ import "@ui-sdk/web/file-input"
49
+ ```
50
+
51
+ ## Composition
52
+
53
+ Use the following composition to build a `ui-file-input`:
54
+
55
+ ```text
56
+ ui-file-input
57
+ ├── ui-file-input-trigger
58
+ │ └── button
59
+ ├── ui-file-input-dropzone
60
+ └── ui-file-input-list
61
+ └── template
62
+ └── ui-file-input-item
63
+ └── ui-file-input-item-remove
64
+ └── button
65
+ ```
66
+
67
+ The trigger wraps a native button that opens the system file picker. The drop zone takes files that are dropped on it or pasted while focus is inside it; keep a trigger beside it for people using a keyboard. The list copies the item in its `<template>` once for each file, and an item's `file` property holds its file; elements in the item with `data-file="name"`, `"size"`, `"type"` or `"path"` show that about the file. A remove button wraps a native button that removes its item's file.
68
+
69
+ ## Usage
70
+
71
+ Import the parts and put them together:
72
+
73
+ ```html
74
+ <script type="module">
75
+ import "@ui-sdk/web/file-input"
76
+ </script>
77
+
78
+ <ui-file-input name="attachments" multiple>
79
+ <ui-file-input-dropzone>
80
+ <p>Drag and drop files here</p>
81
+ <ui-file-input-trigger><button>Browse Files</button></ui-file-input-trigger>
82
+ </ui-file-input-dropzone>
83
+ <ui-file-input-list aria-label="Files">
84
+ <template>
85
+ <ui-file-input-item>
86
+ <span data-file="name"></span>
87
+ <span data-file="size"></span>
88
+ <ui-file-input-item-remove>
89
+ <button type="button"><svg aria-hidden="true">…</svg></button>
90
+ </ui-file-input-item-remove>
91
+ </ui-file-input-item>
92
+ </template>
93
+ </ui-file-input-list>
94
+ </ui-file-input>
95
+ ```
96
+
97
+ ## Upload Button
98
+
99
+ A trigger is enough when you only need the system file picker. Read the chosen file from the `valuechange` event to show its name beside the button.
100
+
101
+ ```html
102
+ <ui-file-input name="resume">
103
+ <ui-file-input-trigger><button>Upload Resume</button></ui-file-input-trigger>
104
+ <span>No file chosen</span>
105
+ </ui-file-input>
106
+ ```
107
+
108
+ ```ts
109
+ const input = document.querySelector("ui-file-input")!
110
+ input.addEventListener("valuechange", (event) => {
111
+ input.querySelector("span")!.textContent =
112
+ event.detail.value[0]?.name ?? "No file chosen"
113
+ })
114
+ ```
115
+
116
+ ## Accepted Types
117
+
118
+ `accept` takes MIME types, wildcards, and extensions, separated by commas, such as `image/*,.pdf`. It checks files from the picker, drops, and pastes. An extension matches the filename, even when the operating system reports an unexpected MIME type.
119
+
120
+ A rejected file never joins the value. The `reject` event's `detail.value` has each one with its `reasons`, such as `file-type`, so you can say why it was left out. While files are dragged over a drop zone, `data-drag-reject` shows when their types won't be accepted.
121
+
122
+ ```html
123
+ <ui-file-input multiple accept="image/*,.pdf"></ui-file-input>
124
+ ```
125
+
126
+ ```ts
127
+ input.addEventListener("reject", (event) => setRejected(event.detail.value))
128
+ ```
129
+
130
+ ## Limits
131
+
132
+ Use `max-files` to limit the total count, and `min-size` or `max-size` for bytes per file. When too many files arrive, the component accepts the first ones that pass the other checks until the list is full, and rejects the rest with `too-many-files`.
133
+
134
+ ```html
135
+ <ui-file-input
136
+ multiple
137
+ max-files="3"
138
+ min-size="1"
139
+ max-size="5000000"
140
+ ></ui-file-input>
141
+ ```
142
+
143
+ ## One File
144
+
145
+ Without `multiple`, a new file replaces the current one. A rejected file leaves the current value unchanged. With `multiple`, accepted files join the list.
146
+
147
+ ```html
148
+ <ui-file-input accept=".pdf">
149
+ <ui-file-input-trigger><button>Choose a PDF</button></ui-file-input-trigger>
150
+ </ui-file-input>
151
+ ```
152
+
153
+ ```ts
154
+ input.addEventListener("valuechange", (event) => {
155
+ input.querySelector("button")!.textContent = event.detail.value[0]
156
+ ? "Replace PDF"
157
+ : "Choose a PDF"
158
+ })
159
+ ```
160
+
161
+ ## Validation
162
+
163
+ Set the `validate` property for checks of your own. Return a reason string to reject a file, or `null` to accept it. It runs after the built-in type and size checks, and its reason reaches the `reject` event like theirs. Validate uploads on your server too.
164
+
165
+ ```ts
166
+ const input = document.querySelector("ui-file-input")!
167
+ input.validate = (file) =>
168
+ input.value.some((other) => other.name === file.name) ? "duplicate" : null
169
+ input.addEventListener("reject", (event) => setRejected(event.detail.value))
170
+ ```
171
+
172
+ ## File List
173
+
174
+ The list has one Tab stop. Arrow keys, Home, and End move between files; Delete or Backspace removes the focused file. Remove buttons are named for their file and stay outside the Tab order.
175
+
176
+ For an image preview, put an `<img>` in the template, create an object URL from the item's `file` when the item is added, and revoke it when the item goes away:
177
+
178
+ ```html
179
+ <ui-file-input-list aria-label="Images">
180
+ <template>
181
+ <ui-file-input-item>
182
+ <img alt="" />
183
+ <span data-file="name"></span>
184
+ <ui-file-input-item-remove>
185
+ <button type="button"><svg aria-hidden="true">…</svg></button>
186
+ </ui-file-input-item-remove>
187
+ </ui-file-input-item>
188
+ </template>
189
+ </ui-file-input-list>
190
+ ```
191
+
192
+ ```ts
193
+ const list = document.querySelector("ui-file-input-list")!
194
+ new MutationObserver((records) => {
195
+ for (const { addedNodes, removedNodes } of records) {
196
+ for (const node of addedNodes) {
197
+ const image = (node as Element).querySelector?.("img")
198
+ const file = (node as HTMLElement & { file?: File }).file
199
+ if (image && file && !image.src) image.src = URL.createObjectURL(file)
200
+ }
201
+ for (const node of removedNodes) {
202
+ const image = (node as Element).querySelector?.("img")
203
+ if (image && !node.isConnected) URL.revokeObjectURL(image.src)
204
+ }
205
+ }
206
+ }).observe(list, { childList: true })
207
+ ```
208
+
209
+ ## Attachments
210
+
211
+ Put a textarea inside a drop zone to attach files to a message. `paste-target` takes file pastes from the textarea too, through a CSS selector; text pastes keep their normal behavior. It can also be `"document"`.
212
+
213
+ ```html
214
+ <ui-file-input multiple>
215
+ <ui-file-input-dropzone paste-target="#message">
216
+ <ui-file-input-list aria-label="Attachments">
217
+ <template>
218
+ <ui-file-input-item><span data-file="name"></span></ui-file-input-item>
219
+ </template>
220
+ </ui-file-input-list>
221
+ <textarea id="message" aria-label="Message"></textarea>
222
+ <ui-file-input-trigger>
223
+ <button aria-label="Attach Files"><svg aria-hidden="true">…</svg></button>
224
+ </ui-file-input-trigger>
225
+ </ui-file-input-dropzone>
226
+ </ui-file-input>
227
+ ```
228
+
229
+ ## Page-Wide Drop
230
+
231
+ Set `target="document"` to take files dropped anywhere on the page. The zone shows `data-dragging` while a file is over the window, so it can be a full-page overlay. A drop on another zone stays with that zone.
232
+
233
+ ```ts title="page.ts"
234
+ import "@ui-sdk/web/file-input"
235
+ import { createElement, File as FileIcon, Upload, X } from "lucide"
236
+
237
+ function mount(root: HTMLElement) {
238
+ root.innerHTML = `
239
+ <ui-file-input multiple>
240
+ <div data-slot="row">
241
+ <p data-slot="hint">Drop files anywhere.</p>
242
+ <ui-file-input-trigger><button>Upload Files</button></ui-file-input-trigger>
243
+ </div>
244
+ <ui-file-input-dropzone target="document" data-variant="overlay">
245
+ <div data-slot="stack">
246
+ ${createElement(Upload, { "aria-hidden": "true" }).outerHTML}
247
+ <p>Drop to attach</p>
248
+ </div>
249
+ </ui-file-input-dropzone>
250
+ <ui-file-input-list aria-label="Attachments">
251
+ <template>
252
+ <ui-file-input-item>
253
+ ${createElement(FileIcon, { "aria-hidden": "true" }).outerHTML}
254
+ <span data-file="name"></span>
255
+ <span data-file="size" data-slot="hint"></span>
256
+ <ui-file-input-item-remove><button type="button">${createElement(X, { "aria-hidden": "true" }).outerHTML}</button></ui-file-input-item-remove>
257
+ </ui-file-input-item>
258
+ </template>
259
+ </ui-file-input-list>
260
+ </ui-file-input>
261
+ `
262
+ }
263
+
264
+ export { mount }
265
+ ```
266
+
267
+ Drag a file over this page to see the overlay, then drop it. The file joins the Attachments list; a drop on the first example's zone stays there.
268
+
269
+ While a drop zone is connected, dropping a file outside every zone doesn't navigate away from the page. Drops onto native file inputs and ordinary text drops keep their behavior.
270
+
271
+ ## Folders
272
+
273
+ `directory` picks a whole folder and turns on `multiple`. Dropped folders are read recursively, up to 1,000 files, skipping system files such as `.DS_Store`. `data-file="path"` shows the path inside the folder, the same as `relativePath(file)` from `@ui-sdk/web/file-input`.
274
+
275
+ ```html
276
+ <ui-file-input directory>
277
+ <ui-file-input-trigger
278
+ ><button>Choose a Folder</button></ui-file-input-trigger
279
+ >
280
+ <ui-file-input-list aria-label="Files">
281
+ <template>
282
+ <ui-file-input-item><span data-file="path"></span></ui-file-input-item>
283
+ </template>
284
+ </ui-file-input-list>
285
+ </ui-file-input>
286
+ ```
287
+
288
+ ## Camera
289
+
290
+ Use `capture="environment"` to request the rear camera, or `"user"` for the front camera. The picker offered depends on the device and browser; a desktop browser opens a file picker.
291
+
292
+ ```html
293
+ <ui-file-input accept="image/*" capture="environment">
294
+ <ui-file-input-trigger><button>Take a Photo</button></ui-file-input-trigger>
295
+ </ui-file-input>
296
+ ```
297
+
298
+ ## Controlled
299
+
300
+ Set the element's `value` property and listen for `valuechange`. `event.detail` has the files as `value`, the `reason`, and the `added`, `removed`, and `rejected` files. Call `event.preventDefault()` to keep the current value. The `reject` event reports rejected files even when none were accepted.
301
+
302
+ ```ts
303
+ const input = document.querySelector("ui-file-input")!
304
+ input.value = files
305
+ input.addEventListener("valuechange", (event) => setFiles(event.detail.value))
306
+ ```
307
+
308
+ ## Opening from Anywhere
309
+
310
+ Create a controller with `createFileInputController()` and set it as the element's `controller` property. Use it to open the picker, add or remove files, clear the value, or read the files. Open the picker from a user action, such as a button press, so the browser allows it. The element's `api` property has the same methods. A `ui-file-input-trigger` outside the file input connects with `for` set to the file input's `id`.
311
+
312
+ ```html
313
+ <button type="button" data-action="open">Choose Files</button>
314
+ <button type="button" data-action="clear">Clear</button>
315
+ <ui-file-input multiple></ui-file-input>
316
+ ```
317
+
318
+ ```ts
319
+ import { createFileInputController } from "@ui-sdk/web/file-input"
320
+
321
+ const attachments = createFileInputController()
322
+ document.querySelector("ui-file-input")!.controller = attachments
323
+ document
324
+ .querySelector('[data-action="open"]')!
325
+ .addEventListener("click", () => attachments.open())
326
+ document
327
+ .querySelector('[data-action="clear"]')!
328
+ .addEventListener("click", () => attachments.clear())
329
+ ```
330
+
331
+ ## Announcements
332
+
333
+ The component announces accepted, removed, and rejected files through a polite live region. Set the `announcement` property to change the message, or return `null` to skip it.
334
+
335
+ ```ts
336
+ input.announcement = ({ added, removed }) =>
337
+ added.length
338
+ ? `Added ${added.map((file) => file.name).join(", ")}.`
339
+ : removed.length
340
+ ? `Removed ${removed.map((file) => file.name).join(", ")}.`
341
+ : null
342
+ ```
343
+
344
+ ## Forms
345
+
346
+ With `name`, the element submits its files through `ElementInternals` once it upgrades. A form reset returns to `defaultValue`, a property you set from script before connecting the element. `form` connects the file input to a form elsewhere on the page. Rejected files never submit, and `disabled` leaves the value out of the submission as well as stopping picks, drops, and pastes.
347
+
348
+ ```html
349
+ <form method="post" enctype="multipart/form-data">
350
+ <ui-file-input name="attachments" multiple>
351
+ <ui-file-input-trigger><button>Attach Files</button></ui-file-input-trigger>
352
+ </ui-file-input>
353
+ <button type="submit">Send</button>
354
+ <button type="reset">Reset</button>
355
+ </form>
356
+ ```
357
+
358
+ ```ts
359
+ input.defaultValue = [coverLetter]
360
+ ```
361
+
362
+ ## Fields
363
+
364
+ Wrap the file input in a [Field](./field.md) to connect its label, description, and validation message. The trigger becomes the field's control, and pressing the label opens the picker. `required` stops the form from submitting with no file.
365
+
366
+ ```html
367
+ <ui-field>
368
+ <ui-field-label>Proof of address</ui-field-label>
369
+ <ui-file-input name="proof" required accept="image/*,.pdf">
370
+ <ui-file-input-trigger
371
+ ><button>Choose a File</button></ui-file-input-trigger
372
+ >
373
+ </ui-file-input>
374
+ <ui-field-description
375
+ >A utility bill or bank statement from the last 3
376
+ months.</ui-field-description
377
+ >
378
+ <ui-field-error match="valueMissing">Add a scan to continue.</ui-field-error>
379
+ </ui-field>
380
+ ```
381
+
382
+ ## Custom Rendering
383
+
384
+ Parts have no render functions: each element is the part, and the trigger and remove parts wrap your own buttons. Give a part attributes of its own, like `role` and `aria-label` in place of a `<section>`, and show content from its data attributes, like `in-data-drag-reject:inline` in Tailwind. The list's `<template>` is the markup for each file:
385
+
386
+ ```html
387
+ <ui-file-input-dropzone role="region" aria-label="Gallery upload">
388
+ <span class="hidden in-data-drag-reject:inline">Images only</span>
389
+ <span class="hidden in-data-drag-accept:inline">Release to add</span>
390
+ <span class="in-data-dragging:hidden">Drag images here</span>
391
+ </ui-file-input-dropzone>
392
+ <ui-file-input-list aria-label="Images">
393
+ <template>
394
+ <ui-file-input-item><span data-file="name"></span></ui-file-input-item>
395
+ </template>
396
+ </ui-file-input-list>
397
+ ```
398
+
399
+ ## Styling
400
+
401
+ Use `data-dragging`, `data-drag-accept`, and `data-drag-reject` on the drop zone to show what a drop would do. Drag acceptance reflects the file information the browser exposes before a drop. Inside a Field, the trigger also gets the field's attributes, such as `data-invalid`.
402
+
403
+ Each element has a `data-slot`, such as `file-input-dropzone`, and its state attributes are listed under [Data Attributes](#data-attributes).
404
+
405
+ ## Data Attributes
406
+
407
+ ### `<ui-file-input>`
408
+ `[data-slot="file-input"]`
409
+
410
+ - `data-disabled`: Present when disabled, by its own prop or a `<fieldset>`.
411
+ - `data-required`: Present when a file is required.
412
+ - `data-dragging`: Present while files are dragged over one of its drop zones.
413
+
414
+ ### `<ui-file-input-trigger>`
415
+ `[data-slot="file-input-trigger"]`
416
+
417
+ - `data-disabled`: Present when disabled, by its own prop or a `<fieldset>`.
418
+ - `data-required`: Present when a file is required.
419
+
420
+ ### `<ui-file-input-dropzone>`
421
+ `[data-slot="file-input-dropzone"]`
422
+
423
+ - `data-disabled`: Present when disabled, by its own prop or a `<fieldset>`.
424
+ - `data-dragging`: Present while files are dragged over the zone, or the window with `target="document"`.
425
+ - `data-drag-accept`: Present while dragged files look acceptable, from their types and count.
426
+ - `data-drag-reject`: Present while a dragged file has a type `accept` rules out, or there are too many.
427
+
428
+ ### `<ui-file-input-list>`
429
+ `[data-slot="file-input-list"]`
430
+
431
+ - `data-disabled`: Present when disabled, by its own prop or a `<fieldset>`.
432
+ - `data-required`: Present when a file is required.
433
+
434
+ ### `<ui-file-input-item>`
435
+ `[data-slot="file-input-item"]`
436
+
437
+ - `data-disabled`: Present when disabled, by its own prop or a `<fieldset>`.
438
+
439
+ ### `<ui-file-input-item-remove>`
440
+ `[data-slot="file-input-item-remove"]`
441
+
442
+ - `data-disabled`: Present when disabled, by its own prop or a `<fieldset>`.
443
+
444
+ ## API Reference
445
+
446
+ Props are attributes in kebab case, like `max-size`. `accept` is comma-separated, and `paste-target` is `"document"` or a CSS selector. `validate`, `announcement`, `controller` and `defaultValue` are properties, set from script, and `value` is the files. `onValueChange` is the `valuechange` event: `detail.value` holds the files, beside `reason`, `added`, `removed` and `rejected`. Call `preventDefault()` to cancel. `onReject` is the `reject` event.
447
+
448
+ ### FileInput
449
+
450
+ - `accept?` (`string | readonly string[]`): The files to accept, like the `accept` attribute: MIME types (`"image/png"`), wildcards (`"image/*"`) and extensions (`".pdf"`), in a comma-separated string or an array. Without it, any file.
451
+ - `maxFiles?` (`number`): The most files accepted at a time. The first ones that pass the other checks are accepted, and the rest are rejected.
452
+ - `maxSize?` (`number`): The largest size accepted, in bytes.
453
+ - `minSize?` (`number`): The smallest size accepted, in bytes.
454
+ - `validate?` (`((file: File) => string | null | undefined | void)`): A check of your own. Return a reason, like `"duplicate"`, to reject the file, or nothing to accept it.
455
+ - `value?` (`File[]`): The files, to control the file input.
456
+ - `defaultValue?` (`File[]`): The files at first, when uncontrolled. A form reset returns to them.
457
+ - `valuechange event`: Runs when files are added or removed, with what changed in the details. `details.cancel()` stops it.
458
+ - `reject event`: Runs when files fail the checks, after `valuechange`, with every reason each failed, even when none were accepted.
459
+ - `multiple?` (`boolean`): Holds more than one file. New files join the ones it has, up to `maxFiles` in all. Without it, a new file replaces the one it has.
460
+ - `directory?` (`boolean`): Picks a whole folder, with every file inside it. Turns on `multiple`.
461
+ - `capture?` (`"environment" | "user" | boolean`): Opens the camera on phones instead of the files: `"user"` for the front camera, `"environment"` for the back one, or `true` for the default one.
462
+ - `name?` (`string`): The name the files submit under. Without one, nothing is submitted.
463
+ - `form?` (`string`): The id of a form to belong to, when it isn't inside that form.
464
+ - `required?` (`boolean`): Blocks form submission until it holds a file, with the browser's own message.
465
+ - `disabled?` (`boolean`): Disables it like a native control: the trigger can't be focused or used, drops and pastes are ignored, and nothing is submitted.
466
+ - `announcement?` (`((change: FileInputChange) => string | null | undefined)`): What screen readers hear after a change. Return null for nothing.
467
+ - `controller?` (`object`): Adds and removes files from anywhere. Create one with `createFileInputController()`.
468
+ - `debug?` (`boolean`): Logs every state change with its reason to the console, in development builds.
469
+
470
+ ### FileInputTrigger
471
+
472
+ - `controller?` (`object`): Connects a trigger outside the file input, like one in a toolbar, to the file input with this controller.
473
+
474
+ ### FileInputDropzone
475
+
476
+ - `target?` (`FileInputDropzoneTarget`): Where it takes drops. `"document"` takes files dropped anywhere on the page, and the zone shows `data-dragging` while files are over the window, so it can be a full-page overlay.
477
+ - `pasteTarget?` (`FileInputPasteTarget`): Somewhere else to take pasted files from, on top of pastes while focus is inside the zone: `"document"`, an element, a CSS selector, or a function that returns an element, like a prompt's text area. Text pastes are left alone.
478
+
479
+ ### FileInputList
480
+
481
+ Copies the item in its `<template>` once for each file. Without a template, each item shows the file's name and a remove button.
482
+
483
+ ### FileInputItem
484
+
485
+ - `file` (`File`): The file this item shows. The list passes it to the items it renders.
486
+
487
+ ### FileInputItemRemove
488
+
489
+ Wraps a button that removes its item's file. It's named for the file and stays out of the Tab order.
490
+
491
+ ### State
492
+
493
+ The root's, the trigger's and the list's state:
494
+
495
+ - `value` (`readonly File[]`): The files it holds.
496
+ - `disabled` (`boolean`): Whether it's disabled, by itself or by a `<fieldset>`.
497
+ - `required` (`boolean`): Whether a form won't submit while it holds no files.
498
+ - `dragging` (`boolean`): Whether files are being dragged over one of its drop zones.
499
+
500
+ A drop zone's:
501
+
502
+ - `dragging` (`boolean`): Whether files are being dragged over it, or over the page for a page-wide zone.
503
+ - `dragAccept` (`boolean`): Whether the dragged files look acceptable, from their types and count.
504
+ - `dragReject` (`boolean`): Whether a dragged file has a type `accept` rules out, or there are too many.
505
+ - `disabled` (`boolean`): Whether the file input is disabled, by itself or by a `<fieldset>`, so drops and pastes are ignored.
506
+
507
+ An item's:
508
+
509
+ - `file` (`File`): The file this item shows: the one its `FileInputList` renders it for, or its `file` prop.
510
+ - `index` (`number`): Where it is in the value, from 0.
511
+ - `disabled` (`boolean`): Whether the file input is disabled, so the item can't be removed.
512
+
513
+ A remove button's:
514
+
515
+ - `disabled` (`boolean`): Whether the file input is disabled, so the button can't remove its file.
516
+
517
+ ### Reasons
518
+
519
+ - `picker` (`Event`): Files were chosen in the system's file picker. Its input's `change` event.
520
+ - `drop` (`DragEvent`): Files were dropped on a drop zone, or text and tokens on a token input.
521
+ - `paste` (`ClipboardEvent`): Files were pasted, like a screenshot, or text and tokens into a token input.
522
+ - `remove-press` (`MouseEvent | KeyboardEvent`): A chip's remove part was pressed, or Backspace or Delete removed a chip or a span.
523
+ - `reset` (`none`): A form reset.
524
+ - `imperative` (`none`): A controller or `api` call, or a property set on a web component.
525
+
526
+ Rejected files carry one or more of these reasons, or a reason from your `validate`: `file-type`, `file-too-large`, `file-too-small` and `too-many-files`.
527
+
528
+ ### Controller
529
+
530
+ Create one with `createFileInputController()` and set it as the `controller` property. The element's `api` property has the same methods.
531
+
532
+ - `getValue()` (`() => readonly File[]`): The files it holds.
533
+ - `setValue(files, options?)` (`(files: readonly File[], options?: FileInputChangeOptions | undefined) => boolean`): Replaces the files, without checking them. Returns false when canceled.
534
+ - `addFiles(files, options?)` (`(files: readonly File[] | FileList, options?: FileInputChangeOptions | undefined) => boolean`): Runs files through the checks and adds the accepted ones, like a drop. Returns false when disabled or canceled.
535
+ - `removeFile(file, options?)` (`(file: File, options?: FileInputChangeOptions | undefined) => boolean`): Removes one file. Returns false when it isn't there, or the change is canceled.
536
+ - `clear(options?)` (`(options?: FileInputChangeOptions | undefined) => boolean`): Removes every file.
537
+ - `open()` (`() => boolean`): Opens the file picker. Browsers only allow it during a user action, like a click. Returns false when disabled.
538
+ - `focus()` (`() => void`): Moves focus to the trigger.
539
+ - `isDragging()` (`() => boolean`): Whether files are being dragged over a drop zone.
540
+
541
+ ## Accessibility
542
+
543
+ Keep a trigger available alongside a drop zone for people using a keyboard or screen reader. Changes are announced through a polite live region, and the file list supports keyboard navigation and removal.
544
+
545
+ **Drops and pastes**
546
+
547
+ - Dropped files are reported, the rejected ones with every reason.
548
+ - Files over the zone show data-dragging and data-drag-accept until they leave.
549
+ - A type the file input doesn't accept shows data-drag-reject.
550
+ - More files than the file input takes show data-drag-reject.
551
+ - The drag state holds while the drag crosses the zone's children.
552
+ - Text dragged over the zone is ignored.
553
+ - A drag that started in the page is ignored, even with files.
554
+ - The first files up to maxFiles are accepted and the rest rejected.
555
+ - MaxFiles counts the files the file input already holds.
556
+ - Without multiple, the first file is accepted, and a new one replaces it.
557
+ - A disabled file input takes no drops and shows no drag state.
558
+ - Files dropped outside the zone don't open in the browser.
559
+ - Pasting files while focus is inside the zone reports them.
560
+ - Pasting text is left alone.
561
+ - Pasting files into the paste target reports them.
562
+ - A page-wide zone shows while files are over the window.
563
+ - A page-wide zone takes files dropped anywhere.
564
+ - A drop on a zone doesn't reach a page-wide zone.
565
+ - Render functions get the drag state. React and Vue only.
566
+
567
+ **The picker**
568
+
569
+ - A trigger alone opens the file picker, and the chosen file is reported.
570
+ - Files the accept list rules out are rejected.
571
+ - An unnamed file input empties its input after each choice, so the same file can be chosen again.
572
+ - A folder picker reports every file inside the folder.
573
+ - The input carries accept, capture, multiple and directory.
574
+ - The input stays out of the tab order and the accessibility tree.
575
+ - With multiple, chosen files join the ones dropped before.
576
+
577
+ **Forms**
578
+
579
+ - A named file input submits the chosen files with its form.
580
+ - Rejected files are never submitted.
581
+ - A named file input with no files submits an empty file, like a native input.
582
+ - Files dropped on the zone go in the form.
583
+ - Canceling a change keeps its files out of the form.
584
+ - A form reset clears the files.
585
+ - A required file input blocks submission and shows the field's error.
586
+ - Files set from script update the field even when the announcement throws. Web components only.
587
+ - The field's label and the button's text name the trigger, and its description describes it.
588
+ - A press on the field's label opens the picker.
589
+ - A disabled file input disables its trigger.
590
+
591
+ Runs in React, Vue and web components.
592
+
593
+ - Each file shows as an item in the list, in order.
594
+ - A remove button is named after its file, and removes it.
595
+ - The list is one tab stop, and arrow keys, Home and End move between items.
596
+ - Backspace on a focused item removes it and focuses the next one.
597
+ - A removal is announced politely.
598
+ - A canceled change leaves the list as it was.
599
+ - A form reset empties the list.
600
+ - A controlled file input shows the value it's given. React and Vue only.
601
+ - A removal a controlled owner ignores keeps the item and its focus. React and Vue only.
602
+ - The value property sets the files quietly on web components, and the api reports. Web components only.
603
+ - The remove buttons are out of the tab order.
604
+
605
+ Runs in React, Vue and web components.
606
+
607
+ - No axe violations at first.
608
+ - No axe violations while dragging.
609
+ - No axe violations with files in the list.
610
+ - No axe violations with the field's error showing.
611
+ - No axe violations when disabled.
612
+ - The zone isn't a control: the trigger inside it is the one tab stop.
613
+ - The accessibility tree is the same everywhere.
614
+ - Accepted and rejected counts are announced politely.
615
+ - A choice from the picker is announced too.
616
+
617
+ Runs in React, Vue and web components.