react-aria-components 1.5.0 → 1.6.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 (403) hide show
  1. package/dist/Autocomplete.main.js +80 -0
  2. package/dist/Autocomplete.main.js.map +1 -0
  3. package/dist/Autocomplete.mjs +68 -0
  4. package/dist/Autocomplete.module.js +68 -0
  5. package/dist/Autocomplete.module.js.map +1 -0
  6. package/dist/Breadcrumbs.main.js +2 -5
  7. package/dist/Breadcrumbs.main.js.map +1 -1
  8. package/dist/Breadcrumbs.mjs +3 -6
  9. package/dist/Breadcrumbs.module.js +3 -6
  10. package/dist/Breadcrumbs.module.js.map +1 -1
  11. package/dist/Button.main.js +5 -5
  12. package/dist/Button.main.js.map +1 -1
  13. package/dist/Button.mjs +5 -5
  14. package/dist/Button.module.js +5 -5
  15. package/dist/Button.module.js.map +1 -1
  16. package/dist/Calendar.main.js +29 -28
  17. package/dist/Calendar.main.js.map +1 -1
  18. package/dist/Calendar.mjs +30 -29
  19. package/dist/Calendar.module.js +30 -29
  20. package/dist/Calendar.module.js.map +1 -1
  21. package/dist/Checkbox.main.js +5 -12
  22. package/dist/Checkbox.main.js.map +1 -1
  23. package/dist/Checkbox.mjs +6 -13
  24. package/dist/Checkbox.module.js +6 -13
  25. package/dist/Checkbox.module.js.map +1 -1
  26. package/dist/ColorArea.main.js +2 -5
  27. package/dist/ColorArea.main.js.map +1 -1
  28. package/dist/ColorArea.mjs +3 -6
  29. package/dist/ColorArea.module.js +3 -6
  30. package/dist/ColorArea.module.js.map +1 -1
  31. package/dist/ColorField.main.js +2 -5
  32. package/dist/ColorField.main.js.map +1 -1
  33. package/dist/ColorField.mjs +2 -5
  34. package/dist/ColorField.module.js +2 -5
  35. package/dist/ColorField.module.js.map +1 -1
  36. package/dist/ColorSlider.main.js +2 -5
  37. package/dist/ColorSlider.main.js.map +1 -1
  38. package/dist/ColorSlider.mjs +2 -5
  39. package/dist/ColorSlider.module.js +2 -5
  40. package/dist/ColorSlider.module.js.map +1 -1
  41. package/dist/ColorSwatch.main.js +2 -5
  42. package/dist/ColorSwatch.main.js.map +1 -1
  43. package/dist/ColorSwatch.mjs +2 -5
  44. package/dist/ColorSwatch.module.js +2 -5
  45. package/dist/ColorSwatch.module.js.map +1 -1
  46. package/dist/ColorSwatchPicker.main.js +4 -8
  47. package/dist/ColorSwatchPicker.main.js.map +1 -1
  48. package/dist/ColorSwatchPicker.mjs +5 -9
  49. package/dist/ColorSwatchPicker.module.js +5 -9
  50. package/dist/ColorSwatchPicker.module.js.map +1 -1
  51. package/dist/ColorThumb.main.js +2 -5
  52. package/dist/ColorThumb.main.js.map +1 -1
  53. package/dist/ColorThumb.mjs +3 -6
  54. package/dist/ColorThumb.module.js +3 -6
  55. package/dist/ColorThumb.module.js.map +1 -1
  56. package/dist/ColorWheel.main.js +5 -11
  57. package/dist/ColorWheel.main.js.map +1 -1
  58. package/dist/ColorWheel.mjs +6 -12
  59. package/dist/ColorWheel.module.js +6 -12
  60. package/dist/ColorWheel.module.js.map +1 -1
  61. package/dist/ComboBox.main.js +2 -5
  62. package/dist/ComboBox.main.js.map +1 -1
  63. package/dist/ComboBox.mjs +3 -6
  64. package/dist/ComboBox.module.js +3 -6
  65. package/dist/ComboBox.module.js.map +1 -1
  66. package/dist/DateField.main.js +8 -23
  67. package/dist/DateField.main.js.map +1 -1
  68. package/dist/DateField.mjs +9 -24
  69. package/dist/DateField.module.js +9 -24
  70. package/dist/DateField.module.js.map +1 -1
  71. package/dist/DatePicker.main.js +4 -11
  72. package/dist/DatePicker.main.js.map +1 -1
  73. package/dist/DatePicker.mjs +5 -12
  74. package/dist/DatePicker.module.js +5 -12
  75. package/dist/DatePicker.module.js.map +1 -1
  76. package/dist/Dialog.main.js +2 -5
  77. package/dist/Dialog.main.js.map +1 -1
  78. package/dist/Dialog.mjs +3 -6
  79. package/dist/Dialog.module.js +3 -6
  80. package/dist/Dialog.module.js.map +1 -1
  81. package/dist/Disclosure.main.js +6 -16
  82. package/dist/Disclosure.main.js.map +1 -1
  83. package/dist/Disclosure.mjs +6 -16
  84. package/dist/Disclosure.module.js +6 -16
  85. package/dist/Disclosure.module.js.map +1 -1
  86. package/dist/DragAndDrop.main.js +2 -5
  87. package/dist/DragAndDrop.main.js.map +1 -1
  88. package/dist/DragAndDrop.mjs +3 -6
  89. package/dist/DragAndDrop.module.js +3 -6
  90. package/dist/DragAndDrop.module.js.map +1 -1
  91. package/dist/DropZone.main.js +2 -5
  92. package/dist/DropZone.main.js.map +1 -1
  93. package/dist/DropZone.mjs +3 -6
  94. package/dist/DropZone.module.js +3 -6
  95. package/dist/DropZone.module.js.map +1 -1
  96. package/dist/FieldError.main.js +2 -5
  97. package/dist/FieldError.main.js.map +1 -1
  98. package/dist/FieldError.mjs +3 -6
  99. package/dist/FieldError.module.js +3 -6
  100. package/dist/FieldError.module.js.map +1 -1
  101. package/dist/FileTrigger.main.js +2 -5
  102. package/dist/FileTrigger.main.js.map +1 -1
  103. package/dist/FileTrigger.mjs +2 -5
  104. package/dist/FileTrigger.module.js +2 -5
  105. package/dist/FileTrigger.module.js.map +1 -1
  106. package/dist/Form.main.js +2 -6
  107. package/dist/Form.main.js.map +1 -1
  108. package/dist/Form.mjs +2 -6
  109. package/dist/Form.module.js +2 -6
  110. package/dist/Form.module.js.map +1 -1
  111. package/dist/GridList.main.js +2 -6
  112. package/dist/GridList.main.js.map +1 -1
  113. package/dist/GridList.mjs +3 -7
  114. package/dist/GridList.module.js +3 -7
  115. package/dist/GridList.module.js.map +1 -1
  116. package/dist/Group.main.js +2 -5
  117. package/dist/Group.main.js.map +1 -1
  118. package/dist/Group.mjs +2 -5
  119. package/dist/Group.module.js +2 -5
  120. package/dist/Group.module.js.map +1 -1
  121. package/dist/Heading.main.js +2 -3
  122. package/dist/Heading.main.js.map +1 -1
  123. package/dist/Heading.mjs +2 -3
  124. package/dist/Heading.module.js +2 -3
  125. package/dist/Heading.module.js.map +1 -1
  126. package/dist/Input.main.js +2 -5
  127. package/dist/Input.main.js.map +1 -1
  128. package/dist/Input.mjs +2 -5
  129. package/dist/Input.module.js +2 -5
  130. package/dist/Input.module.js.map +1 -1
  131. package/dist/Keyboard.main.js +2 -3
  132. package/dist/Keyboard.main.js.map +1 -1
  133. package/dist/Keyboard.mjs +2 -3
  134. package/dist/Keyboard.module.js +2 -3
  135. package/dist/Keyboard.module.js.map +1 -1
  136. package/dist/Label.main.js +2 -3
  137. package/dist/Label.main.js.map +1 -1
  138. package/dist/Label.mjs +2 -3
  139. package/dist/Label.module.js +2 -3
  140. package/dist/Label.module.js.map +1 -1
  141. package/dist/Link.main.js +2 -6
  142. package/dist/Link.main.js.map +1 -1
  143. package/dist/Link.mjs +2 -6
  144. package/dist/Link.module.js +2 -6
  145. package/dist/Link.module.js.map +1 -1
  146. package/dist/ListBox.main.js +22 -11
  147. package/dist/ListBox.main.js.map +1 -1
  148. package/dist/ListBox.mjs +24 -13
  149. package/dist/ListBox.module.js +24 -13
  150. package/dist/ListBox.module.js.map +1 -1
  151. package/dist/Menu.main.js +21 -13
  152. package/dist/Menu.main.js.map +1 -1
  153. package/dist/Menu.mjs +23 -15
  154. package/dist/Menu.module.js +23 -15
  155. package/dist/Menu.module.js.map +1 -1
  156. package/dist/Meter.main.js +2 -5
  157. package/dist/Meter.main.js.map +1 -1
  158. package/dist/Meter.mjs +2 -5
  159. package/dist/Meter.module.js +2 -5
  160. package/dist/Meter.module.js.map +1 -1
  161. package/dist/Modal.main.js +7 -10
  162. package/dist/Modal.main.js.map +1 -1
  163. package/dist/Modal.mjs +10 -13
  164. package/dist/Modal.module.js +10 -13
  165. package/dist/Modal.module.js.map +1 -1
  166. package/dist/NumberField.main.js +2 -5
  167. package/dist/NumberField.main.js.map +1 -1
  168. package/dist/NumberField.mjs +3 -6
  169. package/dist/NumberField.module.js +3 -6
  170. package/dist/NumberField.module.js.map +1 -1
  171. package/dist/OverlayArrow.main.js +2 -6
  172. package/dist/OverlayArrow.main.js.map +1 -1
  173. package/dist/OverlayArrow.mjs +2 -6
  174. package/dist/OverlayArrow.module.js +2 -6
  175. package/dist/OverlayArrow.module.js.map +1 -1
  176. package/dist/Popover.main.js +4 -7
  177. package/dist/Popover.main.js.map +1 -1
  178. package/dist/Popover.mjs +7 -10
  179. package/dist/Popover.module.js +7 -10
  180. package/dist/Popover.module.js.map +1 -1
  181. package/dist/ProgressBar.main.js +2 -6
  182. package/dist/ProgressBar.main.js.map +1 -1
  183. package/dist/ProgressBar.mjs +2 -6
  184. package/dist/ProgressBar.module.js +2 -6
  185. package/dist/ProgressBar.module.js.map +1 -1
  186. package/dist/RadioGroup.main.js +4 -10
  187. package/dist/RadioGroup.main.js.map +1 -1
  188. package/dist/RadioGroup.mjs +4 -10
  189. package/dist/RadioGroup.module.js +4 -10
  190. package/dist/RadioGroup.module.js.map +1 -1
  191. package/dist/SearchField.main.js +6 -8
  192. package/dist/SearchField.main.js.map +1 -1
  193. package/dist/SearchField.mjs +8 -10
  194. package/dist/SearchField.module.js +8 -10
  195. package/dist/SearchField.module.js.map +1 -1
  196. package/dist/Select.main.js +6 -12
  197. package/dist/Select.main.js.map +1 -1
  198. package/dist/Select.mjs +7 -13
  199. package/dist/Select.module.js +7 -13
  200. package/dist/Select.module.js.map +1 -1
  201. package/dist/Slider.main.js +8 -20
  202. package/dist/Slider.main.js.map +1 -1
  203. package/dist/Slider.mjs +9 -21
  204. package/dist/Slider.module.js +9 -21
  205. package/dist/Slider.module.js.map +1 -1
  206. package/dist/Switch.main.js +2 -5
  207. package/dist/Switch.main.js.map +1 -1
  208. package/dist/Switch.mjs +2 -5
  209. package/dist/Switch.module.js +2 -5
  210. package/dist/Switch.module.js.map +1 -1
  211. package/dist/Table.main.js +6 -12
  212. package/dist/Table.main.js.map +1 -1
  213. package/dist/Table.mjs +7 -13
  214. package/dist/Table.module.js +7 -13
  215. package/dist/Table.module.js.map +1 -1
  216. package/dist/Tabs.main.js +9 -17
  217. package/dist/Tabs.main.js.map +1 -1
  218. package/dist/Tabs.mjs +11 -19
  219. package/dist/Tabs.module.js +11 -19
  220. package/dist/Tabs.module.js.map +1 -1
  221. package/dist/TagGroup.main.js +4 -10
  222. package/dist/TagGroup.main.js.map +1 -1
  223. package/dist/TagGroup.mjs +5 -11
  224. package/dist/TagGroup.module.js +5 -11
  225. package/dist/TagGroup.module.js.map +1 -1
  226. package/dist/Text.main.js +2 -3
  227. package/dist/Text.main.js.map +1 -1
  228. package/dist/Text.mjs +2 -3
  229. package/dist/Text.module.js +2 -3
  230. package/dist/Text.module.js.map +1 -1
  231. package/dist/TextArea.main.js +2 -5
  232. package/dist/TextArea.main.js.map +1 -1
  233. package/dist/TextArea.mjs +2 -5
  234. package/dist/TextArea.module.js +2 -5
  235. package/dist/TextArea.module.js.map +1 -1
  236. package/dist/TextField.main.js +9 -9
  237. package/dist/TextField.main.js.map +1 -1
  238. package/dist/TextField.mjs +11 -11
  239. package/dist/TextField.module.js +11 -11
  240. package/dist/TextField.module.js.map +1 -1
  241. package/dist/ToggleButton.main.js +2 -5
  242. package/dist/ToggleButton.main.js.map +1 -1
  243. package/dist/ToggleButton.mjs +3 -6
  244. package/dist/ToggleButton.module.js +3 -6
  245. package/dist/ToggleButton.module.js.map +1 -1
  246. package/dist/ToggleButtonGroup.main.js +2 -5
  247. package/dist/ToggleButtonGroup.main.js.map +1 -1
  248. package/dist/ToggleButtonGroup.mjs +2 -5
  249. package/dist/ToggleButtonGroup.module.js +2 -5
  250. package/dist/ToggleButtonGroup.module.js.map +1 -1
  251. package/dist/Toolbar.main.js +2 -6
  252. package/dist/Toolbar.main.js.map +1 -1
  253. package/dist/Toolbar.mjs +2 -6
  254. package/dist/Toolbar.module.js +2 -6
  255. package/dist/Toolbar.module.js.map +1 -1
  256. package/dist/Tooltip.main.js +4 -7
  257. package/dist/Tooltip.main.js.map +1 -1
  258. package/dist/Tooltip.mjs +7 -10
  259. package/dist/Tooltip.module.js +7 -10
  260. package/dist/Tooltip.module.js.map +1 -1
  261. package/dist/Tree.main.js +2 -6
  262. package/dist/Tree.main.js.map +1 -1
  263. package/dist/Tree.mjs +3 -7
  264. package/dist/Tree.module.js +3 -7
  265. package/dist/Tree.module.js.map +1 -1
  266. package/dist/import.mjs +4 -2
  267. package/dist/main.js +6 -0
  268. package/dist/main.js.map +1 -1
  269. package/dist/module.js +4 -2
  270. package/dist/module.js.map +1 -1
  271. package/dist/types.d.ts +230 -220
  272. package/dist/types.d.ts.map +1 -1
  273. package/dist/utils.main.js +0 -61
  274. package/dist/utils.main.js.map +1 -1
  275. package/dist/utils.mjs +1 -60
  276. package/dist/utils.module.js +1 -60
  277. package/dist/utils.module.js.map +1 -1
  278. package/i18n/ar-AE.js +1 -1
  279. package/i18n/ar-AE.mjs +1 -1
  280. package/i18n/bg-BG.js +1 -1
  281. package/i18n/bg-BG.mjs +1 -1
  282. package/i18n/cs-CZ.js +1 -1
  283. package/i18n/cs-CZ.mjs +1 -1
  284. package/i18n/da-DK.js +1 -1
  285. package/i18n/da-DK.mjs +1 -1
  286. package/i18n/de-DE.js +1 -1
  287. package/i18n/de-DE.mjs +1 -1
  288. package/i18n/el-GR.js +1 -1
  289. package/i18n/el-GR.mjs +1 -1
  290. package/i18n/en-US.js +1 -1
  291. package/i18n/en-US.mjs +1 -1
  292. package/i18n/es-ES.js +1 -1
  293. package/i18n/es-ES.mjs +1 -1
  294. package/i18n/et-EE.js +1 -1
  295. package/i18n/et-EE.mjs +1 -1
  296. package/i18n/fi-FI.js +1 -1
  297. package/i18n/fi-FI.mjs +1 -1
  298. package/i18n/fr-FR.js +1 -1
  299. package/i18n/fr-FR.mjs +1 -1
  300. package/i18n/he-IL.js +1 -1
  301. package/i18n/he-IL.mjs +1 -1
  302. package/i18n/hr-HR.js +1 -1
  303. package/i18n/hr-HR.mjs +1 -1
  304. package/i18n/hu-HU.js +1 -1
  305. package/i18n/hu-HU.mjs +1 -1
  306. package/i18n/index.js +1 -1
  307. package/i18n/index.mjs +1 -1
  308. package/i18n/it-IT.js +1 -1
  309. package/i18n/it-IT.mjs +1 -1
  310. package/i18n/ja-JP.js +1 -1
  311. package/i18n/ja-JP.mjs +1 -1
  312. package/i18n/ko-KR.js +1 -1
  313. package/i18n/ko-KR.mjs +1 -1
  314. package/i18n/lt-LT.js +1 -1
  315. package/i18n/lt-LT.mjs +1 -1
  316. package/i18n/lv-LV.js +1 -1
  317. package/i18n/lv-LV.mjs +1 -1
  318. package/i18n/nb-NO.js +1 -1
  319. package/i18n/nb-NO.mjs +1 -1
  320. package/i18n/nl-NL.js +1 -1
  321. package/i18n/nl-NL.mjs +1 -1
  322. package/i18n/pl-PL.js +1 -1
  323. package/i18n/pl-PL.mjs +1 -1
  324. package/i18n/pt-BR.js +1 -1
  325. package/i18n/pt-BR.mjs +1 -1
  326. package/i18n/pt-PT.js +1 -1
  327. package/i18n/pt-PT.mjs +1 -1
  328. package/i18n/ro-RO.js +1 -1
  329. package/i18n/ro-RO.mjs +1 -1
  330. package/i18n/ru-RU.js +1 -1
  331. package/i18n/ru-RU.mjs +1 -1
  332. package/i18n/sk-SK.js +1 -1
  333. package/i18n/sk-SK.mjs +1 -1
  334. package/i18n/sl-SI.js +1 -1
  335. package/i18n/sl-SI.mjs +1 -1
  336. package/i18n/sr-SP.js +1 -1
  337. package/i18n/sr-SP.mjs +1 -1
  338. package/i18n/sv-SE.js +1 -1
  339. package/i18n/sv-SE.mjs +1 -1
  340. package/i18n/tr-TR.js +1 -1
  341. package/i18n/tr-TR.mjs +1 -1
  342. package/i18n/uk-UA.js +1 -1
  343. package/i18n/uk-UA.mjs +1 -1
  344. package/i18n/zh-CN.js +1 -1
  345. package/i18n/zh-CN.mjs +1 -1
  346. package/i18n/zh-TW.js +1 -1
  347. package/i18n/zh-TW.mjs +1 -1
  348. package/package.json +30 -28
  349. package/src/Autocomplete.tsx +71 -0
  350. package/src/Breadcrumbs.tsx +5 -8
  351. package/src/Button.tsx +8 -8
  352. package/src/Calendar.tsx +35 -39
  353. package/src/Checkbox.tsx +11 -17
  354. package/src/ColorArea.tsx +5 -8
  355. package/src/ColorField.tsx +5 -8
  356. package/src/ColorSlider.tsx +5 -8
  357. package/src/ColorSwatch.tsx +5 -8
  358. package/src/ColorSwatchPicker.tsx +7 -13
  359. package/src/ColorThumb.tsx +5 -8
  360. package/src/ColorWheel.tsx +10 -16
  361. package/src/ComboBox.tsx +5 -8
  362. package/src/DateField.tsx +21 -33
  363. package/src/DatePicker.tsx +9 -15
  364. package/src/Dialog.tsx +5 -8
  365. package/src/Disclosure.tsx +16 -25
  366. package/src/DragAndDrop.tsx +5 -8
  367. package/src/DropZone.tsx +5 -8
  368. package/src/FieldError.tsx +5 -8
  369. package/src/FileTrigger.tsx +5 -8
  370. package/src/Form.tsx +6 -9
  371. package/src/GridList.tsx +6 -9
  372. package/src/Group.tsx +5 -8
  373. package/src/Heading.tsx +2 -5
  374. package/src/Input.tsx +5 -8
  375. package/src/Keyboard.tsx +2 -5
  376. package/src/Label.tsx +2 -5
  377. package/src/Link.tsx +6 -9
  378. package/src/ListBox.tsx +16 -15
  379. package/src/Menu.tsx +20 -19
  380. package/src/Meter.tsx +5 -8
  381. package/src/Modal.tsx +7 -10
  382. package/src/NumberField.tsx +5 -8
  383. package/src/OverlayArrow.tsx +6 -9
  384. package/src/Popover.tsx +7 -10
  385. package/src/ProgressBar.tsx +6 -9
  386. package/src/RadioGroup.tsx +10 -16
  387. package/src/SearchField.tsx +9 -11
  388. package/src/Select.tsx +12 -17
  389. package/src/Slider.tsx +20 -32
  390. package/src/Switch.tsx +5 -8
  391. package/src/Table.tsx +10 -19
  392. package/src/Tabs.tsx +18 -25
  393. package/src/TagGroup.tsx +8 -14
  394. package/src/Text.tsx +2 -5
  395. package/src/TextArea.tsx +5 -7
  396. package/src/TextField.tsx +11 -13
  397. package/src/ToggleButton.tsx +5 -8
  398. package/src/ToggleButtonGroup.tsx +5 -8
  399. package/src/Toolbar.tsx +6 -9
  400. package/src/Tooltip.tsx +7 -10
  401. package/src/Tree.tsx +6 -9
  402. package/src/index.ts +3 -1
  403. package/src/utils.tsx +0 -71
package/dist/Menu.mjs CHANGED
@@ -6,13 +6,14 @@ import {OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe}
6
6
  import {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from "./Popover.mjs";
7
7
  import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.mjs";
8
8
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
9
+ import {UNSTABLE_InternalAutocompleteContext as $d2f53cda644affe3$export$65d2a03b8800d6e3} from "./Autocomplete.mjs";
9
10
  import {useMenuTrigger as $kM2ZM$useMenuTrigger, useMenu as $kM2ZM$useMenu, FocusScope as $kM2ZM$FocusScope, useMenuSection as $kM2ZM$useMenuSection, useMenuItem as $kM2ZM$useMenuItem, useFocusRing as $kM2ZM$useFocusRing, mergeProps as $kM2ZM$mergeProps} from "react-aria";
10
- import {useMenuTriggerState as $kM2ZM$useMenuTriggerState, useTreeState as $kM2ZM$useTreeState} from "react-stately";
11
11
  import {createBranchComponent as $kM2ZM$createBranchComponent, CollectionBuilder as $kM2ZM$CollectionBuilder, Collection as $kM2ZM$Collection, createLeafComponent as $kM2ZM$createLeafComponent} from "@react-aria/collections";
12
- import {useResizeObserver as $kM2ZM$useResizeObserver, useObjectRef as $kM2ZM$useObjectRef, filterDOMProps as $kM2ZM$filterDOMProps} from "@react-aria/utils";
12
+ import {useMenuTriggerState as $kM2ZM$useMenuTriggerState, useTreeState as $kM2ZM$useTreeState} from "react-stately";
13
+ import {useResizeObserver as $kM2ZM$useResizeObserver, useObjectRef as $kM2ZM$useObjectRef, mergeRefs as $kM2ZM$mergeRefs, filterDOMProps as $kM2ZM$filterDOMProps} from "@react-aria/utils";
13
14
  import {SelectionManager as $kM2ZM$SelectionManager, useMultipleSelectionState as $kM2ZM$useMultipleSelectionState} from "@react-stately/selection";
14
15
  import {PressResponder as $kM2ZM$PressResponder, useHover as $kM2ZM$useHover} from "@react-aria/interactions";
15
- import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$useRef, useState as $kM2ZM$useState, useCallback as $kM2ZM$useCallback, useContext as $kM2ZM$useContext, forwardRef as $kM2ZM$forwardRef} from "react";
16
+ import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$useRef, useState as $kM2ZM$useState, useCallback as $kM2ZM$useCallback, useContext as $kM2ZM$useContext, forwardRef as $kM2ZM$forwardRef, useMemo as $kM2ZM$useMemo} from "react";
16
17
  import {useSubmenuTriggerState as $kM2ZM$useSubmenuTriggerState} from "@react-stately/menu";
17
18
  import {useSubmenuTrigger as $kM2ZM$useSubmenuTrigger} from "@react-aria/menu";
18
19
 
@@ -43,6 +44,7 @@ import {useSubmenuTrigger as $kM2ZM$useSubmenuTrigger} from "@react-aria/menu";
43
44
 
44
45
 
45
46
 
47
+
46
48
  const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
47
49
  const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
48
50
  const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
@@ -155,7 +157,7 @@ const $3674c52c6b3c5bce$export$ecabc99eeffab7ca = /*#__PURE__*/ (0, $kM2ZM$creat
155
157
  parent: item
156
158
  }), props.children[1]);
157
159
  }, (props)=>props.children[0]);
158
- function $3674c52c6b3c5bce$var$Menu(props, ref) {
160
+ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwardRef)(function Menu(props, ref) {
159
161
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3674c52c6b3c5bce$export$c7e742effb1c51e2);
160
162
  // Delay rendering the actual menu until we have the collection so that auto focus works properly.
161
163
  return /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $kM2ZM$CollectionBuilder), {
@@ -165,17 +167,28 @@ function $3674c52c6b3c5bce$var$Menu(props, ref) {
165
167
  collection: collection,
166
168
  menuRef: ref
167
169
  }));
168
- }
170
+ });
169
171
  function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
172
+ let { filterFn: filterFn, collectionProps: autocompleteMenuProps, collectionRef: collectionRef } = (0, $kM2ZM$useContext)((0, $d2f53cda644affe3$export$65d2a03b8800d6e3)) || {};
173
+ // Memoed so that useAutocomplete callback ref is properly only called once on mount and not everytime a rerender happens
174
+ ref = (0, $kM2ZM$useObjectRef)((0, $kM2ZM$useMemo)(()=>(0, $kM2ZM$mergeRefs)(ref, collectionRef !== undefined ? collectionRef : null), [
175
+ collectionRef,
176
+ ref
177
+ ]));
178
+ let filteredCollection = (0, $kM2ZM$useMemo)(()=>filterFn ? collection.filter(filterFn) : collection, [
179
+ collection,
180
+ filterFn
181
+ ]);
170
182
  let state = (0, $kM2ZM$useTreeState)({
171
183
  ...props,
172
- collection: collection,
184
+ collection: filteredCollection,
173
185
  children: undefined
174
186
  });
175
187
  let triggerState = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$795aec4671cbae19);
176
188
  let { isVirtualized: isVirtualized, CollectionRoot: CollectionRoot } = (0, $kM2ZM$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
177
189
  let { menuProps: menuProps } = (0, $kM2ZM$useMenu)({
178
190
  ...props,
191
+ ...autocompleteMenuProps,
179
192
  isVirtualized: isVirtualized,
180
193
  onClose: props.onClose || (triggerState === null || triggerState === void 0 ? void 0 : triggerState.close)
181
194
  }, state, ref);
@@ -208,7 +221,7 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
208
221
  (0, $7135fc7d473fd974$export$d40e14dec8b060a8),
209
222
  {
210
223
  name: 'MenuSection',
211
- render: $3674c52c6b3c5bce$var$MenuSection
224
+ render: $3674c52c6b3c5bce$var$MenuSectionInner
212
225
  }
213
226
  ],
214
227
  [
@@ -227,14 +240,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
227
240
  ]
228
241
  ]
229
242
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
230
- collection: collection,
243
+ collection: state.collection,
231
244
  persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey),
232
245
  scrollRef: ref
233
246
  }))));
234
247
  }
235
- /**
236
- * A menu displays a list of actions or options that a user can choose.
237
- */ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwardRef)($3674c52c6b3c5bce$var$Menu);
238
248
  // A subclass of SelectionManager that forwards focus-related properties to the parent,
239
249
  // but has its own local selection state.
240
250
  class $3674c52c6b3c5bce$var$GroupSelectionManager extends (0, $kM2ZM$SelectionManager) {
@@ -258,7 +268,7 @@ class $3674c52c6b3c5bce$var$GroupSelectionManager extends (0, $kM2ZM$SelectionMa
258
268
  this.parent = parent;
259
269
  }
260
270
  }
261
- function $3674c52c6b3c5bce$var$MenuSection(props, ref, section, className = 'react-aria-MenuSection') {
271
+ function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className = 'react-aria-MenuSection') {
262
272
  var _section_props, _section_props1;
263
273
  let state = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
264
274
  let { CollectionBranch: CollectionBranch } = (0, $kM2ZM$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -301,9 +311,7 @@ function $3674c52c6b3c5bce$var$MenuSection(props, ref, section, className = 'rea
301
311
  parent: section
302
312
  })));
303
313
  }
304
- /**
305
- * A MenuSection represents a section within a Menu.
306
- */ const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $kM2ZM$createBranchComponent)('section', $3674c52c6b3c5bce$var$MenuSection);
314
+ const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $kM2ZM$createBranchComponent)('section', $3674c52c6b3c5bce$var$MenuSectionInner);
307
315
  const $3674c52c6b3c5bce$var$MenuItemContext = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
308
316
  const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$createLeafComponent)('item', function MenuItem(props, forwardedRef, item) {
309
317
  var _useSlottedContext;
@@ -6,13 +6,14 @@ import {OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe}
6
6
  import {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from "./Popover.module.js";
7
7
  import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.module.js";
8
8
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
9
+ import {UNSTABLE_InternalAutocompleteContext as $d2f53cda644affe3$export$65d2a03b8800d6e3} from "./Autocomplete.module.js";
9
10
  import {useMenuTrigger as $kM2ZM$useMenuTrigger, useMenu as $kM2ZM$useMenu, FocusScope as $kM2ZM$FocusScope, useMenuSection as $kM2ZM$useMenuSection, useMenuItem as $kM2ZM$useMenuItem, useFocusRing as $kM2ZM$useFocusRing, mergeProps as $kM2ZM$mergeProps} from "react-aria";
10
- import {useMenuTriggerState as $kM2ZM$useMenuTriggerState, useTreeState as $kM2ZM$useTreeState} from "react-stately";
11
11
  import {createBranchComponent as $kM2ZM$createBranchComponent, CollectionBuilder as $kM2ZM$CollectionBuilder, Collection as $kM2ZM$Collection, createLeafComponent as $kM2ZM$createLeafComponent} from "@react-aria/collections";
12
- import {useResizeObserver as $kM2ZM$useResizeObserver, useObjectRef as $kM2ZM$useObjectRef, filterDOMProps as $kM2ZM$filterDOMProps} from "@react-aria/utils";
12
+ import {useMenuTriggerState as $kM2ZM$useMenuTriggerState, useTreeState as $kM2ZM$useTreeState} from "react-stately";
13
+ import {useResizeObserver as $kM2ZM$useResizeObserver, useObjectRef as $kM2ZM$useObjectRef, mergeRefs as $kM2ZM$mergeRefs, filterDOMProps as $kM2ZM$filterDOMProps} from "@react-aria/utils";
13
14
  import {SelectionManager as $kM2ZM$SelectionManager, useMultipleSelectionState as $kM2ZM$useMultipleSelectionState} from "@react-stately/selection";
14
15
  import {PressResponder as $kM2ZM$PressResponder, useHover as $kM2ZM$useHover} from "@react-aria/interactions";
15
- import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$useRef, useState as $kM2ZM$useState, useCallback as $kM2ZM$useCallback, useContext as $kM2ZM$useContext, forwardRef as $kM2ZM$forwardRef} from "react";
16
+ import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$useRef, useState as $kM2ZM$useState, useCallback as $kM2ZM$useCallback, useContext as $kM2ZM$useContext, forwardRef as $kM2ZM$forwardRef, useMemo as $kM2ZM$useMemo} from "react";
16
17
  import {useSubmenuTriggerState as $kM2ZM$useSubmenuTriggerState} from "@react-stately/menu";
17
18
  import {useSubmenuTrigger as $kM2ZM$useSubmenuTrigger} from "@react-aria/menu";
18
19
 
@@ -43,6 +44,7 @@ import {useSubmenuTrigger as $kM2ZM$useSubmenuTrigger} from "@react-aria/menu";
43
44
 
44
45
 
45
46
 
47
+
46
48
  const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
47
49
  const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
48
50
  const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
@@ -155,7 +157,7 @@ const $3674c52c6b3c5bce$export$ecabc99eeffab7ca = /*#__PURE__*/ (0, $kM2ZM$creat
155
157
  parent: item
156
158
  }), props.children[1]);
157
159
  }, (props)=>props.children[0]);
158
- function $3674c52c6b3c5bce$var$Menu(props, ref) {
160
+ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwardRef)(function Menu(props, ref) {
159
161
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3674c52c6b3c5bce$export$c7e742effb1c51e2);
160
162
  // Delay rendering the actual menu until we have the collection so that auto focus works properly.
161
163
  return /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $kM2ZM$CollectionBuilder), {
@@ -165,17 +167,28 @@ function $3674c52c6b3c5bce$var$Menu(props, ref) {
165
167
  collection: collection,
166
168
  menuRef: ref
167
169
  }));
168
- }
170
+ });
169
171
  function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
172
+ let { filterFn: filterFn, collectionProps: autocompleteMenuProps, collectionRef: collectionRef } = (0, $kM2ZM$useContext)((0, $d2f53cda644affe3$export$65d2a03b8800d6e3)) || {};
173
+ // Memoed so that useAutocomplete callback ref is properly only called once on mount and not everytime a rerender happens
174
+ ref = (0, $kM2ZM$useObjectRef)((0, $kM2ZM$useMemo)(()=>(0, $kM2ZM$mergeRefs)(ref, collectionRef !== undefined ? collectionRef : null), [
175
+ collectionRef,
176
+ ref
177
+ ]));
178
+ let filteredCollection = (0, $kM2ZM$useMemo)(()=>filterFn ? collection.filter(filterFn) : collection, [
179
+ collection,
180
+ filterFn
181
+ ]);
170
182
  let state = (0, $kM2ZM$useTreeState)({
171
183
  ...props,
172
- collection: collection,
184
+ collection: filteredCollection,
173
185
  children: undefined
174
186
  });
175
187
  let triggerState = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$795aec4671cbae19);
176
188
  let { isVirtualized: isVirtualized, CollectionRoot: CollectionRoot } = (0, $kM2ZM$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
177
189
  let { menuProps: menuProps } = (0, $kM2ZM$useMenu)({
178
190
  ...props,
191
+ ...autocompleteMenuProps,
179
192
  isVirtualized: isVirtualized,
180
193
  onClose: props.onClose || (triggerState === null || triggerState === void 0 ? void 0 : triggerState.close)
181
194
  }, state, ref);
@@ -208,7 +221,7 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
208
221
  (0, $7135fc7d473fd974$export$d40e14dec8b060a8),
209
222
  {
210
223
  name: 'MenuSection',
211
- render: $3674c52c6b3c5bce$var$MenuSection
224
+ render: $3674c52c6b3c5bce$var$MenuSectionInner
212
225
  }
213
226
  ],
214
227
  [
@@ -227,14 +240,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
227
240
  ]
228
241
  ]
229
242
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
230
- collection: collection,
243
+ collection: state.collection,
231
244
  persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey),
232
245
  scrollRef: ref
233
246
  }))));
234
247
  }
235
- /**
236
- * A menu displays a list of actions or options that a user can choose.
237
- */ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwardRef)($3674c52c6b3c5bce$var$Menu);
238
248
  // A subclass of SelectionManager that forwards focus-related properties to the parent,
239
249
  // but has its own local selection state.
240
250
  class $3674c52c6b3c5bce$var$GroupSelectionManager extends (0, $kM2ZM$SelectionManager) {
@@ -258,7 +268,7 @@ class $3674c52c6b3c5bce$var$GroupSelectionManager extends (0, $kM2ZM$SelectionMa
258
268
  this.parent = parent;
259
269
  }
260
270
  }
261
- function $3674c52c6b3c5bce$var$MenuSection(props, ref, section, className = 'react-aria-MenuSection') {
271
+ function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className = 'react-aria-MenuSection') {
262
272
  var _section_props, _section_props1;
263
273
  let state = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
264
274
  let { CollectionBranch: CollectionBranch } = (0, $kM2ZM$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -301,9 +311,7 @@ function $3674c52c6b3c5bce$var$MenuSection(props, ref, section, className = 'rea
301
311
  parent: section
302
312
  })));
303
313
  }
304
- /**
305
- * A MenuSection represents a section within a Menu.
306
- */ const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $kM2ZM$createBranchComponent)('section', $3674c52c6b3c5bce$var$MenuSection);
314
+ const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $kM2ZM$createBranchComponent)('section', $3674c52c6b3c5bce$var$MenuSectionInner);
307
315
  const $3674c52c6b3c5bce$var$MenuItemContext = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
308
316
  const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$createLeafComponent)('item', function MenuItem(props, forwardedRef, item) {
309
317
  var _useSlottedContext;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAiCM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,oBAAY,EAA+B;AACtF,MAAM,8DAA0B,CAAA,GAAA,oBAAY,EAA2B;AAMhE,SAAS,0CAAY,KAAuB;IACjD,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;IAChC,IAAI,MAAM,CAAA,GAAA,aAAK,EAAqB;IACpC,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QACjD,GAAG,KAAK;QACR,MAAM;IACR,GAAG,OAAO;IACV,oCAAoC;IACpC,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,eAAO,EAAiB;IAC5D,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE;QACzB,IAAI,IAAI,OAAO,EACb,eAAe,IAAI,OAAO,CAAC,WAAW,GAAG;IAE7C,GAAG;QAAC;KAAI;IAER,CAAA,GAAA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mBAAmB,iBAAiB,iBAAiB;YACrD,YAAY,CAAC,CAAC,KAAK,CAAC,gBAAgB;YACpC,QAAQ,KAAK,CAAC,gBAAgB,KAAK;QACrC;IACF;IAEA,IAAI,cAAiC,MAAM,IAAI,GAAG,MAAM;IAExD,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,eAAe,YAAY,WAAW;QACpD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,iBAAe,OAAO,UAAU,IAAI;QACpC,uBAAqB,iBAAiB,aAAa,KAAK,SAAS,YAAY,iBAAiB,aAAa;QAC3G,oBAAkB,CAAC,CAAC,KAAK,CAAC,gBAAgB,IAAI;QAC9C,aAAW,KAAK,CAAC,gBAAgB,KAAK,UAAU;qBAChD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;SACzC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n\nimport {AriaMenuProps, FocusScope, mergeProps, useFocusRing, useMenu, useMenuItem, useMenuSection, useMenuTrigger} from 'react-aria';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, TreeState, useMenuTriggerState, useTreeState} from 'react-stately';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, HoverEvents, Key, LinkDOMProps, MultipleSelection} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {RootMenuTriggerState, useSubmenuTriggerState} from '@react-stately/menu';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {useSubmenuTrigger} from '@react-aria/menu';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps) {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>} | null>(null);\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent('submenutrigger', (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, submenuProps],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n ref: submenuRef,\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n // Prevent parent popover from hiding submenu.\n // @ts-ignore\n 'data-react-aria-top-layer': true,\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleProps, SlotProps, ScrollableProps<HTMLDivElement> {}\n\nfunction Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => collection.size > 0 && <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface MenuInnerProps<T> {\n props: MenuProps<T>,\n collection: ICollection<Node<object>>,\n menuRef: RefObject<HTMLDivElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n let state = useTreeState({\n ...props,\n collection,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized, onClose: props.onClose || triggerState?.close}, state, ref);\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...menuProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSection}],\n [SubmenuTriggerContext, {parentMenuRef: ref}],\n [MenuItemContext, null],\n [SelectionManagerContext, state.selectionManager]\n ]}>\n <CollectionRoot\n collection={collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nconst _Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(Menu);\nexport {_Menu as Menu};\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSection<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nconst _MenuSection = /*#__PURE__*/ createBranchComponent('section', MenuSection);\nexport {_MenuSection as MenuSection};\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean,\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean\n}\n\nexport interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the item is selected. */\n onAction?: () => void\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent('item', function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(menuItemProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAkCM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,oBAAY,EAA+B;AACtF,MAAM,8DAA0B,CAAA,GAAA,oBAAY,EAA2B;AAMhE,SAAS,0CAAY,KAAuB;IACjD,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;IAChC,IAAI,MAAM,CAAA,GAAA,aAAK,EAAqB;IACpC,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QACjD,GAAG,KAAK;QACR,MAAM;IACR,GAAG,OAAO;IACV,oCAAoC;IACpC,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,eAAO,EAAi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BAAG;oBACZ,OAAO;wBACL,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;SACzC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMenuProps, FocusScope, mergeProps, useFocusRing, useMenu, useMenuItem, useMenuSection, useMenuTrigger} from 'react-aria';\nimport {BaseCollection, Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, TreeState, useMenuTriggerState, useTreeState} from 'react-stately';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeRefs, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, HoverEvents, Key, LinkDOMProps, MultipleSelection} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {RootMenuTriggerState, useSubmenuTriggerState} from '@react-stately/menu';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {UNSTABLE_InternalAutocompleteContext} from './Autocomplete';\nimport {useSubmenuTrigger} from '@react-aria/menu';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps) {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>} | null>(null);\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent('submenutrigger', (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, submenuProps],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n ref: submenuRef,\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n // Prevent parent popover from hiding submenu.\n // @ts-ignore\n 'data-react-aria-top-layer': true,\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleProps, SlotProps, ScrollableProps<HTMLDivElement> {}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nexport const Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(function Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => collection.size > 0 && <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface MenuInnerProps<T> {\n props: MenuProps<T>,\n collection: BaseCollection<object>,\n menuRef: RefObject<HTMLDivElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n let {filterFn, collectionProps: autocompleteMenuProps, collectionRef} = useContext(UNSTABLE_InternalAutocompleteContext) || {};\n // Memoed so that useAutocomplete callback ref is properly only called once on mount and not everytime a rerender happens\n ref = useObjectRef(useMemo(() => mergeRefs(ref, collectionRef !== undefined ? collectionRef as RefObject<HTMLDivElement> : null), [collectionRef, ref]));\n let filteredCollection = useMemo(() => filterFn ? collection.filter(filterFn) : collection, [collection, filterFn]);\n let state = useTreeState({\n ...props,\n collection: filteredCollection as ICollection<Node<object>>,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, ...autocompleteMenuProps, isVirtualized, onClose: props.onClose || triggerState?.close}, state, ref);\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...menuProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSectionInner}],\n [SubmenuTriggerContext, {parentMenuRef: ref}],\n [MenuItemContext, null],\n [SelectionManagerContext, state.selectionManager]\n ]}>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n </div>\n </FocusScope>\n );\n}\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nexport const MenuSection = /*#__PURE__*/ createBranchComponent('section', MenuSectionInner);\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean,\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean\n}\n\nexport interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the item is selected. */\n onAction?: () => void\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent('item', function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(menuItemProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.module.js.map"}
@@ -31,7 +31,7 @@ $parcel$export(module.exports, "Meter", () => $e85da53562ca5320$export$62e3ae2a4
31
31
 
32
32
 
33
33
  const $e85da53562ca5320$export$8b645da15a96b44f = /*#__PURE__*/ (0, $ixfXu$react.createContext)(null);
34
- function $e85da53562ca5320$var$Meter(props, ref) {
34
+ const $e85da53562ca5320$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $ixfXu$react.forwardRef)(function Meter(props, ref) {
35
35
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $e85da53562ca5320$export$8b645da15a96b44f);
36
36
  let { value: value = 0, minValue: minValue = 0, maxValue: maxValue = 100 } = props;
37
37
  value = (0, $ixfXu$reactstatelyutils.clamp)(value, minValue, maxValue);
@@ -62,10 +62,7 @@ function $e85da53562ca5320$var$Meter(props, ref) {
62
62
  elementType: 'span'
63
63
  }
64
64
  }, renderProps.children));
65
- }
66
- /**
67
- * A meter represents a quantity within a known range, or a fractional value.
68
- */ const $e85da53562ca5320$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $ixfXu$react.forwardRef)($e85da53562ca5320$var$Meter);
65
+ });
69
66
 
70
67
 
71
68
  //# sourceMappingURL=Meter.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA4C;AAEpF,SAAS,4BAAM,KAAiB,EAAE,GAAiC;IACjE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SACF,QAAQ,aACR,WAAW,aACX,WAAW,KACZ,GAAG;IACJ,QAAQ,CAAA,GAAA,8BAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,EACX,GAAG,CAAA,GAAA,yBAAO,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAE7B,0DAA0D;IAC1D,IAAI,aAAa,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAK;IAE9D,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,UAAU,CAAC,iBAAiB;QACzC;IACF;IAEA,qBACE,0DAAC;QAAK,GAAG,UAAU;QAAG,GAAG,WAAW;QAAE,KAAK;QAAK,MAAM,MAAM,IAAI,IAAI;qBAClE,0DAAC,CAAA,GAAA,sCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B;AAEA;;CAEC,GACD,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB","sources":["packages/react-aria-components/src/Meter.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMeterProps, useMeter} from 'react-aria';\nimport {clamp} from '@react-stately/utils';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'label'>, RenderProps<MeterRenderProps>, SlotProps {}\n\nexport interface MeterRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number,\n /**\n * A formatted version of the value.\n * @selector [aria-valuetext]\n */\n valueText: string | undefined\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, HTMLDivElement>>(null);\n\nfunction Meter(props: MeterProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MeterContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100\n } = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot();\n let {\n meterProps,\n labelProps\n } = useMeter({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = (value - minValue) / (maxValue - minValue) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Meter',\n values: {\n percentage,\n valueText: meterProps['aria-valuetext']\n }\n });\n\n return (\n <div {...meterProps} {...renderProps} ref={ref} slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </div>\n );\n}\n\n/**\n * A meter represents a quantity within a known range, or a fractional value.\n */\nconst _Meter = /*#__PURE__*/ (forwardRef as forwardRefType)(Meter);\nexport {_Meter as Meter};\n"],"names":[],"version":3,"file":"Meter.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA4C;AAK7E,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,MAAM,KAAiB,EAAE,GAAiC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SACF,QAAQ,aACR,WAAW,aACX,WAAW,KACZ,GAAG;IACJ,QAAQ,CAAA,GAAA,8BAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,EACX,GAAG,CAAA,GAAA,yBAAO,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAE7B,0DAA0D;IAC1D,IAAI,aAAa,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAK;IAE9D,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,UAAU,CAAC,iBAAiB;QACzC;IACF;IAEA,qBACE,0DAAC;QAAK,GAAG,UAAU;QAAG,GAAG,WAAW;QAAE,KAAK;QAAK,MAAM,MAAM,IAAI,IAAI;qBAClE,0DAAC,CAAA,GAAA,sCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Meter.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMeterProps, useMeter} from 'react-aria';\nimport {clamp} from '@react-stately/utils';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'label'>, RenderProps<MeterRenderProps>, SlotProps {}\n\nexport interface MeterRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number,\n /**\n * A formatted version of the value.\n * @selector [aria-valuetext]\n */\n valueText: string | undefined\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, HTMLDivElement>>(null);\n\n/**\n * A meter represents a quantity within a known range, or a fractional value.\n */\nexport const Meter = /*#__PURE__*/ (forwardRef as forwardRefType)(function Meter(props: MeterProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MeterContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100\n } = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot();\n let {\n meterProps,\n labelProps\n } = useMeter({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = (value - minValue) / (maxValue - minValue) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Meter',\n values: {\n percentage,\n valueText: meterProps['aria-valuetext']\n }\n });\n\n return (\n <div {...meterProps} {...renderProps} ref={ref} slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Meter.main.js.map"}
package/dist/Meter.mjs CHANGED
@@ -20,7 +20,7 @@ import $9ESvm$react, {createContext as $9ESvm$createContext, forwardRef as $9ESv
20
20
 
21
21
 
22
22
  const $c0c9ced265f3594c$export$8b645da15a96b44f = /*#__PURE__*/ (0, $9ESvm$createContext)(null);
23
- function $c0c9ced265f3594c$var$Meter(props, ref) {
23
+ const $c0c9ced265f3594c$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $9ESvm$forwardRef)(function Meter(props, ref) {
24
24
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $c0c9ced265f3594c$export$8b645da15a96b44f);
25
25
  let { value: value = 0, minValue: minValue = 0, maxValue: maxValue = 100 } = props;
26
26
  value = (0, $9ESvm$clamp)(value, minValue, maxValue);
@@ -51,10 +51,7 @@ function $c0c9ced265f3594c$var$Meter(props, ref) {
51
51
  elementType: 'span'
52
52
  }
53
53
  }, renderProps.children));
54
- }
55
- /**
56
- * A meter represents a quantity within a known range, or a fractional value.
57
- */ const $c0c9ced265f3594c$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $9ESvm$forwardRef)($c0c9ced265f3594c$var$Meter);
54
+ });
58
55
 
59
56
 
60
57
  export {$c0c9ced265f3594c$export$8b645da15a96b44f as MeterContext, $c0c9ced265f3594c$export$62e3ae2a4090b879 as Meter};
@@ -20,7 +20,7 @@ import $9ESvm$react, {createContext as $9ESvm$createContext, forwardRef as $9ESv
20
20
 
21
21
 
22
22
  const $c0c9ced265f3594c$export$8b645da15a96b44f = /*#__PURE__*/ (0, $9ESvm$createContext)(null);
23
- function $c0c9ced265f3594c$var$Meter(props, ref) {
23
+ const $c0c9ced265f3594c$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $9ESvm$forwardRef)(function Meter(props, ref) {
24
24
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $c0c9ced265f3594c$export$8b645da15a96b44f);
25
25
  let { value: value = 0, minValue: minValue = 0, maxValue: maxValue = 100 } = props;
26
26
  value = (0, $9ESvm$clamp)(value, minValue, maxValue);
@@ -51,10 +51,7 @@ function $c0c9ced265f3594c$var$Meter(props, ref) {
51
51
  elementType: 'span'
52
52
  }
53
53
  }, renderProps.children));
54
- }
55
- /**
56
- * A meter represents a quantity within a known range, or a fractional value.
57
- */ const $c0c9ced265f3594c$export$62e3ae2a4090b879 = /*#__PURE__*/ (0, $9ESvm$forwardRef)($c0c9ced265f3594c$var$Meter);
54
+ });
58
55
 
59
56
 
60
57
  export {$c0c9ced265f3594c$export$8b645da15a96b44f as MeterContext, $c0c9ced265f3594c$export$62e3ae2a4090b879 as Meter};
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA4C;AAEpF,SAAS,4BAAM,KAAiB,EAAE,GAAiC;IACjE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SACF,QAAQ,aACR,WAAW,aACX,WAAW,KACZ,GAAG;IACJ,QAAQ,CAAA,GAAA,YAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,EACX,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAE7B,0DAA0D;IAC1D,IAAI,aAAa,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAK;IAE9D,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,UAAU,CAAC,iBAAiB;QACzC;IACF;IAEA,qBACE,gCAAC;QAAK,GAAG,UAAU;QAAG,GAAG,WAAW;QAAE,KAAK;QAAK,MAAM,MAAM,IAAI,IAAI;qBAClE,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B;AAEA;;CAEC,GACD,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/Meter.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMeterProps, useMeter} from 'react-aria';\nimport {clamp} from '@react-stately/utils';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'label'>, RenderProps<MeterRenderProps>, SlotProps {}\n\nexport interface MeterRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number,\n /**\n * A formatted version of the value.\n * @selector [aria-valuetext]\n */\n valueText: string | undefined\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, HTMLDivElement>>(null);\n\nfunction Meter(props: MeterProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MeterContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100\n } = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot();\n let {\n meterProps,\n labelProps\n } = useMeter({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = (value - minValue) / (maxValue - minValue) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Meter',\n values: {\n percentage,\n valueText: meterProps['aria-valuetext']\n }\n });\n\n return (\n <div {...meterProps} {...renderProps} ref={ref} slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </div>\n );\n}\n\n/**\n * A meter represents a quantity within a known range, or a fractional value.\n */\nconst _Meter = /*#__PURE__*/ (forwardRef as forwardRefType)(Meter);\nexport {_Meter as Meter};\n"],"names":[],"version":3,"file":"Meter.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA4C;AAK7E,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,MAAM,KAAiB,EAAE,GAAiC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SACF,QAAQ,aACR,WAAW,aACX,WAAW,KACZ,GAAG;IACJ,QAAQ,CAAA,GAAA,YAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,EACX,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAE7B,0DAA0D;IAC1D,IAAI,aAAa,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAK;IAE9D,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,UAAU,CAAC,iBAAiB;QACzC;IACF;IAEA,qBACE,gCAAC;QAAK,GAAG,UAAU;QAAG,GAAG,WAAW;QAAE,KAAK;QAAK,MAAM,MAAM,IAAI,IAAI;qBAClE,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Meter.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMeterProps, useMeter} from 'react-aria';\nimport {clamp} from '@react-stately/utils';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'label'>, RenderProps<MeterRenderProps>, SlotProps {}\n\nexport interface MeterRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number,\n /**\n * A formatted version of the value.\n * @selector [aria-valuetext]\n */\n valueText: string | undefined\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, HTMLDivElement>>(null);\n\n/**\n * A meter represents a quantity within a known range, or a fractional value.\n */\nexport const Meter = /*#__PURE__*/ (forwardRef as forwardRefType)(function Meter(props: MeterProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MeterContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100\n } = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot();\n let {\n meterProps,\n labelProps\n } = useMeter({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = (value - minValue) / (maxValue - minValue) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Meter',\n values: {\n percentage,\n valueText: meterProps['aria-valuetext']\n }\n });\n\n return (\n <div {...meterProps} {...renderProps} ref={ref} slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Meter.module.js.map"}
@@ -15,8 +15,8 @@ function $parcel$export(e, n, v, s) {
15
15
  }
16
16
 
17
17
  $parcel$export(module.exports, "ModalContext", () => $71899cff63e14b82$export$ab57792b9b6974a6);
18
- $parcel$export(module.exports, "ModalOverlay", () => $71899cff63e14b82$export$8948f78d83984c69);
19
18
  $parcel$export(module.exports, "Modal", () => $71899cff63e14b82$export$2b77a92f1a5ad772);
19
+ $parcel$export(module.exports, "ModalOverlay", () => $71899cff63e14b82$export$8948f78d83984c69);
20
20
  /*
21
21
  * Copyright 2022 Adobe. All rights reserved.
22
22
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -35,7 +35,7 @@ $parcel$export(module.exports, "Modal", () => $71899cff63e14b82$export$2b77a92f1
35
35
 
36
36
  const $71899cff63e14b82$export$ab57792b9b6974a6 = /*#__PURE__*/ (0, $cIZLj$react.createContext)(null);
37
37
  const $71899cff63e14b82$var$InternalModalContext = /*#__PURE__*/ (0, $cIZLj$react.createContext)(null);
38
- function $71899cff63e14b82$var$Modal(props, ref) {
38
+ const $71899cff63e14b82$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $cIZLj$react.forwardRef)(function Modal(props, ref) {
39
39
  let ctx = (0, $cIZLj$react.useContext)($71899cff63e14b82$var$InternalModalContext);
40
40
  if (ctx) return /*#__PURE__*/ (0, ($parcel$interopDefault($cIZLj$react))).createElement($71899cff63e14b82$var$ModalContent, {
41
41
  ...props,
@@ -56,10 +56,7 @@ function $71899cff63e14b82$var$Modal(props, ref) {
56
56
  ...otherProps,
57
57
  modalRef: ref
58
58
  }, children));
59
- }
60
- /**
61
- * A modal is an overlay element which blocks interaction with elements outside it.
62
- */ const $71899cff63e14b82$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $cIZLj$react.forwardRef)($71899cff63e14b82$var$Modal);
59
+ });
63
60
  function $71899cff63e14b82$var$ModalOverlayWithForwardRef(props, ref) {
64
61
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $71899cff63e14b82$export$ab57792b9b6974a6);
65
62
  let contextState = (0, $cIZLj$react.useContext)((0, $2979ab89b336194b$exports.OverlayTriggerStateContext));
@@ -67,8 +64,8 @@ function $71899cff63e14b82$var$ModalOverlayWithForwardRef(props, ref) {
67
64
  let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
68
65
  let objectRef = (0, $cIZLj$reactariautils.useObjectRef)(ref);
69
66
  let modalRef = (0, $cIZLj$react.useRef)(null);
70
- let isOverlayExiting = (0, $c5ccf687772c0422$exports.useExitAnimation)(objectRef, state.isOpen);
71
- let isModalExiting = (0, $c5ccf687772c0422$exports.useExitAnimation)(modalRef, state.isOpen);
67
+ let isOverlayExiting = (0, $cIZLj$reactariautils.useExitAnimation)(objectRef, state.isOpen);
68
+ let isModalExiting = (0, $cIZLj$reactariautils.useExitAnimation)(modalRef, state.isOpen);
72
69
  let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;
73
70
  let isSSR = (0, $cIZLj$reactaria.useIsSSR)();
74
71
  if (!state.isOpen && !isExiting || isSSR) return null;
@@ -85,7 +82,7 @@ function $71899cff63e14b82$var$ModalOverlayInner({ UNSTABLE_portalContainer: UNS
85
82
  let modalRef = props.modalRef;
86
83
  let { state: state } = props;
87
84
  let { modalProps: modalProps, underlayProps: underlayProps } = (0, $cIZLj$reactaria.useModalOverlay)(props, state, modalRef);
88
- let entering = (0, $c5ccf687772c0422$exports.useEnterAnimation)(props.overlayRef) || props.isEntering || false;
85
+ let entering = (0, $cIZLj$reactariautils.useEnterAnimation)(props.overlayRef) || props.isEntering || false;
89
86
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
90
87
  ...props,
91
88
  defaultClassName: 'react-aria-ModalOverlay',
@@ -136,7 +133,7 @@ function $71899cff63e14b82$var$ModalContent(props) {
136
133
  modalRef
137
134
  ]);
138
135
  let ref = (0, $cIZLj$reactariautils.useObjectRef)(mergedRefs);
139
- let entering = (0, $c5ccf687772c0422$exports.useEnterAnimation)(ref);
136
+ let entering = (0, $cIZLj$reactariautils.useEnterAnimation)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AAM,UAAU;QACrB,iBAAe,YAAY;QAC3B,gBAAc,MAAM,SAAS,IAAI;qBACjC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAsB;gCAAC;8BAAY;oBAAU,WAAW,MAAM,SAAS;oBAAE,eAAe,MAAM,aAAa;gBAAA;aAAE;YAC9G;gBAAC,CAAA,GAAA,oDAAyB;gBAAG;aAAM;SACpC;OACA,YAAY,QAAQ;AAK/B;AAMA,SAAS,mCAAa,KAAwB;IAC5C,IAAI,cAAC,UAAU,YAAE,QAAQ,aAAE,SAAS,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAClE,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,oDAAyB;IAChD,IAAI,aAAa,CAAA,GAAA,oBAAM,EAAE,IAAM,CAAA,GAAA,+BAAQ,EAAE,MAAM,QAAQ,EAAE,WAAW;QAAC,MAAM,QAAQ;QAAE;KAAS;IAE9F,IAAI,MAAM,CAAA,GAAA,kCAAW,EAAE;IACvB,IAAI,WAAW,CAAA,GAAA,2CAAgB,EAAE;IACjC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY;uBACZ;mBACA;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,QAAe,WAAW;QACvD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,YAAY;QAC3B,gBAAc,aAAa;OAC1B,+BACC,0DAAC,CAAA,GAAA,8BAAY;QAAE,WAAW,MAAM,KAAK;QAEtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaModalOverlayProps, DismissButton, Overlay, useIsSSR, useModalOverlay} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useEnterAnimation, useExitAnimation, useRenderProps} from './utils';\nimport {DOMAttributes, forwardRefType, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useObjectRef, useViewportSize} from '@react-aria/utils';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo, useRef} from 'react';\n\nexport interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {\n /**\n * Whether the modal is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the modal is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element\n}\n\ninterface InternalModalContextValue {\n modalProps: DOMAttributes,\n modalRef: RefObject<HTMLDivElement | null>,\n isExiting: boolean,\n isDismissable?: boolean\n}\n\nexport const ModalContext = createContext<ContextValue<ModalOverlayProps, HTMLDivElement>>(null);\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\nexport interface ModalRenderProps {\n /**\n * Whether the modal is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the modal is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the modal.\n */\n state: OverlayTriggerState\n}\n\nfunction Modal(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n let ctx = useContext(InternalModalContext);\n\n if (ctx) {\n return <ModalContent {...props} modalRef={ref}>{props.children}</ModalContent>;\n }\n\n let {\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n defaultOpen,\n onOpenChange,\n children,\n isEntering,\n isExiting,\n UNSTABLE_portalContainer,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n return (\n <ModalOverlay\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isEntering={isEntering}\n isExiting={isExiting}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}>\n <ModalContent {...otherProps} modalRef={ref}>\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n}\n\ninterface ModalOverlayInnerProps extends ModalOverlayProps {\n overlayRef: RefObject<HTMLDivElement | null>,\n modalRef: RefObject<HTMLDivElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean\n}\n\n/**\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nconst _Modal = /*#__PURE__*/ (forwardRef as forwardRefType)(Modal);\nexport {_Modal as Modal};\n\nfunction ModalOverlayWithForwardRef(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ModalContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n\n let objectRef = useObjectRef(ref);\n let modalRef = useRef<HTMLDivElement>(null);\n let isOverlayExiting = useExitAnimation(objectRef, state.isOpen);\n let isModalExiting = useExitAnimation(modalRef, state.isOpen);\n let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;\n let isSSR = useIsSSR();\n\n if ((!state.isOpen && !isExiting) || isSSR) {\n return null;\n }\n\n return (\n <ModalOverlayInner\n {...props}\n state={state}\n isExiting={isExiting}\n overlayRef={objectRef}\n modalRef={modalRef} />\n );\n}\n\n/**\n * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.\n */\nexport const ModalOverlay = /*#__PURE__*/ (forwardRef as forwardRefType)(ModalOverlayWithForwardRef);\n\nfunction ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInnerProps) {\n let modalRef = props.modalRef;\n let {state} = props;\n let {modalProps, underlayProps} = useModalOverlay(props, state, modalRef);\n\n let entering = useEnterAnimation(props.overlayRef) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ModalOverlay',\n values: {\n isEntering: entering,\n isExiting: props.isExiting,\n state\n }\n });\n\n let viewport = useViewportSize();\n let style = {\n ...renderProps.style,\n '--visual-viewport-height': viewport.height + 'px'\n };\n\n return (\n <Overlay isExiting={props.isExiting} portalContainer={UNSTABLE_portalContainer}>\n <div\n {...mergeProps(filterDOMProps(props as any), underlayProps)}\n {...renderProps}\n style={style}\n ref={props.overlayRef}\n data-entering={entering || undefined}\n data-exiting={props.isExiting || undefined}>\n <Provider\n values={[\n [InternalModalContext, {modalProps, modalRef, isExiting: props.isExiting, isDismissable: props.isDismissable}],\n [OverlayTriggerStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </Overlay>\n );\n}\n\ninterface ModalContentProps extends RenderProps<ModalRenderProps> {\n modalRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction ModalContent(props: ModalContentProps) {\n let {modalProps, modalRef, isExiting, isDismissable} = useContext(InternalModalContext)!;\n let state = useContext(OverlayTriggerStateContext)!;\n let mergedRefs = useMemo(() => mergeRefs(props.modalRef, modalRef), [props.modalRef, modalRef]);\n\n let ref = useObjectRef(mergedRefs);\n let entering = useEnterAnimation(ref);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Modal',\n values: {\n isEntering: entering,\n isExiting,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(filterDOMProps(props as any), modalProps)}\n {...renderProps}\n ref={ref}\n data-entering={entering || undefined}\n data-exiting={isExiting || undefined}>\n {isDismissable &&\n <DismissButton onDismiss={state.close} />\n }\n {renderProps.children}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Modal.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiCM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAAmD;AAC3F,MAAM,2DAAuB,CAAA,GAAA,0BAAY,EAAoC;AAsBtE,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,MAAM,KAAwB,EAAE,GAAiC;IAC1I,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IAErB,IAAI,KACF,qBAAO,0DAAC;QAAc,GAAG,KAAK;QAAE,UAAU;OAAM,MAAM,QAAQ;IAGhE,IAAI,iBACF,aAAa,6BACb,yBAAyB,UACzB,MAAM,eACN,WAAW,gBACX,YAAY,YACZ,QAAQ,cACR,UAAU,aACV,SAAS,4BACT,wBAAwB,gCACxB,4BAA4B,EAC5B,GAAG,YACJ,GAAG;IAEJ,qBACE,0DAAC;QACC,eAAe;QACf,2BAA2B;QAC3B,QAAQ;QACR,aAAa;QACb,cAAc;QACd,YAAY;QACZ,WAAW;QACX,0BAA0B;QAC1B,8BAA8B;qBAC9B,0DAAC;QAAc,GAAG,UAAU;QAAE,UAAU;OACrC;AAIT;AASA,SAAS,iDAA2B,KAAwB,EAAE,GAAiC;IAC7F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAe,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,oDAAyB;IACvD,IAAI,aAAa,CAAA,GAAA,0CAAqB,EAAE;IACxC,IAAI,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAAM,WAAW,IAAI,QAAQ,CAAC,eAAe,aAAa;IAE9F,IAAI,YAAY,C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QAC1D,GAAG,WAAW;QACf,OAAO;QACP,KAAK,MAAM,UAAU;QACrB,iBAAe,YAAY;QAC3B,gBAAc,MAAM,SAAS,IAAI;qBACjC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAsB;gCAAC;8BAAY;oBAAU,WAAW,MAAM,SAAS;oBAAE,eAAe,MAAM,aAAa;gBAAA;aAAE;YAC9G;gBAAC,CAAA,GAAA,oDAAyB;gBAAG;aAAM;SACpC;OACA,YAAY,QAAQ;AAK/B;AAMA,SAAS,mCAAa,KAAwB;IAC5C,IAAI,cAAC,UAAU,YAAE,QAAQ,aAAE,SAAS,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAClE,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,oDAAyB;IAChD,IAAI,aAAa,CAAA,GAAA,oBAAM,EAAE,IAAM,CAAA,GAAA,+BAAQ,EAAE,MAAM,QAAQ,EAAE,WAAW;QAAC,MAAM,QAAQ;QAAE;KAAS;IAE9F,IAAI,MAAM,CAAA,GAAA,kCAAW,EAAE;IACvB,IAAI,WAAW,CAAA,GAAA,uCAAgB,EAAE;IACjC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY;uBACZ;mBACA;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,QAAe,WAAW;QACvD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,YAAY;QAC3B,gBAAc,aAAa;OAC1B,+BACC,0DAAC,CAAA,GAAA,8BAAY;QAAE,WAAW,MAAM,KAAK;QAEtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaModalOverlayProps, DismissButton, Overlay, useIsSSR, useModalOverlay} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DOMAttributes, forwardRefType, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useEnterAnimation, useExitAnimation, useObjectRef, useViewportSize} from '@react-aria/utils';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo, useRef} from 'react';\n\nexport interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {\n /**\n * Whether the modal is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the modal is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element\n}\n\ninterface InternalModalContextValue {\n modalProps: DOMAttributes,\n modalRef: RefObject<HTMLDivElement | null>,\n isExiting: boolean,\n isDismissable?: boolean\n}\n\nexport const ModalContext = createContext<ContextValue<ModalOverlayProps, HTMLDivElement>>(null);\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\nexport interface ModalRenderProps {\n /**\n * Whether the modal is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the modal is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the modal.\n */\n state: OverlayTriggerState\n}\n\n/**\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport const Modal = /*#__PURE__*/ (forwardRef as forwardRefType)(function Modal(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n let ctx = useContext(InternalModalContext);\n\n if (ctx) {\n return <ModalContent {...props} modalRef={ref}>{props.children}</ModalContent>;\n }\n\n let {\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n defaultOpen,\n onOpenChange,\n children,\n isEntering,\n isExiting,\n UNSTABLE_portalContainer,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n return (\n <ModalOverlay\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isEntering={isEntering}\n isExiting={isExiting}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}>\n <ModalContent {...otherProps} modalRef={ref}>\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n});\n\ninterface ModalOverlayInnerProps extends ModalOverlayProps {\n overlayRef: RefObject<HTMLDivElement | null>,\n modalRef: RefObject<HTMLDivElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean\n}\n\nfunction ModalOverlayWithForwardRef(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ModalContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n\n let objectRef = useObjectRef(ref);\n let modalRef = useRef<HTMLDivElement>(null);\n let isOverlayExiting = useExitAnimation(objectRef, state.isOpen);\n let isModalExiting = useExitAnimation(modalRef, state.isOpen);\n let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;\n let isSSR = useIsSSR();\n\n if ((!state.isOpen && !isExiting) || isSSR) {\n return null;\n }\n\n return (\n <ModalOverlayInner\n {...props}\n state={state}\n isExiting={isExiting}\n overlayRef={objectRef}\n modalRef={modalRef} />\n );\n}\n\n/**\n * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.\n */\nexport const ModalOverlay = /*#__PURE__*/ (forwardRef as forwardRefType)(ModalOverlayWithForwardRef);\n\nfunction ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInnerProps) {\n let modalRef = props.modalRef;\n let {state} = props;\n let {modalProps, underlayProps} = useModalOverlay(props, state, modalRef);\n\n let entering = useEnterAnimation(props.overlayRef) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ModalOverlay',\n values: {\n isEntering: entering,\n isExiting: props.isExiting,\n state\n }\n });\n\n let viewport = useViewportSize();\n let style = {\n ...renderProps.style,\n '--visual-viewport-height': viewport.height + 'px'\n };\n\n return (\n <Overlay isExiting={props.isExiting} portalContainer={UNSTABLE_portalContainer}>\n <div\n {...mergeProps(filterDOMProps(props as any), underlayProps)}\n {...renderProps}\n style={style}\n ref={props.overlayRef}\n data-entering={entering || undefined}\n data-exiting={props.isExiting || undefined}>\n <Provider\n values={[\n [InternalModalContext, {modalProps, modalRef, isExiting: props.isExiting, isDismissable: props.isDismissable}],\n [OverlayTriggerStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </Overlay>\n );\n}\n\ninterface ModalContentProps extends RenderProps<ModalRenderProps> {\n modalRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction ModalContent(props: ModalContentProps) {\n let {modalProps, modalRef, isExiting, isDismissable} = useContext(InternalModalContext)!;\n let state = useContext(OverlayTriggerStateContext)!;\n let mergedRefs = useMemo(() => mergeRefs(props.modalRef, modalRef), [props.modalRef, modalRef]);\n\n let ref = useObjectRef(mergedRefs);\n let entering = useEnterAnimation(ref);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Modal',\n values: {\n isEntering: entering,\n isExiting,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(filterDOMProps(props as any), modalProps)}\n {...renderProps}\n ref={ref}\n data-entering={entering || undefined}\n data-exiting={isExiting || undefined}>\n {isDismissable &&\n <DismissButton onDismiss={state.close} />\n }\n {renderProps.children}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Modal.main.js.map"}