react-aria-components 1.13.0 → 1.14.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 (319) hide show
  1. package/dist/Autocomplete.main.js.map +1 -1
  2. package/dist/Autocomplete.module.js.map +1 -1
  3. package/dist/Breadcrumbs.main.js +5 -3
  4. package/dist/Breadcrumbs.main.js.map +1 -1
  5. package/dist/Breadcrumbs.mjs +5 -3
  6. package/dist/Breadcrumbs.module.js +5 -3
  7. package/dist/Breadcrumbs.module.js.map +1 -1
  8. package/dist/Button.main.js.map +1 -1
  9. package/dist/Button.module.js.map +1 -1
  10. package/dist/Calendar.main.js +2 -2
  11. package/dist/Calendar.main.js.map +1 -1
  12. package/dist/Calendar.mjs +2 -2
  13. package/dist/Calendar.module.js +2 -2
  14. package/dist/Calendar.module.js.map +1 -1
  15. package/dist/Checkbox.main.js.map +1 -1
  16. package/dist/Checkbox.module.js.map +1 -1
  17. package/dist/Collection.main.js +1 -1
  18. package/dist/Collection.main.js.map +1 -1
  19. package/dist/Collection.mjs +1 -1
  20. package/dist/Collection.module.js +1 -1
  21. package/dist/Collection.module.js.map +1 -1
  22. package/dist/ColorArea.main.js +1 -1
  23. package/dist/ColorArea.main.js.map +1 -1
  24. package/dist/ColorArea.mjs +1 -1
  25. package/dist/ColorArea.module.js +1 -1
  26. package/dist/ColorArea.module.js.map +1 -1
  27. package/dist/ColorField.main.js +1 -1
  28. package/dist/ColorField.main.js.map +1 -1
  29. package/dist/ColorField.mjs +1 -1
  30. package/dist/ColorField.module.js +1 -1
  31. package/dist/ColorField.module.js.map +1 -1
  32. package/dist/ColorPicker.main.js +1 -1
  33. package/dist/ColorPicker.main.js.map +1 -1
  34. package/dist/ColorPicker.mjs +1 -1
  35. package/dist/ColorPicker.module.js +1 -1
  36. package/dist/ColorPicker.module.js.map +1 -1
  37. package/dist/ColorSlider.main.js +1 -1
  38. package/dist/ColorSlider.main.js.map +1 -1
  39. package/dist/ColorSlider.mjs +1 -1
  40. package/dist/ColorSlider.module.js +1 -1
  41. package/dist/ColorSlider.module.js.map +1 -1
  42. package/dist/ColorSwatch.main.js.map +1 -1
  43. package/dist/ColorSwatch.module.js.map +1 -1
  44. package/dist/ColorSwatchPicker.main.js +1 -1
  45. package/dist/ColorSwatchPicker.main.js.map +1 -1
  46. package/dist/ColorSwatchPicker.mjs +1 -1
  47. package/dist/ColorSwatchPicker.module.js +1 -1
  48. package/dist/ColorSwatchPicker.module.js.map +1 -1
  49. package/dist/ColorThumb.main.js.map +1 -1
  50. package/dist/ColorThumb.module.js.map +1 -1
  51. package/dist/ColorWheel.main.js +1 -1
  52. package/dist/ColorWheel.main.js.map +1 -1
  53. package/dist/ColorWheel.mjs +1 -1
  54. package/dist/ColorWheel.module.js +1 -1
  55. package/dist/ColorWheel.module.js.map +1 -1
  56. package/dist/ComboBox.main.js.map +1 -1
  57. package/dist/ComboBox.module.js.map +1 -1
  58. package/dist/DateField.main.js +3 -1
  59. package/dist/DateField.main.js.map +1 -1
  60. package/dist/DateField.mjs +3 -1
  61. package/dist/DateField.module.js +3 -1
  62. package/dist/DateField.module.js.map +1 -1
  63. package/dist/DatePicker.main.js.map +1 -1
  64. package/dist/DatePicker.module.js.map +1 -1
  65. package/dist/Dialog.main.js.map +1 -1
  66. package/dist/Dialog.module.js.map +1 -1
  67. package/dist/Disclosure.main.js +2 -1
  68. package/dist/Disclosure.main.js.map +1 -1
  69. package/dist/Disclosure.mjs +2 -1
  70. package/dist/Disclosure.module.js +2 -1
  71. package/dist/Disclosure.module.js.map +1 -1
  72. package/dist/DragAndDrop.main.js.map +1 -1
  73. package/dist/DragAndDrop.module.js.map +1 -1
  74. package/dist/DropZone.main.js.map +1 -1
  75. package/dist/DropZone.module.js.map +1 -1
  76. package/dist/FieldError.main.js.map +1 -1
  77. package/dist/FieldError.module.js.map +1 -1
  78. package/dist/FileTrigger.main.js +1 -0
  79. package/dist/FileTrigger.main.js.map +1 -1
  80. package/dist/FileTrigger.mjs +1 -0
  81. package/dist/FileTrigger.module.js +1 -0
  82. package/dist/FileTrigger.module.js.map +1 -1
  83. package/dist/Form.main.js.map +1 -1
  84. package/dist/Form.module.js.map +1 -1
  85. package/dist/GridList.main.js +1 -1
  86. package/dist/GridList.main.js.map +1 -1
  87. package/dist/GridList.mjs +1 -1
  88. package/dist/GridList.module.js +1 -1
  89. package/dist/GridList.module.js.map +1 -1
  90. package/dist/Group.main.js +2 -2
  91. package/dist/Group.main.js.map +1 -1
  92. package/dist/Group.mjs +2 -2
  93. package/dist/Group.module.js +2 -2
  94. package/dist/Group.module.js.map +1 -1
  95. package/dist/HiddenDateInput.main.js +5 -3
  96. package/dist/HiddenDateInput.main.js.map +1 -1
  97. package/dist/HiddenDateInput.mjs +5 -3
  98. package/dist/HiddenDateInput.module.js +5 -3
  99. package/dist/HiddenDateInput.module.js.map +1 -1
  100. package/dist/Input.main.js +4 -1
  101. package/dist/Input.main.js.map +1 -1
  102. package/dist/Input.mjs +4 -1
  103. package/dist/Input.module.js +4 -1
  104. package/dist/Input.module.js.map +1 -1
  105. package/dist/Link.main.js.map +1 -1
  106. package/dist/Link.module.js.map +1 -1
  107. package/dist/ListBox.main.js +6 -3
  108. package/dist/ListBox.main.js.map +1 -1
  109. package/dist/ListBox.mjs +7 -4
  110. package/dist/ListBox.module.js +7 -4
  111. package/dist/ListBox.module.js.map +1 -1
  112. package/dist/Menu.main.js +1 -1
  113. package/dist/Menu.main.js.map +1 -1
  114. package/dist/Menu.mjs +1 -1
  115. package/dist/Menu.module.js +1 -1
  116. package/dist/Menu.module.js.map +1 -1
  117. package/dist/Meter.main.js.map +1 -1
  118. package/dist/Meter.module.js.map +1 -1
  119. package/dist/Modal.main.js.map +1 -1
  120. package/dist/Modal.module.js.map +1 -1
  121. package/dist/NumberField.main.js.map +1 -1
  122. package/dist/NumberField.module.js.map +1 -1
  123. package/dist/OverlayArrow.main.js.map +1 -1
  124. package/dist/OverlayArrow.module.js.map +1 -1
  125. package/dist/Popover.main.js.map +1 -1
  126. package/dist/Popover.module.js.map +1 -1
  127. package/dist/ProgressBar.main.js.map +1 -1
  128. package/dist/ProgressBar.module.js.map +1 -1
  129. package/dist/RadioGroup.main.js.map +1 -1
  130. package/dist/RadioGroup.module.js.map +1 -1
  131. package/dist/SearchField.main.js +5 -1
  132. package/dist/SearchField.main.js.map +1 -1
  133. package/dist/SearchField.mjs +5 -1
  134. package/dist/SearchField.module.js +5 -1
  135. package/dist/SearchField.module.js.map +1 -1
  136. package/dist/Select.main.js.map +1 -1
  137. package/dist/Select.module.js.map +1 -1
  138. package/dist/SelectionIndicator.main.js.map +1 -1
  139. package/dist/SelectionIndicator.module.js.map +1 -1
  140. package/dist/Separator.main.js.map +1 -1
  141. package/dist/Separator.module.js.map +1 -1
  142. package/dist/Slider.main.js.map +1 -1
  143. package/dist/Slider.module.js.map +1 -1
  144. package/dist/Switch.main.js.map +1 -1
  145. package/dist/Switch.module.js.map +1 -1
  146. package/dist/Table.main.js +126 -42
  147. package/dist/Table.main.js.map +1 -1
  148. package/dist/Table.mjs +126 -42
  149. package/dist/Table.module.js +126 -42
  150. package/dist/Table.module.js.map +1 -1
  151. package/dist/Tabs.main.js +75 -6
  152. package/dist/Tabs.main.js.map +1 -1
  153. package/dist/Tabs.mjs +77 -9
  154. package/dist/Tabs.module.js +77 -9
  155. package/dist/Tabs.module.js.map +1 -1
  156. package/dist/TagGroup.main.js +1 -1
  157. package/dist/TagGroup.main.js.map +1 -1
  158. package/dist/TagGroup.mjs +1 -1
  159. package/dist/TagGroup.module.js +1 -1
  160. package/dist/TagGroup.module.js.map +1 -1
  161. package/dist/TextArea.main.js.map +1 -1
  162. package/dist/TextArea.module.js.map +1 -1
  163. package/dist/TextField.main.js.map +1 -1
  164. package/dist/TextField.module.js.map +1 -1
  165. package/dist/Toast.main.js.map +1 -1
  166. package/dist/Toast.module.js.map +1 -1
  167. package/dist/ToggleButton.main.js.map +1 -1
  168. package/dist/ToggleButton.module.js.map +1 -1
  169. package/dist/ToggleButtonGroup.main.js +1 -0
  170. package/dist/ToggleButtonGroup.main.js.map +1 -1
  171. package/dist/ToggleButtonGroup.mjs +1 -0
  172. package/dist/ToggleButtonGroup.module.js +1 -0
  173. package/dist/ToggleButtonGroup.module.js.map +1 -1
  174. package/dist/Toolbar.main.js.map +1 -1
  175. package/dist/Toolbar.module.js.map +1 -1
  176. package/dist/Tooltip.main.js.map +1 -1
  177. package/dist/Tooltip.module.js.map +1 -1
  178. package/dist/Tree.main.js.map +1 -1
  179. package/dist/Tree.module.js.map +1 -1
  180. package/dist/import.mjs +4 -4
  181. package/dist/main.js +5 -0
  182. package/dist/main.js.map +1 -1
  183. package/dist/module.js +4 -4
  184. package/dist/module.js.map +1 -1
  185. package/dist/types.d.ts +565 -35
  186. package/dist/types.d.ts.map +1 -1
  187. package/dist/utils.main.js +0 -1
  188. package/dist/utils.main.js.map +1 -1
  189. package/dist/utils.mjs +0 -1
  190. package/dist/utils.module.js +0 -1
  191. package/dist/utils.module.js.map +1 -1
  192. package/i18n/ar-AE.js +1 -1
  193. package/i18n/ar-AE.mjs +1 -1
  194. package/i18n/bg-BG.js +1 -1
  195. package/i18n/bg-BG.mjs +1 -1
  196. package/i18n/cs-CZ.js +1 -1
  197. package/i18n/cs-CZ.mjs +1 -1
  198. package/i18n/da-DK.js +1 -1
  199. package/i18n/da-DK.mjs +1 -1
  200. package/i18n/de-DE.js +1 -1
  201. package/i18n/de-DE.mjs +1 -1
  202. package/i18n/el-GR.js +1 -1
  203. package/i18n/el-GR.mjs +1 -1
  204. package/i18n/en-US.js +1 -1
  205. package/i18n/en-US.mjs +1 -1
  206. package/i18n/es-ES.js +1 -1
  207. package/i18n/es-ES.mjs +1 -1
  208. package/i18n/et-EE.js +1 -1
  209. package/i18n/et-EE.mjs +1 -1
  210. package/i18n/fi-FI.js +1 -1
  211. package/i18n/fi-FI.mjs +1 -1
  212. package/i18n/fr-FR.js +1 -1
  213. package/i18n/fr-FR.mjs +1 -1
  214. package/i18n/he-IL.js +1 -1
  215. package/i18n/he-IL.mjs +1 -1
  216. package/i18n/hr-HR.js +1 -1
  217. package/i18n/hr-HR.mjs +1 -1
  218. package/i18n/hu-HU.js +1 -1
  219. package/i18n/hu-HU.mjs +1 -1
  220. package/i18n/index.js +67 -67
  221. package/i18n/index.mjs +67 -67
  222. package/i18n/it-IT.js +1 -1
  223. package/i18n/it-IT.mjs +1 -1
  224. package/i18n/ja-JP.js +1 -1
  225. package/i18n/ja-JP.mjs +1 -1
  226. package/i18n/ko-KR.js +1 -1
  227. package/i18n/ko-KR.mjs +1 -1
  228. package/i18n/lt-LT.js +1 -1
  229. package/i18n/lt-LT.mjs +1 -1
  230. package/i18n/lv-LV.js +1 -1
  231. package/i18n/lv-LV.mjs +1 -1
  232. package/i18n/nb-NO.js +1 -1
  233. package/i18n/nb-NO.mjs +1 -1
  234. package/i18n/nl-NL.js +1 -1
  235. package/i18n/nl-NL.mjs +1 -1
  236. package/i18n/pl-PL.js +1 -1
  237. package/i18n/pl-PL.mjs +1 -1
  238. package/i18n/pt-BR.js +1 -1
  239. package/i18n/pt-BR.mjs +1 -1
  240. package/i18n/pt-PT.js +1 -1
  241. package/i18n/pt-PT.mjs +1 -1
  242. package/i18n/ro-RO.js +1 -1
  243. package/i18n/ro-RO.mjs +1 -1
  244. package/i18n/ru-RU.js +1 -1
  245. package/i18n/ru-RU.mjs +1 -1
  246. package/i18n/sk-SK.js +1 -1
  247. package/i18n/sk-SK.mjs +1 -1
  248. package/i18n/sl-SI.js +1 -1
  249. package/i18n/sl-SI.mjs +1 -1
  250. package/i18n/sr-SP.js +1 -1
  251. package/i18n/sr-SP.mjs +1 -1
  252. package/i18n/sv-SE.js +1 -1
  253. package/i18n/sv-SE.mjs +1 -1
  254. package/i18n/tr-TR.js +1 -1
  255. package/i18n/tr-TR.mjs +1 -1
  256. package/i18n/uk-UA.js +1 -1
  257. package/i18n/uk-UA.mjs +1 -1
  258. package/i18n/zh-CN.js +1 -1
  259. package/i18n/zh-CN.mjs +1 -1
  260. package/i18n/zh-TW.js +1 -1
  261. package/i18n/zh-TW.mjs +1 -1
  262. package/package.json +20 -20
  263. package/src/Autocomplete.tsx +1 -1
  264. package/src/Breadcrumbs.tsx +25 -6
  265. package/src/Button.tsx +6 -0
  266. package/src/Calendar.tsx +51 -6
  267. package/src/Checkbox.tsx +25 -2
  268. package/src/Collection.tsx +1 -1
  269. package/src/ColorArea.tsx +15 -2
  270. package/src/ColorField.tsx +16 -1
  271. package/src/ColorPicker.tsx +5 -2
  272. package/src/ColorSlider.tsx +16 -2
  273. package/src/ColorSwatch.tsx +15 -2
  274. package/src/ColorSwatchPicker.tsx +18 -1
  275. package/src/ColorThumb.tsx +8 -2
  276. package/src/ColorWheel.tsx +24 -3
  277. package/src/ComboBox.tsx +18 -1
  278. package/src/DateField.tsx +40 -5
  279. package/src/DatePicker.tsx +27 -3
  280. package/src/Dialog.tsx +5 -0
  281. package/src/Disclosure.tsx +30 -5
  282. package/src/DragAndDrop.tsx +8 -2
  283. package/src/DropZone.tsx +16 -2
  284. package/src/FieldError.tsx +8 -2
  285. package/src/FileTrigger.tsx +1 -0
  286. package/src/Form.tsx +5 -0
  287. package/src/GridList.tsx +34 -2
  288. package/src/Group.tsx +29 -18
  289. package/src/HiddenDateInput.tsx +6 -4
  290. package/src/Input.tsx +21 -7
  291. package/src/Link.tsx +15 -2
  292. package/src/ListBox.tsx +46 -7
  293. package/src/Menu.tsx +30 -2
  294. package/src/Meter.tsx +16 -2
  295. package/src/Modal.tsx +19 -1
  296. package/src/NumberField.tsx +20 -2
  297. package/src/OverlayArrow.tsx +14 -2
  298. package/src/Popover.tsx +13 -1
  299. package/src/ProgressBar.tsx +16 -2
  300. package/src/RadioGroup.tsx +25 -2
  301. package/src/SearchField.tsx +35 -3
  302. package/src/Select.tsx +25 -2
  303. package/src/SelectionIndicator.tsx +8 -2
  304. package/src/Separator.tsx +10 -1
  305. package/src/Slider.tsx +35 -3
  306. package/src/Switch.tsx +18 -5
  307. package/src/Table.tsx +187 -67
  308. package/src/Tabs.tsx +150 -13
  309. package/src/TagGroup.tsx +29 -2
  310. package/src/TextArea.tsx +14 -2
  311. package/src/TextField.tsx +19 -1
  312. package/src/Toast.tsx +22 -2
  313. package/src/ToggleButton.tsx +13 -1
  314. package/src/ToggleButtonGroup.tsx +22 -3
  315. package/src/Toolbar.tsx +13 -1
  316. package/src/Tooltip.tsx +13 -1
  317. package/src/Tree.tsx +62 -33
  318. package/src/index.ts +7 -7
  319. package/src/utils.tsx +1 -2
@@ -77,12 +77,14 @@ function $c699643d2073b351$export$f6a685cd1acbd1fa(props, state) {
77
77
  if (state.granularity === 'day') targetValue = (0, $62z4d$parseDate)(targetString);
78
78
  // We check to to see if setSegment exists in the state since it only exists in DateFieldState and not DatePickerState.
79
79
  // The setValue method has different behavior depending on if it's coming from DateFieldState or DatePickerState.
80
- // In DateFieldState, setValue firsts checks to make sure that each segment is filled before committing the newValue
81
- // which is why in the code below we first set each segment to validate it before committing the new value.
82
- // However, in DatePickerState, since we have to be able to commit values from the Calendar popover, we are also able to
80
+ // In DateFieldState, setValue firsts checks to make sure that each segment is filled before committing the newValue
81
+ // which is why in the code below we first set each segment to validate it before committing the new value.
82
+ // However, in DatePickerState, since we have to be able to commit values from the Calendar popover, we are also able to
83
83
  // set a new value when the field itself is empty.
84
84
  if ('setSegment' in state) for(let type in targetValue){
85
+ // eslint-disable-next-line max-depth
85
86
  if ($c699643d2073b351$var$dateSegments.includes(type)) state.setSegment(type, targetValue[type]);
87
+ // eslint-disable-next-line max-depth
86
88
  if (timeSegments.includes(type)) state.setSegment(type, targetValue[type]);
87
89
  }
88
90
  state.setValue(targetValue);
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAiCD,MAAM,qCAAe;IAAC;IAAO;IAAS;CAAO;AAC7C,MAAM,uCAAiB;IAAC,QAAQ;IAAG,UAAU;IAAG,UAAU;AAAC;AAEpD,SAAS,0CAAmB,KAA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IAAI,QAAQ,YAAa;wBAC5B,IAAI,mCAAa,QAAQ,CAAC,OACxB,MAAM,UAAU,CAAC,MAAyB,WAAW,CAAC,KAAK;wBAE7D,IAAI,aAAa,QAAQ,CAAC,OACxB,MAAM,UAAU,CAAC,MAAyB,WAAW,CAAC,KAAK;oBAE/D;oBAEF,MAAM,QAAQ,CAAC;gBACjB,EAAE,OAAM;gBACN,SAAS;gBACX;YAEJ;QACF;IACF;AACF;AAEO,SAAS,0CAAgB,KAA2B;IACzD,IAAI,SAAC,KAAK,EAAC,GAAG;IACd,IAAI,kBAAC,cAAc,cAAE,UAAU,EAAC,GAAG,0CAAmB;QAAC,GAAG,KAAK;IAAA,GAAG;IAClE,qBACE,gCAAC;QAAK,GAAG,cAAc;QAAE,eAAY;qBACnC,gCAAC,SAAU;AAGjB","sources":["packages/react-aria-components/src/HiddenDateInput.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n\nimport {CalendarDate, CalendarDateTime, parseDate, parseDateTime} from '@internationalized/date';\nimport {DateFieldState, DatePickerState, DateSegmentType} from 'react-stately';\nimport React, {ReactNode} from 'react';\nimport {useVisuallyHidden} from 'react-aria';\n\ninterface AriaHiddenDateInputProps {\n /**\n * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).\n */\n autoComplete?: string,\n /** HTML form input name. */\n name?: string,\n /** Sets the disabled state of the input. */\n isDisabled?: boolean\n}\n\ninterface HiddenDateInputProps extends AriaHiddenDateInputProps {\n /**\n * State for the input.\n */\n state: DateFieldState | DatePickerState\n}\n\nexport interface HiddenDateAria {\n /** Props for the container element. */\n containerProps: React.HTMLAttributes<HTMLDivElement>,\n /** Props for the hidden input element. */\n inputProps: React.InputHTMLAttributes<HTMLInputElement>\n}\n\nconst dateSegments = ['day', 'month', 'year'];\nconst granularityMap = {'hour': 1, 'minute': 2, 'second': 3};\n\nexport function useHiddenDateInput(props: HiddenDateInputProps, state: DateFieldState | DatePickerState) : HiddenDateAria {\n let {\n autoComplete,\n isDisabled,\n name\n } = props;\n let {visuallyHiddenProps} = useVisuallyHidden({\n style: {\n // Prevent page scrolling.\n position: 'fixed',\n top: 0,\n left: 0\n }\n });\n\n let inputStep = 60;\n if (state.granularity === 'second') {\n inputStep = 1;\n } else if (state.granularity === 'hour') {\n inputStep = 3600; \n }\n\n let dateValue = state.value == null ? '' : state.value.toString();\n\n let inputType = state.granularity === 'day' ? 'date' : 'datetime-local';\n\n let timeSegments = ['hour', 'minute', 'second'];\n // Depending on the granularity, we only want to validate certain time segments\n let end = 0;\n if (timeSegments.includes(state.granularity)) {\n end = granularityMap[state.granularity];\n timeSegments = timeSegments.slice(0, end);\n }\n\n return {\n containerProps: {\n ...visuallyHiddenProps,\n 'aria-hidden': true,\n // @ts-ignore\n ['data-react-aria-prevent-focus']: true,\n // @ts-ignore\n ['data-a11y-ignore']: 'aria-hidden-focus'\n },\n inputProps: {\n tabIndex: -1,\n autoComplete,\n disabled: isDisabled,\n type: inputType,\n // We set the form prop to an empty string to prevent the hidden date input's value from being submitted\n form: '',\n name,\n step: inputStep,\n value: dateValue,\n onChange: (e) => {\n let targetString = e.target.value.toString();\n if (targetString) {\n try {\n let targetValue: CalendarDateTime | CalendarDate = parseDateTime(targetString);\n if (state.granularity === 'day') {\n targetValue = parseDate(targetString);\n }\n // We check to to see if setSegment exists in the state since it only exists in DateFieldState and not DatePickerState.\n // The setValue method has different behavior depending on if it's coming from DateFieldState or DatePickerState.\n // In DateFieldState, setValue firsts checks to make sure that each segment is filled before committing the newValue \n // which is why in the code below we first set each segment to validate it before committing the new value. \n // However, in DatePickerState, since we have to be able to commit values from the Calendar popover, we are also able to \n // set a new value when the field itself is empty.\n if ('setSegment' in state) {\n for (let type in targetValue) {\n if (dateSegments.includes(type)) {\n state.setSegment(type as DateSegmentType, targetValue[type]);\n }\n if (timeSegments.includes(type)) {\n state.setSegment(type as DateSegmentType, targetValue[type]);\n }\n }\n }\n state.setValue(targetValue);\n } catch {\n // ignore\n }\n }\n }\n }\n };\n}\n\nexport function HiddenDateInput(props: HiddenDateInputProps): ReactNode | null {\n let {state} = props;\n let {containerProps, inputProps} = useHiddenDateInput({...props}, state);\n return (\n <div {...containerProps} data-testid=\"hidden-dateinput-container\">\n <input {...inputProps} />\n </div>\n );\n}\n"],"names":[],"version":3,"file":"HiddenDateInput.module.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAiCD,MAAM,qCAAe;IAAC;IAAO;IAAS;CAAO;AAC7C,MAAM,uCAAiB;IAAC,QAAQ;IAAG,UAAU;IAAG,UAAU;AAAC;AAEpD,SAAS,0CAAmB,KAA2B,EAAE,KAAuC;IACrG,IAAI,gBACF,YAAY,cACZ,UAAU,QACV,IAAI,EACL,GAAG;IACJ,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAC5C,OAAO;YACL,0BAA0B;YAC1B,UAAU;YACV,KAAK;YACL,MAAM;QACR;IACF;IAEA,IAAI,YAAY;IAChB,IAAI,MAAM,WAAW,KAAK,UACxB,YAAY;SACP,IAAI,MAAM,WAAW,KAAK,QAC/B,YAAY;IAGd,IAAI,YAAY,MAAM,KAAK,IAAI,OAAO,KAAK,MAAM,KAAK,CAAC,QAAQ;IAE/D,IAAI,YAAY,MAAM,WAAW,KAAK,QAAQ,SAAS;IAEvD,IAAI,eAAe;QAAC;QAAQ;QAAU;KAAS;IAC/C,+EAA+E;IAC/E,IAAI,MAAM;IACV,IAAI,aAAa,Q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jB","sources":["packages/react-aria-components/src/HiddenDateInput.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n\nimport {CalendarDate, CalendarDateTime, parseDate, parseDateTime} from '@internationalized/date';\nimport {DateFieldState, DatePickerState, DateSegmentType} from 'react-stately';\nimport React, {ReactNode} from 'react';\nimport {useVisuallyHidden} from 'react-aria';\n\ninterface AriaHiddenDateInputProps {\n /**\n * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).\n */\n autoComplete?: string,\n /** HTML form input name. */\n name?: string,\n /** Sets the disabled state of the input. */\n isDisabled?: boolean\n}\n\ninterface HiddenDateInputProps extends AriaHiddenDateInputProps {\n /**\n * State for the input.\n */\n state: DateFieldState | DatePickerState\n}\n\nexport interface HiddenDateAria {\n /** Props for the container element. */\n containerProps: React.HTMLAttributes<HTMLDivElement>,\n /** Props for the hidden input element. */\n inputProps: React.InputHTMLAttributes<HTMLInputElement>\n}\n\nconst dateSegments = ['day', 'month', 'year'];\nconst granularityMap = {'hour': 1, 'minute': 2, 'second': 3};\n\nexport function useHiddenDateInput(props: HiddenDateInputProps, state: DateFieldState | DatePickerState) : HiddenDateAria {\n let {\n autoComplete,\n isDisabled,\n name\n } = props;\n let {visuallyHiddenProps} = useVisuallyHidden({\n style: {\n // Prevent page scrolling.\n position: 'fixed',\n top: 0,\n left: 0\n }\n });\n\n let inputStep = 60;\n if (state.granularity === 'second') {\n inputStep = 1;\n } else if (state.granularity === 'hour') {\n inputStep = 3600;\n }\n\n let dateValue = state.value == null ? '' : state.value.toString();\n\n let inputType = state.granularity === 'day' ? 'date' : 'datetime-local';\n\n let timeSegments = ['hour', 'minute', 'second'];\n // Depending on the granularity, we only want to validate certain time segments\n let end = 0;\n if (timeSegments.includes(state.granularity)) {\n end = granularityMap[state.granularity];\n timeSegments = timeSegments.slice(0, end);\n }\n\n return {\n containerProps: {\n ...visuallyHiddenProps,\n 'aria-hidden': true,\n // @ts-ignore\n ['data-react-aria-prevent-focus']: true,\n // @ts-ignore\n ['data-a11y-ignore']: 'aria-hidden-focus'\n },\n inputProps: {\n tabIndex: -1,\n autoComplete,\n disabled: isDisabled,\n type: inputType,\n // We set the form prop to an empty string to prevent the hidden date input's value from being submitted\n form: '',\n name,\n step: inputStep,\n value: dateValue,\n onChange: (e) => {\n let targetString = e.target.value.toString();\n if (targetString) {\n try {\n let targetValue: CalendarDateTime | CalendarDate = parseDateTime(targetString);\n if (state.granularity === 'day') {\n targetValue = parseDate(targetString);\n }\n // We check to to see if setSegment exists in the state since it only exists in DateFieldState and not DatePickerState.\n // The setValue method has different behavior depending on if it's coming from DateFieldState or DatePickerState.\n // In DateFieldState, setValue firsts checks to make sure that each segment is filled before committing the newValue\n // which is why in the code below we first set each segment to validate it before committing the new value.\n // However, in DatePickerState, since we have to be able to commit values from the Calendar popover, we are also able to\n // set a new value when the field itself is empty.\n if ('setSegment' in state) {\n for (let type in targetValue) {\n // eslint-disable-next-line max-depth\n if (dateSegments.includes(type)) {\n state.setSegment(type as DateSegmentType, targetValue[type]);\n }\n // eslint-disable-next-line max-depth\n if (timeSegments.includes(type)) {\n state.setSegment(type as DateSegmentType, targetValue[type]);\n }\n }\n }\n state.setValue(targetValue);\n } catch {\n // ignore\n }\n }\n }\n }\n };\n}\n\nexport function HiddenDateInput(props: HiddenDateInputProps): ReactNode | null {\n let {state} = props;\n let {containerProps, inputProps} = useHiddenDateInput({...props}, state);\n return (\n <div {...containerProps} data-testid=\"hidden-dateinput-container\">\n <input {...inputProps} />\n </div>\n );\n}\n"],"names":[],"version":3,"file":"HiddenDateInput.module.js.map"}
@@ -36,7 +36,10 @@ let $1bcfcef5af644e13$var$filterHoverProps = (props)=>{
36
36
  };
37
37
  const $1bcfcef5af644e13$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fA2o8$reactariacollections.createHideableComponent)(function Input(props, ref) {
38
38
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $1bcfcef5af644e13$export$37fb8590cf2c088c);
39
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fA2o8$reactaria.useHover)(props);
39
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fA2o8$reactaria.useHover)({
40
+ ...props,
41
+ isDisabled: props.disabled
42
+ });
40
43
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $fA2o8$reactaria.useFocusRing)({
41
44
  isTextInput: true,
42
45
  autoFocus: props.autoFocus
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2CM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/Input.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 {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\n\nexport interface InputRenderProps {\n /**\n * Whether the input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the input is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {\n /**\n * Temporary text that occupies the text input when it is empty.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder).\n */\n placeholder?: string\n}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-Input'\n });\n\n return (\n <input\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Input.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAsDM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY,MAAM,QAAQ;IAC5B;IACA,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/Input.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 {\n ClassNameOrFunction,\n ContextValue,\n StyleRenderProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\n\nexport interface InputRenderProps {\n /**\n * Whether the input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the input is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Input'\n */\n className?: ClassNameOrFunction<InputRenderProps>,\n /**\n * Temporary text that occupies the text input when it is empty.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder).\n */\n placeholder?: string\n}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.disabled\n });\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-Input'\n });\n\n return (\n <input\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Input.main.js.map"}
package/dist/Input.mjs CHANGED
@@ -25,7 +25,10 @@ let $3985021b0ad6602f$var$filterHoverProps = (props)=>{
25
25
  };
26
26
  const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $jMZTB$createHideableComponent)(function Input(props, ref) {
27
27
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
28
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jMZTB$useHover)(props);
28
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jMZTB$useHover)({
29
+ ...props,
30
+ isDisabled: props.disabled
31
+ });
29
32
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $jMZTB$useFocusRing)({
30
33
  isTextInput: true,
31
34
  autoFocus: props.autoFocus
@@ -25,7 +25,10 @@ let $3985021b0ad6602f$var$filterHoverProps = (props)=>{
25
25
  };
26
26
  const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $jMZTB$createHideableComponent)(function Input(props, ref) {
27
27
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
28
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jMZTB$useHover)(props);
28
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jMZTB$useHover)({
29
+ ...props,
30
+ isDisabled: props.disabled
31
+ });
29
32
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $jMZTB$useFocusRing)({
30
33
  isTextInput: true,
31
34
  autoFocus: props.autoFocus
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AA2CM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/Input.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 {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\n\nexport interface InputRenderProps {\n /**\n * Whether the input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the input is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {\n /**\n * Temporary text that occupies the text input when it is empty.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder).\n */\n placeholder?: string\n}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-Input'\n });\n\n return (\n <input\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Input.module.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAsDM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAEvF,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,4CAAQ,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,MAAM,KAAiB,EAAE,GAAmC;IAC9H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY,MAAM,QAAQ;IAC5B;IACA,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/Input.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 {\n ClassNameOrFunction,\n ContextValue,\n StyleRenderProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\n\nexport interface InputRenderProps {\n /**\n * Whether the input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the input is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Input'\n */\n className?: ClassNameOrFunction<InputRenderProps>,\n /**\n * Temporary text that occupies the text input when it is empty.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder).\n */\n placeholder?: string\n}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.disabled\n });\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-Input'\n });\n\n return (\n <input\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Input.module.js.map"}
@@ -1 +1 @@
1
- {"mapp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sx"],"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"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAwDM,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 {\n ClassNameOrFunction,\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} 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<HTMLAnchorElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Link'\n */\n className?: ClassNameOrFunction<LinkRenderProps>\n}\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"}
@@ -1 +1 @@
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"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAwDM,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 {\n ClassNameOrFunction,\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} 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<HTMLAnchorElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Link'\n */\n className?: ClassNameOrFunction<LinkRenderProps>\n}\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"}
@@ -1,5 +1,5 @@
1
- var $3114c2382242bdc0$exports = require("./Collection.main.js");
2
1
  var $c5ccf687772c0422$exports = require("./utils.main.js");
2
+ var $3114c2382242bdc0$exports = require("./Collection.main.js");
3
3
  var $0c2289d253cb4544$exports = require("./DragAndDrop.main.js");
4
4
  var $c7efb75a1a3fe2d2$exports = require("./Header.main.js");
5
5
  var $525402dfec7da5bc$exports = require("./RSPContexts.main.js");
@@ -313,9 +313,11 @@ const $a03b42240404b420$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $59TRP$reacta
313
313
  onHoverChange: item.props.onHoverChange,
314
314
  onHoverEnd: item.props.onHoverEnd
315
315
  });
316
+ let { focusProps: focusProps } = (0, $59TRP$reactaria.useFocus)(props);
316
317
  let draggableItem = null;
317
318
  if (dragState && dragAndDropHooks) draggableItem = dragAndDropHooks.useDraggableItem({
318
- key: item.key
319
+ key: item.key,
320
+ hasAction: states.hasAction
319
321
  }, dragState);
320
322
  let droppableItem = null;
321
323
  if (dropState && dragAndDropHooks) droppableItem = dragAndDropHooks.useDroppableItem({
@@ -352,8 +354,9 @@ const $a03b42240404b420$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $59TRP$reacta
352
354
  });
353
355
  delete DOMProps.id;
354
356
  delete DOMProps.onClick;
357
+ if (ElementType === 'a' && optionProps.tabIndex == null) optionProps.tabIndex = -1;
355
358
  return /*#__PURE__*/ (0, ($parcel$interopDefault($59TRP$react))).createElement(ElementType, {
356
- ...(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
+ ...(0, $59TRP$reactaria.mergeProps)(DOMProps, renderProps, optionProps, hoverProps, focusProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
357
360
  ref: ref,
358
361
  "data-allows-dragging": !!dragState || undefined,
359
362
  "data-selected": states.isSelected || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AA0EM,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,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CAAA,GAAA,sCAAS,GAAG,SAAS,wBAAwB,KAA+B,EAAE,GAAiC,EAAE,IAAkB;IACxL,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE;IACvB,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,YAAY,EAAE,GAAG,YAAW,GAAG;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,yCAAkB,EAAE,qBAAqB;IACzC,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;IAIZ;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,OAAO;YAAC,QAAQ;QAAI,IAAI,YAAY;QACjE,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, 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 './RSPContexts';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\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 <SharedElementTransition>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </SharedElementTransition>\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 [SelectionIndicatorContext, {isSelected: states.isSelected}]\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"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AA2FM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAK9D,MAAM,4CAAwB,AAAd,WAAW,GAAI,C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,UAAU,KAAK,QAAQ;QACvB,kBAAkB;QAClB,QAAQ;IACV;IAEA,IAAI,cAAc;QAChB,uBAAuB;QACvB,UAAU;IAIZ;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,OAAO;YAAC,QAAQ;QAAI,IAAI,YAAY;QACjE,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, useFocus, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent, ItemNode, LoaderNode, SectionNode} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\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 {FocusEvents, 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 './RSPContexts';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\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 * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-ListBox'\n */\n className?: ClassNameOrFunction<ListBoxRenderProps>,\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 <SharedElementTransition>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-ListBoxSection'\n */\n className?: string\n}\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, FocusEvents<HTMLDivElement>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-ListBoxItem'\n */\n className?: ClassNameOrFunction<ListBoxItemRenderProps>,\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 {focusProps} = useFocus(props);\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasAction: states.hasAction}, 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 if (ElementType === 'a' && optionProps.tabIndex == null) {\n optionProps.tabIndex = -1;\n }\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, optionProps, hoverProps, focusProps, 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 [SelectionIndicatorContext, {isSelected: states.isSelected}]\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 CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-ListBoxLoadMoreItem'\n */\n className?: string,\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
@@ -1,5 +1,5 @@
1
- import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8} from "./Collection.mjs";
2
1
  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";
2
+ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8} from "./Collection.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
5
  import {SelectableCollectionContext as $4e85f108e88277b8$export$b0d3ecf7112093a7} from "./RSPContexts.mjs";
@@ -7,7 +7,7 @@ import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0}
7
7
  import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.mjs";
8
8
  import {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from "./SharedElementTransition.mjs";
9
9
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
10
- 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";
10
+ 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, useFocus as $e8Bmu$useFocus} from "react-aria";
11
11
  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";
12
12
  import {useListState as $e8Bmu$useListState, UNSTABLE_useFilteredListState as $e8Bmu$UNSTABLE_useFilteredListState} from "react-stately";
13
13
  import {filterDOMProps as $e8Bmu$filterDOMProps, useObjectRef as $e8Bmu$useObjectRef, useLoadMoreSentinel as $e8Bmu$useLoadMoreSentinel, inertValue as $e8Bmu$inertValue} from "@react-aria/utils";
@@ -298,9 +298,11 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$create
298
298
  onHoverChange: item.props.onHoverChange,
299
299
  onHoverEnd: item.props.onHoverEnd
300
300
  });
301
+ let { focusProps: focusProps } = (0, $e8Bmu$useFocus)(props);
301
302
  let draggableItem = null;
302
303
  if (dragState && dragAndDropHooks) draggableItem = dragAndDropHooks.useDraggableItem({
303
- key: item.key
304
+ key: item.key,
305
+ hasAction: states.hasAction
304
306
  }, dragState);
305
307
  let droppableItem = null;
306
308
  if (dropState && dragAndDropHooks) droppableItem = dragAndDropHooks.useDroppableItem({
@@ -337,8 +339,9 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$create
337
339
  });
338
340
  delete DOMProps.id;
339
341
  delete DOMProps.onClick;
342
+ if (ElementType === 'a' && optionProps.tabIndex == null) optionProps.tabIndex = -1;
340
343
  return /*#__PURE__*/ (0, $e8Bmu$react).createElement(ElementType, {
341
- ...(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
+ ...(0, $e8Bmu$mergeProps)(DOMProps, renderProps, optionProps, hoverProps, focusProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
342
345
  ref: ref,
343
346
  "data-allows-dragging": !!dragState || undefined,
344
347
  "data-selected": states.isSelected || undefined,
@@ -1,5 +1,5 @@
1
- import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8} from "./Collection.module.js";
2
1
  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.module.js";
2
+ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8} from "./Collection.module.js";
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.module.js";
4
4
  import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.module.js";
5
5
  import {SelectableCollectionContext as $4e85f108e88277b8$export$b0d3ecf7112093a7} from "./RSPContexts.module.js";
@@ -7,7 +7,7 @@ import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0}
7
7
  import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.module.js";
8
8
  import {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from "./SharedElementTransition.module.js";
9
9
  import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
10
- 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";
10
+ 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, useFocus as $e8Bmu$useFocus} from "react-aria";
11
11
  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";
12
12
  import {useListState as $e8Bmu$useListState, UNSTABLE_useFilteredListState as $e8Bmu$UNSTABLE_useFilteredListState} from "react-stately";
13
13
  import {filterDOMProps as $e8Bmu$filterDOMProps, useObjectRef as $e8Bmu$useObjectRef, useLoadMoreSentinel as $e8Bmu$useLoadMoreSentinel, inertValue as $e8Bmu$inertValue} from "@react-aria/utils";
@@ -298,9 +298,11 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$create
298
298
  onHoverChange: item.props.onHoverChange,
299
299
  onHoverEnd: item.props.onHoverEnd
300
300
  });
301
+ let { focusProps: focusProps } = (0, $e8Bmu$useFocus)(props);
301
302
  let draggableItem = null;
302
303
  if (dragState && dragAndDropHooks) draggableItem = dragAndDropHooks.useDraggableItem({
303
- key: item.key
304
+ key: item.key,
305
+ hasAction: states.hasAction
304
306
  }, dragState);
305
307
  let droppableItem = null;
306
308
  if (dropState && dragAndDropHooks) droppableItem = dragAndDropHooks.useDroppableItem({
@@ -337,8 +339,9 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ (0, $e8Bmu$create
337
339
  });
338
340
  delete DOMProps.id;
339
341
  delete DOMProps.onClick;
342
+ if (ElementType === 'a' && optionProps.tabIndex == null) optionProps.tabIndex = -1;
340
343
  return /*#__PURE__*/ (0, $e8Bmu$react).createElement(ElementType, {
341
- ...(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
+ ...(0, $e8Bmu$mergeProps)(DOMProps, renderProps, optionProps, hoverProps, focusProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
342
345
  ref: ref,
343
346
  "data-allows-dragging": !!dragState || undefined,
344
347
  "data-selected": states.isSelected || undefined,