@depup/react-aria-components 1.19.0-depup.27 → 1.21.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/NavigationTree/package.json +5 -0
  2. package/PreviewTrigger/package.json +5 -0
  3. package/README.md +2 -2
  4. package/TokenField/package.json +5 -0
  5. package/changes.json +1 -1
  6. package/dist/exports/GridList.cjs.map +1 -1
  7. package/dist/exports/GridList.js.map +1 -1
  8. package/dist/exports/GridList.mjs.map +1 -1
  9. package/dist/exports/Menu.cjs +1 -0
  10. package/dist/exports/Menu.cjs.map +1 -1
  11. package/dist/exports/Menu.js +2 -2
  12. package/dist/exports/Menu.js.map +1 -1
  13. package/dist/exports/Menu.mjs +2 -2
  14. package/dist/exports/Menu.mjs.map +1 -1
  15. package/dist/exports/NavigationTree.cjs +37 -0
  16. package/dist/exports/NavigationTree.cjs.map +1 -0
  17. package/dist/exports/NavigationTree.js +25 -0
  18. package/dist/exports/NavigationTree.js.map +1 -0
  19. package/dist/exports/NavigationTree.mjs +25 -0
  20. package/dist/exports/NavigationTree.mjs.map +1 -0
  21. package/dist/exports/PreviewTrigger.cjs +26 -0
  22. package/dist/exports/PreviewTrigger.cjs.map +1 -0
  23. package/dist/exports/PreviewTrigger.js +21 -0
  24. package/dist/exports/PreviewTrigger.js.map +1 -0
  25. package/dist/exports/PreviewTrigger.mjs +21 -0
  26. package/dist/exports/PreviewTrigger.mjs.map +1 -0
  27. package/dist/exports/TokenField.cjs +31 -0
  28. package/dist/exports/TokenField.cjs.map +1 -0
  29. package/dist/exports/TokenField.js +21 -0
  30. package/dist/exports/TokenField.js.map +1 -0
  31. package/dist/exports/TokenField.mjs +21 -0
  32. package/dist/exports/TokenField.mjs.map +1 -0
  33. package/dist/exports/Tree.cjs.map +1 -1
  34. package/dist/exports/Tree.js.map +1 -1
  35. package/dist/exports/Tree.mjs.map +1 -1
  36. package/dist/exports/index.cjs +25 -0
  37. package/dist/exports/index.cjs.map +1 -1
  38. package/dist/exports/index.js +12 -2
  39. package/dist/exports/index.js.map +1 -1
  40. package/dist/exports/index.mjs +12 -2
  41. package/dist/exports/index.mjs.map +1 -1
  42. package/dist/private/Checkbox.cjs.map +1 -1
  43. package/dist/private/Checkbox.js.map +1 -1
  44. package/dist/private/Checkbox.mjs.map +1 -1
  45. package/dist/private/ComboBox.cjs +21 -2
  46. package/dist/private/ComboBox.cjs.map +1 -1
  47. package/dist/private/ComboBox.js +21 -2
  48. package/dist/private/ComboBox.js.map +1 -1
  49. package/dist/private/ComboBox.mjs +21 -2
  50. package/dist/private/ComboBox.mjs.map +1 -1
  51. package/dist/private/Dialog.cjs +21 -1
  52. package/dist/private/Dialog.cjs.map +1 -1
  53. package/dist/private/Dialog.js +21 -1
  54. package/dist/private/Dialog.js.map +1 -1
  55. package/dist/private/Dialog.mjs +21 -1
  56. package/dist/private/Dialog.mjs.map +1 -1
  57. package/dist/private/DragAndDrop.cjs +1 -0
  58. package/dist/private/DragAndDrop.cjs.map +1 -1
  59. package/dist/private/DragAndDrop.js +1 -0
  60. package/dist/private/DragAndDrop.js.map +1 -1
  61. package/dist/private/DragAndDrop.mjs +1 -0
  62. package/dist/private/DragAndDrop.mjs.map +1 -1
  63. package/dist/private/DropZone.cjs +5 -2
  64. package/dist/private/DropZone.cjs.map +1 -1
  65. package/dist/private/DropZone.js +5 -3
  66. package/dist/private/DropZone.js.map +1 -1
  67. package/dist/private/DropZone.mjs +5 -2
  68. package/dist/private/DropZone.mjs.map +1 -1
  69. package/dist/private/FileTrigger.cjs +1 -0
  70. package/dist/private/FileTrigger.cjs.map +1 -1
  71. package/dist/private/FileTrigger.js +1 -0
  72. package/dist/private/FileTrigger.js.map +1 -1
  73. package/dist/private/FileTrigger.mjs +1 -0
  74. package/dist/private/FileTrigger.mjs.map +1 -1
  75. package/dist/private/GridLayout.cjs +3 -1
  76. package/dist/private/GridLayout.cjs.map +1 -1
  77. package/dist/private/GridLayout.js +3 -1
  78. package/dist/private/GridLayout.js.map +1 -1
  79. package/dist/private/GridLayout.mjs +3 -1
  80. package/dist/private/GridLayout.mjs.map +1 -1
  81. package/dist/private/GridList.cjs +12 -1
  82. package/dist/private/GridList.cjs.map +1 -1
  83. package/dist/private/GridList.js +12 -1
  84. package/dist/private/GridList.js.map +1 -1
  85. package/dist/private/GridList.mjs +12 -1
  86. package/dist/private/GridList.mjs.map +1 -1
  87. package/dist/private/ListBox.cjs +9 -1
  88. package/dist/private/ListBox.cjs.map +1 -1
  89. package/dist/private/ListBox.js +9 -1
  90. package/dist/private/ListBox.js.map +1 -1
  91. package/dist/private/ListBox.mjs +9 -1
  92. package/dist/private/ListBox.mjs.map +1 -1
  93. package/dist/private/Menu.cjs +59 -2
  94. package/dist/private/Menu.cjs.map +1 -1
  95. package/dist/private/Menu.js +60 -4
  96. package/dist/private/Menu.js.map +1 -1
  97. package/dist/private/Menu.mjs +60 -4
  98. package/dist/private/Menu.mjs.map +1 -1
  99. package/dist/private/Meter.cjs +2 -1
  100. package/dist/private/Meter.cjs.map +1 -1
  101. package/dist/private/Meter.js +2 -1
  102. package/dist/private/Meter.js.map +1 -1
  103. package/dist/private/Meter.mjs +2 -1
  104. package/dist/private/Meter.mjs.map +1 -1
  105. package/dist/private/Modal.cjs +2 -0
  106. package/dist/private/Modal.cjs.map +1 -1
  107. package/dist/private/Modal.js +2 -0
  108. package/dist/private/Modal.js.map +1 -1
  109. package/dist/private/Modal.mjs +2 -0
  110. package/dist/private/Modal.mjs.map +1 -1
  111. package/dist/private/NavigationTree.cjs +272 -0
  112. package/dist/private/NavigationTree.cjs.map +1 -0
  113. package/dist/private/NavigationTree.js +258 -0
  114. package/dist/private/NavigationTree.js.map +1 -0
  115. package/dist/private/NavigationTree.mjs +257 -0
  116. package/dist/private/NavigationTree.mjs.map +1 -0
  117. package/dist/private/Popover.cjs +34 -9
  118. package/dist/private/Popover.cjs.map +1 -1
  119. package/dist/private/Popover.js +34 -9
  120. package/dist/private/Popover.js.map +1 -1
  121. package/dist/private/Popover.mjs +34 -9
  122. package/dist/private/Popover.mjs.map +1 -1
  123. package/dist/private/PreviewTrigger.cjs +88 -0
  124. package/dist/private/PreviewTrigger.cjs.map +1 -0
  125. package/dist/private/PreviewTrigger.js +80 -0
  126. package/dist/private/PreviewTrigger.js.map +1 -0
  127. package/dist/private/PreviewTrigger.mjs +79 -0
  128. package/dist/private/PreviewTrigger.mjs.map +1 -0
  129. package/dist/private/ProgressBar.cjs +6 -1
  130. package/dist/private/ProgressBar.cjs.map +1 -1
  131. package/dist/private/ProgressBar.js +6 -1
  132. package/dist/private/ProgressBar.js.map +1 -1
  133. package/dist/private/ProgressBar.mjs +6 -1
  134. package/dist/private/ProgressBar.mjs.map +1 -1
  135. package/dist/private/RadioGroup.cjs.map +1 -1
  136. package/dist/private/RadioGroup.js.map +1 -1
  137. package/dist/private/RadioGroup.mjs.map +1 -1
  138. package/dist/private/Select.cjs.map +1 -1
  139. package/dist/private/Select.js.map +1 -1
  140. package/dist/private/Select.mjs.map +1 -1
  141. package/dist/private/Switch.cjs +8 -2
  142. package/dist/private/Switch.cjs.map +1 -1
  143. package/dist/private/Switch.js +9 -3
  144. package/dist/private/Switch.js.map +1 -1
  145. package/dist/private/Switch.mjs +9 -3
  146. package/dist/private/Switch.mjs.map +1 -1
  147. package/dist/private/Table.cjs +26 -14
  148. package/dist/private/Table.cjs.map +1 -1
  149. package/dist/private/Table.js +26 -14
  150. package/dist/private/Table.js.map +1 -1
  151. package/dist/private/Table.mjs +26 -14
  152. package/dist/private/Table.mjs.map +1 -1
  153. package/dist/private/TableLayout.cjs +3 -1
  154. package/dist/private/TableLayout.cjs.map +1 -1
  155. package/dist/private/TableLayout.js +3 -1
  156. package/dist/private/TableLayout.js.map +1 -1
  157. package/dist/private/TableLayout.mjs +3 -1
  158. package/dist/private/TableLayout.mjs.map +1 -1
  159. package/dist/private/TagGroup.cjs +1 -0
  160. package/dist/private/TagGroup.cjs.map +1 -1
  161. package/dist/private/TagGroup.js +1 -0
  162. package/dist/private/TagGroup.js.map +1 -1
  163. package/dist/private/TagGroup.mjs +1 -0
  164. package/dist/private/TagGroup.mjs.map +1 -1
  165. package/dist/private/Text.cjs +3 -1
  166. package/dist/private/Text.cjs.map +1 -1
  167. package/dist/private/Text.js +4 -2
  168. package/dist/private/Text.js.map +1 -1
  169. package/dist/private/Text.mjs +4 -2
  170. package/dist/private/Text.mjs.map +1 -1
  171. package/dist/private/ToggleButton.cjs.map +1 -1
  172. package/dist/private/ToggleButton.js.map +1 -1
  173. package/dist/private/ToggleButton.mjs.map +1 -1
  174. package/dist/private/TokenField.cjs +235 -0
  175. package/dist/private/TokenField.cjs.map +1 -0
  176. package/dist/private/TokenField.js +225 -0
  177. package/dist/private/TokenField.js.map +1 -0
  178. package/dist/private/TokenField.mjs +223 -0
  179. package/dist/private/TokenField.mjs.map +1 -0
  180. package/dist/private/Tooltip.cjs +10 -2
  181. package/dist/private/Tooltip.cjs.map +1 -1
  182. package/dist/private/Tooltip.js +10 -2
  183. package/dist/private/Tooltip.js.map +1 -1
  184. package/dist/private/Tooltip.mjs +10 -2
  185. package/dist/private/Tooltip.mjs.map +1 -1
  186. package/dist/private/Tree.cjs +11 -1
  187. package/dist/private/Tree.cjs.map +1 -1
  188. package/dist/private/Tree.js +11 -1
  189. package/dist/private/Tree.js.map +1 -1
  190. package/dist/private/Tree.mjs +11 -1
  191. package/dist/private/Tree.mjs.map +1 -1
  192. package/dist/private/TreeDropTargetDelegate.cjs +11 -6
  193. package/dist/private/TreeDropTargetDelegate.cjs.map +1 -1
  194. package/dist/private/TreeDropTargetDelegate.js +11 -6
  195. package/dist/private/TreeDropTargetDelegate.js.map +1 -1
  196. package/dist/private/TreeDropTargetDelegate.mjs +11 -6
  197. package/dist/private/TreeDropTargetDelegate.mjs.map +1 -1
  198. package/dist/private/Virtualizer.cjs +18 -16
  199. package/dist/private/Virtualizer.cjs.map +1 -1
  200. package/dist/private/Virtualizer.js +18 -16
  201. package/dist/private/Virtualizer.js.map +1 -1
  202. package/dist/private/Virtualizer.mjs +18 -16
  203. package/dist/private/Virtualizer.mjs.map +1 -1
  204. package/dist/private/useDragAndDrop.cjs +7 -0
  205. package/dist/private/useDragAndDrop.cjs.map +1 -1
  206. package/dist/private/useDragAndDrop.js +7 -0
  207. package/dist/private/useDragAndDrop.js.map +1 -1
  208. package/dist/private/useDragAndDrop.mjs +7 -0
  209. package/dist/private/useDragAndDrop.mjs.map +1 -1
  210. package/dist/private/utils.cjs.map +1 -1
  211. package/dist/private/utils.js.map +1 -1
  212. package/dist/private/utils.mjs.map +1 -1
  213. package/dist/types/exports/GridList.d.ts +1 -1
  214. package/dist/types/exports/Menu.d.ts +2 -2
  215. package/dist/types/exports/NavigationTree.d.ts +8 -0
  216. package/dist/types/exports/PreviewTrigger.d.ts +3 -0
  217. package/dist/types/exports/TokenField.d.ts +5 -0
  218. package/dist/types/exports/Tree.d.ts +1 -1
  219. package/dist/types/exports/index.d.ts +14 -5
  220. package/dist/types/src/Breadcrumbs.d.ts +2 -2
  221. package/dist/types/src/Button.d.ts +1 -1
  222. package/dist/types/src/Calendar.d.ts +6 -6
  223. package/dist/types/src/Checkbox.d.ts +8 -8
  224. package/dist/types/src/Collection.d.ts +1 -1
  225. package/dist/types/src/ComboBox.d.ts +6 -3
  226. package/dist/types/src/DateField.d.ts +4 -4
  227. package/dist/types/src/DatePicker.d.ts +2 -2
  228. package/dist/types/src/Dialog.d.ts +2 -2
  229. package/dist/types/src/Disclosure.d.ts +2 -2
  230. package/dist/types/src/GridList.d.ts +18 -7
  231. package/dist/types/src/Group.d.ts +1 -1
  232. package/dist/types/src/Header.d.ts +1 -1
  233. package/dist/types/src/Input.d.ts +1 -1
  234. package/dist/types/src/Label.d.ts +1 -1
  235. package/dist/types/src/Link.d.ts +1 -1
  236. package/dist/types/src/ListBox.d.ts +6 -6
  237. package/dist/types/src/Menu.d.ts +25 -6
  238. package/dist/types/src/Meter.d.ts +1 -1
  239. package/dist/types/src/Modal.d.ts +2 -2
  240. package/dist/types/src/NavigationTree.d.ts +80 -0
  241. package/dist/types/src/NumberField.d.ts +1 -1
  242. package/dist/types/src/OverlayArrow.d.ts +1 -1
  243. package/dist/types/src/Popover.d.ts +8 -1
  244. package/dist/types/src/PreviewTrigger.d.ts +23 -0
  245. package/dist/types/src/RadioGroup.d.ts +8 -8
  246. package/dist/types/src/SearchField.d.ts +1 -1
  247. package/dist/types/src/Select.d.ts +3 -3
  248. package/dist/types/src/Separator.d.ts +1 -1
  249. package/dist/types/src/Slider.d.ts +5 -5
  250. package/dist/types/src/Switch.d.ts +7 -7
  251. package/dist/types/src/Table.d.ts +32 -8
  252. package/dist/types/src/Tabs.d.ts +5 -5
  253. package/dist/types/src/TagGroup.d.ts +3 -3
  254. package/dist/types/src/Text.d.ts +1 -1
  255. package/dist/types/src/TextField.d.ts +1 -1
  256. package/dist/types/src/Toast.d.ts +3 -3
  257. package/dist/types/src/ToggleButton.d.ts +1 -1
  258. package/dist/types/src/ToggleButtonGroup.d.ts +1 -1
  259. package/dist/types/src/TokenField.d.ts +111 -0
  260. package/dist/types/src/Toolbar.d.ts +1 -1
  261. package/dist/types/src/Tooltip.d.ts +1 -1
  262. package/dist/types/src/Tree.d.ts +12 -10
  263. package/dist/types/src/Virtualizer.d.ts +4 -0
  264. package/dist/types/src/utils.d.ts +19 -5
  265. package/i18n/ar-AE.js +1 -1
  266. package/i18n/ar-AE.mjs +1 -1
  267. package/i18n/bg-BG.js +1 -1
  268. package/i18n/bg-BG.mjs +1 -1
  269. package/i18n/cs-CZ.js +1 -1
  270. package/i18n/cs-CZ.mjs +1 -1
  271. package/i18n/da-DK.js +1 -1
  272. package/i18n/da-DK.mjs +1 -1
  273. package/i18n/de-DE.js +1 -1
  274. package/i18n/de-DE.mjs +1 -1
  275. package/i18n/el-GR.js +1 -1
  276. package/i18n/el-GR.mjs +1 -1
  277. package/i18n/en-US.js +1 -1
  278. package/i18n/en-US.mjs +1 -1
  279. package/i18n/es-ES.js +1 -1
  280. package/i18n/es-ES.mjs +1 -1
  281. package/i18n/et-EE.js +1 -1
  282. package/i18n/et-EE.mjs +1 -1
  283. package/i18n/fi-FI.js +1 -1
  284. package/i18n/fi-FI.mjs +1 -1
  285. package/i18n/fr-FR.js +1 -1
  286. package/i18n/fr-FR.mjs +1 -1
  287. package/i18n/he-IL.js +1 -1
  288. package/i18n/he-IL.mjs +1 -1
  289. package/i18n/hr-HR.js +1 -1
  290. package/i18n/hr-HR.mjs +1 -1
  291. package/i18n/hu-HU.js +1 -1
  292. package/i18n/hu-HU.mjs +1 -1
  293. package/i18n/it-IT.js +1 -1
  294. package/i18n/it-IT.mjs +1 -1
  295. package/i18n/ja-JP.js +1 -1
  296. package/i18n/ja-JP.mjs +1 -1
  297. package/i18n/ko-KR.js +1 -1
  298. package/i18n/ko-KR.mjs +1 -1
  299. package/i18n/lt-LT.js +1 -1
  300. package/i18n/lt-LT.mjs +1 -1
  301. package/i18n/lv-LV.js +1 -1
  302. package/i18n/lv-LV.mjs +1 -1
  303. package/i18n/nb-NO.js +1 -1
  304. package/i18n/nb-NO.mjs +1 -1
  305. package/i18n/nl-NL.js +1 -1
  306. package/i18n/nl-NL.mjs +1 -1
  307. package/i18n/pl-PL.js +1 -1
  308. package/i18n/pl-PL.mjs +1 -1
  309. package/i18n/pt-BR.js +1 -1
  310. package/i18n/pt-BR.mjs +1 -1
  311. package/i18n/pt-PT.js +1 -1
  312. package/i18n/pt-PT.mjs +1 -1
  313. package/i18n/ro-RO.js +1 -1
  314. package/i18n/ro-RO.mjs +1 -1
  315. package/i18n/ru-RU.js +1 -1
  316. package/i18n/ru-RU.mjs +1 -1
  317. package/i18n/sk-SK.js +1 -1
  318. package/i18n/sk-SK.mjs +1 -1
  319. package/i18n/sl-SI.js +1 -1
  320. package/i18n/sl-SI.mjs +1 -1
  321. package/i18n/sr-SP.js +1 -1
  322. package/i18n/sr-SP.mjs +1 -1
  323. package/i18n/sv-SE.js +1 -1
  324. package/i18n/sv-SE.mjs +1 -1
  325. package/i18n/tr-TR.js +1 -1
  326. package/i18n/tr-TR.mjs +1 -1
  327. package/i18n/uk-UA.js +1 -1
  328. package/i18n/uk-UA.mjs +1 -1
  329. package/i18n/zh-CN.js +1 -1
  330. package/i18n/zh-CN.mjs +1 -1
  331. package/i18n/zh-TW.js +1 -1
  332. package/i18n/zh-TW.mjs +1 -1
  333. package/package.json +33 -31
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAwIM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAkD;AAE5F,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAC3E,KAAmB,EACnB,GAA8B;IAE9B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAe,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wCAAyB;IACvD,IAAI,aAAa,CAAA,GAAA,6BAAqB,EAAE;IACxC,IAAI,QACF,MAAM,MAAM,IAAI,QAAQ,MAAM,WAAW,IAAI,QAAQ,CAAC,eAAe,aAAa;IACpF,IAAI,YAAY,CAAA,GAAA,uBAAe,EAAE,KAAK,MAAM,MAAM,KAAK,MAAM,SAAS,IAAI;IAC1E,IAAI,WAAW,CAAA,GAAA,kBAAU;IACzB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAE1B,sEAAsE;IACtE,IAAI,UAAU;QACZ,IAAI,WAAW,MAAM,QAAQ;QAC7B,IAAI,OAAO,aAAa,YACtB,WAAW,SAAS;YAClB,SAAS,MAAM,OAAO,IAAI;YAC1B,WAAW;YACX,YAAY;YACZ,WAAW;YACX,iBAAiB;QACnB;QAGF,qBAAO,kEAAG;IACZ;IAEA,IA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This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n AriaLabelingProps,\n forwardRefType,\n GlobalDOMAttributes,\n RefObject\n} from '@react-types/shared';\nimport {AriaPopoverProps, usePopover} from 'react-aria/usePopover';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DismissButton, Overlay} from 'react-aria/Overlay';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {getInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {isFocusWithin} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {\n OverlayTriggerProps,\n OverlayTriggerState,\n useOverlayTriggerState\n} from 'react-stately/useOverlayTriggerState';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PlacementAxis, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {\n Context,\n createContext,\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {useEnterAnimation, useExitAnimation} from 'react-aria/private/utils/animation';\nimport {useIsHidden} from 'react-aria/private/collections/Hidden';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\n\nexport interface PopoverProps\n extends\n Omit<PositionProps, 'isOpen'>,\n Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>,\n OverlayTriggerProps,\n RenderProps<PopoverRenderProps>,\n SlotProps,\n AriaLabelingProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Popover'\n */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string;\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>;\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean;\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean;\n /**\n * The container element in which the overlay portal will be placed. This may have unknown\n * behavior depending on where it is portalled to.\n *\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element;\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n *\n * @default 8\n */\n offset?: number;\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n *\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null;\n /**\n * The placement of the popover relative to the trigger.\n *\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null;\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n *\n * @selector [data-entering]\n */\n isEntering: boolean;\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n *\n * @selector [data-exiting]\n */\n isExiting: boolean;\n}\n\ninterface PopoverContextValue extends PopoverProps {\n /** Contexts to clear. */\n clearContexts?: Context<any>[];\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverContextValue, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(\n props: PopoverProps,\n ref: ForwardedRef<HTMLElement>\n) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state =\n props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction}\n />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState;\n isEntering?: boolean;\n isExiting: boolean;\n UNSTABLE_portalContainer?: Element;\n trigger?: string;\n dir?: 'ltr' | 'rtl';\n clearContexts?: Context<any>[];\n}\n\nfunction PopoverInner({\n state,\n isExiting,\n UNSTABLE_portalContainer,\n clearContexts,\n ...props\n}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n\n let {popoverProps, underlayProps, arrowProps, placement, triggerAnchorPoint} = usePopover(\n {\n ...props,\n offset: props.offset ?? 8,\n arrowRef,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n },\n state\n );\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n // Skip this for submenus since hovering a submenutrigger should keep focus on the trigger\n useEffect(() => {\n if (\n isDialog &&\n (props.trigger !== 'SubmenuTrigger' || getInteractionModality() !== 'pointer') &&\n ref.current &&\n !isFocusWithin(ref.current)\n ) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref, props.trigger]);\n\n let children = useMemo(() => {\n let children = renderProps.children;\n if (clearContexts) {\n for (let Context of clearContexts) {\n children = <Context.Provider value={null}>{children}</Context.Provider>;\n }\n }\n return children;\n }, [renderProps.children, clearContexts]);\n\n let [triggerWidth, setTriggerWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (props.triggerRef.current) {\n setTriggerWidth(props.triggerRef.current.getBoundingClientRect().width + 'px');\n }\n }, [props.triggerRef]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: renderProps.style?.['--trigger-width'] ? undefined : props.triggerRef,\n onResize: onResize\n });\n\n let style = {\n ...popoverProps.style,\n '--trigger-anchor-point': triggerAnchorPoint\n ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px`\n : undefined,\n ...renderProps.style,\n '--trigger-width': renderProps.style?.['--trigger-width'] || triggerWidth\n };\n\n let overlay = (\n <dom.div\n {...mergeProps(filterDOMProps(props, {global: true}), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </dom.div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay\n {...props}\n shouldContainFocus={isDialog}\n isExiting={isExiting}\n portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && (\n <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />\n )}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay\n {...props}\n shouldContainFocus={isDialog}\n isExiting={isExiting}\n portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA+IM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAkD;AAE5F,iFAAiF;AACjF,MA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O,KAAK;QAClD,WAAW;QACX,iBAAiB,4BAA4B,UAAU,WAAW;OACjE;AAGL,qCAAqC;AACvC","sources":["packages/react-aria-components/src/Popover.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n AriaLabelingProps,\n forwardRefType,\n GlobalDOMAttributes,\n RefObject\n} from '@react-types/shared';\nimport {AriaPopoverProps, usePopover} from 'react-aria/usePopover';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {DismissButton, Overlay} from 'react-aria/Overlay';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {getInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {isFocusWithin} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {\n OverlayTriggerProps,\n OverlayTriggerState,\n useOverlayTriggerState\n} from 'react-stately/useOverlayTriggerState';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PlacementAxis, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {\n Context,\n createContext,\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {useEnterAnimation, useExitAnimation} from 'react-aria/private/utils/animation';\nimport {useIsHidden} from 'react-aria/private/collections/Hidden';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\n\nexport interface PopoverProps\n extends\n Omit<PositionProps, 'isOpen'>,\n Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>,\n OverlayTriggerProps,\n RenderProps<PopoverRenderProps>,\n SlotProps,\n AriaLabelingProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Popover'\n */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string;\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>;\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean;\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean;\n /**\n * Whether the popover should appear and disappear without an entry or exit animation. This is\n * used by components such as PreviewTrigger to skip animations when quickly swapping between\n * overlays.\n */\n shouldSkipAnimation?: boolean;\n /**\n * The container element in which the overlay portal will be placed. This may have unknown\n * behavior depending on where it is portalled to.\n *\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element;\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n *\n * @default 8\n */\n offset?: number;\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n *\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null;\n /**\n * The placement of the popover relative to the trigger.\n *\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null;\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n *\n * @selector [data-entering]\n */\n isEntering: boolean;\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n *\n * @selector [data-exiting]\n */\n isExiting: boolean;\n}\n\ninterface PopoverContextValue extends PopoverProps {\n id?: string;\n /** Contexts to clear. */\n clearContexts?: Context<any>[];\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverContextValue, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(\n props: PopoverProps,\n ref: ForwardedRef<HTMLElement>\n) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state =\n props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n // Skip the automatic exit animation when closing instantly (e.g. swapping between previews\n // during warmup). An explicitly provided isExiting prop still takes precedence.\n let exitAnimation = useExitAnimation(ref, state.isOpen);\n let isExiting = props.isExiting || (!props.shouldSkipAnimation && exitAnimation) || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction}\n />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState;\n isEntering?: boolean;\n isExiting: boolean;\n shouldSkipAnimation?: boolean;\n UNSTABLE_portalContainer?: Element;\n trigger?: string;\n dir?: 'ltr' | 'rtl';\n clearContexts?: Context<any>[];\n id?: string;\n}\n\nfunction PopoverInner({\n state,\n isExiting,\n UNSTABLE_portalContainer,\n clearContexts,\n ...props\n}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n\n let {popoverProps, underlayProps, arrowProps, placement, triggerAnchorPoint} = usePopover(\n {\n ...props,\n offset: props.offset ?? 8,\n arrowRef,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n },\n state\n );\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n // Skip the automatic entry animation when opening instantly (e.g. swapping between previews\n // during warmup). An explicitly provided isEntering prop still takes precedence.\n let enterAnimation = useEnterAnimation(ref, !!placement);\n // oxlint-disable-next-line react/react-compiler\n let isEntering = props.isEntering || (!props.shouldSkipAnimation && enterAnimation) || false;\n // oxlint-disable-next-line react/react-compiler\n let renderProps = useRenderProps({\n // oxlint-disable-next-line react/react-compiler\n ...props,\n defaultClassName: 'react-aria-Popover',\n // oxlint-disable-next-line react/react-compiler\n values: {\n // oxlint-disable-next-line react/react-compiler\n trigger: props.trigger || null,\n placement,\n // oxlint-disable-next-line react/react-compiler\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog =\n // oxlint-disable-next-line react/react-compiler\n !props.isNonModal || props.trigger === 'SubmenuTrigger' || props.trigger === 'PreviewTrigger';\n // oxlint-disable-next-line react/react-compiler\n let [isDialog, setDialog] = useState(props.trigger === 'PreviewTrigger');\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n // Skip this for submenus since hovering a submenutrigger should keep focus on the trigger\n // oxlint-disable react/react-compiler\n useEffect(() => {\n if (\n isDialog &&\n props.trigger !== 'PreviewTrigger' &&\n (props.trigger !== 'SubmenuTrigger' || getInteractionModality() !== 'pointer') &&\n ref.current &&\n !isFocusWithin(ref.current)\n ) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref, props.trigger]);\n // oxlint-enable react/react-compiler\n\n let children = useMemo(() => {\n let children = renderProps.children;\n if (clearContexts) {\n for (let Context of clearContexts) {\n children = <Context.Provider value={null}>{children}</Context.Provider>;\n }\n }\n return children;\n }, [renderProps.children, clearContexts]);\n\n let [triggerWidth, setTriggerWidth] = useState<string | null>(null);\n // oxlint-disable-next-line react/react-compiler\n let onResize = useCallback(() => {\n if (props.triggerRef.current) {\n setTriggerWidth(props.triggerRef.current.getBoundingClientRect().width + 'px');\n }\n }, [props.triggerRef]);\n\n useLayoutEffect(onResize, [onResize]);\n // oxlint-disable-next-line react/react-compiler\n useResizeObserver({\n // oxlint-disable-next-line react/react-compiler\n ref: renderProps.style?.['--trigger-width'] ? undefined : props.triggerRef,\n onResize: onResize\n });\n\n let style = {\n ...popoverProps.style,\n '--trigger-anchor-point': triggerAnchorPoint\n ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px`\n : undefined,\n ...renderProps.style,\n '--trigger-width': renderProps.style?.['--trigger-width'] || triggerWidth\n };\n\n // oxlint-disable react/react-compiler\n let overlay = (\n <dom.div\n {...mergeProps(filterDOMProps(props, {global: true}), popoverProps)}\n {...renderProps}\n id={isDialog ? props.id : undefined}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {/* oxlint-disable-next-line react/react-compiler */}\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </dom.div>\n );\n // oxlint-enable react/react-compiler\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n // oxlint-disable react/react-compiler\n return (\n <Overlay\n {...props}\n shouldContainFocus={isDialog && props.trigger !== 'PreviewTrigger'}\n isExiting={isExiting}\n portalContainer={UNSTABLE_portalContainer}>\n {/* oxlint-disable-next-line react/react-compiler */}\n {!props.isNonModal && state.isOpen && (\n <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />\n )}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n // oxlint-enable react/react-compiler\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n // oxlint-disable react/react-compiler\n return (\n <Overlay\n {...props}\n shouldContainFocus={isDialog && props.trigger !== 'PreviewTrigger'}\n isExiting={isExiting}\n portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n // oxlint-enable react/react-compiler\n}\n"],"names":[],"version":3,"file":"Popover.mjs.map"}
@@ -0,0 +1,88 @@
1
+ var $88595bf043e542ec$exports = require("./Dialog.cjs");
2
+ var $74e35a768d38d46b$exports = require("./Popover.cjs");
3
+ var $048d76b84370f141$exports = require("./utils.cjs");
4
+ var $3aRaU$reactariausePreviewTrigger = require("react-aria/usePreviewTrigger");
5
+ var $3aRaU$reactariaprivateinteractionsuseFocusable = require("react-aria/private/interactions/useFocusable");
6
+ var $3aRaU$react = require("react");
7
+ var $3aRaU$reactstatelyuseTooltipTriggerState = require("react-stately/useTooltipTriggerState");
8
+
9
+
10
+ function $parcel$interopDefault(a) {
11
+ return a && a.__esModule ? a.default : a;
12
+ }
13
+
14
+ function $parcel$export(e, n, v, s) {
15
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
16
+ }
17
+
18
+ $parcel$export(module.exports, "PreviewTrigger", function () { return $d080a2b6a6742393$export$60a5cf113499de66; });
19
+ /*
20
+ * Copyright 2026 Adobe. All rights reserved.
21
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
22
+ * you may not use this file except in compliance with the License. You may obtain a copy
23
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
24
+ *
25
+ * Unless required by applicable law or agreed to in writing, software distributed under
26
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
27
+ * OF ANY KIND, either express or implied. See the License for the specific language
28
+ * governing permissions and limitations under the License.
29
+ */
30
+
31
+
32
+
33
+
34
+
35
+
36
+ function $d080a2b6a6742393$export$60a5cf113499de66(props) {
37
+ let state = (0, $3aRaU$reactstatelyuseTooltipTriggerState.useTooltipTriggerState)({
38
+ ...props,
39
+ delay: props.delay ?? 600,
40
+ closeDelay: props.closeDelay ?? 200
41
+ });
42
+ let triggerRef = (0, $3aRaU$react.useRef)(null);
43
+ let popoverRef = (0, $3aRaU$react.useRef)(null);
44
+ let { triggerProps: triggerProps, popoverProps: popoverProps } = (0, $3aRaU$reactariausePreviewTrigger.usePreviewTrigger)({
45
+ ...props,
46
+ triggerRef: triggerRef,
47
+ popoverRef: popoverRef
48
+ }, state);
49
+ // The Popover and usePopover expect an OverlayTriggerState. Adapt the TooltipTriggerState (which
50
+ // provides the warmup/cooldown delay behavior) to that interface.
51
+ let overlayState = (0, $3aRaU$react.useMemo)(()=>({
52
+ isOpen: state.isOpen,
53
+ open: ()=>state.open(),
54
+ close: ()=>state.close(),
55
+ setOpen: (isOpen)=>isOpen ? state.open() : state.close(),
56
+ toggle: ()=>state.isOpen ? state.close() : state.open(),
57
+ point: null,
58
+ setPoint: ()=>{}
59
+ }), [
60
+ state
61
+ ]);
62
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($3aRaU$react))).createElement((0, $048d76b84370f141$exports.Provider), {
63
+ values: [
64
+ [
65
+ (0, $88595bf043e542ec$exports.OverlayTriggerStateContext),
66
+ overlayState
67
+ ],
68
+ [
69
+ (0, $74e35a768d38d46b$exports.PopoverContext),
70
+ {
71
+ trigger: 'PreviewTrigger',
72
+ triggerRef: triggerRef,
73
+ ref: popoverRef,
74
+ isNonModal: true,
75
+ // Skip enter/exit animations when swapping between previews during the warmup period.
76
+ shouldSkipAnimation: state.shouldSkipAnimation,
77
+ ...popoverProps
78
+ }
79
+ ]
80
+ ]
81
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($3aRaU$react))).createElement((0, $3aRaU$reactariaprivateinteractionsuseFocusable.FocusableProvider), {
82
+ ...triggerProps,
83
+ ref: triggerRef
84
+ }, props.children));
85
+ }
86
+
87
+
88
+ //# sourceMappingURL=PreviewTrigger.cjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiCM,SAAS,0CAAe,KAA0B;IACvD,IAAI,QAAQ,CAAA,GAAA,gEAAqB,EAAE;QACjC,GAAG,KAAK;QACR,OAAO,MAAM,KAAK,IAAI;QACtB,YAAY,MAAM,UAAU,IAAI;IAClC;IACA,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAoB;IAC1C,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAe;IACrC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,mDAAgB,EAAE;QAAC,GAAG,KAAK;oBAAE;oBAAY;IAAU,GAAG;IAEzF,iGAAiG;IACjG,kEAAkE;IAClE,IAAI,eAAe,CAAA,GAAA,oBAAM,EACvB,IAAO,CAAA;YACL,QAAQ,MAAM,MAAM;YACpB,MAAM,IAAM,MAAM,IAAI;YACtB,OAAO,IAAM,MAAM,KAAK;YACxB,SAAS,CAAA,SAAW,SAAS,MAAM,IAAI,KAAK,MAAM,KAAK;YACvD,QAAQ,IAAO,MAAM,MAAM,GAAG,MAAM,KAAK,KAAK,MAAM,IAAI;YACxD,OAAO;YACP,UAAU,KAAO;QACnB,CAAA,GACA;QAAC;KAAM;IAGT,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,oDAAyB;gBAAG;aAAa;YAC1C;gBACE,CAAA,GAAA,wCAAa;gBACb;oBACE,SAAS;gCACT;oBACA,KAAK;oBACL,YAAY;oBACZ,sFAAsF;oBACtF,qBAAqB,MAAM,mBAAmB;oBAC9C,GAAG,YAAY;gBACjB;aACD;SACF;qBACD,0DAAC,CAAA,GAAA,iEAAgB;QAAG,GAAG,YAAY;QAAE,KAAK;OACvC,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/PreviewTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 {AriaPreviewTriggerProps, usePreviewTrigger} from 'react-aria/usePreviewTrigger';\nimport {FocusableElement} from '@react-types/shared';\nimport {FocusableProvider} from 'react-aria/private/interactions/useFocusable';\nimport {OverlayTriggerState} from 'react-stately/useOverlayTriggerState';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {Provider} from './utils';\nimport React, {JSX, ReactNode, useMemo, useRef} from 'react';\nimport {useTooltipTriggerState} from 'react-stately/useTooltipTriggerState';\n\nexport interface PreviewTriggerProps extends AriaPreviewTriggerProps {\n /** The trigger and Popover that make up the preview trigger. */\n children: ReactNode;\n /**\n * The delay time in milliseconds before the preview opens.\n *\n * @default 600\n */\n delay?: number;\n /**\n * The delay time in milliseconds before the preview closes.\n *\n * @default 200\n */\n closeDelay?: number;\n}\n\n/**\n * A PreviewTrigger displays a non-modal popover on hover, focus, or long press. Unlike a tooltip,\n * the popover may contain interactive content.\n */\nexport function PreviewTrigger(props: PreviewTriggerProps): JSX.Element {\n let state = useTooltipTriggerState({\n ...props,\n delay: props.delay ?? 600,\n closeDelay: props.closeDelay ?? 200\n });\n let triggerRef = useRef<FocusableElement>(null);\n let popoverRef = useRef<HTMLElement>(null);\n let {triggerProps, popoverProps} = usePreviewTrigger({...props, triggerRef, popoverRef}, state);\n\n // The Popover and usePopover expect an OverlayTriggerState. Adapt the TooltipTriggerState (which\n // provides the warmup/cooldown delay behavior) to that interface.\n let overlayState = useMemo<OverlayTriggerState>(\n () => ({\n isOpen: state.isOpen,\n open: () => state.open(),\n close: () => state.close(),\n setOpen: isOpen => (isOpen ? state.open() : state.close()),\n toggle: () => (state.isOpen ? state.close() : state.open()),\n point: null,\n setPoint: () => {}\n }),\n [state]\n );\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, overlayState],\n [\n PopoverContext,\n {\n trigger: 'PreviewTrigger',\n triggerRef,\n ref: popoverRef,\n isNonModal: true,\n // Skip enter/exit animations when swapping between previews during the warmup period.\n shouldSkipAnimation: state.shouldSkipAnimation,\n ...popoverProps\n }\n ]\n ]}>\n <FocusableProvider {...triggerProps} ref={triggerRef}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"PreviewTrigger.cjs.map"}
@@ -0,0 +1,80 @@
1
+ import {OverlayTriggerStateContext as $acf8e70c2f419f18$export$d2f961adcb0afbe} from "./Dialog.js";
2
+ import {PopoverContext as $03df2f2d3cffb62f$export$9b9a0cd73afb7ca4} from "./Popover.js";
3
+ import {Provider as $b7b7a92703138c9b$export$2881499e37b75b9a} from "./utils.js";
4
+ import {usePreviewTrigger as $gmnOE$usePreviewTrigger} from "react-aria/usePreviewTrigger";
5
+ import {FocusableProvider as $gmnOE$FocusableProvider} from "react-aria/private/interactions/useFocusable";
6
+ import $gmnOE$react, {useRef as $gmnOE$useRef, useMemo as $gmnOE$useMemo} from "react";
7
+ import {useTooltipTriggerState as $gmnOE$useTooltipTriggerState} from "react-stately/useTooltipTriggerState";
8
+
9
+ /*
10
+ * Copyright 2026 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+
21
+
22
+
23
+
24
+
25
+
26
+ function $7e17edf2fd1a9983$export$60a5cf113499de66(props) {
27
+ var _props_delay, _props_closeDelay;
28
+ let state = (0, $gmnOE$useTooltipTriggerState)({
29
+ ...props,
30
+ delay: (_props_delay = props.delay) !== null && _props_delay !== void 0 ? _props_delay : 600,
31
+ closeDelay: (_props_closeDelay = props.closeDelay) !== null && _props_closeDelay !== void 0 ? _props_closeDelay : 200
32
+ });
33
+ let triggerRef = (0, $gmnOE$useRef)(null);
34
+ let popoverRef = (0, $gmnOE$useRef)(null);
35
+ let { triggerProps: triggerProps, popoverProps: popoverProps } = (0, $gmnOE$usePreviewTrigger)({
36
+ ...props,
37
+ triggerRef: triggerRef,
38
+ popoverRef: popoverRef
39
+ }, state);
40
+ // The Popover and usePopover expect an OverlayTriggerState. Adapt the TooltipTriggerState (which
41
+ // provides the warmup/cooldown delay behavior) to that interface.
42
+ let overlayState = (0, $gmnOE$useMemo)(()=>({
43
+ isOpen: state.isOpen,
44
+ open: ()=>state.open(),
45
+ close: ()=>state.close(),
46
+ setOpen: (isOpen)=>isOpen ? state.open() : state.close(),
47
+ toggle: ()=>state.isOpen ? state.close() : state.open(),
48
+ point: null,
49
+ setPoint: ()=>{}
50
+ }), [
51
+ state
52
+ ]);
53
+ return /*#__PURE__*/ (0, $gmnOE$react).createElement((0, $b7b7a92703138c9b$export$2881499e37b75b9a), {
54
+ values: [
55
+ [
56
+ (0, $acf8e70c2f419f18$export$d2f961adcb0afbe),
57
+ overlayState
58
+ ],
59
+ [
60
+ (0, $03df2f2d3cffb62f$export$9b9a0cd73afb7ca4),
61
+ {
62
+ trigger: 'PreviewTrigger',
63
+ triggerRef: triggerRef,
64
+ ref: popoverRef,
65
+ isNonModal: true,
66
+ // Skip enter/exit animations when swapping between previews during the warmup period.
67
+ shouldSkipAnimation: state.shouldSkipAnimation,
68
+ ...popoverProps
69
+ }
70
+ ]
71
+ ]
72
+ }, /*#__PURE__*/ (0, $gmnOE$react).createElement((0, $gmnOE$FocusableProvider), {
73
+ ...triggerProps,
74
+ ref: triggerRef
75
+ }, props.children));
76
+ }
77
+
78
+
79
+ export {$7e17edf2fd1a9983$export$60a5cf113499de66 as PreviewTrigger};
80
+ //# sourceMappingURL=PreviewTrigger.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiCM,SAAS,0CAAe,KAA0B;QAG9C,cACK;IAHd,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;QACjC,GAAG,KAAK;QACR,OAAO,CAAA,eAAA,MAAM,KAAK,cAAX,0BAAA,eAAe;QACtB,YAAY,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB;IAClC;IACA,IAAI,aAAa,CAAA,GAAA,aAAK,EAAoB;IAC1C,IAAI,aAAa,CAAA,GAAA,aAAK,EAAe;IACrC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAAC,GAAG,KAAK;oBAAE;oBAAY;IAAU,GAAG;IAEzF,iGAAiG;IACjG,kEAAkE;IAClE,IAAI,eAAe,CAAA,GAAA,cAAM,EACvB,IAAO,CAAA;YACL,QAAQ,MAAM,MAAM;YACpB,MAAM,IAAM,MAAM,IAAI;YACtB,OAAO,IAAM,MAAM,KAAK;YACxB,SAAS,CAAA,SAAW,SAAS,MAAM,IAAI,KAAK,MAAM,KAAK;YACvD,QAAQ,IAAO,MAAM,MAAM,GAAG,MAAM,KAAK,KAAK,MAAM,IAAI;YACxD,OAAO;YACP,UAAU,KAAO;QACnB,CAAA,GACA;QAAC;KAAM;IAGT,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,wCAAyB;gBAAG;aAAa;YAC1C;gBACE,CAAA,GAAA,yCAAa;gBACb;oBACE,SAAS;gCACT;oBACA,KAAK;oBACL,YAAY;oBACZ,sFAAsF;oBACtF,qBAAqB,MAAM,mBAAmB;oBAC9C,GAAG,YAAY;gBACjB;aACD;SACF;qBACD,gCAAC,CAAA,GAAA,wBAAgB;QAAG,GAAG,YAAY;QAAE,KAAK;OACvC,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/PreviewTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 {AriaPreviewTriggerProps, usePreviewTrigger} from 'react-aria/usePreviewTrigger';\nimport {FocusableElement} from '@react-types/shared';\nimport {FocusableProvider} from 'react-aria/private/interactions/useFocusable';\nimport {OverlayTriggerState} from 'react-stately/useOverlayTriggerState';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {Provider} from './utils';\nimport React, {JSX, ReactNode, useMemo, useRef} from 'react';\nimport {useTooltipTriggerState} from 'react-stately/useTooltipTriggerState';\n\nexport interface PreviewTriggerProps extends AriaPreviewTriggerProps {\n /** The trigger and Popover that make up the preview trigger. */\n children: ReactNode;\n /**\n * The delay time in milliseconds before the preview opens.\n *\n * @default 600\n */\n delay?: number;\n /**\n * The delay time in milliseconds before the preview closes.\n *\n * @default 200\n */\n closeDelay?: number;\n}\n\n/**\n * A PreviewTrigger displays a non-modal popover on hover, focus, or long press. Unlike a tooltip,\n * the popover may contain interactive content.\n */\nexport function PreviewTrigger(props: PreviewTriggerProps): JSX.Element {\n let state = useTooltipTriggerState({\n ...props,\n delay: props.delay ?? 600,\n closeDelay: props.closeDelay ?? 200\n });\n let triggerRef = useRef<FocusableElement>(null);\n let popoverRef = useRef<HTMLElement>(null);\n let {triggerProps, popoverProps} = usePreviewTrigger({...props, triggerRef, popoverRef}, state);\n\n // The Popover and usePopover expect an OverlayTriggerState. Adapt the TooltipTriggerState (which\n // provides the warmup/cooldown delay behavior) to that interface.\n let overlayState = useMemo<OverlayTriggerState>(\n () => ({\n isOpen: state.isOpen,\n open: () => state.open(),\n close: () => state.close(),\n setOpen: isOpen => (isOpen ? state.open() : state.close()),\n toggle: () => (state.isOpen ? state.close() : state.open()),\n point: null,\n setPoint: () => {}\n }),\n [state]\n );\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, overlayState],\n [\n PopoverContext,\n {\n trigger: 'PreviewTrigger',\n triggerRef,\n ref: popoverRef,\n isNonModal: true,\n // Skip enter/exit animations when swapping between previews during the warmup period.\n shouldSkipAnimation: state.shouldSkipAnimation,\n ...popoverProps\n }\n ]\n ]}>\n <FocusableProvider {...triggerProps} ref={triggerRef}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"PreviewTrigger.js.map"}
@@ -0,0 +1,79 @@
1
+ import {OverlayTriggerStateContext as $f2ff30fde7b014be$export$d2f961adcb0afbe} from "./Dialog.mjs";
2
+ import {PopoverContext as $542a13ca2fa5b484$export$9b9a0cd73afb7ca4} from "./Popover.mjs";
3
+ import {Provider as $7230ffa83bc0c2cf$export$2881499e37b75b9a} from "./utils.mjs";
4
+ import {usePreviewTrigger as $evW8Q$usePreviewTrigger} from "react-aria/usePreviewTrigger";
5
+ import {FocusableProvider as $evW8Q$FocusableProvider} from "react-aria/private/interactions/useFocusable";
6
+ import $evW8Q$react, {useRef as $evW8Q$useRef, useMemo as $evW8Q$useMemo} from "react";
7
+ import {useTooltipTriggerState as $evW8Q$useTooltipTriggerState} from "react-stately/useTooltipTriggerState";
8
+
9
+ /*
10
+ * Copyright 2026 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+
21
+
22
+
23
+
24
+
25
+
26
+ function $32e5dbc959387ef1$export$60a5cf113499de66(props) {
27
+ let state = (0, $evW8Q$useTooltipTriggerState)({
28
+ ...props,
29
+ delay: props.delay ?? 600,
30
+ closeDelay: props.closeDelay ?? 200
31
+ });
32
+ let triggerRef = (0, $evW8Q$useRef)(null);
33
+ let popoverRef = (0, $evW8Q$useRef)(null);
34
+ let { triggerProps: triggerProps, popoverProps: popoverProps } = (0, $evW8Q$usePreviewTrigger)({
35
+ ...props,
36
+ triggerRef: triggerRef,
37
+ popoverRef: popoverRef
38
+ }, state);
39
+ // The Popover and usePopover expect an OverlayTriggerState. Adapt the TooltipTriggerState (which
40
+ // provides the warmup/cooldown delay behavior) to that interface.
41
+ let overlayState = (0, $evW8Q$useMemo)(()=>({
42
+ isOpen: state.isOpen,
43
+ open: ()=>state.open(),
44
+ close: ()=>state.close(),
45
+ setOpen: (isOpen)=>isOpen ? state.open() : state.close(),
46
+ toggle: ()=>state.isOpen ? state.close() : state.open(),
47
+ point: null,
48
+ setPoint: ()=>{}
49
+ }), [
50
+ state
51
+ ]);
52
+ return /*#__PURE__*/ (0, $evW8Q$react).createElement((0, $7230ffa83bc0c2cf$export$2881499e37b75b9a), {
53
+ values: [
54
+ [
55
+ (0, $f2ff30fde7b014be$export$d2f961adcb0afbe),
56
+ overlayState
57
+ ],
58
+ [
59
+ (0, $542a13ca2fa5b484$export$9b9a0cd73afb7ca4),
60
+ {
61
+ trigger: 'PreviewTrigger',
62
+ triggerRef: triggerRef,
63
+ ref: popoverRef,
64
+ isNonModal: true,
65
+ // Skip enter/exit animations when swapping between previews during the warmup period.
66
+ shouldSkipAnimation: state.shouldSkipAnimation,
67
+ ...popoverProps
68
+ }
69
+ ]
70
+ ]
71
+ }, /*#__PURE__*/ (0, $evW8Q$react).createElement((0, $evW8Q$FocusableProvider), {
72
+ ...triggerProps,
73
+ ref: triggerRef
74
+ }, props.children));
75
+ }
76
+
77
+
78
+ export {$32e5dbc959387ef1$export$60a5cf113499de66 as PreviewTrigger};
79
+ //# sourceMappingURL=PreviewTrigger.mjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiCM,SAAS,0CAAe,KAA0B;IACvD,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;QACjC,GAAG,KAAK;QACR,OAAO,MAAM,KAAK,IAAI;QACtB,YAAY,MAAM,UAAU,IAAI;IAClC;IACA,IAAI,aAAa,CAAA,GAAA,aAAK,EAAoB;IAC1C,IAAI,aAAa,CAAA,GAAA,aAAK,EAAe;IACrC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAAC,GAAG,KAAK;oBAAE;oBAAY;IAAU,GAAG;IAEzF,iGAAiG;IACjG,kEAAkE;IAClE,IAAI,eAAe,CAAA,GAAA,cAAM,EACvB,IAAO,CAAA;YACL,QAAQ,MAAM,MAAM;YACpB,MAAM,IAAM,MAAM,IAAI;YACtB,OAAO,IAAM,MAAM,KAAK;YACxB,SAAS,CAAA,SAAW,SAAS,MAAM,IAAI,KAAK,MAAM,KAAK;YACvD,QAAQ,IAAO,MAAM,MAAM,GAAG,MAAM,KAAK,KAAK,MAAM,IAAI;YACxD,OAAO;YACP,UAAU,KAAO;QACnB,CAAA,GACA;QAAC;KAAM;IAGT,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,wCAAyB;gBAAG;aAAa;YAC1C;gBACE,CAAA,GAAA,yCAAa;gBACb;oBACE,SAAS;gCACT;oBACA,KAAK;oBACL,YAAY;oBACZ,sFAAsF;oBACtF,qBAAqB,MAAM,mBAAmB;oBAC9C,GAAG,YAAY;gBACjB;aACD;SACF;qBACD,gCAAC,CAAA,GAAA,wBAAgB;QAAG,GAAG,YAAY;QAAE,KAAK;OACvC,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/PreviewTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 {AriaPreviewTriggerProps, usePreviewTrigger} from 'react-aria/usePreviewTrigger';\nimport {FocusableElement} from '@react-types/shared';\nimport {FocusableProvider} from 'react-aria/private/interactions/useFocusable';\nimport {OverlayTriggerState} from 'react-stately/useOverlayTriggerState';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {Provider} from './utils';\nimport React, {JSX, ReactNode, useMemo, useRef} from 'react';\nimport {useTooltipTriggerState} from 'react-stately/useTooltipTriggerState';\n\nexport interface PreviewTriggerProps extends AriaPreviewTriggerProps {\n /** The trigger and Popover that make up the preview trigger. */\n children: ReactNode;\n /**\n * The delay time in milliseconds before the preview opens.\n *\n * @default 600\n */\n delay?: number;\n /**\n * The delay time in milliseconds before the preview closes.\n *\n * @default 200\n */\n closeDelay?: number;\n}\n\n/**\n * A PreviewTrigger displays a non-modal popover on hover, focus, or long press. Unlike a tooltip,\n * the popover may contain interactive content.\n */\nexport function PreviewTrigger(props: PreviewTriggerProps): JSX.Element {\n let state = useTooltipTriggerState({\n ...props,\n delay: props.delay ?? 600,\n closeDelay: props.closeDelay ?? 200\n });\n let triggerRef = useRef<FocusableElement>(null);\n let popoverRef = useRef<HTMLElement>(null);\n let {triggerProps, popoverProps} = usePreviewTrigger({...props, triggerRef, popoverRef}, state);\n\n // The Popover and usePopover expect an OverlayTriggerState. Adapt the TooltipTriggerState (which\n // provides the warmup/cooldown delay behavior) to that interface.\n let overlayState = useMemo<OverlayTriggerState>(\n () => ({\n isOpen: state.isOpen,\n open: () => state.open(),\n close: () => state.close(),\n setOpen: isOpen => (isOpen ? state.open() : state.close()),\n toggle: () => (state.isOpen ? state.close() : state.open()),\n point: null,\n setPoint: () => {}\n }),\n [state]\n );\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, overlayState],\n [\n PopoverContext,\n {\n trigger: 'PreviewTrigger',\n triggerRef,\n ref: popoverRef,\n isNonModal: true,\n // Skip enter/exit animations when swapping between previews during the warmup period.\n shouldSkipAnimation: state.shouldSkipAnimation,\n ...popoverProps\n }\n ]\n ]}>\n <FocusableProvider {...triggerProps} ref={triggerRef}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"PreviewTrigger.mjs.map"}
@@ -44,8 +44,13 @@ const $ffc270943183f850$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $gDBFy$react
44
44
  ...props,
45
45
  label: label
46
46
  });
47
+ let range = maxValue - minValue;
47
48
  // Calculate the width of the progress bar as a percentage
48
- let percentage = isIndeterminate ? undefined : (value - minValue) / (maxValue - minValue) * 100;
49
+ let percentage = undefined;
50
+ if (!isIndeterminate) {
51
+ if (range === 0) percentage = 0;
52
+ else percentage = (value - minValue) / range * 100;
53
+ }
49
54
  let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
50
55
  ...props,
51
56
  defaultClassName: 'react-aria-ProgressBar',
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuDM,MAAM,0DACX,CAAA,GAAA,0BAAY,EAAkD;AAMzD,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SAAC,QAAQ,aAAG,WAAW,aAAG,WAAW,sBAAK,kBAAkB,OAAM,GAAG;IACzE,QAAQ,CAAA,GAAA,2CAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IACjF,IAAI,oBAAC,gBAAgB,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6CAAa,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAEpE,0DAA0D;IAC1D,IAAI,aAAa,kBAAkB,YAAY,AAAE,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAM;IAE9F,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,gBAAgB,CAAC,iBAAiB;6BAC7C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,aAAa,iBAAiB;QACvD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,0DAAC,CAAA,GAAA,sCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\n\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = isIndeterminate ? undefined : ((value - minValue) / (maxValue - minValue)) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.cjs.map"}
1
+ {"mappings":";;;;;;;;;;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,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n let range = maxValue - minValue;\n // Calculate the width of the progress bar as a percentage\n let percentage: number | undefined = undefined;\n if (!isIndeterminate) {\n if (range === 0) {\n percentage = 0;\n } else {\n percentage = ((value - minValue) / range) * 100;\n }\n }\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.cjs.map"}
@@ -33,8 +33,13 @@ const $71551be8b98e6856$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $lG3gV$forwa
33
33
  ...props,
34
34
  label: label
35
35
  });
36
+ let range = maxValue - minValue;
36
37
  // Calculate the width of the progress bar as a percentage
37
- let percentage = isIndeterminate ? undefined : (value - minValue) / (maxValue - minValue) * 100;
38
+ let percentage = undefined;
39
+ if (!isIndeterminate) {
40
+ if (range === 0) percentage = 0;
41
+ else percentage = (value - minValue) / range * 100;
42
+ }
38
43
  let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
39
44
  ...props,
40
45
  defaultClassName: 'react-aria-ProgressBar',
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CA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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 {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\n\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = isIndeterminate ? undefined : ((value - minValue) / (maxValue - minValue)) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAsDM,MAAM,0DACX,CAAA,GAAA,oBAAY,EAAkD;AAMzD,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SAAC,QAAQ,aAAG,WAAW,aAAG,WAAW,sBAAK,kBAAkB,OAAM,GAAG;IACzE,QAAQ,CAAA,GAAA,YAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IACjF,IAAI,oBAAC,gBAAgB,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAEpE,IAAI,QAAQ,WAAW;IACvB,0DAA0D;IAC1D,IAAI,aAAiC;IACrC,IAAI,CAAC;QACH,IAAI,UAAU,GACZ,aAAa;aAEb,aAAa,AAAE,CAAA,QAAQ,QAAO,IAAK,QAAS;;IAIhD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,gBAAgB,CAAC,iBAAiB;6BAC7C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,iBAAiB;QACvD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n let range = maxValue - minValue;\n // Calculate the width of the progress bar as a percentage\n let percentage: number | undefined = undefined;\n if (!isIndeterminate) {\n if (range === 0) {\n percentage = 0;\n } else {\n percentage = ((value - minValue) / range) * 100;\n }\n }\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.js.map"}
@@ -33,8 +33,13 @@ const $6c0095e7e99364f2$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $8MuvO$forwa
33
33
  ...props,
34
34
  label: label
35
35
  });
36
+ let range = maxValue - minValue;
36
37
  // Calculate the width of the progress bar as a percentage
37
- let percentage = isIndeterminate ? undefined : (value - minValue) / (maxValue - minValue) * 100;
38
+ let percentage = undefined;
39
+ if (!isIndeterminate) {
40
+ if (range === 0) percentage = 0;
41
+ else percentage = (value - minValue) / range * 100;
42
+ }
38
43
  let renderProps = (0, $7230ffa83bc0c2cf$export$4d86445c2cf5e3)({
39
44
  ...props,
40
45
  defaultClassName: 'react-aria-ProgressBar',
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuDM,MAAM,0DACX,CAAA,GAAA,oBAAY,EAAkD;AAMzD,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SAAC,QAAQ,aAAG,WAAW,aAAG,WAAW,sBAAK,kBAAkB,OAAM,GAAG;IACzE,QAAQ,CAAA,GAAA,YAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IACjF,IAAI,oBAAC,gBAAgB,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAEpE,0DAA0D;IAC1D,IAAI,aAAa,kBAAkB,YAAY,AAAE,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAM;IAE9F,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,gBAAgB,CAAC,iBAAiB;6BAC7C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,iBAAiB;QACvD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\n\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = isIndeterminate ? undefined : ((value - minValue) / (maxValue - minValue)) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":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AAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n let range = maxValue - minValue;\n // Calculate the width of the progress bar as a percentage\n let percentage: number | undefined = undefined;\n if (!isIndeterminate) {\n if (range === 0) {\n percentage = 0;\n } else {\n percentage = ((value - minValue) / range) * 100;\n }\n }\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAuPM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DACX,CAAA,GAAA,0BAAY,EAAuD;AAC9D,MAAM,0DACX,CAAA,GAAA,0BAAY,EAA0D;AACjE,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAC9E,KAAsB,EACtB,GAAiC;IAEjC,CAAC,OAAO,IAAI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,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,0DAAC,CAAA,GAAA,6CAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","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 {\n AriaRadioGroupProps,\n AriaRadioProps,\n RadioAria,\n useRadio,\n useRadioGroup\n} from 'react-aria/useRadioGroup';\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} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents, Orientation} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately/useRadioGroupState';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface RadioGroupProps\n extends\n Omit<\n AriaRadioGroupProps,\n | 'children'\n | 'label'\n | 'description'\n | 'errorMessage'\n | 'validationState'\n | 'validationBehavior'\n >,\n RACValidation,\n RenderProps<RadioGroupRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>;\n}\nexport interface RadioProps\n extends\n Omit<AriaRadioProps, 'children'>,\n HoverEvents,\n RenderProps<RadioRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-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 RadioFieldProps\n extends\n Omit<AriaRadioProps, 'children'>,\n RenderProps<RadioFieldRenderProps>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioField'\n */\n className?: ClassNameOrFunction<RadioFieldRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface RadioButtonProps\n extends\n HoverEvents,\n RenderProps<RadioButtonRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioButton'\n */\n className?: ClassNameOrFunction<RadioButtonRenderProps>;\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n *\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation;\n /**\n * Whether the radio group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio group is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio group is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n /**\n * Whether the radio group is invalid.\n *\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 *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the radio is currently in a pressed state.\n *\n * @selector [data-pressed]\n */\n isPressed: boolean;\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the radio is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioFieldRenderProps {\n /**\n * Whether the radio is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioButtonRenderProps extends RadioRenderProps {}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext =\n createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioFieldContext =\n createContext<ContextValue<Partial<RadioFieldProps>, HTMLDivElement>>(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(\n props: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\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(!props['aria-label'] && !props['aria-labelledby']);\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} =\n useRadioGroup(\n {\n ...props,\n label,\n validationBehavior\n },\n state\n );\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 [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>{renderProps.children}</SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n *\n * @deprecated Use RadioField + RadioButton instead.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(\n props: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n\n return (\n <InternalRadioContext.Provider\n value={{...aria, inputRef, defaultClassName: 'react-aria-Radio'}}>\n <RadioButton {...props} ref={ref} />\n </InternalRadioContext.Provider>\n );\n});\n\ninterface InternalRadioContextValue extends RadioAria {\n inputRef: RefObject<HTMLInputElement | null>;\n defaultClassName: string;\n}\n\nconst InternalRadioContext = createContext<InternalRadioContextValue | null>(null);\n\n/**\n * A RadioField represents an individual option within a radio group, containing a RadioButton and\n * optional description.\n */\nexport const RadioField = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioField(\n props: RadioFieldProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioFieldContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioFieldProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n let {descriptionProps, isSelected, isDisabled} = aria;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-RadioField',\n values: {\n isSelected,\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.div\n {...mergeProps(DOMProps, renderProps)}\n ref={ref}\n data-selected={isSelected || 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 <Provider\n values={[\n [SelectionIndicatorContext, {isSelected}],\n [\n InternalRadioContext,\n {\n ...aria,\n inputRef,\n defaultClassName: 'react-aria-RadioButton'\n }\n ],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps\n }\n }\n ]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A RadioButton is the clickable area of a radio, including the indicator and label.\n */\nexport const RadioButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioButton(\n props: RadioButtonProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {labelProps, inputProps, isSelected, isDisabled, isPressed, defaultClassName, inputRef} =\n useContext(InternalRadioContext)!;\n let state = React.useContext(RadioGroupStateContext)!;\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,\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 {renderProps.children}\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAuPM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DACX,CAAA,GAAA,0BAAY,EAAuD;AAC9D,MAAM,0DACX,CAAA,GAAA,0BAAY,EAA0D;AACjE,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAC9E,KAAsB,EACtB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,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,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,6CAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","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 {\n AriaRadioGroupProps,\n AriaRadioProps,\n RadioAria,\n useRadio,\n useRadioGroup\n} from 'react-aria/useRadioGroup';\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} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents, Orientation} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately/useRadioGroupState';\nimport React, {createContext, ForwardedRef, forwardRef, Ref, useContext, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface RadioGroupProps\n extends\n Omit<\n AriaRadioGroupProps,\n | 'children'\n | 'label'\n | 'description'\n | 'errorMessage'\n | 'validationState'\n | 'validationBehavior'\n >,\n RACValidation,\n RenderProps<RadioGroupRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>;\n}\nexport interface RadioProps\n extends\n Omit<AriaRadioProps, 'children'>,\n HoverEvents,\n RenderProps<RadioRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: Ref<HTMLInputElement | null>;\n}\n\nexport interface RadioFieldProps\n extends\n Omit<AriaRadioProps, 'children'>,\n RenderProps<RadioFieldRenderProps>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioField'\n */\n className?: ClassNameOrFunction<RadioFieldRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: Ref<HTMLInputElement | null>;\n}\n\nexport interface RadioButtonProps\n extends\n HoverEvents,\n RenderProps<RadioButtonRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioButton'\n */\n className?: ClassNameOrFunction<RadioButtonRenderProps>;\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n *\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation;\n /**\n * Whether the radio group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio group is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio group is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n /**\n * Whether the radio group is invalid.\n *\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 *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the radio is currently in a pressed state.\n *\n * @selector [data-pressed]\n */\n isPressed: boolean;\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the radio is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioFieldRenderProps {\n /**\n * Whether the radio is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioButtonRenderProps extends RadioRenderProps {}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext =\n createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioFieldContext =\n createContext<ContextValue<Partial<RadioFieldProps>, HTMLDivElement>>(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(\n props: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\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(!props['aria-label'] && !props['aria-labelledby']);\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} =\n useRadioGroup(\n {\n ...props,\n label,\n validationBehavior\n },\n state\n );\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 [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>{renderProps.children}</SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n *\n * @deprecated Use RadioField + RadioButton instead.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(\n props: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n\n return (\n <InternalRadioContext.Provider\n value={{...aria, inputRef, defaultClassName: 'react-aria-Radio'}}>\n <RadioButton {...props} ref={ref} />\n </InternalRadioContext.Provider>\n );\n});\n\ninterface InternalRadioContextValue extends RadioAria {\n inputRef: RefObject<HTMLInputElement | null>;\n defaultClassName: string;\n}\n\nconst InternalRadioContext = createContext<InternalRadioContextValue | null>(null);\n\n/**\n * A RadioField represents an individual option within a radio group, containing a RadioButton and\n * optional description.\n */\nexport const RadioField = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioField(\n props: RadioFieldProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioFieldContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioFieldProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n let {descriptionProps, isSelected, isDisabled} = aria;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-RadioField',\n values: {\n isSelected,\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.div\n {...mergeProps(DOMProps, renderProps)}\n ref={ref}\n data-selected={isSelected || 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 <Provider\n values={[\n [SelectionIndicatorContext, {isSelected}],\n [\n InternalRadioContext,\n {\n ...aria,\n inputRef,\n defaultClassName: 'react-aria-RadioButton'\n }\n ],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps\n }\n }\n ]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A RadioButton is the clickable area of a radio, including the indicator and label.\n */\nexport const RadioButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioButton(\n props: RadioButtonProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {labelProps, inputProps, isSelected, isDisabled, isPressed, defaultClassName, inputRef} =\n useContext(InternalRadioContext)!;\n let state = React.useContext(RadioGroupStateContext)!;\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,\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 {renderProps.children}\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.cjs.map"}