@rpcbase/ui 0.245.0 → 0.246.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 (448) hide show
  1. package/dist/index149.js +5 -14
  2. package/dist/index149.js.map +1 -1
  3. package/dist/index150.js +63 -63
  4. package/dist/index150.js.map +1 -1
  5. package/dist/index151.js +2 -38
  6. package/dist/index151.js.map +1 -1
  7. package/dist/index152.js +385 -13
  8. package/dist/index152.js.map +1 -1
  9. package/dist/index153.js +261 -23
  10. package/dist/index153.js.map +1 -1
  11. package/dist/index154.js +58 -109
  12. package/dist/index154.js.map +1 -1
  13. package/dist/index155.js +47 -13
  14. package/dist/index155.js.map +1 -1
  15. package/dist/index156.js +169 -4
  16. package/dist/index156.js.map +1 -1
  17. package/dist/index157.js +110 -4
  18. package/dist/index157.js.map +1 -1
  19. package/dist/index158.js +25 -5
  20. package/dist/index158.js.map +1 -1
  21. package/dist/index159.js +8 -12
  22. package/dist/index159.js.map +1 -1
  23. package/dist/index160.js +4 -19
  24. package/dist/index160.js.map +1 -1
  25. package/dist/index161.js +6 -11
  26. package/dist/index161.js.map +1 -1
  27. package/dist/index162.js +4 -176
  28. package/dist/index162.js.map +1 -1
  29. package/dist/index163.js +476 -268
  30. package/dist/index163.js.map +1 -1
  31. package/dist/index164.js +189 -4
  32. package/dist/index164.js.map +1 -1
  33. package/dist/index165.js +14 -28
  34. package/dist/index165.js.map +1 -1
  35. package/dist/index166.js +105 -124
  36. package/dist/index166.js.map +1 -1
  37. package/dist/index167.js +262 -63
  38. package/dist/index167.js.map +1 -1
  39. package/dist/index168.js +6 -8
  40. package/dist/index168.js.map +1 -1
  41. package/dist/index169.js +40 -15
  42. package/dist/index169.js.map +1 -1
  43. package/dist/index170.js +4 -30
  44. package/dist/index170.js.map +1 -1
  45. package/dist/index171.js +14 -69
  46. package/dist/index171.js.map +1 -1
  47. package/dist/index172.js +68 -5
  48. package/dist/index172.js.map +1 -1
  49. package/dist/index173.js +35 -66
  50. package/dist/index173.js.map +1 -1
  51. package/dist/index174.js +14 -2
  52. package/dist/index174.js.map +1 -1
  53. package/dist/index175.js +22 -384
  54. package/dist/index175.js.map +1 -1
  55. package/dist/index176.js +108 -258
  56. package/dist/index176.js.map +1 -1
  57. package/dist/index177.js +13 -61
  58. package/dist/index177.js.map +1 -1
  59. package/dist/index178.js +4 -46
  60. package/dist/index178.js.map +1 -1
  61. package/dist/index179.js +4 -170
  62. package/dist/index179.js.map +1 -1
  63. package/dist/index180.js +5 -110
  64. package/dist/index180.js.map +1 -1
  65. package/dist/index181.js +11 -24
  66. package/dist/index181.js.map +1 -1
  67. package/dist/index182.js +20 -8
  68. package/dist/index182.js.map +1 -1
  69. package/dist/index183.js +11 -5
  70. package/dist/index183.js.map +1 -1
  71. package/dist/index184.js +176 -5
  72. package/dist/index184.js.map +1 -1
  73. package/dist/index185.js +279 -4
  74. package/dist/index185.js.map +1 -1
  75. package/dist/index186.js +4 -487
  76. package/dist/index186.js.map +1 -1
  77. package/dist/index187.js +27 -189
  78. package/dist/index187.js.map +1 -1
  79. package/dist/index188.js +126 -13
  80. package/dist/index188.js.map +1 -1
  81. package/dist/index189.js +63 -107
  82. package/dist/index189.js.map +1 -1
  83. package/dist/index190.js +8 -262
  84. package/dist/index190.js.map +1 -1
  85. package/dist/index191.js +16 -7
  86. package/dist/index191.js.map +1 -1
  87. package/dist/index192.js +29 -39
  88. package/dist/index192.js.map +1 -1
  89. package/dist/index193.js +69 -4
  90. package/dist/index193.js.map +1 -1
  91. package/dist/index254.js +20 -67
  92. package/dist/index254.js.map +1 -1
  93. package/dist/index255.js +66 -8
  94. package/dist/index255.js.map +1 -1
  95. package/dist/index256.js +6 -11
  96. package/dist/index256.js.map +1 -1
  97. package/dist/index257.js +5 -8
  98. package/dist/index257.js.map +1 -1
  99. package/dist/index258.js +11 -5
  100. package/dist/index258.js.map +1 -1
  101. package/dist/index259.js +3 -13
  102. package/dist/index259.js.map +1 -1
  103. package/dist/index260.js +50 -3
  104. package/dist/index260.js.map +1 -1
  105. package/dist/index261.js +4 -4
  106. package/dist/index261.js.map +1 -1
  107. package/dist/index262.js +27 -97
  108. package/dist/index262.js.map +1 -1
  109. package/dist/index263.js +15 -16
  110. package/dist/index263.js.map +1 -1
  111. package/dist/index264.js +5 -29
  112. package/dist/index264.js.map +1 -1
  113. package/dist/index265.js +21 -51
  114. package/dist/index265.js.map +1 -1
  115. package/dist/index266.js +53 -5
  116. package/dist/index266.js.map +1 -1
  117. package/dist/index267.js +20 -5
  118. package/dist/index267.js.map +1 -1
  119. package/dist/index268.js +39 -59
  120. package/dist/index268.js.map +1 -1
  121. package/dist/index269.js +36 -63
  122. package/dist/index269.js.map +1 -1
  123. package/dist/index270.js +46 -134
  124. package/dist/index270.js.map +1 -1
  125. package/dist/index271.js +19 -7
  126. package/dist/index271.js.map +1 -1
  127. package/dist/index272.js +71 -5
  128. package/dist/index272.js.map +1 -1
  129. package/dist/index273.js +18 -4
  130. package/dist/index273.js.map +1 -1
  131. package/dist/index274.js +3 -11
  132. package/dist/index274.js.map +1 -1
  133. package/dist/index275.js +11 -21
  134. package/dist/index275.js.map +1 -1
  135. package/dist/index276.js +13 -16
  136. package/dist/index276.js.map +1 -1
  137. package/dist/index277.js +17 -10
  138. package/dist/index277.js.map +1 -1
  139. package/dist/index278.js +37 -8
  140. package/dist/index278.js.map +1 -1
  141. package/dist/index279.js +237 -142
  142. package/dist/index279.js.map +1 -1
  143. package/dist/index28.js +1 -1
  144. package/dist/index280.js +249 -76
  145. package/dist/index280.js.map +1 -1
  146. package/dist/index281.js +68 -61
  147. package/dist/index281.js.map +1 -1
  148. package/dist/index282.js +100 -15
  149. package/dist/index282.js.map +1 -1
  150. package/dist/index283.js +84 -20
  151. package/dist/index283.js.map +1 -1
  152. package/dist/index284.js +3 -6
  153. package/dist/index284.js.map +1 -1
  154. package/dist/index285.js +29 -11
  155. package/dist/index285.js.map +1 -1
  156. package/dist/index286.js +16 -3
  157. package/dist/index286.js.map +1 -1
  158. package/dist/index287.js +34 -50
  159. package/dist/index287.js.map +1 -1
  160. package/dist/index288.js +16 -15
  161. package/dist/index288.js.map +1 -1
  162. package/dist/index289.js +3 -21
  163. package/dist/index289.js.map +1 -1
  164. package/dist/index29.js +1 -1
  165. package/dist/index290.js +26 -53
  166. package/dist/index290.js.map +1 -1
  167. package/dist/index291.js +28 -20
  168. package/dist/index291.js.map +1 -1
  169. package/dist/index292.js +4 -42
  170. package/dist/index292.js.map +1 -1
  171. package/dist/index293.js +73 -34
  172. package/dist/index293.js.map +1 -1
  173. package/dist/index294.js +273 -46
  174. package/dist/index294.js.map +1 -1
  175. package/dist/index295.js +11 -20
  176. package/dist/index295.js.map +1 -1
  177. package/dist/index296.js +11 -71
  178. package/dist/index296.js.map +1 -1
  179. package/dist/index297.js +25 -17
  180. package/dist/index297.js.map +1 -1
  181. package/dist/index298.js +16 -3
  182. package/dist/index298.js.map +1 -1
  183. package/dist/index299.js +124 -12
  184. package/dist/index299.js.map +1 -1
  185. package/dist/index300.js +5 -18
  186. package/dist/index300.js.map +1 -1
  187. package/dist/index301.js +64 -35
  188. package/dist/index301.js.map +1 -1
  189. package/dist/index302.js +14 -240
  190. package/dist/index302.js.map +1 -1
  191. package/dist/index303.js +7 -252
  192. package/dist/index303.js.map +1 -1
  193. package/dist/index304.js +5 -68
  194. package/dist/index304.js.map +1 -1
  195. package/dist/index305.js +3 -83
  196. package/dist/index305.js.map +1 -1
  197. package/dist/index306.js +10 -3
  198. package/dist/index306.js.map +1 -1
  199. package/dist/index307.js +7 -29
  200. package/dist/index307.js.map +1 -1
  201. package/dist/index308.js +133 -16
  202. package/dist/index308.js.map +1 -1
  203. package/dist/index309.js +397 -32
  204. package/dist/index309.js.map +1 -1
  205. package/dist/index310.js +5 -18
  206. package/dist/index310.js.map +1 -1
  207. package/dist/index311.js +52 -3
  208. package/dist/index311.js.map +1 -1
  209. package/dist/index312.js +11 -26
  210. package/dist/index312.js.map +1 -1
  211. package/dist/index313.js +25 -26
  212. package/dist/index313.js.map +1 -1
  213. package/dist/index314.js +12 -4
  214. package/dist/index314.js.map +1 -1
  215. package/dist/index315.js +151 -75
  216. package/dist/index315.js.map +1 -1
  217. package/dist/index316.js +30 -270
  218. package/dist/index316.js.map +1 -1
  219. package/dist/index317.js +11 -11
  220. package/dist/index317.js.map +1 -1
  221. package/dist/index318.js +50 -11
  222. package/dist/index318.js.map +1 -1
  223. package/dist/index319.js +8 -24
  224. package/dist/index319.js.map +1 -1
  225. package/dist/index320.js +11 -16
  226. package/dist/index320.js.map +1 -1
  227. package/dist/index321.js +42 -124
  228. package/dist/index321.js.map +1 -1
  229. package/dist/index322.js +97 -5
  230. package/dist/index322.js.map +1 -1
  231. package/dist/index323.js +82 -61
  232. package/dist/index323.js.map +1 -1
  233. package/dist/index324.js +104 -12
  234. package/dist/index324.js.map +1 -1
  235. package/dist/index325.js +52 -7
  236. package/dist/index325.js.map +1 -1
  237. package/dist/index326.js +11 -5
  238. package/dist/index326.js.map +1 -1
  239. package/dist/index327.js +4 -3
  240. package/dist/index327.js.map +1 -1
  241. package/dist/index328.js +37 -10
  242. package/dist/index328.js.map +1 -1
  243. package/dist/index329.js +8 -7
  244. package/dist/index329.js.map +1 -1
  245. package/dist/index33.js +2 -2
  246. package/dist/index330.js +121 -385
  247. package/dist/index330.js.map +1 -1
  248. package/dist/index331.js +18 -5
  249. package/dist/index331.js.map +1 -1
  250. package/dist/index332.js +14 -51
  251. package/dist/index332.js.map +1 -1
  252. package/dist/index333.js +3 -11
  253. package/dist/index333.js.map +1 -1
  254. package/dist/index334.js +34 -25
  255. package/dist/index334.js.map +1 -1
  256. package/dist/index335.js +20 -11
  257. package/dist/index335.js.map +1 -1
  258. package/dist/index336.js +9 -154
  259. package/dist/index336.js.map +1 -1
  260. package/dist/index337.js +8 -32
  261. package/dist/index337.js.map +1 -1
  262. package/dist/index338.js +24 -11
  263. package/dist/index338.js.map +1 -1
  264. package/dist/index339.js +25 -46
  265. package/dist/index339.js.map +1 -1
  266. package/dist/index34.js +5 -5
  267. package/dist/index340.js +16 -9
  268. package/dist/index340.js.map +1 -1
  269. package/dist/index341.js +8 -11
  270. package/dist/index341.js.map +1 -1
  271. package/dist/index342.js +11 -43
  272. package/dist/index342.js.map +1 -1
  273. package/dist/index343.js +7 -96
  274. package/dist/index343.js.map +1 -1
  275. package/dist/index344.js +11 -84
  276. package/dist/index344.js.map +1 -1
  277. package/dist/index345.js +3 -105
  278. package/dist/index345.js.map +1 -1
  279. package/dist/index346.js +3 -52
  280. package/dist/index346.js.map +1 -1
  281. package/dist/index347.js +16 -10
  282. package/dist/index347.js.map +1 -1
  283. package/dist/index348.js +51 -4
  284. package/dist/index348.js.map +1 -1
  285. package/dist/index349.js +5 -37
  286. package/dist/index349.js.map +1 -1
  287. package/dist/index35.js +11 -11
  288. package/dist/index350.js +61 -8
  289. package/dist/index350.js.map +1 -1
  290. package/dist/index351.js +61 -130
  291. package/dist/index351.js.map +1 -1
  292. package/dist/index352.js +8 -17
  293. package/dist/index352.js.map +1 -1
  294. package/dist/index353.js +5 -16
  295. package/dist/index353.js.map +1 -1
  296. package/dist/index354.js +11 -3
  297. package/dist/index354.js.map +1 -1
  298. package/dist/index355.js +19 -34
  299. package/dist/index355.js.map +1 -1
  300. package/dist/index356.js +16 -20
  301. package/dist/index356.js.map +1 -1
  302. package/dist/index357.js +8 -10
  303. package/dist/index357.js.map +1 -1
  304. package/dist/index358.js +144 -8
  305. package/dist/index358.js.map +1 -1
  306. package/dist/index359.js +77 -22
  307. package/dist/index359.js.map +1 -1
  308. package/dist/index36.js +3 -3
  309. package/dist/index360.js +61 -28
  310. package/dist/index360.js.map +1 -1
  311. package/dist/index361.js +15 -17
  312. package/dist/index361.js.map +1 -1
  313. package/dist/index365.js +11 -8
  314. package/dist/index365.js.map +1 -1
  315. package/dist/index366.js +4 -27
  316. package/dist/index366.js.map +1 -1
  317. package/dist/index367.js +5 -137
  318. package/dist/index367.js.map +1 -1
  319. package/dist/index368.js +3 -13
  320. package/dist/index368.js.map +1 -1
  321. package/dist/index369.js +20 -46
  322. package/dist/index369.js.map +1 -1
  323. package/dist/index37.js +4 -4
  324. package/dist/index370.js +45 -4
  325. package/dist/index370.js.map +1 -1
  326. package/dist/index371.js +17 -21
  327. package/dist/index371.js.map +1 -1
  328. package/dist/index372.js +4 -75
  329. package/dist/index372.js.map +1 -1
  330. package/dist/index373.js +200 -11
  331. package/dist/index373.js.map +1 -1
  332. package/dist/index374.js +73 -3
  333. package/dist/index374.js.map +1 -1
  334. package/dist/index375.js +122 -72
  335. package/dist/index375.js.map +1 -1
  336. package/dist/index376.js +4 -200
  337. package/dist/index376.js.map +1 -1
  338. package/dist/index377.js +20 -71
  339. package/dist/index377.js.map +1 -1
  340. package/dist/index378.js +8 -35
  341. package/dist/index378.js.map +1 -1
  342. package/dist/index379.js +27 -7
  343. package/dist/index379.js.map +1 -1
  344. package/dist/index38.js +5 -5
  345. package/dist/index380.js +136 -14
  346. package/dist/index380.js.map +1 -1
  347. package/dist/index381.js +10 -121
  348. package/dist/index381.js.map +1 -1
  349. package/dist/index382.js +47 -4
  350. package/dist/index382.js.map +1 -1
  351. package/dist/index383.js +3 -11
  352. package/dist/index383.js.map +1 -1
  353. package/dist/index384.js +21 -5
  354. package/dist/index384.js.map +1 -1
  355. package/dist/index385.js +76 -3
  356. package/dist/index385.js.map +1 -1
  357. package/dist/index386.js +12 -21
  358. package/dist/index386.js.map +1 -1
  359. package/dist/index387.js +4 -45
  360. package/dist/index387.js.map +1 -1
  361. package/dist/index388.js +70 -16
  362. package/dist/index388.js.map +1 -1
  363. package/dist/index389.js +36 -5
  364. package/dist/index389.js.map +1 -1
  365. package/dist/index39.js +3 -3
  366. package/dist/index390.js +7 -5
  367. package/dist/index390.js.map +1 -1
  368. package/dist/index391.js +15 -20
  369. package/dist/index391.js.map +1 -1
  370. package/dist/index40.js +10 -10
  371. package/dist/index409.js +3 -3
  372. package/dist/index409.js.map +1 -1
  373. package/dist/index410.js +3 -15
  374. package/dist/index410.js.map +1 -1
  375. package/dist/index411.js +3 -492
  376. package/dist/index411.js.map +1 -1
  377. package/dist/index412.js +15 -3
  378. package/dist/index412.js.map +1 -1
  379. package/dist/index413.js +492 -3
  380. package/dist/index413.js.map +1 -1
  381. package/dist/index417.js +1 -1
  382. package/dist/index419.js +1 -1
  383. package/dist/index420.js +2 -2
  384. package/dist/index421.js +7 -32
  385. package/dist/index421.js.map +1 -1
  386. package/dist/index422.js +2 -8
  387. package/dist/index422.js.map +1 -1
  388. package/dist/index423.js +44 -2
  389. package/dist/index423.js.map +1 -1
  390. package/dist/index424.js +52 -40
  391. package/dist/index424.js.map +1 -1
  392. package/dist/index425.js +7 -55
  393. package/dist/index425.js.map +1 -1
  394. package/dist/index426.js +2 -8
  395. package/dist/index426.js.map +1 -1
  396. package/dist/index427.js +55 -2
  397. package/dist/index427.js.map +1 -1
  398. package/dist/index428.js +53 -52
  399. package/dist/index428.js.map +1 -1
  400. package/dist/index429.js +32 -55
  401. package/dist/index429.js.map +1 -1
  402. package/dist/index430.js +2 -16
  403. package/dist/index430.js.map +1 -1
  404. package/dist/index431.js +2 -29
  405. package/dist/index431.js.map +1 -1
  406. package/dist/index432.js +2 -13
  407. package/dist/index432.js.map +1 -1
  408. package/dist/index433.js +2 -7
  409. package/dist/index433.js.map +1 -1
  410. package/dist/index434.js +16 -2
  411. package/dist/index434.js.map +1 -1
  412. package/dist/index435.js +29 -2
  413. package/dist/index435.js.map +1 -1
  414. package/dist/index436.js +13 -2
  415. package/dist/index436.js.map +1 -1
  416. package/dist/index437.js +7 -2
  417. package/dist/index437.js.map +1 -1
  418. package/dist/index47.js +2 -2
  419. package/dist/index48.js +36 -36
  420. package/dist/index49.js +29 -29
  421. package/dist/index50.js +2 -2
  422. package/dist/index51.js +12 -12
  423. package/dist/index52.js +4 -4
  424. package/dist/index53.js +1 -1
  425. package/dist/index54.js +21 -21
  426. package/dist/index55.js +5 -5
  427. package/dist/index56.js +5 -5
  428. package/dist/index57.js +8 -8
  429. package/dist/index58.js +5 -5
  430. package/dist/index59.js +17 -17
  431. package/dist/index60.js +5 -5
  432. package/dist/index61.js +3 -3
  433. package/dist/index64.js +5 -5
  434. package/dist/index64.js.map +1 -1
  435. package/dist/index66.js +10 -22
  436. package/dist/index66.js.map +1 -1
  437. package/dist/index67.js +17 -232
  438. package/dist/index67.js.map +1 -1
  439. package/dist/index68.js +5 -5
  440. package/dist/index68.js.map +1 -1
  441. package/dist/index70.js +22 -10
  442. package/dist/index70.js.map +1 -1
  443. package/dist/index71.js +232 -17
  444. package/dist/index71.js.map +1 -1
  445. package/dist/index76.js +1 -1
  446. package/dist/index77.js +2 -2
  447. package/dist/index78.js +2 -2
  448. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index260.js","sources":["../../../node_modules/@base-ui/react/utils/resolveClassName.mjs"],"sourcesContent":["/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}"],"names":["resolveClassName","className","state"],"mappings":"AAOO,SAASA,EAAiBC,GAAWC,GAAO;AACjD,SAAO,OAAOD,KAAc,aAAaA,EAAUC,CAAK,IAAID;AAC9D;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index260.js","sources":["../../../node_modules/@base-ui/utils/useControlled.mjs"],"sourcesContent":["'use client';\n\n// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- process.env never changes, dependency arrays are intentionally ignored\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nimport { error } from \"./error.mjs\";\nexport function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n error([`A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {\n error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [defaultProp]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}\nfunction serializeToDevModeString(input) {\n let nextId = 0;\n const seen = new WeakMap();\n try {\n const result = JSON.stringify(input, function replacer(key, value) {\n if (key === '_owner' && this != null && typeof this === 'object' && '$$typeof' in this) {\n return undefined;\n }\n if (typeof value === 'bigint') {\n return `__bigint__:${value}`;\n }\n if (value !== null && typeof value === 'object') {\n const id = seen.get(value);\n if (id !== undefined) {\n return `__object__:${id}`;\n }\n seen.set(value, nextId);\n nextId += 1;\n }\n return value;\n });\n return result ?? `__top__:${typeof input}`;\n } catch {\n return '__unserializable__';\n }\n}"],"names":["useControlled","controlled","defaultProp","name","state","isControlled","React","valueState","setValue","value","error","defaultValue","serializeToDevModeString","setValueIfUncontrolled","newValue","input","nextId","seen","key","id"],"mappings":";;AAMO,SAASA,EAAc;AAAA,EAC5B,YAAAC;AAAA,EACA,SAASC;AAAA,EACT,MAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,GAAG;AAED,QAAM;AAAA,IACJ,SAASC;AAAA,EACb,IAAMC,EAAM,OAAOL,MAAe,MAAS,GACnC,CAACM,GAAYC,CAAQ,IAAIF,EAAM,SAASJ,CAAW,GACnDO,IAAQJ,IAAeJ,IAAaM;AAC1C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,IAAAD,EAAM,UAAU,MAAM;AACpB,MAAID,OAAkBJ,MAAe,WACnCS,EAAM,CAAC,+BAA+BL,IAAe,KAAK,IAAI,cAAcD,CAAK,aAAaD,CAAI,UAAUE,IAAe,OAAO,EAAE,eAAe,+EAA+E,qDAAqDF,CAAI,+CAAoD,8HAA8H,sDAAsD,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,IAEnhB,GAAG,CAACC,GAAOD,GAAMF,CAAU,CAAC;AAC5B,UAAM;AAAA,MACJ,SAASU;AAAA,IACf,IAAQL,EAAM,OAAOJ,CAAW;AAC5B,IAAAI,EAAM,UAAU,MAAM;AACpB,MAAI,CAACD,KAAgBO,EAAyBD,CAAY,MAAMC,EAAyBV,CAAW,KAClGQ,EAAM,CAAC,uCAAuCN,CAAK,6BAA6BD,CAAI,8EAAmFA,CAAI,GAAG,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,IAE9L,GAAG,CAACD,CAAW,CAAC;AAAA,EAClB;AACA,QAAMW,IAAyBP,EAAM,YAAY,CAAAQ,MAAY;AAC3D,IAAKT,KACHG,EAASM,CAAQ;AAAA,EAErB,GAAG,CAAA,CAAE;AACL,SAAO,CAACL,GAAOI,CAAsB;AACvC;AACA,SAASD,EAAyBG,GAAO;AACvC,MAAIC,IAAS;AACb,QAAMC,IAAO,oBAAI,QAAO;AACxB,MAAI;AAkBF,WAjBe,KAAK,UAAUF,GAAO,SAAkBG,GAAKT,GAAO;AACjE,UAAI,EAAAS,MAAQ,YAAY,QAAQ,QAAQ,OAAO,QAAS,YAAY,cAAc,OAGlF;AAAA,YAAI,OAAOT,KAAU;AACnB,iBAAO,cAAcA,CAAK;AAE5B,YAAIA,MAAU,QAAQ,OAAOA,KAAU,UAAU;AAC/C,gBAAMU,IAAKF,EAAK,IAAIR,CAAK;AACzB,cAAIU,MAAO;AACT,mBAAO,cAAcA,CAAE;AAEzB,UAAAF,EAAK,IAAIR,GAAOO,CAAM,GACtBA,KAAU;AAAA,QACZ;AACA,eAAOP;AAAA;AAAA,IACT,CAAC,KACgB,WAAW,OAAOM,CAAK;AAAA,EAC1C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","x_google_ignoreList":[0]}
package/dist/index261.js CHANGED
@@ -1,7 +1,7 @@
1
- function e(n, o) {
2
- return typeof n == "function" ? n(o) : n;
3
- }
1
+ import * as o from "react";
2
+ const t = () => {
3
+ }, e = typeof document < "u" ? o.useLayoutEffect : t;
4
4
  export {
5
- e as resolveStyle
5
+ e as useIsoLayoutEffect
6
6
  };
7
7
  //# sourceMappingURL=index261.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index261.js","sources":["../../../node_modules/@base-ui/react/utils/resolveStyle.mjs"],"sourcesContent":["/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}"],"names":["resolveStyle","style","state"],"mappings":"AAOO,SAASA,EAAaC,GAAOC,GAAO;AACzC,SAAO,OAAOD,KAAU,aAAaA,EAAMC,CAAK,IAAID;AACtD;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index261.js","sources":["../../../node_modules/@base-ui/utils/useIsoLayoutEffect.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nconst noop = () => {};\nexport const useIsoLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : noop;"],"names":["noop","useIsoLayoutEffect","React"],"mappings":";AAGA,MAAMA,IAAO,MAAM;AAAC,GACPC,IAAqB,OAAO,WAAa,MAAcC,EAAM,kBAAkBF;","x_google_ignoreList":[0]}
package/dist/index262.js CHANGED
@@ -1,103 +1,33 @@
1
- import { mergeObjects as y } from "./index256.js";
2
- const o = {};
3
- function j(t, n, e, r, c) {
4
- if (!e && !r && !c && !t)
5
- return u(n);
6
- let f = u(t);
7
- return n && (f = i(f, n)), e && (f = i(f, e)), r && (f = i(f, r)), c && (f = i(f, c)), f;
8
- }
9
- function w(t) {
10
- if (t.length === 0)
11
- return o;
12
- if (t.length === 1)
13
- return u(t[0]);
14
- let n = u(t[0]);
15
- for (let e = 1; e < t.length; e += 1)
16
- n = i(n, t[e]);
17
- return n;
18
- }
19
- function u(t) {
20
- return l(t) ? {
21
- ...s(t, o)
22
- } : m(t);
23
- }
24
- function i(t, n) {
25
- return l(n) ? s(n, t) : U(t, n);
26
- }
27
- function m(t) {
28
- const n = {
29
- ...t
30
- };
31
- for (const e in n) {
32
- const r = n[e];
33
- a(e, r) && (n[e] = v(r));
34
- }
35
- return n;
36
- }
37
- function U(t, n) {
38
- if (!n)
39
- return t;
40
- for (const e in n) {
41
- const r = n[e];
42
- switch (e) {
43
- case "style": {
44
- t[e] = y(t.style, r);
45
- break;
46
- }
47
- case "className": {
48
- t[e] = M(t.className, r);
49
- break;
50
- }
51
- default:
52
- a(e, r) ? t[e] = A(t[e], r) : t[e] = r;
1
+ import { SafeReact as a } from "./index353.js";
2
+ import { useRefWithInit as c } from "./index256.js";
3
+ const n = a.useInsertionEffect, r = (
4
+ // React 17 doesn't have useInsertionEffect.
5
+ n && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
6
+ n !== a.useLayoutEffect ? n : (e) => e()
7
+ );
8
+ function i(e) {
9
+ const t = c(o).current;
10
+ return t.next = e, r(t.effect), t.trampoline;
11
+ }
12
+ function o() {
13
+ const e = {
14
+ next: void 0,
15
+ callback: f,
16
+ trampoline: (...t) => e.callback?.(...t),
17
+ effect: () => {
18
+ e.callback = e.next;
53
19
  }
54
- }
55
- return t;
56
- }
57
- function a(t, n) {
58
- const e = t.charCodeAt(0), r = t.charCodeAt(1), c = t.charCodeAt(2);
59
- return e === 111 && r === 110 && c >= 65 && c <= 90 && (typeof n == "function" || typeof n > "u");
60
- }
61
- function l(t) {
62
- return typeof t == "function";
63
- }
64
- function s(t, n) {
65
- return l(t) ? t(n) : t ?? o;
66
- }
67
- function A(t, n) {
68
- return n ? t ? (...e) => {
69
- const r = e[0];
70
- if (I(r)) {
71
- const f = r;
72
- E(f);
73
- const b = n(...e);
74
- return f.baseUIHandlerPrevented || t?.(...e), b;
75
- }
76
- const c = n(...e);
77
- return t?.(...e), c;
78
- } : v(n) : t;
79
- }
80
- function v(t) {
81
- return t && ((...n) => {
82
- const e = n[0];
83
- return I(e) && E(e), t(...n);
84
- });
85
- }
86
- function E(t) {
87
- return t.preventBaseUIHandler = () => {
88
- t.baseUIHandlerPrevented = !0;
89
- }, t;
90
- }
91
- function M(t, n) {
92
- return n ? t ? n + " " + t : n : t;
20
+ };
21
+ return e;
93
22
  }
94
- function I(t) {
95
- return t != null && typeof t == "object" && "nativeEvent" in t;
23
+ function f() {
24
+ if (process.env.NODE_ENV !== "production")
25
+ throw (
26
+ /* minify-error-disabled */
27
+ new Error("Base UI: Cannot call an event handler while rendering.")
28
+ );
96
29
  }
97
30
  export {
98
- E as makeEventPreventable,
99
- M as mergeClassNames,
100
- j as mergeProps,
101
- w as mergePropsN
31
+ i as useStableCallback
102
32
  };
103
33
  //# sourceMappingURL=index262.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index262.js","sources":["../../../node_modules/@base-ui/react/merge-props/mergeProps.mjs"],"sourcesContent":["import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...resolvePropsGetter(inputProps, EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return resolvePropsGetter(inputProps, merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}"],"names":["EMPTY_PROPS","mergeProps","a","b","c","d","e","createInitialMergedProps","merged","mergeInto","mergePropsN","props","i","inputProps","isPropsGetter","resolvePropsGetter","copyInitialProps","mutablyMergeInto","copiedProps","propName","propValue","isEventHandler","wrapEventHandler","mergedProps","externalProps","externalPropValue","mergeObjects","mergeClassNames","mergeEventHandlers","key","value","code0","code1","code2","previousProps","ourHandler","theirHandler","args","event","isSyntheticEvent","baseUIEvent","makeEventPreventable","result","handler","ourClassName","theirClassName"],"mappings":";AACA,MAAMA,IAAc,CAAA;AAiCb,SAASC,EAAWC,GAAGC,GAAGC,GAAGC,GAAGC,GAAG;AACxC,MAAI,CAACF,KAAK,CAACC,KAAK,CAACC,KAAK,CAACJ;AACrB,WAAOK,EAAyBJ,CAAC;AAInC,MAAIK,IAASD,EAAyBL,CAAC;AACvC,SAAIC,MACFK,IAASC,EAAUD,GAAQL,CAAC,IAE1BC,MACFI,IAASC,EAAUD,GAAQJ,CAAC,IAE1BC,MACFG,IAASC,EAAUD,GAAQH,CAAC,IAE1BC,MACFE,IAASC,EAAUD,GAAQF,CAAC,IAEvBE;AACT;AAgBO,SAASE,EAAYC,GAAO;AACjC,MAAIA,EAAM,WAAW;AACnB,WAAOX;AAET,MAAIW,EAAM,WAAW;AACnB,WAAOJ,EAAyBI,EAAM,CAAC,CAAC;AAI1C,MAAIH,IAASD,EAAyBI,EAAM,CAAC,CAAC;AAC9C,WAASC,IAAI,GAAGA,IAAID,EAAM,QAAQC,KAAK;AACrC,IAAAJ,IAASC,EAAUD,GAAQG,EAAMC,CAAC,CAAC;AAErC,SAAOJ;AACT;AACA,SAASD,EAAyBM,GAAY;AAC5C,SAAIC,EAAcD,CAAU,IAEnB;AAAA,IACL,GAAGE,EAAmBF,GAAYb,CAAW;AAAA,EACnD,IAESgB,EAAiBH,CAAU;AACpC;AACA,SAASJ,EAAUD,GAAQK,GAAY;AACrC,SAAIC,EAAcD,CAAU,IACnBE,EAAmBF,GAAYL,CAAM,IAEvCS,EAAiBT,GAAQK,CAAU;AAC5C;AACA,SAASG,EAAiBH,GAAY;AACpC,QAAMK,IAAc;AAAA,IAClB,GAAGL;AAAA,EACP;AAIE,aAAWM,KAAYD,GAAa;AAClC,UAAME,IAAYF,EAAYC,CAAQ;AACtC,IAAIE,EAAeF,GAAUC,CAAS,MACpCF,EAAYC,CAAQ,IAAIG,EAAiBF,CAAS;AAAA,EAEtD;AACA,SAAOF;AACT;AAKA,SAASD,EAAiBM,GAAaC,GAAe;AACpD,MAAI,CAACA;AACH,WAAOD;AAIT,aAAWJ,KAAYK,GAAe;AACpC,UAAMC,IAAoBD,EAAcL,CAAQ;AAChD,YAAQA,GAAQ;AAAA,MACd,KAAK,SACH;AACE,QAAAI,EAAYJ,CAAQ,IAAIO,EAAaH,EAAY,OAAOE,CAAiB;AACzE;AAAA,MACF;AAAA,MACF,KAAK,aACH;AACE,QAAAF,EAAYJ,CAAQ,IAAIQ,EAAgBJ,EAAY,WAAWE,CAAiB;AAChF;AAAA,MACF;AAAA,MACF;AAEI,QAAIJ,EAAeF,GAAUM,CAAiB,IAC5CF,EAAYJ,CAAQ,IAAIS,EAAmBL,EAAYJ,CAAQ,GAAGM,CAAiB,IAEnFF,EAAYJ,CAAQ,IAAIM;AAAA,IAGpC;AAAA,EACE;AACA,SAAOF;AACT;AACA,SAASF,EAAeQ,GAAKC,GAAO;AAElC,QAAMC,IAAQF,EAAI,WAAW,CAAC,GACxBG,IAAQH,EAAI,WAAW,CAAC,GACxBI,IAAQJ,EAAI,WAAW,CAAC;AAC9B,SAAOE,MAAU,OAAeC,MAAU,OAAeC,KAAS,MAAcA,KAAS,OAAe,OAAOH,KAAU,cAAc,OAAOA,IAAU;AAC1J;AACA,SAAShB,EAAcD,GAAY;AACjC,SAAO,OAAOA,KAAe;AAC/B;AACA,SAASE,EAAmBF,GAAYqB,GAAe;AACrD,SAAIpB,EAAcD,CAAU,IACnBA,EAAWqB,CAAa,IAE1BrB,KAAcb;AACvB;AACA,SAAS4B,EAAmBO,GAAYC,GAAc;AACpD,SAAKA,IAGAD,IAGE,IAAIE,MAAS;AAClB,UAAMC,IAAQD,EAAK,CAAC;AACpB,QAAIE,EAAiBD,CAAK,GAAG;AAC3B,YAAME,IAAcF;AACpB,MAAAG,EAAqBD,CAAW;AAChC,YAAME,IAASN,EAAa,GAAGC,CAAI;AACnC,aAAKG,EAAY,0BACfL,IAAa,GAAGE,CAAI,GAEfK;AAAA,IACT;AACA,UAAMA,IAASN,EAAa,GAAGC,CAAI;AACnC,WAAAF,IAAa,GAAGE,CAAI,GACbK;AAAA,EACT,IAhBSpB,EAAiBc,CAAY,IAH7BD;AAoBX;AACA,SAASb,EAAiBqB,GAAS;AACjC,SAAKA,MAGE,IAAIN,MAAS;AAClB,UAAMC,IAAQD,EAAK,CAAC;AACpB,WAAIE,EAAiBD,CAAK,KACxBG,EAAqBH,CAAK,GAErBK,EAAQ,GAAGN,CAAI;AAAA,EACxB;AACF;AACO,SAASI,EAAqBH,GAAO;AAC1C,SAAAA,EAAM,uBAAuB,MAAM;AACjC,IAAAA,EAAM,yBAAyB;AAAA,EACjC,GACOA;AACT;AACO,SAASX,EAAgBiB,GAAcC,GAAgB;AAC5D,SAAIA,IACED,IAEKC,IAAiB,MAAMD,IAEzBC,IAEFD;AACT;AACA,SAASL,EAAiBD,GAAO;AAC/B,SAAOA,KAAS,QAAQ,OAAOA,KAAU,YAAY,iBAAiBA;AACxE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index262.js","sources":["../../../node_modules/@base-ui/utils/useStableCallback.mjs"],"sourcesContent":["'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}"],"names":["useInsertionEffect","SafeReact","useSafeInsertionEffect","fn","useStableCallback","callback","stable","useRefWithInit","createStableCallback","assertNotCalled","args"],"mappings":";;AAIA,MAAMA,IAAqBC,EAAU,oBAC/BC;AAAA;AAAA,EAENF;AAAA,EAEAA,MAAuBC,EAAU,kBAAkBD,IAAqB,CAAAG,MAAMA,EAAE;AAAA;AAWzE,SAASC,EAAkBC,GAAU;AAC1C,QAAMC,IAASC,EAAeC,CAAoB,EAAE;AACpD,SAAAF,EAAO,OAAOD,GACdH,EAAuBI,EAAO,MAAM,GAC7BA,EAAO;AAChB;AACA,SAASE,IAAuB;AAC9B,QAAMF,IAAS;AAAA,IACb,MAAM;AAAA,IACN,UAAUG;AAAA,IACV,YAAY,IAAIC,MAASJ,EAAO,WAAW,GAAGI,CAAI;AAAA,IAClD,QAAQ,MAAM;AACZ,MAAAJ,EAAO,WAAWA,EAAO;AAAA,IAC3B;AAAA,EACJ;AACE,SAAOA;AACT;AACA,SAASG,IAAkB;AACzB,MAAI,QAAQ,IAAI,aAAa;AAG3B;AAAA;AAAA,MAAiC,IAAI,MAAM,wDAAwD;AAAA;AAEvG;","x_google_ignoreList":[0]}
package/dist/index263.js CHANGED
@@ -1,21 +1,20 @@
1
- import * as n from "react";
2
- import { SafeReact as f } from "./index272.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;
1
+ import { useIsoLayoutEffect as r } from "./index261.js";
2
+ import { useRefWithInit as n } from "./index256.js";
3
+ function s(e) {
4
+ const t = n(f, e).current;
5
+ return t.next = e, r(t.effect), t;
9
6
  }
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);
15
- }
16
- return l(u, t);
7
+ function f(e) {
8
+ const t = {
9
+ current: e,
10
+ next: e,
11
+ effect: () => {
12
+ t.current = t.next;
13
+ }
14
+ };
15
+ return t;
17
16
  }
18
17
  export {
19
- I as useId
18
+ s as useValueAsRef
20
19
  };
21
20
  //# sourceMappingURL=index263.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index263.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":"index263.js","sources":["../../../node_modules/@base-ui/utils/useValueAsRef.mjs"],"sourcesContent":["'use client';\n\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Untracks the provided value by turning it into a ref to remove its reactivity.\n *\n * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.\n */\nexport function useValueAsRef(value) {\n const latest = useRefWithInit(createLatestRef, value).current;\n latest.next = value;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(latest.effect);\n return latest;\n}\nfunction createLatestRef(value) {\n const latest = {\n current: value,\n next: value,\n effect: () => {\n latest.current = latest.next;\n }\n };\n return latest;\n}"],"names":["useValueAsRef","value","latest","useRefWithInit","createLatestRef","useIsoLayoutEffect"],"mappings":";;AAUO,SAASA,EAAcC,GAAO;AACnC,QAAMC,IAASC,EAAeC,GAAiBH,CAAK,EAAE;AACtD,SAAAC,EAAO,OAAOD,GAGdI,EAAmBH,EAAO,MAAM,GACzBA;AACT;AACA,SAASE,EAAgBH,GAAO;AAC9B,QAAMC,IAAS;AAAA,IACb,SAASD;AAAA,IACT,MAAMA;AAAA,IACN,QAAQ,MAAM;AACZ,MAAAC,EAAO,UAAUA,EAAO;AAAA,IAC1B;AAAA,EACJ;AACE,SAAOA;AACT;","x_google_ignoreList":[0]}
package/dist/index264.js CHANGED
@@ -1,33 +1,9 @@
1
- import { SafeReact as a } from "./index272.js";
2
- import { useRefWithInit as c } from "./index284.js";
3
- const n = a.useInsertionEffect, r = (
4
- // React 17 doesn't have useInsertionEffect.
5
- n && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
6
- n !== a.useLayoutEffect ? n : (e) => e()
7
- );
8
- function i(e) {
9
- const t = c(o).current;
10
- return t.next = e, r(t.effect), t.trampoline;
11
- }
12
- function o() {
13
- const e = {
14
- next: void 0,
15
- callback: f,
16
- trampoline: (...t) => e.callback?.(...t),
17
- effect: () => {
18
- e.callback = e.next;
19
- }
20
- };
21
- return e;
22
- }
23
- function f() {
24
- if (process.env.NODE_ENV !== "production")
25
- throw (
26
- /* minify-error-disabled */
27
- new Error("Base UI: Cannot call an event handler while rendering.")
28
- );
1
+ function e() {
29
2
  }
3
+ const t = Object.freeze([]), c = Object.freeze({});
30
4
  export {
31
- i as useStableCallback
5
+ t as EMPTY_ARRAY,
6
+ c as EMPTY_OBJECT,
7
+ e as NOOP
32
8
  };
33
9
  //# sourceMappingURL=index264.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index264.js","sources":["../../../node_modules/@base-ui/utils/useStableCallback.mjs"],"sourcesContent":["'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}"],"names":["useInsertionEffect","SafeReact","useSafeInsertionEffect","fn","useStableCallback","callback","stable","useRefWithInit","createStableCallback","assertNotCalled","args"],"mappings":";;AAIA,MAAMA,IAAqBC,EAAU,oBAC/BC;AAAA;AAAA,EAENF;AAAA,EAEAA,MAAuBC,EAAU,kBAAkBD,IAAqB,CAAAG,MAAMA,EAAE;AAAA;AAWzE,SAASC,EAAkBC,GAAU;AAC1C,QAAMC,IAASC,EAAeC,CAAoB,EAAE;AACpD,SAAAF,EAAO,OAAOD,GACdH,EAAuBI,EAAO,MAAM,GAC7BA,EAAO;AAChB;AACA,SAASE,IAAuB;AAC9B,QAAMF,IAAS;AAAA,IACb,MAAM;AAAA,IACN,UAAUG;AAAA,IACV,YAAY,IAAIC,MAASJ,EAAO,WAAW,GAAGI,CAAI;AAAA,IAClD,QAAQ,MAAM;AACZ,MAAAJ,EAAO,WAAWA,EAAO;AAAA,IAC3B;AAAA,EACJ;AACE,SAAOA;AACT;AACA,SAASG,IAAkB;AACzB,MAAI,QAAQ,IAAI,aAAa;AAG3B;AAAA;AAAA,MAAiC,IAAI,MAAM,wDAAwD;AAAA;AAEvG;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index264.js","sources":["../../../node_modules/@base-ui/utils/empty.mjs"],"sourcesContent":["export function NOOP() {}\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});"],"names":["NOOP","EMPTY_ARRAY","EMPTY_OBJECT"],"mappings":"AAAO,SAASA,IAAO;AAAC;AACZ,MAACC,IAAc,OAAO,OAAO,CAAA,CAAE,GAC9BC,IAAe,OAAO,OAAO,CAAA,CAAE;","x_google_ignoreList":[0]}
package/dist/index265.js CHANGED
@@ -1,55 +1,25 @@
1
- import * as l from "react-dom";
2
- import { useAnimationFrame as b } from "./index323.js";
3
- import { useStableCallback as A } from "./index264.js";
4
- import { resolveRef as d } from "./index374.js";
5
- import { TransitionStatusDataAttributes as h } from "./index152.js";
6
- function y(c, f = !1, m = !0) {
7
- const o = b();
8
- return A((s, n = null) => {
9
- o.cancel();
10
- const a = d(c);
11
- if (a == null)
12
- return;
13
- const e = a, u = () => {
14
- l.flushSync(s);
15
- };
16
- if (typeof e.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
17
- s();
18
- return;
19
- }
20
- function i() {
21
- Promise.all(e.getAnimations().map((t) => t.finished)).then(() => {
22
- n?.aborted || u();
23
- }).catch(() => {
24
- if (m) {
25
- n?.aborted || u();
26
- return;
27
- }
28
- const t = e.getAnimations();
29
- !n?.aborted && t.length > 0 && t.some((r) => r.pending || r.playState !== "finished") && i();
30
- });
31
- }
32
- if (f) {
33
- const t = h.startingStyle;
34
- if (!e.hasAttribute(t)) {
35
- o.request(i);
36
- return;
37
- }
38
- const r = new MutationObserver(() => {
39
- e.hasAttribute(t) || (r.disconnect(), i());
40
- });
41
- r.observe(e, {
42
- attributes: !0,
43
- attributeFilter: [t]
44
- }), n?.addEventListener("abort", () => r.disconnect(), {
45
- once: !0
46
- });
47
- return;
48
- }
49
- o.request(i);
50
- });
1
+ import o from "./index190.js";
2
+ import * as e from "react";
3
+ const n = /* @__PURE__ */ e.createContext(null);
4
+ process.env.NODE_ENV !== "production" && (n.displayName = "SelectRootContext");
5
+ const c = /* @__PURE__ */ e.createContext(null);
6
+ process.env.NODE_ENV !== "production" && (c.displayName = "SelectFloatingContext");
7
+ function s() {
8
+ const t = e.useContext(n);
9
+ if (t === null)
10
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>." : o(60));
11
+ return t;
12
+ }
13
+ function i() {
14
+ const t = e.useContext(c);
15
+ if (t === null)
16
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>." : o(61));
17
+ return t;
51
18
  }
52
19
  export {
53
- y as useAnimationsFinished
20
+ c as SelectFloatingContext,
21
+ n as SelectRootContext,
22
+ i as useSelectFloatingContext,
23
+ s as useSelectRootContext
54
24
  };
55
25
  //# sourceMappingURL=index265.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index265.js","sources":["../../../node_modules/@base-ui/react/internals/useAnimationsFinished.mjs"],"sourcesContent":["'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\nimport { TransitionStatusDataAttributes } from \"./stateAttributesMapping.mjs\";\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param treatAbortedAsFinished - Whether to treat aborted animations as finished. If `false`, and there are aborted animations,\n * the function will check again if any new animations have started and wait for them to finish.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n ReactDOM.flushSync(fnToExecute);\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }).catch(() => {\n if (treatAbortedAsFinished) {\n if (!signal?.aborted) {\n done();\n }\n return;\n }\n const currentAnimations = resolvedElement.getAnimations();\n if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n }\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}"],"names":["useAnimationsFinished","elementOrRef","waitForStartingStyleRemoved","treatAbortedAsFinished","frame","useAnimationFrame","useStableCallback","fnToExecute","signal","element","resolveRef","resolvedElement","done","ReactDOM","exec","animation","currentAnimations","startingStyleAttribute","TransitionStatusDataAttributes","attributeObserver"],"mappings":";;;;;AAgBO,SAASA,EAAsBC,GAAcC,IAA8B,IAAOC,IAAyB,IAAM;AACtH,QAAMC,IAAQC,EAAiB;AAC/B,SAAOC,EAAkB,CAACC,GAM1BC,IAAS,SAAS;AAChB,IAAAJ,EAAM,OAAM;AACZ,UAAMK,IAAUC,EAAWT,CAAY;AACvC,QAAIQ,KAAW;AACb;AAEF,UAAME,IAAkBF,GAClBG,IAAO,MAAM;AAGjB,MAAAC,EAAS,UAAUN,CAAW;AAAA,IAChC;AACA,QAAI,OAAOI,EAAgB,iBAAkB,cAAc,WAAW,6BAA6B;AACjG,MAAAJ,EAAW;AACX;AAAA,IACF;AACA,aAASO,IAAO;AACd,cAAQ,IAAIH,EAAgB,gBAAgB,IAAI,CAAAI,MAAaA,EAAU,QAAQ,CAAC,EAAE,KAAK,MAAM;AAC3F,QAAKP,GAAQ,WACXI,EAAI;AAAA,MAER,CAAC,EAAE,MAAM,MAAM;AACb,YAAIT,GAAwB;AAC1B,UAAKK,GAAQ,WACXI,EAAI;AAEN;AAAA,QACF;AACA,cAAMI,IAAoBL,EAAgB,cAAa;AACvD,QAAI,CAACH,GAAQ,WAAWQ,EAAkB,SAAS,KAAKA,EAAkB,KAAK,CAAAD,MAAaA,EAAU,WAAWA,EAAU,cAAc,UAAU,KAGjJD,EAAI;AAAA,MAER,CAAC;AAAA,IACH;AACA,QAAIZ,GAA6B;AAC/B,YAAMe,IAAyBC,EAA+B;AAI9D,UAAI,CAACP,EAAgB,aAAaM,CAAsB,GAAG;AACzD,QAAAb,EAAM,QAAQU,CAAI;AAClB;AAAA,MACF;AAGA,YAAMK,IAAoB,IAAI,iBAAiB,MAAM;AACnD,QAAKR,EAAgB,aAAaM,CAAsB,MACtDE,EAAkB,WAAU,GAC5BL,EAAI;AAAA,MAER,CAAC;AACD,MAAAK,EAAkB,QAAQR,GAAiB;AAAA,QACzC,YAAY;AAAA,QACZ,iBAAiB,CAACM,CAAsB;AAAA,MAChD,CAAO,GACDT,GAAQ,iBAAiB,SAAS,MAAMW,EAAkB,WAAU,GAAI;AAAA,QACtE,MAAM;AAAA,MACd,CAAO;AACD;AAAA,IACF;AACA,IAAAf,EAAM,QAAQU,CAAI;AAAA,EACpB,CAAC;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index265.js","sources":["../../../node_modules/@base-ui/react/select/root/SelectRootContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectRootContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") SelectRootContext.displayName = \"SelectRootContext\";\nexport const SelectFloatingContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") SelectFloatingContext.displayName = \"SelectFloatingContext\";\nexport function useSelectRootContext() {\n const context = React.useContext(SelectRootContext);\n if (context === null) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(60));\n }\n return context;\n}\nexport function useSelectFloatingContext() {\n const context = React.useContext(SelectFloatingContext);\n if (context === null) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(61));\n }\n return context;\n}"],"names":["SelectRootContext","React","SelectFloatingContext","useSelectRootContext","context","_formatErrorMessage","useSelectFloatingContext"],"mappings":";;AAIY,MAACA,IAAiC,gBAAAC,EAAM,cAAc,IAAI;AAClE,QAAQ,IAAI,aAAa,iBAAcD,EAAkB,cAAc;AAC/D,MAACE,IAAqC,gBAAAD,EAAM,cAAc,IAAI;AACtE,QAAQ,IAAI,aAAa,iBAAcC,EAAsB,cAAc;AACxE,SAASC,IAAuB;AACrC,QAAMC,IAAUH,EAAM,WAAWD,CAAiB;AAClD,MAAII,MAAY;AACd,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,6FAA6FC,EAAoB,EAAE,CAAC;AAE9K,SAAOD;AACT;AACO,SAASE,IAA2B;AACzC,QAAMF,IAAUH,EAAM,WAAWC,CAAqB;AACtD,MAAIE,MAAY;AACd,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,iGAAiGC,EAAoB,EAAE,CAAC;AAElL,SAAOD;AACT;","x_google_ignoreList":[0]}
package/dist/index266.js CHANGED
@@ -1,9 +1,57 @@
1
- import * as t from "react";
2
- const e = parseInt(t.version, 10);
3
- function o(r) {
4
- return e >= r;
1
+ import a from "./index190.js";
2
+ import * as n from "react";
3
+ import { NOOP as e, EMPTY_OBJECT as d } from "./index264.js";
4
+ import { DEFAULT_FIELD_ROOT_STATE as l, DEFAULT_FIELD_STATE_ATTRIBUTES as i, DEFAULT_VALIDITY_STATE as s } from "./index287.js";
5
+ const u = {
6
+ invalid: void 0,
7
+ name: void 0,
8
+ validityData: {
9
+ state: s,
10
+ errors: [],
11
+ error: "",
12
+ value: "",
13
+ initialValue: null
14
+ },
15
+ setValidityData: e,
16
+ disabled: void 0,
17
+ touched: i.touched,
18
+ setTouched: e,
19
+ dirty: i.dirty,
20
+ setDirty: e,
21
+ filled: i.filled,
22
+ setFilled: e,
23
+ focused: i.focused,
24
+ setFocused: e,
25
+ validate: () => null,
26
+ validationMode: "onSubmit",
27
+ validationDebounceTime: 0,
28
+ shouldValidateOnChange: () => !1,
29
+ state: l,
30
+ markedDirtyRef: {
31
+ current: !1
32
+ },
33
+ registerFieldControl: e,
34
+ validation: {
35
+ getValidationProps: (o, t = d) => t,
36
+ inputRef: {
37
+ current: null
38
+ },
39
+ registerInput: e,
40
+ commit: async () => {
41
+ },
42
+ change: e
43
+ }
44
+ }, r = /* @__PURE__ */ n.createContext(u);
45
+ process.env.NODE_ENV !== "production" && (r.displayName = "FieldRootContext");
46
+ function f(o = !0) {
47
+ const t = n.useContext(r);
48
+ if (t.setValidityData === e && !o)
49
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : a(28));
50
+ return t;
5
51
  }
6
52
  export {
7
- o as isReactVersionAtLeast
53
+ u as DEFAULT_FIELD_ROOT_CONTEXT,
54
+ r as FieldRootContext,
55
+ f as useFieldRootContext
8
56
  };
9
57
  //# sourceMappingURL=index266.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index266.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]}
1
+ {"version":3,"file":"index266.js","sources":["../../../node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { NOOP } from \"../noop.mjs\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_FIELD_STATE_ATTRIBUTES, DEFAULT_VALIDITY_STATE } from \"../field-constants/constants.mjs\";\nexport const DEFAULT_FIELD_ROOT_CONTEXT = {\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched,\n setTouched: NOOP,\n dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty,\n setDirty: NOOP,\n filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled,\n setFilled: NOOP,\n focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused,\n setFocused: NOOP,\n validate: () => null,\n validationMode: 'onSubmit',\n validationDebounceTime: 0,\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n markedDirtyRef: {\n current: false\n },\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n registerInput: NOOP,\n commit: async () => {},\n change: NOOP\n }\n};\nexport const FieldRootContext = /*#__PURE__*/React.createContext(DEFAULT_FIELD_ROOT_CONTEXT);\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}"],"names":["DEFAULT_FIELD_ROOT_CONTEXT","DEFAULT_VALIDITY_STATE","NOOP","DEFAULT_FIELD_STATE_ATTRIBUTES","DEFAULT_FIELD_ROOT_STATE","_disabled","props","EMPTY_OBJECT","FieldRootContext","React","useFieldRootContext","optional","context","_formatErrorMessage"],"mappings":";;;;AAOY,MAACA,IAA6B;AAAA,EACxC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,IACZ,OAAOC;AAAA,IACP,QAAQ,CAAA;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,IACP,cAAc;AAAA,EAClB;AAAA,EACE,iBAAiBC;AAAA,EACjB,UAAU;AAAA,EACV,SAASC,EAA+B;AAAA,EACxC,YAAYD;AAAA,EACZ,OAAOC,EAA+B;AAAA,EACtC,UAAUD;AAAA,EACV,QAAQC,EAA+B;AAAA,EACvC,WAAWD;AAAA,EACX,SAASC,EAA+B;AAAA,EACxC,YAAYD;AAAA,EACZ,UAAU,MAAM;AAAA,EAChB,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,wBAAwB,MAAM;AAAA,EAC9B,OAAOE;AAAA,EACP,gBAAgB;AAAA,IACd,SAAS;AAAA,EACb;AAAA,EACE,sBAAsBF;AAAA,EACtB,YAAY;AAAA,IACV,oBAAoB,CAACG,GAAWC,IAAQC,MAAiBD;AAAA,IACzD,UAAU;AAAA,MACR,SAAS;AAAA,IACf;AAAA,IACI,eAAeJ;AAAA,IACf,QAAQ,YAAY;AAAA,IAAC;AAAA,IACrB,QAAQA;AAAA,EACZ;AACA,GACaM,IAAgC,gBAAAC,EAAM,cAAcT,CAA0B;AACvF,QAAQ,IAAI,aAAa,iBAAcQ,EAAiB,cAAc;AACnE,SAASE,EAAoBC,IAAW,IAAM;AACnD,QAAMC,IAAUH,EAAM,WAAWD,CAAgB;AACjD,MAAII,EAAQ,oBAAoBV,KAAQ,CAACS;AACvC,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,0FAA0FE,EAAoB,EAAE,CAAC;AAE3K,SAAOD;AACT;","x_google_ignoreList":[0]}
package/dist/index267.js CHANGED
@@ -1,9 +1,24 @@
1
- import * as t from "react";
2
- function n(r) {
3
- const e = t.useRef(!0);
4
- e.current && (e.current = !1, r());
1
+ import * as f from "react";
2
+ import { useIsoLayoutEffect as l } from "./index261.js";
3
+ import { useFieldRootContext as m } from "./index266.js";
4
+ function R(o, n, s, u, i = !0, c) {
5
+ const {
6
+ registerFieldControl: t
7
+ } = m(), r = f.useRef(null);
8
+ r.current || (r.current = /* @__PURE__ */ Symbol()), l(() => {
9
+ const e = r.current;
10
+ return !e || !i ? void 0 : (t(e, {
11
+ controlRef: o,
12
+ getValue: u,
13
+ id: n,
14
+ name: c,
15
+ value: s
16
+ }), () => {
17
+ t(e, void 0);
18
+ });
19
+ }, [o, i, u, n, c, t, s]);
5
20
  }
6
21
  export {
7
- n as useOnFirstRender
22
+ R as useRegisterFieldControl
8
23
  };
9
24
  //# sourceMappingURL=index267.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index267.js","sources":["../../../node_modules/@base-ui/utils/useOnFirstRender.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}"],"names":["useOnFirstRender","fn","ref","React"],"mappings":";AAGO,SAASA,EAAiBC,GAAI;AACnC,QAAMC,IAAMC,EAAM,OAAO,EAAI;AAC7B,EAAID,EAAI,YACNA,EAAI,UAAU,IACdD,EAAE;AAEN;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index267.js","sources":["../../../node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFieldRootContext } from \"../field-root-context/FieldRootContext.mjs\";\nexport function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = React.useRef(null);\n if (!sourceRef.current) {\n sourceRef.current = Symbol();\n }\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!source || !enabled) {\n return undefined;\n }\n const registration = {\n controlRef,\n getValue: getFormValueOverride,\n id,\n name,\n value\n };\n registerFieldControl(source, registration);\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, value]);\n}"],"names":["useRegisterFieldControl","controlRef","id","value","getFormValueOverride","enabled","name","registerFieldControl","useFieldRootContext","sourceRef","React","useIsoLayoutEffect","source"],"mappings":";;;AAKO,SAASA,EAAwBC,GAAYC,GAAIC,GAAOC,GAAsBC,IAAU,IAAMC,GAAM;AACzG,QAAM;AAAA,IACJ,sBAAAC;AAAA,EACJ,IAAMC,EAAmB,GACjBC,IAAYC,EAAM,OAAO,IAAI;AACnC,EAAKD,EAAU,YACbA,EAAU,UAAU,uBAAM,IAE5BE,EAAmB,MAAM;AACvB,UAAMC,IAASH,EAAU;AACzB,WAAI,CAACG,KAAU,CAACP,IACd,UASFE,EAAqBK,GAPA;AAAA,MACnB,YAAAX;AAAA,MACA,UAAUG;AAAA,MACV,IAAAF;AAAA,MACA,MAAAI;AAAA,MACA,OAAAH;AAAA,IACN,CAC6C,GAClC,MAAM;AACX,MAAAI,EAAqBK,GAAQ,MAAS;AAAA,IACxC;AAAA,EACF,GAAG,CAACX,GAAYI,GAASD,GAAsBF,GAAII,GAAMC,GAAsBJ,CAAK,CAAC;AACvF;","x_google_ignoreList":[0]}