@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,2213 +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 declare type AlignedPlacement = `${Side}-${Alignment}`;
7
- export declare type Alignment = "start" | "end";
8
- export declare type Axis = "x" | "y";
9
- export declare type ClientRectObject = Prettify<Rect & SideObject>;
10
- export declare type Coords = {
11
- [key in Axis]: number;
12
- };
13
- export declare type Dimensions = {
14
- [key in Length]: number;
15
- };
16
- export declare type Length = "width" | "height";
17
- export declare type Padding = number | Prettify<Partial<SideObject>>;
18
- export declare type Placement = Prettify<Side | AlignedPlacement>;
19
- export declare type Prettify<T> = {
20
- [K in keyof T]: T[K];
21
- } & {};
22
- export declare type Rect = Prettify<Coords & Dimensions>;
23
- export declare type Side = "top" | "right" | "bottom" | "left";
24
- export declare type SideObject = {
25
- [key in Side]: number;
26
- };
27
- export declare type Strategy = "absolute" | "fixed";
28
- export declare interface ComputePositionReturn extends Coords {
29
- /**
30
- * The final chosen placement of the floating element.
31
- */
32
- placement: Placement;
33
- /**
34
- * The strategy used to position the floating element.
35
- */
36
- strategy: Strategy;
37
- /**
38
- * Object containing data returned from all middleware, keyed by their name.
39
- */
40
- middlewareData: MiddlewareData;
41
- }
42
- export declare interface MiddlewareData {
43
- [key: string]: any;
44
- arrow?: Partial<Coords> & {
45
- centerOffset: number;
46
- alignmentOffset?: number;
47
- };
48
- autoPlacement?: {
49
- index?: number;
50
- overflows: Array<{
51
- placement: Placement;
52
- overflows: Array<number>;
53
- }>;
54
- };
55
- flip?: {
56
- index?: number;
57
- overflows: Array<{
58
- placement: Placement;
59
- overflows: Array<number>;
60
- }>;
61
- };
62
- hide?: {
63
- referenceHidden?: boolean;
64
- escaped?: boolean;
65
- referenceHiddenOffsets?: SideObject;
66
- escapedOffsets?: SideObject;
67
- };
68
- offset?: Coords & {
69
- placement: Placement;
70
- };
71
- shift?: Coords & {
72
- enabled: {
73
- [key in Axis]: boolean;
74
- };
75
- };
76
- }
77
- /**
78
- * Custom positioning reference element.
79
- * @see https://floating-ui.com/docs/virtual-elements
80
- */
81
- export declare interface VirtualElement {
82
- getBoundingClientRect(): ClientRectObject;
83
- getClientRects?(): Array<ClientRectObject> | DOMRectList;
84
- contextElement?: Element;
85
- }
86
- declare type Prettify$1<T> = {
87
- [K in keyof T]: T[K];
88
- } & {};
89
- export declare type ReferenceType = Element | VirtualElement;
90
- export declare type UseFloatingData = Prettify$1<ComputePositionReturn & {
91
- isPositioned: boolean;
92
- }>;
93
- export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify$1<UseFloatingData & {
94
- /**
95
- * Update the position of the floating element, re-rendering the component
96
- * if required.
97
- */
98
- update: () => void;
99
- /**
100
- * Pre-configured positioning styles to apply to the floating element.
101
- */
102
- floatingStyles: React$1.CSSProperties;
103
- /**
104
- * Object containing the reference and floating refs and reactive setters.
105
- */
106
- refs: {
107
- /**
108
- * A React ref to the reference element.
109
- */
110
- reference: React$1.MutableRefObject<RT | null>;
111
- /**
112
- * A React ref to the floating element.
113
- */
114
- floating: React$1.MutableRefObject<HTMLElement | null>;
115
- /**
116
- * A callback to set the reference element (reactive).
117
- */
118
- setReference: (node: RT | null) => void;
119
- /**
120
- * A callback to set the floating element (reactive).
121
- */
122
- setFloating: (node: HTMLElement | null) => void;
123
- };
124
- /**
125
- * Object containing the reference and floating elements.
126
- */
127
- elements: {
128
- reference: RT | null;
129
- floating: HTMLElement | null;
130
- };
131
- }>;
132
- declare const none: "none";
133
- declare const triggerPress: "trigger-press";
134
- declare const triggerHover: "trigger-hover";
135
- declare const triggerFocus: "trigger-focus";
136
- declare const outsidePress: "outside-press";
137
- declare const itemPress: "item-press";
138
- declare const closePress: "close-press";
139
- declare const linkPress: "link-press";
140
- declare const clearPress: "clear-press";
141
- declare const chipRemovePress: "chip-remove-press";
142
- declare const trackPress: "track-press";
143
- declare const incrementPress: "increment-press";
144
- declare const decrementPress: "decrement-press";
145
- declare const inputChange: "input-change";
146
- declare const inputClear: "input-clear";
147
- declare const inputBlur: "input-blur";
148
- declare const inputPaste: "input-paste";
149
- declare const inputPress: "input-press";
150
- declare const focusOut: "focus-out";
151
- declare const escapeKey: "escape-key";
152
- declare const closeWatcher: "close-watcher";
153
- declare const listNavigation: "list-navigation";
154
- declare const keyboard: "keyboard";
155
- declare const pointer: "pointer";
156
- declare const drag: "drag";
157
- declare const wheel: "wheel";
158
- declare const scrub: "scrub";
159
- declare const cancelOpen: "cancel-open";
160
- declare const siblingOpen: "sibling-open";
161
- declare const disabled: "disabled";
162
- declare const missing: "missing";
163
- declare const initial: "initial";
164
- declare const imperativeAction: "imperative-action";
165
- declare const swipe: "swipe";
166
- declare const windowResize: "window-resize";
167
- export interface ReasonToEventMap {
168
- [none]: Event;
169
- [triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
170
- [triggerHover]: MouseEvent;
171
- [triggerFocus]: FocusEvent;
172
- [outsidePress]: MouseEvent | PointerEvent | TouchEvent;
173
- [itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
174
- [closePress]: MouseEvent | KeyboardEvent | PointerEvent;
175
- [linkPress]: MouseEvent | PointerEvent;
176
- [clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
177
- [chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
178
- [trackPress]: PointerEvent | MouseEvent | TouchEvent;
179
- [incrementPress]: PointerEvent | MouseEvent | TouchEvent;
180
- [decrementPress]: PointerEvent | MouseEvent | TouchEvent;
181
- [inputChange]: InputEvent | Event;
182
- [inputClear]: InputEvent | FocusEvent | Event;
183
- [inputBlur]: FocusEvent;
184
- [inputPaste]: ClipboardEvent;
185
- [inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
186
- [focusOut]: FocusEvent | KeyboardEvent;
187
- [escapeKey]: KeyboardEvent;
188
- [closeWatcher]: Event;
189
- [listNavigation]: KeyboardEvent;
190
- [keyboard]: KeyboardEvent;
191
- [pointer]: PointerEvent;
192
- [drag]: PointerEvent | TouchEvent;
193
- [swipe]: PointerEvent | TouchEvent;
194
- [wheel]: WheelEvent;
195
- [scrub]: PointerEvent;
196
- [cancelOpen]: MouseEvent;
197
- [siblingOpen]: Event;
198
- [disabled]: Event;
199
- [missing]: Event;
200
- [initial]: Event;
201
- [imperativeAction]: Event;
202
- [windowResize]: UIEvent;
203
- }
204
- /**
205
- * Maps a change `reason` string to the corresponding native event type.
206
- */
207
- export type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
208
- export type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
209
- /**
210
- * The reason for the event.
211
- */
212
- reason: Reason;
213
- /**
214
- * The native event associated with the custom event.
215
- */
216
- event: ReasonToEvent<Reason>;
217
- /**
218
- * Cancels Base UI from handling the event.
219
- */
220
- cancel: () => void;
221
- /**
222
- * Allows the event to propagate in cases where Base UI will stop the propagation.
223
- */
224
- allowPropagation: () => void;
225
- /**
226
- * Indicates whether the event has been canceled.
227
- */
228
- isCanceled: boolean;
229
- /**
230
- * Indicates whether the event is allowed to propagate.
231
- */
232
- isPropagationAllowed: boolean;
233
- /**
234
- * The element that triggered the event, if applicable.
235
- */
236
- trigger: Element | undefined;
237
- } & CustomProperties;
238
- /**
239
- * Details of custom change events emitted by Base UI components.
240
- */
241
- export type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
242
- declare class FloatingTreeStore {
243
- readonly nodesRef: React$1.RefObject<Array<FloatingNodeType>>;
244
- readonly events: FloatingEvents;
245
- addNode(node: FloatingNodeType): void;
246
- removeNode(node: FloatingNodeType): void;
247
- }
248
- export type Listener<T> = (state: T) => void;
249
- declare class Store<State> {
250
- /**
251
- * The current state of the store.
252
- * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
253
- * 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).
254
- * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
255
- *
256
- * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
257
- */
258
- state: State;
259
- private listeners;
260
- private updateTick;
261
- constructor(state: State);
262
- /**
263
- * Registers a listener that will be called whenever the store's state changes.
264
- *
265
- * @param fn The listener function to be called on state changes.
266
- * @returns A function to unsubscribe the listener.
267
- */
268
- subscribe: (fn: Listener<State>) => () => void;
269
- /**
270
- * Returns the current state of the store.
271
- */
272
- getSnapshot: () => State;
273
- /**
274
- * Updates the entire store's state and notifies all registered listeners.
275
- *
276
- * @param newState The new state to set for the store.
277
- */
278
- setState(newState: State): void;
279
- /**
280
- * Merges the provided changes into the current state and notifies listeners if there are changes.
281
- *
282
- * @param changes An object containing the changes to apply to the current state.
283
- */
284
- update(changes: Partial<State>): void;
285
- /**
286
- * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
287
- *
288
- * @param key The key in the store's state to update.
289
- * @param value The new value to set for the specified key.
290
- */
291
- set<T>(key: keyof State, value: T): void;
292
- /**
293
- * Gives the state a new reference and updates all registered listeners.
294
- */
295
- notifyAll(): void;
296
- use<F extends (...args: any) => any>(selector: F, ...args: SelectorArgs<F>): ReturnType<F>;
297
- }
298
- export type SelectorArgs<Selector> = Selector extends ((...params: infer Params) => any) ? Tail<Params> : never;
299
- export type Tail<T extends readonly any[]> = T extends readonly [
300
- any,
301
- ...infer Rest
302
- ] ? Rest : [
303
- ];
304
- declare class ReactStore<State extends object, Context = Record<string, never>, Selectors extends Record<string, SelectorFunction<State>> = Record<string, never>> extends Store<State> {
305
- /**
306
- * Creates a new ReactStore instance.
307
- *
308
- * @param state Initial state of the store.
309
- * @param context Non-reactive context values.
310
- * @param selectors Optional selectors for use with `useState`.
311
- */
312
- constructor(state: State, context?: Context, selectors?: Selectors);
313
- /**
314
- * Non-reactive values such as refs, callbacks, etc.
315
- */
316
- readonly context: Context;
317
- private selectors;
318
- /**
319
- * Synchronizes a single external value into the store.
320
- *
321
- * Note that the while the value in `state` is updated immediately, the value returned
322
- * by `useState` is updated before the next render (similarly to React's `useState`).
323
- */
324
- useSyncedValue<Key extends keyof State, Value extends State[Key]>(key: keyof State, value: Value): void;
325
- /**
326
- * Synchronizes a single external value into the store and
327
- * cleans it up (sets to `undefined`) on unmount.
328
- *
329
- * Note that the while the value in `state` is updated immediately, the value returned
330
- * by `useState` is updated before the next render (similarly to React's `useState`).
331
- */
332
- useSyncedValueWithCleanup<Key extends KeysAllowingUndefined<State>>(key: Key, value: State[Key]): void;
333
- /**
334
- * Synchronizes multiple external values into the store.
335
- *
336
- * Note that the while the values in `state` are updated immediately, the values returned
337
- * by `useState` are updated before the next render (similarly to React's `useState`).
338
- */
339
- useSyncedValues(statePart: Partial<State>): void;
340
- /**
341
- * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
342
- * is non-undefined, the store's state at `key` is updated to match `controlled`.
343
- */
344
- useControlledProp<Key extends keyof State, Value extends State[Key]>(key: keyof State, controlled: Value | undefined): void;
345
- /** Gets the current value from the store using a selector with the provided key.
346
- *
347
- * @param key Key of the selector to use.
348
- */
349
- select<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
350
- /**
351
- * Returns a value from the store's state using a selector function.
352
- * Used to subscribe to specific parts of the state.
353
- * This methods causes a rerender whenever the selected state changes.
354
- *
355
- * @param key Key of the selector to use.
356
- */
357
- useState<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
358
- /**
359
- * Wraps a function with `useStableCallback` to ensure it has a stable reference
360
- * and assigns it to the context.
361
- *
362
- * @param key Key of the event callback. Must be a function in the context.
363
- * @param fn Function to assign.
364
- */
365
- useContextCallback<Key extends ContextFunctionKeys<Context>>(key: Key, fn: ContextFunction<Context, Key> | undefined): void;
366
- /**
367
- * Returns a stable setter function for a specific key in the store's state.
368
- * It's commonly used to pass as a ref callback to React elements.
369
- *
370
- * @param key Key of the state to set.
371
- */
372
- useStateSetter<const Key extends keyof State, Value extends State[Key]>(key: keyof State): (v: Value) => void;
373
- /**
374
- * Observes changes derived from the store's selectors and calls the listener when the selected value changes.
375
- *
376
- * @param key Key of the selector to observe.
377
- * @param listener Listener function called when the selector result changes.
378
- */
379
- observe<Key extends keyof Selectors>(selector: Key, listener: (newValue: ReturnType<Selectors[Key]>, oldValue: ReturnType<Selectors[Key]>, store: this) => void): () => void;
380
- observe<Selector extends ObserveSelector<State>>(selector: Selector, listener: (newValue: ReturnType<Selector>, oldValue: ReturnType<Selector>, store: this) => void): () => void;
381
- }
382
- export type MaybeCallable = (...args: any[]) => any;
383
- export type ContextFunctionKeys<Context> = {
384
- [Key in keyof Context]-?: Extract<Context[Key], MaybeCallable> extends never ? never : Key;
385
- }[keyof Context];
386
- export type ContextFunction<Context, Key extends keyof Context> = Extract<Context[Key], MaybeCallable>;
387
- export type KeysAllowingUndefined<State> = {
388
- [Key in keyof State]-?: undefined extends State[Key] ? Key : never;
389
- }[keyof State];
390
- export type ObserveSelector<State> = (state: State) => any;
391
- export type SelectorFunction<State> = (state: State, ...args: any[]) => any;
392
- type Tail$1<T extends readonly any[]> = T extends readonly [
393
- any,
394
- ...infer Rest
395
- ] ? Rest : [
396
- ];
397
- type SelectorArgs$1<Selector> = Selector extends ((...params: infer Params) => any) ? Tail$1<Params> : never;
398
- export type InteractionType = "mouse" | "touch" | "pen" | "keyboard" | "";
399
- export type TransitionStatus = "starting" | "ending" | "idle" | undefined;
400
- declare class PopupTriggerMap {
401
- private elementsSet;
402
- private idMap;
403
- constructor();
404
- /**
405
- * Adds a trigger element with the given ID.
406
- *
407
- * Note: The provided element is assumed to not be registered under multiple IDs.
408
- */
409
- add(id: string, element: Element): void;
410
- /**
411
- * Removes the trigger element with the given ID.
412
- */
413
- delete(id: string): void;
414
- /**
415
- * Whether the given element is registered as a trigger.
416
- */
417
- hasElement(element: Element): boolean;
418
- /**
419
- * Whether there is a registered trigger element matching the given predicate.
420
- */
421
- hasMatchingElement(predicate: (el: Element) => boolean): boolean;
422
- /**
423
- * Returns the trigger element associated with the given ID, or undefined if no such element exists.
424
- */
425
- getById(id: string): Element | undefined;
426
- /**
427
- * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
428
- */
429
- entries(): IterableIterator<[
430
- string,
431
- Element
432
- ]>;
433
- /**
434
- * Returns an iterable of all registered trigger elements.
435
- */
436
- elements(): IterableIterator<Element>;
437
- /**
438
- * Returns the number of registered trigger elements.
439
- */
440
- get size(): number;
441
- }
442
- export type HTMLProps<T = any> = React$1.HTMLAttributes<T> & {
443
- ref?: React$1.Ref<T> | undefined;
444
- };
445
- /**
446
- * 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.
447
- *
448
- * @template Props Props to be spread on the rendered element.
449
- * @template State Component's internal state.
450
- */
451
- export type ComponentRenderFn<Props, State> = (props: Props, state: State) => React$1.ReactElement<unknown>;
452
- export type BaseUIEvent<E extends React$1.SyntheticEvent<Element, Event>> = E & {
453
- preventBaseUIHandler: () => void;
454
- readonly baseUIHandlerPrevented?: boolean | undefined;
455
- };
456
- 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;
457
- /**
458
- * Adds a `preventBaseUIHandler` method to all event handlers.
459
- */
460
- export type WithBaseUIEvent<T> = {
461
- [K in keyof T]: WithPreventBaseUIHandler<T[K]>;
462
- };
463
- /**
464
- * Props shared by all Base UI components.
465
- * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
466
- */
467
- export type BaseUIComponentProps<ElementType extends React$1.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React$1.ComponentPropsWithRef<ElementType>>, "className" | "color" | "defaultValue" | "defaultChecked" | "style"> & {
468
- /**
469
- * CSS class applied to the element, or a function that
470
- * returns a class based on the component's state.
471
- */
472
- className?: string | ((state: State) => string | undefined) | undefined;
473
- /**
474
- * Allows you to replace the component's HTML element
475
- * with a different tag, or compose it with another component.
476
- *
477
- * Accepts a `ReactElement` or a function that returns the element to render.
478
- */
479
- render?: React$1.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
480
- /**
481
- * Style applied to the element, or a function that
482
- * returns a style object based on the component's state.
483
- */
484
- style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
485
- };
486
- export interface NativeButtonProps {
487
- /**
488
- * Whether the component renders a native `<button>` element when replacing it
489
- * via the `render` prop.
490
- * Set to `false` if the rendered element is not a button (for example, `<div>`).
491
- * @default true
492
- */
493
- nativeButton?: boolean | undefined;
494
- }
495
- export interface NonNativeButtonProps {
496
- /**
497
- * Whether the component renders a native `<button>` element when replacing it
498
- * via the `render` prop.
499
- * Set to `true` if the rendered element is a native button.
500
- * @default false
501
- */
502
- nativeButton?: boolean | undefined;
503
- }
504
- export type Orientation = "horizontal" | "vertical";
505
- /**
506
- * State common to all popup stores.
507
- */
508
- export type PopupStoreState<Payload> = {
509
- /**
510
- * Whether the popup is open (internal state).
511
- */
512
- open: boolean;
513
- /**
514
- * Whether the popup is open (external prop).
515
- */
516
- readonly openProp: boolean | undefined;
517
- /**
518
- * Whether the popup should be mounted in the DOM.
519
- * This usually follows `open` but can be different during exit transitions.
520
- */
521
- mounted: boolean;
522
- /**
523
- * The current enter/exit transition status of the popup.
524
- */
525
- transitionStatus: TransitionStatus;
526
- floatingRootContext: FloatingRootContext;
527
- floatingId: string | undefined;
528
- /**
529
- * Number of trigger elements currently registered for this popup.
530
- */
531
- triggerCount: number;
532
- /**
533
- * Whether to prevent unmounting the popup when closed.
534
- * Useful for interacting with JS animation libraries that control unmounting themselves.
535
- */
536
- preventUnmountingOnClose: boolean;
537
- /**
538
- * Optional payload set by the trigger.
539
- */
540
- payload: Payload | undefined;
541
- /**
542
- * ID of the currently active trigger.
543
- */
544
- activeTriggerId: string | null;
545
- /**
546
- * The currently active trigger DOM element.
547
- */
548
- activeTriggerElement: Element | null;
549
- /**
550
- * ID of the trigger (external prop).
551
- */
552
- readonly triggerIdProp: string | null | undefined;
553
- /**
554
- * The popup DOM element.
555
- */
556
- popupElement: HTMLElement | null;
557
- /**
558
- * The positioner DOM element.
559
- */
560
- positionerElement: HTMLElement | null;
561
- /**
562
- * Props to spread onto the active trigger element.
563
- */
564
- activeTriggerProps: HTMLProps;
565
- /**
566
- * Props to spread onto inactive trigger elements.
567
- */
568
- inactiveTriggerProps: HTMLProps;
569
- /**
570
- * Props to spread onto the popup element.
571
- */
572
- popupProps: HTMLProps;
573
- };
574
- export type PopupStoreContext<ChangeEventDetails> = {
575
- /**
576
- * Map of registered trigger elements.
577
- */
578
- readonly triggerElements: PopupTriggerMap;
579
- /**
580
- * Reference to the popup element.
581
- */
582
- readonly popupRef: React$1.RefObject<HTMLElement | null>;
583
- /**
584
- * Callback fired when the open state changes.
585
- */
586
- onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
587
- /**
588
- * Callback fired when the open state change animation completes.
589
- */
590
- onOpenChangeComplete: ((open: boolean) => void) | undefined;
591
- };
592
- export type PayloadChildRenderFunction<Payload> = (arg: {
593
- payload: Payload | undefined;
594
- }) => React$1.ReactNode;
595
- export interface FloatingRootState {
596
- open: boolean;
597
- transitionStatus: TransitionStatus | undefined;
598
- domReferenceElement: Element | null;
599
- referenceElement: ReferenceType$1 | null;
600
- floatingElement: HTMLElement | null;
601
- positionReference: ReferenceType$1 | null;
602
- /**
603
- * The ID of the floating element.
604
- */
605
- floatingId: string | undefined;
606
- }
607
- export interface FloatingRootStoreContext {
608
- onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
609
- readonly dataRef: React$1.RefObject<ContextData>;
610
- readonly events: FloatingEvents;
611
- nested: boolean;
612
- readonly triggerElements: PopupTriggerMap;
613
- }
614
- declare const selectors: {
615
- open: (state: FloatingRootState) => boolean;
616
- transitionStatus: (state: FloatingRootState) => TransitionStatus;
617
- domReferenceElement: (state: FloatingRootState) => Element | null;
618
- referenceElement: (state: FloatingRootState) => ReferenceType$1 | null;
619
- floatingElement: (state: FloatingRootState) => HTMLElement | null;
620
- floatingId: (state: FloatingRootState) => string | undefined;
621
- };
622
- export interface FloatingRootStoreOptions {
623
- open: boolean;
624
- transitionStatus: TransitionStatus | undefined;
625
- referenceElement: ReferenceType$1 | null;
626
- floatingElement: HTMLElement | null;
627
- triggerElements: PopupTriggerMap;
628
- floatingId: string | undefined;
629
- /**
630
- * When true, `setOpen` only forwards to `onOpenChange`.
631
- * The popup store owns `dispatchOpenChange(...)` in this mode.
632
- */
633
- syncOnly: boolean;
634
- nested: boolean;
635
- onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
636
- }
637
- declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
638
- private readonly syncOnly;
639
- constructor(options: FloatingRootStoreOptions);
640
- /**
641
- * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
642
- */
643
- syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
644
- /**
645
- * Runs the root-owned side effects for an open state change.
646
- */
647
- dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
648
- /**
649
- * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
650
- *
651
- * @param newOpen The new open state.
652
- * @param eventDetails Details about the event that triggered the open state change.
653
- */
654
- setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
655
- }
656
- export interface UseRenderElementComponentProps<State> {
657
- /**
658
- * The class name to apply to the rendered element.
659
- * Can be a string or a function that accepts the state and returns a string.
660
- */
661
- className?: string | ((state: State) => string | undefined) | undefined;
662
- /**
663
- * The render prop or React element to override the default element.
664
- */
665
- render?: undefined | React$1.ReactElement | ComponentRenderFn<React$1.HTMLAttributes<any>, State>;
666
- /**
667
- * The style to apply to the rendered element.
668
- * Can be a style object or a function that accepts the state and returns a style object.
669
- */
670
- style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
671
- }
672
- export interface UseFloatingPortalNodeProps {
673
- ref?: React$1.Ref<HTMLDivElement> | undefined;
674
- container?: HTMLElement | ShadowRoot | null | React$1.RefObject<HTMLElement | ShadowRoot | null> | undefined;
675
- componentProps?: UseRenderElementComponentProps<any> | undefined;
676
- elementProps?: React$1.HTMLAttributes<HTMLDivElement> | undefined;
677
- }
678
- declare const FloatingPortal: React$1.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
679
- renderGuards?: boolean | undefined;
680
- }, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
681
- export interface FloatingPortalState {
682
- }
683
- declare namespace FloatingPortal {
684
- type State = FloatingPortalState;
685
- interface Props<TState> extends BaseUIComponentProps<"div", TState> {
686
- /**
687
- * A parent element to render the portal element into.
688
- */
689
- container?: UseFloatingPortalNodeProps["container"] | undefined;
690
- }
691
- }
692
- export type NarrowedElement<T> = T extends Element ? T : Element;
693
- export interface ExtendedRefs {
694
- reference: React$1.RefObject<ReferenceType$1 | null>;
695
- floating: React$1.RefObject<HTMLElement | null>;
696
- domReference: React$1.RefObject<NarrowedElement<ReferenceType$1> | null>;
697
- setReference(node: ReferenceType$1 | null): void;
698
- setFloating(node: HTMLElement | null): void;
699
- setPositionReference(node: ReferenceType$1 | null): void;
700
- }
701
- export interface ExtendedElements {
702
- reference: ReferenceType$1 | null;
703
- floating: HTMLElement | null;
704
- domReference: NarrowedElement<ReferenceType$1> | null;
705
- }
706
- export interface FloatingEvents {
707
- emit<T extends string>(event: T, data?: any): void;
708
- on(event: string, handler: (data: any) => void): void;
709
- off(event: string, handler: (data: any) => void): void;
710
- }
711
- export interface ContextData {
712
- openEvent?: Event | undefined;
713
- floatingContext?: FloatingContext | undefined;
714
- [key: string]: any;
715
- }
716
- export type FloatingRootContext = FloatingRootStore;
717
- export type FloatingContext = Omit<UseFloatingReturn<ReferenceType$1>, "refs" | "elements"> & {
718
- open: boolean;
719
- onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
720
- events: FloatingEvents;
721
- dataRef: React$1.RefObject<ContextData>;
722
- nodeId: string | undefined;
723
- floatingId: string | undefined;
724
- refs: ExtendedRefs;
725
- elements: ExtendedElements;
726
- rootStore: FloatingRootContext;
727
- };
728
- export interface FloatingNodeType {
729
- id: string | undefined;
730
- parentId: string | null;
731
- context?: FloatingContext | undefined;
732
- }
733
- type ReferenceType$1 = Element | VirtualElement;
734
- type Side$1 = "top" | "bottom" | "left" | "right" | "inline-end" | "inline-start";
735
- export type Align = "start" | "center" | "end";
736
- export type Boundary = "clipping-ancestors" | Element | Element[] | Rect;
737
- export type OffsetFunction = (data: {
738
- side: Side$1;
739
- align: Align;
740
- anchor: {
741
- width: number;
742
- height: number;
743
- };
744
- positioner: {
745
- width: number;
746
- height: number;
747
- };
748
- }) => number;
749
- export interface SideFlipMode {
750
- /**
751
- * How to avoid collisions on the side axis.
752
- * - `'flip'`: If there is not enough space, place the popup on the opposite side.
753
- * - `'none'`: Keep the preferred side even if it overflows.
754
- */
755
- side?: "flip" | "none" | undefined;
756
- /**
757
- * How to avoid collisions on the align axis.
758
- * - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
759
- * - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
760
- * - `'none'`: Keep the preferred alignment even if it overflows.
761
- */
762
- align?: "flip" | "shift" | "none" | undefined;
763
- /**
764
- * If both sides on the preferred axis do not fit, determines whether to fallback
765
- * to a side on the perpendicular axis and which logical side to prefer.
766
- * - `'start'`: Prefer the logical start side on the perpendicular axis.
767
- * - `'end'`: Prefer the logical end side on the perpendicular axis.
768
- * - `'none'`: Do not fallback to the perpendicular axis.
769
- */
770
- fallbackAxisSide?: "start" | "end" | "none" | undefined;
771
- }
772
- export interface SideShiftMode {
773
- /**
774
- * How to avoid collisions on the side axis.
775
- * - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
776
- * - `'none'`: Keep the preferred side even if it overflows.
777
- */
778
- side?: "shift" | "none" | undefined;
779
- /**
780
- * How to avoid collisions on the align axis.
781
- * - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
782
- * - `'none'`: Keep the preferred alignment even if it overflows.
783
- */
784
- align?: "shift" | "none" | undefined;
785
- /**
786
- * If both sides on the preferred axis do not fit, determines whether to fallback
787
- * to a side on the perpendicular axis and which logical side to prefer.
788
- * - `'start'`: Prefer the logical start side on the perpendicular axis.
789
- * - `'end'`: Prefer the logical end side on the perpendicular axis.
790
- * - `'none'`: Do not fallback to the perpendicular axis.
791
- */
792
- fallbackAxisSide?: "start" | "end" | "none" | undefined;
793
- }
794
- export type CollisionAvoidance = SideFlipMode | SideShiftMode;
795
- export interface UseAnchorPositioningSharedParameters {
796
- /**
797
- * An element to position the popup against.
798
- * By default, the popup will be positioned against the trigger.
799
- */
800
- anchor?: Element | null | VirtualElement | React$1.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
801
- /**
802
- * Determines which CSS `position` property to use.
803
- * @default 'absolute'
804
- */
805
- positionMethod?: "absolute" | "fixed" | undefined;
806
- /**
807
- * Which side of the anchor element to align the popup against.
808
- * May automatically change to avoid collisions.
809
- * @default 'bottom'
810
- */
811
- side?: Side$1 | undefined;
812
- /**
813
- * Distance between the anchor and the popup in pixels.
814
- * Also accepts a function that returns the distance to read the dimensions of the anchor
815
- * and positioner elements, along with its side and alignment.
816
- *
817
- * The function takes a `data` object parameter with the following properties:
818
- * - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
819
- * - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
820
- * - `data.side`: which side of the anchor element the positioner is aligned against.
821
- * - `data.align`: how the positioner is aligned relative to the specified side.
822
- *
823
- * @example
824
- * ```jsx
825
- * <Positioner
826
- * sideOffset={({ side, align, anchor, positioner }) => {
827
- * return side === 'top' || side === 'bottom'
828
- * ? anchor.height
829
- * : anchor.width;
830
- * }}
831
- * />
832
- * ```
833
- *
834
- * @default 0
835
- */
836
- sideOffset?: number | OffsetFunction | undefined;
837
- /**
838
- * How to align the popup relative to the specified side.
839
- * @default 'center'
840
- */
841
- align?: Align | undefined;
842
- /**
843
- * Additional offset along the alignment axis in pixels.
844
- * Also accepts a function that returns the offset to read the dimensions of the anchor
845
- * and positioner elements, along with its side and alignment.
846
- *
847
- * The function takes a `data` object parameter with the following properties:
848
- * - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
849
- * - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
850
- * - `data.side`: which side of the anchor element the positioner is aligned against.
851
- * - `data.align`: how the positioner is aligned relative to the specified side.
852
- *
853
- * @example
854
- * ```jsx
855
- * <Positioner
856
- * alignOffset={({ side, align, anchor, positioner }) => {
857
- * return side === 'top' || side === 'bottom'
858
- * ? anchor.width
859
- * : anchor.height;
860
- * }}
861
- * />
862
- * ```
863
- *
864
- * @default 0
865
- */
866
- alignOffset?: number | OffsetFunction | undefined;
867
- /**
868
- * An element or a rectangle that delimits the area that the popup is confined to.
869
- * @default 'clipping-ancestors'
870
- */
871
- collisionBoundary?: Boundary | undefined;
872
- /**
873
- * Additional space to maintain from the edge of the collision boundary.
874
- * @default 5
875
- */
876
- collisionPadding?: Padding | undefined;
877
- /**
878
- * Whether to maintain the popup in the viewport after
879
- * the anchor element was scrolled out of view.
880
- * @default false
881
- */
882
- sticky?: boolean | undefined;
883
- /**
884
- * Minimum distance to maintain between the arrow and the edges of the popup.
885
- *
886
- * Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
887
- * @default 5
888
- */
889
- arrowPadding?: number | undefined;
890
- /**
891
- * Whether to disable the popup from tracking any layout shift of its positioning anchor.
892
- * @default false
893
- */
894
- disableAnchorTracking?: boolean | undefined;
895
- /**
896
- * Determines how to handle collisions when positioning the popup.
897
- *
898
- * `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
899
- * - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
900
- * (`top` and `bottom`, or `left` and `right`).
901
- * - `'shift'`: never change side; keep the requested side and move the popup within
902
- * the clipping boundary so it stays visible.
903
- * - `'none'`: do not correct side-axis overflow.
904
- *
905
- * `align` controls overflow on the alignment axis (`start`/`center`/`end`):
906
- * - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
907
- * - `'shift'`: keep side and requested alignment, then nudge the popup along the
908
- * alignment axis to fit.
909
- * - `'none'`: do not correct alignment-axis overflow.
910
- *
911
- * `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
912
- * preferred axis cannot fit:
913
- * - `'start'`: allow perpendicular fallback and try the logical start side first
914
- * (`top` before `bottom`, or `left` before `right` in LTR).
915
- * - `'end'`: allow perpendicular fallback and try the logical end side first
916
- * (`bottom` before `top`, or `right` before `left` in LTR).
917
- * - `'none'`: do not fallback to the perpendicular axis.
918
- *
919
- * When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
920
- * If `align` is omitted, it defaults to `'flip'`.
921
- *
922
- * @example
923
- * ```jsx
924
- * <Positioner
925
- * collisionAvoidance={{
926
- * side: 'shift',
927
- * align: 'shift',
928
- * fallbackAxisSide: 'none',
929
- * }}
930
- * />
931
- * ```
932
- *
933
- */
934
- collisionAvoidance?: CollisionAvoidance | undefined;
935
- }
936
- declare const MenuArrow: React$1.ForwardRefExoticComponent<Omit<MenuArrowProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
937
- interface MenuArrowState {
938
- /**
939
- * Whether the menu is currently open.
940
- */
941
- open: boolean;
942
- /**
943
- * The side of the anchor the component is placed on.
944
- */
945
- side: Side$1;
946
- /**
947
- * The alignment of the component relative to the anchor.
948
- */
949
- align: Align;
950
- /**
951
- * Whether the arrow cannot be centered on the anchor.
952
- */
953
- uncentered: boolean;
954
- }
955
- interface MenuArrowProps extends BaseUIComponentProps<"div", MenuArrowState> {
956
- }
957
- declare namespace MenuArrow {
958
- type State = MenuArrowState;
959
- type Props = MenuArrowProps;
960
- }
961
- declare const MenuBackdrop: React$1.ForwardRefExoticComponent<Omit<MenuBackdropProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
962
- interface MenuBackdropState {
963
- /**
964
- * Whether the menu is currently open.
965
- */
966
- open: boolean;
967
- /**
968
- * The transition status of the component.
969
- */
970
- transitionStatus: TransitionStatus;
971
- }
972
- interface MenuBackdropProps extends BaseUIComponentProps<"div", MenuBackdropState> {
973
- }
974
- declare namespace MenuBackdrop {
975
- type State = MenuBackdropState;
976
- type Props = MenuBackdropProps;
977
- }
978
- export type State<Payload> = PopupStoreState<Payload> & {
979
- disabled: boolean;
980
- modal: boolean;
981
- openMethod: InteractionType | null;
982
- allowMouseEnter: boolean;
983
- parent: MenuParent;
984
- rootId: string | undefined;
985
- activeIndex: number | null;
986
- hoverEnabled: boolean;
987
- stickIfOpen: boolean;
988
- instantType: "dismiss" | "click" | "group" | "trigger-change" | undefined;
989
- openChangeReason: MenuRoot.ChangeEventReason | null;
990
- floatingTreeRoot: FloatingTreeStore;
991
- floatingNodeId: string | undefined;
992
- floatingParentNodeId: string | null;
993
- itemProps: HTMLProps;
994
- closeDelay: number;
995
- keyboardEventRelay: ((event: React$1.KeyboardEvent<any>) => void) | undefined;
996
- hasViewport: boolean;
997
- };
998
- export type Context = PopupStoreContext<MenuRoot.ChangeEventDetails> & {
999
- readonly positionerRef: React$1.RefObject<HTMLElement | null>;
1000
- readonly popupRef: React$1.RefObject<HTMLElement | null>;
1001
- readonly typingRef: React$1.RefObject<boolean>;
1002
- readonly itemDomElements: React$1.RefObject<(HTMLElement | null)[]>;
1003
- readonly itemLabels: React$1.RefObject<(string | null)[]>;
1004
- allowMouseUpTriggerRef: React$1.RefObject<boolean>;
1005
- readonly triggerFocusTargetRef: React$1.RefObject<HTMLElement | null>;
1006
- readonly beforeContentFocusGuardRef: React$1.RefObject<HTMLElement | null>;
1007
- };
1008
- declare const selectors$1: {
1009
- disabled: (state: State<unknown>) => boolean;
1010
- modal: (state: State<unknown>) => boolean;
1011
- openMethod: (state: State<unknown>) => InteractionType | null;
1012
- allowMouseEnter: (state: State<unknown>) => boolean;
1013
- stickIfOpen: (state: State<unknown>) => boolean;
1014
- parent: (state: State<unknown>) => MenuParent;
1015
- rootId: (state: State<unknown>) => string | undefined;
1016
- activeIndex: (state: State<unknown>) => number | null;
1017
- isActive: (state: State<unknown>, itemIndex: number) => boolean;
1018
- hoverEnabled: (state: State<unknown>) => boolean;
1019
- instantType: (state: State<unknown>) => "group" | "click" | "dismiss" | "trigger-change" | undefined;
1020
- lastOpenChangeReason: (state: State<unknown>) => MenuRootChangeEventReason | null;
1021
- floatingTreeRoot: (state: State<unknown>) => FloatingTreeStore;
1022
- floatingNodeId: (state: State<unknown>) => string | undefined;
1023
- floatingParentNodeId: (state: State<unknown>) => string | null;
1024
- itemProps: (state: State<unknown>) => HTMLProps;
1025
- closeDelay: (state: State<unknown>) => number;
1026
- hasViewport: (state: State<unknown>) => boolean;
1027
- keyboardEventRelay: (state: State<unknown>) => React$1.KeyboardEventHandler<any> | undefined;
1028
- open: (state: {
1029
- open: boolean;
1030
- readonly openProp: boolean | undefined;
1031
- mounted: boolean;
1032
- transitionStatus: TransitionStatus;
1033
- floatingRootContext: FloatingRootContext;
1034
- floatingId: string | undefined;
1035
- triggerCount: number;
1036
- preventUnmountingOnClose: boolean;
1037
- payload: unknown;
1038
- activeTriggerId: string | null;
1039
- activeTriggerElement: Element | null;
1040
- readonly triggerIdProp: string | null | undefined;
1041
- popupElement: HTMLElement | null;
1042
- positionerElement: HTMLElement | null;
1043
- activeTriggerProps: HTMLProps;
1044
- inactiveTriggerProps: HTMLProps;
1045
- popupProps: HTMLProps;
1046
- }) => boolean;
1047
- mounted: (state: {
1048
- open: boolean;
1049
- readonly openProp: boolean | undefined;
1050
- mounted: boolean;
1051
- transitionStatus: TransitionStatus;
1052
- floatingRootContext: FloatingRootContext;
1053
- floatingId: string | undefined;
1054
- triggerCount: number;
1055
- preventUnmountingOnClose: boolean;
1056
- payload: unknown;
1057
- activeTriggerId: string | null;
1058
- activeTriggerElement: Element | null;
1059
- readonly triggerIdProp: string | null | undefined;
1060
- popupElement: HTMLElement | null;
1061
- positionerElement: HTMLElement | null;
1062
- activeTriggerProps: HTMLProps;
1063
- inactiveTriggerProps: HTMLProps;
1064
- popupProps: HTMLProps;
1065
- }) => boolean;
1066
- transitionStatus: (state: {
1067
- open: boolean;
1068
- readonly openProp: boolean | undefined;
1069
- mounted: boolean;
1070
- transitionStatus: TransitionStatus;
1071
- floatingRootContext: FloatingRootContext;
1072
- floatingId: string | undefined;
1073
- triggerCount: number;
1074
- preventUnmountingOnClose: boolean;
1075
- payload: unknown;
1076
- activeTriggerId: string | null;
1077
- activeTriggerElement: Element | null;
1078
- readonly triggerIdProp: string | null | undefined;
1079
- popupElement: HTMLElement | null;
1080
- positionerElement: HTMLElement | null;
1081
- activeTriggerProps: HTMLProps;
1082
- inactiveTriggerProps: HTMLProps;
1083
- popupProps: HTMLProps;
1084
- }) => TransitionStatus;
1085
- floatingRootContext: (state: {
1086
- open: boolean;
1087
- readonly openProp: boolean | undefined;
1088
- mounted: boolean;
1089
- transitionStatus: TransitionStatus;
1090
- floatingRootContext: FloatingRootContext;
1091
- floatingId: string | undefined;
1092
- triggerCount: number;
1093
- preventUnmountingOnClose: boolean;
1094
- payload: unknown;
1095
- activeTriggerId: string | null;
1096
- activeTriggerElement: Element | null;
1097
- readonly triggerIdProp: string | null | undefined;
1098
- popupElement: HTMLElement | null;
1099
- positionerElement: HTMLElement | null;
1100
- activeTriggerProps: HTMLProps;
1101
- inactiveTriggerProps: HTMLProps;
1102
- popupProps: HTMLProps;
1103
- }) => FloatingRootStore;
1104
- triggerCount: (state: {
1105
- open: boolean;
1106
- readonly openProp: boolean | undefined;
1107
- mounted: boolean;
1108
- transitionStatus: TransitionStatus;
1109
- floatingRootContext: FloatingRootContext;
1110
- floatingId: string | undefined;
1111
- triggerCount: number;
1112
- preventUnmountingOnClose: boolean;
1113
- payload: unknown;
1114
- activeTriggerId: string | null;
1115
- activeTriggerElement: Element | null;
1116
- readonly triggerIdProp: string | null | undefined;
1117
- popupElement: HTMLElement | null;
1118
- positionerElement: HTMLElement | null;
1119
- activeTriggerProps: HTMLProps;
1120
- inactiveTriggerProps: HTMLProps;
1121
- popupProps: HTMLProps;
1122
- }) => number;
1123
- preventUnmountingOnClose: (state: {
1124
- open: boolean;
1125
- readonly openProp: boolean | undefined;
1126
- mounted: boolean;
1127
- transitionStatus: TransitionStatus;
1128
- floatingRootContext: FloatingRootContext;
1129
- floatingId: string | undefined;
1130
- triggerCount: number;
1131
- preventUnmountingOnClose: boolean;
1132
- payload: unknown;
1133
- activeTriggerId: string | null;
1134
- activeTriggerElement: Element | null;
1135
- readonly triggerIdProp: string | null | undefined;
1136
- popupElement: HTMLElement | null;
1137
- positionerElement: HTMLElement | null;
1138
- activeTriggerProps: HTMLProps;
1139
- inactiveTriggerProps: HTMLProps;
1140
- popupProps: HTMLProps;
1141
- }) => boolean;
1142
- payload: (state: {
1143
- open: boolean;
1144
- readonly openProp: boolean | undefined;
1145
- mounted: boolean;
1146
- transitionStatus: TransitionStatus;
1147
- floatingRootContext: FloatingRootContext;
1148
- floatingId: string | undefined;
1149
- triggerCount: number;
1150
- preventUnmountingOnClose: boolean;
1151
- payload: unknown;
1152
- activeTriggerId: string | null;
1153
- activeTriggerElement: Element | null;
1154
- readonly triggerIdProp: string | null | undefined;
1155
- popupElement: HTMLElement | null;
1156
- positionerElement: HTMLElement | null;
1157
- activeTriggerProps: HTMLProps;
1158
- inactiveTriggerProps: HTMLProps;
1159
- popupProps: HTMLProps;
1160
- }) => unknown;
1161
- activeTriggerId: (state: {
1162
- open: boolean;
1163
- readonly openProp: boolean | undefined;
1164
- mounted: boolean;
1165
- transitionStatus: TransitionStatus;
1166
- floatingRootContext: FloatingRootContext;
1167
- floatingId: string | undefined;
1168
- triggerCount: number;
1169
- preventUnmountingOnClose: boolean;
1170
- payload: unknown;
1171
- activeTriggerId: string | null;
1172
- activeTriggerElement: Element | null;
1173
- readonly triggerIdProp: string | null | undefined;
1174
- popupElement: HTMLElement | null;
1175
- positionerElement: HTMLElement | null;
1176
- activeTriggerProps: HTMLProps;
1177
- inactiveTriggerProps: HTMLProps;
1178
- popupProps: HTMLProps;
1179
- }) => string | null;
1180
- activeTriggerElement: (state: {
1181
- open: boolean;
1182
- readonly openProp: boolean | undefined;
1183
- mounted: boolean;
1184
- transitionStatus: TransitionStatus;
1185
- floatingRootContext: FloatingRootContext;
1186
- floatingId: string | undefined;
1187
- triggerCount: number;
1188
- preventUnmountingOnClose: boolean;
1189
- payload: unknown;
1190
- activeTriggerId: string | null;
1191
- activeTriggerElement: Element | null;
1192
- readonly triggerIdProp: string | null | undefined;
1193
- popupElement: HTMLElement | null;
1194
- positionerElement: HTMLElement | null;
1195
- activeTriggerProps: HTMLProps;
1196
- inactiveTriggerProps: HTMLProps;
1197
- popupProps: HTMLProps;
1198
- }) => Element | null;
1199
- popupId: (state: {
1200
- open: boolean;
1201
- readonly openProp: boolean | undefined;
1202
- mounted: boolean;
1203
- transitionStatus: TransitionStatus;
1204
- floatingRootContext: FloatingRootContext;
1205
- floatingId: string | undefined;
1206
- triggerCount: number;
1207
- preventUnmountingOnClose: boolean;
1208
- payload: unknown;
1209
- activeTriggerId: string | null;
1210
- activeTriggerElement: Element | null;
1211
- readonly triggerIdProp: string | null | undefined;
1212
- popupElement: HTMLElement | null;
1213
- positionerElement: HTMLElement | null;
1214
- activeTriggerProps: HTMLProps;
1215
- inactiveTriggerProps: HTMLProps;
1216
- popupProps: HTMLProps;
1217
- }) => string | undefined;
1218
- isTriggerActive: (state: {
1219
- open: boolean;
1220
- readonly openProp: boolean | undefined;
1221
- mounted: boolean;
1222
- transitionStatus: TransitionStatus;
1223
- floatingRootContext: FloatingRootContext;
1224
- floatingId: string | undefined;
1225
- triggerCount: number;
1226
- preventUnmountingOnClose: boolean;
1227
- payload: unknown;
1228
- activeTriggerId: string | null;
1229
- activeTriggerElement: Element | null;
1230
- readonly triggerIdProp: string | null | undefined;
1231
- popupElement: HTMLElement | null;
1232
- positionerElement: HTMLElement | null;
1233
- activeTriggerProps: HTMLProps;
1234
- inactiveTriggerProps: HTMLProps;
1235
- popupProps: HTMLProps;
1236
- }, triggerId: string | undefined) => boolean;
1237
- isOpenedByTrigger: (state: {
1238
- open: boolean;
1239
- readonly openProp: boolean | undefined;
1240
- mounted: boolean;
1241
- transitionStatus: TransitionStatus;
1242
- floatingRootContext: FloatingRootContext;
1243
- floatingId: string | undefined;
1244
- triggerCount: number;
1245
- preventUnmountingOnClose: boolean;
1246
- payload: unknown;
1247
- activeTriggerId: string | null;
1248
- activeTriggerElement: Element | null;
1249
- readonly triggerIdProp: string | null | undefined;
1250
- popupElement: HTMLElement | null;
1251
- positionerElement: HTMLElement | null;
1252
- activeTriggerProps: HTMLProps;
1253
- inactiveTriggerProps: HTMLProps;
1254
- popupProps: HTMLProps;
1255
- }, triggerId: string | undefined) => boolean;
1256
- isMountedByTrigger: (state: {
1257
- open: boolean;
1258
- readonly openProp: boolean | undefined;
1259
- mounted: boolean;
1260
- transitionStatus: TransitionStatus;
1261
- floatingRootContext: FloatingRootContext;
1262
- floatingId: string | undefined;
1263
- triggerCount: number;
1264
- preventUnmountingOnClose: boolean;
1265
- payload: unknown;
1266
- activeTriggerId: string | null;
1267
- activeTriggerElement: Element | null;
1268
- readonly triggerIdProp: string | null | undefined;
1269
- popupElement: HTMLElement | null;
1270
- positionerElement: HTMLElement | null;
1271
- activeTriggerProps: HTMLProps;
1272
- inactiveTriggerProps: HTMLProps;
1273
- popupProps: HTMLProps;
1274
- }, triggerId: string | undefined) => boolean;
1275
- triggerProps: (state: {
1276
- open: boolean;
1277
- readonly openProp: boolean | undefined;
1278
- mounted: boolean;
1279
- transitionStatus: TransitionStatus;
1280
- floatingRootContext: FloatingRootContext;
1281
- floatingId: string | undefined;
1282
- triggerCount: number;
1283
- preventUnmountingOnClose: boolean;
1284
- payload: unknown;
1285
- activeTriggerId: string | null;
1286
- activeTriggerElement: Element | null;
1287
- readonly triggerIdProp: string | null | undefined;
1288
- popupElement: HTMLElement | null;
1289
- positionerElement: HTMLElement | null;
1290
- activeTriggerProps: HTMLProps;
1291
- inactiveTriggerProps: HTMLProps;
1292
- popupProps: HTMLProps;
1293
- }, isActive: boolean) => HTMLProps;
1294
- triggerPopupId: (state: {
1295
- open: boolean;
1296
- readonly openProp: boolean | undefined;
1297
- mounted: boolean;
1298
- transitionStatus: TransitionStatus;
1299
- floatingRootContext: FloatingRootContext;
1300
- floatingId: string | undefined;
1301
- triggerCount: number;
1302
- preventUnmountingOnClose: boolean;
1303
- payload: unknown;
1304
- activeTriggerId: string | null;
1305
- activeTriggerElement: Element | null;
1306
- readonly triggerIdProp: string | null | undefined;
1307
- popupElement: HTMLElement | null;
1308
- positionerElement: HTMLElement | null;
1309
- activeTriggerProps: HTMLProps;
1310
- inactiveTriggerProps: HTMLProps;
1311
- popupProps: HTMLProps;
1312
- }, triggerId: string | undefined) => string | undefined;
1313
- popupProps: (state: {
1314
- open: boolean;
1315
- readonly openProp: boolean | undefined;
1316
- mounted: boolean;
1317
- transitionStatus: TransitionStatus;
1318
- floatingRootContext: FloatingRootContext;
1319
- floatingId: string | undefined;
1320
- triggerCount: number;
1321
- preventUnmountingOnClose: boolean;
1322
- payload: unknown;
1323
- activeTriggerId: string | null;
1324
- activeTriggerElement: Element | null;
1325
- readonly triggerIdProp: string | null | undefined;
1326
- popupElement: HTMLElement | null;
1327
- positionerElement: HTMLElement | null;
1328
- activeTriggerProps: HTMLProps;
1329
- inactiveTriggerProps: HTMLProps;
1330
- popupProps: HTMLProps;
1331
- }) => HTMLProps;
1332
- popupElement: (state: {
1333
- open: boolean;
1334
- readonly openProp: boolean | undefined;
1335
- mounted: boolean;
1336
- transitionStatus: TransitionStatus;
1337
- floatingRootContext: FloatingRootContext;
1338
- floatingId: string | undefined;
1339
- triggerCount: number;
1340
- preventUnmountingOnClose: boolean;
1341
- payload: unknown;
1342
- activeTriggerId: string | null;
1343
- activeTriggerElement: Element | null;
1344
- readonly triggerIdProp: string | null | undefined;
1345
- popupElement: HTMLElement | null;
1346
- positionerElement: HTMLElement | null;
1347
- activeTriggerProps: HTMLProps;
1348
- inactiveTriggerProps: HTMLProps;
1349
- popupProps: HTMLProps;
1350
- }) => HTMLElement | null;
1351
- positionerElement: (state: {
1352
- open: boolean;
1353
- readonly openProp: boolean | undefined;
1354
- mounted: boolean;
1355
- transitionStatus: TransitionStatus;
1356
- floatingRootContext: FloatingRootContext;
1357
- floatingId: string | undefined;
1358
- triggerCount: number;
1359
- preventUnmountingOnClose: boolean;
1360
- payload: unknown;
1361
- activeTriggerId: string | null;
1362
- activeTriggerElement: Element | null;
1363
- readonly triggerIdProp: string | null | undefined;
1364
- popupElement: HTMLElement | null;
1365
- positionerElement: HTMLElement | null;
1366
- activeTriggerProps: HTMLProps;
1367
- inactiveTriggerProps: HTMLProps;
1368
- popupProps: HTMLProps;
1369
- }) => HTMLElement | null;
1370
- };
1371
- declare class MenuStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, typeof selectors$1> {
1372
- constructor(initialState?: Partial<State<Payload>>);
1373
- setOpen(open: boolean, eventDetails: Omit<MenuRoot.ChangeEventDetails, "preventUnmountOnClose">): void;
1374
- static useStore<Payload>(externalStore: MenuStore<Payload> | undefined, initialState: Partial<State<Payload>>): MenuStore<Payload>;
1375
- private unsubscribeParentListener;
1376
- }
1377
- export interface MenuRootContext<Payload = unknown> {
1378
- store: MenuStore<Payload>;
1379
- parent: MenuParent;
1380
- }
1381
- declare const MenuRootContext: React$1.Context<MenuRootContext<unknown> | undefined>;
1382
- export interface MenubarContext {
1383
- modal: boolean;
1384
- disabled: boolean;
1385
- contentElement: HTMLElement | null;
1386
- setContentElement: (element: HTMLElement | null) => void;
1387
- hasSubmenuOpen: boolean;
1388
- setHasSubmenuOpen: (open: boolean) => void;
1389
- orientation: MenuRoot.Orientation;
1390
- allowMouseUpTriggerRef: React$1.RefObject<boolean>;
1391
- rootId: string | undefined;
1392
- }
1393
- declare const MenubarContext: React$1.Context<MenubarContext | null>;
1394
- export interface ContextMenuRootContext {
1395
- anchor: {
1396
- getBoundingClientRect: () => DOMRect;
1397
- };
1398
- setAnchor: React$1.Dispatch<React$1.SetStateAction<ContextMenuRootContext["anchor"]>>;
1399
- backdropRef: React$1.RefObject<HTMLDivElement | null>;
1400
- internalBackdropRef: React$1.RefObject<HTMLDivElement | null>;
1401
- actionsRef: React$1.RefObject<{
1402
- setOpen: (nextOpen: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void;
1403
- } | null>;
1404
- positionerRef: React$1.RefObject<HTMLElement | null>;
1405
- allowMouseUpTriggerRef: React$1.RefObject<boolean>;
1406
- initialCursorPointRef: React$1.RefObject<{
1407
- x: number;
1408
- y: number;
1409
- } | null>;
1410
- rootId: string | undefined;
1411
- }
1412
- declare const ContextMenuRootContext: React$1.Context<ContextMenuRootContext | undefined>;
1413
- declare class MenuHandle<Payload> {
1414
- /**
1415
- * Internal store holding the menu's state.
1416
- * @internal
1417
- */
1418
- readonly store: MenuStore<Payload>;
1419
- constructor();
1420
- /**
1421
- * Opens the menu and associates it with the trigger with the given id.
1422
- * The trigger must be a Menu.Trigger component with this handle passed as a prop.
1423
- *
1424
- * @param triggerId ID of the trigger to associate with the menu.
1425
- */
1426
- open(triggerId: string): void;
1427
- /**
1428
- * Closes the menu.
1429
- */
1430
- close(): void;
1431
- /**
1432
- * Indicates whether the menu is currently open.
1433
- */
1434
- get isOpen(): boolean;
1435
- }
1436
- declare function createMenuHandle<Payload>(): MenuHandle<Payload>;
1437
- declare const MenuRoot: <Payload>(props: MenuRoot.Props<Payload>) => import("react/jsx-runtime").React$1.JSX.Element;
1438
- export interface MenuRootState {
1439
- }
1440
- export interface MenuRootProps<Payload = unknown> {
1441
- /**
1442
- * Whether the menu is initially open.
1443
- *
1444
- * To render a controlled menu, use the `open` prop instead.
1445
- * @default false
1446
- */
1447
- defaultOpen?: boolean | undefined;
1448
- /**
1449
- * Whether to loop keyboard focus back to the first item
1450
- * when the end of the list is reached while using the arrow keys.
1451
- * @default true
1452
- */
1453
- loopFocus?: boolean | undefined;
1454
- /**
1455
- * Whether moving the pointer over items should highlight them.
1456
- * Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
1457
- * @default true
1458
- */
1459
- highlightItemOnHover?: boolean | undefined;
1460
- /**
1461
- * Determines if the menu enters a modal state when open.
1462
- * - `true`: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled.
1463
- * - `false`: user interaction with the rest of the document is allowed.
1464
- * @default true
1465
- */
1466
- modal?: boolean | undefined;
1467
- /**
1468
- * Event handler called when the menu is opened or closed.
1469
- */
1470
- onOpenChange?: ((open: boolean, eventDetails: MenuRoot.ChangeEventDetails) => void) | undefined;
1471
- /**
1472
- * Event handler called after any animations complete when the menu is closed.
1473
- */
1474
- onOpenChangeComplete?: ((open: boolean) => void) | undefined;
1475
- /**
1476
- * Whether the menu is currently open.
1477
- */
1478
- open?: boolean | undefined;
1479
- /**
1480
- * The visual orientation of the menu.
1481
- * Controls whether roving focus uses up/down or left/right arrow keys.
1482
- * @default 'vertical'
1483
- */
1484
- orientation?: MenuRoot.Orientation | undefined;
1485
- /**
1486
- * Whether the component should ignore user interaction.
1487
- * @default false
1488
- */
1489
- disabled?: boolean | undefined;
1490
- /**
1491
- * When in a submenu, determines whether pressing the Escape key
1492
- * closes the entire menu, or only the current child menu.
1493
- * @default false
1494
- */
1495
- closeParentOnEsc?: boolean | undefined;
1496
- /**
1497
- * A ref to imperative actions.
1498
- * - `unmount`: When specified, the menu will not be unmounted when closed.
1499
- * Instead, the `unmount` function must be called to unmount the menu manually.
1500
- * Useful when the menu's animation is controlled by an external library.
1501
- * - `close`: When specified, the menu can be closed imperatively.
1502
- */
1503
- actionsRef?: React$1.RefObject<MenuRoot.Actions | null> | undefined;
1504
- /**
1505
- * ID of the trigger that the popover is associated with.
1506
- * This is useful in conjunction with the `open` prop to create a controlled popover.
1507
- * There's no need to specify this prop when the popover is uncontrolled (that is, when the `open` prop is not set).
1508
- */
1509
- triggerId?: string | null | undefined;
1510
- /**
1511
- * ID of the trigger that the popover is associated with.
1512
- * This is useful in conjunction with the `defaultOpen` prop to create an initially open popover.
1513
- */
1514
- defaultTriggerId?: string | null | undefined;
1515
- /**
1516
- * A handle to associate the menu with a trigger.
1517
- * If specified, allows external triggers to control the menu's open state.
1518
- */
1519
- handle?: MenuHandle<Payload> | undefined;
1520
- /**
1521
- * The content of the popover.
1522
- * This can be a regular React node or a render function that receives the `payload` of the active trigger.
1523
- */
1524
- children?: React$1.ReactNode | PayloadChildRenderFunction<Payload>;
1525
- }
1526
- export interface MenuRootActions {
1527
- unmount: () => void;
1528
- close: () => void;
1529
- }
1530
- export type MenuRootChangeEventReason = typeof triggerHover | typeof triggerFocus | typeof triggerPress | typeof outsidePress | typeof focusOut | typeof listNavigation | typeof escapeKey | typeof itemPress | typeof closePress | typeof siblingOpen | typeof cancelOpen | typeof imperativeAction | typeof none;
1531
- export type MenuRootChangeEventDetails = BaseUIChangeEventDetails<MenuRoot.ChangeEventReason> & {
1532
- preventUnmountOnClose(): void;
1533
- };
1534
- export type MenuRootOrientation = "horizontal" | "vertical";
1535
- export type MenuParent = {
1536
- type: "menu";
1537
- store: MenuStore<unknown>;
1538
- } | {
1539
- type: "menubar";
1540
- context: MenubarContext;
1541
- } | {
1542
- type: "context-menu";
1543
- context: ContextMenuRootContext;
1544
- } | {
1545
- type: "nested-context-menu";
1546
- context: ContextMenuRootContext;
1547
- menuContext: MenuRootContext;
1548
- } | {
1549
- type: undefined;
1550
- };
1551
- declare namespace MenuRoot {
1552
- type State = MenuRootState;
1553
- type Props<Payload = unknown> = MenuRootProps<Payload>;
1554
- type Actions = MenuRootActions;
1555
- type ChangeEventReason = MenuRootChangeEventReason;
1556
- type ChangeEventDetails = MenuRootChangeEventDetails;
1557
- type Orientation = MenuRootOrientation;
1558
- }
1559
- declare const MenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
1560
- interface MenuCheckboxItemState {
1561
- /**
1562
- * Whether the checkbox item should ignore user interaction.
1563
- */
1564
- disabled: boolean;
1565
- /**
1566
- * Whether the checkbox item is currently highlighted.
1567
- */
1568
- highlighted: boolean;
1569
- /**
1570
- * Whether the checkbox item is currently ticked.
1571
- */
1572
- checked: boolean;
1573
- }
1574
- interface MenuCheckboxItemProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuCheckboxItemState> {
1575
- /**
1576
- * Whether the checkbox item is currently ticked.
1577
- *
1578
- * To render an uncontrolled checkbox item, use the `defaultChecked` prop instead.
1579
- */
1580
- checked?: boolean | undefined;
1581
- /**
1582
- * Whether the checkbox item is initially ticked.
1583
- *
1584
- * To render a controlled checkbox item, use the `checked` prop instead.
1585
- * @default false
1586
- */
1587
- defaultChecked?: boolean | undefined;
1588
- /**
1589
- * Event handler called when the checkbox item is ticked or unticked.
1590
- */
1591
- onCheckedChange?: ((checked: boolean, eventDetails: MenuCheckboxItem.ChangeEventDetails) => void) | undefined;
1592
- /**
1593
- * The click handler for the menu item.
1594
- */
1595
- onClick?: BaseUIComponentProps<"div", MenuCheckboxItemState>["onClick"] | undefined;
1596
- /**
1597
- * Whether the component should ignore user interaction.
1598
- * @default false
1599
- */
1600
- disabled?: boolean | undefined;
1601
- /**
1602
- * Overrides the text label to use when the item is matched during keyboard text navigation.
1603
- */
1604
- label?: string | undefined;
1605
- /**
1606
- * @ignore
1607
- */
1608
- id?: string | undefined;
1609
- /**
1610
- * Whether to close the menu when the item is clicked.
1611
- * @default false
1612
- */
1613
- closeOnClick?: boolean | undefined;
1614
- }
1615
- export type MenuCheckboxItemChangeEventReason = MenuRoot.ChangeEventReason;
1616
- export type MenuCheckboxItemChangeEventDetails = MenuRoot.ChangeEventDetails;
1617
- declare namespace MenuCheckboxItem {
1618
- type State = MenuCheckboxItemState;
1619
- type Props = MenuCheckboxItemProps;
1620
- type ChangeEventReason = MenuCheckboxItemChangeEventReason;
1621
- type ChangeEventDetails = MenuCheckboxItemChangeEventDetails;
1622
- }
1623
- declare const MenuCheckboxItemIndicator: React$1.ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
1624
- interface MenuCheckboxItemIndicatorProps extends BaseUIComponentProps<"span", MenuCheckboxItemIndicatorState> {
1625
- /**
1626
- * Whether to keep the HTML element in the DOM when the checkbox item is not checked.
1627
- * @default false
1628
- */
1629
- keepMounted?: boolean | undefined;
1630
- }
1631
- interface MenuCheckboxItemIndicatorState {
1632
- /**
1633
- * Whether the checkbox item is currently ticked.
1634
- */
1635
- checked: boolean;
1636
- /**
1637
- * Whether the component should ignore user interaction.
1638
- */
1639
- disabled: boolean;
1640
- /**
1641
- * Whether the item is highlighted.
1642
- */
1643
- highlighted: boolean;
1644
- /**
1645
- * The transition status of the component.
1646
- */
1647
- transitionStatus: TransitionStatus;
1648
- }
1649
- declare namespace MenuCheckboxItemIndicator {
1650
- type Props = MenuCheckboxItemIndicatorProps;
1651
- type State = MenuCheckboxItemIndicatorState;
1652
- }
1653
- declare const MenuGroup: React$1.ForwardRefExoticComponent<Omit<MenuGroupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1654
- interface MenuGroupProps extends BaseUIComponentProps<"div", MenuGroupState> {
1655
- /**
1656
- * The content of the component.
1657
- */
1658
- children?: React$1.ReactNode;
1659
- }
1660
- interface MenuGroupState {
1661
- }
1662
- declare namespace MenuGroup {
1663
- type Props = MenuGroupProps;
1664
- type State = MenuGroupState;
1665
- }
1666
- declare const MenuGroupLabel: React$1.ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1667
- interface MenuGroupLabelProps extends BaseUIComponentProps<"div", MenuGroupLabelState> {
1668
- }
1669
- interface MenuGroupLabelState {
1670
- }
1671
- declare namespace MenuGroupLabel {
1672
- type Props = MenuGroupLabelProps;
1673
- type State = MenuGroupLabelState;
1674
- }
1675
- declare const MenuItem: React$1.ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
1676
- interface MenuItemState {
1677
- /**
1678
- * Whether the item should ignore user interaction.
1679
- */
1680
- disabled: boolean;
1681
- /**
1682
- * Whether the item is highlighted.
1683
- */
1684
- highlighted: boolean;
1685
- }
1686
- interface MenuItemProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuItemState> {
1687
- /**
1688
- * The click handler for the menu item.
1689
- */
1690
- onClick?: BaseUIComponentProps<"div", MenuItemState>["onClick"] | undefined;
1691
- /**
1692
- * Whether the component should ignore user interaction.
1693
- * @default false
1694
- */
1695
- disabled?: boolean | undefined;
1696
- /**
1697
- * Overrides the text label to use when the item is matched during keyboard text navigation.
1698
- */
1699
- label?: string | undefined;
1700
- /**
1701
- * @ignore
1702
- */
1703
- id?: string | undefined;
1704
- /**
1705
- * Whether to close the menu when the item is clicked.
1706
- *
1707
- * @default true
1708
- */
1709
- closeOnClick?: boolean | undefined;
1710
- }
1711
- declare namespace MenuItem {
1712
- type State = MenuItemState;
1713
- type Props = MenuItemProps;
1714
- }
1715
- declare const MenuLinkItem: React$1.ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & React$1.RefAttributes<Element>>;
1716
- interface MenuLinkItemState {
1717
- /**
1718
- * Whether the item is highlighted.
1719
- */
1720
- highlighted: boolean;
1721
- }
1722
- interface MenuLinkItemProps extends BaseUIComponentProps<"a", MenuLinkItemState> {
1723
- /**
1724
- * Overrides the text label to use when the item is matched during keyboard text navigation.
1725
- */
1726
- label?: string | undefined;
1727
- /**
1728
- * @ignore
1729
- */
1730
- id?: string | undefined;
1731
- /**
1732
- * Whether to close the menu when the item is clicked.
1733
- * @default false
1734
- */
1735
- closeOnClick?: boolean | undefined;
1736
- }
1737
- declare namespace MenuLinkItem {
1738
- type State = MenuLinkItemState;
1739
- type Props = MenuLinkItemProps;
1740
- }
1741
- declare const MenuPopup: React$1.ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1742
- interface MenuPopupProps extends BaseUIComponentProps<"div", MenuPopupState> {
1743
- children?: React$1.ReactNode;
1744
- /**
1745
- * @ignore
1746
- */
1747
- id?: string | undefined;
1748
- /**
1749
- * Determines the element to focus when the menu is closed.
1750
- *
1751
- * - `false`: Do not move focus.
1752
- * - `true`: Move focus based on the default behavior (trigger or previously focused element).
1753
- * - `RefObject`: Move focus to the ref element.
1754
- * - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
1755
- * Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
1756
- */
1757
- finalFocus?: boolean | React$1.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefined;
1758
- }
1759
- interface MenuPopupState {
1760
- /**
1761
- * The transition status of the component.
1762
- */
1763
- transitionStatus: TransitionStatus;
1764
- /**
1765
- * The side of the anchor the component is placed on.
1766
- */
1767
- side: Side$1;
1768
- /**
1769
- * The alignment of the component relative to the anchor.
1770
- */
1771
- align: Align;
1772
- /**
1773
- * Whether the menu is currently open.
1774
- */
1775
- open: boolean;
1776
- /**
1777
- * Whether the component is nested.
1778
- */
1779
- nested: boolean;
1780
- /**
1781
- * Whether transitions should be skipped.
1782
- */
1783
- instant: "dismiss" | "click" | "group" | "trigger-change" | undefined;
1784
- }
1785
- declare namespace MenuPopup {
1786
- type Props = MenuPopupProps;
1787
- type State = MenuPopupState;
1788
- }
1789
- declare const MenuPortal: React$1.ForwardRefExoticComponent<Omit<MenuPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1790
- interface MenuPortalState {
1791
- }
1792
- interface MenuPortalProps extends FloatingPortal.Props<MenuPortalState> {
1793
- /**
1794
- * Whether to keep the portal mounted in the DOM while the popup is hidden.
1795
- * @default false
1796
- */
1797
- keepMounted?: boolean | undefined;
1798
- }
1799
- declare namespace MenuPortal {
1800
- type State = MenuPortalState;
1801
- type Props = MenuPortalProps;
1802
- }
1803
- declare const MenuPositioner: React$1.ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1804
- interface MenuPositionerState {
1805
- /**
1806
- * Whether the menu is currently open.
1807
- */
1808
- open: boolean;
1809
- /**
1810
- * The side of the anchor the component is placed on.
1811
- */
1812
- side: Side$1;
1813
- /**
1814
- * The alignment of the component relative to the anchor.
1815
- */
1816
- align: Align;
1817
- /**
1818
- * Whether the anchor element is hidden.
1819
- */
1820
- anchorHidden: boolean;
1821
- /**
1822
- * Whether the component is nested.
1823
- */
1824
- nested: boolean;
1825
- /**
1826
- * Whether CSS transitions should be disabled.
1827
- */
1828
- instant: string | undefined;
1829
- }
1830
- interface MenuPositionerProps extends UseAnchorPositioningSharedParameters, BaseUIComponentProps<"div", MenuPositionerState> {
1831
- }
1832
- declare namespace MenuPositioner {
1833
- type State = MenuPositionerState;
1834
- type Props = MenuPositionerProps;
1835
- }
1836
- declare const MenuRadioGroup: React$1.NamedExoticComponent<Omit<MenuRadioGroupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1837
- interface MenuRadioGroupProps extends BaseUIComponentProps<"div", MenuRadioGroupState> {
1838
- /**
1839
- * The content of the component.
1840
- */
1841
- children?: React$1.ReactNode;
1842
- /**
1843
- * The controlled value of the radio item that should be currently selected.
1844
- *
1845
- * To render an uncontrolled radio group, use the `defaultValue` prop instead.
1846
- */
1847
- value?: any;
1848
- /**
1849
- * The uncontrolled value of the radio item that should be initially selected.
1850
- *
1851
- * To render a controlled radio group, use the `value` prop instead.
1852
- */
1853
- defaultValue?: any;
1854
- /**
1855
- * Function called when the selected value changes.
1856
- */
1857
- onValueChange?: ((value: any, eventDetails: MenuRadioGroup.ChangeEventDetails) => void) | undefined;
1858
- /**
1859
- * Whether the component should ignore user interaction.
1860
- *
1861
- * @default false
1862
- */
1863
- disabled?: boolean | undefined;
1864
- }
1865
- interface MenuRadioGroupState {
1866
- /**
1867
- * Whether the component is disabled.
1868
- */
1869
- disabled: boolean;
1870
- }
1871
- export type MenuRadioGroupChangeEventReason = MenuRoot.ChangeEventReason;
1872
- export type MenuRadioGroupChangeEventDetails = MenuRoot.ChangeEventDetails;
1873
- declare namespace MenuRadioGroup {
1874
- type Props = MenuRadioGroupProps;
1875
- type State = MenuRadioGroupState;
1876
- type ChangeEventReason = MenuRadioGroupChangeEventReason;
1877
- type ChangeEventDetails = MenuRadioGroupChangeEventDetails;
1878
- }
1879
- declare const MenuRadioItem: React$1.ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
1880
- interface MenuRadioItemState {
1881
- /**
1882
- * Whether the radio item should ignore user interaction.
1883
- */
1884
- disabled: boolean;
1885
- /**
1886
- * Whether the radio item is currently highlighted.
1887
- */
1888
- highlighted: boolean;
1889
- /**
1890
- * Whether the radio item is currently selected.
1891
- */
1892
- checked: boolean;
1893
- }
1894
- interface MenuRadioItemProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuRadioItemState> {
1895
- /**
1896
- * Value of the radio item.
1897
- * This is the value that will be set in the MenuRadioGroup when the item is selected.
1898
- */
1899
- value: any;
1900
- /**
1901
- * The click handler for the menu item.
1902
- */
1903
- onClick?: BaseUIComponentProps<"div", MenuRadioItemState>["onClick"] | undefined;
1904
- /**
1905
- * Whether the component should ignore user interaction.
1906
- * @default false
1907
- */
1908
- disabled?: boolean | undefined;
1909
- /**
1910
- * Overrides the text label to use when the item is matched during keyboard text navigation.
1911
- */
1912
- label?: string | undefined;
1913
- /**
1914
- * @ignore
1915
- */
1916
- id?: string | undefined;
1917
- /**
1918
- * Whether to close the menu when the item is clicked.
1919
- * @default false
1920
- */
1921
- closeOnClick?: boolean | undefined;
1922
- }
1923
- declare namespace MenuRadioItem {
1924
- type State = MenuRadioItemState;
1925
- type Props = MenuRadioItemProps;
1926
- }
1927
- declare const MenuRadioItemIndicator: React$1.ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
1928
- interface MenuRadioItemIndicatorProps extends BaseUIComponentProps<"span", MenuRadioItemIndicatorState> {
1929
- /**
1930
- * Whether to keep the HTML element in the DOM when the radio item is inactive.
1931
- * @default false
1932
- */
1933
- keepMounted?: boolean | undefined;
1934
- }
1935
- interface MenuRadioItemIndicatorState {
1936
- /**
1937
- * Whether the radio item is currently selected.
1938
- */
1939
- checked: boolean;
1940
- /**
1941
- * Whether the component should ignore user interaction.
1942
- */
1943
- disabled: boolean;
1944
- /**
1945
- * Whether the item is highlighted.
1946
- */
1947
- highlighted: boolean;
1948
- /**
1949
- * The transition status of the component.
1950
- */
1951
- transitionStatus: TransitionStatus;
1952
- }
1953
- declare namespace MenuRadioItemIndicator {
1954
- type Props = MenuRadioItemIndicatorProps;
1955
- type State = MenuRadioItemIndicatorState;
1956
- }
1957
- declare function MenuSubmenuRoot(props: MenuSubmenuRoot.Props): import("react/jsx-runtime").React$1.JSX.Element;
1958
- interface MenuSubmenuRootProps extends Omit<MenuRoot.Props, "modal" | "openOnHover" | "onOpenChange"> {
1959
- /**
1960
- * Event handler called when the menu is opened or closed.
1961
- */
1962
- onOpenChange?: ((open: boolean, eventDetails: MenuSubmenuRoot.ChangeEventDetails) => void) | undefined;
1963
- /**
1964
- * When in a submenu, determines whether pressing the Escape key
1965
- * closes the entire menu, or only the current child menu.
1966
- * @default false
1967
- */
1968
- closeParentOnEsc?: boolean | undefined;
1969
- }
1970
- interface MenuSubmenuRootState {
1971
- }
1972
- export type MenuSubmenuRootChangeEventReason = MenuRoot.ChangeEventReason;
1973
- export type MenuSubmenuRootChangeEventDetails = MenuRoot.ChangeEventDetails;
1974
- declare namespace MenuSubmenuRoot {
1975
- type Props = MenuSubmenuRootProps;
1976
- type State = MenuSubmenuRootState;
1977
- type ChangeEventReason = MenuSubmenuRootChangeEventReason;
1978
- type ChangeEventDetails = MenuSubmenuRootChangeEventDetails;
1979
- }
1980
- declare const MenuTrigger: MenuTrigger;
1981
- export interface MenuTrigger {
1982
- <Payload>(componentProps: MenuTriggerProps<Payload> & React$1.RefAttributes<HTMLElement>): React$1.JSX.Element;
1983
- }
1984
- export interface MenuTriggerProps<Payload = unknown> extends NativeButtonProps, BaseUIComponentProps<"button", MenuTriggerState> {
1985
- children?: React$1.ReactNode;
1986
- /**
1987
- * Whether the component should ignore user interaction.
1988
- * @default false
1989
- */
1990
- disabled?: boolean | undefined;
1991
- /**
1992
- * A handle to associate the trigger with a menu.
1993
- */
1994
- handle?: MenuHandle<Payload> | undefined;
1995
- /**
1996
- * A payload to pass to the menu when it is opened.
1997
- */
1998
- payload?: Payload | undefined;
1999
- /**
2000
- * How long to wait before the menu may be opened on hover. Specified in milliseconds.
2001
- *
2002
- * Requires the `openOnHover` prop.
2003
- * @default 100
2004
- */
2005
- delay?: number | undefined;
2006
- /**
2007
- * How long to wait before closing the menu that was opened on hover.
2008
- * Specified in milliseconds.
2009
- *
2010
- * Requires the `openOnHover` prop.
2011
- * @default 0
2012
- */
2013
- closeDelay?: number | undefined;
2014
- /**
2015
- * Whether the menu should also open when the trigger is hovered.
2016
- */
2017
- openOnHover?: boolean | undefined;
2018
- }
2019
- export interface MenuTriggerState {
2020
- /**
2021
- * Whether the menu is currently open.
2022
- */
2023
- open: boolean;
2024
- /**
2025
- * Whether the trigger is disabled.
2026
- */
2027
- disabled: boolean;
2028
- }
2029
- declare namespace MenuTrigger {
2030
- type Props<Payload = unknown> = MenuTriggerProps<Payload>;
2031
- type State = MenuTriggerState;
2032
- }
2033
- declare const MenuViewport: React$1.ForwardRefExoticComponent<Omit<MenuViewport.Props, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
2034
- declare namespace MenuViewport {
2035
- interface Props extends BaseUIComponentProps<"div", State> {
2036
- /**
2037
- * The content to render inside the transition container.
2038
- */
2039
- children?: React$1.ReactNode;
2040
- }
2041
- interface State {
2042
- activationDirection: string | undefined;
2043
- /**
2044
- * Whether the viewport is currently transitioning between contents.
2045
- */
2046
- transitioning: boolean;
2047
- /**
2048
- * Present if animations should be instant.
2049
- */
2050
- instant: "dismiss" | "click" | "group" | "trigger-change" | undefined;
2051
- }
2052
- }
2053
- declare const Separator: React$1.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
2054
- export interface SeparatorProps extends BaseUIComponentProps<"div", SeparatorState> {
2055
- /**
2056
- * The orientation of the separator.
2057
- * @default 'horizontal'
2058
- */
2059
- orientation?: Orientation | undefined;
2060
- }
2061
- export interface SeparatorState {
2062
- /**
2063
- * The orientation of the separator.
2064
- */
2065
- orientation: Orientation;
2066
- }
2067
- declare namespace Separator {
2068
- type Props = SeparatorProps;
2069
- type State = SeparatorState;
2070
- }
2071
- declare const MenuSubmenuTrigger: React$1.ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
2072
- interface MenuSubmenuTriggerState {
2073
- /**
2074
- * Whether the component should ignore user interaction.
2075
- */
2076
- disabled: boolean;
2077
- /**
2078
- * Whether the item is highlighted.
2079
- */
2080
- highlighted: boolean;
2081
- /**
2082
- * Whether the menu is currently open.
2083
- */
2084
- open: boolean;
2085
- }
2086
- interface MenuSubmenuTriggerProps extends NonNativeButtonProps, BaseUIComponentProps<"div", MenuSubmenuTriggerState> {
2087
- onClick?: BaseUIComponentProps<"div", MenuSubmenuTriggerState>["onClick"] | undefined;
2088
- /**
2089
- * Overrides the text label to use when the item is matched during keyboard text navigation.
2090
- */
2091
- label?: string | undefined;
2092
- /**
2093
- * @ignore
2094
- */
2095
- id?: string | undefined;
2096
- /**
2097
- * Whether the component should ignore user interaction.
2098
- * @default false
2099
- */
2100
- disabled?: boolean | undefined;
2101
- /**
2102
- * How long to wait before the menu may be opened on hover. Specified in milliseconds.
2103
- *
2104
- * Requires the `openOnHover` prop.
2105
- * @default 100
2106
- */
2107
- delay?: number | undefined;
2108
- /**
2109
- * How long to wait before closing the menu that was opened on hover.
2110
- * Specified in milliseconds.
2111
- *
2112
- * Requires the `openOnHover` prop.
2113
- * @default 0
2114
- */
2115
- closeDelay?: number | undefined;
2116
- /**
2117
- * Whether the menu should also open when the trigger is hovered.
2118
- */
2119
- openOnHover?: boolean | undefined;
2120
- }
2121
- declare namespace MenuSubmenuTrigger {
2122
- type Props = MenuSubmenuTriggerProps;
2123
- type State = MenuSubmenuTriggerState;
2124
- }
2125
- /**
2126
- * A component that creates a context menu activated by right clicking or long pressing.
2127
- * Doesn't render its own HTML element.
2128
- *
2129
- * Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)
2130
- */
2131
- export declare function ContextMenuRoot(props: ContextMenuRoot.Props): import("react/jsx-runtime").React$1.JSX.Element;
2132
- export interface ContextMenuRootState {
2133
- }
2134
- export interface ContextMenuRootProps extends Omit<Menu.Root.Props, "modal" | "openOnHover" | "delay" | "closeDelay" | "onOpenChange"> {
2135
- /**
2136
- * Event handler called when the menu is opened or closed.
2137
- */
2138
- onOpenChange?: ((open: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void) | undefined;
2139
- }
2140
- export type ContextMenuRootActions = MenuRoot.Actions;
2141
- export type ContextMenuRootChangeEventReason = MenuRoot.ChangeEventReason;
2142
- export type ContextMenuRootChangeEventDetails = BaseUIChangeEventDetails<ContextMenuRoot.ChangeEventReason>;
2143
- export declare namespace ContextMenuRoot {
2144
- type State = ContextMenuRootState;
2145
- type Props = ContextMenuRootProps;
2146
- type Actions = ContextMenuRootActions;
2147
- type ChangeEventReason = ContextMenuRootChangeEventReason;
2148
- type ChangeEventDetails = ContextMenuRootChangeEventDetails;
2149
- }
2150
- /**
2151
- * An area that opens the menu on right click or long press.
2152
- * Renders a `<div>` element.
2153
- *
2154
- * Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)
2155
- */
2156
- export declare const ContextMenuTrigger: React$1.ForwardRefExoticComponent<Omit<ContextMenuTriggerProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
2157
- export interface ContextMenuTriggerState {
2158
- /**
2159
- * Whether the context menu is currently open.
2160
- */
2161
- open: boolean;
2162
- }
2163
- export interface ContextMenuTriggerProps extends BaseUIComponentProps<"div", ContextMenuTriggerState> {
2164
- }
2165
- export declare namespace ContextMenuTrigger {
2166
- type State = ContextMenuTriggerState;
2167
- type Props = ContextMenuTriggerProps;
2168
- }
2169
-
2170
- declare namespace Menu {
2171
- export { MenuArrow as Arrow, MenuBackdrop as Backdrop, MenuCheckboxItem as CheckboxItem, MenuCheckboxItemIndicator as CheckboxItemIndicator, MenuGroup as Group, MenuGroupLabel as GroupLabel, MenuHandle as Handle, MenuItem as Item, MenuLinkItem as LinkItem, MenuPopup as Popup, MenuPortal as Portal, MenuPositioner as Positioner, MenuRadioGroup as RadioGroup, MenuRadioItem as RadioItem, MenuRadioItemIndicator as RadioItemIndicator, MenuRoot as Root, MenuSubmenuRoot as SubmenuRoot, MenuSubmenuTrigger as SubmenuTrigger, MenuTrigger as Trigger, MenuViewport as Viewport, Separator, createMenuHandle as createHandle };
2172
- }
2173
- declare namespace ContextMenu {
2174
- export { ContextMenuRoot as Root, ContextMenuTrigger as Trigger, MenuArrow as Arrow, MenuBackdrop as Backdrop, MenuCheckboxItem as CheckboxItem, MenuCheckboxItemIndicator as CheckboxItemIndicator, MenuGroup as Group, MenuGroupLabel as GroupLabel, MenuItem as Item, MenuLinkItem as LinkItem, MenuPopup as Popup, MenuPortal as Portal, MenuPositioner as Positioner, MenuRadioGroup as RadioGroup, MenuRadioItem as RadioItem, MenuRadioItemIndicator as RadioItemIndicator, MenuSubmenuRoot as SubmenuRoot, MenuSubmenuTrigger as SubmenuTrigger, Separator };
2175
- }
2176
-
2177
- export {
2178
- ContextMenu,
2179
- MenuArrowProps as ContextMenuArrowProps,
2180
- MenuArrowState as ContextMenuArrowState,
2181
- MenuBackdropProps as ContextMenuBackdropProps,
2182
- MenuBackdropState as ContextMenuBackdropState,
2183
- MenuCheckboxItemIndicatorProps as ContextMenuCheckboxItemIndicatorProps,
2184
- MenuCheckboxItemIndicatorState as ContextMenuCheckboxItemIndicatorState,
2185
- MenuCheckboxItemProps as ContextMenuCheckboxItemProps,
2186
- MenuCheckboxItemState as ContextMenuCheckboxItemState,
2187
- MenuGroupLabelProps as ContextMenuGroupLabelProps,
2188
- MenuGroupLabelState as ContextMenuGroupLabelState,
2189
- MenuGroupProps as ContextMenuGroupProps,
2190
- MenuGroupState as ContextMenuGroupState,
2191
- MenuItemProps as ContextMenuItemProps,
2192
- MenuItemState as ContextMenuItemState,
2193
- MenuLinkItemProps as ContextMenuLinkItemProps,
2194
- MenuLinkItemState as ContextMenuLinkItemState,
2195
- MenuPopupProps as ContextMenuPopupProps,
2196
- MenuPopupState as ContextMenuPopupState,
2197
- MenuPortalProps as ContextMenuPortalProps,
2198
- MenuPortalState as ContextMenuPortalState,
2199
- MenuPositionerProps as ContextMenuPositionerProps,
2200
- MenuPositionerState as ContextMenuPositionerState,
2201
- MenuRadioGroupProps as ContextMenuRadioGroupProps,
2202
- MenuRadioGroupState as ContextMenuRadioGroupState,
2203
- MenuRadioItemIndicatorProps as ContextMenuRadioItemIndicatorProps,
2204
- MenuRadioItemIndicatorState as ContextMenuRadioItemIndicatorState,
2205
- MenuRadioItemProps as ContextMenuRadioItemProps,
2206
- MenuRadioItemState as ContextMenuRadioItemState,
2207
- MenuSubmenuRootProps as ContextMenuSubmenuRootProps,
2208
- MenuSubmenuRootState as ContextMenuSubmenuRootState,
2209
- MenuSubmenuTriggerProps as ContextMenuSubmenuTriggerProps,
2210
- MenuSubmenuTriggerState as ContextMenuSubmenuTriggerState,
2211
- };
2212
-
2213
- export {};