@stevederico/skateboard-ui 3.11.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 +17 -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 -48
  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,1608 +0,0 @@
1
- /* @base-ui/react 1.5.0 — vendored (MIT — MUI Inc).
2
- * Refresh: scripts/vendor-base-ui.js (see header for instructions).
3
- * Do not edit by hand. */
4
- import * as React$1 from 'react';
5
-
6
- declare const none: "none";
7
- declare const triggerPress: "trigger-press";
8
- declare const triggerHover: "trigger-hover";
9
- declare const triggerFocus: "trigger-focus";
10
- declare const outsidePress: "outside-press";
11
- declare const itemPress: "item-press";
12
- declare const closePress: "close-press";
13
- declare const linkPress: "link-press";
14
- declare const clearPress: "clear-press";
15
- declare const chipRemovePress: "chip-remove-press";
16
- declare const trackPress: "track-press";
17
- declare const incrementPress: "increment-press";
18
- declare const decrementPress: "decrement-press";
19
- declare const inputChange: "input-change";
20
- declare const inputClear: "input-clear";
21
- declare const inputBlur: "input-blur";
22
- declare const inputPaste: "input-paste";
23
- declare const inputPress: "input-press";
24
- declare const focusOut: "focus-out";
25
- declare const escapeKey: "escape-key";
26
- declare const closeWatcher: "close-watcher";
27
- declare const listNavigation: "list-navigation";
28
- declare const keyboard: "keyboard";
29
- declare const pointer: "pointer";
30
- declare const drag: "drag";
31
- declare const wheel: "wheel";
32
- declare const scrub: "scrub";
33
- declare const cancelOpen: "cancel-open";
34
- declare const siblingOpen: "sibling-open";
35
- declare const disabled: "disabled";
36
- declare const missing: "missing";
37
- declare const initial: "initial";
38
- declare const imperativeAction: "imperative-action";
39
- declare const swipe: "swipe";
40
- declare const windowResize: "window-resize";
41
- export interface ReasonToEventMap {
42
- [none]: Event;
43
- [triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
44
- [triggerHover]: MouseEvent;
45
- [triggerFocus]: FocusEvent;
46
- [outsidePress]: MouseEvent | PointerEvent | TouchEvent;
47
- [itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
48
- [closePress]: MouseEvent | KeyboardEvent | PointerEvent;
49
- [linkPress]: MouseEvent | PointerEvent;
50
- [clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
51
- [chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
52
- [trackPress]: PointerEvent | MouseEvent | TouchEvent;
53
- [incrementPress]: PointerEvent | MouseEvent | TouchEvent;
54
- [decrementPress]: PointerEvent | MouseEvent | TouchEvent;
55
- [inputChange]: InputEvent | Event;
56
- [inputClear]: InputEvent | FocusEvent | Event;
57
- [inputBlur]: FocusEvent;
58
- [inputPaste]: ClipboardEvent;
59
- [inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
60
- [focusOut]: FocusEvent | KeyboardEvent;
61
- [escapeKey]: KeyboardEvent;
62
- [closeWatcher]: Event;
63
- [listNavigation]: KeyboardEvent;
64
- [keyboard]: KeyboardEvent;
65
- [pointer]: PointerEvent;
66
- [drag]: PointerEvent | TouchEvent;
67
- [swipe]: PointerEvent | TouchEvent;
68
- [wheel]: WheelEvent;
69
- [scrub]: PointerEvent;
70
- [cancelOpen]: MouseEvent;
71
- [siblingOpen]: Event;
72
- [disabled]: Event;
73
- [missing]: Event;
74
- [initial]: Event;
75
- [imperativeAction]: Event;
76
- [windowResize]: UIEvent;
77
- }
78
- /**
79
- * Maps a change `reason` string to the corresponding native event type.
80
- */
81
- export type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
82
- export type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
83
- /**
84
- * The reason for the event.
85
- */
86
- reason: Reason;
87
- /**
88
- * The native event associated with the custom event.
89
- */
90
- event: ReasonToEvent<Reason>;
91
- /**
92
- * Cancels Base UI from handling the event.
93
- */
94
- cancel: () => void;
95
- /**
96
- * Allows the event to propagate in cases where Base UI will stop the propagation.
97
- */
98
- allowPropagation: () => void;
99
- /**
100
- * Indicates whether the event has been canceled.
101
- */
102
- isCanceled: boolean;
103
- /**
104
- * Indicates whether the event is allowed to propagate.
105
- */
106
- isPropagationAllowed: boolean;
107
- /**
108
- * The element that triggered the event, if applicable.
109
- */
110
- trigger: Element | undefined;
111
- } & CustomProperties;
112
- /**
113
- * Details of custom change events emitted by Base UI components.
114
- */
115
- export type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
116
- export declare type AlignedPlacement = `${Side}-${Alignment}`;
117
- export declare type Alignment = "start" | "end";
118
- export declare type Axis = "x" | "y";
119
- export declare type ClientRectObject = Prettify<Rect & SideObject>;
120
- export declare type Coords = {
121
- [key in Axis]: number;
122
- };
123
- export declare type Dimensions = {
124
- [key in Length]: number;
125
- };
126
- export declare type Length = "width" | "height";
127
- export declare type Padding = number | Prettify<Partial<SideObject>>;
128
- export declare type Placement = Prettify<Side | AlignedPlacement>;
129
- export declare type Prettify<T> = {
130
- [K in keyof T]: T[K];
131
- } & {};
132
- export declare type Rect = Prettify<Coords & Dimensions>;
133
- export declare type Side = "top" | "right" | "bottom" | "left";
134
- export declare type SideObject = {
135
- [key in Side]: number;
136
- };
137
- export declare type Strategy = "absolute" | "fixed";
138
- export declare interface ComputePositionReturn extends Coords {
139
- /**
140
- * The final chosen placement of the floating element.
141
- */
142
- placement: Placement;
143
- /**
144
- * The strategy used to position the floating element.
145
- */
146
- strategy: Strategy;
147
- /**
148
- * Object containing data returned from all middleware, keyed by their name.
149
- */
150
- middlewareData: MiddlewareData;
151
- }
152
- export declare interface MiddlewareData {
153
- [key: string]: any;
154
- arrow?: Partial<Coords> & {
155
- centerOffset: number;
156
- alignmentOffset?: number;
157
- };
158
- autoPlacement?: {
159
- index?: number;
160
- overflows: Array<{
161
- placement: Placement;
162
- overflows: Array<number>;
163
- }>;
164
- };
165
- flip?: {
166
- index?: number;
167
- overflows: Array<{
168
- placement: Placement;
169
- overflows: Array<number>;
170
- }>;
171
- };
172
- hide?: {
173
- referenceHidden?: boolean;
174
- escaped?: boolean;
175
- referenceHiddenOffsets?: SideObject;
176
- escapedOffsets?: SideObject;
177
- };
178
- offset?: Coords & {
179
- placement: Placement;
180
- };
181
- shift?: Coords & {
182
- enabled: {
183
- [key in Axis]: boolean;
184
- };
185
- };
186
- }
187
- /**
188
- * Custom positioning reference element.
189
- * @see https://floating-ui.com/docs/virtual-elements
190
- */
191
- export declare interface VirtualElement {
192
- getBoundingClientRect(): ClientRectObject;
193
- getClientRects?(): Array<ClientRectObject> | DOMRectList;
194
- contextElement?: Element;
195
- }
196
- declare type Prettify$1<T> = {
197
- [K in keyof T]: T[K];
198
- } & {};
199
- export declare type ReferenceType = Element | VirtualElement;
200
- export declare type UseFloatingData = Prettify$1<ComputePositionReturn & {
201
- isPositioned: boolean;
202
- }>;
203
- export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify$1<UseFloatingData & {
204
- /**
205
- * Update the position of the floating element, re-rendering the component
206
- * if required.
207
- */
208
- update: () => void;
209
- /**
210
- * Pre-configured positioning styles to apply to the floating element.
211
- */
212
- floatingStyles: React$1.CSSProperties;
213
- /**
214
- * Object containing the reference and floating refs and reactive setters.
215
- */
216
- refs: {
217
- /**
218
- * A React ref to the reference element.
219
- */
220
- reference: React$1.MutableRefObject<RT | null>;
221
- /**
222
- * A React ref to the floating element.
223
- */
224
- floating: React$1.MutableRefObject<HTMLElement | null>;
225
- /**
226
- * A callback to set the reference element (reactive).
227
- */
228
- setReference: (node: RT | null) => void;
229
- /**
230
- * A callback to set the floating element (reactive).
231
- */
232
- setFloating: (node: HTMLElement | null) => void;
233
- };
234
- /**
235
- * Object containing the reference and floating elements.
236
- */
237
- elements: {
238
- reference: RT | null;
239
- floating: HTMLElement | null;
240
- };
241
- }>;
242
- export interface InlineRectCoords {
243
- /** The x position in viewport coordinates. */
244
- x: number;
245
- /** The y position in viewport coordinates. */
246
- y: number;
247
- /** The line index under the pointer when coordinates were captured. */
248
- lineIndex?: number | undefined;
249
- /** The trigger element whose rects produced these coordinates. */
250
- element: Element;
251
- }
252
- export type Listener<T> = (state: T) => void;
253
- declare class Store<State> {
254
- /**
255
- * The current state of the store.
256
- * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
257
- * 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).
258
- * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
259
- *
260
- * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
261
- */
262
- state: State;
263
- private listeners;
264
- private updateTick;
265
- constructor(state: State);
266
- /**
267
- * Registers a listener that will be called whenever the store's state changes.
268
- *
269
- * @param fn The listener function to be called on state changes.
270
- * @returns A function to unsubscribe the listener.
271
- */
272
- subscribe: (fn: Listener<State>) => () => void;
273
- /**
274
- * Returns the current state of the store.
275
- */
276
- getSnapshot: () => State;
277
- /**
278
- * Updates the entire store's state and notifies all registered listeners.
279
- *
280
- * @param newState The new state to set for the store.
281
- */
282
- setState(newState: State): void;
283
- /**
284
- * Merges the provided changes into the current state and notifies listeners if there are changes.
285
- *
286
- * @param changes An object containing the changes to apply to the current state.
287
- */
288
- update(changes: Partial<State>): void;
289
- /**
290
- * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
291
- *
292
- * @param key The key in the store's state to update.
293
- * @param value The new value to set for the specified key.
294
- */
295
- set<T>(key: keyof State, value: T): void;
296
- /**
297
- * Gives the state a new reference and updates all registered listeners.
298
- */
299
- notifyAll(): void;
300
- use<F extends (...args: any) => any>(selector: F, ...args: SelectorArgs<F>): ReturnType<F>;
301
- }
302
- export type SelectorArgs<Selector> = Selector extends ((...params: infer Params) => any) ? Tail<Params> : never;
303
- export type Tail<T extends readonly any[]> = T extends readonly [
304
- any,
305
- ...infer Rest
306
- ] ? Rest : [
307
- ];
308
- declare class ReactStore<State extends object, Context = Record<string, never>, Selectors extends Record<string, SelectorFunction<State>> = Record<string, never>> extends Store<State> {
309
- /**
310
- * Creates a new ReactStore instance.
311
- *
312
- * @param state Initial state of the store.
313
- * @param context Non-reactive context values.
314
- * @param selectors Optional selectors for use with `useState`.
315
- */
316
- constructor(state: State, context?: Context, selectors?: Selectors);
317
- /**
318
- * Non-reactive values such as refs, callbacks, etc.
319
- */
320
- readonly context: Context;
321
- private selectors;
322
- /**
323
- * Synchronizes a single external value into the store.
324
- *
325
- * Note that the while the value in `state` is updated immediately, the value returned
326
- * by `useState` is updated before the next render (similarly to React's `useState`).
327
- */
328
- useSyncedValue<Key extends keyof State, Value extends State[Key]>(key: keyof State, value: Value): void;
329
- /**
330
- * Synchronizes a single external value into the store and
331
- * cleans it up (sets to `undefined`) on unmount.
332
- *
333
- * Note that the while the value in `state` is updated immediately, the value returned
334
- * by `useState` is updated before the next render (similarly to React's `useState`).
335
- */
336
- useSyncedValueWithCleanup<Key extends KeysAllowingUndefined<State>>(key: Key, value: State[Key]): void;
337
- /**
338
- * Synchronizes multiple external values into the store.
339
- *
340
- * Note that the while the values in `state` are updated immediately, the values returned
341
- * by `useState` are updated before the next render (similarly to React's `useState`).
342
- */
343
- useSyncedValues(statePart: Partial<State>): void;
344
- /**
345
- * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
346
- * is non-undefined, the store's state at `key` is updated to match `controlled`.
347
- */
348
- useControlledProp<Key extends keyof State, Value extends State[Key]>(key: keyof State, controlled: Value | undefined): void;
349
- /** Gets the current value from the store using a selector with the provided key.
350
- *
351
- * @param key Key of the selector to use.
352
- */
353
- select<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
354
- /**
355
- * Returns a value from the store's state using a selector function.
356
- * Used to subscribe to specific parts of the state.
357
- * This methods causes a rerender whenever the selected state changes.
358
- *
359
- * @param key Key of the selector to use.
360
- */
361
- useState<Key extends keyof Selectors>(key: Key, ...args: SelectorArgs$1<Selectors[Key]>): ReturnType<Selectors[Key]>;
362
- /**
363
- * Wraps a function with `useStableCallback` to ensure it has a stable reference
364
- * and assigns it to the context.
365
- *
366
- * @param key Key of the event callback. Must be a function in the context.
367
- * @param fn Function to assign.
368
- */
369
- useContextCallback<Key extends ContextFunctionKeys<Context>>(key: Key, fn: ContextFunction<Context, Key> | undefined): void;
370
- /**
371
- * Returns a stable setter function for a specific key in the store's state.
372
- * It's commonly used to pass as a ref callback to React elements.
373
- *
374
- * @param key Key of the state to set.
375
- */
376
- useStateSetter<const Key extends keyof State, Value extends State[Key]>(key: keyof State): (v: Value) => void;
377
- /**
378
- * Observes changes derived from the store's selectors and calls the listener when the selected value changes.
379
- *
380
- * @param key Key of the selector to observe.
381
- * @param listener Listener function called when the selector result changes.
382
- */
383
- observe<Key extends keyof Selectors>(selector: Key, listener: (newValue: ReturnType<Selectors[Key]>, oldValue: ReturnType<Selectors[Key]>, store: this) => void): () => void;
384
- observe<Selector extends ObserveSelector<State>>(selector: Selector, listener: (newValue: ReturnType<Selector>, oldValue: ReturnType<Selector>, store: this) => void): () => void;
385
- }
386
- export type MaybeCallable = (...args: any[]) => any;
387
- export type ContextFunctionKeys<Context> = {
388
- [Key in keyof Context]-?: Extract<Context[Key], MaybeCallable> extends never ? never : Key;
389
- }[keyof Context];
390
- export type ContextFunction<Context, Key extends keyof Context> = Extract<Context[Key], MaybeCallable>;
391
- export type KeysAllowingUndefined<State> = {
392
- [Key in keyof State]-?: undefined extends State[Key] ? Key : never;
393
- }[keyof State];
394
- export type ObserveSelector<State> = (state: State) => any;
395
- export type SelectorFunction<State> = (state: State, ...args: any[]) => any;
396
- type Tail$1<T extends readonly any[]> = T extends readonly [
397
- any,
398
- ...infer Rest
399
- ] ? Rest : [
400
- ];
401
- type SelectorArgs$1<Selector> = Selector extends ((...params: infer Params) => any) ? Tail$1<Params> : never;
402
- export type TransitionStatus = "starting" | "ending" | "idle" | undefined;
403
- export interface FloatingRootState {
404
- open: boolean;
405
- transitionStatus: TransitionStatus | undefined;
406
- domReferenceElement: Element | null;
407
- referenceElement: ReferenceType$1 | null;
408
- floatingElement: HTMLElement | null;
409
- positionReference: ReferenceType$1 | null;
410
- /**
411
- * The ID of the floating element.
412
- */
413
- floatingId: string | undefined;
414
- }
415
- export interface FloatingRootStoreContext {
416
- onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
417
- readonly dataRef: React$1.RefObject<ContextData>;
418
- readonly events: FloatingEvents;
419
- nested: boolean;
420
- readonly triggerElements: PopupTriggerMap;
421
- }
422
- declare const selectors: {
423
- open: (state: FloatingRootState) => boolean;
424
- transitionStatus: (state: FloatingRootState) => TransitionStatus;
425
- domReferenceElement: (state: FloatingRootState) => Element | null;
426
- referenceElement: (state: FloatingRootState) => ReferenceType$1 | null;
427
- floatingElement: (state: FloatingRootState) => HTMLElement | null;
428
- floatingId: (state: FloatingRootState) => string | undefined;
429
- };
430
- export interface FloatingRootStoreOptions {
431
- open: boolean;
432
- transitionStatus: TransitionStatus | undefined;
433
- referenceElement: ReferenceType$1 | null;
434
- floatingElement: HTMLElement | null;
435
- triggerElements: PopupTriggerMap;
436
- floatingId: string | undefined;
437
- /**
438
- * When true, `setOpen` only forwards to `onOpenChange`.
439
- * The popup store owns `dispatchOpenChange(...)` in this mode.
440
- */
441
- syncOnly: boolean;
442
- nested: boolean;
443
- onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
444
- }
445
- declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
446
- private readonly syncOnly;
447
- constructor(options: FloatingRootStoreOptions);
448
- /**
449
- * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
450
- */
451
- syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
452
- /**
453
- * Runs the root-owned side effects for an open state change.
454
- */
455
- dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
456
- /**
457
- * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
458
- *
459
- * @param newOpen The new open state.
460
- * @param eventDetails Details about the event that triggered the open state change.
461
- */
462
- setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
463
- }
464
- export type HTMLProps<T = any> = React$1.HTMLAttributes<T> & {
465
- ref?: React$1.Ref<T> | undefined;
466
- };
467
- /**
468
- * 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.
469
- *
470
- * @template Props Props to be spread on the rendered element.
471
- * @template State Component's internal state.
472
- */
473
- export type ComponentRenderFn<Props, State> = (props: Props, state: State) => React$1.ReactElement<unknown>;
474
- export type BaseUIEvent<E extends React$1.SyntheticEvent<Element, Event>> = E & {
475
- preventBaseUIHandler: () => void;
476
- readonly baseUIHandlerPrevented?: boolean | undefined;
477
- };
478
- 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;
479
- /**
480
- * Adds a `preventBaseUIHandler` method to all event handlers.
481
- */
482
- export type WithBaseUIEvent<T> = {
483
- [K in keyof T]: WithPreventBaseUIHandler<T[K]>;
484
- };
485
- /**
486
- * Props shared by all Base UI components.
487
- * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
488
- */
489
- export type BaseUIComponentProps<ElementType extends React$1.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React$1.ComponentPropsWithRef<ElementType>>, "className" | "color" | "defaultValue" | "defaultChecked" | "style"> & {
490
- /**
491
- * CSS class applied to the element, or a function that
492
- * returns a class based on the component's state.
493
- */
494
- className?: string | ((state: State) => string | undefined) | undefined;
495
- /**
496
- * Allows you to replace the component's HTML element
497
- * with a different tag, or compose it with another component.
498
- *
499
- * Accepts a `ReactElement` or a function that returns the element to render.
500
- */
501
- render?: React$1.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
502
- /**
503
- * Style applied to the element, or a function that
504
- * returns a style object based on the component's state.
505
- */
506
- style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
507
- };
508
- export interface UseRenderElementComponentProps<State> {
509
- /**
510
- * The class name to apply to the rendered element.
511
- * Can be a string or a function that accepts the state and returns a string.
512
- */
513
- className?: string | ((state: State) => string | undefined) | undefined;
514
- /**
515
- * The render prop or React element to override the default element.
516
- */
517
- render?: undefined | React$1.ReactElement | ComponentRenderFn<React$1.HTMLAttributes<any>, State>;
518
- /**
519
- * The style to apply to the rendered element.
520
- * Can be a style object or a function that accepts the state and returns a style object.
521
- */
522
- style?: React$1.CSSProperties | ((state: State) => React$1.CSSProperties | undefined) | undefined;
523
- }
524
- export interface UseFloatingPortalNodeProps {
525
- ref?: React$1.Ref<HTMLDivElement> | undefined;
526
- container?: HTMLElement | ShadowRoot | null | React$1.RefObject<HTMLElement | ShadowRoot | null> | undefined;
527
- componentProps?: UseRenderElementComponentProps<any> | undefined;
528
- elementProps?: React$1.HTMLAttributes<HTMLDivElement> | undefined;
529
- }
530
- declare const FloatingPortal: React$1.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
531
- renderGuards?: boolean | undefined;
532
- }, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
533
- export interface FloatingPortalState {
534
- }
535
- declare namespace FloatingPortal {
536
- type State = FloatingPortalState;
537
- interface Props<TState> extends BaseUIComponentProps<"div", TState> {
538
- /**
539
- * A parent element to render the portal element into.
540
- */
541
- container?: UseFloatingPortalNodeProps["container"] | undefined;
542
- }
543
- }
544
- export type NarrowedElement<T> = T extends Element ? T : Element;
545
- export interface ExtendedRefs {
546
- reference: React$1.RefObject<ReferenceType$1 | null>;
547
- floating: React$1.RefObject<HTMLElement | null>;
548
- domReference: React$1.RefObject<NarrowedElement<ReferenceType$1> | null>;
549
- setReference(node: ReferenceType$1 | null): void;
550
- setFloating(node: HTMLElement | null): void;
551
- setPositionReference(node: ReferenceType$1 | null): void;
552
- }
553
- export interface ExtendedElements {
554
- reference: ReferenceType$1 | null;
555
- floating: HTMLElement | null;
556
- domReference: NarrowedElement<ReferenceType$1> | null;
557
- }
558
- export interface FloatingEvents {
559
- emit<T extends string>(event: T, data?: any): void;
560
- on(event: string, handler: (data: any) => void): void;
561
- off(event: string, handler: (data: any) => void): void;
562
- }
563
- export interface ContextData {
564
- openEvent?: Event | undefined;
565
- floatingContext?: FloatingContext | undefined;
566
- [key: string]: any;
567
- }
568
- export type FloatingRootContext = FloatingRootStore;
569
- export type FloatingContext = Omit<UseFloatingReturn<ReferenceType$1>, "refs" | "elements"> & {
570
- open: boolean;
571
- onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
572
- events: FloatingEvents;
573
- dataRef: React$1.RefObject<ContextData>;
574
- nodeId: string | undefined;
575
- floatingId: string | undefined;
576
- refs: ExtendedRefs;
577
- elements: ExtendedElements;
578
- rootStore: FloatingRootContext;
579
- };
580
- type ReferenceType$1 = Element | VirtualElement;
581
- declare class PopupTriggerMap {
582
- private elementsSet;
583
- private idMap;
584
- constructor();
585
- /**
586
- * Adds a trigger element with the given ID.
587
- *
588
- * Note: The provided element is assumed to not be registered under multiple IDs.
589
- */
590
- add(id: string, element: Element): void;
591
- /**
592
- * Removes the trigger element with the given ID.
593
- */
594
- delete(id: string): void;
595
- /**
596
- * Whether the given element is registered as a trigger.
597
- */
598
- hasElement(element: Element): boolean;
599
- /**
600
- * Whether there is a registered trigger element matching the given predicate.
601
- */
602
- hasMatchingElement(predicate: (el: Element) => boolean): boolean;
603
- /**
604
- * Returns the trigger element associated with the given ID, or undefined if no such element exists.
605
- */
606
- getById(id: string): Element | undefined;
607
- /**
608
- * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
609
- */
610
- entries(): IterableIterator<[
611
- string,
612
- Element
613
- ]>;
614
- /**
615
- * Returns an iterable of all registered trigger elements.
616
- */
617
- elements(): IterableIterator<Element>;
618
- /**
619
- * Returns the number of registered trigger elements.
620
- */
621
- get size(): number;
622
- }
623
- /**
624
- * State common to all popup stores.
625
- */
626
- export type PopupStoreState<Payload> = {
627
- /**
628
- * Whether the popup is open (internal state).
629
- */
630
- open: boolean;
631
- /**
632
- * Whether the popup is open (external prop).
633
- */
634
- readonly openProp: boolean | undefined;
635
- /**
636
- * Whether the popup should be mounted in the DOM.
637
- * This usually follows `open` but can be different during exit transitions.
638
- */
639
- mounted: boolean;
640
- /**
641
- * The current enter/exit transition status of the popup.
642
- */
643
- transitionStatus: TransitionStatus;
644
- floatingRootContext: FloatingRootContext;
645
- floatingId: string | undefined;
646
- /**
647
- * Number of trigger elements currently registered for this popup.
648
- */
649
- triggerCount: number;
650
- /**
651
- * Whether to prevent unmounting the popup when closed.
652
- * Useful for interacting with JS animation libraries that control unmounting themselves.
653
- */
654
- preventUnmountingOnClose: boolean;
655
- /**
656
- * Optional payload set by the trigger.
657
- */
658
- payload: Payload | undefined;
659
- /**
660
- * ID of the currently active trigger.
661
- */
662
- activeTriggerId: string | null;
663
- /**
664
- * The currently active trigger DOM element.
665
- */
666
- activeTriggerElement: Element | null;
667
- /**
668
- * ID of the trigger (external prop).
669
- */
670
- readonly triggerIdProp: string | null | undefined;
671
- /**
672
- * The popup DOM element.
673
- */
674
- popupElement: HTMLElement | null;
675
- /**
676
- * The positioner DOM element.
677
- */
678
- positionerElement: HTMLElement | null;
679
- /**
680
- * Props to spread onto the active trigger element.
681
- */
682
- activeTriggerProps: HTMLProps;
683
- /**
684
- * Props to spread onto inactive trigger elements.
685
- */
686
- inactiveTriggerProps: HTMLProps;
687
- /**
688
- * Props to spread onto the popup element.
689
- */
690
- popupProps: HTMLProps;
691
- };
692
- export type PopupStoreContext<ChangeEventDetails> = {
693
- /**
694
- * Map of registered trigger elements.
695
- */
696
- readonly triggerElements: PopupTriggerMap;
697
- /**
698
- * Reference to the popup element.
699
- */
700
- readonly popupRef: React$1.RefObject<HTMLElement | null>;
701
- /**
702
- * Callback fired when the open state changes.
703
- */
704
- onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
705
- /**
706
- * Callback fired when the open state change animation completes.
707
- */
708
- onOpenChangeComplete: ((open: boolean) => void) | undefined;
709
- };
710
- export type PayloadChildRenderFunction<Payload> = (arg: {
711
- payload: Payload | undefined;
712
- }) => React$1.ReactNode;
713
- type Side$1 = "top" | "bottom" | "left" | "right" | "inline-end" | "inline-start";
714
- export type Align = "start" | "center" | "end";
715
- export type Boundary = "clipping-ancestors" | Element | Element[] | Rect;
716
- export type OffsetFunction = (data: {
717
- side: Side$1;
718
- align: Align;
719
- anchor: {
720
- width: number;
721
- height: number;
722
- };
723
- positioner: {
724
- width: number;
725
- height: number;
726
- };
727
- }) => number;
728
- export interface SideFlipMode {
729
- /**
730
- * How to avoid collisions on the side axis.
731
- * - `'flip'`: If there is not enough space, place the popup on the opposite side.
732
- * - `'none'`: Keep the preferred side even if it overflows.
733
- */
734
- side?: "flip" | "none" | undefined;
735
- /**
736
- * How to avoid collisions on the align axis.
737
- * - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
738
- * - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
739
- * - `'none'`: Keep the preferred alignment even if it overflows.
740
- */
741
- align?: "flip" | "shift" | "none" | undefined;
742
- /**
743
- * If both sides on the preferred axis do not fit, determines whether to fallback
744
- * to a side on the perpendicular axis and which logical side to prefer.
745
- * - `'start'`: Prefer the logical start side on the perpendicular axis.
746
- * - `'end'`: Prefer the logical end side on the perpendicular axis.
747
- * - `'none'`: Do not fallback to the perpendicular axis.
748
- */
749
- fallbackAxisSide?: "start" | "end" | "none" | undefined;
750
- }
751
- export interface SideShiftMode {
752
- /**
753
- * How to avoid collisions on the side axis.
754
- * - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
755
- * - `'none'`: Keep the preferred side even if it overflows.
756
- */
757
- side?: "shift" | "none" | undefined;
758
- /**
759
- * How to avoid collisions on the align axis.
760
- * - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
761
- * - `'none'`: Keep the preferred alignment even if it overflows.
762
- */
763
- align?: "shift" | "none" | undefined;
764
- /**
765
- * If both sides on the preferred axis do not fit, determines whether to fallback
766
- * to a side on the perpendicular axis and which logical side to prefer.
767
- * - `'start'`: Prefer the logical start side on the perpendicular axis.
768
- * - `'end'`: Prefer the logical end side on the perpendicular axis.
769
- * - `'none'`: Do not fallback to the perpendicular axis.
770
- */
771
- fallbackAxisSide?: "start" | "end" | "none" | undefined;
772
- }
773
- export type CollisionAvoidance = SideFlipMode | SideShiftMode;
774
- export interface UseAnchorPositioningSharedParameters {
775
- /**
776
- * An element to position the popup against.
777
- * By default, the popup will be positioned against the trigger.
778
- */
779
- anchor?: Element | null | VirtualElement | React$1.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
780
- /**
781
- * Determines which CSS `position` property to use.
782
- * @default 'absolute'
783
- */
784
- positionMethod?: "absolute" | "fixed" | undefined;
785
- /**
786
- * Which side of the anchor element to align the popup against.
787
- * May automatically change to avoid collisions.
788
- * @default 'bottom'
789
- */
790
- side?: Side$1 | undefined;
791
- /**
792
- * Distance between the anchor and the popup in pixels.
793
- * Also accepts a function that returns the distance to read the dimensions of the anchor
794
- * and positioner elements, along with its side and alignment.
795
- *
796
- * The function takes a `data` object parameter with the following properties:
797
- * - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
798
- * - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
799
- * - `data.side`: which side of the anchor element the positioner is aligned against.
800
- * - `data.align`: how the positioner is aligned relative to the specified side.
801
- *
802
- * @example
803
- * ```jsx
804
- * <Positioner
805
- * sideOffset={({ side, align, anchor, positioner }) => {
806
- * return side === 'top' || side === 'bottom'
807
- * ? anchor.height
808
- * : anchor.width;
809
- * }}
810
- * />
811
- * ```
812
- *
813
- * @default 0
814
- */
815
- sideOffset?: number | OffsetFunction | undefined;
816
- /**
817
- * How to align the popup relative to the specified side.
818
- * @default 'center'
819
- */
820
- align?: Align | undefined;
821
- /**
822
- * Additional offset along the alignment axis in pixels.
823
- * Also accepts a function that returns the offset to read the dimensions of the anchor
824
- * and positioner elements, along with its side and alignment.
825
- *
826
- * The function takes a `data` object parameter with the following properties:
827
- * - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
828
- * - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
829
- * - `data.side`: which side of the anchor element the positioner is aligned against.
830
- * - `data.align`: how the positioner is aligned relative to the specified side.
831
- *
832
- * @example
833
- * ```jsx
834
- * <Positioner
835
- * alignOffset={({ side, align, anchor, positioner }) => {
836
- * return side === 'top' || side === 'bottom'
837
- * ? anchor.width
838
- * : anchor.height;
839
- * }}
840
- * />
841
- * ```
842
- *
843
- * @default 0
844
- */
845
- alignOffset?: number | OffsetFunction | undefined;
846
- /**
847
- * An element or a rectangle that delimits the area that the popup is confined to.
848
- * @default 'clipping-ancestors'
849
- */
850
- collisionBoundary?: Boundary | undefined;
851
- /**
852
- * Additional space to maintain from the edge of the collision boundary.
853
- * @default 5
854
- */
855
- collisionPadding?: Padding | undefined;
856
- /**
857
- * Whether to maintain the popup in the viewport after
858
- * the anchor element was scrolled out of view.
859
- * @default false
860
- */
861
- sticky?: boolean | undefined;
862
- /**
863
- * Minimum distance to maintain between the arrow and the edges of the popup.
864
- *
865
- * Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
866
- * @default 5
867
- */
868
- arrowPadding?: number | undefined;
869
- /**
870
- * Whether to disable the popup from tracking any layout shift of its positioning anchor.
871
- * @default false
872
- */
873
- disableAnchorTracking?: boolean | undefined;
874
- /**
875
- * Determines how to handle collisions when positioning the popup.
876
- *
877
- * `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
878
- * - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
879
- * (`top` and `bottom`, or `left` and `right`).
880
- * - `'shift'`: never change side; keep the requested side and move the popup within
881
- * the clipping boundary so it stays visible.
882
- * - `'none'`: do not correct side-axis overflow.
883
- *
884
- * `align` controls overflow on the alignment axis (`start`/`center`/`end`):
885
- * - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
886
- * - `'shift'`: keep side and requested alignment, then nudge the popup along the
887
- * alignment axis to fit.
888
- * - `'none'`: do not correct alignment-axis overflow.
889
- *
890
- * `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
891
- * preferred axis cannot fit:
892
- * - `'start'`: allow perpendicular fallback and try the logical start side first
893
- * (`top` before `bottom`, or `left` before `right` in LTR).
894
- * - `'end'`: allow perpendicular fallback and try the logical end side first
895
- * (`bottom` before `top`, or `right` before `left` in LTR).
896
- * - `'none'`: do not fallback to the perpendicular axis.
897
- *
898
- * When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
899
- * If `align` is omitted, it defaults to `'flip'`.
900
- *
901
- * @example
902
- * ```jsx
903
- * <Positioner
904
- * collisionAvoidance={{
905
- * side: 'shift',
906
- * align: 'shift',
907
- * fallbackAxisSide: 'none',
908
- * }}
909
- * />
910
- * ```
911
- *
912
- */
913
- collisionAvoidance?: CollisionAvoidance | undefined;
914
- }
915
- declare const FloatingPortalLite: React$1.ForwardRefExoticComponent<Omit<FloatingPortalLite.Props<any>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
916
- export interface FloatingPortalLiteState {
917
- }
918
- export interface FloatingPortalLiteProps<TState> extends FloatingPortal.Props<TState> {
919
- }
920
- declare namespace FloatingPortalLite {
921
- type State = FloatingPortalLiteState;
922
- type Props<TState> = FloatingPortalLiteProps<TState>;
923
- }
924
- export type State<Payload> = PopupStoreState<Payload> & {
925
- instantType: "dismiss" | "focus" | undefined;
926
- hasViewport: boolean;
927
- };
928
- export type Context = PopupStoreContext<PreviewCardRoot.ChangeEventDetails> & {
929
- closeDelayRef: React$1.RefObject<number>;
930
- inlineRectCoordsRef: React$1.MutableRefObject<InlineRectCoords | undefined>;
931
- };
932
- declare const selectors$1: {
933
- instantType: (state: State<unknown>) => "focus" | "dismiss" | undefined;
934
- hasViewport: (state: State<unknown>) => boolean;
935
- open: (state: {
936
- open: boolean;
937
- readonly openProp: boolean | undefined;
938
- mounted: boolean;
939
- transitionStatus: TransitionStatus;
940
- floatingRootContext: FloatingRootContext;
941
- floatingId: string | undefined;
942
- triggerCount: number;
943
- preventUnmountingOnClose: boolean;
944
- payload: unknown;
945
- activeTriggerId: string | null;
946
- activeTriggerElement: Element | null;
947
- readonly triggerIdProp: string | null | undefined;
948
- popupElement: HTMLElement | null;
949
- positionerElement: HTMLElement | null;
950
- activeTriggerProps: HTMLProps;
951
- inactiveTriggerProps: HTMLProps;
952
- popupProps: HTMLProps;
953
- }) => boolean;
954
- mounted: (state: {
955
- open: boolean;
956
- readonly openProp: boolean | undefined;
957
- mounted: boolean;
958
- transitionStatus: TransitionStatus;
959
- floatingRootContext: FloatingRootContext;
960
- floatingId: string | undefined;
961
- triggerCount: number;
962
- preventUnmountingOnClose: boolean;
963
- payload: unknown;
964
- activeTriggerId: string | null;
965
- activeTriggerElement: Element | null;
966
- readonly triggerIdProp: string | null | undefined;
967
- popupElement: HTMLElement | null;
968
- positionerElement: HTMLElement | null;
969
- activeTriggerProps: HTMLProps;
970
- inactiveTriggerProps: HTMLProps;
971
- popupProps: HTMLProps;
972
- }) => boolean;
973
- transitionStatus: (state: {
974
- open: boolean;
975
- readonly openProp: boolean | undefined;
976
- mounted: boolean;
977
- transitionStatus: TransitionStatus;
978
- floatingRootContext: FloatingRootContext;
979
- floatingId: string | undefined;
980
- triggerCount: number;
981
- preventUnmountingOnClose: boolean;
982
- payload: unknown;
983
- activeTriggerId: string | null;
984
- activeTriggerElement: Element | null;
985
- readonly triggerIdProp: string | null | undefined;
986
- popupElement: HTMLElement | null;
987
- positionerElement: HTMLElement | null;
988
- activeTriggerProps: HTMLProps;
989
- inactiveTriggerProps: HTMLProps;
990
- popupProps: HTMLProps;
991
- }) => TransitionStatus;
992
- floatingRootContext: (state: {
993
- open: boolean;
994
- readonly openProp: boolean | undefined;
995
- mounted: boolean;
996
- transitionStatus: TransitionStatus;
997
- floatingRootContext: FloatingRootContext;
998
- floatingId: string | undefined;
999
- triggerCount: number;
1000
- preventUnmountingOnClose: boolean;
1001
- payload: unknown;
1002
- activeTriggerId: string | null;
1003
- activeTriggerElement: Element | null;
1004
- readonly triggerIdProp: string | null | undefined;
1005
- popupElement: HTMLElement | null;
1006
- positionerElement: HTMLElement | null;
1007
- activeTriggerProps: HTMLProps;
1008
- inactiveTriggerProps: HTMLProps;
1009
- popupProps: HTMLProps;
1010
- }) => FloatingRootStore;
1011
- triggerCount: (state: {
1012
- open: boolean;
1013
- readonly openProp: boolean | undefined;
1014
- mounted: boolean;
1015
- transitionStatus: TransitionStatus;
1016
- floatingRootContext: FloatingRootContext;
1017
- floatingId: string | undefined;
1018
- triggerCount: number;
1019
- preventUnmountingOnClose: boolean;
1020
- payload: unknown;
1021
- activeTriggerId: string | null;
1022
- activeTriggerElement: Element | null;
1023
- readonly triggerIdProp: string | null | undefined;
1024
- popupElement: HTMLElement | null;
1025
- positionerElement: HTMLElement | null;
1026
- activeTriggerProps: HTMLProps;
1027
- inactiveTriggerProps: HTMLProps;
1028
- popupProps: HTMLProps;
1029
- }) => number;
1030
- preventUnmountingOnClose: (state: {
1031
- open: boolean;
1032
- readonly openProp: boolean | undefined;
1033
- mounted: boolean;
1034
- transitionStatus: TransitionStatus;
1035
- floatingRootContext: FloatingRootContext;
1036
- floatingId: string | undefined;
1037
- triggerCount: number;
1038
- preventUnmountingOnClose: boolean;
1039
- payload: unknown;
1040
- activeTriggerId: string | null;
1041
- activeTriggerElement: Element | null;
1042
- readonly triggerIdProp: string | null | undefined;
1043
- popupElement: HTMLElement | null;
1044
- positionerElement: HTMLElement | null;
1045
- activeTriggerProps: HTMLProps;
1046
- inactiveTriggerProps: HTMLProps;
1047
- popupProps: HTMLProps;
1048
- }) => boolean;
1049
- payload: (state: {
1050
- open: boolean;
1051
- readonly openProp: boolean | undefined;
1052
- mounted: boolean;
1053
- transitionStatus: TransitionStatus;
1054
- floatingRootContext: FloatingRootContext;
1055
- floatingId: string | undefined;
1056
- triggerCount: number;
1057
- preventUnmountingOnClose: boolean;
1058
- payload: unknown;
1059
- activeTriggerId: string | null;
1060
- activeTriggerElement: Element | null;
1061
- readonly triggerIdProp: string | null | undefined;
1062
- popupElement: HTMLElement | null;
1063
- positionerElement: HTMLElement | null;
1064
- activeTriggerProps: HTMLProps;
1065
- inactiveTriggerProps: HTMLProps;
1066
- popupProps: HTMLProps;
1067
- }) => unknown;
1068
- activeTriggerId: (state: {
1069
- open: boolean;
1070
- readonly openProp: boolean | undefined;
1071
- mounted: boolean;
1072
- transitionStatus: TransitionStatus;
1073
- floatingRootContext: FloatingRootContext;
1074
- floatingId: string | undefined;
1075
- triggerCount: number;
1076
- preventUnmountingOnClose: boolean;
1077
- payload: unknown;
1078
- activeTriggerId: string | null;
1079
- activeTriggerElement: Element | null;
1080
- readonly triggerIdProp: string | null | undefined;
1081
- popupElement: HTMLElement | null;
1082
- positionerElement: HTMLElement | null;
1083
- activeTriggerProps: HTMLProps;
1084
- inactiveTriggerProps: HTMLProps;
1085
- popupProps: HTMLProps;
1086
- }) => string | null;
1087
- activeTriggerElement: (state: {
1088
- open: boolean;
1089
- readonly openProp: boolean | undefined;
1090
- mounted: boolean;
1091
- transitionStatus: TransitionStatus;
1092
- floatingRootContext: FloatingRootContext;
1093
- floatingId: string | undefined;
1094
- triggerCount: number;
1095
- preventUnmountingOnClose: boolean;
1096
- payload: unknown;
1097
- activeTriggerId: string | null;
1098
- activeTriggerElement: Element | null;
1099
- readonly triggerIdProp: string | null | undefined;
1100
- popupElement: HTMLElement | null;
1101
- positionerElement: HTMLElement | null;
1102
- activeTriggerProps: HTMLProps;
1103
- inactiveTriggerProps: HTMLProps;
1104
- popupProps: HTMLProps;
1105
- }) => Element | null;
1106
- popupId: (state: {
1107
- open: boolean;
1108
- readonly openProp: boolean | undefined;
1109
- mounted: boolean;
1110
- transitionStatus: TransitionStatus;
1111
- floatingRootContext: FloatingRootContext;
1112
- floatingId: string | undefined;
1113
- triggerCount: number;
1114
- preventUnmountingOnClose: boolean;
1115
- payload: unknown;
1116
- activeTriggerId: string | null;
1117
- activeTriggerElement: Element | null;
1118
- readonly triggerIdProp: string | null | undefined;
1119
- popupElement: HTMLElement | null;
1120
- positionerElement: HTMLElement | null;
1121
- activeTriggerProps: HTMLProps;
1122
- inactiveTriggerProps: HTMLProps;
1123
- popupProps: HTMLProps;
1124
- }) => string | undefined;
1125
- isTriggerActive: (state: {
1126
- open: boolean;
1127
- readonly openProp: boolean | undefined;
1128
- mounted: boolean;
1129
- transitionStatus: TransitionStatus;
1130
- floatingRootContext: FloatingRootContext;
1131
- floatingId: string | undefined;
1132
- triggerCount: number;
1133
- preventUnmountingOnClose: boolean;
1134
- payload: unknown;
1135
- activeTriggerId: string | null;
1136
- activeTriggerElement: Element | null;
1137
- readonly triggerIdProp: string | null | undefined;
1138
- popupElement: HTMLElement | null;
1139
- positionerElement: HTMLElement | null;
1140
- activeTriggerProps: HTMLProps;
1141
- inactiveTriggerProps: HTMLProps;
1142
- popupProps: HTMLProps;
1143
- }, triggerId: string | undefined) => boolean;
1144
- isOpenedByTrigger: (state: {
1145
- open: boolean;
1146
- readonly openProp: boolean | undefined;
1147
- mounted: boolean;
1148
- transitionStatus: TransitionStatus;
1149
- floatingRootContext: FloatingRootContext;
1150
- floatingId: string | undefined;
1151
- triggerCount: number;
1152
- preventUnmountingOnClose: boolean;
1153
- payload: unknown;
1154
- activeTriggerId: string | null;
1155
- activeTriggerElement: Element | null;
1156
- readonly triggerIdProp: string | null | undefined;
1157
- popupElement: HTMLElement | null;
1158
- positionerElement: HTMLElement | null;
1159
- activeTriggerProps: HTMLProps;
1160
- inactiveTriggerProps: HTMLProps;
1161
- popupProps: HTMLProps;
1162
- }, triggerId: string | undefined) => boolean;
1163
- isMountedByTrigger: (state: {
1164
- open: boolean;
1165
- readonly openProp: boolean | undefined;
1166
- mounted: boolean;
1167
- transitionStatus: TransitionStatus;
1168
- floatingRootContext: FloatingRootContext;
1169
- floatingId: string | undefined;
1170
- triggerCount: number;
1171
- preventUnmountingOnClose: boolean;
1172
- payload: unknown;
1173
- activeTriggerId: string | null;
1174
- activeTriggerElement: Element | null;
1175
- readonly triggerIdProp: string | null | undefined;
1176
- popupElement: HTMLElement | null;
1177
- positionerElement: HTMLElement | null;
1178
- activeTriggerProps: HTMLProps;
1179
- inactiveTriggerProps: HTMLProps;
1180
- popupProps: HTMLProps;
1181
- }, triggerId: string | undefined) => boolean;
1182
- triggerProps: (state: {
1183
- open: boolean;
1184
- readonly openProp: boolean | undefined;
1185
- mounted: boolean;
1186
- transitionStatus: TransitionStatus;
1187
- floatingRootContext: FloatingRootContext;
1188
- floatingId: string | undefined;
1189
- triggerCount: number;
1190
- preventUnmountingOnClose: boolean;
1191
- payload: unknown;
1192
- activeTriggerId: string | null;
1193
- activeTriggerElement: Element | null;
1194
- readonly triggerIdProp: string | null | undefined;
1195
- popupElement: HTMLElement | null;
1196
- positionerElement: HTMLElement | null;
1197
- activeTriggerProps: HTMLProps;
1198
- inactiveTriggerProps: HTMLProps;
1199
- popupProps: HTMLProps;
1200
- }, isActive: boolean) => HTMLProps;
1201
- triggerPopupId: (state: {
1202
- open: boolean;
1203
- readonly openProp: boolean | undefined;
1204
- mounted: boolean;
1205
- transitionStatus: TransitionStatus;
1206
- floatingRootContext: FloatingRootContext;
1207
- floatingId: string | undefined;
1208
- triggerCount: number;
1209
- preventUnmountingOnClose: boolean;
1210
- payload: unknown;
1211
- activeTriggerId: string | null;
1212
- activeTriggerElement: Element | null;
1213
- readonly triggerIdProp: string | null | undefined;
1214
- popupElement: HTMLElement | null;
1215
- positionerElement: HTMLElement | null;
1216
- activeTriggerProps: HTMLProps;
1217
- inactiveTriggerProps: HTMLProps;
1218
- popupProps: HTMLProps;
1219
- }, triggerId: string | undefined) => string | undefined;
1220
- popupProps: (state: {
1221
- open: boolean;
1222
- readonly openProp: boolean | undefined;
1223
- mounted: boolean;
1224
- transitionStatus: TransitionStatus;
1225
- floatingRootContext: FloatingRootContext;
1226
- floatingId: string | undefined;
1227
- triggerCount: number;
1228
- preventUnmountingOnClose: boolean;
1229
- payload: unknown;
1230
- activeTriggerId: string | null;
1231
- activeTriggerElement: Element | null;
1232
- readonly triggerIdProp: string | null | undefined;
1233
- popupElement: HTMLElement | null;
1234
- positionerElement: HTMLElement | null;
1235
- activeTriggerProps: HTMLProps;
1236
- inactiveTriggerProps: HTMLProps;
1237
- popupProps: HTMLProps;
1238
- }) => HTMLProps;
1239
- popupElement: (state: {
1240
- open: boolean;
1241
- readonly openProp: boolean | undefined;
1242
- mounted: boolean;
1243
- transitionStatus: TransitionStatus;
1244
- floatingRootContext: FloatingRootContext;
1245
- floatingId: string | undefined;
1246
- triggerCount: number;
1247
- preventUnmountingOnClose: boolean;
1248
- payload: unknown;
1249
- activeTriggerId: string | null;
1250
- activeTriggerElement: Element | null;
1251
- readonly triggerIdProp: string | null | undefined;
1252
- popupElement: HTMLElement | null;
1253
- positionerElement: HTMLElement | null;
1254
- activeTriggerProps: HTMLProps;
1255
- inactiveTriggerProps: HTMLProps;
1256
- popupProps: HTMLProps;
1257
- }) => HTMLElement | null;
1258
- positionerElement: (state: {
1259
- open: boolean;
1260
- readonly openProp: boolean | undefined;
1261
- mounted: boolean;
1262
- transitionStatus: TransitionStatus;
1263
- floatingRootContext: FloatingRootContext;
1264
- floatingId: string | undefined;
1265
- triggerCount: number;
1266
- preventUnmountingOnClose: boolean;
1267
- payload: unknown;
1268
- activeTriggerId: string | null;
1269
- activeTriggerElement: Element | null;
1270
- readonly triggerIdProp: string | null | undefined;
1271
- popupElement: HTMLElement | null;
1272
- positionerElement: HTMLElement | null;
1273
- activeTriggerProps: HTMLProps;
1274
- inactiveTriggerProps: HTMLProps;
1275
- popupProps: HTMLProps;
1276
- }) => HTMLElement | null;
1277
- };
1278
- declare class PreviewCardStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, typeof selectors$1> {
1279
- constructor(initialState?: Partial<State<Payload>>, floatingId?: string | undefined, nested?: boolean);
1280
- setOpen: (nextOpen: boolean, eventDetails: Omit<PreviewCardRoot.ChangeEventDetails, "preventUnmountOnClose">) => void;
1281
- static useStore<Payload>(externalStore: PreviewCardStore<Payload> | undefined, initialState?: Partial<State<Payload>>): PreviewCardStore<Payload>;
1282
- }
1283
- declare class PreviewCardHandle<Payload> {
1284
- /**
1285
- * Internal store holding the preview card state.
1286
- * @internal
1287
- */
1288
- readonly store: PreviewCardStore<Payload>;
1289
- constructor();
1290
- /**
1291
- * Opens the preview card and associates it with the trigger with the given ID.
1292
- * The trigger must be a PreviewCard.Trigger component with this handle passed as a prop.
1293
- *
1294
- * This method should only be called in an event handler or an effect (not during rendering).
1295
- *
1296
- * @param triggerId ID of the trigger to associate with the preview card.
1297
- */
1298
- open(triggerId: string): void;
1299
- /**
1300
- * Closes the preview card.
1301
- */
1302
- close(): void;
1303
- /**
1304
- * Indicates whether the preview card is currently open.
1305
- */
1306
- get isOpen(): boolean;
1307
- }
1308
- declare function createPreviewCardHandle<Payload>(): PreviewCardHandle<Payload>;
1309
- /**
1310
- * Groups all parts of the preview card.
1311
- * Doesn't render its own HTML element.
1312
- *
1313
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1314
- */
1315
- export declare const PreviewCardRoot: <Payload>(props: PreviewCardRoot.Props<Payload>) => import("react/jsx-runtime").React$1.JSX.Element;
1316
- export interface PreviewCardRootState {
1317
- }
1318
- export interface PreviewCardRootProps<Payload = unknown> {
1319
- /**
1320
- * Whether the preview card is initially open.
1321
- *
1322
- * To render a controlled preview card, use the `open` prop instead.
1323
- * @default false
1324
- */
1325
- defaultOpen?: boolean | undefined;
1326
- /**
1327
- * Whether the preview card is currently open.
1328
- */
1329
- open?: boolean | undefined;
1330
- /**
1331
- * Event handler called when the preview card is opened or closed.
1332
- */
1333
- onOpenChange?: ((open: boolean, eventDetails: PreviewCardRoot.ChangeEventDetails) => void) | undefined;
1334
- /**
1335
- * Event handler called after any animations complete when the preview card is opened or closed.
1336
- */
1337
- onOpenChangeComplete?: ((open: boolean) => void) | undefined;
1338
- /**
1339
- * A ref to imperative actions.
1340
- * - `unmount`: Unmounts the preview card popup.
1341
- * - `close`: Closes the preview card imperatively when called.
1342
- */
1343
- actionsRef?: React$1.RefObject<PreviewCardRoot.Actions | null> | undefined;
1344
- /**
1345
- * A handle to associate the preview card with a trigger.
1346
- * If specified, allows external triggers to control the card's open state.
1347
- * Can be created with the PreviewCard.createHandle() method.
1348
- */
1349
- handle?: PreviewCardHandle<Payload> | undefined;
1350
- /**
1351
- * The content of the preview card.
1352
- * This can be a regular React node or a render function that receives the `payload` of the active trigger.
1353
- */
1354
- children?: React$1.ReactNode | PayloadChildRenderFunction<Payload>;
1355
- /**
1356
- * ID of the trigger that the preview card is associated with.
1357
- * This is useful in conjunction with the `open` prop to create a controlled preview card.
1358
- * There's no need to specify this prop when the preview card is uncontrolled (that is, when the `open` prop is not set).
1359
- */
1360
- triggerId?: string | null | undefined;
1361
- /**
1362
- * ID of the trigger that the preview card is associated with.
1363
- * This is useful in conjunction with the `defaultOpen` prop to create an initially open preview card.
1364
- */
1365
- defaultTriggerId?: string | null | undefined;
1366
- }
1367
- export interface PreviewCardRootActions {
1368
- unmount: () => void;
1369
- close: () => void;
1370
- }
1371
- export type PreviewCardRootChangeEventReason = typeof triggerHover | typeof triggerFocus | typeof triggerPress | typeof outsidePress | typeof escapeKey | typeof imperativeAction | typeof none;
1372
- export type PreviewCardRootChangeEventDetails = BaseUIChangeEventDetails<PreviewCardRoot.ChangeEventReason> & {
1373
- preventUnmountOnClose(): void;
1374
- };
1375
- export declare namespace PreviewCardRoot {
1376
- type State = PreviewCardRootState;
1377
- type Props<Payload = unknown> = PreviewCardRootProps<Payload>;
1378
- type Actions = PreviewCardRootActions;
1379
- type ChangeEventReason = PreviewCardRootChangeEventReason;
1380
- type ChangeEventDetails = PreviewCardRootChangeEventDetails;
1381
- }
1382
- /**
1383
- * A portal element that moves the popup to a different part of the DOM.
1384
- * By default, the portal element is appended to `<body>`.
1385
- * Renders a `<div>` element.
1386
- *
1387
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1388
- */
1389
- export declare const PreviewCardPortal: React$1.ForwardRefExoticComponent<Omit<PreviewCardPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1390
- export interface PreviewCardPortalState {
1391
- }
1392
- export interface PreviewCardPortalProps extends FloatingPortalLite.Props<PreviewCardPortalState> {
1393
- /**
1394
- * Whether to keep the portal mounted in the DOM while the popup is hidden.
1395
- * @default false
1396
- */
1397
- keepMounted?: boolean | undefined;
1398
- }
1399
- export declare namespace PreviewCardPortal {
1400
- type State = PreviewCardPortalState;
1401
- type Props = PreviewCardPortalProps;
1402
- }
1403
- /**
1404
- * A link that opens the preview card.
1405
- * Renders an `<a>` element.
1406
- *
1407
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1408
- */
1409
- export declare const PreviewCardTrigger: PreviewCardTrigger;
1410
- export interface PreviewCardTrigger {
1411
- <Payload>(componentProps: PreviewCardTrigger.Props<Payload> & React$1.RefAttributes<HTMLElement>): React$1.JSX.Element;
1412
- }
1413
- export interface PreviewCardTriggerState {
1414
- /**
1415
- * Whether the preview card is currently open.
1416
- */
1417
- open: boolean;
1418
- }
1419
- export interface PreviewCardTriggerProps<Payload = unknown> extends BaseUIComponentProps<"a", PreviewCardTriggerState> {
1420
- /**
1421
- * A handle to associate the trigger with a preview card.
1422
- */
1423
- handle?: PreviewCardHandle<Payload> | undefined;
1424
- /**
1425
- * A payload to pass to the preview card when it is opened.
1426
- */
1427
- payload?: Payload | undefined;
1428
- /**
1429
- * How long to wait before the preview card opens. Specified in milliseconds.
1430
- * @default 600
1431
- */
1432
- delay?: number | undefined;
1433
- /**
1434
- * How long to wait before closing the preview card. Specified in milliseconds.
1435
- * @default 300
1436
- */
1437
- closeDelay?: number | undefined;
1438
- }
1439
- export declare namespace PreviewCardTrigger {
1440
- type State = PreviewCardTriggerState;
1441
- type Props<Payload = unknown> = PreviewCardTriggerProps<Payload>;
1442
- }
1443
- /**
1444
- * Positions the popup against the trigger.
1445
- * Renders a `<div>` element.
1446
- *
1447
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1448
- */
1449
- export declare const PreviewCardPositioner: React$1.ForwardRefExoticComponent<Omit<PreviewCardPositionerProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1450
- export interface PreviewCardPositionerState {
1451
- /**
1452
- * Whether the preview card is currently open.
1453
- */
1454
- open: boolean;
1455
- /**
1456
- * The side of the anchor the component is placed on.
1457
- */
1458
- side: Side$1;
1459
- /**
1460
- * The alignment of the component relative to the anchor.
1461
- */
1462
- align: Align;
1463
- /**
1464
- * Whether the anchor element is hidden.
1465
- */
1466
- anchorHidden: boolean;
1467
- /**
1468
- * Whether transitions should be skipped.
1469
- */
1470
- instant: "dismiss" | "focus" | undefined;
1471
- }
1472
- export interface PreviewCardPositionerProps extends UseAnchorPositioningSharedParameters, BaseUIComponentProps<"div", PreviewCardPositionerState> {
1473
- }
1474
- export declare namespace PreviewCardPositioner {
1475
- type State = PreviewCardPositionerState;
1476
- type Props = PreviewCardPositionerProps;
1477
- }
1478
- /**
1479
- * A container for the preview card contents.
1480
- * Renders a `<div>` element.
1481
- *
1482
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1483
- */
1484
- export declare const PreviewCardPopup: React$1.ForwardRefExoticComponent<Omit<PreviewCardPopupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1485
- export interface PreviewCardPopupState {
1486
- /**
1487
- * Whether the preview card is currently open.
1488
- */
1489
- open: boolean;
1490
- /**
1491
- * The side of the anchor the component is placed on.
1492
- */
1493
- side: Side$1;
1494
- /**
1495
- * The alignment of the component relative to the anchor.
1496
- */
1497
- align: Align;
1498
- /**
1499
- * Whether transitions should be skipped.
1500
- */
1501
- instant: "dismiss" | "focus" | undefined;
1502
- /**
1503
- * The transition status of the component.
1504
- */
1505
- transitionStatus: TransitionStatus;
1506
- }
1507
- export interface PreviewCardPopupProps extends BaseUIComponentProps<"div", PreviewCardPopupState> {
1508
- }
1509
- export declare namespace PreviewCardPopup {
1510
- type State = PreviewCardPopupState;
1511
- type Props = PreviewCardPopupProps;
1512
- }
1513
- /**
1514
- * Displays an element positioned against the preview card anchor.
1515
- * Renders a `<div>` element.
1516
- *
1517
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1518
- */
1519
- export declare const PreviewCardArrow: React$1.ForwardRefExoticComponent<Omit<PreviewCardArrowProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1520
- export interface PreviewCardArrowState {
1521
- /**
1522
- * Whether the preview card is currently open.
1523
- */
1524
- open: boolean;
1525
- /**
1526
- * The side of the anchor the component is placed on.
1527
- */
1528
- side: Side$1;
1529
- /**
1530
- * The alignment of the component relative to the anchor.
1531
- */
1532
- align: Align;
1533
- /**
1534
- * Whether the arrow cannot be centered on the anchor.
1535
- */
1536
- uncentered: boolean;
1537
- }
1538
- export interface PreviewCardArrowProps extends BaseUIComponentProps<"div", PreviewCardArrowState> {
1539
- }
1540
- export declare namespace PreviewCardArrow {
1541
- type State = PreviewCardArrowState;
1542
- type Props = PreviewCardArrowProps;
1543
- }
1544
- /**
1545
- * An overlay displayed beneath the popup.
1546
- * Renders a `<div>` element.
1547
- *
1548
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1549
- */
1550
- export declare const PreviewCardBackdrop: React$1.ForwardRefExoticComponent<Omit<PreviewCardBackdropProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1551
- export interface PreviewCardBackdropState {
1552
- /**
1553
- * Whether the preview card is currently open.
1554
- */
1555
- open: boolean;
1556
- /**
1557
- * The transition status of the component.
1558
- */
1559
- transitionStatus: TransitionStatus;
1560
- }
1561
- export interface PreviewCardBackdropProps extends BaseUIComponentProps<"div", PreviewCardBackdropState> {
1562
- }
1563
- export declare namespace PreviewCardBackdrop {
1564
- type State = PreviewCardBackdropState;
1565
- type Props = PreviewCardBackdropProps;
1566
- }
1567
- /**
1568
- * A viewport for displaying content transitions.
1569
- * This component is only required if one popup can be opened by multiple triggers, its content
1570
- * changes based on the trigger, and switching between them is animated.
1571
- * Renders a `<div>` element.
1572
- *
1573
- * Documentation: [Base UI Preview Card](https://base-ui.com/react/components/preview-card)
1574
- */
1575
- export declare const PreviewCardViewport: React$1.ForwardRefExoticComponent<Omit<PreviewCardViewport.Props, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1576
- export interface PreviewCardViewportState {
1577
- /**
1578
- * The activation direction of the transitioned content.
1579
- */
1580
- activationDirection: string | undefined;
1581
- /**
1582
- * Whether the viewport is currently transitioning between contents.
1583
- */
1584
- transitioning: boolean;
1585
- /**
1586
- * Present if animations should be instant.
1587
- */
1588
- instant: "dismiss" | "focus" | undefined;
1589
- }
1590
- export declare namespace PreviewCardViewport {
1591
- interface Props extends BaseUIComponentProps<"div", PreviewCardViewportState> {
1592
- /**
1593
- * The content to render inside the transition container.
1594
- */
1595
- children?: React$1.ReactNode;
1596
- }
1597
- type State = PreviewCardViewportState;
1598
- }
1599
-
1600
- declare namespace PreviewCard {
1601
- export { PreviewCardArrow as Arrow, PreviewCardBackdrop as Backdrop, PreviewCardHandle as Handle, PreviewCardPopup as Popup, PreviewCardPortal as Portal, PreviewCardPositioner as Positioner, PreviewCardRoot as Root, PreviewCardTrigger as Trigger, PreviewCardViewport as Viewport, createPreviewCardHandle as createHandle };
1602
- }
1603
-
1604
- export {
1605
- PreviewCard,
1606
- };
1607
-
1608
- export {};