@rpcbase/ui 0.185.0 → 0.187.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 (484) hide show
  1. package/dist/helpers/useScrollPagination.d.ts.map +1 -1
  2. package/dist/index100.js +4 -107
  3. package/dist/index100.js.map +1 -1
  4. package/dist/index101.js +6 -262
  5. package/dist/index101.js.map +1 -1
  6. package/dist/index102.js +5 -9
  7. package/dist/index102.js.map +1 -1
  8. package/dist/index103.js +4 -42
  9. package/dist/index103.js.map +1 -1
  10. package/dist/index104.js +5 -4
  11. package/dist/index104.js.map +1 -1
  12. package/dist/index105.js +4 -46
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +9 -52
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js +5 -4
  17. package/dist/index107.js.map +1 -1
  18. package/dist/index108.js +3 -3
  19. package/dist/index108.js.map +1 -1
  20. package/dist/index109.js +4 -15
  21. package/dist/index109.js.map +1 -1
  22. package/dist/index110.js +5 -4
  23. package/dist/index110.js.map +1 -1
  24. package/dist/index111.js +145 -7
  25. package/dist/index111.js.map +1 -1
  26. package/dist/index112.js +39 -16
  27. package/dist/index112.js.map +1 -1
  28. package/dist/index113.js +4 -4
  29. package/dist/index113.js.map +1 -1
  30. package/dist/index114.js +7 -4
  31. package/dist/index114.js.map +1 -1
  32. package/dist/index115.js +13 -5
  33. package/dist/index115.js.map +1 -1
  34. package/dist/index116.js +13 -5
  35. package/dist/index116.js.map +1 -1
  36. package/dist/index117.js +7 -4
  37. package/dist/index117.js.map +1 -1
  38. package/dist/index118.js +31 -4
  39. package/dist/index118.js.map +1 -1
  40. package/dist/index119.js +10 -6
  41. package/dist/index119.js.map +1 -1
  42. package/dist/index120.js +10 -24
  43. package/dist/index120.js.map +1 -1
  44. package/dist/index121.js +8 -6
  45. package/dist/index121.js.map +1 -1
  46. package/dist/index122.js +13 -4
  47. package/dist/index122.js.map +1 -1
  48. package/dist/index123.js +101 -6
  49. package/dist/index123.js.map +1 -1
  50. package/dist/index124.js +20 -6
  51. package/dist/index124.js.map +1 -1
  52. package/dist/index125.js +53 -4
  53. package/dist/index125.js.map +1 -1
  54. package/dist/index126.js +72 -5
  55. package/dist/index126.js.map +1 -1
  56. package/dist/index127.js +9 -4
  57. package/dist/index127.js.map +1 -1
  58. package/dist/index128.js +20 -8
  59. package/dist/index128.js.map +1 -1
  60. package/dist/index129.js +16 -5
  61. package/dist/index129.js.map +1 -1
  62. package/dist/index130.js +23 -4
  63. package/dist/index130.js.map +1 -1
  64. package/dist/index131.js +6 -4
  65. package/dist/index131.js.map +1 -1
  66. package/dist/index132.js +5 -6
  67. package/dist/index132.js.map +1 -1
  68. package/dist/index133.js +23 -145
  69. package/dist/index133.js.map +1 -1
  70. package/dist/index134.js +34 -39
  71. package/dist/index134.js.map +1 -1
  72. package/dist/index135.js +16 -5
  73. package/dist/index135.js.map +1 -1
  74. package/dist/index136.js +6 -7
  75. package/dist/index136.js.map +1 -1
  76. package/dist/index137.js +4 -13
  77. package/dist/index137.js.map +1 -1
  78. package/dist/index138.js +4 -13
  79. package/dist/index138.js.map +1 -1
  80. package/dist/index139.js +4 -7
  81. package/dist/index139.js.map +1 -1
  82. package/dist/index140.js +4 -31
  83. package/dist/index140.js.map +1 -1
  84. package/dist/index141.js +3 -10
  85. package/dist/index141.js.map +1 -1
  86. package/dist/index142.js +6 -10
  87. package/dist/index142.js.map +1 -1
  88. package/dist/index143.js +24 -9
  89. package/dist/index143.js.map +1 -1
  90. package/dist/index144.js +7 -13
  91. package/dist/index144.js.map +1 -1
  92. package/dist/index145.js +6 -101
  93. package/dist/index145.js.map +1 -1
  94. package/dist/index146.js +6 -20
  95. package/dist/index146.js.map +1 -1
  96. package/dist/index147.js +3 -53
  97. package/dist/index147.js.map +1 -1
  98. package/dist/index148.js +3 -72
  99. package/dist/index148.js.map +1 -1
  100. package/dist/index149.js +4 -9
  101. package/dist/index149.js.map +1 -1
  102. package/dist/index150.js +3 -20
  103. package/dist/index150.js.map +1 -1
  104. package/dist/index151.js +4 -16
  105. package/dist/index151.js.map +1 -1
  106. package/dist/index152.js +3 -23
  107. package/dist/index152.js.map +1 -1
  108. package/dist/index153.js +3 -6
  109. package/dist/index153.js.map +1 -1
  110. package/dist/index154.js +3 -5
  111. package/dist/index154.js.map +1 -1
  112. package/dist/index155.js +42 -19
  113. package/dist/index155.js.map +1 -1
  114. package/dist/index156.js +45 -33
  115. package/dist/index156.js.map +1 -1
  116. package/dist/index157.js +206 -16
  117. package/dist/index157.js.map +1 -1
  118. package/dist/index158.js +22 -7
  119. package/dist/index158.js.map +1 -1
  120. package/dist/index159.js +24 -4
  121. package/dist/index159.js.map +1 -1
  122. package/dist/index160.js +399 -4
  123. package/dist/index160.js.map +1 -1
  124. package/dist/index161.js +5 -4
  125. package/dist/index161.js.map +1 -1
  126. package/dist/index162.js +68 -4
  127. package/dist/index162.js.map +1 -1
  128. package/dist/index163.js +2 -4
  129. package/dist/index163.js.map +1 -1
  130. package/dist/index164.js +363 -6
  131. package/dist/index164.js.map +1 -1
  132. package/dist/index165.js +262 -24
  133. package/dist/index165.js.map +1 -1
  134. package/dist/index166.js +60 -7
  135. package/dist/index166.js.map +1 -1
  136. package/dist/index167.js +46 -6
  137. package/dist/index167.js.map +1 -1
  138. package/dist/index168.js +169 -5
  139. package/dist/index168.js.map +1 -1
  140. package/dist/index169.js +109 -3
  141. package/dist/index169.js.map +1 -1
  142. package/dist/index170.js +24 -3
  143. package/dist/index170.js.map +1 -1
  144. package/dist/index171.js +8 -5
  145. package/dist/index171.js.map +1 -1
  146. package/dist/index172.js +4 -3
  147. package/dist/index172.js.map +1 -1
  148. package/dist/index173.js +5 -4
  149. package/dist/index173.js.map +1 -1
  150. package/dist/index174.js +4 -3
  151. package/dist/index174.js.map +1 -1
  152. package/dist/index175.js +466 -3
  153. package/dist/index175.js.map +1 -1
  154. package/dist/index176.js +185 -3
  155. package/dist/index176.js.map +1 -1
  156. package/dist/index177.js +103 -42
  157. package/dist/index177.js.map +1 -1
  158. package/dist/index178.js +253 -196
  159. package/dist/index178.js.map +1 -1
  160. package/dist/index179.js +10 -22
  161. package/dist/index179.js.map +1 -1
  162. package/dist/index180.js +42 -24
  163. package/dist/index180.js.map +1 -1
  164. package/dist/index181.js +4 -399
  165. package/dist/index181.js.map +1 -1
  166. package/dist/index182.js +13 -13
  167. package/dist/index183.js +58 -13
  168. package/dist/index183.js.map +1 -1
  169. package/dist/index184.js +8 -154
  170. package/dist/index184.js.map +1 -1
  171. package/dist/index185.js +64 -28
  172. package/dist/index185.js.map +1 -1
  173. package/dist/index186.js +19 -9
  174. package/dist/index186.js.map +1 -1
  175. package/dist/index187.js +14 -45
  176. package/dist/index187.js.map +1 -1
  177. package/dist/index188.js +5 -11
  178. package/dist/index188.js.map +1 -1
  179. package/dist/index189.js +4 -43
  180. package/dist/index189.js.map +1 -1
  181. package/dist/index190.js +6 -95
  182. package/dist/index190.js.map +1 -1
  183. package/dist/index191.js +4 -86
  184. package/dist/index191.js.map +1 -1
  185. package/dist/index192.js +7 -105
  186. package/dist/index192.js.map +1 -1
  187. package/dist/index193.js +17 -52
  188. package/dist/index193.js.map +1 -1
  189. package/dist/index194.js +5 -11
  190. package/dist/index194.js.map +1 -1
  191. package/dist/index195.js +5 -37
  192. package/dist/index195.js.map +1 -1
  193. package/dist/index196.js +13 -8
  194. package/dist/index196.js.map +1 -1
  195. package/dist/index197.js +10 -116
  196. package/dist/index197.js.map +1 -1
  197. package/dist/index198.js +14 -17
  198. package/dist/index198.js.map +1 -1
  199. package/dist/index199.js +14 -15
  200. package/dist/index199.js.map +1 -1
  201. package/dist/index200.js +5 -3
  202. package/dist/index200.js.map +1 -1
  203. package/dist/index201.js +6 -36
  204. package/dist/index201.js.map +1 -1
  205. package/dist/index202.js +7 -20
  206. package/dist/index202.js.map +1 -1
  207. package/dist/index203.js +6 -9
  208. package/dist/index203.js.map +1 -1
  209. package/dist/index204.js +9 -8
  210. package/dist/index204.js.map +1 -1
  211. package/dist/index205.js +5 -19
  212. package/dist/index205.js.map +1 -1
  213. package/dist/index206.js +5 -28
  214. package/dist/index206.js.map +1 -1
  215. package/dist/index207.js +9 -16
  216. package/dist/index207.js.map +1 -1
  217. package/dist/index208.js +5 -58
  218. package/dist/index208.js.map +1 -1
  219. package/dist/index209.js +5 -8
  220. package/dist/index209.js.map +1 -1
  221. package/dist/index210.js +4 -66
  222. package/dist/index210.js.map +1 -1
  223. package/dist/index211.js +11 -19
  224. package/dist/index211.js.map +1 -1
  225. package/dist/index212.js +10 -16
  226. package/dist/index212.js.map +1 -1
  227. package/dist/index213.js +10 -5
  228. package/dist/index213.js.map +1 -1
  229. package/dist/index214.js +11 -5
  230. package/dist/index214.js.map +1 -1
  231. package/dist/index215.js +11 -6
  232. package/dist/index215.js.map +1 -1
  233. package/dist/index216.js +10 -4
  234. package/dist/index216.js.map +1 -1
  235. package/dist/index217.js +6 -6
  236. package/dist/index217.js.map +1 -1
  237. package/dist/index218.js +6 -17
  238. package/dist/index218.js.map +1 -1
  239. package/dist/index219.js +5 -5
  240. package/dist/index219.js.map +1 -1
  241. package/dist/index220.js +6 -5
  242. package/dist/index220.js.map +1 -1
  243. package/dist/index221.js +7 -13
  244. package/dist/index221.js.map +1 -1
  245. package/dist/index222.js +5 -9
  246. package/dist/index222.js.map +1 -1
  247. package/dist/index223.js +55 -14
  248. package/dist/index223.js.map +1 -1
  249. package/dist/index224.js +16 -14
  250. package/dist/index224.js.map +1 -1
  251. package/dist/index225.js +7 -5
  252. package/dist/index225.js.map +1 -1
  253. package/dist/index226.js +10 -6
  254. package/dist/index226.js.map +1 -1
  255. package/dist/index227.js +10 -7
  256. package/dist/index227.js.map +1 -1
  257. package/dist/index228.js +21 -6
  258. package/dist/index228.js.map +1 -1
  259. package/dist/index229.js +10 -9
  260. package/dist/index229.js.map +1 -1
  261. package/dist/index230.js +9 -5
  262. package/dist/index230.js.map +1 -1
  263. package/dist/index231.js +9 -5
  264. package/dist/index231.js.map +1 -1
  265. package/dist/index232.js +4 -9
  266. package/dist/index232.js.map +1 -1
  267. package/dist/index233.js +5 -5
  268. package/dist/index233.js.map +1 -1
  269. package/dist/index234.js +16 -5
  270. package/dist/index234.js.map +1 -1
  271. package/dist/index235.js +9 -4
  272. package/dist/index235.js.map +1 -1
  273. package/dist/index236.js +18 -11
  274. package/dist/index236.js.map +1 -1
  275. package/dist/index237.js +15 -10
  276. package/dist/index237.js.map +1 -1
  277. package/dist/index238.js +12 -10
  278. package/dist/index238.js.map +1 -1
  279. package/dist/index239.js +29 -11
  280. package/dist/index239.js.map +1 -1
  281. package/dist/index24.js +1 -1
  282. package/dist/index240.js +12 -11
  283. package/dist/index240.js.map +1 -1
  284. package/dist/index241.js +25 -10
  285. package/dist/index241.js.map +1 -1
  286. package/dist/index242.js +5 -7
  287. package/dist/index242.js.map +1 -1
  288. package/dist/index243.js +24 -6
  289. package/dist/index243.js.map +1 -1
  290. package/dist/index244.js +29 -6
  291. package/dist/index244.js.map +1 -1
  292. package/dist/index245.js +5 -7
  293. package/dist/index245.js.map +1 -1
  294. package/dist/index246.js +13 -7
  295. package/dist/index246.js.map +1 -1
  296. package/dist/index247.js +154 -6
  297. package/dist/index247.js.map +1 -1
  298. package/dist/index248.js +28 -53
  299. package/dist/index248.js.map +1 -1
  300. package/dist/index249.js +9 -16
  301. package/dist/index249.js.map +1 -1
  302. package/dist/index250.js +47 -7
  303. package/dist/index250.js.map +1 -1
  304. package/dist/index251.js +11 -10
  305. package/dist/index251.js.map +1 -1
  306. package/dist/index252.js +43 -9
  307. package/dist/index252.js.map +1 -1
  308. package/dist/index253.js +93 -19
  309. package/dist/index253.js.map +1 -1
  310. package/dist/index254.js +86 -10
  311. package/dist/index254.js.map +1 -1
  312. package/dist/index255.js +105 -9
  313. package/dist/index255.js.map +1 -1
  314. package/dist/index256.js +52 -9
  315. package/dist/index256.js.map +1 -1
  316. package/dist/index257.js +11 -4
  317. package/dist/index257.js.map +1 -1
  318. package/dist/index258.js +37 -5
  319. package/dist/index258.js.map +1 -1
  320. package/dist/index259.js +8 -16
  321. package/dist/index259.js.map +1 -1
  322. package/dist/index260.js +3 -9
  323. package/dist/index260.js.map +1 -1
  324. package/dist/index261.js +9 -18
  325. package/dist/index261.js.map +1 -1
  326. package/dist/index262.js +115 -14
  327. package/dist/index262.js.map +1 -1
  328. package/dist/index263.js +17 -12
  329. package/dist/index263.js.map +1 -1
  330. package/dist/index264.js +14 -28
  331. package/dist/index264.js.map +1 -1
  332. package/dist/index265.js +34 -10
  333. package/dist/index265.js.map +1 -1
  334. package/dist/index266.js +19 -24
  335. package/dist/index266.js.map +1 -1
  336. package/dist/index267.js +8 -5
  337. package/dist/index267.js.map +1 -1
  338. package/dist/index268.js +19 -24
  339. package/dist/index268.js.map +1 -1
  340. package/dist/index269.js +29 -29
  341. package/dist/index269.js.map +1 -1
  342. package/dist/index270.js +17 -5
  343. package/dist/index270.js.map +1 -1
  344. package/dist/index271.js +2 -2
  345. package/dist/index272.js +9 -9
  346. package/dist/index273.js +1 -1
  347. package/dist/index274.js +4 -20
  348. package/dist/index274.js.map +1 -1
  349. package/dist/index275.js +19 -5
  350. package/dist/index275.js.map +1 -1
  351. package/dist/index276.js +13 -19
  352. package/dist/index276.js.map +1 -1
  353. package/dist/index277.js +5 -13
  354. package/dist/index277.js.map +1 -1
  355. package/dist/index278.js +3 -5
  356. package/dist/index278.js.map +1 -1
  357. package/dist/index279.js +24 -3
  358. package/dist/index279.js.map +1 -1
  359. package/dist/index280.js +111 -22
  360. package/dist/index280.js.map +1 -1
  361. package/dist/index281.js +14 -111
  362. package/dist/index281.js.map +1 -1
  363. package/dist/index282.js +523 -14
  364. package/dist/index282.js.map +1 -1
  365. package/dist/index283.js +114 -511
  366. package/dist/index283.js.map +1 -1
  367. package/dist/index284.js +117 -111
  368. package/dist/index284.js.map +1 -1
  369. package/dist/index285.js +20 -133
  370. package/dist/index285.js.map +1 -1
  371. package/dist/index293.js +2 -2
  372. package/dist/index296.js +1 -1
  373. package/dist/index297.js +2 -2
  374. package/dist/index299.js +1 -1
  375. package/dist/index300.js +1 -1
  376. package/dist/index301.js +1 -1
  377. package/dist/index302.js +1 -1
  378. package/dist/index303.js +1 -1
  379. package/dist/index304.js +1 -1
  380. package/dist/index31.js +5 -5
  381. package/dist/index32.js +24 -24
  382. package/dist/index33.js +3 -3
  383. package/dist/index35.js +1 -1
  384. package/dist/index39.js +1 -1
  385. package/dist/index40.js +2 -2
  386. package/dist/index43.js +2 -2
  387. package/dist/index44.js +20 -20
  388. package/dist/index48.js +1 -1
  389. package/dist/index49.js +1 -1
  390. package/dist/index52.js +1 -1
  391. package/dist/index53.js +1 -1
  392. package/dist/index54.js +5 -52
  393. package/dist/index54.js.map +1 -1
  394. package/dist/index55.js +34 -2
  395. package/dist/index55.js.map +1 -1
  396. package/dist/index56.js +27 -2
  397. package/dist/index56.js.map +1 -1
  398. package/dist/index57.js +7 -5
  399. package/dist/index57.js.map +1 -1
  400. package/dist/index58.js +11 -7
  401. package/dist/index58.js.map +1 -1
  402. package/dist/index59.js +2 -6
  403. package/dist/index59.js.map +1 -1
  404. package/dist/index6.js +134 -119
  405. package/dist/index6.js.map +1 -1
  406. package/dist/index60.js +2 -2
  407. package/dist/index61.js +2 -2
  408. package/dist/index62.js +2 -7
  409. package/dist/index62.js.map +1 -1
  410. package/dist/index63.js +53 -33
  411. package/dist/index63.js.map +1 -1
  412. package/dist/index64.js +204 -26
  413. package/dist/index64.js.map +1 -1
  414. package/dist/index65.js +3 -7
  415. package/dist/index65.js.map +1 -1
  416. package/dist/index66.js +47 -11
  417. package/dist/index66.js.map +1 -1
  418. package/dist/index67.js +49 -203
  419. package/dist/index67.js.map +1 -1
  420. package/dist/index68.js +7 -3
  421. package/dist/index68.js.map +1 -1
  422. package/dist/index69.js +14 -47
  423. package/dist/index69.js.map +1 -1
  424. package/dist/index70.js +129 -46
  425. package/dist/index70.js.map +1 -1
  426. package/dist/index71.js +10 -7
  427. package/dist/index71.js.map +1 -1
  428. package/dist/index72.js +215 -13
  429. package/dist/index72.js.map +1 -1
  430. package/dist/index73.js +12 -133
  431. package/dist/index73.js.map +1 -1
  432. package/dist/index74.js +46 -10
  433. package/dist/index74.js.map +1 -1
  434. package/dist/index75.js +46 -213
  435. package/dist/index75.js.map +1 -1
  436. package/dist/index76.js +4 -13
  437. package/dist/index76.js.map +1 -1
  438. package/dist/index77.js +5 -46
  439. package/dist/index77.js.map +1 -1
  440. package/dist/index78.js +28 -50
  441. package/dist/index78.js.map +1 -1
  442. package/dist/index79.js +49 -3
  443. package/dist/index79.js.map +1 -1
  444. package/dist/index80.js +9 -6
  445. package/dist/index80.js.map +1 -1
  446. package/dist/index81.js +6 -28
  447. package/dist/index81.js.map +1 -1
  448. package/dist/index82.js +8 -50
  449. package/dist/index82.js.map +1 -1
  450. package/dist/index83.js +6 -9
  451. package/dist/index83.js.map +1 -1
  452. package/dist/index84.js +52 -6
  453. package/dist/index84.js.map +1 -1
  454. package/dist/index85.js +4 -68
  455. package/dist/index85.js.map +1 -1
  456. package/dist/index86.js +5 -2
  457. package/dist/index86.js.map +1 -1
  458. package/dist/index87.js +15 -363
  459. package/dist/index87.js.map +1 -1
  460. package/dist/index88.js +5 -261
  461. package/dist/index88.js.map +1 -1
  462. package/dist/index89.js +7 -60
  463. package/dist/index89.js.map +1 -1
  464. package/dist/index90.js +16 -46
  465. package/dist/index90.js.map +1 -1
  466. package/dist/index91.js +4 -169
  467. package/dist/index91.js.map +1 -1
  468. package/dist/index92.js +4 -109
  469. package/dist/index92.js.map +1 -1
  470. package/dist/index93.js +5 -24
  471. package/dist/index93.js.map +1 -1
  472. package/dist/index94.js +6 -8
  473. package/dist/index94.js.map +1 -1
  474. package/dist/index95.js +4 -4
  475. package/dist/index95.js.map +1 -1
  476. package/dist/index96.js +4 -5
  477. package/dist/index96.js.map +1 -1
  478. package/dist/index97.js +6 -4
  479. package/dist/index97.js.map +1 -1
  480. package/dist/index98.js +24 -466
  481. package/dist/index98.js.map +1 -1
  482. package/dist/index99.js +6 -185
  483. package/dist/index99.js.map +1 -1
  484. package/package.json +1 -1
package/dist/index73.js CHANGED
@@ -1,137 +1,16 @@
1
- import * as d from "react";
2
- import { useComposedRefs as P } from "./index64.js";
3
- import { Primitive as M } from "./index63.js";
4
- import { useCallbackRef as y } from "./index65.js";
5
- import { j as _ } from "./index30.js";
6
- var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, t) => {
7
- const {
8
- loop: n = !1,
9
- trapped: u = !1,
10
- onMountAutoFocus: p,
11
- onUnmountAutoFocus: L,
12
- ...g
13
- } = e, [o, R] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), U = P(t, (s) => R(s)), a = d.useRef({
14
- paused: !1,
15
- pause() {
16
- this.paused = !0;
17
- },
18
- resume() {
19
- this.paused = !1;
20
- }
21
- }).current;
22
- d.useEffect(() => {
23
- if (u) {
24
- let s = function(i) {
25
- if (a.paused || !o) return;
26
- const c = i.target;
27
- o.contains(c) ? b.current = c : f(b.current, { select: !0 });
28
- }, l = function(i) {
29
- if (a.paused || !o) return;
30
- const c = i.relatedTarget;
31
- c !== null && (o.contains(c) || f(b.current, { select: !0 }));
32
- }, r = function(i) {
33
- if (document.activeElement === document.body)
34
- for (const h of i)
35
- h.removedNodes.length > 0 && f(o);
36
- };
37
- document.addEventListener("focusin", s), document.addEventListener("focusout", l);
38
- const m = new MutationObserver(r);
39
- return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
40
- document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
41
- };
42
- }
43
- }, [u, o, a.paused]), d.useEffect(() => {
44
- if (o) {
45
- O.add(a);
46
- const s = document.activeElement;
47
- if (!o.contains(s)) {
48
- const r = new CustomEvent(F, N);
49
- o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(V(I(o)), { select: !0 }), document.activeElement === s && f(o));
50
- }
51
- return () => {
52
- o.removeEventListener(F, E), setTimeout(() => {
53
- const r = new CustomEvent(T, N);
54
- o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), O.remove(a);
55
- }, 0);
56
- };
57
- }
58
- }, [o, E, v, a]);
59
- const A = d.useCallback(
60
- (s) => {
61
- if (!n && !u || a.paused) return;
62
- const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
63
- if (l && r) {
64
- const m = s.currentTarget, [i, c] = x(m);
65
- i && c ? !s.shiftKey && r === c ? (s.preventDefault(), n && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), n && f(c, { select: !0 })) : r === m && s.preventDefault();
66
- }
67
- },
68
- [n, u, a.paused]
69
- );
70
- return /* @__PURE__ */ _.jsx(M.div, { tabIndex: -1, ...g, ref: U, onKeyDown: A });
1
+ import * as o from "react";
2
+ import n from "react-dom";
3
+ import { Primitive as f } from "./index55.js";
4
+ import { useLayoutEffect as u } from "./index76.js";
5
+ import { j as c } from "./index30.js";
6
+ var l = "Portal", p = o.forwardRef((r, e) => {
7
+ const { container: a, ...s } = r, [i, m] = o.useState(!1);
8
+ u(() => m(!0), []);
9
+ const t = a || i && globalThis?.document?.body;
10
+ return t ? n.createPortal(/* @__PURE__ */ c.jsx(f.div, { ...s, ref: e }), t) : null;
71
11
  });
72
- k.displayName = K;
73
- function w(e, { select: t = !1 } = {}) {
74
- const n = document.activeElement;
75
- for (const u of e)
76
- if (f(u, { select: t }), document.activeElement !== n) return;
77
- }
78
- function x(e) {
79
- const t = I(e), n = S(t, e), u = S(t.reverse(), e);
80
- return [n, u];
81
- }
82
- function I(e) {
83
- const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
84
- acceptNode: (u) => {
85
- const p = u.tagName === "INPUT" && u.type === "hidden";
86
- return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
87
- }
88
- });
89
- for (; n.nextNode(); ) t.push(n.currentNode);
90
- return t;
91
- }
92
- function S(e, t) {
93
- for (const n of e)
94
- if (!D(n, { upTo: t })) return n;
95
- }
96
- function D(e, { upTo: t }) {
97
- if (getComputedStyle(e).visibility === "hidden") return !0;
98
- for (; e; ) {
99
- if (t !== void 0 && e === t) return !1;
100
- if (getComputedStyle(e).display === "none") return !0;
101
- e = e.parentElement;
102
- }
103
- return !1;
104
- }
105
- function H(e) {
106
- return e instanceof HTMLInputElement && "select" in e;
107
- }
108
- function f(e, { select: t = !1 } = {}) {
109
- if (e && e.focus) {
110
- const n = document.activeElement;
111
- e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
112
- }
113
- }
114
- var O = j();
115
- function j() {
116
- let e = [];
117
- return {
118
- add(t) {
119
- const n = e[0];
120
- t !== n && n?.pause(), e = C(e, t), e.unshift(t);
121
- },
122
- remove(t) {
123
- e = C(e, t), e[0]?.resume();
124
- }
125
- };
126
- }
127
- function C(e, t) {
128
- const n = [...e], u = n.indexOf(t);
129
- return u !== -1 && n.splice(u, 1), n;
130
- }
131
- function V(e) {
132
- return e.filter((t) => t.tagName !== "A");
133
- }
12
+ p.displayName = l;
134
13
  export {
135
- k as FocusScope
14
+ p as Portal
136
15
  };
137
16
  //# sourceMappingURL=index73.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index73.js","sources":["../../../node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","FOCUS_SCOPE_NAME","FocusScope","React","props","forwardedRef","loop","trapped","onMountAutoFocusProp","onUnmountAutoFocusProp","scopeProps","container","setContainer","onMountAutoFocus","useCallbackRef","onUnmountAutoFocus","lastFocusedElementRef","composedRefs","useComposedRefs","node","focusScope","handleFocusIn2","event","target","focus","handleFocusOut2","relatedTarget","handleMutations2","mutations","mutation","mutationObserver","focusScopesStack","previouslyFocusedElement","mountEvent","focusFirst","removeLinks","getTabbableCandidates","unmountEvent","handleKeyDown","isTabKey","focusedElement","container2","first","last","getTabbableEdges","jsx","Primitive","candidates","select","candidate","findVisible","nodes","walker","isHiddenInput","elements","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","activeFocusScope","arrayRemove","array","item","updatedArray","index","items"],"mappings":";;;;;AAQA,IAAIA,IAAqB,+BACrBC,IAAuB,iCACvBC,IAAgB,EAAE,SAAS,IAAO,YAAY,GAAI,GAClDC,IAAmB,cACnBC,IAAaC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACzD,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,kBAAkBC;AAAA,IAClB,oBAAoBC;AAAA,IACpB,GAAGC;AAAA,EACP,IAAMN,GACE,CAACO,GAAWC,CAAY,IAAIT,EAAM,SAAS,IAAI,GAC/CU,IAAmBC,EAAeN,CAAoB,GACtDO,IAAqBD,EAAeL,CAAsB,GAC1DO,IAAwBb,EAAM,OAAO,IAAI,GACzCc,IAAeC,EAAgBb,GAAc,CAACc,MAASP,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ACZD,EAAa,OAAOC,GAAO,CAAC,GAEvBD;AACT;AACA,SAAS9B,EAAYgC,GAAO;AAC1B,SAAOA,EAAM,OAAO,CAACH,MAASA,EAAK,YAAY,GAAG;AACpD;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index73.js","sources":["../../../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PORTAL_NAME","Portal","React","props","forwardedRef","containerProp","portalProps","mounted","setMounted","useLayoutEffect","container","ReactDOM","jsx","Primitive"],"mappings":";;;;;AAQA,IAAIA,IAAc,UACdC,IAASC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACrD,QAAM,EAAE,WAAWC,GAAe,GAAGC,EAAW,IAAKH,GAC/C,CAACI,GAASC,CAAU,IAAIN,EAAM,SAAS,EAAK;AAClDO,EAAAA,EAAgB,MAAMD,EAAW,EAAI,GAAG,CAAA,CAAE;AAC1C,QAAME,IAAYL,KAAiBE,KAAW,YAAY,UAAU;AACpE,SAAOG,IAAYC,EAAS,aAA6BC,gBAAAA,EAAAA,IAAIC,EAAU,KAAK,EAAE,GAAGP,GAAa,KAAKF,EAAY,CAAE,GAAGM,CAAS,IAAI;AACnI,CAAC;AACDT,EAAO,cAAcD;","x_google_ignoreList":[0]}
package/dist/index74.js CHANGED
@@ -1,14 +1,50 @@
1
- import * as o from "react";
2
- import { useLayoutEffect as a } from "./index79.js";
3
- var s = o[" useId ".trim().toString()] || (() => {
4
- }), f = 0;
5
- function i(t) {
6
- const [e, r] = o.useState(s());
7
- return a(() => {
8
- r((u) => u ?? String(f++));
9
- }, [t]), t || (e ? `radix-${e}` : "");
1
+ import * as l from "react";
2
+ import { composeRefs as m } from "./index56.js";
3
+ import { j as u } from "./index30.js";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function x(e) {
6
+ const r = /* @__PURE__ */ y(e), t = l.forwardRef((o, n) => {
7
+ const { children: i, ...c } = o, s = l.Children.toArray(i), a = s.find(g);
8
+ if (a) {
9
+ const f = a.props.children, d = s.map((p) => p === a ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : p);
10
+ return /* @__PURE__ */ u.jsx(r, { ...c, ref: n, children: l.isValidElement(f) ? l.cloneElement(f, void 0, d) : null });
11
+ }
12
+ return /* @__PURE__ */ u.jsx(r, { ...c, ref: n, children: i });
13
+ });
14
+ return t.displayName = `${e}.Slot`, t;
15
+ }
16
+ // @__NO_SIDE_EFFECTS__
17
+ function y(e) {
18
+ const r = l.forwardRef((t, o) => {
19
+ const { children: n, ...i } = t;
20
+ if (l.isValidElement(n)) {
21
+ const c = R(n), s = C(i, n.props);
22
+ return n.type !== l.Fragment && (s.ref = o ? m(o, c) : c), l.cloneElement(n, s);
23
+ }
24
+ return l.Children.count(n) > 1 ? l.Children.only(null) : null;
25
+ });
26
+ return r.displayName = `${e}.SlotClone`, r;
27
+ }
28
+ var E = /* @__PURE__ */ Symbol("radix.slottable");
29
+ function g(e) {
30
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === E;
31
+ }
32
+ function C(e, r) {
33
+ const t = { ...r };
34
+ for (const o in r) {
35
+ const n = e[o], i = r[o];
36
+ /^on[A-Z]/.test(o) ? n && i ? t[o] = (...s) => {
37
+ const a = i(...s);
38
+ return n(...s), a;
39
+ } : n && (t[o] = n) : o === "style" ? t[o] = { ...n, ...i } : o === "className" && (t[o] = [n, i].filter(Boolean).join(" "));
40
+ }
41
+ return { ...e, ...t };
42
+ }
43
+ function R(e) {
44
+ let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning;
45
+ return t ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
10
46
  }
11
47
  export {
12
- i as useId
48
+ x as createSlot
13
49
  };
14
50
  //# sourceMappingURL=index74.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index74.js","sources":["../../../node_modules/@radix-ui/react-id/dist/index.mjs"],"sourcesContent":["// packages/react/id/src/id.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useReactId = React[\" useId \".trim().toString()] || (() => void 0);\nvar count = 0;\nfunction useId(deterministicId) {\n const [id, setId] = React.useState(useReactId());\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : \"\");\n}\nexport {\n useId\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useReactId","React","count","useId","deterministicId","id","setId","useLayoutEffect","reactId"],"mappings":";;AAGA,IAAIA,IAAaC,EAAM,UAAU,KAAI,EAAG,SAAQ,CAAE,MAAM,MAAA;AAAA,IACpDC,IAAQ;AACZ,SAASC,EAAMC,GAAiB;AAC9B,QAAM,CAACC,GAAIC,CAAK,IAAIL,EAAM,SAASD,GAAY;AAC/CO,SAAAA,EAAgB,MAAM;AACE,IAAAD,EAAM,CAACE,MAAYA,KAAW,OAAON,GAAO,CAAC;AAAA,EACrE,GAAG,CAACE,CAAe,CAAC,GACbA,MAAoBC,IAAK,SAASA,CAAE,KAAK;AAClD;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index74.js","sources":["../../../node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","composeRefs","SLOTTABLE_IDENTIFIER","childPro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MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
package/dist/index75.js CHANGED
@@ -1,220 +1,53 @@
1
- import * as p from "react";
2
- import { useFloating as fe, offset as me, shift as he, flip as ue, size as ge, arrow as we, hide as xe, limitShift as Pe } from "./index178.js";
3
- import { Root as ye } from "./index179.js";
4
- import { useComposedRefs as z } from "./index64.js";
5
- import { createContextScope as Ae } from "./index70.js";
6
- import { Primitive as I } from "./index63.js";
7
- import { useCallbackRef as ve } from "./index65.js";
8
- import { useLayoutEffect as W } from "./index79.js";
9
- import { useSize as Ce } from "./index180.js";
10
- import { j as f } from "./index30.js";
11
- import { autoUpdate as Se } from "./index181.js";
12
- var R = "Popper", [Y, Fe] = Ae(R), [Re, M] = Y(R), X = (e) => {
13
- const { __scopePopper: i, children: n } = e, [s, a] = p.useState(null);
14
- return /* @__PURE__ */ f.jsx(Re, { scope: i, anchor: s, onAnchorChange: a, children: n });
15
- };
16
- X.displayName = R;
17
- var D = "PopperAnchor", F = p.forwardRef(
18
- (e, i) => {
19
- const { __scopePopper: n, virtualRef: s, ...a } = e, t = M(D, n), r = p.useRef(null), u = z(i, r), o = p.useRef(null);
20
- return p.useEffect(() => {
21
- const c = o.current;
22
- o.current = s?.current || r.current, c !== o.current && t.onAnchorChange(o.current);
23
- }), s ? null : /* @__PURE__ */ f.jsx(I.div, { ...a, ref: u });
24
- }
25
- );
26
- F.displayName = D;
27
- var b = "PopperContent", [be, Oe] = Y(b), k = p.forwardRef(
28
- (e, i) => {
29
- const {
30
- __scopePopper: n,
31
- side: s = "bottom",
32
- sideOffset: a = 0,
33
- align: t = "center",
34
- alignOffset: r = 0,
35
- arrowPadding: u = 0,
36
- avoidCollisions: o = !0,
37
- collisionBoundary: c = [],
38
- collisionPadding: g = 0,
39
- sticky: m = "partial",
40
- hideWhenDetached: x = !1,
41
- updatePositionStrategy: P = "optimized",
42
- onPlaced: d,
43
- ...l
44
- } = e, Z = M(b, n), [C, U] = p.useState(null), q = z(i, (w) => U(w)), [S, G] = p.useState(null), O = Ce(S), J = O?.width ?? 0, E = O?.height ?? 0, K = s + (t !== "center" ? "-" + t : ""), Q = typeof g == "number" ? g : { top: 0, right: 0, bottom: 0, left: 0, ...g }, N = Array.isArray(c) ? c : [c], V = N.length > 0, y = {
45
- padding: Q,
46
- boundary: N.filter(Ne),
47
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
48
- altBoundary: V
49
- }, { refs: ee, floatingStyles: _, placement: te, isPositioned: A, middlewareData: h } = fe({
50
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
51
- strategy: "fixed",
52
- placement: K,
53
- whileElementsMounted: (...w) => Se(...w, {
54
- animationFrame: P === "always"
55
- }),
56
- elements: {
57
- reference: Z.anchor
58
- },
59
- middleware: [
60
- me({ mainAxis: a + E, alignmentAxis: r }),
61
- o && he({
62
- mainAxis: !0,
63
- crossAxis: !1,
64
- limiter: m === "partial" ? Pe() : void 0,
65
- ...y
66
- }),
67
- o && ue({ ...y }),
68
- ge({
69
- ...y,
70
- apply: ({ elements: w, rects: H, availableWidth: ce, availableHeight: pe }) => {
71
- const { width: le, height: de } = H.reference, v = w.floating.style;
72
- v.setProperty("--radix-popper-available-width", `${ce}px`), v.setProperty("--radix-popper-available-height", `${pe}px`), v.setProperty("--radix-popper-anchor-width", `${le}px`), v.setProperty("--radix-popper-anchor-height", `${de}px`);
73
- }
74
- }),
75
- S && we({ element: S, padding: u }),
76
- _e({ arrowWidth: J, arrowHeight: E }),
77
- x && xe({ strategy: "referenceHidden", ...y })
78
- ]
79
- }), [$, re] = L(te), j = ve(d);
80
- W(() => {
81
- A && j?.();
82
- }, [A, j]);
83
- const oe = h.arrow?.x, ne = h.arrow?.y, ae = h.arrow?.centerOffset !== 0, [ie, se] = p.useState();
84
- return W(() => {
85
- C && se(window.getComputedStyle(C).zIndex);
86
- }, [C]), /* @__PURE__ */ f.jsx(
87
- "div",
88
- {
89
- ref: ee.setFloating,
90
- "data-radix-popper-content-wrapper": "",
91
- style: {
92
- ..._,
93
- transform: A ? _.transform : "translate(0, -200%)",
94
- // keep off the page when measuring
95
- minWidth: "max-content",
96
- zIndex: ie,
97
- "--radix-popper-transform-origin": [
98
- h.transformOrigin?.x,
99
- h.transformOrigin?.y
100
- ].join(" "),
101
- // hide the content if using the hide middleware and should be hidden
102
- // set visibility to hidden and disable pointer events so the UI behaves
103
- // as if the PopperContent isn't there at all
104
- ...h.hide?.referenceHidden && {
105
- visibility: "hidden",
106
- pointerEvents: "none"
107
- }
108
- },
109
- dir: e.dir,
110
- children: /* @__PURE__ */ f.jsx(
111
- be,
112
- {
113
- scope: n,
114
- placedSide: $,
115
- onArrowChange: G,
116
- arrowX: oe,
117
- arrowY: ne,
118
- shouldHideArrow: ae,
119
- children: /* @__PURE__ */ f.jsx(
120
- I.div,
121
- {
122
- "data-side": $,
123
- "data-align": re,
124
- ...l,
125
- ref: q,
126
- style: {
127
- ...l.style,
128
- // if the PopperContent hasn't been placed yet (not all measurements done)
129
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
130
- animation: A ? void 0 : "none"
131
- }
132
- }
133
- )
134
- }
135
- )
136
- }
137
- );
1
+ import * as o from "react";
2
+ import { useLayoutEffect as m } from "./index76.js";
3
+ var v = o[" useInsertionEffect ".trim().toString()] || m;
4
+ function w({
5
+ prop: e,
6
+ defaultProp: s,
7
+ onChange: t = () => {
8
+ },
9
+ caller: f
10
+ }) {
11
+ const [u, c, i] = R({
12
+ defaultProp: s,
13
+ onChange: t
14
+ }), n = e !== void 0, a = n ? e : u;
15
+ {
16
+ const r = o.useRef(e !== void 0);
17
+ o.useEffect(() => {
18
+ const l = r.current;
19
+ l !== n && console.warn(
20
+ `${f} is changing from ${l ? "controlled" : "uncontrolled"} to ${n ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
21
+ ), r.current = n;
22
+ }, [n, f]);
138
23
  }
139
- );
140
- k.displayName = b;
141
- var B = "PopperArrow", Ee = {
142
- top: "bottom",
143
- right: "left",
144
- bottom: "top",
145
- left: "right"
146
- }, T = p.forwardRef(function(i, n) {
147
- const { __scopePopper: s, ...a } = i, t = Oe(B, s), r = Ee[t.placedSide];
148
- return (
149
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
150
- // doesn't report size as we'd expect on SVG elements.
151
- // it reports their bounding box which is effectively the largest path inside the SVG.
152
- /* @__PURE__ */ f.jsx(
153
- "span",
154
- {
155
- ref: t.onArrowChange,
156
- style: {
157
- position: "absolute",
158
- left: t.arrowX,
159
- top: t.arrowY,
160
- [r]: 0,
161
- transformOrigin: {
162
- top: "",
163
- right: "0 0",
164
- bottom: "center 0",
165
- left: "100% 0"
166
- }[t.placedSide],
167
- transform: {
168
- top: "translateY(100%)",
169
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
170
- bottom: "rotate(180deg)",
171
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
172
- }[t.placedSide],
173
- visibility: t.shouldHideArrow ? "hidden" : void 0
174
- },
175
- children: /* @__PURE__ */ f.jsx(
176
- ye,
177
- {
178
- ...a,
179
- ref: n,
180
- style: {
181
- ...a.style,
182
- // ensures the element can be measured correctly (mostly for if SVG)
183
- display: "block"
184
- }
185
- }
186
- )
187
- }
188
- )
24
+ const d = o.useCallback(
25
+ (r) => {
26
+ if (n) {
27
+ const l = C(r) ? r(e) : r;
28
+ l !== e && i.current?.(l);
29
+ } else
30
+ c(r);
31
+ },
32
+ [n, e, c, i]
189
33
  );
190
- });
191
- T.displayName = B;
192
- function Ne(e) {
193
- return e !== null;
34
+ return [a, d];
194
35
  }
195
- var _e = (e) => ({
196
- name: "transformOrigin",
197
- options: e,
198
- fn(i) {
199
- const { placement: n, rects: s, middlewareData: a } = i, r = a.arrow?.centerOffset !== 0, u = r ? 0 : e.arrowWidth, o = r ? 0 : e.arrowHeight, [c, g] = L(n), m = { start: "0%", center: "50%", end: "100%" }[g], x = (a.arrow?.x ?? 0) + u / 2, P = (a.arrow?.y ?? 0) + o / 2;
200
- let d = "", l = "";
201
- return c === "bottom" ? (d = r ? m : `${x}px`, l = `${-o}px`) : c === "top" ? (d = r ? m : `${x}px`, l = `${s.floating.height + o}px`) : c === "right" ? (d = `${-o}px`, l = r ? m : `${P}px`) : c === "left" && (d = `${s.floating.width + o}px`, l = r ? m : `${P}px`), { data: { x: d, y: l } };
202
- }
203
- });
204
- function L(e) {
205
- const [i, n = "center"] = e.split("-");
206
- return [i, n];
36
+ function R({
37
+ defaultProp: e,
38
+ onChange: s
39
+ }) {
40
+ const [t, f] = o.useState(e), u = o.useRef(t), c = o.useRef(s);
41
+ return v(() => {
42
+ c.current = s;
43
+ }, [s]), o.useEffect(() => {
44
+ u.current !== t && (c.current?.(t), u.current = t);
45
+ }, [t, u]), [t, f, c];
46
+ }
47
+ function C(e) {
48
+ return typeof e == "function";
207
49
  }
208
- var ke = X, Be = F, Te = k, Le = T;
209
50
  export {
210
- Be as Anchor,
211
- Le as Arrow,
212
- Te as Content,
213
- X as Popper,
214
- F as PopperAnchor,
215
- T as PopperArrow,
216
- k as PopperContent,
217
- ke as Root,
218
- Fe as createPopperScope
51
+ w as useControllableState
219
52
  };
220
53
  //# sourceMappingURL=index75.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index75.js","sources":["../../../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef?.current || ref.current;\n if (previousAnchor !== anchorRef.current) {\n context.onAnchorChange(anchorRef.current);\n }\n });\n return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n [\"--radix-popper-transform-origin\"]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["POPPER_NAME","createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","jsx","ANCHOR_NAME","PopperAnchor","forwardedRef","virtualRef","anchorProps","context","ref","composedRefs","useComposedRefs","anchorRef","previousAnchor","Primitive","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPaddingProp","sticky","hideWhenDetached","updatePositionStrategy","onPlaced","contentProps","content","setContent","node","arrow","setArrow","arrowSize","useSize","arrowWidth","arrowHeight","desiredPlacement","collisionPadding","boundary","hasExplicitBoundaries","detectOverflowOptions","isNotNull","refs","floatingStyles","placement","isPositioned","middlewareData","useFloating","args","autoUpdate","offset","shift","limitShift","flip","size","elements","rects","availableWidth","availableHeight","anchorWidth","anchorHeight","contentStyle","floatingUIarrow","transformOrigin","hide","placedSide","placedAlign","getSideAndAlignFromPlacement","handlePlaced","useCallbackRef","useLayoutEffect","arrowX","arrowY","cannotCenterArrow","contentZIndex","setContentZIndex","ARROW_NAME","OPPOSITE_SIDE","PopperArrow","arrowProps","contentContext","baseSide","ArrowPrimitive.Root","value","options","data","isArrowHidden","noArrowAlign","arrowXCenter","arrowYCenter","x","y","Root2","Anchor","Content","Arrow"],"mappings":";;;;;;;;;;;AAyBA,IAAIA,IAAc,UACd,CAACC,GAAqBC,EAAiB,IAAIC,GAAmBH,CAAW,GACzE,CAACI,IAAgBC,CAAgB,IAAIJ,EAAoBD,CAAW,GACpEM,IAAS,CAACC,MAAU;AACtB,QAAM,EAAE,eAAAC,GAAe,UAAAC,EAAQ,IAAKF,GAC9B,CAACG,GAAQC,CAAS,IAAIC,EAAM,SAAS,IAAI;AAC/C,SAAuBC,gBAAAA,EAAAA,IAAIT,IAAgB,EAAE,OAAOI,GAAe,QAAAE,GAAQ,gBAAgBC,GAAW,UAAAF,GAAU;AAClH;AACAH,EAAO,cAAcN;AACrB,IAAIc,IAAc,gBACdC,IAAeH,EAAM;AAAA,EACvB,CAACL,GAAOS,MAAiB;AACvB,UAAM,EAAE,eAAAR,GAAe,YAAAS,GAAY,GAAGC,EAAW,IAAKX,GAChDY,IAAUd,EAAiBS,GAAaN,CAAa,GACrDY,IAAMR,EAAM,OAAO,IAAI,GACvBS,IAAeC,EAAgBN,GAAcI,CAAG,GAChDG,IAAYX,EAAM,OAAO,IAAI;AACnC,WAAAA,EAAM,UAAU,MAAM;AACpB,YAAMY,IAAiBD,EAAU;AACjC,MAAAA,EAAU,UAAUN,GAAY,WAAWG,EAAI,SAC3CI,MAAmBD,EAAU,WAC/BJ,EAAQ,eAAe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AC/C,QAAM,CAAC9B,GAAME,IAAQ,QAAQ,IAAI4B,EAAU,MAAM,GAAG;AACpD,SAAO,CAAC9B,GAAME,CAAK;AACrB;AACG,IAAC4E,KAAQtG,GACRuG,KAAS9F,GACT+F,KAAUjF,GACVkF,KAAQjB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index75.js","sources":["../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs"],"sourcesContent":["// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useInsertionEffect","React","useLayoutEffect","useControllableState","prop","defaultProp","onChange","caller","uncontrolledProp","setUncontrolledProp","onChangeRef","useUncontrolledState","isControlled","value","isControlledRef","wasControlled","setValue","nextValue","value2","isFunction","prevValueRef"],"mappings":";;AAGA,IAAIA,IAAqBC,EAAM,uBAAuB,KAAI,EAAG,SAAQ,CAAE,KAAKC;AAC5E,SAASC,EAAqB;AAAA,EAC5B,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EACjB;AAAA,EACA,QAAAC;AACF,GAAG;AACD,QAAM,CAACC,GAAkBC,GAAqBC,CAAW,IAAIC,EAAqB;AAAA,IAChF,aAAAN;AAAA,IACA,UAAAC;AAAA,EACJ,CAAG,GACKM,IAAeR,MAAS,QACxBS,IAAQD,IAAeR,IAAOI;AAC1B;AACR,UAAMM,IAAkBb,EAAM,OAAOG,MAAS,MAAM;AACpD,IAAAH,EAAM,UAAU,MAAM;AACpB,YAAMc,IAAgBD,EAAgB;AACtC,MAAIC,MAAkBH,KAGpB,QAAQ;AAAA,QACN,GAAGL,CAAM,qBAHEQ,IAAgB,eAAe,cAGR,OAFzBH,IAAe,eAAe,cAEI;AAAA,MACrD,GAEME,EAAgB,UAAUF;AAAA,IAC5B,GAAG,CAACA,GAAcL,CAAM,CAAC;AAAA,EAC3B;AACA,QAAMS,IAAWf,EAAM;AAAA,IACrB,CAACgB,MAAc;AACb,UAAIL,GAAc;AAChB,cAAMM,IAASC,EAAWF,CAAS,IAAIA,EAAUb,CAAI,IAAIa;AACzD,QAAIC,MAAWd,KACbM,EAAY,UAAUQ,CAAM;AAAA,MAEhC;AACE,QAAAT,EAAoBQ,CAAS;AAAA,IAEjC;AAAA,IACA,CAACL,GAAcR,GAAMK,GAAqBC,CAAW;AAAA,EACzD;AACE,SAAO,CAACG,GAAOG,CAAQ;AACzB;AACA,SAASL,EAAqB;AAAA,EAC5B,aAAAN;AAAA,EACA,UAAAC;AACF,GAAG;AACD,QAAM,CAACO,GAAOG,CAAQ,IAAIf,EAAM,SAASI,CAAW,GAC9Ce,IAAenB,EAAM,OAAOY,CAAK,GACjCH,IAAcT,EAAM,OAAOK,CAAQ;AACzC,SAAAN,EAAmB,MAAM;AACvB,IAAAU,EAAY,UAAUJ;AAAA,EACxB,GAAG,CAACA,CAAQ,CAAC,GACbL,EAAM,UAAU,MAAM;AACpB,IAAImB,EAAa,YAAYP,MAC3BH,EAAY,UAAUG,CAAK,GAC3BO,EAAa,UAAUP;AAAA,EAE3B,GAAG,CAACA,GAAOO,CAAY,CAAC,GACjB,CAACP,GAAOG,GAAUN,CAAW;AACtC;AACA,SAASS,EAAWN,GAAO;AACzB,SAAO,OAAOA,KAAU;AAC1B;","x_google_ignoreList":[0]}
package/dist/index76.js CHANGED
@@ -1,16 +1,7 @@
1
- import * as o from "react";
2
- import n from "react-dom";
3
- import { Primitive as f } from "./index63.js";
4
- import { useLayoutEffect as u } from "./index79.js";
5
- import { j as c } from "./index30.js";
6
- var l = "Portal", p = o.forwardRef((r, e) => {
7
- const { container: a, ...s } = r, [i, m] = o.useState(!1);
8
- u(() => m(!0), []);
9
- const t = a || i && globalThis?.document?.body;
10
- return t ? n.createPortal(/* @__PURE__ */ c.jsx(f.div, { ...s, ref: e }), t) : null;
11
- });
12
- p.displayName = l;
1
+ import * as t from "react";
2
+ var e = globalThis?.document ? t.useLayoutEffect : () => {
3
+ };
13
4
  export {
14
- p as Portal
5
+ e as useLayoutEffect
15
6
  };
16
7
  //# sourceMappingURL=index76.js.map