@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,639 @@
1
+ # Pagination
2
+
3
+ Navigate pages with buttons, links, or your router.
4
+
5
+ ```ts title="basic.ts"
6
+ import "@ui-sdk/web/pagination"
7
+ import { ChevronLeft, ChevronRight, createElement, Ellipsis } from "lucide"
8
+ import { log } from "./log"
9
+
10
+ function mount(root: HTMLElement) {
11
+ root.innerHTML = `
12
+ <ui-pagination aria-label="Pagination" page-count="10">
13
+ <ui-pagination-list>
14
+ <ui-pagination-item>
15
+ <ui-pagination-previous>
16
+ <button data-variant="ghost">
17
+ ${createElement(ChevronLeft, { "aria-hidden": "true" }).outerHTML}
18
+ <span data-slot="visually-hidden">Previous</span>
19
+ </button>
20
+ </ui-pagination-previous>
21
+ </ui-pagination-item>
22
+ <template>
23
+ <ui-pagination-item>
24
+ <ui-pagination-link>
25
+ <button data-variant="ghost"></button>
26
+ </ui-pagination-link>
27
+ </ui-pagination-item>
28
+ </template>
29
+ <template data-ellipsis>
30
+ <ui-pagination-item>
31
+ <ui-pagination-ellipsis>${createElement(Ellipsis, { "aria-hidden": "true" }).outerHTML}</ui-pagination-ellipsis>
32
+ </ui-pagination-item>
33
+ </template>
34
+ <ui-pagination-item>
35
+ <ui-pagination-next>
36
+ <button data-variant="ghost">
37
+ <span data-slot="visually-hidden">Next</span>
38
+ ${createElement(ChevronRight, { "aria-hidden": "true" }).outerHTML}
39
+ </button>
40
+ </ui-pagination-next>
41
+ </ui-pagination-item>
42
+ </ui-pagination-list>
43
+ </ui-pagination>
44
+ `
45
+ root
46
+ .querySelector("ui-pagination")!
47
+ .addEventListener("pagechange", (event) => {
48
+ const { value, reason } = event.detail
49
+ log(root, `Page ${value} (${reason})`)
50
+ })
51
+ }
52
+
53
+ export { mount }
54
+ ```
55
+
56
+ Choose a page, or use Previous and Next. The console logs each page and its reason, and the step at either end stays focusable as a button.
57
+
58
+ ## Installation
59
+
60
+ ```bash
61
+ npm install @ui-sdk/web @ui-sdk/core
62
+ ```
63
+
64
+ Importing the component defines its elements. On the server the import does nothing.
65
+
66
+ ```ts
67
+ import "@ui-sdk/web/pagination"
68
+ ```
69
+
70
+ ## Composition
71
+
72
+ Use the following composition to build a `ui-pagination`:
73
+
74
+ ```text
75
+ ui-pagination
76
+ └── ui-pagination-list
77
+ ├── ui-pagination-item
78
+ │ └── ui-pagination-previous
79
+ │ └── button
80
+ ├── template
81
+ │ └── ui-pagination-item
82
+ │ └── ui-pagination-link
83
+ │ └── button
84
+ ├── template
85
+ │ └── ui-pagination-item
86
+ │ └── ui-pagination-ellipsis
87
+ └── ui-pagination-item
88
+ └── ui-pagination-next
89
+ └── button
90
+ ```
91
+
92
+ Name the navigation with `aria-label`, then put the page links and steps in a list.
93
+
94
+ A list with a `<template>` renders the range from it: one copy for each page, with the page number in an empty button, and the `<template data-ellipsis>` for each gap. Without the ellipsis template, gaps get a plain `<ui-pagination-ellipsis>`. Links and steps wrap your own `<button>`, or an `<a>` with [`getHref`](#links), so style those. Links you write yourself, like a server's, take a `page` attribute.
95
+
96
+ The template keeps page entries keyed as the range moves. The current page's wrapped button gets `aria-current="page"` and `data-current`; an ellipsis shows “…” and is hidden from screen readers.
97
+
98
+ Give each step text or an `aria-label` on its wrapped button. At an end, the button gets `aria-disabled="true"` and `data-disabled` and stops changing the page. As a button, it stays in the tab order.
99
+
100
+ ## Usage
101
+
102
+ Import the parts and put them together:
103
+
104
+ ```html
105
+ <script type="module">
106
+ import "@ui-sdk/web/pagination"
107
+ </script>
108
+
109
+ <ui-pagination aria-label="Pagination" page-count="10">
110
+ <ui-pagination-list>
111
+ <ui-pagination-item>
112
+ <ui-pagination-previous><button>Previous</button></ui-pagination-previous>
113
+ </ui-pagination-item>
114
+ <template>
115
+ <ui-pagination-item>
116
+ <ui-pagination-link><button></button></ui-pagination-link>
117
+ </ui-pagination-item>
118
+ </template>
119
+ <ui-pagination-item>
120
+ <ui-pagination-next><button>Next</button></ui-pagination-next>
121
+ </ui-pagination-item>
122
+ </ui-pagination-list>
123
+ </ui-pagination>
124
+ ```
125
+
126
+ ## Total and Page Size
127
+
128
+ Instead of `page-count`, pass `total`, how many items there are, and `page-size`, how many fit on a page (10 by default). Pagination calculates the page count, with a minimum of one. This example resets to page 1 when the page size changes.
129
+
130
+ A page past the end, like after the count shrinks, reads as the last page.
131
+
132
+ ```ts title="total.ts"
133
+ import "@ui-sdk/web/pagination"
134
+ import { ChevronLeft, ChevronRight, createElement, Ellipsis } from "lucide"
135
+ import { log } from "./log"
136
+
137
+ function mount(root: HTMLElement) {
138
+ root.innerHTML = `
139
+ <div data-slot="stack">
140
+ <div data-slot="row">
141
+ <p>Showing 21–40 of 95</p>
142
+ <label data-slot="label">
143
+ Rows per page
144
+ <select>
145
+ <option value="10">10</option>
146
+ <option value="20" selected>20</option>
147
+ <option value="50">50</option>
148
+ </select>
149
+ </label>
150
+ </div>
151
+ <ui-pagination aria-label="Pagination" total="95" page-size="20" default-page="2">
152
+ <ui-pagination-list>
153
+ <ui-pagination-item>
154
+ <ui-pagination-previous>
155
+ <button data-variant="ghost">
156
+ ${createElement(ChevronLeft, { "aria-hidden": "true" }).outerHTML}
157
+ <span data-slot="visually-hidden">Previous</span>
158
+ </button>
159
+ </ui-pagination-previous>
160
+ </ui-pagination-item>
161
+ <template>
162
+ <ui-pagination-item>
163
+ <ui-pagination-link>
164
+ <button data-variant="ghost"></button>
165
+ </ui-pagination-link>
166
+ </ui-pagination-item>
167
+ </template>
168
+ <template data-ellipsis>
169
+ <ui-pagination-item>
170
+ <ui-pagination-ellipsis>${createElement(Ellipsis, { "aria-hidden": "true" }).outerHTML}</ui-pagination-ellipsis>
171
+ </ui-pagination-item>
172
+ </template>
173
+ <ui-pagination-item>
174
+ <ui-pagination-next>
175
+ <button data-variant="ghost">
176
+ <span data-slot="visually-hidden">Next</span>
177
+ ${createElement(ChevronRight, { "aria-hidden": "true" }).outerHTML}
178
+ </button>
179
+ </ui-pagination-next>
180
+ </ui-pagination-item>
181
+ </ui-pagination-list>
182
+ </ui-pagination>
183
+ </div>
184
+ `
185
+ const pagination = root.querySelector("ui-pagination")!
186
+ const select = root.querySelector("select")!
187
+ const showing = (page: number) => {
188
+ const size = Number(select.value)
189
+ root.querySelector("p")!.textContent =
190
+ `Showing ${(page - 1) * size + 1}–${Math.min(page * size, 95)} of 95`
191
+ }
192
+ pagination.addEventListener("pagechange", (event) => {
193
+ showing(event.detail.value)
194
+ if (event.detail.reason !== "imperative") {
195
+ log(root, `Page ${event.detail.value}`)
196
+ }
197
+ })
198
+ select.addEventListener("change", () => {
199
+ pagination.setAttribute("page-size", select.value)
200
+ pagination.page = 1
201
+ showing(1)
202
+ log(root, `${select.value} rows per page`)
203
+ })
204
+ }
205
+
206
+ export { mount }
207
+ ```
208
+
209
+ Choose a page, then change Rows per page. The console logs each change, and a new size starts again at page 1.
210
+
211
+ ## Simple
212
+
213
+ With only a few pages, the range has no gaps, so you can write the links out and leave the steps off. Links you write yourself take a `page` attribute and need their own number.
214
+
215
+ ```html
216
+ <ui-pagination aria-label="Pagination" page-count="5">
217
+ <ui-pagination-list>
218
+ <ui-pagination-item
219
+ ><ui-pagination-link page="1"
220
+ ><button>1</button></ui-pagination-link
221
+ ></ui-pagination-item
222
+ >
223
+ <ui-pagination-item
224
+ ><ui-pagination-link page="2"
225
+ ><button>2</button></ui-pagination-link
226
+ ></ui-pagination-item
227
+ >
228
+ <ui-pagination-item
229
+ ><ui-pagination-link page="3"
230
+ ><button>3</button></ui-pagination-link
231
+ ></ui-pagination-item
232
+ >
233
+ <ui-pagination-item
234
+ ><ui-pagination-link page="4"
235
+ ><button>4</button></ui-pagination-link
236
+ ></ui-pagination-item
237
+ >
238
+ <ui-pagination-item
239
+ ><ui-pagination-link page="5"
240
+ ><button>5</button></ui-pagination-link
241
+ ></ui-pagination-item
242
+ >
243
+ </ui-pagination-list>
244
+ </ui-pagination>
245
+ ```
246
+
247
+ ## Links
248
+
249
+ Set the `getHref` property to map each page to a URL, and wrap `<a>` elements instead of buttons.
250
+
251
+ ```html
252
+ <ui-pagination aria-label="Pagination" page-count="10">
253
+ <ui-pagination-list>
254
+ <ui-pagination-item>
255
+ <ui-pagination-previous><a>Previous</a></ui-pagination-previous>
256
+ </ui-pagination-item>
257
+ <template>
258
+ <ui-pagination-item>
259
+ <ui-pagination-link><a></a></ui-pagination-link>
260
+ </ui-pagination-item>
261
+ </template>
262
+ <ui-pagination-item>
263
+ <ui-pagination-next><a>Next</a></ui-pagination-next>
264
+ </ui-pagination-item>
265
+ </ui-pagination-list>
266
+ </ui-pagination>
267
+ ```
268
+
269
+ ```ts
270
+ document.querySelector("ui-pagination")!.getHref = (page) =>
271
+ `/posts?page=${page}`
272
+ ```
273
+
274
+ Server-rendered anchors work before JavaScript loads. A normal click changes the page and follows the URL. Modifier clicks and middle clicks leave pagination state alone so the browser can open the link elsewhere.
275
+
276
+ A step at its end loses its `href` and leaves the tab order, but keeps focus if it already had it. During navigation, its original `href` stays in place so Next cannot accidentally follow the next page's URL.
277
+
278
+ ## Router Links
279
+
280
+ Render your router's link to page on the client. Parts bind whatever `<a>` they wrap, so a router that listens for clicks on links keeps working. The pagination's click handler runs first: when a change is canceled or a step is at its end, it calls `preventDefault()`. Check `event.defaultPrevented` before navigating.
281
+
282
+ Read the page from the URL, like your router's search params, and set the [`page` property](#controlled) from it.
283
+
284
+ ```ts
285
+ const pagination = document.querySelector("ui-pagination")!
286
+ pagination.getHref = (page) => `?page=${page}`
287
+ pagination.page = Number(new URL(location.href).searchParams.get("page") ?? 1)
288
+ ```
289
+
290
+ ## Controlled
291
+
292
+ The element owns its page. Listen for `pagechange`, and call `preventDefault()` on it to keep the current page. The `page` property reads the page, and setting it goes there.
293
+
294
+ ```ts
295
+ const pagination = document.querySelector("ui-pagination")!
296
+ pagination.addEventListener("pagechange", (event) =>
297
+ console.log(event.detail.value, event.detail.reason)
298
+ )
299
+ pagination.page = 1
300
+ ```
301
+
302
+ Every change carries a [reason](#reasons): `item-press` for a page, `previous-press`, `next-press`, `first-press` or `last-press` for a step, and `imperative` from a [controller](#controller). Call `event.preventDefault()` to keep the page, like while a form has unsaved changes. A canceled change also stops a link from navigating.
303
+
304
+ ## Default Page
305
+
306
+ `default-page` is the page it starts on, when uncontrolled. It's 1 by default.
307
+
308
+ ```html
309
+ <ui-pagination aria-label="Pagination" page-count="10" default-page="5">
310
+ ...
311
+ </ui-pagination>
312
+ ```
313
+
314
+ ## Siblings
315
+
316
+ `siblings` is how many pages show on each side of the current one, 1 by default. Near an end, the window slides over instead of shrinking, keeping the range length stable. A gap of one page shows that page instead of an ellipsis.
317
+
318
+ ```html
319
+ <ui-pagination
320
+ aria-label="Pagination"
321
+ page-count="20"
322
+ default-page="10"
323
+ siblings="2"
324
+ >
325
+ ...
326
+ </ui-pagination>
327
+ ```
328
+
329
+ ## Boundaries
330
+
331
+ `boundaries` is how many pages always show at each end, 1 by default.
332
+
333
+ ```html
334
+ <ui-pagination
335
+ aria-label="Pagination"
336
+ page-count="20"
337
+ default-page="10"
338
+ boundaries="2"
339
+ >
340
+ ...
341
+ </ui-pagination>
342
+ ```
343
+
344
+ ## Paging from Anywhere
345
+
346
+ The element's `api` property is its [controller](#controller): it pages the pagination from anywhere, like buttons elsewhere on the page or a keyboard shortcut. Or create one with `createPaginationController()` and set the `controller` property.
347
+
348
+ ```html
349
+ <button type="button" data-action="next">Next Page</button>
350
+ <ui-pagination aria-label="Pagination" page-count="10"> ... </ui-pagination>
351
+ ```
352
+
353
+ ```ts
354
+ const pagination = document.querySelector("ui-pagination")!.api
355
+ document
356
+ .querySelector('[data-action="next"]')!
357
+ .addEventListener("click", () => pagination.next())
358
+ ```
359
+
360
+ ## Your Own Markup
361
+
362
+ `paginationRange({ page, pageCount, siblings, boundaries })` is the range the parts use, as a pure function. It runs anywhere, like on the server, in an email or for a UI that isn't a list of pages. Import it from `@ui-sdk/core/pagination`. Here it keeps a strip of slide dots the same length however many slides there are.
363
+
364
+ ```html
365
+ <div role="group" aria-label="Slides"></div>
366
+ ```
367
+
368
+ ```ts
369
+ import { paginationRange } from "@ui-sdk/core/pagination"
370
+
371
+ function renderDots(group: HTMLElement, slide: number) {
372
+ const items = paginationRange({
373
+ page: slide,
374
+ pageCount: 20,
375
+ siblings: 2,
376
+ boundaries: 1,
377
+ })
378
+ group.replaceChildren(
379
+ ...items.map((item) => {
380
+ if (typeof item !== "number") {
381
+ const gap = document.createElement("span")
382
+ gap.setAttribute("aria-hidden", "true")
383
+ return gap
384
+ }
385
+ const dot = document.createElement("button")
386
+ dot.setAttribute("aria-label", `Slide ${item}`)
387
+ if (item === slide) dot.setAttribute("aria-current", "true")
388
+ dot.addEventListener("click", () => renderDots(group, item))
389
+ return dot
390
+ })
391
+ )
392
+ }
393
+ ```
394
+
395
+ ## Custom Rendering
396
+
397
+ Elements have no render functions. Links and steps wrap your own elements, so change them directly, and read state from their attributes, the `page` property or the `pagechange` event: whether a link is current, and for a step, the page it goes to and whether it's disabled. Here a `pagechange` listener writes Page 3 into the current link, and gives each arrow the page it goes to and a title.
398
+
399
+ ```ts title="render.ts"
400
+ import "@ui-sdk/web/pagination"
401
+ import { ArrowLeft, ArrowRight, createElement } from "lucide"
402
+
403
+ function mount(root: HTMLElement) {
404
+ root.innerHTML = `
405
+ <ui-pagination aria-label="Pagination" page-count="10">
406
+ <ui-pagination-list>
407
+ <ui-pagination-item>
408
+ <ui-pagination-previous>
409
+ <button aria-label="Previous page">
410
+ ${createElement(ArrowLeft, { "aria-hidden": "true" }).outerHTML}
411
+ <span aria-hidden="true"></span>
412
+ </button>
413
+ </ui-pagination-previous>
414
+ </ui-pagination-item>
415
+ <template>
416
+ <ui-pagination-item>
417
+ <ui-pagination-link>
418
+ <button></button>
419
+ </ui-pagination-link>
420
+ </ui-pagination-item>
421
+ </template>
422
+ <ui-pagination-item>
423
+ <ui-pagination-next>
424
+ <button aria-label="Next page">
425
+ <span aria-hidden="true"></span>
426
+ ${createElement(ArrowRight, { "aria-hidden": "true" }).outerHTML}
427
+ </button>
428
+ </ui-pagination-next>
429
+ </ui-pagination-item>
430
+ </ui-pagination-list>
431
+ </ui-pagination>
432
+ `
433
+ const pagination = root.querySelector("ui-pagination")!
434
+
435
+ function step(selector: string, page: number) {
436
+ const button = root.querySelector<HTMLButtonElement>(`${selector} button`)!
437
+ const disabled = page < 1 || page > pagination.api.getPageCount()
438
+ button.querySelector("span")!.hidden = disabled
439
+ button.querySelector("span")!.textContent = String(page)
440
+ if (disabled) {
441
+ button.removeAttribute("title")
442
+ } else {
443
+ button.title = `Go to page ${page}`
444
+ }
445
+ }
446
+
447
+ function update() {
448
+ const page = pagination.page
449
+ step("ui-pagination-previous", page - 1)
450
+ step("ui-pagination-next", page + 1)
451
+ for (const link of root.querySelectorAll("ui-pagination-link[page]")) {
452
+ const n = Number(link.getAttribute("page"))
453
+ link.querySelector("button")!.textContent =
454
+ n === page ? `Page ${n}` : String(n)
455
+ }
456
+ }
457
+
458
+ queueMicrotask(update)
459
+ pagination.addEventListener("pagechange", () => queueMicrotask(update))
460
+ }
461
+
462
+ export { mount }
463
+ ```
464
+
465
+ Choose a page. The current page widens to say Page 3, and each arrow shows the page it goes to.
466
+
467
+ ## Styling
468
+
469
+ Parts are unstyled. Style them through the attributes they render, which are the same in every framework: `aria-current="page"` or `data-current` on the current page's link, and `aria-disabled` or `data-disabled` on a step at its end.
470
+
471
+ Each part has a `data-slot`, such as `pagination-link`, and its state attributes are listed under [Data Attributes](#data-attributes). The root, list, items and ellipsis have none.
472
+
473
+ The list and its items are `<ui-pagination-list>` and `<ui-pagination-item>`, which display as blocks. Give the list `flex` to lay the pages out in a row.
474
+
475
+ ## Data Attributes
476
+
477
+ ### `<ui-pagination-link>`
478
+ `[data-slot="pagination-link"]`
479
+
480
+ - `data-current`: Present on the current page's link, beside `aria-current="page"`.
481
+
482
+ ### `<ui-pagination-previous>`
483
+ `[data-slot="pagination-previous"]`
484
+
485
+ - `data-disabled`: Present on a step at the end it goes to, beside `aria-disabled`. It stays focusable and does nothing.
486
+
487
+ ### `<ui-pagination-next>`
488
+ `[data-slot="pagination-next"]`
489
+
490
+ - `data-disabled`: Present on a step at the end it goes to, beside `aria-disabled`. It stays focusable and does nothing.
491
+
492
+ ### `<ui-pagination-first>`
493
+ `[data-slot="pagination-first"]`
494
+
495
+ - `data-disabled`: Present on a step at the end it goes to, beside `aria-disabled`. It stays focusable and does nothing.
496
+
497
+ ### `<ui-pagination-last>`
498
+ `[data-slot="pagination-last"]`
499
+
500
+ - `data-disabled`: Present on a step at the end it goes to, beside `aria-disabled`. It stays focusable and does nothing.
501
+
502
+ ## API Reference
503
+
504
+ Props are attributes in kebab case, like `page-count`, `default-page` and `page-size`, and numbers are
505
+ numbers. `getHref` and `controller` are properties. `page` is a live property. Callbacks are DOM events.
506
+
507
+ ### Pagination
508
+
509
+ - `page?` (`number`): The current page, from 1. Pass it to control the pagination.
510
+ - `defaultPage?` (`number`): The page it starts on, when uncontrolled.
511
+ - `pagechange event`: Runs when the page wants to change: a page link (`"item-press"`), the Previous, Next, First or Last part, or a controller (`"imperative"`). `details.cancel()` keeps the page, and stops a link from navigating.
512
+ - `pageCount?` (`number`): How many pages there are. Or pass `total` and `pageSize`.
513
+ - `total?` (`number`): How many items there are, for `pageCount` from `pageSize`.
514
+ - `pageSize?` (`number`): How many items fit on a page, with `total`.
515
+ - `siblings?` (`number`): How many pages show on each side of the current one.
516
+ - `boundaries?` (`number`): How many pages always show at each end.
517
+ - `getHref?` (`((page: number) => string)`): The URL of a page. With it, parts are links: they navigate, open in a new tab with a modifier key, and work before JavaScript loads. Without it, they're buttons.
518
+ - `controller?` (`object`): Pages it from anywhere. Create one with `createPaginationController()`.
519
+ - `debug?` (`boolean`): Logs every state change with its reason to the console, in development builds.
520
+
521
+ ### PaginationLink
522
+
523
+ - `page` (`number`): The page the link goes to, from 1.
524
+
525
+ `PaginationList`, `PaginationItem`, `PaginationPrevious`, `PaginationNext`, `PaginationFirst`, `PaginationLast` and `PaginationEllipsis` take no props of their own.
526
+
527
+ ### State
528
+
529
+ The same state shows as attributes on each link and step.
530
+
531
+ `Pagination` and `PaginationList`:
532
+
533
+ - `page` (`number`): The current page, from 1.
534
+ - `pageCount` (`number`): How many pages there are.
535
+ - `items` (`PaginationRangeItem[]`): The pages to show, with an ellipsis for each gap. Render a PaginationLink or a PaginationEllipsis for each.
536
+
537
+ `PaginationLink`:
538
+
539
+ - `page` (`number`): The page it goes to, from its `page` prop.
540
+ - `current` (`boolean`): Whether it's the current page.
541
+
542
+ `PaginationPrevious`, `PaginationNext`, `PaginationFirst` and `PaginationLast`:
543
+
544
+ - `page` (`number`): The page it goes to.
545
+ - `disabled` (`boolean`): Whether it's at the end it goes to, so it does nothing.
546
+
547
+ ### Reasons
548
+
549
+ `event.detail.reason` says why the page changed.
550
+
551
+ - `item-press` (`MouseEvent | KeyboardEvent`): A member of a collection was chosen: a menu item, a tab, a radio or a checkbox item.
552
+ - `previous-press` (`MouseEvent | KeyboardEvent`): A pagination's or a carousel's Previous part was pressed.
553
+ - `next-press` (`MouseEvent | KeyboardEvent`): A pagination's or a carousel's Next part was pressed.
554
+ - `first-press` (`MouseEvent | KeyboardEvent`): A pagination's First part was pressed.
555
+ - `last-press` (`MouseEvent | KeyboardEvent`): A pagination's Last part was pressed.
556
+ - `imperative` (`none`): A controller or `api` call, or a property set on a web component.
557
+
558
+ ### Controller
559
+
560
+ The element's `api` property has the same methods.
561
+
562
+ Every write method takes an optional `{ reason, event }`, passed to `pagechange`, and returns `false` when the change is canceled or there's nowhere to go.
563
+
564
+ - `getPage()` (`() => number`): The current page, from 1.
565
+ - `getPageCount()` (`() => number`): How many pages there are.
566
+ - `setPage(page, options?)` (`(page: number, options?: PaginationChangeOptions | undefined) => boolean`): Goes to a page, clamped to the range. Returns false when canceled or already there.
567
+ - `next(options?)` (`(options?: PaginationChangeOptions | undefined) => boolean`): Goes to the next page. Returns false on the last page.
568
+ - `previous(options?)` (`(options?: PaginationChangeOptions | undefined) => boolean`): Goes to the previous page. Returns false on the first page.
569
+ - `first(options?)` (`(options?: PaginationChangeOptions | undefined) => boolean`): Goes to the first page.
570
+ - `last(options?)` (`(options?: PaginationChangeOptions | undefined) => boolean`): Goes to the last page.
571
+
572
+ ### Events
573
+
574
+ Events fire on their own element and don't bubble, with the new page in `event.detail.value` and the `reason` and `event` beside it. Calling `preventDefault()` cancels the change. Type the element as `UiPaginationElement` for typed listeners.
575
+
576
+ | Member | On | Description |
577
+ | --------------------- | --------------- | ---------------------------------------------------- |
578
+ | `page` property | `ui-pagination` | The current page. Setting it goes there |
579
+ | `api` property | `ui-pagination` | The [controller](#controller) |
580
+ | `getHref` property | `ui-pagination` | A page's URL. With it, wrap links instead of buttons |
581
+ | `controller` property | `ui-pagination` | A controller from `createPaginationController()` |
582
+ | `pagechange` event | `ui-pagination` | `detail: { value: page, reason, event, source }` |
583
+
584
+ ## Accessibility
585
+
586
+ There's no WAI-ARIA pattern for pagination. It follows the common practice: a `navigation` landmark named with `aria-label`, a list of links or buttons, and `aria-current="page"` on the current one. The list keeps the `list` role even when styled without bullets, which Safari would otherwise drop.
587
+
588
+ ### Focus
589
+
590
+ Steps rendered as buttons stay focusable at the ends. A clicked page link keeps focus as the range moves; the primitive also tries to restore focus to that page or step if rendering replaces its element. Key range entries by their value rather than their index.
591
+
592
+ ### Tested Behavior
593
+
594
+ Every line below is an automated test.
595
+
596
+ - The pagination is a named navigation landmark with a list of pages.
597
+ - The first page is current to start with, or the default page.
598
+ - Pressing a page goes there.
599
+ - Enter on a focused page goes there.
600
+ - Space on a focused page goes there.
601
+ - Next and Previous step one page.
602
+ - First and Last go to the ends.
603
+ - First and Previous say they're disabled on the first page, and do nothing.
604
+ - Next and Last say they're disabled on the last page, and do nothing.
605
+ - A single page has nothing to step to.
606
+ - Siblings and boundaries widen the range.
607
+ - Ellipses are hidden from screen readers.
608
+ - With getHref, pages and steps are links to their pages.
609
+ - A link at an end has no href and says it's disabled.
610
+ - Pressing a link goes to its page and follows it.
611
+ - A change can be canceled.
612
+ - A canceled change stops a link from navigating.
613
+ - The controller pages it from outside.
614
+ - A controlled pagination follows its owner. React and Vue only.
615
+
616
+ Runs in React, Vue and web components.
617
+
618
+ Beyond the baseline:
619
+
620
+ - Pressing Next onto the last page keeps focus on Next.
621
+ - Pressing Previous onto the first page keeps focus on Previous.
622
+ - Paging through every page with the keyboard never loses focus.
623
+ - Pressing a page keeps focus on it while the range moves around it.
624
+ - Focus comes back to the same part when the list renders again from scratch. React and Vue only.
625
+ - The list has the same number of entries on every page, so nothing shifts under the pointer.
626
+ - A gap of one page shows that page instead of an ellipsis.
627
+ - A link pressed with a modifier opens elsewhere and leaves the page as it is.
628
+ - The list keeps its list role when styled without bullets.
629
+ - Steps at the ends stay in the tab order and say they're disabled.
630
+ - A Next link goes to the next page, not past it, even after the page renders again.
631
+ - A Next link onto the last page still goes there, though it ends there.
632
+
633
+ Runs in React, Vue and web components.
634
+
635
+ Screen readers hear the same thing in each tested framework, recorded by a virtual screen reader:
636
+
637
+ - Announcements while paging with a keyboard.
638
+
639
+ Runs in React, Vue and web components.