@rpcbase/ui 0.214.0 → 0.215.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 (388) hide show
  1. package/dist/index100.js +4 -3
  2. package/dist/index100.js.map +1 -1
  3. package/dist/index101.js +4 -5
  4. package/dist/index101.js.map +1 -1
  5. package/dist/index102.js +8 -4
  6. package/dist/index102.js.map +1 -1
  7. package/dist/index103.js +5 -8
  8. package/dist/index103.js.map +1 -1
  9. package/dist/index104.js +4 -5
  10. package/dist/index104.js.map +1 -1
  11. package/dist/index105.js +3 -3
  12. package/dist/index105.js.map +1 -1
  13. package/dist/index106.js +6 -4
  14. package/dist/index106.js.map +1 -1
  15. package/dist/index107.js +145 -6
  16. package/dist/index107.js.map +1 -1
  17. package/dist/index108.js +38 -144
  18. package/dist/index108.js.map +1 -1
  19. package/dist/index109.js +4 -39
  20. package/dist/index109.js.map +1 -1
  21. package/dist/index110.js +7 -4
  22. package/dist/index110.js.map +1 -1
  23. package/dist/index111.js +12 -6
  24. package/dist/index111.js.map +1 -1
  25. package/dist/index112.js +13 -13
  26. package/dist/index112.js.map +1 -1
  27. package/dist/index113.js +7 -13
  28. package/dist/index113.js.map +1 -1
  29. package/dist/index114.js +30 -6
  30. package/dist/index114.js.map +1 -1
  31. package/dist/index115.js +10 -31
  32. package/dist/index115.js.map +1 -1
  33. package/dist/index116.js +10 -10
  34. package/dist/index116.js.map +1 -1
  35. package/dist/index117.js +8 -10
  36. package/dist/index117.js.map +1 -1
  37. package/dist/index118.js +13 -8
  38. package/dist/index118.js.map +1 -1
  39. package/dist/index119.js +101 -13
  40. package/dist/index119.js.map +1 -1
  41. package/dist/index120.js +20 -102
  42. package/dist/index120.js.map +1 -1
  43. package/dist/index121.js +54 -20
  44. package/dist/index121.js.map +1 -1
  45. package/dist/index122.js +70 -51
  46. package/dist/index122.js.map +1 -1
  47. package/dist/index123.js +9 -72
  48. package/dist/index123.js.map +1 -1
  49. package/dist/index124.js +20 -9
  50. package/dist/index124.js.map +1 -1
  51. package/dist/index125.js +16 -20
  52. package/dist/index125.js.map +1 -1
  53. package/dist/index126.js +23 -16
  54. package/dist/index126.js.map +1 -1
  55. package/dist/index127.js +6 -23
  56. package/dist/index127.js.map +1 -1
  57. package/dist/index128.js +5 -6
  58. package/dist/index128.js.map +1 -1
  59. package/dist/index129.js +23 -5
  60. package/dist/index129.js.map +1 -1
  61. package/dist/index130.js +35 -24
  62. package/dist/index130.js.map +1 -1
  63. package/dist/index131.js +16 -35
  64. package/dist/index131.js.map +1 -1
  65. package/dist/index132.js +7 -16
  66. package/dist/index132.js.map +1 -1
  67. package/dist/index133.js +4 -6
  68. package/dist/index133.js.map +1 -1
  69. package/dist/index134.js +4 -4
  70. package/dist/index134.js.map +1 -1
  71. package/dist/index135.js +4 -4
  72. package/dist/index135.js.map +1 -1
  73. package/dist/index136.js +4 -4
  74. package/dist/index136.js.map +1 -1
  75. package/dist/index137.js +3 -4
  76. package/dist/index137.js.map +1 -1
  77. package/dist/index138.js +6 -3
  78. package/dist/index138.js.map +1 -1
  79. package/dist/index139.js +24 -7
  80. package/dist/index139.js.map +1 -1
  81. package/dist/index140.js +8 -24
  82. package/dist/index140.js.map +1 -1
  83. package/dist/index141.js +6 -7
  84. package/dist/index141.js.map +1 -1
  85. package/dist/index142.js +5 -6
  86. package/dist/index142.js.map +1 -1
  87. package/dist/index143.js +3 -5
  88. package/dist/index143.js.map +1 -1
  89. package/dist/index144.js +3 -3
  90. package/dist/index144.js.map +1 -1
  91. package/dist/index145.js +4 -3
  92. package/dist/index145.js.map +1 -1
  93. package/dist/index146.js +3 -4
  94. package/dist/index146.js.map +1 -1
  95. package/dist/index147.js +4 -3
  96. package/dist/index147.js.map +1 -1
  97. package/dist/index148.js +3 -4
  98. package/dist/index148.js.map +1 -1
  99. package/dist/index149.js +3 -3
  100. package/dist/index149.js.map +1 -1
  101. package/dist/index150.js +3 -3
  102. package/dist/index150.js.map +1 -1
  103. package/dist/index151.js +46 -3
  104. package/dist/index151.js.map +1 -1
  105. package/dist/index152.js +1 -1
  106. package/dist/index152.js.map +1 -1
  107. package/dist/index153.js +224 -41
  108. package/dist/index153.js.map +1 -1
  109. package/dist/index154.js +21 -229
  110. package/dist/index154.js.map +1 -1
  111. package/dist/index155.js +25 -22
  112. package/dist/index155.js.map +1 -1
  113. package/dist/index156.js +399 -23
  114. package/dist/index156.js.map +1 -1
  115. package/dist/index157.js +588 -383
  116. package/dist/index157.js.map +1 -1
  117. package/dist/index16.js +1 -1
  118. package/dist/index179.js +58 -67
  119. package/dist/index179.js.map +1 -1
  120. package/dist/index180.js +8 -180
  121. package/dist/index180.js.map +1 -1
  122. package/dist/index181.js +62 -42
  123. package/dist/index181.js.map +1 -1
  124. package/dist/index182.js +18 -57
  125. package/dist/index182.js.map +1 -1
  126. package/dist/index183.js +16 -8
  127. package/dist/index183.js.map +1 -1
  128. package/dist/index184.js +4 -65
  129. package/dist/index184.js.map +1 -1
  130. package/dist/index185.js +4 -18
  131. package/dist/index185.js.map +1 -1
  132. package/dist/index186.js +6 -16
  133. package/dist/index186.js.map +1 -1
  134. package/dist/index187.js +4 -5
  135. package/dist/index187.js.map +1 -1
  136. package/dist/index188.js +6 -5
  137. package/dist/index188.js.map +1 -1
  138. package/dist/index189.js +16 -6
  139. package/dist/index189.js.map +1 -1
  140. package/dist/index190.js +4 -4
  141. package/dist/index190.js.map +1 -1
  142. package/dist/index191.js +4 -6
  143. package/dist/index191.js.map +1 -1
  144. package/dist/index192.js +12 -16
  145. package/dist/index192.js.map +1 -1
  146. package/dist/index193.js +9 -4
  147. package/dist/index193.js.map +1 -1
  148. package/dist/index194.js +13 -4
  149. package/dist/index194.js.map +1 -1
  150. package/dist/index195.js +13 -12
  151. package/dist/index195.js.map +1 -1
  152. package/dist/index196.js +4 -9
  153. package/dist/index196.js.map +1 -1
  154. package/dist/index197.js +5 -13
  155. package/dist/index197.js.map +1 -1
  156. package/dist/index198.js +6 -13
  157. package/dist/index198.js.map +1 -1
  158. package/dist/index199.js +5 -4
  159. package/dist/index199.js.map +1 -1
  160. package/dist/index200.js +54 -5
  161. package/dist/index200.js.map +1 -1
  162. package/dist/index201.js +8 -6
  163. package/dist/index201.js.map +1 -1
  164. package/dist/index202.js +3 -4
  165. package/dist/index202.js.map +1 -1
  166. package/dist/index203.js +4 -54
  167. package/dist/index203.js.map +1 -1
  168. package/dist/index204.js +6 -6
  169. package/dist/index204.js.map +1 -1
  170. package/dist/index205.js +4 -4
  171. package/dist/index205.js.map +1 -1
  172. package/dist/index206.js +4 -4
  173. package/dist/index206.js.map +1 -1
  174. package/dist/index207.js +3 -8
  175. package/dist/index207.js.map +1 -1
  176. package/dist/index208.js +10 -4
  177. package/dist/index208.js.map +1 -1
  178. package/dist/index209.js +9 -4
  179. package/dist/index209.js.map +1 -1
  180. package/dist/index210.js +9 -3
  181. package/dist/index210.js.map +1 -1
  182. package/dist/index211.js +10 -10
  183. package/dist/index211.js.map +1 -1
  184. package/dist/index212.js +10 -9
  185. package/dist/index212.js.map +1 -1
  186. package/dist/index213.js +9 -9
  187. package/dist/index213.js.map +1 -1
  188. package/dist/index214.js +6 -10
  189. package/dist/index214.js.map +1 -1
  190. package/dist/index215.js +5 -10
  191. package/dist/index215.js.map +1 -1
  192. package/dist/index216.js +4 -9
  193. package/dist/index216.js.map +1 -1
  194. package/dist/index217.js +5 -6
  195. package/dist/index217.js.map +1 -1
  196. package/dist/index218.js +6 -5
  197. package/dist/index218.js.map +1 -1
  198. package/dist/index219.js +5 -4
  199. package/dist/index219.js.map +1 -1
  200. package/dist/index220.js +16 -5
  201. package/dist/index220.js.map +1 -1
  202. package/dist/index221.js +7 -6
  203. package/dist/index221.js.map +1 -1
  204. package/dist/index222.js +10 -5
  205. package/dist/index222.js.map +1 -1
  206. package/dist/index223.js +9 -15
  207. package/dist/index223.js.map +1 -1
  208. package/dist/index224.js +21 -7
  209. package/dist/index224.js.map +1 -1
  210. package/dist/index225.js +10 -10
  211. package/dist/index225.js.map +1 -1
  212. package/dist/index226.js +9 -10
  213. package/dist/index226.js.map +1 -1
  214. package/dist/index227.js +9 -21
  215. package/dist/index227.js.map +1 -1
  216. package/dist/index228.js +4 -10
  217. package/dist/index228.js.map +1 -1
  218. package/dist/index229.js +5 -9
  219. package/dist/index229.js.map +1 -1
  220. package/dist/index230.js +16 -9
  221. package/dist/index230.js.map +1 -1
  222. package/dist/index231.js +9 -4
  223. package/dist/index231.js.map +1 -1
  224. package/dist/index232.js +18 -5
  225. package/dist/index232.js.map +1 -1
  226. package/dist/index233.js +15 -16
  227. package/dist/index233.js.map +1 -1
  228. package/dist/index234.js +12 -9
  229. package/dist/index234.js.map +1 -1
  230. package/dist/index235.js +29 -18
  231. package/dist/index235.js.map +1 -1
  232. package/dist/index236.js +12 -15
  233. package/dist/index236.js.map +1 -1
  234. package/dist/index237.js +25 -12
  235. package/dist/index237.js.map +1 -1
  236. package/dist/index238.js +5 -29
  237. package/dist/index238.js.map +1 -1
  238. package/dist/index239.js +24 -12
  239. package/dist/index239.js.map +1 -1
  240. package/dist/index240.js +29 -26
  241. package/dist/index240.js.map +1 -1
  242. package/dist/index241.js +5 -6
  243. package/dist/index241.js.map +1 -1
  244. package/dist/index242.js +65 -22
  245. package/dist/index242.js.map +1 -1
  246. package/dist/index243.js +179 -27
  247. package/dist/index243.js.map +1 -1
  248. package/dist/index244.js +47 -5
  249. package/dist/index244.js.map +1 -1
  250. package/dist/index248.js +1 -1
  251. package/dist/index249.js +1 -1
  252. package/dist/index252.js +2 -2
  253. package/dist/index255.js +1 -1
  254. package/dist/index259.js +3 -116
  255. package/dist/index259.js.map +1 -1
  256. package/dist/index260.js +9 -17
  257. package/dist/index260.js.map +1 -1
  258. package/dist/index261.js +114 -13
  259. package/dist/index261.js.map +1 -1
  260. package/dist/index262.js +17 -3
  261. package/dist/index262.js.map +1 -1
  262. package/dist/index263.js +12 -33
  263. package/dist/index263.js.map +1 -1
  264. package/dist/index264.js +35 -19
  265. package/dist/index264.js.map +1 -1
  266. package/dist/index265.js +20 -9
  267. package/dist/index265.js.map +1 -1
  268. package/dist/index267.js +2 -2
  269. package/dist/index271.js +5 -5
  270. package/dist/index274.js +1 -1
  271. package/dist/index276.js +5 -5
  272. package/dist/index277.js +1 -1
  273. package/dist/index289.js +4 -4
  274. package/dist/index292.js +1 -1
  275. package/dist/index293.js +2 -2
  276. package/dist/index295.js +1 -1
  277. package/dist/index296.js +1 -1
  278. package/dist/index297.js +1 -1
  279. package/dist/index298.js +1 -1
  280. package/dist/index299.js +69 -65
  281. package/dist/index299.js.map +1 -1
  282. package/dist/index300.js +8 -68
  283. package/dist/index300.js.map +1 -1
  284. package/dist/index301.js +14 -9
  285. package/dist/index301.js.map +1 -1
  286. package/dist/index302.js +66 -14
  287. package/dist/index302.js.map +1 -1
  288. package/dist/index303.js +64 -65
  289. package/dist/index303.js.map +1 -1
  290. package/dist/index304.js +5 -68
  291. package/dist/index304.js.map +1 -1
  292. package/dist/index305.js +55 -30
  293. package/dist/index305.js.map +1 -1
  294. package/dist/index306.js +68 -9
  295. package/dist/index306.js.map +1 -1
  296. package/dist/index307.js +26 -148
  297. package/dist/index307.js.map +1 -1
  298. package/dist/index308.js +9 -108
  299. package/dist/index308.js.map +1 -1
  300. package/dist/index309.js +153 -5
  301. package/dist/index309.js.map +1 -1
  302. package/dist/index31.js +5 -5
  303. package/dist/index310.js +106 -54
  304. package/dist/index310.js.map +1 -1
  305. package/dist/index32.js +24 -24
  306. package/dist/index33.js +3 -3
  307. package/dist/index36.js +1 -1
  308. package/dist/index37.js +2 -2
  309. package/dist/index41.js +4 -4
  310. package/dist/index45.js +1 -1
  311. package/dist/index46.js +1 -1
  312. package/dist/index49.js +1 -1
  313. package/dist/index50.js +1 -1
  314. package/dist/index51.js +2 -205
  315. package/dist/index51.js.map +1 -1
  316. package/dist/index52.js +2 -2
  317. package/dist/index53.js +7 -2
  318. package/dist/index53.js.map +1 -1
  319. package/dist/index54.js +33 -6
  320. package/dist/index54.js.map +1 -1
  321. package/dist/index55.js +48 -33
  322. package/dist/index55.js.map +1 -1
  323. package/dist/index56.js +7 -26
  324. package/dist/index56.js.map +1 -1
  325. package/dist/index57.js +11 -7
  326. package/dist/index57.js.map +1 -1
  327. package/dist/index58.js +205 -12
  328. package/dist/index58.js.map +1 -1
  329. package/dist/index60.js +2 -2
  330. package/dist/index64.js +3 -3
  331. package/dist/index66.js +7 -7
  332. package/dist/index67.js +1 -1
  333. package/dist/index68.js +1 -1
  334. package/dist/index72.js +1 -1
  335. package/dist/index74.js +3 -3
  336. package/dist/index75.js +6 -2
  337. package/dist/index75.js.map +1 -1
  338. package/dist/index76.js +8 -2
  339. package/dist/index76.js.map +1 -1
  340. package/dist/index77.js +5 -5
  341. package/dist/index77.js.map +1 -1
  342. package/dist/index78.js +2 -8
  343. package/dist/index78.js.map +1 -1
  344. package/dist/index79.js +2 -6
  345. package/dist/index79.js.map +1 -1
  346. package/dist/index80.js +52 -606
  347. package/dist/index80.js.map +1 -1
  348. package/dist/index81.js +5 -52
  349. package/dist/index81.js.map +1 -1
  350. package/dist/index82.js +4 -4
  351. package/dist/index82.js.map +1 -1
  352. package/dist/index83.js +15 -4
  353. package/dist/index83.js.map +1 -1
  354. package/dist/index84.js +5 -15
  355. package/dist/index84.js.map +1 -1
  356. package/dist/index85.js +7 -5
  357. package/dist/index85.js.map +1 -1
  358. package/dist/index86.js +15 -6
  359. package/dist/index86.js.map +1 -1
  360. package/dist/index87.js +4 -16
  361. package/dist/index87.js.map +1 -1
  362. package/dist/index88.js +1 -1
  363. package/dist/index88.js.map +1 -1
  364. package/dist/index89.js +5 -4
  365. package/dist/index89.js.map +1 -1
  366. package/dist/index90.js +4 -4
  367. package/dist/index90.js.map +1 -1
  368. package/dist/index91.js +4 -5
  369. package/dist/index91.js.map +1 -1
  370. package/dist/index92.js +2 -2
  371. package/dist/index92.js.map +1 -1
  372. package/dist/index93.js +5 -3
  373. package/dist/index93.js.map +1 -1
  374. package/dist/index94.js +24 -6
  375. package/dist/index94.js.map +1 -1
  376. package/dist/index95.js +6 -24
  377. package/dist/index95.js.map +1 -1
  378. package/dist/index96.js +4 -6
  379. package/dist/index96.js.map +1 -1
  380. package/dist/index97.js +5 -3
  381. package/dist/index97.js.map +1 -1
  382. package/dist/index98.js +5 -6
  383. package/dist/index98.js.map +1 -1
  384. package/dist/index99.js +4 -5
  385. package/dist/index99.js.map +1 -1
  386. package/dist/lib/react-compose-refs.d.ts +5 -0
  387. package/dist/lib/react-compose-refs.d.ts.map +1 -0
  388. package/package.json +1 -1
package/dist/index157.js CHANGED
@@ -1,404 +1,609 @@
1
- import { computePosition as st, offset as rt, shift as ct, flip as lt, size as ft, hide as ut, arrow as ht, limitShift as at } from "./index278.js";
2
- import { createCoords as y, round as z, max as E, min as N, rectToClientRect as J, floor as D } from "./index279.js";
3
- import { isElement as v, getDocumentElement as b, getOverflowAncestors as $, getComputedStyle as R, isHTMLElement as T, getWindow as O, isTopLayer as V, getParentNode as S, isLastTraversableNode as A, isTableElement as dt, isContainingBlock as Q, getContainingBlock as gt, getNodeName as _, isOverflowElement as q, getNodeScroll as H, getFrameElement as U, isWebKit as Y } from "./index280.js";
4
- function Z(t) {
5
- const e = R(t);
6
- let i = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
7
- const n = T(t), r = n ? t.offsetWidth : i, s = n ? t.offsetHeight : o, c = z(i) !== r || z(o) !== s;
8
- return c && (i = r, o = s), {
9
- width: i,
10
- height: o,
11
- $: c
12
- };
13
- }
14
- function X(t) {
15
- return v(t) ? t : t.contextElement;
16
- }
17
- function F(t) {
18
- const e = X(t);
19
- if (!T(e))
20
- return y(1);
21
- const i = e.getBoundingClientRect(), {
22
- width: o,
23
- height: n,
24
- $: r
25
- } = Z(e);
26
- let s = (r ? z(i.width) : i.width) / o, c = (r ? z(i.height) : i.height) / n;
27
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
28
- x: s,
29
- y: c
30
- };
31
- }
32
- const pt = /* @__PURE__ */ y(0);
33
- function tt(t) {
34
- const e = O(t);
35
- return !Y() || !e.visualViewport ? pt : {
36
- x: e.visualViewport.offsetLeft,
37
- y: e.visualViewport.offsetTop
38
- };
39
- }
40
- function mt(t, e, i) {
41
- return e === void 0 && (e = !1), !i || e && i !== O(t) ? !1 : e;
42
- }
43
- function L(t, e, i, o) {
44
- e === void 0 && (e = !1), i === void 0 && (i = !1);
45
- const n = t.getBoundingClientRect(), r = X(t);
46
- let s = y(1);
47
- e && (o ? v(o) && (s = F(o)) : s = F(t));
48
- const c = mt(r, i, o) ? tt(r) : y(0);
49
- let l = (n.left + c.x) / s.x, f = (n.top + c.y) / s.y, u = n.width / s.x, a = n.height / s.y;
50
- if (r) {
51
- const d = O(r), h = o && v(o) ? O(o) : o;
52
- let m = d, p = U(m);
53
- for (; p && o && h !== m; ) {
54
- const w = F(p), g = p.getBoundingClientRect(), x = R(p), C = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, W = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
55
- l *= w.x, f *= w.y, u *= w.x, a *= w.y, l += C, f += W, m = O(p), p = U(m);
1
+ import * as o from "react";
2
+ import { composeEventHandlers as M } from "./index53.js";
3
+ import { createCollection as Ve } from "./index60.js";
4
+ import { useComposedRefs as k, composeRefs as Ye } from "./index55.js";
5
+ import { createContextScope as Xe } from "./index61.js";
6
+ import { useDirection as He } from "./index62.js";
7
+ import { DismissableLayer as We } from "./index31.js";
8
+ import { useFocusGuards as ze } from "./index63.js";
9
+ import { FocusScope as Ze } from "./index64.js";
10
+ import { Anchor as $e, Root as qe, createPopperScope as le, Content as Je, Arrow as Qe } from "./index66.js";
11
+ import { Portal as et } from "./index67.js";
12
+ import { Presence as V } from "./index242.js";
13
+ import { Primitive as D, dispatchDiscreteCustomEvent as tt } from "./index54.js";
14
+ import { createRovingFocusGroupScope as de, Item as nt, Root as ot } from "./index243.js";
15
+ import { createSlot as rt } from "./index244.js";
16
+ import { useCallbackRef as fe } from "./index56.js";
17
+ import { hideOthers as ct } from "./index73.js";
18
+ import st from "./index74.js";
19
+ import { j as a } from "./index30.js";
20
+ var $ = ["Enter", " "], at = ["ArrowDown", "PageUp", "Home"], me = ["ArrowUp", "PageDown", "End"], ut = [...at, ...me], it = {
21
+ ltr: [...$, "ArrowRight"],
22
+ rtl: [...$, "ArrowLeft"]
23
+ }, lt = {
24
+ ltr: ["ArrowLeft"],
25
+ rtl: ["ArrowRight"]
26
+ }, N = "Menu", [j, dt, ft] = Ve(N), [R, Qt] = Xe(N, [
27
+ ft,
28
+ le,
29
+ de
30
+ ]), Y = le(), pe = de(), [mt, P] = R(N), [pt, F] = R(N), ve = (e) => {
31
+ const { __scopeMenu: n, open: t = !1, children: r, dir: u, onOpenChange: c, modal: d = !0 } = e, p = Y(n), [h, m] = o.useState(null), l = o.useRef(!1), s = fe(c), f = He(u);
32
+ return o.useEffect(() => {
33
+ const x = () => {
34
+ l.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
35
+ }, v = () => l.current = !1;
36
+ return document.addEventListener("keydown", x, { capture: !0 }), () => {
37
+ document.removeEventListener("keydown", x, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
38
+ };
39
+ }, []), /* @__PURE__ */ a.jsx(qe, { ...p, children: /* @__PURE__ */ a.jsx(
40
+ mt,
41
+ {
42
+ scope: n,
43
+ open: t,
44
+ onOpenChange: s,
45
+ content: h,
46
+ onContentChange: m,
47
+ children: /* @__PURE__ */ a.jsx(
48
+ pt,
49
+ {
50
+ scope: n,
51
+ onClose: o.useCallback(() => s(!1), [s]),
52
+ isUsingKeyboardRef: l,
53
+ dir: f,
54
+ modal: d,
55
+ children: r
56
+ }
57
+ )
56
58
  }
59
+ ) });
60
+ };
61
+ ve.displayName = N;
62
+ var vt = "MenuAnchor", q = o.forwardRef(
63
+ (e, n) => {
64
+ const { __scopeMenu: t, ...r } = e, u = Y(t);
65
+ return /* @__PURE__ */ a.jsx($e, { ...u, ...r, ref: n });
57
66
  }
58
- return J({
59
- width: u,
60
- height: a,
61
- x: l,
62
- y: f
63
- });
64
- }
65
- function I(t, e) {
66
- const i = H(t).scrollLeft;
67
- return e ? e.left + i : L(b(t)).left + i;
68
- }
69
- function et(t, e) {
70
- const i = t.getBoundingClientRect(), o = i.left + e.scrollLeft - I(t, i), n = i.top + e.scrollTop;
71
- return {
72
- x: o,
73
- y: n
74
- };
75
- }
76
- function wt(t) {
77
- let {
78
- elements: e,
79
- rect: i,
80
- offsetParent: o,
81
- strategy: n
82
- } = t;
83
- const r = n === "fixed", s = b(o), c = e ? V(e.floating) : !1;
84
- if (o === s || c && r)
85
- return i;
86
- let l = {
87
- scrollLeft: 0,
88
- scrollTop: 0
89
- }, f = y(1);
90
- const u = y(0), a = T(o);
91
- if ((a || !a && !r) && ((_(o) !== "body" || q(s)) && (l = H(o)), a)) {
92
- const h = L(o);
93
- f = F(o), u.x = h.x + o.clientLeft, u.y = h.y + o.clientTop;
67
+ );
68
+ q.displayName = vt;
69
+ var J = "MenuPortal", [Mt, Me] = R(J, {
70
+ forceMount: void 0
71
+ }), he = (e) => {
72
+ const { __scopeMenu: n, forceMount: t, children: r, container: u } = e, c = P(J, n);
73
+ return /* @__PURE__ */ a.jsx(Mt, { scope: n, forceMount: t, children: /* @__PURE__ */ a.jsx(V, { present: t || c.open, children: /* @__PURE__ */ a.jsx(et, { asChild: !0, container: u, children: r }) }) });
74
+ };
75
+ he.displayName = J;
76
+ var g = "MenuContent", [ht, Q] = R(g), Ce = o.forwardRef(
77
+ (e, n) => {
78
+ const t = Me(g, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, c = P(g, e.__scopeMenu), d = F(g, e.__scopeMenu);
79
+ return /* @__PURE__ */ a.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(V, { present: r || c.open, children: /* @__PURE__ */ a.jsx(j.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ a.jsx(Ct, { ...u, ref: n }) : /* @__PURE__ */ a.jsx(xt, { ...u, ref: n }) }) }) });
94
80
  }
95
- const d = s && !a && !r ? et(s, l) : y(0);
96
- return {
97
- width: i.width * f.x,
98
- height: i.height * f.y,
99
- x: i.x * f.x - l.scrollLeft * f.x + u.x + d.x,
100
- y: i.y * f.y - l.scrollTop * f.y + u.y + d.y
101
- };
102
- }
103
- function yt(t) {
104
- return Array.from(t.getClientRects());
105
- }
106
- function xt(t) {
107
- const e = b(t), i = H(t), o = t.ownerDocument.body, n = E(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = E(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
108
- let s = -i.scrollLeft + I(t);
109
- const c = -i.scrollTop;
110
- return R(o).direction === "rtl" && (s += E(e.clientWidth, o.clientWidth) - n), {
111
- width: n,
112
- height: r,
113
- x: s,
114
- y: c
115
- };
116
- }
117
- const K = 25;
118
- function vt(t, e) {
119
- const i = O(t), o = b(t), n = i.visualViewport;
120
- let r = o.clientWidth, s = o.clientHeight, c = 0, l = 0;
121
- if (n) {
122
- r = n.width, s = n.height;
123
- const u = Y();
124
- (!u || u && e === "fixed") && (c = n.offsetLeft, l = n.offsetTop);
81
+ ), Ct = o.forwardRef(
82
+ (e, n) => {
83
+ const t = P(g, e.__scopeMenu), r = o.useRef(null), u = k(n, r);
84
+ return o.useEffect(() => {
85
+ const c = r.current;
86
+ if (c) return ct(c);
87
+ }, []), /* @__PURE__ */ a.jsx(
88
+ ee,
89
+ {
90
+ ...e,
91
+ ref: u,
92
+ trapFocus: t.open,
93
+ disableOutsidePointerEvents: t.open,
94
+ disableOutsideScroll: !0,
95
+ onFocusOutside: M(
96
+ e.onFocusOutside,
97
+ (c) => c.preventDefault(),
98
+ { checkForDefaultPrevented: !1 }
99
+ ),
100
+ onDismiss: () => t.onOpenChange(!1)
101
+ }
102
+ );
125
103
  }
126
- const f = I(o);
127
- if (f <= 0) {
128
- const u = o.ownerDocument, a = u.body, d = getComputedStyle(a), h = u.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, m = Math.abs(o.clientWidth - a.clientWidth - h);
129
- m <= K && (r -= m);
130
- } else f <= K && (r += f);
131
- return {
132
- width: r,
133
- height: s,
134
- x: c,
135
- y: l
136
- };
137
- }
138
- function Rt(t, e) {
139
- const i = L(t, !0, e === "fixed"), o = i.top + t.clientTop, n = i.left + t.clientLeft, r = T(t) ? F(t) : y(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = n * r.x, f = o * r.y;
140
- return {
141
- width: s,
142
- height: c,
143
- x: l,
144
- y: f
145
- };
146
- }
147
- function j(t, e, i) {
148
- let o;
149
- if (e === "viewport")
150
- o = vt(t, i);
151
- else if (e === "document")
152
- o = xt(b(t));
153
- else if (v(e))
154
- o = Rt(e, i);
155
- else {
156
- const n = tt(t);
157
- o = {
158
- x: e.x - n.x,
159
- y: e.y - n.y,
160
- width: e.width,
161
- height: e.height
104
+ ), xt = o.forwardRef((e, n) => {
105
+ const t = P(g, e.__scopeMenu);
106
+ return /* @__PURE__ */ a.jsx(
107
+ ee,
108
+ {
109
+ ...e,
110
+ ref: n,
111
+ trapFocus: !1,
112
+ disableOutsidePointerEvents: !1,
113
+ disableOutsideScroll: !1,
114
+ onDismiss: () => t.onOpenChange(!1)
115
+ }
116
+ );
117
+ }), gt = rt("MenuContent.ScrollLock"), ee = o.forwardRef(
118
+ (e, n) => {
119
+ const {
120
+ __scopeMenu: t,
121
+ loop: r = !1,
122
+ trapFocus: u,
123
+ onOpenAutoFocus: c,
124
+ onCloseAutoFocus: d,
125
+ disableOutsidePointerEvents: p,
126
+ onEntryFocus: h,
127
+ onEscapeKeyDown: m,
128
+ onPointerDownOutside: l,
129
+ onFocusOutside: s,
130
+ onInteractOutside: f,
131
+ onDismiss: x,
132
+ disableOutsideScroll: v,
133
+ ...E
134
+ } = e, y = P(g, t), S = F(g, t), De = Y(t), Ne = pe(t), re = dt(t), [Fe, ce] = o.useState(null), L = o.useRef(null), Le = k(n, L, y.onContentChange), K = o.useRef(0), G = o.useRef(""), Ke = o.useRef(0), H = o.useRef(null), se = o.useRef("right"), W = o.useRef(0), Ge = v ? st : o.Fragment, Ue = v ? { as: gt, allowPinchZoom: !0 } : void 0, Be = (i) => {
135
+ const I = G.current + i, _ = re().filter((C) => !C.disabled), b = document.activeElement, z = _.find((C) => C.ref.current === b)?.textValue, Z = _.map((C) => C.textValue), ae = jt(Z, I, z), T = _.find((C) => C.textValue === ae)?.ref.current;
136
+ (function C(ue) {
137
+ G.current = ue, window.clearTimeout(K.current), ue !== "" && (K.current = window.setTimeout(() => C(""), 1e3));
138
+ })(I), T && setTimeout(() => T.focus());
162
139
  };
140
+ o.useEffect(() => () => window.clearTimeout(K.current), []), ze();
141
+ const w = o.useCallback((i) => se.current === H.current?.side && kt(i, H.current?.area), []);
142
+ return /* @__PURE__ */ a.jsx(
143
+ ht,
144
+ {
145
+ scope: t,
146
+ searchRef: G,
147
+ onItemEnter: o.useCallback(
148
+ (i) => {
149
+ w(i) && i.preventDefault();
150
+ },
151
+ [w]
152
+ ),
153
+ onItemLeave: o.useCallback(
154
+ (i) => {
155
+ w(i) || (L.current?.focus(), ce(null));
156
+ },
157
+ [w]
158
+ ),
159
+ onTriggerLeave: o.useCallback(
160
+ (i) => {
161
+ w(i) && i.preventDefault();
162
+ },
163
+ [w]
164
+ ),
165
+ pointerGraceTimerRef: Ke,
166
+ onPointerGraceIntentChange: o.useCallback((i) => {
167
+ H.current = i;
168
+ }, []),
169
+ children: /* @__PURE__ */ a.jsx(Ge, { ...Ue, children: /* @__PURE__ */ a.jsx(
170
+ Ze,
171
+ {
172
+ asChild: !0,
173
+ trapped: u,
174
+ onMountAutoFocus: M(c, (i) => {
175
+ i.preventDefault(), L.current?.focus({ preventScroll: !0 });
176
+ }),
177
+ onUnmountAutoFocus: d,
178
+ children: /* @__PURE__ */ a.jsx(
179
+ We,
180
+ {
181
+ asChild: !0,
182
+ disableOutsidePointerEvents: p,
183
+ onEscapeKeyDown: m,
184
+ onPointerDownOutside: l,
185
+ onFocusOutside: s,
186
+ onInteractOutside: f,
187
+ onDismiss: x,
188
+ children: /* @__PURE__ */ a.jsx(
189
+ ot,
190
+ {
191
+ asChild: !0,
192
+ ...Ne,
193
+ dir: S.dir,
194
+ orientation: "vertical",
195
+ loop: r,
196
+ currentTabStopId: Fe,
197
+ onCurrentTabStopIdChange: ce,
198
+ onEntryFocus: M(h, (i) => {
199
+ S.isUsingKeyboardRef.current || i.preventDefault();
200
+ }),
201
+ preventScrollOnEntryFocus: !0,
202
+ children: /* @__PURE__ */ a.jsx(
203
+ Je,
204
+ {
205
+ role: "menu",
206
+ "aria-orientation": "vertical",
207
+ "data-state": ke(y.open),
208
+ "data-radix-menu-content": "",
209
+ dir: S.dir,
210
+ ...De,
211
+ ...E,
212
+ ref: Le,
213
+ style: { outline: "none", ...E.style },
214
+ onKeyDown: M(E.onKeyDown, (i) => {
215
+ const _ = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, z = i.key.length === 1;
216
+ _ && (i.key === "Tab" && i.preventDefault(), !b && z && Be(i.key));
217
+ const Z = L.current;
218
+ if (i.target !== Z || !ut.includes(i.key)) return;
219
+ i.preventDefault();
220
+ const T = re().filter((C) => !C.disabled).map((C) => C.ref.current);
221
+ me.includes(i.key) && T.reverse(), Tt(T);
222
+ }),
223
+ onBlur: M(e.onBlur, (i) => {
224
+ i.currentTarget.contains(i.target) || (window.clearTimeout(K.current), G.current = "");
225
+ }),
226
+ onPointerMove: M(
227
+ e.onPointerMove,
228
+ O((i) => {
229
+ const I = i.target, _ = W.current !== i.clientX;
230
+ if (i.currentTarget.contains(I) && _) {
231
+ const b = i.clientX > W.current ? "right" : "left";
232
+ se.current = b, W.current = i.clientX;
233
+ }
234
+ })
235
+ )
236
+ }
237
+ )
238
+ }
239
+ )
240
+ }
241
+ )
242
+ }
243
+ ) })
244
+ }
245
+ );
163
246
  }
164
- return J(o);
165
- }
166
- function it(t, e) {
167
- const i = S(t);
168
- return i === e || !v(i) || A(i) ? !1 : R(i).position === "fixed" || it(i, e);
169
- }
170
- function bt(t, e) {
171
- const i = e.get(t);
172
- if (i)
173
- return i;
174
- let o = $(t, [], !1).filter((c) => v(c) && _(c) !== "body"), n = null;
175
- const r = R(t).position === "fixed";
176
- let s = r ? S(t) : t;
177
- for (; v(s) && !A(s); ) {
178
- const c = R(s), l = Q(s);
179
- !l && c.position === "fixed" && (n = null), (r ? !l && !n : !l && c.position === "static" && !!n && (n.position === "absolute" || n.position === "fixed") || q(s) && !l && it(t, s)) ? o = o.filter((u) => u !== s) : n = c, s = S(s);
247
+ );
248
+ Ce.displayName = g;
249
+ var _t = "MenuGroup", te = o.forwardRef(
250
+ (e, n) => {
251
+ const { __scopeMenu: t, ...r } = e;
252
+ return /* @__PURE__ */ a.jsx(D.div, { role: "group", ...r, ref: n });
180
253
  }
181
- return e.set(t, o), o;
182
- }
183
- function Ct(t) {
184
- let {
185
- element: e,
186
- boundary: i,
187
- rootBoundary: o,
188
- strategy: n
189
- } = t;
190
- const s = [...i === "clippingAncestors" ? V(e) ? [] : bt(e, this._c) : [].concat(i), o], c = j(e, s[0], n);
191
- let l = c.top, f = c.right, u = c.bottom, a = c.left;
192
- for (let d = 1; d < s.length; d++) {
193
- const h = j(e, s[d], n);
194
- l = E(h.top, l), f = N(h.right, f), u = N(h.bottom, u), a = E(h.left, a);
254
+ );
255
+ te.displayName = _t;
256
+ var Rt = "MenuLabel", xe = o.forwardRef(
257
+ (e, n) => {
258
+ const { __scopeMenu: t, ...r } = e;
259
+ return /* @__PURE__ */ a.jsx(D.div, { ...r, ref: n });
195
260
  }
196
- return {
197
- width: f - a,
198
- height: u - l,
199
- x: a,
200
- y: l
201
- };
202
- }
203
- function Ot(t) {
204
- const {
205
- width: e,
206
- height: i
207
- } = Z(t);
208
- return {
209
- width: e,
210
- height: i
211
- };
212
- }
213
- function Lt(t, e, i) {
214
- const o = T(e), n = b(e), r = i === "fixed", s = L(t, !0, r, e);
215
- let c = {
216
- scrollLeft: 0,
217
- scrollTop: 0
218
- };
219
- const l = y(0);
220
- function f() {
221
- l.x = I(n);
261
+ );
262
+ xe.displayName = Rt;
263
+ var U = "MenuItem", ie = "menu.itemSelect", X = o.forwardRef(
264
+ (e, n) => {
265
+ const { disabled: t = !1, onSelect: r, ...u } = e, c = o.useRef(null), d = F(U, e.__scopeMenu), p = Q(U, e.__scopeMenu), h = k(n, c), m = o.useRef(!1), l = () => {
266
+ const s = c.current;
267
+ if (!t && s) {
268
+ const f = new CustomEvent(ie, { bubbles: !0, cancelable: !0 });
269
+ s.addEventListener(ie, (x) => r?.(x), { once: !0 }), tt(s, f), f.defaultPrevented ? m.current = !1 : d.onClose();
270
+ }
271
+ };
272
+ return /* @__PURE__ */ a.jsx(
273
+ ge,
274
+ {
275
+ ...u,
276
+ ref: h,
277
+ disabled: t,
278
+ onClick: M(e.onClick, l),
279
+ onPointerDown: (s) => {
280
+ e.onPointerDown?.(s), m.current = !0;
281
+ },
282
+ onPointerUp: M(e.onPointerUp, (s) => {
283
+ m.current || s.currentTarget?.click();
284
+ }),
285
+ onKeyDown: M(e.onKeyDown, (s) => {
286
+ const f = p.searchRef.current !== "";
287
+ t || f && s.key === " " || $.includes(s.key) && (s.currentTarget.click(), s.preventDefault());
288
+ })
289
+ }
290
+ );
291
+ }
292
+ );
293
+ X.displayName = U;
294
+ var ge = o.forwardRef(
295
+ (e, n) => {
296
+ const { __scopeMenu: t, disabled: r = !1, textValue: u, ...c } = e, d = Q(U, t), p = pe(t), h = o.useRef(null), m = k(n, h), [l, s] = o.useState(!1), [f, x] = o.useState("");
297
+ return o.useEffect(() => {
298
+ const v = h.current;
299
+ v && x((v.textContent ?? "").trim());
300
+ }, [c.children]), /* @__PURE__ */ a.jsx(
301
+ j.ItemSlot,
302
+ {
303
+ scope: t,
304
+ disabled: r,
305
+ textValue: u ?? f,
306
+ children: /* @__PURE__ */ a.jsx(nt, { asChild: !0, ...p, focusable: !r, children: /* @__PURE__ */ a.jsx(
307
+ D.div,
308
+ {
309
+ role: "menuitem",
310
+ "data-highlighted": l ? "" : void 0,
311
+ "aria-disabled": r || void 0,
312
+ "data-disabled": r ? "" : void 0,
313
+ ...c,
314
+ ref: m,
315
+ onPointerMove: M(
316
+ e.onPointerMove,
317
+ O((v) => {
318
+ r ? d.onItemLeave(v) : (d.onItemEnter(v), v.defaultPrevented || v.currentTarget.focus({ preventScroll: !0 }));
319
+ })
320
+ ),
321
+ onPointerLeave: M(
322
+ e.onPointerLeave,
323
+ O((v) => d.onItemLeave(v))
324
+ ),
325
+ onFocus: M(e.onFocus, () => s(!0)),
326
+ onBlur: M(e.onBlur, () => s(!1))
327
+ }
328
+ ) })
329
+ }
330
+ );
331
+ }
332
+ ), Pt = "MenuCheckboxItem", _e = o.forwardRef(
333
+ (e, n) => {
334
+ const { checked: t = !1, onCheckedChange: r, ...u } = e;
335
+ return /* @__PURE__ */ a.jsx(we, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ a.jsx(
336
+ X,
337
+ {
338
+ role: "menuitemcheckbox",
339
+ "aria-checked": B(t) ? "mixed" : t,
340
+ ...u,
341
+ ref: n,
342
+ "data-state": oe(t),
343
+ onSelect: M(
344
+ u.onSelect,
345
+ () => r?.(B(t) ? !0 : !t),
346
+ { checkForDefaultPrevented: !1 }
347
+ )
348
+ }
349
+ ) });
350
+ }
351
+ );
352
+ _e.displayName = Pt;
353
+ var Re = "MenuRadioGroup", [Et, St] = R(
354
+ Re,
355
+ { value: void 0, onValueChange: () => {
356
+ } }
357
+ ), Pe = o.forwardRef(
358
+ (e, n) => {
359
+ const { value: t, onValueChange: r, ...u } = e, c = fe(r);
360
+ return /* @__PURE__ */ a.jsx(Et, { scope: e.__scopeMenu, value: t, onValueChange: c, children: /* @__PURE__ */ a.jsx(te, { ...u, ref: n }) });
361
+ }
362
+ );
363
+ Pe.displayName = Re;
364
+ var Ee = "MenuRadioItem", Se = o.forwardRef(
365
+ (e, n) => {
366
+ const { value: t, ...r } = e, u = St(Ee, e.__scopeMenu), c = t === u.value;
367
+ return /* @__PURE__ */ a.jsx(we, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ a.jsx(
368
+ X,
369
+ {
370
+ role: "menuitemradio",
371
+ "aria-checked": c,
372
+ ...r,
373
+ ref: n,
374
+ "data-state": oe(c),
375
+ onSelect: M(
376
+ r.onSelect,
377
+ () => u.onValueChange?.(t),
378
+ { checkForDefaultPrevented: !1 }
379
+ )
380
+ }
381
+ ) });
382
+ }
383
+ );
384
+ Se.displayName = Ee;
385
+ var ne = "MenuItemIndicator", [we, wt] = R(
386
+ ne,
387
+ { checked: !1 }
388
+ ), Ie = o.forwardRef(
389
+ (e, n) => {
390
+ const { __scopeMenu: t, forceMount: r, ...u } = e, c = wt(ne, t);
391
+ return /* @__PURE__ */ a.jsx(
392
+ V,
393
+ {
394
+ present: r || B(c.checked) || c.checked === !0,
395
+ children: /* @__PURE__ */ a.jsx(
396
+ D.span,
397
+ {
398
+ ...u,
399
+ ref: n,
400
+ "data-state": oe(c.checked)
401
+ }
402
+ )
403
+ }
404
+ );
405
+ }
406
+ );
407
+ Ie.displayName = ne;
408
+ var It = "MenuSeparator", ye = o.forwardRef(
409
+ (e, n) => {
410
+ const { __scopeMenu: t, ...r } = e;
411
+ return /* @__PURE__ */ a.jsx(
412
+ D.div,
413
+ {
414
+ role: "separator",
415
+ "aria-orientation": "horizontal",
416
+ ...r,
417
+ ref: n
418
+ }
419
+ );
420
+ }
421
+ );
422
+ ye.displayName = It;
423
+ var yt = "MenuArrow", be = o.forwardRef(
424
+ (e, n) => {
425
+ const { __scopeMenu: t, ...r } = e, u = Y(t);
426
+ return /* @__PURE__ */ a.jsx(Qe, { ...u, ...r, ref: n });
427
+ }
428
+ );
429
+ be.displayName = yt;
430
+ var bt = "MenuSub", [en, Te] = R(bt), A = "MenuSubTrigger", Ae = o.forwardRef(
431
+ (e, n) => {
432
+ const t = P(A, e.__scopeMenu), r = F(A, e.__scopeMenu), u = Te(A, e.__scopeMenu), c = Q(A, e.__scopeMenu), d = o.useRef(null), { pointerGraceTimerRef: p, onPointerGraceIntentChange: h } = c, m = { __scopeMenu: e.__scopeMenu }, l = o.useCallback(() => {
433
+ d.current && window.clearTimeout(d.current), d.current = null;
434
+ }, []);
435
+ return o.useEffect(() => l, [l]), o.useEffect(() => {
436
+ const s = p.current;
437
+ return () => {
438
+ window.clearTimeout(s), h(null);
439
+ };
440
+ }, [p, h]), /* @__PURE__ */ a.jsx(q, { asChild: !0, ...m, children: /* @__PURE__ */ a.jsx(
441
+ ge,
442
+ {
443
+ id: u.triggerId,
444
+ "aria-haspopup": "menu",
445
+ "aria-expanded": t.open,
446
+ "aria-controls": u.contentId,
447
+ "data-state": ke(t.open),
448
+ ...e,
449
+ ref: Ye(n, u.onTriggerChange),
450
+ onClick: (s) => {
451
+ e.onClick?.(s), !(e.disabled || s.defaultPrevented) && (s.currentTarget.focus(), t.open || t.onOpenChange(!0));
452
+ },
453
+ onPointerMove: M(
454
+ e.onPointerMove,
455
+ O((s) => {
456
+ c.onItemEnter(s), !s.defaultPrevented && !e.disabled && !t.open && !d.current && (c.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
457
+ t.onOpenChange(!0), l();
458
+ }, 100));
459
+ })
460
+ ),
461
+ onPointerLeave: M(
462
+ e.onPointerLeave,
463
+ O((s) => {
464
+ l();
465
+ const f = t.content?.getBoundingClientRect();
466
+ if (f) {
467
+ const x = t.content?.dataset.side, v = x === "right", E = v ? -5 : 5, y = f[v ? "left" : "right"], S = f[v ? "right" : "left"];
468
+ c.onPointerGraceIntentChange({
469
+ area: [
470
+ // Apply a bleed on clientX to ensure that our exit point is
471
+ // consistently within polygon bounds
472
+ { x: s.clientX + E, y: s.clientY },
473
+ { x: y, y: f.top },
474
+ { x: S, y: f.top },
475
+ { x: S, y: f.bottom },
476
+ { x: y, y: f.bottom }
477
+ ],
478
+ side: x
479
+ }), window.clearTimeout(p.current), p.current = window.setTimeout(
480
+ () => c.onPointerGraceIntentChange(null),
481
+ 300
482
+ );
483
+ } else {
484
+ if (c.onTriggerLeave(s), s.defaultPrevented) return;
485
+ c.onPointerGraceIntentChange(null);
486
+ }
487
+ })
488
+ ),
489
+ onKeyDown: M(e.onKeyDown, (s) => {
490
+ const f = c.searchRef.current !== "";
491
+ e.disabled || f && s.key === " " || it[r.dir].includes(s.key) && (t.onOpenChange(!0), t.content?.focus(), s.preventDefault());
492
+ })
493
+ }
494
+ ) });
495
+ }
496
+ );
497
+ Ae.displayName = A;
498
+ var je = "MenuSubContent", Oe = o.forwardRef(
499
+ (e, n) => {
500
+ const t = Me(g, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, c = P(g, e.__scopeMenu), d = F(g, e.__scopeMenu), p = Te(je, e.__scopeMenu), h = o.useRef(null), m = k(n, h);
501
+ return /* @__PURE__ */ a.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(V, { present: r || c.open, children: /* @__PURE__ */ a.jsx(j.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(
502
+ ee,
503
+ {
504
+ id: p.contentId,
505
+ "aria-labelledby": p.triggerId,
506
+ ...u,
507
+ ref: m,
508
+ align: "start",
509
+ side: d.dir === "rtl" ? "left" : "right",
510
+ disableOutsidePointerEvents: !1,
511
+ disableOutsideScroll: !1,
512
+ trapFocus: !1,
513
+ onOpenAutoFocus: (l) => {
514
+ d.isUsingKeyboardRef.current && h.current?.focus(), l.preventDefault();
515
+ },
516
+ onCloseAutoFocus: (l) => l.preventDefault(),
517
+ onFocusOutside: M(e.onFocusOutside, (l) => {
518
+ l.target !== p.trigger && c.onOpenChange(!1);
519
+ }),
520
+ onEscapeKeyDown: M(e.onEscapeKeyDown, (l) => {
521
+ d.onClose(), l.preventDefault();
522
+ }),
523
+ onKeyDown: M(e.onKeyDown, (l) => {
524
+ const s = l.currentTarget.contains(l.target), f = lt[d.dir].includes(l.key);
525
+ s && f && (c.onOpenChange(!1), p.trigger?.focus(), l.preventDefault());
526
+ })
527
+ }
528
+ ) }) }) });
222
529
  }
223
- if (o || !o && !r)
224
- if ((_(e) !== "body" || q(n)) && (c = H(e)), o) {
225
- const h = L(e, !0, r, e);
226
- l.x = h.x + e.clientLeft, l.y = h.y + e.clientTop;
227
- } else n && f();
228
- r && !o && n && f();
229
- const u = n && !o && !r ? et(n, c) : y(0), a = s.left + c.scrollLeft - l.x - u.x, d = s.top + c.scrollTop - l.y - u.y;
230
- return {
231
- x: a,
232
- y: d,
233
- width: s.width,
234
- height: s.height
235
- };
530
+ );
531
+ Oe.displayName = je;
532
+ function ke(e) {
533
+ return e ? "open" : "closed";
236
534
  }
237
- function M(t) {
238
- return R(t).position === "static";
535
+ function B(e) {
536
+ return e === "indeterminate";
239
537
  }
240
- function G(t, e) {
241
- if (!T(t) || R(t).position === "fixed")
242
- return null;
243
- if (e)
244
- return e(t);
245
- let i = t.offsetParent;
246
- return b(t) === i && (i = i.ownerDocument.body), i;
538
+ function oe(e) {
539
+ return B(e) ? "indeterminate" : e ? "checked" : "unchecked";
247
540
  }
248
- function ot(t, e) {
249
- const i = O(t);
250
- if (V(t))
251
- return i;
252
- if (!T(t)) {
253
- let n = S(t);
254
- for (; n && !A(n); ) {
255
- if (v(n) && !M(n))
256
- return n;
257
- n = S(n);
258
- }
259
- return i;
260
- }
261
- let o = G(t, e);
262
- for (; o && dt(o) && M(o); )
263
- o = G(o, e);
264
- return o && A(o) && M(o) && !Q(o) ? i : o || gt(t) || i;
541
+ function Tt(e) {
542
+ const n = document.activeElement;
543
+ for (const t of e)
544
+ if (t === n || (t.focus(), document.activeElement !== n)) return;
265
545
  }
266
- const Tt = async function(t) {
267
- const e = this.getOffsetParent || ot, i = this.getDimensions, o = await i(t.floating);
268
- return {
269
- reference: Lt(t.reference, await e(t.floating), t.strategy),
270
- floating: {
271
- x: 0,
272
- y: 0,
273
- width: o.width,
274
- height: o.height
275
- }
276
- };
277
- };
278
- function Et(t) {
279
- return R(t).direction === "rtl";
546
+ function At(e, n) {
547
+ return e.map((t, r) => e[(n + r) % e.length]);
280
548
  }
281
- const Ft = {
282
- convertOffsetParentRelativeRectToViewportRelativeRect: wt,
283
- getDocumentElement: b,
284
- getClippingRect: Ct,
285
- getOffsetParent: ot,
286
- getElementRects: Tt,
287
- getClientRects: yt,
288
- getDimensions: Ot,
289
- getScale: F,
290
- isElement: v,
291
- isRTL: Et
292
- };
293
- function nt(t, e) {
294
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
549
+ function jt(e, n, t) {
550
+ const u = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, c = t ? e.indexOf(t) : -1;
551
+ let d = At(e, Math.max(c, 0));
552
+ u.length === 1 && (d = d.filter((m) => m !== t));
553
+ const h = d.find(
554
+ (m) => m.toLowerCase().startsWith(u.toLowerCase())
555
+ );
556
+ return h !== t ? h : void 0;
295
557
  }
296
- function St(t, e) {
297
- let i = null, o;
298
- const n = b(t);
299
- function r() {
300
- var c;
301
- clearTimeout(o), (c = i) == null || c.disconnect(), i = null;
302
- }
303
- function s(c, l) {
304
- c === void 0 && (c = !1), l === void 0 && (l = 1), r();
305
- const f = t.getBoundingClientRect(), {
306
- left: u,
307
- top: a,
308
- width: d,
309
- height: h
310
- } = f;
311
- if (c || e(), !d || !h)
312
- return;
313
- const m = D(a), p = D(n.clientWidth - (u + d)), w = D(n.clientHeight - (a + h)), g = D(u), C = {
314
- rootMargin: -m + "px " + -p + "px " + -w + "px " + -g + "px",
315
- threshold: E(0, N(1, l)) || 1
316
- };
317
- let W = !0;
318
- function k(P) {
319
- const B = P[0].intersectionRatio;
320
- if (B !== l) {
321
- if (!W)
322
- return s();
323
- B ? s(!1, B) : o = setTimeout(() => {
324
- s(!1, 1e-7);
325
- }, 1e3);
326
- }
327
- B === 1 && !nt(f, t.getBoundingClientRect()) && s(), W = !1;
328
- }
329
- try {
330
- i = new IntersectionObserver(k, {
331
- ...C,
332
- // Handle <iframe>s
333
- root: n.ownerDocument
334
- });
335
- } catch {
336
- i = new IntersectionObserver(k, C);
337
- }
338
- i.observe(t);
558
+ function Ot(e, n) {
559
+ const { x: t, y: r } = e;
560
+ let u = !1;
561
+ for (let c = 0, d = n.length - 1; c < n.length; d = c++) {
562
+ const p = n[c], h = n[d], m = p.x, l = p.y, s = h.x, f = h.y;
563
+ l > r != f > r && t < (s - m) * (r - l) / (f - l) + m && (u = !u);
339
564
  }
340
- return s(!0), r;
565
+ return u;
341
566
  }
342
- function zt(t, e, i, o) {
343
- o === void 0 && (o = {});
344
- const {
345
- ancestorScroll: n = !0,
346
- ancestorResize: r = !0,
347
- elementResize: s = typeof ResizeObserver == "function",
348
- layoutShift: c = typeof IntersectionObserver == "function",
349
- animationFrame: l = !1
350
- } = o, f = X(t), u = n || r ? [...f ? $(f) : [], ...e ? $(e) : []] : [];
351
- u.forEach((g) => {
352
- n && g.addEventListener("scroll", i, {
353
- passive: !0
354
- }), r && g.addEventListener("resize", i);
355
- });
356
- const a = f && c ? St(f, i) : null;
357
- let d = -1, h = null;
358
- s && (h = new ResizeObserver((g) => {
359
- let [x] = g;
360
- x && x.target === f && h && e && (h.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
361
- var C;
362
- (C = h) == null || C.observe(e);
363
- })), i();
364
- }), f && !l && h.observe(f), e && h.observe(e));
365
- let m, p = l ? L(t) : null;
366
- l && w();
367
- function w() {
368
- const g = L(t);
369
- p && !nt(p, g) && i(), p = g, m = requestAnimationFrame(w);
370
- }
371
- return i(), () => {
372
- var g;
373
- u.forEach((x) => {
374
- n && x.removeEventListener("scroll", i), r && x.removeEventListener("resize", i);
375
- }), a?.(), (g = h) == null || g.disconnect(), h = null, l && cancelAnimationFrame(m);
376
- };
567
+ function kt(e, n) {
568
+ if (!n) return !1;
569
+ const t = { x: e.clientX, y: e.clientY };
570
+ return Ot(t, n);
377
571
  }
378
- const At = rt, Ht = ct, It = lt, Mt = ft, Nt = ut, $t = ht, Vt = at, _t = (t, e, i) => {
379
- const o = /* @__PURE__ */ new Map(), n = {
380
- platform: Ft,
381
- ...i
382
- }, r = {
383
- ...n.platform,
384
- _c: o
385
- };
386
- return st(t, e, {
387
- ...n,
388
- platform: r
389
- });
390
- };
572
+ function O(e) {
573
+ return (n) => n.pointerType === "mouse" ? e(n) : void 0;
574
+ }
575
+ var tn = ve, nn = q, on = he, rn = Ce, cn = te, sn = xe, an = X, un = _e, ln = Pe, dn = Se, fn = Ie, mn = ye, pn = be, vn = Ae, Mn = Oe;
391
576
  export {
392
- $t as arrow,
393
- zt as autoUpdate,
394
- _t as computePosition,
395
- It as flip,
396
- $ as getOverflowAncestors,
397
- Nt as hide,
398
- Vt as limitShift,
399
- At as offset,
400
- Ft as platform,
401
- Ht as shift,
402
- Mt as size
577
+ nn as Anchor,
578
+ pn as Arrow,
579
+ un as CheckboxItem,
580
+ rn as Content,
581
+ cn as Group,
582
+ an as Item,
583
+ fn as ItemIndicator,
584
+ sn as Label,
585
+ ve as Menu,
586
+ q as MenuAnchor,
587
+ be as MenuArrow,
588
+ _e as MenuCheckboxItem,
589
+ Ce as MenuContent,
590
+ te as MenuGroup,
591
+ X as MenuItem,
592
+ Ie as MenuItemIndicator,
593
+ xe as MenuLabel,
594
+ he as MenuPortal,
595
+ Pe as MenuRadioGroup,
596
+ Se as MenuRadioItem,
597
+ ye as MenuSeparator,
598
+ Oe as MenuSubContent,
599
+ Ae as MenuSubTrigger,
600
+ on as Portal,
601
+ ln as RadioGroup,
602
+ dn as RadioItem,
603
+ tn as Root,
604
+ mn as Separator,
605
+ Mn as SubContent,
606
+ vn as SubTrigger,
607
+ Qt as createMenuScope
403
608
  };
404
609
  //# sourceMappingURL=index157.js.map