@depup/react-aria-components 1.19.0-depup.27 → 1.20.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 (257) hide show
  1. package/PreviewTrigger/package.json +5 -0
  2. package/README.md +2 -2
  3. package/TokenField/package.json +5 -0
  4. package/changes.json +1 -1
  5. package/dist/exports/GridList.cjs.map +1 -1
  6. package/dist/exports/GridList.js.map +1 -1
  7. package/dist/exports/GridList.mjs.map +1 -1
  8. package/dist/exports/PreviewTrigger.cjs +26 -0
  9. package/dist/exports/PreviewTrigger.cjs.map +1 -0
  10. package/dist/exports/PreviewTrigger.js +21 -0
  11. package/dist/exports/PreviewTrigger.js.map +1 -0
  12. package/dist/exports/PreviewTrigger.mjs +21 -0
  13. package/dist/exports/PreviewTrigger.mjs.map +1 -0
  14. package/dist/exports/TokenField.cjs +31 -0
  15. package/dist/exports/TokenField.cjs.map +1 -0
  16. package/dist/exports/TokenField.js +21 -0
  17. package/dist/exports/TokenField.js.map +1 -0
  18. package/dist/exports/TokenField.mjs +21 -0
  19. package/dist/exports/TokenField.mjs.map +1 -0
  20. package/dist/exports/Tree.cjs.map +1 -1
  21. package/dist/exports/Tree.js.map +1 -1
  22. package/dist/exports/Tree.mjs.map +1 -1
  23. package/dist/exports/index.cjs +12 -0
  24. package/dist/exports/index.cjs.map +1 -1
  25. package/dist/exports/index.js +7 -1
  26. package/dist/exports/index.js.map +1 -1
  27. package/dist/exports/index.mjs +7 -1
  28. package/dist/exports/index.mjs.map +1 -1
  29. package/dist/private/Checkbox.cjs.map +1 -1
  30. package/dist/private/Checkbox.js.map +1 -1
  31. package/dist/private/Checkbox.mjs.map +1 -1
  32. package/dist/private/ComboBox.cjs +21 -2
  33. package/dist/private/ComboBox.cjs.map +1 -1
  34. package/dist/private/ComboBox.js +21 -2
  35. package/dist/private/ComboBox.js.map +1 -1
  36. package/dist/private/ComboBox.mjs +21 -2
  37. package/dist/private/ComboBox.mjs.map +1 -1
  38. package/dist/private/Dialog.cjs +15 -1
  39. package/dist/private/Dialog.cjs.map +1 -1
  40. package/dist/private/Dialog.js +15 -1
  41. package/dist/private/Dialog.js.map +1 -1
  42. package/dist/private/Dialog.mjs +15 -1
  43. package/dist/private/Dialog.mjs.map +1 -1
  44. package/dist/private/DragAndDrop.cjs +1 -0
  45. package/dist/private/DragAndDrop.cjs.map +1 -1
  46. package/dist/private/DragAndDrop.js +1 -0
  47. package/dist/private/DragAndDrop.js.map +1 -1
  48. package/dist/private/DragAndDrop.mjs +1 -0
  49. package/dist/private/DragAndDrop.mjs.map +1 -1
  50. package/dist/private/DropZone.cjs +5 -2
  51. package/dist/private/DropZone.cjs.map +1 -1
  52. package/dist/private/DropZone.js +5 -3
  53. package/dist/private/DropZone.js.map +1 -1
  54. package/dist/private/DropZone.mjs +5 -2
  55. package/dist/private/DropZone.mjs.map +1 -1
  56. package/dist/private/FileTrigger.cjs +1 -0
  57. package/dist/private/FileTrigger.cjs.map +1 -1
  58. package/dist/private/FileTrigger.js +1 -0
  59. package/dist/private/FileTrigger.js.map +1 -1
  60. package/dist/private/FileTrigger.mjs +1 -0
  61. package/dist/private/FileTrigger.mjs.map +1 -1
  62. package/dist/private/GridLayout.cjs +3 -1
  63. package/dist/private/GridLayout.cjs.map +1 -1
  64. package/dist/private/GridLayout.js +3 -1
  65. package/dist/private/GridLayout.js.map +1 -1
  66. package/dist/private/GridLayout.mjs +3 -1
  67. package/dist/private/GridLayout.mjs.map +1 -1
  68. package/dist/private/GridList.cjs +12 -1
  69. package/dist/private/GridList.cjs.map +1 -1
  70. package/dist/private/GridList.js +12 -1
  71. package/dist/private/GridList.js.map +1 -1
  72. package/dist/private/GridList.mjs +12 -1
  73. package/dist/private/GridList.mjs.map +1 -1
  74. package/dist/private/ListBox.cjs +9 -1
  75. package/dist/private/ListBox.cjs.map +1 -1
  76. package/dist/private/ListBox.js +9 -1
  77. package/dist/private/ListBox.js.map +1 -1
  78. package/dist/private/ListBox.mjs +9 -1
  79. package/dist/private/ListBox.mjs.map +1 -1
  80. package/dist/private/Menu.cjs +4 -2
  81. package/dist/private/Menu.cjs.map +1 -1
  82. package/dist/private/Menu.js +4 -2
  83. package/dist/private/Menu.js.map +1 -1
  84. package/dist/private/Menu.mjs +4 -2
  85. package/dist/private/Menu.mjs.map +1 -1
  86. package/dist/private/Meter.cjs +2 -1
  87. package/dist/private/Meter.cjs.map +1 -1
  88. package/dist/private/Meter.js +2 -1
  89. package/dist/private/Meter.js.map +1 -1
  90. package/dist/private/Meter.mjs +2 -1
  91. package/dist/private/Meter.mjs.map +1 -1
  92. package/dist/private/Modal.cjs +2 -0
  93. package/dist/private/Modal.cjs.map +1 -1
  94. package/dist/private/Modal.js +2 -0
  95. package/dist/private/Modal.js.map +1 -1
  96. package/dist/private/Modal.mjs +2 -0
  97. package/dist/private/Modal.mjs.map +1 -1
  98. package/dist/private/Popover.cjs +34 -9
  99. package/dist/private/Popover.cjs.map +1 -1
  100. package/dist/private/Popover.js +34 -9
  101. package/dist/private/Popover.js.map +1 -1
  102. package/dist/private/Popover.mjs +34 -9
  103. package/dist/private/Popover.mjs.map +1 -1
  104. package/dist/private/PreviewTrigger.cjs +88 -0
  105. package/dist/private/PreviewTrigger.cjs.map +1 -0
  106. package/dist/private/PreviewTrigger.js +80 -0
  107. package/dist/private/PreviewTrigger.js.map +1 -0
  108. package/dist/private/PreviewTrigger.mjs +79 -0
  109. package/dist/private/PreviewTrigger.mjs.map +1 -0
  110. package/dist/private/ProgressBar.cjs +6 -1
  111. package/dist/private/ProgressBar.cjs.map +1 -1
  112. package/dist/private/ProgressBar.js +6 -1
  113. package/dist/private/ProgressBar.js.map +1 -1
  114. package/dist/private/ProgressBar.mjs +6 -1
  115. package/dist/private/ProgressBar.mjs.map +1 -1
  116. package/dist/private/Select.cjs.map +1 -1
  117. package/dist/private/Select.js.map +1 -1
  118. package/dist/private/Select.mjs.map +1 -1
  119. package/dist/private/Table.cjs +26 -14
  120. package/dist/private/Table.cjs.map +1 -1
  121. package/dist/private/Table.js +26 -14
  122. package/dist/private/Table.js.map +1 -1
  123. package/dist/private/Table.mjs +26 -14
  124. package/dist/private/Table.mjs.map +1 -1
  125. package/dist/private/TableLayout.cjs +3 -1
  126. package/dist/private/TableLayout.cjs.map +1 -1
  127. package/dist/private/TableLayout.js +3 -1
  128. package/dist/private/TableLayout.js.map +1 -1
  129. package/dist/private/TableLayout.mjs +3 -1
  130. package/dist/private/TableLayout.mjs.map +1 -1
  131. package/dist/private/TagGroup.cjs +1 -0
  132. package/dist/private/TagGroup.cjs.map +1 -1
  133. package/dist/private/TagGroup.js +1 -0
  134. package/dist/private/TagGroup.js.map +1 -1
  135. package/dist/private/TagGroup.mjs +1 -0
  136. package/dist/private/TagGroup.mjs.map +1 -1
  137. package/dist/private/ToggleButton.cjs.map +1 -1
  138. package/dist/private/ToggleButton.js.map +1 -1
  139. package/dist/private/ToggleButton.mjs.map +1 -1
  140. package/dist/private/TokenField.cjs +207 -0
  141. package/dist/private/TokenField.cjs.map +1 -0
  142. package/dist/private/TokenField.js +197 -0
  143. package/dist/private/TokenField.js.map +1 -0
  144. package/dist/private/TokenField.mjs +195 -0
  145. package/dist/private/TokenField.mjs.map +1 -0
  146. package/dist/private/Tooltip.cjs +10 -2
  147. package/dist/private/Tooltip.cjs.map +1 -1
  148. package/dist/private/Tooltip.js +10 -2
  149. package/dist/private/Tooltip.js.map +1 -1
  150. package/dist/private/Tooltip.mjs +10 -2
  151. package/dist/private/Tooltip.mjs.map +1 -1
  152. package/dist/private/Tree.cjs +11 -1
  153. package/dist/private/Tree.cjs.map +1 -1
  154. package/dist/private/Tree.js +11 -1
  155. package/dist/private/Tree.js.map +1 -1
  156. package/dist/private/Tree.mjs +11 -1
  157. package/dist/private/Tree.mjs.map +1 -1
  158. package/dist/private/Virtualizer.cjs +18 -16
  159. package/dist/private/Virtualizer.cjs.map +1 -1
  160. package/dist/private/Virtualizer.js +18 -16
  161. package/dist/private/Virtualizer.js.map +1 -1
  162. package/dist/private/Virtualizer.mjs +18 -16
  163. package/dist/private/Virtualizer.mjs.map +1 -1
  164. package/dist/private/useDragAndDrop.cjs +7 -0
  165. package/dist/private/useDragAndDrop.cjs.map +1 -1
  166. package/dist/private/useDragAndDrop.js +7 -0
  167. package/dist/private/useDragAndDrop.js.map +1 -1
  168. package/dist/private/useDragAndDrop.mjs +7 -0
  169. package/dist/private/useDragAndDrop.mjs.map +1 -1
  170. package/dist/private/utils.cjs.map +1 -1
  171. package/dist/private/utils.js.map +1 -1
  172. package/dist/private/utils.mjs.map +1 -1
  173. package/dist/types/exports/GridList.d.ts +1 -1
  174. package/dist/types/exports/PreviewTrigger.d.ts +3 -0
  175. package/dist/types/exports/TokenField.d.ts +5 -0
  176. package/dist/types/exports/Tree.d.ts +1 -1
  177. package/dist/types/exports/index.d.ts +7 -2
  178. package/dist/types/src/ComboBox.d.ts +4 -1
  179. package/dist/types/src/GridList.d.ts +12 -1
  180. package/dist/types/src/ListBox.d.ts +1 -1
  181. package/dist/types/src/Popover.d.ts +7 -0
  182. package/dist/types/src/PreviewTrigger.d.ts +23 -0
  183. package/dist/types/src/Select.d.ts +1 -1
  184. package/dist/types/src/Table.d.ts +24 -0
  185. package/dist/types/src/TokenField.d.ts +111 -0
  186. package/dist/types/src/Tree.d.ts +7 -5
  187. package/dist/types/src/Virtualizer.d.ts +4 -0
  188. package/dist/types/src/utils.d.ts +19 -5
  189. package/i18n/ar-AE.js +1 -1
  190. package/i18n/ar-AE.mjs +1 -1
  191. package/i18n/bg-BG.js +1 -1
  192. package/i18n/bg-BG.mjs +1 -1
  193. package/i18n/cs-CZ.js +1 -1
  194. package/i18n/cs-CZ.mjs +1 -1
  195. package/i18n/da-DK.js +1 -1
  196. package/i18n/da-DK.mjs +1 -1
  197. package/i18n/de-DE.js +1 -1
  198. package/i18n/de-DE.mjs +1 -1
  199. package/i18n/el-GR.js +1 -1
  200. package/i18n/el-GR.mjs +1 -1
  201. package/i18n/en-US.js +1 -1
  202. package/i18n/en-US.mjs +1 -1
  203. package/i18n/es-ES.js +1 -1
  204. package/i18n/es-ES.mjs +1 -1
  205. package/i18n/et-EE.js +1 -1
  206. package/i18n/et-EE.mjs +1 -1
  207. package/i18n/fi-FI.js +1 -1
  208. package/i18n/fi-FI.mjs +1 -1
  209. package/i18n/fr-FR.js +1 -1
  210. package/i18n/fr-FR.mjs +1 -1
  211. package/i18n/he-IL.js +1 -1
  212. package/i18n/he-IL.mjs +1 -1
  213. package/i18n/hr-HR.js +1 -1
  214. package/i18n/hr-HR.mjs +1 -1
  215. package/i18n/hu-HU.js +1 -1
  216. package/i18n/hu-HU.mjs +1 -1
  217. package/i18n/it-IT.js +1 -1
  218. package/i18n/it-IT.mjs +1 -1
  219. package/i18n/ja-JP.js +1 -1
  220. package/i18n/ja-JP.mjs +1 -1
  221. package/i18n/ko-KR.js +1 -1
  222. package/i18n/ko-KR.mjs +1 -1
  223. package/i18n/lt-LT.js +1 -1
  224. package/i18n/lt-LT.mjs +1 -1
  225. package/i18n/lv-LV.js +1 -1
  226. package/i18n/lv-LV.mjs +1 -1
  227. package/i18n/nb-NO.js +1 -1
  228. package/i18n/nb-NO.mjs +1 -1
  229. package/i18n/nl-NL.js +1 -1
  230. package/i18n/nl-NL.mjs +1 -1
  231. package/i18n/pl-PL.js +1 -1
  232. package/i18n/pl-PL.mjs +1 -1
  233. package/i18n/pt-BR.js +1 -1
  234. package/i18n/pt-BR.mjs +1 -1
  235. package/i18n/pt-PT.js +1 -1
  236. package/i18n/pt-PT.mjs +1 -1
  237. package/i18n/ro-RO.js +1 -1
  238. package/i18n/ro-RO.mjs +1 -1
  239. package/i18n/ru-RU.js +1 -1
  240. package/i18n/ru-RU.mjs +1 -1
  241. package/i18n/sk-SK.js +1 -1
  242. package/i18n/sk-SK.mjs +1 -1
  243. package/i18n/sl-SI.js +1 -1
  244. package/i18n/sl-SI.mjs +1 -1
  245. package/i18n/sr-SP.js +1 -1
  246. package/i18n/sr-SP.mjs +1 -1
  247. package/i18n/sv-SE.js +1 -1
  248. package/i18n/sv-SE.mjs +1 -1
  249. package/i18n/tr-TR.js +1 -1
  250. package/i18n/tr-TR.mjs +1 -1
  251. package/i18n/uk-UA.js +1 -1
  252. package/i18n/uk-UA.mjs +1 -1
  253. package/i18n/zh-CN.js +1 -1
  254. package/i18n/zh-CN.mjs +1 -1
  255. package/i18n/zh-TW.js +1 -1
  256. package/i18n/zh-TW.mjs +1 -1
  257. package/package.json +32 -31
@@ -1 +1 @@
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
+ {"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,gDAAgD;QAChD,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 // oxlint-disable-next-line react/react-compiler\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"}
@@ -3,6 +3,7 @@ var $5724b511a2687756$exports = require("./intlStrings.cjs");
3
3
  var $cab7d9a238d19c33$exports = require("./Text.cjs");
4
4
  var $2uDYL$reactariauseDrop = require("react-aria/useDrop");
5
5
  var $2uDYL$reactariafilterDOMProps = require("react-aria/filterDOMProps");
6
+ var $2uDYL$reactariaprivateutilsfocusWithoutScrolling = require("react-aria/private/utils/focusWithoutScrolling");
6
7
  var $2uDYL$reactariaprivateutilsshadowdomDOMFunctions = require("react-aria/private/utils/shadowdom/DOMFunctions");
7
8
  var $2uDYL$reactariaprivateutilsisFocusable = require("react-aria/private/utils/isFocusable");
8
9
  var $2uDYL$reactariamergeProps = require("react-aria/mergeProps");
@@ -56,9 +57,11 @@ $parcel$export(module.exports, "DropZone", function () { return $2d794bb643c2812
56
57
 
57
58
 
58
59
 
60
+
59
61
  const $2d794bb643c28122$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $2uDYL$react.createContext)(null);
60
62
  const $2d794bb643c28122$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $2uDYL$react.forwardRef)(function DropZone(props, ref) {
61
63
  let { isDisabled: isDisabled = false } = props;
64
+ // oxlint-disable-next-line react/react-compiler
62
65
  [props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $2d794bb643c28122$export$14a72053295ff9a6);
63
66
  let dropzoneRef = (0, $2uDYL$reactariauseObjectRef.useObjectRef)(ref);
64
67
  let buttonRef = (0, $2uDYL$react.useRef)(null);
@@ -125,8 +128,8 @@ const $2d794bb643c28122$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $2uDYL$react.
125
128
  let target = (0, $2uDYL$reactariaprivateutilsshadowdomDOMFunctions.getEventTarget)(e);
126
129
  while(target && (0, $2uDYL$reactariaprivateutilsshadowdomDOMFunctions.nodeContains)(dropzoneRef.current, target)){
127
130
  if ((0, $2uDYL$reactariaprivateutilsisFocusable.isFocusable)(target)) break;
128
- else if (target === dropzoneRef.current) {
129
- buttonRef.current?.focus();
131
+ else if (target === dropzoneRef.current && buttonRef.current) {
132
+ (0, $2uDYL$reactariaprivateutilsfocusWithoutScrolling.focusWithoutScrolling)(buttonRef.current);
130
133
  break;
131
134
  }
132
135
  target = target.parentElement;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAiFM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAC1C,KAAoB,EACpB,GAAiC;IAEjC,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;QACvD,GAAG,KAAK;QACR,KAAK;QACL,eAAe;IACjB;IACA,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;IAEhE,IAAI,SAAS,CAAA,GAAA,2CAAQ;IACrB,IAAI,YAAY,KAAK,CAAC,aAAa,IAAI,gBAAgB,MAAM,CAAC;IAC9D,IAAI,YAAY,KAAK,CAAC,kBAAkB;IACxC,IAAI,iBAAiB;QAAC;QAAQ;KAAU,CAA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ACZ,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';\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
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;AAkFM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAC1C,KAAoB,EACpB,GAAiC;IAEjC,IAAI,cAAC,aAAa,OAAM,GAAG;IAC3B,gDAAgD;IAChD,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAc,CAA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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,IAAI,UAAU,OAAO,EAAE;oBAC9D,CAAA,GAAA,uEAAoB,EAAE,UAAU,OAAO;oBACvC;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 {focusWithoutScrolling} from 'react-aria/private/utils/focusWithoutScrolling';\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';\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 // oxlint-disable-next-line react/react-compiler\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 && buttonRef.current) {\n focusWithoutScrolling(buttonRef.current);\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"}
@@ -3,6 +3,7 @@ import $jX5VW$intlStringsjs from "./intlStrings.js";
3
3
  import {TextContext as $20d769b1e2b13352$export$9afb8bc826b033ea} from "./Text.js";
4
4
  import {useDrop as $jX5VW$useDrop} from "react-aria/useDrop";
5
5
  import {filterDOMProps as $jX5VW$filterDOMProps} from "react-aria/filterDOMProps";
6
+ import {focusWithoutScrolling as $jX5VW$focusWithoutScrolling} from "react-aria/private/utils/focusWithoutScrolling";
6
7
  import {getEventTarget as $jX5VW$getEventTarget, nodeContains as $jX5VW$nodeContains} from "react-aria/private/utils/shadowdom/DOMFunctions";
7
8
  import {isFocusable as $jX5VW$isFocusable} from "react-aria/private/utils/isFocusable";
8
9
  import {mergeProps as $jX5VW$mergeProps} from "react-aria/mergeProps";
@@ -49,9 +50,11 @@ function $parcel$interopDefault(a) {
49
50
 
50
51
 
51
52
 
53
+
52
54
  const $ceb97195dd95fbc4$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $jX5VW$createContext)(null);
53
55
  const $ceb97195dd95fbc4$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $jX5VW$forwardRef)(function DropZone(props, ref) {
54
56
  let { isDisabled: isDisabled = false } = props;
57
+ // oxlint-disable-next-line react/react-compiler
55
58
  [props, ref] = (0, $b7b7a92703138c9b$export$29f1550f4b0d4415)(props, ref, $ceb97195dd95fbc4$export$14a72053295ff9a6);
56
59
  let dropzoneRef = (0, $jX5VW$useObjectRef)(ref);
57
60
  let buttonRef = (0, $jX5VW$useRef)(null);
@@ -121,9 +124,8 @@ const $ceb97195dd95fbc4$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $jX5VW$forwar
121
124
  let target = (0, $jX5VW$getEventTarget)(e);
122
125
  while(target && (0, $jX5VW$nodeContains)(dropzoneRef.current, target)){
123
126
  if ((0, $jX5VW$isFocusable)(target)) break;
124
- else if (target === dropzoneRef.current) {
125
- var _buttonRef_current;
126
- (_buttonRef_current = buttonRef.current) === null || _buttonRef_current === void 0 ? void 0 : _buttonRef_current.focus();
127
+ else if (target === dropzoneRef.current && buttonRef.current) {
128
+ (0, $jX5VW$focusWithoutScrolling)(buttonRef.current);
127
129
  break;
128
130
  }
129
131
  target = target.parentElement;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAiFM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAC1C,KAAoB,EACpB,GAAiC;IAEjC,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;QACvD,GAAG,KAAK;QACR,KAAK;QACL,eAAe;IACjB;IACA,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,mBAAmB,CAAC,GAAG;IACrD,IA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I;QACpB,KAAK;QACL,SAAS,CAAA;YACP,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;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;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';\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,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a,uBACZ,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,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 {focusWithoutScrolling} from 'react-aria/private/utils/focusWithoutScrolling';\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';\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 // oxlint-disable-next-line react/react-compiler\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 && buttonRef.current) {\n focusWithoutScrolling(buttonRef.current);\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"}
@@ -3,6 +3,7 @@ import $7DqZ6$intlStringsmjs from "./intlStrings.mjs";
3
3
  import {TextContext as $efe09c6d1c304b50$export$9afb8bc826b033ea} from "./Text.mjs";
4
4
  import {useDrop as $7DqZ6$useDrop} from "react-aria/useDrop";
5
5
  import {filterDOMProps as $7DqZ6$filterDOMProps} from "react-aria/filterDOMProps";
6
+ import {focusWithoutScrolling as $7DqZ6$focusWithoutScrolling} from "react-aria/private/utils/focusWithoutScrolling";
6
7
  import {getEventTarget as $7DqZ6$getEventTarget, nodeContains as $7DqZ6$nodeContains} from "react-aria/private/utils/shadowdom/DOMFunctions";
7
8
  import {isFocusable as $7DqZ6$isFocusable} from "react-aria/private/utils/isFocusable";
8
9
  import {mergeProps as $7DqZ6$mergeProps} from "react-aria/mergeProps";
@@ -49,9 +50,11 @@ function $parcel$interopDefault(a) {
49
50
 
50
51
 
51
52
 
53
+
52
54
  const $070c0dd15dc89b58$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $7DqZ6$createContext)(null);
53
55
  const $070c0dd15dc89b58$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $7DqZ6$forwardRef)(function DropZone(props, ref) {
54
56
  let { isDisabled: isDisabled = false } = props;
57
+ // oxlint-disable-next-line react/react-compiler
55
58
  [props, ref] = (0, $7230ffa83bc0c2cf$export$29f1550f4b0d4415)(props, ref, $070c0dd15dc89b58$export$14a72053295ff9a6);
56
59
  let dropzoneRef = (0, $7DqZ6$useObjectRef)(ref);
57
60
  let buttonRef = (0, $7DqZ6$useRef)(null);
@@ -118,8 +121,8 @@ const $070c0dd15dc89b58$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $7DqZ6$forwar
118
121
  let target = (0, $7DqZ6$getEventTarget)(e);
119
122
  while(target && (0, $7DqZ6$nodeContains)(dropzoneRef.current, target)){
120
123
  if ((0, $7DqZ6$isFocusable)(target)) break;
121
- else if (target === dropzoneRef.current) {
122
- buttonRef.current?.focus();
124
+ else if (target === dropzoneRef.current && buttonRef.current) {
125
+ (0, $7DqZ6$focusWithoutScrolling)(buttonRef.current);
123
126
  break;
124
127
  }
125
128
  target = target.parentElement;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAiFM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,iBAAS,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AAW;4BAAW;0BAAgB;wBAAc;QAAU;QACvE,kBAAkB;IACpB;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC,CAAA,GAAA,yCAAO;QAAE,QAAQ;YAAC;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBAAC,IAAI;oBAAQ,MAAM;gBAAO;aAAE;SAAC;qBAC5D,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,WAAW,WAAW;QAC5D,MAAM,MAAM,IAAI,IAAI;QACpB,KAAK;QACL,SAAS,CAAA;YACP,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;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';\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
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;AAkFM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AAKnF,MAAM,yDAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAC1C,KAAoB,EACpB,GAAiC;IAEjC,IAAI,cAAC,aAAa,OAAM,GAAG;IAC3B,gDAAgD;IAChD,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;QACvD,GAAG,KAAK;QACR,KAAK;QACL,eAAe;IACjB;IACA,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,aA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,EAAE,QAAS;gBAC1D,IAAI,CAAA,GAAA,kBAAU,EAAE,SACd;qBACK,IAAI,WAAW,YAAY,OAAO,IAAI,UAAU,OAAO,EAAE;oBAC9D,CAAA,GAAA,4BAAoB,EAAE,UAAU,OAAO;oBACvC;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;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 {focusWithoutScrolling} from 'react-aria/private/utils/focusWithoutScrolling';\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';\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 // oxlint-disable-next-line react/react-compiler\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 && buttonRef.current) {\n focusWithoutScrolling(buttonRef.current);\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"}
@@ -47,6 +47,7 @@ const $40f6f61555adb35f$export$6fb4a10d2c950550 = /*#__PURE__*/ (0, $N0sZu$react
47
47
  className: "",
48
48
  type: "file",
49
49
  ref: inputRef,
50
+ onClick: (e)=>e.stopPropagation(),
50
51
  style: {
51
52
  display: 'none'
52
53
  },
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAmC;IAEnC,IAAI,YACF,QAAQ,qBACR,iBAAiB,kBACjB,cAAc,iBACd,aAAa,YACb,QAAQ,mBACR,eAAe,EACf,GAAG,MACJ,GAAG;IACJ,IAAI,WAAW,CAAA,GAAA,yCAAW,EAAE;IAC5B,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,MAAM;QAAC,QAAQ;IAAI;IAEjD,qBACE,oIACE,0DAAC,CAAA,GAAA,gEAAa;QACZ,SAAS;YACP,IAAI,SAAS,OAAO,EAAE,OACpB,SAAS,OAAO,CAAC,KAAK,GAAG;YAE3B,SAAS,OAAO,EAAE;QACpB;OACC,yBAEH,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,QAAQ;QACZ,WAAU;QACV,MAAK;QACL,KAAK;QACL,OAAO;YAAC,SAAS;QAAM;QACvB,QAAQ,mBAAmB;QAC3B,UAAU,CAAA,IAAK,WAAW,CAAA,GAAA,gEAAa,EAAE,GAAG,KAAK;QACjD,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,iBAAiB,kBAAkB,KAAK;;AAIhD","sources":["packages/react-aria-components/src/FileTrigger.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 {filterDOMProps} from 'react-aria/filterDOMProps';\n\nimport {getEventTarget} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {Input} from './Input';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface FileTriggerProps extends GlobalDOMAttributes<HTMLInputElement> {\n /**\n * Specifies what mime type of files are allowed.\n */\n acceptedFileTypes?: ReadonlyArray<string>;\n /**\n * Whether multiple files can be selected.\n */\n allowsMultiple?: boolean;\n /**\n * Specifies the use of a media capture mechanism to capture the media on the spot.\n */\n defaultCamera?: 'user' | 'environment';\n /**\n * Handler when a user selects a file.\n */\n onSelect?: (files: FileList | null) => void;\n /**\n * The children of the component.\n */\n children?: ReactNode;\n /**\n * Enables the selection of directories instead of individual files.\n */\n acceptDirectory?: boolean;\n}\n\n/**\n * A FileTrigger allows a user to access the file system with any pressable React Aria or React\n * Spectrum component, or custom components built with usePress.\n */\nexport const FileTrigger = forwardRef(function FileTrigger(\n props: FileTriggerProps,\n ref: ForwardedRef<HTMLInputElement>\n) {\n let {\n onSelect,\n acceptedFileTypes,\n allowsMultiple,\n defaultCamera,\n children,\n acceptDirectory,\n ...rest\n } = props;\n let inputRef = useObjectRef(ref);\n let domProps = filterDOMProps(rest, {global: true});\n\n return (\n <>\n <PressResponder\n onPress={() => {\n if (inputRef.current?.value) {\n inputRef.current.value = '';\n }\n inputRef.current?.click();\n }}>\n {children}\n </PressResponder>\n <Input\n {...domProps}\n className=\"\"\n type=\"file\"\n ref={inputRef}\n style={{display: 'none'}}\n accept={acceptedFileTypes?.toString()}\n onChange={e => onSelect?.(getEventTarget(e).files)}\n capture={defaultCamera}\n multiple={allowsMultiple}\n // @ts-expect-error\n webkitdirectory={acceptDirectory ? '' : undefined}\n />\n </>\n );\n});\n"],"names":[],"version":3,"file":"FileTrigger.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAmC;IAEnC,IAAI,YACF,QAAQ,qBACR,iBAAiB,kBACjB,cAAc,iBACd,aAAa,YACb,QAAQ,mBACR,eAAe,EACf,GAAG,MACJ,GAAG;IACJ,IAAI,WAAW,CAAA,GAAA,yCAAW,EAAE;IAC5B,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,MAAM;QAAC,QAAQ;IAAI;IAEjD,qBACE,oIACE,0DAAC,CAAA,GAAA,gEAAa;QACZ,SAAS;YACP,IAAI,SAAS,OAAO,EAAE,OACpB,SAAS,OAAO,CAAC,KAAK,GAAG;YAE3B,SAAS,OAAO,EAAE;QACpB;OACC,yBAEH,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,QAAQ;QACZ,WAAU;QACV,MAAK;QACL,KAAK;QACL,SAAS,CAAA,IAAK,EAAE,eAAe;QAC/B,OAAO;YAAC,SAAS;QAAM;QACvB,QAAQ,mBAAmB;QAC3B,UAAU,CAAA,IAAK,WAAW,CAAA,GAAA,gEAAa,EAAE,GAAG,KAAK;QACjD,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,iBAAiB,kBAAkB,KAAK;;AAIhD","sources":["packages/react-aria-components/src/FileTrigger.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 {filterDOMProps} from 'react-aria/filterDOMProps';\n\nimport {getEventTarget} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {Input} from './Input';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface FileTriggerProps extends GlobalDOMAttributes<HTMLInputElement> {\n /**\n * Specifies what mime type of files are allowed.\n */\n acceptedFileTypes?: ReadonlyArray<string>;\n /**\n * Whether multiple files can be selected.\n */\n allowsMultiple?: boolean;\n /**\n * Specifies the use of a media capture mechanism to capture the media on the spot.\n */\n defaultCamera?: 'user' | 'environment';\n /**\n * Handler when a user selects a file.\n */\n onSelect?: (files: FileList | null) => void;\n /**\n * The children of the component.\n */\n children?: ReactNode;\n /**\n * Enables the selection of directories instead of individual files.\n */\n acceptDirectory?: boolean;\n}\n\n/**\n * A FileTrigger allows a user to access the file system with any pressable React Aria or React\n * Spectrum component, or custom components built with usePress.\n */\nexport const FileTrigger = forwardRef(function FileTrigger(\n props: FileTriggerProps,\n ref: ForwardedRef<HTMLInputElement>\n) {\n let {\n onSelect,\n acceptedFileTypes,\n allowsMultiple,\n defaultCamera,\n children,\n acceptDirectory,\n ...rest\n } = props;\n let inputRef = useObjectRef(ref);\n let domProps = filterDOMProps(rest, {global: true});\n\n return (\n <>\n <PressResponder\n onPress={() => {\n if (inputRef.current?.value) {\n inputRef.current.value = '';\n }\n inputRef.current?.click();\n }}>\n {children}\n </PressResponder>\n <Input\n {...domProps}\n className=\"\"\n type=\"file\"\n ref={inputRef}\n onClick={e => e.stopPropagation()}\n style={{display: 'none'}}\n accept={acceptedFileTypes?.toString()}\n onChange={e => onSelect?.(getEventTarget(e).files)}\n capture={defaultCamera}\n multiple={allowsMultiple}\n // @ts-expect-error\n webkitdirectory={acceptDirectory ? '' : undefined}\n />\n </>\n );\n});\n"],"names":[],"version":3,"file":"FileTrigger.cjs.map"}
@@ -38,6 +38,7 @@ const $bc459eb335d0c829$export$6fb4a10d2c950550 = /*#__PURE__*/ (0, $8VH1F$forwa
38
38
  className: "",
39
39
  type: "file",
40
40
  ref: inputRef,
41
+ onClick: (e)=>e.stopPropagation(),
41
42
  style: {
42
43
  display: 'none'
43
44
  },
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAmC;IAEnC,IAAI,YACF,QAAQ,qBACR,iBAAiB,kBACjB,cAAc,iBACd,aAAa,YACb,QAAQ,mBACR,eAAe,EACf,GAAG,MACJ,GAAG;IACJ,IAAI,WAAW,CAAA,GAAA,mBAAW,EAAE;IAC5B,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,MAAM;QAAC,QAAQ;IAAI;IAEjD,qBACE,gFACE,gCAAC,CAAA,GAAA,qBAAa;QACZ,SAAS;gBACH,mBAGJ;YAHA,KAAI,oBAAA,SAAS,OAAO,cAAhB,wCAAA,kBAAkB,KAAK,EACzB,SAAS,OAAO,CAAC,KAAK,GAAG;aAE3B,qBAAA,SAAS,OAAO,cAAhB,yCAAA,mBAAkB,KAAK;QACzB;OACC,yBAEH,gCAAC,CAAA,GAAA,yCAAI;QACF,GAAG,QAAQ;QACZ,WAAU;QACV,MAAK;QACL,KAAK;QACL,OAAO;YAAC,SAAS;QAAM;QACvB,MAAM,EAAE,8BAAA,wCAAA,kBAAmB,QAAQ;QACnC,UAAU,CAAA,IAAK,qBAAA,+BAAA,SAAW,CAAA,GAAA,qBAAa,EAAE,GAAG,KAAK;QACjD,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,iBAAiB,kBAAkB,KAAK;;AAIhD","sources":["packages/react-aria-components/src/FileTrigger.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 {filterDOMProps} from 'react-aria/filterDOMProps';\n\nimport {getEventTarget} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {Input} from './Input';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface FileTriggerProps extends GlobalDOMAttributes<HTMLInputElement> {\n /**\n * Specifies what mime type of files are allowed.\n */\n acceptedFileTypes?: ReadonlyArray<string>;\n /**\n * Whether multiple files can be selected.\n */\n allowsMultiple?: boolean;\n /**\n * Specifies the use of a media capture mechanism to capture the media on the spot.\n */\n defaultCamera?: 'user' | 'environment';\n /**\n * Handler when a user selects a file.\n */\n onSelect?: (files: FileList | null) => void;\n /**\n * The children of the component.\n */\n children?: ReactNode;\n /**\n * Enables the selection of directories instead of individual files.\n */\n acceptDirectory?: boolean;\n}\n\n/**\n * A FileTrigger allows a user to access the file system with any pressable React Aria or React\n * Spectrum component, or custom components built with usePress.\n */\nexport const FileTrigger = forwardRef(function FileTrigger(\n props: FileTriggerProps,\n ref: ForwardedRef<HTMLInputElement>\n) {\n let {\n onSelect,\n acceptedFileTypes,\n allowsMultiple,\n defaultCamera,\n children,\n acceptDirectory,\n ...rest\n } = props;\n let inputRef = useObjectRef(ref);\n let domProps = filterDOMProps(rest, {global: true});\n\n return (\n <>\n <PressResponder\n onPress={() => {\n if (inputRef.current?.value) {\n inputRef.current.value = '';\n }\n inputRef.current?.click();\n }}>\n {children}\n </PressResponder>\n <Input\n {...domProps}\n className=\"\"\n type=\"file\"\n ref={inputRef}\n style={{display: 'none'}}\n accept={acceptedFileTypes?.toString()}\n onChange={e => onSelect?.(getEventTarget(e).files)}\n capture={defaultCamera}\n multiple={allowsMultiple}\n // @ts-expect-error\n webkitdirectory={acceptDirectory ? '' : undefined}\n />\n </>\n );\n});\n"],"names":[],"version":3,"file":"FileTrigger.js.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAmC;IAEnC,IAAI,YACF,QAAQ,qBACR,iBAAiB,kBACjB,cAAc,iBACd,aAAa,YACb,QAAQ,mBACR,eAAe,EACf,GAAG,MACJ,GAAG;IACJ,IAAI,WAAW,CAAA,GAAA,mBAAW,EAAE;IAC5B,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,MAAM;QAAC,QAAQ;IAAI;IAEjD,qBACE,gFACE,gCAAC,CAAA,GAAA,qBAAa;QACZ,SAAS;gBACH,mBAGJ;YAHA,KAAI,oBAAA,SAAS,OAAO,cAAhB,wCAAA,kBAAkB,KAAK,EACzB,SAAS,OAAO,CAAC,KAAK,GAAG;aAE3B,qBAAA,SAAS,OAAO,cAAhB,yCAAA,mBAAkB,KAAK;QACzB;OACC,yBAEH,gCAAC,CAAA,GAAA,yCAAI;QACF,GAAG,QAAQ;QACZ,WAAU;QACV,MAAK;QACL,KAAK;QACL,SAAS,CAAA,IAAK,EAAE,eAAe;QAC/B,OAAO;YAAC,SAAS;QAAM;QACvB,MAAM,EAAE,8BAAA,wCAAA,kBAAmB,QAAQ;QACnC,UAAU,CAAA,IAAK,qBAAA,+BAAA,SAAW,CAAA,GAAA,qBAAa,EAAE,GAAG,KAAK;QACjD,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,iBAAiB,kBAAkB,KAAK;;AAIhD","sources":["packages/react-aria-components/src/FileTrigger.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 {filterDOMProps} from 'react-aria/filterDOMProps';\n\nimport {getEventTarget} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {Input} from './Input';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface FileTriggerProps extends GlobalDOMAttributes<HTMLInputElement> {\n /**\n * Specifies what mime type of files are allowed.\n */\n acceptedFileTypes?: ReadonlyArray<string>;\n /**\n * Whether multiple files can be selected.\n */\n allowsMultiple?: boolean;\n /**\n * Specifies the use of a media capture mechanism to capture the media on the spot.\n */\n defaultCamera?: 'user' | 'environment';\n /**\n * Handler when a user selects a file.\n */\n onSelect?: (files: FileList | null) => void;\n /**\n * The children of the component.\n */\n children?: ReactNode;\n /**\n * Enables the selection of directories instead of individual files.\n */\n acceptDirectory?: boolean;\n}\n\n/**\n * A FileTrigger allows a user to access the file system with any pressable React Aria or React\n * Spectrum component, or custom components built with usePress.\n */\nexport const FileTrigger = forwardRef(function FileTrigger(\n props: FileTriggerProps,\n ref: ForwardedRef<HTMLInputElement>\n) {\n let {\n onSelect,\n acceptedFileTypes,\n allowsMultiple,\n defaultCamera,\n children,\n acceptDirectory,\n ...rest\n } = props;\n let inputRef = useObjectRef(ref);\n let domProps = filterDOMProps(rest, {global: true});\n\n return (\n <>\n <PressResponder\n onPress={() => {\n if (inputRef.current?.value) {\n inputRef.current.value = '';\n }\n inputRef.current?.click();\n }}>\n {children}\n </PressResponder>\n <Input\n {...domProps}\n className=\"\"\n type=\"file\"\n ref={inputRef}\n onClick={e => e.stopPropagation()}\n style={{display: 'none'}}\n accept={acceptedFileTypes?.toString()}\n onChange={e => onSelect?.(getEventTarget(e).files)}\n capture={defaultCamera}\n multiple={allowsMultiple}\n // @ts-expect-error\n webkitdirectory={acceptDirectory ? '' : undefined}\n />\n </>\n );\n});\n"],"names":[],"version":3,"file":"FileTrigger.js.map"}
@@ -37,6 +37,7 @@ const $b325d7bd7e74496a$export$6fb4a10d2c950550 = /*#__PURE__*/ (0, $6JSwL$forwa
37
37
  className: "",
38
38
  type: "file",
39
39
  ref: inputRef,
40
+ onClick: (e)=>e.stopPropagation(),
40
41
  style: {
41
42
  display: 'none'
42
43
  },
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAmC;IAEnC,IAAI,YACF,QAAQ,qBACR,iBAAiB,kBACjB,cAAc,iBACd,aAAa,YACb,QAAQ,mBACR,eAAe,EACf,GAAG,MACJ,GAAG;IACJ,IAAI,WAAW,CAAA,GAAA,mBAAW,EAAE;IAC5B,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,MAAM;QAAC,QAAQ;IAAI;IAEjD,qBACE,gFACE,gCAAC,CAAA,GAAA,qBAAa;QACZ,SAAS;YACP,IAAI,SAAS,OAAO,EAAE,OACpB,SAAS,OAAO,CAAC,KAAK,GAAG;YAE3B,SAAS,OAAO,EAAE;QACpB;OACC,yBAEH,gCAAC,CAAA,GAAA,yCAAI;QACF,GAAG,QAAQ;QACZ,WAAU;QACV,MAAK;QACL,KAAK;QACL,OAAO;YAAC,SAAS;QAAM;QACvB,QAAQ,mBAAmB;QAC3B,UAAU,CAAA,IAAK,WAAW,CAAA,GAAA,qBAAa,EAAE,GAAG,KAAK;QACjD,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,iBAAiB,kBAAkB,KAAK;;AAIhD","sources":["packages/react-aria-components/src/FileTrigger.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 {filterDOMProps} from 'react-aria/filterDOMProps';\n\nimport {getEventTarget} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {Input} from './Input';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface FileTriggerProps extends GlobalDOMAttributes<HTMLInputElement> {\n /**\n * Specifies what mime type of files are allowed.\n */\n acceptedFileTypes?: ReadonlyArray<string>;\n /**\n * Whether multiple files can be selected.\n */\n allowsMultiple?: boolean;\n /**\n * Specifies the use of a media capture mechanism to capture the media on the spot.\n */\n defaultCamera?: 'user' | 'environment';\n /**\n * Handler when a user selects a file.\n */\n onSelect?: (files: FileList | null) => void;\n /**\n * The children of the component.\n */\n children?: ReactNode;\n /**\n * Enables the selection of directories instead of individual files.\n */\n acceptDirectory?: boolean;\n}\n\n/**\n * A FileTrigger allows a user to access the file system with any pressable React Aria or React\n * Spectrum component, or custom components built with usePress.\n */\nexport const FileTrigger = forwardRef(function FileTrigger(\n props: FileTriggerProps,\n ref: ForwardedRef<HTMLInputElement>\n) {\n let {\n onSelect,\n acceptedFileTypes,\n allowsMultiple,\n defaultCamera,\n children,\n acceptDirectory,\n ...rest\n } = props;\n let inputRef = useObjectRef(ref);\n let domProps = filterDOMProps(rest, {global: true});\n\n return (\n <>\n <PressResponder\n onPress={() => {\n if (inputRef.current?.value) {\n inputRef.current.value = '';\n }\n inputRef.current?.click();\n }}>\n {children}\n </PressResponder>\n <Input\n {...domProps}\n className=\"\"\n type=\"file\"\n ref={inputRef}\n style={{display: 'none'}}\n accept={acceptedFileTypes?.toString()}\n onChange={e => onSelect?.(getEventTarget(e).files)}\n capture={defaultCamera}\n multiple={allowsMultiple}\n // @ts-expect-error\n webkitdirectory={acceptDirectory ? '' : undefined}\n />\n </>\n );\n});\n"],"names":[],"version":3,"file":"FileTrigger.mjs.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAmC;IAEnC,IAAI,YACF,QAAQ,qBACR,iBAAiB,kBACjB,cAAc,iBACd,aAAa,YACb,QAAQ,mBACR,eAAe,EACf,GAAG,MACJ,GAAG;IACJ,IAAI,WAAW,CAAA,GAAA,mBAAW,EAAE;IAC5B,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,MAAM;QAAC,QAAQ;IAAI;IAEjD,qBACE,gFACE,gCAAC,CAAA,GAAA,qBAAa;QACZ,SAAS;YACP,IAAI,SAAS,OAAO,EAAE,OACpB,SAAS,OAAO,CAAC,KAAK,GAAG;YAE3B,SAAS,OAAO,EAAE;QACpB;OACC,yBAEH,gCAAC,CAAA,GAAA,yCAAI;QACF,GAAG,QAAQ;QACZ,WAAU;QACV,MAAK;QACL,KAAK;QACL,SAAS,CAAA,IAAK,EAAE,eAAe;QAC/B,OAAO;YAAC,SAAS;QAAM;QACvB,QAAQ,mBAAmB;QAC3B,UAAU,CAAA,IAAK,WAAW,CAAA,GAAA,qBAAa,EAAE,GAAG,KAAK;QACjD,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,iBAAiB,kBAAkB,KAAK;;AAIhD","sources":["packages/react-aria-components/src/FileTrigger.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 {filterDOMProps} from 'react-aria/filterDOMProps';\n\nimport {getEventTarget} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {Input} from './Input';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface FileTriggerProps extends GlobalDOMAttributes<HTMLInputElement> {\n /**\n * Specifies what mime type of files are allowed.\n */\n acceptedFileTypes?: ReadonlyArray<string>;\n /**\n * Whether multiple files can be selected.\n */\n allowsMultiple?: boolean;\n /**\n * Specifies the use of a media capture mechanism to capture the media on the spot.\n */\n defaultCamera?: 'user' | 'environment';\n /**\n * Handler when a user selects a file.\n */\n onSelect?: (files: FileList | null) => void;\n /**\n * The children of the component.\n */\n children?: ReactNode;\n /**\n * Enables the selection of directories instead of individual files.\n */\n acceptDirectory?: boolean;\n}\n\n/**\n * A FileTrigger allows a user to access the file system with any pressable React Aria or React\n * Spectrum component, or custom components built with usePress.\n */\nexport const FileTrigger = forwardRef(function FileTrigger(\n props: FileTriggerProps,\n ref: ForwardedRef<HTMLInputElement>\n) {\n let {\n onSelect,\n acceptedFileTypes,\n allowsMultiple,\n defaultCamera,\n children,\n acceptDirectory,\n ...rest\n } = props;\n let inputRef = useObjectRef(ref);\n let domProps = filterDOMProps(rest, {global: true});\n\n return (\n <>\n <PressResponder\n onPress={() => {\n if (inputRef.current?.value) {\n inputRef.current.value = '';\n }\n inputRef.current?.click();\n }}>\n {children}\n </PressResponder>\n <Input\n {...domProps}\n className=\"\"\n type=\"file\"\n ref={inputRef}\n onClick={e => e.stopPropagation()}\n style={{display: 'none'}}\n accept={acceptedFileTypes?.toString()}\n onChange={e => onSelect?.(getEventTarget(e).files)}\n capture={defaultCamera}\n multiple={allowsMultiple}\n // @ts-expect-error\n webkitdirectory={acceptDirectory ? '' : undefined}\n />\n </>\n );\n});\n"],"names":[],"version":3,"file":"FileTrigger.mjs.map"}
@@ -24,12 +24,14 @@ $parcel$export(module.exports, "GridLayout", function () { return $b0f63132ddc5a
24
24
  class $b0f63132ddc5a7cf$export$7d2b12578154a735 extends (0, $kMpTT$reactstatelyuseVirtualizerState.GridLayout) {
25
25
  // Automatically determine the layout direction from the current locale.
26
26
  useLayoutOptions() {
27
- /* eslint-disable react-hooks/rules-of-hooks */ let { direction: direction } = (0, $kMpTT$reactariaI18nProvider.useLocale)();
27
+ // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks
28
+ let { direction: direction } = (0, $kMpTT$reactariaI18nProvider.useLocale)();
28
29
  return (0, $kMpTT$react.useMemo)(()=>({
29
30
  direction: direction
30
31
  }), [
31
32
  direction
32
33
  ]);
34
+ // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks
33
35
  }
34
36
  }
35
37
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,iDAAa;IAGrB,wEAAwE;IACxE,mBAAsC;QACpC,6CAA6C,GAC7C,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,sCAAQ;QAC1B,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;2BAAC;YAAS,CAAA,GAAI;YAAC;SAAU;IACjD;AACF","sources":["packages/react-aria-components/src/GridLayout.ts"],"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 {GridLayout as BaseGridLayout, GridLayoutOptions} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useMemo} from 'react';\n\nexport class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions>\n extends BaseGridLayout<T, O>\n implements LayoutOptionsDelegate<GridLayoutOptions>\n{\n // Automatically determine the layout direction from the current locale.\n useLayoutOptions(): GridLayoutOptions {\n /* eslint-disable react-hooks/rules-of-hooks */\n let {direction} = useLocale();\n return useMemo(() => ({direction}), [direction]);\n }\n}\n"],"names":[],"version":3,"file":"GridLayout.cjs.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,iDAAa;IAGrB,wEAAwE;IACxE,mBAAsC;QACpC,kEAAkE;QAClE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,sCAAQ;QAC1B,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;2BAAC;YAAS,CAAA,GAAI;YAAC;SAAU;IAC/C,iEAAiE;IACnE;AACF","sources":["packages/react-aria-components/src/GridLayout.ts"],"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 {GridLayout as BaseGridLayout, GridLayoutOptions} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useMemo} from 'react';\n\nexport class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions>\n extends BaseGridLayout<T, O>\n implements LayoutOptionsDelegate<GridLayoutOptions>\n{\n // Automatically determine the layout direction from the current locale.\n useLayoutOptions(): GridLayoutOptions {\n // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks\n let {direction} = useLocale();\n return useMemo(() => ({direction}), [direction]);\n // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks\n }\n}\n"],"names":[],"version":3,"file":"GridLayout.cjs.map"}
@@ -18,12 +18,14 @@ import {useMemo as $86kX2$useMemo} from "react";
18
18
  class $b4dd74abacc8f75e$export$7d2b12578154a735 extends (0, $86kX2$GridLayout) {
19
19
  // Automatically determine the layout direction from the current locale.
20
20
  useLayoutOptions() {
21
- /* eslint-disable react-hooks/rules-of-hooks */ let { direction: direction } = (0, $86kX2$useLocale)();
21
+ // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks
22
+ let { direction: direction } = (0, $86kX2$useLocale)();
22
23
  return (0, $86kX2$useMemo)(()=>({
23
24
  direction: direction
24
25
  }), [
25
26
  direction
26
27
  ]);
28
+ // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks
27
29
  }
28
30
  }
29
31
 
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,iBAAa;IAGrB,wEAAwE;IACxE,mBAAsC;QACpC,6CAA6C,GAC7C,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;QAC1B,OAAO,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;2BAAC;YAAS,CAAA,GAAI;YAAC;SAAU;IACjD;AACF","sources":["packages/react-aria-components/src/GridLayout.ts"],"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 {GridLayout as BaseGridLayout, GridLayoutOptions} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useMemo} from 'react';\n\nexport class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions>\n extends BaseGridLayout<T, O>\n implements LayoutOptionsDelegate<GridLayoutOptions>\n{\n // Automatically determine the layout direction from the current locale.\n useLayoutOptions(): GridLayoutOptions {\n /* eslint-disable react-hooks/rules-of-hooks */\n let {direction} = useLocale();\n return useMemo(() => ({direction}), [direction]);\n }\n}\n"],"names":[],"version":3,"file":"GridLayout.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,iBAAa;IAGrB,wEAAwE;IACxE,mBAAsC;QACpC,kEAAkE;QAClE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;QAC1B,OAAO,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;2BAAC;YAAS,CAAA,GAAI;YAAC;SAAU;IAC/C,iEAAiE;IACnE;AACF","sources":["packages/react-aria-components/src/GridLayout.ts"],"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 {GridLayout as BaseGridLayout, GridLayoutOptions} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useMemo} from 'react';\n\nexport class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions>\n extends BaseGridLayout<T, O>\n implements LayoutOptionsDelegate<GridLayoutOptions>\n{\n // Automatically determine the layout direction from the current locale.\n useLayoutOptions(): GridLayoutOptions {\n // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks\n let {direction} = useLocale();\n return useMemo(() => ({direction}), [direction]);\n // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks\n }\n}\n"],"names":[],"version":3,"file":"GridLayout.js.map"}
@@ -18,12 +18,14 @@ import {useMemo as $drfXP$useMemo} from "react";
18
18
  class $4619d02c7d841f48$export$7d2b12578154a735 extends (0, $drfXP$GridLayout) {
19
19
  // Automatically determine the layout direction from the current locale.
20
20
  useLayoutOptions() {
21
- /* eslint-disable react-hooks/rules-of-hooks */ let { direction: direction } = (0, $drfXP$useLocale)();
21
+ // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks
22
+ let { direction: direction } = (0, $drfXP$useLocale)();
22
23
  return (0, $drfXP$useMemo)(()=>({
23
24
  direction: direction
24
25
  }), [
25
26
  direction
26
27
  ]);
28
+ // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks
27
29
  }
28
30
  }
29
31
 
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,iBAAa;IAGrB,wEAAwE;IACxE,mBAAsC;QACpC,6CAA6C,GAC7C,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;QAC1B,OAAO,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;2BAAC;YAAS,CAAA,GAAI;YAAC;SAAU;IACjD;AACF","sources":["packages/react-aria-components/src/GridLayout.ts"],"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 {GridLayout as BaseGridLayout, GridLayoutOptions} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useMemo} from 'react';\n\nexport class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions>\n extends BaseGridLayout<T, O>\n implements LayoutOptionsDelegate<GridLayoutOptions>\n{\n // Automatically determine the layout direction from the current locale.\n useLayoutOptions(): GridLayoutOptions {\n /* eslint-disable react-hooks/rules-of-hooks */\n let {direction} = useLocale();\n return useMemo(() => ({direction}), [direction]);\n }\n}\n"],"names":[],"version":3,"file":"GridLayout.mjs.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,iBAAa;IAGrB,wEAAwE;IACxE,mBAAsC;QACpC,kEAAkE;QAClE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;QAC1B,OAAO,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;2BAAC;YAAS,CAAA,GAAI;YAAC;SAAU;IAC/C,iEAAiE;IACnE;AACF","sources":["packages/react-aria-components/src/GridLayout.ts"],"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 {GridLayout as BaseGridLayout, GridLayoutOptions} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useMemo} from 'react';\n\nexport class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions>\n extends BaseGridLayout<T, O>\n implements LayoutOptionsDelegate<GridLayoutOptions>\n{\n // Automatically determine the layout direction from the current locale.\n useLayoutOptions(): GridLayoutOptions {\n // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks\n let {direction} = useLocale();\n return useMemo(() => ({direction}), [direction]);\n // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks\n }\n}\n"],"names":[],"version":3,"file":"GridLayout.mjs.map"}
@@ -95,6 +95,7 @@ const $baa7ef94f966d95f$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $lEvRe$react
95
95
  }));
96
96
  });
97
97
  function $baa7ef94f966d95f$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
98
+ // oxlint-disable-next-line react/react-compiler
98
99
  [props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, (0, $433949643203e332$exports.SelectableCollectionContext));
99
100
  let { shouldUseVirtualFocus: // eslint-disable-next-line @typescript-eslint/no-unused-vars
100
101
  shouldUseVirtualFocus, filter: filter, disallowTypeAhead: disallowTypeAhead, UNSTABLE_focusOnEntry: UNSTABLE_focusOnEntry, ...DOMCollectionProps } = props;
@@ -106,6 +107,7 @@ function $baa7ef94f966d95f$var$GridListInner({ props: props, collection: collect
106
107
  children: undefined,
107
108
  layoutDelegate: layoutDelegate
108
109
  });
110
+ // oxlint-disable-next-line react/react-compiler
109
111
  let filteredState = (0, $lEvRe$reactstatelyuseListState.UNSTABLE_useFilteredListState)(gridlistState, filter);
110
112
  let collator = (0, $lEvRe$reactariauseCollator.useCollator)({
111
113
  usage: 'search',
@@ -164,11 +166,13 @@ function $baa7ef94f966d95f$var$GridListInner({ props: props, collection: collect
164
166
  let dragPreview = null;
165
167
  let preview = (0, $lEvRe$react.useRef)(null);
166
168
  if (isListDraggable && dragAndDropHooks) {
169
+ // oxlint-disable-next-line react/react-compiler
167
170
  dragState = dragAndDropHooks.useDraggableCollectionState({
168
171
  collection: filteredState.collection,
169
172
  selectionManager: selectionManager,
170
173
  preview: dragAndDropHooks.renderDragPreview ? preview : undefined
171
174
  });
175
+ // oxlint-disable-next-line react/react-compiler
172
176
  dragAndDropHooks.useDraggableCollection({}, dragState, ref);
173
177
  let DragPreview = dragAndDropHooks.DragPreview;
174
178
  dragPreview = dragAndDropHooks.renderDragPreview ? /*#__PURE__*/ (0, ($parcel$interopDefault($lEvRe$react))).createElement(DragPreview, {
@@ -176,6 +180,7 @@ function $baa7ef94f966d95f$var$GridListInner({ props: props, collection: collect
176
180
  }, dragAndDropHooks.renderDragPreview) : null;
177
181
  }
178
182
  if (isListDroppable && dragAndDropHooks) {
183
+ // oxlint-disable-next-line react/react-compiler
179
184
  dropState = dragAndDropHooks.useDroppableCollectionState({
180
185
  collection: filteredState.collection,
181
186
  selectionManager: selectionManager
@@ -185,6 +190,7 @@ function $baa7ef94f966d95f$var$GridListInner({ props: props, collection: collect
185
190
  direction: direction,
186
191
  orientation: orientation
187
192
  });
193
+ // oxlint-disable-next-line react/react-compiler
188
194
  droppableCollection = dragAndDropHooks.useDroppableCollection({
189
195
  keyboardDelegate: keyboardDelegate,
190
196
  dropTargetDelegate: dropTargetDelegate
@@ -278,7 +284,9 @@ const $baa7ef94f966d95f$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $lEvRe$react
278
284
  let { rowProps: rowProps, gridCellProps: gridCellProps, descriptionProps: descriptionProps, ...states } = (0, $lEvRe$reactariauseGridList.useGridListItem)({
279
285
  node: item,
280
286
  shouldSelectOnPressUp: !!dragState,
281
- isVirtualized: isVirtualized
287
+ isVirtualized: isVirtualized,
288
+ focusMode: props.focusMode,
289
+ allowsArrowNavigation: props.allowsArrowNavigation
282
290
  }, state, ref);
283
291
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $lEvRe$reactariauseHover.useHover)({
284
292
  // because of https://bugs.webkit.org/show_bug.cgi?id=214609, supporting hover styles when a item is ONLY isDraggable
@@ -452,6 +460,7 @@ function $baa7ef94f966d95f$var$GridListDropIndicatorWrapper(props, ref) {
452
460
  ref = (0, $lEvRe$reactariauseObjectRef.useObjectRef)(ref);
453
461
  let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = (0, $lEvRe$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
454
462
  let buttonRef = (0, $lEvRe$react.useRef)(null);
463
+ // oxlint-disable-next-line react/react-compiler
455
464
  let { dropIndicatorProps: dropIndicatorProps, isHidden: isHidden, isDropTarget: isDropTarget } = dragAndDropHooks.useDropIndicator(props, dropState, buttonRef);
456
465
  if (isHidden) return null;
457
466
  return /*#__PURE__*/ (0, ($parcel$interopDefault($lEvRe$react))).createElement($baa7ef94f966d95f$var$GridListDropIndicatorForwardRef, {
@@ -490,6 +499,7 @@ const $baa7ef94f966d95f$var$GridListDropIndicatorForwardRef = /*#__PURE__*/ (0,
490
499
  function $baa7ef94f966d95f$var$RootDropIndicator() {
491
500
  let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = (0, $lEvRe$react.useContext)((0, $d3d8871226fc64f2$exports.DragAndDropContext));
492
501
  let ref = (0, $lEvRe$react.useRef)(null);
502
+ // oxlint-disable-next-line react/react-compiler
493
503
  let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
494
504
  target: {
495
505
  type: 'root'
@@ -528,6 +538,7 @@ const $baa7ef94f966d95f$export$392b9a0bbc7c7e43 = (0, $lEvRe$reactariaCollection
528
538
  }), [
529
539
  onLoadMore,
530
540
  scrollOffset,
541
+ sentinelRef,
531
542
  state?.collection
532
543
  ]);
533
544
  (0, $lEvRe$reactariaprivateutilsuseLoadMoreSentinel.useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);