@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,535 @@
1
+ # Collapsible
2
+
3
+ Show and hide a panel, preserve its contents, and animate its height.
4
+
5
+ Use a collapsible to show and hide one panel of content. For a set of panels, use an [accordion](./accordion.md).
6
+
7
+ ```ts title="basic.ts"
8
+ import "@ui-sdk/web/collapsible"
9
+ import { ChevronDown, createElement } from "lucide"
10
+
11
+ const items = [
12
+ { name: "Linen shirt", price: "$48.00" },
13
+ { name: "Canvas tote", price: "$18.00" },
14
+ { name: "Wool socks", price: "$18.00" },
15
+ ]
16
+
17
+ function mount(root: HTMLElement) {
18
+ root.innerHTML = `
19
+ <ui-collapsible data-variant="card">
20
+ <ui-collapsible-trigger>
21
+ <button type="button" aria-expanded="false">
22
+ <span data-slot="stack">
23
+ <span>Order #4189</span>
24
+ <span data-slot="hint">3 items, $84.00</span>
25
+ </span>
26
+ ${createElement(ChevronDown, { "aria-hidden": "true" }).outerHTML}
27
+ </button>
28
+ </ui-collapsible-trigger>
29
+ <ui-collapsible-panel hidden>
30
+ ${items
31
+ .map(
32
+ (item) => `
33
+ <div data-slot="row">
34
+ <span>${item.name}</span>
35
+ <span>${item.price}</span>
36
+ </div>`
37
+ )
38
+ .join("")}
39
+ </ui-collapsible-panel>
40
+ </ui-collapsible>
41
+ `
42
+ }
43
+
44
+ export { mount }
45
+ ```
46
+
47
+ Press Order #4189, or focus it and press Enter or Space, to show the items.
48
+
49
+ ## Installation
50
+
51
+ ```bash
52
+ npm install @ui-sdk/web @ui-sdk/core
53
+ ```
54
+
55
+ Import the component to register its elements. The import is safe on the server.
56
+
57
+ ```ts
58
+ import "@ui-sdk/web/collapsible"
59
+ ```
60
+
61
+ ## Composition
62
+
63
+ Use the following composition to build a `ui-collapsible`:
64
+
65
+ ```text
66
+ ui-collapsible
67
+ ├── ui-collapsible-trigger
68
+ │ └── button
69
+ └── ui-collapsible-panel
70
+ ```
71
+
72
+ The trigger wraps your own native button, and the root and panel are block elements. Put other content around them, like a heading or a summary that always shows.
73
+
74
+ ## Usage
75
+
76
+ Import the parts and put them together:
77
+
78
+ ```html
79
+ <script type="module">
80
+ import "@ui-sdk/web/collapsible"
81
+ </script>
82
+
83
+ <ui-collapsible>
84
+ <ui-collapsible-trigger
85
+ ><button>Order details</button></ui-collapsible-trigger
86
+ >
87
+ <ui-collapsible-panel hidden>2 × Linen shirt</ui-collapsible-panel>
88
+ </ui-collapsible>
89
+ ```
90
+
91
+ ## Build Your Own
92
+
93
+ `@ui-sdk/web/collapsible` comes with ready-made `ui-collapsible` elements. If you'd like to build your own, with your own element names, start from the `collapsible` primitive in `@ui-sdk/core`:
94
+
95
+ ```ts title="spoiler-elements.ts"
96
+ import { collapsible } from "@ui-sdk/core/collapsible"
97
+ import { createParts, wrappedButton } from "@ui-sdk/web"
98
+
99
+ createParts(collapsible, {
100
+ root: "spoiler-box",
101
+ trigger: {
102
+ tag: "spoiler-toggle",
103
+ target: wrappedButton,
104
+ display: "contents",
105
+ },
106
+ panel: "spoiler-content",
107
+ })
108
+ ```
109
+
110
+ ```html
111
+ <spoiler-box>
112
+ <spoiler-toggle><button>Show the ending</button></spoiler-toggle>
113
+ <spoiler-content hidden>The butler did it.</spoiler-content>
114
+ </spoiler-box>
115
+ ```
116
+
117
+ Each element keeps the behavior, state and data attributes of its ready-made counterpart. See [Rendering](../rendering.md) and [Custom Parts](../custom-parts.md) for more.
118
+
119
+ ## Disabled
120
+
121
+ Set `disabled` on the root to stop its trigger from opening or closing the panel. The trigger stays in the tab order and reports `aria-disabled="true"`. A disabled `<fieldset>` around the collapsible disables it too.
122
+
123
+ ```html
124
+ <ui-collapsible disabled>
125
+ <ui-collapsible-trigger><button>Gift options</button></ui-collapsible-trigger>
126
+ <ui-collapsible-panel hidden
127
+ >Add a gift message and wrapping.</ui-collapsible-panel
128
+ >
129
+ </ui-collapsible>
130
+ ```
131
+
132
+ ## Keep Mounted
133
+
134
+ Closed panels stay in the page with `hidden`, so Tab skips their contents and a field keeps what you typed into it. Set `keep-mounted` on the panel to keep it bound while it's closed, so the trigger's `aria-controls` still points to it.
135
+
136
+ ```ts title="keep-mounted.ts"
137
+ import "@ui-sdk/web/collapsible"
138
+ import "@ui-sdk/web/field"
139
+ import "@ui-sdk/web/textarea"
140
+ import { ChevronDown, createElement } from "lucide"
141
+
142
+ function mount(root: HTMLElement) {
143
+ root.innerHTML = `
144
+ <ui-collapsible data-variant="card">
145
+ <ui-collapsible-trigger>
146
+ <button type="button" aria-expanded="false">
147
+ <span data-slot="stack">
148
+ <span>Add a delivery note</span>
149
+ <span data-slot="hint">Optional, for the courier</span>
150
+ </span>
151
+ ${createElement(ChevronDown, { "aria-hidden": "true" }).outerHTML}
152
+ </button>
153
+ </ui-collapsible-trigger>
154
+ <ui-collapsible-panel keep-mounted hidden>
155
+ <ui-field>
156
+ <ui-field-label>Delivery note</ui-field-label>
157
+ <ui-textarea>
158
+ <textarea placeholder="Leave it with the front desk…"></textarea>
159
+ </ui-textarea>
160
+ </ui-field>
161
+ </ui-collapsible-panel>
162
+ </ui-collapsible>
163
+ `
164
+ }
165
+
166
+ export { mount }
167
+ ```
168
+
169
+ Open Add a delivery note, type a note, then close and reopen the panel. Your note is still there.
170
+
171
+ ## Find in Page
172
+
173
+ Set `hidden-until-found` on the panel to keep it in the DOM as `hidden="until-found"`. Browser Find and links to content inside the panel can reveal it. The panel opens without an animation so the match is visible immediately.
174
+
175
+ Write `hidden="until-found"` on the closed panel too, so it is findable before the elements upgrade.
176
+
177
+ ```ts title="find-in-page.ts"
178
+ import "@ui-sdk/web/collapsible"
179
+ import { ChevronDown, createElement } from "lucide"
180
+
181
+ function mount(root: HTMLElement) {
182
+ root.innerHTML = `
183
+ <ui-collapsible data-variant="card">
184
+ <ui-collapsible-trigger>
185
+ <button type="button" aria-expanded="false">
186
+ <span data-slot="stack">
187
+ <span>Ingredients</span>
188
+ <span data-slot="hint">Morning buns, makes 12</span>
189
+ </span>
190
+ ${createElement(ChevronDown, { "aria-hidden": "true" }).outerHTML}
191
+ </button>
192
+ </ui-collapsible-trigger>
193
+ <ui-collapsible-panel hidden-until-found hidden="until-found">
194
+ <p>Flour, butter, brown sugar, eggs, a pinch of cardamom and sea salt.</p>
195
+ </ui-collapsible-panel>
196
+ </ui-collapsible>
197
+ `
198
+ }
199
+
200
+ export { mount }
201
+ ```
202
+
203
+ Leave Ingredients closed. Open your browser's Find command and search for cardamom to reveal the panel.
204
+
205
+ ## Controlled
206
+
207
+ Read or set the element's `open` property. Setting it commits the change without firing `openchange`, like a native input's `value`. Listen for `openchange` to follow the changes people make, and call `event.preventDefault()` in it to cancel the change.
208
+
209
+ For a button elsewhere on the page, call the element's `api.toggle()`, `api.open()` or `api.close()`. Its `api` property is the [controller](#controller).
210
+
211
+ ```ts title="controlled.ts"
212
+ import "@ui-sdk/web/collapsible"
213
+ import { ChevronDown, createElement } from "lucide"
214
+ import { log } from "./log"
215
+
216
+ const recoveryCodes = ["7KQ2-M9XD", "P4TR-8HZC", "W3NB-6JUE", "C5YF-2LSA"]
217
+
218
+ function mount(root: HTMLElement) {
219
+ root.innerHTML = `
220
+ <div data-slot="stack">
221
+ <div data-slot="controls">
222
+ <button type="button">Toggle</button>
223
+ </div>
224
+ <ui-collapsible data-variant="card">
225
+ <ui-collapsible-trigger>
226
+ <button type="button" aria-expanded="false">
227
+ <span data-slot="stack">
228
+ <span>Recovery codes</span>
229
+ <span data-slot="hint">Each code signs you in once</span>
230
+ </span>
231
+ ${createElement(ChevronDown, { "aria-hidden": "true" }).outerHTML}
232
+ </button>
233
+ </ui-collapsible-trigger>
234
+ <ui-collapsible-panel hidden>
235
+ <div data-slot="stack">
236
+ <ul>${recoveryCodes.map((code) => `<li>${code}</li>`).join("")}</ul>
237
+ <button type="button">Done</button>
238
+ </div>
239
+ </ui-collapsible-panel>
240
+ </ui-collapsible>
241
+ </div>
242
+ `
243
+ const collapsible = root.querySelector("ui-collapsible")!
244
+ root
245
+ .querySelector("[data-slot=controls] button")!
246
+ .addEventListener("click", () => collapsible.api.toggle())
247
+ root
248
+ .querySelector("ui-collapsible-panel button")!
249
+ .addEventListener("click", () => collapsible.api.close())
250
+ collapsible.addEventListener("openchange", (event) => {
251
+ const { value, reason } = event.detail
252
+ log(root, `${value ? "Opened" : "Closed"} (${reason})`)
253
+ })
254
+ }
255
+
256
+ export { mount }
257
+ ```
258
+
259
+ Open Recovery codes with Toggle or its trigger, then press Done. The console logs each change and its reason, and Done returns focus to the trigger.
260
+
261
+ ## Animation
262
+
263
+ Animate the measured `--collapsible-panel-height` between zero and the content's height. `data-starting-style` marks the opening frame, and `data-ending-style` stays on while it closes. The panel stays mounted until its closing animation finishes, and a panel open on its first paint doesn't animate.
264
+
265
+ ```css
266
+ [data-slot="collapsible-panel"] {
267
+ height: var(--collapsible-panel-height);
268
+ overflow: hidden;
269
+ transition: height 0.2s ease-out;
270
+
271
+ &:is([data-starting-style], [data-ending-style]) {
272
+ height: 0;
273
+ }
274
+ }
275
+ ```
276
+
277
+ `openchangecomplete` reports when opening or closing has finished.
278
+
279
+ ```ts title="animation.ts"
280
+ import "@ui-sdk/web/collapsible"
281
+ import { ChevronDown, createElement } from "lucide"
282
+ import { log } from "./log"
283
+
284
+ const notes = [
285
+ "Search now matches file contents, not only names.",
286
+ "Shared links remember the folder they were opened from.",
287
+ "Uploads resume after the connection drops.",
288
+ ]
289
+
290
+ function mount(root: HTMLElement) {
291
+ root.innerHTML = `
292
+ <ui-collapsible data-variant="card">
293
+ <ui-collapsible-trigger>
294
+ <button type="button" aria-expanded="false">
295
+ <span data-slot="stack">
296
+ <span>Release notes</span>
297
+ <span data-slot="hint">Version 2.4, released October 28</span>
298
+ </span>
299
+ ${createElement(ChevronDown, { "aria-hidden": "true" }).outerHTML}
300
+ </button>
301
+ </ui-collapsible-trigger>
302
+ <ui-collapsible-panel hidden>
303
+ <ul>
304
+ ${notes.map((note) => `<li>${note}</li>`).join("")}
305
+ </ul>
306
+ </ui-collapsible-panel>
307
+ </ui-collapsible>
308
+ `
309
+ root
310
+ .querySelector("ui-collapsible")!
311
+ .addEventListener("openchangecomplete", (event) => {
312
+ log(root, event.detail.value ? "Finished opening" : "Finished closing")
313
+ })
314
+ }
315
+
316
+ export { mount }
317
+ ```
318
+
319
+ Open and close Release notes. The console logs when each animation finishes.
320
+
321
+ ## Custom Rendering
322
+
323
+ The trigger wraps your own button, so put it inside a heading. Set `as-child` on the panel to bind it to your own element, here an ordered list. Elements have no render functions, so the summary follows the root's `data-open`. See [Parts and Composition](../parts-and-composition.md).
324
+
325
+ ```ts title="render.ts"
326
+ import "@ui-sdk/web/collapsible"
327
+ import { ChevronDown, createElement } from "lucide"
328
+
329
+ const updates = [
330
+ { label: "Out for delivery", time: "07:40" },
331
+ { label: "Arrived at the local depot", time: "05:12" },
332
+ { label: "Left the sorting center", time: "Wed 21:03" },
333
+ ]
334
+
335
+ function mount(root: HTMLElement) {
336
+ root.innerHTML = `
337
+ <ui-collapsible data-variant="card">
338
+ <h3>
339
+ <ui-collapsible-trigger>
340
+ <button type="button" aria-expanded="false">
341
+ <span data-slot="stack">
342
+ <span>Track parcel</span>
343
+ <span data-slot="hint" data-show="open">3 updates</span>
344
+ <span data-slot="hint" data-show="closed">Arrives Thursday</span>
345
+ </span>
346
+ ${createElement(ChevronDown, { "aria-hidden": "true" }).outerHTML}
347
+ </button>
348
+ </ui-collapsible-trigger>
349
+ </h3>
350
+ <ui-collapsible-panel as-child>
351
+ <ol hidden>
352
+ ${updates
353
+ .map(
354
+ (update) => `
355
+ <li data-slot="row">
356
+ <span>${update.label}</span>
357
+ <span>${update.time}</span>
358
+ </li>`
359
+ )
360
+ .join("")}
361
+ </ol>
362
+ </ui-collapsible-panel>
363
+ </ui-collapsible>
364
+ `
365
+ }
366
+
367
+ export { mount }
368
+ ```
369
+
370
+ Press Track parcel to open the ordered list. The summary changes from Arrives Thursday to 3 updates.
371
+
372
+ ## Styling
373
+
374
+ Use `data-open`, `data-closed` and `data-disabled` to style each state. The examples turn their chevron from the trigger's `data-open`.
375
+
376
+ Each part has a `data-slot`, such as `collapsible-panel`, and its state attributes are listed under [Data Attributes](#data-attributes).
377
+
378
+ ### `<ui-collapsible-panel>`
379
+ - `--collapsible-panel-height`: The panel's content height in pixels while it animates, auto once open and 0px while closed.
380
+ - `--collapsible-panel-width`: The panel's content width, the same way. For panels that open sideways.
381
+
382
+ ## Data Attributes
383
+
384
+ ### `<ui-collapsible>`
385
+ `[data-slot="collapsible"]`
386
+
387
+ - `data-open`: Present while the panel is open.
388
+ - `data-closed`: Present while the panel is closed, including while it animates out.
389
+ - `data-disabled`: Present when the collapsible can't open or close.
390
+
391
+ ### `<ui-collapsible-trigger>`
392
+ `[data-slot="collapsible-trigger"]`
393
+
394
+ - `data-open`: Present while the panel is open.
395
+ - `data-closed`: Present while the panel is closed, including while it animates out.
396
+ - `data-disabled`: Present when the collapsible can't open or close.
397
+
398
+ ### `<ui-collapsible-panel>`
399
+ `[data-slot="collapsible-panel"]`
400
+
401
+ - `data-open`: Present while the panel is open.
402
+ - `data-closed`: Present while the panel is closed, including while it animates out.
403
+ - `data-disabled`: Present when the collapsible can't open or close.
404
+ - `data-starting-style`: Present for the panel's first frame. Style the state you animate from.
405
+ - `data-ending-style`: Present while the panel animates closed. Style the state you animate to.
406
+
407
+ ## API Reference
408
+
409
+ Props are attributes in kebab case, like `default-open`, `keep-mounted` and `hidden-until-found`: `"false"`
410
+ is false. Callbacks are DOM events. Elements have no `controller` attribute: their
411
+ `api` property is one.
412
+
413
+ ### Collapsible
414
+
415
+ - `open?` (`boolean`): Whether the panel is open. Pass it to control the collapsible.
416
+ - `defaultOpen?` (`boolean`): Whether the panel is open at first, when uncontrolled.
417
+ - `openchange event`: Runs when the panel wants to open or close. `details.reason` says why, and `details.cancel()` stops it.
418
+ - `openchangecomplete event`: Runs once the panel has finished opening or closing, after any animation.
419
+ - `disabled?` (`boolean`): Stops the trigger from opening or closing the panel. The trigger stays focusable.
420
+ - `controller?` (`object`): Opens and closes the panel from anywhere. Create one with `createCollapsibleController()`.
421
+ - `debug?` (`boolean`): Logs every state change with its reason to the console, in development builds.
422
+
423
+ ### CollapsibleTrigger
424
+
425
+ The trigger takes no options of its own. `<ui-collapsible-trigger>` wraps a native `button`.
426
+
427
+ ### CollapsiblePanel
428
+
429
+ - `keepMounted?` (`boolean`): Whether the panel stays in the page, hidden, while closed.
430
+ - `hiddenUntilFound?` (`boolean`): Keeps the closed panel in the page as `hidden="until-found"`, so the browser's find in page can match its text and open it.
431
+
432
+ ### State
433
+
434
+ The same state shows as data attributes on each element.
435
+
436
+ - `open` (`boolean`): Whether the panel is open.
437
+ - `disabled` (`boolean`): Whether the trigger ignores presses, by its own `disabled` or a disabled fieldset around it. The `open` option and the controller can still open and close it.
438
+
439
+ ### Reasons
440
+
441
+ `event.detail.reason` says why the panel opened or closed.
442
+
443
+ - `trigger-press` (`MouseEvent | KeyboardEvent | TouchEvent`): Click, tap, Enter or Space on the part that opens, closes or toggles. Arrow keys that open a menu or submenu count too. A tap on a combobox's input that opens a sheet reports its `touchend`.
444
+ - `find-in-page` (`Event`): The browser's find in page matched hidden content.
445
+ - `imperative` (`none`): A controller or `api` call, or a property set on a web component.
446
+
447
+ ### Controller
448
+
449
+ The element's `api` property has the same methods. The `open` property reads and sets whether the panel is
450
+ open.
451
+
452
+ Every write method takes an optional `{ reason, event }`, and returns `false` when the change was canceled or changed nothing.
453
+
454
+ - `isOpen()` (`() => boolean`): Whether the panel is open.
455
+ - `setOpen(open, options?)` (`(open: boolean, options?: CollapsibleChangeOptions | undefined) => boolean`): Opens or closes the panel. Returns false when the change was canceled or not possible.
456
+ - `open(options?)` (`(options?: CollapsibleChangeOptions | undefined) => boolean`): Opens the panel.
457
+ - `close(options?)` (`(options?: CollapsibleChangeOptions | undefined) => boolean`): Closes the panel.
458
+ - `toggle(options?)` (`(options?: CollapsibleChangeOptions | undefined) => boolean`): Opens the panel when it's closed, and closes it when it's open.
459
+ - `focus()` (`() => void`): Moves focus to the trigger.
460
+
461
+ ### Events
462
+
463
+ Events fire on their own element and don't bubble, with the new state in `event.detail.value` and the `reason` and `event` beside it. Calling `preventDefault()` on `openchange` cancels the change.
464
+
465
+ | Member | On | Description |
466
+ | -------------------------- | ---------------- | -------------------------------------------------------------------------- |
467
+ | `open` property, attribute | `ui-collapsible` | Whether the panel is open. The attribute sets where it starts, and is live |
468
+ | `api` property | `ui-collapsible` | The [controller](#controller) |
469
+ | `openchange` event | `ui-collapsible` | `detail: { value: open, reason, event, source }` |
470
+ | `openchangecomplete` event | `ui-collapsible` | `detail: { value: open }`, after the panel's animation |
471
+
472
+ ## Accessibility
473
+
474
+ The collapsible follows the [WAI-ARIA disclosure pattern](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/). The trigger says whether the panel is open with `aria-expanded`, and points to the panel with `aria-controls` while it's bound. Every line below is an automated test.
475
+
476
+ ### Keyboard
477
+
478
+ | Key | Does |
479
+ | ------------ | ------------------------------------------------------ |
480
+ | Enter, Space | Opens or closes the panel. Focus stays on the trigger. |
481
+ | Tab | Moves from the trigger into an open panel |
482
+
483
+ Closing a panel while focus is inside it moves focus back to the trigger.
484
+
485
+ ### Tested Behavior
486
+
487
+ **Opening and closing**
488
+
489
+ - Starts closed, with the panel out of the page.
490
+ - Clicking the trigger opens the panel, and clicking again closes it.
491
+ - The trigger controls the panel.
492
+ - Generated ids start with ui-sdk-.
493
+ - It can start open.
494
+ - An opening can be canceled.
495
+ - A disabled collapsible doesn't open.
496
+ - A disabled trigger stays focusable and says it's disabled.
497
+ - A controller opens and closes it from anywhere.
498
+
499
+ **Keyboard**
500
+
501
+ - Enter toggles the panel and keeps focus on the trigger.
502
+ - Space toggles the panel and keeps focus on the trigger.
503
+ - Tab moves from the open trigger into the panel.
504
+ - Tab skips a closed panel.
505
+
506
+ **Mounting**
507
+
508
+ - With keepMounted, the closed panel stays in the page, hidden.
509
+ - With keepMounted, a class that sets display doesn't show the closed panel.
510
+ - With hiddenUntilFound, the closed panel stays findable.
511
+ - With hiddenUntilFound, a class that sets display keeps the closed panel findable.
512
+ - Finding text in the closed panel opens it.
513
+ - Following a link into the closed panel opens it.
514
+ - The browser's own find opens the closed panel.
515
+
516
+ Runs in React, Vue and web components.
517
+
518
+ Beyond the pattern's baseline:
519
+
520
+ **Enhancements**
521
+
522
+ - Closing the panel while focus is inside it moves focus to the trigger.
523
+ - OnOpenChangeComplete runs once the animation has finished.
524
+ - Find in page reports its own reason and opens without an animation.
525
+ - A canceled find in page keeps the panel hidden until found.
526
+ - An infinite exit animation still unmounts the panel.
527
+ - Parts report open and closed through data attributes.
528
+
529
+ Runs in React, Vue and web components.
530
+
531
+ Screen readers hear the same thing in each tested framework, recorded by a virtual screen reader:
532
+
533
+ - Announcements while using the collapsible with a keyboard.
534
+
535
+ Runs in React, Vue and web components.