@stevederico/skateboard-ui 3.12.0 → 4.0.0

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 (336) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +37 -31
  3. package/dist/shadcn/ui/accordion.d.ts +1 -6
  4. package/dist/shadcn/ui/accordion.js +3 -17
  5. package/dist/shadcn/ui/alert-dialog.d.ts +1 -18
  6. package/dist/shadcn/ui/alert-dialog.js +3 -43
  7. package/dist/shadcn/ui/alert.d.ts +1 -13
  8. package/dist/shadcn/ui/alert.js +3 -28
  9. package/dist/shadcn/ui/aspect-ratio.d.ts +1 -4
  10. package/dist/shadcn/ui/aspect-ratio.js +3 -8
  11. package/dist/shadcn/ui/avatar.d.ts +1 -11
  12. package/dist/shadcn/ui/avatar.js +3 -24
  13. package/dist/shadcn/ui/badge.d.ts +1 -14
  14. package/dist/shadcn/ui/badge.js +3 -33
  15. package/dist/shadcn/ui/breadcrumb.d.ts +1 -10
  16. package/dist/shadcn/ui/breadcrumb.js +3 -37
  17. package/dist/shadcn/ui/button-group.d.ts +1 -13
  18. package/dist/shadcn/ui/button-group.js +3 -36
  19. package/dist/shadcn/ui/button.d.ts +1 -34
  20. package/dist/shadcn/ui/button.js +3 -53
  21. package/dist/shadcn/ui/calendar.d.ts +1 -13
  22. package/dist/shadcn/ui/calendar.js +3 -75
  23. package/dist/shadcn/ui/card.d.ts +1 -11
  24. package/dist/shadcn/ui/card.js +3 -25
  25. package/dist/shadcn/ui/checkbox.d.ts +1 -3
  26. package/dist/shadcn/ui/checkbox.js +3 -9
  27. package/dist/shadcn/ui/collapsible.d.ts +1 -5
  28. package/dist/shadcn/ui/collapsible.js +3 -13
  29. package/dist/shadcn/ui/command.d.ts +1 -19
  30. package/dist/shadcn/ui/command.js +3 -35
  31. package/dist/shadcn/ui/context-menu.d.ts +1 -29
  32. package/dist/shadcn/ui/context-menu.js +3 -52
  33. package/dist/shadcn/ui/dialog.d.ts +1 -17
  34. package/dist/shadcn/ui/dialog.js +3 -38
  35. package/dist/shadcn/ui/drawer.d.ts +1 -13
  36. package/dist/shadcn/ui/drawer.js +3 -196
  37. package/dist/shadcn/ui/dropdown-menu.d.ts +1 -29
  38. package/dist/shadcn/ui/dropdown-menu.js +3 -52
  39. package/dist/shadcn/ui/empty.d.ts +1 -14
  40. package/dist/shadcn/ui/empty.js +3 -33
  41. package/dist/shadcn/ui/field.d.ts +1 -28
  42. package/dist/shadcn/ui/field.js +3 -68
  43. package/dist/shadcn/ui/hover-card.d.ts +1 -5
  44. package/dist/shadcn/ui/hover-card.js +3 -14
  45. package/dist/shadcn/ui/input-group.d.ts +1 -28
  46. package/dist/shadcn/ui/input-group.js +3 -58
  47. package/dist/shadcn/ui/input.d.ts +1 -3
  48. package/dist/shadcn/ui/input.js +3 -8
  49. package/dist/shadcn/ui/item.d.ts +1 -34
  50. package/dist/shadcn/ui/item.js +3 -79
  51. package/dist/shadcn/ui/kbd.d.ts +1 -3
  52. package/dist/shadcn/ui/kbd.js +3 -9
  53. package/dist/shadcn/ui/label.d.ts +1 -3
  54. package/dist/shadcn/ui/label.js +3 -8
  55. package/dist/shadcn/ui/menubar.d.ts +1 -29
  56. package/dist/shadcn/ui/menubar.js +3 -57
  57. package/dist/shadcn/ui/navigation-menu.d.ts +1 -13
  58. package/dist/shadcn/ui/navigation-menu.js +3 -31
  59. package/dist/shadcn/ui/pagination.d.ts +1 -17
  60. package/dist/shadcn/ui/pagination.js +3 -27
  61. package/dist/shadcn/ui/popover.d.ts +1 -9
  62. package/dist/shadcn/ui/popover.js +3 -24
  63. package/dist/shadcn/ui/progress.d.ts +1 -7
  64. package/dist/shadcn/ui/progress.js +3 -20
  65. package/dist/shadcn/ui/radio-group.d.ts +1 -5
  66. package/dist/shadcn/ui/radio-group.js +3 -12
  67. package/dist/shadcn/ui/scroll-area.d.ts +1 -5
  68. package/dist/shadcn/ui/scroll-area.js +3 -12
  69. package/dist/shadcn/ui/select.d.ts +1 -15
  70. package/dist/shadcn/ui/select.js +3 -35
  71. package/dist/shadcn/ui/separator.d.ts +1 -3
  72. package/dist/shadcn/ui/separator.js +3 -8
  73. package/dist/shadcn/ui/sheet.d.ts +1 -14
  74. package/dist/shadcn/ui/sheet.js +3 -38
  75. package/dist/shadcn/ui/sidebar.d.ts +1 -70
  76. package/dist/shadcn/ui/sidebar.js +3 -256
  77. package/dist/shadcn/ui/skeleton.d.ts +1 -2
  78. package/dist/shadcn/ui/skeleton.js +3 -6
  79. package/dist/shadcn/ui/slider.d.ts +1 -3
  80. package/dist/shadcn/ui/slider.js +3 -12
  81. package/dist/shadcn/ui/spinner.d.ts +1 -2
  82. package/dist/shadcn/ui/spinner.js +3 -7
  83. package/dist/shadcn/ui/switch.d.ts +1 -5
  84. package/dist/shadcn/ui/switch.js +3 -8
  85. package/dist/shadcn/ui/table.d.ts +1 -10
  86. package/dist/shadcn/ui/table.js +3 -29
  87. package/dist/shadcn/ui/tabs.d.ts +1 -13
  88. package/dist/shadcn/ui/tabs.js +3 -29
  89. package/dist/shadcn/ui/textarea.d.ts +1 -3
  90. package/dist/shadcn/ui/textarea.js +3 -7
  91. package/dist/shadcn/ui/toggle-group.d.ts +1 -11
  92. package/dist/shadcn/ui/toggle-group.js +3 -25
  93. package/dist/shadcn/ui/toggle.d.ts +1 -15
  94. package/dist/shadcn/ui/toggle.js +3 -26
  95. package/dist/shadcn/ui/tooltip.d.ts +1 -6
  96. package/dist/shadcn/ui/tooltip.js +3 -17
  97. package/dist/ui/accordion.d.ts +21 -0
  98. package/dist/ui/accordion.js +67 -0
  99. package/dist/ui/alert-dialog.d.ts +32 -0
  100. package/dist/ui/alert-dialog.js +102 -0
  101. package/dist/ui/alert.d.ts +13 -0
  102. package/dist/ui/alert.js +28 -0
  103. package/dist/ui/aspect-ratio.d.ts +5 -0
  104. package/dist/ui/aspect-ratio.js +9 -0
  105. package/dist/ui/avatar.d.ts +14 -0
  106. package/dist/ui/avatar.js +49 -0
  107. package/dist/ui/badge.d.ts +22 -0
  108. package/dist/ui/badge.js +26 -0
  109. package/dist/ui/breadcrumb.d.ts +13 -0
  110. package/dist/ui/breadcrumb.js +29 -0
  111. package/dist/ui/button-group.d.ts +21 -0
  112. package/dist/ui/button-group.js +29 -0
  113. package/dist/ui/button.d.ts +38 -0
  114. package/dist/ui/button.js +49 -0
  115. package/dist/ui/calendar.d.ts +13 -0
  116. package/dist/ui/calendar.js +75 -0
  117. package/dist/ui/card.d.ts +11 -0
  118. package/dist/ui/card.js +25 -0
  119. package/dist/ui/checkbox.d.ts +17 -0
  120. package/dist/ui/checkbox.js +25 -0
  121. package/dist/ui/collapsible.d.ts +11 -0
  122. package/dist/ui/collapsible.js +40 -0
  123. package/dist/ui/command.d.ts +19 -0
  124. package/dist/ui/command.js +35 -0
  125. package/dist/ui/context-menu.d.ts +53 -0
  126. package/dist/ui/context-menu.js +345 -0
  127. package/dist/ui/dialog.d.ts +40 -0
  128. package/dist/ui/dialog.js +109 -0
  129. package/dist/ui/drawer.d.ts +36 -0
  130. package/dist/ui/drawer.js +234 -0
  131. package/dist/ui/dropdown-menu.d.ts +61 -0
  132. package/dist/ui/dropdown-menu.js +323 -0
  133. package/dist/ui/empty.d.ts +14 -0
  134. package/dist/ui/empty.js +33 -0
  135. package/dist/ui/field.d.ts +28 -0
  136. package/dist/ui/field.js +68 -0
  137. package/dist/ui/hover-card.d.ts +32 -0
  138. package/dist/ui/hover-card.js +119 -0
  139. package/dist/ui/input-group.d.ts +28 -0
  140. package/dist/ui/input-group.js +58 -0
  141. package/dist/ui/input.d.ts +3 -0
  142. package/dist/ui/input.js +7 -0
  143. package/dist/ui/item.d.ts +41 -0
  144. package/dist/ui/item.js +69 -0
  145. package/dist/ui/kbd.d.ts +4 -0
  146. package/dist/ui/kbd.js +10 -0
  147. package/dist/ui/label.d.ts +3 -0
  148. package/dist/ui/label.js +8 -0
  149. package/dist/ui/menubar.d.ts +59 -0
  150. package/dist/ui/menubar.js +384 -0
  151. package/dist/ui/navigation-menu.d.ts +24 -0
  152. package/dist/ui/navigation-menu.js +134 -0
  153. package/dist/ui/pagination.d.ts +17 -0
  154. package/dist/ui/pagination.js +36 -0
  155. package/dist/ui/popover.d.ts +25 -0
  156. package/dist/ui/popover.js +68 -0
  157. package/dist/ui/portal.d.ts +7 -0
  158. package/dist/ui/portal.js +12 -0
  159. package/dist/ui/progress.d.ts +15 -0
  160. package/dist/ui/progress.js +36 -0
  161. package/dist/ui/radio-group.d.ts +17 -0
  162. package/dist/ui/radio-group.js +54 -0
  163. package/dist/ui/scroll-area.d.ts +9 -0
  164. package/dist/ui/scroll-area.js +72 -0
  165. package/dist/ui/select.d.ts +37 -0
  166. package/dist/ui/select.js +216 -0
  167. package/dist/ui/separator.d.ts +14 -0
  168. package/dist/ui/separator.js +13 -0
  169. package/dist/ui/sheet.d.ts +31 -0
  170. package/dist/ui/sheet.js +121 -0
  171. package/dist/ui/sidebar.d.ts +86 -0
  172. package/dist/ui/sidebar.js +211 -0
  173. package/dist/ui/skeleton.d.ts +3 -0
  174. package/dist/ui/skeleton.js +7 -0
  175. package/dist/ui/slider.d.ts +18 -0
  176. package/dist/ui/slider.js +94 -0
  177. package/dist/ui/slot.d.ts +27 -0
  178. package/dist/ui/slot.js +62 -0
  179. package/dist/ui/spinner.d.ts +3 -0
  180. package/dist/ui/spinner.js +8 -0
  181. package/dist/ui/switch.d.ts +17 -0
  182. package/dist/ui/switch.js +23 -0
  183. package/dist/ui/table.d.ts +10 -0
  184. package/dist/ui/table.js +29 -0
  185. package/dist/ui/tabs.d.ts +29 -0
  186. package/dist/ui/tabs.js +82 -0
  187. package/dist/ui/textarea.d.ts +3 -0
  188. package/dist/ui/textarea.js +7 -0
  189. package/dist/ui/toggle-group.d.ts +23 -0
  190. package/dist/ui/toggle-group.js +52 -0
  191. package/dist/ui/toggle.d.ts +25 -0
  192. package/dist/ui/toggle.js +41 -0
  193. package/dist/ui/tooltip.d.ts +25 -0
  194. package/dist/ui/tooltip.js +90 -0
  195. package/dist/ui/use-controllable-state.d.ts +10 -0
  196. package/dist/ui/use-controllable-state.js +17 -0
  197. package/dist/ui/use-dismiss.d.ts +10 -0
  198. package/dist/ui/use-dismiss.js +51 -0
  199. package/dist/ui/use-floating.d.ts +38 -0
  200. package/dist/ui/use-floating.js +128 -0
  201. package/dist/ui/use-presence.d.ts +8 -0
  202. package/dist/ui/use-presence.js +48 -0
  203. package/package.json +6 -1
  204. package/dist/shadcn/lib/base-ui/LICENSE +0 -21
  205. package/dist/shadcn/lib/base-ui/_chunk-000kmre8.js +0 -150
  206. package/dist/shadcn/lib/base-ui/_chunk-1vw45v38.js +0 -64
  207. package/dist/shadcn/lib/base-ui/_chunk-23rx7haq.js +0 -81
  208. package/dist/shadcn/lib/base-ui/_chunk-242gh8ph.js +0 -230
  209. package/dist/shadcn/lib/base-ui/_chunk-26cc610z.js +0 -6
  210. package/dist/shadcn/lib/base-ui/_chunk-2z044bba.js +0 -5890
  211. package/dist/shadcn/lib/base-ui/_chunk-3cpd1vjz.js +0 -13
  212. package/dist/shadcn/lib/base-ui/_chunk-3enq1vat.js +0 -82
  213. package/dist/shadcn/lib/base-ui/_chunk-3xpke33f.js +0 -23
  214. package/dist/shadcn/lib/base-ui/_chunk-451nqgsa.js +0 -6
  215. package/dist/shadcn/lib/base-ui/_chunk-4maf6pas.js +0 -11
  216. package/dist/shadcn/lib/base-ui/_chunk-4zhfq4d3.js +0 -16
  217. package/dist/shadcn/lib/base-ui/_chunk-5gaqyne5.js +0 -21
  218. package/dist/shadcn/lib/base-ui/_chunk-5tt5hk59.js +0 -4
  219. package/dist/shadcn/lib/base-ui/_chunk-5tze5c8q.js +0 -13
  220. package/dist/shadcn/lib/base-ui/_chunk-5xmdvndx.js +0 -225
  221. package/dist/shadcn/lib/base-ui/_chunk-6adaer33.js +0 -435
  222. package/dist/shadcn/lib/base-ui/_chunk-6ejf1z1r.js +0 -9
  223. package/dist/shadcn/lib/base-ui/_chunk-6kqramh9.js +0 -27
  224. package/dist/shadcn/lib/base-ui/_chunk-7b9dc493.js +0 -14
  225. package/dist/shadcn/lib/base-ui/_chunk-8a9vv8am.js +0 -89
  226. package/dist/shadcn/lib/base-ui/_chunk-8ctgmf06.js +0 -129
  227. package/dist/shadcn/lib/base-ui/_chunk-8ganmsbg.js +0 -54
  228. package/dist/shadcn/lib/base-ui/_chunk-8xaqxgck.js +0 -15
  229. package/dist/shadcn/lib/base-ui/_chunk-95tf2rxq.js +0 -62
  230. package/dist/shadcn/lib/base-ui/_chunk-9x63vfqj.js +0 -70
  231. package/dist/shadcn/lib/base-ui/_chunk-ase0ydtt.js +0 -9
  232. package/dist/shadcn/lib/base-ui/_chunk-b0nc8wq7.js +0 -34
  233. package/dist/shadcn/lib/base-ui/_chunk-b5ya6xds.js +0 -10
  234. package/dist/shadcn/lib/base-ui/_chunk-b6dkjkbw.js +0 -43
  235. package/dist/shadcn/lib/base-ui/_chunk-c2bz952e.js +0 -19
  236. package/dist/shadcn/lib/base-ui/_chunk-cdgfsr3q.js +0 -15
  237. package/dist/shadcn/lib/base-ui/_chunk-cdj8cpx5.js +0 -347
  238. package/dist/shadcn/lib/base-ui/_chunk-cgptgywc.js +0 -104
  239. package/dist/shadcn/lib/base-ui/_chunk-cwvtvwc7.js +0 -35
  240. package/dist/shadcn/lib/base-ui/_chunk-dan0mva4.js +0 -23
  241. package/dist/shadcn/lib/base-ui/_chunk-dzvjwv25.js +0 -0
  242. package/dist/shadcn/lib/base-ui/_chunk-e13rsb6b.js +0 -184
  243. package/dist/shadcn/lib/base-ui/_chunk-e56mpvk1.js +0 -118
  244. package/dist/shadcn/lib/base-ui/_chunk-e6k2ecs7.js +0 -48
  245. package/dist/shadcn/lib/base-ui/_chunk-ebyxgtb4.js +0 -29
  246. package/dist/shadcn/lib/base-ui/_chunk-f2wttwrf.js +0 -39
  247. package/dist/shadcn/lib/base-ui/_chunk-fdzctasg.js +0 -38
  248. package/dist/shadcn/lib/base-ui/_chunk-ffpjy0ta.js +0 -39
  249. package/dist/shadcn/lib/base-ui/_chunk-fqry7pew.js +0 -603
  250. package/dist/shadcn/lib/base-ui/_chunk-ghn1tzt8.js +0 -84
  251. package/dist/shadcn/lib/base-ui/_chunk-gy0bpkmx.js +0 -12
  252. package/dist/shadcn/lib/base-ui/_chunk-hm5h9vsk.js +0 -16
  253. package/dist/shadcn/lib/base-ui/_chunk-htdj1jps.js +0 -833
  254. package/dist/shadcn/lib/base-ui/_chunk-j29xjete.js +0 -146
  255. package/dist/shadcn/lib/base-ui/_chunk-j3qkyd10.js +0 -50
  256. package/dist/shadcn/lib/base-ui/_chunk-ktvsd5k6.js +0 -2386
  257. package/dist/shadcn/lib/base-ui/_chunk-kw8nnq00.js +0 -546
  258. package/dist/shadcn/lib/base-ui/_chunk-m307wpdj.js +0 -18
  259. package/dist/shadcn/lib/base-ui/_chunk-mnd0j7v9.js +0 -15
  260. package/dist/shadcn/lib/base-ui/_chunk-n11h505c.js +0 -32
  261. package/dist/shadcn/lib/base-ui/_chunk-p0e2qacz.js +0 -26
  262. package/dist/shadcn/lib/base-ui/_chunk-pv7b791x.js +0 -106
  263. package/dist/shadcn/lib/base-ui/_chunk-q5cg71p7.js +0 -83
  264. package/dist/shadcn/lib/base-ui/_chunk-qbezxj1g.js +0 -385
  265. package/dist/shadcn/lib/base-ui/_chunk-qmsqz6nt.js +0 -15
  266. package/dist/shadcn/lib/base-ui/_chunk-rrh8rt4v.js +0 -65
  267. package/dist/shadcn/lib/base-ui/_chunk-s5pwkz8v.js +0 -25
  268. package/dist/shadcn/lib/base-ui/_chunk-svxv97ph.js +0 -218
  269. package/dist/shadcn/lib/base-ui/_chunk-t7ppm3t0.js +0 -68
  270. package/dist/shadcn/lib/base-ui/_chunk-vg16xxmb.js +0 -52
  271. package/dist/shadcn/lib/base-ui/_chunk-vgkfmtbe.js +0 -21
  272. package/dist/shadcn/lib/base-ui/_chunk-watha94s.js +0 -14
  273. package/dist/shadcn/lib/base-ui/_chunk-wdqynnjf.js +0 -35
  274. package/dist/shadcn/lib/base-ui/_chunk-wx2nxg0p.js +0 -15
  275. package/dist/shadcn/lib/base-ui/_chunk-x11e1k9r.js +0 -0
  276. package/dist/shadcn/lib/base-ui/_chunk-x8xehj6d.js +0 -302
  277. package/dist/shadcn/lib/base-ui/_chunk-xcqbtm2f.js +0 -28
  278. package/dist/shadcn/lib/base-ui/_chunk-ytnp24gq.js +0 -328
  279. package/dist/shadcn/lib/base-ui/_chunk-yzr7eg4b.js +0 -6
  280. package/dist/shadcn/lib/base-ui/_chunk-zk4mtm9m.js +0 -9
  281. package/dist/shadcn/lib/base-ui/accordion.d.ts +0 -447
  282. package/dist/shadcn/lib/base-ui/accordion.js +0 -630
  283. package/dist/shadcn/lib/base-ui/alert-dialog.d.ts +0 -1467
  284. package/dist/shadcn/lib/base-ui/alert-dialog.js +0 -98
  285. package/dist/shadcn/lib/base-ui/avatar.d.ts +0 -123
  286. package/dist/shadcn/lib/base-ui/avatar.js +0 -235
  287. package/dist/shadcn/lib/base-ui/button.d.ts +0 -84
  288. package/dist/shadcn/lib/base-ui/button.js +0 -51
  289. package/dist/shadcn/lib/base-ui/checkbox.d.ts +0 -341
  290. package/dist/shadcn/lib/base-ui/checkbox.js +0 -501
  291. package/dist/shadcn/lib/base-ui/collapsible.d.ts +0 -291
  292. package/dist/shadcn/lib/base-ui/collapsible.js +0 -264
  293. package/dist/shadcn/lib/base-ui/context-menu.d.ts +0 -2213
  294. package/dist/shadcn/lib/base-ui/context-menu.js +0 -323
  295. package/dist/shadcn/lib/base-ui/dialog.d.ts +0 -1448
  296. package/dist/shadcn/lib/base-ui/dialog.js +0 -79
  297. package/dist/shadcn/lib/base-ui/input.d.ts +0 -506
  298. package/dist/shadcn/lib/base-ui/input.js +0 -1027
  299. package/dist/shadcn/lib/base-ui/menu.d.ts +0 -2275
  300. package/dist/shadcn/lib/base-ui/menu.js +0 -60
  301. package/dist/shadcn/lib/base-ui/menubar.d.ts +0 -48
  302. package/dist/shadcn/lib/base-ui/menubar.js +0 -156
  303. package/dist/shadcn/lib/base-ui/merge-props.d.ts +0 -70
  304. package/dist/shadcn/lib/base-ui/merge-props.js +0 -15
  305. package/dist/shadcn/lib/base-ui/navigation-menu.d.ts +0 -825
  306. package/dist/shadcn/lib/base-ui/navigation-menu.js +0 -1849
  307. package/dist/shadcn/lib/base-ui/popover.d.ts +0 -1743
  308. package/dist/shadcn/lib/base-ui/popover.js +0 -1089
  309. package/dist/shadcn/lib/base-ui/preview-card.d.ts +0 -1608
  310. package/dist/shadcn/lib/base-ui/preview-card.js +0 -919
  311. package/dist/shadcn/lib/base-ui/progress.d.ts +0 -172
  312. package/dist/shadcn/lib/base-ui/progress.js +0 -272
  313. package/dist/shadcn/lib/base-ui/radio-group.d.ts +0 -260
  314. package/dist/shadcn/lib/base-ui/radio-group.js +0 -239
  315. package/dist/shadcn/lib/base-ui/radio.d.ts +0 -176
  316. package/dist/shadcn/lib/base-ui/radio.js +0 -387
  317. package/dist/shadcn/lib/base-ui/scroll-area.d.ts +0 -241
  318. package/dist/shadcn/lib/base-ui/scroll-area.js +0 -1055
  319. package/dist/shadcn/lib/base-ui/select.d.ts +0 -1266
  320. package/dist/shadcn/lib/base-ui/select.js +0 -2450
  321. package/dist/shadcn/lib/base-ui/separator.d.ts +0 -76
  322. package/dist/shadcn/lib/base-ui/separator.js +0 -11
  323. package/dist/shadcn/lib/base-ui/slider.d.ts +0 -551
  324. package/dist/shadcn/lib/base-ui/slider.js +0 -1583
  325. package/dist/shadcn/lib/base-ui/switch.d.ts +0 -313
  326. package/dist/shadcn/lib/base-ui/switch.js +0 -326
  327. package/dist/shadcn/lib/base-ui/tabs.d.ts +0 -406
  328. package/dist/shadcn/lib/base-ui/tabs.js +0 -915
  329. package/dist/shadcn/lib/base-ui/toggle-group.d.ts +0 -235
  330. package/dist/shadcn/lib/base-ui/toggle-group.js +0 -145
  331. package/dist/shadcn/lib/base-ui/toggle.d.ts +0 -224
  332. package/dist/shadcn/lib/base-ui/toggle.js +0 -127
  333. package/dist/shadcn/lib/base-ui/tooltip.d.ts +0 -1656
  334. package/dist/shadcn/lib/base-ui/tooltip.js +0 -920
  335. package/dist/shadcn/lib/base-ui/use-render.d.ts +0 -87
  336. package/dist/shadcn/lib/base-ui/use-render.js +0 -15
@@ -1,1448 +0,0 @@
1
- /* @base-ui/react 1.5.0 — vendored (MIT — MUI Inc).
2
- * Refresh: scripts/vendor-base-ui.js (see header for instructions).
3
- * Do not edit by hand. */
4
- import * as React$1 from 'react';
5
-
6
- export type TransitionStatus = "starting" | "ending" | "idle" | undefined;
7
- declare const none: "none";
8
- declare const triggerPress: "trigger-press";
9
- declare const triggerHover: "trigger-hover";
10
- declare const triggerFocus: "trigger-focus";
11
- declare const outsidePress: "outside-press";
12
- declare const itemPress: "item-press";
13
- declare const closePress: "close-press";
14
- declare const linkPress: "link-press";
15
- declare const clearPress: "clear-press";
16
- declare const chipRemovePress: "chip-remove-press";
17
- declare const trackPress: "track-press";
18
- declare const incrementPress: "increment-press";
19
- declare const decrementPress: "decrement-press";
20
- declare const inputChange: "input-change";
21
- declare const inputClear: "input-clear";
22
- declare const inputBlur: "input-blur";
23
- declare const inputPaste: "input-paste";
24
- declare const inputPress: "input-press";
25
- declare const focusOut: "focus-out";
26
- declare const escapeKey: "escape-key";
27
- declare const closeWatcher: "close-watcher";
28
- declare const listNavigation: "list-navigation";
29
- declare const keyboard: "keyboard";
30
- declare const pointer: "pointer";
31
- declare const drag: "drag";
32
- declare const wheel: "wheel";
33
- declare const scrub: "scrub";
34
- declare const cancelOpen: "cancel-open";
35
- declare const siblingOpen: "sibling-open";
36
- declare const disabled: "disabled";
37
- declare const missing: "missing";
38
- declare const initial: "initial";
39
- declare const imperativeAction: "imperative-action";
40
- declare const swipe: "swipe";
41
- declare const windowResize: "window-resize";
42
- export interface ReasonToEventMap {
43
- [none]: Event;
44
- [triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
45
- [triggerHover]: MouseEvent;
46
- [triggerFocus]: FocusEvent;
47
- [outsidePress]: MouseEvent | PointerEvent | TouchEvent;
48
- [itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
49
- [closePress]: MouseEvent | KeyboardEvent | PointerEvent;
50
- [linkPress]: MouseEvent | PointerEvent;
51
- [clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
52
- [chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
53
- [trackPress]: PointerEvent | MouseEvent | TouchEvent;
54
- [incrementPress]: PointerEvent | MouseEvent | TouchEvent;
55
- [decrementPress]: PointerEvent | MouseEvent | TouchEvent;
56
- [inputChange]: InputEvent | Event;
57
- [inputClear]: InputEvent | FocusEvent | Event;
58
- [inputBlur]: FocusEvent;
59
- [inputPaste]: ClipboardEvent;
60
- [inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
61
- [focusOut]: FocusEvent | KeyboardEvent;
62
- [escapeKey]: KeyboardEvent;
63
- [closeWatcher]: Event;
64
- [listNavigation]: KeyboardEvent;
65
- [keyboard]: KeyboardEvent;
66
- [pointer]: PointerEvent;
67
- [drag]: PointerEvent | TouchEvent;
68
- [swipe]: PointerEvent | TouchEvent;
69
- [wheel]: WheelEvent;
70
- [scrub]: PointerEvent;
71
- [cancelOpen]: MouseEvent;
72
- [siblingOpen]: Event;
73
- [disabled]: Event;
74
- [missing]: Event;
75
- [initial]: Event;
76
- [imperativeAction]: Event;
77
- [windowResize]: UIEvent;
78
- }
79
- /**
80
- * Maps a change `reason` string to the corresponding native event type.
81
- */
82
- export type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
83
- export type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
84
- /**
85
- * The reason for the event.
86
- */
87
- reason: Reason;
88
- /**
89
- * The native event associated with the custom event.
90
- */
91
- event: ReasonToEvent<Reason>;
92
- /**
93
- * Cancels Base UI from handling the event.
94
- */
95
- cancel: () => void;
96
- /**
97
- * Allows the event to propagate in cases where Base UI will stop the propagation.
98
- */
99
- allowPropagation: () => void;
100
- /**
101
- * Indicates whether the event has been canceled.
102
- */
103
- isCanceled: boolean;
104
- /**
105
- * Indicates whether the event is allowed to propagate.
106
- */
107
- isPropagationAllowed: boolean;
108
- /**
109
- * The element that triggered the event, if applicable.
110
- */
111
- trigger: Element | undefined;
112
- } & CustomProperties;
113
- /**
114
- * Details of custom change events emitted by Base UI components.
115
- */
116
- export type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
117
- export type HTMLProps<T = any> = React$1.HTMLAttributes<T> & {
118
- ref?: React$1.Ref<T> | undefined;
119
- };
120
- /**
121
- * Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
122
- *
123
- * @template Props Props to be spread on the rendered element.
124
- * @template State Component's internal state.
125
- */
126
- export type ComponentRenderFn<Props, State> = (props: Props, state: State) => React$1.ReactElement<unknown>;
127
- export type BaseUIEvent<E extends React$1.SyntheticEvent<Element, Event>> = E & {
128
- preventBaseUIHandler: () => void;
129
- readonly baseUIHandlerPrevented?: boolean | undefined;
130
- };
131
- export type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React$1.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
132
- /**
133
- * Adds a `preventBaseUIHandler` method to all event handlers.
134
- */
135
- export type WithBaseUIEvent<T> = {
136
- [K in keyof T]: WithPreventBaseUIHandler<T[K]>;
137
- };
138
- /**
139
- * Props shared by all Base UI components.
140
- * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
141
- */
142
- export type BaseUIComponentProps<ElementType extends React$1.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React$1.ComponentPropsWithRef<ElementType>>, "className" | "color" | "defaultValue" | "defaultChecked" | "style"> & {
143
- /**
144
- * CSS class applied to the element, or a function that
145
- * returns a class based on the component's state.
146
- */
147
- className?: string | ((state: State) => string | undefined) | undefined;
148
- /**
149
- * Allows you to replace the component's HTML element
150
- * with a different tag, or compose it with another component.
151
- *
152
- * Accepts a `ReactElement` or a function that returns the element to render.
153
- */
154
- render?: React$1.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
155
- /**
156
- * Style applied to the element, or a function that
157
- * returns a style object based on the component's state.
158
- */
159
- style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
160
- };
161
- export interface NativeButtonProps {
162
- /**
163
- * Whether the component renders a native `<button>` element when replacing it
164
- * via the `render` prop.
165
- * Set to `false` if the rendered element is not a button (for example, `<div>`).
166
- * @default true
167
- */
168
- nativeButton?: boolean | undefined;
169
- }
170
- /**
171
- * An overlay displayed beneath the popup.
172
- * Renders a `<div>` element.
173
- *
174
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
175
- */
176
- export declare const DialogBackdrop: React$1.ForwardRefExoticComponent<Omit<DialogBackdropProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
177
- export interface DialogBackdropProps extends BaseUIComponentProps<"div", DialogBackdropState> {
178
- /**
179
- * Whether the backdrop is forced to render even when nested.
180
- * @default false
181
- */
182
- forceRender?: boolean | undefined;
183
- }
184
- export interface DialogBackdropState {
185
- /**
186
- * Whether the dialog is currently open.
187
- */
188
- open: boolean;
189
- /**
190
- * The transition status of the component.
191
- */
192
- transitionStatus: TransitionStatus;
193
- }
194
- export declare namespace DialogBackdrop {
195
- type Props = DialogBackdropProps;
196
- type State = DialogBackdropState;
197
- }
198
- /**
199
- * A button that closes the dialog.
200
- * Renders a `<button>` element.
201
- *
202
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
203
- */
204
- export declare const DialogClose: React$1.ForwardRefExoticComponent<Omit<DialogCloseProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
205
- export interface DialogCloseProps extends NativeButtonProps, BaseUIComponentProps<"button", DialogCloseState> {
206
- }
207
- export interface DialogCloseState {
208
- /**
209
- * Whether the button is currently disabled.
210
- */
211
- disabled: boolean;
212
- }
213
- export declare namespace DialogClose {
214
- type Props = DialogCloseProps;
215
- type State = DialogCloseState;
216
- }
217
- /**
218
- * A paragraph with additional information about the dialog.
219
- * Renders a `<p>` element.
220
- *
221
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
222
- */
223
- export declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogDescriptionProps, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
224
- export interface DialogDescriptionProps extends BaseUIComponentProps<"p", DialogDescriptionState> {
225
- }
226
- export interface DialogDescriptionState {
227
- }
228
- export declare namespace DialogDescription {
229
- type Props = DialogDescriptionProps;
230
- type State = DialogDescriptionState;
231
- }
232
- export type InteractionType = "mouse" | "touch" | "pen" | "keyboard" | "";
233
- /**
234
- * A container for the dialog contents.
235
- * Renders a `<div>` element.
236
- *
237
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
238
- */
239
- export declare const DialogPopup: React$1.ForwardRefExoticComponent<Omit<DialogPopupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
240
- export interface DialogPopupProps extends BaseUIComponentProps<"div", DialogPopupState> {
241
- /**
242
- * Determines the element to focus when the dialog is opened.
243
- *
244
- * - `false`: Do not move focus.
245
- * - `true`: Move focus based on the default behavior (first tabbable element or popup).
246
- * - `RefObject`: Move focus to the ref element.
247
- * - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
248
- * Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
249
- */
250
- initialFocus?: boolean | React$1.RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void) | undefined;
251
- /**
252
- * Determines the element to focus when the dialog is closed.
253
- *
254
- * - `false`: Do not move focus.
255
- * - `true`: Move focus based on the default behavior (trigger or previously focused element).
256
- * - `RefObject`: Move focus to the ref element.
257
- * - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
258
- * Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
259
- */
260
- finalFocus?: boolean | React$1.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefined;
261
- }
262
- export interface DialogPopupState {
263
- /**
264
- * Whether the dialog is currently open.
265
- */
266
- open: boolean;
267
- /**
268
- * The transition status of the component.
269
- */
270
- transitionStatus: TransitionStatus;
271
- /**
272
- * Whether the dialog is nested within a parent dialog.
273
- */
274
- nested: boolean;
275
- /**
276
- * Whether the dialog has nested dialogs open.
277
- */
278
- nestedDialogOpen: boolean;
279
- }
280
- export declare namespace DialogPopup {
281
- type Props = DialogPopupProps;
282
- type State = DialogPopupState;
283
- }
284
- export declare type AlignedPlacement = `${Side}-${Alignment}`;
285
- export declare type Alignment = "start" | "end";
286
- export declare type Axis = "x" | "y";
287
- export declare type ClientRectObject = Prettify<Rect & SideObject>;
288
- export declare type Coords = {
289
- [key in Axis]: number;
290
- };
291
- export declare type Dimensions = {
292
- [key in Length]: number;
293
- };
294
- export declare type Length = "width" | "height";
295
- export declare type Placement = Prettify<Side | AlignedPlacement>;
296
- export declare type Prettify<T> = {
297
- [K in keyof T]: T[K];
298
- } & {};
299
- export declare type Rect = Prettify<Coords & Dimensions>;
300
- export declare type Side = "top" | "right" | "bottom" | "left";
301
- export declare type SideObject = {
302
- [key in Side]: number;
303
- };
304
- export declare type Strategy = "absolute" | "fixed";
305
- export declare interface ComputePositionReturn extends Coords {
306
- /**
307
- * The final chosen placement of the floating element.
308
- */
309
- placement: Placement;
310
- /**
311
- * The strategy used to position the floating element.
312
- */
313
- strategy: Strategy;
314
- /**
315
- * Object containing data returned from all middleware, keyed by their name.
316
- */
317
- middlewareData: MiddlewareData;
318
- }
319
- export declare interface MiddlewareData {
320
- [key: string]: any;
321
- arrow?: Partial<Coords> & {
322
- centerOffset: number;
323
- alignmentOffset?: number;
324
- };
325
- autoPlacement?: {
326
- index?: number;
327
- overflows: Array<{
328
- placement: Placement;
329
- overflows: Array<number>;
330
- }>;
331
- };
332
- flip?: {
333
- index?: number;
334
- overflows: Array<{
335
- placement: Placement;
336
- overflows: Array<number>;
337
- }>;
338
- };
339
- hide?: {
340
- referenceHidden?: boolean;
341
- escaped?: boolean;
342
- referenceHiddenOffsets?: SideObject;
343
- escapedOffsets?: SideObject;
344
- };
345
- offset?: Coords & {
346
- placement: Placement;
347
- };
348
- shift?: Coords & {
349
- enabled: {
350
- [key in Axis]: boolean;
351
- };
352
- };
353
- }
354
- /**
355
- * Custom positioning reference element.
356
- * @see https://floating-ui.com/docs/virtual-elements
357
- */
358
- export declare interface VirtualElement {
359
- getBoundingClientRect(): ClientRectObject;
360
- getClientRects?(): Array<ClientRectObject> | DOMRectList;
361
- contextElement?: Element;
362
- }
363
- declare type Prettify$1<T> = {
364
- [K in keyof T]: T[K];
365
- } & {};
366
- export declare type ReferenceType = Element | VirtualElement;
367
- export declare type UseFloatingData = Prettify$1<ComputePositionReturn & {
368
- isPositioned: boolean;
369
- }>;
370
- export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify$1<UseFloatingData & {
371
- /**
372
- * Update the position of the floating element, re-rendering the component
373
- * if required.
374
- */
375
- update: () => void;
376
- /**
377
- * Pre-configured positioning styles to apply to the floating element.
378
- */
379
- floatingStyles: React$1.CSSProperties;
380
- /**
381
- * Object containing the reference and floating refs and reactive setters.
382
- */
383
- refs: {
384
- /**
385
- * A React ref to the reference element.
386
- */
387
- reference: React$1.MutableRefObject<RT | null>;
388
- /**
389
- * A React ref to the floating element.
390
- */
391
- floating: React$1.MutableRefObject<HTMLElement | null>;
392
- /**
393
- * A callback to set the reference element (reactive).
394
- */
395
- setReference: (node: RT | null) => void;
396
- /**
397
- * A callback to set the floating element (reactive).
398
- */
399
- setFloating: (node: HTMLElement | null) => void;
400
- };
401
- /**
402
- * Object containing the reference and floating elements.
403
- */
404
- elements: {
405
- reference: RT | null;
406
- floating: HTMLElement | null;
407
- };
408
- }>;
409
- export type Listener<T> = (state: T) => void;
410
- declare class Store<State> {
411
- /**
412
- * The current state of the store.
413
- * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
414
- * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
415
- * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
416
- *
417
- * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
418
- */
419
- state: State;
420
- private listeners;
421
- private updateTick;
422
- constructor(state: State);
423
- /**
424
- * Registers a listener that will be called whenever the store's state changes.
425
- *
426
- * @param fn The listener function to be called on state changes.
427
- * @returns A function to unsubscribe the listener.
428
- */
429
- subscribe: (fn: Listener<State>) => () => void;
430
- /**
431
- * Returns the current state of the store.
432
- */
433
- getSnapshot: () => State;
434
- /**
435
- * Updates the entire store's state and notifies all registered listeners.
436
- *
437
- * @param newState The new state to set for the store.
438
- */
439
- setState(newState: State): void;
440
- /**
441
- * Merges the provided changes into the current state and notifies listeners if there are changes.
442
- *
443
- * @param changes An object containing the changes to apply to the current state.
444
- */
445
- update(changes: Partial<State>): void;
446
- /**
447
- * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
448
- *
449
- * @param key The key in the store's state to update.
450
- * @param value The new value to set for the specified key.
451
- */
452
- set<T>(key: keyof State, value: T): void;
453
- /**
454
- * Gives the state a new reference and updates all registered listeners.
455
- */
456
- notifyAll(): void;
457
- use<F extends (...args: any) => any>(selector: F, ...args: SelectorArgs<F>): ReturnType<F>;
458
- }
459
- export type SelectorArgs<Selector> = Selector extends ((...params: infer Params) => any) ? Tail<Params> : never;
460
- export type Tail<T extends readonly any[]> = T extends readonly [
461
- any,
462
- ...infer Rest
463
- ] ? Rest : [
464
- ];
465
- declare class ReactStore<State extends object, Context = Record<string, never>, Selectors extends Record<string, SelectorFunction<State>> = Record<string, never>> extends Store<State> {
466
- /**
467
- * Creates a new ReactStore instance.
468
- *
469
- * @param state Initial state of the store.
470
- * @param context Non-reactive context values.
471
- * @param selectors Optional selectors for use with `useState`.
472
- */
473
- constructor(state: State, context?: Context, selectors?: Selectors);
474
- /**
475
- * Non-reactive values such as refs, callbacks, etc.
476
- */
477
- readonly context: Context;
478
- private selectors;
479
- /**
480
- * Synchronizes a single external value into the store.
481
- *
482
- * Note that the while the value in `state` is updated immediately, the value returned
483
- * by `useState` is updated before the next render (similarly to React's `useState`).
484
- */
485
- useSyncedValue<Key extends keyof State, Value extends State[Key]>(key: keyof State, value: Value): void;
486
- /**
487
- * Synchronizes a single external value into the store and
488
- * cleans it up (sets to `undefined`) on unmount.
489
- *
490
- * Note that the while the value in `state` is updated immediately, the value returned
491
- * by `useState` is updated before the next render (similarly to React's `useState`).
492
- */
493
- useSyncedValueWithCleanup<Key extends KeysAllowingUndefined<State>>(key: Key, value: State[Key]): void;
494
- /**
495
- * Synchronizes multiple external values into the store.
496
- *
497
- * Note that the while the values in `state` are updated immediately, the values returned
498
- * by `useState` are updated before the next render (similarly to React's `useState`).
499
- */
500
- useSyncedValues(statePart: Partial<State>): void;
501
- /**
502
- * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
503
- * is non-undefined, the store's state at `key` is updated to match `controlled`.
504
- */
505
- useControlledProp<Key extends keyof State, Value extends State[Key]>(key: keyof State, controlled: Value | undefined): void;
506
- /** Gets the current value from the store using a selector with the provided key.
507
- *
508
- * @param key Key of the selector to use.
509
- */
510
- select<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
511
- /**
512
- * Returns a value from the store's state using a selector function.
513
- * Used to subscribe to specific parts of the state.
514
- * This methods causes a rerender whenever the selected state changes.
515
- *
516
- * @param key Key of the selector to use.
517
- */
518
- useState<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
519
- /**
520
- * Wraps a function with `useStableCallback` to ensure it has a stable reference
521
- * and assigns it to the context.
522
- *
523
- * @param key Key of the event callback. Must be a function in the context.
524
- * @param fn Function to assign.
525
- */
526
- useContextCallback<Key extends ContextFunctionKeys<Context>>(key: Key, fn: ContextFunction<Context, Key> | undefined): void;
527
- /**
528
- * Returns a stable setter function for a specific key in the store's state.
529
- * It's commonly used to pass as a ref callback to React elements.
530
- *
531
- * @param key Key of the state to set.
532
- */
533
- useStateSetter<const Key extends keyof State, Value extends State[Key]>(key: keyof State): (v: Value) => void;
534
- /**
535
- * Observes changes derived from the store's selectors and calls the listener when the selected value changes.
536
- *
537
- * @param key Key of the selector to observe.
538
- * @param listener Listener function called when the selector result changes.
539
- */
540
- observe<Key extends keyof Selectors>(selector: Key, listener: (newValue: ReturnType<Selectors[Key]>, oldValue: ReturnType<Selectors[Key]>, store: this) => void): () => void;
541
- observe<Selector extends ObserveSelector<State>>(selector: Selector, listener: (newValue: ReturnType<Selector>, oldValue: ReturnType<Selector>, store: this) => void): () => void;
542
- }
543
- export type MaybeCallable = (...args: any[]) => any;
544
- export type ContextFunctionKeys<Context> = {
545
- [Key in keyof Context]-?: Extract<Context[Key], MaybeCallable> extends never ? never : Key;
546
- }[keyof Context];
547
- export type ContextFunction<Context, Key extends keyof Context> = Extract<Context[Key], MaybeCallable>;
548
- export type KeysAllowingUndefined<State> = {
549
- [Key in keyof State]-?: undefined extends State[Key] ? Key : never;
550
- }[keyof State];
551
- export type ObserveSelector<State> = (state: State) => any;
552
- export type SelectorFunction<State> = (state: State, ...args: any[]) => any;
553
- type Tail$1<T extends readonly any[]> = T extends readonly [
554
- any,
555
- ...infer Rest
556
- ] ? Rest : [
557
- ];
558
- type SelectorArgs$1<Selector> = Selector extends ((...params: infer Params) => any) ? Tail$1<Params> : never;
559
- declare class PopupTriggerMap {
560
- private elementsSet;
561
- private idMap;
562
- constructor();
563
- /**
564
- * Adds a trigger element with the given ID.
565
- *
566
- * Note: The provided element is assumed to not be registered under multiple IDs.
567
- */
568
- add(id: string, element: Element): void;
569
- /**
570
- * Removes the trigger element with the given ID.
571
- */
572
- delete(id: string): void;
573
- /**
574
- * Whether the given element is registered as a trigger.
575
- */
576
- hasElement(element: Element): boolean;
577
- /**
578
- * Whether there is a registered trigger element matching the given predicate.
579
- */
580
- hasMatchingElement(predicate: (el: Element) => boolean): boolean;
581
- /**
582
- * Returns the trigger element associated with the given ID, or undefined if no such element exists.
583
- */
584
- getById(id: string): Element | undefined;
585
- /**
586
- * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
587
- */
588
- entries(): IterableIterator<[
589
- string,
590
- Element
591
- ]>;
592
- /**
593
- * Returns an iterable of all registered trigger elements.
594
- */
595
- elements(): IterableIterator<Element>;
596
- /**
597
- * Returns the number of registered trigger elements.
598
- */
599
- get size(): number;
600
- }
601
- /**
602
- * State common to all popup stores.
603
- */
604
- export type PopupStoreState<Payload> = {
605
- /**
606
- * Whether the popup is open (internal state).
607
- */
608
- open: boolean;
609
- /**
610
- * Whether the popup is open (external prop).
611
- */
612
- readonly openProp: boolean | undefined;
613
- /**
614
- * Whether the popup should be mounted in the DOM.
615
- * This usually follows `open` but can be different during exit transitions.
616
- */
617
- mounted: boolean;
618
- /**
619
- * The current enter/exit transition status of the popup.
620
- */
621
- transitionStatus: TransitionStatus;
622
- floatingRootContext: FloatingRootContext;
623
- floatingId: string | undefined;
624
- /**
625
- * Number of trigger elements currently registered for this popup.
626
- */
627
- triggerCount: number;
628
- /**
629
- * Whether to prevent unmounting the popup when closed.
630
- * Useful for interacting with JS animation libraries that control unmounting themselves.
631
- */
632
- preventUnmountingOnClose: boolean;
633
- /**
634
- * Optional payload set by the trigger.
635
- */
636
- payload: Payload | undefined;
637
- /**
638
- * ID of the currently active trigger.
639
- */
640
- activeTriggerId: string | null;
641
- /**
642
- * The currently active trigger DOM element.
643
- */
644
- activeTriggerElement: Element | null;
645
- /**
646
- * ID of the trigger (external prop).
647
- */
648
- readonly triggerIdProp: string | null | undefined;
649
- /**
650
- * The popup DOM element.
651
- */
652
- popupElement: HTMLElement | null;
653
- /**
654
- * The positioner DOM element.
655
- */
656
- positionerElement: HTMLElement | null;
657
- /**
658
- * Props to spread onto the active trigger element.
659
- */
660
- activeTriggerProps: HTMLProps;
661
- /**
662
- * Props to spread onto inactive trigger elements.
663
- */
664
- inactiveTriggerProps: HTMLProps;
665
- /**
666
- * Props to spread onto the popup element.
667
- */
668
- popupProps: HTMLProps;
669
- };
670
- export type PopupStoreContext<ChangeEventDetails> = {
671
- /**
672
- * Map of registered trigger elements.
673
- */
674
- readonly triggerElements: PopupTriggerMap;
675
- /**
676
- * Reference to the popup element.
677
- */
678
- readonly popupRef: React$1.RefObject<HTMLElement | null>;
679
- /**
680
- * Callback fired when the open state changes.
681
- */
682
- onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
683
- /**
684
- * Callback fired when the open state change animation completes.
685
- */
686
- onOpenChangeComplete: ((open: boolean) => void) | undefined;
687
- };
688
- export type PayloadChildRenderFunction<Payload> = (arg: {
689
- payload: Payload | undefined;
690
- }) => React$1.ReactNode;
691
- export interface FloatingRootState {
692
- open: boolean;
693
- transitionStatus: TransitionStatus | undefined;
694
- domReferenceElement: Element | null;
695
- referenceElement: ReferenceType$1 | null;
696
- floatingElement: HTMLElement | null;
697
- positionReference: ReferenceType$1 | null;
698
- /**
699
- * The ID of the floating element.
700
- */
701
- floatingId: string | undefined;
702
- }
703
- export interface FloatingRootStoreContext {
704
- onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
705
- readonly dataRef: React$1.RefObject<ContextData>;
706
- readonly events: FloatingEvents;
707
- nested: boolean;
708
- readonly triggerElements: PopupTriggerMap;
709
- }
710
- declare const selectors: {
711
- open: (state: FloatingRootState) => boolean;
712
- transitionStatus: (state: FloatingRootState) => TransitionStatus;
713
- domReferenceElement: (state: FloatingRootState) => Element | null;
714
- referenceElement: (state: FloatingRootState) => ReferenceType$1 | null;
715
- floatingElement: (state: FloatingRootState) => HTMLElement | null;
716
- floatingId: (state: FloatingRootState) => string | undefined;
717
- };
718
- export interface FloatingRootStoreOptions {
719
- open: boolean;
720
- transitionStatus: TransitionStatus | undefined;
721
- referenceElement: ReferenceType$1 | null;
722
- floatingElement: HTMLElement | null;
723
- triggerElements: PopupTriggerMap;
724
- floatingId: string | undefined;
725
- /**
726
- * When true, `setOpen` only forwards to `onOpenChange`.
727
- * The popup store owns `dispatchOpenChange(...)` in this mode.
728
- */
729
- syncOnly: boolean;
730
- nested: boolean;
731
- onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
732
- }
733
- declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
734
- private readonly syncOnly;
735
- constructor(options: FloatingRootStoreOptions);
736
- /**
737
- * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
738
- */
739
- syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
740
- /**
741
- * Runs the root-owned side effects for an open state change.
742
- */
743
- dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
744
- /**
745
- * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
746
- *
747
- * @param newOpen The new open state.
748
- * @param eventDetails Details about the event that triggered the open state change.
749
- */
750
- setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
751
- }
752
- export interface UseRenderElementComponentProps<State> {
753
- /**
754
- * The class name to apply to the rendered element.
755
- * Can be a string or a function that accepts the state and returns a string.
756
- */
757
- className?: string | ((state: State) => string | undefined) | undefined;
758
- /**
759
- * The render prop or React element to override the default element.
760
- */
761
- render?: undefined | React$1.ReactElement | ComponentRenderFn<React$1.HTMLAttributes<any>, State>;
762
- /**
763
- * The style to apply to the rendered element.
764
- * Can be a style object or a function that accepts the state and returns a style object.
765
- */
766
- style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
767
- }
768
- export interface UseFloatingPortalNodeProps {
769
- ref?: React$1.Ref<HTMLDivElement> | undefined;
770
- container?: HTMLElement | ShadowRoot | null | React$1.RefObject<HTMLElement | ShadowRoot | null> | undefined;
771
- componentProps?: UseRenderElementComponentProps<any> | undefined;
772
- elementProps?: React$1.HTMLAttributes<HTMLDivElement> | undefined;
773
- }
774
- declare const FloatingPortal: React$1.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
775
- renderGuards?: boolean | undefined;
776
- }, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
777
- export interface FloatingPortalState {
778
- }
779
- declare namespace FloatingPortal {
780
- type State = FloatingPortalState;
781
- interface Props<TState> extends BaseUIComponentProps<"div", TState> {
782
- /**
783
- * A parent element to render the portal element into.
784
- */
785
- container?: UseFloatingPortalNodeProps["container"] | undefined;
786
- }
787
- }
788
- export type NarrowedElement<T> = T extends Element ? T : Element;
789
- export interface ExtendedRefs {
790
- reference: React$1.RefObject<ReferenceType$1 | null>;
791
- floating: React$1.RefObject<HTMLElement | null>;
792
- domReference: React$1.RefObject<NarrowedElement<ReferenceType$1> | null>;
793
- setReference(node: ReferenceType$1 | null): void;
794
- setFloating(node: HTMLElement | null): void;
795
- setPositionReference(node: ReferenceType$1 | null): void;
796
- }
797
- export interface ExtendedElements {
798
- reference: ReferenceType$1 | null;
799
- floating: HTMLElement | null;
800
- domReference: NarrowedElement<ReferenceType$1> | null;
801
- }
802
- export interface FloatingEvents {
803
- emit<T extends string>(event: T, data?: any): void;
804
- on(event: string, handler: (data: any) => void): void;
805
- off(event: string, handler: (data: any) => void): void;
806
- }
807
- export interface ContextData {
808
- openEvent?: Event | undefined;
809
- floatingContext?: FloatingContext | undefined;
810
- [key: string]: any;
811
- }
812
- export type FloatingRootContext = FloatingRootStore;
813
- export type FloatingContext = Omit<UseFloatingReturn<ReferenceType$1>, "refs" | "elements"> & {
814
- open: boolean;
815
- onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
816
- events: FloatingEvents;
817
- dataRef: React$1.RefObject<ContextData>;
818
- nodeId: string | undefined;
819
- floatingId: string | undefined;
820
- refs: ExtendedRefs;
821
- elements: ExtendedElements;
822
- rootStore: FloatingRootContext;
823
- };
824
- type ReferenceType$1 = Element | VirtualElement;
825
- /**
826
- * A portal element that moves the popup to a different part of the DOM.
827
- * By default, the portal element is appended to `<body>`.
828
- * Renders a `<div>` element.
829
- *
830
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
831
- */
832
- export declare const DialogPortal: React$1.ForwardRefExoticComponent<Omit<DialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
833
- export interface DialogPortalState {
834
- }
835
- export interface DialogPortalProps extends FloatingPortal.Props<DialogPortalState> {
836
- /**
837
- * Whether to keep the portal mounted in the DOM while the popup is hidden.
838
- * @default false
839
- */
840
- keepMounted?: boolean | undefined;
841
- /**
842
- * A parent element to render the portal element into.
843
- */
844
- container?: FloatingPortal.Props<DialogPortalState>["container"] | undefined;
845
- }
846
- export declare namespace DialogPortal {
847
- type State = DialogPortalState;
848
- type Props = DialogPortalProps;
849
- }
850
- /**
851
- * A heading that labels the dialog.
852
- * Renders an `<h2>` element.
853
- *
854
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
855
- */
856
- export declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogTitleProps, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
857
- export interface DialogTitleProps extends BaseUIComponentProps<"h2", DialogTitleState> {
858
- }
859
- export interface DialogTitleState {
860
- }
861
- export declare namespace DialogTitle {
862
- type Props = DialogTitleProps;
863
- type State = DialogTitleState;
864
- }
865
- /**
866
- * A button that opens the dialog.
867
- * Renders a `<button>` element.
868
- *
869
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
870
- */
871
- export declare const DialogTrigger: DialogTrigger;
872
- export interface DialogTrigger {
873
- <Payload>(componentProps: DialogTriggerProps<Payload> & React$1.RefAttributes<HTMLElement>): React$1.JSX.Element;
874
- }
875
- export interface DialogTriggerProps<Payload = unknown> extends NativeButtonProps, BaseUIComponentProps<"button", DialogTriggerState> {
876
- /**
877
- * A handle to associate the trigger with a dialog.
878
- * Can be created with the Dialog.createHandle() method.
879
- */
880
- handle?: DialogHandle<Payload> | undefined;
881
- /**
882
- * A payload to pass to the dialog when it is opened.
883
- */
884
- payload?: Payload | undefined;
885
- /**
886
- * ID of the trigger. In addition to being forwarded to the rendered element,
887
- * it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot `triggerId` prop).
888
- */
889
- id?: string | undefined;
890
- }
891
- export interface DialogTriggerState {
892
- /**
893
- * Whether the dialog is currently disabled.
894
- */
895
- disabled: boolean;
896
- /**
897
- * Whether the dialog is currently open.
898
- */
899
- open: boolean;
900
- }
901
- export declare namespace DialogTrigger {
902
- type Props<Payload = unknown> = DialogTriggerProps<Payload>;
903
- type State = DialogTriggerState;
904
- }
905
- /**
906
- * A positioning container for the dialog popup that can be made scrollable.
907
- * Renders a `<div>` element.
908
- *
909
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
910
- */
911
- export declare const DialogViewport: React$1.ForwardRefExoticComponent<Omit<DialogViewportProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
912
- export interface DialogViewportState {
913
- /**
914
- * Whether the dialog is currently open.
915
- */
916
- open: boolean;
917
- /**
918
- * The transition status of the component.
919
- */
920
- transitionStatus: TransitionStatus;
921
- /**
922
- * Whether the dialog is nested within another dialog.
923
- */
924
- nested: boolean;
925
- /**
926
- * Whether the dialog has nested dialogs open.
927
- */
928
- nestedDialogOpen: boolean;
929
- }
930
- export interface DialogViewportProps extends BaseUIComponentProps<"div", DialogViewportState> {
931
- }
932
- export declare namespace DialogViewport {
933
- type State = DialogViewportState;
934
- type Props = DialogViewportProps;
935
- }
936
- export type State<Payload> = PopupStoreState<Payload> & {
937
- modal: boolean | "trap-focus";
938
- disablePointerDismissal: boolean;
939
- openMethod: InteractionType | null;
940
- nested: boolean;
941
- nestedOpenDialogCount: number;
942
- nestedOpenDrawerCount: number;
943
- titleElementId: string | undefined;
944
- descriptionElementId: string | undefined;
945
- viewportElement: HTMLElement | null;
946
- role: "dialog" | "alertdialog";
947
- };
948
- export type Context = PopupStoreContext<DialogRoot.ChangeEventDetails> & {
949
- readonly popupRef: React$1.RefObject<HTMLElement | null>;
950
- readonly backdropRef: React$1.RefObject<HTMLDivElement | null>;
951
- readonly internalBackdropRef: React$1.RefObject<HTMLDivElement | null>;
952
- readonly outsidePressEnabledRef: React$1.MutableRefObject<boolean>;
953
- readonly onNestedDialogOpen?: ((dialogCount: number, drawerCount: number) => void) | undefined;
954
- readonly onNestedDialogClose?: (() => void) | undefined;
955
- };
956
- declare const selectors$1: {
957
- modal: (state: State<unknown>) => boolean | "trap-focus";
958
- nested: (state: State<unknown>) => boolean;
959
- nestedOpenDialogCount: (state: State<unknown>) => number;
960
- nestedOpenDrawerCount: (state: State<unknown>) => number;
961
- disablePointerDismissal: (state: State<unknown>) => boolean;
962
- openMethod: (state: State<unknown>) => InteractionType | null;
963
- descriptionElementId: (state: State<unknown>) => string | undefined;
964
- titleElementId: (state: State<unknown>) => string | undefined;
965
- viewportElement: (state: State<unknown>) => HTMLElement | null;
966
- role: (state: State<unknown>) => "dialog" | "alertdialog";
967
- open: (state: {
968
- open: boolean;
969
- readonly openProp: boolean | undefined;
970
- mounted: boolean;
971
- transitionStatus: TransitionStatus;
972
- floatingRootContext: FloatingRootContext;
973
- floatingId: string | undefined;
974
- triggerCount: number;
975
- preventUnmountingOnClose: boolean;
976
- payload: unknown;
977
- activeTriggerId: string | null;
978
- activeTriggerElement: Element | null;
979
- readonly triggerIdProp: string | null | undefined;
980
- popupElement: HTMLElement | null;
981
- positionerElement: HTMLElement | null;
982
- activeTriggerProps: HTMLProps;
983
- inactiveTriggerProps: HTMLProps;
984
- popupProps: HTMLProps;
985
- }) => boolean;
986
- mounted: (state: {
987
- open: boolean;
988
- readonly openProp: boolean | undefined;
989
- mounted: boolean;
990
- transitionStatus: TransitionStatus;
991
- floatingRootContext: FloatingRootContext;
992
- floatingId: string | undefined;
993
- triggerCount: number;
994
- preventUnmountingOnClose: boolean;
995
- payload: unknown;
996
- activeTriggerId: string | null;
997
- activeTriggerElement: Element | null;
998
- readonly triggerIdProp: string | null | undefined;
999
- popupElement: HTMLElement | null;
1000
- positionerElement: HTMLElement | null;
1001
- activeTriggerProps: HTMLProps;
1002
- inactiveTriggerProps: HTMLProps;
1003
- popupProps: HTMLProps;
1004
- }) => boolean;
1005
- transitionStatus: (state: {
1006
- open: boolean;
1007
- readonly openProp: boolean | undefined;
1008
- mounted: boolean;
1009
- transitionStatus: TransitionStatus;
1010
- floatingRootContext: FloatingRootContext;
1011
- floatingId: string | undefined;
1012
- triggerCount: number;
1013
- preventUnmountingOnClose: boolean;
1014
- payload: unknown;
1015
- activeTriggerId: string | null;
1016
- activeTriggerElement: Element | null;
1017
- readonly triggerIdProp: string | null | undefined;
1018
- popupElement: HTMLElement | null;
1019
- positionerElement: HTMLElement | null;
1020
- activeTriggerProps: HTMLProps;
1021
- inactiveTriggerProps: HTMLProps;
1022
- popupProps: HTMLProps;
1023
- }) => TransitionStatus;
1024
- floatingRootContext: (state: {
1025
- open: boolean;
1026
- readonly openProp: boolean | undefined;
1027
- mounted: boolean;
1028
- transitionStatus: TransitionStatus;
1029
- floatingRootContext: FloatingRootContext;
1030
- floatingId: string | undefined;
1031
- triggerCount: number;
1032
- preventUnmountingOnClose: boolean;
1033
- payload: unknown;
1034
- activeTriggerId: string | null;
1035
- activeTriggerElement: Element | null;
1036
- readonly triggerIdProp: string | null | undefined;
1037
- popupElement: HTMLElement | null;
1038
- positionerElement: HTMLElement | null;
1039
- activeTriggerProps: HTMLProps;
1040
- inactiveTriggerProps: HTMLProps;
1041
- popupProps: HTMLProps;
1042
- }) => FloatingRootStore;
1043
- triggerCount: (state: {
1044
- open: boolean;
1045
- readonly openProp: boolean | undefined;
1046
- mounted: boolean;
1047
- transitionStatus: TransitionStatus;
1048
- floatingRootContext: FloatingRootContext;
1049
- floatingId: string | undefined;
1050
- triggerCount: number;
1051
- preventUnmountingOnClose: boolean;
1052
- payload: unknown;
1053
- activeTriggerId: string | null;
1054
- activeTriggerElement: Element | null;
1055
- readonly triggerIdProp: string | null | undefined;
1056
- popupElement: HTMLElement | null;
1057
- positionerElement: HTMLElement | null;
1058
- activeTriggerProps: HTMLProps;
1059
- inactiveTriggerProps: HTMLProps;
1060
- popupProps: HTMLProps;
1061
- }) => number;
1062
- preventUnmountingOnClose: (state: {
1063
- open: boolean;
1064
- readonly openProp: boolean | undefined;
1065
- mounted: boolean;
1066
- transitionStatus: TransitionStatus;
1067
- floatingRootContext: FloatingRootContext;
1068
- floatingId: string | undefined;
1069
- triggerCount: number;
1070
- preventUnmountingOnClose: boolean;
1071
- payload: unknown;
1072
- activeTriggerId: string | null;
1073
- activeTriggerElement: Element | null;
1074
- readonly triggerIdProp: string | null | undefined;
1075
- popupElement: HTMLElement | null;
1076
- positionerElement: HTMLElement | null;
1077
- activeTriggerProps: HTMLProps;
1078
- inactiveTriggerProps: HTMLProps;
1079
- popupProps: HTMLProps;
1080
- }) => boolean;
1081
- payload: (state: {
1082
- open: boolean;
1083
- readonly openProp: boolean | undefined;
1084
- mounted: boolean;
1085
- transitionStatus: TransitionStatus;
1086
- floatingRootContext: FloatingRootContext;
1087
- floatingId: string | undefined;
1088
- triggerCount: number;
1089
- preventUnmountingOnClose: boolean;
1090
- payload: unknown;
1091
- activeTriggerId: string | null;
1092
- activeTriggerElement: Element | null;
1093
- readonly triggerIdProp: string | null | undefined;
1094
- popupElement: HTMLElement | null;
1095
- positionerElement: HTMLElement | null;
1096
- activeTriggerProps: HTMLProps;
1097
- inactiveTriggerProps: HTMLProps;
1098
- popupProps: HTMLProps;
1099
- }) => unknown;
1100
- activeTriggerId: (state: {
1101
- open: boolean;
1102
- readonly openProp: boolean | undefined;
1103
- mounted: boolean;
1104
- transitionStatus: TransitionStatus;
1105
- floatingRootContext: FloatingRootContext;
1106
- floatingId: string | undefined;
1107
- triggerCount: number;
1108
- preventUnmountingOnClose: boolean;
1109
- payload: unknown;
1110
- activeTriggerId: string | null;
1111
- activeTriggerElement: Element | null;
1112
- readonly triggerIdProp: string | null | undefined;
1113
- popupElement: HTMLElement | null;
1114
- positionerElement: HTMLElement | null;
1115
- activeTriggerProps: HTMLProps;
1116
- inactiveTriggerProps: HTMLProps;
1117
- popupProps: HTMLProps;
1118
- }) => string | null;
1119
- activeTriggerElement: (state: {
1120
- open: boolean;
1121
- readonly openProp: boolean | undefined;
1122
- mounted: boolean;
1123
- transitionStatus: TransitionStatus;
1124
- floatingRootContext: FloatingRootContext;
1125
- floatingId: string | undefined;
1126
- triggerCount: number;
1127
- preventUnmountingOnClose: boolean;
1128
- payload: unknown;
1129
- activeTriggerId: string | null;
1130
- activeTriggerElement: Element | null;
1131
- readonly triggerIdProp: string | null | undefined;
1132
- popupElement: HTMLElement | null;
1133
- positionerElement: HTMLElement | null;
1134
- activeTriggerProps: HTMLProps;
1135
- inactiveTriggerProps: HTMLProps;
1136
- popupProps: HTMLProps;
1137
- }) => Element | null;
1138
- popupId: (state: {
1139
- open: boolean;
1140
- readonly openProp: boolean | undefined;
1141
- mounted: boolean;
1142
- transitionStatus: TransitionStatus;
1143
- floatingRootContext: FloatingRootContext;
1144
- floatingId: string | undefined;
1145
- triggerCount: number;
1146
- preventUnmountingOnClose: boolean;
1147
- payload: unknown;
1148
- activeTriggerId: string | null;
1149
- activeTriggerElement: Element | null;
1150
- readonly triggerIdProp: string | null | undefined;
1151
- popupElement: HTMLElement | null;
1152
- positionerElement: HTMLElement | null;
1153
- activeTriggerProps: HTMLProps;
1154
- inactiveTriggerProps: HTMLProps;
1155
- popupProps: HTMLProps;
1156
- }) => string | undefined;
1157
- isTriggerActive: (state: {
1158
- open: boolean;
1159
- readonly openProp: boolean | undefined;
1160
- mounted: boolean;
1161
- transitionStatus: TransitionStatus;
1162
- floatingRootContext: FloatingRootContext;
1163
- floatingId: string | undefined;
1164
- triggerCount: number;
1165
- preventUnmountingOnClose: boolean;
1166
- payload: unknown;
1167
- activeTriggerId: string | null;
1168
- activeTriggerElement: Element | null;
1169
- readonly triggerIdProp: string | null | undefined;
1170
- popupElement: HTMLElement | null;
1171
- positionerElement: HTMLElement | null;
1172
- activeTriggerProps: HTMLProps;
1173
- inactiveTriggerProps: HTMLProps;
1174
- popupProps: HTMLProps;
1175
- }, triggerId: string | undefined) => boolean;
1176
- isOpenedByTrigger: (state: {
1177
- open: boolean;
1178
- readonly openProp: boolean | undefined;
1179
- mounted: boolean;
1180
- transitionStatus: TransitionStatus;
1181
- floatingRootContext: FloatingRootContext;
1182
- floatingId: string | undefined;
1183
- triggerCount: number;
1184
- preventUnmountingOnClose: boolean;
1185
- payload: unknown;
1186
- activeTriggerId: string | null;
1187
- activeTriggerElement: Element | null;
1188
- readonly triggerIdProp: string | null | undefined;
1189
- popupElement: HTMLElement | null;
1190
- positionerElement: HTMLElement | null;
1191
- activeTriggerProps: HTMLProps;
1192
- inactiveTriggerProps: HTMLProps;
1193
- popupProps: HTMLProps;
1194
- }, triggerId: string | undefined) => boolean;
1195
- isMountedByTrigger: (state: {
1196
- open: boolean;
1197
- readonly openProp: boolean | undefined;
1198
- mounted: boolean;
1199
- transitionStatus: TransitionStatus;
1200
- floatingRootContext: FloatingRootContext;
1201
- floatingId: string | undefined;
1202
- triggerCount: number;
1203
- preventUnmountingOnClose: boolean;
1204
- payload: unknown;
1205
- activeTriggerId: string | null;
1206
- activeTriggerElement: Element | null;
1207
- readonly triggerIdProp: string | null | undefined;
1208
- popupElement: HTMLElement | null;
1209
- positionerElement: HTMLElement | null;
1210
- activeTriggerProps: HTMLProps;
1211
- inactiveTriggerProps: HTMLProps;
1212
- popupProps: HTMLProps;
1213
- }, triggerId: string | undefined) => boolean;
1214
- triggerProps: (state: {
1215
- open: boolean;
1216
- readonly openProp: boolean | undefined;
1217
- mounted: boolean;
1218
- transitionStatus: TransitionStatus;
1219
- floatingRootContext: FloatingRootContext;
1220
- floatingId: string | undefined;
1221
- triggerCount: number;
1222
- preventUnmountingOnClose: boolean;
1223
- payload: unknown;
1224
- activeTriggerId: string | null;
1225
- activeTriggerElement: Element | null;
1226
- readonly triggerIdProp: string | null | undefined;
1227
- popupElement: HTMLElement | null;
1228
- positionerElement: HTMLElement | null;
1229
- activeTriggerProps: HTMLProps;
1230
- inactiveTriggerProps: HTMLProps;
1231
- popupProps: HTMLProps;
1232
- }, isActive: boolean) => HTMLProps;
1233
- triggerPopupId: (state: {
1234
- open: boolean;
1235
- readonly openProp: boolean | undefined;
1236
- mounted: boolean;
1237
- transitionStatus: TransitionStatus;
1238
- floatingRootContext: FloatingRootContext;
1239
- floatingId: string | undefined;
1240
- triggerCount: number;
1241
- preventUnmountingOnClose: boolean;
1242
- payload: unknown;
1243
- activeTriggerId: string | null;
1244
- activeTriggerElement: Element | null;
1245
- readonly triggerIdProp: string | null | undefined;
1246
- popupElement: HTMLElement | null;
1247
- positionerElement: HTMLElement | null;
1248
- activeTriggerProps: HTMLProps;
1249
- inactiveTriggerProps: HTMLProps;
1250
- popupProps: HTMLProps;
1251
- }, triggerId: string | undefined) => string | undefined;
1252
- popupProps: (state: {
1253
- open: boolean;
1254
- readonly openProp: boolean | undefined;
1255
- mounted: boolean;
1256
- transitionStatus: TransitionStatus;
1257
- floatingRootContext: FloatingRootContext;
1258
- floatingId: string | undefined;
1259
- triggerCount: number;
1260
- preventUnmountingOnClose: boolean;
1261
- payload: unknown;
1262
- activeTriggerId: string | null;
1263
- activeTriggerElement: Element | null;
1264
- readonly triggerIdProp: string | null | undefined;
1265
- popupElement: HTMLElement | null;
1266
- positionerElement: HTMLElement | null;
1267
- activeTriggerProps: HTMLProps;
1268
- inactiveTriggerProps: HTMLProps;
1269
- popupProps: HTMLProps;
1270
- }) => HTMLProps;
1271
- popupElement: (state: {
1272
- open: boolean;
1273
- readonly openProp: boolean | undefined;
1274
- mounted: boolean;
1275
- transitionStatus: TransitionStatus;
1276
- floatingRootContext: FloatingRootContext;
1277
- floatingId: string | undefined;
1278
- triggerCount: number;
1279
- preventUnmountingOnClose: boolean;
1280
- payload: unknown;
1281
- activeTriggerId: string | null;
1282
- activeTriggerElement: Element | null;
1283
- readonly triggerIdProp: string | null | undefined;
1284
- popupElement: HTMLElement | null;
1285
- positionerElement: HTMLElement | null;
1286
- activeTriggerProps: HTMLProps;
1287
- inactiveTriggerProps: HTMLProps;
1288
- popupProps: HTMLProps;
1289
- }) => HTMLElement | null;
1290
- positionerElement: (state: {
1291
- open: boolean;
1292
- readonly openProp: boolean | undefined;
1293
- mounted: boolean;
1294
- transitionStatus: TransitionStatus;
1295
- floatingRootContext: FloatingRootContext;
1296
- floatingId: string | undefined;
1297
- triggerCount: number;
1298
- preventUnmountingOnClose: boolean;
1299
- payload: unknown;
1300
- activeTriggerId: string | null;
1301
- activeTriggerElement: Element | null;
1302
- readonly triggerIdProp: string | null | undefined;
1303
- popupElement: HTMLElement | null;
1304
- positionerElement: HTMLElement | null;
1305
- activeTriggerProps: HTMLProps;
1306
- inactiveTriggerProps: HTMLProps;
1307
- popupProps: HTMLProps;
1308
- }) => HTMLElement | null;
1309
- };
1310
- declare class DialogStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, typeof selectors$1> {
1311
- constructor(initialState?: Partial<State<Payload>>, floatingId?: string | undefined, nested?: boolean);
1312
- setOpen: (nextOpen: boolean, eventDetails: Omit<DialogRoot.ChangeEventDetails, "preventUnmountOnClose">) => void;
1313
- static useStore<Payload>(externalStore: DialogStore<Payload> | undefined, initialState?: Partial<State<Payload>>): DialogStore<Payload>;
1314
- }
1315
- declare class DialogHandle<Payload> {
1316
- /**
1317
- * Internal store holding the dialog state.
1318
- * @internal
1319
- */
1320
- readonly store: DialogStore<Payload>;
1321
- constructor(store?: DialogStore<Payload>);
1322
- /**
1323
- * Opens the dialog and associates it with the trigger with the given id.
1324
- * The trigger, if provided, must be a matching Trigger component with this handle passed as a prop.
1325
- *
1326
- * This method should only be called in an event handler or an effect (not during rendering).
1327
- *
1328
- * @param triggerId ID of the trigger to associate with the dialog. If null, the dialog will open without a trigger association.
1329
- */
1330
- open(triggerId: string | null): void;
1331
- /**
1332
- * Opens the dialog and sets the payload.
1333
- * Does not associate the dialog with any trigger.
1334
- *
1335
- * @param payload Payload to set when opening the dialog.
1336
- */
1337
- openWithPayload(payload: Payload): void;
1338
- /**
1339
- * Closes the dialog.
1340
- */
1341
- close(): void;
1342
- /**
1343
- * Indicates whether the dialog is currently open.
1344
- */
1345
- get isOpen(): boolean;
1346
- }
1347
- declare function createDialogHandle<Payload>(): DialogHandle<Payload>;
1348
- /**
1349
- * Groups all parts of the dialog.
1350
- * Doesn't render its own HTML element.
1351
- *
1352
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
1353
- */
1354
- export declare function DialogRoot<Payload>(props: DialogRoot.Props<Payload>): import("react/jsx-runtime").React$1.JSX.Element;
1355
- export interface DialogRootState {
1356
- }
1357
- export interface DialogRootProps<Payload = unknown> {
1358
- /**
1359
- * Whether the dialog is currently open.
1360
- */
1361
- open?: boolean | undefined;
1362
- /**
1363
- * Whether the dialog is initially open.
1364
- *
1365
- * To render a controlled dialog, use the `open` prop instead.
1366
- * @default false
1367
- */
1368
- defaultOpen?: boolean | undefined;
1369
- /**
1370
- * Determines if the dialog enters a modal state when open.
1371
- * - `true`: user interaction is limited to just the dialog: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled.
1372
- * - `false`: user interaction with the rest of the document is allowed.
1373
- * - `'trap-focus'`: focus is trapped inside the dialog, but document page scroll is not locked and pointer interactions outside of it remain enabled.
1374
- *
1375
- * When `modal` is `true` or `'trap-focus'`, render `<Dialog.Close>` inside `<Dialog.Popup>` so
1376
- * touch screen readers can escape the popup.
1377
- * @default true
1378
- */
1379
- modal?: boolean | "trap-focus" | undefined;
1380
- /**
1381
- * Event handler called when the dialog is opened or closed.
1382
- */
1383
- onOpenChange?: ((open: boolean, eventDetails: DialogRoot.ChangeEventDetails) => void) | undefined;
1384
- /**
1385
- * Event handler called after any animations complete when the dialog is opened or closed.
1386
- */
1387
- onOpenChangeComplete?: ((open: boolean) => void) | undefined;
1388
- /**
1389
- * Determines whether the dialog should close on outside clicks.
1390
- * @default false
1391
- */
1392
- disablePointerDismissal?: boolean | undefined;
1393
- /**
1394
- * A ref to imperative actions.
1395
- * - `unmount`: When specified, the dialog will not be unmounted when closed.
1396
- * Instead, the `unmount` function must be called to unmount the dialog manually.
1397
- * Useful when the dialog's animation is controlled by an external library.
1398
- * - `close`: Closes the dialog imperatively when called.
1399
- */
1400
- actionsRef?: React$1.RefObject<DialogRoot.Actions | null> | undefined;
1401
- /**
1402
- * A handle to associate the dialog with a trigger.
1403
- * If specified, allows external triggers to control the dialog's open state.
1404
- * Can be created with the Dialog.createHandle() method.
1405
- */
1406
- handle?: DialogHandle<Payload> | undefined;
1407
- /**
1408
- * The content of the dialog.
1409
- * This can be a regular React node or a render function that receives the `payload` of the active trigger.
1410
- */
1411
- children?: React$1.ReactNode | PayloadChildRenderFunction<Payload>;
1412
- /**
1413
- * ID of the trigger that the dialog is associated with.
1414
- * This is useful in conjunction with the `open` prop to create a controlled dialog.
1415
- * There's no need to specify this prop when the dialog is uncontrolled (that is, when the `open` prop is not set).
1416
- */
1417
- triggerId?: string | null | undefined;
1418
- /**
1419
- * ID of the trigger that the dialog is associated with.
1420
- * This is useful in conjunction with the `defaultOpen` prop to create an initially open dialog.
1421
- */
1422
- defaultTriggerId?: string | null | undefined;
1423
- }
1424
- export interface DialogRootActions {
1425
- unmount: () => void;
1426
- close: () => void;
1427
- }
1428
- export type DialogRootChangeEventReason = typeof triggerPress | typeof outsidePress | typeof escapeKey | typeof closePress | typeof focusOut | typeof imperativeAction | typeof none;
1429
- export type DialogRootChangeEventDetails = BaseUIChangeEventDetails<DialogRoot.ChangeEventReason> & {
1430
- preventUnmountOnClose(): void;
1431
- };
1432
- export declare namespace DialogRoot {
1433
- type State = DialogRootState;
1434
- type Props<Payload = unknown> = DialogRootProps<Payload>;
1435
- type Actions = DialogRootActions;
1436
- type ChangeEventReason = DialogRootChangeEventReason;
1437
- type ChangeEventDetails = DialogRootChangeEventDetails;
1438
- }
1439
-
1440
- declare namespace Dialog {
1441
- export { DialogBackdrop as Backdrop, DialogClose as Close, DialogDescription as Description, DialogHandle as Handle, DialogPopup as Popup, DialogPortal as Portal, DialogRoot as Root, DialogTitle as Title, DialogTrigger as Trigger, DialogViewport as Viewport, createDialogHandle as createHandle };
1442
- }
1443
-
1444
- export {
1445
- Dialog,
1446
- };
1447
-
1448
- export {};