@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;;;AAOM,MAAM,kDACH,CAAA,GAAA,kBAAc;IAGtB,2DAA2D;IAC3D,mBAAqC;QACnC,6DAA6D;QAC7D,6CAA6C,GAC7C,IAAI,iBAAiB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAA4B;QAC5D,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;gBACL,YAAY,EAAE,2BAAA,qCAAA,eAAgB,YAAY;YAC5C,CAAA,GACA;YAAC,2BAAA,qCAAA,eAAgB,YAAY;SAAC;IAElC;AACF","sources":["packages/react-aria-components/src/TableLayout.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {TableLayout as BaseTableLayout, TableLayoutProps} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {TableColumnResizeStateContext} from './Table';\nimport {useContext, useMemo} from 'react';\n\nexport class TableLayout<T, O extends TableLayoutProps = TableLayoutProps>\n extends BaseTableLayout<T, O>\n implements LayoutOptionsDelegate<TableLayoutProps>\n{\n // Invalidate the layout whenever the column widths change.\n useLayoutOptions(): TableLayoutProps {\n // This is not a React class component, just a regular class.\n /* eslint-disable react-hooks/rules-of-hooks */\n let colResizeState = useContext(TableColumnResizeStateContext);\n return useMemo(\n () => ({\n columnWidths: colResizeState?.columnWidths\n }),\n [colResizeState?.columnWidths]\n );\n }\n}\n"],"names":[],"version":3,"file":"TableLayout.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,kBAAc;IAGtB,2DAA2D;IAC3D,mBAAqC;QACnC,6DAA6D;QAC7D,kEAAkE;QAClE,IAAI,iBAAiB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAA4B;QAC5D,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;gBACL,YAAY,EAAE,2BAAA,qCAAA,eAAgB,YAAY;YAC5C,CAAA,GACA;YAAC,2BAAA,qCAAA,eAAgB,YAAY;SAAC;IAEhC,iEAAiE;IACnE;AACF","sources":["packages/react-aria-components/src/TableLayout.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {TableLayout as BaseTableLayout, TableLayoutProps} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {TableColumnResizeStateContext} from './Table';\nimport {useContext, useMemo} from 'react';\n\nexport class TableLayout<T, O extends TableLayoutProps = TableLayoutProps>\n extends BaseTableLayout<T, O>\n implements LayoutOptionsDelegate<TableLayoutProps>\n{\n // Invalidate the layout whenever the column widths change.\n useLayoutOptions(): TableLayoutProps {\n // This is not a React class component, just a regular class.\n // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks\n let colResizeState = useContext(TableColumnResizeStateContext);\n return useMemo(\n () => ({\n columnWidths: colResizeState?.columnWidths\n }),\n [colResizeState?.columnWidths]\n );\n // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks\n }\n}\n"],"names":[],"version":3,"file":"TableLayout.js.map"}
@@ -19,12 +19,14 @@ class $117bf84ed4596724$export$62444c3c724b1b20 extends (0, $dQ2t8$TableLayout)
19
19
  // Invalidate the layout whenever the column widths change.
20
20
  useLayoutOptions() {
21
21
  // This is not a React class component, just a regular class.
22
- /* eslint-disable react-hooks/rules-of-hooks */ let colResizeState = (0, $dQ2t8$useContext)((0, $76d00c5a4edb230a$export$a2680a798823803c));
22
+ // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks
23
+ let colResizeState = (0, $dQ2t8$useContext)((0, $76d00c5a4edb230a$export$a2680a798823803c));
23
24
  return (0, $dQ2t8$useMemo)(()=>({
24
25
  columnWidths: colResizeState?.columnWidths
25
26
  }), [
26
27
  colResizeState?.columnWidths
27
28
  ]);
29
+ // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks
28
30
  }
29
31
  }
30
32
 
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,kBAAc;IAGtB,2DAA2D;IAC3D,mBAAqC;QACnC,6DAA6D;QAC7D,6CAA6C,GAC7C,IAAI,iBAAiB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAA4B;QAC5D,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;gBACL,cAAc,gBAAgB;YAChC,CAAA,GACA;YAAC,gBAAgB;SAAa;IAElC;AACF","sources":["packages/react-aria-components/src/TableLayout.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {TableLayout as BaseTableLayout, TableLayoutProps} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {TableColumnResizeStateContext} from './Table';\nimport {useContext, useMemo} from 'react';\n\nexport class TableLayout<T, O extends TableLayoutProps = TableLayoutProps>\n extends BaseTableLayout<T, O>\n implements LayoutOptionsDelegate<TableLayoutProps>\n{\n // Invalidate the layout whenever the column widths change.\n useLayoutOptions(): TableLayoutProps {\n // This is not a React class component, just a regular class.\n /* eslint-disable react-hooks/rules-of-hooks */\n let colResizeState = useContext(TableColumnResizeStateContext);\n return useMemo(\n () => ({\n columnWidths: colResizeState?.columnWidths\n }),\n [colResizeState?.columnWidths]\n );\n }\n}\n"],"names":[],"version":3,"file":"TableLayout.mjs.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAOM,MAAM,kDACH,CAAA,GAAA,kBAAc;IAGtB,2DAA2D;IAC3D,mBAAqC;QACnC,6DAA6D;QAC7D,kEAAkE;QAClE,IAAI,iBAAiB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAA4B;QAC5D,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;gBACL,cAAc,gBAAgB;YAChC,CAAA,GACA;YAAC,gBAAgB;SAAa;IAEhC,iEAAiE;IACnE;AACF","sources":["packages/react-aria-components/src/TableLayout.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {TableLayout as BaseTableLayout, TableLayoutProps} from 'react-stately/useVirtualizerState';\nimport {LayoutOptionsDelegate} from './Virtualizer';\nimport {TableColumnResizeStateContext} from './Table';\nimport {useContext, useMemo} from 'react';\n\nexport class TableLayout<T, O extends TableLayoutProps = TableLayoutProps>\n extends BaseTableLayout<T, O>\n implements LayoutOptionsDelegate<TableLayoutProps>\n{\n // Invalidate the layout whenever the column widths change.\n useLayoutOptions(): TableLayoutProps {\n // This is not a React class component, just a regular class.\n // oxlint-disable react/react-compiler, react-hooks/rules-of-hooks\n let colResizeState = useContext(TableColumnResizeStateContext);\n return useMemo(\n () => ({\n columnWidths: colResizeState?.columnWidths\n }),\n [colResizeState?.columnWidths]\n );\n // oxlint-enable react/react-compiler, react-hooks/rules-of-hooks\n }\n}\n"],"names":[],"version":3,"file":"TableLayout.mjs.map"}
@@ -90,6 +90,7 @@ function $c5db5fc82b83c4a1$var$TagGroupInner({ props: props, forwardedRef: ref,
90
90
  children: undefined,
91
91
  collection: collection
92
92
  });
93
+ // oxlint-disable-next-line react/react-compiler
93
94
  let filteredState = (0, $9dmNy$reactstatelyuseListState.UNSTABLE_useFilteredListState)(tagGroupState, filter);
94
95
  // Prevent DOM props from going to two places.
95
96
  let domProps = (0, $9dmNy$reactariafilterDOMProps.filterDOMProps)(otherProps, {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA2HM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AAMtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAC5E,KAAoB,EACpB,GAAiC;IAEjC,CA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AAA,GAAA,uCAAY;gBACZ;oBACE,OAAO;wBACL,QAAQ;oBACV;gBACF;aACD;YACD;gBAAC,CAAA,GAAA,mDAAwB;gBAAG,CAAA,GAAA,mDAAwB;aAAE;YACtD;gBAAC,CAAA,GAAA,mDAAwB;gBAAG;oBAAC,YAAY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 {AriaTagGroupProps, useTag, useTagGroup} from 'react-aria/useTagGroup';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMProps,\n DOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n DefaultCollectionRenderer,\n ItemRenderProps,\n usePersistedKeys\n} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {ItemNode} from 'react-aria/private/collections/BaseCollection';\nimport {LabelContext} from './Label';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\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';\n\nexport interface TagGroupProps\n extends\n Omit<\n AriaTagGroupProps<unknown>,\n 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'\n >,\n DOMProps,\n SlotProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-TagGroup'\n */\n className?: string;\n}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the tag list is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the tag list is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>;\n}\n\nexport interface TagListProps<T>\n extends\n Omit<CollectionProps<T>, 'disabledKeys'>,\n StyleRenderProps<TagListRenderProps, 'div'>,\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-TagList'\n */\n className?: ClassNameOrFunction<TagListRenderProps>;\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode;\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with\n * support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(\n props: TagGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <ListStateContext.Provider value={null}>\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </ListStateContext.Provider>\n );\n});\n\ninterface TagGroupInnerProps<T> {\n props: TagGroupProps & SelectableCollectionContextValue<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n collection: any;\n}\n\nfunction TagGroupInner<T>({props, forwardedRef: ref, collection}: TagGroupInnerProps<T>) {\n let tagListRef = useRef<HTMLElement>(null);\n // Extract the user provided id so it doesn't clash with the collection id provided by Autocomplete\n let {id, ...otherProps} = props;\n [otherProps, tagListRef] = useContextProps(otherProps, tagListRef, SelectableCollectionContext);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {filter, shouldUseVirtualFocus, ...DOMCollectionProps} = otherProps;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let tagGroupState = useListState({\n ...DOMCollectionProps,\n children: undefined,\n collection\n });\n\n let filteredState = UNSTABLE_useFilteredListState(tagGroupState as ListState<T>, filter);\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(otherProps, {global: true});\n let domPropOverrides = Object.fromEntries(\n Object.entries(domProps).map(([k, val]) => [k, k === 'id' ? val : undefined])\n );\n let {gridProps, labelProps, descriptionProps, errorMessageProps} = useTagGroup(\n {\n ...DOMCollectionProps,\n ...domPropOverrides,\n label\n },\n filteredState,\n tagListRef\n );\n\n return (\n <dom.div\n render={props.render}\n {...domProps}\n id={id}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef as RefObject<HTMLDivElement>}],\n [ListStateContext, filteredState],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T>(\n props: TagListProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n): JSX.Element {\n let state = useContext(ListStateContext);\n return state ? <TagListInner props={props} forwardedRef={ref} /> : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n}\n\nfunction TagListInner<T>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps({}, forwardedRef, TagListContext);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps)}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SharedElementTransition>\n {state.collection.size === 0 && props.renderEmptyState ? (\n props.renderEmptyState(renderValues)\n ) : (\n <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />\n )}\n </SharedElementTransition>\n </dom.div>\n );\n}\n\nexport interface TagRenderProps extends Omit<\n ItemRenderProps,\n 'allowsDragging' | 'isDragging' | 'isDropTarget'\n> {\n /**\n * Whether the tag group allows items to be removed.\n *\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean;\n}\n\nexport interface TagProps\n extends\n RenderProps<TagRenderProps, 'div'>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\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-Tag'\n */\n className?: ClassNameOrFunction<TagRenderProps>;\n /** A unique id for the tag. */\n id?: Key;\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent(\n ItemNode,\n (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.'\n );\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n ref={ref}\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n remove: removeButtonProps\n }\n }\n ],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"TagGroup.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA2HM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AAMtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAC5E,KAAoB,EACpB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC,CAAA,GAAA,0CAAe,EAAE,QAAQ;QAAC,OAAO;qBAChC,0DAAC,CAAA,GAAA,mDAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2B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AY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 {AriaTagGroupProps, useTag, useTagGroup} from 'react-aria/useTagGroup';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMProps,\n DOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n DefaultCollectionRenderer,\n ItemRenderProps,\n usePersistedKeys\n} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {ItemNode} from 'react-aria/private/collections/BaseCollection';\nimport {LabelContext} from './Label';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\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';\n\nexport interface TagGroupProps\n extends\n Omit<\n AriaTagGroupProps<unknown>,\n 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'\n >,\n DOMProps,\n SlotProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-TagGroup'\n */\n className?: string;\n}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the tag list is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the tag list is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>;\n}\n\nexport interface TagListProps<T>\n extends\n Omit<CollectionProps<T>, 'disabledKeys'>,\n StyleRenderProps<TagListRenderProps, 'div'>,\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-TagList'\n */\n className?: ClassNameOrFunction<TagListRenderProps>;\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode;\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with\n * support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(\n props: TagGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <ListStateContext.Provider value={null}>\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </ListStateContext.Provider>\n );\n});\n\ninterface TagGroupInnerProps<T> {\n props: TagGroupProps & SelectableCollectionContextValue<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n collection: any;\n}\n\nfunction TagGroupInner<T>({props, forwardedRef: ref, collection}: TagGroupInnerProps<T>) {\n let tagListRef = useRef<HTMLElement>(null);\n // Extract the user provided id so it doesn't clash with the collection id provided by Autocomplete\n let {id, ...otherProps} = props;\n [otherProps, tagListRef] = useContextProps(otherProps, tagListRef, SelectableCollectionContext);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {filter, shouldUseVirtualFocus, ...DOMCollectionProps} = otherProps;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let tagGroupState = useListState({\n ...DOMCollectionProps,\n children: undefined,\n collection\n });\n\n // oxlint-disable-next-line react/react-compiler\n let filteredState = UNSTABLE_useFilteredListState(tagGroupState as ListState<T>, filter);\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(otherProps, {global: true});\n let domPropOverrides = Object.fromEntries(\n Object.entries(domProps).map(([k, val]) => [k, k === 'id' ? val : undefined])\n );\n let {gridProps, labelProps, descriptionProps, errorMessageProps} = useTagGroup(\n {\n ...DOMCollectionProps,\n ...domPropOverrides,\n label\n },\n filteredState,\n tagListRef\n );\n\n return (\n <dom.div\n render={props.render}\n {...domProps}\n id={id}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef as RefObject<HTMLDivElement>}],\n [ListStateContext, filteredState],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T>(\n props: TagListProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n): JSX.Element {\n let state = useContext(ListStateContext);\n return state ? <TagListInner props={props} forwardedRef={ref} /> : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n}\n\nfunction TagListInner<T>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps({}, forwardedRef, TagListContext);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps)}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SharedElementTransition>\n {state.collection.size === 0 && props.renderEmptyState ? (\n props.renderEmptyState(renderValues)\n ) : (\n <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />\n )}\n </SharedElementTransition>\n </dom.div>\n );\n}\n\nexport interface TagRenderProps extends Omit<\n ItemRenderProps,\n 'allowsDragging' | 'isDragging' | 'isDropTarget'\n> {\n /**\n * Whether the tag group allows items to be removed.\n *\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean;\n}\n\nexport interface TagProps\n extends\n RenderProps<TagRenderProps, 'div'>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\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-Tag'\n */\n className?: ClassNameOrFunction<TagRenderProps>;\n /** A unique id for the tag. */\n id?: Key;\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent(\n ItemNode,\n (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.'\n );\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n ref={ref}\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n remove: removeButtonProps\n }\n }\n ],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"TagGroup.cjs.map"}
@@ -76,6 +76,7 @@ function $ada7ba7890ac1d93$var$TagGroupInner({ props: props, forwardedRef: ref,
76
76
  children: undefined,
77
77
  collection: collection
78
78
  });
79
+ // oxlint-disable-next-line react/react-compiler
79
80
  let filteredState = (0, $7VBu2$UNSTABLE_useFilteredListState)(tagGroupState, filter);
80
81
  // Prevent DOM props from going to two places.
81
82
  let domProps = (0, $7VBu2$filterDOMProps)(otherProps, {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA2HM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAMtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAC5E,KAAoB,EACpB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,yCAAe,E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D;gBAAC,CAAA,GAAA,yCAAwB;gBAAG,CAAA,GAAA,yCAAwB;aAAE;YACtD;gBAAC,CAAA,GAAA,yCAAwB;gBAAG;oBAAC,YAAY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 {AriaTagGroupProps, useTag, useTagGroup} from 'react-aria/useTagGroup';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMProps,\n DOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n DefaultCollectionRenderer,\n ItemRenderProps,\n usePersistedKeys\n} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {ItemNode} from 'react-aria/private/collections/BaseCollection';\nimport {LabelContext} from './Label';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\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';\n\nexport interface TagGroupProps\n extends\n Omit<\n AriaTagGroupProps<unknown>,\n 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'\n >,\n DOMProps,\n SlotProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-TagGroup'\n */\n className?: string;\n}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the tag list is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the tag list is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>;\n}\n\nexport interface TagListProps<T>\n extends\n Omit<CollectionProps<T>, 'disabledKeys'>,\n StyleRenderProps<TagListRenderProps, 'div'>,\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-TagList'\n */\n className?: ClassNameOrFunction<TagListRenderProps>;\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode;\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with\n * support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(\n props: TagGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <ListStateContext.Provider value={null}>\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </ListStateContext.Provider>\n );\n});\n\ninterface TagGroupInnerProps<T> {\n props: TagGroupProps & SelectableCollectionContextValue<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n collection: any;\n}\n\nfunction TagGroupInner<T>({props, forwardedRef: ref, collection}: TagGroupInnerProps<T>) {\n let tagListRef = useRef<HTMLElement>(null);\n // Extract the user provided id so it doesn't clash with the collection id provided by Autocomplete\n let {id, ...otherProps} = props;\n [otherProps, tagListRef] = useContextProps(otherProps, tagListRef, SelectableCollectionContext);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {filter, shouldUseVirtualFocus, ...DOMCollectionProps} = otherProps;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let tagGroupState = useListState({\n ...DOMCollectionProps,\n children: undefined,\n collection\n });\n\n let filteredState = UNSTABLE_useFilteredListState(tagGroupState as ListState<T>, filter);\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(otherProps, {global: true});\n let domPropOverrides = Object.fromEntries(\n Object.entries(domProps).map(([k, val]) => [k, k === 'id' ? val : undefined])\n );\n let {gridProps, labelProps, descriptionProps, errorMessageProps} = useTagGroup(\n {\n ...DOMCollectionProps,\n ...domPropOverrides,\n label\n },\n filteredState,\n tagListRef\n );\n\n return (\n <dom.div\n render={props.render}\n {...domProps}\n id={id}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef as RefObject<HTMLDivElement>}],\n [ListStateContext, filteredState],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T>(\n props: TagListProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n): JSX.Element {\n let state = useContext(ListStateContext);\n return state ? <TagListInner props={props} forwardedRef={ref} /> : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n}\n\nfunction TagListInner<T>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps({}, forwardedRef, TagListContext);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps)}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SharedElementTransition>\n {state.collection.size === 0 && props.renderEmptyState ? (\n props.renderEmptyState(renderValues)\n ) : (\n <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />\n )}\n </SharedElementTransition>\n </dom.div>\n );\n}\n\nexport interface TagRenderProps extends Omit<\n ItemRenderProps,\n 'allowsDragging' | 'isDragging' | 'isDropTarget'\n> {\n /**\n * Whether the tag group allows items to be removed.\n *\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean;\n}\n\nexport interface TagProps\n extends\n RenderProps<TagRenderProps, 'div'>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\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-Tag'\n */\n className?: ClassNameOrFunction<TagRenderProps>;\n /** A unique id for the tag. */\n id?: Key;\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent(\n ItemNode,\n (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.'\n );\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n ref={ref}\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n remove: removeButtonProps\n }\n }\n ],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"TagGroup.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA2HM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAMtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAC5E,KAAoB,EACpB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,yCAAe,EAAE,QAAQ;QAAC,OAAO;qBAChC,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,gCAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAInF;AAQA,SAAS,oCAAiB,SAAC,KAAK,E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B","sources":["packages/react-aria-components/src/TagGroup.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 {AriaTagGroupProps, useTag, useTagGroup} from 'react-aria/useTagGroup';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMProps,\n DOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n DefaultCollectionRenderer,\n ItemRenderProps,\n usePersistedKeys\n} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {ItemNode} from 'react-aria/private/collections/BaseCollection';\nimport {LabelContext} from './Label';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\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';\n\nexport interface TagGroupProps\n extends\n Omit<\n AriaTagGroupProps<unknown>,\n 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'\n >,\n DOMProps,\n SlotProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-TagGroup'\n */\n className?: string;\n}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the tag list is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the tag list is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>;\n}\n\nexport interface TagListProps<T>\n extends\n Omit<CollectionProps<T>, 'disabledKeys'>,\n StyleRenderProps<TagListRenderProps, 'div'>,\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-TagList'\n */\n className?: ClassNameOrFunction<TagListRenderProps>;\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode;\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with\n * support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(\n props: TagGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <ListStateContext.Provider value={null}>\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </ListStateContext.Provider>\n );\n});\n\ninterface TagGroupInnerProps<T> {\n props: TagGroupProps & SelectableCollectionContextValue<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n collection: any;\n}\n\nfunction TagGroupInner<T>({props, forwardedRef: ref, collection}: TagGroupInnerProps<T>) {\n let tagListRef = useRef<HTMLElement>(null);\n // Extract the user provided id so it doesn't clash with the collection id provided by Autocomplete\n let {id, ...otherProps} = props;\n [otherProps, tagListRef] = useContextProps(otherProps, tagListRef, SelectableCollectionContext);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {filter, shouldUseVirtualFocus, ...DOMCollectionProps} = otherProps;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let tagGroupState = useListState({\n ...DOMCollectionProps,\n children: undefined,\n collection\n });\n\n // oxlint-disable-next-line react/react-compiler\n let filteredState = UNSTABLE_useFilteredListState(tagGroupState as ListState<T>, filter);\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(otherProps, {global: true});\n let domPropOverrides = Object.fromEntries(\n Object.entries(domProps).map(([k, val]) => [k, k === 'id' ? val : undefined])\n );\n let {gridProps, labelProps, descriptionProps, errorMessageProps} = useTagGroup(\n {\n ...DOMCollectionProps,\n ...domPropOverrides,\n label\n },\n filteredState,\n tagListRef\n );\n\n return (\n <dom.div\n render={props.render}\n {...domProps}\n id={id}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef as RefObject<HTMLDivElement>}],\n [ListStateContext, filteredState],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T>(\n props: TagListProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n): JSX.Element {\n let state = useContext(ListStateContext);\n return state ? <TagListInner props={props} forwardedRef={ref} /> : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n}\n\nfunction TagListInner<T>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps({}, forwardedRef, TagListContext);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps)}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SharedElementTransition>\n {state.collection.size === 0 && props.renderEmptyState ? (\n props.renderEmptyState(renderValues)\n ) : (\n <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />\n )}\n </SharedElementTransition>\n </dom.div>\n );\n}\n\nexport interface TagRenderProps extends Omit<\n ItemRenderProps,\n 'allowsDragging' | 'isDragging' | 'isDropTarget'\n> {\n /**\n * Whether the tag group allows items to be removed.\n *\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean;\n}\n\nexport interface TagProps\n extends\n RenderProps<TagRenderProps, 'div'>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\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-Tag'\n */\n className?: ClassNameOrFunction<TagRenderProps>;\n /** A unique id for the tag. */\n id?: Key;\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent(\n ItemNode,\n (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.'\n );\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n ref={ref}\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n remove: removeButtonProps\n }\n }\n ],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"TagGroup.js.map"}
@@ -76,6 +76,7 @@ function $3df3ddf5bafbc7b1$var$TagGroupInner({ props: props, forwardedRef: ref,
76
76
  children: undefined,
77
77
  collection: collection
78
78
  });
79
+ // oxlint-disable-next-line react/react-compiler
79
80
  let filteredState = (0, $ck0pj$UNSTABLE_useFilteredListState)(tagGroupState, filter);
80
81
  // Prevent DOM props from going to two places.
81
82
  let domProps = (0, $ck0pj$filterDOMProps)(otherProps, {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA2HM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAMtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAC5E,KAAoB,EACpB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,yCAAe,EAAE,QAAQ;QAAC,OAAO;qBAChC,gCAAC,CAAA,GAAA,wBAAgB;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wB;gBAAG;oBAAC,YAAY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 {AriaTagGroupProps, useTag, useTagGroup} from 'react-aria/useTagGroup';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMProps,\n DOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n DefaultCollectionRenderer,\n ItemRenderProps,\n usePersistedKeys\n} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {ItemNode} from 'react-aria/private/collections/BaseCollection';\nimport {LabelContext} from './Label';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\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';\n\nexport interface TagGroupProps\n extends\n Omit<\n AriaTagGroupProps<unknown>,\n 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'\n >,\n DOMProps,\n SlotProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-TagGroup'\n */\n className?: string;\n}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the tag list is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the tag list is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>;\n}\n\nexport interface TagListProps<T>\n extends\n Omit<CollectionProps<T>, 'disabledKeys'>,\n StyleRenderProps<TagListRenderProps, 'div'>,\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-TagList'\n */\n className?: ClassNameOrFunction<TagListRenderProps>;\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode;\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with\n * support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(\n props: TagGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <ListStateContext.Provider value={null}>\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </ListStateContext.Provider>\n );\n});\n\ninterface TagGroupInnerProps<T> {\n props: TagGroupProps & SelectableCollectionContextValue<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n collection: any;\n}\n\nfunction TagGroupInner<T>({props, forwardedRef: ref, collection}: TagGroupInnerProps<T>) {\n let tagListRef = useRef<HTMLElement>(null);\n // Extract the user provided id so it doesn't clash with the collection id provided by Autocomplete\n let {id, ...otherProps} = props;\n [otherProps, tagListRef] = useContextProps(otherProps, tagListRef, SelectableCollectionContext);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {filter, shouldUseVirtualFocus, ...DOMCollectionProps} = otherProps;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let tagGroupState = useListState({\n ...DOMCollectionProps,\n children: undefined,\n collection\n });\n\n let filteredState = UNSTABLE_useFilteredListState(tagGroupState as ListState<T>, filter);\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(otherProps, {global: true});\n let domPropOverrides = Object.fromEntries(\n Object.entries(domProps).map(([k, val]) => [k, k === 'id' ? val : undefined])\n );\n let {gridProps, labelProps, descriptionProps, errorMessageProps} = useTagGroup(\n {\n ...DOMCollectionProps,\n ...domPropOverrides,\n label\n },\n filteredState,\n tagListRef\n );\n\n return (\n <dom.div\n render={props.render}\n {...domProps}\n id={id}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef as RefObject<HTMLDivElement>}],\n [ListStateContext, filteredState],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T>(\n props: TagListProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n): JSX.Element {\n let state = useContext(ListStateContext);\n return state ? <TagListInner props={props} forwardedRef={ref} /> : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n}\n\nfunction TagListInner<T>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps({}, forwardedRef, TagListContext);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps)}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SharedElementTransition>\n {state.collection.size === 0 && props.renderEmptyState ? (\n props.renderEmptyState(renderValues)\n ) : (\n <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />\n )}\n </SharedElementTransition>\n </dom.div>\n );\n}\n\nexport interface TagRenderProps extends Omit<\n ItemRenderProps,\n 'allowsDragging' | 'isDragging' | 'isDropTarget'\n> {\n /**\n * Whether the tag group allows items to be removed.\n *\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean;\n}\n\nexport interface TagProps\n extends\n RenderProps<TagRenderProps, 'div'>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\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-Tag'\n */\n className?: ClassNameOrFunction<TagRenderProps>;\n /** A unique id for the tag. */\n id?: Key;\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent(\n ItemNode,\n (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.'\n );\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n ref={ref}\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n remove: removeButtonProps\n }\n }\n ],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"TagGroup.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA2HM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAMtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAC5E,KAAoB,EACpB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,yCAAe,EAAE,QAAQ;QAAC,OAAO;qBAChC,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,gCAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAInF;AAQA,SAAS,oCAAiB,SAAC,KAAK,EAAE,cAAc,GAAG,cAAE,UAAU,EAAwB;IACrF,IAAI,aAAa,CAAA,GAAA,aAAK,EAAe;IACrC,mGAAmG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BAAmB,MAAM,gBAAgB,CAAC,iBAAiB;QAC7D;IACF;IAEA,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAC,KAAK,SAAS,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC9C,QAAQ,IAAI,CACV;IAGN,GAAG;QAAC,KAAK,SAAS;KAAC;IAEnB,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACN,KAAK;QACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,UAAU,YAAY,WAAW;QACvE,iBAAe,OAAO,UAAU,IAAI;QACpC,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,wBAAsB,OAAO,cAAc,IAAI;QAC/C,uBACE,MAAM,gBAAgB,CAAC,aAAa,KAAK,SACrC,YACA,MAAM,gBAAgB,CAAC,aAAa;qBAE1C,gCAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBACE,CAAA,GAAA,yCAAY;gBACZ;oBACE,OAAO;wBACL,QAAQ;oBACV;gBACF;aACD;YACD;gBAAC,CAAA,GAAA,yCAAwB;gBAAG,CAAA,GAAA,yCAAwB;aAAE;YACtD;gBAAC,CAAA,GAAA,yCAAwB;gBAAG;oBAAC,YAAY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 {AriaTagGroupProps, useTag, useTagGroup} from 'react-aria/useTagGroup';\n\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMProps,\n DOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n DefaultCollectionRenderer,\n ItemRenderProps,\n usePersistedKeys\n} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {ItemNode} from 'react-aria/private/collections/BaseCollection';\nimport {LabelContext} from './Label';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\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';\n\nexport interface TagGroupProps\n extends\n Omit<\n AriaTagGroupProps<unknown>,\n 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'\n >,\n DOMProps,\n SlotProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-TagGroup'\n */\n className?: string;\n}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the tag list is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the tag list is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>;\n}\n\nexport interface TagListProps<T>\n extends\n Omit<CollectionProps<T>, 'disabledKeys'>,\n StyleRenderProps<TagListRenderProps, 'div'>,\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-TagList'\n */\n className?: ClassNameOrFunction<TagListRenderProps>;\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode;\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with\n * support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(\n props: TagGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <ListStateContext.Provider value={null}>\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </ListStateContext.Provider>\n );\n});\n\ninterface TagGroupInnerProps<T> {\n props: TagGroupProps & SelectableCollectionContextValue<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n collection: any;\n}\n\nfunction TagGroupInner<T>({props, forwardedRef: ref, collection}: TagGroupInnerProps<T>) {\n let tagListRef = useRef<HTMLElement>(null);\n // Extract the user provided id so it doesn't clash with the collection id provided by Autocomplete\n let {id, ...otherProps} = props;\n [otherProps, tagListRef] = useContextProps(otherProps, tagListRef, SelectableCollectionContext);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {filter, shouldUseVirtualFocus, ...DOMCollectionProps} = otherProps;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let tagGroupState = useListState({\n ...DOMCollectionProps,\n children: undefined,\n collection\n });\n\n // oxlint-disable-next-line react/react-compiler\n let filteredState = UNSTABLE_useFilteredListState(tagGroupState as ListState<T>, filter);\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(otherProps, {global: true});\n let domPropOverrides = Object.fromEntries(\n Object.entries(domProps).map(([k, val]) => [k, k === 'id' ? val : undefined])\n );\n let {gridProps, labelProps, descriptionProps, errorMessageProps} = useTagGroup(\n {\n ...DOMCollectionProps,\n ...domPropOverrides,\n label\n },\n filteredState,\n tagListRef\n );\n\n return (\n <dom.div\n render={props.render}\n {...domProps}\n id={id}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef as RefObject<HTMLDivElement>}],\n [ListStateContext, filteredState],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ]\n ]}>\n {props.children}\n </Provider>\n </dom.div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T>(\n props: TagListProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n): JSX.Element {\n let state = useContext(ListStateContext);\n return state ? <TagListInner props={props} forwardedRef={ref} /> : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>;\n forwardedRef: ForwardedRef<HTMLDivElement>;\n}\n\nfunction TagListInner<T>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps({}, forwardedRef, TagListContext);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps)}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SharedElementTransition>\n {state.collection.size === 0 && props.renderEmptyState ? (\n props.renderEmptyState(renderValues)\n ) : (\n <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />\n )}\n </SharedElementTransition>\n </dom.div>\n );\n}\n\nexport interface TagRenderProps extends Omit<\n ItemRenderProps,\n 'allowsDragging' | 'isDragging' | 'isDropTarget'\n> {\n /**\n * Whether the tag group allows items to be removed.\n *\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean;\n}\n\nexport interface TagProps\n extends\n RenderProps<TagRenderProps, 'div'>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\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-Tag'\n */\n className?: ClassNameOrFunction<TagRenderProps>;\n /** A unique id for the tag. */\n id?: Key;\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent(\n ItemNode,\n (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.'\n );\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n ref={ref}\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: {\n remove: removeButtonProps\n }\n }\n ],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </dom.div>\n );\n }\n);\n"],"names":[],"version":3,"file":"TagGroup.mjs.map"}
@@ -1,4 +1,5 @@
1
1
  var $048d76b84370f141$exports = require("./utils.cjs");
2
+ var $5lxjW$reactariaprivatecollectionsHidden = require("react-aria/private/collections/Hidden");
2
3
  var $5lxjW$react = require("react");
3
4
 
4
5
 
@@ -24,8 +25,9 @@ $parcel$export(module.exports, "Text", function () { return $cab7d9a238d19c33$ex
24
25
  * governing permissions and limitations under the License.
25
26
  */
26
27
 
28
+
27
29
  const $cab7d9a238d19c33$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $5lxjW$react.createContext)({});
28
- const $cab7d9a238d19c33$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $5lxjW$react.forwardRef)(function Text(props, ref) {
30
+ const $cab7d9a238d19c33$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $5lxjW$reactariaprivatecollectionsHidden.createHideableComponent)(function Text(props, ref) {
29
31
  [props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $cab7d9a238d19c33$export$9afb8bc826b033ea);
30
32
  let { elementType: elementType = 'span', ...domProps } = props;
31
33
  let ElementType = (0, $048d76b84370f141$exports.dom)[elementType];
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAwC,CAAC;AAEzE,MAAM,0DAAO,CAAA,GAAA,uBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA8B;IAC3F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAC,cAAc,QAAQ,GAAG,UAAS,GAAG;IAC1C,IAAI,cAAc,CAAA,GAAA,6BAAE,CAAC,CAAC,YAAY;IAClC,aAAa;IACb,qBAAO,0DAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<any, any> {\n elementType?: string;\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = forwardRef(function Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType = 'span', ...domProps} = props;\n let ElementType = dom[elementType];\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AASM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAwC,CAAC;AAEzE,MAAM,4CAAO,WAAW,GAAG,CAAA,GAAA,gEAAsB,EAAE,SAAS,KACjE,KAAgB,EAChB,GAA8B;IAE9B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,cAAc,QAAQ,GAAG,UAAS,GAAG;IAC1C,IAAI,cAAc,CAAA,GAAA,6BAAE,CAAC,CAAC,YAAY;IAClC,aAAa;IACb,qBAAO,0DAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.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 */\nimport {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport React, {createContext, ForwardedRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<any, any> {\n elementType?: string;\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = /*#__PURE__*/ createHideableComponent(function Text(\n props: TextProps,\n ref: ForwardedRef<HTMLElement>\n) {\n [props, ref] = useContextProps(props, ref, TextContext);\n\n let {elementType = 'span', ...domProps} = props;\n let ElementType = dom[elementType];\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.cjs.map"}
@@ -1,5 +1,6 @@
1
1
  import {dom as $b7b7a92703138c9b$export$df3a06d6289f983e, useContextProps as $b7b7a92703138c9b$export$29f1550f4b0d4415} from "./utils.js";
2
- import $dk7Vg$react, {createContext as $dk7Vg$createContext, forwardRef as $dk7Vg$forwardRef} from "react";
2
+ import {createHideableComponent as $dk7Vg$createHideableComponent} from "react-aria/private/collections/Hidden";
3
+ import $dk7Vg$react, {createContext as $dk7Vg$createContext} from "react";
3
4
 
4
5
  /*
5
6
  * Copyright 2022 Adobe. All rights reserved.
@@ -13,8 +14,9 @@ import $dk7Vg$react, {createContext as $dk7Vg$createContext, forwardRef as $dk7V
13
14
  * governing permissions and limitations under the License.
14
15
  */
15
16
 
17
+
16
18
  const $20d769b1e2b13352$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $dk7Vg$createContext)({});
17
- const $20d769b1e2b13352$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $dk7Vg$forwardRef)(function Text(props, ref) {
19
+ const $20d769b1e2b13352$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $dk7Vg$createHideableComponent)(function Text(props, ref) {
18
20
  [props, ref] = (0, $b7b7a92703138c9b$export$29f1550f4b0d4415)(props, ref, $20d769b1e2b13352$export$9afb8bc826b033ea);
19
21
  let { elementType: elementType = 'span', ...domProps } = props;
20
22
  let ElementType = (0, $b7b7a92703138c9b$export$df3a06d6289f983e)[elementType];
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAEzE,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA8B;IAC3F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAC,cAAc,QAAQ,GAAG,UAAS,GAAG;IAC1C,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,YAAY;IAClC,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<any, any> {\n elementType?: string;\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = forwardRef(function Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType = 'span', ...domProps} = props;\n let ElementType = dom[elementType];\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AASM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAEzE,MAAM,4CAAO,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,KACjE,KAAgB,EAChB,GAA8B;IAE9B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,cAAc,QAAQ,GAAG,UAAS,GAAG;IAC1C,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,YAAY;IAClC,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.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 */\nimport {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport React, {createContext, ForwardedRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<any, any> {\n elementType?: string;\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = /*#__PURE__*/ createHideableComponent(function Text(\n props: TextProps,\n ref: ForwardedRef<HTMLElement>\n) {\n [props, ref] = useContextProps(props, ref, TextContext);\n\n let {elementType = 'span', ...domProps} = props;\n let ElementType = dom[elementType];\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.js.map"}
@@ -1,5 +1,6 @@
1
1
  import {dom as $7230ffa83bc0c2cf$export$df3a06d6289f983e, useContextProps as $7230ffa83bc0c2cf$export$29f1550f4b0d4415} from "./utils.mjs";
2
- import $cGkLv$react, {createContext as $cGkLv$createContext, forwardRef as $cGkLv$forwardRef} from "react";
2
+ import {createHideableComponent as $cGkLv$createHideableComponent} from "react-aria/private/collections/Hidden";
3
+ import $cGkLv$react, {createContext as $cGkLv$createContext} from "react";
3
4
 
4
5
  /*
5
6
  * Copyright 2022 Adobe. All rights reserved.
@@ -13,8 +14,9 @@ import $cGkLv$react, {createContext as $cGkLv$createContext, forwardRef as $cGkL
13
14
  * governing permissions and limitations under the License.
14
15
  */
15
16
 
17
+
16
18
  const $efe09c6d1c304b50$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $cGkLv$createContext)({});
17
- const $efe09c6d1c304b50$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $cGkLv$forwardRef)(function Text(props, ref) {
19
+ const $efe09c6d1c304b50$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $cGkLv$createHideableComponent)(function Text(props, ref) {
18
20
  [props, ref] = (0, $7230ffa83bc0c2cf$export$29f1550f4b0d4415)(props, ref, $efe09c6d1c304b50$export$9afb8bc826b033ea);
19
21
  let { elementType: elementType = 'span', ...domProps } = props;
20
22
  let ElementType = (0, $7230ffa83bc0c2cf$export$df3a06d6289f983e)[elementType];
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAEzE,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA8B;IAC3F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAC,cAAc,QAAQ,GAAG,UAAS,GAAG;IAC1C,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,YAAY;IAClC,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<any, any> {\n elementType?: string;\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = forwardRef(function Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType = 'span', ...domProps} = props;\n let ElementType = dom[elementType];\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.mjs.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AASM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAEzE,MAAM,4CAAO,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,KACjE,KAAgB,EAChB,GAA8B;IAE9B,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,cAAc,QAAQ,GAAG,UAAS,GAAG;IAC1C,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,YAAY;IAClC,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.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 */\nimport {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport React, {createContext, ForwardedRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<any, any> {\n elementType?: string;\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = /*#__PURE__*/ createHideableComponent(function Text(\n props: TextProps,\n ref: ForwardedRef<HTMLElement>\n) {\n [props, ref] = useContextProps(props, ref, TextContext);\n\n let {elementType = 'span', ...domProps} = props;\n let ElementType = dom[elementType];\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4DM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAE7C,CAAC;AAMI,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,aAChF,KAAwB,EACxB,GAAoC;IAEpC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,gDAAa,EACvB,cAAc,MAAM,EAAE,IAAI,OACtB;QACE,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;IACF,IACA;IAGN,IAAI,eAAC,WAAW,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAClD,cAAc,MAAM,EAAE,IAAI,OAEtB,CAAA,GAAA,6DAAuB,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE;IAAA,GAAG,YAAY,OAE/D,CAAA,GAAA,+CAAc,EACZ;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE,IAAI,OAAO,OAAO,MAAM,EAAE,IAAI;IAAS,GAC9D,OACA;IAGR,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;QAAC,GAAG,KAAK;oBAAE;IAAU;IAC5D,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,QAAQ;uBACN;uBACA;uBACA;YACA,YAAY,MAAM,UAAU;4BAC5B;wBACA;mBACA;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,MAAM;QACR,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, useToggleButton} from 'react-aria/useToggleButton';\n\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately/useToggleState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useToggleButtonGroupItem} from 'react-aria/useToggleButtonGroup';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * State of the toggle button.\n */\n state: ToggleState;\n}\n\nexport interface ToggleButtonProps\n extends\n Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>,\n HoverEvents,\n SlotProps,\n RenderProps<ToggleButtonRenderProps, 'button'>,\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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>;\n /**\n * When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used\n * standalone, a DOM id.\n */\n id?: Key;\n}\n\nexport const ToggleButtonContext = createContext<\n ContextValue<ToggleButtonProps, HTMLButtonElement>\n>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two\n * states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(\n groupState && props.id != null\n ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n }\n : props\n );\n\n let {buttonProps, isPressed, isSelected, isDisabled} =\n groupState && props.id != null\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n : // eslint-disable-next-line react-hooks/rules-of-hooks\n useToggleButton(\n {...props, id: props.id != null ? String(props.id) : undefined},\n state,\n ref\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {\n isHovered,\n isPressed,\n isFocused,\n isSelected: state.isSelected,\n isFocusVisible,\n isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4DM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAE7C,CAAC;AAMI,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,aAChF,KAAwB,EACx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AE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, useToggleButton} from 'react-aria/useToggleButton';\n\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately/useToggleState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useToggleButtonGroupItem} from 'react-aria/useToggleButtonGroup';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * State of the toggle button.\n */\n state: ToggleState;\n}\n\nexport interface ToggleButtonProps\n extends\n Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>,\n HoverEvents,\n SlotProps,\n RenderProps<ToggleButtonRenderProps, 'button'>,\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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>;\n /**\n * When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used\n * standalone, a DOM id.\n */\n id?: Key;\n}\n\nexport const ToggleButtonContext = createContext<\n ContextValue<ToggleButtonProps, HTMLButtonElement>\n>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two\n * states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(\n groupState && props.id != null\n ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n }\n : props\n );\n\n let {buttonProps, isPressed, isSelected, isDisabled} =\n groupState && props.id != null\n ? // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n : // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useToggleButton(\n {...props, id: props.id != null ? String(props.id) : undefined},\n state,\n ref\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {\n isHovered,\n isPressed,\n isFocused,\n isSelected: state.isSelected,\n isFocusVisible,\n isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4DM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAE7C,CAAC;AAMI,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,aAChF,KAAwB,EACxB,GAAoC;IAEpC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,qBAAa,EACvB,cAAc,MAAM,EAAE,IAAI,OACtB;QACE,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;IACF,IACA;IAGN,IAAI,eAAC,WAAW,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAClD,cAAc,MAAM,EAAE,IAAI,OAEtB,CAAA,GAAA,+BAAuB,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE;IAAA,GAAG,YAAY,OAE/D,CAAA,GAAA,sBAAc,EACZ;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE,IAAI,OAAO,OAAO,MAAM,EAAE,IAAI;IAAS,GAC9D,OACA;IAGR,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,GAAG,KAAK;oBAAE;IAAU;IAC5D,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,QAAQ;uBACN;uBACA;uBACA;YACA,YAAY,MAAM,UAAU;4BAC5B;wBACA;mBACA;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,MAAM;QACR,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, useToggleButton} from 'react-aria/useToggleButton';\n\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately/useToggleState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useToggleButtonGroupItem} from 'react-aria/useToggleButtonGroup';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * State of the toggle button.\n */\n state: ToggleState;\n}\n\nexport interface ToggleButtonProps\n extends\n Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>,\n HoverEvents,\n SlotProps,\n RenderProps<ToggleButtonRenderProps, 'button'>,\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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>;\n /**\n * When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used\n * standalone, a DOM id.\n */\n id?: Key;\n}\n\nexport const ToggleButtonContext = createContext<\n ContextValue<ToggleButtonProps, HTMLButtonElement>\n>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two\n * states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(\n groupState && props.id != null\n ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n }\n : props\n );\n\n let {buttonProps, isPressed, isSelected, isDisabled} =\n groupState && props.id != null\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n : // eslint-disable-next-line react-hooks/rules-of-hooks\n useToggleButton(\n {...props, id: props.id != null ? String(props.id) : undefined},\n state,\n ref\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {\n isHovered,\n isPressed,\n isFocused,\n isSelected: state.isSelected,\n isFocusVisible,\n isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.js.map"}
1
+ {"mappings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I,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,MAAM;QACR,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, useToggleButton} from 'react-aria/useToggleButton';\n\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately/useToggleState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useToggleButtonGroupItem} from 'react-aria/useToggleButtonGroup';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * State of the toggle button.\n */\n state: ToggleState;\n}\n\nexport interface ToggleButtonProps\n extends\n Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>,\n HoverEvents,\n SlotProps,\n RenderProps<ToggleButtonRenderProps, 'button'>,\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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>;\n /**\n * When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used\n * standalone, a DOM id.\n */\n id?: Key;\n}\n\nexport const ToggleButtonContext = createContext<\n ContextValue<ToggleButtonProps, HTMLButtonElement>\n>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two\n * states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(\n groupState && props.id != null\n ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n }\n : props\n );\n\n let {buttonProps, isPressed, isSelected, isDisabled} =\n groupState && props.id != null\n ? // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n : // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useToggleButton(\n {...props, id: props.id != null ? String(props.id) : undefined},\n state,\n ref\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {\n isHovered,\n isPressed,\n isFocused,\n isSelected: state.isSelected,\n isFocusVisible,\n isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4DM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAE7C,CAAC;AAMI,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,aAChF,KAAwB,EACxB,GAAoC;IAEpC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,qBAAa,EACvB,cAAc,MAAM,EAAE,IAAI,OACtB;QACE,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC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ria-components/src/ToggleButton.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 {AriaToggleButtonProps, useToggleButton} from 'react-aria/useToggleButton';\n\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately/useToggleState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useToggleButtonGroupItem} from 'react-aria/useToggleButtonGroup';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * State of the toggle button.\n */\n state: ToggleState;\n}\n\nexport interface ToggleButtonProps\n extends\n Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>,\n HoverEvents,\n SlotProps,\n RenderProps<ToggleButtonRenderProps, 'button'>,\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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>;\n /**\n * When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used\n * standalone, a DOM id.\n */\n id?: Key;\n}\n\nexport const ToggleButtonContext = createContext<\n ContextValue<ToggleButtonProps, HTMLButtonElement>\n>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two\n * states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(\n groupState && props.id != null\n ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n }\n : props\n );\n\n let {buttonProps, isPressed, isSelected, isDisabled} =\n groupState && props.id != null\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n : // eslint-disable-next-line react-hooks/rules-of-hooks\n useToggleButton(\n {...props, id: props.id != null ? String(props.id) : undefined},\n state,\n ref\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {\n isHovered,\n isPressed,\n isFocused,\n isSelected: state.isSelected,\n isFocusVisible,\n isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4DM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAE7C,CAAC;AAMI,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,aAChF,KAAwB,EACxB,GAAoC;IAEpC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,qBAAa,EACvB,cAAc,MAAM,EAAE,IAAI,OACtB;QACE,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;IACF,IACA;IAGN,IAAI,eAAC,WAAW,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAClD,cAAc,MAAM,EAAE,IAAI,OAEtB,CAAA,GAAA,+BAAuB,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE;IAAA,GAAG,YAAY,OAE/D,CAAA,GAAA,sBAAc,EACZ;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE,IAAI,OAAO,OAAO,MAAM,EAAE,IAAI;IAAS,GAC9D,OACA;IAGR,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,GAAG,KAAK;oBAAE;IAAU;IAC5D,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,QAAQ;uBACN;uBACA;uBACA;YACA,YAAY,MAAM,UAAU;4BAC5B;wBACA;mBACA;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,MAAM;QACR,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, useToggleButton} from 'react-aria/useToggleButton';\n\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately/useToggleState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useToggleButtonGroupItem} from 'react-aria/useToggleButtonGroup';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * State of the toggle button.\n */\n state: ToggleState;\n}\n\nexport interface ToggleButtonProps\n extends\n Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>,\n HoverEvents,\n SlotProps,\n RenderProps<ToggleButtonRenderProps, 'button'>,\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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>;\n /**\n * When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used\n * standalone, a DOM id.\n */\n id?: Key;\n}\n\nexport const ToggleButtonContext = createContext<\n ContextValue<ToggleButtonProps, HTMLButtonElement>\n>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two\n * states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(\n groupState && props.id != null\n ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n }\n : props\n );\n\n let {buttonProps, isPressed, isSelected, isDisabled} =\n groupState && props.id != null\n ? // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n : // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n useToggleButton(\n {...props, id: props.id != null ? String(props.id) : undefined},\n state,\n ref\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {\n isHovered,\n isPressed,\n isFocused,\n isSelected: state.isSelected,\n isFocusVisible,\n isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.mjs.map"}