react-aria-components 1.10.1 → 1.12.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 (320) hide show
  1. package/dist/Autocomplete.main.js +7 -20
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +8 -20
  4. package/dist/Autocomplete.module.js +8 -20
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/Breadcrumbs.main.js +13 -3
  7. package/dist/Breadcrumbs.main.js.map +1 -1
  8. package/dist/Breadcrumbs.mjs +15 -5
  9. package/dist/Breadcrumbs.module.js +15 -5
  10. package/dist/Breadcrumbs.module.js.map +1 -1
  11. package/dist/Button.main.js +7 -17
  12. package/dist/Button.main.js.map +1 -1
  13. package/dist/Button.mjs +7 -17
  14. package/dist/Button.module.js +7 -17
  15. package/dist/Button.module.js.map +1 -1
  16. package/dist/Calendar.main.js +36 -14
  17. package/dist/Calendar.main.js.map +1 -1
  18. package/dist/Calendar.mjs +38 -16
  19. package/dist/Calendar.module.js +38 -16
  20. package/dist/Calendar.module.js.map +1 -1
  21. package/dist/Checkbox.main.js +8 -3
  22. package/dist/Checkbox.main.js.map +1 -1
  23. package/dist/Checkbox.mjs +10 -5
  24. package/dist/Checkbox.module.js +10 -5
  25. package/dist/Checkbox.module.js.map +1 -1
  26. package/dist/Collection.main.js.map +1 -1
  27. package/dist/Collection.module.js.map +1 -1
  28. package/dist/ColorArea.main.js +4 -4
  29. package/dist/ColorArea.main.js.map +1 -1
  30. package/dist/ColorArea.mjs +5 -5
  31. package/dist/ColorArea.module.js +5 -5
  32. package/dist/ColorArea.module.js.map +1 -1
  33. package/dist/ColorField.main.js +14 -1
  34. package/dist/ColorField.main.js.map +1 -1
  35. package/dist/ColorField.mjs +14 -1
  36. package/dist/ColorField.module.js +14 -1
  37. package/dist/ColorField.module.js.map +1 -1
  38. package/dist/ColorSlider.main.js +3 -1
  39. package/dist/ColorSlider.main.js.map +1 -1
  40. package/dist/ColorSlider.mjs +3 -1
  41. package/dist/ColorSlider.module.js +3 -1
  42. package/dist/ColorSlider.module.js.map +1 -1
  43. package/dist/ColorSwatch.main.js +6 -2
  44. package/dist/ColorSwatch.main.js.map +1 -1
  45. package/dist/ColorSwatch.mjs +6 -2
  46. package/dist/ColorSwatch.module.js +6 -2
  47. package/dist/ColorSwatch.module.js.map +1 -1
  48. package/dist/ColorSwatchPicker.main.js.map +1 -1
  49. package/dist/ColorSwatchPicker.module.js.map +1 -1
  50. package/dist/ColorThumb.main.js +3 -1
  51. package/dist/ColorThumb.main.js.map +1 -1
  52. package/dist/ColorThumb.mjs +3 -1
  53. package/dist/ColorThumb.module.js +3 -1
  54. package/dist/ColorThumb.module.js.map +1 -1
  55. package/dist/ColorWheel.main.js +3 -1
  56. package/dist/ColorWheel.main.js.map +1 -1
  57. package/dist/ColorWheel.mjs +3 -1
  58. package/dist/ColorWheel.module.js +3 -1
  59. package/dist/ColorWheel.module.js.map +1 -1
  60. package/dist/ComboBox.main.js +4 -1
  61. package/dist/ComboBox.main.js.map +1 -1
  62. package/dist/ComboBox.mjs +4 -1
  63. package/dist/ComboBox.module.js +4 -1
  64. package/dist/ComboBox.module.js.map +1 -1
  65. package/dist/DateField.main.js +16 -3
  66. package/dist/DateField.main.js.map +1 -1
  67. package/dist/DateField.mjs +16 -3
  68. package/dist/DateField.module.js +16 -3
  69. package/dist/DateField.module.js.map +1 -1
  70. package/dist/DatePicker.main.js +15 -8
  71. package/dist/DatePicker.main.js.map +1 -1
  72. package/dist/DatePicker.mjs +16 -9
  73. package/dist/DatePicker.module.js +16 -9
  74. package/dist/DatePicker.module.js.map +1 -1
  75. package/dist/Dialog.main.js +4 -3
  76. package/dist/Dialog.main.js.map +1 -1
  77. package/dist/Dialog.mjs +5 -4
  78. package/dist/Dialog.module.js +5 -4
  79. package/dist/Dialog.module.js.map +1 -1
  80. package/dist/Disclosure.main.js +12 -10
  81. package/dist/Disclosure.main.js.map +1 -1
  82. package/dist/Disclosure.mjs +13 -11
  83. package/dist/Disclosure.module.js +13 -11
  84. package/dist/Disclosure.module.js.map +1 -1
  85. package/dist/DragAndDrop.main.js +31 -3
  86. package/dist/DragAndDrop.main.js.map +1 -1
  87. package/dist/DragAndDrop.mjs +31 -3
  88. package/dist/DragAndDrop.module.js +31 -3
  89. package/dist/DragAndDrop.module.js.map +1 -1
  90. package/dist/DropZone.main.js +4 -3
  91. package/dist/DropZone.main.js.map +1 -1
  92. package/dist/DropZone.mjs +4 -3
  93. package/dist/DropZone.module.js +4 -3
  94. package/dist/DropZone.module.js.map +1 -1
  95. package/dist/FieldError.main.js +3 -1
  96. package/dist/FieldError.main.js.map +1 -1
  97. package/dist/FieldError.mjs +3 -1
  98. package/dist/FieldError.module.js +3 -1
  99. package/dist/FieldError.module.js.map +1 -1
  100. package/dist/FileTrigger.main.js +3 -1
  101. package/dist/FileTrigger.main.js.map +1 -1
  102. package/dist/FileTrigger.mjs +3 -1
  103. package/dist/FileTrigger.module.js +3 -1
  104. package/dist/FileTrigger.module.js.map +1 -1
  105. package/dist/Form.main.js.map +1 -1
  106. package/dist/Form.module.js.map +1 -1
  107. package/dist/GridList.main.js +114 -26
  108. package/dist/GridList.main.js.map +1 -1
  109. package/dist/GridList.mjs +116 -30
  110. package/dist/GridList.module.js +116 -30
  111. package/dist/GridList.module.js.map +1 -1
  112. package/dist/Header.main.js +1 -1
  113. package/dist/Header.main.js.map +1 -1
  114. package/dist/Header.mjs +2 -2
  115. package/dist/Header.module.js +2 -2
  116. package/dist/Header.module.js.map +1 -1
  117. package/dist/HiddenDateInput.main.js +118 -0
  118. package/dist/HiddenDateInput.main.js.map +1 -0
  119. package/dist/HiddenDateInput.mjs +109 -0
  120. package/dist/HiddenDateInput.module.js +109 -0
  121. package/dist/HiddenDateInput.module.js.map +1 -0
  122. package/dist/Link.main.js +7 -1
  123. package/dist/Link.main.js.map +1 -1
  124. package/dist/Link.mjs +7 -1
  125. package/dist/Link.module.js +7 -1
  126. package/dist/Link.module.js.map +1 -1
  127. package/dist/ListBox.main.js +27 -36
  128. package/dist/ListBox.main.js.map +1 -1
  129. package/dist/ListBox.mjs +29 -38
  130. package/dist/ListBox.module.js +29 -38
  131. package/dist/ListBox.module.js.map +1 -1
  132. package/dist/Menu.main.js +44 -23
  133. package/dist/Menu.main.js.map +1 -1
  134. package/dist/Menu.mjs +47 -26
  135. package/dist/Menu.module.js +47 -26
  136. package/dist/Menu.module.js.map +1 -1
  137. package/dist/Meter.main.js +6 -2
  138. package/dist/Meter.main.js.map +1 -1
  139. package/dist/Meter.mjs +6 -2
  140. package/dist/Meter.module.js +6 -2
  141. package/dist/Meter.module.js.map +1 -1
  142. package/dist/Modal.main.js +31 -6
  143. package/dist/Modal.main.js.map +1 -1
  144. package/dist/Modal.mjs +31 -6
  145. package/dist/Modal.module.js +31 -6
  146. package/dist/Modal.module.js.map +1 -1
  147. package/dist/NumberField.main.js +4 -1
  148. package/dist/NumberField.main.js.map +1 -1
  149. package/dist/NumberField.mjs +4 -1
  150. package/dist/NumberField.module.js +4 -1
  151. package/dist/NumberField.module.js.map +1 -1
  152. package/dist/Popover.main.js +10 -12
  153. package/dist/Popover.main.js.map +1 -1
  154. package/dist/Popover.mjs +11 -13
  155. package/dist/Popover.module.js +11 -13
  156. package/dist/Popover.module.js.map +1 -1
  157. package/dist/ProgressBar.main.js +6 -2
  158. package/dist/ProgressBar.main.js.map +1 -1
  159. package/dist/ProgressBar.mjs +6 -2
  160. package/dist/ProgressBar.module.js +6 -2
  161. package/dist/ProgressBar.module.js.map +1 -1
  162. package/dist/RadioGroup.main.js +8 -3
  163. package/dist/RadioGroup.main.js.map +1 -1
  164. package/dist/RadioGroup.mjs +9 -4
  165. package/dist/RadioGroup.module.js +9 -4
  166. package/dist/RadioGroup.module.js.map +1 -1
  167. package/dist/SearchField.main.js +9 -5
  168. package/dist/SearchField.main.js.map +1 -1
  169. package/dist/SearchField.mjs +10 -6
  170. package/dist/SearchField.module.js +10 -6
  171. package/dist/SearchField.module.js.map +1 -1
  172. package/dist/Select.main.js +12 -14
  173. package/dist/Select.main.js.map +1 -1
  174. package/dist/Select.mjs +13 -15
  175. package/dist/Select.module.js +13 -15
  176. package/dist/Select.module.js.map +1 -1
  177. package/dist/Separator.main.js +17 -3
  178. package/dist/Separator.main.js.map +1 -1
  179. package/dist/Separator.mjs +20 -6
  180. package/dist/Separator.module.js +20 -6
  181. package/dist/Separator.module.js.map +1 -1
  182. package/dist/Slider.main.js +7 -5
  183. package/dist/Slider.main.js.map +1 -1
  184. package/dist/Slider.mjs +8 -6
  185. package/dist/Slider.module.js +8 -6
  186. package/dist/Slider.module.js.map +1 -1
  187. package/dist/Switch.main.js +4 -1
  188. package/dist/Switch.main.js.map +1 -1
  189. package/dist/Switch.mjs +4 -1
  190. package/dist/Switch.module.js +4 -1
  191. package/dist/Switch.module.js.map +1 -1
  192. package/dist/Table.main.js +104 -42
  193. package/dist/Table.main.js.map +1 -1
  194. package/dist/Table.mjs +107 -45
  195. package/dist/Table.module.js +107 -45
  196. package/dist/Table.module.js.map +1 -1
  197. package/dist/Tabs.main.js +24 -11
  198. package/dist/Tabs.main.js.map +1 -1
  199. package/dist/Tabs.mjs +26 -13
  200. package/dist/Tabs.module.js +26 -13
  201. package/dist/Tabs.module.js.map +1 -1
  202. package/dist/TagGroup.main.js +27 -12
  203. package/dist/TagGroup.main.js.map +1 -1
  204. package/dist/TagGroup.mjs +29 -14
  205. package/dist/TagGroup.module.js +29 -14
  206. package/dist/TagGroup.module.js.map +1 -1
  207. package/dist/TextField.main.js +20 -6
  208. package/dist/TextField.main.js.map +1 -1
  209. package/dist/TextField.mjs +21 -7
  210. package/dist/TextField.module.js +21 -7
  211. package/dist/TextField.module.js.map +1 -1
  212. package/dist/Toast.main.js +9 -5
  213. package/dist/Toast.main.js.map +1 -1
  214. package/dist/Toast.mjs +9 -5
  215. package/dist/Toast.module.js +9 -5
  216. package/dist/Toast.module.js.map +1 -1
  217. package/dist/ToggleButton.main.js +8 -2
  218. package/dist/ToggleButton.main.js.map +1 -1
  219. package/dist/ToggleButton.mjs +8 -2
  220. package/dist/ToggleButton.module.js +8 -2
  221. package/dist/ToggleButton.module.js.map +1 -1
  222. package/dist/ToggleButtonGroup.main.js +6 -2
  223. package/dist/ToggleButtonGroup.main.js.map +1 -1
  224. package/dist/ToggleButtonGroup.mjs +6 -2
  225. package/dist/ToggleButtonGroup.module.js +6 -2
  226. package/dist/ToggleButtonGroup.module.js.map +1 -1
  227. package/dist/Toolbar.main.js +4 -3
  228. package/dist/Toolbar.main.js.map +1 -1
  229. package/dist/Toolbar.mjs +4 -3
  230. package/dist/Toolbar.module.js +4 -3
  231. package/dist/Toolbar.module.js.map +1 -1
  232. package/dist/Tooltip.main.js +9 -14
  233. package/dist/Tooltip.main.js.map +1 -1
  234. package/dist/Tooltip.mjs +10 -15
  235. package/dist/Tooltip.module.js +10 -15
  236. package/dist/Tooltip.module.js.map +1 -1
  237. package/dist/Tree.main.js +81 -28
  238. package/dist/Tree.main.js.map +1 -1
  239. package/dist/Tree.mjs +83 -30
  240. package/dist/Tree.module.js +83 -30
  241. package/dist/Tree.module.js.map +1 -1
  242. package/dist/TreeDropTargetDelegate.main.js +8 -5
  243. package/dist/TreeDropTargetDelegate.main.js.map +1 -1
  244. package/dist/TreeDropTargetDelegate.mjs +8 -5
  245. package/dist/TreeDropTargetDelegate.module.js +8 -5
  246. package/dist/TreeDropTargetDelegate.module.js.map +1 -1
  247. package/dist/context.main.js +25 -0
  248. package/dist/context.main.js.map +1 -0
  249. package/dist/context.mjs +19 -0
  250. package/dist/context.module.js +19 -0
  251. package/dist/context.module.js.map +1 -0
  252. package/dist/import.mjs +6 -6
  253. package/dist/main.js +7 -4
  254. package/dist/main.js.map +1 -1
  255. package/dist/module.js +6 -6
  256. package/dist/module.js.map +1 -1
  257. package/dist/types.d.ts +358 -342
  258. package/dist/types.d.ts.map +1 -1
  259. package/dist/useDragAndDrop.main.js.map +1 -1
  260. package/dist/useDragAndDrop.module.js.map +1 -1
  261. package/dist/utils.main.js.map +1 -1
  262. package/dist/utils.module.js.map +1 -1
  263. package/i18n/de-DE.js +1 -1
  264. package/i18n/de-DE.mjs +1 -1
  265. package/package.json +27 -26
  266. package/src/Autocomplete.tsx +14 -25
  267. package/src/Breadcrumbs.tsx +16 -8
  268. package/src/Button.tsx +8 -30
  269. package/src/Calendar.tsx +41 -24
  270. package/src/Checkbox.tsx +8 -6
  271. package/src/Collection.tsx +2 -2
  272. package/src/ColorArea.tsx +5 -6
  273. package/src/ColorField.tsx +6 -4
  274. package/src/ColorSlider.tsx +3 -2
  275. package/src/ColorSwatch.tsx +6 -3
  276. package/src/ColorSwatchPicker.tsx +3 -3
  277. package/src/ColorThumb.tsx +3 -3
  278. package/src/ColorWheel.tsx +6 -5
  279. package/src/ComboBox.tsx +4 -4
  280. package/src/DateField.tsx +15 -10
  281. package/src/DatePicker.tsx +14 -12
  282. package/src/Dialog.tsx +6 -6
  283. package/src/Disclosure.tsx +10 -14
  284. package/src/DragAndDrop.tsx +31 -1
  285. package/src/DropZone.tsx +4 -5
  286. package/src/FieldError.tsx +3 -3
  287. package/src/FileTrigger.tsx +4 -3
  288. package/src/Form.tsx +2 -1
  289. package/src/GridList.tsx +112 -37
  290. package/src/Header.tsx +2 -2
  291. package/src/HiddenDateInput.tsx +142 -0
  292. package/src/Link.tsx +7 -3
  293. package/src/ListBox.tsx +40 -39
  294. package/src/Menu.tsx +52 -29
  295. package/src/Meter.tsx +6 -3
  296. package/src/Modal.tsx +16 -5
  297. package/src/NumberField.tsx +4 -4
  298. package/src/Popover.tsx +14 -14
  299. package/src/ProgressBar.tsx +6 -2
  300. package/src/RadioGroup.tsx +8 -6
  301. package/src/SearchField.tsx +8 -6
  302. package/src/Select.tsx +13 -16
  303. package/src/Separator.tsx +23 -6
  304. package/src/Slider.tsx +9 -11
  305. package/src/Switch.tsx +4 -3
  306. package/src/Table.tsx +119 -74
  307. package/src/Tabs.tsx +24 -17
  308. package/src/TagGroup.tsx +28 -18
  309. package/src/TextField.tsx +13 -9
  310. package/src/Toast.tsx +10 -8
  311. package/src/ToggleButton.tsx +8 -4
  312. package/src/ToggleButtonGroup.tsx +6 -4
  313. package/src/Toolbar.tsx +4 -5
  314. package/src/Tooltip.tsx +15 -18
  315. package/src/Tree.tsx +102 -46
  316. package/src/TreeDropTargetDelegate.ts +5 -1
  317. package/src/context.tsx +34 -0
  318. package/src/index.ts +9 -9
  319. package/src/useDragAndDrop.tsx +11 -11
  320. package/src/utils.tsx +9 -9
package/dist/Link.main.js CHANGED
@@ -1,5 +1,6 @@
1
1
  var $c5ccf687772c0422$exports = require("./utils.main.js");
2
2
  var $7KWRi$reactaria = require("react-aria");
3
+ var $7KWRi$reactariautils = require("@react-aria/utils");
3
4
  var $7KWRi$react = require("react");
4
5
 
5
6
 
@@ -26,6 +27,7 @@ $parcel$export(module.exports, "Link", () => $c87397ee936d2bda$export$a6c7ac8248
26
27
  */
27
28
 
28
29
 
30
+
29
31
  const $c87397ee936d2bda$export$e2509388b49734e7 = /*#__PURE__*/ (0, $7KWRi$react.createContext)(null);
30
32
  const $c87397ee936d2bda$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $7KWRi$react.forwardRef)(function Link(props, ref) {
31
33
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $c87397ee936d2bda$export$e2509388b49734e7);
@@ -48,10 +50,14 @@ const $c87397ee936d2bda$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $7KWRi$react
48
50
  isFocusVisible: isFocusVisible
49
51
  }
50
52
  });
53
+ let DOMProps = (0, $7KWRi$reactariautils.filterDOMProps)(props, {
54
+ global: true
55
+ });
56
+ delete DOMProps.onClick;
51
57
  return /*#__PURE__*/ (0, ($parcel$interopDefault($7KWRi$react))).createElement(ElementType, {
52
58
  ref: ref,
53
59
  slot: props.slot || undefined,
54
- ...(0, $7KWRi$reactaria.mergeProps)(renderProps, linkProps, hoverProps, focusProps),
60
+ ...(0, $7KWRi$reactaria.mergeProps)(DOMProps, renderProps, linkProps, hoverProps, focusProps),
55
61
  "data-focused": isFocused || undefined,
56
62
  "data-hovered": isHovered || undefined,
57
63
  "data-pressed": isPressed || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA8C;AAM9E,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAoC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAA2B,MAAM,IAAI,IAAI,CAAC,MAAM,UAAU,GAAG,MAAM;IACvE,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAM,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAW,GAAG;IAE3E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IAEzD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,WAAW,CAAC,CAAC,KAAK,CAAC,eAAe;YAClC,YAAY,MAAM,UAAU,IAAI;uBAChC;uBACA;uBACA;4BACA;QACF;IACF;IAEA,qBACE,0DAAC;QACC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACnB,GAAG,CAAA,GAAA,2BAAS,EAAE,aAAa,WAAW,YAAY,WAAW;QAC9D,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI;QACzC,iBAAe,MAAM,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps {}\n\nexport interface LinkRenderProps {\n /**\n * Whether the link is the current item within a list.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the link is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the link is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the link is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the link is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the link is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n [props, ref] = useContextProps(props, ref, LinkContext);\n\n let ElementType: ElementType = props.href && !props.isDisabled ? 'a' : 'span';\n let {linkProps, isPressed} = useLink({...props, elementType: ElementType}, ref);\n\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Link',\n values: {\n isCurrent: !!props['aria-current'],\n isDisabled: props.isDisabled || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <ElementType\n ref={ref}\n slot={props.slot || undefined}\n {...mergeProps(renderProps, linkProps, hoverProps, focusProps)}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-current={!!props['aria-current'] || undefined}\n data-disabled={props.isDisabled || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Link.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2CM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA8C;AAM9E,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAoC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAA2B,MAAM,IAAI,IAAI,CAAC,MAAM,UAAU,GAAG,MAAM;IACvE,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAM,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAW,GAAG;IAE3E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IAEzD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,WAAW,CAAC,CAAC,KAAK,CAAC,eAAe;YAClC,YAAY,MAAM,UAAU,IAAI;uBAChC;uBACA;uBACA;4BACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC;QACC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACnB,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,WAAW,YAAY,WAAW;QACxE,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI;QACzC,iBAAe,MAAM,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {}\n\nexport interface LinkRenderProps {\n /**\n * Whether the link is the current item within a list.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the link is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the link is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the link is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the link is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the link is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n [props, ref] = useContextProps(props, ref, LinkContext);\n\n let ElementType: ElementType = props.href && !props.isDisabled ? 'a' : 'span';\n let {linkProps, isPressed} = useLink({...props, elementType: ElementType}, ref);\n\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Link',\n values: {\n isCurrent: !!props['aria-current'],\n isDisabled: props.isDisabled || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <ElementType\n ref={ref}\n slot={props.slot || undefined}\n {...mergeProps(DOMProps, renderProps, linkProps, hoverProps, focusProps)}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-current={!!props['aria-current'] || undefined}\n data-disabled={props.isDisabled || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Link.main.js.map"}
package/dist/Link.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
2
2
  import {useLink as $115DY$useLink, useHover as $115DY$useHover, useFocusRing as $115DY$useFocusRing, mergeProps as $115DY$mergeProps} from "react-aria";
3
+ import {filterDOMProps as $115DY$filterDOMProps} from "@react-aria/utils";
3
4
  import $115DY$react, {createContext as $115DY$createContext, forwardRef as $115DY$forwardRef} from "react";
4
5
 
5
6
  /*
@@ -15,6 +16,7 @@ import $115DY$react, {createContext as $115DY$createContext, forwardRef as $115D
15
16
  */
16
17
 
17
18
 
19
+
18
20
  const $4f118338184dc1d9$export$e2509388b49734e7 = /*#__PURE__*/ (0, $115DY$createContext)(null);
19
21
  const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwardRef)(function Link(props, ref) {
20
22
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $4f118338184dc1d9$export$e2509388b49734e7);
@@ -37,10 +39,14 @@ const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwa
37
39
  isFocusVisible: isFocusVisible
38
40
  }
39
41
  });
42
+ let DOMProps = (0, $115DY$filterDOMProps)(props, {
43
+ global: true
44
+ });
45
+ delete DOMProps.onClick;
40
46
  return /*#__PURE__*/ (0, $115DY$react).createElement(ElementType, {
41
47
  ref: ref,
42
48
  slot: props.slot || undefined,
43
- ...(0, $115DY$mergeProps)(renderProps, linkProps, hoverProps, focusProps),
49
+ ...(0, $115DY$mergeProps)(DOMProps, renderProps, linkProps, hoverProps, focusProps),
44
50
  "data-focused": isFocused || undefined,
45
51
  "data-hovered": isHovered || undefined,
46
52
  "data-pressed": isPressed || undefined,
@@ -1,5 +1,6 @@
1
1
  import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
2
2
  import {useLink as $115DY$useLink, useHover as $115DY$useHover, useFocusRing as $115DY$useFocusRing, mergeProps as $115DY$mergeProps} from "react-aria";
3
+ import {filterDOMProps as $115DY$filterDOMProps} from "@react-aria/utils";
3
4
  import $115DY$react, {createContext as $115DY$createContext, forwardRef as $115DY$forwardRef} from "react";
4
5
 
5
6
  /*
@@ -15,6 +16,7 @@ import $115DY$react, {createContext as $115DY$createContext, forwardRef as $115D
15
16
  */
16
17
 
17
18
 
19
+
18
20
  const $4f118338184dc1d9$export$e2509388b49734e7 = /*#__PURE__*/ (0, $115DY$createContext)(null);
19
21
  const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwardRef)(function Link(props, ref) {
20
22
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $4f118338184dc1d9$export$e2509388b49734e7);
@@ -37,10 +39,14 @@ const $4f118338184dc1d9$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $115DY$forwa
37
39
  isFocusVisible: isFocusVisible
38
40
  }
39
41
  });
42
+ let DOMProps = (0, $115DY$filterDOMProps)(props, {
43
+ global: true
44
+ });
45
+ delete DOMProps.onClick;
40
46
  return /*#__PURE__*/ (0, $115DY$react).createElement(ElementType, {
41
47
  ref: ref,
42
48
  slot: props.slot || undefined,
43
- ...(0, $115DY$mergeProps)(renderProps, linkProps, hoverProps, focusProps),
49
+ ...(0, $115DY$mergeProps)(DOMProps, renderProps, linkProps, hoverProps, focusProps),
44
50
  "data-focused": isFocused || undefined,
45
51
  "data-hovered": isHovered || undefined,
46
52
  "data-pressed": isPressed || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA0CM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA8C;AAM9E,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAoC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAA2B,MAAM,IAAI,IAAI,CAAC,MAAM,UAAU,GAAG,MAAM;IACvE,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,cAAM,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAW,GAAG;IAE3E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAEzD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,WAAW,CAAC,CAAC,KAAK,CAAC,eAAe;YAClC,YAAY,MAAM,UAAU,IAAI;uBAChC;uBACA;uBACA;4BACA;QACF;IACF;IAEA,qBACE,gCAAC;QACC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,WAAW,YAAY,WAAW;QAC9D,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI;QACzC,iBAAe,MAAM,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {forwardRefType} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps {}\n\nexport interface LinkRenderProps {\n /**\n * Whether the link is the current item within a list.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the link is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the link is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the link is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the link is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the link is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n [props, ref] = useContextProps(props, ref, LinkContext);\n\n let ElementType: ElementType = props.href && !props.isDisabled ? 'a' : 'span';\n let {linkProps, isPressed} = useLink({...props, elementType: ElementType}, ref);\n\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Link',\n values: {\n isCurrent: !!props['aria-current'],\n isDisabled: props.isDisabled || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <ElementType\n ref={ref}\n slot={props.slot || undefined}\n {...mergeProps(renderProps, linkProps, hoverProps, focusProps)}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-current={!!props['aria-current'] || undefined}\n data-disabled={props.isDisabled || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Link.module.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AA2CM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA8C;AAM9E,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAoC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAA2B,MAAM,IAAI,IAAI,CAAC,MAAM,UAAU,GAAG,MAAM;IACvE,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,cAAM,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAW,GAAG;IAE3E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAEzD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,WAAW,CAAC,CAAC,KAAK,CAAC,eAAe;YAClC,YAAY,MAAM,UAAU,IAAI;uBAChC;uBACA;uBACA;4BACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC;QACC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,WAAW,YAAY,WAAW;QACxE,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI;QACzC,iBAAe,MAAM,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {}\n\nexport interface LinkRenderProps {\n /**\n * Whether the link is the current item within a list.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the link is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the link is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the link is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the link is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the link is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n [props, ref] = useContextProps(props, ref, LinkContext);\n\n let ElementType: ElementType = props.href && !props.isDisabled ? 'a' : 'span';\n let {linkProps, isPressed} = useLink({...props, elementType: ElementType}, ref);\n\n let {hoverProps, isHovered} = useHover(props);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Link',\n values: {\n isCurrent: !!props['aria-current'],\n isDisabled: props.isDisabled || false,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <ElementType\n ref={ref}\n slot={props.slot || undefined}\n {...mergeProps(DOMProps, renderProps, linkProps, hoverProps, focusProps)}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-current={!!props['aria-current'] || undefined}\n data-disabled={props.isDisabled || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Link.module.js.map"}
@@ -2,9 +2,9 @@ var $3114c2382242bdc0$exports = require("./Collection.main.js");
2
2
  var $c5ccf687772c0422$exports = require("./utils.main.js");
3
3
  var $0c2289d253cb4544$exports = require("./DragAndDrop.main.js");
4
4
  var $c7efb75a1a3fe2d2$exports = require("./Header.main.js");
5
+ var $09cb5ee89bb327e1$exports = require("./context.main.js");
5
6
  var $54b202ace195eaa4$exports = require("./Separator.main.js");
6
7
  var $a8a589c28affdc40$exports = require("./Text.main.js");
7
- var $33f48720060787fa$exports = require("./Autocomplete.main.js");
8
8
  var $59TRP$reactaria = require("react-aria");
9
9
  var $59TRP$reactariacollections = require("@react-aria/collections");
10
10
  var $59TRP$reactstately = require("react-stately");
@@ -25,7 +25,7 @@ $parcel$export(module.exports, "ListStateContext", () => $a03b42240404b420$expor
25
25
  $parcel$export(module.exports, "ListBox", () => $a03b42240404b420$export$41f133550aa26f48);
26
26
  $parcel$export(module.exports, "ListBoxSection", () => $a03b42240404b420$export$dca12b0bb56e4fc);
27
27
  $parcel$export(module.exports, "ListBoxItem", () => $a03b42240404b420$export$a11e76429ed99b4);
28
- $parcel$export(module.exports, "UNSTABLE_ListBoxLoadingSentinel", () => $a03b42240404b420$export$e59f0e608576589b);
28
+ $parcel$export(module.exports, "ListBoxLoadMoreItem", () => $a03b42240404b420$export$8e6d031a08cf56a1);
29
29
  /*
30
30
  * Copyright 2022 Adobe. All rights reserved.
31
31
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -90,21 +90,8 @@ function $a03b42240404b420$var$StandaloneListBox({ props: props, listBoxRef: lis
90
90
  });
91
91
  }
92
92
  function $a03b42240404b420$var$ListBoxInner({ state: inputState, props: props, listBoxRef: listBoxRef }) {
93
- var _state_collection_getItem;
94
- let { filter: filter, collectionProps: collectionProps, collectionRef: collectionRef } = (0, $59TRP$react.useContext)((0, $33f48720060787fa$exports.UNSTABLE_InternalAutocompleteContext)) || {};
95
- props = (0, $59TRP$react.useMemo)(()=>collectionProps ? {
96
- ...props,
97
- ...collectionProps
98
- } : props, [
99
- props,
100
- collectionProps
101
- ]);
102
- let { dragAndDropHooks: dragAndDropHooks, layout: layout = 'stack', orientation: orientation = 'vertical' } = props;
103
- // Memoed so that useAutocomplete callback ref is properly only called once on mount and not everytime a rerender happens
104
- listBoxRef = (0, $59TRP$reactariautils.useObjectRef)((0, $59TRP$react.useMemo)(()=>(0, $59TRP$reactariautils.mergeRefs)(listBoxRef, collectionRef !== undefined ? collectionRef : null), [
105
- collectionRef,
106
- listBoxRef
107
- ]));
93
+ [props, listBoxRef] = (0, $c5ccf687772c0422$exports.useContextProps)(props, listBoxRef, (0, $09cb5ee89bb327e1$exports.SelectableCollectionContext));
94
+ let { dragAndDropHooks: dragAndDropHooks, layout: layout = 'stack', orientation: orientation = 'vertical', filter: filter } = props;
108
95
  let state = (0, $59TRP$reactstately.UNSTABLE_useFilteredListState)(inputState, filter);
109
96
  let { collection: collection, selectionManager: selectionManager } = state;
110
97
  let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
@@ -191,7 +178,7 @@ function $a03b42240404b420$var$ListBoxInner({ state: inputState, props: props, l
191
178
  });
192
179
  }
193
180
  let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $59TRP$reactaria.useFocusRing)();
194
- let isEmpty = state.collection.size === 0 || state.collection.size === 1 && ((_state_collection_getItem = state.collection.getItem(state.collection.getFirstKey())) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.type) === 'loader';
181
+ let isEmpty = state.collection.size === 0;
195
182
  let renderValues = {
196
183
  isDropTarget: isRootDropTarget,
197
184
  isEmpty: isEmpty,
@@ -214,10 +201,11 @@ function $a03b42240404b420$var$ListBoxInner({ state: inputState, props: props, l
214
201
  display: 'contents'
215
202
  }
216
203
  }, props.renderEmptyState(renderValues));
204
+ let DOMProps = (0, $59TRP$reactariautils.filterDOMProps)(props, {
205
+ global: true
206
+ });
217
207
  return /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement((0, $59TRP$reactaria.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement("div", {
218
- ...(0, $59TRP$reactariautils.filterDOMProps)(props),
219
- ...(0, $59TRP$reactaria.mergeProps)(listBoxProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
220
- ...renderProps,
208
+ ...(0, $59TRP$reactaria.mergeProps)(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
221
209
  ref: listBoxRef,
222
210
  slot: props.slot || undefined,
223
211
  onScroll: props.onScroll,
@@ -288,10 +276,12 @@ function $a03b42240404b420$var$ListBoxSectionInner(props, ref, section, classNam
288
276
  style: props.style,
289
277
  values: {}
290
278
  });
279
+ let DOMProps = (0, $59TRP$reactariautils.filterDOMProps)(props, {
280
+ global: true
281
+ });
282
+ delete DOMProps.id;
291
283
  return /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement("section", {
292
- ...(0, $59TRP$reactariautils.filterDOMProps)(props),
293
- ...groupProps,
294
- ...renderProps,
284
+ ...(0, $59TRP$reactaria.mergeProps)(DOMProps, renderProps, groupProps),
295
285
  ref: ref
296
286
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement((0, $c7efb75a1a3fe2d2$exports.HeaderContext).Provider, {
297
287
  value: {
@@ -304,8 +294,8 @@ function $a03b42240404b420$var$ListBoxSectionInner(props, ref, section, classNam
304
294
  renderDropIndicator: (0, $0c2289d253cb4544$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
305
295
  })));
306
296
  }
307
- const $a03b42240404b420$export$dca12b0bb56e4fc = /*#__PURE__*/ (0, $59TRP$reactariacollections.createBranchComponent)('section', $a03b42240404b420$var$ListBoxSectionInner);
308
- const $a03b42240404b420$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $59TRP$reactariacollections.createLeafComponent)('item', function ListBoxItem(props, forwardedRef, item) {
297
+ const $a03b42240404b420$export$dca12b0bb56e4fc = /*#__PURE__*/ (0, $59TRP$reactariacollections.createBranchComponent)((0, $59TRP$reactariacollections.SectionNode), $a03b42240404b420$var$ListBoxSectionInner);
298
+ const $a03b42240404b420$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $59TRP$reactariacollections.createLeafComponent)((0, $59TRP$reactariacollections.ItemNode), function ListBoxItem(props, forwardedRef, item) {
309
299
  let ref = (0, $59TRP$reactariautils.useObjectRef)(forwardedRef);
310
300
  let state = (0, $59TRP$react.useContext)($a03b42240404b420$export$7c5906fe4f1f2af2);
311
301
  let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $59TRP$react.useContext)((0, $0c2289d253cb4544$exports.DragAndDropContext));
@@ -353,9 +343,13 @@ const $a03b42240404b420$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $59TRP$reacta
353
343
  item.textValue
354
344
  ]);
355
345
  let ElementType = props.href ? 'a' : 'div';
346
+ let DOMProps = (0, $59TRP$reactariautils.filterDOMProps)(props, {
347
+ global: true
348
+ });
349
+ delete DOMProps.id;
350
+ delete DOMProps.onClick;
356
351
  return /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement(ElementType, {
357
- ...(0, $59TRP$reactaria.mergeProps)(optionProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
358
- ...renderProps,
352
+ ...(0, $59TRP$reactaria.mergeProps)(DOMProps, renderProps, optionProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
359
353
  ref: ref,
360
354
  "data-allows-dragging": !!dragState || undefined,
361
355
  "data-selected": states.isSelected || undefined,
@@ -413,9 +407,8 @@ function $a03b42240404b420$var$ListBoxDropIndicator(props, ref) {
413
407
  });
414
408
  }
415
409
  const $a03b42240404b420$var$ListBoxDropIndicatorForwardRef = /*#__PURE__*/ (0, $59TRP$react.forwardRef)($a03b42240404b420$var$ListBoxDropIndicator);
416
- const $a03b42240404b420$export$e59f0e608576589b = (0, $59TRP$reactariacollections.createLeafComponent)('loader', function ListBoxLoadingIndicator(props, ref, item) {
410
+ const $a03b42240404b420$export$8e6d031a08cf56a1 = (0, $59TRP$reactariacollections.createLeafComponent)((0, $59TRP$reactariacollections.LoaderNode), function ListBoxLoadingIndicator(props, ref, item) {
417
411
  let state = (0, $59TRP$react.useContext)($a03b42240404b420$export$7c5906fe4f1f2af2);
418
- let { isVirtualized: isVirtualized } = (0, $59TRP$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
419
412
  let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
420
413
  let sentinelRef = (0, $59TRP$react.useRef)(null);
421
414
  let memoedLoadMoreProps = (0, $59TRP$react.useMemo)(()=>({
@@ -428,7 +421,7 @@ const $a03b42240404b420$export$e59f0e608576589b = (0, $59TRP$reactariacollection
428
421
  scrollOffset,
429
422
  state === null || state === void 0 ? void 0 : state.collection
430
423
  ]);
431
- (0, $59TRP$reactariautils.UNSTABLE_useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
424
+ (0, $59TRP$reactariautils.useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
432
425
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
433
426
  ...otherProps,
434
427
  id: undefined,
@@ -440,10 +433,6 @@ const $a03b42240404b420$export$e59f0e608576589b = (0, $59TRP$reactariacollection
440
433
  // For Android talkback
441
434
  tabIndex: -1
442
435
  };
443
- if (isVirtualized) {
444
- optionProps['aria-posinset'] = item.index + 1;
445
- optionProps['aria-setsize'] = state.collection.size;
446
- }
447
436
  return /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement((0, ($parcel$interopDefault($59TRP$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement("div", {
448
437
  style: {
449
438
  position: 'relative',
@@ -460,7 +449,9 @@ const $a03b42240404b420$export$e59f0e608576589b = (0, $59TRP$reactariacollection
460
449
  width: 1
461
450
  }
462
451
  })), isLoading && renderProps.children && /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement("div", {
463
- ...(0, $59TRP$reactaria.mergeProps)((0, $59TRP$reactariautils.filterDOMProps)(props), optionProps),
452
+ ...(0, $59TRP$reactaria.mergeProps)((0, $59TRP$reactariautils.filterDOMProps)(props, {
453
+ global: true
454
+ }), optionProps),
464
455
  ...renderProps,
465
456
  // aria-selected isn't needed here since this option is not selectable.
466
457
  // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAqEM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAK9D,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAA0B,KAAsB,EAAE,GAAiC;IAC9J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE;IAEvB,uHAAuH;IACvH,4HAA4H;IAC5H,qGAAqG;IACrG,wHAAwH;IACxH,kGAAkG;IAClG,IAAI,OACF,qBAAO,0DAAC;QAAa,OAAO;QAAO,OAAO;QAAO,YAAY;;IAG/D,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA,2BAAc,0DAAC;YAAkB,OAAO;YAAO,YAAY;YAAK,YAAY;;AAGnF;AAEA,SAAS,wCAAkB,SAAC,KAAK,cAAE,UAAU,cAAE,UAAU,EAAC;IACxD,QAAQ;QAAC,GAAG,KAAK;oBAAE;QAAY,UAAU;QAAM,OAAO;IAAI;IAC1D,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,QAAQ,CAAA,GAAA,gCAAW,EAAE;QAAC,GAAG,KAAK;wBAAE;IAAc;IAClD,qBAAO,0DAAC;QAAa,OAAO;QAAO,OAAO;QAAO,YAAY;;AAC/D;AAQA,SAAS,mCAA+B,EAAC,OAAO,UAAU,SAAE,KAAK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AG;IAE3D,IAAI,cAAc,CAAA,GAAA,mBAAK,EAAkB;IACzC,IAAI,sBAAsB,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;wBACvC;YACA,UAAU,EAAE,kBAAA,4BAAA,MAAO,UAAU;yBAC7B;0BACA;QACF,CAAA,GAAI;QAAC;QAAY;QAAc,kBAAA,4BAAA,MAAO,UAAU;KAAC;IACjD,CAAA,GAAA,kDAA2B,EAAE,qBAAqB;IAClD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,IAAI;QACJ,UAAU,KAAK,QAAQ;QACvB,kBAAkB;QAClB,QAAQ;IACV;IAEA,IAAI,cAAc;QAChB,uBAAuB;QACvB,UAAU;IACZ;IAEA,IAAI,eAAe;QACjB,WAAW,CAAC,gBAAgB,GAAG,KAAK,KAAK,GAAG;QAC5C,WAAW,CAAC,eAAe,GAAG,MAAM,UAAU,CAAC,IAAI;IACrD;IAEA,qBACE,oIAGE,0DAAC;QAAI,OAAO;YAAC,UAAU;YAAY,OAAO;YAAG,QAAQ;QAAC;QAAG,OAAO,CAAA,GAAA,gCAAS,EAAE;qBACzE,0DAAC;QAAI,eAAY;QAAmB,KAAK;QAAa,OAAO;YAAC,UAAU;YAAY,QAAQ;YAAG,OAAO;QAAC;SAExG,aAAa,YAAY,QAAQ,kBAChC,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,QAAe,YAAY;QACxD,GAAG,WAAW;QACf,uEAAuE;QACvE,iEAAiE;QACjE,MAAK;QACL,KAAK;OACJ,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/ListBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, ListState, Node, Orientation, SelectionBehavior, UNSTABLE_useFilteredListState, useListState} from 'react-stately';\nimport {filterDOMProps, inertValue, LoadMoreSentinelProps, mergeRefs, UNSTABLE_useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {UNSTABLE_InternalAutocompleteContext} from './Autocomplete';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the listbox is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the listbox is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the listbox is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the listbox.\n */\n state: ListState<unknown>\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' | 'label'>, CollectionProps<T>, StyleRenderProps<ListBoxRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T extends object>(props: ListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>,\n props: ListBoxProps<T> & AriaListBoxOptions<T>,\n listBoxRef: RefObject<HTMLDivElement | null>\n}\n\nfunction ListBoxInner<T extends object>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) {\n let {filter, collectionProps, collectionRef} = useContext(UNSTABLE_InternalAutocompleteContext) || {};\n props = useMemo(() => collectionProps ? ({...props, ...collectionProps}) : props, [props, collectionProps]);\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical'} = props;\n // Memoed so that useAutocomplete callback ref is properly only called once on mount and not everytime a rerender happens\n listBoxRef = useObjectRef(useMemo(() => mergeRefs(listBoxRef, collectionRef !== undefined ? collectionRef as RefObject<HTMLDivElement> : null), [collectionRef, listBoxRef]));\n let state = UNSTABLE_useFilteredListState(inputState, filter);\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot} = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(() => (\n props.keyboardDelegate || new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n })\n ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout, layoutDelegate]);\n\n let {listBoxProps} = useListBox({\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n }, state, listBoxRef);\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {orientation, layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, listBoxRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0 || (state.collection.size === 1 && state.collection.getItem(state.collection.getFirstKey()!)?.type === 'loader');\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (isEmpty && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...mergeProps(listBoxProps, focusProps, droppableCollection?.collectionProps)}\n {...renderProps}\n ref={listBoxRef}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={props.orientation || 'vertical'}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {}\n\nfunction ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection') {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </HeaderContext.Provider>\n </section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent('section', ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent('item', function ListBoxItem<T extends object>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key}, dragState);\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, ref);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(optionProps, hoverProps, draggableItem?.dragProps, droppableItem?.dropProps)}\n {...renderProps}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} ref={ref} />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n ...otherProps\n } = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...dropIndicatorProps}\n {...renderProps}\n // eslint-disable-next-line\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined} />\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n\nexport interface ListBoxLoadingSentinelProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps {\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode,\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean\n}\n\nexport const UNSTABLE_ListBoxLoadingSentinel = createLeafComponent('loader', function ListBoxLoadingIndicator<T extends object>(props: ListBoxLoadingSentinelProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(() => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }), [onLoadMore, scrollOffset, state?.collection]);\n UNSTABLE_useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-ListBoxLoadingIndicator',\n values: null\n });\n\n let optionProps = {\n // For Android talkback\n tabIndex: -1\n };\n\n if (isVirtualized) {\n optionProps['aria-posinset'] = item.index + 1;\n optionProps['aria-setsize'] = state.collection.size;\n }\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >\n <div data-testid=\"loadMoreSentinel\" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />\n </div>\n {isLoading && renderProps.children && (\n <div\n {...mergeProps(filterDOMProps(props as any), optionProps)}\n {...renderProps}\n // aria-selected isn't needed here since this option is not selectable.\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n role=\"option\"\n ref={ref}>\n {renderProps.children}\n </div>\n )}\n </>\n );\n});\n"],"names":[],"version":3,"file":"ListBox.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAwEM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAK9D,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAA0B,KAAsB,EAAE,GAAiC;IAC9J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE;IAEvB,uHAAuH;IACvH,4HAA4H;IAC5H,qGAAqG;IACrG,wHAAwH;IACxH,kGAAkG;I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,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/ListBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent, ItemNode, LoaderNode, SectionNode} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, ListState, Node, Orientation, SelectionBehavior, UNSTABLE_useFilteredListState, useListState} from 'react-stately';\nimport {filterDOMProps, inertValue, LoadMoreSentinelProps, useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './context';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the listbox is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the listbox is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the listbox is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the listbox.\n */\n state: ListState<unknown>\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' | 'label'>, CollectionProps<T>, StyleRenderProps<ListBoxRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * How multiple selection should behave in the collection.\n * @default \"toggle\"\n */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T extends object>(props: ListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>,\n props: ListBoxProps<T> & AriaListBoxOptions<T> & {filter?: SelectableCollectionContextValue<T>['filter']},\n listBoxRef: RefObject<HTMLElement | null>\n}\n\nfunction ListBoxInner<T extends object>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) {\n [props, listBoxRef] = useContextProps(props, listBoxRef, SelectableCollectionContext);\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical', filter} = props;\n let state = UNSTABLE_useFilteredListState(inputState, filter);\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot} = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(() => (\n props.keyboardDelegate || new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n })\n ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout, layoutDelegate]);\n\n let {listBoxProps} = useListBox({\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n }, state, listBoxRef);\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {orientation, layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, listBoxRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (isEmpty && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection?.collectionProps)}\n ref={listBoxRef as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={props.orientation || 'vertical'}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {}\n\nfunction ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection') {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: props.className,\n style: props.style,\n values: {}\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <section\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </HeaderContext.Provider>\n </section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent(SectionNode, ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function ListBoxItem<T extends object>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key}, dragState);\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, ref);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, optionProps, hoverProps, draggableItem?.dragProps, droppableItem?.dropProps)}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} ref={ref} />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n ...otherProps\n } = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...dropIndicatorProps}\n {...renderProps}\n // eslint-disable-next-line\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined} />\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n\nexport interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode,\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean\n}\n\nexport const ListBoxLoadMoreItem = createLeafComponent(LoaderNode, function ListBoxLoadingIndicator(props: ListBoxLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {\n let state = useContext(ListStateContext)!;\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(() => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }), [onLoadMore, scrollOffset, state?.collection]);\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-ListBoxLoadingIndicator',\n values: null\n });\n\n let optionProps = {\n // For Android talkback\n tabIndex: -1\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n };\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >\n <div data-testid=\"loadMoreSentinel\" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />\n </div>\n {isLoading && renderProps.children && (\n <div\n {...mergeProps(filterDOMProps(props, {global: true}), optionProps)}\n {...renderProps}\n // aria-selected isn't needed here since this option is not selectable.\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n role=\"option\"\n ref={ref as ForwardedRef<HTMLDivElement>}>\n {renderProps.children}\n </div>\n )}\n </>\n );\n});\n"],"names":[],"version":3,"file":"ListBox.main.js.map"}
package/dist/ListBox.mjs CHANGED
@@ -2,13 +2,13 @@ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5,
2
2
  import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8} from "./utils.mjs";
3
3
  import {DragAndDropContext as $612b8eb6cb90e02d$export$d188a835a7bc5783, DropIndicatorContext as $612b8eb6cb90e02d$export$f55761759794cf55, useDndPersistedKeys as $612b8eb6cb90e02d$export$d1e8e3fbb7461f6, useRenderDropIndicator as $612b8eb6cb90e02d$export$971707d8a129a1f7} from "./DragAndDrop.mjs";
4
4
  import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.mjs";
5
+ import {SelectableCollectionContext as $8e6cc465cc68f603$export$b0d3ecf7112093a7} from "./context.mjs";
5
6
  import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.mjs";
6
7
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
7
- import {UNSTABLE_InternalAutocompleteContext as $d2f53cda644affe3$export$65d2a03b8800d6e3} from "./Autocomplete.mjs";
8
8
  import {useLocale as $e8Bmu$useLocale, useCollator as $e8Bmu$useCollator, ListKeyboardDelegate as $e8Bmu$ListKeyboardDelegate, useListBox as $e8Bmu$useListBox, useFocusRing as $e8Bmu$useFocusRing, FocusScope as $e8Bmu$FocusScope, mergeProps as $e8Bmu$mergeProps, useListBoxSection as $e8Bmu$useListBoxSection, useOption as $e8Bmu$useOption, useHover as $e8Bmu$useHover} from "react-aria";
9
- import {CollectionBuilder as $e8Bmu$CollectionBuilder, Collection as $e8Bmu$Collection, createBranchComponent as $e8Bmu$createBranchComponent, createLeafComponent as $e8Bmu$createLeafComponent} from "@react-aria/collections";
9
+ import {CollectionBuilder as $e8Bmu$CollectionBuilder, Collection as $e8Bmu$Collection, createBranchComponent as $e8Bmu$createBranchComponent, SectionNode as $e8Bmu$SectionNode, createLeafComponent as $e8Bmu$createLeafComponent, ItemNode as $e8Bmu$ItemNode, LoaderNode as $e8Bmu$LoaderNode} from "@react-aria/collections";
10
10
  import {useListState as $e8Bmu$useListState, UNSTABLE_useFilteredListState as $e8Bmu$UNSTABLE_useFilteredListState} from "react-stately";
11
- import {useObjectRef as $e8Bmu$useObjectRef, mergeRefs as $e8Bmu$mergeRefs, filterDOMProps as $e8Bmu$filterDOMProps, UNSTABLE_useLoadMoreSentinel as $e8Bmu$UNSTABLE_useLoadMoreSentinel, inertValue as $e8Bmu$inertValue} from "@react-aria/utils";
11
+ import {filterDOMProps as $e8Bmu$filterDOMProps, useObjectRef as $e8Bmu$useObjectRef, useLoadMoreSentinel as $e8Bmu$useLoadMoreSentinel, inertValue as $e8Bmu$inertValue} from "@react-aria/utils";
12
12
  import $e8Bmu$react, {createContext as $e8Bmu$createContext, forwardRef as $e8Bmu$forwardRef, useContext as $e8Bmu$useContext, useMemo as $e8Bmu$useMemo, useRef as $e8Bmu$useRef, useEffect as $e8Bmu$useEffect} from "react";
13
13
 
14
14
  /*
@@ -75,21 +75,8 @@ function $eed445e0843c11d0$var$StandaloneListBox({ props: props, listBoxRef: lis
75
75
  });
76
76
  }
77
77
  function $eed445e0843c11d0$var$ListBoxInner({ state: inputState, props: props, listBoxRef: listBoxRef }) {
78
- var _state_collection_getItem;
79
- let { filter: filter, collectionProps: collectionProps, collectionRef: collectionRef } = (0, $e8Bmu$useContext)((0, $d2f53cda644affe3$export$65d2a03b8800d6e3)) || {};
80
- props = (0, $e8Bmu$useMemo)(()=>collectionProps ? {
81
- ...props,
82
- ...collectionProps
83
- } : props, [
84
- props,
85
- collectionProps
86
- ]);
87
- let { dragAndDropHooks: dragAndDropHooks, layout: layout = 'stack', orientation: orientation = 'vertical' } = props;
88
- // Memoed so that useAutocomplete callback ref is properly only called once on mount and not everytime a rerender happens
89
- listBoxRef = (0, $e8Bmu$useObjectRef)((0, $e8Bmu$useMemo)(()=>(0, $e8Bmu$mergeRefs)(listBoxRef, collectionRef !== undefined ? collectionRef : null), [
90
- collectionRef,
91
- listBoxRef
92
- ]));
78
+ [props, listBoxRef] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, listBoxRef, (0, $8e6cc465cc68f603$export$b0d3ecf7112093a7));
79
+ let { dragAndDropHooks: dragAndDropHooks, layout: layout = 'stack', orientation: orientation = 'vertical', filter: filter } = props;
93
80
  let state = (0, $e8Bmu$UNSTABLE_useFilteredListState)(inputState, filter);
94
81
  let { collection: collection, selectionManager: selectionManager } = state;
95
82
  let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
@@ -176,7 +163,7 @@ function $eed445e0843c11d0$var$ListBoxInner({ state: inputState, props: props, l
176
163
  });
177
164
  }
178
165
  let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $e8Bmu$useFocusRing)();
179
- let isEmpty = state.collection.size === 0 || state.collection.size === 1 && ((_state_collection_getItem = state.collection.getItem(state.collection.getFirstKey())) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.type) === 'loader';
166
+ let isEmpty = state.collection.size === 0;
180
167
  let renderValues = {
181
168
  isDropTarget: isRootDropTarget,
182
169
  isEmpty: isEmpty,
@@ -199,10 +186,11 @@ function $eed445e0843c11d0$var$ListBoxInner({ state: inputState, props: props, l
199
186
  display: 'contents'
200
187
  }
201
188
  }, props.renderEmptyState(renderValues));
189
+ let DOMProps = (0, $e8Bmu$filterDOMProps)(props, {
190
+ global: true
191
+ });
202
192
  return /*#__PURE__*/ (0, $e8Bmu$react).createElement((0, $e8Bmu$FocusScope), null, /*#__PURE__*/ (0, $e8Bmu$react).createElement("div", {
203
- ...(0, $e8Bmu$filterDOMProps)(props),
204
- ...(0, $e8Bmu$mergeProps)(listBoxProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
205
- ...renderProps,
193
+ ...(0, $e8Bmu$mergeProps)(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
206
194
  ref: listBoxRef,
207
195
  slot: props.slot || undefined,
208
196
  onScroll: props.onScroll,
@@ -273,10 +261,12 @@ function $eed445e0843c11d0$var$ListBoxSectionInner(props, ref, section, classNam
273
261
  style: props.style,
274
262
  values: {}
275
263
  });
264
+ let DOMProps = (0, $e8Bmu$filterDOMProps)(props, {
265
+ global: true
266
+ });
267
+ delete DOMProps.id;
276
268
  return /*#__PURE__*/ (0, $e8Bmu$react).createElement("section", {
277
- ...(0, $e8Bmu$filterDOMProps)(props),
278
- ...groupProps,
279
- ...renderProps,
269
+ ...(0, $e8Bmu$mergeProps)(DOMProps, renderProps, groupProps),
280
270
  ref: ref
281
271
  }, /*#__PURE__*/ (0, $e8Bmu$react).createElement((0, $72a5793c14baf454$export$e0e4026c12a8bdbb).Provider, {
282
272
  value: {
@@ -289,8 +279,8 @@ function $eed445e0843c11d0$var$ListBoxSectionInner(props, ref, section, classNam
289
279
  renderDropIndicator: (0, $612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
290
280
  })));
291
281
  }
292
- const $eed445e0843c11d0$export$dca12b0bb56e4fc = /*#__PURE__*/ (0, $e8Bmu$createBranchComponent)('section', $eed445e0843c11d0$var$ListBoxSectionInner);
293
- const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$createLeafComponent)('item', function ListBoxItem(props, forwardedRef, item) {
282
+ const $eed445e0843c11d0$export$dca12b0bb56e4fc = /*#__PURE__*/ (0, $e8Bmu$createBranchComponent)((0, $e8Bmu$SectionNode), $eed445e0843c11d0$var$ListBoxSectionInner);
283
+ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$createLeafComponent)((0, $e8Bmu$ItemNode), function ListBoxItem(props, forwardedRef, item) {
294
284
  let ref = (0, $e8Bmu$useObjectRef)(forwardedRef);
295
285
  let state = (0, $e8Bmu$useContext)($eed445e0843c11d0$export$7c5906fe4f1f2af2);
296
286
  let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $e8Bmu$useContext)((0, $612b8eb6cb90e02d$export$d188a835a7bc5783));
@@ -338,9 +328,13 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$create
338
328
  item.textValue
339
329
  ]);
340
330
  let ElementType = props.href ? 'a' : 'div';
331
+ let DOMProps = (0, $e8Bmu$filterDOMProps)(props, {
332
+ global: true
333
+ });
334
+ delete DOMProps.id;
335
+ delete DOMProps.onClick;
341
336
  return /*#__PURE__*/ (0, $e8Bmu$react).createElement(ElementType, {
342
- ...(0, $e8Bmu$mergeProps)(optionProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
343
- ...renderProps,
337
+ ...(0, $e8Bmu$mergeProps)(DOMProps, renderProps, optionProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
344
338
  ref: ref,
345
339
  "data-allows-dragging": !!dragState || undefined,
346
340
  "data-selected": states.isSelected || undefined,
@@ -398,9 +392,8 @@ function $eed445e0843c11d0$var$ListBoxDropIndicator(props, ref) {
398
392
  });
399
393
  }
400
394
  const $eed445e0843c11d0$var$ListBoxDropIndicatorForwardRef = /*#__PURE__*/ (0, $e8Bmu$forwardRef)($eed445e0843c11d0$var$ListBoxDropIndicator);
401
- const $eed445e0843c11d0$export$e59f0e608576589b = (0, $e8Bmu$createLeafComponent)('loader', function ListBoxLoadingIndicator(props, ref, item) {
395
+ const $eed445e0843c11d0$export$8e6d031a08cf56a1 = (0, $e8Bmu$createLeafComponent)((0, $e8Bmu$LoaderNode), function ListBoxLoadingIndicator(props, ref, item) {
402
396
  let state = (0, $e8Bmu$useContext)($eed445e0843c11d0$export$7c5906fe4f1f2af2);
403
- let { isVirtualized: isVirtualized } = (0, $e8Bmu$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
404
397
  let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
405
398
  let sentinelRef = (0, $e8Bmu$useRef)(null);
406
399
  let memoedLoadMoreProps = (0, $e8Bmu$useMemo)(()=>({
@@ -413,7 +406,7 @@ const $eed445e0843c11d0$export$e59f0e608576589b = (0, $e8Bmu$createLeafComponent
413
406
  scrollOffset,
414
407
  state === null || state === void 0 ? void 0 : state.collection
415
408
  ]);
416
- (0, $e8Bmu$UNSTABLE_useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
409
+ (0, $e8Bmu$useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
417
410
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
418
411
  ...otherProps,
419
412
  id: undefined,
@@ -425,10 +418,6 @@ const $eed445e0843c11d0$export$e59f0e608576589b = (0, $e8Bmu$createLeafComponent
425
418
  // For Android talkback
426
419
  tabIndex: -1
427
420
  };
428
- if (isVirtualized) {
429
- optionProps['aria-posinset'] = item.index + 1;
430
- optionProps['aria-setsize'] = state.collection.size;
431
- }
432
421
  return /*#__PURE__*/ (0, $e8Bmu$react).createElement((0, $e8Bmu$react).Fragment, null, /*#__PURE__*/ (0, $e8Bmu$react).createElement("div", {
433
422
  style: {
434
423
  position: 'relative',
@@ -445,7 +434,9 @@ const $eed445e0843c11d0$export$e59f0e608576589b = (0, $e8Bmu$createLeafComponent
445
434
  width: 1
446
435
  }
447
436
  })), isLoading && renderProps.children && /*#__PURE__*/ (0, $e8Bmu$react).createElement("div", {
448
- ...(0, $e8Bmu$mergeProps)((0, $e8Bmu$filterDOMProps)(props), optionProps),
437
+ ...(0, $e8Bmu$mergeProps)((0, $e8Bmu$filterDOMProps)(props, {
438
+ global: true
439
+ }), optionProps),
449
440
  ...renderProps,
450
441
  // aria-selected isn't needed here since this option is not selectable.
451
442
  // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
@@ -455,5 +446,5 @@ const $eed445e0843c11d0$export$e59f0e608576589b = (0, $e8Bmu$createLeafComponent
455
446
  });
456
447
 
457
448
 
458
- export {$eed445e0843c11d0$export$7ff8f37d2d81a48d as ListBoxContext, $eed445e0843c11d0$export$7c5906fe4f1f2af2 as ListStateContext, $eed445e0843c11d0$export$41f133550aa26f48 as ListBox, $eed445e0843c11d0$export$dca12b0bb56e4fc as ListBoxSection, $eed445e0843c11d0$export$a11e76429ed99b4 as ListBoxItem, $eed445e0843c11d0$export$e59f0e608576589b as UNSTABLE_ListBoxLoadingSentinel};
449
+ export {$eed445e0843c11d0$export$7ff8f37d2d81a48d as ListBoxContext, $eed445e0843c11d0$export$7c5906fe4f1f2af2 as ListStateContext, $eed445e0843c11d0$export$41f133550aa26f48 as ListBox, $eed445e0843c11d0$export$dca12b0bb56e4fc as ListBoxSection, $eed445e0843c11d0$export$a11e76429ed99b4 as ListBoxItem, $eed445e0843c11d0$export$8e6d031a08cf56a1 as ListBoxLoadMoreItem};
459
450
  //# sourceMappingURL=ListBox.module.js.map