@koide-labs/ui 0.0.14 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/dist/-utils.d.ts +2 -2
  2. package/dist/-utils.js +1 -1
  3. package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
  4. package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
  5. package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
  6. package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
  7. package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
  8. package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
  9. package/dist/accordion.css +1 -0
  10. package/dist/alert-dialog.css +1 -0
  11. package/dist/anchor.css +1 -0
  12. package/dist/avatar.css +1 -0
  13. package/dist/badge.css +1 -0
  14. package/dist/button.css +1 -0
  15. package/dist/checkbox.css +1 -0
  16. package/dist/code.css +1 -0
  17. package/dist/collapse.css +1 -0
  18. package/dist/command.css +1 -0
  19. package/dist/components/accordion/accordion.d.ts +19 -0
  20. package/dist/components/accordion/accordion.js +701 -0
  21. package/dist/components/accordion/index.d.ts +1 -12
  22. package/dist/components/accordion/index.js +2 -697
  23. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  24. package/dist/components/alert-dialog/alert-dialog.js +138 -0
  25. package/dist/components/alert-dialog/index.d.ts +1 -26
  26. package/dist/components/alert-dialog/index.js +2 -134
  27. package/dist/components/anchor/anchor.d.ts +12 -0
  28. package/dist/components/anchor/anchor.js +21 -0
  29. package/dist/components/anchor/index.d.ts +1 -8
  30. package/dist/components/anchor/index.js +2 -19
  31. package/dist/components/avatar/avatar.d.ts +25 -0
  32. package/dist/components/avatar/avatar.js +161 -0
  33. package/dist/components/avatar/index.d.ts +1 -21
  34. package/dist/components/avatar/index.js +2 -159
  35. package/dist/components/badge/badge.d.ts +20 -0
  36. package/dist/components/badge/badge.js +42 -0
  37. package/dist/components/badge/index.d.ts +1 -16
  38. package/dist/components/badge/index.js +2 -40
  39. package/dist/components/button/button.d.ts +27 -0
  40. package/dist/components/button/button.js +47 -0
  41. package/dist/components/button/index.d.ts +1 -24
  42. package/dist/components/button/index.js +2 -45
  43. package/dist/components/checkbox/checkbox.d.ts +13 -0
  44. package/dist/components/checkbox/checkbox.js +269 -0
  45. package/dist/components/checkbox/index.d.ts +1 -9
  46. package/dist/components/checkbox/index.js +2 -267
  47. package/dist/components/code/code.d.ts +13 -0
  48. package/dist/components/code/code.js +1206 -0
  49. package/dist/components/code/index.d.ts +1 -9
  50. package/dist/components/code/index.js +2 -1204
  51. package/dist/components/collapse/collapse.d.ts +14 -0
  52. package/dist/components/collapse/collapse.js +35 -0
  53. package/dist/components/collapse/index.d.ts +1 -11
  54. package/dist/components/collapse/index.js +2 -33
  55. package/dist/components/command/command.d.ts +36 -0
  56. package/dist/components/command/command.js +1695 -0
  57. package/dist/components/command/index.d.ts +1 -15
  58. package/dist/components/command/index.js +2 -1693
  59. package/dist/components/context-menu/context-menu.d.ts +82 -0
  60. package/dist/components/context-menu/context-menu.js +1445 -0
  61. package/dist/components/context-menu/index.d.ts +1 -42
  62. package/dist/components/context-menu/index.js +2 -1442
  63. package/dist/components/dialog/dialog.d.ts +22 -0
  64. package/dist/components/dialog/dialog.js +140 -0
  65. package/dist/components/dialog/dialog.types.d.ts +38 -0
  66. package/dist/components/dialog/index.d.ts +1 -48
  67. package/dist/components/dialog/index.js +2 -136
  68. package/dist/components/heading/heading.d.ts +25 -0
  69. package/dist/components/heading/heading.js +36 -0
  70. package/dist/components/heading/index.d.ts +1 -44
  71. package/dist/components/heading/index.js +2 -49
  72. package/dist/components/icon/icon.d.ts +28 -0
  73. package/dist/components/icon/icon.js +43 -0
  74. package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
  75. package/dist/components/icon/icon.types.js +1 -0
  76. package/dist/components/icon/index.d.ts +2 -24
  77. package/dist/components/icon/index.js +2 -41
  78. package/dist/components/icon-button/icon-button.d.ts +16 -0
  79. package/dist/components/icon-button/icon-button.js +46 -0
  80. package/dist/components/icon-button/index.d.ts +1 -12
  81. package/dist/components/icon-button/index.js +2 -44
  82. package/dist/components/inline-code/index.d.ts +1 -6
  83. package/dist/components/inline-code/index.js +2 -20
  84. package/dist/components/inline-code/inline-code.d.ts +10 -0
  85. package/dist/components/inline-code/inline-code.js +25 -0
  86. package/dist/components/input/index.d.ts +1 -3
  87. package/dist/components/input/index.js +2 -117
  88. package/dist/components/input/input.d.ts +9 -0
  89. package/dist/components/input/input.js +126 -0
  90. package/dist/components/meter/index.d.ts +1 -18
  91. package/dist/components/meter/index.js +2 -163
  92. package/dist/components/meter/meter.d.ts +22 -0
  93. package/dist/components/meter/meter.js +165 -0
  94. package/dist/components/multiline-input/index.d.ts +1 -6
  95. package/dist/components/multiline-input/index.js +2 -98
  96. package/dist/components/multiline-input/multiline-input.d.ts +10 -0
  97. package/dist/components/multiline-input/multiline-input.js +100 -0
  98. package/dist/components/number-input/index.d.ts +1 -10
  99. package/dist/components/number-input/index.js +2 -1167
  100. package/dist/components/number-input/number-input.d.ts +14 -0
  101. package/dist/components/number-input/number-input.js +1169 -0
  102. package/dist/components/password-input/index.d.ts +1 -2
  103. package/dist/components/password-input/index.js +2 -27
  104. package/dist/components/password-input/password-input.d.ts +7 -0
  105. package/dist/components/password-input/password-input.js +29 -0
  106. package/dist/components/pill/index.d.ts +1 -13
  107. package/dist/components/pill/index.js +2 -36
  108. package/dist/components/pill/pill.d.ts +17 -0
  109. package/dist/components/pill/pill.js +38 -0
  110. package/dist/components/popover/index.d.ts +1 -21
  111. package/dist/components/popover/index.js +2 -634
  112. package/dist/components/popover/popover.d.ts +22 -0
  113. package/dist/components/popover/popover.js +634 -0
  114. package/dist/components/preview-card/index.d.ts +1 -17
  115. package/dist/components/preview-card/index.js +2 -400
  116. package/dist/components/preview-card/preview-card.d.ts +21 -0
  117. package/dist/components/preview-card/preview-card.js +402 -0
  118. package/dist/components/radio-group/index.d.ts +1 -0
  119. package/dist/components/radio-group/index.js +5 -0
  120. package/dist/components/radio-group/radio-group.d.ts +25 -0
  121. package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
  122. package/dist/components/search-bar/index.d.ts +1 -12
  123. package/dist/components/search-bar/index.js +2 -46
  124. package/dist/components/search-bar/search-bar.d.ts +16 -0
  125. package/dist/components/search-bar/search-bar.js +43 -0
  126. package/dist/components/select/index.d.ts +1 -16
  127. package/dist/components/select/index.js +2 -1261
  128. package/dist/components/select/select.d.ts +22 -0
  129. package/dist/components/select/select.js +1263 -0
  130. package/dist/components/separator/index.d.ts +1 -7
  131. package/dist/components/separator/index.js +2 -4
  132. package/dist/components/separator/separator.d.ts +10 -0
  133. package/dist/components/separator/separator.js +6 -0
  134. package/dist/components/slider/index.d.ts +1 -5
  135. package/dist/components/slider/index.js +2 -900
  136. package/dist/components/slider/slider.d.ts +10 -0
  137. package/dist/components/slider/slider.js +899 -0
  138. package/dist/components/spinner/index.d.ts +1 -2
  139. package/dist/components/spinner/index.js +2 -11
  140. package/dist/components/spinner/spinner.d.ts +7 -0
  141. package/dist/components/spinner/spinner.js +13 -0
  142. package/dist/components/stacked-avatars/index.d.ts +1 -14
  143. package/dist/components/stacked-avatars/index.js +2 -90
  144. package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
  145. package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
  146. package/dist/components/status-banner/index.d.ts +1 -17
  147. package/dist/components/status-banner/index.js +2 -69
  148. package/dist/components/status-banner/status-banner.d.ts +22 -0
  149. package/dist/components/status-banner/status-banner.js +71 -0
  150. package/dist/components/surface/index.d.ts +2 -27
  151. package/dist/components/surface/index.js +2 -39
  152. package/dist/components/surface/surface.d.ts +26 -0
  153. package/dist/components/surface/surface.js +36 -0
  154. package/dist/components/surface/surface.types.d.ts +1 -0
  155. package/dist/components/surface/surface.types.js +1 -0
  156. package/dist/components/switch/index.d.ts +1 -5
  157. package/dist/components/switch/index.js +2 -194
  158. package/dist/components/switch/switch.d.ts +10 -0
  159. package/dist/components/switch/switch.js +193 -0
  160. package/dist/components/tabs/index.d.ts +1 -18
  161. package/dist/components/tabs/index.js +2 -507
  162. package/dist/components/tabs/tabs.d.ts +28 -0
  163. package/dist/components/tabs/tabs.js +511 -0
  164. package/dist/components/text/index.d.ts +1 -26
  165. package/dist/components/text/index.js +2 -46
  166. package/dist/components/text/text.d.ts +29 -0
  167. package/dist/components/text/text.js +48 -0
  168. package/dist/components/theme-provider/index.d.ts +1 -1
  169. package/dist/components/theme-provider/theme-provider.d.ts +8 -4
  170. package/dist/components/theme-provider/theme-provider.js +3 -3
  171. package/dist/components/timestamp/index.d.ts +1 -23
  172. package/dist/components/timestamp/index.js +2 -1390
  173. package/dist/components/timestamp/timestamp.d.ts +26 -0
  174. package/dist/components/timestamp/timestamp.js +1391 -0
  175. package/dist/components/toaster/index.d.ts +2 -0
  176. package/dist/components/toaster/index.js +7 -0
  177. package/dist/components/toaster/toaster.d.ts +7 -0
  178. package/dist/components/toaster/toaster.js +923 -0
  179. package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
  180. package/dist/components/tooltip/index.d.ts +1 -14
  181. package/dist/components/tooltip/index.js +2 -710
  182. package/dist/components/tooltip/tooltip.d.ts +24 -0
  183. package/dist/components/tooltip/tooltip.js +9 -0
  184. package/dist/components/view/index.d.ts +2 -30
  185. package/dist/components/view/index.js +2 -79
  186. package/dist/components/view/view.d.ts +31 -0
  187. package/dist/components/view/view.js +83 -0
  188. package/dist/components/view/view.types.d.ts +5 -0
  189. package/dist/components/view/view.types.js +1 -0
  190. package/dist/components/visually-hidden/index.d.ts +5 -1
  191. package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
  192. package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
  193. package/dist/context-menu.css +1 -0
  194. package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
  195. package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
  196. package/dist/dialog.css +1 -1
  197. package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
  198. package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
  199. package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
  200. package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
  201. package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
  202. package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
  203. package/dist/heading.css +1 -0
  204. package/dist/icon-button.css +1 -0
  205. package/dist/icon.css +1 -0
  206. package/dist/index.d.ts +10 -10
  207. package/dist/index.js +86 -104
  208. package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
  209. package/dist/inline-code.css +1 -0
  210. package/dist/input.css +1 -1
  211. package/dist/input.module-CtE19OH8.js +8 -0
  212. package/dist/integrations/react-markdown/index.js +12 -12
  213. package/dist/meter.css +1 -0
  214. package/dist/number-input.css +1 -0
  215. package/dist/password-input.css +1 -0
  216. package/dist/pill.css +1 -0
  217. package/dist/popover.css +1 -0
  218. package/dist/preview-card.css +1 -0
  219. package/dist/radio-group.css +1 -0
  220. package/dist/safePolygon-DnkzOIur.js +558 -0
  221. package/dist/search-bar.css +1 -0
  222. package/dist/select.css +1 -0
  223. package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
  224. package/dist/separator.css +1 -0
  225. package/dist/slider.css +1 -0
  226. package/dist/spinner.css +1 -0
  227. package/dist/stacked-avatars.css +1 -0
  228. package/dist/status-banner.css +1 -0
  229. package/dist/styles/core.css +1 -1
  230. package/dist/surface.css +1 -0
  231. package/dist/switch.css +1 -0
  232. package/dist/tabs.css +1 -0
  233. package/dist/text.css +1 -0
  234. package/dist/timestamp.css +1 -0
  235. package/dist/toaster.css +1 -0
  236. package/dist/tooltip-oCp-elli.js +765 -0
  237. package/dist/tooltip.css +1 -0
  238. package/dist/transitions.css +1 -1
  239. package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
  240. package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
  241. package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
  242. package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
  243. package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
  244. package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
  245. package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
  246. package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
  247. package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
  248. package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
  249. package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
  250. package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
  251. package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
  252. package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
  253. package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
  254. package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
  255. package/dist/view.css +1 -1
  256. package/dist/view.module-Dj7wj0kk.js +6 -0
  257. package/dist/view2.css +1 -0
  258. package/package.json +16 -19
  259. package/dist/components/radio/index.d.ts +0 -13
  260. package/dist/components/toast/index.d.ts +0 -2
  261. package/dist/components/toast/index.js +0 -8
  262. package/dist/components/toast/toast.d.ts +0 -2
  263. package/dist/components/toast/toast.js +0 -921
  264. package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
  265. package/dist/components/tooltip/tooltip-arrow.js +0 -6
  266. package/dist/index10.css +0 -1
  267. package/dist/index11.css +0 -1
  268. package/dist/index12.css +0 -1
  269. package/dist/index13.css +0 -1
  270. package/dist/index14.css +0 -1
  271. package/dist/index15.css +0 -1
  272. package/dist/index16.css +0 -1
  273. package/dist/index17.css +0 -1
  274. package/dist/index18.css +0 -1
  275. package/dist/index19.css +0 -1
  276. package/dist/index20.css +0 -1
  277. package/dist/index21.css +0 -1
  278. package/dist/index22.css +0 -1
  279. package/dist/index23.css +0 -1
  280. package/dist/index24.css +0 -1
  281. package/dist/index25.css +0 -1
  282. package/dist/index26.css +0 -1
  283. package/dist/index27.css +0 -1
  284. package/dist/index28.css +0 -1
  285. package/dist/index29.css +0 -1
  286. package/dist/index3.css +0 -1
  287. package/dist/index30.css +0 -1
  288. package/dist/index31.css +0 -1
  289. package/dist/index32.css +0 -1
  290. package/dist/index33.css +0 -1
  291. package/dist/index34.css +0 -1
  292. package/dist/index35.css +0 -1
  293. package/dist/index36.css +0 -1
  294. package/dist/index37.css +0 -1
  295. package/dist/index4.css +0 -1
  296. package/dist/index5.css +0 -1
  297. package/dist/index6.css +0 -1
  298. package/dist/index7.css +0 -1
  299. package/dist/index8.css +0 -1
  300. package/dist/index9.css +0 -1
  301. package/dist/input.module-DDQY_Ij6.js +0 -7
  302. package/dist/safePolygon-DWy1dGKJ.js +0 -308
  303. package/dist/toast.css +0 -1
  304. package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
  305. package/dist/tooltip-arrow.css +0 -1
  306. package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
  307. package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
  308. package/dist/view.module-DfDLgJE0.js +0 -6
  309. /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
  310. /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
@@ -1,1445 +1,5 @@
1
1
  "use client";
2
- import { jsx as c, jsxs as ee } from "react/jsx-runtime";
3
- import { c as de } from "../../clsx-OuTLNxxd.js";
4
- import * as t from "react";
5
- import { createContext as Kt, useContext as Wt } from "react";
6
- import { textify as Ce } from "../../-utils.js";
7
- import { tokens as st } from "../../styles/tokens.js";
8
- import { Icon as ce } from "../icon/index.js";
9
- import { S as Xt, a as jt } from "../../index-DVjyPAD4.js";
10
- import { Surface as it } from "../surface/index.js";
11
- import { Text as at } from "../text/index.js";
12
- import { View as Re } from "../view/index.js";
13
- import { p as ut, k as qt, R as $t, P as Jt, c as U, m as Qt, j as Zt, u as en, d as tn, e as ct, h as nn, f as on, i as rn, t as lt } from "../../transitions.module-CWX8e5cx.js";
14
- import { u as dt } from "../../useControlled-Du4sJyMj.js";
15
- import { u as le } from "../../useStableCallback-CkTrVkNX.js";
16
- import { f as J } from "../../formatErrorMessage-BqPuTBN-.js";
17
- import { m as Se, c as sn, u as Y, a as an, E as un, b as cn } from "../../useRenderElement-DwToLA61.js";
18
- import { u as pt } from "../../useId-C5kyn6tA.js";
19
- import * as ln from "react-dom";
20
- import { u as Me } from "../../useTimeout-CflX-kz3.js";
21
- import { u as Te } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
22
- import { u as dn } from "../../useAnimationFrame-451ugS_6.js";
23
- import { F as pn, I as fn, u as mn, a as gn, b as hn } from "../../InternalBackdrop-jYAiOJ8v.js";
24
- import { h as xn, m as Mn, P as Cn, T as Rn } from "../../FloatingPortal-tWyuKRSN.js";
25
- import { u as bn } from "../../DirectionContext-C2o_MF_i.js";
26
- import { x as be, c as $, o as vn, t as xe, y as ue, b as et, a as ft, f as En, l as In, e as yn, i as Nn, v as Pn } from "../../createBaseUIEventDetails-D8M2Yl-a.js";
27
- import { p as Sn, c as Tn, u as On, a as kn, b as _n, e as wn } from "../../useSyncedFloatingRootContext-Dorsv-jf.js";
28
- import { u as Dn } from "../../useRole-oDBdbuwQ.js";
29
- import { u as Vn, a as An } from "../../useTypeahead-D85V2IUx.js";
30
- import { o as tt } from "../../owner-rKN292Q9.js";
31
- import { i as Un, o as Ln, n as Fn } from "../../floating-ui.utils.dom-C7FS5id0.js";
32
- import { e as nt, f as he } from "../../element-CZEOj04G.js";
33
- import { s as Bn } from "../../event-CKoGyQEJ.js";
34
- import { i as Gn } from "../../inertValue-BCYGsdmf.js";
35
- import { g as Hn, a as Yn } from "../../getDisabledMountTransitionStyles-YfHPge6T.js";
36
- import { u as ve, C as zn } from "../../useCompositeListItem-OkcAim_1.js";
37
- import { t as mt, a as Oe } from "../../useOpenChangeComplete-Dse9kY9E.js";
38
- import { u as Kn } from "../../ToolbarRootContext-CvvL0Tk1.js";
39
- import { C as Wn } from "../../composite-C9L5QmZL.js";
40
- import { a as Xn, u as jn } from "../../useHoverReferenceInteraction-SfOBPoXM.js";
41
- import { u as gt } from "../../useTransitionStatus-CUfcuGAV.js";
42
- import { u as qn } from "../../useButton-DfIwsdb8.js";
43
- import { u as pe } from "../../useBaseUiId-B7WyxtIE.js";
44
- import { s as $n } from "../../safePolygon-DWy1dGKJ.js";
45
- import '../../index35.css';const ke = /* @__PURE__ */ t.createContext(void 0);
46
- process.env.NODE_ENV !== "production" && (ke.displayName = "ContextMenuRootContext");
47
- function Ee(e = !0) {
48
- const o = t.useContext(ke);
49
- if (o === void 0 && !e)
50
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>." : J(25));
51
- return o;
52
- }
53
- const _e = /* @__PURE__ */ t.createContext(void 0);
54
- process.env.NODE_ENV !== "production" && (_e.displayName = "MenuPositionerContext");
55
- function fe(e) {
56
- const o = t.useContext(_e);
57
- if (o === void 0 && !e)
58
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>." : J(33));
59
- return o;
60
- }
61
- const Ie = /* @__PURE__ */ t.createContext(void 0);
62
- process.env.NODE_ENV !== "production" && (Ie.displayName = "MenuRootContext");
63
- function q(e) {
64
- const o = t.useContext(Ie);
65
- if (o === void 0 && !e)
66
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>." : J(36));
67
- return o;
68
- }
69
- const we = /* @__PURE__ */ t.createContext(void 0);
70
- process.env.NODE_ENV !== "production" && (we.displayName = "MenuCheckboxItemContext");
71
- function Jn() {
72
- const e = t.useContext(we);
73
- if (e === void 0)
74
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>." : J(30));
75
- return e;
76
- }
77
- const De = {
78
- type: "regular-item"
79
- };
80
- function ye(e) {
81
- const {
82
- closeOnClick: o,
83
- disabled: i = !1,
84
- highlighted: C,
85
- id: E,
86
- store: d,
87
- nativeButton: R,
88
- itemMetadata: r,
89
- nodeId: a
90
- } = e, f = t.useRef(null), g = Ee(!0), b = g !== void 0, {
91
- events: I
92
- } = d.useState("floatingTreeRoot"), {
93
- getButtonProps: P,
94
- buttonRef: k
95
- } = qn({
96
- disabled: i,
97
- focusableWhenDisabled: !0,
98
- native: R
99
- }), l = t.useCallback((u) => Se({
100
- id: E,
101
- role: "menuitem",
102
- tabIndex: C ? 0 : -1,
103
- onMouseMove(s) {
104
- a && I.emit("itemhover", {
105
- nodeId: a,
106
- target: s.currentTarget
107
- });
108
- },
109
- onMouseEnter() {
110
- r.type === "submenu-trigger" && r.setActive();
111
- },
112
- onKeyUp(s) {
113
- s.key === " " && d.context.typingRef.current && s.preventBaseUIHandler();
114
- },
115
- onClick(s) {
116
- o && I.emit("close", {
117
- domEvent: s,
118
- reason: be
119
- });
120
- },
121
- onMouseUp(s) {
122
- if (g) {
123
- const _ = g.initialCursorPointRef.current;
124
- if (g.initialCursorPointRef.current = null, b && _ && Math.abs(s.clientX - _.x) <= 1 && Math.abs(s.clientY - _.y) <= 1)
125
- return;
126
- }
127
- f.current && d.context.allowMouseUpTriggerRef.current && (!b || s.button === 2) && r.type === "regular-item" && f.current.click();
128
- }
129
- }, u, P), [E, C, P, o, I, d, b, g, r, a]), h = sn(f, k);
130
- return t.useMemo(() => ({
131
- getItemProps: l,
132
- itemRef: h
133
- }), [l, h]);
134
- }
135
- let ot = /* @__PURE__ */ (function(e) {
136
- return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.highlighted = "data-highlighted", e;
137
- })({});
138
- const Ne = {
139
- checked(e) {
140
- return e ? {
141
- [ot.checked]: ""
142
- } : {
143
- [ot.unchecked]: ""
144
- };
145
- },
146
- ...mt
147
- }, ht = /* @__PURE__ */ t.forwardRef(function(o, i) {
148
- const {
149
- render: C,
150
- className: E,
151
- id: d,
152
- label: R,
153
- nativeButton: r = !1,
154
- disabled: a = !1,
155
- closeOnClick: f = !1,
156
- checked: g,
157
- defaultChecked: b,
158
- onCheckedChange: I,
159
- ...P
160
- } = o, k = ve({
161
- label: R
162
- }), l = fe(!0), h = pe(d), {
163
- store: u
164
- } = q(), s = u.useState("isActive", k.index), _ = u.useState("itemProps"), [O, n] = dt({
165
- controlled: g,
166
- default: b ?? !1,
167
- name: "MenuCheckboxItem",
168
- state: "checked"
169
- }), {
170
- getItemProps: A,
171
- itemRef: y
172
- } = ye({
173
- closeOnClick: f,
174
- disabled: a,
175
- highlighted: s,
176
- id: h,
177
- store: u,
178
- nativeButton: r,
179
- nodeId: l?.nodeId,
180
- itemMetadata: De
181
- }), D = t.useMemo(() => ({
182
- disabled: a,
183
- highlighted: s,
184
- checked: O
185
- }), [a, s, O]), p = le((w) => {
186
- const x = {
187
- ...$(be, w.nativeEvent),
188
- preventUnmountOnClose: () => {
189
- }
190
- };
191
- I?.(!O, x), !x.isCanceled && n((m) => !m);
192
- }), B = Y("div", o, {
193
- state: D,
194
- stateAttributesMapping: Ne,
195
- props: [_, {
196
- role: "menuitemcheckbox",
197
- "aria-checked": O,
198
- onClick: p
199
- }, P, A],
200
- ref: [y, i, k.ref]
201
- });
202
- return /* @__PURE__ */ c(we.Provider, {
203
- value: D,
204
- children: B
205
- });
206
- });
207
- process.env.NODE_ENV !== "production" && (ht.displayName = "MenuCheckboxItem");
208
- const xt = /* @__PURE__ */ t.forwardRef(function(o, i) {
209
- const {
210
- render: C,
211
- className: E,
212
- keepMounted: d = !1,
213
- ...R
214
- } = o, r = Jn(), a = t.useRef(null), {
215
- transitionStatus: f,
216
- setMounted: g
217
- } = gt(r.checked);
218
- Oe({
219
- open: r.checked,
220
- ref: a,
221
- onComplete() {
222
- r.checked || g(!1);
223
- }
224
- });
225
- const b = t.useMemo(() => ({
226
- checked: r.checked,
227
- disabled: r.disabled,
228
- highlighted: r.highlighted,
229
- transitionStatus: f
230
- }), [r.checked, r.disabled, r.highlighted, f]);
231
- return Y("span", o, {
232
- state: b,
233
- ref: [i, a],
234
- stateAttributesMapping: Ne,
235
- props: {
236
- "aria-hidden": !0,
237
- ...R
238
- },
239
- enabled: d || r.checked
240
- });
241
- });
242
- process.env.NODE_ENV !== "production" && (xt.displayName = "MenuCheckboxItemIndicator");
243
- const Ve = /* @__PURE__ */ t.createContext(void 0);
244
- process.env.NODE_ENV !== "production" && (Ve.displayName = "MenuGroupContext");
245
- function Qn() {
246
- const e = t.useContext(Ve);
247
- if (e === void 0)
248
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuGroupRootContext is missing. Menu group parts must be used within <Menu.Group>." : J(31));
249
- return e;
250
- }
251
- const Mt = /* @__PURE__ */ t.forwardRef(function(o, i) {
252
- const {
253
- render: C,
254
- className: E,
255
- ...d
256
- } = o, [R, r] = t.useState(void 0), a = t.useMemo(() => ({
257
- setLabelId: r
258
- }), [r]), f = Y("div", o, {
259
- ref: i,
260
- props: {
261
- role: "group",
262
- "aria-labelledby": R,
263
- ...d
264
- }
265
- });
266
- return /* @__PURE__ */ c(Ve.Provider, {
267
- value: a,
268
- children: f
269
- });
270
- });
271
- process.env.NODE_ENV !== "production" && (Mt.displayName = "MenuGroup");
272
- const Ct = /* @__PURE__ */ t.forwardRef(function(o, i) {
273
- const {
274
- className: C,
275
- render: E,
276
- id: d,
277
- ...R
278
- } = o, r = pe(d), {
279
- setLabelId: a
280
- } = Qn();
281
- return Te(() => (a(r), () => {
282
- a(void 0);
283
- }), [a, r]), Y("div", o, {
284
- ref: i,
285
- props: {
286
- id: r,
287
- role: "presentation",
288
- ...R
289
- }
290
- });
291
- });
292
- process.env.NODE_ENV !== "production" && (Ct.displayName = "MenuGroupLabel");
293
- const Rt = /* @__PURE__ */ t.forwardRef(function(o, i) {
294
- const {
295
- render: C,
296
- className: E,
297
- id: d,
298
- label: R,
299
- nativeButton: r = !1,
300
- disabled: a = !1,
301
- closeOnClick: f = !0,
302
- ...g
303
- } = o, b = ve({
304
- label: R
305
- }), I = fe(!0), P = pe(d), {
306
- store: k
307
- } = q(), l = k.useState("isActive", b.index), h = k.useState("itemProps"), {
308
- getItemProps: u,
309
- itemRef: s
310
- } = ye({
311
- closeOnClick: f,
312
- disabled: a,
313
- highlighted: l,
314
- id: P,
315
- store: k,
316
- nativeButton: r,
317
- nodeId: I?.nodeId,
318
- itemMetadata: De
319
- }), _ = t.useMemo(() => ({
320
- disabled: a,
321
- highlighted: l
322
- }), [a, l]);
323
- return Y("div", o, {
324
- state: _,
325
- props: [h, g, u],
326
- ref: [s, i, b.ref]
327
- });
328
- });
329
- process.env.NODE_ENV !== "production" && (Rt.displayName = "MenuItem");
330
- const Zn = {
331
- ...ut,
332
- ...mt
333
- }, Ae = /* @__PURE__ */ t.forwardRef(function(o, i) {
334
- const {
335
- render: C,
336
- className: E,
337
- finalFocus: d,
338
- ...R
339
- } = o, {
340
- store: r
341
- } = q(), {
342
- side: a,
343
- align: f
344
- } = fe(), g = Kn() != null, b = r.useState("open"), I = r.useState("transitionStatus"), P = r.useState("popupProps"), k = r.useState("mounted"), l = r.useState("instantType"), h = r.useState("activeTriggerElement"), u = r.useState("parent"), s = r.useState("lastOpenChangeReason"), _ = r.useState("rootId"), O = r.useState("floatingRootContext"), n = r.useState("floatingTreeRoot"), A = r.useState("closeDelay"), y = r.useState("activeTriggerElement");
345
- Oe({
346
- open: b,
347
- ref: r.context.popupRef,
348
- onComplete() {
349
- b && r.context.onOpenChangeComplete?.(!0);
350
- }
351
- }), t.useEffect(() => {
352
- function m(N) {
353
- r.setOpen(!1, $(N.reason, N.domEvent));
354
- }
355
- return n.events.on("close", m), () => {
356
- n.events.off("close", m);
357
- };
358
- }, [n.events, r]);
359
- const D = r.useState("hoverEnabled"), p = r.useState("disabled");
360
- Xn(O, {
361
- enabled: D && !p && u.type !== "context-menu" && u.type !== "menubar",
362
- closeDelay: A
363
- });
364
- const B = t.useMemo(() => ({
365
- transitionStatus: I,
366
- side: a,
367
- align: f,
368
- open: b,
369
- nested: u.type === "menu",
370
- instant: l
371
- }), [I, a, f, b, u.type, l]), w = Y("div", o, {
372
- state: B,
373
- ref: [i, r.context.popupRef],
374
- stateAttributesMapping: Zn,
375
- props: [P, {
376
- onKeyDown(m) {
377
- g && Wn.has(m.key) && m.stopPropagation();
378
- }
379
- }, Hn(I), R, {
380
- "data-rootownerid": _
381
- }]
382
- });
383
- let x = u.type === void 0 || u.type === "context-menu";
384
- return (h || u.type === "menubar" && s !== vn) && (x = !0), /* @__PURE__ */ c(pn, {
385
- context: O,
386
- modal: !1,
387
- disabled: !k,
388
- returnFocus: d === void 0 ? x : d,
389
- initialFocus: u.type !== "menu",
390
- restoreFocus: !0,
391
- externalTree: u.type !== "menubar" ? n : void 0,
392
- previousFocusableElement: y,
393
- nextFocusableElement: u.type === void 0 ? r.context.triggerFocusTargetRef : void 0,
394
- beforeContentFocusGuardRef: u.type === void 0 ? r.context.beforeContentFocusGuardRef : void 0,
395
- children: w
396
- });
397
- });
398
- process.env.NODE_ENV !== "production" && (Ae.displayName = "MenuPopup");
399
- const Ue = /* @__PURE__ */ t.createContext(void 0);
400
- process.env.NODE_ENV !== "production" && (Ue.displayName = "MenuPortalContext");
401
- function eo() {
402
- const e = t.useContext(Ue);
403
- if (e === void 0)
404
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.Portal> is missing." : J(32));
405
- return e;
406
- }
407
- const Le = /* @__PURE__ */ t.forwardRef(function(o, i) {
408
- const {
409
- keepMounted: C = !1,
410
- ...E
411
- } = o, {
412
- store: d
413
- } = q();
414
- return d.useState("mounted") || C ? /* @__PURE__ */ c(Ue.Provider, {
415
- value: C,
416
- children: /* @__PURE__ */ c(xn, {
417
- ref: i,
418
- ...E
419
- })
420
- }) : null;
421
- });
422
- process.env.NODE_ENV !== "production" && (Le.displayName = "MenuPortal");
423
- const Fe = /* @__PURE__ */ t.forwardRef(function(o, i) {
424
- const {
425
- anchor: C,
426
- positionMethod: E = "absolute",
427
- className: d,
428
- render: R,
429
- side: r,
430
- align: a,
431
- sideOffset: f = 0,
432
- alignOffset: g = 0,
433
- collisionBoundary: b = "clipping-ancestors",
434
- collisionPadding: I = 5,
435
- arrowPadding: P = 5,
436
- sticky: k = !1,
437
- disableAnchorTracking: l = !1,
438
- collisionAvoidance: h = Mn,
439
- ...u
440
- } = o, {
441
- store: s
442
- } = q(), _ = eo(), O = Ee(!0), n = s.useState("parent"), A = s.useState("floatingRootContext"), y = s.useState("floatingTreeRoot"), D = s.useState("mounted"), p = s.useState("open"), B = s.useState("modal"), w = s.useState("activeTriggerElement"), x = s.useState("lastOpenChangeReason"), m = s.useState("floatingNodeId"), N = s.useState("floatingParentNodeId");
443
- let L = C, v = f, X = g, Q = a, ne = h;
444
- n.type === "context-menu" && (L = C ?? n.context?.anchor, Q = Q ?? "start", !r && Q !== "center" && (X = o.alignOffset ?? 2, v = o.sideOffset ?? -5));
445
- let z = r, K = Q;
446
- n.type === "menu" ? (z = z ?? "inline-end", K = K ?? "start", ne = o.collisionAvoidance ?? Cn) : n.type === "menubar" && (z = z ?? "bottom", K = K ?? "start");
447
- const W = n.type === "context-menu", T = Yn({
448
- anchor: L,
449
- floatingRootContext: A,
450
- positionMethod: O ? "fixed" : E,
451
- mounted: D,
452
- side: z,
453
- sideOffset: v,
454
- align: K,
455
- alignOffset: X,
456
- arrowPadding: W ? 0 : P,
457
- collisionBoundary: b,
458
- collisionPadding: I,
459
- sticky: k,
460
- nodeId: m,
461
- keepMounted: _,
462
- disableAnchorTracking: l,
463
- collisionAvoidance: ne,
464
- shiftCrossAxis: W,
465
- externalTree: y
466
- }), te = t.useMemo(() => {
467
- const F = {};
468
- return p || (F.pointerEvents = "none"), {
469
- role: "presentation",
470
- hidden: !D,
471
- style: {
472
- ...T.positionerStyles,
473
- ...F
474
- }
475
- };
476
- }, [p, D, T.positionerStyles]);
477
- t.useEffect(() => {
478
- function F(V) {
479
- V.open ? (V.parentNodeId === m && s.set("hoverEnabled", !1), V.nodeId !== m && V.parentNodeId === s.select("floatingParentNodeId") && s.setOpen(!1, $(ue))) : V.parentNodeId === m && V.reason !== ue && s.set("hoverEnabled", !0);
480
- }
481
- return y.events.on("menuopenchange", F), () => {
482
- y.events.off("menuopenchange", F);
483
- };
484
- }, [s, y.events, m]), t.useEffect(() => {
485
- if (s.select("floatingParentNodeId") == null)
486
- return;
487
- function F(V) {
488
- if (V.open || V.nodeId !== s.select("floatingParentNodeId"))
489
- return;
490
- const me = V.reason ?? ue;
491
- s.setOpen(!1, $(me));
492
- }
493
- return y.events.on("menuopenchange", F), () => {
494
- y.events.off("menuopenchange", F);
495
- };
496
- }, [y.events, s]), t.useEffect(() => {
497
- function F(V) {
498
- !p || V.nodeId !== s.select("floatingParentNodeId") || V.target && w && w !== V.target && s.setOpen(!1, $(ue));
499
- }
500
- return y.events.on("itemhover", F), () => {
501
- y.events.off("itemhover", F);
502
- };
503
- }, [y.events, p, w, s]), t.useEffect(() => {
504
- const F = {
505
- open: p,
506
- nodeId: m,
507
- parentNodeId: N,
508
- reason: s.select("lastOpenChangeReason")
509
- };
510
- y.events.emit("menuopenchange", F);
511
- }, [y.events, p, s, m, N]);
512
- const j = t.useMemo(() => ({
513
- open: p,
514
- side: T.side,
515
- align: T.align,
516
- anchorHidden: T.anchorHidden,
517
- nested: n.type === "menu"
518
- }), [p, T.side, T.align, T.anchorHidden, n.type]), oe = t.useMemo(() => ({
519
- side: T.side,
520
- align: T.align,
521
- arrowRef: T.arrowRef,
522
- arrowUncentered: T.arrowUncentered,
523
- arrowStyles: T.arrowStyles,
524
- nodeId: T.context.nodeId
525
- }), [T.side, T.align, T.arrowRef, T.arrowUncentered, T.arrowStyles, T.context.nodeId]), se = Y("div", o, {
526
- state: j,
527
- stateAttributesMapping: ut,
528
- ref: [i, s.useStateSetter("positionerElement")],
529
- props: [te, u]
530
- }), ie = D && n.type !== "menu" && (n.type !== "menubar" && B && x !== xe || n.type === "menubar" && n.context.modal);
531
- let Z = null;
532
- return n.type === "menubar" ? Z = n.context.contentElement : n.type === void 0 && (Z = w), /* @__PURE__ */ ee(_e.Provider, {
533
- value: oe,
534
- children: [ie && /* @__PURE__ */ c(fn, {
535
- ref: n.type === "context-menu" || n.type === "nested-context-menu" ? n.context.internalBackdropRef : null,
536
- inert: Gn(!p),
537
- cutout: Z
538
- }), /* @__PURE__ */ c(qt, {
539
- id: m,
540
- children: /* @__PURE__ */ c(zn, {
541
- elementsRef: s.context.itemDomElements,
542
- labelsRef: s.context.itemLabels,
543
- children: se
544
- })
545
- })]
546
- });
547
- });
548
- process.env.NODE_ENV !== "production" && (Fe.displayName = "MenuPositioner");
549
- const Be = /* @__PURE__ */ t.createContext(void 0);
550
- process.env.NODE_ENV !== "production" && (Be.displayName = "MenuRadioGroupContext");
551
- function to() {
552
- const e = t.useContext(Be);
553
- if (e === void 0)
554
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>." : J(34));
555
- return e;
556
- }
557
- const bt = /* @__PURE__ */ t.memo(/* @__PURE__ */ t.forwardRef(function(o, i) {
558
- const {
559
- render: C,
560
- className: E,
561
- value: d,
562
- defaultValue: R,
563
- onValueChange: r,
564
- disabled: a = !1,
565
- ...f
566
- } = o, [g, b] = dt({
567
- controlled: d,
568
- default: R,
569
- name: "MenuRadioGroup"
570
- }), I = le(r), P = le((u, s) => {
571
- I?.(u, s), !s.isCanceled && b(u);
572
- }), k = t.useMemo(() => ({
573
- disabled: a
574
- }), [a]), l = Y("div", o, {
575
- state: k,
576
- ref: i,
577
- props: {
578
- role: "group",
579
- "aria-disabled": a || void 0,
580
- ...f
581
- }
582
- }), h = t.useMemo(() => ({
583
- value: g,
584
- setValue: P,
585
- disabled: a
586
- }), [g, P, a]);
587
- return /* @__PURE__ */ c(Be.Provider, {
588
- value: h,
589
- children: l
590
- });
591
- }));
592
- process.env.NODE_ENV !== "production" && (bt.displayName = "MenuRadioGroup");
593
- const Ge = /* @__PURE__ */ t.createContext(void 0);
594
- process.env.NODE_ENV !== "production" && (Ge.displayName = "MenuRadioItemContext");
595
- function no() {
596
- const e = t.useContext(Ge);
597
- if (e === void 0)
598
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>." : J(35));
599
- return e;
600
- }
601
- const vt = /* @__PURE__ */ t.forwardRef(function(o, i) {
602
- const {
603
- render: C,
604
- className: E,
605
- id: d,
606
- label: R,
607
- nativeButton: r = !1,
608
- disabled: a = !1,
609
- closeOnClick: f = !1,
610
- value: g,
611
- ...b
612
- } = o, I = ve({
613
- label: R
614
- }), P = fe(!0), k = pe(d), {
615
- store: l
616
- } = q(), h = l.useState("isActive", I.index), u = l.useState("itemProps"), {
617
- value: s,
618
- setValue: _,
619
- disabled: O
620
- } = to(), n = O || a, A = s === g, {
621
- getItemProps: y,
622
- itemRef: D
623
- } = ye({
624
- closeOnClick: f,
625
- disabled: n,
626
- highlighted: h,
627
- id: k,
628
- store: l,
629
- nativeButton: r,
630
- nodeId: P?.nodeId,
631
- itemMetadata: De
632
- }), p = t.useMemo(() => ({
633
- disabled: n,
634
- highlighted: h,
635
- checked: A
636
- }), [n, h, A]), B = le((x) => {
637
- const m = {
638
- ...$(be, x.nativeEvent),
639
- preventUnmountOnClose: () => {
640
- }
641
- };
642
- _(g, m);
643
- }), w = Y("div", o, {
644
- state: p,
645
- stateAttributesMapping: Ne,
646
- props: [u, {
647
- role: "menuitemradio",
648
- "aria-checked": A,
649
- onClick: B
650
- }, b, y],
651
- ref: [D, i, I.ref]
652
- });
653
- return /* @__PURE__ */ c(Ge.Provider, {
654
- value: p,
655
- children: w
656
- });
657
- });
658
- process.env.NODE_ENV !== "production" && (vt.displayName = "MenuRadioItem");
659
- const Et = /* @__PURE__ */ t.forwardRef(function(o, i) {
660
- const {
661
- render: C,
662
- className: E,
663
- keepMounted: d = !1,
664
- ...R
665
- } = o, r = no(), a = t.useRef(null), {
666
- transitionStatus: f,
667
- setMounted: g
668
- } = gt(r.checked);
669
- Oe({
670
- open: r.checked,
671
- ref: a,
672
- onComplete() {
673
- r.checked || g(!1);
674
- }
675
- });
676
- const b = t.useMemo(() => ({
677
- checked: r.checked,
678
- disabled: r.disabled,
679
- highlighted: r.highlighted,
680
- transitionStatus: f
681
- }), [r.checked, r.disabled, r.highlighted, f]);
682
- return Y("span", o, {
683
- state: b,
684
- stateAttributesMapping: Ne,
685
- ref: [i, a],
686
- props: {
687
- "aria-hidden": !0,
688
- ...R
689
- },
690
- enabled: d || r.checked
691
- });
692
- });
693
- process.env.NODE_ENV !== "production" && (Et.displayName = "MenuRadioItemIndicator");
694
- const It = /* @__PURE__ */ t.createContext(null);
695
- process.env.NODE_ENV !== "production" && (It.displayName = "MenubarContext");
696
- function oo(e) {
697
- return t.useContext(It);
698
- }
699
- const ro = {
700
- ...Sn,
701
- disabled: U((e) => e.parent.type === "menubar" && e.parent.context.disabled || e.disabled),
702
- modal: U((e) => (e.parent.type === void 0 || e.parent.type === "context-menu") && (e.modal ?? !0)),
703
- allowMouseEnter: U((e) => e.parent.type === "menu" ? e.parent.store.select("allowMouseEnter") : e.allowMouseEnter),
704
- stickIfOpen: U((e) => e.stickIfOpen),
705
- parent: U((e) => e.parent),
706
- rootId: U((e) => e.parent.type === "menu" ? e.parent.store.select("rootId") : e.parent.type !== void 0 ? e.parent.context.rootId : e.rootId),
707
- activeIndex: U((e) => e.activeIndex),
708
- isActive: U((e, o) => e.activeIndex === o),
709
- hoverEnabled: U((e) => e.hoverEnabled),
710
- instantType: U((e) => e.instantType),
711
- lastOpenChangeReason: U((e) => e.openChangeReason),
712
- floatingTreeRoot: U((e) => e.parent.type === "menu" ? e.parent.store.select("floatingTreeRoot") : e.floatingTreeRoot),
713
- floatingNodeId: U((e) => e.floatingNodeId),
714
- floatingParentNodeId: U((e) => e.floatingParentNodeId),
715
- itemProps: U((e) => e.itemProps),
716
- closeDelay: U((e) => e.closeDelay),
717
- keyboardEventRelay: U((e) => {
718
- if (e.keyboardEventRelay)
719
- return e.keyboardEventRelay;
720
- if (e.parent.type === "menu")
721
- return e.parent.store.select("keyboardEventRelay");
722
- })
723
- };
724
- class He extends $t {
725
- constructor(o) {
726
- super({
727
- ...so(),
728
- ...o
729
- }, {
730
- positionerRef: /* @__PURE__ */ t.createRef(),
731
- popupRef: /* @__PURE__ */ t.createRef(),
732
- typingRef: {
733
- current: !1
734
- },
735
- itemDomElements: {
736
- current: []
737
- },
738
- itemLabels: {
739
- current: []
740
- },
741
- allowMouseUpTriggerRef: {
742
- current: !1
743
- },
744
- triggerFocusTargetRef: /* @__PURE__ */ t.createRef(),
745
- beforeContentFocusGuardRef: /* @__PURE__ */ t.createRef(),
746
- onOpenChangeComplete: void 0,
747
- triggerElements: new Jt()
748
- }, ro), this.observe(U((i) => i.allowMouseEnter), (i, C) => {
749
- this.state.parent.type === "menu" && i !== C && this.state.parent.store.set("allowMouseEnter", i);
750
- }), this.unsubscribeParentListener = this.observe("parent", (i) => {
751
- if (this.unsubscribeParentListener?.(), i.type === "menu") {
752
- this.unsubscribeParentListener = i.store.subscribe(() => {
753
- this.notifyAll();
754
- }), this.context.allowMouseUpTriggerRef = i.store.context.allowMouseUpTriggerRef;
755
- return;
756
- }
757
- i.type !== void 0 && (this.context.allowMouseUpTriggerRef = i.context.allowMouseUpTriggerRef), this.unsubscribeParentListener = null;
758
- });
759
- }
760
- setOpen(o, i) {
761
- this.state.floatingRootContext.context.events.emit("setOpen", {
762
- open: o,
763
- eventDetails: i
764
- });
765
- }
766
- static useStore(o, i) {
767
- return an(() => o ?? new He(i)).current;
768
- }
769
- unsubscribeParentListener = null;
770
- }
771
- function so() {
772
- return {
773
- ...Tn(),
774
- disabled: !1,
775
- modal: !0,
776
- allowMouseEnter: !0,
777
- stickIfOpen: !0,
778
- parent: {
779
- type: void 0
780
- },
781
- rootId: void 0,
782
- activeIndex: null,
783
- hoverEnabled: !0,
784
- instantType: void 0,
785
- openChangeReason: null,
786
- floatingTreeRoot: new Qt(),
787
- floatingNodeId: void 0,
788
- floatingParentNodeId: null,
789
- itemProps: un,
790
- keyboardEventRelay: void 0,
791
- closeDelay: 0
792
- };
793
- }
794
- const Ye = /* @__PURE__ */ t.createContext(void 0);
795
- process.env.NODE_ENV !== "production" && (Ye.displayName = "MenuSubmenuRootContext");
796
- function yt() {
797
- return t.useContext(Ye);
798
- }
799
- function Nt(e) {
800
- const {
801
- children: o,
802
- open: i,
803
- onOpenChange: C,
804
- onOpenChangeComplete: E,
805
- defaultOpen: d = !1,
806
- disabled: R = !1,
807
- modal: r,
808
- loopFocus: a = !0,
809
- orientation: f = "vertical",
810
- actionsRef: g,
811
- closeParentOnEsc: b = !1,
812
- handle: I,
813
- triggerId: P,
814
- defaultTriggerId: k = null,
815
- highlightItemOnHover: l = !0
816
- } = e, h = Ee(!0), u = q(!0), s = oo(), _ = yt(), O = t.useMemo(() => _ && u ? {
817
- type: "menu",
818
- store: u.store
819
- } : s ? {
820
- type: "menubar",
821
- context: s
822
- } : h && !u ? {
823
- type: "context-menu",
824
- context: h
825
- } : {
826
- type: void 0
827
- }, [h, u, s, _]), n = He.useStore(I?.store, {
828
- parent: O
829
- }), A = n.useState("floatingTreeRoot"), y = Zt(A), D = en();
830
- Te(() => {
831
- h && !u ? n.update({
832
- parent: {
833
- type: "context-menu",
834
- context: h
835
- },
836
- floatingNodeId: y,
837
- floatingParentNodeId: D
838
- }) : u && n.update({
839
- floatingNodeId: y,
840
- floatingParentNodeId: D
841
- });
842
- }, [h, u, y, D, n]), n.useControlledProp("open", i, d), n.useControlledProp("activeTriggerId", P, k), n.useContextCallback("onOpenChangeComplete", E);
843
- const p = n.useState("open"), B = n.useState("activeTriggerElement"), w = n.useState("positionerElement"), x = n.useState("hoverEnabled"), m = n.useState("modal"), N = n.useState("disabled"), L = n.useState("lastOpenChangeReason"), v = n.useState("parent"), X = n.useState("activeIndex"), Q = n.useState("payload"), ne = n.useState("floatingParentNodeId"), z = t.useRef(null), K = ne != null;
844
- let W;
845
- process.env.NODE_ENV !== "production" && v.type !== void 0 && r !== void 0 && console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored."), n.useSyncedValues({
846
- disabled: R,
847
- modal: v.type === void 0 ? r : void 0,
848
- rootId: pt()
849
- });
850
- const {
851
- openMethod: T,
852
- triggerProps: te,
853
- reset: j
854
- } = mn(p);
855
- On(n);
856
- const {
857
- forceUnmount: oe
858
- } = kn(p, n, () => {
859
- n.update({
860
- allowMouseEnter: !1,
861
- stickIfOpen: !0
862
- }), j();
863
- }), se = t.useRef(v.type !== "context-menu"), ie = Me();
864
- t.useEffect(() => {
865
- if (p || (z.current = null), v.type === "context-menu") {
866
- if (!p) {
867
- ie.clear(), se.current = !1;
868
- return;
869
- }
870
- ie.start(500, () => {
871
- se.current = !0;
872
- });
873
- }
874
- }, [ie, p, v.type]), gn(p && m && L !== xe && T !== "touch", w), Te(() => {
875
- !p && !x && n.set("hoverEnabled", !0);
876
- }, [p, x, n]);
877
- const Z = t.useRef(!0), F = Me(), V = le((M, S) => {
878
- const G = S.reason;
879
- if (p === M && S.trigger === B || (S.preventUnmountOnClose = () => {
880
- n.set("preventUnmountingOnClose", !0);
881
- }, !M && S.trigger == null && (S.trigger = B ?? void 0), C?.(M, S), S.isCanceled))
882
- return;
883
- const Yt = {
884
- open: M,
885
- nativeEvent: S.event,
886
- reason: S.reason,
887
- nested: K
888
- };
889
- W?.emit("openchange", Yt);
890
- const ge = S.event;
891
- if (M === !1 && ge?.type === "click" && ge.pointerType === "touch" && !Z.current)
892
- return;
893
- if (!M && X !== null) {
894
- const ae = n.context.itemDomElements.current[X];
895
- queueMicrotask(() => {
896
- ae?.setAttribute("tabindex", "-1");
897
- });
898
- }
899
- M && G === et ? (Z.current = !1, F.start(300, () => {
900
- Z.current = !0;
901
- })) : (Z.current = !0, F.clear());
902
- const Je = (G === ft || G === be) && ge.detail === 0 && ge?.isTrusted, zt = !M && (G === yn || G == null);
903
- function Qe() {
904
- const ae = {
905
- open: M,
906
- openChangeReason: G
907
- };
908
- z.current = S.event ?? null;
909
- const Ze = S.trigger?.id ?? null;
910
- (Ze || M) && (ae.activeTriggerId = Ze, ae.activeTriggerElement = S.trigger ?? null), n.update(ae);
911
- }
912
- G === xe ? ln.flushSync(Qe) : Qe(), v.type === "menubar" && (G === et || G === En || G === xe || G === In || G === ue) ? n.set("instantType", "group") : Je || zt ? n.set("instantType", Je ? "click" : "dismiss") : n.set("instantType", void 0);
913
- }), me = t.useCallback((M) => {
914
- const S = $(M);
915
- return S.preventUnmountOnClose = () => {
916
- n.set("preventUnmountingOnClose", !0);
917
- }, S;
918
- }, [n]), ze = t.useCallback(() => {
919
- n.setOpen(!1, me(Nn));
920
- }, [n, me]);
921
- t.useImperativeHandle(g, () => ({
922
- unmount: oe,
923
- close: ze
924
- }), [oe, ze]);
925
- let Pe;
926
- v.type === "context-menu" && (Pe = v.context), t.useImperativeHandle(Pe?.positionerRef, () => w, [w]), t.useImperativeHandle(Pe?.actionsRef, () => ({
927
- setOpen: V
928
- }), [V]);
929
- const re = _n({
930
- popupStore: n,
931
- onOpenChange: V
932
- });
933
- W = re.context.events, t.useEffect(() => {
934
- const M = ({
935
- open: S,
936
- eventDetails: G
937
- }) => V(S, G);
938
- return W.on("setOpen", M), () => {
939
- W?.off("setOpen", M);
940
- };
941
- }, [W, V]);
942
- const kt = tn(re, {
943
- enabled: !N,
944
- bubbles: b && v.type === "menu",
945
- outsidePress() {
946
- return v.type !== "context-menu" || z.current?.type === "contextmenu" ? !0 : se.current;
947
- },
948
- externalTree: K ? A : void 0
949
- }), _t = Dn(re, {
950
- role: "menu"
951
- }), wt = bn(), Dt = t.useCallback((M) => {
952
- n.select("activeIndex") !== M && n.set("activeIndex", M);
953
- }, [n]), Vt = Vn(re, {
954
- enabled: !N,
955
- listRef: n.context.itemDomElements,
956
- activeIndex: X,
957
- nested: v.type !== void 0,
958
- loopFocus: a,
959
- orientation: f,
960
- parentOrientation: v.type === "menubar" ? v.context.orientation : void 0,
961
- rtl: wt === "rtl",
962
- disabledIndices: cn,
963
- onNavigate: Dt,
964
- openOnArrowKeyDown: v.type !== "context-menu",
965
- externalTree: K ? A : void 0,
966
- focusItemOnHover: l
967
- }), At = t.useCallback((M) => {
968
- n.context.typingRef.current = M;
969
- }, [n]), Ut = An(re, {
970
- listRef: n.context.itemLabels,
971
- activeIndex: X,
972
- resetMs: Rn,
973
- onMatch: (M) => {
974
- p && M !== X && n.set("activeIndex", M);
975
- },
976
- onTypingChange: At
977
- }), {
978
- getReferenceProps: Ke,
979
- getFloatingProps: We,
980
- getItemProps: Xe,
981
- getTriggerProps: je
982
- } = ct([kt, _t, Vt, Ut]), Lt = t.useMemo(() => {
983
- const M = Se(Ke(), {
984
- onMouseEnter() {
985
- n.set("hoverEnabled", !0);
986
- },
987
- onMouseMove() {
988
- n.set("allowMouseEnter", !0);
989
- }
990
- }, te);
991
- return delete M.role, M;
992
- }, [Ke, n, te]), Ft = t.useMemo(() => {
993
- const M = je();
994
- if (!M)
995
- return M;
996
- const S = Se(M, te);
997
- return delete S.role, delete S["aria-controls"], S;
998
- }, [je, te]), qe = dn(), Bt = t.useMemo(() => We({
999
- onMouseEnter() {
1000
- v.type === "menu" && qe.request(() => n.set("hoverEnabled", !1));
1001
- },
1002
- onMouseMove() {
1003
- n.set("allowMouseEnter", !0);
1004
- },
1005
- onClick() {
1006
- n.select("hoverEnabled") && n.set("hoverEnabled", !1);
1007
- },
1008
- onKeyDown(M) {
1009
- const S = n.select("keyboardEventRelay");
1010
- S && !M.isPropagationStopped() && S(M);
1011
- }
1012
- }), [We, v.type, qe, n]), Gt = t.useMemo(() => Xe(), [Xe]);
1013
- n.useSyncedValues({
1014
- floatingRootContext: re,
1015
- activeTriggerProps: Lt,
1016
- inactiveTriggerProps: Ft,
1017
- popupProps: Bt,
1018
- itemProps: Gt
1019
- });
1020
- const Ht = t.useMemo(() => ({
1021
- store: n,
1022
- parent: O
1023
- }), [n, O]), $e = /* @__PURE__ */ c(Ie.Provider, {
1024
- value: Ht,
1025
- children: typeof o == "function" ? o({
1026
- payload: Q
1027
- }) : o
1028
- });
1029
- return v.type === void 0 || v.type === "context-menu" ? /* @__PURE__ */ c(nn, {
1030
- externalTree: A,
1031
- children: $e
1032
- }) : $e;
1033
- }
1034
- function io(e) {
1035
- const o = q().store, i = t.useMemo(() => ({
1036
- parentMenu: o
1037
- }), [o]);
1038
- return /* @__PURE__ */ c(Ye.Provider, {
1039
- value: i,
1040
- children: /* @__PURE__ */ c(Nt, {
1041
- ...e
1042
- })
1043
- });
1044
- }
1045
- function Pt(e) {
1046
- if (Un(e) && e.hasAttribute("data-rootownerid"))
1047
- return e.getAttribute("data-rootownerid") ?? void 0;
1048
- if (!Ln(e))
1049
- return Pt(Fn(e));
1050
- }
1051
- const St = /* @__PURE__ */ t.forwardRef(function(o, i) {
1052
- const {
1053
- render: C,
1054
- className: E,
1055
- label: d,
1056
- id: R,
1057
- nativeButton: r = !1,
1058
- openOnHover: a = !0,
1059
- delay: f = 100,
1060
- closeDelay: g = 0,
1061
- disabled: b = !1,
1062
- ...I
1063
- } = o, P = ve(), k = fe(), {
1064
- store: l
1065
- } = q(), h = pe(R), u = l.useState("open"), s = l.useState("floatingRootContext"), _ = l.useState("floatingTreeRoot"), O = wn(h, l), n = t.useCallback((j) => {
1066
- const oe = O(j);
1067
- return j !== null && l.select("open") && l.select("activeTriggerId") == null && l.update({
1068
- activeTriggerId: h,
1069
- activeTriggerElement: j,
1070
- closeDelay: g
1071
- }), oe;
1072
- }, [O, g, l, h]), A = t.useRef(null), y = t.useCallback((j) => {
1073
- A.current = j, l.set("activeTriggerElement", j);
1074
- }, [l]), D = yt();
1075
- if (!D?.parentMenu)
1076
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>." : J(37));
1077
- l.useSyncedValue("closeDelay", g);
1078
- const p = D.parentMenu, B = p.useState("itemProps"), w = p.useState("isActive", P.index), x = t.useMemo(() => ({
1079
- type: "submenu-trigger",
1080
- setActive: () => p.set("activeIndex", P.index)
1081
- }), [p, P.index]), m = l.useState("disabled"), N = b || m, {
1082
- getItemProps: L,
1083
- itemRef: v
1084
- } = ye({
1085
- closeOnClick: !1,
1086
- disabled: N,
1087
- highlighted: w,
1088
- id: h,
1089
- store: l,
1090
- nativeButton: r,
1091
- itemMetadata: x,
1092
- nodeId: k?.nodeId
1093
- }), X = l.useState("hoverEnabled"), Q = l.useState("allowMouseEnter"), ne = jn(s, {
1094
- enabled: X && a && !N && Q,
1095
- handleClose: $n({
1096
- blockPointerEvents: !0
1097
- }),
1098
- mouseOnly: !0,
1099
- move: !0,
1100
- restMs: f,
1101
- delay: {
1102
- open: f,
1103
- close: g
1104
- },
1105
- triggerElementRef: A,
1106
- externalTree: _
1107
- }), z = hn(s, {
1108
- enabled: !N,
1109
- event: "mousedown",
1110
- toggle: !a,
1111
- ignoreMouse: a,
1112
- stickIfOpen: !1
1113
- }), K = ct([z]), W = l.useState("triggerProps", !0);
1114
- delete W.id;
1115
- const T = t.useMemo(() => ({
1116
- disabled: N,
1117
- highlighted: w,
1118
- open: u
1119
- }), [N, w, u]);
1120
- return Y("div", o, {
1121
- state: T,
1122
- stateAttributesMapping: on,
1123
- props: [K.getReferenceProps(), ne, W, B, {
1124
- tabIndex: u || w ? 0 : -1,
1125
- onBlur() {
1126
- w && p.set("activeIndex", null);
1127
- }
1128
- }, I, L],
1129
- ref: [i, P.ref, v, n, y]
1130
- });
1131
- });
1132
- process.env.NODE_ENV !== "production" && (St.displayName = "MenuSubmenuTrigger");
1133
- function ao(e) {
1134
- const [o, i] = t.useState({
1135
- getBoundingClientRect() {
1136
- return DOMRect.fromRect({
1137
- width: 0,
1138
- height: 0,
1139
- x: 0,
1140
- y: 0
1141
- });
1142
- }
1143
- }), C = t.useRef(null), E = t.useRef(null), d = t.useRef(null), R = t.useRef(null), r = t.useRef(!0), a = t.useRef(null), f = pt(), g = t.useMemo(() => ({
1144
- anchor: o,
1145
- setAnchor: i,
1146
- actionsRef: d,
1147
- backdropRef: C,
1148
- internalBackdropRef: E,
1149
- positionerRef: R,
1150
- allowMouseUpTriggerRef: r,
1151
- initialCursorPointRef: a,
1152
- rootId: f
1153
- }), [o, f]);
1154
- return /* @__PURE__ */ c(ke.Provider, {
1155
- value: g,
1156
- children: /* @__PURE__ */ c(Ie.Provider, {
1157
- value: void 0,
1158
- children: /* @__PURE__ */ c(Nt, {
1159
- ...e
1160
- })
1161
- })
1162
- });
1163
- }
1164
- const rt = 500, Tt = /* @__PURE__ */ t.forwardRef(function(o, i) {
1165
- const {
1166
- render: C,
1167
- className: E,
1168
- ...d
1169
- } = o, {
1170
- setAnchor: R,
1171
- actionsRef: r,
1172
- internalBackdropRef: a,
1173
- backdropRef: f,
1174
- positionerRef: g,
1175
- allowMouseUpTriggerRef: b,
1176
- initialCursorPointRef: I,
1177
- rootId: P
1178
- } = Ee(!1), {
1179
- store: k
1180
- } = q(!1), l = k.useState("open"), h = t.useRef(null), u = t.useRef(null), s = Me(), _ = Me(), O = t.useRef(!1);
1181
- function n(x, m, N) {
1182
- const L = N.type.startsWith("touch");
1183
- I.current = {
1184
- x,
1185
- y: m
1186
- }, R({
1187
- getBoundingClientRect() {
1188
- return DOMRect.fromRect({
1189
- width: L ? 10 : 0,
1190
- height: L ? 10 : 0,
1191
- x,
1192
- y: m
1193
- });
1194
- }
1195
- }), O.current = !1, r.current?.setOpen(!0, $(ft, N)), _.start(rt, () => {
1196
- O.current = !0;
1197
- });
1198
- }
1199
- function A(x) {
1200
- b.current = !0, Bn(x), n(x.clientX, x.clientY, x.nativeEvent), tt(h.current).addEventListener("mouseup", (N) => {
1201
- if (b.current = !1, !O.current)
1202
- return;
1203
- _.clear(), O.current = !1;
1204
- const L = nt(N);
1205
- he(g.current, L) || P && L && Pt(L) === P || r.current?.setOpen(!1, $(Pn, N));
1206
- }, {
1207
- once: !0
1208
- });
1209
- }
1210
- function y(x) {
1211
- if (b.current = !1, x.touches.length === 1) {
1212
- x.stopPropagation();
1213
- const m = x.touches[0];
1214
- u.current = {
1215
- x: m.clientX,
1216
- y: m.clientY
1217
- }, s.start(rt, () => {
1218
- u.current && n(u.current.x, u.current.y, x.nativeEvent);
1219
- });
1220
- }
1221
- }
1222
- function D(x) {
1223
- if (s.isStarted() && u.current && x.touches.length === 1) {
1224
- const m = x.touches[0], N = 10, L = Math.abs(m.clientX - u.current.x), v = Math.abs(m.clientY - u.current.y);
1225
- (L > N || v > N) && s.clear();
1226
- }
1227
- }
1228
- function p() {
1229
- s.clear(), u.current = null;
1230
- }
1231
- t.useEffect(() => {
1232
- function x(N) {
1233
- const v = nt(N);
1234
- (he(h.current, v) || he(a.current, v) || he(f.current, v)) && N.preventDefault();
1235
- }
1236
- const m = tt(h.current);
1237
- return m.addEventListener("contextmenu", x), () => {
1238
- m.removeEventListener("contextmenu", x);
1239
- };
1240
- }, [f, a]);
1241
- const B = t.useMemo(() => ({
1242
- open: l
1243
- }), [l]);
1244
- return Y("div", o, {
1245
- state: B,
1246
- ref: [h, i],
1247
- props: [{
1248
- onContextMenu: A,
1249
- onTouchStart: y,
1250
- onTouchMove: D,
1251
- onTouchEnd: p,
1252
- onTouchCancel: p,
1253
- style: {
1254
- WebkitTouchCallout: "none"
1255
- }
1256
- }, d],
1257
- stateAttributesMapping: rn
1258
- });
1259
- });
1260
- process.env.NODE_ENV !== "production" && (Tt.displayName = "ContextMenuTrigger");
1261
- const H = {
1262
- "context-menu": "_context-menu_zcfxh_1",
1263
- "context-menu__item": "_context-menu__item_zcfxh_10",
1264
- "context-menu__item-icon": "_context-menu__item-icon_zcfxh_22",
1265
- "context-menu__item-shortcut": "_context-menu__item-shortcut_zcfxh_29",
1266
- "context-menu__label": "_context-menu__label_zcfxh_34"
1267
- }, Ot = Kt("root");
1268
- function $o({
1269
- trigger: e,
1270
- background: o = "root",
1271
- className: i,
1272
- children: C,
1273
- style: E,
1274
- ...d
1275
- }) {
1276
- return /* @__PURE__ */ c(Ot.Provider, { value: o, children: /* @__PURE__ */ ee(ao, { ...d, children: [
1277
- e ? /* @__PURE__ */ c(Tt, { render: e }) : null,
1278
- /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(Fe, { children: /* @__PURE__ */ c(
1279
- Ae,
1280
- {
1281
- render: /* @__PURE__ */ c(it, { background: o }),
1282
- className: de(
1283
- H["context-menu"],
1284
- lt["transition_fade-out"],
1285
- i
1286
- ),
1287
- style: E,
1288
- children: C
1289
- }
1290
- ) }) })
1291
- ] }) });
1292
- }
1293
- function Jo({
1294
- icon: e,
1295
- shortcut: o,
1296
- className: i,
1297
- children: C,
1298
- ...E
1299
- }) {
1300
- return /* @__PURE__ */ ee(
1301
- Re,
1302
- {
1303
- render: /* @__PURE__ */ c(Rt, { ...E }),
1304
- interactive: "list-item",
1305
- className: de(H["context-menu__item"], i),
1306
- children: [
1307
- e ? /* @__PURE__ */ c(ce, { name: e, className: H["context-menu__item-icon"] }) : null,
1308
- Ce(C),
1309
- o ? /* @__PURE__ */ c(
1310
- at,
1311
- {
1312
- className: H["context-menu__item-shortcut"],
1313
- color: "dimmest",
1314
- size: "sm",
1315
- children: o
1316
- }
1317
- ) : null
1318
- ]
1319
- }
1320
- );
1321
- }
1322
- function Qo(e) {
1323
- return /* @__PURE__ */ c(Xt, { render: /* @__PURE__ */ c(jt, {}), ...e });
1324
- }
1325
- function Zo({
1326
- label: e,
1327
- children: o,
1328
- ...i
1329
- }) {
1330
- return /* @__PURE__ */ ee(Mt, { ...i, children: [
1331
- e ? /* @__PURE__ */ c(
1332
- at,
1333
- {
1334
- render: /* @__PURE__ */ c(Ct, {}),
1335
- className: H["context-menu__label"],
1336
- color: "dimmest",
1337
- size: "sm",
1338
- children: e
1339
- }
1340
- ) : null,
1341
- o
1342
- ] });
1343
- }
1344
- const er = bt;
1345
- function tr({
1346
- className: e,
1347
- children: o,
1348
- ...i
1349
- }) {
1350
- return /* @__PURE__ */ ee(
1351
- Re,
1352
- {
1353
- interactive: "list-item",
1354
- render: /* @__PURE__ */ c(vt, { ...i }),
1355
- className: de(H["context-menu__item"], e),
1356
- children: [
1357
- /* @__PURE__ */ c(
1358
- Et,
1359
- {
1360
- className: H["context-menu__item-icon"],
1361
- children: /* @__PURE__ */ c(ce, { name: "checkbox-circle-line", color: st.primaryDefault })
1362
- }
1363
- ),
1364
- Ce(o)
1365
- ]
1366
- }
1367
- );
1368
- }
1369
- function nr({
1370
- className: e,
1371
- children: o,
1372
- ...i
1373
- }) {
1374
- return /* @__PURE__ */ ee(
1375
- Re,
1376
- {
1377
- interactive: "list-item",
1378
- render: /* @__PURE__ */ c(ht, { ...i }),
1379
- className: de(H["context-menu__item"], e),
1380
- children: [
1381
- /* @__PURE__ */ c(
1382
- xt,
1383
- {
1384
- className: H["context-menu__item-icon"],
1385
- children: /* @__PURE__ */ c(ce, { name: "check-line", color: st.primaryDefault })
1386
- }
1387
- ),
1388
- Ce(o)
1389
- ]
1390
- }
1391
- );
1392
- }
1393
- function or({
1394
- label: e,
1395
- icon: o,
1396
- children: i,
1397
- className: C,
1398
- style: E,
1399
- ...d
1400
- }) {
1401
- const R = Wt(Ot);
1402
- return /* @__PURE__ */ ee(io, { ...d, children: [
1403
- /* @__PURE__ */ ee(
1404
- Re,
1405
- {
1406
- render: /* @__PURE__ */ c(St, {}),
1407
- className: H["context-menu__item"],
1408
- children: [
1409
- o ? /* @__PURE__ */ c(ce, { name: o, className: H["context-menu__item-icon"] }) : null,
1410
- Ce(e),
1411
- /* @__PURE__ */ c(
1412
- ce,
1413
- {
1414
- name: "arrow-right-line",
1415
- className: H["context-menu__item-shortcut"]
1416
- }
1417
- )
1418
- ]
1419
- }
1420
- ),
1421
- /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(Fe, { alignOffset: -4, sideOffset: -4, children: /* @__PURE__ */ c(
1422
- Ae,
1423
- {
1424
- render: /* @__PURE__ */ c(it, { background: R }),
1425
- className: de(
1426
- H["context-menu"],
1427
- lt.transition_scale,
1428
- C
1429
- ),
1430
- style: E,
1431
- children: i
1432
- }
1433
- ) }) })
1434
- ] });
1435
- }
2
+ import { ContextMenu as n } from "./context-menu.js";
1436
3
  export {
1437
- $o as ContextMenu,
1438
- nr as ContextMenuCheckboxItem,
1439
- Zo as ContextMenuGroup,
1440
- Jo as ContextMenuItem,
1441
- or as ContextMenuMore,
1442
- er as ContextMenuRadioGroup,
1443
- tr as ContextMenuRadioItem,
1444
- Qo as ContextMenuSeparator
4
+ n as ContextMenu
1445
5
  };