@rpcbase/ui 0.250.0 → 0.251.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 (463) hide show
  1. package/dist/index105.js +36 -36
  2. package/dist/index117.js +6 -6
  3. package/dist/index120.js +10 -10
  4. package/dist/index122.js +2 -2
  5. package/dist/index123.js +3 -3
  6. package/dist/index124.js +1 -1
  7. package/dist/index126.js +2 -2
  8. package/dist/index128.js +2 -2
  9. package/dist/index150.js +3 -3
  10. package/dist/index156.js +1 -1
  11. package/dist/index163.js +2 -2
  12. package/dist/index164.js +7 -7
  13. package/dist/index167.js +1 -1
  14. package/dist/index169.js +1 -1
  15. package/dist/index172.js +3 -3
  16. package/dist/index175.js +1 -1
  17. package/dist/index176.js +4 -4
  18. package/dist/index178.js +1 -1
  19. package/dist/index182.js +2 -2
  20. package/dist/index184.js +5 -5
  21. package/dist/index185.js +13 -13
  22. package/dist/index186.js +1 -1
  23. package/dist/index188.js +6 -6
  24. package/dist/index189.js +3 -3
  25. package/dist/index192.js +2 -2
  26. package/dist/index193.js +6 -6
  27. package/dist/index194.js +59 -20
  28. package/dist/index194.js.map +1 -1
  29. package/dist/index195.js +8 -66
  30. package/dist/index195.js.map +1 -1
  31. package/dist/index196.js +87 -6
  32. package/dist/index196.js.map +1 -1
  33. package/dist/index197.js +19 -5
  34. package/dist/index197.js.map +1 -1
  35. package/dist/index198.js +16 -11
  36. package/dist/index198.js.map +1 -1
  37. package/dist/index199.js +5 -3
  38. package/dist/index199.js.map +1 -1
  39. package/dist/index200.js +4 -49
  40. package/dist/index200.js.map +1 -1
  41. package/dist/index201.js +7 -4
  42. package/dist/index201.js.map +1 -1
  43. package/dist/index202.js +4 -29
  44. package/dist/index202.js.map +1 -1
  45. package/dist/index203.js +6 -16
  46. package/dist/index203.js.map +1 -1
  47. package/dist/index204.js +16 -5
  48. package/dist/index204.js.map +1 -1
  49. package/dist/index205.js +4 -21
  50. package/dist/index205.js.map +1 -1
  51. package/dist/index206.js +4 -53
  52. package/dist/index206.js.map +1 -1
  53. package/dist/index207.js +12 -20
  54. package/dist/index207.js.map +1 -1
  55. package/dist/index208.js +9 -41
  56. package/dist/index208.js.map +1 -1
  57. package/dist/index209.js +13 -39
  58. package/dist/index209.js.map +1 -1
  59. package/dist/index210.js +14 -46
  60. package/dist/index210.js.map +1 -1
  61. package/dist/index211.js +4 -20
  62. package/dist/index211.js.map +1 -1
  63. package/dist/index212.js +5 -70
  64. package/dist/index212.js.map +1 -1
  65. package/dist/index213.js +6 -17
  66. package/dist/index213.js.map +1 -1
  67. package/dist/index214.js +5 -3
  68. package/dist/index214.js.map +1 -1
  69. package/dist/index215.js +54 -11
  70. package/dist/index215.js.map +1 -1
  71. package/dist/index216.js +8 -13
  72. package/dist/index216.js.map +1 -1
  73. package/dist/index217.js +4 -18
  74. package/dist/index217.js.map +1 -1
  75. package/dist/index218.js +4 -36
  76. package/dist/index218.js.map +1 -1
  77. package/dist/index219.js +8 -239
  78. package/dist/index219.js.map +1 -1
  79. package/dist/index220.js +4 -252
  80. package/dist/index220.js.map +1 -1
  81. package/dist/index221.js +4 -68
  82. package/dist/index221.js.map +1 -1
  83. package/dist/index222.js +3 -99
  84. package/dist/index222.js.map +1 -1
  85. package/dist/index223.js +10 -83
  86. package/dist/index223.js.map +1 -1
  87. package/dist/index224.js +9 -3
  88. package/dist/index224.js.map +1 -1
  89. package/dist/index225.js +9 -29
  90. package/dist/index225.js.map +1 -1
  91. package/dist/index226.js +10 -16
  92. package/dist/index226.js.map +1 -1
  93. package/dist/index227.js +11 -35
  94. package/dist/index227.js.map +1 -1
  95. package/dist/index228.js +9 -17
  96. package/dist/index228.js.map +1 -1
  97. package/dist/index229.js +6 -3
  98. package/dist/index229.js.map +1 -1
  99. package/dist/index230.js +5 -26
  100. package/dist/index230.js.map +1 -1
  101. package/dist/index231.js +4 -28
  102. package/dist/index231.js.map +1 -1
  103. package/dist/index232.js +6 -4
  104. package/dist/index232.js.map +1 -1
  105. package/dist/index233.js +6 -78
  106. package/dist/index233.js.map +1 -1
  107. package/dist/index234.js +5 -272
  108. package/dist/index234.js.map +1 -1
  109. package/dist/index235.js +15 -10
  110. package/dist/index235.js.map +1 -1
  111. package/dist/index236.js +7 -10
  112. package/dist/index236.js.map +1 -1
  113. package/dist/index237.js +10 -25
  114. package/dist/index237.js.map +1 -1
  115. package/dist/index238.js +10 -16
  116. package/dist/index238.js.map +1 -1
  117. package/dist/index239.js +21 -125
  118. package/dist/index239.js.map +1 -1
  119. package/dist/index240.js +8 -5
  120. package/dist/index240.js.map +1 -1
  121. package/dist/index241.js +9 -65
  122. package/dist/index241.js.map +1 -1
  123. package/dist/index242.js +10 -14
  124. package/dist/index242.js.map +1 -1
  125. package/dist/index243.js +4 -7
  126. package/dist/index243.js.map +1 -1
  127. package/dist/index244.js +5 -5
  128. package/dist/index244.js.map +1 -1
  129. package/dist/index245.js +16 -3
  130. package/dist/index245.js.map +1 -1
  131. package/dist/index246.js +9 -10
  132. package/dist/index246.js.map +1 -1
  133. package/dist/index247.js +18 -7
  134. package/dist/index247.js.map +1 -1
  135. package/dist/index248.js +19 -132
  136. package/dist/index248.js.map +1 -1
  137. package/dist/index249.js +10 -397
  138. package/dist/index249.js.map +1 -1
  139. package/dist/index250.js +30 -5
  140. package/dist/index250.js.map +1 -1
  141. package/dist/index251.js +12 -52
  142. package/dist/index251.js.map +1 -1
  143. package/dist/index252.js +25 -11
  144. package/dist/index252.js.map +1 -1
  145. package/dist/index253.js +5 -27
  146. package/dist/index253.js.map +1 -1
  147. package/dist/index254.js +20 -12
  148. package/dist/index254.js.map +1 -1
  149. package/dist/index255.js +65 -57
  150. package/dist/index255.js.map +1 -1
  151. package/dist/index256.js +6 -8
  152. package/dist/index256.js.map +1 -1
  153. package/dist/index257.js +5 -87
  154. package/dist/index257.js.map +1 -1
  155. package/dist/index258.js +11 -19
  156. package/dist/index258.js.map +1 -1
  157. package/dist/index259.js +3 -16
  158. package/dist/index259.js.map +1 -1
  159. package/dist/index260.js +49 -4
  160. package/dist/index260.js.map +1 -1
  161. package/dist/index261.js +4 -6
  162. package/dist/index261.js.map +1 -1
  163. package/dist/index262.js +29 -6
  164. package/dist/index262.js.map +1 -1
  165. package/dist/index263.js +16 -4
  166. package/dist/index263.js.map +1 -1
  167. package/dist/index264.js +5 -6
  168. package/dist/index264.js.map +1 -1
  169. package/dist/index265.js +21 -16
  170. package/dist/index265.js.map +1 -1
  171. package/dist/index266.js +53 -4
  172. package/dist/index266.js.map +1 -1
  173. package/dist/index267.js +20 -4
  174. package/dist/index267.js.map +1 -1
  175. package/dist/index268.js +41 -12
  176. package/dist/index268.js.map +1 -1
  177. package/dist/index269.js +39 -9
  178. package/dist/index269.js.map +1 -1
  179. package/dist/index270.js +46 -14
  180. package/dist/index270.js.map +1 -1
  181. package/dist/index271.js +20 -13
  182. package/dist/index271.js.map +1 -1
  183. package/dist/index272.js +70 -4
  184. package/dist/index272.js.map +1 -1
  185. package/dist/index273.js +17 -5
  186. package/dist/index273.js.map +1 -1
  187. package/dist/index274.js +3 -6
  188. package/dist/index274.js.map +1 -1
  189. package/dist/index275.js +11 -5
  190. package/dist/index275.js.map +1 -1
  191. package/dist/index276.js +12 -53
  192. package/dist/index276.js.map +1 -1
  193. package/dist/index277.js +18 -8
  194. package/dist/index277.js.map +1 -1
  195. package/dist/index278.js +36 -4
  196. package/dist/index278.js.map +1 -1
  197. package/dist/index279.js +239 -4
  198. package/dist/index279.js.map +1 -1
  199. package/dist/index280.js +252 -8
  200. package/dist/index280.js.map +1 -1
  201. package/dist/index281.js +68 -4
  202. package/dist/index281.js.map +1 -1
  203. package/dist/index282.js +99 -4
  204. package/dist/index282.js.map +1 -1
  205. package/dist/index283.js +83 -3
  206. package/dist/index283.js.map +1 -1
  207. package/dist/index284.js +3 -10
  208. package/dist/index284.js.map +1 -1
  209. package/dist/index285.js +29 -9
  210. package/dist/index285.js.map +1 -1
  211. package/dist/index286.js +16 -9
  212. package/dist/index286.js.map +1 -1
  213. package/dist/index287.js +35 -11
  214. package/dist/index287.js.map +1 -1
  215. package/dist/index288.js +17 -10
  216. package/dist/index288.js.map +1 -1
  217. package/dist/index289.js +3 -9
  218. package/dist/index289.js.map +1 -1
  219. package/dist/index290.js +26 -6
  220. package/dist/index290.js.map +1 -1
  221. package/dist/index291.js +28 -5
  222. package/dist/index291.js.map +1 -1
  223. package/dist/index292.js +4 -5
  224. package/dist/index292.js.map +1 -1
  225. package/dist/index293.js +78 -5
  226. package/dist/index293.js.map +1 -1
  227. package/dist/index294.js +272 -6
  228. package/dist/index294.js.map +1 -1
  229. package/dist/index295.js +11 -5
  230. package/dist/index295.js.map +1 -1
  231. package/dist/index296.js +10 -16
  232. package/dist/index296.js.map +1 -1
  233. package/dist/index297.js +25 -7
  234. package/dist/index297.js.map +1 -1
  235. package/dist/index298.js +16 -10
  236. package/dist/index298.js.map +1 -1
  237. package/dist/index299.js +124 -9
  238. package/dist/index299.js.map +1 -1
  239. package/dist/index300.js +5 -21
  240. package/dist/index300.js.map +1 -1
  241. package/dist/index301.js +65 -8
  242. package/dist/index301.js.map +1 -1
  243. package/dist/index302.js +14 -10
  244. package/dist/index302.js.map +1 -1
  245. package/dist/index303.js +7 -9
  246. package/dist/index303.js.map +1 -1
  247. package/dist/index304.js +5 -4
  248. package/dist/index304.js.map +1 -1
  249. package/dist/index305.js +3 -5
  250. package/dist/index305.js.map +1 -1
  251. package/dist/index306.js +10 -16
  252. package/dist/index306.js.map +1 -1
  253. package/dist/index307.js +7 -9
  254. package/dist/index307.js.map +1 -1
  255. package/dist/index308.js +132 -17
  256. package/dist/index308.js.map +1 -1
  257. package/dist/index309.js +397 -18
  258. package/dist/index309.js.map +1 -1
  259. package/dist/index310.js +5 -13
  260. package/dist/index310.js.map +1 -1
  261. package/dist/index311.js +52 -29
  262. package/dist/index311.js.map +1 -1
  263. package/dist/index312.js +11 -12
  264. package/dist/index312.js.map +1 -1
  265. package/dist/index313.js +27 -25
  266. package/dist/index313.js.map +1 -1
  267. package/dist/index314.js +11 -5
  268. package/dist/index314.js.map +1 -1
  269. package/dist/index315.js +29 -151
  270. package/dist/index315.js.map +1 -1
  271. package/dist/index316.js +11 -32
  272. package/dist/index316.js.map +1 -1
  273. package/dist/index317.js +49 -11
  274. package/dist/index317.js.map +1 -1
  275. package/dist/index318.js +9 -49
  276. package/dist/index318.js.map +1 -1
  277. package/dist/index319.js +11 -9
  278. package/dist/index319.js.map +1 -1
  279. package/dist/index320.js +43 -11
  280. package/dist/index320.js.map +1 -1
  281. package/dist/index321.js +94 -40
  282. package/dist/index321.js.map +1 -1
  283. package/dist/index322.js +76 -87
  284. package/dist/index322.js.map +1 -1
  285. package/dist/index323.js +88 -69
  286. package/dist/index323.js.map +1 -1
  287. package/dist/index324.js +39 -92
  288. package/dist/index324.js.map +1 -1
  289. package/dist/index325.js +10 -51
  290. package/dist/index325.js.map +1 -1
  291. package/dist/index326.js +4 -11
  292. package/dist/index326.js.map +1 -1
  293. package/dist/index327.js +37 -4
  294. package/dist/index327.js.map +1 -1
  295. package/dist/index328.js +8 -37
  296. package/dist/index328.js.map +1 -1
  297. package/dist/index329.js +154 -8
  298. package/dist/index329.js.map +1 -1
  299. package/dist/index330.js +135 -3
  300. package/dist/index330.js.map +1 -1
  301. package/dist/index331.js +16 -134
  302. package/dist/index331.js.map +1 -1
  303. package/dist/index332.js +15 -17
  304. package/dist/index332.js.map +1 -1
  305. package/dist/index333.js +3 -15
  306. package/dist/index333.js.map +1 -1
  307. package/dist/index334.js +1 -1
  308. package/dist/index335.js +1 -1
  309. package/dist/index338.js +1 -1
  310. package/dist/index341.js +1 -1
  311. package/dist/index347.js +17 -51
  312. package/dist/index347.js.map +1 -1
  313. package/dist/index348.js +51 -5
  314. package/dist/index348.js.map +1 -1
  315. package/dist/index349.js +5 -61
  316. package/dist/index349.js.map +1 -1
  317. package/dist/index350.js +60 -65
  318. package/dist/index350.js.map +1 -1
  319. package/dist/index351.js +65 -16
  320. package/dist/index351.js.map +1 -1
  321. package/dist/index357.js +1 -1
  322. package/dist/index358.js +5 -5
  323. package/dist/index359.js +1 -1
  324. package/dist/index362.js +5 -4
  325. package/dist/index362.js.map +1 -1
  326. package/dist/index363.js +18 -6
  327. package/dist/index363.js.map +1 -1
  328. package/dist/index364.js +13 -3
  329. package/dist/index364.js.map +1 -1
  330. package/dist/index365.js +4 -12
  331. package/dist/index365.js.map +1 -1
  332. package/dist/index366.js +5 -20
  333. package/dist/index366.js.map +1 -1
  334. package/dist/index367.js +3 -45
  335. package/dist/index367.js.map +1 -1
  336. package/dist/index368.js +11 -17
  337. package/dist/index368.js.map +1 -1
  338. package/dist/index369.js +21 -5
  339. package/dist/index369.js.map +1 -1
  340. package/dist/index370.js +44 -200
  341. package/dist/index370.js.map +1 -1
  342. package/dist/index371.js +17 -73
  343. package/dist/index371.js.map +1 -1
  344. package/dist/index372.js +5 -124
  345. package/dist/index372.js.map +1 -1
  346. package/dist/index373.js +200 -4
  347. package/dist/index373.js.map +1 -1
  348. package/dist/index374.js +74 -18
  349. package/dist/index374.js.map +1 -1
  350. package/dist/index375.js +123 -12
  351. package/dist/index375.js.map +1 -1
  352. package/dist/index379.js +4 -4
  353. package/dist/index380.js +3 -3
  354. package/dist/index382.js +1 -1
  355. package/dist/index384.js +1 -1
  356. package/dist/index385.js +2 -2
  357. package/dist/index388.js +2 -2
  358. package/dist/index389.js +2 -2
  359. package/dist/index392.js +5 -3
  360. package/dist/index392.js.map +1 -1
  361. package/dist/index393.js +5 -3
  362. package/dist/index393.js.map +1 -1
  363. package/dist/index394.js +4 -5
  364. package/dist/index394.js.map +1 -1
  365. package/dist/index395.js +15 -4
  366. package/dist/index395.js.map +1 -1
  367. package/dist/index396.js +9 -4
  368. package/dist/index396.js.map +1 -1
  369. package/dist/index397.js +5 -15
  370. package/dist/index397.js.map +1 -1
  371. package/dist/index398.js +4 -8
  372. package/dist/index398.js.map +1 -1
  373. package/dist/index399.js +545 -5
  374. package/dist/index399.js.map +1 -1
  375. package/dist/index400.js +47 -5
  376. package/dist/index400.js.map +1 -1
  377. package/dist/index401.js +15 -543
  378. package/dist/index401.js.map +1 -1
  379. package/dist/index402.js +6 -47
  380. package/dist/index402.js.map +1 -1
  381. package/dist/index403.js +7 -17
  382. package/dist/index403.js.map +1 -1
  383. package/dist/index404.js +6 -5
  384. package/dist/index404.js.map +1 -1
  385. package/dist/index405.js +7 -7
  386. package/dist/index405.js.map +1 -1
  387. package/dist/index406.js +11 -6
  388. package/dist/index406.js.map +1 -1
  389. package/dist/index407.js +8 -7
  390. package/dist/index407.js.map +1 -1
  391. package/dist/index408.js +12 -11
  392. package/dist/index408.js.map +1 -1
  393. package/dist/index409.js +3 -9
  394. package/dist/index409.js.map +1 -1
  395. package/dist/index410.js +3 -13
  396. package/dist/index410.js.map +1 -1
  397. package/dist/index411.js +15 -3
  398. package/dist/index411.js.map +1 -1
  399. package/dist/index412.js +3 -15
  400. package/dist/index412.js.map +1 -1
  401. package/dist/index413.js +1 -1
  402. package/dist/index414.js +4 -7
  403. package/dist/index414.js.map +1 -1
  404. package/dist/index415.js +56 -2
  405. package/dist/index415.js.map +1 -1
  406. package/dist/index416.js +67 -43
  407. package/dist/index416.js.map +1 -1
  408. package/dist/index417.js +31 -56
  409. package/dist/index417.js.map +1 -1
  410. package/dist/index418.js +9 -8
  411. package/dist/index418.js.map +1 -1
  412. package/dist/index419.js +153 -2
  413. package/dist/index419.js.map +1 -1
  414. package/dist/index420.js +107 -54
  415. package/dist/index420.js.map +1 -1
  416. package/dist/index421.js +7 -55
  417. package/dist/index421.js.map +1 -1
  418. package/dist/index422.js +2 -33
  419. package/dist/index422.js.map +1 -1
  420. package/dist/index423.js +43 -4
  421. package/dist/index423.js.map +1 -1
  422. package/dist/index424.js +55 -55
  423. package/dist/index424.js.map +1 -1
  424. package/dist/index425.js +8 -68
  425. package/dist/index425.js.map +1 -1
  426. package/dist/index426.js +2 -31
  427. package/dist/index426.js.map +1 -1
  428. package/dist/index427.js +55 -9
  429. package/dist/index427.js.map +1 -1
  430. package/dist/index428.js +55 -152
  431. package/dist/index428.js.map +1 -1
  432. package/dist/index429.js +32 -107
  433. package/dist/index429.js.map +1 -1
  434. package/dist/index430.js +16 -2
  435. package/dist/index430.js.map +1 -1
  436. package/dist/index431.js +29 -2
  437. package/dist/index431.js.map +1 -1
  438. package/dist/index432.js +13 -2
  439. package/dist/index432.js.map +1 -1
  440. package/dist/index433.js +7 -2
  441. package/dist/index433.js.map +1 -1
  442. package/dist/index434.js +2 -16
  443. package/dist/index434.js.map +1 -1
  444. package/dist/index435.js +2 -29
  445. package/dist/index435.js.map +1 -1
  446. package/dist/index436.js +2 -13
  447. package/dist/index436.js.map +1 -1
  448. package/dist/index437.js +2 -7
  449. package/dist/index437.js.map +1 -1
  450. package/dist/index49.js +30 -30
  451. package/dist/index50.js +21 -21
  452. package/dist/index51.js +1 -1
  453. package/dist/index52.js +8 -8
  454. package/dist/index53.js +2 -2
  455. package/dist/index55.js +16 -16
  456. package/dist/index56.js +4 -4
  457. package/dist/index57.js +3 -3
  458. package/dist/index58.js +7 -7
  459. package/dist/index59.js +4 -4
  460. package/dist/index60.js +12 -12
  461. package/dist/index61.js +2 -2
  462. package/dist/index62.js +2 -2
  463. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index349.js","sources":["../../../node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions, usePopupInteractionProps, usePopupRootSync } from \"../../utils/popups/index.mjs\";\nexport function useDialogRoot(params) {\n const {\n store,\n actionsRef\n } = params;\n const open = store.useState('open');\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }, [store]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n}\nexport function DialogInteractions({\n store,\n parentContext,\n isDrawer\n}) {\n const open = store.useState('open');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const floatingRootContext = store.useState('floatingRootContext');\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event && event.touches.length !== 1) {\n return false;\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n return store.context.internalBackdropRef.current || store.context.backdropRef.current ? store.context.internalBackdropRef.current === target || store.context.backdropRef.current === target || contains(target, popupElement) && !target?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n\n // Listen for nested open/close events on this store to maintain the counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n store.useContextCallback('onNestedDialogClose', () => {\n setOwnNestedOpenDialogs(0);\n setOwnNestedOpenDrawers(0);\n });\n\n // Notify parent of our open/close state using parent callbacks, if any\n React.useEffect(() => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n }\n if (parentContext?.onNestedDialogClose && !open) {\n parentContext.onNestedDialogClose();\n }\n return () => {\n if (parentContext?.onNestedDialogClose && open) {\n parentContext.onNestedDialogClose();\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n const activeTriggerProps = dismiss.reference ?? EMPTY_OBJECT;\n const inactiveTriggerProps = dismiss.trigger ?? EMPTY_OBJECT;\n // Consumers (DialogPopup/DrawerPopup) already spread `FOCUSABLE_POPUP_PROPS`\n // directly, so the popup props only need to carry the dismiss handlers.\n const popupProps = dismiss.floating ?? EMPTY_OBJECT;\n usePopupInteractionProps(store, {\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n return null;\n}"],"names":["useDialogRoot","params","store","actionsRef","open","usePopupRootSync","useImplicitActiveTrigger","forceUnmount","useOpenStateTransitions","handleImperativeClose","React","createChangeEventDetails","REASONS.imperativeAction","DialogInteractions","parentContext","isDrawer","disablePointerDismissal","modal","popupElement","floatingRootContext","ownNestedOpenDialogs","setOwnNestedOpenDialogs","ownNestedOpenDrawers","setOwnNestedOpenDrawers","isTopmost","dismiss","useDismiss","event","target","getTarget","contains","useScrollLock","dialogCount","drawerCount","activeTriggerProps","EMPTY_OBJEC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List":[0]}
1
+ {"version":3,"file":"index349.js","sources":["../../../node_modules/@base-ui/utils/reactVersion.mjs"],"sourcesContent":["import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}"],"names":["majorVersion","React","isReactVersionAtLeast","reactVersionToCheck"],"mappings":";AACA,MAAMA,IAAe,SAASC,EAAM,SAAS,EAAE;AACxC,SAASC,EAAsBC,GAAqB;AACzD,SAAOH,KAAgBG;AACzB;","x_google_ignoreList":[0]}
package/dist/index350.js CHANGED
@@ -1,70 +1,65 @@
1
- import * as p from "react";
2
- import { ReactStore as l } from "./index358.js";
3
- import { createPopupFloatingRootContext as d, popupStoreSelectors as u, createInitialPopupStoreState as c } from "./index359.js";
4
- import { PopupTriggerMap as m } from "./index360.js";
5
- import { setPopupOpenState as f, usePopupStore as g } from "./index184.js";
6
- import { createSelector as o } from "./index361.js";
7
- const C = {
8
- ...u,
9
- modal: o((e) => e.modal),
10
- nested: o((e) => e.nested),
11
- nestedOpenDialogCount: o((e) => e.nestedOpenDialogCount),
12
- nestedOpenDrawerCount: o((e) => e.nestedOpenDrawerCount),
13
- disablePointerDismissal: o((e) => e.disablePointerDismissal),
14
- openMethod: o((e) => e.openMethod),
15
- descriptionElementId: o((e) => e.descriptionElementId),
16
- titleElementId: o((e) => e.titleElementId),
17
- viewportElement: o((e) => e.viewportElement),
18
- role: o((e) => e.role)
19
- };
20
- class a extends l {
21
- constructor(n, t, r = !1) {
22
- const i = new m(), s = h(n);
23
- s.floatingRootContext = d(i, t, r), super(s, {
24
- popupRef: /* @__PURE__ */ p.createRef(),
25
- backdropRef: /* @__PURE__ */ p.createRef(),
26
- internalBackdropRef: /* @__PURE__ */ p.createRef(),
27
- outsidePressEnabledRef: {
28
- current: !0
29
- },
30
- triggerElements: i,
31
- onOpenChange: void 0,
32
- onOpenChangeComplete: void 0
33
- }, C);
34
- }
35
- setOpen = (n, t) => {
36
- if (t.preventUnmountOnClose = () => {
37
- this.set("preventUnmountingOnClose", !0);
38
- }, !n && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(n, t), t.isCanceled)
39
- return;
40
- this.state.floatingRootContext.dispatchOpenChange(n, t);
41
- const r = {
42
- open: n
43
- };
44
- f(r, n, t.trigger), this.update(r);
45
- };
46
- static useStore(n, t) {
47
- return g(n, (i, s) => new a(t, i, s), !0).store;
48
- }
1
+ import * as r from "react";
2
+ import { useScrollLock as P } from "./index375.js";
3
+ import { EMPTY_OBJECT as f } from "./index264.js";
4
+ import { createChangeEventDetails as C } from "./index175.js";
5
+ import { usePopupRootSync as S, useImplicitActiveTrigger as k, useOpenStateTransitions as E, usePopupInteractionProps as T } from "./index184.js";
6
+ import { useDismiss as h } from "./index279.js";
7
+ import { getTarget as w, contains as x } from "./index291.js";
8
+ import { imperativeAction as I } from "./index177.js";
9
+ function L(e) {
10
+ const {
11
+ store: t,
12
+ actionsRef: a
13
+ } = e, o = t.useState("open");
14
+ S(t, o), k(t);
15
+ const {
16
+ forceUnmount: c
17
+ } = E(o, t), s = r.useCallback(() => {
18
+ t.setOpen(!1, C(I));
19
+ }, [t]);
20
+ r.useImperativeHandle(a, () => ({
21
+ unmount: c,
22
+ close: s
23
+ }), [c, s]);
49
24
  }
50
- function h(e = {}) {
51
- return {
52
- ...c(),
53
- modal: !0,
54
- disablePointerDismissal: !1,
55
- popupElement: null,
56
- viewportElement: null,
57
- descriptionElementId: void 0,
58
- titleElementId: void 0,
59
- openMethod: null,
60
- nested: !1,
61
- nestedOpenDialogCount: 0,
62
- nestedOpenDrawerCount: 0,
63
- role: "dialog",
64
- ...e
65
- };
25
+ function M({
26
+ store: e,
27
+ parentContext: t,
28
+ isDrawer: a
29
+ }) {
30
+ const o = e.useState("open"), c = e.useState("disablePointerDismissal"), s = e.useState("modal"), d = e.useState("popupElement"), O = e.useState("floatingRootContext"), [u, m] = r.useState(0), [l, g] = r.useState(0), D = u === 0, p = h(O, {
31
+ outsidePressEvent() {
32
+ return e.context.internalBackdropRef.current || e.context.backdropRef.current ? "intentional" : {
33
+ mouse: s === "trap-focus" ? "sloppy" : "intentional",
34
+ touch: "sloppy"
35
+ };
36
+ },
37
+ outsidePress(n) {
38
+ if (!e.context.outsidePressEnabledRef.current || "button" in n && n.button !== 0 || "touches" in n && n.touches.length !== 1)
39
+ return !1;
40
+ const i = w(n);
41
+ return D && !c ? s && (e.context.internalBackdropRef.current || e.context.backdropRef.current) ? e.context.internalBackdropRef.current === i || e.context.backdropRef.current === i || x(i, d) && !i?.hasAttribute("data-base-ui-portal") : !0 : !1;
42
+ },
43
+ escapeKey: D
44
+ });
45
+ P(o && s === !0, d), e.useContextCallback("onNestedDialogOpen", (n, i) => {
46
+ m(n), g(i);
47
+ }), e.useContextCallback("onNestedDialogClose", () => {
48
+ m(0), g(0);
49
+ }), r.useEffect(() => (t?.onNestedDialogOpen && o && t.onNestedDialogOpen(u + 1, l + (a ? 1 : 0)), t?.onNestedDialogClose && !o && t.onNestedDialogClose(), () => {
50
+ t?.onNestedDialogClose && o && t.onNestedDialogClose();
51
+ }), [a, o, u, l, t]);
52
+ const b = p.reference ?? f, R = p.trigger ?? f, N = p.floating ?? f;
53
+ return T(e, {
54
+ activeTriggerProps: b,
55
+ inactiveTriggerProps: R,
56
+ popupProps: N,
57
+ nestedOpenDialogCount: u,
58
+ nestedOpenDrawerCount: l
59
+ }), null;
66
60
  }
67
61
  export {
68
- a as DialogStore
62
+ M as DialogInteractions,
63
+ L as useDialogRoot
69
64
  };
70
65
  //# sourceMappingURL=index350.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index350.js","sources":["../../../node_modules/@base-ui/react/dialog/store/DialogStore.mjs"],"sourcesContent":["import * as React from 'react';\nimport { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { createPopupFloatingRootContext, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, setPopupOpenState, usePopupStore } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: createSelector(state => state.modal),\n nested: createSelector(state => state.nested),\n nestedOpenDialogCount: createSelector(state => state.nestedOpenDialogCount),\n nestedOpenDrawerCount: createSelector(state => state.nestedOpenDrawerCount),\n disablePointerDismissal: createSelector(state => state.disablePointerDismissal),\n openMethod: createSelector(state => state.openMethod),\n descriptionElementId: createSelector(state => state.descriptionElementId),\n titleElementId: createSelector(state => state.titleElementId),\n viewportElement: createSelector(state => state.viewportElement),\n role: createSelector(state => state.role)\n};\nexport class DialogStore extends ReactStore {\n constructor(initialState, floatingId, nested = false) {\n const triggerElements = new PopupTriggerMap();\n const state = createInitialState(initialState);\n state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);\n super(state, {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements,\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const updatedState = {\n open: nextOpen\n };\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger);\n this.update(updatedState);\n };\n static useStore(externalStore, initialState) {\n /* eslint-disable react-hooks/rules-of-hooks */\n const store = usePopupStore(externalStore, (floatingId, nested) => new DialogStore(initialState, floatingId, nested), true).store;\n /* eslint-enable react-hooks/rules-of-hooks */\n\n return store;\n }\n}\nfunction createInitialState(initialState = {}) {\n return {\n ...createInitialPopupStoreState(),\n modal: true,\n disablePointerDismissal: false,\n popupElement: null,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n}"],"names":["selectors","popupStoreSelectors","createSelector","state","DialogStore","ReactStore","initialState","floatingId","nested","triggerElements","PopupTriggerMap","createInitialState","createPopupFloatingRootContext","React","nextOpen","eventDetails","updatedState","setPopupOpenState","externalStore","usePopupStore","createInitialPopupStoreState"],"mappings":";;;;;;AAGA,MAAMA,IAAY;AAAA,EAChB,GAAGC;AAAA,EACH,OAAOC,EAAe,CAAAC,MAASA,EAAM,KAAK;AAAA,EAC1C,QAAQD,EAAe,CAAAC,MAASA,EAAM,MAAM;AAAA,EAC5C,uBAAuBD,EAAe,CAAAC,MAASA,EAAM,qBAAqB;AAAA,EAC1E,uBAAuBD,EAAe,CAAAC,MAASA,EAAM,qBAAqB;AAAA,EAC1E,yBAAyBD,EAAe,CAAAC,MAASA,EAAM,uBAAuB;AAAA,EAC9E,YAAYD,EAAe,CAAAC,MAASA,EAAM,UAAU;AAAA,EACpD,sBAAsBD,EAAe,CAAAC,MAASA,EAAM,oBAAoB;AAAA,EACxE,gBAAgBD,EAAe,CAAAC,MAASA,EAAM,cAAc;AAAA,EAC5D,iBAAiBD,EAAe,CAAAC,MAASA,EAAM,eAAe;AAAA,EAC9D,MAAMD,EAAe,CAAAC,MAASA,EAAM,IAAI;AAC1C;AACO,MAAMC,UAAoBC,EAAW;AAAA,EAC1C,YAAYC,GAAcC,GAAYC,IAAS,IAAO;AACpD,UAAMC,IAAkB,IAAIC,EAAe,GACrCP,IAAQQ,EAAmBL,CAAY;AAC7C,IAAAH,EAAM,sBAAsBS,EAA+BH,GAAiBF,GAAYC,CAAM,GAC9F,MAAML,GAAO;AAAA,MACX,UAAuB,gB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@base-ui/react/dialog/root/useDialogRoot.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions, usePopupInteractionProps, usePopupRootSync } from \"../../utils/popups/index.mjs\";\nexport function useDialogRoot(params) {\n const {\n store,\n actionsRef\n } = params;\n const open = store.useState('open');\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }, [store]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n}\nexport function DialogInteractions({\n store,\n parentContext,\n isDrawer\n}) {\n const open = store.useState('open');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const floatingRootContext = store.useState('floatingRootContext');\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event && event.touches.length !== 1) {\n return false;\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n return store.context.internalBackdropRef.current || store.context.backdropRef.current ? store.context.internalBackdropRef.current === target || store.context.backdropRef.current === target || contains(target, popupElement) && !target?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n\n // Listen for nested open/close events on this store to maintain the counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n store.useContextCallback('onNestedDialogClose', () => {\n setOwnNestedOpenDialogs(0);\n setOwnNestedOpenDrawers(0);\n });\n\n // Notify parent of our open/close state using parent callbacks, if any\n React.useEffect(() => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n }\n if (parentContext?.onNestedDialogClose && !open) {\n parentContext.onNestedDialogClose();\n }\n return () => {\n if (parentContext?.onNestedDialogClose && open) {\n parentContext.onNestedDialogClose();\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n const activeTriggerProps = dismiss.reference ?? EMPTY_OBJECT;\n const inactiveTriggerProps = dismiss.trigger ?? EMPTY_OBJECT;\n // Consumers (DialogPopup/DrawerPopup) already spread `FOCUSABLE_POPUP_PROPS`\n // directly, so the popup props only need to carry the dismiss handlers.\n const popupProps = dismiss.floating ?? EMPTY_OBJECT;\n usePopupInteractionProps(store, {\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n return null;\n}"],"names":["useDialogRoot","params","store","actionsRef","open","usePopupRootSync","useImplicitActiveTrigger","forceUnmount","useOpenStateTransitions","handleImperativeClose","React","createChangeEventDetails","REASONS.imperativeAction","DialogInteractions","parentContext","isDrawer","disablePointerDismissal","modal","popupElement","floatingRootContext","ownNestedOpenDialogs","setOwnNestedOpenDialogs","ownNestedOpenDrawers","setOwnNestedOpenDrawers","isTopmost","dismiss","useDismiss","event","target","getTarget","contains","useScrollLock","dialogCount","drawerCount","activeTriggerProps","EMPTY_OBJECT","inactiveTriggerProps","popupProps","usePopupInteractionProps"],"mappings":";;;;;;;;AAUO,SAASA,EAAcC,GAAQ;AACpC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,YAAAC;AAAA,EACJ,IAAMF,GACEG,IAAOF,EAAM,SAAS,MAAM;AAClC,EAAAG,EAAiBH,GAAOE,CAAI,GAC5BE,EAAyBJ,CAAK;AAC9B,QAAM;AAAA,IACJ,cAAAK;AAAA,EACJ,IAAMC,EAAwBJ,GAAMF,CAAK,GACjCO,IAAwBC,EAAM,YAAY,MAAM;AACpD,IAAAR,EAAM,QAAQ,IAAOS,EAAyBC,CAAwB,CAAC;AAAA,EACzE,GAAG,CAACV,CAAK,CAAC;AACV,EAAAQ,EAAM,oBAAoBP,GAAY,OAAO;AAAA,IAC3C,SAASI;AAAA,IACT,OAAOE;AAAA,EACX,IAAM,CAACF,GAAcE,CAAqB,CAAC;AAC3C;AACO,SAASI,EAAmB;AAAA,EACjC,OAAAX;AAAA,EACA,eAAAY;AAAA,EACA,UAAAC;AACF,GAAG;AACD,QAAMX,IAAOF,EAAM,SAAS,MAAM,GAC5Bc,IAA0Bd,EAAM,SAAS,yBAAyB,GAClEe,IAAQf,EAAM,SAAS,OAAO,GAC9BgB,IAAehB,EAAM,SAAS,cAAc,GAC5CiB,IAAsBjB,EAAM,SAAS,qBAAqB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5B,MAAM;AACX,IAAIA,GAAe,uBAAuBV,KACxCU,EAAc,oBAAmB;AAAA,EAErC,IACC,CAACC,GAAUX,GAAMgB,GAAsBE,GAAsBR,CAAa,CAAC;AAC9E,QAAMoB,IAAqBT,EAAQ,aAAaU,GAC1CC,IAAuBX,EAAQ,WAAWU,GAG1CE,IAAaZ,EAAQ,YAAYU;AACvC,SAAAG,EAAyBpC,GAAO;AAAA,IAC9B,oBAAAgC;AAAA,IACA,sBAAAE;AAAA,IACA,YAAAC;AAAA,IACA,uBAAuBjB;AAAA,IACvB,uBAAuBE;AAAA,EAC3B,CAAG,GACM;AACT;","x_google_ignoreList":[0]}
package/dist/index351.js CHANGED
@@ -1,21 +1,70 @@
1
- import * as n from "react";
2
- import { SafeReact as f } from "./index353.js";
3
- let o = 0;
4
- function l(u, t = "mui") {
5
- const [e, s] = n.useState(u), c = u || e;
6
- return n.useEffect(() => {
7
- e == null && (o += 1, s(`${t}-${o}`));
8
- }, [e, t]), c;
9
- }
10
- const a = f.useId;
11
- function I(u, t) {
12
- if (a !== void 0) {
13
- const e = a();
14
- return u ?? (t ? `${t}-${e}` : e);
1
+ import * as p from "react";
2
+ import { ReactStore as l } from "./index358.js";
3
+ import { createPopupFloatingRootContext as d, popupStoreSelectors as u, createInitialPopupStoreState as c } from "./index359.js";
4
+ import { PopupTriggerMap as m } from "./index360.js";
5
+ import { setPopupOpenState as f, usePopupStore as g } from "./index184.js";
6
+ import { createSelector as o } from "./index361.js";
7
+ const C = {
8
+ ...u,
9
+ modal: o((e) => e.modal),
10
+ nested: o((e) => e.nested),
11
+ nestedOpenDialogCount: o((e) => e.nestedOpenDialogCount),
12
+ nestedOpenDrawerCount: o((e) => e.nestedOpenDrawerCount),
13
+ disablePointerDismissal: o((e) => e.disablePointerDismissal),
14
+ openMethod: o((e) => e.openMethod),
15
+ descriptionElementId: o((e) => e.descriptionElementId),
16
+ titleElementId: o((e) => e.titleElementId),
17
+ viewportElement: o((e) => e.viewportElement),
18
+ role: o((e) => e.role)
19
+ };
20
+ class a extends l {
21
+ constructor(n, t, r = !1) {
22
+ const i = new m(), s = h(n);
23
+ s.floatingRootContext = d(i, t, r), super(s, {
24
+ popupRef: /* @__PURE__ */ p.createRef(),
25
+ backdropRef: /* @__PURE__ */ p.createRef(),
26
+ internalBackdropRef: /* @__PURE__ */ p.createRef(),
27
+ outsidePressEnabledRef: {
28
+ current: !0
29
+ },
30
+ triggerElements: i,
31
+ onOpenChange: void 0,
32
+ onOpenChangeComplete: void 0
33
+ }, C);
15
34
  }
16
- return l(u, t);
35
+ setOpen = (n, t) => {
36
+ if (t.preventUnmountOnClose = () => {
37
+ this.set("preventUnmountingOnClose", !0);
38
+ }, !n && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(n, t), t.isCanceled)
39
+ return;
40
+ this.state.floatingRootContext.dispatchOpenChange(n, t);
41
+ const r = {
42
+ open: n
43
+ };
44
+ f(r, n, t.trigger), this.update(r);
45
+ };
46
+ static useStore(n, t) {
47
+ return g(n, (i, s) => new a(t, i, s), !0).store;
48
+ }
49
+ }
50
+ function h(e = {}) {
51
+ return {
52
+ ...c(),
53
+ modal: !0,
54
+ disablePointerDismissal: !1,
55
+ popupElement: null,
56
+ viewportElement: null,
57
+ descriptionElementId: void 0,
58
+ titleElementId: void 0,
59
+ openMethod: null,
60
+ nested: !1,
61
+ nestedOpenDialogCount: 0,
62
+ nestedOpenDrawerCount: 0,
63
+ role: "dialog",
64
+ ...e
65
+ };
17
66
  }
18
67
  export {
19
- I as useId
68
+ a as DialogStore
20
69
  };
21
70
  //# sourceMappingURL=index351.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index351.js","sources":["../../../node_modules/@base-ui/utils/useId.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.mjs\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`${prefix}-${globalId}`);\n }\n }, [defaultId, prefix]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 17.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}"],"names":["globalId","useGlobalId","idOverride","prefix","defaultId","setDefaultId","React","id","maybeReactUseId","SafeReact","useId","reactId"],"mappings":";;AAIA,IAAIA,IAAW;AAGf,SAASC,EAAYC,GAAYC,IAAS,OAAO;AAC/C,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAM,SAASJ,CAAU,GACrDK,IAAKL,KAAcE;AACzB,SAAAE,EAAM,UAAU,MAAM;AACpB,IAAIF,KAAa,SAKfJ,KAAY,GACZK,EAAa,GAAGF,CAAM,IAAIH,CAAQ,EAAE;AAAA,EAExC,GAAG,CAACI,GAAWD,CAAM,CAAC,GACfI;AACT;AACA,MAAMC,IAAkBC,EAAU;AAQ3B,SAASC,EAAMR,GAAYC,GAAQ;AAExC,MAAIK,MAAoB,QAAW;AACjC,UAAMG,IAAUH,EAAe;AAC/B,WAAON,MAAeC,IAAS,GAAGA,CAAM,IAAIQ,CAAO,KAAKA;AAAA,EAC1D;AAIA,SAAOV,EAAYC,GAAYC,CAAM;AACvC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index351.js","sources":["../../../node_modules/@base-ui/react/dialog/store/DialogStore.mjs"],"sourcesContent":["import * as React from 'react';\nimport { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { createPopupFloatingRootContext, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, setPopupOpenState, usePopupStore } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: createSelector(state => state.modal),\n nested: createSelector(state => state.nested),\n nestedOpenDialogCount: createSelector(state => state.nestedOpenDialogCount),\n nestedOpenDrawerCount: createSelector(state => state.nestedOpenDrawerCount),\n disablePointerDismissal: createSelector(state => state.disablePointerDismissal),\n openMethod: createSelector(state => state.openMethod),\n descriptionElementId: createSelector(state => state.descriptionElementId),\n titleElementId: createSelector(state => state.titleElementId),\n viewportElement: createSelector(state => state.viewportElement),\n role: createSelector(state => state.role)\n};\nexport class DialogStore extends ReactStore {\n constructor(initialState, floatingId, nested = false) {\n const triggerElements = new PopupTriggerMap();\n const state = createInitialState(initialState);\n state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);\n super(state, {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements,\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const updatedState = {\n open: nextOpen\n };\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger);\n this.update(updatedState);\n };\n static useStore(externalStore, initialState) {\n /* eslint-disable react-hooks/rules-of-hooks */\n const store = usePopupStore(externalStore, (floatingId, nested) => new DialogStore(initialState, floatingId, nested), true).store;\n /* eslint-enable react-hooks/rules-of-hooks */\n\n return store;\n }\n}\nfunction createInitialState(initialState = {}) {\n return {\n ...createInitialPopupStoreState(),\n modal: true,\n disablePointerDismissal: false,\n popupElement: null,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n}"],"names":["selectors","popupStoreSelectors","createSelector","state","DialogStore","ReactStore","initialState","floatingId","nested","triggerElements","PopupTriggerMap","createInitialState","createPopupFloatingRootContext","React","nextOpen","eventDetails","updatedState","setPopupOpenState","externalStore","usePopupStore","createInitialPopupStoreState"],"mappings":";;;;;;AAGA,MAAMA,IAAY;AAAA,EAChB,GAAGC;AAAA,EACH,OAAOC,EAAe,CAAAC,MAASA,EAAM,KAAK;AAAA,EAC1C,QAAQD,EAAe,CAAAC,MAASA,EAAM,MAAM;AAAA,EAC5C,uBAAuBD,EAAe,CAAAC,MAASA,EAAM,qBAAqB;AAAA,EAC1E,uBAAuBD,EAAe,CAAAC,MAASA,EAAM,qBAAqB;AAAA,EAC1E,yBAAyBD,EAAe,CAAAC,MAASA,EAAM,uBAAuB;AAAA,EAC9E,YAAYD,EAAe,CAAAC,MAASA,EAAM,UAAU;AAAA,EACpD,sBAAsBD,EAAe,CAAAC,MAASA,EAAM,oBAAoB;AAAA,EACxE,gBAAgBD,EAAe,CAAAC,MAASA,EAAM,cAAc;AAAA,EAC5D,iBAAiBD,EAAe,CAAAC,MAASA,EAAM,eAAe;AAAA,EAC9D,MAAMD,EAAe,CAAAC,MAASA,EAAM,IAAI;AA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A,IACd,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,IACvB,MAAM;AAAA,IACN,GAAGd;AAAA,EACP;AACA;","x_google_ignoreList":[0]}
package/dist/index357.js CHANGED
@@ -1,4 +1,4 @@
1
- import { lowerPlatform as t, lowerUserAgent as n, maxTouchPoints as i } from "./index422.js";
1
+ import { lowerPlatform as t, lowerUserAgent as n, maxTouchPoints as i } from "./index429.js";
2
2
  const s = /^i(os$|p)/.test(t) || t === "macintel" && i > 1, o = "android", c = t === o || n.includes(o), r = !s && t.startsWith("mac");
3
3
  t.startsWith("win");
4
4
  const e = r || s;
package/dist/index358.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as c from "react";
2
- import { Store as l } from "./index223.js";
3
- import { useStore as a } from "./index217.js";
4
- import { useStableCallback as f } from "./index202.js";
5
- import { useIsoLayoutEffect as u } from "./index201.js";
6
- import { NOOP as d } from "./index204.js";
2
+ import { Store as l } from "./index283.js";
3
+ import { useStore as a } from "./index277.js";
4
+ import { useStableCallback as f } from "./index262.js";
5
+ import { useIsoLayoutEffect as u } from "./index261.js";
6
+ import { NOOP as d } from "./index264.js";
7
7
  class g extends l {
8
8
  /**
9
9
  * Creates a new ReactStore instance.
package/dist/index359.js CHANGED
@@ -1,4 +1,4 @@
1
- import { EMPTY_OBJECT as r } from "./index204.js";
1
+ import { EMPTY_OBJECT as r } from "./index264.js";
2
2
  import { FloatingRootStore as l } from "./index388.js";
3
3
  import { getEmptyRootContext as d } from "./index391.js";
4
4
  import { createSelector as o } from "./index361.js";
package/dist/index362.js CHANGED
@@ -1,7 +1,8 @@
1
- let a = /* @__PURE__ */ (function(d) {
2
- return d.disabled = "data-disabled", d.valid = "data-valid", d.invalid = "data-invalid", d.touched = "data-touched", d.dirty = "data-dirty", d.filled = "data-filled", d.focused = "data-focused", d;
3
- })({});
1
+ function r(s, t) {
2
+ const e = t.startOfMonth(s), n = e.getDay() > 0 ? e.getDay() : 7, a = t.addDays(s, -n + 1), o = t.addDays(a, 34);
3
+ return t.getMonth(s) === t.getMonth(o) ? 5 : 4;
4
+ }
4
5
  export {
5
- a as FieldControlDataAttributes
6
+ r as getBroadcastWeeksInMonth
6
7
  };
7
8
  //# sourceMappingURL=index362.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index362.js","sources":["../../../node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs"],"sourcesContent":["export let FieldControlDataAttributes = /*#__PURE__*/function (FieldControlDataAttributes) {\n /**\n * Present when the field is disabled.\n */\n FieldControlDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the field is in a valid state.\n */\n FieldControlDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the field is in an invalid state.\n */\n FieldControlDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the field has been touched.\n */\n FieldControlDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the field's value has changed.\n */\n FieldControlDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the field is filled.\n */\n FieldControlDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the field control is focused.\n */\n FieldControlDataAttributes[\"focused\"] = \"data-focused\";\n return FieldControlDataAttributes;\n}({});"],"names":["FieldControlDataAttributes"],"mappings":"AAAU,IAACA,IAA0C,0BAAUA,GAA4B;AAIzF,SAAAA,EAA2B,WAAc,iBAIzCA,EAA2B,QAAW,cAItCA,EAA2B,UAAa,gBAIxCA,EAA2B,UAAa,gBAIxCA,EAA2B,QAAW,cAItCA,EAA2B,SAAY,eAIvCA,EAA2B,UAAa,gBACjCA;AACT,GAAE,CAAA,CAAE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index362.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js"],"sourcesContent":["const FIVE_WEEKS = 5;\nconst FOUR_WEEKS = 4;\n/**\n * Returns the number of weeks to display in the broadcast calendar for a given\n * month.\n *\n * The broadcast calendar may have either 4 or 5 weeks in a month, depending on\n * the start and end dates of the broadcast weeks.\n *\n * @since 9.4.0\n * @param month The month for which to calculate the number of weeks.\n * @param dateLib The date library to use for date manipulation.\n * @returns The number of weeks in the broadcast calendar (4 or 5).\n */\nexport function getBroadcastWeeksInMonth(month, dateLib) {\n // Get the first day of the month\n const firstDayOfMonth = dateLib.startOfMonth(month);\n // Get the day of the week for the first day of the month (1-7, where 1 is Monday)\n const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;\n const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);\n const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);\n const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek)\n ? FIVE_WEEKS\n : FOUR_WEEKS;\n return numberOfWeeks;\n}\n"],"names":["getBroadcastWeeksInMonth","month","dateLib","firstDayOfMonth","firstDayOfWeek","broadcastStartDate","lastDateOfLastWeek"],"mappings":"AAcO,SAASA,EAAyBC,GAAOC,GAAS;AAErD,QAAMC,IAAkBD,EAAQ,aAAaD,CAAK,GAE5CG,IAAiBD,EAAgB,OAAM,IAAK,IAAIA,EAAgB,OAAM,IAAK,GAC3EE,IAAqBH,EAAQ,QAAQD,GAAO,CAACG,IAAiB,CAAC,GAC/DE,IAAqBJ,EAAQ,QAAQG,GAAoB,EAAkB;AAIjF,SAHsBH,EAAQ,SAASD,CAAK,MAAMC,EAAQ,SAASI,CAAkB,IAC/E,IACA;AAEV;","x_google_ignoreList":[0]}
package/dist/index363.js CHANGED
@@ -1,9 +1,21 @@
1
- import * as o from "react";
2
- const e = [];
3
- function n(t) {
4
- o.useEffect(t, e);
5
- }
1
+ import { formatDistance as o } from "./index416.js";
2
+ import { formatLong as t } from "./index417.js";
3
+ import { formatRelative as r } from "./index418.js";
4
+ import { localize as m } from "./index419.js";
5
+ import { match as a } from "./index420.js";
6
+ const p = {
7
+ code: "en-US",
8
+ formatDistance: o,
9
+ formatLong: t,
10
+ formatRelative: r,
11
+ localize: m,
12
+ match: a,
13
+ options: {
14
+ weekStartsOn: 0,
15
+ firstWeekContainsDate: 1
16
+ }
17
+ };
6
18
  export {
7
- n as useOnMount
19
+ p as enUS
8
20
  };
9
21
  //# sourceMappingURL=index363.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index363.js","sources":["../../../node_modules/@base-ui/utils/useOnMount.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}"],"names":["EMPTY","useOnMount","fn","React"],"mappings":";AAGA,MAAMA,IAAQ,CAAA;AAKP,SAASC,EAAWC,GAAI;AAG7B,EAAAC,EAAM,UAAUD,GAAIF,CAAK;AAE3B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index363.js","sources":["../../../node_modules/date-fns/locale/en-US.js"],"sourcesContent":["import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n"],"names":["enUS","formatDistance","formatLong","formatRelative","localize","match"],"mappings":";;;;;AAcY,MAACA,IAAO;AAAA,EAClB,MAAM;AAAA,EACN,gBAAgBC;AAAA,EAChB,YAAYC;AAAA,EACZ,gBAAgBC;AAAA,EAChB,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAAS;AAAA,IACP,cAAc;AAAA,IACd,uBAAuB;AAAA,EAC3B;AACA;","x_google_ignoreList":[0]}
package/dist/index364.js CHANGED
@@ -1,6 +1,16 @@
1
- import { lowerUserAgent as o } from "./index422.js";
2
- const e = /jsdom|happydom/.test(o);
1
+ function g(d, s, k, t, f, O, n) {
2
+ const { ISOWeek: o, broadcastCalendar: r } = O, { addDays: W, addMonths: c, addWeeks: l, addYears: u, endOfBroadcastWeek: b, endOfISOWeek: m, endOfWeek: y, max: F, min: I, startOfBroadcastWeek: h, startOfISOWeek: x, startOfWeek: B } = n;
3
+ let a = {
4
+ day: W,
5
+ week: l,
6
+ month: c,
7
+ year: u,
8
+ startOfWeek: (e) => r ? h(e, n) : o ? x(e) : B(e),
9
+ endOfWeek: (e) => r ? b(e) : o ? m(e) : y(e)
10
+ }[d](k, s === "after" ? 1 : -1);
11
+ return s === "before" && t ? a = F([t, a]) : s === "after" && f && (a = I([f, a])), a;
12
+ }
3
13
  export {
4
- e as jsdom
14
+ g as getFocusableDate
5
15
  };
6
16
  //# sourceMappingURL=index364.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index364.js","sources":["../../../node_modules/@base-ui/utils/platform/env.mjs"],"sourcesContent":["import { lowerUserAgent } from \"./shared.mjs\";\n\n/** Running in jsdom or HappyDOM (used by unit tests). */\nexport const jsdom = /jsdom|happydom/.test(lowerUserAgent);"],"names":["jsdom","lowerUserAgent"],"mappings":";AAGY,MAACA,IAAQ,iBAAiB,KAAKC,CAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index364.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js"],"sourcesContent":["/**\n * Calculates the next date that should be focused in the calendar.\n *\n * This function determines the next focusable date based on the movement\n * direction, constraints, and calendar configuration.\n *\n * @param moveBy The unit of movement (e.g., \"day\", \"week\").\n * @param moveDir The direction of movement (\"before\" or \"after\").\n * @param refDate The reference date from which to calculate the next focusable\n * date.\n * @param navStart The earliest date the user can navigate to.\n * @param navEnd The latest date the user can navigate to.\n * @param props The DayPicker props, including calendar configuration options.\n * @param dateLib The date library to use for date manipulation.\n * @returns The next focusable date.\n */\nexport function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {\n const { ISOWeek, broadcastCalendar } = props;\n const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;\n const moveFns = {\n day: addDays,\n week: addWeeks,\n month: addMonths,\n year: addYears,\n startOfWeek: (date) => broadcastCalendar\n ? startOfBroadcastWeek(date, dateLib)\n : ISOWeek\n ? startOfISOWeek(date)\n : startOfWeek(date),\n endOfWeek: (date) => broadcastCalendar\n ? endOfBroadcastWeek(date)\n : ISOWeek\n ? endOfISOWeek(date)\n : endOfWeek(date),\n };\n let focusableDate = moveFns[moveBy](refDate, moveDir === \"after\" ? 1 : -1);\n if (moveDir === \"before\" && navStart) {\n focusableDate = max([navStart, focusableDate]);\n }\n else if (moveDir === \"after\" && navEnd) {\n focusableDate = min([navEnd, focusableDate]);\n }\n return focusableDate;\n}\n"],"names":["getFocusableDate","moveBy","moveDir","refDate","navStart","navEnd","props","dateLib","ISOWeek","broadcastCalendar","addDays","addMonths","addWeeks","addYears","endOfBroadcastWeek","endOfISOWeek","endOfWeek","max","min","startOfBroadcastWeek","startOfISOWeek","startOfWeek","focusableDate","date"],"mappings":"AAgBO,SAASA,EAAiBC,GAAQC,GAASC,GAASC,GAAUC,GAAQC,GAAOC,GAAS;AACzF,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAiB,IAAKH,GACjC,EAAE,SAAAI,GAAS,WAAAC,GAAW,UAAAC,GAAU,UAAAC,GAAU,oBAAAC,GAAoB,cAAAC,GAAc,WAAAC,GAAW,KAAAC,GAAK,KAAAC,GAAK,sBAAAC,GAAsB,gBAAAC,GAAgB,aAAAC,EAAW,IAAMd;AAiB9J,MAAIe,IAhBY;AAAA,IACZ,KAAKZ;AAAA,IACL,MAAME;AAAA,IACN,OAAOD;AAAA,IACP,MAAME;AAAA,IACN,aAAa,CAACU,MAASd,IACjBU,EAAqBI,GAAMhB,CAAO,IAClCC,IACIY,EAAeG,CAAI,IACnBF,EAAYE,CAAI;AAAA,IAC1B,WAAW,CAACA,MAASd,IACfK,EAAmBS,CAAI,IACvBf,IACIO,EAAaQ,CAAI,IACjBP,EAAUO,CAAI;AAAA,EAChC,EACgCtB,CAAM,EAAEE,GAASD,MAAY,UAAU,IAAI,EAAE;AACzE,SAAIA,MAAY,YAAYE,IACxBkB,IAAgBL,EAAI,CAACb,GAAUkB,CAAa,CAAC,IAExCpB,MAAY,WAAWG,MAC5BiB,IAAgBJ,EAAI,CAACb,GAAQiB,CAAa,CAAC,IAExCA;AACX;","x_google_ignoreList":[0]}
package/dist/index365.js CHANGED
@@ -1,15 +1,7 @@
1
- function t(r) {
2
- if (r == null)
3
- return "";
4
- if (typeof r == "string")
5
- return r;
6
- try {
7
- return JSON.stringify(r);
8
- } catch {
9
- return String(r);
10
- }
11
- }
1
+ let a = /* @__PURE__ */ (function(d) {
2
+ return d.disabled = "data-disabled", d.valid = "data-valid", d.invalid = "data-invalid", d.touched = "data-touched", d.dirty = "data-dirty", d.filled = "data-filled", d.focused = "data-focused", d;
3
+ })({});
12
4
  export {
13
- t as serializeValue
5
+ a as FieldControlDataAttributes
14
6
  };
15
7
  //# sourceMappingURL=index365.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index365.js","sources":["../../../node_modules/@base-ui/react/internals/serializeValue.mjs"],"sourcesContent":["export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}"],"names":["serializeValue","value"],"mappings":"AAAO,SAASA,EAAeC,GAAO;AACpC,MAAIA,KAAS;AACX,WAAO;AAET,MAAI,OAAOA,KAAU;AACnB,WAAOA;AAET,MAAI;AACF,WAAO,KAAK,UAAUA,CAAK;AAAA,EAC7B,QAAQ;AACN,WAAO,OAAOA,CAAK;AAAA,EACrB;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index365.js","sources":["../../../node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs"],"sourcesContent":["export let FieldControlDataAttributes = /*#__PURE__*/function (FieldControlDataAttributes) {\n /**\n * Present when the field is disabled.\n */\n FieldControlDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the field is in a valid state.\n */\n FieldControlDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the field is in an invalid state.\n */\n FieldControlDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the field has been touched.\n */\n FieldControlDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the field's value has changed.\n */\n FieldControlDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the field is filled.\n */\n FieldControlDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the field control is focused.\n */\n FieldControlDataAttributes[\"focused\"] = \"data-focused\";\n return FieldControlDataAttributes;\n}({});"],"names":["FieldControlDataAttributes"],"mappings":"AAAU,IAACA,IAA0C,0BAAUA,GAA4B;AAIzF,SAAAA,EAA2B,WAAc,iBAIzCA,EAA2B,QAAW,cAItCA,EAA2B,UAAa,gBAIxCA,EAA2B,UAAa,gBAIxCA,EAA2B,QAAW,cAItCA,EAA2B,SAAY,eAIvCA,EAA2B,UAAa,gBACjCA;AACT,GAAE,CAAA,CAAE;","x_google_ignoreList":[0]}
package/dist/index366.js CHANGED
@@ -1,24 +1,9 @@
1
- import * as e from "react";
2
- const t = /* @__PURE__ */ e.createContext({
3
- register: () => {
4
- },
5
- unregister: () => {
6
- },
7
- subscribeMapChange: () => () => {
8
- },
9
- elementsRef: {
10
- current: []
11
- },
12
- nextIndexRef: {
13
- current: 0
14
- }
15
- });
16
- process.env.NODE_ENV !== "production" && (t.displayName = "CompositeListContext");
17
- function n() {
18
- return e.useContext(t);
1
+ import * as o from "react";
2
+ const e = [];
3
+ function n(t) {
4
+ o.useEffect(t, e);
19
5
  }
20
6
  export {
21
- t as CompositeListContext,
22
- n as useCompositeListContext
7
+ n as useOnMount
23
8
  };
24
9
  //# sourceMappingURL=index366.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index366.js","sources":["../../../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => {\n return () => {};\n },\n elementsRef: {\n current: []\n },\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}"],"names":["CompositeListContext","React","useCompositeListContext"],"mappings":";AAGY,MAACA,IAAoC,gBAAAC,EAAM,cAAc;AAAA,EACnE,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,oBAAoB,MACX,MAAM;AAAA,EAAC;AAAA,EAEhB,aAAa;AAAA,IACX,SAAS,CAAA;AAAA,EACb;AAAA,EACE,cAAc;AAAA,IACZ,SAAS;AAAA,EACb;AACA,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcD,EAAqB,cAAc;AACvE,SAASE,IAA0B;AACxC,SAAOD,EAAM,WAAWD,CAAoB;AAC9C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index366.js","sources":["../../../node_modules/@base-ui/utils/useOnMount.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}"],"names":["EMPTY","useOnMount","fn","React"],"mappings":";AAGA,MAAMA,IAAQ,CAAA;AAKP,SAASC,EAAWC,GAAI;AAG7B,EAAAC,EAAM,UAAUD,GAAIF,CAAK;AAE3B;","x_google_ignoreList":[0]}
package/dist/index367.js CHANGED
@@ -1,48 +1,6 @@
1
- import { evaluate as W, getPaddingObject as Y, getAlignmentAxis as k, getAlignment as q, getAxisLength as B, clamp as C } from "./index239.js";
2
- const F = (s) => ({
3
- name: "arrow",
4
- options: s,
5
- async fn(i) {
6
- const {
7
- x: y,
8
- y: j,
9
- placement: x,
10
- rects: n,
11
- platform: f,
12
- elements: l,
13
- middlewareData: M
14
- } = i, {
15
- element: g,
16
- padding: v = 0,
17
- offsetParent: z = "real"
18
- } = W(s, i) || {};
19
- if (g == null)
20
- return {};
21
- const h = Y(v), m = {
22
- x: y,
23
- y: j
24
- }, t = k(x), e = B(t), r = await f.getDimensions(g), d = t === "y", E = d ? "top" : "left", H = d ? "bottom" : "right", A = d ? "clientHeight" : "clientWidth", L = n.reference[e] + n.reference[t] - m[t] - n.floating[e], R = m[t] - n.reference[t], S = z === "real" ? await f.getOffsetParent?.(g) : l.floating;
25
- let a = l.floating[A] || n.floating[e];
26
- (!a || !await f.isElement?.(S)) && (a = l.floating[A] || n.floating[e]);
27
- const T = L / 2 - R / 2, O = a / 2 - r[e] / 2 - 1, u = Math.min(h[E], O), b = Math.min(h[H], O), c = u, D = a - r[e] - b, o = a / 2 - r[e] / 2 + T, P = C(c, o, D), p = !M.arrow && q(x) != null && o !== P && n.reference[e] / 2 - (o < c ? u : b) - r[e] / 2 < 0, w = p ? o < c ? o - c : o - D : 0;
28
- return {
29
- [t]: m[t] + w,
30
- data: {
31
- [t]: P,
32
- centerOffset: o - P - w,
33
- ...p && {
34
- alignmentOffset: w
35
- }
36
- },
37
- reset: p
38
- };
39
- }
40
- }), I = (s, i) => ({
41
- ...F(s),
42
- options: [s, i]
43
- });
1
+ import { lowerUserAgent as o } from "./index429.js";
2
+ const e = /jsdom|happydom/.test(o);
44
3
  export {
45
- I as arrow,
46
- F as baseArrow
4
+ e as jsdom
47
5
  };
48
6
  //# sourceMappingURL=index367.js.map