react-aria-components 1.17.0 → 1.18.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 (478) hide show
  1. package/dist/exports/Autocomplete.cjs.map +1 -1
  2. package/dist/exports/Autocomplete.js.map +1 -1
  3. package/dist/exports/Autocomplete.mjs.map +1 -1
  4. package/dist/exports/Calendar.cjs +3 -0
  5. package/dist/exports/Calendar.cjs.map +1 -1
  6. package/dist/exports/Calendar.js +2 -2
  7. package/dist/exports/Calendar.js.map +1 -1
  8. package/dist/exports/Calendar.mjs +2 -2
  9. package/dist/exports/Calendar.mjs.map +1 -1
  10. package/dist/exports/Checkbox.cjs +8 -0
  11. package/dist/exports/Checkbox.cjs.map +1 -1
  12. package/dist/exports/Checkbox.js +6 -2
  13. package/dist/exports/Checkbox.js.map +1 -1
  14. package/dist/exports/Checkbox.mjs +6 -2
  15. package/dist/exports/Checkbox.mjs.map +1 -1
  16. package/dist/exports/CheckboxGroup.cjs.map +1 -1
  17. package/dist/exports/CheckboxGroup.js.map +1 -1
  18. package/dist/exports/CheckboxGroup.mjs.map +1 -1
  19. package/dist/exports/CollectionBuilder.cjs.map +1 -1
  20. package/dist/exports/CollectionBuilder.js.map +1 -1
  21. package/dist/exports/CollectionBuilder.mjs.map +1 -1
  22. package/dist/exports/ColorArea.cjs.map +1 -1
  23. package/dist/exports/ColorArea.js.map +1 -1
  24. package/dist/exports/ColorArea.mjs.map +1 -1
  25. package/dist/exports/ColorField.cjs.map +1 -1
  26. package/dist/exports/ColorField.js.map +1 -1
  27. package/dist/exports/ColorField.mjs.map +1 -1
  28. package/dist/exports/ColorPicker.cjs.map +1 -1
  29. package/dist/exports/ColorPicker.js.map +1 -1
  30. package/dist/exports/ColorPicker.mjs.map +1 -1
  31. package/dist/exports/ColorSlider.cjs.map +1 -1
  32. package/dist/exports/ColorSlider.js.map +1 -1
  33. package/dist/exports/ColorSlider.mjs.map +1 -1
  34. package/dist/exports/ColorSwatch.cjs.map +1 -1
  35. package/dist/exports/ColorSwatch.js.map +1 -1
  36. package/dist/exports/ColorSwatch.mjs.map +1 -1
  37. package/dist/exports/ColorSwatchPicker.cjs.map +1 -1
  38. package/dist/exports/ColorSwatchPicker.js.map +1 -1
  39. package/dist/exports/ColorSwatchPicker.mjs.map +1 -1
  40. package/dist/exports/ColorThumb.cjs.map +1 -1
  41. package/dist/exports/ColorThumb.js.map +1 -1
  42. package/dist/exports/ColorThumb.mjs.map +1 -1
  43. package/dist/exports/ColorWheel.cjs.map +1 -1
  44. package/dist/exports/ColorWheel.js.map +1 -1
  45. package/dist/exports/ColorWheel.mjs.map +1 -1
  46. package/dist/exports/ComboBox.cjs.map +1 -1
  47. package/dist/exports/ComboBox.js.map +1 -1
  48. package/dist/exports/ComboBox.mjs.map +1 -1
  49. package/dist/exports/DateField.cjs.map +1 -1
  50. package/dist/exports/DateField.js.map +1 -1
  51. package/dist/exports/DateField.mjs.map +1 -1
  52. package/dist/exports/DatePicker.cjs.map +1 -1
  53. package/dist/exports/DatePicker.js.map +1 -1
  54. package/dist/exports/DatePicker.mjs.map +1 -1
  55. package/dist/exports/DateRangePicker.cjs.map +1 -1
  56. package/dist/exports/DateRangePicker.js.map +1 -1
  57. package/dist/exports/DateRangePicker.mjs.map +1 -1
  58. package/dist/exports/Disclosure.cjs.map +1 -1
  59. package/dist/exports/Disclosure.js.map +1 -1
  60. package/dist/exports/Disclosure.mjs.map +1 -1
  61. package/dist/exports/DisclosureGroup.cjs.map +1 -1
  62. package/dist/exports/DisclosureGroup.js.map +1 -1
  63. package/dist/exports/DisclosureGroup.mjs.map +1 -1
  64. package/dist/exports/GridList.cjs.map +1 -1
  65. package/dist/exports/GridList.js.map +1 -1
  66. package/dist/exports/GridList.mjs.map +1 -1
  67. package/dist/exports/ListBox.cjs.map +1 -1
  68. package/dist/exports/ListBox.js.map +1 -1
  69. package/dist/exports/ListBox.mjs.map +1 -1
  70. package/dist/exports/Menu.cjs.map +1 -1
  71. package/dist/exports/Menu.js.map +1 -1
  72. package/dist/exports/Menu.mjs.map +1 -1
  73. package/dist/exports/RadioGroup.cjs +3 -0
  74. package/dist/exports/RadioGroup.cjs.map +1 -1
  75. package/dist/exports/RadioGroup.js +2 -2
  76. package/dist/exports/RadioGroup.js.map +1 -1
  77. package/dist/exports/RadioGroup.mjs +2 -2
  78. package/dist/exports/RadioGroup.mjs.map +1 -1
  79. package/dist/exports/RangeCalendar.cjs +3 -0
  80. package/dist/exports/RangeCalendar.cjs.map +1 -1
  81. package/dist/exports/RangeCalendar.js +2 -2
  82. package/dist/exports/RangeCalendar.js.map +1 -1
  83. package/dist/exports/RangeCalendar.mjs +2 -2
  84. package/dist/exports/RangeCalendar.mjs.map +1 -1
  85. package/dist/exports/Select.cjs.map +1 -1
  86. package/dist/exports/Select.js.map +1 -1
  87. package/dist/exports/Select.mjs.map +1 -1
  88. package/dist/exports/SharedElementTransition.cjs.map +1 -1
  89. package/dist/exports/SharedElementTransition.js.map +1 -1
  90. package/dist/exports/SharedElementTransition.mjs.map +1 -1
  91. package/dist/exports/Slider.cjs +2 -0
  92. package/dist/exports/Slider.cjs.map +1 -1
  93. package/dist/exports/Slider.js +2 -2
  94. package/dist/exports/Slider.js.map +1 -1
  95. package/dist/exports/Slider.mjs +2 -2
  96. package/dist/exports/Slider.mjs.map +1 -1
  97. package/dist/exports/Switch.cjs +8 -0
  98. package/dist/exports/Switch.cjs.map +1 -1
  99. package/dist/exports/Switch.js +6 -2
  100. package/dist/exports/Switch.js.map +1 -1
  101. package/dist/exports/Switch.mjs +6 -2
  102. package/dist/exports/Switch.mjs.map +1 -1
  103. package/dist/exports/Table.cjs +1 -0
  104. package/dist/exports/Table.cjs.map +1 -1
  105. package/dist/exports/Table.js +2 -2
  106. package/dist/exports/Table.js.map +1 -1
  107. package/dist/exports/Table.mjs +2 -2
  108. package/dist/exports/Table.mjs.map +1 -1
  109. package/dist/exports/Tabs.cjs.map +1 -1
  110. package/dist/exports/Tabs.js.map +1 -1
  111. package/dist/exports/Tabs.mjs.map +1 -1
  112. package/dist/exports/TagGroup.cjs.map +1 -1
  113. package/dist/exports/TagGroup.js.map +1 -1
  114. package/dist/exports/TagGroup.mjs.map +1 -1
  115. package/dist/exports/TimeField.cjs.map +1 -1
  116. package/dist/exports/TimeField.js.map +1 -1
  117. package/dist/exports/TimeField.mjs.map +1 -1
  118. package/dist/exports/Toast.cjs.map +1 -1
  119. package/dist/exports/Toast.js.map +1 -1
  120. package/dist/exports/Toast.mjs.map +1 -1
  121. package/dist/exports/ToggleButtonGroup.cjs.map +1 -1
  122. package/dist/exports/ToggleButtonGroup.js.map +1 -1
  123. package/dist/exports/ToggleButtonGroup.mjs.map +1 -1
  124. package/dist/exports/Tree.cjs.map +1 -1
  125. package/dist/exports/Tree.js.map +1 -1
  126. package/dist/exports/Tree.mjs.map +1 -1
  127. package/dist/exports/Virtualizer.cjs.map +1 -1
  128. package/dist/exports/Virtualizer.js.map +1 -1
  129. package/dist/exports/Virtualizer.mjs.map +1 -1
  130. package/dist/exports/index.cjs +19 -1
  131. package/dist/exports/index.cjs.map +1 -1
  132. package/dist/exports/index.js +11 -8
  133. package/dist/exports/index.js.map +1 -1
  134. package/dist/exports/index.mjs +11 -8
  135. package/dist/exports/index.mjs.map +1 -1
  136. package/dist/exports/useAsyncList.cjs.map +1 -1
  137. package/dist/exports/useAsyncList.js.map +1 -1
  138. package/dist/exports/useAsyncList.mjs.map +1 -1
  139. package/dist/exports/useDragAndDrop.cjs.map +1 -1
  140. package/dist/exports/useDragAndDrop.js.map +1 -1
  141. package/dist/exports/useDragAndDrop.mjs.map +1 -1
  142. package/dist/exports/useDrop.cjs.map +1 -1
  143. package/dist/exports/useDrop.js.map +1 -1
  144. package/dist/exports/useDrop.mjs.map +1 -1
  145. package/dist/private/Autocomplete.cjs.map +1 -1
  146. package/dist/private/Autocomplete.js.map +1 -1
  147. package/dist/private/Autocomplete.mjs.map +1 -1
  148. package/dist/private/Breadcrumbs.cjs.map +1 -1
  149. package/dist/private/Breadcrumbs.js.map +1 -1
  150. package/dist/private/Breadcrumbs.mjs.map +1 -1
  151. package/dist/private/Button.cjs.map +1 -1
  152. package/dist/private/Button.js.map +1 -1
  153. package/dist/private/Button.mjs.map +1 -1
  154. package/dist/private/Calendar.cjs +34 -2
  155. package/dist/private/Calendar.cjs.map +1 -1
  156. package/dist/private/Calendar.js +34 -5
  157. package/dist/private/Calendar.js.map +1 -1
  158. package/dist/private/Calendar.mjs +34 -5
  159. package/dist/private/Calendar.mjs.map +1 -1
  160. package/dist/private/Checkbox.cjs +104 -17
  161. package/dist/private/Checkbox.cjs.map +1 -1
  162. package/dist/private/Checkbox.js +102 -18
  163. package/dist/private/Checkbox.js.map +1 -1
  164. package/dist/private/Checkbox.mjs +102 -18
  165. package/dist/private/Checkbox.mjs.map +1 -1
  166. package/dist/private/Collection.cjs.map +1 -1
  167. package/dist/private/Collection.js.map +1 -1
  168. package/dist/private/Collection.mjs.map +1 -1
  169. package/dist/private/ColorArea.cjs.map +1 -1
  170. package/dist/private/ColorArea.js.map +1 -1
  171. package/dist/private/ColorArea.mjs.map +1 -1
  172. package/dist/private/ColorField.cjs.map +1 -1
  173. package/dist/private/ColorField.js.map +1 -1
  174. package/dist/private/ColorField.mjs.map +1 -1
  175. package/dist/private/ColorPicker.cjs.map +1 -1
  176. package/dist/private/ColorPicker.js.map +1 -1
  177. package/dist/private/ColorPicker.mjs.map +1 -1
  178. package/dist/private/ColorSlider.cjs.map +1 -1
  179. package/dist/private/ColorSlider.js.map +1 -1
  180. package/dist/private/ColorSlider.mjs.map +1 -1
  181. package/dist/private/ColorSwatch.cjs.map +1 -1
  182. package/dist/private/ColorSwatch.js.map +1 -1
  183. package/dist/private/ColorSwatch.mjs.map +1 -1
  184. package/dist/private/ColorSwatchPicker.cjs.map +1 -1
  185. package/dist/private/ColorSwatchPicker.js.map +1 -1
  186. package/dist/private/ColorSwatchPicker.mjs.map +1 -1
  187. package/dist/private/ColorThumb.cjs.map +1 -1
  188. package/dist/private/ColorThumb.js.map +1 -1
  189. package/dist/private/ColorThumb.mjs.map +1 -1
  190. package/dist/private/ColorWheel.cjs.map +1 -1
  191. package/dist/private/ColorWheel.js.map +1 -1
  192. package/dist/private/ColorWheel.mjs.map +1 -1
  193. package/dist/private/ComboBox.cjs +15 -3
  194. package/dist/private/ComboBox.cjs.map +1 -1
  195. package/dist/private/ComboBox.js +16 -4
  196. package/dist/private/ComboBox.js.map +1 -1
  197. package/dist/private/ComboBox.mjs +16 -4
  198. package/dist/private/ComboBox.mjs.map +1 -1
  199. package/dist/private/DateField.cjs.map +1 -1
  200. package/dist/private/DateField.js.map +1 -1
  201. package/dist/private/DateField.mjs.map +1 -1
  202. package/dist/private/DatePicker.cjs +0 -26
  203. package/dist/private/DatePicker.cjs.map +1 -1
  204. package/dist/private/DatePicker.js +1 -27
  205. package/dist/private/DatePicker.js.map +1 -1
  206. package/dist/private/DatePicker.mjs +1 -27
  207. package/dist/private/DatePicker.mjs.map +1 -1
  208. package/dist/private/Dialog.cjs +1 -17
  209. package/dist/private/Dialog.cjs.map +1 -1
  210. package/dist/private/Dialog.js +2 -18
  211. package/dist/private/Dialog.js.map +1 -1
  212. package/dist/private/Dialog.mjs +2 -18
  213. package/dist/private/Dialog.mjs.map +1 -1
  214. package/dist/private/Disclosure.cjs.map +1 -1
  215. package/dist/private/Disclosure.js.map +1 -1
  216. package/dist/private/Disclosure.mjs.map +1 -1
  217. package/dist/private/DragAndDrop.cjs +3 -3
  218. package/dist/private/DragAndDrop.cjs.map +1 -1
  219. package/dist/private/DragAndDrop.js +3 -3
  220. package/dist/private/DragAndDrop.js.map +1 -1
  221. package/dist/private/DragAndDrop.mjs +3 -3
  222. package/dist/private/DragAndDrop.mjs.map +1 -1
  223. package/dist/private/DropZone.cjs.map +1 -1
  224. package/dist/private/DropZone.js.map +1 -1
  225. package/dist/private/DropZone.mjs.map +1 -1
  226. package/dist/private/FieldError.cjs.map +1 -1
  227. package/dist/private/FieldError.js.map +1 -1
  228. package/dist/private/FieldError.mjs.map +1 -1
  229. package/dist/private/FileTrigger.cjs.map +1 -1
  230. package/dist/private/FileTrigger.js.map +1 -1
  231. package/dist/private/FileTrigger.mjs.map +1 -1
  232. package/dist/private/Form.cjs.map +1 -1
  233. package/dist/private/Form.js.map +1 -1
  234. package/dist/private/Form.mjs.map +1 -1
  235. package/dist/private/GridLayout.cjs +37 -0
  236. package/dist/private/GridLayout.cjs.map +1 -0
  237. package/dist/private/GridLayout.js +32 -0
  238. package/dist/private/GridLayout.js.map +1 -0
  239. package/dist/private/GridLayout.mjs +32 -0
  240. package/dist/private/GridLayout.mjs.map +1 -0
  241. package/dist/private/GridList.cjs +19 -2
  242. package/dist/private/GridList.cjs.map +1 -1
  243. package/dist/private/GridList.js +20 -3
  244. package/dist/private/GridList.js.map +1 -1
  245. package/dist/private/GridList.mjs +20 -3
  246. package/dist/private/GridList.mjs.map +1 -1
  247. package/dist/private/Group.cjs.map +1 -1
  248. package/dist/private/Group.js.map +1 -1
  249. package/dist/private/Group.mjs.map +1 -1
  250. package/dist/private/Header.cjs.map +1 -1
  251. package/dist/private/Header.js.map +1 -1
  252. package/dist/private/Header.mjs.map +1 -1
  253. package/dist/private/Heading.cjs.map +1 -1
  254. package/dist/private/Heading.js.map +1 -1
  255. package/dist/private/Heading.mjs.map +1 -1
  256. package/dist/private/HiddenDateInput.cjs +3 -3
  257. package/dist/private/HiddenDateInput.cjs.map +1 -1
  258. package/dist/private/HiddenDateInput.js +3 -3
  259. package/dist/private/HiddenDateInput.js.map +1 -1
  260. package/dist/private/HiddenDateInput.mjs +3 -3
  261. package/dist/private/HiddenDateInput.mjs.map +1 -1
  262. package/dist/private/Input.cjs.map +1 -1
  263. package/dist/private/Input.js.map +1 -1
  264. package/dist/private/Input.mjs.map +1 -1
  265. package/dist/private/Keyboard.cjs.map +1 -1
  266. package/dist/private/Keyboard.js.map +1 -1
  267. package/dist/private/Keyboard.mjs.map +1 -1
  268. package/dist/private/Label.cjs.map +1 -1
  269. package/dist/private/Label.js.map +1 -1
  270. package/dist/private/Label.mjs.map +1 -1
  271. package/dist/private/Link.cjs.map +1 -1
  272. package/dist/private/Link.js.map +1 -1
  273. package/dist/private/Link.mjs.map +1 -1
  274. package/dist/private/ListBox.cjs +6 -5
  275. package/dist/private/ListBox.cjs.map +1 -1
  276. package/dist/private/ListBox.js +6 -5
  277. package/dist/private/ListBox.js.map +1 -1
  278. package/dist/private/ListBox.mjs +6 -5
  279. package/dist/private/ListBox.mjs.map +1 -1
  280. package/dist/private/Menu.cjs +5 -15
  281. package/dist/private/Menu.cjs.map +1 -1
  282. package/dist/private/Menu.js +6 -16
  283. package/dist/private/Menu.js.map +1 -1
  284. package/dist/private/Menu.mjs +6 -16
  285. package/dist/private/Menu.mjs.map +1 -1
  286. package/dist/private/Meter.cjs.map +1 -1
  287. package/dist/private/Meter.js.map +1 -1
  288. package/dist/private/Meter.mjs.map +1 -1
  289. package/dist/private/Modal.cjs.map +1 -1
  290. package/dist/private/Modal.js.map +1 -1
  291. package/dist/private/Modal.mjs.map +1 -1
  292. package/dist/private/NumberField.cjs.map +1 -1
  293. package/dist/private/NumberField.js.map +1 -1
  294. package/dist/private/NumberField.mjs.map +1 -1
  295. package/dist/private/OverlayArrow.cjs.map +1 -1
  296. package/dist/private/OverlayArrow.js.map +1 -1
  297. package/dist/private/OverlayArrow.mjs.map +1 -1
  298. package/dist/private/Popover.cjs +17 -1
  299. package/dist/private/Popover.cjs.map +1 -1
  300. package/dist/private/Popover.js +19 -2
  301. package/dist/private/Popover.js.map +1 -1
  302. package/dist/private/Popover.mjs +18 -2
  303. package/dist/private/Popover.mjs.map +1 -1
  304. package/dist/private/ProgressBar.cjs.map +1 -1
  305. package/dist/private/ProgressBar.js.map +1 -1
  306. package/dist/private/ProgressBar.mjs.map +1 -1
  307. package/dist/private/RadioGroup.cjs +87 -7
  308. package/dist/private/RadioGroup.cjs.map +1 -1
  309. package/dist/private/RadioGroup.js +86 -9
  310. package/dist/private/RadioGroup.js.map +1 -1
  311. package/dist/private/RadioGroup.mjs +86 -9
  312. package/dist/private/RadioGroup.mjs.map +1 -1
  313. package/dist/private/SearchField.cjs.map +1 -1
  314. package/dist/private/SearchField.js.map +1 -1
  315. package/dist/private/SearchField.mjs.map +1 -1
  316. package/dist/private/Select.cjs +1 -17
  317. package/dist/private/Select.cjs.map +1 -1
  318. package/dist/private/Select.js +2 -18
  319. package/dist/private/Select.js.map +1 -1
  320. package/dist/private/Select.mjs +2 -18
  321. package/dist/private/Select.mjs.map +1 -1
  322. package/dist/private/SelectionIndicator.cjs.map +1 -1
  323. package/dist/private/SelectionIndicator.js.map +1 -1
  324. package/dist/private/SelectionIndicator.mjs.map +1 -1
  325. package/dist/private/Separator.cjs.map +1 -1
  326. package/dist/private/Separator.js.map +1 -1
  327. package/dist/private/Separator.mjs.map +1 -1
  328. package/dist/private/SharedElementTransition.cjs.map +1 -1
  329. package/dist/private/SharedElementTransition.js.map +1 -1
  330. package/dist/private/SharedElementTransition.mjs.map +1 -1
  331. package/dist/private/Slider.cjs +51 -1
  332. package/dist/private/Slider.cjs.map +1 -1
  333. package/dist/private/Slider.js +50 -2
  334. package/dist/private/Slider.js.map +1 -1
  335. package/dist/private/Slider.mjs +50 -2
  336. package/dist/private/Slider.mjs.map +1 -1
  337. package/dist/private/Switch.cjs +118 -4
  338. package/dist/private/Switch.cjs.map +1 -1
  339. package/dist/private/Switch.js +119 -7
  340. package/dist/private/Switch.js.map +1 -1
  341. package/dist/private/Switch.mjs +118 -7
  342. package/dist/private/Switch.mjs.map +1 -1
  343. package/dist/private/Table.cjs +115 -24
  344. package/dist/private/Table.cjs.map +1 -1
  345. package/dist/private/Table.js +116 -26
  346. package/dist/private/Table.js.map +1 -1
  347. package/dist/private/Table.mjs +116 -26
  348. package/dist/private/Table.mjs.map +1 -1
  349. package/dist/private/TableLayout.cjs.map +1 -1
  350. package/dist/private/TableLayout.js.map +1 -1
  351. package/dist/private/TableLayout.mjs.map +1 -1
  352. package/dist/private/Tabs.cjs +4 -3
  353. package/dist/private/Tabs.cjs.map +1 -1
  354. package/dist/private/Tabs.js +4 -3
  355. package/dist/private/Tabs.js.map +1 -1
  356. package/dist/private/Tabs.mjs +4 -3
  357. package/dist/private/Tabs.mjs.map +1 -1
  358. package/dist/private/TagGroup.cjs.map +1 -1
  359. package/dist/private/TagGroup.js.map +1 -1
  360. package/dist/private/TagGroup.mjs.map +1 -1
  361. package/dist/private/Text.cjs.map +1 -1
  362. package/dist/private/Text.js.map +1 -1
  363. package/dist/private/Text.mjs.map +1 -1
  364. package/dist/private/TextArea.cjs.map +1 -1
  365. package/dist/private/TextArea.js.map +1 -1
  366. package/dist/private/TextArea.mjs.map +1 -1
  367. package/dist/private/TextField.cjs.map +1 -1
  368. package/dist/private/TextField.js.map +1 -1
  369. package/dist/private/TextField.mjs.map +1 -1
  370. package/dist/private/Toast.cjs +2 -1
  371. package/dist/private/Toast.cjs.map +1 -1
  372. package/dist/private/Toast.js +2 -1
  373. package/dist/private/Toast.js.map +1 -1
  374. package/dist/private/Toast.mjs +2 -1
  375. package/dist/private/Toast.mjs.map +1 -1
  376. package/dist/private/ToggleButton.cjs.map +1 -1
  377. package/dist/private/ToggleButton.js.map +1 -1
  378. package/dist/private/ToggleButton.mjs.map +1 -1
  379. package/dist/private/ToggleButtonGroup.cjs.map +1 -1
  380. package/dist/private/ToggleButtonGroup.js.map +1 -1
  381. package/dist/private/ToggleButtonGroup.mjs.map +1 -1
  382. package/dist/private/Toolbar.cjs.map +1 -1
  383. package/dist/private/Toolbar.js.map +1 -1
  384. package/dist/private/Toolbar.mjs.map +1 -1
  385. package/dist/private/Tooltip.cjs.map +1 -1
  386. package/dist/private/Tooltip.js.map +1 -1
  387. package/dist/private/Tooltip.mjs.map +1 -1
  388. package/dist/private/Tree.cjs +18 -6
  389. package/dist/private/Tree.cjs.map +1 -1
  390. package/dist/private/Tree.js +19 -7
  391. package/dist/private/Tree.js.map +1 -1
  392. package/dist/private/Tree.mjs +19 -7
  393. package/dist/private/Tree.mjs.map +1 -1
  394. package/dist/private/TreeDropTargetDelegate.cjs +9 -4
  395. package/dist/private/TreeDropTargetDelegate.cjs.map +1 -1
  396. package/dist/private/TreeDropTargetDelegate.js +10 -4
  397. package/dist/private/TreeDropTargetDelegate.js.map +1 -1
  398. package/dist/private/TreeDropTargetDelegate.mjs +9 -4
  399. package/dist/private/TreeDropTargetDelegate.mjs.map +1 -1
  400. package/dist/private/Virtualizer.cjs.map +1 -1
  401. package/dist/private/Virtualizer.js.map +1 -1
  402. package/dist/private/Virtualizer.mjs.map +1 -1
  403. package/dist/private/useDragAndDrop.cjs.map +1 -1
  404. package/dist/private/useDragAndDrop.js.map +1 -1
  405. package/dist/private/useDragAndDrop.mjs.map +1 -1
  406. package/dist/private/utils.cjs.map +1 -1
  407. package/dist/private/utils.js.map +1 -1
  408. package/dist/private/utils.mjs.map +1 -1
  409. package/dist/types/exports/Calendar.d.ts +4 -3
  410. package/dist/types/exports/Checkbox.d.ts +7 -2
  411. package/dist/types/exports/RadioGroup.d.ts +2 -2
  412. package/dist/types/exports/RangeCalendar.d.ts +3 -2
  413. package/dist/types/exports/Slider.d.ts +2 -2
  414. package/dist/types/exports/Switch.d.ts +7 -2
  415. package/dist/types/exports/Table.d.ts +2 -2
  416. package/dist/types/exports/index.d.ts +15 -13
  417. package/dist/types/exports/useDragAndDrop.d.ts +1 -1
  418. package/dist/types/src/Autocomplete.d.ts +1 -1
  419. package/dist/types/src/Breadcrumbs.d.ts +13 -4
  420. package/dist/types/src/Button.d.ts +9 -1
  421. package/dist/types/src/Calendar.d.ts +93 -33
  422. package/dist/types/src/Checkbox.d.ts +93 -2
  423. package/dist/types/src/Collection.d.ts +17 -4
  424. package/dist/types/src/ColorArea.d.ts +6 -2
  425. package/dist/types/src/ColorField.d.ts +8 -1
  426. package/dist/types/src/ColorPicker.d.ts +4 -1
  427. package/dist/types/src/ColorSlider.d.ts +5 -1
  428. package/dist/types/src/ColorSwatch.d.ts +3 -1
  429. package/dist/types/src/ColorSwatchPicker.d.ts +7 -2
  430. package/dist/types/src/ColorThumb.d.ts +10 -2
  431. package/dist/types/src/ColorWheel.d.ts +7 -2
  432. package/dist/types/src/ComboBox.d.ts +24 -11
  433. package/dist/types/src/DateField.d.ts +29 -4
  434. package/dist/types/src/DatePicker.d.ts +15 -3
  435. package/dist/types/src/Dialog.d.ts +3 -1
  436. package/dist/types/src/Disclosure.d.ts +21 -5
  437. package/dist/types/src/DragAndDrop.d.ts +6 -2
  438. package/dist/types/src/DropZone.d.ts +8 -1
  439. package/dist/types/src/FieldError.d.ts +4 -1
  440. package/dist/types/src/FileTrigger.d.ts +2 -1
  441. package/dist/types/src/Form.d.ts +4 -1
  442. package/dist/types/src/GridLayout.d.ts +5 -0
  443. package/dist/types/src/GridList.d.ts +44 -13
  444. package/dist/types/src/Group.d.ts +9 -1
  445. package/dist/types/src/Heading.d.ts +12 -0
  446. package/dist/types/src/HiddenDateInput.d.ts +2 -1
  447. package/dist/types/src/Input.d.ts +8 -1
  448. package/dist/types/src/Link.d.ts +9 -1
  449. package/dist/types/src/ListBox.d.ts +35 -12
  450. package/dist/types/src/Menu.d.ts +22 -10
  451. package/dist/types/src/Meter.d.ts +4 -1
  452. package/dist/types/src/Modal.d.ts +9 -3
  453. package/dist/types/src/NumberField.d.ts +9 -2
  454. package/dist/types/src/OverlayArrow.d.ts +4 -1
  455. package/dist/types/src/Popover.d.ts +12 -3
  456. package/dist/types/src/ProgressBar.d.ts +5 -1
  457. package/dist/types/src/RadioGroup.d.ts +88 -2
  458. package/dist/types/src/SearchField.d.ts +8 -1
  459. package/dist/types/src/Select.d.ts +19 -6
  460. package/dist/types/src/SelectionIndicator.d.ts +7 -2
  461. package/dist/types/src/Separator.d.ts +5 -2
  462. package/dist/types/src/SharedElementTransition.d.ts +2 -0
  463. package/dist/types/src/Slider.d.ts +48 -4
  464. package/dist/types/src/Switch.d.ts +100 -3
  465. package/dist/types/src/Table.d.ts +138 -31
  466. package/dist/types/src/Tabs.d.ts +37 -12
  467. package/dist/types/src/TagGroup.d.ts +18 -7
  468. package/dist/types/src/TextArea.d.ts +3 -1
  469. package/dist/types/src/TextField.d.ts +7 -1
  470. package/dist/types/src/Toast.d.ts +13 -3
  471. package/dist/types/src/ToggleButton.d.ts +10 -3
  472. package/dist/types/src/ToggleButtonGroup.d.ts +7 -2
  473. package/dist/types/src/Toolbar.d.ts +6 -3
  474. package/dist/types/src/Tooltip.d.ts +13 -4
  475. package/dist/types/src/Tree.d.ts +52 -16
  476. package/dist/types/src/useDragAndDrop.d.ts +10 -4
  477. package/dist/types/src/utils.d.ts +109 -17
  478. package/package.json +9 -7
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAqDM,MAAM,yDAA8B,CAAA,GAAA,0BAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GAAA,uBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IAC/H,IAAI,QAAQ,CAAA,GAAA,kEAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;AAI7B;AAkCO,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAO5E,MAAM,gEAA4B,CAAA,GAAA,0BAAY,EAAyC;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closure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from 'react-aria/useDisclosure';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {\n DisclosureGroupState,\n DisclosureGroupProps as StatelyDisclosureGroupProps,\n useDisclosureGroupState\n} from 'react-stately/useDisclosureGroupState';\nimport {DisclosureState, useDisclosureState} from 'react-stately/useDisclosureState';\n\nimport {DOMProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\n\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LabelAriaProps} from 'react-aria/useLabel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useId} from 'react-aria/useId';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DisclosureGroup'\n */\n className?: ClassNameOrFunction<DisclosureGroupRenderProps>\n}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </dom.div>\n );\n});\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Disclosure'\n */\n className?: ClassNameOrFunction<DisclosureRenderProps>,\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <dom.div\n {...mergeProps(domProps, renderProps, focusWithinProps)}\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps, LabelAriaProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DisclosurePanel'\n */\n className?: ClassNameOrFunction<DisclosurePanelRenderProps>,\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}\n ref={mergeRefs(ref, panelRef)}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAoEM,MAAM,yDAA8B,CAAA,GAAA,0BAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GAAA,uBA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C,IAAI,EAAC,gBAAgB,oBAAoB,EAAE,YAAY,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;QACtF,QAAQ;IACV;IACA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;QAAM,WAAW;IAAI;IACnE,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,aAAa,YAAY,iBAAiB;QACnE,KAAK,CAAA,GAAA,mCAAQ,EAAE,KAAK;QACpB,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,0DAAC,CAAA,GAAA,kCAAO;QAAE,QAAQ;YAAC;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAK;SAAC;OAAG,MAAM,QAAQ;AAGhE","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from 'react-aria/useDisclosure';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {\n DisclosureGroupState,\n DisclosureGroupProps as StatelyDisclosureGroupProps,\n useDisclosureGroupState\n} from 'react-stately/useDisclosureGroupState';\nimport {DisclosureState, useDisclosureState} from 'react-stately/useDisclosureState';\n\nimport {DOMProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\n\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LabelAriaProps} from 'react-aria/useLabel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {\n createContext,\n DOMAttributes,\n ForwardedRef,\n forwardRef,\n ReactNode,\n useContext\n} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useId} from 'react-aria/useId';\n\nexport interface DisclosureGroupProps\n extends\n StatelyDisclosureGroupProps,\n RenderProps<DisclosureGroupRenderProps>,\n DOMProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DisclosureGroup'\n */\n className?: ClassNameOrFunction<DisclosureGroupRenderProps>;\n}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState;\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(\n props: DisclosureGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div {...domProps} {...renderProps} ref={ref} data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </dom.div>\n );\n});\n\nexport interface DisclosureProps\n extends\n Omit<AriaDisclosureProps, 'children'>,\n RenderProps<DisclosureRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Disclosure'\n */\n className?: ClassNameOrFunction<DisclosureRenderProps>;\n /**\n * An id for the disclosure when used within a DisclosureGroup, matching the id used in\n * `expandedKeys`.\n */\n id?: Key;\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n *\n * @selector [data-expanded]\n */\n isExpanded: boolean;\n /**\n * Whether the disclosure has keyboard focus.\n *\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean;\n /**\n * Whether the disclosure is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the disclosure.\n */\n state: DisclosureState;\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>;\n panelRef: React.RefObject<HTMLDivElement | null>;\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and\n * trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(\n props: DisclosureProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure(\n {\n ...props,\n isExpanded,\n isDisabled\n },\n state,\n panelRef\n );\n let {isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps} = useFocusRing({\n within: true\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }\n ],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <dom.div\n {...mergeProps(domProps, renderProps, focusWithinProps)}\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n *\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean;\n}\n\nexport interface DisclosurePanelProps\n extends\n RenderProps<DisclosurePanelRenderProps>,\n DOMProps,\n LabelAriaProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DisclosurePanel'\n */\n className?: ClassNameOrFunction<DisclosurePanelRenderProps>;\n /**\n * The accessibility role for the disclosure's panel.\n *\n * @default 'group'\n */\n role?: 'group' | 'region';\n /**\n * The children of the component.\n */\n children: ReactNode;\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(\n function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps} = useFocusRing({\n within: true\n });\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}\n ref={mergeRefs(ref, panelRef)}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider values={[[ButtonContext, null]]}>{props.children}</Provider>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAqDM,MAAM,yDAA8B,CAAA,GAAA,oBAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GAAA,iBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IAC/H,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;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AK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACpB,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from 'react-aria/useDisclosure';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {\n DisclosureGroupState,\n DisclosureGroupProps as StatelyDisclosureGroupProps,\n useDisclosureGroupState\n} from 'react-stately/useDisclosureGroupState';\nimport {DisclosureState, useDisclosureState} from 'react-stately/useDisclosureState';\n\nimport {DOMProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\n\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LabelAriaProps} from 'react-aria/useLabel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useId} from 'react-aria/useId';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DisclosureGroup'\n */\n className?: ClassNameOrFunction<DisclosureGroupRenderProps>\n}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </dom.div>\n );\n});\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Disclosure'\n */\n className?: ClassNameOrFunction<DisclosureRenderProps>,\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <dom.div\n {...mergeProps(domProps, renderProps, focusWithinProps)}\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps, LabelAriaProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DisclosurePanel'\n */\n className?: ClassNameOrFunction<DisclosurePanelRenderProps>,\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}\n ref={mergeRefs(ref, panelRef)}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </dom.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A2B,wBAAwB;OAClD,YAAY,QAAQ;AAI7B;AAuCO,MAAM,4CAAgC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EACrD,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAC,OAAO,SAAQ,GAAG;IACvB,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IACxC,IAAI,EAAC,gBAAgB,oBAAoB,EAAE,YAAY,gBAAgB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACtF,QAAQ;IACV;IACA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;QAAM,WAAW;IAAI;IACnE,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,iBAAiB;QACnE,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACpB,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QAAE,QAAQ;YAAC;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SAAC;OAAG,MAAM,QAAQ;AAGhE","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from 'react-aria/useDisclosure';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {\n DisclosureGroupState,\n DisclosureGroupProps as StatelyDisclosureGroupProps,\n useDisclosureGroupState\n} from 'react-stately/useDisclosureGroupState';\nimport {DisclosureState, useDisclosureState} from 'react-stately/useDisclosureState';\n\nimport {DOMProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\n\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LabelAriaProps} from 'react-aria/useLabel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {\n createContext,\n DOMAttributes,\n ForwardedRef,\n forwardRef,\n ReactNode,\n useContext\n} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useId} from 'react-aria/useId';\n\nexport interface DisclosureGroupProps\n extends\n StatelyDisclosureGroupProps,\n RenderProps<DisclosureGroupRenderProps>,\n DOMProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DisclosureGroup'\n */\n className?: ClassNameOrFunction<DisclosureGroupRenderProps>;\n}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState;\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(\n props: DisclosureGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div {...domProps} {...renderProps} ref={ref} data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </dom.div>\n );\n});\n\nexport interface DisclosureProps\n extends\n Omit<AriaDisclosureProps, 'children'>,\n RenderProps<DisclosureRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Disclosure'\n */\n className?: ClassNameOrFunction<DisclosureRenderProps>;\n /**\n * An id for the disclosure when used within a DisclosureGroup, matching the id used in\n * `expandedKeys`.\n */\n id?: Key;\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n *\n * @selector [data-expanded]\n */\n isExpanded: boolean;\n /**\n * Whether the disclosure has keyboard focus.\n *\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean;\n /**\n * Whether the disclosure is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the disclosure.\n */\n state: DisclosureState;\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>;\n panelRef: React.RefObject<HTMLDivElement | null>;\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and\n * trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(\n props: DisclosureProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure(\n {\n ...props,\n isExpanded,\n isDisabled\n },\n state,\n panelRef\n );\n let {isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps} = useFocusRing({\n within: true\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }\n ],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <dom.div\n {...mergeProps(domProps, renderProps, focusWithinProps)}\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n *\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean;\n}\n\nexport interface DisclosurePanelProps\n extends\n RenderProps<DisclosurePanelRenderProps>,\n DOMProps,\n LabelAriaProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DisclosurePanel'\n */\n className?: ClassNameOrFunction<DisclosurePanelRenderProps>;\n /**\n * The accessibility role for the disclosure's panel.\n *\n * @default 'group'\n */\n role?: 'group' | 'region';\n /**\n * The children of the component.\n */\n children: ReactNode;\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(\n function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps} = useFocusRing({\n within: true\n });\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}\n ref={mergeRefs(ref, panelRef)}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider values={[[ButtonContext, null]]}>{props.children}</Provider>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"Disclosure.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAqDM,MAAM,yDAA8B,CAAA,GAAA,oBAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GAAA,iBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IAC/H,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA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AW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;QAAM,WAAW;IAAI;IACnE,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,iBAAiB;QACnE,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACpB,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from 'react-aria/useDisclosure';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {\n DisclosureGroupState,\n DisclosureGroupProps as StatelyDisclosureGroupProps,\n useDisclosureGroupState\n} from 'react-stately/useDisclosureGroupState';\nimport {DisclosureState, useDisclosureState} from 'react-stately/useDisclosureState';\n\nimport {DOMProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\n\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LabelAriaProps} from 'react-aria/useLabel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useId} from 'react-aria/useId';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DisclosureGroup'\n */\n className?: ClassNameOrFunction<DisclosureGroupRenderProps>\n}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </dom.div>\n );\n});\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Disclosure'\n */\n className?: ClassNameOrFunction<DisclosureRenderProps>,\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <dom.div\n {...mergeProps(domProps, renderProps, focusWithinProps)}\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps, LabelAriaProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DisclosurePanel'\n */\n className?: ClassNameOrFunction<DisclosurePanelRenderProps>,\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}\n ref={mergeRefs(ref, panelRef)}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"Disclosure.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAoEM,MAAM,yDAA8B,CAAA,GAAA,oBAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GAAA,iBAAS,EAAE,SAAS,gBACjD,KAA2B,EAC3B,GAAiC;IAEjC,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QAAE,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,KAAK;QAAK,iBAAe,MAAM,UAAU,IAAI;qBACnF,gCAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;AAI7B;AA+CO,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAiD;AACvF,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAO5E,MAAM,gEAA4B,CAAA,GAAA,oBAAY,EAAyC;AAMhF,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAC9E,KAAsB,EACtB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE;I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,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,iBAAiB;QACvD,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,cAAc;QAC7B,6BAA2B,wBAAwB;OAClD,YAAY,QAAQ;AAI7B;AAuCO,MAAM,4CAAgC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EACrD,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAC,OAAO,SAAQ,GAAG;IACvB,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IACxC,IAAI,EAAC,gBAAgB,oBAAoB,EAAE,YAAY,gBAAgB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACtF,QAAQ;IACV;IACA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;QAAM,WAAW;IAAI;IACnE,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,iBAAiB;QACnE,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACpB,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QAAE,QAAQ;YAAC;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SAAC;OAAG,MAAM,QAAQ;AAGhE","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from 'react-aria/useDisclosure';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {\n DisclosureGroupState,\n DisclosureGroupProps as StatelyDisclosureGroupProps,\n useDisclosureGroupState\n} from 'react-stately/useDisclosureGroupState';\nimport {DisclosureState, useDisclosureState} from 'react-stately/useDisclosureState';\n\nimport {DOMProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\n\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LabelAriaProps} from 'react-aria/useLabel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {\n createContext,\n DOMAttributes,\n ForwardedRef,\n forwardRef,\n ReactNode,\n useContext\n} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useId} from 'react-aria/useId';\n\nexport interface DisclosureGroupProps\n extends\n StatelyDisclosureGroupProps,\n RenderProps<DisclosureGroupRenderProps>,\n DOMProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DisclosureGroup'\n */\n className?: ClassNameOrFunction<DisclosureGroupRenderProps>;\n}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState;\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(\n props: DisclosureGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div {...domProps} {...renderProps} ref={ref} data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </dom.div>\n );\n});\n\nexport interface DisclosureProps\n extends\n Omit<AriaDisclosureProps, 'children'>,\n RenderProps<DisclosureRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Disclosure'\n */\n className?: ClassNameOrFunction<DisclosureRenderProps>;\n /**\n * An id for the disclosure when used within a DisclosureGroup, matching the id used in\n * `expandedKeys`.\n */\n id?: Key;\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n *\n * @selector [data-expanded]\n */\n isExpanded: boolean;\n /**\n * Whether the disclosure has keyboard focus.\n *\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean;\n /**\n * Whether the disclosure is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the disclosure.\n */\n state: DisclosureState;\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>;\n panelRef: React.RefObject<HTMLDivElement | null>;\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and\n * trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(\n props: DisclosureProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure(\n {\n ...props,\n isExpanded,\n isDisabled\n },\n state,\n panelRef\n );\n let {isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps} = useFocusRing({\n within: true\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }\n ],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <dom.div\n {...mergeProps(domProps, renderProps, focusWithinProps)}\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n *\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean;\n}\n\nexport interface DisclosurePanelProps\n extends\n RenderProps<DisclosurePanelRenderProps>,\n DOMProps,\n LabelAriaProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DisclosurePanel'\n */\n className?: ClassNameOrFunction<DisclosurePanelRenderProps>;\n /**\n * The accessibility role for the disclosure's panel.\n *\n * @default 'group'\n */\n role?: 'group' | 'region';\n /**\n * The children of the component.\n */\n children: ReactNode;\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(\n function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps} = useFocusRing({\n within: true\n });\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}\n ref={mergeRefs(ref, panelRef)}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider values={[[ButtonContext, null]]}>{props.children}</Provider>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"Disclosure.mjs.map"}
@@ -39,9 +39,9 @@ function $d3d8871226fc64f2$export$971707d8a129a1f7(dragAndDropHooks, dropState)
39
39
  if (isVirtualDragging || dropState?.isDropTarget(target)) return renderDropIndicator ? renderDropIndicator(target) : /*#__PURE__*/ (0, ($parcel$interopDefault($9uD35$react))).createElement($d3d8871226fc64f2$export$62ed72bc21f6b8a6, {
40
40
  target: target
41
41
  });
42
- // We invalidate whenever the target changes.
42
+ }, // We invalidate whenever the target changes.
43
43
  // eslint-disable-next-line react-hooks/exhaustive-deps
44
- }, [
44
+ [
45
45
  dropState?.target,
46
46
  isVirtualDragging,
47
47
  renderDropIndicator
@@ -61,7 +61,7 @@ function $d3d8871226fc64f2$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
61
61
  if (nextKey != null) {
62
62
  let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;
63
63
  // Skip over any rows that are descendants of the target ("after" position should be after all children)
64
- while(nextKey){
64
+ while(nextKey != null){
65
65
  let node = dropState.collection.getItem(nextKey);
66
66
  // eslint-disable-next-line max-depth
67
67
  if (!node) break;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAiBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAoC;AAwB7E,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8B;IACtH,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAC1B,qBAAO,sHAAG,OAAO,OAAO;AAC1B;AAIO,SAAS,0CAAuB,gBAAmC,EAAE,SAAoC;IAC9G,IAAI,sBAAsB,kBAAkB;IAC5C,IAAI,oBAAoB,kBAAkB;IAC1C,IAAI,KAAK,CAAA,GAAA,wBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,qBAAqB,WAAW,aAAa,SAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,0DAAC;YAAc,QAAQ;;IAEpF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,WAAW;QAAQ;QAAmB;KAAoB;IAC9D,OAAO,kBAAkB,mBAAmB,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;IACvJ,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,kBAAkB,yBAAyB,WAAW,QAAQ,SAAS,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;QACpC,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SAAS;YAC7C,iFAAiF;YACjF,IAAI,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;YAC/C,IAAI,oBAAgC;YACpC,IAAI,WAAW,MAAM;gBACnB,IAAI,cAAc,UAAU,UAAU,CAAC,OAAO,CAAC,gBAAgB,SAAS;gBACxE,wGAAwG;gBACxG,MAAO,QAAS;oBACd,IAAI,OAAO,UAAU,UAAU,CAAC,OAAO,CAAC;oBACxC,qCAAqC;oBACrC,IAAI,CAAC,MACH;oBAEF,6EAA6E;oBAC7E,qCAAqC;oBACrC,IAAI,KAAK,IAAI,KAAK,QAAQ;wBACxB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;wBAC3C;oBACF;oBAEA,wDAAwD;oBACxD,qCAAqC;oBACrC,IAAI,AAAC,CAAA,KAAK,KAAK,IAAI,CAAA,KAAM,aACvB;oBAGF,oBAAoB;oBACpB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;gBAC7C;YACF;YAEA,kEAAkE;YAClE,gBAAgB,WAAW,qBAAqB;QAClD;IACF;IAEA,OAAO,CAAA,GAAA,oBAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport type {DropIndicatorProps as AriaDropIndicatorProps} from 'react-aria/useDroppableCollection';\n\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport type {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport type {ItemDropTarget, Key} from '@react-types/shared';\nimport type {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends Omit<AriaDropIndicatorProps, 'activateButtonRef'>, RenderProps<DropIndicatorRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DropIndicator'\n */\n className?: ClassNameOrFunction<DropIndicatorRenderProps>\n}\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nexport const DropIndicator = forwardRef(function DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n});\n\ntype RenderDropIndicatorRetValue = ((target: ItemDropTarget) => ReactNode | undefined) | undefined\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState): RenderDropIndicatorRetValue {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState): Set<Key> {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n let nextKey = dropState.collection.getKeyAfter(dropTargetKey);\n let lastDescendantKey: Key | null = null;\n if (nextKey != null) {\n let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;\n // Skip over any rows that are descendants of the target (\"after\" position should be after all children)\n while (nextKey) {\n let node = dropState.collection.getItem(nextKey);\n // eslint-disable-next-line max-depth\n if (!node) {\n break;\n }\n // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.\n // eslint-disable-next-line max-depth\n if (node.type !== 'item') {\n nextKey = dropState.collection.getKeyAfter(nextKey);\n continue;\n }\n\n // Stop once we find an item at the same level or higher\n // eslint-disable-next-line max-depth\n if ((node.level ?? 0) <= targetLevel) {\n break;\n }\n \n lastDescendantKey = nextKey;\n nextKey = dropState.collection.getKeyAfter(nextKey);\n }\n }\n\n // If nextKey is null (end of collection), use the last descendant\n dropTargetKey = nextKey ?? lastDescendantKey ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AA0BM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAoC;AA6B7E,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAC/C,KAAyB,EACzB,GAA8B;IAE9B,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAC1B,qBAAO,sHAAG,OAAO,OAAO;AAC1B;AAIO,SAAS,0CACd,gBAAmC,EACnC,SAAoC;IAEpC,IAAI,sBAAsB,kBAAkB;IAC5C,IAAI,oBAAoB,kBAAkB;IAC1C,IAAI,KAAK,CAAA,GAAA,wBAAU,EACjB,CAAC;QACC,sFAAsF;QACtF,IAAI,qBAAqB,WAAW,aAAa,SAC/C,OAAO,sBACL,oBAAoB,wBAEpB,0DAAC;YAAc,QAAQ;;IAG7B,GACA,6CAA6C;IAC7C,uDAAuD;IACvD;QAAC,WAAW;QAAQ;QAAmB;KAAoB;IAE7D,OAAO,kBAAkB,mBAAmB,KAAK;AACnD;AAEO,SAAS,yCACd,gBAA0C,EAC1C,gBAAmC,EACnC,SAAoC;IAEpC,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,kBAAkB,yBAAyB,WAAW,QAAQ,SAAS,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;QACpC,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SAAS;YAC7C,iFAAiF;YACjF,IAAI,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;YAC/C,IAAI,oBAAgC;YACpC,IAAI,WAAW,MAAM;gBACnB,IAAI,cAAc,UAAU,UAAU,CAAC,OAAO,CAAC,gBAAgB,SAAS;gBACxE,wGAAwG;gBACxG,MAAO,WAAW,KAAM;oBACtB,IAAI,OAAO,UAAU,UAAU,CAAC,OAAO,CAAC;oBACxC,qCAAqC;oBACrC,IAAI,CAAC,MACH;oBAEF,6EAA6E;oBAC7E,qCAAqC;oBACrC,IAAI,KAAK,IAAI,KAAK,QAAQ;wBACxB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;wBAC3C;oBACF;oBAEA,wDAAwD;oBACxD,qCAAqC;oBACrC,IAAI,AAAC,CAAA,KAAK,KAAK,IAAI,CAAA,KAAM,aACvB;oBAGF,oBAAoB;oBACpB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;gBAC7C;YACF;YAEA,kEAAkE;YAClE,gBAAgB,WAAW,qBAAqB;QAClD;IACF;IAEA,OAAO,CAAA,GAAA,oBAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport type {DropIndicatorProps as AriaDropIndicatorProps} from 'react-aria/useDroppableCollection';\n\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport type {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport type {ItemDropTarget, Key} from '@react-types/shared';\nimport type {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useCallback,\n useContext,\n useMemo\n} from 'react';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks;\n dragState?: DraggableCollectionState;\n dropState?: DroppableCollectionState;\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n}\n\nexport interface DropIndicatorProps\n extends Omit<AriaDropIndicatorProps, 'activateButtonRef'>, RenderProps<DropIndicatorRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DropIndicator'\n */\n className?: ClassNameOrFunction<DropIndicatorRenderProps>;\n}\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be\n * inserted.\n */\nexport const DropIndicator = forwardRef(function DropIndicator(\n props: DropIndicatorProps,\n ref: ForwardedRef<HTMLElement>\n): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n});\n\ntype RenderDropIndicatorRetValue = ((target: ItemDropTarget) => ReactNode | undefined) | undefined;\n\nexport function useRenderDropIndicator(\n dragAndDropHooks?: DragAndDropHooks,\n dropState?: DroppableCollectionState\n): RenderDropIndicatorRetValue {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback(\n (target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? (\n renderDropIndicator(target)\n ) : (\n <DropIndicator target={target} />\n );\n }\n },\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [dropState?.target, isVirtualDragging, renderDropIndicator]\n );\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(\n selectionManager: MultipleSelectionManager,\n dragAndDropHooks?: DragAndDropHooks,\n dropState?: DroppableCollectionState\n): Set<Key> {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n let nextKey = dropState.collection.getKeyAfter(dropTargetKey);\n let lastDescendantKey: Key | null = null;\n if (nextKey != null) {\n let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;\n // Skip over any rows that are descendants of the target (\"after\" position should be after all children)\n while (nextKey != null) {\n let node = dropState.collection.getItem(nextKey);\n // eslint-disable-next-line max-depth\n if (!node) {\n break;\n }\n // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.\n // eslint-disable-next-line max-depth\n if (node.type !== 'item') {\n nextKey = dropState.collection.getKeyAfter(nextKey);\n continue;\n }\n\n // Stop once we find an item at the same level or higher\n // eslint-disable-next-line max-depth\n if ((node.level ?? 0) <= targetLevel) {\n break;\n }\n\n lastDescendantKey = nextKey;\n nextKey = dropState.collection.getKeyAfter(nextKey);\n }\n }\n\n // If nextKey is null (end of collection), use the last descendant\n dropTargetKey = nextKey ?? lastDescendantKey ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.cjs.map"}
@@ -26,9 +26,9 @@ function $49776fcddfd94ccc$export$971707d8a129a1f7(dragAndDropHooks, dropState)
26
26
  if (isVirtualDragging || (dropState === null || dropState === void 0 ? void 0 : dropState.isDropTarget(target))) return renderDropIndicator ? renderDropIndicator(target) : /*#__PURE__*/ (0, $a4UvK$react).createElement($49776fcddfd94ccc$export$62ed72bc21f6b8a6, {
27
27
  target: target
28
28
  });
29
- // We invalidate whenever the target changes.
29
+ }, // We invalidate whenever the target changes.
30
30
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
- }, [
31
+ [
32
32
  dropState === null || dropState === void 0 ? void 0 : dropState.target,
33
33
  isVirtualDragging,
34
34
  renderDropIndicator
@@ -51,7 +51,7 @@ function $49776fcddfd94ccc$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
51
51
  var _dropState_collection_getItem_level;
52
52
  let targetLevel = (_dropState_collection_getItem_level = (_dropState_collection_getItem = dropState.collection.getItem(dropTargetKey)) === null || _dropState_collection_getItem === void 0 ? void 0 : _dropState_collection_getItem.level) !== null && _dropState_collection_getItem_level !== void 0 ? _dropState_collection_getItem_level : 0;
53
53
  // Skip over any rows that are descendants of the target ("after" position should be after all children)
54
- while(nextKey){
54
+ while(nextKey != null){
55
55
  let node = dropState.collection.getItem(nextKey);
56
56
  // eslint-disable-next-line max-depth
57
57
  if (!node) break;
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAiBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoC;AAwB7E,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8B;IACtH,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IAC1B,qBAAO,kEAAG,OAAO,OAAO;AAC1B;AAIO,SAAS,0CAAu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;oBACxC,qCAAqC;oBACrC,IAAI,CAAC,MACH;oBAEF,6EAA6E;oBAC7E,qCAAqC;oBACrC,IAAI,KAAK,IAAI,KAAK,QAAQ;wBACxB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;wBAC3C;oBACF;wBAIK;oBAFL,wDAAwD;oBACxD,qCAAqC;oBACrC,IAAI,AAAC,CAAA,CAAA,cAAA,KAAK,KAAK,cAAV,yBAAA,cAAc,CAAA,KAAM,aACvB;oBAGF,oBAAoB;oBACpB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;gBAC7C;YACF;gBAGgB;YADhB,kEAAkE;YAClE,gBAAgB,CAAA,OAAA,oBAAA,qBAAA,UAAW,+BAAX,kBAAA,OAAgC;QAClD;IACF;IAEA,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport type {DropIndicatorProps as AriaDropIndicatorProps} from 'react-aria/useDroppableCollection';\n\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport type {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport type {ItemDropTarget, Key} from '@react-types/shared';\nimport type {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends Omit<AriaDropIndicatorProps, 'activateButtonRef'>, RenderProps<DropIndicatorRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DropIndicator'\n */\n className?: ClassNameOrFunction<DropIndicatorRenderProps>\n}\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nexport const DropIndicator = forwardRef(function DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n});\n\ntype RenderDropIndicatorRetValue = ((target: ItemDropTarget) => ReactNode | undefined) | undefined\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState): RenderDropIndicatorRetValue {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState): Set<Key> {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n let nextKey = dropState.collection.getKeyAfter(dropTargetKey);\n let lastDescendantKey: Key | null = null;\n if (nextKey != null) {\n let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;\n // Skip over any rows that are descendants of the target (\"after\" position should be after all children)\n while (nextKey) {\n let node = dropState.collection.getItem(nextKey);\n // eslint-disable-next-line max-depth\n if (!node) {\n break;\n }\n // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.\n // eslint-disable-next-line max-depth\n if (node.type !== 'item') {\n nextKey = dropState.collection.getKeyAfter(nextKey);\n continue;\n }\n\n // Stop once we find an item at the same level or higher\n // eslint-disable-next-line max-depth\n if ((node.level ?? 0) <= targetLevel) {\n break;\n }\n \n lastDescendantKey = nextKey;\n nextKey = dropState.collection.getKeyAfter(nextKey);\n }\n }\n\n // If nextKey is null (end of collection), use the last descendant\n dropTargetKey = nextKey ?? lastDescendantKey ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AA0BM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoC;AA6B7E,MAAM,0DAAgB,CAAA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AA,UAAU,UAAU,CAAC,OAAO,CAAC,4BAA7B,oDAAA,8BAA6C,KAAK,cAAlD,iDAAA,sCAAsD;gBACxE,wGAAwG;gBACxG,MAAO,WAAW,KAAM;oBACtB,IAAI,OAAO,UAAU,UAAU,CAAC,OAAO,CAAC;oBACxC,qCAAqC;oBACrC,IAAI,CAAC,MACH;oBAEF,6EAA6E;oBAC7E,qCAAqC;oBACrC,IAAI,KAAK,IAAI,KAAK,QAAQ;wBACxB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;wBAC3C;oBACF;wBAIK;oBAFL,wDAAwD;oBACxD,qCAAqC;oBACrC,IAAI,AAAC,CAAA,CAAA,cAAA,KAAK,KAAK,cAAV,yBAAA,cAAc,CAAA,KAAM,aACvB;oBAGF,oBAAoB;oBACpB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;gBAC7C;YACF;gBAGgB;YADhB,kEAAkE;YAClE,gBAAgB,CAAA,OAAA,oBAAA,qBAAA,UAAW,+BAAX,kBAAA,OAAgC;QAClD;IACF;IAEA,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport type {DropIndicatorProps as AriaDropIndicatorProps} from 'react-aria/useDroppableCollection';\n\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport type {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport type {ItemDropTarget, Key} from '@react-types/shared';\nimport type {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useCallback,\n useContext,\n useMemo\n} from 'react';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks;\n dragState?: DraggableCollectionState;\n dropState?: DroppableCollectionState;\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n}\n\nexport interface DropIndicatorProps\n extends Omit<AriaDropIndicatorProps, 'activateButtonRef'>, RenderProps<DropIndicatorRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DropIndicator'\n */\n className?: ClassNameOrFunction<DropIndicatorRenderProps>;\n}\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be\n * inserted.\n */\nexport const DropIndicator = forwardRef(function DropIndicator(\n props: DropIndicatorProps,\n ref: ForwardedRef<HTMLElement>\n): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n});\n\ntype RenderDropIndicatorRetValue = ((target: ItemDropTarget) => ReactNode | undefined) | undefined;\n\nexport function useRenderDropIndicator(\n dragAndDropHooks?: DragAndDropHooks,\n dropState?: DroppableCollectionState\n): RenderDropIndicatorRetValue {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback(\n (target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? (\n renderDropIndicator(target)\n ) : (\n <DropIndicator target={target} />\n );\n }\n },\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [dropState?.target, isVirtualDragging, renderDropIndicator]\n );\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(\n selectionManager: MultipleSelectionManager,\n dragAndDropHooks?: DragAndDropHooks,\n dropState?: DroppableCollectionState\n): Set<Key> {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n let nextKey = dropState.collection.getKeyAfter(dropTargetKey);\n let lastDescendantKey: Key | null = null;\n if (nextKey != null) {\n let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;\n // Skip over any rows that are descendants of the target (\"after\" position should be after all children)\n while (nextKey != null) {\n let node = dropState.collection.getItem(nextKey);\n // eslint-disable-next-line max-depth\n if (!node) {\n break;\n }\n // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.\n // eslint-disable-next-line max-depth\n if (node.type !== 'item') {\n nextKey = dropState.collection.getKeyAfter(nextKey);\n continue;\n }\n\n // Stop once we find an item at the same level or higher\n // eslint-disable-next-line max-depth\n if ((node.level ?? 0) <= targetLevel) {\n break;\n }\n\n lastDescendantKey = nextKey;\n nextKey = dropState.collection.getKeyAfter(nextKey);\n }\n }\n\n // If nextKey is null (end of collection), use the last descendant\n dropTargetKey = nextKey ?? lastDescendantKey ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.js.map"}
@@ -25,9 +25,9 @@ function $f9554a667e4f0374$export$971707d8a129a1f7(dragAndDropHooks, dropState)
25
25
  if (isVirtualDragging || dropState?.isDropTarget(target)) return renderDropIndicator ? renderDropIndicator(target) : /*#__PURE__*/ (0, $k30rM$react).createElement($f9554a667e4f0374$export$62ed72bc21f6b8a6, {
26
26
  target: target
27
27
  });
28
- // We invalidate whenever the target changes.
28
+ }, // We invalidate whenever the target changes.
29
29
  // eslint-disable-next-line react-hooks/exhaustive-deps
30
- }, [
30
+ [
31
31
  dropState?.target,
32
32
  isVirtualDragging,
33
33
  renderDropIndicator
@@ -47,7 +47,7 @@ function $f9554a667e4f0374$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
47
47
  if (nextKey != null) {
48
48
  let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;
49
49
  // Skip over any rows that are descendants of the target ("after" position should be after all children)
50
- while(nextKey){
50
+ while(nextKey != null){
51
51
  let node = dropState.collection.getItem(nextKey);
52
52
  // eslint-disable-next-line max-depth
53
53
  if (!node) break;
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAiBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoC;AAwB7E,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8B;IACtH,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IAC1B,qBAAO,kEAAG,OAAO,OAAO;AAC1B;AAIO,SAAS,0CAAuB,gBAAmC,EAAE,SAAoC;IAC9G,IAAI,sBAAsB,kBAAkB;IAC5C,IAAI,oBAAoB,kBAAkB;IAC1C,IAAI,KAAK,CAAA,GAAA,kBAAU,EAAE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M,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport type {DropIndicatorProps as AriaDropIndicatorProps} from 'react-aria/useDroppableCollection';\n\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport type {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport type {ItemDropTarget, Key} from '@react-types/shared';\nimport type {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends Omit<AriaDropIndicatorProps, 'activateButtonRef'>, RenderProps<DropIndicatorRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DropIndicator'\n */\n className?: ClassNameOrFunction<DropIndicatorRenderProps>\n}\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nexport const DropIndicator = forwardRef(function DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n});\n\ntype RenderDropIndicatorRetValue = ((target: ItemDropTarget) => ReactNode | undefined) | undefined\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState): RenderDropIndicatorRetValue {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState): Set<Key> {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n let nextKey = dropState.collection.getKeyAfter(dropTargetKey);\n let lastDescendantKey: Key | null = null;\n if (nextKey != null) {\n let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;\n // Skip over any rows that are descendants of the target (\"after\" position should be after all children)\n while (nextKey) {\n let node = dropState.collection.getItem(nextKey);\n // eslint-disable-next-line max-depth\n if (!node) {\n break;\n }\n // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.\n // eslint-disable-next-line max-depth\n if (node.type !== 'item') {\n nextKey = dropState.collection.getKeyAfter(nextKey);\n continue;\n }\n\n // Stop once we find an item at the same level or higher\n // eslint-disable-next-line max-depth\n if ((node.level ?? 0) <= targetLevel) {\n break;\n }\n \n lastDescendantKey = nextKey;\n nextKey = dropState.collection.getKeyAfter(nextKey);\n }\n }\n\n // If nextKey is null (end of collection), use the last descendant\n dropTargetKey = nextKey ?? lastDescendantKey ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.mjs.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AA0BM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoC;AA6B7E,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAC/C,KAAyB,EACzB,GAA8B;IAE9B,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IAC1B,qBAAO,kEAAG,OAAO,OAAO;AAC1B;AAIO,SAAS,0CACd,gBAAmC,EACnC,SAAoC;IAEpC,IAAI,sBAAsB,kBAAkB;IAC5C,IAAI,oBAAoB,kBAAkB;IAC1C,IAAI,KAAK,CAAA,GAAA,kBAAU,EACjB,CAAC;QACC,sFAAsF;QACtF,IAAI,qBAAqB,WAAW,aAAa,SAC/C,OAAO,sBACL,oBAAoB,wBAEpB,gCAAC;YAAc,QAAQ;;IAG7B,GACA,6CAA6C;IAC7C,uDAAuD;IACvD;QAAC,WAAW;QAAQ;QAAmB;KAAoB;IAE7D,OAAO,kBAAkB,mBAAmB,KAAK;AACnD;AAEO,SAAS,yCACd,gBAA0C,EAC1C,gBAAmC,EACnC,SAAoC;IAEpC,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,kBAAkB,yBAAyB,WAAW,QAAQ,SAAS,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;QACpC,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SAAS;YAC7C,iFAAiF;YACjF,IAAI,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;YAC/C,IAAI,oBAAgC;YACpC,IAAI,WAAW,MAAM;gBACnB,IAAI,cAAc,UAAU,UAAU,CAAC,OAAO,CAAC,gBAAgB,SAAS;gBACxE,wGAAwG;gBACxG,MAAO,WAAW,KAAM;oBACtB,IAAI,OAAO,UAAU,UAAU,CAAC,OAAO,CAAC;oBACxC,qCAAqC;oBACrC,IAAI,CAAC,MACH;oBAEF,6EAA6E;oBAC7E,qCAAqC;oBACrC,IAAI,KAAK,IAAI,KAAK,QAAQ;wBACxB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;wBAC3C;oBACF;oBAEA,wDAAwD;oBACxD,qCAAqC;oBACrC,IAAI,AAAC,CAAA,KAAK,KAAK,IAAI,CAAA,KAAM,aACvB;oBAGF,oBAAoB;oBACpB,UAAU,UAAU,UAAU,CAAC,WAAW,CAAC;gBAC7C;YACF;YAEA,kEAAkE;YAClE,gBAAgB,WAAW,qBAAqB;QAClD;IACF;IAEA,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport type {DropIndicatorProps as AriaDropIndicatorProps} from 'react-aria/useDroppableCollection';\n\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport type {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport type {ItemDropTarget, Key} from '@react-types/shared';\nimport type {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useCallback,\n useContext,\n useMemo\n} from 'react';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks;\n dragState?: DraggableCollectionState;\n dropState?: DroppableCollectionState;\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n}\n\nexport interface DropIndicatorProps\n extends Omit<AriaDropIndicatorProps, 'activateButtonRef'>, RenderProps<DropIndicatorRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DropIndicator'\n */\n className?: ClassNameOrFunction<DropIndicatorRenderProps>;\n}\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be\n * inserted.\n */\nexport const DropIndicator = forwardRef(function DropIndicator(\n props: DropIndicatorProps,\n ref: ForwardedRef<HTMLElement>\n): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n});\n\ntype RenderDropIndicatorRetValue = ((target: ItemDropTarget) => ReactNode | undefined) | undefined;\n\nexport function useRenderDropIndicator(\n dragAndDropHooks?: DragAndDropHooks,\n dropState?: DroppableCollectionState\n): RenderDropIndicatorRetValue {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback(\n (target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? (\n renderDropIndicator(target)\n ) : (\n <DropIndicator target={target} />\n );\n }\n },\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [dropState?.target, isVirtualDragging, renderDropIndicator]\n );\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(\n selectionManager: MultipleSelectionManager,\n dragAndDropHooks?: DragAndDropHooks,\n dropState?: DroppableCollectionState\n): Set<Key> {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n let nextKey = dropState.collection.getKeyAfter(dropTargetKey);\n let lastDescendantKey: Key | null = null;\n if (nextKey != null) {\n let targetLevel = dropState.collection.getItem(dropTargetKey)?.level ?? 0;\n // Skip over any rows that are descendants of the target (\"after\" position should be after all children)\n while (nextKey != null) {\n let node = dropState.collection.getItem(nextKey);\n // eslint-disable-next-line max-depth\n if (!node) {\n break;\n }\n // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.\n // eslint-disable-next-line max-depth\n if (node.type !== 'item') {\n nextKey = dropState.collection.getKeyAfter(nextKey);\n continue;\n }\n\n // Stop once we find an item at the same level or higher\n // eslint-disable-next-line max-depth\n if ((node.level ?? 0) <= targetLevel) {\n break;\n }\n\n lastDescendantKey = nextKey;\n nextKey = dropState.collection.getKeyAfter(nextKey);\n }\n }\n\n // If nextKey is null (end of collection), use the last descendant\n dropTargetKey = nextKey ?? lastDescendantKey ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAoEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC1G,IAAI,cAAC,aAAa,OAAM,GAAG;IAC3B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAc,CAAA,GAAA,yCAAW,EAAE;IAC/B,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAqB;IAC1C,IAAI,aAAC,SAAS,mBAAE,eAAe,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,+BAAM,EAAE;QAAC,GAAG,KAAK;QAAE,KAAK;QAAW,eAAe;IAAI;IACvG,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,mCAAQ,EAAE,mBAAmB,CAAC,GAAG;IACrD,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW;IACzD,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAE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gBAEA,SAAS,OAAO,aAAa;YAC/B;QACF;QACA,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,oBAAkB,gBAAgB;QAClC,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QACE,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,YAAY,gBAAgB,WAAW;QACnE,KAAK;SAER,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DropOptions, useDrop} from 'react-aria/useDrop';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {getEventTarget, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../intl/*.json';\nimport {isFocusable} from 'react-aria/private/utils/isFocusable';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useButton} from 'react-aria/useButton';\nimport {useClipboard} from 'react-aria/useClipboard';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n// @ts-ignore\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useSlotId} from 'react-aria/private/utils/useId';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface DropZoneRenderProps {\n /**\n * Whether the dropzone is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the dropzone is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the dropzone is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the dropzone is the drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the dropzone is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface DropZoneProps extends Omit<DropOptions, 'getDropOperationForPoint' | 'ref' | 'hasDropButton'>, HoverEvents, RenderProps<DropZoneRenderProps>, SlotProps, AriaLabelingProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DropZone'\n */\n className?: ClassNameOrFunction<DropZoneRenderProps>\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, HTMLDivElement>>(null);\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = forwardRef(function DropZone(props: DropZoneProps, ref: ForwardedRef<HTMLDivElement>) {\n let {isDisabled = false} = props;\n [props, ref] = useContextProps(props, ref, DropZoneContext);\n let dropzoneRef = useObjectRef(ref);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {dropProps, dropButtonProps, isDropTarget} = useDrop({...props, ref: buttonRef, hasDropButton: true});\n let {buttonProps} = useButton(dropButtonProps || {}, buttonRef);\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let textId = useSlotId();\n let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');\n let messageId = props['aria-labelledby'];\n let ariaLabelledby = [textId, messageId].filter(Boolean).join(' ');\n let labelProps = useLabels({'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby});\n\n\n let {clipboardProps} = useClipboard({\n isDisabled,\n onPaste: (items) => props.onDrop?.({\n type: 'drop',\n items,\n x: 0,\n y: 0,\n dropOperation: 'copy'\n })\n });\n\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocused, isFocusVisible, isDropTarget, isDisabled},\n defaultClassName: 'react-aria-DropZone'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TextContext, {id: textId, slot: 'label'}]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}\n slot={props.slot || undefined}\n ref={dropzoneRef}\n onClick={(e) => {\n let target = getEventTarget(e) as HTMLElement | null;\n while (target && nodeContains(dropzoneRef.current, target)) {\n if (isFocusable(target)) {\n break;\n } else if (target === dropzoneRef.current) {\n buttonRef.current?.focus();\n break;\n }\n\n target = target.parentElement;\n }\n }}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-drop-target={isDropTarget || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <button\n {...mergeProps(buttonProps, focusProps, clipboardProps, labelProps)}\n ref={buttonRef} />\n </VisuallyHidden>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAkFM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAC1C,KAAoB,EACpB,GAAiC;IAEjC,I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kB;IACpB;IACA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC,CAAA,GAAA,kCAAO;QAAE,QAAQ;YAAC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBAAC,IAAI;oBAAQ,MAAM;gBAAO;aAAE;SAAC;qBAC5D,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,aAAa,WAAW,WAAW;QAC5D,MAAM,MAAM,IAAI,IAAI;QACpB,KAAK;QACL,SAAS,CAAA;YACP,IAAI,SAAS,CAAA,GAAA,gEAAa,EAAE;YAC5B,MAAO,UAAU,CAAA,GAAA,8DAAW,EAAE,YAAY,OAAO,EAAE,QAAS;gBAC1D,IAAI,CAAA,GAAA,mDAAU,EAAE,SACd;qBACK,IAAI,WAAW,YAAY,OAAO,EAAE;oBACzC,UAAU,OAAO,EAAE;oBACnB;gBACF;gBAEA,SAAS,OAAO,aAAa;YAC/B;QACF;QACA,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,oBAAkB,gBAAgB;QAClC,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QACE,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,YAAY,gBAAgB,WAAW;QACnE,KAAK;SAGR,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DropOptions, useDrop} from 'react-aria/useDrop';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {getEventTarget, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../intl/*.json';\nimport {isFocusable} from 'react-aria/private/utils/isFocusable';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useButton} from 'react-aria/useButton';\nimport {useClipboard} from 'react-aria/useClipboard';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n// @ts-ignore\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useSlotId} from 'react-aria/private/utils/useId';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface DropZoneRenderProps {\n /**\n * Whether the dropzone is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the dropzone is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the dropzone is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the dropzone is the drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n /**\n * Whether the dropzone is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n}\n\nexport interface DropZoneProps\n extends\n Omit<DropOptions, 'getDropOperationForPoint' | 'ref' | 'hasDropButton'>,\n HoverEvents,\n RenderProps<DropZoneRenderProps>,\n SlotProps,\n AriaLabelingProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DropZone'\n */\n className?: ClassNameOrFunction<DropZoneRenderProps>;\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, HTMLDivElement>>(null);\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = forwardRef(function DropZone(\n props: DropZoneProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isDisabled = false} = props;\n [props, ref] = useContextProps(props, ref, DropZoneContext);\n let dropzoneRef = useObjectRef(ref);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {dropProps, dropButtonProps, isDropTarget} = useDrop({\n ...props,\n ref: buttonRef,\n hasDropButton: true\n });\n let {buttonProps} = useButton(dropButtonProps || {}, buttonRef);\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let textId = useSlotId();\n let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');\n let messageId = props['aria-labelledby'];\n let ariaLabelledby = [textId, messageId].filter(Boolean).join(' ');\n let labelProps = useLabels({'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby});\n\n let {clipboardProps} = useClipboard({\n isDisabled,\n onPaste: items =>\n props.onDrop?.({\n type: 'drop',\n items,\n x: 0,\n y: 0,\n dropOperation: 'copy'\n })\n });\n\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocused, isFocusVisible, isDropTarget, isDisabled},\n defaultClassName: 'react-aria-DropZone'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider values={[[TextContext, {id: textId, slot: 'label'}]]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}\n slot={props.slot || undefined}\n ref={dropzoneRef}\n onClick={e => {\n let target = getEventTarget(e) as HTMLElement | null;\n while (target && nodeContains(dropzoneRef.current, target)) {\n if (isFocusable(target)) {\n break;\n } else if (target === dropzoneRef.current) {\n buttonRef.current?.focus();\n break;\n }\n\n target = target.parentElement;\n }\n }}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-drop-target={isDropTarget || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <button\n {...mergeProps(buttonProps, focusProps, clipboardProps, labelProps)}\n ref={buttonRef}\n />\n </VisuallyHidden>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAoEM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC1G,IAAI,cAAC,aAAa,OAAM,GAAG;IAC3B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAc,CAAA,GAAA,mBAAW,EAAE;IAC/B,IAAI,YAAY,CAAA,GAAA,aAAK,EAAqB;IAC1C,IAAI,aAAC,SAAS,mBAAE,eAAe,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,cAAM,EAAE;QAAC,GAAG,KAAK;QAAE,KAAK;QAAW,eAAe;IAAI;IACvG,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,mBAAmB,CAAC,GAAG;IACrD,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG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AO,EAAE,QAAS;gBAC1D,IAAI,CAAA,GAAA,kBAAU,EAAE,SACd;qBACK,IAAI,WAAW,YAAY,OAAO,EAAE;wBACzC;qBAAA,qBAAA,UAAU,OAAO,cAAjB,yCAAA,mBAAmB,KAAK;oBACxB;gBACF;gBAEA,SAAS,OAAO,aAAa;YAC/B;QACF;QACA,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,oBAAkB,gBAAgB;QAClC,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,YAAY,gBAAgB,WAAW;QACnE,KAAK;SAER,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DropOptions, useDrop} from 'react-aria/useDrop';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {getEventTarget, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../intl/*.json';\nimport {isFocusable} from 'react-aria/private/utils/isFocusable';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useButton} from 'react-aria/useButton';\nimport {useClipboard} from 'react-aria/useClipboard';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n// @ts-ignore\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useSlotId} from 'react-aria/private/utils/useId';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface DropZoneRenderProps {\n /**\n * Whether the dropzone is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the dropzone is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the dropzone is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the dropzone is the drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the dropzone is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface DropZoneProps extends Omit<DropOptions, 'getDropOperationForPoint' | 'ref' | 'hasDropButton'>, HoverEvents, RenderProps<DropZoneRenderProps>, SlotProps, AriaLabelingProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DropZone'\n */\n className?: ClassNameOrFunction<DropZoneRenderProps>\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, HTMLDivElement>>(null);\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = forwardRef(function DropZone(props: DropZoneProps, ref: ForwardedRef<HTMLDivElement>) {\n let {isDisabled = false} = props;\n [props, ref] = useContextProps(props, ref, DropZoneContext);\n let dropzoneRef = useObjectRef(ref);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {dropProps, dropButtonProps, isDropTarget} = useDrop({...props, ref: buttonRef, hasDropButton: true});\n let {buttonProps} = useButton(dropButtonProps || {}, buttonRef);\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let textId = useSlotId();\n let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');\n let messageId = props['aria-labelledby'];\n let ariaLabelledby = [textId, messageId].filter(Boolean).join(' ');\n let labelProps = useLabels({'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby});\n\n\n let {clipboardProps} = useClipboard({\n isDisabled,\n onPaste: (items) => props.onDrop?.({\n type: 'drop',\n items,\n x: 0,\n y: 0,\n dropOperation: 'copy'\n })\n });\n\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocused, isFocusVisible, isDropTarget, isDisabled},\n defaultClassName: 'react-aria-DropZone'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TextContext, {id: textId, slot: 'label'}]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}\n slot={props.slot || undefined}\n ref={dropzoneRef}\n onClick={(e) => {\n let target = getEventTarget(e) as HTMLElement | null;\n while (target && nodeContains(dropzoneRef.current, target)) {\n if (isFocusable(target)) {\n break;\n } else if (target === dropzoneRef.current) {\n buttonRef.current?.focus();\n break;\n }\n\n target = target.parentElement;\n }\n }}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-drop-target={isDropTarget || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <button\n {...mergeProps(buttonProps, focusProps, clipboardProps, labelProps)}\n ref={buttonRef} />\n </VisuallyHidden>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;C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ved.\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 {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DropOptions, useDrop} from 'react-aria/useDrop';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {getEventTarget, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../intl/*.json';\nimport {isFocusable} from 'react-aria/private/utils/isFocusable';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useButton} from 'react-aria/useButton';\nimport {useClipboard} from 'react-aria/useClipboard';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n// @ts-ignore\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useSlotId} from 'react-aria/private/utils/useId';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface DropZoneRenderProps {\n /**\n * Whether the dropzone is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the dropzone is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the dropzone is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the dropzone is the drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n /**\n * Whether the dropzone is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n}\n\nexport interface DropZoneProps\n extends\n Omit<DropOptions, 'getDropOperationForPoint' | 'ref' | 'hasDropButton'>,\n HoverEvents,\n RenderProps<DropZoneRenderProps>,\n SlotProps,\n AriaLabelingProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DropZone'\n */\n className?: ClassNameOrFunction<DropZoneRenderProps>;\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, HTMLDivElement>>(null);\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = forwardRef(function DropZone(\n props: DropZoneProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isDisabled = false} = props;\n [props, ref] = useContextProps(props, ref, DropZoneContext);\n let dropzoneRef = useObjectRef(ref);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {dropProps, dropButtonProps, isDropTarget} = useDrop({\n ...props,\n ref: buttonRef,\n hasDropButton: true\n });\n let {buttonProps} = useButton(dropButtonProps || {}, buttonRef);\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let textId = useSlotId();\n let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');\n let messageId = props['aria-labelledby'];\n let ariaLabelledby = [textId, messageId].filter(Boolean).join(' ');\n let labelProps = useLabels({'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby});\n\n let {clipboardProps} = useClipboard({\n isDisabled,\n onPaste: items =>\n props.onDrop?.({\n type: 'drop',\n items,\n x: 0,\n y: 0,\n dropOperation: 'copy'\n })\n });\n\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocused, isFocusVisible, isDropTarget, isDisabled},\n defaultClassName: 'react-aria-DropZone'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider values={[[TextContext, {id: textId, slot: 'label'}]]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}\n slot={props.slot || undefined}\n ref={dropzoneRef}\n onClick={e => {\n let target = getEventTarget(e) as HTMLElement | null;\n while (target && nodeContains(dropzoneRef.current, target)) {\n if (isFocusable(target)) {\n break;\n } else if (target === dropzoneRef.current) {\n buttonRef.current?.focus();\n break;\n }\n\n target = target.parentElement;\n }\n }}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-drop-target={isDropTarget || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <button\n {...mergeProps(buttonProps, focusProps, clipboardProps, labelProps)}\n ref={buttonRef}\n />\n </VisuallyHidden>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAoEM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC1G,IAAI,cAAC,aAAa,OAAM,GAAG;IAC3B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAc,CAAA,GAAA,mBAAW,EAAE;IAC/B,IAAI,YAAY,CAAA,GAAA,aAAK,EAAqB;IAC1C,IAAI,aAAC,SAAS,mBAAE,eAAe,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,cAAM,EAAE;QAAC,GAAG,KAAK;QAAE,KAAK;QA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iBAAS,EAAE,UAAU,aAAa,WAAW,WAAW;QAC5D,MAAM,MAAM,IAAI,IAAI;QACpB,KAAK;QACL,SAAS,CAAC;YACR,IAAI,SAAS,CAAA,GAAA,qBAAa,EAAE;YAC5B,MAAO,UAAU,CAAA,GAAA,mBAAW,EAAE,YAAY,OAAO,EAAE,QAAS;gBAC1D,IAAI,CAAA,GAAA,kBAAU,EAAE,SACd;qBACK,IAAI,WAAW,YAAY,OAAO,EAAE;oBACzC,UAAU,OAAO,EAAE;oBACnB;gBACF;gBAEA,SAAS,OAAO,aAAa;YAC/B;QACF;QACA,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,oBAAkB,gBAAgB;QAClC,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,YAAY,gBAAgB,WAAW;QACnE,KAAK;SAER,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DropOptions, useDrop} from 'react-aria/useDrop';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {getEventTarget, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../intl/*.json';\nimport {isFocusable} from 'react-aria/private/utils/isFocusable';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useButton} from 'react-aria/useButton';\nimport {useClipboard} from 'react-aria/useClipboard';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n// @ts-ignore\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useSlotId} from 'react-aria/private/utils/useId';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface DropZoneRenderProps {\n /**\n * Whether the dropzone is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the dropzone is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the dropzone is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the dropzone is the drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the dropzone is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface DropZoneProps extends Omit<DropOptions, 'getDropOperationForPoint' | 'ref' | 'hasDropButton'>, HoverEvents, RenderProps<DropZoneRenderProps>, SlotProps, AriaLabelingProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-DropZone'\n */\n className?: ClassNameOrFunction<DropZoneRenderProps>\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, HTMLDivElement>>(null);\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = forwardRef(function DropZone(props: DropZoneProps, ref: ForwardedRef<HTMLDivElement>) {\n let {isDisabled = false} = props;\n [props, ref] = useContextProps(props, ref, DropZoneContext);\n let dropzoneRef = useObjectRef(ref);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {dropProps, dropButtonProps, isDropTarget} = useDrop({...props, ref: buttonRef, hasDropButton: true});\n let {buttonProps} = useButton(dropButtonProps || {}, buttonRef);\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let textId = useSlotId();\n let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');\n let messageId = props['aria-labelledby'];\n let ariaLabelledby = [textId, messageId].filter(Boolean).join(' ');\n let labelProps = useLabels({'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby});\n\n\n let {clipboardProps} = useClipboard({\n isDisabled,\n onPaste: (items) => props.onDrop?.({\n type: 'drop',\n items,\n x: 0,\n y: 0,\n dropOperation: 'copy'\n })\n });\n\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocused, isFocusVisible, isDropTarget, isDisabled},\n defaultClassName: 'react-aria-DropZone'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TextContext, {id: textId, slot: 'label'}]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}\n slot={props.slot || undefined}\n ref={dropzoneRef}\n onClick={(e) => {\n let target = getEventTarget(e) as HTMLElement | null;\n while (target && nodeContains(dropzoneRef.current, target)) {\n if (isFocusable(target)) {\n break;\n } else if (target === dropzoneRef.current) {\n buttonRef.current?.focus();\n break;\n }\n\n target = target.parentElement;\n }\n }}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-drop-target={isDropTarget || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <button\n {...mergeProps(buttonProps, focusProps, clipboardProps, labelProps)}\n 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AQ;AAI7B","sources":["packages/react-aria-components/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DropOptions, useDrop} from 'react-aria/useDrop';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {getEventTarget, nodeContains} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../intl/*.json';\nimport {isFocusable} from 'react-aria/private/utils/isFocusable';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\nimport {useButton} from 'react-aria/useButton';\nimport {useClipboard} from 'react-aria/useClipboard';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n// @ts-ignore\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useSlotId} from 'react-aria/private/utils/useId';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface DropZoneRenderProps {\n /**\n * Whether the dropzone is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the dropzone is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the dropzone is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the dropzone is the drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n /**\n * Whether the dropzone is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n}\n\nexport interface DropZoneProps\n extends\n Omit<DropOptions, 'getDropOperationForPoint' | 'ref' | 'hasDropButton'>,\n HoverEvents,\n RenderProps<DropZoneRenderProps>,\n SlotProps,\n AriaLabelingProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-DropZone'\n */\n className?: ClassNameOrFunction<DropZoneRenderProps>;\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, HTMLDivElement>>(null);\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = forwardRef(function DropZone(\n props: DropZoneProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isDisabled = false} = props;\n [props, ref] = useContextProps(props, ref, DropZoneContext);\n let dropzoneRef = useObjectRef(ref);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {dropProps, dropButtonProps, isDropTarget} = useDrop({\n ...props,\n ref: buttonRef,\n hasDropButton: true\n });\n let {buttonProps} = useButton(dropButtonProps || {}, buttonRef);\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let textId = useSlotId();\n let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');\n let messageId = props['aria-labelledby'];\n let ariaLabelledby = [textId, messageId].filter(Boolean).join(' ');\n let labelProps = useLabels({'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby});\n\n let {clipboardProps} = useClipboard({\n isDisabled,\n onPaste: items =>\n props.onDrop?.({\n type: 'drop',\n items,\n x: 0,\n y: 0,\n dropOperation: 'copy'\n })\n });\n\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocused, isFocusVisible, isDropTarget, isDisabled},\n defaultClassName: 'react-aria-DropZone'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider values={[[TextContext, {id: textId, slot: 'label'}]]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}\n slot={props.slot || undefined}\n ref={dropzoneRef}\n onClick={e => {\n let target = getEventTarget(e) as HTMLElement | null;\n while (target && nodeContains(dropzoneRef.current, target)) {\n if (isFocusable(target)) {\n break;\n } else if (target === dropzoneRef.current) {\n buttonRef.current?.focus();\n break;\n }\n\n target = target.parentElement;\n }\n }}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-drop-target={isDropTarget || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <button\n {...mergeProps(buttonProps, focusProps, clipboardProps, labelProps)}\n ref={buttonRef}\n />\n </VisuallyHidden>\n {renderProps.children}\n </dom.div>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAQM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAA2B;AAoBjE,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAA8B;IAC7G,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE;IAC5B,IAAI,CAAC,YAAY,WACf,OAAO;IAGT,qBAAO,0DAAC;QAAiB,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAEA,MAAM,sDAAkB,CAAA,GAAA,uBAAS,EAAE,CAAC,OAAwB;IAC1D,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE;IAC5B,IAAI,eAAC,WAAW,EAAE,GAAG,WAAU,GAAG;IAClC,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,WAAW;QAAC,QAAQ;IAAI;IACtD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,SAAS;QACZ,kBAAkB;QAClB,iBAAiB,WAAW,gBAAgB,CAAC,MAAM,KAAK,IAAI,YAAY,WAAW,gBAAgB,CAAC,IAAI,CAAC;QACzG,QAAQ;IACV;IAEA,IAAI,YAAY,QAAQ,IAAI,MAC1B,OAAO;IAGT,qBAAO,0DAAC,CAAA,GAAA,8BAAG;QAAE,MAAK;QAAe,aAAa;QAAc,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,KAAK;;AACjG","sources":["packages/react-aria-components/src/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {ClassNameOrFunction, RenderProps, useRenderProps} from './utils';\nimport {DOMProps, GlobalDOMAttributes, ValidationResult} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {Text} from './Text';\n\nexport const FieldErrorContext = createContext<ValidationResult | null>(null);\n\nexport interface FieldErrorRenderProps extends ValidationResult {}\nexport interface FieldErrorProps extends RenderProps<FieldErrorRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-FieldError'\n */\n className?: ClassNameOrFunction<FieldErrorRenderProps>,\n /**\n * The HTML element type to render. Defaults to `'span'`.\n * Set to `'div'` when using block-level children (e.g. `<ul>`) to avoid invalid HTML.\n * @default 'span'\n */\n elementType?: string\n}\n\n/**\n * A FieldError displays validation errors for a form field.\n */\nexport const FieldError = forwardRef(function FieldError(props: FieldErrorProps, ref: ForwardedRef<HTMLElement>) {\n let validation = useContext(FieldErrorContext);\n if (!validation?.isInvalid) {\n return null;\n }\n\n return <FieldErrorInner {...props} ref={ref} />;\n});\n\nconst FieldErrorInner = forwardRef((props: FieldErrorProps, ref: ForwardedRef<HTMLElement>) => {\n let validation = useContext(FieldErrorContext)!;\n let {elementType, ...restProps} = props;\n let domProps = filterDOMProps(restProps, {global: true})!;\n let renderProps = useRenderProps({\n ...restProps,\n defaultClassName: 'react-aria-FieldError',\n defaultChildren: validation.validationErrors.length === 0 ? undefined : validation.validationErrors.join(' '),\n values: validation\n });\n\n if (renderProps.children == null) {\n return null;\n }\n\n return <Text slot=\"errorMessage\" elementType={elementType} {...domProps} {...renderProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"FieldError.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAQM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAA2B;AAwBjE,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAC5C,KAAsB,EACtB,GAA8B;IAE9B,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE;IAC5B,IAAI,CAAC,YAAY,WACf,OAAO;IAGT,qBAAO,0DAAC;QAAiB,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAEA,MAAM,sDAAkB,CAAA,GAAA,uBAAS,EAAE,CAAC,OAAwB;IAC1D,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE;IAC5B,IAAI,eAAC,WAAW,EAAE,GAAG,WAAU,GAAG;IAClC,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,WAAW;QAAC,QAAQ;IAAI;IACtD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,SAAS;QACZ,kBAAkB;QAClB,iBACE,WAAW,gBAAgB,CAAC,MAAM,KAAK,IAAI,YAAY,WAAW,gBAAgB,CAAC,IAAI,CAAC;QAC1F,QAAQ;IACV;IAEA,IAAI,YAAY,QAAQ,IAAI,MAC1B,OAAO;IAGT,qBACE,0DAAC,CAAA,GAAA,8BAAG;QAAE,MAAK;QAAe,aAAa;QAAc,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,KAAK;;AAE5F","sources":["packages/react-aria-components/src/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {ClassNameOrFunction, RenderProps, useRenderProps} from './utils';\nimport {DOMProps, GlobalDOMAttributes, ValidationResult} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {Text} from './Text';\n\nexport const FieldErrorContext = createContext<ValidationResult | null>(null);\n\nexport interface FieldErrorRenderProps extends ValidationResult {}\nexport interface FieldErrorProps\n extends RenderProps<FieldErrorRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-FieldError'\n */\n className?: ClassNameOrFunction<FieldErrorRenderProps>;\n /**\n * The HTML element type to render. Defaults to `'span'`.\n * Set to `'div'` when using block-level children (e.g. `<ul>`) to avoid invalid HTML.\n *\n * @default 'span'\n */\n elementType?: string;\n}\n\n/**\n * A FieldError displays validation errors for a form field.\n */\nexport const FieldError = forwardRef(function FieldError(\n props: FieldErrorProps,\n ref: ForwardedRef<HTMLElement>\n) {\n let validation = useContext(FieldErrorContext);\n if (!validation?.isInvalid) {\n return null;\n }\n\n return <FieldErrorInner {...props} ref={ref} />;\n});\n\nconst FieldErrorInner = forwardRef((props: FieldErrorProps, ref: ForwardedRef<HTMLElement>) => {\n let validation = useContext(FieldErrorContext)!;\n let {elementType, ...restProps} = props;\n let domProps = filterDOMProps(restProps, {global: true})!;\n let renderProps = useRenderProps({\n ...restProps,\n defaultClassName: 'react-aria-FieldError',\n defaultChildren:\n validation.validationErrors.length === 0 ? undefined : validation.validationErrors.join(' '),\n values: validation\n });\n\n if (renderProps.children == null) {\n return null;\n }\n\n return (\n <Text slot=\"errorMessage\" elementType={elementType} {...domProps} {...renderProps} ref={ref} />\n );\n});\n"],"names":[],"version":3,"file":"FieldError.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAQM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAA2B;AAoBjE,MAAM,0DAAa,CAAA,GAAA,iBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAA8B;IAC7G,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE;IAC5B,IAAI,EAAC,uBAAA,iCAAA,WAAY,SAAS,GACxB,OAAO;IAGT,qBAAO,gCAAC;QAAiB,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAEA,MAAM,sDAAkB,CAAA,GAAA,iBAAS,EAAE,CAAC,OAAwB;IAC1D,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE;IAC5B,IAAI,eAAC,WAAW,EAAE,GAAG,WAAU,GAAG;IAClC,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,WAAW;QAAC,QAAQ;IAAI;IACtD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,SAAS;QACZ,kBAAkB;QAClB,iBAAiB,WAAW,gBAAgB,CAAC,MAAM,KAAK,IAAI,YAAY,WAAW,gBAAgB,CAAC,IAAI,CAAC;QACzG,QAAQ;IACV;IAEA,IAAI,YAAY,QAAQ,IAAI,MAC1B,OAAO;IAGT,qBAAO,gCAAC,CAAA,GAAA,yCAAG;QAAE,MAAK;QAAe,aAAa;QAAc,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,KAAK;;AACjG","sources":["packages/react-aria-components/src/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {ClassNameOrFunction, RenderProps, useRenderProps} from './utils';\nimport {DOMProps, GlobalDOMAttributes, ValidationResult} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {Text} from './Text';\n\nexport const FieldErrorContext = createContext<ValidationResult | null>(null);\n\nexport interface FieldErrorRenderProps extends ValidationResult {}\nexport interface FieldErrorProps extends RenderProps<FieldErrorRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-FieldError'\n */\n className?: ClassNameOrFunction<FieldErrorRenderProps>,\n /**\n * The HTML element type to render. Defaults to `'span'`.\n * Set to `'div'` when using block-level children (e.g. `<ul>`) to avoid invalid HTML.\n * @default 'span'\n */\n elementType?: string\n}\n\n/**\n * A FieldError displays validation errors for a form field.\n */\nexport const FieldError = forwardRef(function FieldError(props: FieldErrorProps, ref: ForwardedRef<HTMLElement>) {\n let validation = useContext(FieldErrorContext);\n if (!validation?.isInvalid) {\n return null;\n }\n\n return <FieldErrorInner {...props} ref={ref} />;\n});\n\nconst FieldErrorInner = forwardRef((props: FieldErrorProps, ref: ForwardedRef<HTMLElement>) => {\n let validation = useContext(FieldErrorContext)!;\n let {elementType, ...restProps} = props;\n let domProps = filterDOMProps(restProps, {global: true})!;\n let renderProps = useRenderProps({\n ...restProps,\n defaultClassName: 'react-aria-FieldError',\n defaultChildren: validation.validationErrors.length === 0 ? undefined : validation.validationErrors.join(' '),\n values: validation\n });\n\n if (renderProps.children == null) {\n return null;\n }\n\n return <Text slot=\"errorMessage\" elementType={elementType} {...domProps} {...renderProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"FieldError.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAQM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAA2B;AAwBjE,MAAM,0DAAa,CAAA,GAAA,iBAAS,EAAE,SAAS,WAC5C,KAAsB,EACtB,GAA8B;IAE9B,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE;IAC5B,IAAI,EAAC,uBAAA,iCAAA,WAAY,SAAS,GACxB,OAAO;IAGT,qBAAO,gCAAC;QAAiB,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAEA,MAAM,sDAAkB,CAAA,GAAA,iBAAS,EAAE,CAAC,OAAwB;IAC1D,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE;IAC5B,IAAI,eAAC,WAAW,EAAE,GAAG,WAAU,GAAG;IAClC,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,WAAW;QAAC,QAAQ;IAAI;IACtD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,SAAS;QACZ,kBAAkB;QAClB,iBACE,WAAW,gBAAgB,CAAC,MAAM,KAAK,IAAI,YAAY,WAAW,gBAAgB,CAAC,IAAI,CAAC;QAC1F,QAAQ;IACV;IAEA,IAAI,YAAY,QAAQ,IAAI,MAC1B,OAAO;IAGT,qBACE,gCAAC,CAAA,GAAA,yCAAG;QAAE,MAAK;QAAe,aAAa;QAAc,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,KAAK;;AAE5F","sources":["packages/react-aria-components/src/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {ClassNameOrFunction, RenderProps, useRenderProps} from './utils';\nimport {DOMProps, GlobalDOMAttributes, ValidationResult} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {Text} from './Text';\n\nexport const FieldErrorContext = createContext<ValidationResult | null>(null);\n\nexport interface FieldErrorRenderProps extends ValidationResult {}\nexport interface FieldErrorProps\n extends RenderProps<FieldErrorRenderProps>, DOMProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-FieldError'\n */\n className?: ClassNameOrFunction<FieldErrorRenderProps>;\n /**\n * The HTML element type to render. Defaults to `'span'`.\n * Set to `'div'` when using block-level children (e.g. `<ul>`) to avoid invalid HTML.\n *\n * @default 'span'\n */\n elementType?: string;\n}\n\n/**\n * A FieldError displays validation errors for a form field.\n */\nexport const FieldError = forwardRef(function FieldError(\n props: FieldErrorProps,\n ref: ForwardedRef<HTMLElement>\n) {\n let validation = useContext(FieldErrorContext);\n if (!validation?.isInvalid) {\n return null;\n }\n\n return <FieldErrorInner {...props} ref={ref} />;\n});\n\nconst FieldErrorInner = forwardRef((props: FieldErrorProps, ref: ForwardedRef<HTMLElement>) => {\n let validation = useContext(FieldErrorContext)!;\n let {elementType, ...restProps} = props;\n let domProps = filterDOMProps(restProps, {global: true})!;\n let renderProps = useRenderProps({\n ...restProps,\n defaultClassName: 'react-aria-FieldError',\n defaultChildren:\n validation.validationErrors.length === 0 ? undefined : validation.validationErrors.join(' '),\n values: validation\n });\n\n if (renderProps.children == null) {\n return null;\n }\n\n return (\n <Text slot=\"errorMessage\" elementType={elementType} {...domProps} {...renderProps} ref={ref} />\n );\n});\n"],"names":[],"version":3,"file":"FieldError.js.map"}