@rpcbase/ui 0.252.0 → 0.254.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 (353) hide show
  1. package/dist/components/Notifications/types.d.ts +2 -0
  2. package/dist/components/Notifications/types.d.ts.map +1 -1
  3. package/dist/index10.js +2 -2
  4. package/dist/index106.js +1 -1
  5. package/dist/index11.js +2 -2
  6. package/dist/index12.js +3 -3
  7. package/dist/index120.js +10 -10
  8. package/dist/index122.js +2 -2
  9. package/dist/index123.js +3 -3
  10. package/dist/index13.js +2 -2
  11. package/dist/index14.js +2 -2
  12. package/dist/index15.js +2 -2
  13. package/dist/index16.js +8 -8
  14. package/dist/index167.js +3 -3
  15. package/dist/index17.js +1 -1
  16. package/dist/index172.js +3 -3
  17. package/dist/index175.js +1 -1
  18. package/dist/index176.js +4 -4
  19. package/dist/index18.js +7 -7
  20. package/dist/index182.js +2 -2
  21. package/dist/index184.js +4 -4
  22. package/dist/index185.js +14 -14
  23. package/dist/index186.js +1 -1
  24. package/dist/index187.js +1 -1
  25. package/dist/index188.js +6 -6
  26. package/dist/index189.js +2 -2
  27. package/dist/index19.js +16 -16
  28. package/dist/index192.js +2 -2
  29. package/dist/index193.js +6 -6
  30. package/dist/index21.js +1 -1
  31. package/dist/index22.js +2 -2
  32. package/dist/index23.js +1 -1
  33. package/dist/index235.js +27 -14
  34. package/dist/index235.js.map +1 -1
  35. package/dist/index236.js +12 -7
  36. package/dist/index236.js.map +1 -1
  37. package/dist/index237.js +24 -9
  38. package/dist/index237.js.map +1 -1
  39. package/dist/index238.js +5 -10
  40. package/dist/index238.js.map +1 -1
  41. package/dist/index239.js +15 -20
  42. package/dist/index239.js.map +1 -1
  43. package/dist/index24.js +1 -1
  44. package/dist/index240.js +7 -8
  45. package/dist/index240.js.map +1 -1
  46. package/dist/index241.js +10 -9
  47. package/dist/index241.js.map +1 -1
  48. package/dist/index242.js +10 -9
  49. package/dist/index242.js.map +1 -1
  50. package/dist/index243.js +21 -4
  51. package/dist/index243.js.map +1 -1
  52. package/dist/index244.js +8 -5
  53. package/dist/index244.js.map +1 -1
  54. package/dist/index245.js +9 -16
  55. package/dist/index245.js.map +1 -1
  56. package/dist/index246.js +8 -8
  57. package/dist/index246.js.map +1 -1
  58. package/dist/index247.js +4 -18
  59. package/dist/index247.js.map +1 -1
  60. package/dist/index248.js +5 -20
  61. package/dist/index248.js.map +1 -1
  62. package/dist/index249.js +16 -12
  63. package/dist/index249.js.map +1 -1
  64. package/dist/index25.js +1 -1
  65. package/dist/index250.js +9 -29
  66. package/dist/index250.js.map +1 -1
  67. package/dist/index251.js +18 -12
  68. package/dist/index251.js.map +1 -1
  69. package/dist/index252.js +20 -25
  70. package/dist/index252.js.map +1 -1
  71. package/dist/index253.js +12 -5
  72. package/dist/index253.js.map +1 -1
  73. package/dist/index260.js +2 -2
  74. package/dist/index273.js +1 -1
  75. package/dist/index277.js +25 -20
  76. package/dist/index277.js.map +1 -1
  77. package/dist/index278.js +24 -62
  78. package/dist/index278.js.map +1 -1
  79. package/dist/index279.js +16 -6
  80. package/dist/index279.js.map +1 -1
  81. package/dist/index28.js +1 -1
  82. package/dist/index280.js +20 -6
  83. package/dist/index280.js.map +1 -1
  84. package/dist/index281.js +66 -11
  85. package/dist/index281.js.map +1 -1
  86. package/dist/index282.js +6 -3
  87. package/dist/index282.js.map +1 -1
  88. package/dist/index283.js +5 -50
  89. package/dist/index283.js.map +1 -1
  90. package/dist/index284.js +12 -4
  91. package/dist/index284.js.map +1 -1
  92. package/dist/index285.js +3 -29
  93. package/dist/index285.js.map +1 -1
  94. package/dist/index286.js +49 -15
  95. package/dist/index286.js.map +1 -1
  96. package/dist/index287.js +4 -6
  97. package/dist/index287.js.map +1 -1
  98. package/dist/index288.js +28 -20
  99. package/dist/index288.js.map +1 -1
  100. package/dist/index289.js +15 -52
  101. package/dist/index289.js.map +1 -1
  102. package/dist/index29.js +3 -56
  103. package/dist/index29.js.map +1 -1
  104. package/dist/index290.js +5 -20
  105. package/dist/index290.js.map +1 -1
  106. package/dist/index291.js +21 -41
  107. package/dist/index291.js.map +1 -1
  108. package/dist/index292.js +53 -39
  109. package/dist/index292.js.map +1 -1
  110. package/dist/index293.js +21 -46
  111. package/dist/index293.js.map +1 -1
  112. package/dist/index294.js +40 -19
  113. package/dist/index294.js.map +1 -1
  114. package/dist/index295.js +38 -69
  115. package/dist/index295.js.map +1 -1
  116. package/dist/index296.js +46 -18
  117. package/dist/index296.js.map +1 -1
  118. package/dist/index297.js +20 -3
  119. package/dist/index297.js.map +1 -1
  120. package/dist/index298.js +69 -10
  121. package/dist/index298.js.map +1 -1
  122. package/dist/index299.js +16 -12
  123. package/dist/index299.js.map +1 -1
  124. package/dist/index3.js +2 -2
  125. package/dist/index30.js +242 -3
  126. package/dist/index30.js.map +1 -1
  127. package/dist/index300.js +3 -18
  128. package/dist/index300.js.map +1 -1
  129. package/dist/index301.js +11 -36
  130. package/dist/index301.js.map +1 -1
  131. package/dist/index302.js +12 -238
  132. package/dist/index302.js.map +1 -1
  133. package/dist/index303.js +15 -249
  134. package/dist/index303.js.map +1 -1
  135. package/dist/index304.js +35 -67
  136. package/dist/index304.js.map +1 -1
  137. package/dist/index305.js +233 -93
  138. package/dist/index305.js.map +1 -1
  139. package/dist/index306.js +243 -74
  140. package/dist/index306.js.map +1 -1
  141. package/dist/index307.js +68 -3
  142. package/dist/index307.js.map +1 -1
  143. package/dist/index308.js +96 -26
  144. package/dist/index308.js.map +1 -1
  145. package/dist/index309.js +83 -16
  146. package/dist/index309.js.map +1 -1
  147. package/dist/index31.js +21 -239
  148. package/dist/index31.js.map +1 -1
  149. package/dist/index310.js +4 -35
  150. package/dist/index310.js.map +1 -1
  151. package/dist/index311.js +28 -16
  152. package/dist/index311.js.map +1 -1
  153. package/dist/index312.js +16 -3
  154. package/dist/index312.js.map +1 -1
  155. package/dist/index313.js +35 -27
  156. package/dist/index313.js.map +1 -1
  157. package/dist/index314.js +17 -28
  158. package/dist/index314.js.map +1 -1
  159. package/dist/index315.js +4 -4
  160. package/dist/index315.js.map +1 -1
  161. package/dist/index316.js +23 -75
  162. package/dist/index316.js.map +1 -1
  163. package/dist/index317.js +25 -269
  164. package/dist/index317.js.map +1 -1
  165. package/dist/index318.js +4 -12
  166. package/dist/index318.js.map +1 -1
  167. package/dist/index319.js +79 -11
  168. package/dist/index319.js.map +1 -1
  169. package/dist/index32.js +4 -23
  170. package/dist/index32.js.map +1 -1
  171. package/dist/index320.js +270 -23
  172. package/dist/index320.js.map +1 -1
  173. package/dist/index321.js +11 -16
  174. package/dist/index321.js.map +1 -1
  175. package/dist/index322.js +10 -125
  176. package/dist/index322.js.map +1 -1
  177. package/dist/index323.js +24 -4
  178. package/dist/index323.js.map +1 -1
  179. package/dist/index324.js +16 -65
  180. package/dist/index324.js.map +1 -1
  181. package/dist/index325.js +125 -13
  182. package/dist/index325.js.map +1 -1
  183. package/dist/index326.js +5 -7
  184. package/dist/index326.js.map +1 -1
  185. package/dist/index327.js +65 -5
  186. package/dist/index327.js.map +1 -1
  187. package/dist/index328.js +14 -4
  188. package/dist/index328.js.map +1 -1
  189. package/dist/index329.js +7 -10
  190. package/dist/index329.js.map +1 -1
  191. package/dist/index33.js +6 -3
  192. package/dist/index33.js.map +1 -1
  193. package/dist/index330.js +5 -7
  194. package/dist/index330.js.map +1 -1
  195. package/dist/index331.js +3 -133
  196. package/dist/index331.js.map +1 -1
  197. package/dist/index332.js +9 -398
  198. package/dist/index332.js.map +1 -1
  199. package/dist/index333.js +8 -5
  200. package/dist/index333.js.map +1 -1
  201. package/dist/index334.js +131 -50
  202. package/dist/index334.js.map +1 -1
  203. package/dist/index335.js +399 -11
  204. package/dist/index335.js.map +1 -1
  205. package/dist/index336.js +5 -28
  206. package/dist/index336.js.map +1 -1
  207. package/dist/index337.js +52 -11
  208. package/dist/index337.js.map +1 -1
  209. package/dist/index338.js +11 -24
  210. package/dist/index338.js.map +1 -1
  211. package/dist/index339.js +27 -28
  212. package/dist/index339.js.map +1 -1
  213. package/dist/index34.js +38 -8
  214. package/dist/index34.js.map +1 -1
  215. package/dist/index340.js +11 -16
  216. package/dist/index340.js.map +1 -1
  217. package/dist/index341.js +1 -1
  218. package/dist/index348.js +5 -51
  219. package/dist/index348.js.map +1 -1
  220. package/dist/index349.js +51 -5
  221. package/dist/index349.js.map +1 -1
  222. package/dist/index35.js +74 -35
  223. package/dist/index35.js.map +1 -1
  224. package/dist/index350.js +3 -3
  225. package/dist/index358.js +5 -5
  226. package/dist/index359.js +1 -1
  227. package/dist/index36.js +20 -74
  228. package/dist/index36.js.map +1 -1
  229. package/dist/index363.js +5 -5
  230. package/dist/index368.js +11 -5
  231. package/dist/index368.js.map +1 -1
  232. package/dist/index369.js +6 -3
  233. package/dist/index369.js.map +1 -1
  234. package/dist/index37.js +33 -18
  235. package/dist/index37.js.map +1 -1
  236. package/dist/index370.js +3 -12
  237. package/dist/index370.js.map +1 -1
  238. package/dist/index372.js +1 -1
  239. package/dist/index375.js +2 -2
  240. package/dist/index376.js +3 -3
  241. package/dist/index377.js +8 -8
  242. package/dist/index379.js +5 -5
  243. package/dist/index38.js +26 -36
  244. package/dist/index38.js.map +1 -1
  245. package/dist/index380.js +3 -3
  246. package/dist/index382.js +1 -1
  247. package/dist/index384.js +1 -1
  248. package/dist/index385.js +2 -2
  249. package/dist/index386.js +1 -1
  250. package/dist/index388.js +2 -2
  251. package/dist/index389.js +2 -2
  252. package/dist/index39.js +21 -26
  253. package/dist/index39.js.map +1 -1
  254. package/dist/index399.js +2 -2
  255. package/dist/index4.js +2 -2
  256. package/dist/index40.js +56 -20
  257. package/dist/index40.js.map +1 -1
  258. package/dist/index41.js +51 -59
  259. package/dist/index41.js.map +1 -1
  260. package/dist/index411.js +3 -15
  261. package/dist/index411.js.map +1 -1
  262. package/dist/index412.js +15 -3
  263. package/dist/index412.js.map +1 -1
  264. package/dist/index413.js +1 -1
  265. package/dist/index414.js +68 -5
  266. package/dist/index414.js.map +1 -1
  267. package/dist/index415.js +30 -55
  268. package/dist/index415.js.map +1 -1
  269. package/dist/index416.js +9 -68
  270. package/dist/index416.js.map +1 -1
  271. package/dist/index417.js +148 -26
  272. package/dist/index417.js.map +1 -1
  273. package/dist/index418.js +108 -9
  274. package/dist/index418.js.map +1 -1
  275. package/dist/index419.js +5 -153
  276. package/dist/index419.js.map +1 -1
  277. package/dist/index42.js +21 -50
  278. package/dist/index42.js.map +1 -1
  279. package/dist/index420.js +54 -106
  280. package/dist/index420.js.map +1 -1
  281. package/dist/index43.js +127 -18
  282. package/dist/index43.js.map +1 -1
  283. package/dist/index44.js +39 -122
  284. package/dist/index44.js.map +1 -1
  285. package/dist/index45.js +85 -42
  286. package/dist/index45.js.map +1 -1
  287. package/dist/index46.js +123 -87
  288. package/dist/index46.js.map +1 -1
  289. package/dist/index47.js +5 -126
  290. package/dist/index47.js.map +1 -1
  291. package/dist/index48.js +332 -5
  292. package/dist/index48.js.map +1 -1
  293. package/dist/index49.js +245 -320
  294. package/dist/index49.js.map +1 -1
  295. package/dist/index5.js +2 -2
  296. package/dist/index50.js +23 -254
  297. package/dist/index50.js.map +1 -1
  298. package/dist/index51.js +129 -25
  299. package/dist/index51.js.map +1 -1
  300. package/dist/index52.js +24 -129
  301. package/dist/index52.js.map +1 -1
  302. package/dist/index53.js +19 -22
  303. package/dist/index53.js.map +1 -1
  304. package/dist/index54.js +134 -19
  305. package/dist/index54.js.map +1 -1
  306. package/dist/index55.js +30 -133
  307. package/dist/index55.js.map +1 -1
  308. package/dist/index56.js +24 -30
  309. package/dist/index56.js.map +1 -1
  310. package/dist/index57.js +38 -26
  311. package/dist/index57.js.map +1 -1
  312. package/dist/index58.js +19 -39
  313. package/dist/index58.js.map +1 -1
  314. package/dist/index59.js +133 -18
  315. package/dist/index59.js.map +1 -1
  316. package/dist/index6.js +4 -4
  317. package/dist/index60.js +49 -134
  318. package/dist/index60.js.map +1 -1
  319. package/dist/index61.js +25 -48
  320. package/dist/index61.js.map +1 -1
  321. package/dist/index62.js +57 -28
  322. package/dist/index62.js.map +1 -1
  323. package/dist/index63.js +56 -57
  324. package/dist/index63.js.map +1 -1
  325. package/dist/index64.js +5 -5
  326. package/dist/index64.js.map +1 -1
  327. package/dist/index66.js +23 -11
  328. package/dist/index66.js.map +1 -1
  329. package/dist/index67.js +232 -17
  330. package/dist/index67.js.map +1 -1
  331. package/dist/index68.js +5 -5
  332. package/dist/index68.js.map +1 -1
  333. package/dist/index7.js +11 -11
  334. package/dist/index70.js +11 -23
  335. package/dist/index70.js.map +1 -1
  336. package/dist/index71.js +17 -232
  337. package/dist/index71.js.map +1 -1
  338. package/dist/index72.js +6 -2
  339. package/dist/index72.js.map +1 -1
  340. package/dist/index73.js +8 -2
  341. package/dist/index73.js.map +1 -1
  342. package/dist/index74.js +6 -2
  343. package/dist/index74.js.map +1 -1
  344. package/dist/index75.js +2 -2
  345. package/dist/index76.js +2 -6
  346. package/dist/index76.js.map +1 -1
  347. package/dist/index77.js +2 -8
  348. package/dist/index77.js.map +1 -1
  349. package/dist/index78.js +2 -6
  350. package/dist/index78.js.map +1 -1
  351. package/dist/index8.js +2 -2
  352. package/dist/index9.js +1 -1
  353. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index278.js","sources":["../../../node_modules/@base-ui/utils/useMergedRefs.mjs"],"sourcesContent":["import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}"],"names":["useMergedRefs","a","b","d","forkRef","useRefWithInit","createForkRef","didChange","update","useMergedRefsN","refs","didChangeN","c","newRefs","ref","index","instance","cleanupCallbacks","i","refCleanup","cleanupCallback"],"mappings":";AAUO,SAASA,EAAcC,GAAGC,GAAG,GAAGC,GAAG;AACxC,QAAMC,IAAUC,EAAeC,CAAa,EAAE;AAC9C,SAAIC,EAAUH,GAASH,GAAGC,GAAG,GAAGC,CAAC,KAC/BK,EAAOJ,GAAS,CAACH,GAAGC,GAAG,GAAGC,CAAC,CAAC,GAEvBC,EAAQ;AACjB;AAOO,SAASK,EAAeC,GAAM;AACnC,QAAMN,IAAUC,EAAeC,CAAa,EAAE;AAC9C,SAAIK,EAAWP,GAASM,CAAI,KAC1BF,EAAOJ,GAASM,CAAI,GAEfN,EAAQ;AACjB;AACA,SAASE,IAAgB;AACvB,SAAO;AAAA,IACL,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM,CAAA;AAAA,EACV;AACA;AACA,SAASC,EAAUH,GAASH,GAAGC,GAAGU,GAAGT,GAAG;AAEtC,SAAOC,EAAQ,KAAK,CAAC,MAAMH,KAAKG,EAAQ,KAAK,CAAC,MAAMF,KAAKE,EAAQ,KAAK,CAAC,MAAMQ,KAAKR,EAAQ,KAAK,CAAC,MAAMD;AACxG;AACA,SAASQ,EAAWP,GAASS,GAAS;AACpC,SAAOT,EAAQ,KAAK,WAAWS,EAAQ,UAAUT,EAAQ,KAAK,KAAK,CAACU,GAAKC,MAAUD,MAAQD,EAAQE,CAAK,CAAC;AAC3G;AACA,SAASP,EAAOJ,GAASM,GAAM;AAE7B,MADAN,EAAQ,OAAOM,GACXA,EAAK,MAAM,CAAAI,MAAOA,KAAO,IAAI,GAAG;AAClC,IAAAV,EAAQ,WAAW;AACnB;AAAA,EACF;AACA,EAAAA,EAAQ,WAAW,CAAAY,MAAY;AAK7B,QAJIZ,EAAQ,YACVA,EAAQ,QAAO,GACfA,EAAQ,UAAU,OAEhBY,KAAY,MAAM;AACpB,YAAMC,IAAmB,MAAMP,EAAK,MAAM,EAAE,KAAK,IAAI;AACrD,eAASQ,IAAI,GAAGA,IAAIR,EAAK,QAAQQ,KAAK,GAAG;AACvC,cAAMJ,IAAMJ,EAAKQ,CAAC;AAClB,YAAIJ,KAAO;AAGX,kBAAQ,OAAOA,GAAG;AAAA,YAChB,KAAK,YACH;AACE,oBAAMK,IAAaL,EAAIE,CAAQ;AAC/B,cAAI,OAAOG,KAAe,eACxBF,EAAiBC,CAAC,IAAIC;AAExB;AAAA,YACF;AAAA,YACF,KAAK,UACH;AACE,cAAAL,EAAI,UAAUE;AACd;AAAA,YACF;AAAA,UAEZ;AAAA,MACM;AACA,MAAAZ,EAAQ,UAAU,MAAM;AACtB,iBAASc,IAAI,GAAGA,IAAIR,EAAK,QAAQQ,KAAK,GAAG;AACvC,gBAAMJ,IAAMJ,EAAKQ,CAAC;AAClB,cAAIJ,KAAO;AAGX,oBAAQ,OAAOA,GAAG;AAAA,cAChB,KAAK,YACH;AACE,sBAAMM,IAAkBH,EAAiBC,CAAC;AAC1C,gBAAI,OAAOE,KAAoB,aAC7BA,EAAe,IAEfN,EAAI,IAAI;AAEV;AAAA,cACF;AAAA,cACF,KAAK,UACH;AACE,gBAAAA,EAAI,UAAU;AACd;AAAA,cACF;AAAA,YAEd;AAAA,QACQ;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index278.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js"],"sourcesContent":["/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not.\r\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode;\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());\n // If there's more than one captured group,\n // then carrier code is the second one.\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n }\n // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length);\n // If there's at least one captured group,\n // then carrier code is the first one.\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n }\n // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n var nationalPrefix;\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);\n // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map"],"names":["extractNationalNumberFromPossiblyIncompleteNumber","number","metadata","prefixPattern","prefixMatch","nationalNumber","carrierCode","capturedGroupsCount","hasCapturedGroups","prefixBeforeNationalNumber","nationalPrefix","possiblePositionOfTheFirstCapturedGroup","possibleNationalPrefix"],"mappings":"AAae,SAASA,EAAkDC,GAAQC,GAAU;AAC1F,MAAID,KAAUC,EAAS,cAAc,yBAAwB,GAAI;AAI/D,QAAIC,IAAgB,IAAI,OAAO,SAASD,EAAS,cAAc,yBAAwB,IAAK,GAAG,GAC3FE,IAAcD,EAAc,KAAKF,CAAM;AAC3C,QAAIG,GAAa;AACf,UAAIC,GACAC,GAiBAC,IAAsBH,EAAY,SAAS,GAC3CI,IAAoBD,IAAsB,KAAKH,EAAYG,CAAmB;AAClF,UAAIL,EAAS,4BAA2B,KAAMM;AAC5C,QAAAH,IAAiBJ,EAAO,QAAQE,GAAeD,EAAS,4BAA2B,CAAE,GAGjFK,IAAsB,MACxBD,IAAcF,EAAY,CAAC;AAAA,WAS1B;AAMH,YAAIK,IAA6BL,EAAY,CAAC;AAC9C,QAAAC,IAAiBJ,EAAO,MAAMQ,EAA2B,MAAM,GAG3DD,MACFF,IAAcF,EAAY,CAAC;AAAA,MAE/B;AAMA,UAAIM;AACJ,UAAIF,GAAmB;AACrB,YAAIG,IAA0CV,EAAO,QAAQG,EAAY,CAAC,CAAC,GACvEQ,IAAyBX,EAAO,MAAM,GAAGU,CAAuC;AAOpF,QAAIC,MAA2BV,EAAS,cAAc,eAAc,MAClEQ,IAAiBR,EAAS,cAAc,eAAc;AAAA,MAE1D;AACE,QAAAQ,IAAiBN,EAAY,CAAC;AAEhC,aAAO;AAAA,QACL,gBAAgBC;AAAA,QAChB,gBAAgBK;AAAA,QAChB,aAAaJ;AAAA,MACrB;AAAA,IACI;AAAA,EACF;AACA,SAAO;AAAA,IACL,gBAAgBL;AAAA,EACpB;AACA;","x_google_ignoreList":[0]}
package/dist/index279.js CHANGED
@@ -1,10 +1,20 @@
1
- import * as c from "react";
2
- const e = {};
3
- function f(r, n) {
4
- const t = c.useRef(e);
5
- return t.current === e && (t.current = r(n)), t;
1
+ import I from "./index163.js";
2
+ import { VALID_DIGITS as l } from "./index159.js";
3
+ var p = new RegExp("([" + l + "])");
4
+ function c(t, r, f, n) {
5
+ if (r) {
6
+ var a = new I(n);
7
+ a.selectNumberingPlan(r || f);
8
+ var i = new RegExp(a.IDDPrefix());
9
+ if (t.search(i) === 0) {
10
+ t = t.slice(t.match(i)[0].length);
11
+ var e = t.match(p);
12
+ if (!(e && e[1] != null && e[1].length > 0 && e[1] === "0"))
13
+ return t;
14
+ }
15
+ }
6
16
  }
7
17
  export {
8
- f as useRefWithInit
18
+ c as default
9
19
  };
10
20
  //# sourceMappingURL=index279.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index279.js","sources":["../../../node_modules/@base-ui/utils/useRefWithInit.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}"],"names":["UNINITIALIZED","useRefWithInit","init","initArg","ref","React"],"mappings":";AAGA,MAAMA,IAAgB,CAAA;AAUf,SAASC,EAAeC,GAAMC,GAAS;AAC5C,QAAMC,IAAMC,EAAM,OAAOL,CAAa;AACtC,SAAII,EAAI,YAAYJ,MAClBI,EAAI,UAAUF,EAAKC,CAAO,IAErBC;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index279.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport { VALID_DIGITS } from '../constants.js';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadataJson) {\n if (!country) {\n return;\n }\n\n // Get the IDD prefix pattern.\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || callingCode);\n var IDDPrefixPattern = new RegExp(metadata.IDDPrefix());\n\n // Check if the number is IDD-prefixed.\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n }\n\n // Strip IDD prefix.\n number = number.slice(number.match(IDDPrefixPattern)[0].length);\n\n // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map"],"names":["CAPTURING_DIGIT_PATTERN","VALID_DIGITS","stripIddPrefix","number","country","callingCode","metadataJson","metadata","Metadata","IDDPrefixPattern","matchedGroups"],"mappings":";;AAEA,IAAIA,IAA0B,IAAI,OAAO,OAAOC,IAAe,IAAI;AACpD,SAASC,EAAeC,GAAQC,GAASC,GAAaC,GAAc;AACjF,MAAKF,GAKL;AAAA,QAAIG,IAAW,IAAIC,EAASF,CAAY;AACxC,IAAAC,EAAS,oBAAoBH,KAAWC,CAAW;AACnD,QAAII,IAAmB,IAAI,OAAOF,EAAS,UAAS,CAAE;AAGtD,QAAIJ,EAAO,OAAOM,CAAgB,MAAM,GAKxC;AAAA,MAAAN,IAASA,EAAO,MAAMA,EAAO,MAAMM,CAAgB,EAAE,CAAC,EAAE,MAAM;AAM9D,UAAIC,IAAgBP,EAAO,MAAMH,CAAuB;AACxD,UAAI,EAAAU,KAAiBA,EAAc,CAAC,KAAK,QAAQA,EAAc,CAAC,EAAE,SAAS,KACrEA,EAAc,CAAC,MAAM;AAI3B,eAAOP;AAAA;AAAA;AACT;","x_google_ignoreList":[0]}
package/dist/index28.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __require as r } from "./index64.js";
2
2
  var i = r();
3
3
  export {
4
- i as c
4
+ i as j
5
5
  };
6
6
  //# sourceMappingURL=index28.js.map
package/dist/index280.js CHANGED
@@ -1,9 +1,23 @@
1
- import * as t from "react";
2
- function n(r) {
3
- const e = t.useRef(!0);
4
- e.current && (e.current = !1, r());
5
- }
1
+ const i = {
2
+ clipPath: "inset(50%)",
3
+ overflow: "hidden",
4
+ whiteSpace: "nowrap",
5
+ border: 0,
6
+ padding: 0,
7
+ width: 1,
8
+ height: 1,
9
+ margin: -1
10
+ }, e = {
11
+ ...i,
12
+ position: "fixed",
13
+ top: 0,
14
+ left: 0
15
+ }, t = {
16
+ ...i,
17
+ position: "absolute"
18
+ };
6
19
  export {
7
- n as useOnFirstRender
20
+ e as visuallyHidden,
21
+ t as visuallyHiddenInput
8
22
  };
9
23
  //# sourceMappingURL=index280.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index280.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":"index280.js","sources":["../../../node_modules/@base-ui/utils/visuallyHidden.mjs"],"sourcesContent":["const visuallyHiddenBase = {\n clipPath: 'inset(50%)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n border: 0,\n padding: 0,\n width: 1,\n height: 1,\n margin: -1\n};\nexport const visuallyHidden = {\n ...visuallyHiddenBase,\n position: 'fixed',\n top: 0,\n left: 0\n};\nexport const visuallyHiddenInput = {\n ...visuallyHiddenBase,\n position: 'absolute'\n};"],"names":["visuallyHiddenBase","visuallyHidden","visuallyHiddenInput"],"mappings":"AAAA,MAAMA,IAAqB;AAAA,EACzB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV,GACaC,IAAiB;AAAA,EAC5B,GAAGD;AAAA,EACH,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AACR,GACaE,IAAsB;AAAA,EACjC,GAAGF;AAAA,EACH,UAAU;AACZ;","x_google_ignoreList":[0]}
package/dist/index281.js CHANGED
@@ -1,15 +1,70 @@
1
- import * as u from "react";
2
- function s(r) {
3
- const [t, e] = u.useState({
4
- current: r,
5
- previous: null
6
- });
7
- return r !== t.current && e({
8
- current: r,
9
- previous: t.current
10
- }), t.previous;
1
+ import { useRefWithInit as r } from "./index282.js";
2
+ function b(n, e, c, t) {
3
+ const l = r(i).current;
4
+ return s(l, n, e, c, t) && o(l, [n, e, c, t]), l.callback;
5
+ }
6
+ function h(n) {
7
+ const e = r(i).current;
8
+ return f(e, n) && o(e, n), e.callback;
9
+ }
10
+ function i() {
11
+ return {
12
+ callback: null,
13
+ cleanup: null,
14
+ refs: []
15
+ };
16
+ }
17
+ function s(n, e, c, t, l) {
18
+ return n.refs[0] !== e || n.refs[1] !== c || n.refs[2] !== t || n.refs[3] !== l;
19
+ }
20
+ function f(n, e) {
21
+ return n.refs.length !== e.length || n.refs.some((c, t) => c !== e[t]);
22
+ }
23
+ function o(n, e) {
24
+ if (n.refs = e, e.every((c) => c == null)) {
25
+ n.callback = null;
26
+ return;
27
+ }
28
+ n.callback = (c) => {
29
+ if (n.cleanup && (n.cleanup(), n.cleanup = null), c != null) {
30
+ const t = Array(e.length).fill(null);
31
+ for (let l = 0; l < e.length; l += 1) {
32
+ const u = e[l];
33
+ if (u != null)
34
+ switch (typeof u) {
35
+ case "function": {
36
+ const a = u(c);
37
+ typeof a == "function" && (t[l] = a);
38
+ break;
39
+ }
40
+ case "object": {
41
+ u.current = c;
42
+ break;
43
+ }
44
+ }
45
+ }
46
+ n.cleanup = () => {
47
+ for (let l = 0; l < e.length; l += 1) {
48
+ const u = e[l];
49
+ if (u != null)
50
+ switch (typeof u) {
51
+ case "function": {
52
+ const a = t[l];
53
+ typeof a == "function" ? a() : u(null);
54
+ break;
55
+ }
56
+ case "object": {
57
+ u.current = null;
58
+ break;
59
+ }
60
+ }
61
+ }
62
+ };
63
+ }
64
+ };
11
65
  }
12
66
  export {
13
- s as usePreviousValue
67
+ b as useMergedRefs,
68
+ h as useMergedRefsN
14
69
  };
15
70
  //# sourceMappingURL=index281.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index281.js","sources":["../../../node_modules/@base-ui/utils/usePreviousValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a previous value of its argument.\n * @param value Current value.\n * @returns Previous value, or null if there is no previous value.\n */\nexport function usePreviousValue(value) {\n const [state, setState] = React.useState({\n current: value,\n previous: null\n });\n if (value !== state.current) {\n setState({\n current: value,\n previous: state.current\n });\n }\n return state.previous;\n}"],"names":["usePreviousValue","value","state","setState","React"],"mappings":";AASO,SAASA,EAAiBC,GAAO;AACtC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAM,SAAS;AAAA,IACvC,SAASH;AAAA,IACT,UAAU;AAAA,EACd,CAAG;AACD,SAAIA,MAAUC,EAAM,WAClBC,EAAS;AAAA,IACP,SAASF;AAAA,IACT,UAAUC,EAAM;AAAA,EACtB,CAAK,GAEIA,EAAM;AACf;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index281.js","sources":["../../../node_modules/@base-ui/utils/useMergedRefs.mjs"],"sourcesContent":["import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}"],"names":["useMergedRefs","a","b","d","forkRef","useRefWithInit","createForkRef","didChange","update","useMergedRefsN","refs","didChangeN","c","newRefs","ref","index","instance","cleanupCallbacks","i","refCleanup","cleanupCallback"],"mappings":";AAUO,SAASA,EAAcC,GAAGC,GAAG,GAAGC,GAAG;AACxC,QAAMC,IAAUC,EAAeC,CAAa,EAAE;AAC9C,SAAIC,EAAUH,GAASH,GAAGC,GAAG,GAAGC,CAAC,KAC/BK,EAAOJ,GAAS,CAACH,GAAGC,GAAG,GAAGC,CAAC,CAAC,GAEvBC,EAAQ;AACjB;AAOO,SAASK,EAAeC,GAAM;AACnC,QAAMN,IAAUC,EAAeC,CAAa,EAAE;AAC9C,SAAIK,EAAWP,GAASM,CAAI,KAC1BF,EAAOJ,GAASM,CAAI,GAEfN,EAAQ;AACjB;AACA,SAASE,IAAgB;AACvB,SAAO;AAAA,IACL,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM,CAAA;AAAA,EACV;AACA;AACA,SAASC,EAAUH,GAASH,GAAGC,GAAGU,GAAGT,GAAG;AAEtC,SAAOC,EAAQ,KAAK,CAAC,MAAMH,KAAKG,EAAQ,KAAK,CAAC,MAAMF,KAAKE,EAAQ,KAAK,CAAC,MAAMQ,KAAKR,EAAQ,KAAK,CAAC,MAAMD;AACxG;AACA,SAASQ,EAAWP,GAASS,GAAS;AACpC,SAAOT,EAAQ,KAAK,WAAWS,EAAQ,UAAUT,EAAQ,KAAK,KAAK,CAACU,GAAKC,MAAUD,MAAQD,EAAQE,CAAK,CAAC;AAC3G;AACA,SAASP,EAAOJ,GAASM,GAAM;AAE7B,MADAN,EAAQ,OAAOM,GACXA,EAAK,MAAM,CAAAI,MAAOA,KAAO,IAAI,GAAG;AAClC,IAAAV,EAAQ,WAAW;AACnB;AAAA,EACF;AACA,EAAAA,EAAQ,WAAW,CAAAY,MAAY;AAK7B,QAJIZ,EAAQ,YACVA,EAAQ,QAAO,GACfA,EAAQ,UAAU,OAEhBY,KAAY,MAAM;AACpB,YAAMC,IAAmB,MAAMP,EAAK,MAAM,EAAE,KAAK,IAAI;AACrD,eAASQ,IAAI,GAAGA,IAAIR,EAAK,QAAQQ,KAAK,GAAG;AACvC,cAAMJ,IAAMJ,EAAKQ,CAAC;AAClB,YAAIJ,KAAO;AAGX,kBAAQ,OAAOA,GAAG;AAAA,YAChB,KAAK,YACH;AACE,oBAAMK,IAAaL,EAAIE,CAAQ;AAC/B,cAAI,OAAOG,KAAe,eACxBF,EAAiBC,CAAC,IAAIC;AAExB;AAAA,YACF;AAAA,YACF,KAAK,UACH;AACE,cAAAL,EAAI,UAAUE;AACd;AAAA,YACF;AAAA,UAEZ;AAAA,MACM;AACA,MAAAZ,EAAQ,UAAU,MAAM;AACtB,iBAASc,IAAI,GAAGA,IAAIR,EAAK,QAAQQ,KAAK,GAAG;AACvC,gBAAMJ,IAAMJ,EAAKQ,CAAC;AAClB,cAAIJ,KAAO;AAGX,oBAAQ,OAAOA,GAAG;AAAA,cAChB,KAAK,YACH;AACE,sBAAMM,IAAkBH,EAAiBC,CAAC;AAC1C,gBAAI,OAAOE,KAAoB,aAC7BA,EAAe,IAEfN,EAAI,IAAI;AAEV;AAAA,cACF;AAAA,cACF,KAAK,UACH;AACE,gBAAAA,EAAI,UAAU;AACd;AAAA,cACF;AAAA,YAEd;AAAA,QACQ;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","x_google_ignoreList":[0]}
package/dist/index282.js CHANGED
@@ -1,7 +1,10 @@
1
- function i(t) {
2
- return t == null || t.hasAttribute("disabled") || t.getAttribute("aria-disabled") === "true";
1
+ import * as c from "react";
2
+ const e = {};
3
+ function f(r, n) {
4
+ const t = c.useRef(e);
5
+ return t.current === e && (t.current = r(n)), t;
3
6
  }
4
7
  export {
5
- i as isElementDisabled
8
+ f as useRefWithInit
6
9
  };
7
10
  //# sourceMappingURL=index282.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index282.js","sources":["../../../node_modules/@base-ui/utils/isElementDisabled.mjs"],"sourcesContent":["export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}"],"names":["isElementDisabled","element"],"mappings":"AAAO,SAASA,EAAkBC,GAAS;AACzC,SAAOA,KAAW,QAAQA,EAAQ,aAAa,UAAU,KAAKA,EAAQ,aAAa,eAAe,MAAM;AAC1G;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index282.js","sources":["../../../node_modules/@base-ui/utils/useRefWithInit.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}"],"names":["UNINITIALIZED","useRefWithInit","init","initArg","ref","React"],"mappings":";AAGA,MAAMA,IAAgB,CAAA;AAUf,SAASC,EAAeC,GAAMC,GAAS;AAC5C,QAAMC,IAAMC,EAAM,OAAOL,CAAa;AACtC,SAAII,EAAI,YAAYJ,MAClBI,EAAI,UAAUF,EAAKC,CAAO,IAErBC;AACT;","x_google_ignoreList":[0]}
package/dist/index283.js CHANGED
@@ -1,54 +1,9 @@
1
- import * as r from "react";
2
- import { error as l } from "./index352.js";
3
- function _({
4
- controlled: n,
5
- default: o,
6
- name: t,
7
- state: s = "value"
8
- }) {
9
- const {
10
- current: i
11
- } = r.useRef(n !== void 0), [f, e] = r.useState(o), c = i ? n : f;
12
- if (process.env.NODE_ENV !== "production") {
13
- r.useEffect(() => {
14
- i !== (n !== void 0) && l([`A component is changing the ${i ? "" : "un"}controlled ${s} state of ${t} to be ${i ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${t} 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(`
15
- `));
16
- }, [s, t, n]);
17
- const {
18
- current: u
19
- } = r.useRef(o);
20
- r.useEffect(() => {
21
- !i && d(u) !== d(o) && l([`A component is changing the default ${s} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`].join(`
22
- `));
23
- }, [o]);
24
- }
25
- const a = r.useCallback((u) => {
26
- i || e(u);
27
- }, []);
28
- return [c, a];
29
- }
30
- function d(n) {
31
- let o = 0;
32
- const t = /* @__PURE__ */ new WeakMap();
33
- try {
34
- return JSON.stringify(n, function(f, e) {
35
- if (!(f === "_owner" && this != null && typeof this == "object" && "$$typeof" in this)) {
36
- if (typeof e == "bigint")
37
- return `__bigint__:${e}`;
38
- if (e !== null && typeof e == "object") {
39
- const c = t.get(e);
40
- if (c !== void 0)
41
- return `__object__:${c}`;
42
- t.set(e, o), o += 1;
43
- }
44
- return e;
45
- }
46
- }) ?? `__top__:${typeof n}`;
47
- } catch {
48
- return "__unserializable__";
49
- }
1
+ import * as t from "react";
2
+ function n(r) {
3
+ const e = t.useRef(!0);
4
+ e.current && (e.current = !1, r());
50
5
  }
51
6
  export {
52
- _ as useControlled
7
+ n as useOnFirstRender
53
8
  };
54
9
  //# sourceMappingURL=index283.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index283.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]}
1
+ {"version":3,"file":"index283.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]}
package/dist/index284.js CHANGED
@@ -1,7 +1,15 @@
1
- import * as o from "react";
2
- const t = () => {
3
- }, e = typeof document < "u" ? o.useLayoutEffect : t;
1
+ import * as u from "react";
2
+ function s(r) {
3
+ const [t, e] = u.useState({
4
+ current: r,
5
+ previous: null
6
+ });
7
+ return r !== t.current && e({
8
+ current: r,
9
+ previous: t.current
10
+ }), t.previous;
11
+ }
4
12
  export {
5
- e as useIsoLayoutEffect
13
+ s as usePreviousValue
6
14
  };
7
15
  //# sourceMappingURL=index284.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index284.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]}
1
+ {"version":3,"file":"index284.js","sources":["../../../node_modules/@base-ui/utils/usePreviousValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a previous value of its argument.\n * @param value Current value.\n * @returns Previous value, or null if there is no previous value.\n */\nexport function usePreviousValue(value) {\n const [state, setState] = React.useState({\n current: value,\n previous: null\n });\n if (value !== state.current) {\n setState({\n current: value,\n previous: state.current\n });\n }\n return state.previous;\n}"],"names":["usePreviousValue","value","state","setState","React"],"mappings":";AASO,SAASA,EAAiBC,GAAO;AACtC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAM,SAAS;AAAA,IACvC,SAASH;AAAA,IACT,UAAU;AAAA,EACd,CAAG;AACD,SAAIA,MAAUC,EAAM,WAClBC,EAAS;AAAA,IACP,SAASF;AAAA,IACT,UAAUC,EAAM;AAAA,EACtB,CAAK,GAEIA,EAAM;AACf;","x_google_ignoreList":[0]}
package/dist/index285.js CHANGED
@@ -1,33 +1,7 @@
1
- import { SafeReact as a } from "./index353.js";
2
- import { useRefWithInit as c } from "./index279.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 i(t) {
2
+ return t == null || t.hasAttribute("disabled") || t.getAttribute("aria-disabled") === "true";
29
3
  }
30
4
  export {
31
- i as useStableCallback
5
+ i as isElementDisabled
32
6
  };
33
7
  //# sourceMappingURL=index285.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index285.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":"index285.js","sources":["../../../node_modules/@base-ui/utils/isElementDisabled.mjs"],"sourcesContent":["export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}"],"names":["isElementDisabled","element"],"mappings":"AAAO,SAASA,EAAkBC,GAAS;AACzC,SAAOA,KAAW,QAAQA,EAAQ,aAAa,UAAU,KAAKA,EAAQ,aAAa,eAAe,MAAM;AAC1G;","x_google_ignoreList":[0]}
package/dist/index286.js CHANGED
@@ -1,20 +1,54 @@
1
- import { useIsoLayoutEffect as r } from "./index284.js";
2
- import { useRefWithInit as n } from "./index279.js";
3
- function s(e) {
4
- const t = n(f, e).current;
5
- return t.next = e, r(t.effect), t;
1
+ import * as r from "react";
2
+ import { error as l } from "./index352.js";
3
+ function _({
4
+ controlled: n,
5
+ default: o,
6
+ name: t,
7
+ state: s = "value"
8
+ }) {
9
+ const {
10
+ current: i
11
+ } = r.useRef(n !== void 0), [f, e] = r.useState(o), c = i ? n : f;
12
+ if (process.env.NODE_ENV !== "production") {
13
+ r.useEffect(() => {
14
+ i !== (n !== void 0) && l([`A component is changing the ${i ? "" : "un"}controlled ${s} state of ${t} to be ${i ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${t} 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(`
15
+ `));
16
+ }, [s, t, n]);
17
+ const {
18
+ current: u
19
+ } = r.useRef(o);
20
+ r.useEffect(() => {
21
+ !i && d(u) !== d(o) && l([`A component is changing the default ${s} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`].join(`
22
+ `));
23
+ }, [o]);
24
+ }
25
+ const a = r.useCallback((u) => {
26
+ i || e(u);
27
+ }, []);
28
+ return [c, a];
6
29
  }
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;
30
+ function d(n) {
31
+ let o = 0;
32
+ const t = /* @__PURE__ */ new WeakMap();
33
+ try {
34
+ return JSON.stringify(n, function(f, e) {
35
+ if (!(f === "_owner" && this != null && typeof this == "object" && "$$typeof" in this)) {
36
+ if (typeof e == "bigint")
37
+ return `__bigint__:${e}`;
38
+ if (e !== null && typeof e == "object") {
39
+ const c = t.get(e);
40
+ if (c !== void 0)
41
+ return `__object__:${c}`;
42
+ t.set(e, o), o += 1;
43
+ }
44
+ return e;
45
+ }
46
+ }) ?? `__top__:${typeof n}`;
47
+ } catch {
48
+ return "__unserializable__";
49
+ }
16
50
  }
17
51
  export {
18
- s as useValueAsRef
52
+ _ as useControlled
19
53
  };
20
54
  //# sourceMappingURL=index286.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index286.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]}
1
+ {"version":3,"file":"index286.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/index287.js CHANGED
@@ -1,9 +1,7 @@
1
- function e() {
2
- }
3
- const t = Object.freeze([]), c = Object.freeze({});
1
+ import * as o from "react";
2
+ const t = () => {
3
+ }, e = typeof document < "u" ? o.useLayoutEffect : t;
4
4
  export {
5
- t as EMPTY_ARRAY,
6
- c as EMPTY_OBJECT,
7
- e as NOOP
5
+ e as useIsoLayoutEffect
8
6
  };
9
7
  //# sourceMappingURL=index287.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index287.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]}
1
+ {"version":3,"file":"index287.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/index288.js CHANGED
@@ -1,25 +1,33 @@
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;
1
+ import { SafeReact as a } from "./index353.js";
2
+ import { useRefWithInit as c } from "./index282.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;
12
11
  }
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;
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
+ );
18
29
  }
19
30
  export {
20
- c as SelectFloatingContext,
21
- n as SelectRootContext,
22
- i as useSelectFloatingContext,
23
- s as useSelectRootContext
31
+ i as useStableCallback
24
32
  };
25
33
  //# sourceMappingURL=index288.js.map