@arcadeai/design-system 3.39.0 → 3.39.2

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 (425) hide show
  1. package/dist/CompositeItem-CniPsjzP.js +30 -0
  2. package/dist/CompositeList-yq5K_yj6.js +81 -0
  3. package/dist/CompositeRoot-Dy-5A-Je.js +206 -0
  4. package/dist/DialogRoot-DDokfJcO.js +57 -0
  5. package/dist/DialogTrigger-CFUE8YsM.js +402 -0
  6. package/dist/DirectionContext-BSOheMwC.js +10 -0
  7. package/dist/FieldItemContext-CF2fRwBC.js +12 -0
  8. package/dist/FloatingPortalLite-BHsRx4XN.js +29 -0
  9. package/dist/InternalBackdrop-BVEfe6O1.js +610 -0
  10. package/dist/LabelableContext-Dzw1DWuj.js +171 -0
  11. package/dist/Separator-CswSYAXX.js +25 -0
  12. package/dist/ToolbarRootContext-D7EsmJ5f.js +10 -0
  13. package/dist/andromeeda-B-gfN00q.js +4 -0
  14. package/dist/angular-html-dA1qUKRV.js +32 -0
  15. package/dist/angular-ts-CXyBC0vY.js +21 -0
  16. package/dist/apl-CjNiDgad.js +3 -3
  17. package/dist/assets/icons/telegram.js +10 -0
  18. package/dist/assets/images/arcade-grid.d.ts.map +1 -1
  19. package/dist/assets/images/arcade-grid.js +1 -0
  20. package/dist/assets/index.css +1 -1
  21. package/dist/assets/tokens.css +1 -1
  22. package/dist/assets/variables.css +1 -1
  23. package/dist/astro--3ZkKqYU.js +18 -0
  24. package/dist/astro-CFFExE8Q.js +5 -5
  25. package/dist/aurora-x-B56eICma.js +4 -0
  26. package/dist/ayu-dark-DJSOaKig.js +4 -0
  27. package/dist/ayu-light-BPfFt4v-.js +4 -0
  28. package/dist/ayu-mirage-DmPLRBj7.js +4 -0
  29. package/dist/blade-BoRuQEEj.js +20 -0
  30. package/dist/blade-D0HyNvCw.js +4 -4
  31. package/dist/c-C4SM8H98.js +6 -0
  32. package/dist/cairo-DM6WF2e3.js +1 -1
  33. package/dist/{calendar-DreAgQKY.js → calendar-CLEnvrbp.js} +483 -482
  34. package/dist/catppuccin-frappe-CA5k7W3u.js +4 -0
  35. package/dist/catppuccin-latte-CYfkUW5v.js +4 -0
  36. package/dist/catppuccin-macchiato-BOj_4I3g.js +4 -0
  37. package/dist/catppuccin-mocha-BXpUXme4.js +4 -0
  38. package/dist/clamp-BxE4ZAuA.js +17 -0
  39. package/dist/cobol-HihOMwht.js +1 -1
  40. package/dist/coffee-D8Swy5yR.js +8 -0
  41. package/dist/components/index.js +665 -644
  42. package/dist/components/ui/atoms/accordion.d.ts +9 -7
  43. package/dist/components/ui/atoms/accordion.d.ts.map +1 -1
  44. package/dist/components/ui/atoms/accordion.js +454 -243
  45. package/dist/components/ui/atoms/alert-dialog.d.ts +13 -9
  46. package/dist/components/ui/atoms/alert-dialog.d.ts.map +1 -1
  47. package/dist/components/ui/atoms/alert-dialog.js +149 -183
  48. package/dist/components/ui/atoms/alert.d.ts +2 -1
  49. package/dist/components/ui/atoms/alert.d.ts.map +1 -1
  50. package/dist/components/ui/atoms/alert.js +36 -25
  51. package/dist/components/ui/atoms/avatar.d.ts +10 -5
  52. package/dist/components/ui/atoms/avatar.d.ts.map +1 -1
  53. package/dist/components/ui/atoms/avatar.js +198 -205
  54. package/dist/components/ui/atoms/badge.d.ts +4 -5
  55. package/dist/components/ui/atoms/badge.d.ts.map +1 -1
  56. package/dist/components/ui/atoms/badge.js +31 -22
  57. package/dist/components/ui/atoms/breadcrumb.d.ts +4 -5
  58. package/dist/components/ui/atoms/breadcrumb.d.ts.map +1 -1
  59. package/dist/components/ui/atoms/breadcrumb.js +46 -29
  60. package/dist/components/ui/atoms/button.d.ts +4 -6
  61. package/dist/components/ui/atoms/button.d.ts.map +1 -1
  62. package/dist/components/ui/atoms/button.js +59 -28
  63. package/dist/components/ui/atoms/byoc-badge.d.ts +2 -2
  64. package/dist/components/ui/atoms/byoc-badge.d.ts.map +1 -1
  65. package/dist/components/ui/atoms/byoc-badge.js +14 -8
  66. package/dist/components/ui/atoms/calendar.d.ts +6 -16
  67. package/dist/components/ui/atoms/calendar.d.ts.map +1 -1
  68. package/dist/components/ui/atoms/calendar.js +1 -1
  69. package/dist/components/ui/atoms/card.d.ts +4 -2
  70. package/dist/components/ui/atoms/card.d.ts.map +1 -1
  71. package/dist/components/ui/atoms/card.js +46 -35
  72. package/dist/components/ui/atoms/chart.d.ts +24 -48
  73. package/dist/components/ui/atoms/chart.d.ts.map +1 -1
  74. package/dist/components/ui/atoms/chart.js +179 -148
  75. package/dist/components/ui/atoms/checkbox.d.ts +2 -3
  76. package/dist/components/ui/atoms/checkbox.d.ts.map +1 -1
  77. package/dist/components/ui/atoms/checkbox.js +269 -249
  78. package/dist/components/ui/atoms/code-block.js +1 -1
  79. package/dist/components/ui/atoms/collapsible.d.ts +5 -5
  80. package/dist/components/ui/atoms/collapsible.d.ts.map +1 -1
  81. package/dist/components/ui/atoms/collapsible.js +208 -23
  82. package/dist/components/ui/atoms/command.d.ts +4 -3
  83. package/dist/components/ui/atoms/command.d.ts.map +1 -1
  84. package/dist/components/ui/atoms/command.js +1655 -348
  85. package/dist/components/ui/atoms/dialog.d.ts +12 -10
  86. package/dist/components/ui/atoms/dialog.d.ts.map +1 -1
  87. package/dist/components/ui/atoms/dialog.js +91 -80
  88. package/dist/components/ui/atoms/dropdown-menu.d.ts +21 -17
  89. package/dist/components/ui/atoms/dropdown-menu.d.ts.map +1 -1
  90. package/dist/components/ui/atoms/dropdown-menu.js +1507 -899
  91. package/dist/components/ui/atoms/form.d.ts +5 -3
  92. package/dist/components/ui/atoms/form.d.ts.map +1 -1
  93. package/dist/components/ui/atoms/form.js +36 -42
  94. package/dist/components/ui/atoms/hover-card.d.ts +5 -6
  95. package/dist/components/ui/atoms/hover-card.d.ts.map +1 -1
  96. package/dist/components/ui/atoms/hover-card.js +355 -193
  97. package/dist/components/ui/atoms/icons/index.d.ts +1 -0
  98. package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
  99. package/dist/components/ui/atoms/icons/index.js +58 -56
  100. package/dist/components/ui/atoms/icons/telegram.d.ts +4 -0
  101. package/dist/components/ui/atoms/icons/telegram.d.ts.map +1 -0
  102. package/dist/components/ui/atoms/icons/telegram.js +37 -0
  103. package/dist/components/ui/atoms/index.d.ts +1 -0
  104. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  105. package/dist/components/ui/atoms/index.js +566 -545
  106. package/dist/components/ui/atoms/input-group.d.ts +20 -0
  107. package/dist/components/ui/atoms/input-group.d.ts.map +1 -0
  108. package/dist/components/ui/atoms/input-group.js +136 -0
  109. package/dist/components/ui/atoms/input.d.ts.map +1 -1
  110. package/dist/components/ui/atoms/input.js +113 -13
  111. package/dist/components/ui/atoms/label.d.ts +1 -2
  112. package/dist/components/ui/atoms/label.d.ts.map +1 -1
  113. package/dist/components/ui/atoms/label.js +18 -31
  114. package/dist/components/ui/atoms/markdown.js +1 -1
  115. package/dist/components/ui/atoms/mobile-tooltip.js +4 -3
  116. package/dist/components/ui/atoms/popover.d.ts +8 -6
  117. package/dist/components/ui/atoms/popover.d.ts.map +1 -1
  118. package/dist/components/ui/atoms/popover.js +617 -245
  119. package/dist/components/ui/atoms/pro-badge.js +1 -1
  120. package/dist/components/ui/atoms/progress.d.ts +7 -4
  121. package/dist/components/ui/atoms/progress.d.ts.map +1 -1
  122. package/dist/components/ui/atoms/progress.js +236 -92
  123. package/dist/components/ui/atoms/radio-group.d.ts +4 -4
  124. package/dist/components/ui/atoms/radio-group.d.ts.map +1 -1
  125. package/dist/components/ui/atoms/radio-group.js +355 -251
  126. package/dist/components/ui/atoms/resizable.d.ts +3 -4
  127. package/dist/components/ui/atoms/resizable.d.ts.map +1 -1
  128. package/dist/components/ui/atoms/resizable.js +25 -27
  129. package/dist/components/ui/atoms/scroll-area.d.ts +5 -5
  130. package/dist/components/ui/atoms/scroll-area.d.ts.map +1 -1
  131. package/dist/components/ui/atoms/scroll-area.js +611 -526
  132. package/dist/components/ui/atoms/scroll-button.d.ts.map +1 -1
  133. package/dist/components/ui/atoms/scroll-button.js +27 -22
  134. package/dist/components/ui/atoms/select.d.ts +11 -11
  135. package/dist/components/ui/atoms/select.d.ts.map +1 -1
  136. package/dist/components/ui/atoms/select.js +1525 -889
  137. package/dist/components/ui/atoms/separator.d.ts +2 -3
  138. package/dist/components/ui/atoms/separator.d.ts.map +1 -1
  139. package/dist/components/ui/atoms/separator.js +16 -35
  140. package/dist/components/ui/atoms/sheet.d.ts +9 -9
  141. package/dist/components/ui/atoms/sheet.d.ts.map +1 -1
  142. package/dist/components/ui/atoms/sheet.js +65 -64
  143. package/dist/components/ui/atoms/sidebar.d.ts +9 -15
  144. package/dist/components/ui/atoms/sidebar.d.ts.map +1 -1
  145. package/dist/components/ui/atoms/sidebar.js +288 -283
  146. package/dist/components/ui/atoms/skeleton.js +4 -4
  147. package/dist/components/ui/atoms/slider.d.ts +2 -3
  148. package/dist/components/ui/atoms/slider.d.ts.map +1 -1
  149. package/dist/components/ui/atoms/slider.js +886 -440
  150. package/dist/components/ui/atoms/switch.d.ts +4 -5
  151. package/dist/components/ui/atoms/switch.d.ts.map +1 -1
  152. package/dist/components/ui/atoms/switch.js +218 -151
  153. package/dist/components/ui/atoms/table.d.ts +2 -4
  154. package/dist/components/ui/atoms/table.d.ts.map +1 -1
  155. package/dist/components/ui/atoms/table.js +35 -36
  156. package/dist/components/ui/atoms/tabs.d.ts +11 -7
  157. package/dist/components/ui/atoms/tabs.d.ts.map +1 -1
  158. package/dist/components/ui/atoms/tabs.js +492 -186
  159. package/dist/components/ui/atoms/textarea.d.ts.map +1 -1
  160. package/dist/components/ui/atoms/textarea.js +7 -7
  161. package/dist/components/ui/atoms/toggle.d.ts +2 -3
  162. package/dist/components/ui/atoms/toggle.d.ts.map +1 -1
  163. package/dist/components/ui/atoms/toggle.js +92 -45
  164. package/dist/components/ui/atoms/tooltip.d.ts +6 -9
  165. package/dist/components/ui/atoms/tooltip.d.ts.map +1 -1
  166. package/dist/components/ui/atoms/tooltip.js +625 -343
  167. package/dist/components/ui/atoms/view-tools-control.js +16 -15
  168. package/dist/components/ui/atoms/virtualized-grid.d.ts +11 -4
  169. package/dist/components/ui/atoms/virtualized-grid.d.ts.map +1 -1
  170. package/dist/components/ui/atoms/virtualized-grid.js +365 -333
  171. package/dist/components/ui/index.js +665 -644
  172. package/dist/components/ui/molecules/chat-history-item.d.ts.map +1 -1
  173. package/dist/components/ui/molecules/chat-history-item.js +47 -40
  174. package/dist/components/ui/molecules/command-bar.js +1 -1
  175. package/dist/components/ui/molecules/confirm-popover.d.ts +2 -2
  176. package/dist/components/ui/molecules/confirm-popover.d.ts.map +1 -1
  177. package/dist/components/ui/molecules/confirm-popover.js +26 -24
  178. package/dist/components/ui/molecules/date-time-picker.d.ts.map +1 -1
  179. package/dist/components/ui/molecules/date-time-picker.js +17 -11
  180. package/dist/components/ui/molecules/index.js +1 -1
  181. package/dist/components/ui/molecules/message.d.ts +2 -3
  182. package/dist/components/ui/molecules/message.d.ts.map +1 -1
  183. package/dist/components/ui/molecules/message.js +10 -16
  184. package/dist/components/ui/molecules/prompt-input.d.ts +1 -1
  185. package/dist/components/ui/molecules/prompt-input.d.ts.map +1 -1
  186. package/dist/components/ui/molecules/prompt-input.js +21 -22
  187. package/dist/components/ui/molecules/requirement-badges.d.ts.map +1 -1
  188. package/dist/components/ui/molecules/requirement-badges.js +3 -3
  189. package/dist/components/ui/molecules/steps-progress.js +1 -0
  190. package/dist/components/ui/molecules/tool-call-accordion.js +1 -0
  191. package/dist/components/ui/molecules/tool-card.d.ts.map +1 -1
  192. package/dist/components/ui/molecules/tool-card.js +60 -47
  193. package/dist/components/ui/molecules/toolkit-card.d.ts.map +1 -1
  194. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  195. package/dist/components/ui/molecules/user-nav.d.ts.map +1 -1
  196. package/dist/components/ui/molecules/user-nav.js +62 -57
  197. package/dist/components/ui/templates/auth-template.js +5 -5
  198. package/dist/composite-BASdnlNo.js +220 -0
  199. package/dist/composite-BSpUD7nI.js +66 -0
  200. package/dist/cpp-CA4iM_wM.js +18 -0
  201. package/dist/createBaseUIEventDetails-CqidROtw.js +55 -0
  202. package/dist/crystal-CRJyc4G-.js +4 -4
  203. package/dist/css-M7EaDHN_.js +6 -0
  204. package/dist/csv-B7yqA61e.js +6 -0
  205. package/dist/dark-plus-B4vfALTw.js +4 -0
  206. package/dist/detectBrowser-Dn2N72k1.js +42 -0
  207. package/dist/dracula-Cb59ZzY3.js +4 -0
  208. package/dist/dracula-soft-aaEmszbU.js +4 -0
  209. package/dist/edge-BYQkOzbF.js +1 -1
  210. package/dist/element-DSo91iOi.js +88 -0
  211. package/dist/elm-BtNbw_Cd.js +1 -1
  212. package/dist/erlang-DNcDT8Hi.js +1 -1
  213. package/dist/event-BCa0Un_3.js +30 -0
  214. package/dist/everforest-dark-CLp_21RJ.js +4 -0
  215. package/dist/everforest-light-CZ0NCAAv.js +4 -0
  216. package/dist/floating-ui.utils-48URp89E.js +126 -0
  217. package/dist/floating-ui.utils.dom-jr2suqy2.js +135 -0
  218. package/dist/fsharp-CYOiIVNx.js +1 -1
  219. package/dist/getDisabledMountTransitionStyles-fmnaQYVj.js +1539 -0
  220. package/dist/getPseudoElementBounds-B4_miSEJ.js +364 -0
  221. package/dist/git-rebase-ZWUFO_T4.js +1 -1
  222. package/dist/github-dark-BD3lImVS.js +4 -0
  223. package/dist/github-dark-default-ID_nBUwl.js +4 -0
  224. package/dist/github-dark-dimmed-Cw4rFgde.js +4 -0
  225. package/dist/github-dark-high-contrast-DSby9de8.js +4 -0
  226. package/dist/github-light-W396yAFe.js +4 -0
  227. package/dist/github-light-default-DCAQ2px1.js +4 -0
  228. package/dist/github-light-high-contrast-ChWJGEvx.js +4 -0
  229. package/dist/glimmer-js-DkxNrfPT.js +2 -2
  230. package/dist/glimmer-ts-D6YZEmK_.js +2 -2
  231. package/dist/glsl-CgdqkyFp.js +8 -0
  232. package/dist/graphql-Bv26LTzG.js +14 -0
  233. package/dist/gruvbox-dark-hard-BC1GRqFa.js +4 -0
  234. package/dist/gruvbox-dark-medium-COLy2cDY.js +4 -0
  235. package/dist/gruvbox-dark-soft-B8MALL4f.js +4 -0
  236. package/dist/gruvbox-light-hard-Bzxr_AnB.js +4 -0
  237. package/dist/gruvbox-light-medium-D2fqu3Kj.js +4 -0
  238. package/dist/gruvbox-light-soft-atzRH3-n.js +4 -0
  239. package/dist/hack-ItRNKiEb.js +1 -1
  240. package/dist/haml-B1t5q1Sv.js +10 -0
  241. package/dist/haml-NZLVzu_R.js +1 -1
  242. package/dist/handlebars-B2fb61mr.js +14 -0
  243. package/dist/handlebars-mxStpSE7.js +2 -2
  244. package/dist/highlighted-body-OFNGDK62-Df6AJMbs.js +20 -0
  245. package/dist/hooks/use-mobile.d.ts.map +1 -1
  246. package/dist/hooks/use-mobile.js +11 -12
  247. package/dist/horizon-PFtq58ZB.js +4 -0
  248. package/dist/horizon-bright-2WzHy-Vo.js +4 -0
  249. package/dist/houston-BEqUWhHr.js +4 -0
  250. package/dist/html-B50bmoVb.js +1 -1
  251. package/dist/html-CPZ3oZQ7.js +10 -0
  252. package/dist/html-derivative-B2qv7eyt.js +8 -0
  253. package/dist/http-BQ2t9cn1.js +14 -0
  254. package/dist/hurl-RyCMCa80.js +12 -0
  255. package/dist/imba-DpB-wtPB.js +6 -0
  256. package/dist/index-3rscXtm3.js +4708 -0
  257. package/dist/inertValue-kpZZDBEy.js +7 -0
  258. package/dist/integrations/rhf/index.js +6 -5
  259. package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
  260. package/dist/java-CbphP4lz.js +6 -0
  261. package/dist/javascript-CgYd5l7W.js +6 -0
  262. package/dist/jinja-DFCUirAg.js +11 -0
  263. package/dist/jison-CTEI_s6O.js +8 -0
  264. package/dist/json-B5-prx4F.js +6 -0
  265. package/dist/json5-CZ8R1oUY.js +6 -0
  266. package/dist/jsonc-DMboCKBJ.js +6 -0
  267. package/dist/jsonl-YgIUi4Dg.js +6 -0
  268. package/dist/jsx-D4q4E1UD.js +6 -0
  269. package/dist/julia-2ubi2n9a.js +16 -0
  270. package/dist/just-CEK2SJ_k.js +4 -4
  271. package/dist/kanagawa-dragon-DuYaOBBk.js +4 -0
  272. package/dist/kanagawa-lotus-CyjAihYC.js +4 -0
  273. package/dist/kanagawa-wave-BVdXUMj5.js +4 -0
  274. package/dist/laserwave-B_2VVKNJ.js +4 -0
  275. package/dist/less-MoGo8xoS.js +6 -0
  276. package/dist/light-plus-IB4fPeJj.js +4 -0
  277. package/dist/liquid-CHzkx3jT.js +2 -2
  278. package/dist/lua-Bp3IRv7I.js +1 -1
  279. package/dist/main.js +691 -670
  280. package/dist/markdown-B-zRtm0x.js +6 -0
  281. package/dist/{markdown-D0xxRbwP.js → markdown-B71Eurda.js} +10329 -8108
  282. package/dist/marko-BlmC3dqW.js +14 -0
  283. package/dist/marko-CJBA24Ri.js +2 -2
  284. package/dist/material-theme-CjsSdYF2.js +4 -0
  285. package/dist/material-theme-darker-DEk0vgdS.js +4 -0
  286. package/dist/material-theme-lighter-DEVB_7K5.js +4 -0
  287. package/dist/material-theme-ocean-DK6jm24j.js +4 -0
  288. package/dist/material-theme-palenight-CNkXNpHv.js +4 -0
  289. package/dist/mdc-C9YSUwVC.js +2 -2
  290. package/dist/mdc-CLNk3q28.js +12 -0
  291. package/dist/mdx-CiUWpBB_.js +6 -0
  292. package/dist/mermaid-GHXKKRXX-BkplG-MI.js +5 -0
  293. package/dist/metadata/toolkit-icons.d.ts.map +1 -1
  294. package/dist/metadata/toolkit-icons.js +40 -38
  295. package/dist/metadata/toolkits.d.ts.map +1 -1
  296. package/dist/metadata/toolkits.js +13 -0
  297. package/dist/min-dark-CJcHUHwu.js +4 -0
  298. package/dist/min-light-BAN2UR75.js +4 -0
  299. package/dist/monokai-BbXwpjKl.js +4 -0
  300. package/dist/night-owl-csViJ7u4.js +4 -0
  301. package/dist/night-owl-light-BC-NuMC3.js +4 -0
  302. package/dist/nim-QAjRdh9w.js +5 -5
  303. package/dist/nord-B8Sq-VQ0.js +4 -0
  304. package/dist/one-dark-pro-DTdrcl-J.js +4 -0
  305. package/dist/one-light-kPHTChCU.js +4 -0
  306. package/dist/owner-rKN292Q9.js +6 -0
  307. package/dist/perl-DkVrgJBg.js +3 -3
  308. package/dist/php-BIzsF_5x.js +4 -4
  309. package/dist/php-Kn-vgdBD.js +18 -0
  310. package/dist/plastic-DDweBgVs.js +4 -0
  311. package/dist/poimandres-Dqvs16BQ.js +4 -0
  312. package/dist/popupStateMapping-BT9Y_jIq.js +1849 -0
  313. package/dist/postcss-CwL8bLZI.js +6 -0
  314. package/dist/pug-CTOOvSEH.js +12 -0
  315. package/dist/pug-XOw9Q1Ho.js +1 -1
  316. package/dist/python-jjYlTiSH.js +6 -0
  317. package/dist/qml-rTNXsquU.js +1 -1
  318. package/dist/r-C8zl4zMO.js +6 -0
  319. package/dist/react-resizable-panels-BqIpIFl2.js +2017 -0
  320. package/dist/red-DBDwQkX-.js +4 -0
  321. package/dist/regexp-Dpy_RgoJ.js +6 -0
  322. package/dist/resolveAriaLabelledBy-B5vw-szP.js +11 -0
  323. package/dist/rose-pine-DGHrTu7e.js +4 -0
  324. package/dist/rose-pine-dawn-DfRVdapG.js +4 -0
  325. package/dist/rose-pine-moon-DFpJm5Rd.js +4 -0
  326. package/dist/rst-DM32Wy3O.js +5 -5
  327. package/dist/ruby-BeqCs27h.js +8 -8
  328. package/dist/safePolygon-CJcmMc0u.js +389 -0
  329. package/dist/safeReact-DKq-628G.js +7 -0
  330. package/dist/sas-fpEvgATw.js +1 -1
  331. package/dist/sass-BmupNt-w.js +6 -0
  332. package/dist/scss-BZYVIVaN.js +8 -0
  333. package/dist/serializeValue-BebmSzW3.js +14 -0
  334. package/dist/shellscript-fMxXshxv.js +6 -0
  335. package/dist/shellsession-DiDJNQdy.js +1 -1
  336. package/dist/slack-dark-noeC6QPl.js +4 -0
  337. package/dist/slack-ochin-3_2idqLR.js +4 -0
  338. package/dist/snazzy-light-B9cV359v.js +4 -0
  339. package/dist/solarized-dark-B6X0ILWr.js +4 -0
  340. package/dist/solarized-light-LxOemn3c.js +4 -0
  341. package/dist/sql-D30Zid36.js +6 -0
  342. package/dist/stata-B8c5fTjX.js +1 -1
  343. package/dist/styles-DU5BO7fS.js +16 -0
  344. package/dist/stylus-BoBcEBjx.js +6 -0
  345. package/dist/surrealql-CQi7GQN7.js +1 -1
  346. package/dist/svelte-b9PAcyUe.js +14 -0
  347. package/dist/svelte-rYri41WT.js +3 -3
  348. package/dist/synthwave-84-DzQeMpV0.js +4 -0
  349. package/dist/templ-Crs9Ui8q.js +1 -1
  350. package/dist/tex-AHxmLTL0.js +1 -1
  351. package/dist/tokyo-night-CLM-V_Re.js +4 -0
  352. package/dist/{toolkit-card-CB1oiaei.js → toolkit-card-DhpOY80l.js} +56 -36
  353. package/dist/ts-tags-CP1b-4Z2.js +41 -0
  354. package/dist/ts-tags-ioVe2PKw.js +5 -5
  355. package/dist/tsx-QNpb2qLW.js +6 -0
  356. package/dist/twig-DwV2Fi4L.js +2 -2
  357. package/dist/typescript-AhniRyfZ.js +6 -0
  358. package/dist/useAnimationFrame-DIc6eFHa.js +69 -0
  359. package/dist/useAriaLabelledBy-VklrCmKp.js +34 -0
  360. package/dist/useBaseUiId-C8Dq0BQq.js +25 -0
  361. package/dist/useButton-JYPKQKj4.js +150 -0
  362. package/dist/useCollapsiblePanel-9pDlDh3R.js +257 -0
  363. package/dist/useCompositeItem-D00ALGkT.js +35 -0
  364. package/dist/useCompositeListItem-CYQrZg5-.js +74 -0
  365. package/dist/useControlled-Sx-_x7Sz.js +32 -0
  366. package/dist/useFocus-Aj9ShMQu.js +97 -0
  367. package/dist/useIsoLayoutEffect-DpJo20by.js +7 -0
  368. package/dist/useLabelableId-DF_d91GP.js +44 -0
  369. package/dist/useOnFirstRender-B4aruaIA.js +9 -0
  370. package/dist/useOnMount-JHtE6teb.js +9 -0
  371. package/dist/useOpenChangeComplete-DkeH9FGJ.js +130 -0
  372. package/dist/useRender-BNXBkp2o.js +7 -0
  373. package/dist/useRenderElement-DNB2vtF1.js +274 -0
  374. package/dist/useRole-N-RCRzo1.js +76 -0
  375. package/dist/useStableCallback-CudqoENs.js +33 -0
  376. package/dist/useSyncedFloatingRootContext-Bc90zSTy.js +185 -0
  377. package/dist/useTimeout-DAqPwigF.js +33 -0
  378. package/dist/useValueAsRef-LhoZc6As.js +20 -0
  379. package/dist/useValueChanged-Bissqjjn.js +15 -0
  380. package/dist/valueToPercent-BBgE4D3L.js +27 -0
  381. package/dist/vesper-BmV7KiQ0.js +4 -0
  382. package/dist/visuallyHidden-PuyyGHVF.js +22 -0
  383. package/dist/vitesse-black-CxZz3C4s.js +4 -0
  384. package/dist/vitesse-dark-DVUJ0sy2.js +4 -0
  385. package/dist/vitesse-light-BDJohtUr.js +4 -0
  386. package/dist/vue-CY6W2ID0.js +31 -0
  387. package/dist/vue-DXEmyXn9.js +3 -3
  388. package/dist/vue-html-DYXHAJ2G.js +8 -0
  389. package/dist/vue-vine-D41-N99t.js +4 -4
  390. package/dist/vue-vine-DiWTpMwZ.js +18 -0
  391. package/dist/wasm-3y0A1Y71.js +6 -0
  392. package/dist/wasm-Dm9SFfrx.js +7 -0
  393. package/dist/web-BbvN_Lei.js +2846 -0
  394. package/dist/wgsl-SXl3EZUN.js +6 -0
  395. package/dist/wit-Cw0CTVY0.js +6 -0
  396. package/dist/xml-CNXGTZ6Z.js +8 -0
  397. package/dist/xsl-BmSZphgC.js +1 -1
  398. package/dist/yaml-DZqZ2PBD.js +6 -0
  399. package/package.json +37 -34
  400. package/dist/highlighted-body-TPN3WLV5-D6UnKGod.js +0 -19
  401. package/dist/index-0ioNhtNM.js +0 -10
  402. package/dist/index-437EL2iq.js +0 -52
  403. package/dist/index-B695uy69.js +0 -9
  404. package/dist/index-BEZCAdXQ.js +0 -1568
  405. package/dist/index-BGQepRFJ.js +0 -27
  406. package/dist/index-BZPx6jYI.js +0 -8
  407. package/dist/index-BaLuVb4t.js +0 -70
  408. package/dist/index-Bw62B28F.js +0 -31
  409. package/dist/index-By-GFSsC.js +0 -245
  410. package/dist/index-ByaXH_ih.js +0 -10
  411. package/dist/index-CCKe-Mpx.js +0 -6
  412. package/dist/index-Cv867SGx.js +0 -13
  413. package/dist/index-CvA4FcaC.js +0 -677
  414. package/dist/index-D2LZVjSn.js +0 -82
  415. package/dist/index-DFZozV_h.js +0 -68
  416. package/dist/index-DJQkmo5O.js +0 -49
  417. package/dist/index-DLohNuco.js +0 -36
  418. package/dist/index-DrFfdHac.js +0 -144
  419. package/dist/index-DrlYGDRT.js +0 -119
  420. package/dist/index-Dz8CQngS.js +0 -181
  421. package/dist/index-cd1ceFJg.js +0 -6973
  422. package/dist/index-rKs9bXHr.js +0 -6
  423. package/dist/mermaid-O7DHMXV3-gUrB-Xs1.js +0 -4
  424. package/dist/react-resizable-panels.browser-DYl0LXfw.js +0 -1510
  425. package/dist/web-BwFNdl01.js +0 -697
@@ -1,944 +1,1596 @@
1
- import { jsx as r, jsxs as ne } from "react/jsx-runtime";
2
- import { CheckIcon as Rn, CircleIcon as bn, ChevronRightIcon as xn } from "lucide-react";
3
- import { cn as R } from "../../../lib/utils.js";
4
- import * as s from "react";
5
- import { c as g } from "../../../index-B695uy69.js";
6
- import { u as G, b as Me, c as Dn } from "../../../index-D2LZVjSn.js";
7
- import { c as he } from "../../../index-DFZozV_h.js";
8
- import { u as we } from "../../../index-437EL2iq.js";
9
- import { P as y, d as Sn } from "../../../index-DLohNuco.js";
10
- import { c as In } from "../../../index-DJQkmo5O.js";
11
- import { u as Pn } from "../../../index-ByaXH_ih.js";
12
- import { P as En, D as yn } from "../../../index-DrFfdHac.js";
13
- import { h as Nn, u as Tn, R as An, F as On } from "../../../index-CvA4FcaC.js";
14
- import { u as V } from "../../../index-Cv867SGx.js";
15
- import { R as Ce, A as kn, c as _e, C as Ln, a as Gn } from "../../../index-BEZCAdXQ.js";
16
- import { P as Y } from "../../../index-BaLuVb4t.js";
17
- import { c as Re, I as Fn, R as Kn } from "../../../index-Dz8CQngS.js";
18
- import { u as te } from "../../../index-0ioNhtNM.js";
19
- var ee = ["Enter", " "], $n = ["ArrowDown", "PageUp", "Home"], be = ["ArrowUp", "PageDown", "End"], Un = [...$n, ...be], zn = {
20
- ltr: [...ee, "ArrowRight"],
21
- rtl: [...ee, "ArrowLeft"]
22
- }, Bn = {
23
- ltr: ["ArrowLeft"],
24
- rtl: ["ArrowRight"]
25
- }, F = "Menu", [k, Vn, jn] = In(F), [D, xe] = he(F, [
26
- jn,
27
- _e,
28
- Re
29
- ]), K = _e(), De = Re(), [Se, b] = D(F), [Xn, $] = D(F), Ie = (e) => {
30
- const { __scopeMenu: t, open: n = !1, children: o, dir: a, onOpenChange: c, modal: i = !0 } = e, d = K(t), [f, m] = s.useState(null), p = s.useRef(!1), u = te(c), v = Pn(a);
31
- return s.useEffect(() => {
32
- const C = () => {
33
- p.current = !0, document.addEventListener("pointerdown", M, { capture: !0, once: !0 }), document.addEventListener("pointermove", M, { capture: !0, once: !0 });
34
- }, M = () => p.current = !1;
35
- return document.addEventListener("keydown", C, { capture: !0 }), () => {
36
- document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown", M, { capture: !0 }), document.removeEventListener("pointermove", M, { capture: !0 });
37
- };
38
- }, []), /* @__PURE__ */ r(Ce, { ...d, children: /* @__PURE__ */ r(
39
- Se,
40
- {
41
- scope: t,
42
- open: n,
43
- onOpenChange: u,
44
- content: f,
45
- onContentChange: m,
46
- children: /* @__PURE__ */ r(
47
- Xn,
48
- {
49
- scope: t,
50
- onClose: s.useCallback(() => u(!1), [u]),
51
- isUsingKeyboardRef: p,
52
- dir: v,
53
- modal: i,
54
- children: o
55
- }
56
- )
1
+ "use client";
2
+ import { jsx as f, jsxs as xe } from "react/jsx-runtime";
3
+ import { CheckIcon as ut, ChevronRightIcon as qt } from "lucide-react";
4
+ import { cn as ce } from "../../../lib/utils.js";
5
+ import * as n from "react";
6
+ import { u as he } from "../../../useTimeout-DAqPwigF.js";
7
+ import { u as de } from "../../../useStableCallback-CudqoENs.js";
8
+ import { u as ge, a as Wt } from "../../../useBaseUiId-C8Dq0BQq.js";
9
+ import { u as ve } from "../../../useIsoLayoutEffect-DpJo20by.js";
10
+ import { u as Xt } from "../../../useOnFirstRender-B4aruaIA.js";
11
+ import { F as $t, I as Jt, u as Qt, a as Zt, b as ct } from "../../../InternalBackdrop-BVEfe6O1.js";
12
+ import { f as ie, m as Oe, c as en, u as q, a as tn, E as _e, b as nn } from "../../../useRenderElement-DNB2vtF1.js";
13
+ import { x as dt, z as on, L as rn, s as sn, w as an, R as un, P as cn, M as lt, d as G, H as dn, v as pt, u as ft, p as ln, T as pn, q as Ve, o as fn, J as mn, b as gn, E as bn, j as hn, G as vn, k as xn, B as ot, i as rt, A as Mn, r as Cn } from "../../../popupStateMapping-BT9Y_jIq.js";
14
+ import { u as Rn } from "../../../DirectionContext-BSOheMwC.js";
15
+ import { r as Ee, c as ae, o as yn, b as ye, s as be, t as st, a as En, e as In, f as ke, l as Pn, i as Nn, q as Tn } from "../../../createBaseUIEventDetails-CqidROtw.js";
16
+ import { p as wn, c as Sn, a as On, b as kn, u as Dn, d as _n, e as Vn } from "../../../useSyncedFloatingRootContext-Bc90zSTy.js";
17
+ import { u as Fn } from "../../../useRole-N-RCRzo1.js";
18
+ import { u as An, a as Un, g as Bn } from "../../../getPseudoElementBounds-B4_miSEJ.js";
19
+ import { u as mt } from "../../../useControlled-Sx-_x7Sz.js";
20
+ import { b as Gn } from "../../../detectBrowser-Dn2N72k1.js";
21
+ import { a as gt, u as Ln } from "../../../useButton-JYPKQKj4.js";
22
+ import { u as Ie } from "../../../useCompositeListItem-CYQrZg5-.js";
23
+ import { t as bt, u as ht, a as Fe, b as Hn } from "../../../useOpenChangeComplete-DkeH9FGJ.js";
24
+ import { i as zn } from "../../../inertValue-kpZZDBEy.js";
25
+ import { g as vt, u as Kn, a as Yn } from "../../../getDisabledMountTransitionStyles-fmnaQYVj.js";
26
+ import { C as jn } from "../../../CompositeList-yq5K_yj6.js";
27
+ import { u as qn } from "../../../ToolbarRootContext-D7EsmJ5f.js";
28
+ import { C as Wn } from "../../../composite-BSpUD7nI.js";
29
+ import { a as Xn, u as xt, s as Mt } from "../../../safePolygon-CJcmMc0u.js";
30
+ import { S as $n } from "../../../Separator-CswSYAXX.js";
31
+ import * as at from "react-dom";
32
+ import { o as De } from "../../../owner-rKN292Q9.js";
33
+ import { C as Jn } from "../../../CompositeItem-CniPsjzP.js";
34
+ import { i as Qn, n as Zn, m as eo } from "../../../floating-ui.utils.dom-jr2suqy2.js";
35
+ import { u as to } from "../../../useFocus-Aj9ShMQu.js";
36
+ import { c as Se } from "../../../element-DSo91iOi.js";
37
+ const Ae = /* @__PURE__ */ n.createContext(void 0);
38
+ process.env.NODE_ENV !== "production" && (Ae.displayName = "MenuPositionerContext");
39
+ function Me(e) {
40
+ const t = n.useContext(Ae);
41
+ if (t === void 0 && !e)
42
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>." : ie(33));
43
+ return t;
44
+ }
45
+ const Ue = /* @__PURE__ */ n.createContext(void 0);
46
+ process.env.NODE_ENV !== "production" && (Ue.displayName = "MenuRootContext");
47
+ function ee(e) {
48
+ const t = n.useContext(Ue);
49
+ if (t === void 0 && !e)
50
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>." : ie(36));
51
+ return t;
52
+ }
53
+ const Ct = /* @__PURE__ */ n.createContext(void 0);
54
+ process.env.NODE_ENV !== "production" && (Ct.displayName = "ContextMenuRootContext");
55
+ function Pe(e = !0) {
56
+ const t = n.useContext(Ct);
57
+ if (t === void 0 && !e)
58
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>." : ie(25));
59
+ return t;
60
+ }
61
+ const Be = /* @__PURE__ */ n.createContext(void 0);
62
+ process.env.NODE_ENV !== "production" && (Be.displayName = "MenuCheckboxItemContext");
63
+ function no() {
64
+ const e = n.useContext(Be);
65
+ if (e === void 0)
66
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>." : ie(30));
67
+ return e;
68
+ }
69
+ function oo(e) {
70
+ const {
71
+ closeOnClick: t,
72
+ highlighted: o,
73
+ id: u,
74
+ nodeId: p,
75
+ store: d,
76
+ typingRef: b,
77
+ itemRef: r,
78
+ itemMetadata: c
79
+ } = e, {
80
+ events: y
81
+ } = d.useState("floatingTreeRoot"), m = Pe(!0), x = m !== void 0;
82
+ return n.useMemo(() => ({
83
+ id: u,
84
+ role: "menuitem",
85
+ tabIndex: o ? 0 : -1,
86
+ onKeyDown(g) {
87
+ g.key === " " && b?.current && g.preventDefault();
88
+ },
89
+ onMouseMove(g) {
90
+ p && y.emit("itemhover", {
91
+ nodeId: p,
92
+ target: g.currentTarget
93
+ });
94
+ },
95
+ onClick(g) {
96
+ t && y.emit("close", {
97
+ domEvent: g,
98
+ reason: Ee
99
+ });
100
+ },
101
+ onMouseUp(g) {
102
+ if (m) {
103
+ const P = m.initialCursorPointRef.current;
104
+ if (m.initialCursorPointRef.current = null, x && P && Math.abs(g.clientX - P.x) <= 1 && Math.abs(g.clientY - P.y) <= 1 || x && !Gn && g.button === 2)
105
+ return;
106
+ }
107
+ r.current && d.context.allowMouseUpTriggerRef.current && (!x || g.button === 2) && (!c || c.type === "regular-item") && r.current.click();
57
108
  }
58
- ) });
59
- };
60
- Ie.displayName = F;
61
- var Yn = "MenuAnchor", oe = s.forwardRef(
62
- (e, t) => {
63
- const { __scopeMenu: n, ...o } = e, a = K(n);
64
- return /* @__PURE__ */ r(kn, { ...a, ...o, ref: t });
65
- }
66
- );
67
- oe.displayName = Yn;
68
- var re = "MenuPortal", [Hn, Pe] = D(re, {
69
- forceMount: void 0
70
- }), Ee = (e) => {
71
- const { __scopeMenu: t, forceMount: n, children: o, container: a } = e, c = b(re, t);
72
- return /* @__PURE__ */ r(Hn, { scope: t, forceMount: n, children: /* @__PURE__ */ r(Y, { present: n || c.open, children: /* @__PURE__ */ r(En, { asChild: !0, container: a, children: o }) }) });
109
+ }), [t, o, u, y, p, d, b, r, m, x, c]);
110
+ }
111
+ const Ge = {
112
+ type: "regular-item"
73
113
  };
74
- Ee.displayName = re;
75
- var _ = "MenuContent", [Wn, ae] = D(_), ye = s.forwardRef(
76
- (e, t) => {
77
- const n = Pe(_, e.__scopeMenu), { forceMount: o = n.forceMount, ...a } = e, c = b(_, e.__scopeMenu), i = $(_, e.__scopeMenu);
78
- return /* @__PURE__ */ r(k.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ r(Y, { present: o || c.open, children: /* @__PURE__ */ r(k.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ r(Zn, { ...a, ref: t }) : /* @__PURE__ */ r(qn, { ...a, ref: t }) }) }) });
79
- }
80
- ), Zn = s.forwardRef(
81
- (e, t) => {
82
- const n = b(_, e.__scopeMenu), o = s.useRef(null), a = G(t, o);
83
- return s.useEffect(() => {
84
- const c = o.current;
85
- if (c) return Nn(c);
86
- }, []), /* @__PURE__ */ r(
87
- se,
88
- {
89
- ...e,
90
- ref: a,
91
- trapFocus: n.open,
92
- disableOutsidePointerEvents: n.open,
93
- disableOutsideScroll: !0,
94
- onFocusOutside: g(
95
- e.onFocusOutside,
96
- (c) => c.preventDefault(),
97
- { checkForDefaultPrevented: !1 }
98
- ),
99
- onDismiss: () => n.onOpenChange(!1)
100
- }
101
- );
102
- }
103
- ), qn = s.forwardRef((e, t) => {
104
- const n = b(_, e.__scopeMenu);
105
- return /* @__PURE__ */ r(
106
- se,
107
- {
108
- ...e,
109
- ref: t,
110
- trapFocus: !1,
111
- disableOutsidePointerEvents: !1,
112
- disableOutsideScroll: !1,
113
- onDismiss: () => n.onOpenChange(!1)
114
+ function Ne(e) {
115
+ const {
116
+ closeOnClick: t,
117
+ disabled: o = !1,
118
+ highlighted: u,
119
+ id: p,
120
+ store: d,
121
+ typingRef: b = d.context.typingRef,
122
+ nativeButton: r,
123
+ itemMetadata: c,
124
+ nodeId: y
125
+ } = e, m = n.useRef(null), {
126
+ getButtonProps: x,
127
+ buttonRef: g
128
+ } = gt({
129
+ disabled: o,
130
+ focusableWhenDisabled: !0,
131
+ native: r,
132
+ composite: !0
133
+ }), P = oo({
134
+ closeOnClick: t,
135
+ highlighted: u,
136
+ id: p,
137
+ nodeId: y,
138
+ store: d,
139
+ typingRef: b,
140
+ itemRef: m,
141
+ itemMetadata: c
142
+ }), O = n.useCallback((C) => Oe(P, {
143
+ onMouseEnter() {
144
+ c.type === "submenu-trigger" && c.setActive();
114
145
  }
115
- );
116
- }), Jn = Dn("MenuContent.ScrollLock"), se = s.forwardRef(
117
- (e, t) => {
118
- const {
119
- __scopeMenu: n,
120
- loop: o = !1,
121
- trapFocus: a,
122
- onOpenAutoFocus: c,
123
- onCloseAutoFocus: i,
124
- disableOutsidePointerEvents: d,
125
- onEntryFocus: f,
126
- onEscapeKeyDown: m,
127
- onPointerDownOutside: p,
128
- onFocusOutside: u,
129
- onInteractOutside: v,
130
- onDismiss: C,
131
- disableOutsideScroll: M,
132
- ...S
133
- } = e, N = b(_, n), I = $(_, n), mn = K(n), vn = De(n), le = Vn(n), [gn, pe] = s.useState(null), U = s.useRef(null), Mn = G(t, U, N.onContentChange), z = s.useRef(0), B = s.useRef(""), hn = s.useRef(0), Z = s.useRef(null), fe = s.useRef("right"), q = s.useRef(0), wn = M ? An : s.Fragment, Cn = M ? { as: Jn, allowPinchZoom: !0 } : void 0, _n = (l) => {
134
- const E = B.current + l, x = le().filter((w) => !w.disabled), T = document.activeElement, J = x.find((w) => w.ref.current === T)?.textValue, Q = x.map((w) => w.textValue), me = dt(Q, E, J), A = x.find((w) => w.textValue === me)?.ref.current;
135
- (function w(ve) {
136
- B.current = ve, window.clearTimeout(z.current), ve !== "" && (z.current = window.setTimeout(() => w(""), 1e3));
137
- })(E), A && setTimeout(() => A.focus());
146
+ }, C, x), [P, x, c]), i = en(m, g);
147
+ return n.useMemo(() => ({
148
+ getItemProps: O,
149
+ itemRef: i
150
+ }), [O, i]);
151
+ }
152
+ let it = /* @__PURE__ */ (function(e) {
153
+ return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.highlighted = "data-highlighted", e;
154
+ })({});
155
+ const Te = {
156
+ checked(e) {
157
+ return e ? {
158
+ [it.checked]: ""
159
+ } : {
160
+ [it.unchecked]: ""
138
161
  };
139
- s.useEffect(() => () => window.clearTimeout(z.current), []), Tn();
140
- const P = s.useCallback((l) => fe.current === Z.current?.side && pt(l, Z.current?.area), []);
141
- return /* @__PURE__ */ r(
142
- Wn,
143
- {
144
- scope: n,
145
- searchRef: B,
146
- onItemEnter: s.useCallback(
147
- (l) => {
148
- P(l) && l.preventDefault();
149
- },
150
- [P]
151
- ),
152
- onItemLeave: s.useCallback(
153
- (l) => {
154
- P(l) || (U.current?.focus(), pe(null));
155
- },
156
- [P]
157
- ),
158
- onTriggerLeave: s.useCallback(
159
- (l) => {
160
- P(l) && l.preventDefault();
161
- },
162
- [P]
163
- ),
164
- pointerGraceTimerRef: hn,
165
- onPointerGraceIntentChange: s.useCallback((l) => {
166
- Z.current = l;
167
- }, []),
168
- children: /* @__PURE__ */ r(wn, { ...Cn, children: /* @__PURE__ */ r(
169
- On,
170
- {
171
- asChild: !0,
172
- trapped: a,
173
- onMountAutoFocus: g(c, (l) => {
174
- l.preventDefault(), U.current?.focus({ preventScroll: !0 });
175
- }),
176
- onUnmountAutoFocus: i,
177
- children: /* @__PURE__ */ r(
178
- yn,
179
- {
180
- asChild: !0,
181
- disableOutsidePointerEvents: d,
182
- onEscapeKeyDown: m,
183
- onPointerDownOutside: p,
184
- onFocusOutside: u,
185
- onInteractOutside: v,
186
- onDismiss: C,
187
- children: /* @__PURE__ */ r(
188
- Kn,
189
- {
190
- asChild: !0,
191
- ...vn,
192
- dir: I.dir,
193
- orientation: "vertical",
194
- loop: o,
195
- currentTabStopId: gn,
196
- onCurrentTabStopIdChange: pe,
197
- onEntryFocus: g(f, (l) => {
198
- I.isUsingKeyboardRef.current || l.preventDefault();
199
- }),
200
- preventScrollOnEntryFocus: !0,
201
- children: /* @__PURE__ */ r(
202
- Ln,
203
- {
204
- role: "menu",
205
- "aria-orientation": "vertical",
206
- "data-state": Ye(N.open),
207
- "data-radix-menu-content": "",
208
- dir: I.dir,
209
- ...mn,
210
- ...S,
211
- ref: Mn,
212
- style: { outline: "none", ...S.style },
213
- onKeyDown: g(S.onKeyDown, (l) => {
214
- const x = l.target.closest("[data-radix-menu-content]") === l.currentTarget, T = l.ctrlKey || l.altKey || l.metaKey, J = l.key.length === 1;
215
- x && (l.key === "Tab" && l.preventDefault(), !T && J && _n(l.key));
216
- const Q = U.current;
217
- if (l.target !== Q || !Un.includes(l.key)) return;
218
- l.preventDefault();
219
- const A = le().filter((w) => !w.disabled).map((w) => w.ref.current);
220
- be.includes(l.key) && A.reverse(), ut(A);
221
- }),
222
- onBlur: g(e.onBlur, (l) => {
223
- l.currentTarget.contains(l.target) || (window.clearTimeout(z.current), B.current = "");
224
- }),
225
- onPointerMove: g(
226
- e.onPointerMove,
227
- L((l) => {
228
- const E = l.target, x = q.current !== l.clientX;
229
- if (l.currentTarget.contains(E) && x) {
230
- const T = l.clientX > q.current ? "right" : "left";
231
- fe.current = T, q.current = l.clientX;
232
- }
233
- })
234
- )
235
- }
236
- )
237
- }
238
- )
239
- }
240
- )
241
- }
242
- ) })
243
- }
244
- );
245
- }
246
- );
247
- ye.displayName = _;
248
- var Qn = "MenuGroup", ce = s.forwardRef(
249
- (e, t) => {
250
- const { __scopeMenu: n, ...o } = e;
251
- return /* @__PURE__ */ r(y.div, { role: "group", ...o, ref: t });
252
- }
253
- );
254
- ce.displayName = Qn;
255
- var et = "MenuLabel", Ne = s.forwardRef(
256
- (e, t) => {
257
- const { __scopeMenu: n, ...o } = e;
258
- return /* @__PURE__ */ r(y.div, { ...o, ref: t });
259
- }
260
- );
261
- Ne.displayName = et;
262
- var j = "MenuItem", ge = "menu.itemSelect", H = s.forwardRef(
263
- (e, t) => {
264
- const { disabled: n = !1, onSelect: o, ...a } = e, c = s.useRef(null), i = $(j, e.__scopeMenu), d = ae(j, e.__scopeMenu), f = G(t, c), m = s.useRef(!1), p = () => {
265
- const u = c.current;
266
- if (!n && u) {
267
- const v = new CustomEvent(ge, { bubbles: !0, cancelable: !0 });
268
- u.addEventListener(ge, (C) => o?.(C), { once: !0 }), Sn(u, v), v.defaultPrevented ? m.current = !1 : i.onClose();
162
+ },
163
+ ...bt
164
+ }, Rt = /* @__PURE__ */ n.forwardRef(function(t, o) {
165
+ const {
166
+ render: u,
167
+ className: p,
168
+ id: d,
169
+ label: b,
170
+ nativeButton: r = !1,
171
+ disabled: c = !1,
172
+ closeOnClick: y = !1,
173
+ checked: m,
174
+ defaultChecked: x,
175
+ onCheckedChange: g,
176
+ ...P
177
+ } = t, O = Ie({
178
+ label: b
179
+ }), i = Me(!0), C = ge(d), {
180
+ store: h
181
+ } = ee(), a = h.useState("isActive", O.index), S = h.useState("itemProps"), [k, l] = mt({
182
+ controlled: m,
183
+ default: x ?? !1,
184
+ name: "MenuCheckboxItem",
185
+ state: "checked"
186
+ }), {
187
+ getItemProps: s,
188
+ itemRef: N
189
+ } = Ne({
190
+ closeOnClick: y,
191
+ disabled: c,
192
+ highlighted: a,
193
+ id: C,
194
+ store: h,
195
+ nativeButton: r,
196
+ nodeId: i?.nodeId,
197
+ itemMetadata: Ge
198
+ }), T = n.useMemo(() => ({
199
+ disabled: c,
200
+ highlighted: a,
201
+ checked: k
202
+ }), [c, a, k]), R = de((A) => {
203
+ const L = {
204
+ ...ae(Ee, A.nativeEvent),
205
+ preventUnmountOnClose: () => {
269
206
  }
270
207
  };
271
- return /* @__PURE__ */ r(
272
- Te,
273
- {
274
- ...a,
275
- ref: f,
276
- disabled: n,
277
- onClick: g(e.onClick, p),
278
- onPointerDown: (u) => {
279
- e.onPointerDown?.(u), m.current = !0;
280
- },
281
- onPointerUp: g(e.onPointerUp, (u) => {
282
- m.current || u.currentTarget?.click();
283
- }),
284
- onKeyDown: g(e.onKeyDown, (u) => {
285
- const v = d.searchRef.current !== "";
286
- n || v && u.key === " " || ee.includes(u.key) && (u.currentTarget.click(), u.preventDefault());
287
- })
288
- }
289
- );
290
- }
291
- );
292
- H.displayName = j;
293
- var Te = s.forwardRef(
294
- (e, t) => {
295
- const { __scopeMenu: n, disabled: o = !1, textValue: a, ...c } = e, i = ae(j, n), d = De(n), f = s.useRef(null), m = G(t, f), [p, u] = s.useState(!1), [v, C] = s.useState("");
296
- return s.useEffect(() => {
297
- const M = f.current;
298
- M && C((M.textContent ?? "").trim());
299
- }, [c.children]), /* @__PURE__ */ r(
300
- k.ItemSlot,
301
- {
302
- scope: n,
303
- disabled: o,
304
- textValue: a ?? v,
305
- children: /* @__PURE__ */ r(Fn, { asChild: !0, ...d, focusable: !o, children: /* @__PURE__ */ r(
306
- y.div,
307
- {
308
- role: "menuitem",
309
- "data-highlighted": p ? "" : void 0,
310
- "aria-disabled": o || void 0,
311
- "data-disabled": o ? "" : void 0,
312
- ...c,
313
- ref: m,
314
- onPointerMove: g(
315
- e.onPointerMove,
316
- L((M) => {
317
- o ? i.onItemLeave(M) : (i.onItemEnter(M), M.defaultPrevented || M.currentTarget.focus({ preventScroll: !0 }));
318
- })
319
- ),
320
- onPointerLeave: g(
321
- e.onPointerLeave,
322
- L((M) => i.onItemLeave(M))
323
- ),
324
- onFocus: g(e.onFocus, () => u(!0)),
325
- onBlur: g(e.onBlur, () => u(!1))
326
- }
327
- ) })
328
- }
329
- );
330
- }
331
- ), nt = "MenuCheckboxItem", Ae = s.forwardRef(
332
- (e, t) => {
333
- const { checked: n = !1, onCheckedChange: o, ...a } = e;
334
- return /* @__PURE__ */ r(Fe, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ r(
335
- H,
336
- {
337
- role: "menuitemcheckbox",
338
- "aria-checked": X(n) ? "mixed" : n,
339
- ...a,
340
- ref: t,
341
- "data-state": de(n),
342
- onSelect: g(
343
- a.onSelect,
344
- () => o?.(X(n) ? !0 : !n),
345
- { checkForDefaultPrevented: !1 }
346
- )
347
- }
348
- ) });
349
- }
350
- );
351
- Ae.displayName = nt;
352
- var Oe = "MenuRadioGroup", [tt, ot] = D(
353
- Oe,
354
- { value: void 0, onValueChange: () => {
355
- } }
356
- ), ke = s.forwardRef(
357
- (e, t) => {
358
- const { value: n, onValueChange: o, ...a } = e, c = te(o);
359
- return /* @__PURE__ */ r(tt, { scope: e.__scopeMenu, value: n, onValueChange: c, children: /* @__PURE__ */ r(ce, { ...a, ref: t }) });
360
- }
361
- );
362
- ke.displayName = Oe;
363
- var Le = "MenuRadioItem", Ge = s.forwardRef(
364
- (e, t) => {
365
- const { value: n, ...o } = e, a = ot(Le, e.__scopeMenu), c = n === a.value;
366
- return /* @__PURE__ */ r(Fe, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ r(
367
- H,
368
- {
369
- role: "menuitemradio",
370
- "aria-checked": c,
371
- ...o,
372
- ref: t,
373
- "data-state": de(c),
374
- onSelect: g(
375
- o.onSelect,
376
- () => a.onValueChange?.(n),
377
- { checkForDefaultPrevented: !1 }
378
- )
208
+ g?.(!k, L), !L.isCanceled && l((_) => !_);
209
+ }), D = q("div", t, {
210
+ state: T,
211
+ stateAttributesMapping: Te,
212
+ props: [S, {
213
+ role: "menuitemcheckbox",
214
+ "aria-checked": k,
215
+ onClick: R
216
+ }, P, s],
217
+ ref: [N, o, O.ref]
218
+ });
219
+ return /* @__PURE__ */ f(Be.Provider, {
220
+ value: T,
221
+ children: D
222
+ });
223
+ });
224
+ process.env.NODE_ENV !== "production" && (Rt.displayName = "MenuCheckboxItem");
225
+ const yt = /* @__PURE__ */ n.forwardRef(function(t, o) {
226
+ const {
227
+ render: u,
228
+ className: p,
229
+ keepMounted: d = !1,
230
+ ...b
231
+ } = t, r = no(), c = n.useRef(null), {
232
+ transitionStatus: y,
233
+ setMounted: m
234
+ } = ht(r.checked);
235
+ Fe({
236
+ open: r.checked,
237
+ ref: c,
238
+ onComplete() {
239
+ r.checked || m(!1);
240
+ }
241
+ });
242
+ const x = {
243
+ checked: r.checked,
244
+ disabled: r.disabled,
245
+ highlighted: r.highlighted,
246
+ transitionStatus: y
247
+ };
248
+ return q("span", t, {
249
+ state: x,
250
+ ref: [o, c],
251
+ stateAttributesMapping: Te,
252
+ props: {
253
+ "aria-hidden": !0,
254
+ ...b
255
+ },
256
+ enabled: d || r.checked
257
+ });
258
+ });
259
+ process.env.NODE_ENV !== "production" && (yt.displayName = "MenuCheckboxItemIndicator");
260
+ const Le = /* @__PURE__ */ n.createContext(void 0);
261
+ process.env.NODE_ENV !== "production" && (Le.displayName = "MenuGroupContext");
262
+ function ro() {
263
+ const e = n.useContext(Le);
264
+ if (e === void 0)
265
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuGroupRootContext is missing. Menu group parts must be used within <Menu.Group>." : ie(31));
266
+ return e;
267
+ }
268
+ const He = /* @__PURE__ */ n.forwardRef(function(t, o) {
269
+ const {
270
+ render: u,
271
+ className: p,
272
+ ...d
273
+ } = t, [b, r] = n.useState(void 0), c = n.useMemo(() => ({
274
+ setLabelId: r
275
+ }), [r]), y = q("div", t, {
276
+ ref: o,
277
+ props: {
278
+ role: "group",
279
+ "aria-labelledby": b,
280
+ ...d
281
+ }
282
+ });
283
+ return /* @__PURE__ */ f(Le.Provider, {
284
+ value: c,
285
+ children: y
286
+ });
287
+ });
288
+ process.env.NODE_ENV !== "production" && (He.displayName = "MenuGroup");
289
+ const Et = /* @__PURE__ */ n.forwardRef(function(t, o) {
290
+ const {
291
+ className: u,
292
+ render: p,
293
+ id: d,
294
+ ...b
295
+ } = t, r = ge(d), {
296
+ setLabelId: c
297
+ } = ro();
298
+ return ve(() => (c(r), () => {
299
+ c(void 0);
300
+ }), [c, r]), q("div", t, {
301
+ ref: o,
302
+ props: {
303
+ id: r,
304
+ role: "presentation",
305
+ ...b
306
+ }
307
+ });
308
+ });
309
+ process.env.NODE_ENV !== "production" && (Et.displayName = "MenuGroupLabel");
310
+ const It = /* @__PURE__ */ n.forwardRef(function(t, o) {
311
+ const {
312
+ render: u,
313
+ className: p,
314
+ id: d,
315
+ label: b,
316
+ nativeButton: r = !1,
317
+ disabled: c = !1,
318
+ closeOnClick: y = !0,
319
+ ...m
320
+ } = t, x = Ie({
321
+ label: b
322
+ }), g = Me(!0), P = ge(d), {
323
+ store: O
324
+ } = ee(), i = O.useState("isActive", x.index), C = O.useState("itemProps"), {
325
+ getItemProps: h,
326
+ itemRef: a
327
+ } = Ne({
328
+ closeOnClick: y,
329
+ disabled: c,
330
+ highlighted: i,
331
+ id: P,
332
+ store: O,
333
+ nativeButton: r,
334
+ nodeId: g?.nodeId,
335
+ itemMetadata: Ge
336
+ });
337
+ return q("div", t, {
338
+ state: {
339
+ disabled: c,
340
+ highlighted: i
341
+ },
342
+ props: [C, m, h],
343
+ ref: [a, o, x.ref]
344
+ });
345
+ });
346
+ process.env.NODE_ENV !== "production" && (It.displayName = "MenuItem");
347
+ const so = {
348
+ ...dt,
349
+ ...bt
350
+ }, Pt = /* @__PURE__ */ n.forwardRef(function(t, o) {
351
+ const {
352
+ render: u,
353
+ className: p,
354
+ finalFocus: d,
355
+ ...b
356
+ } = t, {
357
+ store: r
358
+ } = ee(), {
359
+ side: c,
360
+ align: y
361
+ } = Me(), m = qn() != null, x = r.useState("open"), g = r.useState("transitionStatus"), P = r.useState("popupProps"), O = r.useState("mounted"), i = r.useState("instantType"), C = r.useState("activeTriggerElement"), h = r.useState("parent"), a = r.useState("lastOpenChangeReason"), S = r.useState("rootId"), k = r.useState("floatingRootContext"), l = r.useState("floatingTreeRoot"), s = r.useState("closeDelay"), N = r.useState("activeTriggerElement"), T = h.type === "context-menu";
362
+ Fe({
363
+ open: x,
364
+ ref: r.context.popupRef,
365
+ onComplete() {
366
+ x && r.context.onOpenChangeComplete?.(!0);
367
+ }
368
+ }), n.useEffect(() => {
369
+ function U(W) {
370
+ r.setOpen(!1, ae(W.reason, W.domEvent));
371
+ }
372
+ return l.events.on("close", U), () => {
373
+ l.events.off("close", U);
374
+ };
375
+ }, [l.events, r]);
376
+ const R = r.useState("hoverEnabled"), D = r.useState("disabled");
377
+ Xn(k, {
378
+ enabled: R && !D && !T && h.type !== "menubar",
379
+ closeDelay: s
380
+ });
381
+ const A = {
382
+ transitionStatus: g,
383
+ side: c,
384
+ align: y,
385
+ open: x,
386
+ nested: h.type === "menu",
387
+ instant: i
388
+ }, L = n.useCallback((U) => {
389
+ r.set("popupElement", U);
390
+ }, [r]), _ = q("div", t, {
391
+ state: A,
392
+ ref: [o, r.context.popupRef, L],
393
+ stateAttributesMapping: so,
394
+ props: [P, {
395
+ onKeyDown(U) {
396
+ m && Wn.has(U.key) && U.stopPropagation();
379
397
  }
380
- ) });
381
- }
382
- );
383
- Ge.displayName = Le;
384
- var ue = "MenuItemIndicator", [Fe, rt] = D(
385
- ue,
386
- { checked: !1 }
387
- ), Ke = s.forwardRef(
388
- (e, t) => {
389
- const { __scopeMenu: n, forceMount: o, ...a } = e, c = rt(ue, n);
390
- return /* @__PURE__ */ r(
391
- Y,
392
- {
393
- present: o || X(c.checked) || c.checked === !0,
394
- children: /* @__PURE__ */ r(
395
- y.span,
396
- {
397
- ...a,
398
- ref: t,
399
- "data-state": de(c.checked)
400
- }
401
- )
398
+ }, vt(g), b, {
399
+ "data-rootownerid": S
400
+ }]
401
+ });
402
+ let K = h.type === void 0 || T;
403
+ return (C || h.type === "menubar" && a !== yn) && (K = !0), /* @__PURE__ */ f($t, {
404
+ context: k,
405
+ modal: T,
406
+ disabled: !O,
407
+ returnFocus: d === void 0 ? K : d,
408
+ initialFocus: h.type !== "menu",
409
+ restoreFocus: !0,
410
+ externalTree: h.type !== "menubar" ? l : void 0,
411
+ previousFocusableElement: N,
412
+ nextFocusableElement: h.type === void 0 ? r.context.triggerFocusTargetRef : void 0,
413
+ beforeContentFocusGuardRef: h.type === void 0 ? r.context.beforeContentFocusGuardRef : void 0,
414
+ children: _
415
+ });
416
+ });
417
+ process.env.NODE_ENV !== "production" && (Pt.displayName = "MenuPopup");
418
+ const ze = /* @__PURE__ */ n.createContext(void 0);
419
+ process.env.NODE_ENV !== "production" && (ze.displayName = "MenuPortalContext");
420
+ function ao() {
421
+ const e = n.useContext(ze);
422
+ if (e === void 0)
423
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.Portal> is missing." : ie(32));
424
+ return e;
425
+ }
426
+ const Ke = /* @__PURE__ */ n.forwardRef(function(t, o) {
427
+ const {
428
+ keepMounted: u = !1,
429
+ ...p
430
+ } = t, {
431
+ store: d
432
+ } = ee();
433
+ return d.useState("mounted") || u ? /* @__PURE__ */ f(ze.Provider, {
434
+ value: u,
435
+ children: /* @__PURE__ */ f(on, {
436
+ ref: o,
437
+ ...p
438
+ })
439
+ }) : null;
440
+ });
441
+ process.env.NODE_ENV !== "production" && (Ke.displayName = "MenuPortal");
442
+ const Nt = /* @__PURE__ */ n.forwardRef(function(t, o) {
443
+ const {
444
+ anchor: u,
445
+ positionMethod: p = "absolute",
446
+ className: d,
447
+ render: b,
448
+ side: r,
449
+ align: c,
450
+ sideOffset: y = 0,
451
+ alignOffset: m = 0,
452
+ collisionBoundary: x = "clipping-ancestors",
453
+ collisionPadding: g = 5,
454
+ arrowPadding: P = 5,
455
+ sticky: O = !1,
456
+ disableAnchorTracking: i = !1,
457
+ collisionAvoidance: C = rn,
458
+ ...h
459
+ } = t, {
460
+ store: a
461
+ } = ee(), S = ao(), k = Pe(!0), l = a.useState("parent"), s = a.useState("floatingRootContext"), N = a.useState("floatingTreeRoot"), T = a.useState("mounted"), R = a.useState("open"), D = a.useState("modal"), A = a.useState("activeTriggerElement"), L = a.useState("transitionStatus"), _ = a.useState("positionerElement"), K = a.useState("instantType"), U = a.useState("hasViewport"), W = a.useState("lastOpenChangeReason"), E = a.useState("floatingNodeId"), H = a.useState("floatingParentNodeId"), ue = s.useState("domReferenceElement"), te = n.useRef(null), Y = Hn(_, !1, !1);
462
+ let ne = u, X = y, le = m, B = c, $ = C;
463
+ l.type === "context-menu" && (ne = u ?? l.context?.anchor, B = B ?? "start", !r && B !== "center" && (le = t.alignOffset ?? 2, X = t.sideOffset ?? -5));
464
+ let J = r, Q = B;
465
+ l.type === "menu" ? (J = J ?? "inline-end", Q = Q ?? "start", $ = t.collisionAvoidance ?? sn) : l.type === "menubar" && (J = J ?? "bottom", Q = Q ?? "start");
466
+ const oe = l.type === "context-menu", V = Kn({
467
+ anchor: ne,
468
+ floatingRootContext: s,
469
+ positionMethod: k ? "fixed" : p,
470
+ mounted: T,
471
+ side: J,
472
+ sideOffset: X,
473
+ align: Q,
474
+ alignOffset: le,
475
+ arrowPadding: oe ? 0 : P,
476
+ collisionBoundary: x,
477
+ collisionPadding: g,
478
+ sticky: O,
479
+ nodeId: E,
480
+ keepMounted: S,
481
+ disableAnchorTracking: i,
482
+ collisionAvoidance: $,
483
+ shiftCrossAxis: oe && !("side" in $ && $.side === "flip"),
484
+ externalTree: N,
485
+ adaptiveOrigin: U ? Yn : void 0
486
+ }), re = n.useMemo(() => {
487
+ const M = {};
488
+ return R || (M.pointerEvents = "none"), {
489
+ role: "presentation",
490
+ hidden: !T,
491
+ style: {
492
+ ...V.positionerStyles,
493
+ ...M
402
494
  }
403
- );
404
- }
405
- );
406
- Ke.displayName = ue;
407
- var at = "MenuSeparator", $e = s.forwardRef(
408
- (e, t) => {
409
- const { __scopeMenu: n, ...o } = e;
410
- return /* @__PURE__ */ r(
411
- y.div,
412
- {
413
- role: "separator",
414
- "aria-orientation": "horizontal",
415
- ...o,
416
- ref: t
495
+ };
496
+ }, [R, T, V.positionerStyles]);
497
+ n.useEffect(() => {
498
+ function M(I) {
499
+ I.open && (I.parentNodeId === E && a.set("hoverEnabled", !1), I.nodeId !== E && I.parentNodeId === a.select("floatingParentNodeId") && a.setOpen(!1, ae(be)));
500
+ }
501
+ return N.events.on("menuopenchange", M), () => {
502
+ N.events.off("menuopenchange", M);
503
+ };
504
+ }, [a, N.events, E]), n.useEffect(() => {
505
+ if (a.select("floatingParentNodeId") == null)
506
+ return;
507
+ function M(I) {
508
+ if (I.open || I.nodeId !== a.select("floatingParentNodeId"))
509
+ return;
510
+ const Z = I.reason ?? be;
511
+ a.setOpen(!1, ae(Z));
512
+ }
513
+ return N.events.on("menuopenchange", M), () => {
514
+ N.events.off("menuopenchange", M);
515
+ };
516
+ }, [N.events, a]);
517
+ const j = he();
518
+ n.useEffect(() => {
519
+ R || j.clear();
520
+ }, [R, j]), n.useEffect(() => {
521
+ function M(I) {
522
+ if (!(!R || I.nodeId !== a.select("floatingParentNodeId")))
523
+ if (I.target && A && A !== I.target) {
524
+ const Z = a.select("closeDelay");
525
+ Z > 0 ? j.isStarted() || j.start(Z, () => {
526
+ a.setOpen(!1, ae(be));
527
+ }) : a.setOpen(!1, ae(be));
528
+ } else
529
+ j.clear();
530
+ }
531
+ return N.events.on("itemhover", M), () => {
532
+ N.events.off("itemhover", M);
533
+ };
534
+ }, [N.events, R, A, a, j]), n.useEffect(() => {
535
+ const M = {
536
+ open: R,
537
+ nodeId: E,
538
+ parentNodeId: H,
539
+ reason: a.select("lastOpenChangeReason")
540
+ };
541
+ N.events.emit("menuopenchange", M);
542
+ }, [N.events, R, a, E, H]), ve(() => {
543
+ const M = ue, I = te.current;
544
+ if (M && (te.current = M), I && M && M !== I) {
545
+ a.set("instantType", void 0);
546
+ const Z = new AbortController();
547
+ return Y(() => {
548
+ a.set("instantType", "trigger-change");
549
+ }, Z.signal), () => {
550
+ Z.abort();
551
+ };
552
+ }
553
+ }, [ue, Y, a]);
554
+ const pe = {
555
+ open: R,
556
+ side: V.side,
557
+ align: V.align,
558
+ anchorHidden: V.anchorHidden,
559
+ nested: l.type === "menu",
560
+ instant: K
561
+ }, fe = n.useMemo(() => ({
562
+ side: V.side,
563
+ align: V.align,
564
+ arrowRef: V.arrowRef,
565
+ arrowUncentered: V.arrowUncentered,
566
+ arrowStyles: V.arrowStyles,
567
+ nodeId: V.context.nodeId
568
+ }), [V.side, V.align, V.arrowRef, V.arrowUncentered, V.arrowStyles, V.context.nodeId]), se = q("div", t, {
569
+ state: pe,
570
+ stateAttributesMapping: dt,
571
+ ref: [o, a.useStateSetter("positionerElement")],
572
+ props: [re, vt(L), h]
573
+ }), me = T && l.type !== "menu" && (l.type !== "menubar" && D && W !== ye || l.type === "menubar" && l.context.modal);
574
+ let F = null;
575
+ return l.type === "menubar" ? F = l.context.contentElement : l.type === void 0 && (F = A), /* @__PURE__ */ xe(Ae.Provider, {
576
+ value: fe,
577
+ children: [me && /* @__PURE__ */ f(Jt, {
578
+ ref: l.type === "context-menu" || l.type === "nested-context-menu" ? l.context.internalBackdropRef : null,
579
+ inert: zn(!R),
580
+ cutout: F
581
+ }), /* @__PURE__ */ f(an, {
582
+ id: E,
583
+ children: /* @__PURE__ */ f(jn, {
584
+ elementsRef: a.context.itemDomElements,
585
+ labelsRef: a.context.itemLabels,
586
+ children: se
587
+ })
588
+ })]
589
+ });
590
+ });
591
+ process.env.NODE_ENV !== "production" && (Nt.displayName = "MenuPositioner");
592
+ const Ye = /* @__PURE__ */ n.createContext(void 0);
593
+ process.env.NODE_ENV !== "production" && (Ye.displayName = "MenuRadioGroupContext");
594
+ function io() {
595
+ const e = n.useContext(Ye);
596
+ if (e === void 0)
597
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>." : ie(34));
598
+ return e;
599
+ }
600
+ const Tt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
601
+ const {
602
+ render: u,
603
+ className: p,
604
+ value: d,
605
+ defaultValue: b,
606
+ onValueChange: r,
607
+ disabled: c = !1,
608
+ ...y
609
+ } = t, [m, x] = mt({
610
+ controlled: d,
611
+ default: b,
612
+ name: "MenuRadioGroup"
613
+ }), g = de(r), P = de((h, a) => {
614
+ g?.(h, a), !a.isCanceled && x(h);
615
+ }), i = q("div", t, {
616
+ state: {
617
+ disabled: c
618
+ },
619
+ ref: o,
620
+ props: {
621
+ role: "group",
622
+ "aria-disabled": c || void 0,
623
+ ...y
624
+ }
625
+ }), C = n.useMemo(() => ({
626
+ value: m,
627
+ setValue: P,
628
+ disabled: c
629
+ }), [m, P, c]);
630
+ return /* @__PURE__ */ f(Ye.Provider, {
631
+ value: C,
632
+ children: i
633
+ });
634
+ }));
635
+ process.env.NODE_ENV !== "production" && (Tt.displayName = "MenuRadioGroup");
636
+ const je = /* @__PURE__ */ n.createContext(void 0);
637
+ process.env.NODE_ENV !== "production" && (je.displayName = "MenuRadioItemContext");
638
+ function uo() {
639
+ const e = n.useContext(je);
640
+ if (e === void 0)
641
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>." : ie(35));
642
+ return e;
643
+ }
644
+ const wt = /* @__PURE__ */ n.forwardRef(function(t, o) {
645
+ const {
646
+ render: u,
647
+ className: p,
648
+ id: d,
649
+ label: b,
650
+ nativeButton: r = !1,
651
+ disabled: c = !1,
652
+ closeOnClick: y = !1,
653
+ value: m,
654
+ ...x
655
+ } = t, g = Ie({
656
+ label: b
657
+ }), P = Me(!0), O = ge(d), {
658
+ store: i
659
+ } = ee(), C = i.useState("isActive", g.index), h = i.useState("itemProps"), {
660
+ value: a,
661
+ setValue: S,
662
+ disabled: k
663
+ } = io(), l = k || c, s = a === m, {
664
+ getItemProps: N,
665
+ itemRef: T
666
+ } = Ne({
667
+ closeOnClick: y,
668
+ disabled: l,
669
+ highlighted: C,
670
+ id: O,
671
+ store: i,
672
+ nativeButton: r,
673
+ nodeId: P?.nodeId,
674
+ itemMetadata: Ge
675
+ }), R = n.useMemo(() => ({
676
+ disabled: l,
677
+ highlighted: C,
678
+ checked: s
679
+ }), [l, C, s]), D = de((L) => {
680
+ const _ = {
681
+ ...ae(Ee, L.nativeEvent),
682
+ preventUnmountOnClose: () => {
417
683
  }
418
- );
419
- }
420
- );
421
- $e.displayName = at;
422
- var st = "MenuArrow", Ue = s.forwardRef(
423
- (e, t) => {
424
- const { __scopeMenu: n, ...o } = e, a = K(n);
425
- return /* @__PURE__ */ r(Gn, { ...a, ...o, ref: t });
426
- }
427
- );
428
- Ue.displayName = st;
429
- var ie = "MenuSub", [ct, ze] = D(ie), Be = (e) => {
430
- const { __scopeMenu: t, children: n, open: o = !1, onOpenChange: a } = e, c = b(ie, t), i = K(t), [d, f] = s.useState(null), [m, p] = s.useState(null), u = te(a);
431
- return s.useEffect(() => (c.open === !1 && u(!1), () => u(!1)), [c.open, u]), /* @__PURE__ */ r(Ce, { ...i, children: /* @__PURE__ */ r(
432
- Se,
433
- {
434
- scope: t,
435
- open: o,
436
- onOpenChange: u,
437
- content: m,
438
- onContentChange: p,
439
- children: /* @__PURE__ */ r(
440
- ct,
441
- {
442
- scope: t,
443
- contentId: V(),
444
- triggerId: V(),
445
- trigger: d,
446
- onTriggerChange: f,
447
- children: n
448
- }
449
- )
684
+ };
685
+ S(m, _);
686
+ }), A = q("div", t, {
687
+ state: R,
688
+ stateAttributesMapping: Te,
689
+ props: [h, {
690
+ role: "menuitemradio",
691
+ "aria-checked": s,
692
+ onClick: D
693
+ }, x, N],
694
+ ref: [T, o, g.ref]
695
+ });
696
+ return /* @__PURE__ */ f(je.Provider, {
697
+ value: R,
698
+ children: A
699
+ });
700
+ });
701
+ process.env.NODE_ENV !== "production" && (wt.displayName = "MenuRadioItem");
702
+ const St = /* @__PURE__ */ n.forwardRef(function(t, o) {
703
+ const {
704
+ render: u,
705
+ className: p,
706
+ keepMounted: d = !1,
707
+ ...b
708
+ } = t, r = uo(), c = n.useRef(null), {
709
+ transitionStatus: y,
710
+ setMounted: m
711
+ } = ht(r.checked);
712
+ Fe({
713
+ open: r.checked,
714
+ ref: c,
715
+ onComplete() {
716
+ r.checked || m(!1);
450
717
  }
451
- ) });
718
+ });
719
+ const x = {
720
+ checked: r.checked,
721
+ disabled: r.disabled,
722
+ highlighted: r.highlighted,
723
+ transitionStatus: y
724
+ };
725
+ return q("span", t, {
726
+ state: x,
727
+ stateAttributesMapping: Te,
728
+ ref: [o, c],
729
+ props: {
730
+ "aria-hidden": !0,
731
+ ...b
732
+ },
733
+ enabled: d || r.checked
734
+ });
735
+ });
736
+ process.env.NODE_ENV !== "production" && (St.displayName = "MenuRadioItemIndicator");
737
+ const Ot = /* @__PURE__ */ n.createContext(null);
738
+ process.env.NODE_ENV !== "production" && (Ot.displayName = "MenubarContext");
739
+ function kt(e) {
740
+ return n.useContext(Ot);
741
+ }
742
+ const co = {
743
+ ...wn,
744
+ disabled: G((e) => e.parent.type === "menubar" && e.parent.context.disabled || e.disabled),
745
+ modal: G((e) => (e.parent.type === void 0 || e.parent.type === "context-menu") && (e.modal ?? !0)),
746
+ allowMouseEnter: G((e) => e.allowMouseEnter),
747
+ stickIfOpen: G((e) => e.stickIfOpen),
748
+ parent: G((e) => e.parent),
749
+ rootId: G((e) => e.parent.type === "menu" ? e.parent.store.select("rootId") : e.parent.type !== void 0 ? e.parent.context.rootId : e.rootId),
750
+ activeIndex: G((e) => e.activeIndex),
751
+ isActive: G((e, t) => e.activeIndex === t),
752
+ hoverEnabled: G((e) => e.hoverEnabled),
753
+ instantType: G((e) => e.instantType),
754
+ lastOpenChangeReason: G((e) => e.openChangeReason),
755
+ floatingTreeRoot: G((e) => e.parent.type === "menu" ? e.parent.store.select("floatingTreeRoot") : e.floatingTreeRoot),
756
+ floatingNodeId: G((e) => e.floatingNodeId),
757
+ floatingParentNodeId: G((e) => e.floatingParentNodeId),
758
+ itemProps: G((e) => e.itemProps),
759
+ closeDelay: G((e) => e.closeDelay),
760
+ hasViewport: G((e) => e.hasViewport),
761
+ keyboardEventRelay: G((e) => {
762
+ if (e.keyboardEventRelay)
763
+ return e.keyboardEventRelay;
764
+ if (e.parent.type === "menu")
765
+ return e.parent.store.select("keyboardEventRelay");
766
+ })
452
767
  };
453
- Be.displayName = ie;
454
- var O = "MenuSubTrigger", Ve = s.forwardRef(
455
- (e, t) => {
456
- const n = b(O, e.__scopeMenu), o = $(O, e.__scopeMenu), a = ze(O, e.__scopeMenu), c = ae(O, e.__scopeMenu), i = s.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: f } = c, m = { __scopeMenu: e.__scopeMenu }, p = s.useCallback(() => {
457
- i.current && window.clearTimeout(i.current), i.current = null;
458
- }, []);
459
- return s.useEffect(() => p, [p]), s.useEffect(() => {
460
- const u = d.current;
461
- return () => {
462
- window.clearTimeout(u), f(null);
463
- };
464
- }, [d, f]), /* @__PURE__ */ r(oe, { asChild: !0, ...m, children: /* @__PURE__ */ r(
465
- Te,
466
- {
467
- id: a.triggerId,
468
- "aria-haspopup": "menu",
469
- "aria-expanded": n.open,
470
- "aria-controls": a.contentId,
471
- "data-state": Ye(n.open),
472
- ...e,
473
- ref: Me(t, a.onTriggerChange),
474
- onClick: (u) => {
475
- e.onClick?.(u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0));
476
- },
477
- onPointerMove: g(
478
- e.onPointerMove,
479
- L((u) => {
480
- c.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !i.current && (c.onPointerGraceIntentChange(null), i.current = window.setTimeout(() => {
481
- n.onOpenChange(!0), p();
482
- }, 100));
483
- })
484
- ),
485
- onPointerLeave: g(
486
- e.onPointerLeave,
487
- L((u) => {
488
- p();
489
- const v = n.content?.getBoundingClientRect();
490
- if (v) {
491
- const C = n.content?.dataset.side, M = C === "right", S = M ? -5 : 5, N = v[M ? "left" : "right"], I = v[M ? "right" : "left"];
492
- c.onPointerGraceIntentChange({
493
- area: [
494
- // Apply a bleed on clientX to ensure that our exit point is
495
- // consistently within polygon bounds
496
- { x: u.clientX + S, y: u.clientY },
497
- { x: N, y: v.top },
498
- { x: I, y: v.top },
499
- { x: I, y: v.bottom },
500
- { x: N, y: v.bottom }
501
- ],
502
- side: C
503
- }), window.clearTimeout(d.current), d.current = window.setTimeout(
504
- () => c.onPointerGraceIntentChange(null),
505
- 300
506
- );
507
- } else {
508
- if (c.onTriggerLeave(u), u.defaultPrevented) return;
509
- c.onPointerGraceIntentChange(null);
510
- }
511
- })
512
- ),
513
- onKeyDown: g(e.onKeyDown, (u) => {
514
- const v = c.searchRef.current !== "";
515
- e.disabled || v && u.key === " " || zn[o.dir].includes(u.key) && (n.onOpenChange(!0), n.content?.focus(), u.preventDefault());
516
- })
768
+ class qe extends un {
769
+ constructor(t) {
770
+ super({
771
+ ...lo(),
772
+ ...t
773
+ }, {
774
+ positionerRef: /* @__PURE__ */ n.createRef(),
775
+ popupRef: /* @__PURE__ */ n.createRef(),
776
+ typingRef: {
777
+ current: !1
778
+ },
779
+ itemDomElements: {
780
+ current: []
781
+ },
782
+ itemLabels: {
783
+ current: []
784
+ },
785
+ allowMouseUpTriggerRef: {
786
+ current: !1
787
+ },
788
+ triggerFocusTargetRef: /* @__PURE__ */ n.createRef(),
789
+ beforeContentFocusGuardRef: /* @__PURE__ */ n.createRef(),
790
+ onOpenChangeComplete: void 0,
791
+ triggerElements: new cn()
792
+ }, co), this.unsubscribeParentListener = this.observe("parent", (o) => {
793
+ if (this.unsubscribeParentListener?.(), o.type === "menu") {
794
+ let u = o.store.select("rootId"), p = o.store.select("floatingTreeRoot"), d = o.store.select("keyboardEventRelay");
795
+ this.unsubscribeParentListener = o.store.subscribe(() => {
796
+ const b = o.store.select("rootId"), r = o.store.select("floatingTreeRoot"), c = o.store.select("keyboardEventRelay");
797
+ u === b && p === r && d === c || (u = b, p = r, d = c, this.notifyAll());
798
+ }), this.context.allowMouseUpTriggerRef = o.store.context.allowMouseUpTriggerRef;
799
+ return;
517
800
  }
518
- ) });
801
+ o.type !== void 0 && (this.context.allowMouseUpTriggerRef = o.context.allowMouseUpTriggerRef), this.unsubscribeParentListener = null;
802
+ });
519
803
  }
520
- );
521
- Ve.displayName = O;
522
- var je = "MenuSubContent", Xe = s.forwardRef(
523
- (e, t) => {
524
- const n = Pe(_, e.__scopeMenu), { forceMount: o = n.forceMount, ...a } = e, c = b(_, e.__scopeMenu), i = $(_, e.__scopeMenu), d = ze(je, e.__scopeMenu), f = s.useRef(null), m = G(t, f);
525
- return /* @__PURE__ */ r(k.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ r(Y, { present: o || c.open, children: /* @__PURE__ */ r(k.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ r(
526
- se,
527
- {
528
- id: d.contentId,
529
- "aria-labelledby": d.triggerId,
530
- ...a,
531
- ref: m,
532
- align: "start",
533
- side: i.dir === "rtl" ? "left" : "right",
534
- disableOutsidePointerEvents: !1,
535
- disableOutsideScroll: !1,
536
- trapFocus: !1,
537
- onOpenAutoFocus: (p) => {
538
- i.isUsingKeyboardRef.current && f.current?.focus(), p.preventDefault();
539
- },
540
- onCloseAutoFocus: (p) => p.preventDefault(),
541
- onFocusOutside: g(e.onFocusOutside, (p) => {
542
- p.target !== d.trigger && c.onOpenChange(!1);
543
- }),
544
- onEscapeKeyDown: g(e.onEscapeKeyDown, (p) => {
545
- i.onClose(), p.preventDefault();
546
- }),
547
- onKeyDown: g(e.onKeyDown, (p) => {
548
- const u = p.currentTarget.contains(p.target), v = Bn[i.dir].includes(p.key);
549
- u && v && (c.onOpenChange(!1), d.trigger?.focus(), p.preventDefault());
550
- })
551
- }
552
- ) }) }) });
804
+ setOpen(t, o) {
805
+ this.state.floatingRootContext.context.events.emit("setOpen", {
806
+ open: t,
807
+ eventDetails: o
808
+ });
553
809
  }
554
- );
555
- Xe.displayName = je;
556
- function Ye(e) {
557
- return e ? "open" : "closed";
558
- }
559
- function X(e) {
560
- return e === "indeterminate";
561
- }
562
- function de(e) {
563
- return X(e) ? "indeterminate" : e ? "checked" : "unchecked";
564
- }
565
- function ut(e) {
566
- const t = document.activeElement;
567
- for (const n of e)
568
- if (n === t || (n.focus(), document.activeElement !== t)) return;
569
- }
570
- function it(e, t) {
571
- return e.map((n, o) => e[(t + o) % e.length]);
572
- }
573
- function dt(e, t, n) {
574
- const a = t.length > 1 && Array.from(t).every((m) => m === t[0]) ? t[0] : t, c = n ? e.indexOf(n) : -1;
575
- let i = it(e, Math.max(c, 0));
576
- a.length === 1 && (i = i.filter((m) => m !== n));
577
- const f = i.find(
578
- (m) => m.toLowerCase().startsWith(a.toLowerCase())
579
- );
580
- return f !== n ? f : void 0;
581
- }
582
- function lt(e, t) {
583
- const { x: n, y: o } = e;
584
- let a = !1;
585
- for (let c = 0, i = t.length - 1; c < t.length; i = c++) {
586
- const d = t[c], f = t[i], m = d.x, p = d.y, u = f.x, v = f.y;
587
- p > o != v > o && n < (u - m) * (o - p) / (v - p) + m && (a = !a);
810
+ static useStore(t, o) {
811
+ const u = tn(() => new qe(o)).current;
812
+ return t ?? u;
588
813
  }
589
- return a;
814
+ unsubscribeParentListener = null;
590
815
  }
591
- function pt(e, t) {
592
- if (!t) return !1;
593
- const n = { x: e.clientX, y: e.clientY };
594
- return lt(n, t);
816
+ function lo() {
817
+ return {
818
+ ...Sn(),
819
+ disabled: !1,
820
+ modal: !0,
821
+ allowMouseEnter: !1,
822
+ stickIfOpen: !0,
823
+ parent: {
824
+ type: void 0
825
+ },
826
+ rootId: void 0,
827
+ activeIndex: null,
828
+ hoverEnabled: !0,
829
+ instantType: void 0,
830
+ openChangeReason: null,
831
+ floatingTreeRoot: new lt(),
832
+ floatingNodeId: void 0,
833
+ floatingParentNodeId: null,
834
+ itemProps: _e,
835
+ keyboardEventRelay: void 0,
836
+ closeDelay: 0,
837
+ hasViewport: !1
838
+ };
595
839
  }
596
- function L(e) {
597
- return (t) => t.pointerType === "mouse" ? e(t) : void 0;
840
+ const We = /* @__PURE__ */ n.createContext(void 0);
841
+ process.env.NODE_ENV !== "production" && (We.displayName = "MenuSubmenuRootContext");
842
+ function Dt() {
843
+ return n.useContext(We);
598
844
  }
599
- var ft = Ie, mt = oe, vt = Ee, gt = ye, Mt = ce, ht = Ne, wt = H, Ct = Ae, _t = ke, Rt = Ge, bt = Ke, xt = $e, Dt = Ue, St = Be, It = Ve, Pt = Xe, W = "DropdownMenu", [Et] = he(
600
- W,
601
- [xe]
602
- ), h = xe(), [yt, He] = Et(W), We = (e) => {
845
+ const Xe = dn(function(t) {
603
846
  const {
604
- __scopeDropdownMenu: t,
605
- children: n,
606
- dir: o,
607
- open: a,
608
- defaultOpen: c,
609
- onOpenChange: i,
610
- modal: d = !0
611
- } = e, f = h(t), m = s.useRef(null), [p, u] = we({
612
- prop: a,
613
- defaultProp: c ?? !1,
614
- onChange: i,
615
- caller: W
847
+ children: o,
848
+ open: u,
849
+ onOpenChange: p,
850
+ onOpenChangeComplete: d,
851
+ defaultOpen: b = !1,
852
+ disabled: r = !1,
853
+ modal: c,
854
+ loopFocus: y = !0,
855
+ orientation: m = "vertical",
856
+ actionsRef: x,
857
+ closeParentOnEsc: g = !1,
858
+ handle: P,
859
+ triggerId: O,
860
+ defaultTriggerId: i = null,
861
+ highlightItemOnHover: C = !0
862
+ } = t, h = Pe(!0), a = ee(!0), S = kt(!0), k = Dt(), l = n.useMemo(() => k && a ? {
863
+ type: "menu",
864
+ store: a.store
865
+ } : S ? {
866
+ type: "menubar",
867
+ context: S
868
+ } : h && !a ? {
869
+ type: "context-menu",
870
+ context: h
871
+ } : {
872
+ type: void 0
873
+ }, [h, a, S, k]), s = qe.useStore(P?.store, {
874
+ open: b,
875
+ openProp: u,
876
+ activeTriggerId: i,
877
+ triggerIdProp: O,
878
+ parent: l
616
879
  });
617
- return /* @__PURE__ */ r(
618
- yt,
619
- {
620
- scope: t,
621
- triggerId: V(),
622
- triggerRef: m,
623
- contentId: V(),
624
- open: p,
625
- onOpenChange: u,
626
- onOpenToggle: s.useCallback(() => u((v) => !v), [u]),
627
- modal: d,
628
- children: /* @__PURE__ */ r(ft, { ...f, open: p, onOpenChange: u, dir: o, modal: d, children: n })
629
- }
630
- );
631
- };
632
- We.displayName = W;
633
- var Ze = "DropdownMenuTrigger", qe = s.forwardRef(
634
- (e, t) => {
635
- const { __scopeDropdownMenu: n, disabled: o = !1, ...a } = e, c = He(Ze, n), i = h(n);
636
- return /* @__PURE__ */ r(mt, { asChild: !0, ...i, children: /* @__PURE__ */ r(
637
- y.button,
638
- {
639
- type: "button",
640
- id: c.triggerId,
641
- "aria-haspopup": "menu",
642
- "aria-expanded": c.open,
643
- "aria-controls": c.open ? c.contentId : void 0,
644
- "data-state": c.open ? "open" : "closed",
645
- "data-disabled": o ? "" : void 0,
646
- disabled: o,
647
- ...a,
648
- ref: Me(t, c.triggerRef),
649
- onPointerDown: g(e.onPointerDown, (d) => {
650
- !o && d.button === 0 && d.ctrlKey === !1 && (c.onOpenToggle(), c.open || d.preventDefault());
651
- }),
652
- onKeyDown: g(e.onKeyDown, (d) => {
653
- o || (["Enter", " "].includes(d.key) && c.onOpenToggle(), d.key === "ArrowDown" && c.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
654
- })
880
+ Xt(() => {
881
+ u === void 0 && s.state.open === !1 && b === !0 && s.update({
882
+ open: !0,
883
+ activeTriggerId: i
884
+ });
885
+ }), s.useControlledProp("openProp", u), s.useControlledProp("triggerIdProp", O), s.useContextCallback("onOpenChangeComplete", d);
886
+ const N = s.useState("floatingTreeRoot"), T = pt(N), R = ft();
887
+ ve(() => {
888
+ h && !a ? s.update({
889
+ parent: {
890
+ type: "context-menu",
891
+ context: h
892
+ },
893
+ floatingNodeId: T,
894
+ floatingParentNodeId: R
895
+ }) : a && s.update({
896
+ floatingNodeId: T,
897
+ floatingParentNodeId: R
898
+ });
899
+ }, [h, a, T, R, s]);
900
+ const D = s.useState("open"), A = s.useState("activeTriggerElement"), L = s.useState("positionerElement"), _ = s.useState("hoverEnabled"), K = s.useState("modal"), U = s.useState("disabled"), W = s.useState("lastOpenChangeReason"), E = s.useState("parent"), H = s.useState("activeIndex"), ue = s.useState("payload"), te = s.useState("floatingParentNodeId"), Y = n.useRef(null), ne = te != null;
901
+ let X;
902
+ process.env.NODE_ENV !== "production" && E.type !== void 0 && c !== void 0 && console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored."), s.useSyncedValues({
903
+ disabled: r,
904
+ modal: E.type === void 0 ? c : void 0,
905
+ rootId: Wt()
906
+ });
907
+ const {
908
+ openMethod: le,
909
+ triggerProps: B
910
+ } = Qt(D);
911
+ On(s);
912
+ const {
913
+ forceUnmount: $
914
+ } = kn(D, s, () => {
915
+ s.update({
916
+ allowMouseEnter: !1,
917
+ stickIfOpen: !0
918
+ });
919
+ }), J = n.useRef(E.type !== "context-menu"), Q = he();
920
+ n.useEffect(() => {
921
+ if (D || (Y.current = null), E.type === "context-menu") {
922
+ if (!D) {
923
+ Q.clear(), J.current = !1;
924
+ return;
655
925
  }
656
- ) });
657
- }
658
- );
659
- qe.displayName = Ze;
660
- var Nt = "DropdownMenuPortal", Je = (e) => {
661
- const { __scopeDropdownMenu: t, ...n } = e, o = h(t);
662
- return /* @__PURE__ */ r(vt, { ...o, ...n });
663
- };
664
- Je.displayName = Nt;
665
- var Qe = "DropdownMenuContent", en = s.forwardRef(
666
- (e, t) => {
667
- const { __scopeDropdownMenu: n, ...o } = e, a = He(Qe, n), c = h(n), i = s.useRef(!1);
668
- return /* @__PURE__ */ r(
669
- gt,
670
- {
671
- id: a.contentId,
672
- "aria-labelledby": a.triggerId,
673
- ...c,
674
- ...o,
675
- ref: t,
676
- onCloseAutoFocus: g(e.onCloseAutoFocus, (d) => {
677
- i.current || a.triggerRef.current?.focus(), i.current = !1, d.preventDefault();
678
- }),
679
- onInteractOutside: g(e.onInteractOutside, (d) => {
680
- const f = d.detail.originalEvent, m = f.button === 0 && f.ctrlKey === !0, p = f.button === 2 || m;
681
- (!a.modal || p) && (i.current = !0);
682
- }),
683
- style: {
684
- ...e.style,
685
- "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
686
- "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
687
- "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
688
- "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
689
- "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
690
- }
926
+ Q.start(500, () => {
927
+ J.current = !0;
928
+ });
929
+ }
930
+ }, [Q, D, E.type]), Zt(D && K && W !== ye && le !== "touch", L), ve(() => {
931
+ !D && !_ && s.set("hoverEnabled", !0);
932
+ }, [D, _, s]);
933
+ const oe = n.useRef(!0), V = he(), re = de((v, w) => {
934
+ const z = w.reason;
935
+ if (D === v && w.trigger === A && W === z || (w.preventUnmountOnClose = () => {
936
+ s.set("preventUnmountingOnClose", !0);
937
+ }, !v && w.trigger == null && (w.trigger = A ?? void 0), p?.(v, w), w.isCanceled))
938
+ return;
939
+ const Kt = {
940
+ open: v,
941
+ nativeEvent: w.event,
942
+ reason: w.reason,
943
+ nested: ne
944
+ };
945
+ X?.emit("openchange", Kt);
946
+ const Ce = w.event;
947
+ if (v === !1 && Ce?.type === "click" && Ce.pointerType === "touch" && !oe.current)
948
+ return;
949
+ if (!v && H !== null) {
950
+ const jt = s.context.itemDomElements.current[H];
951
+ queueMicrotask(() => {
952
+ jt?.setAttribute("tabindex", "-1");
953
+ });
954
+ }
955
+ v && z === st ? (oe.current = !1, V.start(300, () => {
956
+ oe.current = !0;
957
+ })) : (oe.current = !0, V.clear());
958
+ const tt = (z === En || z === Ee) && Ce.detail === 0 && Ce?.isTrusted, Yt = !v && (z === In || z == null), we = {
959
+ open: v,
960
+ openChangeReason: z
961
+ };
962
+ Y.current = w.event ?? null;
963
+ const nt = w.trigger?.id ?? null;
964
+ (nt || v) && (we.activeTriggerId = nt, we.activeTriggerElement = w.trigger ?? null), s.update(we), E.type === "menubar" && (z === st || z === ke || z === ye || z === Pn || z === be) ? s.set("instantType", "group") : tt || Yt ? s.set("instantType", tt ? "click" : "dismiss") : s.set("instantType", void 0);
965
+ }), j = n.useCallback((v) => {
966
+ const w = ae(v);
967
+ return w.preventUnmountOnClose = () => {
968
+ s.set("preventUnmountingOnClose", !0);
969
+ }, w;
970
+ }, [s]), pe = n.useCallback(() => {
971
+ s.setOpen(!1, j(Nn));
972
+ }, [s, j]);
973
+ n.useImperativeHandle(x, () => ({
974
+ unmount: $,
975
+ close: pe
976
+ }), [$, pe]);
977
+ let fe;
978
+ E.type === "context-menu" && (fe = E.context), n.useImperativeHandle(fe?.positionerRef, () => L, [L]), n.useImperativeHandle(fe?.actionsRef, () => ({
979
+ setOpen: re
980
+ }), [re]);
981
+ const se = Dn({
982
+ popupStore: s,
983
+ onOpenChange: re
984
+ });
985
+ X = se.context.events, n.useEffect(() => {
986
+ const v = ({
987
+ open: w,
988
+ eventDetails: z
989
+ }) => re(w, z);
990
+ return X.on("setOpen", v), () => {
991
+ X?.off("setOpen", v);
992
+ };
993
+ }, [X, re]);
994
+ const me = ln(se, {
995
+ enabled: !U,
996
+ bubbles: {
997
+ escapeKey: g && E.type === "menu"
998
+ },
999
+ outsidePress() {
1000
+ return E.type !== "context-menu" || Y.current?.type === "contextmenu" ? !0 : J.current;
1001
+ },
1002
+ externalTree: ne ? N : void 0
1003
+ }), F = Fn(se, {
1004
+ role: "menu"
1005
+ }), M = Rn(), I = n.useCallback((v) => {
1006
+ s.select("activeIndex") !== v && s.set("activeIndex", v);
1007
+ }, [s]), Z = An(se, {
1008
+ enabled: !U,
1009
+ listRef: s.context.itemDomElements,
1010
+ activeIndex: H,
1011
+ nested: E.type !== void 0,
1012
+ loopFocus: y,
1013
+ orientation: m,
1014
+ parentOrientation: E.type === "menubar" ? E.context.orientation : void 0,
1015
+ rtl: M === "rtl",
1016
+ disabledIndices: nn,
1017
+ onNavigate: I,
1018
+ openOnArrowKeyDown: E.type !== "context-menu",
1019
+ externalTree: ne ? N : void 0,
1020
+ focusItemOnHover: C
1021
+ }), At = n.useCallback((v) => {
1022
+ s.context.typingRef.current = v;
1023
+ }, [s]), Ut = Un(se, {
1024
+ listRef: s.context.itemLabels,
1025
+ elementsRef: s.context.itemDomElements,
1026
+ activeIndex: H,
1027
+ resetMs: pn,
1028
+ onMatch: (v) => {
1029
+ D && v !== H && s.set("activeIndex", v);
1030
+ },
1031
+ onTypingChange: At
1032
+ }), {
1033
+ getReferenceProps: $e,
1034
+ getFloatingProps: Je,
1035
+ getItemProps: Qe,
1036
+ getTriggerProps: Ze
1037
+ } = Ve([me, F, Z, Ut]), Bt = n.useMemo(() => {
1038
+ const v = Oe($e(), {
1039
+ onMouseMove() {
1040
+ s.set("allowMouseEnter", !0);
691
1041
  }
692
- );
693
- }
694
- );
695
- en.displayName = Qe;
696
- var Tt = "DropdownMenuGroup", nn = s.forwardRef(
697
- (e, t) => {
698
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
699
- return /* @__PURE__ */ r(Mt, { ...a, ...o, ref: t });
700
- }
701
- );
702
- nn.displayName = Tt;
703
- var At = "DropdownMenuLabel", tn = s.forwardRef(
704
- (e, t) => {
705
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
706
- return /* @__PURE__ */ r(ht, { ...a, ...o, ref: t });
707
- }
708
- );
709
- tn.displayName = At;
710
- var Ot = "DropdownMenuItem", on = s.forwardRef(
711
- (e, t) => {
712
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
713
- return /* @__PURE__ */ r(wt, { ...a, ...o, ref: t });
714
- }
715
- );
716
- on.displayName = Ot;
717
- var kt = "DropdownMenuCheckboxItem", rn = s.forwardRef((e, t) => {
718
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
719
- return /* @__PURE__ */ r(Ct, { ...a, ...o, ref: t });
720
- });
721
- rn.displayName = kt;
722
- var Lt = "DropdownMenuRadioGroup", an = s.forwardRef((e, t) => {
723
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
724
- return /* @__PURE__ */ r(_t, { ...a, ...o, ref: t });
725
- });
726
- an.displayName = Lt;
727
- var Gt = "DropdownMenuRadioItem", sn = s.forwardRef((e, t) => {
728
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
729
- return /* @__PURE__ */ r(Rt, { ...a, ...o, ref: t });
730
- });
731
- sn.displayName = Gt;
732
- var Ft = "DropdownMenuItemIndicator", cn = s.forwardRef((e, t) => {
733
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
734
- return /* @__PURE__ */ r(bt, { ...a, ...o, ref: t });
735
- });
736
- cn.displayName = Ft;
737
- var Kt = "DropdownMenuSeparator", un = s.forwardRef((e, t) => {
738
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
739
- return /* @__PURE__ */ r(xt, { ...a, ...o, ref: t });
740
- });
741
- un.displayName = Kt;
742
- var $t = "DropdownMenuArrow", Ut = s.forwardRef(
743
- (e, t) => {
744
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
745
- return /* @__PURE__ */ r(Dt, { ...a, ...o, ref: t });
746
- }
747
- );
748
- Ut.displayName = $t;
749
- var zt = (e) => {
750
- const { __scopeDropdownMenu: t, children: n, open: o, onOpenChange: a, defaultOpen: c } = e, i = h(t), [d, f] = we({
751
- prop: o,
752
- defaultProp: c ?? !1,
753
- onChange: a,
754
- caller: "DropdownMenuSub"
1042
+ }, B);
1043
+ return delete v.role, v;
1044
+ }, [$e, s, B]), Gt = n.useMemo(() => {
1045
+ const v = Ze();
1046
+ if (!v)
1047
+ return v;
1048
+ const w = Oe(v, B);
1049
+ return delete w.role, delete w["aria-controls"], w;
1050
+ }, [Ze, B]), Lt = n.useMemo(() => Je({
1051
+ onMouseMove() {
1052
+ s.set("allowMouseEnter", !0), E.type === "menu" && s.set("hoverEnabled", !1);
1053
+ },
1054
+ onClick() {
1055
+ s.select("hoverEnabled") && s.set("hoverEnabled", !1);
1056
+ },
1057
+ onKeyDown(v) {
1058
+ const w = s.select("keyboardEventRelay");
1059
+ w && !v.isPropagationStopped() && w(v);
1060
+ }
1061
+ }), [Je, E.type, s]), Ht = n.useMemo(() => Qe(), [Qe]);
1062
+ s.useSyncedValues({
1063
+ floatingRootContext: se,
1064
+ activeTriggerProps: Bt,
1065
+ inactiveTriggerProps: Gt,
1066
+ popupProps: Lt,
1067
+ itemProps: Ht
1068
+ });
1069
+ const zt = n.useMemo(() => ({
1070
+ store: s,
1071
+ parent: l
1072
+ }), [s, l]), et = /* @__PURE__ */ f(Ue.Provider, {
1073
+ value: zt,
1074
+ children: typeof o == "function" ? o({
1075
+ payload: ue
1076
+ }) : o
755
1077
  });
756
- return /* @__PURE__ */ r(St, { ...i, open: d, onOpenChange: f, children: n });
757
- }, Bt = "DropdownMenuSubTrigger", dn = s.forwardRef((e, t) => {
758
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
759
- return /* @__PURE__ */ r(It, { ...a, ...o, ref: t });
1078
+ return E.type === void 0 || E.type === "context-menu" ? /* @__PURE__ */ f(fn, {
1079
+ externalTree: N,
1080
+ children: et
1081
+ }) : et;
760
1082
  });
761
- dn.displayName = Bt;
762
- var Vt = "DropdownMenuSubContent", ln = s.forwardRef((e, t) => {
763
- const { __scopeDropdownMenu: n, ...o } = e, a = h(n);
764
- return /* @__PURE__ */ r(
765
- Pt,
766
- {
767
- ...a,
768
- ...o,
769
- ref: t,
770
- style: {
771
- ...e.style,
772
- "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
773
- "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
774
- "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
775
- "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
776
- "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
1083
+ process.env.NODE_ENV !== "production" && (Xe.displayName = "MenuRoot");
1084
+ function po(e) {
1085
+ const t = ee().store, o = n.useMemo(() => ({
1086
+ parentMenu: t
1087
+ }), [t]);
1088
+ return /* @__PURE__ */ f(We.Provider, {
1089
+ value: o,
1090
+ children: /* @__PURE__ */ f(Xe, {
1091
+ ...e
1092
+ })
1093
+ });
1094
+ }
1095
+ function _t(e) {
1096
+ if (Qn(e) && e.hasAttribute("data-rootownerid"))
1097
+ return e.getAttribute("data-rootownerid") ?? void 0;
1098
+ if (!Zn(e))
1099
+ return _t(eo(e));
1100
+ }
1101
+ function fo(e) {
1102
+ const {
1103
+ enabled: t = !0,
1104
+ mouseDownAction: o,
1105
+ open: u
1106
+ } = e, p = n.useRef(!1);
1107
+ return n.useMemo(() => t ? {
1108
+ onMouseDown: (d) => {
1109
+ (o === "open" && !u || o === "close" && u) && (p.current = !0, De(d.currentTarget).addEventListener("click", () => {
1110
+ p.current = !1;
1111
+ }, {
1112
+ once: !0
1113
+ }));
1114
+ },
1115
+ onClick: (d) => {
1116
+ p.current && (p.current = !1, d.preventBaseUIHandler());
1117
+ }
1118
+ } : _e, [t, o, u]);
1119
+ }
1120
+ const Re = 2, Vt = mn(function(t, o) {
1121
+ const {
1122
+ render: u,
1123
+ className: p,
1124
+ disabled: d = !1,
1125
+ nativeButton: b = !0,
1126
+ id: r,
1127
+ openOnHover: c,
1128
+ delay: y = 100,
1129
+ closeDelay: m = 0,
1130
+ handle: x,
1131
+ payload: g,
1132
+ ...P
1133
+ } = t, O = ee(!0), i = x?.store ?? O?.store;
1134
+ if (!i)
1135
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle." : ie(85));
1136
+ const C = ge(r), h = i.useState("isTriggerActive", C), a = i.useState("floatingRootContext"), S = i.useState("isOpenedByTrigger", C), k = n.useRef(null), l = go(), s = Ln(!0), N = gn(), T = n.useMemo(() => N ?? new lt(), [N]), R = pt(T), D = ft(), {
1137
+ registerTrigger: A,
1138
+ isMountedByThisTrigger: L
1139
+ } = _n(C, k, i, {
1140
+ payload: g,
1141
+ closeDelay: m,
1142
+ parent: l,
1143
+ floatingTreeRoot: T,
1144
+ floatingNodeId: R,
1145
+ floatingParentNodeId: D,
1146
+ keyboardEventRelay: s?.relayKeyboardEvent
1147
+ }), _ = l.type === "menubar", K = i.useState("disabled"), U = d || K || _ && l.context.disabled, {
1148
+ getButtonProps: W,
1149
+ buttonRef: E
1150
+ } = gt({
1151
+ disabled: U,
1152
+ native: b
1153
+ });
1154
+ n.useEffect(() => {
1155
+ !S && l.type === void 0 && (i.context.allowMouseUpTriggerRef.current = !1);
1156
+ }, [i, S, l.type]);
1157
+ const H = n.useRef(null), ue = he(), te = de((F) => {
1158
+ if (!H.current)
1159
+ return;
1160
+ ue.clear(), i.context.allowMouseUpTriggerRef.current = !1;
1161
+ const M = F.target;
1162
+ if (Se(H.current, M) || Se(i.select("positionerElement"), M) || M === H.current || M != null && _t(M) === i.select("rootId"))
1163
+ return;
1164
+ const I = Bn(H.current);
1165
+ F.clientX >= I.left - Re && F.clientX <= I.right + Re && F.clientY >= I.top - Re && F.clientY <= I.bottom + Re || T.events.emit("close", {
1166
+ domEvent: F,
1167
+ reason: Tn
1168
+ });
1169
+ });
1170
+ n.useEffect(() => {
1171
+ S && i.select("lastOpenChangeReason") === ye && De(H.current).addEventListener("mouseup", te, {
1172
+ once: !0
1173
+ });
1174
+ }, [S, te, i]);
1175
+ const Y = _ && l.context.hasSubmenuOpen, X = xt(a, {
1176
+ enabled: (c ?? Y) && !U && l.type !== "context-menu" && (!_ || Y && !L),
1177
+ handleClose: Mt({
1178
+ blockPointerEvents: !_
1179
+ }),
1180
+ mouseOnly: !0,
1181
+ move: !1,
1182
+ restMs: l.type === void 0 ? y : void 0,
1183
+ delay: {
1184
+ close: m
1185
+ },
1186
+ triggerElementRef: k,
1187
+ externalTree: T,
1188
+ isActiveTrigger: h
1189
+ }), le = mo(S, i.select("lastOpenChangeReason")), B = ct(a, {
1190
+ enabled: !U && l.type !== "context-menu",
1191
+ event: S && _ ? "click" : "mousedown",
1192
+ toggle: !0,
1193
+ ignoreMouse: !1,
1194
+ stickIfOpen: l.type === void 0 ? le : !1
1195
+ }), $ = to(a, {
1196
+ enabled: !U && Y
1197
+ }), J = fo({
1198
+ open: S,
1199
+ enabled: _,
1200
+ mouseDownAction: "open"
1201
+ }), Q = Ve([B, $]), oe = {
1202
+ disabled: U,
1203
+ open: S
1204
+ }, V = i.useState("triggerProps", L), re = [H, o, E, A, k], j = [Q.getReferenceProps(), X ?? _e, V, {
1205
+ "aria-haspopup": "menu",
1206
+ id: C,
1207
+ onMouseDown: (F) => {
1208
+ if (i.select("open"))
1209
+ return;
1210
+ ue.start(200, () => {
1211
+ i.context.allowMouseUpTriggerRef.current = !0;
1212
+ }), De(F.currentTarget).addEventListener("mouseup", te, {
1213
+ once: !0
1214
+ });
1215
+ }
1216
+ }, _ ? {
1217
+ role: "menuitem"
1218
+ } : {}, J, P, W], pe = n.useRef(null), fe = de((F) => {
1219
+ at.flushSync(() => {
1220
+ i.setOpen(!1, ae(ke, F.nativeEvent, F.currentTarget));
1221
+ }), bn(pe.current)?.focus();
1222
+ }), se = de((F) => {
1223
+ const M = i.select("positionerElement");
1224
+ if (M && hn(F, M))
1225
+ i.context.beforeContentFocusGuardRef.current?.focus();
1226
+ else {
1227
+ at.flushSync(() => {
1228
+ i.setOpen(!1, ae(ke, F.nativeEvent, F.currentTarget));
1229
+ });
1230
+ let I = vn(i.context.triggerFocusTargetRef.current || k.current);
1231
+ for (; I !== null && Se(M, I); ) {
1232
+ const Z = I;
1233
+ if (I = xn(I), I === Z)
1234
+ break;
777
1235
  }
1236
+ I?.focus();
778
1237
  }
779
- );
1238
+ }), me = q("button", t, {
1239
+ enabled: !_,
1240
+ stateAttributesMapping: ot,
1241
+ state: oe,
1242
+ ref: re,
1243
+ props: j
1244
+ });
1245
+ return _ ? /* @__PURE__ */ f(Jn, {
1246
+ tag: "button",
1247
+ render: u,
1248
+ className: p,
1249
+ state: oe,
1250
+ refs: re,
1251
+ props: j,
1252
+ stateAttributesMapping: ot
1253
+ }) : S ? /* @__PURE__ */ xe(n.Fragment, {
1254
+ children: [/* @__PURE__ */ f(rt, {
1255
+ ref: pe,
1256
+ onFocus: fe
1257
+ }, `${C}-pre-focus-guard`), /* @__PURE__ */ f(n.Fragment, {
1258
+ children: me
1259
+ }, C), /* @__PURE__ */ f(rt, {
1260
+ ref: i.context.triggerFocusTargetRef,
1261
+ onFocus: se
1262
+ }, `${C}-post-focus-guard`)]
1263
+ }) : /* @__PURE__ */ f(n.Fragment, {
1264
+ children: me
1265
+ }, C);
780
1266
  });
781
- ln.displayName = Vt;
782
- var jt = We, Xt = qe, pn = Je, Yt = en, Ht = nn, Wt = tn, Zt = on, qt = rn, Jt = an, Qt = sn, fn = cn, eo = un, no = zt, to = dn, oo = ln;
783
- function Ro({
784
- ...e
785
- }) {
786
- return /* @__PURE__ */ r(jt, { "data-slot": "dropdown-menu", ...e });
1267
+ process.env.NODE_ENV !== "production" && (Vt.displayName = "MenuTrigger");
1268
+ function mo(e, t) {
1269
+ const o = he(), [u, p] = n.useState(!1);
1270
+ return ve(() => {
1271
+ e && t === "trigger-hover" ? (p(!0), o.start(Mn, () => {
1272
+ p(!1);
1273
+ })) : e || (o.clear(), p(!1));
1274
+ }, [e, t, o]), u;
787
1275
  }
788
- function bo({
789
- ...e
790
- }) {
791
- return /* @__PURE__ */ r(pn, { "data-slot": "dropdown-menu-portal", ...e });
1276
+ function go() {
1277
+ const e = Pe(!0), t = ee(!0), o = kt();
1278
+ return n.useMemo(() => o ? {
1279
+ type: "menubar",
1280
+ context: o
1281
+ } : e && !t ? {
1282
+ type: "context-menu",
1283
+ context: e
1284
+ } : {
1285
+ type: void 0
1286
+ }, [e, t, o]);
1287
+ }
1288
+ const Ft = /* @__PURE__ */ n.forwardRef(function(t, o) {
1289
+ const {
1290
+ render: u,
1291
+ className: p,
1292
+ label: d,
1293
+ id: b,
1294
+ nativeButton: r = !1,
1295
+ openOnHover: c = !0,
1296
+ delay: y = 100,
1297
+ closeDelay: m = 0,
1298
+ disabled: x = !1,
1299
+ ...g
1300
+ } = t, P = Ie(), O = Me(), {
1301
+ store: i
1302
+ } = ee(), C = ge(b), h = i.useState("open"), a = i.useState("floatingRootContext"), S = i.useState("floatingTreeRoot"), k = Vn(C, i), l = n.useCallback((B) => {
1303
+ const $ = k(B);
1304
+ return B !== null && i.select("open") && i.select("activeTriggerId") == null && i.update({
1305
+ activeTriggerId: C,
1306
+ activeTriggerElement: B,
1307
+ closeDelay: m
1308
+ }), $;
1309
+ }, [k, m, i, C]), s = n.useRef(null), N = n.useCallback((B) => {
1310
+ s.current = B, i.set("activeTriggerElement", B);
1311
+ }, [i]), T = Dt();
1312
+ if (!T?.parentMenu)
1313
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>." : ie(37));
1314
+ i.useSyncedValue("closeDelay", m);
1315
+ const R = T.parentMenu, D = R.useState("itemProps"), A = R.useState("isActive", P.index), L = n.useMemo(() => ({
1316
+ type: "submenu-trigger",
1317
+ setActive() {
1318
+ R.set("activeIndex", P.index);
1319
+ }
1320
+ }), [R, P.index]), _ = i.useState("disabled"), K = x || _, {
1321
+ getItemProps: U,
1322
+ itemRef: W
1323
+ } = Ne({
1324
+ closeOnClick: !1,
1325
+ disabled: K,
1326
+ highlighted: A,
1327
+ id: C,
1328
+ store: i,
1329
+ typingRef: R.context.typingRef,
1330
+ nativeButton: r,
1331
+ itemMetadata: L,
1332
+ nodeId: O?.nodeId
1333
+ }), E = i.useState("hoverEnabled"), H = R.useState("allowMouseEnter"), ue = xt(a, {
1334
+ enabled: E && c && !K,
1335
+ handleClose: Mt({
1336
+ blockPointerEvents: !0
1337
+ }),
1338
+ mouseOnly: !0,
1339
+ move: !0,
1340
+ restMs: y,
1341
+ delay: H ? {
1342
+ open: y,
1343
+ close: m
1344
+ } : 0,
1345
+ triggerElementRef: s,
1346
+ externalTree: S
1347
+ }), te = ct(a, {
1348
+ enabled: !K,
1349
+ event: "mousedown",
1350
+ toggle: !c,
1351
+ ignoreMouse: c,
1352
+ stickIfOpen: !1
1353
+ }), Y = Ve([te]), ne = i.useState("triggerProps", !0);
1354
+ return delete ne.id, q("div", t, {
1355
+ state: {
1356
+ disabled: K,
1357
+ highlighted: A,
1358
+ open: h
1359
+ },
1360
+ stateAttributesMapping: Cn,
1361
+ props: [Y.getReferenceProps(), ue, ne, D, {
1362
+ tabIndex: h || A ? 0 : -1,
1363
+ onBlur() {
1364
+ A && R.set("activeIndex", null);
1365
+ }
1366
+ }, g, U],
1367
+ ref: [o, P.ref, W, l, N]
1368
+ });
1369
+ });
1370
+ process.env.NODE_ENV !== "production" && (Ft.displayName = "MenuSubmenuTrigger");
1371
+ function $o({ ...e }) {
1372
+ return /* @__PURE__ */ f(Xe, { "data-slot": "dropdown-menu", ...e });
1373
+ }
1374
+ function Jo({ ...e }) {
1375
+ return /* @__PURE__ */ f(Ke, { "data-slot": "dropdown-menu-portal", ...e });
1376
+ }
1377
+ function Qo({ ...e }) {
1378
+ return /* @__PURE__ */ f(Vt, { "data-slot": "dropdown-menu-trigger", ...e });
792
1379
  }
793
- function xo({
794
- ...e
1380
+ function bo({
1381
+ align: e = "start",
1382
+ alignOffset: t = 0,
1383
+ side: o = "bottom",
1384
+ sideOffset: u = 4,
1385
+ className: p,
1386
+ ...d
795
1387
  }) {
796
- return /* @__PURE__ */ r(
797
- Xt,
1388
+ return /* @__PURE__ */ f(Ke, { children: /* @__PURE__ */ f(
1389
+ Nt,
798
1390
  {
799
- "data-slot": "dropdown-menu-trigger",
800
- ...e
1391
+ align: e,
1392
+ alignOffset: t,
1393
+ className: "isolate z-50 outline-none",
1394
+ side: o,
1395
+ sideOffset: u,
1396
+ children: /* @__PURE__ */ f(
1397
+ Pt,
1398
+ {
1399
+ className: ce(
1400
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-md outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in data-closed:overflow-hidden",
1401
+ p
1402
+ ),
1403
+ "data-slot": "dropdown-menu-content",
1404
+ ...d
1405
+ }
1406
+ )
801
1407
  }
802
- );
1408
+ ) });
1409
+ }
1410
+ function Zo({ ...e }) {
1411
+ return /* @__PURE__ */ f(He, { "data-slot": "dropdown-menu-group", ...e });
803
1412
  }
804
- function Do({
1413
+ function er({
805
1414
  className: e,
806
- sideOffset: t = 4,
807
- ...n
1415
+ inset: t,
1416
+ ...o
808
1417
  }) {
809
- return /* @__PURE__ */ r(pn, { children: /* @__PURE__ */ r(
810
- Yt,
1418
+ return /* @__PURE__ */ f(He, { children: /* @__PURE__ */ f(
1419
+ Et,
811
1420
  {
812
- className: R(
813
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
1421
+ className: ce(
1422
+ "px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:pl-8",
814
1423
  e
815
1424
  ),
816
- "data-slot": "dropdown-menu-content",
817
- sideOffset: t,
818
- ...n
1425
+ "data-inset": t,
1426
+ "data-slot": "dropdown-menu-label",
1427
+ ...o
819
1428
  }
820
1429
  ) });
821
1430
  }
822
- function So({
823
- ...e
824
- }) {
825
- return /* @__PURE__ */ r(Ht, { "data-slot": "dropdown-menu-group", ...e });
826
- }
827
- function Io({
1431
+ function tr({
828
1432
  className: e,
829
1433
  inset: t,
830
- variant: n = "default",
831
- ...o
1434
+ variant: o = "default",
1435
+ ...u
832
1436
  }) {
833
- return /* @__PURE__ */ r(
834
- Zt,
1437
+ return /* @__PURE__ */ f(
1438
+ It,
835
1439
  {
836
- className: R(
837
- "data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
1440
+ className: ce(
1441
+ "group/dropdown-menu-item relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive",
838
1442
  e
839
1443
  ),
840
1444
  "data-inset": t,
841
1445
  "data-slot": "dropdown-menu-item",
842
- "data-variant": n,
843
- ...o
1446
+ "data-variant": o,
1447
+ ...u
844
1448
  }
845
1449
  );
846
1450
  }
847
- function Po({
1451
+ function nr({ ...e }) {
1452
+ return /* @__PURE__ */ f(po, { "data-slot": "dropdown-menu-sub", ...e });
1453
+ }
1454
+ function or({
848
1455
  className: e,
849
- children: t,
850
- checked: n,
851
- ...o
1456
+ inset: t,
1457
+ children: o,
1458
+ ...u
852
1459
  }) {
853
- return /* @__PURE__ */ ne(
854
- qt,
1460
+ return /* @__PURE__ */ xe(
1461
+ Ft,
855
1462
  {
856
- checked: n,
857
- className: R(
858
- "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1463
+ className: ce(
1464
+ "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-open:bg-accent data-popup-open:bg-accent data-inset:pl-8 data-open:text-accent-foreground data-popup-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
859
1465
  e
860
1466
  ),
861
- "data-slot": "dropdown-menu-checkbox-item",
862
- ...o,
1467
+ "data-inset": t,
1468
+ "data-slot": "dropdown-menu-sub-trigger",
1469
+ ...u,
863
1470
  children: [
864
- /* @__PURE__ */ r("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ r(fn, { children: /* @__PURE__ */ r(Rn, { className: "size-4" }) }) }),
865
- t
1471
+ o,
1472
+ /* @__PURE__ */ f(qt, { className: "ml-auto" })
866
1473
  ]
867
1474
  }
868
1475
  );
869
1476
  }
870
- function Eo({
871
- ...e
1477
+ function rr({
1478
+ align: e = "start",
1479
+ alignOffset: t = -3,
1480
+ side: o = "right",
1481
+ sideOffset: u = 0,
1482
+ className: p,
1483
+ ...d
872
1484
  }) {
873
- return /* @__PURE__ */ r(
874
- Jt,
1485
+ return /* @__PURE__ */ f(
1486
+ bo,
875
1487
  {
876
- "data-slot": "dropdown-menu-radio-group",
877
- ...e
1488
+ align: e,
1489
+ alignOffset: t,
1490
+ className: ce(
1491
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",
1492
+ p
1493
+ ),
1494
+ "data-slot": "dropdown-menu-sub-content",
1495
+ side: o,
1496
+ sideOffset: u,
1497
+ ...d
878
1498
  }
879
1499
  );
880
1500
  }
881
- function yo({
1501
+ function sr({
882
1502
  className: e,
883
1503
  children: t,
884
- ...n
1504
+ checked: o,
1505
+ inset: u,
1506
+ ...p
885
1507
  }) {
886
- return /* @__PURE__ */ ne(
887
- Qt,
1508
+ return /* @__PURE__ */ xe(
1509
+ Rt,
888
1510
  {
889
- className: R(
890
- "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1511
+ checked: o,
1512
+ className: ce(
1513
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
891
1514
  e
892
1515
  ),
893
- "data-slot": "dropdown-menu-radio-item",
894
- ...n,
1516
+ "data-inset": u,
1517
+ "data-slot": "dropdown-menu-checkbox-item",
1518
+ ...p,
895
1519
  children: [
896
- /* @__PURE__ */ r("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ r(fn, { children: /* @__PURE__ */ r(bn, { className: "size-2 fill-current" }) }) }),
1520
+ /* @__PURE__ */ f(
1521
+ "span",
1522
+ {
1523
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
1524
+ "data-slot": "dropdown-menu-checkbox-item-indicator",
1525
+ children: /* @__PURE__ */ f(yt, { children: /* @__PURE__ */ f(ut, {}) })
1526
+ }
1527
+ ),
897
1528
  t
898
1529
  ]
899
1530
  }
900
1531
  );
901
1532
  }
902
- function No({
1533
+ function ar({ ...e }) {
1534
+ return /* @__PURE__ */ f(
1535
+ Tt,
1536
+ {
1537
+ "data-slot": "dropdown-menu-radio-group",
1538
+ ...e
1539
+ }
1540
+ );
1541
+ }
1542
+ function ir({
903
1543
  className: e,
904
- inset: t,
905
- ...n
1544
+ children: t,
1545
+ inset: o,
1546
+ ...u
906
1547
  }) {
907
- return /* @__PURE__ */ r(
908
- Wt,
1548
+ return /* @__PURE__ */ xe(
1549
+ wt,
909
1550
  {
910
- className: R(
911
- "px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",
1551
+ className: ce(
1552
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
912
1553
  e
913
1554
  ),
914
- "data-inset": t,
915
- "data-slot": "dropdown-menu-label",
916
- ...n
1555
+ "data-inset": o,
1556
+ "data-slot": "dropdown-menu-radio-item",
1557
+ ...u,
1558
+ children: [
1559
+ /* @__PURE__ */ f(
1560
+ "span",
1561
+ {
1562
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
1563
+ "data-slot": "dropdown-menu-radio-item-indicator",
1564
+ children: /* @__PURE__ */ f(St, { children: /* @__PURE__ */ f(ut, {}) })
1565
+ }
1566
+ ),
1567
+ t
1568
+ ]
917
1569
  }
918
1570
  );
919
1571
  }
920
- function To({
1572
+ function ur({
921
1573
  className: e,
922
1574
  ...t
923
1575
  }) {
924
- return /* @__PURE__ */ r(
925
- eo,
1576
+ return /* @__PURE__ */ f(
1577
+ $n,
926
1578
  {
927
- className: R("-mx-1 my-1 h-px bg-border", e),
1579
+ className: ce("-mx-1 my-1 h-px bg-border", e),
928
1580
  "data-slot": "dropdown-menu-separator",
929
1581
  ...t
930
1582
  }
931
1583
  );
932
1584
  }
933
- function Ao({
1585
+ function cr({
934
1586
  className: e,
935
1587
  ...t
936
1588
  }) {
937
- return /* @__PURE__ */ r(
1589
+ return /* @__PURE__ */ f(
938
1590
  "span",
939
1591
  {
940
- className: R(
941
- "ml-auto text-muted-foreground text-xs tracking-widest",
1592
+ className: ce(
1593
+ "ml-auto text-muted-foreground text-xs tracking-widest group-focus/dropdown-menu-item:text-accent-foreground",
942
1594
  e
943
1595
  ),
944
1596
  "data-slot": "dropdown-menu-shortcut",
@@ -946,64 +1598,20 @@ function Ao({
946
1598
  }
947
1599
  );
948
1600
  }
949
- function Oo({
950
- ...e
951
- }) {
952
- return /* @__PURE__ */ r(no, { "data-slot": "dropdown-menu-sub", ...e });
953
- }
954
- function ko({
955
- className: e,
956
- inset: t,
957
- children: n,
958
- ...o
959
- }) {
960
- return /* @__PURE__ */ ne(
961
- to,
962
- {
963
- className: R(
964
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[inset]:pl-8 data-[state=open]:text-accent-foreground",
965
- e
966
- ),
967
- "data-inset": t,
968
- "data-slot": "dropdown-menu-sub-trigger",
969
- ...o,
970
- children: [
971
- n,
972
- /* @__PURE__ */ r(xn, { className: "ml-auto size-4" })
973
- ]
974
- }
975
- );
976
- }
977
- function Lo({
978
- className: e,
979
- ...t
980
- }) {
981
- return /* @__PURE__ */ r(
982
- oo,
983
- {
984
- className: R(
985
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in",
986
- e
987
- ),
988
- "data-slot": "dropdown-menu-sub-content",
989
- ...t
990
- }
991
- );
992
- }
993
1601
  export {
994
- Ro as DropdownMenu,
995
- Po as DropdownMenuCheckboxItem,
996
- Do as DropdownMenuContent,
997
- So as DropdownMenuGroup,
998
- Io as DropdownMenuItem,
999
- No as DropdownMenuLabel,
1000
- bo as DropdownMenuPortal,
1001
- Eo as DropdownMenuRadioGroup,
1002
- yo as DropdownMenuRadioItem,
1003
- To as DropdownMenuSeparator,
1004
- Ao as DropdownMenuShortcut,
1005
- Oo as DropdownMenuSub,
1006
- Lo as DropdownMenuSubContent,
1007
- ko as DropdownMenuSubTrigger,
1008
- xo as DropdownMenuTrigger
1602
+ $o as DropdownMenu,
1603
+ sr as DropdownMenuCheckboxItem,
1604
+ bo as DropdownMenuContent,
1605
+ Zo as DropdownMenuGroup,
1606
+ tr as DropdownMenuItem,
1607
+ er as DropdownMenuLabel,
1608
+ Jo as DropdownMenuPortal,
1609
+ ar as DropdownMenuRadioGroup,
1610
+ ir as DropdownMenuRadioItem,
1611
+ ur as DropdownMenuSeparator,
1612
+ cr as DropdownMenuShortcut,
1613
+ nr as DropdownMenuSub,
1614
+ rr as DropdownMenuSubContent,
1615
+ or as DropdownMenuSubTrigger,
1616
+ Qo as DropdownMenuTrigger
1009
1617
  };