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