react-aria-components 1.14.0 → 1.15.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 (333) hide show
  1. package/dist/Breadcrumbs.main.js +3 -2
  2. package/dist/Breadcrumbs.main.js.map +1 -1
  3. package/dist/Breadcrumbs.mjs +4 -3
  4. package/dist/Breadcrumbs.module.js +4 -3
  5. package/dist/Breadcrumbs.module.js.map +1 -1
  6. package/dist/Button.main.js +1 -1
  7. package/dist/Button.main.js.map +1 -1
  8. package/dist/Button.mjs +2 -2
  9. package/dist/Button.module.js +2 -2
  10. package/dist/Button.module.js.map +1 -1
  11. package/dist/Calendar.main.js +11 -7
  12. package/dist/Calendar.main.js.map +1 -1
  13. package/dist/Calendar.mjs +12 -8
  14. package/dist/Calendar.module.js +12 -8
  15. package/dist/Calendar.module.js.map +1 -1
  16. package/dist/Checkbox.main.js +2 -2
  17. package/dist/Checkbox.main.js.map +1 -1
  18. package/dist/Checkbox.mjs +3 -3
  19. package/dist/Checkbox.module.js +3 -3
  20. package/dist/Checkbox.module.js.map +1 -1
  21. package/dist/ColorArea.main.js +1 -1
  22. package/dist/ColorArea.main.js.map +1 -1
  23. package/dist/ColorArea.mjs +2 -2
  24. package/dist/ColorArea.module.js +2 -2
  25. package/dist/ColorArea.module.js.map +1 -1
  26. package/dist/ColorField.main.js +7 -3
  27. package/dist/ColorField.main.js.map +1 -1
  28. package/dist/ColorField.mjs +8 -4
  29. package/dist/ColorField.module.js +8 -4
  30. package/dist/ColorField.module.js.map +1 -1
  31. package/dist/ColorSlider.main.js +1 -1
  32. package/dist/ColorSlider.main.js.map +1 -1
  33. package/dist/ColorSlider.mjs +2 -2
  34. package/dist/ColorSlider.module.js +2 -2
  35. package/dist/ColorSlider.module.js.map +1 -1
  36. package/dist/ColorSwatch.main.js +1 -1
  37. package/dist/ColorSwatch.main.js.map +1 -1
  38. package/dist/ColorSwatch.mjs +2 -2
  39. package/dist/ColorSwatch.module.js +2 -2
  40. package/dist/ColorSwatch.module.js.map +1 -1
  41. package/dist/ColorSwatchPicker.main.js +2 -0
  42. package/dist/ColorSwatchPicker.main.js.map +1 -1
  43. package/dist/ColorSwatchPicker.mjs +2 -0
  44. package/dist/ColorSwatchPicker.module.js +2 -0
  45. package/dist/ColorSwatchPicker.module.js.map +1 -1
  46. package/dist/ColorThumb.main.js +1 -1
  47. package/dist/ColorThumb.main.js.map +1 -1
  48. package/dist/ColorThumb.mjs +2 -2
  49. package/dist/ColorThumb.module.js +2 -2
  50. package/dist/ColorThumb.module.js.map +1 -1
  51. package/dist/ColorWheel.main.js +2 -2
  52. package/dist/ColorWheel.main.js.map +1 -1
  53. package/dist/ColorWheel.mjs +3 -3
  54. package/dist/ColorWheel.module.js +3 -3
  55. package/dist/ColorWheel.module.js.map +1 -1
  56. package/dist/ComboBox.main.js +2 -2
  57. package/dist/ComboBox.main.js.map +1 -1
  58. package/dist/ComboBox.mjs +3 -3
  59. package/dist/ComboBox.module.js +3 -3
  60. package/dist/ComboBox.module.js.map +1 -1
  61. package/dist/DateField.main.js +3 -3
  62. package/dist/DateField.main.js.map +1 -1
  63. package/dist/DateField.mjs +4 -4
  64. package/dist/DateField.module.js +4 -4
  65. package/dist/DateField.module.js.map +1 -1
  66. package/dist/DatePicker.main.js +2 -2
  67. package/dist/DatePicker.main.js.map +1 -1
  68. package/dist/DatePicker.mjs +3 -3
  69. package/dist/DatePicker.module.js +3 -3
  70. package/dist/DatePicker.module.js.map +1 -1
  71. package/dist/Dialog.main.js +2 -1
  72. package/dist/Dialog.main.js.map +1 -1
  73. package/dist/Dialog.mjs +3 -2
  74. package/dist/Dialog.module.js +3 -2
  75. package/dist/Dialog.module.js.map +1 -1
  76. package/dist/Disclosure.main.js +3 -3
  77. package/dist/Disclosure.main.js.map +1 -1
  78. package/dist/Disclosure.mjs +4 -4
  79. package/dist/Disclosure.module.js +4 -4
  80. package/dist/Disclosure.module.js.map +1 -1
  81. package/dist/DropZone.main.js +2 -3
  82. package/dist/DropZone.main.js.map +1 -1
  83. package/dist/DropZone.mjs +4 -5
  84. package/dist/DropZone.module.js +4 -5
  85. package/dist/DropZone.module.js.map +1 -1
  86. package/dist/Form.main.js +1 -1
  87. package/dist/Form.main.js.map +1 -1
  88. package/dist/Form.mjs +2 -2
  89. package/dist/Form.module.js +2 -2
  90. package/dist/Form.module.js.map +1 -1
  91. package/dist/GridList.main.js +16 -13
  92. package/dist/GridList.main.js.map +1 -1
  93. package/dist/GridList.mjs +17 -14
  94. package/dist/GridList.module.js +17 -14
  95. package/dist/GridList.module.js.map +1 -1
  96. package/dist/Group.main.js +1 -1
  97. package/dist/Group.main.js.map +1 -1
  98. package/dist/Group.mjs +2 -2
  99. package/dist/Group.module.js +2 -2
  100. package/dist/Group.module.js.map +1 -1
  101. package/dist/Header.main.js +1 -1
  102. package/dist/Header.main.js.map +1 -1
  103. package/dist/Header.mjs +2 -2
  104. package/dist/Header.module.js +2 -2
  105. package/dist/Header.module.js.map +1 -1
  106. package/dist/Heading.main.js +2 -2
  107. package/dist/Heading.main.js.map +1 -1
  108. package/dist/Heading.mjs +2 -2
  109. package/dist/Heading.module.js +2 -2
  110. package/dist/Heading.module.js.map +1 -1
  111. package/dist/HiddenDateInput.main.js +5 -1
  112. package/dist/HiddenDateInput.main.js.map +1 -1
  113. package/dist/HiddenDateInput.mjs +6 -2
  114. package/dist/HiddenDateInput.module.js +6 -2
  115. package/dist/HiddenDateInput.module.js.map +1 -1
  116. package/dist/Input.main.js +1 -1
  117. package/dist/Input.main.js.map +1 -1
  118. package/dist/Input.mjs +2 -2
  119. package/dist/Input.module.js +2 -2
  120. package/dist/Input.module.js.map +1 -1
  121. package/dist/Keyboard.main.js +1 -1
  122. package/dist/Keyboard.main.js.map +1 -1
  123. package/dist/Keyboard.mjs +2 -2
  124. package/dist/Keyboard.module.js +2 -2
  125. package/dist/Keyboard.module.js.map +1 -1
  126. package/dist/Label.main.js +2 -1
  127. package/dist/Label.main.js.map +1 -1
  128. package/dist/Label.mjs +3 -2
  129. package/dist/Label.module.js +3 -2
  130. package/dist/Label.module.js.map +1 -1
  131. package/dist/Link.main.js +3 -2
  132. package/dist/Link.main.js.map +1 -1
  133. package/dist/Link.mjs +4 -3
  134. package/dist/Link.module.js +4 -3
  135. package/dist/Link.module.js.map +1 -1
  136. package/dist/ListBox.main.js +13 -14
  137. package/dist/ListBox.main.js.map +1 -1
  138. package/dist/ListBox.mjs +14 -15
  139. package/dist/ListBox.module.js +14 -15
  140. package/dist/ListBox.module.js.map +1 -1
  141. package/dist/Menu.main.js +21 -8
  142. package/dist/Menu.main.js.map +1 -1
  143. package/dist/Menu.mjs +22 -9
  144. package/dist/Menu.module.js +22 -9
  145. package/dist/Menu.module.js.map +1 -1
  146. package/dist/Meter.main.js +1 -1
  147. package/dist/Meter.main.js.map +1 -1
  148. package/dist/Meter.mjs +2 -2
  149. package/dist/Meter.module.js +2 -2
  150. package/dist/Meter.module.js.map +1 -1
  151. package/dist/Modal.main.js +2 -2
  152. package/dist/Modal.main.js.map +1 -1
  153. package/dist/Modal.mjs +3 -3
  154. package/dist/Modal.module.js +3 -3
  155. package/dist/Modal.module.js.map +1 -1
  156. package/dist/NumberField.main.js +1 -1
  157. package/dist/NumberField.main.js.map +1 -1
  158. package/dist/NumberField.mjs +2 -2
  159. package/dist/NumberField.module.js +2 -2
  160. package/dist/NumberField.module.js.map +1 -1
  161. package/dist/OverlayArrow.main.js +1 -1
  162. package/dist/OverlayArrow.main.js.map +1 -1
  163. package/dist/OverlayArrow.mjs +2 -2
  164. package/dist/OverlayArrow.module.js +2 -2
  165. package/dist/OverlayArrow.module.js.map +1 -1
  166. package/dist/Popover.main.js +2 -2
  167. package/dist/Popover.main.js.map +1 -1
  168. package/dist/Popover.mjs +4 -4
  169. package/dist/Popover.module.js +4 -4
  170. package/dist/Popover.module.js.map +1 -1
  171. package/dist/ProgressBar.main.js +1 -1
  172. package/dist/ProgressBar.main.js.map +1 -1
  173. package/dist/ProgressBar.mjs +2 -2
  174. package/dist/ProgressBar.module.js +2 -2
  175. package/dist/ProgressBar.module.js.map +1 -1
  176. package/dist/RadioGroup.main.js +2 -2
  177. package/dist/RadioGroup.main.js.map +1 -1
  178. package/dist/RadioGroup.mjs +3 -3
  179. package/dist/RadioGroup.module.js +3 -3
  180. package/dist/RadioGroup.module.js.map +1 -1
  181. package/dist/SearchField.main.js +1 -1
  182. package/dist/SearchField.main.js.map +1 -1
  183. package/dist/SearchField.mjs +2 -2
  184. package/dist/SearchField.module.js +2 -2
  185. package/dist/SearchField.module.js.map +1 -1
  186. package/dist/Select.main.js +2 -2
  187. package/dist/Select.main.js.map +1 -1
  188. package/dist/Select.mjs +3 -3
  189. package/dist/Select.module.js +3 -3
  190. package/dist/Select.module.js.map +1 -1
  191. package/dist/Separator.main.js +3 -1
  192. package/dist/Separator.main.js.map +1 -1
  193. package/dist/Separator.mjs +4 -2
  194. package/dist/Separator.module.js +4 -2
  195. package/dist/Separator.module.js.map +1 -1
  196. package/dist/SharedElementTransition.main.js +3 -2
  197. package/dist/SharedElementTransition.main.js.map +1 -1
  198. package/dist/SharedElementTransition.mjs +4 -3
  199. package/dist/SharedElementTransition.module.js +4 -3
  200. package/dist/SharedElementTransition.module.js.map +1 -1
  201. package/dist/Slider.main.js +6 -5
  202. package/dist/Slider.main.js.map +1 -1
  203. package/dist/Slider.mjs +7 -6
  204. package/dist/Slider.module.js +7 -6
  205. package/dist/Slider.module.js.map +1 -1
  206. package/dist/Switch.main.js +1 -1
  207. package/dist/Switch.main.js.map +1 -1
  208. package/dist/Switch.mjs +2 -2
  209. package/dist/Switch.module.js +2 -2
  210. package/dist/Switch.module.js.map +1 -1
  211. package/dist/Table.main.js +30 -25
  212. package/dist/Table.main.js.map +1 -1
  213. package/dist/Table.mjs +31 -26
  214. package/dist/Table.module.js +31 -26
  215. package/dist/Table.module.js.map +1 -1
  216. package/dist/Tabs.main.js +13 -6
  217. package/dist/Tabs.main.js.map +1 -1
  218. package/dist/Tabs.mjs +14 -7
  219. package/dist/Tabs.module.js +14 -7
  220. package/dist/Tabs.module.js.map +1 -1
  221. package/dist/TagGroup.main.js +6 -5
  222. package/dist/TagGroup.main.js.map +1 -1
  223. package/dist/TagGroup.mjs +7 -6
  224. package/dist/TagGroup.module.js +7 -6
  225. package/dist/TagGroup.module.js.map +1 -1
  226. package/dist/Text.main.js +2 -1
  227. package/dist/Text.main.js.map +1 -1
  228. package/dist/Text.mjs +3 -2
  229. package/dist/Text.module.js +3 -2
  230. package/dist/Text.module.js.map +1 -1
  231. package/dist/TextArea.main.js +1 -1
  232. package/dist/TextArea.main.js.map +1 -1
  233. package/dist/TextArea.mjs +2 -2
  234. package/dist/TextArea.module.js +2 -2
  235. package/dist/TextArea.module.js.map +1 -1
  236. package/dist/TextField.main.js +1 -1
  237. package/dist/TextField.main.js.map +1 -1
  238. package/dist/TextField.mjs +2 -2
  239. package/dist/TextField.module.js +2 -2
  240. package/dist/TextField.module.js.map +1 -1
  241. package/dist/Toast.main.js +6 -4
  242. package/dist/Toast.main.js.map +1 -1
  243. package/dist/Toast.mjs +7 -5
  244. package/dist/Toast.module.js +7 -5
  245. package/dist/Toast.module.js.map +1 -1
  246. package/dist/ToggleButton.main.js +5 -2
  247. package/dist/ToggleButton.main.js.map +1 -1
  248. package/dist/ToggleButton.mjs +6 -3
  249. package/dist/ToggleButton.module.js +6 -3
  250. package/dist/ToggleButton.module.js.map +1 -1
  251. package/dist/ToggleButtonGroup.main.js +1 -1
  252. package/dist/ToggleButtonGroup.main.js.map +1 -1
  253. package/dist/ToggleButtonGroup.mjs +2 -2
  254. package/dist/ToggleButtonGroup.module.js +2 -2
  255. package/dist/ToggleButtonGroup.module.js.map +1 -1
  256. package/dist/Toolbar.main.js +1 -1
  257. package/dist/Toolbar.main.js.map +1 -1
  258. package/dist/Toolbar.mjs +2 -2
  259. package/dist/Toolbar.module.js +2 -2
  260. package/dist/Toolbar.module.js.map +1 -1
  261. package/dist/Tooltip.main.js +1 -1
  262. package/dist/Tooltip.main.js.map +1 -1
  263. package/dist/Tooltip.mjs +2 -2
  264. package/dist/Tooltip.module.js +2 -2
  265. package/dist/Tooltip.module.js.map +1 -1
  266. package/dist/Tree.main.js +6 -6
  267. package/dist/Tree.main.js.map +1 -1
  268. package/dist/Tree.mjs +7 -7
  269. package/dist/Tree.module.js +7 -7
  270. package/dist/Tree.module.js.map +1 -1
  271. package/dist/types.d.ts +122 -63
  272. package/dist/types.d.ts.map +1 -1
  273. package/dist/utils.main.js +41 -3
  274. package/dist/utils.main.js.map +1 -1
  275. package/dist/utils.mjs +42 -5
  276. package/dist/utils.module.js +42 -5
  277. package/dist/utils.module.js.map +1 -1
  278. package/package.json +24 -24
  279. package/src/Breadcrumbs.tsx +9 -6
  280. package/src/Button.tsx +4 -3
  281. package/src/Calendar.tsx +26 -20
  282. package/src/Checkbox.tsx +7 -6
  283. package/src/ColorArea.tsx +3 -2
  284. package/src/ColorField.tsx +18 -3
  285. package/src/ColorSlider.tsx +2 -1
  286. package/src/ColorSwatch.tsx +2 -1
  287. package/src/ColorSwatchPicker.tsx +2 -0
  288. package/src/ColorThumb.tsx +3 -3
  289. package/src/ColorWheel.tsx +4 -3
  290. package/src/ComboBox.tsx +3 -2
  291. package/src/DateField.tsx +5 -4
  292. package/src/DatePicker.tsx +3 -2
  293. package/src/Dialog.tsx +5 -4
  294. package/src/Disclosure.tsx +7 -6
  295. package/src/DropZone.tsx +5 -5
  296. package/src/Form.tsx +4 -4
  297. package/src/GridList.tsx +30 -23
  298. package/src/Group.tsx +10 -9
  299. package/src/Header.tsx +7 -5
  300. package/src/Heading.tsx +4 -4
  301. package/src/HiddenDateInput.tsx +10 -3
  302. package/src/Input.tsx +3 -2
  303. package/src/Keyboard.tsx +4 -2
  304. package/src/Label.tsx +4 -3
  305. package/src/Link.tsx +15 -12
  306. package/src/ListBox.tsx +23 -22
  307. package/src/Menu.tsx +32 -17
  308. package/src/Meter.tsx +3 -2
  309. package/src/Modal.tsx +5 -4
  310. package/src/NumberField.tsx +2 -1
  311. package/src/OverlayArrow.tsx +3 -2
  312. package/src/Popover.tsx +5 -4
  313. package/src/ProgressBar.tsx +3 -2
  314. package/src/RadioGroup.tsx +6 -5
  315. package/src/SearchField.tsx +3 -2
  316. package/src/Select.tsx +6 -5
  317. package/src/Separator.tsx +8 -5
  318. package/src/SharedElementTransition.tsx +4 -3
  319. package/src/Slider.tsx +9 -7
  320. package/src/Switch.tsx +11 -10
  321. package/src/Table.tsx +47 -36
  322. package/src/Tabs.tsx +23 -18
  323. package/src/TagGroup.tsx +16 -13
  324. package/src/Text.tsx +4 -3
  325. package/src/TextArea.tsx +3 -2
  326. package/src/TextField.tsx +4 -3
  327. package/src/Toast.tsx +15 -11
  328. package/src/ToggleButton.tsx +5 -4
  329. package/src/ToggleButtonGroup.tsx +3 -2
  330. package/src/Toolbar.tsx +3 -2
  331. package/src/Tooltip.tsx +3 -2
  332. package/src/Tree.tsx +18 -17
  333. package/src/utils.tsx +97 -11
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA8HM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAiD;AACvF,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAuD;AACxF,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,I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AEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;uBAEtD,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/RadioGroup.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 {AriaRadioGroupProps, AriaRadioProps, HoverEvents, Orientation, useFocusRing, useHover, useRadio, useRadioGroup, VisuallyHidden} from 'react-aria';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\n\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<RadioGroupRenderProps>, 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-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>\n}\nexport interface RadioProps extends Omit<AriaRadioProps, 'children'>, HoverEvents, RenderProps<RadioRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, '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-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the radio group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the radio group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the radio group.\n */\n state: RadioGroupState\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the radio is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the radio is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the radio is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the radio is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext = createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useRadioGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>\n {renderProps.children}\n </SharedElementTransition>\n </Provider>\n </div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(props: RadioProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isPressed} = useRadio({\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+HM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAiD;AACvF,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAuD;AACxF,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;QAC7B,GAAG,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A,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,KAAK;QACP,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;uBAEtD,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/RadioGroup.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 {AriaRadioGroupProps, AriaRadioProps, HoverEvents, Orientation, useFocusRing, useHover, useRadio, useRadioGroup, VisuallyHidden} from 'react-aria';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\n\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<RadioGroupRenderProps>, 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-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>\n}\nexport interface RadioProps extends Omit<AriaRadioProps, 'children'>, HoverEvents, RenderProps<RadioRenderProps, 'label'>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, '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-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the radio group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the radio group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the radio group.\n */\n state: RadioGroupState\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the radio is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the radio is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the radio is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the radio is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext = createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useRadioGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>\n {renderProps.children}\n </SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(props: RadioProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isPressed} = useRadio({\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.module.js.map"}
@@ -82,7 +82,7 @@ const $a83c69b310385d53$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $9H0iv$react
82
82
  global: true
83
83
  });
84
84
  delete DOMProps.id;
85
- return /*#__PURE__*/ (0, ($parcel$interopDefault($9H0iv$react))).createElement("div", {
85
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($9H0iv$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
86
86
  ...DOMProps,
87
87
  ...renderProps,
88
88
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAsEM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAkD;AAKzF,MAAM,4CAAc,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,E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C,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,WAAW,SAAS,IAAI;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAiB;YACjC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,WAAW,WAAW,SAAS;oBAAE,YAAY,MAAM,UAAU,IAAI;gBAAK;aAAE;YACxF;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;aAAW;SAChC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/SearchField.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 {AriaSearchFieldProps, useSearchField} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {FieldInputContext} from './RSPContexts';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, useRef} from 'react';\nimport {SearchFieldState, useSearchFieldState} from 'react-stately';\nimport {TextContext} from './Text';\n\nexport interface SearchFieldRenderProps {\n /**\n * Whether the search field is empty.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the search field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the search field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the search field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the search field is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * State of the search field.\n */\n state: SearchFieldState\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<SearchFieldRenderProps>, 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-SearchField'\n */\n className?: ClassNameOrFunction<SearchFieldRenderProps>\n}\n\nexport const SearchFieldContext = createContext<ContextValue<SearchFieldProps, HTMLDivElement>>(null);\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport const SearchField = /*#__PURE__*/ createHideableComponent(function SearchField(props: SearchFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SearchFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let inputRef = useRef<HTMLInputElement>(null);\n [props, inputRef as unknown] = useContextProps(props, inputRef, FieldInputContext);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useSearchFieldState({\n ...props,\n validationBehavior\n });\n\n let {labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps, ...validation} = useSearchField({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isEmpty: state.value === '',\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n state\n },\n defaultClassName: 'react-aria-SearchField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-empty={state.value === '' || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}],\n [InputContext, {...inputProps, ref: inputRef}],\n [ButtonContext, clearButtonProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [GroupContext, {isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"SearchField.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAuEM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAkD;AAKzF,MAAM,4CAAc,WAAW,GAAG,CAAA,GAAA,mDAAsB,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,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K,KAAK,MAAM;QAClC,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,WAAW,SAAS,IAAI;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAiB;YACjC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,WAAW,WAAW,SAAS;oBAAE,YAAY,MAAM,UAAU,IAAI;gBAAK;aAAE;YACxF;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;aAAW;SAChC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/SearchField.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 {AriaSearchFieldProps, useSearchField} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {FieldInputContext} from './RSPContexts';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, useRef} from 'react';\nimport {SearchFieldState, useSearchFieldState} from 'react-stately';\nimport {TextContext} from './Text';\n\nexport interface SearchFieldRenderProps {\n /**\n * Whether the search field is empty.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the search field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the search field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the search field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the search field is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * State of the search field.\n */\n state: SearchFieldState\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<SearchFieldRenderProps>, 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-SearchField'\n */\n className?: ClassNameOrFunction<SearchFieldRenderProps>\n}\n\nexport const SearchFieldContext = createContext<ContextValue<SearchFieldProps, HTMLDivElement>>(null);\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport const SearchField = /*#__PURE__*/ createHideableComponent(function SearchField(props: SearchFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SearchFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let inputRef = useRef<HTMLInputElement>(null);\n [props, inputRef as unknown] = useContextProps(props, inputRef, FieldInputContext);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useSearchFieldState({\n ...props,\n validationBehavior\n });\n\n let {labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps, ...validation} = useSearchField({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isEmpty: state.value === '',\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n state\n },\n defaultClassName: 'react-aria-SearchField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-empty={state.value === '' || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}],\n [InputContext, {...inputProps, ref: inputRef}],\n [ButtonContext, clearButtonProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [GroupContext, {isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"SearchField.main.js.map"}
@@ -1,5 +1,5 @@
1
1
  import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
2
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
2
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
3
3
  import {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from "./FieldError.mjs";
4
4
  import {FieldInputContext as $4e85f108e88277b8$export$698f465ec27e93df} from "./RSPContexts.mjs";
5
5
  import {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from "./Form.mjs";
@@ -71,7 +71,7 @@ const $440f4836bcb56932$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $8iEQ9$creat
71
71
  global: true
72
72
  });
73
73
  delete DOMProps.id;
74
- return /*#__PURE__*/ (0, $8iEQ9$react).createElement("div", {
74
+ return /*#__PURE__*/ (0, $8iEQ9$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
75
75
  ...DOMProps,
76
76
  ...renderProps,
77
77
  ref: ref,
@@ -1,5 +1,5 @@
1
1
  import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.module.js";
2
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
2
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
3
3
  import {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from "./FieldError.module.js";
4
4
  import {FieldInputContext as $4e85f108e88277b8$export$698f465ec27e93df} from "./RSPContexts.module.js";
5
5
  import {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from "./Form.module.js";
@@ -71,7 +71,7 @@ const $440f4836bcb56932$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $8iEQ9$creat
71
71
  global: true
72
72
  });
73
73
  delete DOMProps.id;
74
- return /*#__PURE__*/ (0, $8iEQ9$react).createElement("div", {
74
+ return /*#__PURE__*/ (0, $8iEQ9$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
75
75
  ...DOMProps,
76
76
  ...renderProps,
77
77
  ref: ref,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAsEM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAkD;AAKzF,MAAM,4CAAc,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,WAA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,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAiB;YACjC;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,WAAW,WAAW,SAAS;oBAAE,YAAY,MAAM,UAAU,IAAI;gBAAK;aAAE;YACxF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/SearchField.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 {AriaSearchFieldProps, useSearchField} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {FieldInputContext} from './RSPContexts';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, useRef} from 'react';\nimport {SearchFieldState, useSearchFieldState} from 'react-stately';\nimport {TextContext} from './Text';\n\nexport interface SearchFieldRenderProps {\n /**\n * Whether the search field is empty.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the search field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the search field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the search field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the search field is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * State of the search field.\n */\n state: SearchFieldState\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<SearchFieldRenderProps>, 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-SearchField'\n */\n className?: ClassNameOrFunction<SearchFieldRenderProps>\n}\n\nexport const SearchFieldContext = createContext<ContextValue<SearchFieldProps, HTMLDivElement>>(null);\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport const SearchField = /*#__PURE__*/ createHideableComponent(function SearchField(props: SearchFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SearchFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let inputRef = useRef<HTMLInputElement>(null);\n [props, inputRef as unknown] = useContextProps(props, inputRef, FieldInputContext);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useSearchFieldState({\n ...props,\n validationBehavior\n });\n\n let {labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps, ...validation} = useSearchField({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isEmpty: state.value === '',\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n state\n },\n defaultClassName: 'react-aria-SearchField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-empty={state.value === '' || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}],\n [InputContext, {...inputProps, ref: inputRef}],\n [ButtonContext, clearButtonProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [GroupContext, {isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"SearchField.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAuEM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAkD;AAKzF,MAAM,4CAAc,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;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AAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAiB;YACjC;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,WAAW,WAAW,SAAS;oBAAE,YAAY,MAAM,UAAU,IAAI;gBAAK;aAAE;YACxF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/SearchField.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 {AriaSearchFieldProps, useSearchField} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {FieldInputContext} from './RSPContexts';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, useRef} from 'react';\nimport {SearchFieldState, useSearchFieldState} from 'react-stately';\nimport {TextContext} from './Text';\n\nexport interface SearchFieldRenderProps {\n /**\n * Whether the search field is empty.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the search field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the search field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the search field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the search field is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * State of the search field.\n */\n state: SearchFieldState\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<SearchFieldRenderProps>, 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-SearchField'\n */\n className?: ClassNameOrFunction<SearchFieldRenderProps>\n}\n\nexport const SearchFieldContext = createContext<ContextValue<SearchFieldProps, HTMLDivElement>>(null);\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport const SearchField = /*#__PURE__*/ createHideableComponent(function SearchField(props: SearchFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SearchFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let inputRef = useRef<HTMLInputElement>(null);\n [props, inputRef as unknown] = useContextProps(props, inputRef, FieldInputContext);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useSearchFieldState({\n ...props,\n validationBehavior\n });\n\n let {labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps, ...validation} = useSearchField({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isEmpty: state.value === '',\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n state\n },\n defaultClassName: 'react-aria-SearchField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-empty={state.value === '' || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}],\n [InputContext, {...inputProps, ref: inputRef}],\n [ButtonContext, clearButtonProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [GroupContext, {isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"SearchField.module.js.map"}
@@ -218,7 +218,7 @@ function $17f0ecdc17674b23$var$SelectInner({ props: props, selectRef: ref, colle
218
218
  validation
219
219
  ]
220
220
  ]
221
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($23VoQ$react))).createElement("div", {
221
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($23VoQ$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
222
222
  ...(0, $23VoQ$reactariautils.mergeProps)(DOMProps, renderProps, focusProps),
223
223
  ref: ref,
224
224
  slot: props.slot || undefined,
@@ -310,7 +310,7 @@ const $17f0ecdc17674b23$export$e288731fd71264f0 = /*#__PURE__*/ (0, $23VoQ$react
310
310
  let DOMProps = (0, $23VoQ$reactariautils.filterDOMProps)(props, {
311
311
  global: true
312
312
  });
313
- return /*#__PURE__*/ (0, ($parcel$interopDefault($23VoQ$react))).createElement("span", {
313
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($23VoQ$react))).createElement((0, $c5ccf687772c0422$exports.dom).span, {
314
314
  ref: ref,
315
315
  ...DOMProps,
316
316
  ...renderProps,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAiFM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAiE;AACnG,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA8C;AAKrF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAkE,KAAwB,EAAE,GAAiC;IACvM,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,cAAE,aAAa,kBAAO,YAAY,mBAAO,aAAa,OAAM,GAAG;IAC5E,IAAI,UAAU,CAAA,GAAA,oBAAM,EAAE,IACpB,OAAO,aAAa,aAChB,SAAS;YACT,QAAQ;wBACR;uBACA;wBACA;YACA,WAAW;YACX,gBAAgB;YAChB,iBAAiB;QACnB,KACE,UACH;QAAC;QAAU;QAAY;QAAW;KAAW;IAEhD,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,0DAAC;YAAY,OAAO;YAAO,YAAY;YAAY,WAAW;;AAGnF;AAEA,wCAAwC;AACxC,MAAM,uCAAiB;IAAC,CAAA,GAAA,sCAAW;IAAG,CAAA,GAAA,uCAAY;IAAG,CAAA,GAAA,qCAAU;CAAE;AAQjE,SAAS,kCAA8B,SAAC,KAAK,EAAE,WAAW,GAAG,cAAE,UAAU,EAAsB;IAC7F,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE,CAAA,GAAA,qCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4B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O;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QAAK,KAAK;QAAM,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,oBAAkB,MAAM,aAAa,CAAC,MAAM,KAAK,KAAK;qBAEnG,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Select.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 {AriaSelectProps, HiddenSelect, useFocusRing, useListFormatter, useLocalizedStringFormatter, useSelect} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {Collection, Node, SelectState, useSelectState} from 'react-stately';\nimport {CollectionBuilder, createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ItemRenderProps} from './Collection';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, Fragment, HTMLAttributes, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface SelectRenderProps {\n /**\n * Whether the select is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the select is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the select is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the select is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * Whether the select is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the select is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface SelectProps<T extends object = {}, M extends SelectionMode = 'single'> extends Omit<AriaSelectProps<T, M>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, 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-Select'\n */\n className?: ClassNameOrFunction<SelectRenderProps>,\n /**\n * Temporary text that occupies the select when it is empty.\n * @default 'Select an item' (localized)\n */\n placeholder?: string\n}\n\nexport const SelectContext = createContext<ContextValue<SelectProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const SelectStateContext = createContext<SelectState<unknown, SelectionMode> | null>(null);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport const Select = /*#__PURE__*/ (forwardRef as forwardRefType)(function Select<T extends object = {}, M extends SelectionMode = 'single'>(props: SelectProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;\n let content = useMemo(() => (\n typeof children === 'function'\n ? children({\n isOpen: false,\n isDisabled,\n isInvalid,\n isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n })\n : children\n ), [children, isDisabled, isInvalid, isRequired]);\n\n return (\n <CollectionBuilder content={content}>\n {collection => <SelectInner props={props} collection={collection} selectRef={ref} />}\n </CollectionBuilder>\n );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, TextContext];\n\ninterface SelectInnerProps<T extends object> {\n props: SelectProps<T, SelectionMode>,\n selectRef: ForwardedRef<HTMLDivElement>,\n collection: Collection<Node<T>>\n}\n\nfunction SelectInner<T extends object>({props, selectRef: ref, collection}: SelectInnerProps<T>) {\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useSelectState({\n ...props,\n collection,\n children: undefined,\n validationBehavior\n });\n\n let {isFocusVisible, focusProps} = useFocusRing({within: true});\n\n // Get props for child elements from useSelect\n let buttonRef = useRef<HTMLButtonElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n descriptionProps,\n errorMessageProps,\n hiddenSelectProps,\n ...validation\n } = useSelect({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, buttonRef);\n\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (buttonRef.current) {\n setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }\n }, [buttonRef]);\n\n useResizeObserver({\n ref: buttonRef,\n onResize: onResize\n });\n\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = useMemo(() => ({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [state.isOpen, state.isFocused, isFocusVisible, props.isDisabled, validation.isInvalid, props.isRequired]);\n\n let renderProps = useRenderProps({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [SelectContext, props],\n [SelectStateContext, state],\n [SelectValueContext, valueProps],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [ButtonContext, {...triggerProps, ref: buttonRef, isPressed: state.isOpen, autoFocus: props.autoFocus}],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: CLEAR_CONTEXTS\n }],\n [ListBoxContext, {...menuProps, ref: scrollRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-open={state.isOpen || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n {renderProps.children}\n <HiddenSelect\n {...hiddenSelectProps}\n autoComplete={props.autoComplete} />\n </div>\n </Provider>\n );\n}\n\nexport interface SelectValueRenderProps<T> {\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * The object value of the first selected item.\n * @deprecated\n */\n selectedItem: T | null,\n /** The object values of the currently selected items. */\n selectedItems: (T | null)[],\n /** The textValue of the currently selected items. */\n selectedText: string,\n /** The state of the select. */\n state: SelectState<T, 'single' | 'multiple'>\n}\n\nexport interface SelectValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<SelectValueRenderProps<T>> {\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-SelectValue'\n */\n className?: ClassNameOrFunction<SelectValueRenderProps<T>>\n}\n\nexport const SelectValueContext = createContext<ContextValue<SelectValueProps<any>, HTMLSpanElement>>(null);\n\n/**\n * SelectValue renders the current value of a Select, or a placeholder if no value is selected.\n * It is usually placed within the button element.\n */\nexport const SelectValue = /*#__PURE__*/ createHideableComponent(function SelectValue<T extends object>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n [props, ref] = useContextProps(props, ref, SelectValueContext);\n let state = useContext(SelectStateContext)! as SelectState<T, 'single' | 'multiple'>;\n let {placeholder} = useSlottedContext(SelectContext)!;\n let rendered = state.selectedItems.map((item) => {\n let rendered = item.props?.children;\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n if (typeof rendered === 'function') {\n let fn = rendered as (s: ItemRenderProps) => ReactNode;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n\n return rendered;\n });\n\n let formatter = useListFormatter();\n let textValue = useMemo(() => state.selectedItems.map(item => item?.textValue), [state.selectedItems]);\n let selectionMode = state.selectionManager.selectionMode;\n let selectedText = useMemo(() => (\n selectionMode === 'single' \n ? textValue[0] ?? '' \n : formatter.format(textValue)\n ), [selectionMode, formatter, textValue]);\n\n let defaultChildren = useMemo(() => {\n if (selectionMode === 'single') {\n return rendered[0];\n }\n\n let parts = formatter.formatToParts(textValue);\n if (parts.length === 0) {\n return null;\n }\n\n let index = 0;\n return parts.map(part => {\n if (part.type === 'element') {\n return <Fragment key={index}>{rendered[index++]}</Fragment>;\n } else {\n return part.value;\n }\n });\n }, [selectionMode, formatter, textValue, rendered]);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let renderProps = useRenderProps({\n ...props,\n defaultChildren: defaultChildren ?? placeholder ?? stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: state.selectedItems[0]?.value as T ?? null,\n selectedItems: useMemo(() => state.selectedItems.map(item => item.value as T ?? null), [state.selectedItems]),\n selectedText,\n isPlaceholder: state.selectedItems.length === 0,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <span ref={ref} {...DOMProps} {...renderProps} data-placeholder={state.selectedItems.length === 0 || undefined}>\n {/* clear description and error message slots */}\n <TextContext.Provider value={undefined}>\n {renderProps.children}\n </TextContext.Provider>\n </span>\n );\n});\n"],"names":[],"version":3,"file":"Select.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAkFM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAiE;AACnG,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA8C;AAKrF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAkE,KAAwB,EAAE,GAAiC;IACvM,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,cAAE,aAAa,kBAAO,YAAY,mBAAO,aAAa,OAAM,GAAG;IAC5E,IAAI,UAAU,CAAA,GAAA,oBAAM,EAAE,IACpB,OAAO,aAAa,aAChB,SAAS;YACT,QAAQ;wBACR;uBACA;wBACA;YACA,WAAW;YACX,gBAAgB;YAChB,iBAAiB;QACnB,KACE,UACH;QAAC;QAAU;QAAY;QAAW;KAAW;IAEhD,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,0DAAC;YAAY,OAAO;YAAO,YAAY;YAAY,WAAW;;AAGnF;AAEA,wCAAwC;AACxC,MAAM,uCAAiB;IAAC,CAAA,GAAA,sCAAW;IAAG,CAAA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,cAA7B,yCAAA,8BAAsC;YACpD,eAAe,CAAA,GAAA,oBAAM,EAAE,IAAM,MAAM,aAAa,CAAC,GAAG,CAAC,CAAA;wBAAQ;2BAAA,CAAA,cAAA,KAAK,KAAK,cAAV,yBAAA,cAAmB;oBAAO;gBAAC,MAAM,aAAa;aAAC;0BAC5G;YACA,eAAe,MAAM,aAAa,CAAC,MAAM,KAAK;mBAC9C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,IAAI;QAAC,KAAK;QAAM,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,oBAAkB,MAAM,aAAa,CAAC,MAAM,KAAK,KAAK;qBAEvG,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Select.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 {AriaSelectProps, HiddenSelect, useFocusRing, useListFormatter, useLocalizedStringFormatter, useSelect} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {Collection, Node, SelectState, useSelectState} from 'react-stately';\nimport {CollectionBuilder, createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ItemRenderProps} from './Collection';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, Fragment, HTMLAttributes, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface SelectRenderProps {\n /**\n * Whether the select is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the select is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the select is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the select is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * Whether the select is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the select is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface SelectProps<T extends object = {}, M extends SelectionMode = 'single'> extends Omit<AriaSelectProps<T, M>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, 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-Select'\n */\n className?: ClassNameOrFunction<SelectRenderProps>,\n /**\n * Temporary text that occupies the select when it is empty.\n * @default 'Select an item' (localized)\n */\n placeholder?: string\n}\n\nexport const SelectContext = createContext<ContextValue<SelectProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const SelectStateContext = createContext<SelectState<unknown, SelectionMode> | null>(null);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport const Select = /*#__PURE__*/ (forwardRef as forwardRefType)(function Select<T extends object = {}, M extends SelectionMode = 'single'>(props: SelectProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;\n let content = useMemo(() => (\n typeof children === 'function'\n ? children({\n isOpen: false,\n isDisabled,\n isInvalid,\n isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n })\n : children\n ), [children, isDisabled, isInvalid, isRequired]);\n\n return (\n <CollectionBuilder content={content}>\n {collection => <SelectInner props={props} collection={collection} selectRef={ref} />}\n </CollectionBuilder>\n );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, TextContext];\n\ninterface SelectInnerProps<T extends object> {\n props: SelectProps<T, SelectionMode>,\n selectRef: ForwardedRef<HTMLDivElement>,\n collection: Collection<Node<T>>\n}\n\nfunction SelectInner<T extends object>({props, selectRef: ref, collection}: SelectInnerProps<T>) {\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useSelectState({\n ...props,\n collection,\n children: undefined,\n validationBehavior\n });\n\n let {isFocusVisible, focusProps} = useFocusRing({within: true});\n\n // Get props for child elements from useSelect\n let buttonRef = useRef<HTMLButtonElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n descriptionProps,\n errorMessageProps,\n hiddenSelectProps,\n ...validation\n } = useSelect({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, buttonRef);\n\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (buttonRef.current) {\n setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }\n }, [buttonRef]);\n\n useResizeObserver({\n ref: buttonRef,\n onResize: onResize\n });\n\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = useMemo(() => ({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [state.isOpen, state.isFocused, isFocusVisible, props.isDisabled, validation.isInvalid, props.isRequired]);\n\n let renderProps = useRenderProps({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [SelectContext, props],\n [SelectStateContext, state],\n [SelectValueContext, valueProps],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [ButtonContext, {...triggerProps, ref: buttonRef, isPressed: state.isOpen, autoFocus: props.autoFocus}],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: CLEAR_CONTEXTS\n }],\n [ListBoxContext, {...menuProps, ref: scrollRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-open={state.isOpen || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n {renderProps.children}\n <HiddenSelect\n {...hiddenSelectProps}\n autoComplete={props.autoComplete} />\n </dom.div>\n </Provider>\n );\n}\n\nexport interface SelectValueRenderProps<T> {\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * The object value of the first selected item.\n * @deprecated\n */\n selectedItem: T | null,\n /** The object values of the currently selected items. */\n selectedItems: (T | null)[],\n /** The textValue of the currently selected items. */\n selectedText: string,\n /** The state of the select. */\n state: SelectState<T, 'single' | 'multiple'>\n}\n\nexport interface SelectValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<SelectValueRenderProps<T>, 'span'> {\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-SelectValue'\n */\n className?: ClassNameOrFunction<SelectValueRenderProps<T>>\n}\n\nexport const SelectValueContext = createContext<ContextValue<SelectValueProps<any>, HTMLSpanElement>>(null);\n\n/**\n * SelectValue renders the current value of a Select, or a placeholder if no value is selected.\n * It is usually placed within the button element.\n */\nexport const SelectValue = /*#__PURE__*/ createHideableComponent(function SelectValue<T extends object>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n [props, ref] = useContextProps(props, ref, SelectValueContext);\n let state = useContext(SelectStateContext)! as SelectState<T, 'single' | 'multiple'>;\n let {placeholder} = useSlottedContext(SelectContext)!;\n let rendered = state.selectedItems.map((item) => {\n let rendered = item.props?.children;\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n if (typeof rendered === 'function') {\n let fn = rendered as (s: ItemRenderProps) => ReactNode;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n\n return rendered;\n });\n\n let formatter = useListFormatter();\n let textValue = useMemo(() => state.selectedItems.map(item => item?.textValue), [state.selectedItems]);\n let selectionMode = state.selectionManager.selectionMode;\n let selectedText = useMemo(() => (\n selectionMode === 'single' \n ? textValue[0] ?? '' \n : formatter.format(textValue)\n ), [selectionMode, formatter, textValue]);\n\n let defaultChildren = useMemo(() => {\n if (selectionMode === 'single') {\n return rendered[0];\n }\n\n let parts = formatter.formatToParts(textValue);\n if (parts.length === 0) {\n return null;\n }\n\n let index = 0;\n return parts.map(part => {\n if (part.type === 'element') {\n return <Fragment key={index}>{rendered[index++]}</Fragment>;\n } else {\n return part.value;\n }\n });\n }, [selectionMode, formatter, textValue, rendered]);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let renderProps = useRenderProps({\n ...props,\n defaultChildren: defaultChildren ?? placeholder ?? stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: state.selectedItems[0]?.value as T ?? null,\n selectedItems: useMemo(() => state.selectedItems.map(item => item.value as T ?? null), [state.selectedItems]),\n selectedText,\n isPlaceholder: state.selectedItems.length === 0,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.span ref={ref} {...DOMProps} {...renderProps} data-placeholder={state.selectedItems.length === 0 || undefined}>\n {/* clear description and error message slots */}\n <TextContext.Provider value={undefined}>\n {renderProps.children}\n </TextContext.Provider>\n </dom.span>\n );\n});\n"],"names":[],"version":3,"file":"Select.main.js.map"}
package/dist/Select.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
2
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
2
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
3
3
  import {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from "./FieldError.mjs";
4
4
  import {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from "./Form.mjs";
5
5
  import $akiWb$intlStringsmodulejs from "./intlStrings.mjs";
@@ -208,7 +208,7 @@ function $82d7e5349645de74$var$SelectInner({ props: props, selectRef: ref, colle
208
208
  validation
209
209
  ]
210
210
  ]
211
- }, /*#__PURE__*/ (0, $akiWb$react).createElement("div", {
211
+ }, /*#__PURE__*/ (0, $akiWb$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
212
212
  ...(0, $akiWb$mergeProps)(DOMProps, renderProps, focusProps),
213
213
  ref: ref,
214
214
  slot: props.slot || undefined,
@@ -300,7 +300,7 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ (0, $akiWb$creat
300
300
  let DOMProps = (0, $akiWb$filterDOMProps)(props, {
301
301
  global: true
302
302
  });
303
- return /*#__PURE__*/ (0, $akiWb$react).createElement("span", {
303
+ return /*#__PURE__*/ (0, $akiWb$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).span, {
304
304
  ref: ref,
305
305
  ...DOMProps,
306
306
  ...renderProps,
@@ -1,5 +1,5 @@
1
1
  import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.module.js";
2
- import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
2
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
3
3
  import {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from "./FieldError.module.js";
4
4
  import {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from "./Form.module.js";
5
5
  import $akiWb$intlStringsmodulejs from "./intlStrings.module.js";
@@ -208,7 +208,7 @@ function $82d7e5349645de74$var$SelectInner({ props: props, selectRef: ref, colle
208
208
  validation
209
209
  ]
210
210
  ]
211
- }, /*#__PURE__*/ (0, $akiWb$react).createElement("div", {
211
+ }, /*#__PURE__*/ (0, $akiWb$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
212
212
  ...(0, $akiWb$mergeProps)(DOMProps, renderProps, focusProps),
213
213
  ref: ref,
214
214
  slot: props.slot || undefined,
@@ -300,7 +300,7 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ (0, $akiWb$creat
300
300
  let DOMProps = (0, $akiWb$filterDOMProps)(props, {
301
301
  global: true
302
302
  });
303
- return /*#__PURE__*/ (0, $akiWb$react).createElement("span", {
303
+ return /*#__PURE__*/ (0, $akiWb$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).span, {
304
304
  ref: ref,
305
305
  ...DOMProps,
306
306
  ...renderProps,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAiFM,MAA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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 {AriaSelectProps, HiddenSelect, useFocusRing, useListFormatter, useLocalizedStringFormatter, useSelect} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {Collection, Node, SelectState, useSelectState} from 'react-stately';\nimport {CollectionBuilder, createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ItemRenderProps} from './Collection';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, Fragment, HTMLAttributes, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface SelectRenderProps {\n /**\n * Whether the select is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the select is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the select is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the select is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * Whether the select is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the select is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface SelectProps<T extends object = {}, M extends SelectionMode = 'single'> extends Omit<AriaSelectProps<T, M>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, 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-Select'\n */\n className?: ClassNameOrFunction<SelectRenderProps>,\n /**\n * Temporary text that occupies the select when it is empty.\n * @default 'Select an item' (localized)\n */\n placeholder?: string\n}\n\nexport const SelectContext = createContext<ContextValue<SelectProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const SelectStateContext = createContext<SelectState<unknown, SelectionMode> | null>(null);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport const Select = /*#__PURE__*/ (forwardRef as forwardRefType)(function Select<T extends object = {}, M extends SelectionMode = 'single'>(props: SelectProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;\n let content = useMemo(() => (\n typeof children === 'function'\n ? children({\n isOpen: false,\n isDisabled,\n isInvalid,\n isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n })\n : children\n ), [children, isDisabled, isInvalid, isRequired]);\n\n return (\n <CollectionBuilder content={content}>\n {collection => <SelectInner props={props} collection={collection} selectRef={ref} />}\n </CollectionBuilder>\n );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, TextContext];\n\ninterface SelectInnerProps<T extends object> {\n props: SelectProps<T, SelectionMode>,\n selectRef: ForwardedRef<HTMLDivElement>,\n collection: Collection<Node<T>>\n}\n\nfunction SelectInner<T extends object>({props, selectRef: ref, collection}: SelectInnerProps<T>) {\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useSelectState({\n ...props,\n collection,\n children: undefined,\n validationBehavior\n });\n\n let {isFocusVisible, focusProps} = useFocusRing({within: true});\n\n // Get props for child elements from useSelect\n let buttonRef = useRef<HTMLButtonElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n descriptionProps,\n errorMessageProps,\n hiddenSelectProps,\n ...validation\n } = useSelect({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, buttonRef);\n\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (buttonRef.current) {\n setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }\n }, [buttonRef]);\n\n useResizeObserver({\n ref: buttonRef,\n onResize: onResize\n });\n\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = useMemo(() => ({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [state.isOpen, state.isFocused, isFocusVisible, props.isDisabled, validation.isInvalid, props.isRequired]);\n\n let renderProps = useRenderProps({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [SelectContext, props],\n [SelectStateContext, state],\n [SelectValueContext, valueProps],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [ButtonContext, {...triggerProps, ref: buttonRef, isPressed: state.isOpen, autoFocus: props.autoFocus}],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: CLEAR_CONTEXTS\n }],\n [ListBoxContext, {...menuProps, ref: scrollRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-open={state.isOpen || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n {renderProps.children}\n <HiddenSelect\n {...hiddenSelectProps}\n autoComplete={props.autoComplete} />\n </div>\n </Provider>\n );\n}\n\nexport interface SelectValueRenderProps<T> {\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * The object value of the first selected item.\n * @deprecated\n */\n selectedItem: T | null,\n /** The object values of the currently selected items. */\n selectedItems: (T | null)[],\n /** The textValue of the currently selected items. */\n selectedText: string,\n /** The state of the select. */\n state: SelectState<T, 'single' | 'multiple'>\n}\n\nexport interface SelectValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<SelectValueRenderProps<T>> {\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-SelectValue'\n */\n className?: ClassNameOrFunction<SelectValueRenderProps<T>>\n}\n\nexport const SelectValueContext = createContext<ContextValue<SelectValueProps<any>, HTMLSpanElement>>(null);\n\n/**\n * SelectValue renders the current value of a Select, or a placeholder if no value is selected.\n * It is usually placed within the button element.\n */\nexport const SelectValue = /*#__PURE__*/ createHideableComponent(function SelectValue<T extends object>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n [props, ref] = useContextProps(props, ref, SelectValueContext);\n let state = useContext(SelectStateContext)! as SelectState<T, 'single' | 'multiple'>;\n let {placeholder} = useSlottedContext(SelectContext)!;\n let rendered = state.selectedItems.map((item) => {\n let rendered = item.props?.children;\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n if (typeof rendered === 'function') {\n let fn = rendered as (s: ItemRenderProps) => ReactNode;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n\n return rendered;\n });\n\n let formatter = useListFormatter();\n let textValue = useMemo(() => state.selectedItems.map(item => item?.textValue), [state.selectedItems]);\n let selectionMode = state.selectionManager.selectionMode;\n let selectedText = useMemo(() => (\n selectionMode === 'single' \n ? textValue[0] ?? '' \n : formatter.format(textValue)\n ), [selectionMode, formatter, textValue]);\n\n let defaultChildren = useMemo(() => {\n if (selectionMode === 'single') {\n return rendered[0];\n }\n\n let parts = formatter.formatToParts(textValue);\n if (parts.length === 0) {\n return null;\n }\n\n let index = 0;\n return parts.map(part => {\n if (part.type === 'element') {\n return <Fragment key={index}>{rendered[index++]}</Fragment>;\n } else {\n return part.value;\n }\n });\n }, [selectionMode, formatter, textValue, rendered]);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let renderProps = useRenderProps({\n ...props,\n defaultChildren: defaultChildren ?? placeholder ?? stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: state.selectedItems[0]?.value as T ?? null,\n selectedItems: useMemo(() => state.selectedItems.map(item => item.value as T ?? null), [state.selectedItems]),\n selectedText,\n isPlaceholder: state.selectedItems.length === 0,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <span ref={ref} {...DOMProps} {...renderProps} data-placeholder={state.selectedItems.length === 0 || undefined}>\n {/* clear description and error message slots */}\n <TextContext.Provider value={undefined}>\n {renderProps.children}\n </TextContext.Provider>\n </span>\n );\n});\n"],"names":[],"version":3,"file":"Select.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAkFM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAiE;AACnG,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA8C;AAKrF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAkE,KAAwB,EAAE,GAAiC;IACvM,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,cAAE,aAAa,kBAAO,YAAY,mBAAO,aAAa,OAAM,GAAG;IAC5E,IAAI,UAAU,CAAA,GAAA,cAAM,EAAE,IACpB,OAAO,aAAa,aAChB,SAAS;YACT,QAAQ;wBACR;uBACA;wBACA;YACA,WAAW;YACX,gBAAgB;YAChB,iBAAiB;QACnB,KACE,UACH;QAAC;QAAU;QAAY;QAAW;KAAW;IAEhD,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,gCAAC;YAAY,OAAO;YAAO,YAAY;YAAY,WAAW;;AAGnF;AAEA,wCAAwC;AACxC,MAAM,uCAAiB;IAAC,CAAA,GAAA,yCAAW;IAAG,CAAA,GAAA,yCAAY;IAAG,CAAA,GAAA,yCAAU;CAAE;AAQjE,SAAS,kCAA8B,SAAC,KAAK,EAAE,WAAW,GAAG,cAAE,UAAU,EAAsB;IAC7F,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,O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AAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,IAAI;QAAC,KAAK;QAAM,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,oBAAkB,MAAM,aAAa,CAAC,MAAM,KAAK,KAAK;qBAEvG,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Select.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 {AriaSelectProps, HiddenSelect, useFocusRing, useListFormatter, useLocalizedStringFormatter, useSelect} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {Collection, Node, SelectState, useSelectState} from 'react-stately';\nimport {CollectionBuilder, createHideableComponent} from '@react-aria/collections';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ItemRenderProps} from './Collection';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, Fragment, HTMLAttributes, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface SelectRenderProps {\n /**\n * Whether the select is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the select is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the select is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the select is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * Whether the select is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the select is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface SelectProps<T extends object = {}, M extends SelectionMode = 'single'> extends Omit<AriaSelectProps<T, M>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, 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-Select'\n */\n className?: ClassNameOrFunction<SelectRenderProps>,\n /**\n * Temporary text that occupies the select when it is empty.\n * @default 'Select an item' (localized)\n */\n placeholder?: string\n}\n\nexport const SelectContext = createContext<ContextValue<SelectProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const SelectStateContext = createContext<SelectState<unknown, SelectionMode> | null>(null);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport const Select = /*#__PURE__*/ (forwardRef as forwardRefType)(function Select<T extends object = {}, M extends SelectionMode = 'single'>(props: SelectProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;\n let content = useMemo(() => (\n typeof children === 'function'\n ? children({\n isOpen: false,\n isDisabled,\n isInvalid,\n isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n })\n : children\n ), [children, isDisabled, isInvalid, isRequired]);\n\n return (\n <CollectionBuilder content={content}>\n {collection => <SelectInner props={props} collection={collection} selectRef={ref} />}\n </CollectionBuilder>\n );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, TextContext];\n\ninterface SelectInnerProps<T extends object> {\n props: SelectProps<T, SelectionMode>,\n selectRef: ForwardedRef<HTMLDivElement>,\n collection: Collection<Node<T>>\n}\n\nfunction SelectInner<T extends object>({props, selectRef: ref, collection}: SelectInnerProps<T>) {\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useSelectState({\n ...props,\n collection,\n children: undefined,\n validationBehavior\n });\n\n let {isFocusVisible, focusProps} = useFocusRing({within: true});\n\n // Get props for child elements from useSelect\n let buttonRef = useRef<HTMLButtonElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n descriptionProps,\n errorMessageProps,\n hiddenSelectProps,\n ...validation\n } = useSelect({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, buttonRef);\n\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (buttonRef.current) {\n setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }\n }, [buttonRef]);\n\n useResizeObserver({\n ref: buttonRef,\n onResize: onResize\n });\n\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = useMemo(() => ({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [state.isOpen, state.isFocused, isFocusVisible, props.isDisabled, validation.isInvalid, props.isRequired]);\n\n let renderProps = useRenderProps({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [SelectContext, props],\n [SelectStateContext, state],\n [SelectValueContext, valueProps],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [ButtonContext, {...triggerProps, ref: buttonRef, isPressed: state.isOpen, autoFocus: props.autoFocus}],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: CLEAR_CONTEXTS\n }],\n [ListBoxContext, {...menuProps, ref: scrollRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-open={state.isOpen || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n {renderProps.children}\n <HiddenSelect\n {...hiddenSelectProps}\n autoComplete={props.autoComplete} />\n </dom.div>\n </Provider>\n );\n}\n\nexport interface SelectValueRenderProps<T> {\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * The object value of the first selected item.\n * @deprecated\n */\n selectedItem: T | null,\n /** The object values of the currently selected items. */\n selectedItems: (T | null)[],\n /** The textValue of the currently selected items. */\n selectedText: string,\n /** The state of the select. */\n state: SelectState<T, 'single' | 'multiple'>\n}\n\nexport interface SelectValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<SelectValueRenderProps<T>, 'span'> {\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-SelectValue'\n */\n className?: ClassNameOrFunction<SelectValueRenderProps<T>>\n}\n\nexport const SelectValueContext = createContext<ContextValue<SelectValueProps<any>, HTMLSpanElement>>(null);\n\n/**\n * SelectValue renders the current value of a Select, or a placeholder if no value is selected.\n * It is usually placed within the button element.\n */\nexport const SelectValue = /*#__PURE__*/ createHideableComponent(function SelectValue<T extends object>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n [props, ref] = useContextProps(props, ref, SelectValueContext);\n let state = useContext(SelectStateContext)! as SelectState<T, 'single' | 'multiple'>;\n let {placeholder} = useSlottedContext(SelectContext)!;\n let rendered = state.selectedItems.map((item) => {\n let rendered = item.props?.children;\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n if (typeof rendered === 'function') {\n let fn = rendered as (s: ItemRenderProps) => ReactNode;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n\n return rendered;\n });\n\n let formatter = useListFormatter();\n let textValue = useMemo(() => state.selectedItems.map(item => item?.textValue), [state.selectedItems]);\n let selectionMode = state.selectionManager.selectionMode;\n let selectedText = useMemo(() => (\n selectionMode === 'single' \n ? textValue[0] ?? '' \n : formatter.format(textValue)\n ), [selectionMode, formatter, textValue]);\n\n let defaultChildren = useMemo(() => {\n if (selectionMode === 'single') {\n return rendered[0];\n }\n\n let parts = formatter.formatToParts(textValue);\n if (parts.length === 0) {\n return null;\n }\n\n let index = 0;\n return parts.map(part => {\n if (part.type === 'element') {\n return <Fragment key={index}>{rendered[index++]}</Fragment>;\n } else {\n return part.value;\n }\n });\n }, [selectionMode, formatter, textValue, rendered]);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let renderProps = useRenderProps({\n ...props,\n defaultChildren: defaultChildren ?? placeholder ?? stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: state.selectedItems[0]?.value as T ?? null,\n selectedItems: useMemo(() => state.selectedItems.map(item => item.value as T ?? null), [state.selectedItems]),\n selectedText,\n isPlaceholder: state.selectedItems.length === 0,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.span ref={ref} {...DOMProps} {...renderProps} data-placeholder={state.selectedItems.length === 0 || undefined}>\n {/* clear description and error message slots */}\n <TextContext.Provider value={undefined}>\n {renderProps.children}\n </TextContext.Provider>\n </dom.span>\n );\n});\n"],"names":[],"version":3,"file":"Select.module.js.map"}
@@ -48,6 +48,7 @@ const $54b202ace195eaa4$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $6jQ43$react
48
48
  let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
49
49
  let Element = elementType || 'hr';
50
50
  if (Element === 'hr' && orientation === 'vertical') Element = 'div';
51
+ let ElementType = (0, $c5ccf687772c0422$exports.dom)[Element];
51
52
  let { separatorProps: separatorProps } = (0, $6jQ43$reactaria.useSeparator)({
52
53
  ...otherProps,
53
54
  elementType: elementType,
@@ -56,7 +57,8 @@ const $54b202ace195eaa4$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $6jQ43$react
56
57
  let DOMProps = (0, $6jQ43$reactariautils.filterDOMProps)(props, {
57
58
  global: true
58
59
  });
59
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6jQ43$react))).createElement(Element, {
60
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($6jQ43$react))).createElement(ElementType, {
61
+ render: props.render,
60
62
  ...(0, $6jQ43$reactariautils.mergeProps)(DOMProps, separatorProps),
61
63
  style: style,
62
64
  className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,0CAAa;IAG9C,OAAO,UAA+B,EAAE,aAAkC,EAA8B;QACtG,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAba,0CACK,OAAO;AAiBlB,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,2CAAe,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAChJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,AAAC,eAA+B;IAC9C,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria';\nimport {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {ContextValue, SlotProps, StyleProps, useContextProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-Separator'\n */\n className?: string\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = (elementType as ElementType) || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <Element\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Separator.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,0CAAa;IAG9C,OAAO,UAA+B,EAAE,aAAkC,EAA8B;QACtG,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAba,0CACK,OAAO;AAiBlB,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,2CAAe,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAChJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,6BAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria';\nimport {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, DOMRenderProps<'hr' | 'div', undefined>, GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-Separator'\n */\n className?: string\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = elementType || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let ElementType = dom[Element];\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <ElementType\n render={props.render}\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Separator.main.js.map"}
@@ -1,4 +1,4 @@
1
- import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.mjs";
1
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.mjs";
2
2
  import {useSeparator as $i9JCE$useSeparator} from "react-aria";
3
3
  import {CollectionNode as $i9JCE$CollectionNode, createLeafComponent as $i9JCE$createLeafComponent} from "@react-aria/collections";
4
4
  import {filterDOMProps as $i9JCE$filterDOMProps, mergeProps as $i9JCE$mergeProps} from "@react-aria/utils";
@@ -37,6 +37,7 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
37
37
  let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
38
38
  let Element = elementType || 'hr';
39
39
  if (Element === 'hr' && orientation === 'vertical') Element = 'div';
40
+ let ElementType = (0, $64fa3d84918910a7$export$df3a06d6289f983e)[Element];
40
41
  let { separatorProps: separatorProps } = (0, $i9JCE$useSeparator)({
41
42
  ...otherProps,
42
43
  elementType: elementType,
@@ -45,7 +46,8 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
45
46
  let DOMProps = (0, $i9JCE$filterDOMProps)(props, {
46
47
  global: true
47
48
  });
48
- return /*#__PURE__*/ (0, $i9JCE$react).createElement(Element, {
49
+ return /*#__PURE__*/ (0, $i9JCE$react).createElement(ElementType, {
50
+ render: props.render,
49
51
  ...(0, $i9JCE$mergeProps)(DOMProps, separatorProps),
50
52
  style: style,
51
53
  className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
@@ -1,4 +1,4 @@
1
- import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.module.js";
1
+ import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.module.js";
2
2
  import {useSeparator as $i9JCE$useSeparator} from "react-aria";
3
3
  import {CollectionNode as $i9JCE$CollectionNode, createLeafComponent as $i9JCE$createLeafComponent} from "@react-aria/collections";
4
4
  import {filterDOMProps as $i9JCE$filterDOMProps, mergeProps as $i9JCE$mergeProps} from "@react-aria/utils";
@@ -37,6 +37,7 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
37
37
  let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
38
38
  let Element = elementType || 'hr';
39
39
  if (Element === 'hr' && orientation === 'vertical') Element = 'div';
40
+ let ElementType = (0, $64fa3d84918910a7$export$df3a06d6289f983e)[Element];
40
41
  let { separatorProps: separatorProps } = (0, $i9JCE$useSeparator)({
41
42
  ...otherProps,
42
43
  elementType: elementType,
@@ -45,7 +46,8 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
45
46
  let DOMProps = (0, $i9JCE$filterDOMProps)(props, {
46
47
  global: true
47
48
  });
48
- return /*#__PURE__*/ (0, $i9JCE$react).createElement(Element, {
49
+ return /*#__PURE__*/ (0, $i9JCE$react).createElement(ElementType, {
50
+ render: props.render,
49
51
  ...(0, $i9JCE$mergeProps)(DOMProps, separatorProps),
50
52
  style: style,
51
53
  className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,qBAAa;IAG9C,OAAO,UAA+B,EAAE,aAAkC,EAA8B;QACtG,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAba,0CACK,OAAO;AAiBlB,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,2CAAe,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAChJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,AAAC,eAA+B;IAC9C,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria';\nimport {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {ContextValue, SlotProps, StyleProps, useContextProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ElementType, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-Separator'\n */\n className?: string\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = (elementType as ElementType) || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <Element\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Separator.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,qBAAa;IAG9C,OAAO,UAA+B,EAAE,aAAkC,EAA8B;QACtG,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAba,0CACK,OAAO;AAiBlB,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,2CAAe,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAChJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria';\nimport {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, DOMRenderProps<'hr' | 'div', undefined>, GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-Separator'\n */\n className?: string\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = elementType || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let ElementType = dom[Element];\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <ElementType\n render={props.render}\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"Separator.module.js.map"}
@@ -38,7 +38,7 @@ function $2d10bc562fea46b3$export$758399f318e6385a(props) {
38
38
  }, props.children);
39
39
  }
40
40
  const $2d10bc562fea46b3$export$c34620ff8881d89f = /*#__PURE__*/ (0, $aakJU$react.forwardRef)(function SharedElement(props, ref) {
41
- let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, ...divProps } = props;
41
+ let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, render: render, ...divProps } = props;
42
42
  let [state, setState] = (0, $aakJU$react.useState)(isVisible ? 'visible' : 'hidden');
43
43
  let scopeRef = (0, $aakJU$react.useContext)($2d10bc562fea46b3$var$SharedElementContext);
44
44
  if (!scopeRef) throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');
@@ -120,13 +120,14 @@ const $2d10bc562fea46b3$export$c34620ff8881d89f = /*#__PURE__*/ (0, $aakJU$react
120
120
  children: children,
121
121
  className: className,
122
122
  style: style,
123
+ render: render,
123
124
  values: {
124
125
  isEntering: state === 'entering',
125
126
  isExiting: state === 'exiting'
126
127
  }
127
128
  });
128
129
  if (state === 'hidden') return null;
129
- return /*#__PURE__*/ (0, ($parcel$interopDefault($aakJU$react))).createElement("div", {
130
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($aakJU$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
130
131
  ...divProps,
131
132
  ...renderProps,
132
133
  ref: ref,