@depup/react-aria-components 1.16.0-depup.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 (661) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +31 -0
  3. package/changes.json +10 -0
  4. package/dist/Autocomplete.main.js +78 -0
  5. package/dist/Autocomplete.main.js.map +1 -0
  6. package/dist/Autocomplete.mjs +67 -0
  7. package/dist/Autocomplete.module.js +67 -0
  8. package/dist/Autocomplete.module.js.map +1 -0
  9. package/dist/Breadcrumbs.main.js +103 -0
  10. package/dist/Breadcrumbs.main.js.map +1 -0
  11. package/dist/Breadcrumbs.mjs +92 -0
  12. package/dist/Breadcrumbs.module.js +92 -0
  13. package/dist/Breadcrumbs.module.js.map +1 -0
  14. package/dist/Button.main.js +123 -0
  15. package/dist/Button.main.js.map +1 -0
  16. package/dist/Button.mjs +113 -0
  17. package/dist/Button.module.js +113 -0
  18. package/dist/Button.module.js.map +1 -0
  19. package/dist/Calendar.main.js +364 -0
  20. package/dist/Calendar.main.js.map +1 -0
  21. package/dist/Calendar.mjs +345 -0
  22. package/dist/Calendar.module.js +345 -0
  23. package/dist/Calendar.module.js.map +1 -0
  24. package/dist/Checkbox.main.js +188 -0
  25. package/dist/Checkbox.main.js.map +1 -0
  26. package/dist/Checkbox.mjs +176 -0
  27. package/dist/Checkbox.module.js +176 -0
  28. package/dist/Checkbox.module.js.map +1 -0
  29. package/dist/Collection.main.js +105 -0
  30. package/dist/Collection.main.js.map +1 -0
  31. package/dist/Collection.mjs +91 -0
  32. package/dist/Collection.module.js +91 -0
  33. package/dist/Collection.module.js.map +1 -0
  34. package/dist/ColorArea.main.js +80 -0
  35. package/dist/ColorArea.main.js.map +1 -0
  36. package/dist/ColorArea.mjs +70 -0
  37. package/dist/ColorArea.module.js +70 -0
  38. package/dist/ColorArea.module.js.map +1 -0
  39. package/dist/ColorField.main.js +168 -0
  40. package/dist/ColorField.main.js.map +1 -0
  41. package/dist/ColorField.mjs +158 -0
  42. package/dist/ColorField.module.js +158 -0
  43. package/dist/ColorField.module.js.map +1 -0
  44. package/dist/ColorPicker.main.js +102 -0
  45. package/dist/ColorPicker.main.js.map +1 -0
  46. package/dist/ColorPicker.mjs +91 -0
  47. package/dist/ColorPicker.module.js +91 -0
  48. package/dist/ColorPicker.module.js.map +1 -0
  49. package/dist/ColorSlider.main.js +112 -0
  50. package/dist/ColorSlider.main.js.map +1 -0
  51. package/dist/ColorSlider.mjs +102 -0
  52. package/dist/ColorSlider.module.js +102 -0
  53. package/dist/ColorSlider.module.js.map +1 -0
  54. package/dist/ColorSwatch.main.js +44 -0
  55. package/dist/ColorSwatch.main.js.map +1 -0
  56. package/dist/ColorSwatch.mjs +34 -0
  57. package/dist/ColorSwatch.module.js +34 -0
  58. package/dist/ColorSwatch.module.js.map +1 -0
  59. package/dist/ColorSwatchPicker.main.js +102 -0
  60. package/dist/ColorSwatchPicker.main.js.map +1 -0
  61. package/dist/ColorSwatchPicker.mjs +95 -0
  62. package/dist/ColorSwatchPicker.module.js +95 -0
  63. package/dist/ColorSwatchPicker.module.js.map +1 -0
  64. package/dist/ColorThumb.main.js +67 -0
  65. package/dist/ColorThumb.main.js.map +1 -0
  66. package/dist/ColorThumb.mjs +57 -0
  67. package/dist/ColorThumb.module.js +57 -0
  68. package/dist/ColorThumb.module.js.map +1 -0
  69. package/dist/ColorWheel.main.js +102 -0
  70. package/dist/ColorWheel.main.js.map +1 -0
  71. package/dist/ColorWheel.mjs +90 -0
  72. package/dist/ColorWheel.module.js +90 -0
  73. package/dist/ColorWheel.module.js.map +1 -0
  74. package/dist/ComboBox.main.js +322 -0
  75. package/dist/ComboBox.main.js.map +1 -0
  76. package/dist/ComboBox.mjs +309 -0
  77. package/dist/ComboBox.module.js +309 -0
  78. package/dist/ComboBox.module.js.map +1 -0
  79. package/dist/DateField.main.js +361 -0
  80. package/dist/DateField.main.js.map +1 -0
  81. package/dist/DateField.mjs +345 -0
  82. package/dist/DateField.module.js +345 -0
  83. package/dist/DateField.module.js.map +1 -0
  84. package/dist/DatePicker.main.js +342 -0
  85. package/dist/DatePicker.main.js.map +1 -0
  86. package/dist/DatePicker.mjs +328 -0
  87. package/dist/DatePicker.module.js +328 -0
  88. package/dist/DatePicker.module.js.map +1 -0
  89. package/dist/Dialog.main.js +167 -0
  90. package/dist/Dialog.main.js.map +1 -0
  91. package/dist/Dialog.mjs +155 -0
  92. package/dist/Dialog.module.js +155 -0
  93. package/dist/Dialog.module.js.map +1 -0
  94. package/dist/Disclosure.main.js +171 -0
  95. package/dist/Disclosure.main.js.map +1 -0
  96. package/dist/Disclosure.mjs +157 -0
  97. package/dist/Disclosure.module.js +157 -0
  98. package/dist/Disclosure.module.js.map +1 -0
  99. package/dist/DragAndDrop.main.js +103 -0
  100. package/dist/DragAndDrop.main.js.map +1 -0
  101. package/dist/DragAndDrop.mjs +90 -0
  102. package/dist/DragAndDrop.module.js +90 -0
  103. package/dist/DragAndDrop.module.js.map +1 -0
  104. package/dist/DropZone.main.js +127 -0
  105. package/dist/DropZone.main.js.map +1 -0
  106. package/dist/DropZone.mjs +121 -0
  107. package/dist/DropZone.module.js +121 -0
  108. package/dist/DropZone.module.js.map +1 -0
  109. package/dist/FieldError.main.js +61 -0
  110. package/dist/FieldError.main.js.map +1 -0
  111. package/dist/FieldError.mjs +51 -0
  112. package/dist/FieldError.module.js +51 -0
  113. package/dist/FieldError.module.js.map +1 -0
  114. package/dist/FileTrigger.main.js +60 -0
  115. package/dist/FileTrigger.main.js.map +1 -0
  116. package/dist/FileTrigger.mjs +51 -0
  117. package/dist/FileTrigger.module.js +51 -0
  118. package/dist/FileTrigger.module.js.map +1 -0
  119. package/dist/Form.main.js +49 -0
  120. package/dist/Form.main.js.map +1 -0
  121. package/dist/Form.mjs +39 -0
  122. package/dist/Form.module.js +39 -0
  123. package/dist/Form.module.js.map +1 -0
  124. package/dist/GridList.main.js +589 -0
  125. package/dist/GridList.main.js.map +1 -0
  126. package/dist/GridList.mjs +573 -0
  127. package/dist/GridList.module.js +573 -0
  128. package/dist/GridList.module.js.map +1 -0
  129. package/dist/Group.main.js +72 -0
  130. package/dist/Group.main.js.map +1 -0
  131. package/dist/Group.mjs +62 -0
  132. package/dist/Group.module.js +62 -0
  133. package/dist/Group.module.js.map +1 -0
  134. package/dist/Header.main.js +40 -0
  135. package/dist/Header.main.js.map +1 -0
  136. package/dist/Header.mjs +30 -0
  137. package/dist/Header.module.js +30 -0
  138. package/dist/Header.module.js.map +1 -0
  139. package/dist/Heading.main.js +40 -0
  140. package/dist/Heading.main.js.map +1 -0
  141. package/dist/Heading.mjs +31 -0
  142. package/dist/Heading.module.js +31 -0
  143. package/dist/Heading.module.js.map +1 -0
  144. package/dist/HiddenDateInput.main.js +126 -0
  145. package/dist/HiddenDateInput.main.js.map +1 -0
  146. package/dist/HiddenDateInput.mjs +117 -0
  147. package/dist/HiddenDateInput.module.js +117 -0
  148. package/dist/HiddenDateInput.module.js.map +1 -0
  149. package/dist/Input.main.js +72 -0
  150. package/dist/Input.main.js.map +1 -0
  151. package/dist/Input.mjs +62 -0
  152. package/dist/Input.module.js +62 -0
  153. package/dist/Input.module.js.map +1 -0
  154. package/dist/Keyboard.main.js +38 -0
  155. package/dist/Keyboard.main.js.map +1 -0
  156. package/dist/Keyboard.mjs +28 -0
  157. package/dist/Keyboard.module.js +28 -0
  158. package/dist/Keyboard.module.js.map +1 -0
  159. package/dist/Label.main.js +43 -0
  160. package/dist/Label.main.js.map +1 -0
  161. package/dist/Label.mjs +33 -0
  162. package/dist/Label.module.js +33 -0
  163. package/dist/Label.module.js.map +1 -0
  164. package/dist/Link.main.js +72 -0
  165. package/dist/Link.main.js.map +1 -0
  166. package/dist/Link.mjs +62 -0
  167. package/dist/Link.module.js +62 -0
  168. package/dist/Link.module.js.map +1 -0
  169. package/dist/ListBox.main.js +477 -0
  170. package/dist/ListBox.main.js.map +1 -0
  171. package/dist/ListBox.mjs +463 -0
  172. package/dist/ListBox.module.js +463 -0
  173. package/dist/ListBox.module.js.map +1 -0
  174. package/dist/Menu.main.js +459 -0
  175. package/dist/Menu.main.js.map +1 -0
  176. package/dist/Menu.mjs +443 -0
  177. package/dist/Menu.module.js +443 -0
  178. package/dist/Menu.module.js.map +1 -0
  179. package/dist/Meter.main.js +72 -0
  180. package/dist/Meter.main.js.map +1 -0
  181. package/dist/Meter.mjs +62 -0
  182. package/dist/Meter.module.js +62 -0
  183. package/dist/Meter.module.js.map +1 -0
  184. package/dist/Modal.main.js +191 -0
  185. package/dist/Modal.main.js.map +1 -0
  186. package/dist/Modal.mjs +180 -0
  187. package/dist/Modal.module.js +180 -0
  188. package/dist/Modal.module.js.map +1 -0
  189. package/dist/NumberField.main.js +147 -0
  190. package/dist/NumberField.main.js.map +1 -0
  191. package/dist/NumberField.mjs +136 -0
  192. package/dist/NumberField.module.js +136 -0
  193. package/dist/NumberField.module.js.map +1 -0
  194. package/dist/OverlayArrow.main.js +64 -0
  195. package/dist/OverlayArrow.main.js.map +1 -0
  196. package/dist/OverlayArrow.mjs +54 -0
  197. package/dist/OverlayArrow.module.js +54 -0
  198. package/dist/OverlayArrow.module.js.map +1 -0
  199. package/dist/Popover.main.js +196 -0
  200. package/dist/Popover.main.js.map +1 -0
  201. package/dist/Popover.mjs +186 -0
  202. package/dist/Popover.module.js +186 -0
  203. package/dist/Popover.module.js.map +1 -0
  204. package/dist/ProgressBar.main.js +73 -0
  205. package/dist/ProgressBar.main.js.map +1 -0
  206. package/dist/ProgressBar.mjs +63 -0
  207. package/dist/ProgressBar.module.js +63 -0
  208. package/dist/ProgressBar.module.js.map +1 -0
  209. package/dist/RSPContexts.main.js +37 -0
  210. package/dist/RSPContexts.main.js.map +1 -0
  211. package/dist/RSPContexts.mjs +25 -0
  212. package/dist/RSPContexts.module.js +25 -0
  213. package/dist/RSPContexts.module.js.map +1 -0
  214. package/dist/RadioGroup.main.js +184 -0
  215. package/dist/RadioGroup.main.js.map +1 -0
  216. package/dist/RadioGroup.mjs +171 -0
  217. package/dist/RadioGroup.module.js +171 -0
  218. package/dist/RadioGroup.module.js.map +1 -0
  219. package/dist/SearchField.main.js +140 -0
  220. package/dist/SearchField.main.js.map +1 -0
  221. package/dist/SearchField.mjs +130 -0
  222. package/dist/SearchField.module.js +130 -0
  223. package/dist/SearchField.module.js.map +1 -0
  224. package/dist/Select.main.js +324 -0
  225. package/dist/Select.main.js.map +1 -0
  226. package/dist/Select.mjs +315 -0
  227. package/dist/Select.module.js +315 -0
  228. package/dist/Select.module.js.map +1 -0
  229. package/dist/SelectionIndicator.main.js +45 -0
  230. package/dist/SelectionIndicator.main.js.map +1 -0
  231. package/dist/SelectionIndicator.mjs +35 -0
  232. package/dist/SelectionIndicator.module.js +35 -0
  233. package/dist/SelectionIndicator.module.js.map +1 -0
  234. package/dist/Separator.main.js +71 -0
  235. package/dist/Separator.main.js.map +1 -0
  236. package/dist/Separator.mjs +61 -0
  237. package/dist/Separator.module.js +61 -0
  238. package/dist/Separator.module.js.map +1 -0
  239. package/dist/SharedElementTransition.main.js +140 -0
  240. package/dist/SharedElementTransition.main.js.map +1 -0
  241. package/dist/SharedElementTransition.mjs +130 -0
  242. package/dist/SharedElementTransition.module.js +130 -0
  243. package/dist/SharedElementTransition.module.js.map +1 -0
  244. package/dist/Slider.main.js +220 -0
  245. package/dist/Slider.main.js.map +1 -0
  246. package/dist/Slider.mjs +204 -0
  247. package/dist/Slider.module.js +204 -0
  248. package/dist/Slider.module.js.map +1 -0
  249. package/dist/Switch.main.js +89 -0
  250. package/dist/Switch.main.js.map +1 -0
  251. package/dist/Switch.mjs +79 -0
  252. package/dist/Switch.module.js +79 -0
  253. package/dist/Switch.module.js.map +1 -0
  254. package/dist/Table.main.js +1171 -0
  255. package/dist/Table.main.js.map +1 -0
  256. package/dist/Table.mjs +1154 -0
  257. package/dist/Table.module.js +1154 -0
  258. package/dist/Table.module.js.map +1 -0
  259. package/dist/TableLayout.main.js +38 -0
  260. package/dist/TableLayout.main.js.map +1 -0
  261. package/dist/TableLayout.mjs +33 -0
  262. package/dist/TableLayout.module.js +33 -0
  263. package/dist/TableLayout.module.js.map +1 -0
  264. package/dist/Tabs.main.js +330 -0
  265. package/dist/Tabs.main.js.map +1 -0
  266. package/dist/Tabs.mjs +315 -0
  267. package/dist/Tabs.module.js +315 -0
  268. package/dist/Tabs.module.js.map +1 -0
  269. package/dist/TagGroup.main.js +255 -0
  270. package/dist/TagGroup.main.js.map +1 -0
  271. package/dist/TagGroup.mjs +242 -0
  272. package/dist/TagGroup.module.js +242 -0
  273. package/dist/TagGroup.module.js.map +1 -0
  274. package/dist/Text.main.js +41 -0
  275. package/dist/Text.main.js.map +1 -0
  276. package/dist/Text.mjs +31 -0
  277. package/dist/Text.module.js +31 -0
  278. package/dist/Text.module.js.map +1 -0
  279. package/dist/TextArea.main.js +57 -0
  280. package/dist/TextArea.main.js.map +1 -0
  281. package/dist/TextArea.mjs +47 -0
  282. package/dist/TextArea.module.js +47 -0
  283. package/dist/TextArea.module.js.map +1 -0
  284. package/dist/TextField.main.js +145 -0
  285. package/dist/TextField.main.js.map +1 -0
  286. package/dist/TextField.mjs +135 -0
  287. package/dist/TextField.module.js +135 -0
  288. package/dist/TextField.module.js.map +1 -0
  289. package/dist/Toast.main.js +183 -0
  290. package/dist/Toast.main.js.map +1 -0
  291. package/dist/Toast.mjs +170 -0
  292. package/dist/Toast.module.js +170 -0
  293. package/dist/Toast.module.js.map +1 -0
  294. package/dist/ToggleButton.main.js +96 -0
  295. package/dist/ToggleButton.main.js.map +1 -0
  296. package/dist/ToggleButton.mjs +86 -0
  297. package/dist/ToggleButton.module.js +86 -0
  298. package/dist/ToggleButton.module.js.map +1 -0
  299. package/dist/ToggleButtonGroup.main.js +66 -0
  300. package/dist/ToggleButtonGroup.main.js.map +1 -0
  301. package/dist/ToggleButtonGroup.mjs +55 -0
  302. package/dist/ToggleButtonGroup.module.js +55 -0
  303. package/dist/ToggleButtonGroup.module.js.map +1 -0
  304. package/dist/Toolbar.main.js +55 -0
  305. package/dist/Toolbar.main.js.map +1 -0
  306. package/dist/Toolbar.mjs +45 -0
  307. package/dist/Toolbar.module.js +45 -0
  308. package/dist/Toolbar.module.js.map +1 -0
  309. package/dist/Tooltip.main.js +132 -0
  310. package/dist/Tooltip.main.js.map +1 -0
  311. package/dist/Tooltip.mjs +120 -0
  312. package/dist/Tooltip.module.js +120 -0
  313. package/dist/Tooltip.module.js.map +1 -0
  314. package/dist/Tree.main.js +834 -0
  315. package/dist/Tree.main.js.map +1 -0
  316. package/dist/Tree.mjs +818 -0
  317. package/dist/Tree.module.js +818 -0
  318. package/dist/Tree.module.js.map +1 -0
  319. package/dist/TreeDropTargetDelegate.main.js +216 -0
  320. package/dist/TreeDropTargetDelegate.main.js.map +1 -0
  321. package/dist/TreeDropTargetDelegate.mjs +211 -0
  322. package/dist/TreeDropTargetDelegate.module.js +211 -0
  323. package/dist/TreeDropTargetDelegate.module.js.map +1 -0
  324. package/dist/Virtualizer.main.js +135 -0
  325. package/dist/Virtualizer.main.js.map +1 -0
  326. package/dist/Virtualizer.mjs +126 -0
  327. package/dist/Virtualizer.module.js +126 -0
  328. package/dist/Virtualizer.module.js.map +1 -0
  329. package/dist/ar-AE.main.js +9 -0
  330. package/dist/ar-AE.main.js.map +1 -0
  331. package/dist/ar-AE.mjs +11 -0
  332. package/dist/ar-AE.module.js +11 -0
  333. package/dist/ar-AE.module.js.map +1 -0
  334. package/dist/bg-BG.main.js +9 -0
  335. package/dist/bg-BG.main.js.map +1 -0
  336. package/dist/bg-BG.mjs +11 -0
  337. package/dist/bg-BG.module.js +11 -0
  338. package/dist/bg-BG.module.js.map +1 -0
  339. package/dist/cs-CZ.main.js +9 -0
  340. package/dist/cs-CZ.main.js.map +1 -0
  341. package/dist/cs-CZ.mjs +11 -0
  342. package/dist/cs-CZ.module.js +11 -0
  343. package/dist/cs-CZ.module.js.map +1 -0
  344. package/dist/da-DK.main.js +9 -0
  345. package/dist/da-DK.main.js.map +1 -0
  346. package/dist/da-DK.mjs +11 -0
  347. package/dist/da-DK.module.js +11 -0
  348. package/dist/da-DK.module.js.map +1 -0
  349. package/dist/de-DE.main.js +9 -0
  350. package/dist/de-DE.main.js.map +1 -0
  351. package/dist/de-DE.mjs +11 -0
  352. package/dist/de-DE.module.js +11 -0
  353. package/dist/de-DE.module.js.map +1 -0
  354. package/dist/el-GR.main.js +9 -0
  355. package/dist/el-GR.main.js.map +1 -0
  356. package/dist/el-GR.mjs +11 -0
  357. package/dist/el-GR.module.js +11 -0
  358. package/dist/el-GR.module.js.map +1 -0
  359. package/dist/en-US.main.js +9 -0
  360. package/dist/en-US.main.js.map +1 -0
  361. package/dist/en-US.mjs +11 -0
  362. package/dist/en-US.module.js +11 -0
  363. package/dist/en-US.module.js.map +1 -0
  364. package/dist/es-ES.main.js +9 -0
  365. package/dist/es-ES.main.js.map +1 -0
  366. package/dist/es-ES.mjs +11 -0
  367. package/dist/es-ES.module.js +11 -0
  368. package/dist/es-ES.module.js.map +1 -0
  369. package/dist/et-EE.main.js +9 -0
  370. package/dist/et-EE.main.js.map +1 -0
  371. package/dist/et-EE.mjs +11 -0
  372. package/dist/et-EE.module.js +11 -0
  373. package/dist/et-EE.module.js.map +1 -0
  374. package/dist/fi-FI.main.js +9 -0
  375. package/dist/fi-FI.main.js.map +1 -0
  376. package/dist/fi-FI.mjs +11 -0
  377. package/dist/fi-FI.module.js +11 -0
  378. package/dist/fi-FI.module.js.map +1 -0
  379. package/dist/fr-FR.main.js +9 -0
  380. package/dist/fr-FR.main.js.map +1 -0
  381. package/dist/fr-FR.mjs +11 -0
  382. package/dist/fr-FR.module.js +11 -0
  383. package/dist/fr-FR.module.js.map +1 -0
  384. package/dist/he-IL.main.js +9 -0
  385. package/dist/he-IL.main.js.map +1 -0
  386. package/dist/he-IL.mjs +11 -0
  387. package/dist/he-IL.module.js +11 -0
  388. package/dist/he-IL.module.js.map +1 -0
  389. package/dist/hr-HR.main.js +9 -0
  390. package/dist/hr-HR.main.js.map +1 -0
  391. package/dist/hr-HR.mjs +11 -0
  392. package/dist/hr-HR.module.js +11 -0
  393. package/dist/hr-HR.module.js.map +1 -0
  394. package/dist/hu-HU.main.js +9 -0
  395. package/dist/hu-HU.main.js.map +1 -0
  396. package/dist/hu-HU.mjs +11 -0
  397. package/dist/hu-HU.module.js +11 -0
  398. package/dist/hu-HU.module.js.map +1 -0
  399. package/dist/import.mjs +161 -0
  400. package/dist/intlStrings.main.js +108 -0
  401. package/dist/intlStrings.main.js.map +1 -0
  402. package/dist/intlStrings.mjs +110 -0
  403. package/dist/intlStrings.module.js +110 -0
  404. package/dist/intlStrings.module.js.map +1 -0
  405. package/dist/it-IT.main.js +9 -0
  406. package/dist/it-IT.main.js.map +1 -0
  407. package/dist/it-IT.mjs +11 -0
  408. package/dist/it-IT.module.js +11 -0
  409. package/dist/it-IT.module.js.map +1 -0
  410. package/dist/ja-JP.main.js +9 -0
  411. package/dist/ja-JP.main.js.map +1 -0
  412. package/dist/ja-JP.mjs +11 -0
  413. package/dist/ja-JP.module.js +11 -0
  414. package/dist/ja-JP.module.js.map +1 -0
  415. package/dist/ko-KR.main.js +9 -0
  416. package/dist/ko-KR.main.js.map +1 -0
  417. package/dist/ko-KR.mjs +11 -0
  418. package/dist/ko-KR.module.js +11 -0
  419. package/dist/ko-KR.module.js.map +1 -0
  420. package/dist/lt-LT.main.js +9 -0
  421. package/dist/lt-LT.main.js.map +1 -0
  422. package/dist/lt-LT.mjs +11 -0
  423. package/dist/lt-LT.module.js +11 -0
  424. package/dist/lt-LT.module.js.map +1 -0
  425. package/dist/lv-LV.main.js +9 -0
  426. package/dist/lv-LV.main.js.map +1 -0
  427. package/dist/lv-LV.mjs +11 -0
  428. package/dist/lv-LV.module.js +11 -0
  429. package/dist/lv-LV.module.js.map +1 -0
  430. package/dist/main.js +430 -0
  431. package/dist/main.js.map +1 -0
  432. package/dist/module.js +161 -0
  433. package/dist/module.js.map +1 -0
  434. package/dist/nb-NO.main.js +9 -0
  435. package/dist/nb-NO.main.js.map +1 -0
  436. package/dist/nb-NO.mjs +11 -0
  437. package/dist/nb-NO.module.js +11 -0
  438. package/dist/nb-NO.module.js.map +1 -0
  439. package/dist/nl-NL.main.js +9 -0
  440. package/dist/nl-NL.main.js.map +1 -0
  441. package/dist/nl-NL.mjs +11 -0
  442. package/dist/nl-NL.module.js +11 -0
  443. package/dist/nl-NL.module.js.map +1 -0
  444. package/dist/pl-PL.main.js +9 -0
  445. package/dist/pl-PL.main.js.map +1 -0
  446. package/dist/pl-PL.mjs +11 -0
  447. package/dist/pl-PL.module.js +11 -0
  448. package/dist/pl-PL.module.js.map +1 -0
  449. package/dist/pt-BR.main.js +9 -0
  450. package/dist/pt-BR.main.js.map +1 -0
  451. package/dist/pt-BR.mjs +11 -0
  452. package/dist/pt-BR.module.js +11 -0
  453. package/dist/pt-BR.module.js.map +1 -0
  454. package/dist/pt-PT.main.js +9 -0
  455. package/dist/pt-PT.main.js.map +1 -0
  456. package/dist/pt-PT.mjs +11 -0
  457. package/dist/pt-PT.module.js +11 -0
  458. package/dist/pt-PT.module.js.map +1 -0
  459. package/dist/ro-RO.main.js +9 -0
  460. package/dist/ro-RO.main.js.map +1 -0
  461. package/dist/ro-RO.mjs +11 -0
  462. package/dist/ro-RO.module.js +11 -0
  463. package/dist/ro-RO.module.js.map +1 -0
  464. package/dist/ru-RU.main.js +9 -0
  465. package/dist/ru-RU.main.js.map +1 -0
  466. package/dist/ru-RU.mjs +11 -0
  467. package/dist/ru-RU.module.js +11 -0
  468. package/dist/ru-RU.module.js.map +1 -0
  469. package/dist/sk-SK.main.js +9 -0
  470. package/dist/sk-SK.main.js.map +1 -0
  471. package/dist/sk-SK.mjs +11 -0
  472. package/dist/sk-SK.module.js +11 -0
  473. package/dist/sk-SK.module.js.map +1 -0
  474. package/dist/sl-SI.main.js +9 -0
  475. package/dist/sl-SI.main.js.map +1 -0
  476. package/dist/sl-SI.mjs +11 -0
  477. package/dist/sl-SI.module.js +11 -0
  478. package/dist/sl-SI.module.js.map +1 -0
  479. package/dist/sr-SP.main.js +9 -0
  480. package/dist/sr-SP.main.js.map +1 -0
  481. package/dist/sr-SP.mjs +11 -0
  482. package/dist/sr-SP.module.js +11 -0
  483. package/dist/sr-SP.module.js.map +1 -0
  484. package/dist/sv-SE.main.js +9 -0
  485. package/dist/sv-SE.main.js.map +1 -0
  486. package/dist/sv-SE.mjs +11 -0
  487. package/dist/sv-SE.module.js +11 -0
  488. package/dist/sv-SE.module.js.map +1 -0
  489. package/dist/tr-TR.main.js +9 -0
  490. package/dist/tr-TR.main.js.map +1 -0
  491. package/dist/tr-TR.mjs +11 -0
  492. package/dist/tr-TR.module.js +11 -0
  493. package/dist/tr-TR.module.js.map +1 -0
  494. package/dist/types.d.ts +3764 -0
  495. package/dist/types.d.ts.map +1 -0
  496. package/dist/uk-UA.main.js +9 -0
  497. package/dist/uk-UA.main.js.map +1 -0
  498. package/dist/uk-UA.mjs +11 -0
  499. package/dist/uk-UA.module.js +11 -0
  500. package/dist/uk-UA.module.js.map +1 -0
  501. package/dist/useDragAndDrop.main.js +74 -0
  502. package/dist/useDragAndDrop.main.js.map +1 -0
  503. package/dist/useDragAndDrop.mjs +69 -0
  504. package/dist/useDragAndDrop.module.js +69 -0
  505. package/dist/useDragAndDrop.module.js.map +1 -0
  506. package/dist/utils.main.js +205 -0
  507. package/dist/utils.main.js.map +1 -0
  508. package/dist/utils.mjs +188 -0
  509. package/dist/utils.module.js +188 -0
  510. package/dist/utils.module.js.map +1 -0
  511. package/dist/zh-CN.main.js +9 -0
  512. package/dist/zh-CN.main.js.map +1 -0
  513. package/dist/zh-CN.mjs +11 -0
  514. package/dist/zh-CN.module.js +11 -0
  515. package/dist/zh-CN.module.js.map +1 -0
  516. package/dist/zh-TW.main.js +9 -0
  517. package/dist/zh-TW.main.js.map +1 -0
  518. package/dist/zh-TW.mjs +11 -0
  519. package/dist/zh-TW.module.js +11 -0
  520. package/dist/zh-TW.module.js.map +1 -0
  521. package/i18n/ar-AE.js +1 -0
  522. package/i18n/ar-AE.mjs +1 -0
  523. package/i18n/bg-BG.js +1 -0
  524. package/i18n/bg-BG.mjs +1 -0
  525. package/i18n/cs-CZ.js +1 -0
  526. package/i18n/cs-CZ.mjs +1 -0
  527. package/i18n/da-DK.js +1 -0
  528. package/i18n/da-DK.mjs +1 -0
  529. package/i18n/de-DE.js +1 -0
  530. package/i18n/de-DE.mjs +1 -0
  531. package/i18n/el-GR.js +1 -0
  532. package/i18n/el-GR.mjs +1 -0
  533. package/i18n/en-US.js +1 -0
  534. package/i18n/en-US.mjs +1 -0
  535. package/i18n/es-ES.js +1 -0
  536. package/i18n/es-ES.mjs +1 -0
  537. package/i18n/et-EE.js +1 -0
  538. package/i18n/et-EE.mjs +1 -0
  539. package/i18n/fi-FI.js +1 -0
  540. package/i18n/fi-FI.mjs +1 -0
  541. package/i18n/fr-FR.js +1 -0
  542. package/i18n/fr-FR.mjs +1 -0
  543. package/i18n/he-IL.js +1 -0
  544. package/i18n/he-IL.mjs +1 -0
  545. package/i18n/hr-HR.js +1 -0
  546. package/i18n/hr-HR.mjs +1 -0
  547. package/i18n/hu-HU.js +1 -0
  548. package/i18n/hu-HU.mjs +1 -0
  549. package/i18n/index.d.ts +13 -0
  550. package/i18n/index.js +118 -0
  551. package/i18n/index.mjs +115 -0
  552. package/i18n/it-IT.js +1 -0
  553. package/i18n/it-IT.mjs +1 -0
  554. package/i18n/ja-JP.js +1 -0
  555. package/i18n/ja-JP.mjs +1 -0
  556. package/i18n/ko-KR.js +1 -0
  557. package/i18n/ko-KR.mjs +1 -0
  558. package/i18n/lang.d.ts +7 -0
  559. package/i18n/lt-LT.js +1 -0
  560. package/i18n/lt-LT.mjs +1 -0
  561. package/i18n/lv-LV.js +1 -0
  562. package/i18n/lv-LV.mjs +1 -0
  563. package/i18n/nb-NO.js +1 -0
  564. package/i18n/nb-NO.mjs +1 -0
  565. package/i18n/nl-NL.js +1 -0
  566. package/i18n/nl-NL.mjs +1 -0
  567. package/i18n/pl-PL.js +1 -0
  568. package/i18n/pl-PL.mjs +1 -0
  569. package/i18n/pt-BR.js +1 -0
  570. package/i18n/pt-BR.mjs +1 -0
  571. package/i18n/pt-PT.js +1 -0
  572. package/i18n/pt-PT.mjs +1 -0
  573. package/i18n/ro-RO.js +1 -0
  574. package/i18n/ro-RO.mjs +1 -0
  575. package/i18n/ru-RU.js +1 -0
  576. package/i18n/ru-RU.mjs +1 -0
  577. package/i18n/sk-SK.js +1 -0
  578. package/i18n/sk-SK.mjs +1 -0
  579. package/i18n/sl-SI.js +1 -0
  580. package/i18n/sl-SI.mjs +1 -0
  581. package/i18n/sr-SP.js +1 -0
  582. package/i18n/sr-SP.mjs +1 -0
  583. package/i18n/sv-SE.js +1 -0
  584. package/i18n/sv-SE.mjs +1 -0
  585. package/i18n/tr-TR.js +1 -0
  586. package/i18n/tr-TR.mjs +1 -0
  587. package/i18n/uk-UA.js +1 -0
  588. package/i18n/uk-UA.mjs +1 -0
  589. package/i18n/zh-CN.js +1 -0
  590. package/i18n/zh-CN.mjs +1 -0
  591. package/i18n/zh-TW.js +1 -0
  592. package/i18n/zh-TW.mjs +1 -0
  593. package/package.json +105 -0
  594. package/src/Autocomplete.tsx +64 -0
  595. package/src/Breadcrumbs.tsx +137 -0
  596. package/src/Button.tsx +185 -0
  597. package/src/Calendar.tsx +620 -0
  598. package/src/Checkbox.tsx +282 -0
  599. package/src/Collection.tsx +225 -0
  600. package/src/ColorArea.tsx +89 -0
  601. package/src/ColorField.tsx +243 -0
  602. package/src/ColorPicker.tsx +63 -0
  603. package/src/ColorSlider.tsx +110 -0
  604. package/src/ColorSwatch.tsx +54 -0
  605. package/src/ColorSwatchPicker.tsx +125 -0
  606. package/src/ColorThumb.tsx +108 -0
  607. package/src/ColorWheel.tsx +122 -0
  608. package/src/ComboBox.tsx +325 -0
  609. package/src/DateField.tsx +425 -0
  610. package/src/DatePicker.tsx +334 -0
  611. package/src/Dialog.tsx +159 -0
  612. package/src/Disclosure.tsx +259 -0
  613. package/src/DragAndDrop.tsx +115 -0
  614. package/src/DropZone.tsx +145 -0
  615. package/src/FieldError.tsx +57 -0
  616. package/src/FileTrigger.tsx +79 -0
  617. package/src/Form.tsx +52 -0
  618. package/src/GridList.tsx +678 -0
  619. package/src/Group.tsx +114 -0
  620. package/src/Header.tsx +28 -0
  621. package/src/Heading.tsx +31 -0
  622. package/src/HiddenDateInput.tsx +152 -0
  623. package/src/Input.tsx +113 -0
  624. package/src/Keyboard.tsx +23 -0
  625. package/src/Label.tsx +29 -0
  626. package/src/Link.tsx +115 -0
  627. package/src/ListBox.tsx +577 -0
  628. package/src/Menu.tsx +496 -0
  629. package/src/Meter.tsx +93 -0
  630. package/src/Modal.tsx +262 -0
  631. package/src/NumberField.tsx +152 -0
  632. package/src/OverlayArrow.tsx +91 -0
  633. package/src/Popover.tsx +267 -0
  634. package/src/ProgressBar.tsx +101 -0
  635. package/src/RSPContexts.ts +52 -0
  636. package/src/RadioGroup.tsx +273 -0
  637. package/src/SearchField.tsx +152 -0
  638. package/src/Select.tsx +356 -0
  639. package/src/SelectionIndicator.tsx +46 -0
  640. package/src/Separator.tsx +76 -0
  641. package/src/SharedElementTransition.tsx +186 -0
  642. package/src/Slider.tsx +310 -0
  643. package/src/Switch.tsx +146 -0
  644. package/src/Table.tsx +1597 -0
  645. package/src/TableLayout.ts +28 -0
  646. package/src/Tabs.tsx +495 -0
  647. package/src/TagGroup.tsx +310 -0
  648. package/src/Text.tsx +28 -0
  649. package/src/TextArea.tsx +65 -0
  650. package/src/TextField.tsx +148 -0
  651. package/src/Toast.tsx +248 -0
  652. package/src/ToggleButton.tsx +103 -0
  653. package/src/ToggleButtonGroup.tsx +90 -0
  654. package/src/Toolbar.tsx +69 -0
  655. package/src/Tooltip.tsx +187 -0
  656. package/src/Tree.tsx +1066 -0
  657. package/src/TreeDropTargetDelegate.ts +308 -0
  658. package/src/Virtualizer.tsx +174 -0
  659. package/src/index.ts +160 -0
  660. package/src/useDragAndDrop.tsx +150 -0
  661. package/src/utils.tsx +351 -0
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,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;QAEtF;IADxB,IAAI,sBAAsB,6BAAA,uCAAA,iBAAkB,mBAAmB;IAC/D,IAAI,oBAAoB,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA;IACxB,IAAI,KAAK,CAAA,GAAA,wBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,sBAAqB,sBAAA,gCAAA,UAAW,YAAY,CAAC,UAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,0DAAC;YAAc,QAAQ;;IAEpF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,sBAAA,gCAAA,UAAW,MAAM;QAAE;QAAmB;KAAoB;IAC9D,OAAO,CAAA,6BAAA,uCAAA,iBAAkB,gBAAgB,IAAG,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;QAInJ,qCAA2C;IAH/C,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,CAAA,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA,sBAA2C,CAAA,sBAAA,iCAAA,oBAAA,UAAW,MAAM,cAAjB,wCAAA,kBAAmB,IAAI,MAAK,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;oBACD;oBAAA;gBAAlB,IAAI,cAAc,CAAA,uCAAA,gCAAA,UAAU,UAAU,CAAC,OAAO,CAAC,4BAA7B,oDAAA,8BAA6C,KAAK,cAAlD,iDAAA,sCAAsD;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;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,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, ItemDropTarget, Key} from 'react-aria';\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState, DroppableCollectionState, MultipleSelectionManager} from 'react-stately';\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.main.js.map"}
@@ -0,0 +1,90 @@
1
+ import $f3JOg$react, {createContext as $f3JOg$createContext, forwardRef as $f3JOg$forwardRef, useContext as $f3JOg$useContext, useCallback as $f3JOg$useCallback, useMemo as $f3JOg$useMemo} from "react";
2
+
3
+ /*
4
+ * Copyright 2024 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ const $612b8eb6cb90e02d$export$d188a835a7bc5783 = /*#__PURE__*/ (0, $f3JOg$createContext)({});
15
+ const $612b8eb6cb90e02d$export$f55761759794cf55 = /*#__PURE__*/ (0, $f3JOg$createContext)(null);
16
+ const $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 = /*#__PURE__*/ (0, $f3JOg$forwardRef)(function DropIndicator(props, ref) {
17
+ let { render: render } = (0, $f3JOg$useContext)($612b8eb6cb90e02d$export$f55761759794cf55);
18
+ return /*#__PURE__*/ (0, $f3JOg$react).createElement((0, $f3JOg$react).Fragment, null, render(props, ref));
19
+ });
20
+ function $612b8eb6cb90e02d$export$971707d8a129a1f7(dragAndDropHooks, dropState) {
21
+ var _dragAndDropHooks_isVirtualDragging;
22
+ let renderDropIndicator = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.renderDropIndicator;
23
+ let isVirtualDragging = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks);
24
+ let fn = (0, $f3JOg$useCallback)((target)=>{
25
+ // Only show drop indicators when virtual dragging or this is the current drop target.
26
+ if (isVirtualDragging || (dropState === null || dropState === void 0 ? void 0 : dropState.isDropTarget(target))) return renderDropIndicator ? renderDropIndicator(target) : /*#__PURE__*/ (0, $f3JOg$react).createElement($612b8eb6cb90e02d$export$62ed72bc21f6b8a6, {
27
+ target: target
28
+ });
29
+ // We invalidate whenever the target changes.
30
+ // eslint-disable-next-line react-hooks/exhaustive-deps
31
+ }, [
32
+ dropState === null || dropState === void 0 ? void 0 : dropState.target,
33
+ isVirtualDragging,
34
+ renderDropIndicator
35
+ ]);
36
+ return (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDropIndicator) ? fn : undefined;
37
+ }
38
+ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropHooks, dropState) {
39
+ var _dragAndDropHooks_isVirtualDragging, _dropState_target;
40
+ // Persist the focused key and the drop target key.
41
+ let focusedKey = selectionManager.focusedKey;
42
+ let dropTargetKey = null;
43
+ if ((dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks)) && (dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === 'item') {
44
+ dropTargetKey = dropState.target.key;
45
+ if (dropState.target.dropPosition === 'after') {
46
+ // Normalize to the "before" drop position since we only render those to the DOM.
47
+ let nextKey = dropState.collection.getKeyAfter(dropTargetKey);
48
+ let lastDescendantKey = null;
49
+ if (nextKey != null) {
50
+ var _dropState_collection_getItem;
51
+ var _dropState_collection_getItem_level;
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
+ // Skip over any rows that are descendants of the target ("after" position should be after all children)
54
+ while(nextKey){
55
+ let node = dropState.collection.getItem(nextKey);
56
+ // eslint-disable-next-line max-depth
57
+ if (!node) break;
58
+ // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.
59
+ // eslint-disable-next-line max-depth
60
+ if (node.type !== 'item') {
61
+ nextKey = dropState.collection.getKeyAfter(nextKey);
62
+ continue;
63
+ }
64
+ var _node_level;
65
+ // Stop once we find an item at the same level or higher
66
+ // eslint-disable-next-line max-depth
67
+ if (((_node_level = node.level) !== null && _node_level !== void 0 ? _node_level : 0) <= targetLevel) break;
68
+ lastDescendantKey = nextKey;
69
+ nextKey = dropState.collection.getKeyAfter(nextKey);
70
+ }
71
+ }
72
+ var _ref;
73
+ // If nextKey is null (end of collection), use the last descendant
74
+ dropTargetKey = (_ref = nextKey !== null && nextKey !== void 0 ? nextKey : lastDescendantKey) !== null && _ref !== void 0 ? _ref : dropTargetKey;
75
+ }
76
+ }
77
+ return (0, $f3JOg$useMemo)(()=>{
78
+ return new Set([
79
+ focusedKey,
80
+ dropTargetKey
81
+ ].filter((k)=>k != null));
82
+ }, [
83
+ focusedKey,
84
+ dropTargetKey
85
+ ]);
86
+ }
87
+
88
+
89
+ export {$612b8eb6cb90e02d$export$d188a835a7bc5783 as DragAndDropContext, $612b8eb6cb90e02d$export$f55761759794cf55 as DropIndicatorContext, $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 as DropIndicator, $612b8eb6cb90e02d$export$971707d8a129a1f7 as useRenderDropIndicator, $612b8eb6cb90e02d$export$d1e8e3fbb7461f6 as useDndPersistedKeys};
90
+ //# sourceMappingURL=DragAndDrop.module.js.map
@@ -0,0 +1,90 @@
1
+ import $f3JOg$react, {createContext as $f3JOg$createContext, forwardRef as $f3JOg$forwardRef, useContext as $f3JOg$useContext, useCallback as $f3JOg$useCallback, useMemo as $f3JOg$useMemo} from "react";
2
+
3
+ /*
4
+ * Copyright 2024 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ const $612b8eb6cb90e02d$export$d188a835a7bc5783 = /*#__PURE__*/ (0, $f3JOg$createContext)({});
15
+ const $612b8eb6cb90e02d$export$f55761759794cf55 = /*#__PURE__*/ (0, $f3JOg$createContext)(null);
16
+ const $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 = /*#__PURE__*/ (0, $f3JOg$forwardRef)(function DropIndicator(props, ref) {
17
+ let { render: render } = (0, $f3JOg$useContext)($612b8eb6cb90e02d$export$f55761759794cf55);
18
+ return /*#__PURE__*/ (0, $f3JOg$react).createElement((0, $f3JOg$react).Fragment, null, render(props, ref));
19
+ });
20
+ function $612b8eb6cb90e02d$export$971707d8a129a1f7(dragAndDropHooks, dropState) {
21
+ var _dragAndDropHooks_isVirtualDragging;
22
+ let renderDropIndicator = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.renderDropIndicator;
23
+ let isVirtualDragging = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks);
24
+ let fn = (0, $f3JOg$useCallback)((target)=>{
25
+ // Only show drop indicators when virtual dragging or this is the current drop target.
26
+ if (isVirtualDragging || (dropState === null || dropState === void 0 ? void 0 : dropState.isDropTarget(target))) return renderDropIndicator ? renderDropIndicator(target) : /*#__PURE__*/ (0, $f3JOg$react).createElement($612b8eb6cb90e02d$export$62ed72bc21f6b8a6, {
27
+ target: target
28
+ });
29
+ // We invalidate whenever the target changes.
30
+ // eslint-disable-next-line react-hooks/exhaustive-deps
31
+ }, [
32
+ dropState === null || dropState === void 0 ? void 0 : dropState.target,
33
+ isVirtualDragging,
34
+ renderDropIndicator
35
+ ]);
36
+ return (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDropIndicator) ? fn : undefined;
37
+ }
38
+ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropHooks, dropState) {
39
+ var _dragAndDropHooks_isVirtualDragging, _dropState_target;
40
+ // Persist the focused key and the drop target key.
41
+ let focusedKey = selectionManager.focusedKey;
42
+ let dropTargetKey = null;
43
+ if ((dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks)) && (dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === 'item') {
44
+ dropTargetKey = dropState.target.key;
45
+ if (dropState.target.dropPosition === 'after') {
46
+ // Normalize to the "before" drop position since we only render those to the DOM.
47
+ let nextKey = dropState.collection.getKeyAfter(dropTargetKey);
48
+ let lastDescendantKey = null;
49
+ if (nextKey != null) {
50
+ var _dropState_collection_getItem;
51
+ var _dropState_collection_getItem_level;
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
+ // Skip over any rows that are descendants of the target ("after" position should be after all children)
54
+ while(nextKey){
55
+ let node = dropState.collection.getItem(nextKey);
56
+ // eslint-disable-next-line max-depth
57
+ if (!node) break;
58
+ // Skip over non-item nodes (e.g., loaders) since they can't be drop targets.
59
+ // eslint-disable-next-line max-depth
60
+ if (node.type !== 'item') {
61
+ nextKey = dropState.collection.getKeyAfter(nextKey);
62
+ continue;
63
+ }
64
+ var _node_level;
65
+ // Stop once we find an item at the same level or higher
66
+ // eslint-disable-next-line max-depth
67
+ if (((_node_level = node.level) !== null && _node_level !== void 0 ? _node_level : 0) <= targetLevel) break;
68
+ lastDescendantKey = nextKey;
69
+ nextKey = dropState.collection.getKeyAfter(nextKey);
70
+ }
71
+ }
72
+ var _ref;
73
+ // If nextKey is null (end of collection), use the last descendant
74
+ dropTargetKey = (_ref = nextKey !== null && nextKey !== void 0 ? nextKey : lastDescendantKey) !== null && _ref !== void 0 ? _ref : dropTargetKey;
75
+ }
76
+ }
77
+ return (0, $f3JOg$useMemo)(()=>{
78
+ return new Set([
79
+ focusedKey,
80
+ dropTargetKey
81
+ ].filter((k)=>k != null));
82
+ }, [
83
+ focusedKey,
84
+ dropTargetKey
85
+ ]);
86
+ }
87
+
88
+
89
+ export {$612b8eb6cb90e02d$export$d188a835a7bc5783 as DragAndDropContext, $612b8eb6cb90e02d$export$f55761759794cf55 as DropIndicatorContext, $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 as DropIndicator, $612b8eb6cb90e02d$export$971707d8a129a1f7 as useRenderDropIndicator, $612b8eb6cb90e02d$export$d1e8e3fbb7461f6 as useDndPersistedKeys};
90
+ //# sourceMappingURL=DragAndDrop.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,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;QAEtF;IADxB,IAAI,sBAAsB,6BAAA,uCAAA,iBAAkB,mBAAmB;IAC/D,IAAI,oBAAoB,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA;IACxB,IAAI,KAAK,CAAA,GAAA,kBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,sBAAqB,sBAAA,gCAAA,UAAW,YAAY,CAAC,UAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,gCAAC;YAAc,QAAQ;;IAEpF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,sBAAA,gCAAA,UAAW,MAAM;QAAE;QAAmB;KAAoB;IAC9D,OAAO,CAAA,6BAAA,uCAAA,iBAAkB,gBAAgB,IAAG,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;QAInJ,qCAA2C;IAH/C,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,CAAA,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA,sBAA2C,CAAA,sBAAA,iCAAA,oBAAA,UAAW,MAAM,cAAjB,wCAAA,kBAAmB,IAAI,MAAK,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;oBACD;oBAAA;gBAAlB,IAAI,cAAc,CAAA,uCAAA,gCAAA,UAAU,UAAU,CAAC,OAAO,CAAC,4BAA7B,oDAAA,8BAA6C,KAAK,cAAlD,iDAAA,sCAAsD;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;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, ItemDropTarget, Key} from 'react-aria';\nimport type {ClassNameOrFunction, RenderProps} from './utils';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState, DroppableCollectionState, MultipleSelectionManager} from 'react-stately';\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.module.js.map"}
@@ -0,0 +1,127 @@
1
+ var $c5ccf687772c0422$exports = require("./utils.main.js");
2
+ var $d72d752ea1c67b9a$exports = require("./intlStrings.main.js");
3
+ var $a8a589c28affdc40$exports = require("./Text.main.js");
4
+ var $iiEmS$reactaria = require("react-aria");
5
+ var $iiEmS$reactariautils = require("@react-aria/utils");
6
+ var $iiEmS$react = require("react");
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+
13
+ function $parcel$export(e, n, v, s) {
14
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
+ }
16
+
17
+ $parcel$export(module.exports, "DropZoneContext", () => $80a65baccb138f12$export$14a72053295ff9a6);
18
+ $parcel$export(module.exports, "DropZone", () => $80a65baccb138f12$export$3c6489d84dc98b6);
19
+ /*
20
+ * Copyright 2023 Adobe. All rights reserved.
21
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
22
+ * you may not use this file except in compliance with the License. You may obtain a copy
23
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
24
+ *
25
+ * Unless required by applicable law or agreed to in writing, software distributed under
26
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
27
+ * OF ANY KIND, either express or implied. See the License for the specific language
28
+ * governing permissions and limitations under the License.
29
+ */
30
+
31
+
32
+
33
+
34
+
35
+ const $80a65baccb138f12$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $iiEmS$react.createContext)(null);
36
+ const $80a65baccb138f12$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $iiEmS$react.forwardRef)(function DropZone(props, ref) {
37
+ let { isDisabled: isDisabled = false } = props;
38
+ [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $80a65baccb138f12$export$14a72053295ff9a6);
39
+ let dropzoneRef = (0, $iiEmS$reactariautils.useObjectRef)(ref);
40
+ let buttonRef = (0, $iiEmS$react.useRef)(null);
41
+ let { dropProps: dropProps, dropButtonProps: dropButtonProps, isDropTarget: isDropTarget } = (0, $iiEmS$reactaria.useDrop)({
42
+ ...props,
43
+ ref: buttonRef,
44
+ hasDropButton: true
45
+ });
46
+ let { buttonProps: buttonProps } = (0, $iiEmS$reactaria.useButton)(dropButtonProps || {}, buttonRef);
47
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $iiEmS$reactaria.useHover)(props);
48
+ let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $iiEmS$reactaria.useFocusRing)();
49
+ let stringFormatter = (0, $iiEmS$reactaria.useLocalizedStringFormatter)((0, ($parcel$interopDefault($d72d752ea1c67b9a$exports))), 'react-aria-components');
50
+ let textId = (0, $iiEmS$reactariautils.useSlotId)();
51
+ let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');
52
+ let messageId = props['aria-labelledby'];
53
+ let ariaLabelledby = [
54
+ textId,
55
+ messageId
56
+ ].filter(Boolean).join(' ');
57
+ let labelProps = (0, $iiEmS$reactariautils.useLabels)({
58
+ 'aria-label': ariaLabel,
59
+ 'aria-labelledby': ariaLabelledby
60
+ });
61
+ let { clipboardProps: clipboardProps } = (0, $iiEmS$reactaria.useClipboard)({
62
+ isDisabled: isDisabled,
63
+ onPaste: (items)=>{
64
+ var _props_onDrop;
65
+ return (_props_onDrop = props.onDrop) === null || _props_onDrop === void 0 ? void 0 : _props_onDrop.call(props, {
66
+ type: 'drop',
67
+ items: items,
68
+ x: 0,
69
+ y: 0,
70
+ dropOperation: 'copy'
71
+ });
72
+ }
73
+ });
74
+ let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
75
+ ...props,
76
+ values: {
77
+ isHovered: isHovered,
78
+ isFocused: isFocused,
79
+ isFocusVisible: isFocusVisible,
80
+ isDropTarget: isDropTarget,
81
+ isDisabled: isDisabled
82
+ },
83
+ defaultClassName: 'react-aria-DropZone'
84
+ });
85
+ let DOMProps = (0, $iiEmS$reactariautils.filterDOMProps)(props, {
86
+ global: true
87
+ });
88
+ delete DOMProps.id;
89
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($iiEmS$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
90
+ values: [
91
+ [
92
+ (0, $a8a589c28affdc40$exports.TextContext),
93
+ {
94
+ id: textId,
95
+ slot: 'label'
96
+ }
97
+ ]
98
+ ]
99
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($iiEmS$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
100
+ ...(0, $iiEmS$reactaria.mergeProps)(DOMProps, renderProps, dropProps, hoverProps),
101
+ slot: props.slot || undefined,
102
+ ref: dropzoneRef,
103
+ onClick: (e)=>{
104
+ let target = (0, $iiEmS$reactariautils.getEventTarget)(e);
105
+ while(target && (0, $iiEmS$reactariautils.nodeContains)(dropzoneRef.current, target)){
106
+ if ((0, $iiEmS$reactariautils.isFocusable)(target)) break;
107
+ else if (target === dropzoneRef.current) {
108
+ var _buttonRef_current;
109
+ (_buttonRef_current = buttonRef.current) === null || _buttonRef_current === void 0 ? void 0 : _buttonRef_current.focus();
110
+ break;
111
+ }
112
+ target = target.parentElement;
113
+ }
114
+ },
115
+ "data-hovered": isHovered || undefined,
116
+ "data-focused": isFocused || undefined,
117
+ "data-focus-visible": isFocusVisible || undefined,
118
+ "data-drop-target": isDropTarget || undefined,
119
+ "data-disabled": isDisabled || undefined
120
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($iiEmS$react))).createElement((0, $iiEmS$reactaria.VisuallyHidden), null, /*#__PURE__*/ (0, ($parcel$interopDefault($iiEmS$react))).createElement("button", {
121
+ ...(0, $iiEmS$reactaria.mergeProps)(buttonProps, focusProps, clipboardProps, labelProps),
122
+ ref: buttonRef
123
+ })), renderProps.children));
124
+ });
125
+
126
+
127
+ //# sourceMappingURL=DropZone.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"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","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, mergeProps, useButton, useClipboard, useDrop, useFocusRing, useHover, useLocalizedStringFormatter, VisuallyHidden} from 'react-aria';\nimport {filterDOMProps, getEventTarget, isFocusable, nodeContains, useLabels, useObjectRef, useSlotId} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\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.main.js.map"}
@@ -0,0 +1,121 @@
1
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
2
+ import $dVbUU$intlStringsmodulejs from "./intlStrings.mjs";
3
+ import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
4
+ import {useDrop as $dVbUU$useDrop, useButton as $dVbUU$useButton, useHover as $dVbUU$useHover, useFocusRing as $dVbUU$useFocusRing, useLocalizedStringFormatter as $dVbUU$useLocalizedStringFormatter, useClipboard as $dVbUU$useClipboard, mergeProps as $dVbUU$mergeProps, VisuallyHidden as $dVbUU$VisuallyHidden} from "react-aria";
5
+ import {useObjectRef as $dVbUU$useObjectRef, useSlotId as $dVbUU$useSlotId, useLabels as $dVbUU$useLabels, filterDOMProps as $dVbUU$filterDOMProps, getEventTarget as $dVbUU$getEventTarget, nodeContains as $dVbUU$nodeContains, isFocusable as $dVbUU$isFocusable} from "@react-aria/utils";
6
+ import $dVbUU$react, {createContext as $dVbUU$createContext, forwardRef as $dVbUU$forwardRef, useRef as $dVbUU$useRef} from "react";
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+ /*
13
+ * Copyright 2023 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+
27
+
28
+ const $cb088e721efb9218$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $dVbUU$createContext)(null);
29
+ const $cb088e721efb9218$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $dVbUU$forwardRef)(function DropZone(props, ref) {
30
+ let { isDisabled: isDisabled = false } = props;
31
+ [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $cb088e721efb9218$export$14a72053295ff9a6);
32
+ let dropzoneRef = (0, $dVbUU$useObjectRef)(ref);
33
+ let buttonRef = (0, $dVbUU$useRef)(null);
34
+ let { dropProps: dropProps, dropButtonProps: dropButtonProps, isDropTarget: isDropTarget } = (0, $dVbUU$useDrop)({
35
+ ...props,
36
+ ref: buttonRef,
37
+ hasDropButton: true
38
+ });
39
+ let { buttonProps: buttonProps } = (0, $dVbUU$useButton)(dropButtonProps || {}, buttonRef);
40
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dVbUU$useHover)(props);
41
+ let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $dVbUU$useFocusRing)();
42
+ let stringFormatter = (0, $dVbUU$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dVbUU$intlStringsmodulejs))), 'react-aria-components');
43
+ let textId = (0, $dVbUU$useSlotId)();
44
+ let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');
45
+ let messageId = props['aria-labelledby'];
46
+ let ariaLabelledby = [
47
+ textId,
48
+ messageId
49
+ ].filter(Boolean).join(' ');
50
+ let labelProps = (0, $dVbUU$useLabels)({
51
+ 'aria-label': ariaLabel,
52
+ 'aria-labelledby': ariaLabelledby
53
+ });
54
+ let { clipboardProps: clipboardProps } = (0, $dVbUU$useClipboard)({
55
+ isDisabled: isDisabled,
56
+ onPaste: (items)=>{
57
+ var _props_onDrop;
58
+ return (_props_onDrop = props.onDrop) === null || _props_onDrop === void 0 ? void 0 : _props_onDrop.call(props, {
59
+ type: 'drop',
60
+ items: items,
61
+ x: 0,
62
+ y: 0,
63
+ dropOperation: 'copy'
64
+ });
65
+ }
66
+ });
67
+ let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
68
+ ...props,
69
+ values: {
70
+ isHovered: isHovered,
71
+ isFocused: isFocused,
72
+ isFocusVisible: isFocusVisible,
73
+ isDropTarget: isDropTarget,
74
+ isDisabled: isDisabled
75
+ },
76
+ defaultClassName: 'react-aria-DropZone'
77
+ });
78
+ let DOMProps = (0, $dVbUU$filterDOMProps)(props, {
79
+ global: true
80
+ });
81
+ delete DOMProps.id;
82
+ return /*#__PURE__*/ (0, $dVbUU$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
83
+ values: [
84
+ [
85
+ (0, $514c0188e459b4c0$export$9afb8bc826b033ea),
86
+ {
87
+ id: textId,
88
+ slot: 'label'
89
+ }
90
+ ]
91
+ ]
92
+ }, /*#__PURE__*/ (0, $dVbUU$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
93
+ ...(0, $dVbUU$mergeProps)(DOMProps, renderProps, dropProps, hoverProps),
94
+ slot: props.slot || undefined,
95
+ ref: dropzoneRef,
96
+ onClick: (e)=>{
97
+ let target = (0, $dVbUU$getEventTarget)(e);
98
+ while(target && (0, $dVbUU$nodeContains)(dropzoneRef.current, target)){
99
+ if ((0, $dVbUU$isFocusable)(target)) break;
100
+ else if (target === dropzoneRef.current) {
101
+ var _buttonRef_current;
102
+ (_buttonRef_current = buttonRef.current) === null || _buttonRef_current === void 0 ? void 0 : _buttonRef_current.focus();
103
+ break;
104
+ }
105
+ target = target.parentElement;
106
+ }
107
+ },
108
+ "data-hovered": isHovered || undefined,
109
+ "data-focused": isFocused || undefined,
110
+ "data-focus-visible": isFocusVisible || undefined,
111
+ "data-drop-target": isDropTarget || undefined,
112
+ "data-disabled": isDisabled || undefined
113
+ }, /*#__PURE__*/ (0, $dVbUU$react).createElement((0, $dVbUU$VisuallyHidden), null, /*#__PURE__*/ (0, $dVbUU$react).createElement("button", {
114
+ ...(0, $dVbUU$mergeProps)(buttonProps, focusProps, clipboardProps, labelProps),
115
+ ref: buttonRef
116
+ })), renderProps.children));
117
+ });
118
+
119
+
120
+ export {$cb088e721efb9218$export$14a72053295ff9a6 as DropZoneContext, $cb088e721efb9218$export$3c6489d84dc98b6 as DropZone};
121
+ //# sourceMappingURL=DropZone.module.js.map
@@ -0,0 +1,121 @@
1
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
2
+ import $dVbUU$intlStringsmodulejs from "./intlStrings.module.js";
3
+ import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
4
+ import {useDrop as $dVbUU$useDrop, useButton as $dVbUU$useButton, useHover as $dVbUU$useHover, useFocusRing as $dVbUU$useFocusRing, useLocalizedStringFormatter as $dVbUU$useLocalizedStringFormatter, useClipboard as $dVbUU$useClipboard, mergeProps as $dVbUU$mergeProps, VisuallyHidden as $dVbUU$VisuallyHidden} from "react-aria";
5
+ import {useObjectRef as $dVbUU$useObjectRef, useSlotId as $dVbUU$useSlotId, useLabels as $dVbUU$useLabels, filterDOMProps as $dVbUU$filterDOMProps, getEventTarget as $dVbUU$getEventTarget, nodeContains as $dVbUU$nodeContains, isFocusable as $dVbUU$isFocusable} from "@react-aria/utils";
6
+ import $dVbUU$react, {createContext as $dVbUU$createContext, forwardRef as $dVbUU$forwardRef, useRef as $dVbUU$useRef} from "react";
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+ /*
13
+ * Copyright 2023 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+
27
+
28
+ const $cb088e721efb9218$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $dVbUU$createContext)(null);
29
+ const $cb088e721efb9218$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $dVbUU$forwardRef)(function DropZone(props, ref) {
30
+ let { isDisabled: isDisabled = false } = props;
31
+ [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $cb088e721efb9218$export$14a72053295ff9a6);
32
+ let dropzoneRef = (0, $dVbUU$useObjectRef)(ref);
33
+ let buttonRef = (0, $dVbUU$useRef)(null);
34
+ let { dropProps: dropProps, dropButtonProps: dropButtonProps, isDropTarget: isDropTarget } = (0, $dVbUU$useDrop)({
35
+ ...props,
36
+ ref: buttonRef,
37
+ hasDropButton: true
38
+ });
39
+ let { buttonProps: buttonProps } = (0, $dVbUU$useButton)(dropButtonProps || {}, buttonRef);
40
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dVbUU$useHover)(props);
41
+ let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $dVbUU$useFocusRing)();
42
+ let stringFormatter = (0, $dVbUU$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dVbUU$intlStringsmodulejs))), 'react-aria-components');
43
+ let textId = (0, $dVbUU$useSlotId)();
44
+ let ariaLabel = props['aria-label'] || stringFormatter.format('dropzoneLabel');
45
+ let messageId = props['aria-labelledby'];
46
+ let ariaLabelledby = [
47
+ textId,
48
+ messageId
49
+ ].filter(Boolean).join(' ');
50
+ let labelProps = (0, $dVbUU$useLabels)({
51
+ 'aria-label': ariaLabel,
52
+ 'aria-labelledby': ariaLabelledby
53
+ });
54
+ let { clipboardProps: clipboardProps } = (0, $dVbUU$useClipboard)({
55
+ isDisabled: isDisabled,
56
+ onPaste: (items)=>{
57
+ var _props_onDrop;
58
+ return (_props_onDrop = props.onDrop) === null || _props_onDrop === void 0 ? void 0 : _props_onDrop.call(props, {
59
+ type: 'drop',
60
+ items: items,
61
+ x: 0,
62
+ y: 0,
63
+ dropOperation: 'copy'
64
+ });
65
+ }
66
+ });
67
+ let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
68
+ ...props,
69
+ values: {
70
+ isHovered: isHovered,
71
+ isFocused: isFocused,
72
+ isFocusVisible: isFocusVisible,
73
+ isDropTarget: isDropTarget,
74
+ isDisabled: isDisabled
75
+ },
76
+ defaultClassName: 'react-aria-DropZone'
77
+ });
78
+ let DOMProps = (0, $dVbUU$filterDOMProps)(props, {
79
+ global: true
80
+ });
81
+ delete DOMProps.id;
82
+ return /*#__PURE__*/ (0, $dVbUU$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
83
+ values: [
84
+ [
85
+ (0, $514c0188e459b4c0$export$9afb8bc826b033ea),
86
+ {
87
+ id: textId,
88
+ slot: 'label'
89
+ }
90
+ ]
91
+ ]
92
+ }, /*#__PURE__*/ (0, $dVbUU$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
93
+ ...(0, $dVbUU$mergeProps)(DOMProps, renderProps, dropProps, hoverProps),
94
+ slot: props.slot || undefined,
95
+ ref: dropzoneRef,
96
+ onClick: (e)=>{
97
+ let target = (0, $dVbUU$getEventTarget)(e);
98
+ while(target && (0, $dVbUU$nodeContains)(dropzoneRef.current, target)){
99
+ if ((0, $dVbUU$isFocusable)(target)) break;
100
+ else if (target === dropzoneRef.current) {
101
+ var _buttonRef_current;
102
+ (_buttonRef_current = buttonRef.current) === null || _buttonRef_current === void 0 ? void 0 : _buttonRef_current.focus();
103
+ break;
104
+ }
105
+ target = target.parentElement;
106
+ }
107
+ },
108
+ "data-hovered": isHovered || undefined,
109
+ "data-focused": isFocused || undefined,
110
+ "data-focus-visible": isFocusVisible || undefined,
111
+ "data-drop-target": isDropTarget || undefined,
112
+ "data-disabled": isDisabled || undefined
113
+ }, /*#__PURE__*/ (0, $dVbUU$react).createElement((0, $dVbUU$VisuallyHidden), null, /*#__PURE__*/ (0, $dVbUU$react).createElement("button", {
114
+ ...(0, $dVbUU$mergeProps)(buttonProps, focusProps, clipboardProps, labelProps),
115
+ ref: buttonRef
116
+ })), renderProps.children));
117
+ });
118
+
119
+
120
+ export {$cb088e721efb9218$export$14a72053295ff9a6 as DropZoneContext, $cb088e721efb9218$export$3c6489d84dc98b6 as DropZone};
121
+ //# sourceMappingURL=DropZone.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"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","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, mergeProps, useButton, useClipboard, useDrop, useFocusRing, useHover, useLocalizedStringFormatter, VisuallyHidden} from 'react-aria';\nimport {filterDOMProps, getEventTarget, isFocusable, nodeContains, useLabels, useObjectRef, useSlotId} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\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.module.js.map"}