react-aria-components 1.12.2 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/dist/Autocomplete.main.js +3 -3
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +3 -3
  4. package/dist/Autocomplete.module.js +3 -3
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/Breadcrumbs.main.js +5 -3
  7. package/dist/Breadcrumbs.main.js.map +1 -1
  8. package/dist/Breadcrumbs.mjs +5 -3
  9. package/dist/Breadcrumbs.module.js +5 -3
  10. package/dist/Breadcrumbs.module.js.map +1 -1
  11. package/dist/Button.main.js +5 -11
  12. package/dist/Button.main.js.map +1 -1
  13. package/dist/Button.mjs +5 -11
  14. package/dist/Button.module.js +5 -11
  15. package/dist/Button.module.js.map +1 -1
  16. package/dist/Calendar.main.js +2 -2
  17. package/dist/Calendar.main.js.map +1 -1
  18. package/dist/Calendar.mjs +2 -2
  19. package/dist/Calendar.module.js +2 -2
  20. package/dist/Calendar.module.js.map +1 -1
  21. package/dist/Checkbox.main.js.map +1 -1
  22. package/dist/Checkbox.module.js.map +1 -1
  23. package/dist/Collection.main.js +1 -1
  24. package/dist/Collection.main.js.map +1 -1
  25. package/dist/Collection.mjs +1 -1
  26. package/dist/Collection.module.js +1 -1
  27. package/dist/Collection.module.js.map +1 -1
  28. package/dist/ColorArea.main.js +1 -1
  29. package/dist/ColorArea.main.js.map +1 -1
  30. package/dist/ColorArea.mjs +1 -1
  31. package/dist/ColorArea.module.js +1 -1
  32. package/dist/ColorArea.module.js.map +1 -1
  33. package/dist/ColorField.main.js +1 -1
  34. package/dist/ColorField.main.js.map +1 -1
  35. package/dist/ColorField.mjs +1 -1
  36. package/dist/ColorField.module.js +1 -1
  37. package/dist/ColorField.module.js.map +1 -1
  38. package/dist/ColorPicker.main.js +1 -1
  39. package/dist/ColorPicker.main.js.map +1 -1
  40. package/dist/ColorPicker.mjs +1 -1
  41. package/dist/ColorPicker.module.js +1 -1
  42. package/dist/ColorPicker.module.js.map +1 -1
  43. package/dist/ColorSlider.main.js +1 -1
  44. package/dist/ColorSlider.main.js.map +1 -1
  45. package/dist/ColorSlider.mjs +1 -1
  46. package/dist/ColorSlider.module.js +1 -1
  47. package/dist/ColorSlider.module.js.map +1 -1
  48. package/dist/ColorSwatch.main.js.map +1 -1
  49. package/dist/ColorSwatch.module.js.map +1 -1
  50. package/dist/ColorSwatchPicker.main.js +1 -1
  51. package/dist/ColorSwatchPicker.main.js.map +1 -1
  52. package/dist/ColorSwatchPicker.mjs +1 -1
  53. package/dist/ColorSwatchPicker.module.js +1 -1
  54. package/dist/ColorSwatchPicker.module.js.map +1 -1
  55. package/dist/ColorThumb.main.js.map +1 -1
  56. package/dist/ColorThumb.module.js.map +1 -1
  57. package/dist/ColorWheel.main.js +1 -1
  58. package/dist/ColorWheel.main.js.map +1 -1
  59. package/dist/ColorWheel.mjs +1 -1
  60. package/dist/ColorWheel.module.js +1 -1
  61. package/dist/ColorWheel.module.js.map +1 -1
  62. package/dist/ComboBox.main.js.map +1 -1
  63. package/dist/ComboBox.module.js.map +1 -1
  64. package/dist/DateField.main.js +15 -9
  65. package/dist/DateField.main.js.map +1 -1
  66. package/dist/DateField.mjs +15 -9
  67. package/dist/DateField.module.js +15 -9
  68. package/dist/DateField.module.js.map +1 -1
  69. package/dist/DatePicker.main.js +6 -2
  70. package/dist/DatePicker.main.js.map +1 -1
  71. package/dist/DatePicker.mjs +6 -2
  72. package/dist/DatePicker.module.js +6 -2
  73. package/dist/DatePicker.module.js.map +1 -1
  74. package/dist/Dialog.main.js.map +1 -1
  75. package/dist/Dialog.module.js.map +1 -1
  76. package/dist/Disclosure.main.js +2 -1
  77. package/dist/Disclosure.main.js.map +1 -1
  78. package/dist/Disclosure.mjs +2 -1
  79. package/dist/Disclosure.module.js +2 -1
  80. package/dist/Disclosure.module.js.map +1 -1
  81. package/dist/DragAndDrop.main.js.map +1 -1
  82. package/dist/DragAndDrop.module.js.map +1 -1
  83. package/dist/DropZone.main.js.map +1 -1
  84. package/dist/DropZone.module.js.map +1 -1
  85. package/dist/FieldError.main.js.map +1 -1
  86. package/dist/FieldError.module.js.map +1 -1
  87. package/dist/FileTrigger.main.js +1 -0
  88. package/dist/FileTrigger.main.js.map +1 -1
  89. package/dist/FileTrigger.mjs +1 -0
  90. package/dist/FileTrigger.module.js +1 -0
  91. package/dist/FileTrigger.module.js.map +1 -1
  92. package/dist/Form.main.js.map +1 -1
  93. package/dist/Form.module.js.map +1 -1
  94. package/dist/GridList.main.js +25 -22
  95. package/dist/GridList.main.js.map +1 -1
  96. package/dist/GridList.mjs +26 -24
  97. package/dist/GridList.module.js +26 -24
  98. package/dist/GridList.module.js.map +1 -1
  99. package/dist/Group.main.js +5 -4
  100. package/dist/Group.main.js.map +1 -1
  101. package/dist/Group.mjs +5 -4
  102. package/dist/Group.module.js +5 -4
  103. package/dist/Group.module.js.map +1 -1
  104. package/dist/HiddenDateInput.main.js +5 -3
  105. package/dist/HiddenDateInput.main.js.map +1 -1
  106. package/dist/HiddenDateInput.mjs +5 -3
  107. package/dist/HiddenDateInput.module.js +5 -3
  108. package/dist/HiddenDateInput.module.js.map +1 -1
  109. package/dist/Input.main.js +4 -1
  110. package/dist/Input.main.js.map +1 -1
  111. package/dist/Input.mjs +4 -1
  112. package/dist/Input.module.js +4 -1
  113. package/dist/Input.module.js.map +1 -1
  114. package/dist/Link.main.js.map +1 -1
  115. package/dist/Link.module.js.map +1 -1
  116. package/dist/ListBox.main.js +20 -7
  117. package/dist/ListBox.main.js.map +1 -1
  118. package/dist/ListBox.mjs +21 -8
  119. package/dist/ListBox.module.js +21 -8
  120. package/dist/ListBox.module.js.map +1 -1
  121. package/dist/Menu.main.js +17 -7
  122. package/dist/Menu.main.js.map +1 -1
  123. package/dist/Menu.mjs +17 -7
  124. package/dist/Menu.module.js +17 -7
  125. package/dist/Menu.module.js.map +1 -1
  126. package/dist/Meter.main.js.map +1 -1
  127. package/dist/Meter.module.js.map +1 -1
  128. package/dist/Modal.main.js +9 -1
  129. package/dist/Modal.main.js.map +1 -1
  130. package/dist/Modal.mjs +10 -2
  131. package/dist/Modal.module.js +10 -2
  132. package/dist/Modal.module.js.map +1 -1
  133. package/dist/NumberField.main.js +2 -1
  134. package/dist/NumberField.main.js.map +1 -1
  135. package/dist/NumberField.mjs +2 -1
  136. package/dist/NumberField.module.js +2 -1
  137. package/dist/NumberField.module.js.map +1 -1
  138. package/dist/OverlayArrow.main.js.map +1 -1
  139. package/dist/OverlayArrow.module.js.map +1 -1
  140. package/dist/Popover.main.js.map +1 -1
  141. package/dist/Popover.module.js.map +1 -1
  142. package/dist/ProgressBar.main.js.map +1 -1
  143. package/dist/ProgressBar.module.js.map +1 -1
  144. package/dist/RSPContexts.main.js +4 -0
  145. package/dist/RSPContexts.main.js.map +1 -1
  146. package/dist/RSPContexts.mjs +3 -1
  147. package/dist/RSPContexts.module.js +3 -1
  148. package/dist/RSPContexts.module.js.map +1 -1
  149. package/dist/RadioGroup.main.js +10 -2
  150. package/dist/RadioGroup.main.js.map +1 -1
  151. package/dist/RadioGroup.mjs +10 -2
  152. package/dist/RadioGroup.module.js +10 -2
  153. package/dist/RadioGroup.module.js.map +1 -1
  154. package/dist/SearchField.main.js +7 -3
  155. package/dist/SearchField.main.js.map +1 -1
  156. package/dist/SearchField.mjs +7 -3
  157. package/dist/SearchField.module.js +7 -3
  158. package/dist/SearchField.module.js.map +1 -1
  159. package/dist/Select.main.js +62 -22
  160. package/dist/Select.main.js.map +1 -1
  161. package/dist/Select.mjs +65 -25
  162. package/dist/Select.module.js +65 -25
  163. package/dist/Select.module.js.map +1 -1
  164. package/dist/SelectionIndicator.main.js +45 -0
  165. package/dist/SelectionIndicator.main.js.map +1 -0
  166. package/dist/SelectionIndicator.mjs +35 -0
  167. package/dist/SelectionIndicator.module.js +35 -0
  168. package/dist/SelectionIndicator.module.js.map +1 -0
  169. package/dist/Separator.main.js.map +1 -1
  170. package/dist/Separator.module.js.map +1 -1
  171. package/dist/SharedElementTransition.main.js +139 -0
  172. package/dist/SharedElementTransition.main.js.map +1 -0
  173. package/dist/SharedElementTransition.mjs +129 -0
  174. package/dist/SharedElementTransition.module.js +129 -0
  175. package/dist/SharedElementTransition.module.js.map +1 -0
  176. package/dist/Slider.main.js.map +1 -1
  177. package/dist/Slider.module.js.map +1 -1
  178. package/dist/Switch.main.js.map +1 -1
  179. package/dist/Switch.module.js.map +1 -1
  180. package/dist/Table.main.js +142 -53
  181. package/dist/Table.main.js.map +1 -1
  182. package/dist/Table.mjs +143 -54
  183. package/dist/Table.module.js +143 -54
  184. package/dist/Table.module.js.map +1 -1
  185. package/dist/Tabs.main.js +86 -9
  186. package/dist/Tabs.main.js.map +1 -1
  187. package/dist/Tabs.mjs +88 -12
  188. package/dist/Tabs.module.js +88 -12
  189. package/dist/Tabs.module.js.map +1 -1
  190. package/dist/TagGroup.main.js +29 -17
  191. package/dist/TagGroup.main.js.map +1 -1
  192. package/dist/TagGroup.mjs +29 -17
  193. package/dist/TagGroup.module.js +29 -17
  194. package/dist/TagGroup.module.js.map +1 -1
  195. package/dist/TextArea.main.js.map +1 -1
  196. package/dist/TextArea.module.js.map +1 -1
  197. package/dist/TextField.main.js +2 -2
  198. package/dist/TextField.main.js.map +1 -1
  199. package/dist/TextField.mjs +2 -2
  200. package/dist/TextField.module.js +2 -2
  201. package/dist/TextField.module.js.map +1 -1
  202. package/dist/Toast.main.js.map +1 -1
  203. package/dist/Toast.module.js.map +1 -1
  204. package/dist/ToggleButton.main.js +7 -1
  205. package/dist/ToggleButton.main.js.map +1 -1
  206. package/dist/ToggleButton.mjs +7 -1
  207. package/dist/ToggleButton.module.js +7 -1
  208. package/dist/ToggleButton.module.js.map +1 -1
  209. package/dist/ToggleButtonGroup.main.js +4 -1
  210. package/dist/ToggleButtonGroup.main.js.map +1 -1
  211. package/dist/ToggleButtonGroup.mjs +4 -1
  212. package/dist/ToggleButtonGroup.module.js +4 -1
  213. package/dist/ToggleButtonGroup.module.js.map +1 -1
  214. package/dist/Toolbar.main.js.map +1 -1
  215. package/dist/Toolbar.module.js.map +1 -1
  216. package/dist/Tooltip.main.js.map +1 -1
  217. package/dist/Tooltip.module.js.map +1 -1
  218. package/dist/Tree.main.js +16 -4
  219. package/dist/Tree.main.js.map +1 -1
  220. package/dist/Tree.mjs +16 -4
  221. package/dist/Tree.module.js +16 -4
  222. package/dist/Tree.module.js.map +1 -1
  223. package/dist/import.mjs +13 -7
  224. package/dist/main.js +23 -3
  225. package/dist/main.js.map +1 -1
  226. package/dist/module.js +13 -7
  227. package/dist/module.js.map +1 -1
  228. package/dist/types.d.ts +663 -58
  229. package/dist/types.d.ts.map +1 -1
  230. package/dist/utils.main.js +0 -1
  231. package/dist/utils.main.js.map +1 -1
  232. package/dist/utils.mjs +0 -1
  233. package/dist/utils.module.js +0 -1
  234. package/dist/utils.module.js.map +1 -1
  235. package/i18n/ar-AE.js +1 -1
  236. package/i18n/ar-AE.mjs +1 -1
  237. package/i18n/bg-BG.js +1 -1
  238. package/i18n/bg-BG.mjs +1 -1
  239. package/i18n/cs-CZ.js +1 -1
  240. package/i18n/cs-CZ.mjs +1 -1
  241. package/i18n/da-DK.js +1 -1
  242. package/i18n/da-DK.mjs +1 -1
  243. package/i18n/de-DE.js +1 -1
  244. package/i18n/de-DE.mjs +1 -1
  245. package/i18n/el-GR.js +1 -1
  246. package/i18n/el-GR.mjs +1 -1
  247. package/i18n/en-US.js +1 -1
  248. package/i18n/en-US.mjs +1 -1
  249. package/i18n/es-ES.js +1 -1
  250. package/i18n/es-ES.mjs +1 -1
  251. package/i18n/et-EE.js +1 -1
  252. package/i18n/et-EE.mjs +1 -1
  253. package/i18n/fi-FI.js +1 -1
  254. package/i18n/fi-FI.mjs +1 -1
  255. package/i18n/fr-FR.js +1 -1
  256. package/i18n/fr-FR.mjs +1 -1
  257. package/i18n/he-IL.js +1 -1
  258. package/i18n/he-IL.mjs +1 -1
  259. package/i18n/hr-HR.js +1 -1
  260. package/i18n/hr-HR.mjs +1 -1
  261. package/i18n/hu-HU.js +1 -1
  262. package/i18n/hu-HU.mjs +1 -1
  263. package/i18n/index.js +67 -67
  264. package/i18n/index.mjs +67 -67
  265. package/i18n/it-IT.js +1 -1
  266. package/i18n/it-IT.mjs +1 -1
  267. package/i18n/ja-JP.js +1 -1
  268. package/i18n/ja-JP.mjs +1 -1
  269. package/i18n/ko-KR.js +1 -1
  270. package/i18n/ko-KR.mjs +1 -1
  271. package/i18n/lt-LT.js +1 -1
  272. package/i18n/lt-LT.mjs +1 -1
  273. package/i18n/lv-LV.js +1 -1
  274. package/i18n/lv-LV.mjs +1 -1
  275. package/i18n/nb-NO.js +1 -1
  276. package/i18n/nb-NO.mjs +1 -1
  277. package/i18n/nl-NL.js +1 -1
  278. package/i18n/nl-NL.mjs +1 -1
  279. package/i18n/pl-PL.js +1 -1
  280. package/i18n/pl-PL.mjs +1 -1
  281. package/i18n/pt-BR.js +1 -1
  282. package/i18n/pt-BR.mjs +1 -1
  283. package/i18n/pt-PT.js +1 -1
  284. package/i18n/pt-PT.mjs +1 -1
  285. package/i18n/ro-RO.js +1 -1
  286. package/i18n/ro-RO.mjs +1 -1
  287. package/i18n/ru-RU.js +1 -1
  288. package/i18n/ru-RU.mjs +1 -1
  289. package/i18n/sk-SK.js +1 -1
  290. package/i18n/sk-SK.mjs +1 -1
  291. package/i18n/sl-SI.js +1 -1
  292. package/i18n/sl-SI.mjs +1 -1
  293. package/i18n/sr-SP.js +1 -1
  294. package/i18n/sr-SP.mjs +1 -1
  295. package/i18n/sv-SE.js +1 -1
  296. package/i18n/sv-SE.mjs +1 -1
  297. package/i18n/tr-TR.js +1 -1
  298. package/i18n/tr-TR.mjs +1 -1
  299. package/i18n/uk-UA.js +1 -1
  300. package/i18n/uk-UA.mjs +1 -1
  301. package/i18n/zh-CN.js +1 -1
  302. package/i18n/zh-CN.mjs +1 -1
  303. package/i18n/zh-TW.js +1 -1
  304. package/i18n/zh-TW.mjs +1 -1
  305. package/package.json +25 -25
  306. package/src/Autocomplete.tsx +2 -2
  307. package/src/Breadcrumbs.tsx +25 -6
  308. package/src/Button.tsx +15 -11
  309. package/src/Calendar.tsx +51 -6
  310. package/src/Checkbox.tsx +25 -2
  311. package/src/Collection.tsx +1 -1
  312. package/src/ColorArea.tsx +15 -2
  313. package/src/ColorField.tsx +16 -1
  314. package/src/ColorPicker.tsx +5 -2
  315. package/src/ColorSlider.tsx +16 -2
  316. package/src/ColorSwatch.tsx +15 -2
  317. package/src/ColorSwatchPicker.tsx +18 -1
  318. package/src/ColorThumb.tsx +8 -2
  319. package/src/ColorWheel.tsx +24 -3
  320. package/src/ComboBox.tsx +18 -1
  321. package/src/DateField.tsx +60 -16
  322. package/src/DatePicker.tsx +38 -5
  323. package/src/Dialog.tsx +5 -0
  324. package/src/Disclosure.tsx +30 -5
  325. package/src/DragAndDrop.tsx +8 -2
  326. package/src/DropZone.tsx +16 -2
  327. package/src/FieldError.tsx +8 -2
  328. package/src/FileTrigger.tsx +1 -0
  329. package/src/Form.tsx +5 -0
  330. package/src/GridList.tsx +66 -35
  331. package/src/Group.tsx +32 -18
  332. package/src/HiddenDateInput.tsx +6 -4
  333. package/src/Input.tsx +23 -3
  334. package/src/Link.tsx +15 -2
  335. package/src/ListBox.tsx +58 -14
  336. package/src/Menu.tsx +41 -8
  337. package/src/Meter.tsx +16 -2
  338. package/src/Modal.tsx +30 -3
  339. package/src/NumberField.tsx +21 -3
  340. package/src/OverlayArrow.tsx +14 -2
  341. package/src/Popover.tsx +13 -1
  342. package/src/ProgressBar.tsx +17 -3
  343. package/src/RSPContexts.ts +19 -0
  344. package/src/RadioGroup.tsx +33 -4
  345. package/src/SearchField.tsx +36 -4
  346. package/src/Select.tsx +100 -36
  347. package/src/SelectionIndicator.tsx +46 -0
  348. package/src/Separator.tsx +10 -1
  349. package/src/SharedElementTransition.tsx +185 -0
  350. package/src/Slider.tsx +35 -3
  351. package/src/Switch.tsx +18 -5
  352. package/src/Table.tsx +204 -83
  353. package/src/Tabs.tsx +158 -15
  354. package/src/TagGroup.tsx +60 -26
  355. package/src/TextArea.tsx +14 -2
  356. package/src/TextField.tsx +20 -2
  357. package/src/Toast.tsx +22 -2
  358. package/src/ToggleButton.tsx +19 -2
  359. package/src/ToggleButtonGroup.tsx +26 -4
  360. package/src/Toolbar.tsx +13 -1
  361. package/src/Tooltip.tsx +13 -1
  362. package/src/Tree.tsx +76 -40
  363. package/src/index.ts +17 -10
  364. package/src/utils.tsx +2 -3
  365. package/dist/context.main.js +0 -25
  366. package/dist/context.main.js.map +0 -1
  367. package/dist/context.mjs +0 -19
  368. package/dist/context.module.js +0 -19
  369. package/dist/context.module.js.map +0 -1
  370. package/src/context.tsx +0 -34
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2GM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA2C;AAC3E,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA+B;AAKvE,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAiC;IAChI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,eAAE,cAAc,cAAa,GAAG;IAC7C,WAAW,CAAA,GAAA,oBAAM,EAAE,IACjB,OAAO,aAAa,aAChB,SAAS;yBAAC;YAAa,iBAAiB;QAAI,KAC5C,UACH;QAAC;QAAU;KAAY;IAE1B,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,0DAAC;YAAU,OAAO;YAAO,YAAY;YAAY,SAAS;;AAG/E;AAQA,SAAS,gCAAU,SAAC,KAAK,EAAE,SAAS,GAAG,cAAE,UAAU,EAAiB;IAClE,IAAI,eAAC,cA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A;YACA,6CAA6C;YAC7C,SAAS,CAAA,GAAA,gCAAS,EAAE,CAAC;mBACrB;QACF;IACF;IAEA,IAAI,CAAC,cAAc,CAAC,MAAM,gBAAgB,EACxC,OAAO;IAGT,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IACvD,OAAO,SAAS,EAAE;IAElB,IAAI,WAAW,aACX,CAAA,GAAA,2BAAS,EAAE,UAAU,eAAe,YAAY,eAChD;IAEJ,qBACE,0DAAC;QACE,GAAG,QAAQ;QACZ,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,aAAa;QACb,OAAO,CAAA,GAAA,gCAAS,EAAE,CAAC,cAAc,MAAM,KAAK;QAC5C,cAAY,CAAC,aAAa,SAAS;qBACnC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAa;aAAK;YACnB;gBAAC;gBAAqB;aAAK;SAC5B;qBACD,0DAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;QAAC,OAAO,CAAA,GAAA,mDAAwB;OAChE,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/Tabs.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 {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {AriaTabListProps, AriaTabPanelProps, mergeProps, Orientation, useFocusRing, useHover, useTab, useTabList, useTabPanel} from 'react-aria';\nimport {Collection, CollectionBuilder, CollectionNode, createHideableComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, inertValue, useObjectRef} from '@react-aria/utils';\nimport {Collection as ICollection, Node, TabListState, useTabListState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, useContext, useMemo} from 'react';\n\nexport interface TabsProps extends Omit<AriaTabListProps<any>, 'items' | 'children'>, RenderProps<TabsRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport interface TabsRenderProps {\n /**\n * The orientation of the tabs.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation\n}\n\nexport interface TabListProps<T> extends StyleRenderProps<TabListRenderProps>, AriaLabelingProps, Omit<CollectionProps<T>, 'disabledKeys'>, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport interface TabListRenderProps {\n /**\n * The orientation of the tab list.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the tab. */\n id?: Key,\n /** Whether the tab is disabled. */\n isDisabled?: boolean\n}\n\nexport interface TabRenderProps {\n /**\n * Whether the tab is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the tab is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the tab is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the tab is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, RenderProps<TabPanelRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * Whether to mount the tab panel in the DOM even when it is not currently selected.\n * Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually.\n * @default false\n */\n shouldForceMount?: boolean\n}\n\nexport interface TabPanelRenderProps {\n /**\n * Whether the tab panel is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab panel is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab panel is currently non-interactive. This occurs when the\n * `shouldForceMount` prop is true, and the corresponding tab is not selected.\n * @selector [data-inert]\n */\n isInert: boolean,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\nexport const TabListStateContext = createContext<TabListState<object> | null>(null);\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nexport const Tabs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tabs(props: TabsProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TabsContext);\n let {children, orientation = 'horizontal'} = props;\n children = useMemo(() => (\n typeof children === 'function'\n ? children({orientation, defaultChildren: null})\n : children\n ), [children, orientation]);\n\n return (\n <CollectionBuilder content={children}>\n {collection => <TabsInner props={props} collection={collection} tabsRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface TabsInnerProps {\n props: TabsProps,\n collection: ICollection<Node<any>>,\n tabsRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) {\n let {orientation = 'horizontal'} = props;\n let state = useTabListState({\n ...props,\n collection,\n children: undefined\n });\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let values = useMemo(() => ({\n orientation,\n isFocusWithin: isFocused,\n isFocusVisible\n }), [orientation, isFocused, isFocusVisible]);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tabs',\n values\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-orientation={orientation}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={state.isDisabled || undefined}>\n <Provider\n values={[\n [TabsContext, props],\n [TabListStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A TabList is used within Tabs to group tabs that a user can switch between.\n * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.\n */\nexport const TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TabList<T extends object>(props: TabListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(TabListStateContext);\n return state\n ? <TabListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TabListInnerProps<T> {\n props: TabListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TabListInner<T extends object>({props, forwardedRef: ref}: TabListInnerProps<T>) {\n let state = useContext(TabListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {orientation = 'horizontal', keyboardActivation = 'automatic'} = useSlottedContext(TabsContext)!;\n let objectRef = useObjectRef(ref);\n\n let {tabListProps} = useTabList({\n ...props,\n orientation,\n keyboardActivation\n }, state, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n children: null,\n defaultClassName: 'react-aria-TabList',\n values: {\n orientation,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tabListProps)}\n ref={objectRef}\n data-orientation={orientation || undefined}>\n <CollectionRoot collection={state.collection} persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)} />\n </div>\n );\n}\n\nclass TabItemNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Tab provides a title for an individual item within a TabList.\n */\nexport const Tab = /*#__PURE__*/ createLeafComponent(TabItemNode, (props: TabProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let {tabProps, isSelected, isDisabled, isPressed} = useTab({key: item.key, ...props}, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled,\n onHoverStart: props.onHoverStart,\n onHoverEnd: props.onHoverEnd,\n onHoverChange: props.onHoverChange\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tab',\n values: {\n isSelected,\n isDisabled,\n isFocused,\n isFocusVisible,\n isPressed,\n isHovered\n }\n });\n\n let ElementType: React.ElementType = item.props.href ? 'a' : 'div';\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, tabProps, focusProps, hoverProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n\n/**\n * A TabPanel provides the content for a tab.\n */\nexport const TabPanel = /*#__PURE__*/ createHideableComponent(function TabPanel(props: TabPanelProps, forwardedRef: ForwardedRef<HTMLDivElement>) {\n const state = useContext(TabListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {id, ...otherProps} = props;\n let {tabPanelProps} = useTabPanel(props, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let isSelected = state.selectedKey === props.id;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-TabPanel',\n values: {\n isFocused,\n isFocusVisible,\n // @ts-ignore - compatibility with React < 19\n isInert: inertValue(!isSelected),\n state\n }\n });\n\n if (!isSelected && !props.shouldForceMount) {\n return null;\n }\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n delete DOMProps.id;\n\n let domProps = isSelected\n ? mergeProps(DOMProps, tabPanelProps, focusProps, renderProps)\n : renderProps;\n\n return (\n <div\n {...domProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n inert={inertValue(!isSelected || props.inert)}\n data-inert={!isSelected ? 'true' : undefined}>\n <Provider\n values={[\n [TabsContext, null],\n [TabListStateContext, null]\n ]}>\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Tabs.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6IM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA2C;AAC3E,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA+B;AAKvE,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAiC;IAChI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,eAAE,cAAc,cAAa,GAAG;IAC7C,WAAW,CAAA,GAAA,oBAAM,EAAE,IACjB,OAAO,aAAa,aAChB,SAAS;yBAAC;YAAa,iBAAiB;QAAI,KAC5C,UACH;QAAC;QAAU;KAAY;IAE1B,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS;OACzB,CAAA,2BAA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AAG;IAC5E,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,4BAAU,EAAE,OAAO,OAAO;IAChD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IAEzD,IAAI,aAAa,MAAM,WAAW,KAAK,MAAM,EAAE;IAC/C,IAAI,aAAa,CAAA,GAAA,uCAAgB,EAAE,QAAQ,CAAC;IAC5C,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;uBACN;4BACA;YACA,6CAA6C;YAC7C,SAAS,CAAA,GAAA,gCAAS,EAAE,CAAC;wBACrB;uBACA;mBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IACvD,OAAO,SAAS,EAAE;IAElB,IAAI,WAAW,aACX,CAAA,GAAA,2BAAS,EAAE,UAAU,eAAe,YAAY,eAChD,CAAA,GAAA,2BAAS,EAAE,UAAU;IAEzB,qBACE,0DAAC;QACE,GAAG,QAAQ;QACZ,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,aAAa;QACb,OAAO,CAAA,GAAA,gCAAS,EAAE,CAAC,cAAc,MAAM,KAAK;QAC5C,cAAY,CAAC,aAAa,SAAS;QACnC,iBAAe,cAAc;QAC7B,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAa;aAAK;YACnB;gBAAC;gBAAqB;aAAK;SAC5B;qBACD,0DAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;QAAC,OAAO,CAAA,GAAA,mDAAwB;OAChE,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/Tabs.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 {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {AriaTabListProps, AriaTabPanelProps, mergeProps, Orientation, useFocusRing, useHover, useTab, useTabList, useTabPanel} from 'react-aria';\nimport {ClassNameOrFunction, ContextValue, Provider, RenderProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {Collection, CollectionBuilder, CollectionNode, createHideableComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, usePersistedKeys} from './Collection';\nimport {filterDOMProps, inertValue, useEnterAnimation, useExitAnimation, useLayoutEffect, useObjectRef} from '@react-aria/utils';\nimport {Collection as ICollection, Node, TabListState, useTabListState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, useContext, useMemo, useRef, useState} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\n\nexport interface TabsProps extends Omit<AriaTabListProps<any>, 'items' | 'children'>, RenderProps<TabsRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Tabs'\n */\n className?: ClassNameOrFunction<TabsRenderProps>\n}\n\nexport interface TabsRenderProps {\n /**\n * The orientation of the tabs.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation\n}\n\nexport interface TabListProps<T> extends StyleRenderProps<TabListRenderProps>, AriaLabelingProps, Omit<CollectionProps<T>, 'disabledKeys'>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-TabList'\n */\n className?: ClassNameOrFunction<TabListRenderProps>\n}\n\nexport interface TabListRenderProps {\n /**\n * The orientation of the tab list.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Tab'\n */\n className?: ClassNameOrFunction<TabRenderProps>,\n /** The unique id of the tab. */\n id?: Key,\n /** Whether the tab is disabled. */\n isDisabled?: boolean\n}\n\nexport interface TabRenderProps {\n /**\n * Whether the tab is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the tab is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the tab is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the tab is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, RenderProps<TabPanelRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-TabPanel'\n */\n className?: ClassNameOrFunction<TabPanelRenderProps>,\n /**\n * Whether to mount the tab panel in the DOM even when it is not currently selected.\n * Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually.\n * @default false\n */\n shouldForceMount?: boolean\n}\n\nexport interface TabPanelRenderProps {\n /**\n * Whether the tab panel is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab panel is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab panel is currently non-interactive. This occurs when the\n * `shouldForceMount` prop is true, and the corresponding tab is not selected.\n * @selector [data-inert]\n */\n isInert: boolean,\n /**\n * Whether the tab panel is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the tab panel is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\nexport const TabListStateContext = createContext<TabListState<object> | null>(null);\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nexport const Tabs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tabs(props: TabsProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TabsContext);\n let {children, orientation = 'horizontal'} = props;\n children = useMemo(() => (\n typeof children === 'function'\n ? children({orientation, defaultChildren: null})\n : children\n ), [children, orientation]);\n\n return (\n <CollectionBuilder content={children}>\n {collection => <TabsInner props={props} collection={collection} tabsRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface TabsInnerProps {\n props: TabsProps,\n collection: ICollection<Node<any>>,\n tabsRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) {\n let {orientation = 'horizontal'} = props;\n let state = useTabListState({\n ...props,\n collection,\n children: undefined\n });\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let values = useMemo(() => ({\n orientation,\n isFocusWithin: isFocused,\n isFocusVisible\n }), [orientation, isFocused, isFocusVisible]);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tabs',\n values\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-orientation={orientation}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={state.isDisabled || undefined}>\n <Provider\n values={[\n [TabsContext, props],\n [TabListStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A TabList is used within Tabs to group tabs that a user can switch between.\n * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.\n */\nexport const TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TabList<T extends object>(props: TabListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(TabListStateContext);\n return state\n ? <TabListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TabListInnerProps<T> {\n props: TabListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TabListInner<T extends object>({props, forwardedRef: ref}: TabListInnerProps<T>) {\n let state = useContext(TabListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {orientation = 'horizontal', keyboardActivation = 'automatic'} = useSlottedContext(TabsContext)!;\n let objectRef = useObjectRef(ref);\n\n let {tabListProps} = useTabList({\n ...props,\n orientation,\n keyboardActivation\n }, state, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n children: null,\n defaultClassName: 'react-aria-TabList',\n values: {\n orientation,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tabListProps)}\n ref={objectRef}\n data-orientation={orientation || undefined}>\n <SharedElementTransition>\n <CollectionRoot collection={state.collection} persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)} />\n </SharedElementTransition>\n </div>\n );\n}\n\nclass TabItemNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Tab provides a title for an individual item within a TabList.\n */\nexport const Tab = /*#__PURE__*/ createLeafComponent(TabItemNode, (props: TabProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let {tabProps, isSelected, isDisabled, isPressed} = useTab({key: item.key, ...props}, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled,\n onHoverStart: props.onHoverStart,\n onHoverEnd: props.onHoverEnd,\n onHoverChange: props.onHoverChange\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tab',\n values: {\n isSelected,\n isDisabled,\n isFocused,\n isFocusVisible,\n isPressed,\n isHovered\n }\n });\n\n let ElementType: React.ElementType = item.props.href ? 'a' : 'div';\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, tabProps, focusProps, hoverProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </ElementType>\n );\n});\n\nexport interface TabPanelsProps<T> extends CollectionProps<T>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-TabPanels'\n */\n className?: string\n}\n\n/**\n * Groups multiple `<TabPanel>` elements, and provides CSS variables for animated transitions.\n */\nexport const TabPanels = /*#__PURE__*/ createHideableComponent(function TabPanels<T extends object>(props: TabPanelsProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>) {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef(forwardedRef);\n\n let selectedKeyRef = useRef(state.selectedKey);\n let prevSize = useRef<DOMRect | null>(null);\n let hasTransition = useRef<boolean | null>(null);\n useLayoutEffect(() => {\n let el = ref.current;\n if (!el) {\n return;\n }\n\n if (hasTransition.current == null) {\n hasTransition.current = /width|height|all/.test(window.getComputedStyle(el).transition);\n }\n \n if (hasTransition.current && selectedKeyRef.current != null && selectedKeyRef.current !== state.selectedKey) {\n // Measure auto size.\n el.style.setProperty('--tab-panel-width', 'auto');\n el.style.setProperty('--tab-panel-height', 'auto');\n let {width, height} = el.getBoundingClientRect();\n\n if (prevSize.current && (prevSize.current.width !== width || prevSize.current.height !== height)) {\n // Revert to previous size.\n el.style.setProperty('--tab-panel-width', prevSize.current.width + 'px');\n el.style.setProperty('--tab-panel-height', prevSize.current.height + 'px');\n \n // Force style re-calculation to trigger animations.\n window.getComputedStyle(el).height;\n\n // Animate to current pixel size.\n el.style.setProperty('--tab-panel-width', width + 'px');\n el.style.setProperty('--tab-panel-height', height + 'px');\n\n // When animations complete, revert back to auto size.\n Promise.all(el.getAnimations().map(a => a.finished))\n .then(() => {\n el.style.setProperty('--tab-panel-width', 'auto');\n el.style.setProperty('--tab-panel-height', 'auto');\n })\n .catch(() => {});\n }\n }\n \n selectedKeyRef.current = state.selectedKey;\n }, [ref, state.selectedKey]);\n\n // Store previous size before DOM updates occur.\n // This breaks the rules of hooks because there is no effect that runs _before_ DOM updates.\n // eslint-disable-next-line rulesdir/pure-render\n if (state.selectedKey != null && state.selectedKey !== selectedKeyRef.current && ref.current && hasTransition.current) {\n // eslint-disable-next-line rulesdir/pure-render\n prevSize.current = ref.current.getBoundingClientRect();\n }\n\n return (\n <div \n {...props}\n ref={ref}\n className={props.className || 'react-aria-TabPanels'}>\n <Collection {...props} />\n </div>\n );\n});\n\n/**\n * A TabPanel provides the content for a tab.\n */\nexport const TabPanel = /*#__PURE__*/ createHideableComponent(function TabPanel(props: TabPanelProps, forwardedRef: ForwardedRef<HTMLDivElement>) {\n const state = useContext(TabListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n\n // Track if the tab panel was initially selected on mount (after extra render to populate the collection).\n // In this case, we don't want to trigger animations.\n let isSelected = state.selectedKey === props.id;\n let [isInitiallySelected, setInitiallySelected] = useState<boolean | null>(state.selectedKey != null ? isSelected : null);\n if (isInitiallySelected == null && state.selectedKey != null) {\n setInitiallySelected(isSelected);\n } else if (!isSelected && isInitiallySelected) {\n setInitiallySelected(false);\n }\n\n let isExiting = useExitAnimation(ref, isSelected);\n if (!isSelected && !props.shouldForceMount && !isExiting) {\n return null;\n }\n\n return (\n <TabPanelInner\n {...props}\n tabPanelRef={ref}\n isInitiallySelected={isInitiallySelected || false}\n isExiting={isExiting} />\n );\n});\n\nfunction TabPanelInner(props: TabPanelProps & {tabPanelRef: RefObject<HTMLDivElement | null>, isInitiallySelected: boolean, isExiting: boolean}) {\n let state = useContext(TabListStateContext)!;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {id, tabPanelRef: ref, isInitiallySelected, isExiting, ...otherProps} = props;\n let {tabPanelProps} = useTabPanel(props, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let isSelected = state.selectedKey === props.id;\n let isEntering = useEnterAnimation(ref) && !isInitiallySelected;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-TabPanel',\n values: {\n isFocused,\n isFocusVisible,\n // @ts-ignore - compatibility with React < 19\n isInert: inertValue(!isSelected),\n isEntering,\n isExiting,\n state\n }\n });\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n delete DOMProps.id;\n\n let domProps = isSelected\n ? mergeProps(DOMProps, tabPanelProps, focusProps, renderProps)\n : mergeProps(DOMProps, renderProps);\n\n return (\n <div\n {...domProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n inert={inertValue(!isSelected || props.inert)}\n data-inert={!isSelected ? 'true' : undefined}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n <Provider\n values={[\n [TabsContext, null],\n [TabListStateContext, null]\n ]}>\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n </Provider>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Tabs.main.js.map"}
package/dist/Tabs.mjs CHANGED
@@ -1,10 +1,12 @@
1
- import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.mjs";
2
1
  import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
2
+ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.mjs";
3
+ import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from "./SelectionIndicator.mjs";
4
+ import {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from "./SharedElementTransition.mjs";
3
5
  import {useFocusRing as $7aSLZ$useFocusRing, mergeProps as $7aSLZ$mergeProps, useTabList as $7aSLZ$useTabList, useTab as $7aSLZ$useTab, useHover as $7aSLZ$useHover, useTabPanel as $7aSLZ$useTabPanel} from "react-aria";
4
6
  import {CollectionBuilder as $7aSLZ$CollectionBuilder, Collection as $7aSLZ$Collection, CollectionNode as $7aSLZ$CollectionNode, createLeafComponent as $7aSLZ$createLeafComponent, createHideableComponent as $7aSLZ$createHideableComponent} from "@react-aria/collections";
5
- import {filterDOMProps as $7aSLZ$filterDOMProps, useObjectRef as $7aSLZ$useObjectRef, inertValue as $7aSLZ$inertValue} from "@react-aria/utils";
7
+ import {filterDOMProps as $7aSLZ$filterDOMProps, useObjectRef as $7aSLZ$useObjectRef, useLayoutEffect as $7aSLZ$useLayoutEffect, useExitAnimation as $7aSLZ$useExitAnimation, useEnterAnimation as $7aSLZ$useEnterAnimation, inertValue as $7aSLZ$inertValue} from "@react-aria/utils";
6
8
  import {useTabListState as $7aSLZ$useTabListState} from "react-stately";
7
- import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSLZ$forwardRef, useMemo as $7aSLZ$useMemo, useContext as $7aSLZ$useContext} from "react";
9
+ import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSLZ$forwardRef, useMemo as $7aSLZ$useMemo, useContext as $7aSLZ$useContext, useRef as $7aSLZ$useRef, useState as $7aSLZ$useState} from "react";
8
10
 
9
11
  /*
10
12
  * Copyright 2022 Adobe. All rights reserved.
@@ -23,6 +25,8 @@ import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSL
23
25
 
24
26
 
25
27
 
28
+
29
+
26
30
  const $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f = /*#__PURE__*/ (0, $7aSLZ$createContext)(null);
27
31
  const $5e8ad37a45e1c704$export$364712098d2aa57c = /*#__PURE__*/ (0, $7aSLZ$createContext)(null);
28
32
  const $5e8ad37a45e1c704$export$b2539bed5023c21c = /*#__PURE__*/ (0, $7aSLZ$forwardRef)(function Tabs(props, ref) {
@@ -125,10 +129,10 @@ function $5e8ad37a45e1c704$var$TabListInner({ props: props, forwardedRef: ref })
125
129
  ...(0, $7aSLZ$mergeProps)(DOMProps, renderProps, tabListProps),
126
130
  ref: objectRef,
127
131
  "data-orientation": orientation || undefined
128
- }, /*#__PURE__*/ (0, $7aSLZ$react).createElement(CollectionRoot, {
132
+ }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $c8a5a149f625efcf$export$758399f318e6385a), null, /*#__PURE__*/ (0, $7aSLZ$react).createElement(CollectionRoot, {
129
133
  collection: state.collection,
130
134
  persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey)
131
- }));
135
+ })));
132
136
  }
133
137
  class $5e8ad37a45e1c704$var$TabItemNode extends (0, $7aSLZ$CollectionNode) {
134
138
  }
@@ -176,16 +180,85 @@ const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /*#__PURE__*/ (0, $7aSLZ$creat
176
180
  "data-focus-visible": isFocusVisible || undefined,
177
181
  "data-pressed": isPressed || undefined,
178
182
  "data-hovered": isHovered || undefined
179
- }, renderProps.children);
183
+ }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $1d5b8b8664671ef2$export$c9549807523555e0).Provider, {
184
+ value: {
185
+ isSelected: isSelected
186
+ }
187
+ }, renderProps.children));
188
+ });
189
+ const $5e8ad37a45e1c704$export$5dae8d435677f210 = /*#__PURE__*/ (0, $7aSLZ$createHideableComponent)(function TabPanels(props, forwardedRef) {
190
+ let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
191
+ let ref = (0, $7aSLZ$useObjectRef)(forwardedRef);
192
+ let selectedKeyRef = (0, $7aSLZ$useRef)(state.selectedKey);
193
+ let prevSize = (0, $7aSLZ$useRef)(null);
194
+ let hasTransition = (0, $7aSLZ$useRef)(null);
195
+ (0, $7aSLZ$useLayoutEffect)(()=>{
196
+ let el = ref.current;
197
+ if (!el) return;
198
+ if (hasTransition.current == null) hasTransition.current = /width|height|all/.test(window.getComputedStyle(el).transition);
199
+ if (hasTransition.current && selectedKeyRef.current != null && selectedKeyRef.current !== state.selectedKey) {
200
+ // Measure auto size.
201
+ el.style.setProperty('--tab-panel-width', 'auto');
202
+ el.style.setProperty('--tab-panel-height', 'auto');
203
+ let { width: width, height: height } = el.getBoundingClientRect();
204
+ if (prevSize.current && (prevSize.current.width !== width || prevSize.current.height !== height)) {
205
+ // Revert to previous size.
206
+ el.style.setProperty('--tab-panel-width', prevSize.current.width + 'px');
207
+ el.style.setProperty('--tab-panel-height', prevSize.current.height + 'px');
208
+ // Force style re-calculation to trigger animations.
209
+ window.getComputedStyle(el).height;
210
+ // Animate to current pixel size.
211
+ el.style.setProperty('--tab-panel-width', width + 'px');
212
+ el.style.setProperty('--tab-panel-height', height + 'px');
213
+ // When animations complete, revert back to auto size.
214
+ Promise.all(el.getAnimations().map((a)=>a.finished)).then(()=>{
215
+ el.style.setProperty('--tab-panel-width', 'auto');
216
+ el.style.setProperty('--tab-panel-height', 'auto');
217
+ }).catch(()=>{});
218
+ }
219
+ }
220
+ selectedKeyRef.current = state.selectedKey;
221
+ }, [
222
+ ref,
223
+ state.selectedKey
224
+ ]);
225
+ // Store previous size before DOM updates occur.
226
+ // This breaks the rules of hooks because there is no effect that runs _before_ DOM updates.
227
+ // eslint-disable-next-line rulesdir/pure-render
228
+ if (state.selectedKey != null && state.selectedKey !== selectedKeyRef.current && ref.current && hasTransition.current) // eslint-disable-next-line rulesdir/pure-render
229
+ prevSize.current = ref.current.getBoundingClientRect();
230
+ return /*#__PURE__*/ (0, $7aSLZ$react).createElement("div", {
231
+ ...props,
232
+ ref: ref,
233
+ className: props.className || 'react-aria-TabPanels'
234
+ }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $7aSLZ$Collection), props));
180
235
  });
181
236
  const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$createHideableComponent)(function TabPanel(props, forwardedRef) {
182
237
  const state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
183
238
  let ref = (0, $7aSLZ$useObjectRef)(forwardedRef);
239
+ // Track if the tab panel was initially selected on mount (after extra render to populate the collection).
240
+ // In this case, we don't want to trigger animations.
241
+ let isSelected = state.selectedKey === props.id;
242
+ let [isInitiallySelected, setInitiallySelected] = (0, $7aSLZ$useState)(state.selectedKey != null ? isSelected : null);
243
+ if (isInitiallySelected == null && state.selectedKey != null) setInitiallySelected(isSelected);
244
+ else if (!isSelected && isInitiallySelected) setInitiallySelected(false);
245
+ let isExiting = (0, $7aSLZ$useExitAnimation)(ref, isSelected);
246
+ if (!isSelected && !props.shouldForceMount && !isExiting) return null;
247
+ return /*#__PURE__*/ (0, $7aSLZ$react).createElement($5e8ad37a45e1c704$var$TabPanelInner, {
248
+ ...props,
249
+ tabPanelRef: ref,
250
+ isInitiallySelected: isInitiallySelected || false,
251
+ isExiting: isExiting
252
+ });
253
+ });
254
+ function $5e8ad37a45e1c704$var$TabPanelInner(props) {
255
+ let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
184
256
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
185
- let { id: id, ...otherProps } = props;
257
+ let { id: id, tabPanelRef: ref, isInitiallySelected: isInitiallySelected, isExiting: isExiting, ...otherProps } = props;
186
258
  let { tabPanelProps: tabPanelProps } = (0, $7aSLZ$useTabPanel)(props, state, ref);
187
259
  let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $7aSLZ$useFocusRing)();
188
260
  let isSelected = state.selectedKey === props.id;
261
+ let isEntering = (0, $7aSLZ$useEnterAnimation)(ref) && !isInitiallySelected;
189
262
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
190
263
  ...props,
191
264
  defaultClassName: 'react-aria-TabPanel',
@@ -194,15 +267,16 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$creat
194
267
  isFocusVisible: isFocusVisible,
195
268
  // @ts-ignore - compatibility with React < 19
196
269
  isInert: (0, $7aSLZ$inertValue)(!isSelected),
270
+ isEntering: isEntering,
271
+ isExiting: isExiting,
197
272
  state: state
198
273
  }
199
274
  });
200
- if (!isSelected && !props.shouldForceMount) return null;
201
275
  let DOMProps = (0, $7aSLZ$filterDOMProps)(otherProps, {
202
276
  global: true
203
277
  });
204
278
  delete DOMProps.id;
205
- let domProps = isSelected ? (0, $7aSLZ$mergeProps)(DOMProps, tabPanelProps, focusProps, renderProps) : renderProps;
279
+ let domProps = isSelected ? (0, $7aSLZ$mergeProps)(DOMProps, tabPanelProps, focusProps, renderProps) : (0, $7aSLZ$mergeProps)(DOMProps, renderProps);
206
280
  return /*#__PURE__*/ (0, $7aSLZ$react).createElement("div", {
207
281
  ...domProps,
208
282
  ref: ref,
@@ -210,7 +284,9 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$creat
210
284
  "data-focus-visible": isFocusVisible || undefined,
211
285
  // @ts-ignore
212
286
  inert: (0, $7aSLZ$inertValue)(!isSelected || props.inert),
213
- "data-inert": !isSelected ? 'true' : undefined
287
+ "data-inert": !isSelected ? 'true' : undefined,
288
+ "data-entering": isEntering || undefined,
289
+ "data-exiting": isExiting || undefined
214
290
  }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
215
291
  values: [
216
292
  [
@@ -225,8 +301,8 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$creat
225
301
  }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $7135fc7d473fd974$export$4feb769f8ddf26c5).Provider, {
226
302
  value: (0, $7135fc7d473fd974$export$a164736487e3f0ae)
227
303
  }, renderProps.children)));
228
- });
304
+ }
229
305
 
230
306
 
231
- export {$5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel};
307
+ export {$5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$5dae8d435677f210 as TabPanels, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel};
232
308
  //# sourceMappingURL=Tabs.module.js.map
@@ -1,10 +1,12 @@
1
- import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.module.js";
2
1
  import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
2
+ import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.module.js";
3
+ import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from "./SelectionIndicator.module.js";
4
+ import {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from "./SharedElementTransition.module.js";
3
5
  import {useFocusRing as $7aSLZ$useFocusRing, mergeProps as $7aSLZ$mergeProps, useTabList as $7aSLZ$useTabList, useTab as $7aSLZ$useTab, useHover as $7aSLZ$useHover, useTabPanel as $7aSLZ$useTabPanel} from "react-aria";
4
6
  import {CollectionBuilder as $7aSLZ$CollectionBuilder, Collection as $7aSLZ$Collection, CollectionNode as $7aSLZ$CollectionNode, createLeafComponent as $7aSLZ$createLeafComponent, createHideableComponent as $7aSLZ$createHideableComponent} from "@react-aria/collections";
5
- import {filterDOMProps as $7aSLZ$filterDOMProps, useObjectRef as $7aSLZ$useObjectRef, inertValue as $7aSLZ$inertValue} from "@react-aria/utils";
7
+ import {filterDOMProps as $7aSLZ$filterDOMProps, useObjectRef as $7aSLZ$useObjectRef, useLayoutEffect as $7aSLZ$useLayoutEffect, useExitAnimation as $7aSLZ$useExitAnimation, useEnterAnimation as $7aSLZ$useEnterAnimation, inertValue as $7aSLZ$inertValue} from "@react-aria/utils";
6
8
  import {useTabListState as $7aSLZ$useTabListState} from "react-stately";
7
- import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSLZ$forwardRef, useMemo as $7aSLZ$useMemo, useContext as $7aSLZ$useContext} from "react";
9
+ import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSLZ$forwardRef, useMemo as $7aSLZ$useMemo, useContext as $7aSLZ$useContext, useRef as $7aSLZ$useRef, useState as $7aSLZ$useState} from "react";
8
10
 
9
11
  /*
10
12
  * Copyright 2022 Adobe. All rights reserved.
@@ -23,6 +25,8 @@ import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSL
23
25
 
24
26
 
25
27
 
28
+
29
+
26
30
  const $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f = /*#__PURE__*/ (0, $7aSLZ$createContext)(null);
27
31
  const $5e8ad37a45e1c704$export$364712098d2aa57c = /*#__PURE__*/ (0, $7aSLZ$createContext)(null);
28
32
  const $5e8ad37a45e1c704$export$b2539bed5023c21c = /*#__PURE__*/ (0, $7aSLZ$forwardRef)(function Tabs(props, ref) {
@@ -125,10 +129,10 @@ function $5e8ad37a45e1c704$var$TabListInner({ props: props, forwardedRef: ref })
125
129
  ...(0, $7aSLZ$mergeProps)(DOMProps, renderProps, tabListProps),
126
130
  ref: objectRef,
127
131
  "data-orientation": orientation || undefined
128
- }, /*#__PURE__*/ (0, $7aSLZ$react).createElement(CollectionRoot, {
132
+ }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $c8a5a149f625efcf$export$758399f318e6385a), null, /*#__PURE__*/ (0, $7aSLZ$react).createElement(CollectionRoot, {
129
133
  collection: state.collection,
130
134
  persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey)
131
- }));
135
+ })));
132
136
  }
133
137
  class $5e8ad37a45e1c704$var$TabItemNode extends (0, $7aSLZ$CollectionNode) {
134
138
  }
@@ -176,16 +180,85 @@ const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /*#__PURE__*/ (0, $7aSLZ$creat
176
180
  "data-focus-visible": isFocusVisible || undefined,
177
181
  "data-pressed": isPressed || undefined,
178
182
  "data-hovered": isHovered || undefined
179
- }, renderProps.children);
183
+ }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $1d5b8b8664671ef2$export$c9549807523555e0).Provider, {
184
+ value: {
185
+ isSelected: isSelected
186
+ }
187
+ }, renderProps.children));
188
+ });
189
+ const $5e8ad37a45e1c704$export$5dae8d435677f210 = /*#__PURE__*/ (0, $7aSLZ$createHideableComponent)(function TabPanels(props, forwardedRef) {
190
+ let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
191
+ let ref = (0, $7aSLZ$useObjectRef)(forwardedRef);
192
+ let selectedKeyRef = (0, $7aSLZ$useRef)(state.selectedKey);
193
+ let prevSize = (0, $7aSLZ$useRef)(null);
194
+ let hasTransition = (0, $7aSLZ$useRef)(null);
195
+ (0, $7aSLZ$useLayoutEffect)(()=>{
196
+ let el = ref.current;
197
+ if (!el) return;
198
+ if (hasTransition.current == null) hasTransition.current = /width|height|all/.test(window.getComputedStyle(el).transition);
199
+ if (hasTransition.current && selectedKeyRef.current != null && selectedKeyRef.current !== state.selectedKey) {
200
+ // Measure auto size.
201
+ el.style.setProperty('--tab-panel-width', 'auto');
202
+ el.style.setProperty('--tab-panel-height', 'auto');
203
+ let { width: width, height: height } = el.getBoundingClientRect();
204
+ if (prevSize.current && (prevSize.current.width !== width || prevSize.current.height !== height)) {
205
+ // Revert to previous size.
206
+ el.style.setProperty('--tab-panel-width', prevSize.current.width + 'px');
207
+ el.style.setProperty('--tab-panel-height', prevSize.current.height + 'px');
208
+ // Force style re-calculation to trigger animations.
209
+ window.getComputedStyle(el).height;
210
+ // Animate to current pixel size.
211
+ el.style.setProperty('--tab-panel-width', width + 'px');
212
+ el.style.setProperty('--tab-panel-height', height + 'px');
213
+ // When animations complete, revert back to auto size.
214
+ Promise.all(el.getAnimations().map((a)=>a.finished)).then(()=>{
215
+ el.style.setProperty('--tab-panel-width', 'auto');
216
+ el.style.setProperty('--tab-panel-height', 'auto');
217
+ }).catch(()=>{});
218
+ }
219
+ }
220
+ selectedKeyRef.current = state.selectedKey;
221
+ }, [
222
+ ref,
223
+ state.selectedKey
224
+ ]);
225
+ // Store previous size before DOM updates occur.
226
+ // This breaks the rules of hooks because there is no effect that runs _before_ DOM updates.
227
+ // eslint-disable-next-line rulesdir/pure-render
228
+ if (state.selectedKey != null && state.selectedKey !== selectedKeyRef.current && ref.current && hasTransition.current) // eslint-disable-next-line rulesdir/pure-render
229
+ prevSize.current = ref.current.getBoundingClientRect();
230
+ return /*#__PURE__*/ (0, $7aSLZ$react).createElement("div", {
231
+ ...props,
232
+ ref: ref,
233
+ className: props.className || 'react-aria-TabPanels'
234
+ }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $7aSLZ$Collection), props));
180
235
  });
181
236
  const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$createHideableComponent)(function TabPanel(props, forwardedRef) {
182
237
  const state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
183
238
  let ref = (0, $7aSLZ$useObjectRef)(forwardedRef);
239
+ // Track if the tab panel was initially selected on mount (after extra render to populate the collection).
240
+ // In this case, we don't want to trigger animations.
241
+ let isSelected = state.selectedKey === props.id;
242
+ let [isInitiallySelected, setInitiallySelected] = (0, $7aSLZ$useState)(state.selectedKey != null ? isSelected : null);
243
+ if (isInitiallySelected == null && state.selectedKey != null) setInitiallySelected(isSelected);
244
+ else if (!isSelected && isInitiallySelected) setInitiallySelected(false);
245
+ let isExiting = (0, $7aSLZ$useExitAnimation)(ref, isSelected);
246
+ if (!isSelected && !props.shouldForceMount && !isExiting) return null;
247
+ return /*#__PURE__*/ (0, $7aSLZ$react).createElement($5e8ad37a45e1c704$var$TabPanelInner, {
248
+ ...props,
249
+ tabPanelRef: ref,
250
+ isInitiallySelected: isInitiallySelected || false,
251
+ isExiting: isExiting
252
+ });
253
+ });
254
+ function $5e8ad37a45e1c704$var$TabPanelInner(props) {
255
+ let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
184
256
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
185
- let { id: id, ...otherProps } = props;
257
+ let { id: id, tabPanelRef: ref, isInitiallySelected: isInitiallySelected, isExiting: isExiting, ...otherProps } = props;
186
258
  let { tabPanelProps: tabPanelProps } = (0, $7aSLZ$useTabPanel)(props, state, ref);
187
259
  let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $7aSLZ$useFocusRing)();
188
260
  let isSelected = state.selectedKey === props.id;
261
+ let isEntering = (0, $7aSLZ$useEnterAnimation)(ref) && !isInitiallySelected;
189
262
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
190
263
  ...props,
191
264
  defaultClassName: 'react-aria-TabPanel',
@@ -194,15 +267,16 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$creat
194
267
  isFocusVisible: isFocusVisible,
195
268
  // @ts-ignore - compatibility with React < 19
196
269
  isInert: (0, $7aSLZ$inertValue)(!isSelected),
270
+ isEntering: isEntering,
271
+ isExiting: isExiting,
197
272
  state: state
198
273
  }
199
274
  });
200
- if (!isSelected && !props.shouldForceMount) return null;
201
275
  let DOMProps = (0, $7aSLZ$filterDOMProps)(otherProps, {
202
276
  global: true
203
277
  });
204
278
  delete DOMProps.id;
205
- let domProps = isSelected ? (0, $7aSLZ$mergeProps)(DOMProps, tabPanelProps, focusProps, renderProps) : renderProps;
279
+ let domProps = isSelected ? (0, $7aSLZ$mergeProps)(DOMProps, tabPanelProps, focusProps, renderProps) : (0, $7aSLZ$mergeProps)(DOMProps, renderProps);
206
280
  return /*#__PURE__*/ (0, $7aSLZ$react).createElement("div", {
207
281
  ...domProps,
208
282
  ref: ref,
@@ -210,7 +284,9 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$creat
210
284
  "data-focus-visible": isFocusVisible || undefined,
211
285
  // @ts-ignore
212
286
  inert: (0, $7aSLZ$inertValue)(!isSelected || props.inert),
213
- "data-inert": !isSelected ? 'true' : undefined
287
+ "data-inert": !isSelected ? 'true' : undefined,
288
+ "data-entering": isEntering || undefined,
289
+ "data-exiting": isExiting || undefined
214
290
  }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
215
291
  values: [
216
292
  [
@@ -225,8 +301,8 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$creat
225
301
  }, /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $7135fc7d473fd974$export$4feb769f8ddf26c5).Provider, {
226
302
  value: (0, $7135fc7d473fd974$export$a164736487e3f0ae)
227
303
  }, renderProps.children)));
228
- });
304
+ }
229
305
 
230
306
 
231
- export {$5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel};
307
+ export {$5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$5dae8d435677f210 as TabPanels, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel};
232
308
  //# sourceMappingURL=Tabs.module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2GM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA2C;AAC3E,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA+B;AAKvE,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAiC;IAChI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,eAAE,cAAc,cAAa,GAAG;IAC7C,WAAW,CAAA,GAAA,cAAM,EAAE,IACjB,OAAO,aAAa,aAChB,SAAS;yBAAC;YAAa,iBAAiB;QAAI,KAC5C,UACH;QAAC;QAAU;KAAY;IAE1B,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,gCAAC;YAAU,OAAO;YAAO,YAAY;YAAY,SAAS;;AAG/E;AAQA,SAAS,gCAAU,SAAC,KAAK,EAAE,SAAS,GAAG,cAAE,UAAU,EAAiB;IAClE,IAAI,eAAC,cAAc,cAAa,GAAG;IACnC,IAAI,QAAQ,CAAA,GAAA,sBAAc,EAAE;QAC1B,GAAG,KAAK;oBACR;QACA,UAAU;IACZ;IACA,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mB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Y;QAAC,QAAQ;IAAI;IACvD,OAAO,SAAS,EAAE;IAElB,IAAI,WAAW,aACX,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe,YAAY,eAChD;IAEJ,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,aAAa;QACb,OAAO,CAAA,GAAA,iBAAS,EAAE,CAAC,cAAc,MAAM,KAAK;QAC5C,cAAY,CAAC,aAAa,SAAS;qBACnC,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAa;aAAK;YACnB;gBAAC;gBAAqB;aAAK;SAC5B;qBACD,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO,CAAA,GAAA,yCAAwB;OAChE,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/Tabs.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 {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {AriaTabListProps, AriaTabPanelProps, mergeProps, Orientation, useFocusRing, useHover, useTab, useTabList, useTabPanel} from 'react-aria';\nimport {Collection, CollectionBuilder, CollectionNode, createHideableComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, inertValue, useObjectRef} from '@react-aria/utils';\nimport {Collection as ICollection, Node, TabListState, useTabListState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, useContext, useMemo} from 'react';\n\nexport interface TabsProps extends Omit<AriaTabListProps<any>, 'items' | 'children'>, RenderProps<TabsRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport interface TabsRenderProps {\n /**\n * The orientation of the tabs.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation\n}\n\nexport interface TabListProps<T> extends StyleRenderProps<TabListRenderProps>, AriaLabelingProps, Omit<CollectionProps<T>, 'disabledKeys'>, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport interface TabListRenderProps {\n /**\n * The orientation of the tab list.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the tab. */\n id?: Key,\n /** Whether the tab is disabled. */\n isDisabled?: boolean\n}\n\nexport interface TabRenderProps {\n /**\n * Whether the tab is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the tab is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the tab is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the tab is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, RenderProps<TabPanelRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * Whether to mount the tab panel in the DOM even when it is not currently selected.\n * Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually.\n * @default false\n */\n shouldForceMount?: boolean\n}\n\nexport interface TabPanelRenderProps {\n /**\n * Whether the tab panel is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab panel is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab panel is currently non-interactive. This occurs when the\n * `shouldForceMount` prop is true, and the corresponding tab is not selected.\n * @selector [data-inert]\n */\n isInert: boolean,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\nexport const TabListStateContext = createContext<TabListState<object> | null>(null);\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nexport const Tabs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tabs(props: TabsProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TabsContext);\n let {children, orientation = 'horizontal'} = props;\n children = useMemo(() => (\n typeof children === 'function'\n ? children({orientation, defaultChildren: null})\n : children\n ), [children, orientation]);\n\n return (\n <CollectionBuilder content={children}>\n {collection => <TabsInner props={props} collection={collection} tabsRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface TabsInnerProps {\n props: TabsProps,\n collection: ICollection<Node<any>>,\n tabsRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) {\n let {orientation = 'horizontal'} = props;\n let state = useTabListState({\n ...props,\n collection,\n children: undefined\n });\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let values = useMemo(() => ({\n orientation,\n isFocusWithin: isFocused,\n isFocusVisible\n }), [orientation, isFocused, isFocusVisible]);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tabs',\n values\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-orientation={orientation}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={state.isDisabled || undefined}>\n <Provider\n values={[\n [TabsContext, props],\n [TabListStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A TabList is used within Tabs to group tabs that a user can switch between.\n * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.\n */\nexport const TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TabList<T extends object>(props: TabListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(TabListStateContext);\n return state\n ? <TabListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TabListInnerProps<T> {\n props: TabListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TabListInner<T extends object>({props, forwardedRef: ref}: TabListInnerProps<T>) {\n let state = useContext(TabListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {orientation = 'horizontal', keyboardActivation = 'automatic'} = useSlottedContext(TabsContext)!;\n let objectRef = useObjectRef(ref);\n\n let {tabListProps} = useTabList({\n ...props,\n orientation,\n keyboardActivation\n }, state, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n children: null,\n defaultClassName: 'react-aria-TabList',\n values: {\n orientation,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tabListProps)}\n ref={objectRef}\n data-orientation={orientation || undefined}>\n <CollectionRoot collection={state.collection} persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)} />\n </div>\n );\n}\n\nclass TabItemNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Tab provides a title for an individual item within a TabList.\n */\nexport const Tab = /*#__PURE__*/ createLeafComponent(TabItemNode, (props: TabProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let {tabProps, isSelected, isDisabled, isPressed} = useTab({key: item.key, ...props}, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled,\n onHoverStart: props.onHoverStart,\n onHoverEnd: props.onHoverEnd,\n onHoverChange: props.onHoverChange\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tab',\n values: {\n isSelected,\n isDisabled,\n isFocused,\n isFocusVisible,\n isPressed,\n isHovered\n }\n });\n\n let ElementType: React.ElementType = item.props.href ? 'a' : 'div';\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, tabProps, focusProps, hoverProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}>\n {renderProps.children}\n </ElementType>\n );\n});\n\n/**\n * A TabPanel provides the content for a tab.\n */\nexport const TabPanel = /*#__PURE__*/ createHideableComponent(function TabPanel(props: TabPanelProps, forwardedRef: ForwardedRef<HTMLDivElement>) {\n const state = useContext(TabListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {id, ...otherProps} = props;\n let {tabPanelProps} = useTabPanel(props, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let isSelected = state.selectedKey === props.id;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-TabPanel',\n values: {\n isFocused,\n isFocusVisible,\n // @ts-ignore - compatibility with React < 19\n isInert: inertValue(!isSelected),\n state\n }\n });\n\n if (!isSelected && !props.shouldForceMount) {\n return null;\n }\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n delete DOMProps.id;\n\n let domProps = isSelected\n ? mergeProps(DOMProps, tabPanelProps, focusProps, renderProps)\n : renderProps;\n\n return (\n <div\n {...domProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n inert={inertValue(!isSelected || props.inert)}\n data-inert={!isSelected ? 'true' : undefined}>\n <Provider\n values={[\n [TabsContext, null],\n [TabListStateContext, null]\n ]}>\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Tabs.module.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6IM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA2C;AAC3E,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA+B;AAKvE,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAiC;IAChI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,eAAE,cAAc,cAAa,GAAG;IAC7C,WAAW,CAAA,GAAA,cAAM,EAAE,IACjB,OAAO,aAAa,aAChB,SAAS;yBAAC;YAAa,iBAAiB;QAAI,KAC5C,UACH;QAAC;QAAU;KAAY;IAE1B,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,gCAAC;YAAU,OAAO;YAAO,YAAY;YAAY,SAAS;;AAG/E;AAQA,SAAS,gCAAU,SAAC,KAAK,EAAE,SAAS,GAAG,cAAE,UAAU,EAAiB;IAClE,IAAI,eAAC,cAAc,cAAa,GAAG;IACnC,IAAI,QAAQ,CAAA,GAAA,sBAAc,EAA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;IAC/C,IAAI,aAAa,CAAA,GAAA,wBAAgB,EAAE,QAAQ,CAAC;IAC5C,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;uBACN;4BACA;YACA,6CAA6C;YAC7C,SAAS,CAAA,GAAA,iBAAS,EAAE,CAAC;wBACrB;uBACA;mBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IACvD,OAAO,SAAS,EAAE;IAElB,IAAI,WAAW,aACX,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe,YAAY,eAChD,CAAA,GAAA,iBAAS,EAAE,UAAU;IAEzB,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,aAAa;QACb,OAAO,CAAA,GAAA,iBAAS,EAAE,CAAC,cAAc,MAAM,KAAK;QAC5C,cAAY,CAAC,aAAa,SAAS;QACnC,iBAAe,cAAc;QAC7B,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAa;aAAK;YACnB;gBAAC;gBAAqB;aAAK;SAC5B;qBACD,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO,CAAA,GAAA,yCAAwB;OAChE,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/Tabs.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 {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {AriaTabListProps, AriaTabPanelProps, mergeProps, Orientation, useFocusRing, useHover, useTab, useTabList, useTabPanel} from 'react-aria';\nimport {ClassNameOrFunction, ContextValue, Provider, RenderProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {Collection, CollectionBuilder, CollectionNode, createHideableComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, usePersistedKeys} from './Collection';\nimport {filterDOMProps, inertValue, useEnterAnimation, useExitAnimation, useLayoutEffect, useObjectRef} from '@react-aria/utils';\nimport {Collection as ICollection, Node, TabListState, useTabListState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, useContext, useMemo, useRef, useState} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\n\nexport interface TabsProps extends Omit<AriaTabListProps<any>, 'items' | 'children'>, RenderProps<TabsRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Tabs'\n */\n className?: ClassNameOrFunction<TabsRenderProps>\n}\n\nexport interface TabsRenderProps {\n /**\n * The orientation of the tabs.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation\n}\n\nexport interface TabListProps<T> extends StyleRenderProps<TabListRenderProps>, AriaLabelingProps, Omit<CollectionProps<T>, 'disabledKeys'>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-TabList'\n */\n className?: ClassNameOrFunction<TabListRenderProps>\n}\n\nexport interface TabListRenderProps {\n /**\n * The orientation of the tab list.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Tab'\n */\n className?: ClassNameOrFunction<TabRenderProps>,\n /** The unique id of the tab. */\n id?: Key,\n /** Whether the tab is disabled. */\n isDisabled?: boolean\n}\n\nexport interface TabRenderProps {\n /**\n * Whether the tab is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the tab is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the tab is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the tab is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, RenderProps<TabPanelRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-TabPanel'\n */\n className?: ClassNameOrFunction<TabPanelRenderProps>,\n /**\n * Whether to mount the tab panel in the DOM even when it is not currently selected.\n * Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually.\n * @default false\n */\n shouldForceMount?: boolean\n}\n\nexport interface TabPanelRenderProps {\n /**\n * Whether the tab panel is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab panel is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab panel is currently non-interactive. This occurs when the\n * `shouldForceMount` prop is true, and the corresponding tab is not selected.\n * @selector [data-inert]\n */\n isInert: boolean,\n /**\n * Whether the tab panel is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the tab panel is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\nexport const TabListStateContext = createContext<TabListState<object> | null>(null);\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nexport const Tabs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tabs(props: TabsProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TabsContext);\n let {children, orientation = 'horizontal'} = props;\n children = useMemo(() => (\n typeof children === 'function'\n ? children({orientation, defaultChildren: null})\n : children\n ), [children, orientation]);\n\n return (\n <CollectionBuilder content={children}>\n {collection => <TabsInner props={props} collection={collection} tabsRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface TabsInnerProps {\n props: TabsProps,\n collection: ICollection<Node<any>>,\n tabsRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) {\n let {orientation = 'horizontal'} = props;\n let state = useTabListState({\n ...props,\n collection,\n children: undefined\n });\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let values = useMemo(() => ({\n orientation,\n isFocusWithin: isFocused,\n isFocusVisible\n }), [orientation, isFocused, isFocusVisible]);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tabs',\n values\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-orientation={orientation}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={state.isDisabled || undefined}>\n <Provider\n values={[\n [TabsContext, props],\n [TabListStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A TabList is used within Tabs to group tabs that a user can switch between.\n * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.\n */\nexport const TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TabList<T extends object>(props: TabListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(TabListStateContext);\n return state\n ? <TabListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TabListInnerProps<T> {\n props: TabListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TabListInner<T extends object>({props, forwardedRef: ref}: TabListInnerProps<T>) {\n let state = useContext(TabListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {orientation = 'horizontal', keyboardActivation = 'automatic'} = useSlottedContext(TabsContext)!;\n let objectRef = useObjectRef(ref);\n\n let {tabListProps} = useTabList({\n ...props,\n orientation,\n keyboardActivation\n }, state, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n children: null,\n defaultClassName: 'react-aria-TabList',\n values: {\n orientation,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tabListProps)}\n ref={objectRef}\n data-orientation={orientation || undefined}>\n <SharedElementTransition>\n <CollectionRoot collection={state.collection} persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)} />\n </SharedElementTransition>\n </div>\n );\n}\n\nclass TabItemNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Tab provides a title for an individual item within a TabList.\n */\nexport const Tab = /*#__PURE__*/ createLeafComponent(TabItemNode, (props: TabProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let {tabProps, isSelected, isDisabled, isPressed} = useTab({key: item.key, ...props}, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled,\n onHoverStart: props.onHoverStart,\n onHoverEnd: props.onHoverEnd,\n onHoverChange: props.onHoverChange\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tab',\n values: {\n isSelected,\n isDisabled,\n isFocused,\n isFocusVisible,\n isPressed,\n isHovered\n }\n });\n\n let ElementType: React.ElementType = item.props.href ? 'a' : 'div';\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, tabProps, focusProps, hoverProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </ElementType>\n );\n});\n\nexport interface TabPanelsProps<T> extends CollectionProps<T>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-TabPanels'\n */\n className?: string\n}\n\n/**\n * Groups multiple `<TabPanel>` elements, and provides CSS variables for animated transitions.\n */\nexport const TabPanels = /*#__PURE__*/ createHideableComponent(function TabPanels<T extends object>(props: TabPanelsProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>) {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef(forwardedRef);\n\n let selectedKeyRef = useRef(state.selectedKey);\n let prevSize = useRef<DOMRect | null>(null);\n let hasTransition = useRef<boolean | null>(null);\n useLayoutEffect(() => {\n let el = ref.current;\n if (!el) {\n return;\n }\n\n if (hasTransition.current == null) {\n hasTransition.current = /width|height|all/.test(window.getComputedStyle(el).transition);\n }\n \n if (hasTransition.current && selectedKeyRef.current != null && selectedKeyRef.current !== state.selectedKey) {\n // Measure auto size.\n el.style.setProperty('--tab-panel-width', 'auto');\n el.style.setProperty('--tab-panel-height', 'auto');\n let {width, height} = el.getBoundingClientRect();\n\n if (prevSize.current && (prevSize.current.width !== width || prevSize.current.height !== height)) {\n // Revert to previous size.\n el.style.setProperty('--tab-panel-width', prevSize.current.width + 'px');\n el.style.setProperty('--tab-panel-height', prevSize.current.height + 'px');\n \n // Force style re-calculation to trigger animations.\n window.getComputedStyle(el).height;\n\n // Animate to current pixel size.\n el.style.setProperty('--tab-panel-width', width + 'px');\n el.style.setProperty('--tab-panel-height', height + 'px');\n\n // When animations complete, revert back to auto size.\n Promise.all(el.getAnimations().map(a => a.finished))\n .then(() => {\n el.style.setProperty('--tab-panel-width', 'auto');\n el.style.setProperty('--tab-panel-height', 'auto');\n })\n .catch(() => {});\n }\n }\n \n selectedKeyRef.current = state.selectedKey;\n }, [ref, state.selectedKey]);\n\n // Store previous size before DOM updates occur.\n // This breaks the rules of hooks because there is no effect that runs _before_ DOM updates.\n // eslint-disable-next-line rulesdir/pure-render\n if (state.selectedKey != null && state.selectedKey !== selectedKeyRef.current && ref.current && hasTransition.current) {\n // eslint-disable-next-line rulesdir/pure-render\n prevSize.current = ref.current.getBoundingClientRect();\n }\n\n return (\n <div \n {...props}\n ref={ref}\n className={props.className || 'react-aria-TabPanels'}>\n <Collection {...props} />\n </div>\n );\n});\n\n/**\n * A TabPanel provides the content for a tab.\n */\nexport const TabPanel = /*#__PURE__*/ createHideableComponent(function TabPanel(props: TabPanelProps, forwardedRef: ForwardedRef<HTMLDivElement>) {\n const state = useContext(TabListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n\n // Track if the tab panel was initially selected on mount (after extra render to populate the collection).\n // In this case, we don't want to trigger animations.\n let isSelected = state.selectedKey === props.id;\n let [isInitiallySelected, setInitiallySelected] = useState<boolean | null>(state.selectedKey != null ? isSelected : null);\n if (isInitiallySelected == null && state.selectedKey != null) {\n setInitiallySelected(isSelected);\n } else if (!isSelected && isInitiallySelected) {\n setInitiallySelected(false);\n }\n\n let isExiting = useExitAnimation(ref, isSelected);\n if (!isSelected && !props.shouldForceMount && !isExiting) {\n return null;\n }\n\n return (\n <TabPanelInner\n {...props}\n tabPanelRef={ref}\n isInitiallySelected={isInitiallySelected || false}\n isExiting={isExiting} />\n );\n});\n\nfunction TabPanelInner(props: TabPanelProps & {tabPanelRef: RefObject<HTMLDivElement | null>, isInitiallySelected: boolean, isExiting: boolean}) {\n let state = useContext(TabListStateContext)!;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {id, tabPanelRef: ref, isInitiallySelected, isExiting, ...otherProps} = props;\n let {tabPanelProps} = useTabPanel(props, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let isSelected = state.selectedKey === props.id;\n let isEntering = useEnterAnimation(ref) && !isInitiallySelected;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-TabPanel',\n values: {\n isFocused,\n isFocusVisible,\n // @ts-ignore - compatibility with React < 19\n isInert: inertValue(!isSelected),\n isEntering,\n isExiting,\n state\n }\n });\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n delete DOMProps.id;\n\n let domProps = isSelected\n ? mergeProps(DOMProps, tabPanelProps, focusProps, renderProps)\n : mergeProps(DOMProps, renderProps);\n\n return (\n <div\n {...domProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n inert={inertValue(!isSelected || props.inert)}\n data-inert={!isSelected ? 'true' : undefined}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n <Provider\n values={[\n [TabsContext, null],\n [TabListStateContext, null]\n ]}>\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n </Provider>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Tabs.module.js.map"}