@rpcbase/ui 0.279.0 → 0.281.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 (518) hide show
  1. package/dist/components/AddressAutocompleteInput/index.d.ts +1 -1
  2. package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -1
  3. package/dist/components/ApplePayButton/index.d.ts +1 -1
  4. package/dist/components/ApplePayButton/index.d.ts.map +1 -1
  5. package/dist/components/Checkbox/index.d.ts +1 -1
  6. package/dist/components/Checkbox/index.d.ts.map +1 -1
  7. package/dist/components/DayPickerField/index.d.ts +2 -2
  8. package/dist/components/DayPickerField/index.d.ts.map +1 -1
  9. package/dist/components/Dialog/index.d.ts +9 -9
  10. package/dist/components/Dialog/index.d.ts.map +1 -1
  11. package/dist/components/FilesUploadField/index.d.ts +1 -1
  12. package/dist/components/FilesUploadField/index.d.ts.map +1 -1
  13. package/dist/components/HourPickerField/index.d.ts +2 -2
  14. package/dist/components/HourPickerField/index.d.ts.map +1 -1
  15. package/dist/components/I18nField/index.d.ts +1 -1
  16. package/dist/components/I18nField/index.d.ts.map +1 -1
  17. package/dist/components/Image/index.d.ts +1 -1
  18. package/dist/components/Image/index.d.ts.map +1 -1
  19. package/dist/components/ImagesField/index.d.ts +1 -1
  20. package/dist/components/ImagesField/index.d.ts.map +1 -1
  21. package/dist/components/Input/index.d.ts +1 -1
  22. package/dist/components/Input/index.d.ts.map +1 -1
  23. package/dist/components/Notifications/NotificationsButton.d.ts +1 -1
  24. package/dist/components/Notifications/NotificationsButton.d.ts.map +1 -1
  25. package/dist/components/Notifications/NotificationsDrawer.d.ts +1 -1
  26. package/dist/components/Notifications/NotificationsDrawer.d.ts.map +1 -1
  27. package/dist/components/Notifications/NotificationsSettings.d.ts +1 -1
  28. package/dist/components/Notifications/NotificationsSettings.d.ts.map +1 -1
  29. package/dist/components/PhoneNumberInput/suggestions.d.ts +3 -3
  30. package/dist/components/PhoneNumberInput/suggestions.d.ts.map +1 -1
  31. package/dist/components/Select/index.d.ts +2 -2
  32. package/dist/components/Select/index.d.ts.map +1 -1
  33. package/dist/components/header/MenuPopover/index.d.ts +1 -1
  34. package/dist/components/header/MenuPopover/index.d.ts.map +1 -1
  35. package/dist/index.js +12 -12
  36. package/dist/index10.js +6 -4
  37. package/dist/index10.js.map +1 -1
  38. package/dist/index12.js.map +1 -1
  39. package/dist/index13.js.map +1 -1
  40. package/dist/index14.js.map +1 -1
  41. package/dist/index15.js.map +1 -1
  42. package/dist/index154.js +19 -7
  43. package/dist/index154.js.map +1 -1
  44. package/dist/index16.js +36 -45
  45. package/dist/index16.js.map +1 -1
  46. package/dist/index160.js +3 -3
  47. package/dist/index160.js.map +1 -1
  48. package/dist/index166.js +5 -5
  49. package/dist/index166.js.map +1 -1
  50. package/dist/index172.js +27 -25
  51. package/dist/index172.js.map +1 -1
  52. package/dist/index181.js +1 -1
  53. package/dist/index181.js.map +1 -1
  54. package/dist/index182.js +145 -162
  55. package/dist/index182.js.map +1 -1
  56. package/dist/index184.js +6 -8
  57. package/dist/index184.js.map +1 -1
  58. package/dist/index186.js +2 -8
  59. package/dist/index186.js.map +1 -1
  60. package/dist/index19.js +1 -1
  61. package/dist/index19.js.map +1 -1
  62. package/dist/index195.js +1 -1
  63. package/dist/index195.js.map +1 -1
  64. package/dist/index196.js +2 -2
  65. package/dist/index196.js.map +1 -1
  66. package/dist/index197.js +1 -1
  67. package/dist/index197.js.map +1 -1
  68. package/dist/index198.js +16 -15
  69. package/dist/index198.js.map +1 -1
  70. package/dist/index199.js +13 -17
  71. package/dist/index199.js.map +1 -1
  72. package/dist/index200.js +3 -2
  73. package/dist/index200.js.map +1 -1
  74. package/dist/index207.js +5 -90
  75. package/dist/index207.js.map +1 -1
  76. package/dist/index208.js +15 -3
  77. package/dist/index208.js.map +1 -1
  78. package/dist/index209.js +102 -22
  79. package/dist/index209.js.map +1 -1
  80. package/dist/index210.js +3 -28
  81. package/dist/index210.js.map +1 -1
  82. package/dist/index211.js +23 -19
  83. package/dist/index211.js.map +1 -1
  84. package/dist/index212.js +27 -6
  85. package/dist/index212.js.map +1 -1
  86. package/dist/index213.js +19 -14
  87. package/dist/index213.js.map +1 -1
  88. package/dist/index214.js +5 -6
  89. package/dist/index214.js.map +1 -1
  90. package/dist/index215.js +14 -26
  91. package/dist/index215.js.map +1 -1
  92. package/dist/index216.js +7 -22
  93. package/dist/index216.js.map +1 -1
  94. package/dist/index217.js +27 -6
  95. package/dist/index217.js.map +1 -1
  96. package/dist/index218.js +23 -5
  97. package/dist/index218.js.map +1 -1
  98. package/dist/index219.js +6 -4
  99. package/dist/index219.js.map +1 -1
  100. package/dist/index220.js +5 -4
  101. package/dist/index220.js.map +1 -1
  102. package/dist/index221.js +4 -24
  103. package/dist/index221.js.map +1 -1
  104. package/dist/index222.js +4 -3
  105. package/dist/index222.js.map +1 -1
  106. package/dist/index223.js +21 -21
  107. package/dist/index223.js.map +1 -1
  108. package/dist/index224.js +3 -23
  109. package/dist/index224.js.map +1 -1
  110. package/dist/index225.js +23 -6
  111. package/dist/index225.js.map +1 -1
  112. package/dist/index226.js +22 -9
  113. package/dist/index226.js.map +1 -1
  114. package/dist/index227.js +5 -17
  115. package/dist/index227.js.map +1 -1
  116. package/dist/index228.js +8 -49
  117. package/dist/index228.js.map +1 -1
  118. package/dist/index229.js +18 -5
  119. package/dist/index229.js.map +1 -1
  120. package/dist/index230.js +50 -19
  121. package/dist/index230.js.map +1 -1
  122. package/dist/index231.js +20 -28
  123. package/dist/index231.js.map +1 -1
  124. package/dist/index232.js +27 -104
  125. package/dist/index232.js.map +1 -1
  126. package/dist/index233.js +98 -33
  127. package/dist/index233.js.map +1 -1
  128. package/dist/index234.js +28 -113
  129. package/dist/index234.js.map +1 -1
  130. package/dist/index235.js +117 -11
  131. package/dist/index235.js.map +1 -1
  132. package/dist/index236.js +12 -4
  133. package/dist/index236.js.map +1 -1
  134. package/dist/index237.js +4 -15
  135. package/dist/index237.js.map +1 -1
  136. package/dist/index238.js +13 -62
  137. package/dist/index238.js.map +1 -1
  138. package/dist/index239.js +64 -9
  139. package/dist/index239.js.map +1 -1
  140. package/dist/index240.js +10 -106
  141. package/dist/index240.js.map +1 -1
  142. package/dist/index241.js +107 -13
  143. package/dist/index241.js.map +1 -1
  144. package/dist/index242.js +16 -13
  145. package/dist/index242.js.map +1 -1
  146. package/dist/index243.js +13 -5
  147. package/dist/index243.js.map +1 -1
  148. package/dist/index244.js +4 -316
  149. package/dist/index244.js.map +1 -1
  150. package/dist/index245.js +315 -58
  151. package/dist/index245.js.map +1 -1
  152. package/dist/index246.js +58 -223
  153. package/dist/index246.js.map +1 -1
  154. package/dist/index247.js +215 -318
  155. package/dist/index247.js.map +1 -1
  156. package/dist/index248.js +250 -306
  157. package/dist/index248.js.map +1 -1
  158. package/dist/index249.js +308 -173
  159. package/dist/index249.js.map +1 -1
  160. package/dist/index250.js +178 -7
  161. package/dist/index250.js.map +1 -1
  162. package/dist/index251.js +8 -15
  163. package/dist/index251.js.map +1 -1
  164. package/dist/index252.js +41 -5
  165. package/dist/index252.js.map +1 -1
  166. package/dist/index253.js +46 -38
  167. package/dist/index253.js.map +1 -1
  168. package/dist/index254.js +7 -50
  169. package/dist/index254.js.map +1 -1
  170. package/dist/index255.js +49 -6
  171. package/dist/index255.js.map +1 -1
  172. package/dist/index256.js +48 -46
  173. package/dist/index256.js.map +1 -1
  174. package/dist/index257.js +6 -51
  175. package/dist/index257.js.map +1 -1
  176. package/dist/index258.js +10 -9
  177. package/dist/index258.js.map +1 -1
  178. package/dist/index259.js +60 -8
  179. package/dist/index259.js.map +1 -1
  180. package/dist/index26.js.map +1 -1
  181. package/dist/index260.js +41 -60
  182. package/dist/index260.js.map +1 -1
  183. package/dist/index261.js +88 -34
  184. package/dist/index261.js.map +1 -1
  185. package/dist/index262.js +47 -94
  186. package/dist/index262.js.map +1 -1
  187. package/dist/index263.js +36 -49
  188. package/dist/index263.js.map +1 -1
  189. package/dist/index264.js +45 -32
  190. package/dist/index264.js.map +1 -1
  191. package/dist/index265.js +47 -46
  192. package/dist/index265.js.map +1 -1
  193. package/dist/index266.js +18 -48
  194. package/dist/index266.js.map +1 -1
  195. package/dist/index267.js +174 -15
  196. package/dist/index267.js.map +1 -1
  197. package/dist/index268.js +47 -169
  198. package/dist/index268.js.map +1 -1
  199. package/dist/index269.js +17 -34
  200. package/dist/index269.js.map +1 -1
  201. package/dist/index270.js +59 -10
  202. package/dist/index270.js.map +1 -1
  203. package/dist/index271.js +10 -66
  204. package/dist/index271.js.map +1 -1
  205. package/dist/index272.js +4 -4
  206. package/dist/index273.js +71 -69
  207. package/dist/index273.js.map +1 -1
  208. package/dist/index274.js +158 -152
  209. package/dist/index274.js.map +1 -1
  210. package/dist/index275.js +7 -13
  211. package/dist/index275.js.map +1 -1
  212. package/dist/index276.js +12 -5
  213. package/dist/index276.js.map +1 -1
  214. package/dist/index277.js +12 -6
  215. package/dist/index277.js.map +1 -1
  216. package/dist/index278.js +11 -12
  217. package/dist/index278.js.map +1 -1
  218. package/dist/index279.js +65 -9
  219. package/dist/index279.js.map +1 -1
  220. package/dist/index280.js +6 -74
  221. package/dist/index280.js.map +1 -1
  222. package/dist/index281.js +25 -6
  223. package/dist/index281.js.map +1 -1
  224. package/dist/index282.js +24 -24
  225. package/dist/index282.js.map +1 -1
  226. package/dist/index283.js +125 -24
  227. package/dist/index283.js.map +1 -1
  228. package/dist/index284.js +52 -115
  229. package/dist/index284.js.map +1 -1
  230. package/dist/index285.js +59 -55
  231. package/dist/index285.js.map +1 -1
  232. package/dist/index286.js +48 -61
  233. package/dist/index286.js.map +1 -1
  234. package/dist/index287.js +5 -48
  235. package/dist/index287.js.map +1 -1
  236. package/dist/index288.js +14 -8
  237. package/dist/index288.js.map +1 -1
  238. package/dist/index289.js +18 -14
  239. package/dist/index289.js.map +1 -1
  240. package/dist/index290.js +10 -17
  241. package/dist/index290.js.map +1 -1
  242. package/dist/index291.js +23 -11
  243. package/dist/index291.js.map +1 -1
  244. package/dist/index292.js +52 -25
  245. package/dist/index292.js.map +1 -1
  246. package/dist/index293.js +6 -52
  247. package/dist/index293.js.map +1 -1
  248. package/dist/index294.js +137 -5
  249. package/dist/index294.js.map +1 -1
  250. package/dist/index295.js +59 -149
  251. package/dist/index295.js.map +1 -1
  252. package/dist/index296.js +90 -49
  253. package/dist/index296.js.map +1 -1
  254. package/dist/index297.js +11 -117
  255. package/dist/index297.js.map +1 -1
  256. package/dist/index298.js +863 -11
  257. package/dist/index298.js.map +1 -1
  258. package/dist/index299.js +21 -865
  259. package/dist/index299.js.map +1 -1
  260. package/dist/index3.js.map +1 -1
  261. package/dist/index300.js +417 -27
  262. package/dist/index300.js.map +1 -1
  263. package/dist/index301.js +774 -483
  264. package/dist/index301.js.map +1 -1
  265. package/dist/index302.js +7436 -803
  266. package/dist/index302.js.map +1 -1
  267. package/dist/index303.js +7 -7429
  268. package/dist/index303.js.map +1 -1
  269. package/dist/index304.js +12 -6
  270. package/dist/index304.js.map +1 -1
  271. package/dist/index305.js +5 -12
  272. package/dist/index305.js.map +1 -1
  273. package/dist/index306.js +3 -3
  274. package/dist/index306.js.map +1 -1
  275. package/dist/index307.js +469 -5
  276. package/dist/index307.js.map +1 -1
  277. package/dist/index308.js +32 -464
  278. package/dist/index308.js.map +1 -1
  279. package/dist/index309.js +18 -36
  280. package/dist/index309.js.map +1 -1
  281. package/dist/index310.js +28 -17
  282. package/dist/index310.js.map +1 -1
  283. package/dist/index311.js +4 -30
  284. package/dist/index311.js.map +1 -1
  285. package/dist/index312.js +59 -4
  286. package/dist/index312.js.map +1 -1
  287. package/dist/index313.js +11 -59
  288. package/dist/index313.js.map +1 -1
  289. package/dist/index314.js +5 -9
  290. package/dist/index314.js.map +1 -1
  291. package/dist/index315.js +9 -5
  292. package/dist/index315.js.map +1 -1
  293. package/dist/index316.js +12 -9
  294. package/dist/index316.js.map +1 -1
  295. package/dist/index317.js +3 -13
  296. package/dist/index317.js.map +1 -1
  297. package/dist/index318.js +17 -3
  298. package/dist/index318.js.map +1 -1
  299. package/dist/index319.js +23 -14
  300. package/dist/index319.js.map +1 -1
  301. package/dist/index320.js +39 -23
  302. package/dist/index320.js.map +1 -1
  303. package/dist/index321.js +5 -41
  304. package/dist/index321.js.map +1 -1
  305. package/dist/index322.js +25 -5
  306. package/dist/index322.js.map +1 -1
  307. package/dist/index323.js +18 -24
  308. package/dist/index323.js.map +1 -1
  309. package/dist/index324.js +32 -17
  310. package/dist/index324.js.map +1 -1
  311. package/dist/index325.js +5 -34
  312. package/dist/index325.js.map +1 -1
  313. package/dist/index326.js +9 -5
  314. package/dist/index326.js.map +1 -1
  315. package/dist/index327.js +7 -8
  316. package/dist/index327.js.map +1 -1
  317. package/dist/index328.js +9 -8
  318. package/dist/index328.js.map +1 -1
  319. package/dist/index329.js +10 -9
  320. package/dist/index329.js.map +1 -1
  321. package/dist/index330.js +7 -10
  322. package/dist/index330.js.map +1 -1
  323. package/dist/index331.js +75 -7
  324. package/dist/index331.js.map +1 -1
  325. package/dist/index332.js +153 -66
  326. package/dist/index332.js.map +1 -1
  327. package/dist/index333.js +99 -147
  328. package/dist/index333.js.map +1 -1
  329. package/dist/index334.js +13 -113
  330. package/dist/index334.js.map +1 -1
  331. package/dist/index335.js +78 -12
  332. package/dist/index335.js.map +1 -1
  333. package/dist/index336.js +23 -57
  334. package/dist/index336.js.map +1 -1
  335. package/dist/index337.js +12 -45
  336. package/dist/index337.js.map +1 -1
  337. package/dist/index338.js +16 -13
  338. package/dist/index338.js.map +1 -1
  339. package/dist/index339.js +100 -15
  340. package/dist/index339.js.map +1 -1
  341. package/dist/index340.js +50 -95
  342. package/dist/index340.js.map +1 -1
  343. package/dist/index341.js +57 -5
  344. package/dist/index341.js.map +1 -1
  345. package/dist/index342.js +41 -78
  346. package/dist/index342.js.map +1 -1
  347. package/dist/index343.js +100 -58
  348. package/dist/index343.js.map +1 -1
  349. package/dist/index344.js +46 -104
  350. package/dist/index344.js.map +1 -1
  351. package/dist/index345.js +39 -51
  352. package/dist/index345.js.map +1 -1
  353. package/dist/index346.js +143 -42
  354. package/dist/index346.js.map +1 -1
  355. package/dist/index347.js +122 -123
  356. package/dist/index347.js.map +1 -1
  357. package/dist/index348.js +224 -108
  358. package/dist/index348.js.map +1 -1
  359. package/dist/index349.js +158 -174
  360. package/dist/index349.js.map +1 -1
  361. package/dist/index350.js +213 -144
  362. package/dist/index350.js.map +1 -1
  363. package/dist/index351.js +5 -309
  364. package/dist/index351.js.map +1 -1
  365. package/dist/index352.js +6 -5
  366. package/dist/index352.js.map +1 -1
  367. package/dist/index353.js +7 -6
  368. package/dist/index353.js.map +1 -1
  369. package/dist/index354.js +4 -5
  370. package/dist/index354.js.map +1 -1
  371. package/dist/index355.js +4 -4
  372. package/dist/index355.js.map +1 -1
  373. package/dist/index356.js +21 -6
  374. package/dist/index356.js.map +1 -1
  375. package/dist/index357.js +10 -21
  376. package/dist/index357.js.map +1 -1
  377. package/dist/index358.js +128 -10
  378. package/dist/index358.js.map +1 -1
  379. package/dist/index359.js +36 -122
  380. package/dist/index359.js.map +1 -1
  381. package/dist/index360.js +64 -38
  382. package/dist/index360.js.map +1 -1
  383. package/dist/index361.js +115 -66
  384. package/dist/index361.js.map +1 -1
  385. package/dist/index362.js +485 -112
  386. package/dist/index362.js.map +1 -1
  387. package/dist/index363.js +7 -490
  388. package/dist/index363.js.map +1 -1
  389. package/dist/index364.js +1 -1
  390. package/dist/index364.js.map +1 -1
  391. package/dist/index367.js +2 -9
  392. package/dist/index367.js.map +1 -1
  393. package/dist/index368.js +26 -5
  394. package/dist/index368.js.map +1 -1
  395. package/dist/index369.js +43 -27
  396. package/dist/index369.js.map +1 -1
  397. package/dist/index370.js +35 -46
  398. package/dist/index370.js.map +1 -1
  399. package/dist/index371.js +16 -27
  400. package/dist/index371.js.map +1 -1
  401. package/dist/index372.js +41 -16
  402. package/dist/index372.js.map +1 -1
  403. package/dist/index373.js +11 -42
  404. package/dist/index373.js.map +1 -1
  405. package/dist/index374.js +10 -14
  406. package/dist/index374.js.map +1 -1
  407. package/dist/index375.js +51 -9
  408. package/dist/index375.js.map +1 -1
  409. package/dist/index376.js +40 -53
  410. package/dist/index376.js.map +1 -1
  411. package/dist/index377.js +17 -43
  412. package/dist/index377.js.map +1 -1
  413. package/dist/index378.js +4 -15
  414. package/dist/index378.js.map +1 -1
  415. package/dist/index379.js +4 -4
  416. package/dist/index379.js.map +1 -1
  417. package/dist/index380.js +9 -4
  418. package/dist/index380.js.map +1 -1
  419. package/dist/index381.js +304 -9
  420. package/dist/index381.js.map +1 -1
  421. package/dist/index382.js +4 -339
  422. package/dist/index382.js.map +1 -1
  423. package/dist/index383.js +21 -5
  424. package/dist/index383.js.map +1 -1
  425. package/dist/index384.js +106 -16
  426. package/dist/index384.js.map +1 -1
  427. package/dist/index385.js +19 -109
  428. package/dist/index385.js.map +1 -1
  429. package/dist/index386.js +18 -18
  430. package/dist/index386.js.map +1 -1
  431. package/dist/index387.js +14 -19
  432. package/dist/index387.js.map +1 -1
  433. package/dist/index388.js +12 -4
  434. package/dist/index388.js.map +1 -1
  435. package/dist/index389.js +113 -20
  436. package/dist/index389.js.map +1 -1
  437. package/dist/index390.js +5 -11
  438. package/dist/index390.js.map +1 -1
  439. package/dist/index391.js +28 -85
  440. package/dist/index391.js.map +1 -1
  441. package/dist/index392.js +9 -9
  442. package/dist/index392.js.map +1 -1
  443. package/dist/index393.js +6 -29
  444. package/dist/index393.js.map +1 -1
  445. package/dist/index394.js +254 -10
  446. package/dist/index394.js.map +1 -1
  447. package/dist/index395.js +12 -6
  448. package/dist/index395.js.map +1 -1
  449. package/dist/index396.js +11 -252
  450. package/dist/index396.js.map +1 -1
  451. package/dist/index397.js +6 -11
  452. package/dist/index397.js.map +1 -1
  453. package/dist/index398.js +22 -10
  454. package/dist/index398.js.map +1 -1
  455. package/dist/index399.js +22 -6
  456. package/dist/index399.js.map +1 -1
  457. package/dist/index4.js.map +1 -1
  458. package/dist/index400.js +103 -21
  459. package/dist/index400.js.map +1 -1
  460. package/dist/index401.js +15 -23
  461. package/dist/index401.js.map +1 -1
  462. package/dist/index402.js +11 -108
  463. package/dist/index402.js.map +1 -1
  464. package/dist/index403.js +10 -15
  465. package/dist/index403.js.map +1 -1
  466. package/dist/index404.js +237 -10
  467. package/dist/index404.js.map +1 -1
  468. package/dist/index405.js +27 -9
  469. package/dist/index405.js.map +1 -1
  470. package/dist/index406.js +33 -238
  471. package/dist/index406.js.map +1 -1
  472. package/dist/index407.js +11 -30
  473. package/dist/index407.js.map +1 -1
  474. package/dist/index408.js +118 -48
  475. package/dist/index408.js.map +1 -1
  476. package/dist/index409.js +39 -11
  477. package/dist/index409.js.map +1 -1
  478. package/dist/index410.js +18 -121
  479. package/dist/index410.js.map +1 -1
  480. package/dist/index411.js +11 -39
  481. package/dist/index411.js.map +1 -1
  482. package/dist/index412.js +21 -24
  483. package/dist/index412.js.map +1 -1
  484. package/dist/index413.js +17 -11
  485. package/dist/index413.js.map +1 -1
  486. package/dist/index414.js +10 -20
  487. package/dist/index414.js.map +1 -1
  488. package/dist/index415.js +4 -17
  489. package/dist/index415.js.map +1 -1
  490. package/dist/index416.js +300 -14
  491. package/dist/index416.js.map +1 -1
  492. package/dist/index417.js +61 -323
  493. package/dist/index417.js.map +1 -1
  494. package/dist/index418.js +4 -63
  495. package/dist/index418.js.map +1 -1
  496. package/dist/index419.js +28 -4
  497. package/dist/index419.js.map +1 -1
  498. package/dist/index420.js +468 -25
  499. package/dist/index420.js.map +1 -1
  500. package/dist/index421.js +250 -452
  501. package/dist/index421.js.map +1 -1
  502. package/dist/index6.js.map +1 -1
  503. package/dist/index7.js +91 -133
  504. package/dist/index7.js.map +1 -1
  505. package/dist/index70.js +2 -2
  506. package/dist/index70.js.map +1 -1
  507. package/dist/index71.js +11 -4
  508. package/dist/index71.js.map +1 -1
  509. package/dist/index72.js +1 -3
  510. package/dist/index72.js.map +1 -1
  511. package/dist/index8.js.map +1 -1
  512. package/dist/index9.js +16 -19
  513. package/dist/index9.js.map +1 -1
  514. package/dist/test-only/TestCoverageTestBadge/index.d.ts +1 -1
  515. package/dist/test-only/TestCoverageTestBadge/index.d.ts.map +1 -1
  516. package/package.json +15 -15
  517. package/dist/index422.js +0 -272
  518. package/dist/index422.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index274.js","names":["React","REASONS.listNavigation","REASONS.focusOut"],"sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"../utils/constants.mjs\";\nimport { activeElement, contains, getFloatingFocusElement, getTarget, isTypeableCombobox } from \"../utils/element.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nexport const ESCAPE = 'Escape';\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl, grid) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && grid) {\n return key === ESCAPE;\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nexport function useListNavigation(context, props) {\n const {\n listRef,\n activeIndex,\n onNavigate: onNavigateProp = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loopFocus = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n parentOrientation,\n id,\n resetOnPointerLeave = true,\n externalTree,\n grid: navigateGrid\n } = props;\n const isGrid = navigateGrid != null;\n if (process.env.NODE_ENV !== 'production') {\n if (allowEscape) {\n if (!loopFocus) {\n console.warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n console.warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && isGrid) {\n console.warn('In grid list navigation mode, the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const floatingFocusElement = getFloatingFocusElement(floatingElement);\n const typeableComboboxReference = isTypeableCombobox(domReferenceElement);\n const floatingFocusElementRef = useValueAsRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree(externalTree);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex ?? -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const onNavigate = useStableCallback(event => {\n onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);\n });\n const previousMountedRef = React.useRef(!!floatingElement);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const cancelQueuedFocusRef = React.useRef(null);\n const disabledIndicesRef = useValueAsRef(disabledIndices);\n const latestOpenRef = useValueAsRef(open);\n const selectedIndexRef = useValueAsRef(selectedIndex);\n const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);\n const focusFrame = useAnimationFrame();\n const waitForListPopulatedFrame = useAnimationFrame();\n const focusItem = useStableCallback(() => {\n function runFocus(item) {\n if (virtual) {\n tree?.events.emit('virtualfocus', item);\n } else {\n cancelQueuedFocusRef.current = enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? callback => callback() : callback => focusFrame.request(callback);\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) {\n return;\n }\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const shouldScrollIntoView =\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView?.({\n block: 'nearest',\n inline: 'nearest'\n });\n }\n });\n });\n useIsoLayoutEffect(() => {\n dataRef.current.orientation = orientation;\n }, [dataRef, orientation]);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (open && floatingElement) {\n indexRef.current = selectedIndex ?? -1;\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Reset the active index when the list is no longer open and mounted (closing or\n // unmounting). `onNavigate` is a stable callback that always forwards to the latest\n // `onNavigate` prop.\n indexRef.current = -1;\n onNavigate();\n }\n }, [enabled, open, floatingElement, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (!open) {\n forceSyncFocusRef.current = false;\n return;\n }\n if (!floatingElement) {\n return;\n }\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? callback => waitForListPopulatedFrame.request(callback) : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs += 1;\n } else {\n // Initially focus the first non-disabled item. `disabledIndices` is deliberately\n // omitted here so attribute-disabled items (`disabled`/`aria-disabled`) are skipped\n // on open even when the consumer passes an empty `disabledIndices` array. Passing it\n // would regress that behavior (see mui/base-ui#2604).\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, floatingElement, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useIsoLayoutEffect(() => {\n if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = nodes.find(node => node.id === parentId)?.context?.elements.floating;\n // `floatingElement` is null here (see the guard above), so resolve the owner document from an\n // in-DOM element for realm-safety (shadow DOM/iframes): the reference element, falling back to\n // the parent floating element when the reference is virtual (`domReferenceElement` is null).\n const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);\n useIsoLayoutEffect(() => {\n previousOpenRef.current = open;\n previousMountedRef.current = !!floatingElement;\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n const hasActiveIndex = activeIndex != null;\n const syncCurrentTarget = useStableCallback(event => {\n if (!latestOpenRef.current) {\n return;\n }\n const index = listRef.current.indexOf(event.currentTarget);\n if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const getParentOrientation = useStableCallback(() => {\n return parentOrientation ?? tree?.nodesRef.current.find(node => node.id === parentId)?.context?.dataRef?.current.orientation;\n });\n const getMinEnabledIndex = useStableCallback(() => {\n return getMinListIndex(listRef, disabledIndicesRef.current);\n });\n const commonOnKeyDown = useStableCallback(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n store.setOpen(false, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n if (virtual) {\n tree?.events.emit('virtualfocus', domReferenceElement);\n } else {\n domReferenceElement.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(event);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(event);\n }\n }\n\n // Grid navigation is injected by grid-capable consumers so non-grid\n // consumers (menu, select) tree-shake the grid helpers out.\n if (navigateGrid != null) {\n const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);\n if (index != null) {\n indexRef.current = index;\n onNavigate(event);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(event);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loopFocus) {\n if (currentIndex >= maxIndex) {\n if (allowEscape && currentIndex !== listRef.current.length) {\n indexRef.current = -1;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = minIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else if (loopFocus) {\n if (currentIndex <= minIndex) {\n if (allowEscape && currentIndex !== -1) {\n indexRef.current = listRef.current.length;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = maxIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n if (isIndexOutOfListBounds(listRef.current, indexRef.current)) {\n indexRef.current = -1;\n }\n onNavigate(event);\n }\n });\n const item = React.useMemo(() => {\n const itemProps = {\n onFocus(event) {\n forceSyncFocusRef.current = true;\n syncCurrentTarget(event);\n },\n onClick: ({\n currentTarget\n }) => currentTarget.focus({\n preventScroll: true\n }),\n // Safari\n onMouseMove(event) {\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(event);\n }\n },\n onPointerLeave(event) {\n if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n const relatedTarget = event.relatedTarget;\n if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {\n return;\n }\n if (!resetOnPointerLeaveRef.current) {\n return;\n }\n cancelQueuedFocusRef.current?.();\n cancelQueuedFocusRef.current = null;\n indexRef.current = -1;\n onNavigate(event);\n if (!virtual) {\n const floatingFocusEl = floatingFocusElementRef.current;\n const activeEl = activeElement(ownerDocument(floatingFocusEl));\n if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {\n floatingFocusEl.focus({\n preventScroll: true\n });\n }\n }\n }\n };\n return itemProps;\n }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': `${id}-${activeIndex}`\n };\n }, [virtual, open, hasActiveIndex, id, activeIndex]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown(event) {\n // Close submenu on Shift+Tab\n if (event.key === 'Tab' && event.shiftKey && open && !virtual) {\n // If the event originated from within a nested element (e.g., a Dialog opened from\n // within the menu), don't close the menu. The nested element has its own focus\n // management and should handle the Tab key.\n const target = getTarget(event.nativeEvent);\n if (target && !contains(floatingFocusElementRef.current, target)) {\n return;\n }\n stopEvent(event);\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n domReferenceElement.focus();\n }\n return;\n }\n commonOnKeyDown(event);\n },\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, orientation, typeableComboboxReference, store, open, virtual, domReferenceElement]);\n const trigger = React.useMemo(() => {\n function openOnNavigationKeyDown(event) {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = !virtual;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n onKeyDown(event) {\n // non-reactive open state (to prevent re-creation of the handler)\n const currentOpen = store.select('open');\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && currentOpen) {\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {\n return undefined;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (currentOpen) {\n indexRef.current = getMinEnabledIndex();\n onNavigate(event);\n } else {\n openOnNavigationKeyDown(event);\n }\n }\n return undefined;\n }\n if (isMainKey) {\n if (selectedIndexRef.current != null) {\n indexRef.current = selectedIndexRef.current;\n }\n stopEvent(event);\n if (!currentOpen && openOnArrowKeyDown) {\n openOnNavigationKeyDown(event);\n } else {\n commonOnKeyDown(event);\n }\n if (currentOpen) {\n onNavigate(event);\n }\n }\n return undefined;\n },\n onFocus(event) {\n if (store.select('open') && !virtual) {\n indexRef.current = -1;\n onNavigate(event);\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndexRef, virtual]);\n const reference = React.useMemo(() => {\n return {\n ...ariaActiveDescendantProp,\n ...trigger\n };\n }, [ariaActiveDescendantProp, trigger]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item,\n trigger\n } : {}, [enabled, reference, floating, trigger, item]);\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAa,IAAS;AACtB,SAAS,EAAS,GAAa,GAAU,GAAY;CACnD,QAAQ,GAAR;EACE,KAAK,YACH,OAAO;EACT,KAAK,cACH,OAAO;EACT,SACE,OAAO,KAAY;CACvB;AACF;AACA,SAAS,EAAqB,GAAK,GAAa;CAG9C,OAAO,EAAS,GAFC,MAAA,aAAoB,MAAA,aAClB,MAAA,eAAsB,MAAA,YACQ;AACnD;AACA,SAAS,EAA0B,GAAK,GAAa,GAAK;CAGxD,OAAO,EAAS,GAFC,MAAA,aACE,IAAM,MAAA,cAAqB,MAAA,YACG,KAAK,MAAQ,WAAW,MAAQ,OAAO,MAAQ;AAClG;AACA,SAAS,GAA0B,GAAK,GAAa,GAAK;CAGxD,OAAO,EAAS,GAFC,IAAM,MAAQ,KAAa,MAAQ,GACjC,MAAQ,CACsB;AACnD;AACA,SAAS,GAA2B,GAAK,GAAa,GAAK,GAAM;CAM/D,OAHI,MAAgB,UAAU,MAAgB,gBAAgB,IACrD,MAAQ,IAEV,EAAS,GALC,IAAM,MAAQ,IAAc,MAAQ,IAClC,MAAQ,CAIsB;AACnD;AAMA,SAAgB,EAAkB,GAAS,IAAO;CAChD,IAAM,EACJ,YACA,gBACA,YAAY,UAAuB,CAAC,GACpC,aAAU,IACV,m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ACL,IACC,CAAC,GAA0B,CAAO,CAAC;CACtC,OAAOA,EAAM,cAAc,IAAU;EACnC;EACA;EACA;EACA;CACF,IAAI,CAAC,GAAG;EAAC;EAAS;EAAW;EAAU;EAAS;CAAI,CAAC;AACvD"}
1
+ {"version":3,"file":"index274.js","names":["platform.engine.webkit","React","REASONS.listNavigation","REASONS.focusOut"],"sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { platform } from '@base-ui/utils/platform';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"../utils/constants.mjs\";\nimport { activeElement, contains, getFloatingFocusElement, getTarget, isTypeableCombobox } from \"../utils/element.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nexport const ESCAPE = 'Escape';\n\n// WebKit fires zero-delta `mousemove`/`pointermove` events when the list scrolls\n// beneath a stationary pointer, moving the highlight during keyboard navigation.\n// https://github.com/mui/base-ui/issues/4002\nfunction isStationaryWebKitPointer(event) {\n return platform.engine.webkit && event.movementX === 0 && event.movementY === 0;\n}\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl, grid) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && grid) {\n return key === ESCAPE;\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nexport function useListNavigation(context, props) {\n const {\n listRef,\n activeIndex,\n onNavigate: onNavigateProp = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loopFocus = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n parentOrientation,\n id,\n resetOnPointerLeave = true,\n externalTree,\n grid: navigateGrid\n } = props;\n const isGrid = navigateGrid != null;\n if (process.env.NODE_ENV !== 'production') {\n if (allowEscape) {\n if (!loopFocus) {\n console.warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n console.warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && isGrid) {\n console.warn('In grid list navigation mode, the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const floatingFocusElement = getFloatingFocusElement(floatingElement);\n const typeableComboboxReference = isTypeableCombobox(domReferenceElement);\n const floatingFocusElementRef = useValueAsRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree(externalTree);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex ?? -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const onNavigate = useStableCallback(event => {\n onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);\n });\n const previousMountedRef = React.useRef(!!floatingElement);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const cancelQueuedFocusRef = React.useRef(null);\n const disabledIndicesRef = useValueAsRef(disabledIndices);\n const latestOpenRef = useValueAsRef(open);\n const selectedIndexRef = useValueAsRef(selectedIndex);\n const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);\n const focusFrame = useAnimationFrame();\n const waitForListPopulatedFrame = useAnimationFrame();\n const focusItem = useStableCallback(() => {\n function runFocus(item) {\n if (virtual) {\n tree?.events.emit('virtualfocus', item);\n } else {\n cancelQueuedFocusRef.current = enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? callback => callback() : callback => focusFrame.request(callback);\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) {\n return;\n }\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const shouldScrollIntoView =\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView?.({\n block: 'nearest',\n inline: 'nearest'\n });\n }\n });\n });\n useIsoLayoutEffect(() => {\n dataRef.current.orientation = orientation;\n }, [dataRef, orientation]);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (open && floatingElement) {\n indexRef.current = selectedIndex ?? -1;\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Reset the active index when the list is no longer open and mounted (closing or\n // unmounting). `onNavigate` is a stable callback that always forwards to the latest\n // `onNavigate` prop.\n indexRef.current = -1;\n onNavigate();\n }\n }, [enabled, open, floatingElement, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (!open) {\n forceSyncFocusRef.current = false;\n return;\n }\n if (!floatingElement) {\n return;\n }\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? callback => waitForListPopulatedFrame.request(callback) : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs += 1;\n } else {\n // Initially focus the first non-disabled item. `disabledIndices` is deliberately\n // omitted here so attribute-disabled items (`disabled`/`aria-disabled`) are skipped\n // on open even when the consumer passes an empty `disabledIndices` array. Passing it\n // would regress that behavior (see mui/base-ui#2604).\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, floatingElement, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useIsoLayoutEffect(() => {\n if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = nodes.find(node => node.id === parentId)?.context?.elements.floating;\n // `floatingElement` is null here (see the guard above), so resolve the owner document from an\n // in-DOM element for realm-safety (shadow DOM/iframes): the reference element, falling back to\n // the parent floating element when the reference is virtual (`domReferenceElement` is null).\n const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);\n useIsoLayoutEffect(() => {\n previousOpenRef.current = open;\n previousMountedRef.current = !!floatingElement;\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n const hasActiveIndex = activeIndex != null;\n const syncCurrentTarget = useStableCallback(event => {\n if (!latestOpenRef.current) {\n return;\n }\n const index = listRef.current.indexOf(event.currentTarget);\n if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const getParentOrientation = useStableCallback(() => {\n return parentOrientation ?? tree?.nodesRef.current.find(node => node.id === parentId)?.context?.dataRef?.current.orientation;\n });\n const getMinEnabledIndex = useStableCallback(() => {\n return getMinListIndex(listRef, disabledIndicesRef.current);\n });\n const commonOnKeyDown = useStableCallback(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n store.setOpen(false, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n if (virtual) {\n tree?.events.emit('virtualfocus', domReferenceElement);\n } else {\n domReferenceElement.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(event);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(event);\n }\n }\n\n // Grid navigation is injected by grid-capable consumers so non-grid\n // consumers (menu, select) tree-shake the grid helpers out.\n if (navigateGrid != null) {\n const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);\n if (index != null) {\n indexRef.current = index;\n onNavigate(event);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(event);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loopFocus) {\n if (currentIndex >= maxIndex) {\n if (allowEscape && currentIndex !== listRef.current.length) {\n indexRef.current = -1;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = minIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else if (loopFocus) {\n if (currentIndex <= minIndex) {\n if (allowEscape && currentIndex !== -1) {\n indexRef.current = listRef.current.length;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = maxIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n if (isIndexOutOfListBounds(listRef.current, indexRef.current)) {\n indexRef.current = -1;\n }\n onNavigate(event);\n }\n });\n const item = React.useMemo(() => {\n const itemProps = {\n onFocus(event) {\n forceSyncFocusRef.current = true;\n syncCurrentTarget(event);\n },\n onClick: ({\n currentTarget\n }) => currentTarget.focus({\n preventScroll: true\n }),\n // Safari\n onMouseMove(event) {\n if (isStationaryWebKitPointer(event)) {\n return;\n }\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(event);\n }\n },\n onPointerLeave(event) {\n if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n const relatedTarget = event.relatedTarget;\n if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {\n return;\n }\n if (!resetOnPointerLeaveRef.current) {\n return;\n }\n cancelQueuedFocusRef.current?.();\n cancelQueuedFocusRef.current = null;\n indexRef.current = -1;\n onNavigate(event);\n if (!virtual) {\n const floatingFocusEl = floatingFocusElementRef.current;\n const activeEl = activeElement(ownerDocument(floatingFocusEl));\n if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {\n floatingFocusEl.focus({\n preventScroll: true\n });\n }\n }\n }\n };\n return itemProps;\n }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': `${id}-${activeIndex}`\n };\n }, [virtual, open, hasActiveIndex, id, activeIndex]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown(event) {\n // Close submenu on Shift+Tab\n if (event.key === 'Tab' && event.shiftKey && open && !virtual) {\n // If the event originated from within a nested element (e.g., a Dialog opened from\n // within the menu), don't close the menu. The nested element has its own focus\n // management and should handle the Tab key.\n const target = getTarget(event.nativeEvent);\n if (target && !contains(floatingFocusElementRef.current, target)) {\n return;\n }\n stopEvent(event);\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n domReferenceElement.focus();\n }\n return;\n }\n commonOnKeyDown(event);\n },\n onPointerMove(event) {\n if (isStationaryWebKitPointer(event)) {\n return;\n }\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, orientation, typeableComboboxReference, store, open, virtual, domReferenceElement]);\n const trigger = React.useMemo(() => {\n function openOnNavigationKeyDown(event) {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = !virtual;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n onKeyDown(event) {\n // non-reactive open state (to prevent re-creation of the handler)\n const currentOpen = store.select('open');\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && currentOpen) {\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {\n return undefined;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (currentOpen) {\n indexRef.current = getMinEnabledIndex();\n onNavigate(event);\n } else {\n openOnNavigationKeyDown(event);\n }\n }\n return undefined;\n }\n if (isMainKey) {\n if (selectedIndexRef.current != null) {\n indexRef.current = selectedIndexRef.current;\n }\n stopEvent(event);\n if (!currentOpen && openOnArrowKeyDown) {\n openOnNavigationKeyDown(event);\n } else {\n commonOnKeyDown(event);\n }\n if (currentOpen) {\n onNavigate(event);\n }\n }\n return undefined;\n },\n onFocus(event) {\n if (store.select('open') && !virtual) {\n indexRef.current = -1;\n onNavigate(event);\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndexRef, virtual]);\n const reference = React.useMemo(() => {\n return {\n ...ariaActiveDescendantProp,\n ...trigger\n };\n }, [ariaActiveDescendantProp, trigger]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item,\n trigger\n } : {}, [enabled, reference, floating, trigger, item]);\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAa,IAAS;AAKtB,SAAS,GAA0B,GAAO;CACxC,OAAOA,KAA0B,EAAM,cAAc,KAAK,EAAM,cAAc;AAChF;AACA,SAAS,EAAS,GAAa,GAAU,GAAY;CACnD,QAAQ,GAAR;EACE,KAAK,YACH,OAAO;EACT,KAAK,cACH,OAAO;EACT,SACE,OAAO,KAAY;CACvB;AACF;AACA,SAAS,EAAqB,GAAK,GAAa;CAG9C,OAAO,EAAS,GAFC,MAAA,aAAoB,MAAA,aAClB,MAAA,eAAsB,MAAA,YACQ;AACnD;AACA,SAAS,EAA0B,GAAK,GAAa,GAAK;CAGxD,OAAO,EAAS,GAFC,MAAA,aACE,IAAM,MAAA,cAAqB,MAAA,YACG,KAAK,MAAQ,WAAW,MAAQ,OAAO,MAAQ;AAClG;AACA,SAAS,GAA0B,GAAK,GAAa,GAAK;CAGx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EAAwB,CAAK,IAE7B,EAAgB,CAAK,GAEnB,KACF,EAAW,CAAK;IAxBpB;GA4BF;GACA,QAAQ,GAAO;IACb,AAAI,EAAM,OAAO,MAAM,KAAK,CAAC,MAC3B,EAAS,UAAU,IACnB,EAAW,CAAK;GAEpB;GACA,eAAe;GACf,gBAAgB;GAChB,aAAa;GACb,SAAS;EACX;CACF,GAAG;EAAC;EAAiB;EAAiB;EAAoB;EAAQ;EAAY;EAAO;EAAoB;EAAa;EAAsB;EAAK;EAAkB;CAAO,CAAC,GACrK,KAAYD,EAAM,eACf;EACL,GAAG;EACH,GAAG;CACL,IACC,CAAC,GAA0B,CAAO,CAAC;CACtC,OAAOA,EAAM,cAAc,IAAU;EACnC;EACA;EACA;EACA;CACF,IAAI,CAAC,GAAG;EAAC;EAAS;EAAW;EAAU;EAAS;CAAI,CAAC;AACvD"}
package/dist/index275.js CHANGED
@@ -2,20 +2,20 @@
2
2
  import { EMPTY_ARRAY as e } from "./index191.js";
3
3
  import { useStableCallback as t } from "./index202.js";
4
4
  import { useIsoLayoutEffect as n } from "./index204.js";
5
- import { useTimeout as r } from "./index215.js";
6
- import { stopEvent as i } from "./index221.js";
7
- import { contains as a } from "./index223.js";
8
- import { isElementVisible as o, isListIndexDisabled as s } from "./index233.js";
5
+ import { useTimeout as r } from "./index217.js";
6
+ import { stopEvent as i } from "./index223.js";
7
+ import { contains as a } from "./index225.js";
8
+ import { isElementVisible as o, isListIndexDisabled as s } from "./index234.js";
9
9
  import * as c from "react";
10
10
  //#region ../../node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs
11
11
  function l(l, u) {
12
12
  let { listRef: d, elementsRef: f, activeIndex: p, onMatch: m, disabledIndices: h, onTyping: g, enabled: _ = !0, resetMs: v = 750, selectedIndex: y = null } = u, b = "rootStore" in l ? l.rootStore : l, x = b.useState("open"), S = r(), C = c.useRef(""), w = c.useRef(y ?? p ?? -1), T = c.useRef(null), E = t((t) => {
13
13
  function n(e) {
14
- let t = f?.current[e];
15
- return !t || o(t);
14
+ return f?.current[e];
16
15
  }
17
16
  function r(t) {
18
- return n(t) ? h == null || !s(e, t, h) : !1;
17
+ let r = n(t);
18
+ return r && !o(r) || r?.matches(":disabled") ? !1 : h == null || !s(e, t, h);
19
19
  }
20
20
  function a(e, t, n = 0) {
21
21
  if (e.length === 0) return -1;
@@ -45,12 +45,6 @@ function l(l, u) {
45
45
  x,
46
46
  y,
47
47
  S
48
- ]), n(() => {
49
- x && C.current === "" && (w.current = y ?? p ?? -1);
50
- }, [
51
- x,
52
- y,
53
- p
54
48
  ]);
55
49
  let O = c.useMemo(() => ({
56
50
  onKeyDown: E,
@@ -1 +1 @@
1
- {"version":3,"file":"index275.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { isElementVisible, isListIndexDisabled } from \"../utils/composite.mjs\";\nimport { contains } from \"../utils/element.mjs\";\nimport { stopEvent } from \"../utils/event.mjs\";\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nexport function useTypeahead(context, props) {\n const {\n listRef,\n elementsRef,\n activeIndex,\n onMatch: onMatchProp,\n disabledIndices,\n onTyping,\n enabled = true,\n resetMs = 750,\n selectedIndex = null\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const timeout = useTimeout();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef(selectedIndex ?? activeIndex ?? -1);\n const matchIndexRef = React.useRef(null);\n const onKeyDown = useStableCallback(event => {\n function isVisible(index) {\n const element = elementsRef?.current[index];\n return !element || isElementVisible(element);\n }\n function isItemAvailable(index) {\n if (!isVisible(index)) {\n return false;\n }\n // Visibility is handled above; pass an empty element list so `isListIndexDisabled`\n // resolves only the explicit `disabledIndices` (array/predicate) and skips its own\n // visibility/attribute fallbacks. Consumers that don't opt in keep matching every\n // visible item.\n return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index, disabledIndices);\n }\n function getMatchingIndex(list, string, startIndex = 0) {\n if (list.length === 0) {\n return -1;\n }\n const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;\n const lowerString = string.toLowerCase();\n for (let offset = 0; offset < list.length; offset += 1) {\n const index = (normalizedStartIndex + offset) % list.length;\n const text = list[index];\n if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index)) {\n continue;\n }\n return index;\n }\n return -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && event.key === ' ') {\n // Space should continue the in-progress typeahead session.\n stopEvent(event);\n onTyping?.(true);\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== ' ') {\n onTyping?.(false);\n }\n }\n if (listContent == null ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n onTyping?.(true);\n }\n\n // Capture whether this is a new typing session before mutating the string.\n const isNewSession = stringRef.current === '';\n if (isNewSession) {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too. Unavailable items are skipped while matching, so\n // they must be ignored here as well — otherwise a hidden or disabled double-letter\n // label would block rapid cycling through the available items.\n const allowRapidSuccessionOfFirstLetter = listContent.every((text, index) => text && isItemAvailable(index) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n timeout.start(resetMs, () => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n\n // Compute the starting index for this search.\n // If this is a new typing session (string is empty), base it on the current\n // selection/active item; otherwise continue from the last matched index.\n const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;\n const startIndex = (prevIndex ?? 0) + 1;\n const index = getMatchingIndex(listContent, stringRef.current, startIndex);\n if (index !== -1) {\n onMatchProp?.(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n onTyping?.(false);\n }\n });\n const onBlur = useStableCallback(event => {\n const next = event.relatedTarget;\n const currentDomReferenceElement = store.select('domReferenceElement');\n const currentFloatingElement = store.select('floatingElement');\n const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);\n\n // Keep the session if focus moves within the composite (reference <-> floating).\n if (withinComposite) {\n return;\n }\n\n // End the current typing session when focus leaves the composite entirely.\n timeout.clear();\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n useIsoLayoutEffect(() => {\n if (!open && selectedIndex !== null) {\n return;\n }\n timeout.clear();\n matchIndexRef.current = null;\n if (stringRef.current !== '') {\n stringRef.current = '';\n }\n }, [open, selectedIndex, timeout]);\n useIsoLayoutEffect(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n }, [open, selectedIndex, activeIndex]);\n const sharedProps = React.useMemo(() => ({\n onKeyDown,\n onBlur\n }), [onKeyDown, onBlur]);\n return React.useMemo(() => enabled ? {\n reference: sharedProps,\n floating: sharedProps\n } : {}, [enabled, sharedProps]);\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAeA,SAAgB,EAAa,GAAS,GAAO;CAC3C,IAAM,EACJ,YACA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e;EACvC;EACA;CACF,IAAI,CAAC,GAAW,CAAM,CAAC;CACvB,OAAOA,EAAM,cAAc,IAAU;EACnC,WAAW;EACX,UAAU;CACZ,IAAI,CAAC,GAAG,CAAC,GAAS,CAAW,CAAC;AAChC"}
1
+ {"version":3,"file":"index275.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { isElementVisible, isListIndexDisabled } from \"../utils/composite.mjs\";\nimport { contains } from \"../utils/element.mjs\";\nimport { stopEvent } from \"../utils/event.mjs\";\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nexport function useTypeahead(context, props) {\n const {\n listRef,\n elementsRef,\n activeIndex,\n onMatch: onMatchProp,\n disabledIndices,\n onTyping,\n enabled = true,\n resetMs = 750,\n selectedIndex = null\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const timeout = useTimeout();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef(selectedIndex ?? activeIndex ?? -1);\n const matchIndexRef = React.useRef(null);\n const onKeyDown = useStableCallback(event => {\n function getElement(index) {\n return elementsRef?.current[index];\n }\n function isItemAvailable(index) {\n const element = getElement(index);\n if (element && !isElementVisible(element) || element?.matches(':disabled')) {\n return false;\n }\n // Visibility and native disabled state are handled above; pass an empty\n // element list so `isListIndexDisabled` resolves only the explicit\n // `disabledIndices` (array/predicate) and skips its own fallbacks.\n // Consumers that don't pass `disabledIndices` keep matching every visible\n // item except native disabled elements provided through `elementsRef`.\n return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index, disabledIndices);\n }\n function getMatchingIndex(list, string, startIndex = 0) {\n if (list.length === 0) {\n return -1;\n }\n const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;\n const lowerString = string.toLowerCase();\n for (let offset = 0; offset < list.length; offset += 1) {\n const index = (normalizedStartIndex + offset) % list.length;\n const text = list[index];\n if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index)) {\n continue;\n }\n return index;\n }\n return -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && event.key === ' ') {\n // Space should continue the in-progress typeahead session.\n stopEvent(event);\n onTyping?.(true);\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== ' ') {\n onTyping?.(false);\n }\n }\n if (listContent == null ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n onTyping?.(true);\n }\n\n // Capture whether this is a new typing session before mutating the string.\n const isNewSession = stringRef.current === '';\n if (isNewSession) {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too. Unavailable items are skipped while matching, so\n // they must be ignored here as well — otherwise a hidden or disabled double-letter\n // label would block rapid cycling through the available items.\n const allowRapidSuccessionOfFirstLetter = listContent.every((text, index) => text && isItemAvailable(index) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n timeout.start(resetMs, () => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n\n // Compute the starting index for this search.\n // If this is a new typing session (string is empty), base it on the current\n // selection/active item; otherwise continue from the last matched index.\n const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;\n const startIndex = (prevIndex ?? 0) + 1;\n const index = getMatchingIndex(listContent, stringRef.current, startIndex);\n if (index !== -1) {\n onMatchProp?.(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n onTyping?.(false);\n }\n });\n const onBlur = useStableCallback(event => {\n const next = event.relatedTarget;\n const currentDomReferenceElement = store.select('domReferenceElement');\n const currentFloatingElement = store.select('floatingElement');\n const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);\n\n // Keep the session if focus moves within the composite (reference <-> floating).\n if (withinComposite) {\n return;\n }\n\n // End the current typing session when focus leaves the composite entirely.\n timeout.clear();\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n useIsoLayoutEffect(() => {\n if (!open && selectedIndex !== null) {\n return;\n }\n timeout.clear();\n matchIndexRef.current = null;\n if (stringRef.current !== '') {\n stringRef.current = '';\n }\n }, [open, selectedIndex, timeout]);\n const sharedProps = React.useMemo(() => ({\n onKeyDown,\n onBlur\n }), [onKeyDown, onBlur]);\n return React.useMemo(() => enabled ? {\n reference: sharedProps,\n floating: sharedProps\n } : {}, [enabled, sharedProps]);\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAeA,SAAgB,EAAa,GAAS,GAAO;CAC3C,IAAM,EACJ,YACA,gBACA,gBACA,SAAS,GACT,oBACA,aACA,aAAU,IACV,aAAU,KACV,mBAAgB,SACd,GACE,IAAQ,eAAe,IAAU,EAAQ,YAAY,GACrD,IAAO,EAAM,SAAS,MAAM,GAC5B,IAAU,EAAW,GACrB,IAAYA,EAAM,OAAO,EAAE,GAC3B,IAAeA,EAAM,OAAO,KAAiB,KAAe,EAAE,GAC9D,IAAgBA,EAAM,OAAO,IAAI,GACjC,IAAY,GAAkB,MAAS;EAC3C,SAAS,EAAW,GAAO;GACzB,OAAO,GAAa,QAAQ;EAC9B;EACA,S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3B,EAAQ,MAAM,SAAe;GAG3B,AAFA,EAAU,UAAU,IACpB,EAAa,UAAU,EAAc,SACrC,IAAW,EAAK;EAClB,CAAC;EAMD,IAAM,MADY,IAAe,KAAiB,KAAe,KAAK,EAAa,YAClD,KAAK,GAChC,IAAQ,EAAiB,GAAa,EAAU,SAAS,CAAU;EACzE,AAAI,MAAU,KAGH,EAAM,QAAQ,QACvB,EAAU,UAAU,IACpB,IAAW,EAAK,MAJhB,IAAc,CAAK,GACnB,EAAc,UAAU;CAK5B,CAAC,GACK,IAAS,GAAkB,MAAS;EACxC,IAAM,IAAO,EAAM,eACb,IAA6B,EAAM,OAAO,qBAAqB,GAC/D,IAAyB,EAAM,OAAO,iBAAiB;EACrC,EAAS,GAA4B,CAAI,KAAK,EAAS,GAAwB,CAAI,MAQ3G,EAAQ,MAAM,GACd,EAAU,UAAU,IACpB,EAAa,UAAU,EAAc,SACrC,IAAW,EAAK;CAClB,CAAC;CACD,QAAyB;EACnB,CAAC,KAAQ,MAAkB,SAG/B,EAAQ,MAAM,GACd,EAAc,UAAU,MACpB,EAAU,YAAY,OACxB,EAAU,UAAU;CAExB,GAAG;EAAC;EAAM;EAAe;CAAO,CAAC;CACjC,IAAM,IAAcA,EAAM,eAAe;EACvC;EACA;CACF,IAAI,CAAC,GAAW,CAAM,CAAC;CACvB,OAAOA,EAAM,cAAc,IAAU;EACnC,WAAW;EACX,UAAU;CACZ,IAAI,CAAC,GAAG,CAAC,GAAS,CAAW,CAAC;AAChC"}
package/dist/index276.js CHANGED
@@ -1,8 +1,15 @@
1
- //#region ../../node_modules/@base-ui/react/dialog/popup/DialogPopupCssVars.mjs
2
- var e = /*#__PURE__*/ function(e) {
3
- return e.nestedDialogs = "--nested-dialogs", e;
4
- }({});
1
+ "use client";
2
+ import e from "./index183.js";
3
+ import * as t from "react";
4
+ //#region ../../node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs
5
+ var n = /*#__PURE__*/ t.createContext(void 0);
6
+ process.env.NODE_ENV !== "production" && (n.displayName = "DialogPortalContext");
7
+ function r() {
8
+ let r = t.useContext(n);
9
+ if (r === void 0) throw Error(process.env.NODE_ENV === "production" ? e(26) : "Base UI: <Dialog.Portal> is missing.");
10
+ return r;
11
+ }
5
12
  //#endregion
6
- export { e as DialogPopupCssVars };
13
+ export { n as DialogPortalContext, r as useDialogPortalContext };
7
14
 
8
15
  //# sourceMappingURL=index276.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index276.js","names":[],"sources":["../../../node_modules/@base-ui/react/dialog/popup/DialogPopupCssVars.mjs"],"sourcesContent":["export let DialogPopupCssVars = /*#__PURE__*/function (DialogPopupCssVars) {\n /**\n * Indicates how many dialogs are nested within.\n * @type {number}\n */\n DialogPopupCssVars[\"nestedDialogs\"] = \"--nested-dialogs\";\n return DialogPopupCssVars;\n}({});"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAW,IAAkC,uBAAU,GAAoB;CAMzE,OADA,EAAmB,gBAAmB,oBAC/B;AACT,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"index276.js","names":["React","_formatErrorMessage"],"sources":["../../../node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,IAAa,IAAmC,gBAAM,cAAc,KAAA,CAAS;AAC7E,QAAA,IAAA,aAA6B,iBAAc,EAAoB,cAAc;AAC7E,SAAgB,IAAyB;CACvC,IAAM,IAAQA,EAAM,WAAW,CAAmB;CAClD,IAAI,MAAU,KAAA,GACZ,MAAU,MAAA,QAAA,IAAA,aAA+B,eAAwDC,EAAoB,EAAE,IAA/D,sCAAgE;CAE1H,OAAO;AACT"}
package/dist/index277.js CHANGED
@@ -1,9 +1,15 @@
1
- import { CommonPopupDataAttributes as e } from "./index198.js";
2
- //#region ../../node_modules/@base-ui/react/dialog/popup/DialogPopupDataAttributes.mjs
3
- var t = function(t) {
4
- return t[t.open = e.open] = "open", t[t.closed = e.closed] = "closed", t[t.startingStyle = e.startingStyle] = "startingStyle", t[t.endingStyle = e.endingStyle] = "endingStyle", t.nested = "data-nested", t.nestedDialogOpen = "data-nested-dialog-open", t;
5
- }({});
1
+ import "./index223.js";
2
+ import "./index234.js";
3
+ //#region ../../node_modules/@base-ui/react/internals/composite/composite.mjs
4
+ var e = "ArrowUp", t = "ArrowDown", n = "ArrowLeft", r = "ArrowRight", i = "Home", a = /* @__PURE__ */ new Set([
5
+ e,
6
+ t,
7
+ n,
8
+ r,
9
+ i,
10
+ "End"
11
+ ]);
6
12
  //#endregion
7
- export { t as DialogPopupDataAttributes };
13
+ export { t as ARROW_DOWN, n as ARROW_LEFT, r as ARROW_RIGHT, e as ARROW_UP, a as COMPOSITE_KEYS, i as HOME };
8
14
 
9
15
  //# sourceMappingURL=index277.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index277.js","names":[],"sources":["../../../node_modules/@base-ui/react/dialog/popup/DialogPopupDataAttributes.mjs"],"sourcesContent":["import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\nexport let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {\n /**\n * Present when the dialog is open.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"open\"] = CommonPopupDataAttributes.open] = \"open\";\n /**\n * Present when the dialog is closed.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"closed\"] = CommonPopupDataAttributes.closed] = \"closed\";\n /**\n * Present when the dialog is animating in.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"startingStyle\"] = CommonPopupDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the dialog is animating out.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"endingStyle\"] = CommonPopupDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the dialog is nested within another dialog.\n */\n DialogPopupDataAttributes[\"nested\"] = \"data-nested\";\n /**\n * Present when the dialog has other open dialogs nested within it.\n */\n DialogPopupDataAttributes[\"nestedDialogOpen\"] = \"data-nested-dialog-open\";\n return DialogPopupDataAttributes;\n}({});"],"x_google_ignoreList":[0],"mappings":";;AACA,IAAW,IAA4B,SAAU,GAA2B;CAyB1E,OArBA,EAA0B,EAA0B,OAAU,EAA0B,QAAQ,QAIhG,EAA0B,EAA0B,SAAY,EAA0B,UAAU,UAIpG,EAA0B,EAA0B,gBAAmB,EAA0B,iBAAiB,iBAIlH,EAA0B,EAA0B,cAAiB,EAA0B,eAAe,eAI9G,EAA0B,SAAY,eAItC,EAA0B,mBAAsB,2BACzC;AACT,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"index277.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/composite/composite.mjs"],"sourcesContent":["import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, findNonDisabledListIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.mjs\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const MODIFIER_KEYS = [SHIFT, 'Control', 'Alt', 'Meta'];\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}"],"x_google_ignoreList":[0],"mappings":";;;AAEA,IAAa,IAAW,WACX,IAAa,aACb,IAAa,aACb,IAAc,cACd,IAAO,QAIP,oBAAiB,IAAI,IAAI;CAAC;CAAU;CAAY;CAAY;CAAa;;AAAS,CAAC"}
package/dist/index278.js CHANGED
@@ -1,15 +1,14 @@
1
- "use client";
2
- import e from "./index183.js";
3
- import * as t from "react";
4
- //#region ../../node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs
5
- var n = /*#__PURE__*/ t.createContext(void 0);
6
- process.env.NODE_ENV !== "production" && (n.displayName = "DialogPortalContext");
7
- function r() {
8
- let r = t.useContext(n);
9
- if (r === void 0) throw Error(process.env.NODE_ENV === "production" ? e(26) : "Base UI: <Dialog.Portal> is missing.");
10
- return r;
11
- }
1
+ import { transitionStatusMapping as e } from "./index197.js";
2
+ import { popupStateMapping as t } from "./index198.js";
3
+ //#region ../../node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs
4
+ var n = {
5
+ ...t,
6
+ ...e,
7
+ nestedDialogOpen(e) {
8
+ return e ? { "data-nested-dialog-open": "" } : null;
9
+ }
10
+ };
12
11
  //#endregion
13
- export { n as DialogPortalContext, r as useDialogPortalContext };
12
+ export { n as dialogStateAttributesMapping };
14
13
 
15
14
  //# sourceMappingURL=index278.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index278.js","names":["React","_formatErrorMessage"],"sources":["../../../node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,IAAa,IAAmC,gBAAM,cAAc,KAAA,CAAS;AAC7E,QAAA,IAAA,aAA6B,iBAAc,EAAoB,cAAc;AAC7E,SAAgB,IAAyB;CACvC,IAAM,IAAQA,EAAM,WAAW,CAAmB;CAClD,IAAI,MAAU,KAAA,GACZ,MAAU,MAAA,QAAA,IAAA,aAA+B,eAAwDC,EAAoB,EAAE,IAA/D,sCAAgE;CAE1H,OAAO;AACT"}
1
+ {"version":3,"file":"index278.js","names":[],"sources":["../../../node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs"],"sourcesContent":["import { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\n/**\n * Shared by `Dialog.Popup` and `Dialog.Viewport`, whose states have the same shape.\n * `nested` is not mapped: unmapped `true` booleans already render as `data-nested`.\n */\nexport const dialogStateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping,\n nestedDialogOpen(value) {\n return value ? {\n 'data-nested-dialog-open': ''\n } : null;\n }\n};"],"x_google_ignoreList":[0],"mappings":";;;AAMA,IAAa,IAA+B;CAC1C,GAAG;CACH,GAAG;CACH,iBAAiB,GAAO;EACtB,OAAO,IAAQ,EACb,2BAA2B,GAC7B,IAAI;CACN;AACF"}
package/dist/index279.js CHANGED
@@ -1,12 +1,68 @@
1
- import "./index221.js";
2
- import "./index233.js";
3
- //#region ../../node_modules/@base-ui/react/internals/composite/composite.mjs
4
- var e = "ArrowUp", t = "ArrowDown", n = "ArrowLeft", r = "ArrowRight", i = "Home", a = /* @__PURE__ */ new Set([n, r]), o = /* @__PURE__ */ new Set([e, t]), s = /* @__PURE__ */ new Set([...a, ...o]), c = /* @__PURE__ */ new Set([
5
- ...s,
6
- i,
7
- "End"
8
- ]);
1
+ "use client";
2
+ import { useDialogRootContext as e } from "./index184.js";
3
+ import { useRenderElement as t } from "./index196.js";
4
+ import { FloatingFocusManager as n } from "./index245.js";
5
+ import { useOpenChangeComplete as r } from "./index266.js";
6
+ import { FOCUSABLE_POPUP_PROPS as i, createDefaultInitialFocus as a } from "./index267.js";
7
+ import { useDialogPortalContext as o } from "./index276.js";
8
+ import { COMPOSITE_KEYS as s } from "./index277.js";
9
+ import { dialogStateAttributesMapping as c } from "./index278.js";
10
+ import * as l from "react";
11
+ import { jsx as u } from "react/jsx-runtime";
12
+ //#region ../../node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
13
+ var d = /*#__PURE__*/ l.forwardRef(function(l, d) {
14
+ let { render: f, className: p, style: m, finalFocus: h, initialFocus: g, ..._ } = l, v = e(), y = v.useState("descriptionElementId"), b = v.useState("disablePointerDismissal"), x = v.useState("floatingRootContext"), S = v.useState("popupProps"), C = v.useState("modal"), w = v.useState("mounted"), T = v.useState("nested"), E = v.useState("nestedOpenDialogCount"), D = v.useState("open"), O = v.useState("openMethod"), k = v.useState("titleElementId"), A = v.useState("transitionStatus"), j = v.useState("role"), M = x.useState("floatingId");
15
+ o(), r({
16
+ open: D,
17
+ ref: v.context.popupRef,
18
+ onComplete() {
19
+ D && v.context.onOpenChangeComplete?.(!0);
20
+ }
21
+ });
22
+ let N = g === void 0 ? a(v.context.popupRef) : g, P = E > 0, F = v.useStateSetter("popupElement"), I = t("div", l, {
23
+ state: {
24
+ open: D,
25
+ nested: T,
26
+ transitionStatus: A,
27
+ nestedDialogOpen: P
28
+ },
29
+ props: [
30
+ S,
31
+ {
32
+ id: M,
33
+ "aria-labelledby": k,
34
+ "aria-describedby": y,
35
+ role: j,
36
+ ...i,
37
+ hidden: !w,
38
+ onKeyDown(e) {
39
+ s.has(e.key) && e.stopPropagation();
40
+ },
41
+ style: { "--nested-dialogs": E }
42
+ },
43
+ _
44
+ ],
45
+ ref: [
46
+ d,
47
+ v.context.popupRef,
48
+ F
49
+ ],
50
+ stateAttributesMapping: c
51
+ });
52
+ return /*#__PURE__*/ u(n, {
53
+ context: x,
54
+ openInteractionType: O,
55
+ disabled: !w,
56
+ closeOnFocusOut: !b,
57
+ initialFocus: N,
58
+ returnFocus: h,
59
+ modal: C !== !1,
60
+ restoreFocus: "popup",
61
+ children: I
62
+ });
63
+ });
64
+ process.env.NODE_ENV !== "production" && (d.displayName = "DialogPopup");
9
65
  //#endregion
10
- export { t as ARROW_DOWN, s as ARROW_KEYS, n as ARROW_LEFT, r as ARROW_RIGHT, e as ARROW_UP, c as COMPOSITE_KEYS, i as HOME, a as HORIZONTAL_KEYS, o as VERTICAL_KEYS };
66
+ export { d as DialogPopup };
11
67
 
12
68
  //# sourceMappingURL=index279.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index279.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/composite/composite.mjs"],"sourcesContent":["import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, findNonDisabledListIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.mjs\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const HORIZONTAL_KEYS = new Set([ARROW_LEFT, ARROW_RIGHT]);\nexport const HORIZONTAL_KEYS_WITH_EXTRA_KEYS = new Set([ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const VERTICAL_KEYS = new Set([ARROW_UP, ARROW_DOWN]);\nexport const VERTICAL_KEYS_WITH_EXTRA_KEYS = new Set([ARROW_UP, ARROW_DOWN, HOME, END]);\nexport const ARROW_KEYS = new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);\nexport const COMPOSITE_KEYS = new Set([...ARROW_KEYS, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const CONTROL = 'Control';\nexport const ALT = 'Alt';\nexport const META = 'Meta';\nexport const MODIFIER_KEYS = new Set([SHIFT, CONTROL, ALT, META]);\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}"],"x_google_ignoreList":[0],"mappings":";;;AAEA,IAAa,IAAW,WACX,IAAa,aACb,IAAa,aACb,IAAc,cACd,IAAO,QAIP,oBAAkB,IAAI,IAAI,CAAC,GAAY,CAAW,CAAC,GAEnD,oBAAgB,IAAI,IAAI,CAAC,GAAU,CAAU,CAAC,GAE9C,oBAAa,IAAI,IAAI,CAAC,GAAG,GAAiB,GAAG,CAAa,CAAC,GAC3D,oBAAiB,IAAI,IAAI;CAAC,GAAG;CAAY;;AAAS,CAAC"}
1
+ {"version":3,"file":"index279.js","names":[],"sources":["../../../node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { FOCUSABLE_POPUP_PROPS, createDefaultInitialFocus } from \"../../utils/popups/index.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: floatingId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n '--nested-dialogs': nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping: dialogStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AAmBA,IAAa,IAA2B,gBAAM,WAAW,SAAqB,GAAgB,GAAc;CAC1G,IAAM,EACJ,WACA,cACA,UACA,eACA,iBACA,GAAG,MACD,GACE,IAAQ,EAAqB,GAC7B,IAAuB,EAAM,SAAS,sBAAsB,GAC5D,IAA0B,EAAM,SAAS,yBAAyB,GAClE,IAAsB,EAAM,SAAS,qBAAqB,GAC1D,IAAiB,EAAM,SAAS,YAAY,GAC5C,IAAQ,EAAM,SAAS,OAAO,GAC9B,IAAU,EAAM,SAAS,SAAS,GAClC,IAAS,EAAM,SAAS,QAAQ,GAChC,IAAwB,EAAM,SAAS,uBAAuB,GAC9D,IAAO,EAAM,SAAS,MAAM,GAC5B,IAAa,EAAM,SAAS,YAAY,GACxC,IAAiB,EAAM,SAAS,gBAAgB,GAChD,IAAmB,EAAM,SAAS,kBAAkB,GACpD,IAAO,EAAM,SAAS,MAAM,GAC5B,IAAa,EAAoB,SAAS,YAAY;CAE5D,AADA,EAAuB,GACvB,EAAsB;EACpB;EACA,KAAK,EAAM,QAAQ;EACnB,aAAa;GACX,AAAI,KACF,EAAM,QAAQ,uBAAuB,EAAI;EAE7C;CACF,CAAC;CACD,IAAM,IAAuB,MAAiB,KAAA,IAAY,EAA0B,EAAM,QAAQ,QAAQ,IAAI,GACxG,IAAmB,IAAwB,GAC3C,IAAkB,EAAM,eAAe,cAAc,GAOrD,IAAU,EAAiB,OAAO,GAAgB;EACtD,OAAA;GANA;GACA;GACA;GACA;EAGI;EACJ,OAAO;GAAC;GAAgB;IACtB,IAAI;IACJ,mBAAmB;IACnB,oBAAoB;IACpB;IACA,GAAG;IACH,QAAQ,CAAC;IACT,UAAU,GAAO;KACf,AAAI,EAAe,IAAI,EAAM,GAAG,KAC9B,EAAM,gBAAgB;IAE1B;IACA,OAAO,EACL,oBAAoB,EACtB;GACF;GAAG;EAAY;EACf,KAAK;GAAC;GAAc,EAAM,QAAQ;GAAU;EAAe;EAC3D,wBAAwB;CAC1B,CAAC;CACD,OAAoB,gBAAK,GAAsB;EAC7C,SAAS;EACT,qBAAqB;EACrB,UAAU,CAAC;EACX,iBAAiB,CAAC;EAClB,cAAc;EACd,aAAa;EACb,OAAO,MAAU;EACjB,cAAc;EACd,UAAU;CACZ,CAAC;AACH,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAY,cAAc"}
package/dist/index280.js CHANGED
@@ -1,77 +1,9 @@
1
- "use client";
2
- import { useDialogRootContext as e } from "./index184.js";
3
- import { useRenderElement as t } from "./index196.js";
4
- import { transitionStatusMapping as n } from "./index197.js";
5
- import { popupStateMapping as r } from "./index198.js";
6
- import { FloatingFocusManager as i } from "./index244.js";
7
- import { useOpenChangeComplete as a } from "./index267.js";
8
- import { FOCUSABLE_POPUP_PROPS as o, createDefaultInitialFocus as s } from "./index268.js";
9
- import { DialogPopupCssVars as c } from "./index276.js";
10
- import { DialogPopupDataAttributes as l } from "./index277.js";
11
- import { useDialogPortalContext as u } from "./index278.js";
12
- import { COMPOSITE_KEYS as d } from "./index279.js";
13
- import * as f from "react";
14
- import { jsx as p } from "react/jsx-runtime";
15
- //#region ../../node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
16
- var m = {
17
- ...r,
18
- ...n,
19
- nestedDialogOpen(e) {
20
- return e ? { [l.nestedDialogOpen]: "" } : null;
21
- }
22
- }, h = /*#__PURE__*/ f.forwardRef(function(n, r) {
23
- let { render: l, className: f, style: h, finalFocus: g, initialFocus: _, ...v } = n, { store: y } = e(), b = y.useState("descriptionElementId"), x = y.useState("disablePointerDismissal"), S = y.useState("floatingRootContext"), C = y.useState("popupProps"), w = y.useState("modal"), T = y.useState("mounted"), E = y.useState("nested"), D = y.useState("nestedOpenDialogCount"), O = y.useState("open"), k = y.useState("openMethod"), A = y.useState("titleElementId"), j = y.useState("transitionStatus"), M = y.useState("role"), N = S.useState("floatingId"), P = v.id ?? N;
24
- u(), a({
25
- open: O,
26
- ref: y.context.popupRef,
27
- onComplete() {
28
- O && y.context.onOpenChangeComplete?.(!0);
29
- }
30
- });
31
- let F = _ === void 0 ? s(y.context.popupRef) : _, I = D > 0, L = y.useStateSetter("popupElement"), R = t("div", n, {
32
- state: {
33
- open: O,
34
- nested: E,
35
- transitionStatus: j,
36
- nestedDialogOpen: I
37
- },
38
- props: [
39
- C,
40
- {
41
- id: P,
42
- "aria-labelledby": A ?? void 0,
43
- "aria-describedby": b ?? void 0,
44
- role: M,
45
- ...o,
46
- hidden: !T,
47
- onKeyDown(e) {
48
- d.has(e.key) && e.stopPropagation();
49
- },
50
- style: { [c.nestedDialogs]: D }
51
- },
52
- v
53
- ],
54
- ref: [
55
- r,
56
- y.context.popupRef,
57
- L
58
- ],
59
- stateAttributesMapping: m
60
- });
61
- return /*#__PURE__*/ p(i, {
62
- context: S,
63
- openInteractionType: k,
64
- disabled: !T,
65
- closeOnFocusOut: !x,
66
- initialFocus: F,
67
- returnFocus: g,
68
- modal: w !== !1,
69
- restoreFocus: "popup",
70
- children: R
71
- });
72
- });
73
- process.env.NODE_ENV !== "production" && (h.displayName = "DialogPopup");
1
+ import { isReactVersionAtLeast as e } from "./index187.js";
2
+ //#region ../../node_modules/@base-ui/utils/inertValue.mjs
3
+ function t(t) {
4
+ return e(19) ? t : t ? "true" : void 0;
5
+ }
74
6
  //#endregion
75
- export { h as DialogPopup };
7
+ export { t as inertValue };
76
8
 
77
9
  //# sourceMappingURL=index280.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index280.js","names":["baseMapping"],"sources":["../../../node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { DialogPopupCssVars } from \"./DialogPopupCssVars.mjs\";\nimport { DialogPopupDataAttributes } from \"./DialogPopupDataAttributes.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { FOCUSABLE_POPUP_PROPS, createDefaultInitialFocus } from \"../../utils/popups/index.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping,\n nestedDialogOpen(value) {\n return value ? {\n [DialogPopupDataAttributes.nestedDialogOpen]: ''\n } : null;\n }\n};\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n const popupId = elementProps.id ?? floatingId;\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: popupId,\n 'aria-labelledby': titleElementId ?? undefined,\n 'aria-describedby': descriptionElementId ?? undefined,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n [DialogPopupCssVars.nestedDialogs]: nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;AAeA,IAAM,IAAyB;CAC7B,GAAGA;CACH,GAAG;CACH,iBAAiB,GAAO;EACtB,OAAO,IAAQ,GACZ,EAA0B,mBAAmB,GAChD,IAAI;CACN;AACF,GAQa,IAA2B,gBAAM,WAAW,SAAqB,GAAgB,GAAc;CAC1G,IAAM,EACJ,WACA,cACA,UACA,eACA,iBACA,GAAG,MACD,GACE,EACJ,aACE,EAAqB,GACnB,IAAuB,EAAM,SAAS,sBAAsB,GAC5D,IAA0B,EAAM,SAAS,yBAAyB,GAClE,IAAsB,EAAM,SAAS,qBAAqB,GAC1D,IAAiB,EAAM,SAAS,YAAY,GAC5C,IAAQ,EAAM,SAAS,OAAO,GAC9B,IAAU,EAAM,SAAS,SAAS,GAClC,IAAS,EAAM,SAAS,QAAQ,GAChC,IAAwB,EAAM,SAAS,uBAAuB,GAC9D,IAAO,EAAM,SAAS,MAAM,GAC5B,IAAa,EAAM,SAAS,YAAY,GACxC,IAAiB,EAAM,SAAS,gBAAgB,GAChD,IAAmB,EAAM,SAAS,kBAAkB,GACpD,IAAO,EAAM,SAAS,MAAM,GAC5B,IAAa,EAAoB,SAAS,YAAY,GACtD,IAAU,EAAa,MAAM;CAEnC,AADA,EAAuB,GACvB,EAAsB;EACpB;EACA,KAAK,EAAM,QAAQ;EACnB,aAAa;GACX,AAAI,KACF,EAAM,QAAQ,uBAAuB,EAAI;EAE7C;CACF,CAAC;CACD,IAAM,IAAuB,MAAiB,KAAA,IAAY,EAA0B,EAAM,QAAQ,QAAQ,IAAI,GACxG,IAAmB,IAAwB,GAC3C,IAAkB,EAAM,eAAe,cAAc,GAOrD,IAAU,EAAiB,OAAO,GAAgB;EACtD,OAAA;GANA;GACA;GACA;GACA;EAGI;EACJ,OAAO;GAAC;GAAgB;IACtB,IAAI;IACJ,mBAAmB,KAAkB,KAAA;IACrC,oBAAoB,KAAwB,KAAA;IAC5C;IACA,GAAG;IACH,QAAQ,CAAC;IACT,UAAU,GAAO;KACf,AAAI,EAAe,IAAI,EAAM,GAAG,KAC9B,EAAM,gBAAgB;IAE1B;IACA,OAAO,GACJ,EAAmB,gBAAgB,EACtC;GACF;GAAG;EAAY;EACf,KAAK;GAAC;GAAc,EAAM,QAAQ;GAAU;EAAe;EAC3D;CACF,CAAC;CACD,OAAoB,gBAAK,GAAsB;EAC7C,SAAS;EACT,qBAAqB;EACrB,UAAU,CAAC;EACX,iBAAiB,CAAC;EAClB,cAAc;EACd,aAAa;EACb,OAAO,MAAU;EACjB,cAAc;EACd,UAAU;CACZ,CAAC;AACH,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAY,cAAc"}
1
+ {"version":3,"file":"index280.js","names":[],"sources":["../../../node_modules/@base-ui/utils/inertValue.mjs"],"sourcesContent":["import { isReactVersionAtLeast } from \"./reactVersion.mjs\";\nexport function inertValue(value) {\n if (isReactVersionAtLeast(19)) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}"],"x_google_ignoreList":[0],"mappings":";;AACA,SAAgB,EAAW,GAAO;CAKhC,OAJI,EAAsB,EAAE,IACnB,IAGF,IAAQ,SAAS,KAAA;AAC1B"}