@react-spectrum/s2 3.0.0-nightly-5ae234603-240925 → 3.0.0-nightly-d57bd8d90-240927

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 (445) hide show
  1. package/dist/Accordion.cjs.map +1 -1
  2. package/dist/Accordion.css.map +1 -1
  3. package/dist/Accordion.mjs.map +1 -1
  4. package/dist/ActionButton.cjs.map +1 -1
  5. package/dist/ActionButton.css.map +1 -1
  6. package/dist/ActionButton.mjs.map +1 -1
  7. package/dist/AlertDialog.cjs.map +1 -1
  8. package/dist/AlertDialog.css.map +1 -1
  9. package/dist/AlertDialog.mjs.map +1 -1
  10. package/dist/Avatar.cjs.map +1 -1
  11. package/dist/Avatar.css.map +1 -1
  12. package/dist/Avatar.mjs.map +1 -1
  13. package/dist/AvatarGroup.cjs.map +1 -1
  14. package/dist/AvatarGroup.css.map +1 -1
  15. package/dist/AvatarGroup.mjs.map +1 -1
  16. package/dist/Badge.cjs.map +1 -1
  17. package/dist/Badge.css.map +1 -1
  18. package/dist/Badge.mjs.map +1 -1
  19. package/dist/Breadcrumbs.cjs.map +1 -1
  20. package/dist/Breadcrumbs.css.map +1 -1
  21. package/dist/Breadcrumbs.mjs.map +1 -1
  22. package/dist/Button.cjs +39 -5
  23. package/dist/Button.cjs.map +1 -1
  24. package/dist/Button.css +64 -0
  25. package/dist/Button.css.map +1 -1
  26. package/dist/Button.mjs +39 -5
  27. package/dist/Button.mjs.map +1 -1
  28. package/dist/ButtonGroup.cjs.map +1 -1
  29. package/dist/ButtonGroup.css.map +1 -1
  30. package/dist/ButtonGroup.mjs.map +1 -1
  31. package/dist/Card.cjs +2 -2
  32. package/dist/Card.cjs.map +1 -1
  33. package/dist/Card.css.map +1 -1
  34. package/dist/Card.mjs +2 -2
  35. package/dist/Card.mjs.map +1 -1
  36. package/dist/CardView.cjs.map +1 -1
  37. package/dist/CardView.css.map +1 -1
  38. package/dist/CardView.mjs.map +1 -1
  39. package/dist/CenterBaseline.cjs.map +1 -1
  40. package/dist/CenterBaseline.css.map +1 -1
  41. package/dist/CenterBaseline.mjs.map +1 -1
  42. package/dist/Checkbox.cjs +4 -1
  43. package/dist/Checkbox.cjs.map +1 -1
  44. package/dist/Checkbox.css +4 -0
  45. package/dist/Checkbox.css.map +1 -1
  46. package/dist/Checkbox.mjs +4 -1
  47. package/dist/Checkbox.mjs.map +1 -1
  48. package/dist/CheckboxGroup.cjs.map +1 -1
  49. package/dist/CheckboxGroup.css.map +1 -1
  50. package/dist/CheckboxGroup.mjs.map +1 -1
  51. package/dist/ClearButton.cjs.map +1 -1
  52. package/dist/ClearButton.css.map +1 -1
  53. package/dist/ClearButton.mjs.map +1 -1
  54. package/dist/CloseButton.cjs.map +1 -1
  55. package/dist/CloseButton.css.map +1 -1
  56. package/dist/CloseButton.mjs.map +1 -1
  57. package/dist/ColorArea.cjs.map +1 -1
  58. package/dist/ColorArea.css.map +1 -1
  59. package/dist/ColorArea.mjs.map +1 -1
  60. package/dist/ColorField.cjs.map +1 -1
  61. package/dist/ColorField.css.map +1 -1
  62. package/dist/ColorField.mjs.map +1 -1
  63. package/dist/ColorHandle.cjs.map +1 -1
  64. package/dist/ColorHandle.css.map +1 -1
  65. package/dist/ColorHandle.mjs.map +1 -1
  66. package/dist/ColorSlider.cjs.map +1 -1
  67. package/dist/ColorSlider.css.map +1 -1
  68. package/dist/ColorSlider.mjs.map +1 -1
  69. package/dist/ColorSwatch.cjs.map +1 -1
  70. package/dist/ColorSwatch.css.map +1 -1
  71. package/dist/ColorSwatch.mjs.map +1 -1
  72. package/dist/ColorSwatchPicker.cjs.map +1 -1
  73. package/dist/ColorSwatchPicker.css.map +1 -1
  74. package/dist/ColorSwatchPicker.mjs.map +1 -1
  75. package/dist/ColorWheel.cjs.map +1 -1
  76. package/dist/ColorWheel.css.map +1 -1
  77. package/dist/ColorWheel.mjs.map +1 -1
  78. package/dist/ComboBox.cjs +3 -0
  79. package/dist/ComboBox.cjs.map +1 -1
  80. package/dist/ComboBox.css.map +1 -1
  81. package/dist/ComboBox.mjs +3 -0
  82. package/dist/ComboBox.mjs.map +1 -1
  83. package/dist/Content.cjs +0 -2
  84. package/dist/Content.cjs.map +1 -1
  85. package/dist/Content.mjs +1 -2
  86. package/dist/Content.mjs.map +1 -1
  87. package/dist/ContextualHelp.cjs.map +1 -1
  88. package/dist/ContextualHelp.css.map +1 -1
  89. package/dist/ContextualHelp.mjs.map +1 -1
  90. package/dist/Dialog.cjs +7 -5
  91. package/dist/Dialog.cjs.map +1 -1
  92. package/dist/Dialog.css.map +1 -1
  93. package/dist/Dialog.mjs +8 -6
  94. package/dist/Dialog.mjs.map +1 -1
  95. package/dist/Disclosure.cjs.map +1 -1
  96. package/dist/Disclosure.css.map +1 -1
  97. package/dist/Disclosure.mjs.map +1 -1
  98. package/dist/Divider.cjs.map +1 -1
  99. package/dist/Divider.css.map +1 -1
  100. package/dist/Divider.mjs.map +1 -1
  101. package/dist/DropZone.cjs.map +1 -1
  102. package/dist/DropZone.css.map +1 -1
  103. package/dist/DropZone.mjs.map +1 -1
  104. package/dist/Field.cjs.map +1 -1
  105. package/dist/Field.css.map +1 -1
  106. package/dist/Field.mjs.map +1 -1
  107. package/dist/Form.cjs.map +1 -1
  108. package/dist/Form.css.map +1 -1
  109. package/dist/Form.mjs.map +1 -1
  110. package/dist/IllustratedMessage.cjs.map +1 -1
  111. package/dist/IllustratedMessage.css.map +1 -1
  112. package/dist/IllustratedMessage.mjs.map +1 -1
  113. package/dist/Image.cjs.map +1 -1
  114. package/dist/Image.css.map +1 -1
  115. package/dist/Image.mjs.map +1 -1
  116. package/dist/InlineAlert.cjs.map +1 -1
  117. package/dist/InlineAlert.css.map +1 -1
  118. package/dist/InlineAlert.mjs.map +1 -1
  119. package/dist/Link.cjs.map +1 -1
  120. package/dist/Link.css.map +1 -1
  121. package/dist/Link.mjs.map +1 -1
  122. package/dist/Menu.cjs.map +1 -1
  123. package/dist/Menu.css.map +1 -1
  124. package/dist/Menu.mjs.map +1 -1
  125. package/dist/Meter.cjs.map +1 -1
  126. package/dist/Meter.css.map +1 -1
  127. package/dist/Meter.mjs.map +1 -1
  128. package/dist/Modal.cjs.map +1 -1
  129. package/dist/Modal.css.map +1 -1
  130. package/dist/Modal.mjs.map +1 -1
  131. package/dist/MoveHorizontalCircleTableWidget.cjs +33 -0
  132. package/dist/MoveHorizontalCircleTableWidget.cjs.map +1 -0
  133. package/dist/MoveHorizontalCircleTableWidget.mjs +28 -0
  134. package/dist/MoveHorizontalCircleTableWidget.mjs.map +1 -0
  135. package/dist/NumberField.cjs.map +1 -1
  136. package/dist/NumberField.css.map +1 -1
  137. package/dist/NumberField.mjs.map +1 -1
  138. package/dist/Picker.cjs +3 -0
  139. package/dist/Picker.cjs.map +1 -1
  140. package/dist/Picker.css.map +1 -1
  141. package/dist/Picker.mjs +3 -0
  142. package/dist/Picker.mjs.map +1 -1
  143. package/dist/Popover.cjs +1 -0
  144. package/dist/Popover.cjs.map +1 -1
  145. package/dist/Popover.css +4 -0
  146. package/dist/Popover.css.map +1 -1
  147. package/dist/Popover.mjs +1 -0
  148. package/dist/Popover.mjs.map +1 -1
  149. package/dist/ProgressBar.cjs.map +1 -1
  150. package/dist/ProgressBar.css.map +1 -1
  151. package/dist/ProgressBar.mjs.map +1 -1
  152. package/dist/ProgressCircle.cjs +0 -1
  153. package/dist/ProgressCircle.cjs.map +1 -1
  154. package/dist/ProgressCircle.css +0 -4
  155. package/dist/ProgressCircle.css.map +1 -1
  156. package/dist/ProgressCircle.mjs +0 -1
  157. package/dist/ProgressCircle.mjs.map +1 -1
  158. package/dist/Provider.cjs.map +1 -1
  159. package/dist/Provider.css.map +1 -1
  160. package/dist/Provider.mjs.map +1 -1
  161. package/dist/Radio.cjs.map +1 -1
  162. package/dist/Radio.css.map +1 -1
  163. package/dist/Radio.mjs.map +1 -1
  164. package/dist/RadioGroup.cjs.map +1 -1
  165. package/dist/RadioGroup.css.map +1 -1
  166. package/dist/RadioGroup.mjs.map +1 -1
  167. package/dist/SearchField.cjs.map +1 -1
  168. package/dist/SearchField.css.map +1 -1
  169. package/dist/SearchField.mjs.map +1 -1
  170. package/dist/SegmentedControl.cjs +11 -8
  171. package/dist/SegmentedControl.cjs.map +1 -1
  172. package/dist/SegmentedControl.css.map +1 -1
  173. package/dist/SegmentedControl.mjs +11 -8
  174. package/dist/SegmentedControl.mjs.map +1 -1
  175. package/dist/SkeletonCollection.cjs.map +1 -1
  176. package/dist/SkeletonCollection.mjs.map +1 -1
  177. package/dist/Slider.cjs.map +1 -1
  178. package/dist/Slider.css.map +1 -1
  179. package/dist/Slider.mjs.map +1 -1
  180. package/dist/StatusLight.cjs.map +1 -1
  181. package/dist/StatusLight.css.map +1 -1
  182. package/dist/StatusLight.mjs.map +1 -1
  183. package/dist/Switch.cjs.map +1 -1
  184. package/dist/Switch.css.map +1 -1
  185. package/dist/Switch.mjs.map +1 -1
  186. package/dist/Table.cjs +1064 -0
  187. package/dist/Table.cjs.map +1 -0
  188. package/dist/Table.css +801 -0
  189. package/dist/Table.css.map +1 -0
  190. package/dist/Table.mjs +1054 -0
  191. package/dist/Table.mjs.map +1 -0
  192. package/dist/Tabs.cjs.map +1 -1
  193. package/dist/Tabs.css.map +1 -1
  194. package/dist/Tabs.mjs.map +1 -1
  195. package/dist/TagGroup.cjs +5 -3
  196. package/dist/TagGroup.cjs.map +1 -1
  197. package/dist/TagGroup.css.map +1 -1
  198. package/dist/TagGroup.mjs +5 -3
  199. package/dist/TagGroup.mjs.map +1 -1
  200. package/dist/TextField.cjs.map +1 -1
  201. package/dist/TextField.css.map +1 -1
  202. package/dist/TextField.mjs.map +1 -1
  203. package/dist/ToggleButton.cjs +2 -1
  204. package/dist/ToggleButton.cjs.map +1 -1
  205. package/dist/ToggleButton.css.map +1 -1
  206. package/dist/ToggleButton.mjs +2 -1
  207. package/dist/ToggleButton.mjs.map +1 -1
  208. package/dist/Tooltip.cjs.map +1 -1
  209. package/dist/Tooltip.css.map +1 -1
  210. package/dist/Tooltip.mjs.map +1 -1
  211. package/dist/ar-AE.cjs +5 -0
  212. package/dist/ar-AE.cjs.map +1 -1
  213. package/dist/ar-AE.mjs +5 -0
  214. package/dist/ar-AE.mjs.map +1 -1
  215. package/dist/bg-BG.cjs +5 -0
  216. package/dist/bg-BG.cjs.map +1 -1
  217. package/dist/bg-BG.mjs +5 -0
  218. package/dist/bg-BG.mjs.map +1 -1
  219. package/dist/cs-CZ.cjs +5 -0
  220. package/dist/cs-CZ.cjs.map +1 -1
  221. package/dist/cs-CZ.mjs +5 -0
  222. package/dist/cs-CZ.mjs.map +1 -1
  223. package/dist/da-DK.cjs +5 -0
  224. package/dist/da-DK.cjs.map +1 -1
  225. package/dist/da-DK.mjs +5 -0
  226. package/dist/da-DK.mjs.map +1 -1
  227. package/dist/de-DE.cjs +5 -0
  228. package/dist/de-DE.cjs.map +1 -1
  229. package/dist/de-DE.mjs +5 -0
  230. package/dist/de-DE.mjs.map +1 -1
  231. package/dist/el-GR.cjs +5 -0
  232. package/dist/el-GR.cjs.map +1 -1
  233. package/dist/el-GR.mjs +5 -0
  234. package/dist/el-GR.mjs.map +1 -1
  235. package/dist/en-US.cjs +5 -0
  236. package/dist/en-US.cjs.map +1 -1
  237. package/dist/en-US.mjs +5 -0
  238. package/dist/en-US.mjs.map +1 -1
  239. package/dist/es-ES.cjs +5 -0
  240. package/dist/es-ES.cjs.map +1 -1
  241. package/dist/es-ES.mjs +5 -0
  242. package/dist/es-ES.mjs.map +1 -1
  243. package/dist/et-EE.cjs +5 -0
  244. package/dist/et-EE.cjs.map +1 -1
  245. package/dist/et-EE.mjs +5 -0
  246. package/dist/et-EE.mjs.map +1 -1
  247. package/dist/fi-FI.cjs +5 -0
  248. package/dist/fi-FI.cjs.map +1 -1
  249. package/dist/fi-FI.mjs +5 -0
  250. package/dist/fi-FI.mjs.map +1 -1
  251. package/dist/fr-FR.cjs +5 -0
  252. package/dist/fr-FR.cjs.map +1 -1
  253. package/dist/fr-FR.mjs +5 -0
  254. package/dist/fr-FR.mjs.map +1 -1
  255. package/dist/he-IL.cjs +5 -0
  256. package/dist/he-IL.cjs.map +1 -1
  257. package/dist/he-IL.mjs +5 -0
  258. package/dist/he-IL.mjs.map +1 -1
  259. package/dist/hr-HR.cjs +5 -0
  260. package/dist/hr-HR.cjs.map +1 -1
  261. package/dist/hr-HR.mjs +5 -0
  262. package/dist/hr-HR.mjs.map +1 -1
  263. package/dist/hu-HU.cjs +5 -0
  264. package/dist/hu-HU.cjs.map +1 -1
  265. package/dist/hu-HU.mjs +5 -0
  266. package/dist/hu-HU.mjs.map +1 -1
  267. package/dist/it-IT.cjs +5 -0
  268. package/dist/it-IT.cjs.map +1 -1
  269. package/dist/it-IT.mjs +5 -0
  270. package/dist/it-IT.mjs.map +1 -1
  271. package/dist/ja-JP.cjs +5 -0
  272. package/dist/ja-JP.cjs.map +1 -1
  273. package/dist/ja-JP.mjs +5 -0
  274. package/dist/ja-JP.mjs.map +1 -1
  275. package/dist/ko-KR.cjs +5 -0
  276. package/dist/ko-KR.cjs.map +1 -1
  277. package/dist/ko-KR.mjs +5 -0
  278. package/dist/ko-KR.mjs.map +1 -1
  279. package/dist/lt-LT.cjs +5 -0
  280. package/dist/lt-LT.cjs.map +1 -1
  281. package/dist/lt-LT.mjs +5 -0
  282. package/dist/lt-LT.mjs.map +1 -1
  283. package/dist/lv-LV.cjs +5 -0
  284. package/dist/lv-LV.cjs.map +1 -1
  285. package/dist/lv-LV.mjs +5 -0
  286. package/dist/lv-LV.mjs.map +1 -1
  287. package/dist/main.cjs +11 -0
  288. package/dist/main.cjs.map +1 -1
  289. package/dist/module.mjs +5 -1
  290. package/dist/module.mjs.map +1 -1
  291. package/dist/nb-NO.cjs +5 -0
  292. package/dist/nb-NO.cjs.map +1 -1
  293. package/dist/nb-NO.mjs +5 -0
  294. package/dist/nb-NO.mjs.map +1 -1
  295. package/dist/nl-NL.cjs +5 -0
  296. package/dist/nl-NL.cjs.map +1 -1
  297. package/dist/nl-NL.mjs +5 -0
  298. package/dist/nl-NL.mjs.map +1 -1
  299. package/dist/pl-PL.cjs +5 -0
  300. package/dist/pl-PL.cjs.map +1 -1
  301. package/dist/pl-PL.mjs +5 -0
  302. package/dist/pl-PL.mjs.map +1 -1
  303. package/dist/pt-BR.cjs +5 -0
  304. package/dist/pt-BR.cjs.map +1 -1
  305. package/dist/pt-BR.mjs +5 -0
  306. package/dist/pt-BR.mjs.map +1 -1
  307. package/dist/pt-PT.cjs +5 -0
  308. package/dist/pt-PT.cjs.map +1 -1
  309. package/dist/pt-PT.mjs +5 -0
  310. package/dist/pt-PT.mjs.map +1 -1
  311. package/dist/ro-RO.cjs +5 -0
  312. package/dist/ro-RO.cjs.map +1 -1
  313. package/dist/ro-RO.mjs +5 -0
  314. package/dist/ro-RO.mjs.map +1 -1
  315. package/dist/ru-RU.cjs +5 -0
  316. package/dist/ru-RU.cjs.map +1 -1
  317. package/dist/ru-RU.mjs +5 -0
  318. package/dist/ru-RU.mjs.map +1 -1
  319. package/dist/sk-SK.cjs +5 -0
  320. package/dist/sk-SK.cjs.map +1 -1
  321. package/dist/sk-SK.mjs +5 -0
  322. package/dist/sk-SK.mjs.map +1 -1
  323. package/dist/sl-SI.cjs +5 -0
  324. package/dist/sl-SI.cjs.map +1 -1
  325. package/dist/sl-SI.mjs +5 -0
  326. package/dist/sl-SI.mjs.map +1 -1
  327. package/dist/sr-SP.cjs +5 -0
  328. package/dist/sr-SP.cjs.map +1 -1
  329. package/dist/sr-SP.mjs +5 -0
  330. package/dist/sr-SP.mjs.map +1 -1
  331. package/dist/sv-SE.cjs +5 -0
  332. package/dist/sv-SE.cjs.map +1 -1
  333. package/dist/sv-SE.mjs +5 -0
  334. package/dist/sv-SE.mjs.map +1 -1
  335. package/dist/tr-TR.cjs +5 -0
  336. package/dist/tr-TR.cjs.map +1 -1
  337. package/dist/tr-TR.mjs +5 -0
  338. package/dist/tr-TR.mjs.map +1 -1
  339. package/dist/types.d.ts +136 -30
  340. package/dist/types.d.ts.map +1 -1
  341. package/dist/uk-UA.cjs +5 -0
  342. package/dist/uk-UA.cjs.map +1 -1
  343. package/dist/uk-UA.mjs +5 -0
  344. package/dist/uk-UA.mjs.map +1 -1
  345. package/dist/utils.cjs +30 -0
  346. package/dist/utils.cjs.map +1 -0
  347. package/dist/utils.mjs +25 -0
  348. package/dist/utils.mjs.map +1 -0
  349. package/dist/zh-CN.cjs +5 -0
  350. package/dist/zh-CN.cjs.map +1 -1
  351. package/dist/zh-CN.mjs +5 -0
  352. package/dist/zh-CN.mjs.map +1 -1
  353. package/dist/zh-TW.cjs +5 -0
  354. package/dist/zh-TW.cjs.map +1 -1
  355. package/dist/zh-TW.mjs +5 -0
  356. package/dist/zh-TW.mjs.map +1 -1
  357. package/icons/Skeleton.cjs.map +1 -1
  358. package/icons/Skeleton.css.map +1 -1
  359. package/icons/Skeleton.mjs.map +1 -1
  360. package/package.json +18 -16
  361. package/src/Accordion.tsx +2 -2
  362. package/src/ActionButton.tsx +3 -3
  363. package/src/AlertDialog.tsx +1 -1
  364. package/src/Avatar.tsx +1 -1
  365. package/src/AvatarGroup.tsx +1 -1
  366. package/src/Badge.tsx +1 -1
  367. package/src/Breadcrumbs.tsx +2 -2
  368. package/src/Button.tsx +41 -19
  369. package/src/ButtonGroup.tsx +1 -1
  370. package/src/Card.tsx +7 -7
  371. package/src/CardView.tsx +2 -2
  372. package/src/CenterBaseline.tsx +1 -1
  373. package/src/Checkbox.tsx +3 -2
  374. package/src/CheckboxGroup.tsx +1 -1
  375. package/src/ClearButton.tsx +1 -1
  376. package/src/CloseButton.tsx +2 -2
  377. package/src/ColorArea.tsx +1 -1
  378. package/src/ColorField.tsx +1 -1
  379. package/src/ColorHandle.tsx +1 -1
  380. package/src/ColorSlider.tsx +1 -1
  381. package/src/ColorSwatch.tsx +3 -3
  382. package/src/ColorSwatchPicker.tsx +5 -5
  383. package/src/ColorWheel.tsx +1 -1
  384. package/src/ComboBox.tsx +7 -4
  385. package/src/Content.tsx +1 -3
  386. package/src/ContextualHelp.tsx +1 -1
  387. package/src/Dialog.tsx +4 -3
  388. package/src/Disclosure.tsx +4 -4
  389. package/src/Divider.tsx +1 -1
  390. package/src/DropZone.tsx +1 -1
  391. package/src/Field.tsx +2 -2
  392. package/src/Form.tsx +1 -1
  393. package/src/IllustratedMessage.tsx +1 -1
  394. package/src/Image.tsx +1 -1
  395. package/src/InlineAlert.tsx +2 -2
  396. package/src/Link.tsx +2 -2
  397. package/src/Menu.tsx +2 -2
  398. package/src/Meter.tsx +1 -1
  399. package/src/Modal.tsx +1 -1
  400. package/src/NumberField.tsx +2 -2
  401. package/src/Picker.tsx +7 -4
  402. package/src/Popover.tsx +5 -2
  403. package/src/ProgressBar.tsx +1 -1
  404. package/src/ProgressCircle.tsx +7 -5
  405. package/src/Provider.tsx +1 -1
  406. package/src/Radio.tsx +2 -2
  407. package/src/RadioGroup.tsx +1 -1
  408. package/src/SearchField.tsx +1 -1
  409. package/src/SegmentedControl.tsx +32 -22
  410. package/src/Skeleton.tsx +4 -1
  411. package/src/SkeletonCollection.tsx +4 -0
  412. package/src/Slider.tsx +2 -2
  413. package/src/StatusLight.tsx +1 -1
  414. package/src/Switch.tsx +2 -2
  415. package/src/Table.tsx +1063 -48
  416. package/src/Tabs.tsx +3 -3
  417. package/src/TagGroup.tsx +5 -4
  418. package/src/TextField.tsx +1 -1
  419. package/src/ToggleButton.tsx +3 -2
  420. package/src/Tooltip.tsx +1 -1
  421. package/src/index.ts +4 -0
  422. package/src/style-utils.ts +0 -10
  423. package/src/utils.ts +28 -0
  424. package/style/__tests__/mergeStyles.test.js +32 -0
  425. package/style/__tests__/style-macro.test.js +128 -0
  426. package/style/dist/main.cjs +38 -0
  427. package/style/dist/main.cjs.map +1 -0
  428. package/style/dist/module.mjs +26 -0
  429. package/style/dist/module.mjs.map +1 -0
  430. package/style/dist/spectrum-theme.cjs +1989 -0
  431. package/style/dist/spectrum-theme.cjs.map +1 -0
  432. package/style/dist/spectrum-theme.mjs +1978 -0
  433. package/style/dist/spectrum-theme.mjs.map +1 -0
  434. package/style/dist/style-macro.cjs +544 -0
  435. package/style/dist/style-macro.cjs.map +1 -0
  436. package/style/dist/style-macro.mjs +534 -0
  437. package/style/dist/style-macro.mjs.map +1 -0
  438. package/style/dist/types.d.ts +791 -0
  439. package/style/dist/types.d.ts.map +1 -0
  440. package/style/index.ts +24 -0
  441. package/style/runtime.ts +103 -0
  442. package/style/spectrum-theme.ts +980 -0
  443. package/style/style-macro.ts +638 -0
  444. package/style/tokens.ts +68 -0
  445. package/style/types.ts +178 -0
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+BD,MAAM;AAMN,MAAM;AAMN,MAAM;AAIN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBN,MAAM;AAKN,MAAM;AAwBC,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAsB;IAC7D,MAAM;IACN,eAAe;IACf,WAAW;IACX,YAAY;IACZ,2BAA2B;AAC7B;AAEA,SAAS,6BAAO,KAAkB,EAAE,GAAW;IAC7C,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,aAAa;IAC5D,IAAI,4BAA4B,IAAI,yBAAyB;IAC7D,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,OAAQ,IAAI,IAAI;QACd,KAAK;QACL,KAAK;QACL,KAAK;YAAsB;gBACzB,IAAI,OAAO,IAAI,IAAI,KAAK,UAAU,MAAM,IAAI,GAAG,IAAI,IAAI;gBACvD,qBACE,gCAAC,CAAA,GAAA,+BAAI;oBAAE,MAAM;oBAAM,eAAe;oBAAe,2BAA2B;8BAC1E,cAAA,gCAAC;wBAAa,GAAG,KAAK;wBAAG,GAAG,GAAG;wBAAE,WAAW;wBAAQ,eAAe;;;YAGzE;QACA,KAAK;YAC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C,QAAQ;gCAAI;6BAAE;4BAC9B;gCAAC,CAAA,GAAA,wCAAa;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;4BAClC;gCAAC,CAAA,GAAA,uCAAY;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;4BACjC;gCAAC,CAAA,GAAA,wCAAa;gCAAG;oCAAC,QAAQ,8BAAQ;wCAAC,MAAM,OAAM,IAAI;oCAAA;gCAAE;6BAAE;4BACvD;gCAAC,CAAA,GAAA,uCAAY;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;4BACjC;gCAAC,CAAA,GAAA,4CAAiB;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;yBACvC;kCACA;;kCAGH,gCAAC;wBACC,SAAS;kCAgBT,cAAA,gCAAC,CAAA,GAAA,mCAAO;4BACN,QAAQ;gCACN;oCAAC,CAAA,GAAA,sCAAW;oCAAG;wCAAC,QAAQ;oCAAI;iCAAE;gCAC9B;oCAAC,CAAA,GAAA,wCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,uCAAY;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCACjC;oCAAC,CAAA,GAAA,wCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,uCAAY;oCAAG;wCAAC,QAAQ;oCAAM;iCAAE;gCACjC;oCAAC,CAAA,GAAA,4CAAiB;oCAAG;wCAAC,UAAU,yBAAyB;wCAAU,QAAQ;wCAAa,OAAO;oCAAK;iCAAE;6BACvG;sCACA;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAgCD,MAAM;AAMN,MAAM;AAMN,MAAM;AAIN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBN,MAAM;AAKN,MAAM;AAwBC,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAsB;IAC7D,MAAM;IACN,eAAe;IACf,WAAW;IACX,YAAY;IACZ,2BAA2B;AAC7B;AAEA,SAAS,6BAAO,KAAkB,EAAE,GAAW;IAC7C,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,aAAa;IAC5D,IAAI,4BAA4B,IAAI,yBAAyB;IAC7D,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,OAAQ,IAAI,IAAI;QACd,KAAK;QACL,KAAK;QACL,KAAK;YAAsB;gBACzB,IAAI,OAAO,IAAI,IAAI,KAAK,UAAU,MAAM,IAAI,GAAG,IAAI,IAAI;gBACvD,qBACE,gCAAC,CAAA,GAAA,+BAAI;oBAAE,MAAM;oBAAM,eAAe;oBAAe,2BAA2B;8BAC1E,cAAA,gCAAC;wBAAa,GAAG,KAAK;wBAAG,GAAG,GAAG;wBAAE,WAAW;wBAAQ,eAAe;;;YAGzE;QACA,KAAK;YACH,qCAAqC;YACrC,qBACE,gCAAC,CAAA,GAAA,iCAAM;gBAAE,MAAM,MAAM,IAAI,IAAI;gBAAK,WAAW,IAAI,SAAS;gBAAE,WAAW,IAAI,SAAS;gBAAE,YAAY,IAAI,UAAU;gBAAE,kBAAkB,IAAI,gBAAgB;gBAAE,QAAQ,IAAI,MAAM;gBAAE,aAAa,IAAI,WAAW;0BACxM,cA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IAAI;oCAAA;gCAAE;6BAAE;4BACvD;gCAAC,CAAA,GAAA,uCAAY;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;4BACjC;gCAAC,CAAA,GAAA,4CAAiB;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;yBACvC;kCACA;;kCAGH,gCAAC;wBACC,SAAS;kCAgBT,cAAA,gCAAC,CAAA,GAAA,mCAAO;4BACN,QAAQ;gCACN;oCAAC,CAAA,GAAA,sCAAW;oCAAG;wCAAC,QAAQ;oCAAI;iCAAE;gCAC9B;oCAAC,CAAA,GAAA,wCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,uCAAY;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCACjC;oCAAC,CAAA,GAAA,wCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,uCAAY;oCAAG;wCAAC,QAAQ;oCAAM;iCAAE;gCACjC;oCAAC,CAAA,GAAA,4CAAiB;oCAAG;wCAAC,UAAU,yBAAyB;wCAAU,QAAQ;wCAAa,OAAO;oCAAK;iCAAE;6BACvG;sCACA;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {ImageContext} from './Image';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {styles: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":"ACyCc;EAAA;;;;EAAA;;;;EAAA;;;;EAME;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAMD;;;;EAIE;;;;EAiBF;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAKK;;;;EAAA;;;;EAwEO;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyDJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiBE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqC8E;;;;EAiBhF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9OT;EAME;;;;;;EAAA;;;;EA2BD;;;;EA6EY;;;;EA0EF;;;;EAAA;;;;EAsDF;;;;;AA9OT;;AAME;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAMD;;;;IAIE;;;;;;AAAA;EAAA;IAAA;;;;;;AAwKQ;EAAA;IAAA;;;;IAAA;;;;;;AAqC8E","sources":["ebf76300d207adbd","packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["@import \"41c4aa1296799ea1\";\n@import \"b6cb6ab59865bde8\";\n@import \"c2aa69bcd8dab7fb\";\n@import \"e9cdd4f3ada8c5d9\";\n@import \"722603297b70d86b\";\n@import \"d1b118504b390ed5\";\n@import \"a59d0f5a0e9cb2ac\";\n@import \"26ac236cb46f8555\";\n@import \"8b070308c4891c21\";\n@import \"5ec9bfe5eed7daff\";\n@import \"7eb24a82f7ffd3c6\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.css.map"}
1
+ {"mappings":"AC0Cc;EAAA;;;;EAAA;;;;EAAA;;;;EAME;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAMD;;;;EAIE;;;;EAiBF;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAKK;;;;EAAA;;;;EAwEO;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyDJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiBE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqC8E;;;;EAiBhF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9OT;EAME;;;;;;EAAA;;;;EA2BD;;;;EA6EY;;;;EA0EF;;;;EAAA;;;;EAsDF;;;;;AA9OT;;AAME;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAMD;;;;IAIE;;;;;;AAAA;EAAA;IAAA;;;;;;AAwKQ;EAAA;IAAA;;;;IAAA;;;;;;AAqC8E","sources":["ebf76300d207adbd","packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["@import \"41c4aa1296799ea1\";\n@import \"b6cb6ab59865bde8\";\n@import \"c2aa69bcd8dab7fb\";\n@import \"e9cdd4f3ada8c5d9\";\n@import \"722603297b70d86b\";\n@import \"d1b118504b390ed5\";\n@import \"a59d0f5a0e9cb2ac\";\n@import \"26ac236cb46f8555\";\n@import \"8b070308c4891c21\";\n@import \"5ec9bfe5eed7daff\";\n@import \"7eb24a82f7ffd3c6\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {ImageContext} from './Image';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {styles: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.css.map"}
package/dist/Dialog.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import "./Dialog.css";
2
2
  import {ButtonGroupContext as $472eaa9a9b344b9a$export$4c574c91bb0be0e2} from "./ButtonGroup.mjs";
3
3
  import {CloseButton as $a9cda54c4f47ce52$export$de65de8213222d10} from "./CloseButton.mjs";
4
- import {ContentContext as $8e847109a6ab556d$export$1cbdd774077931b4, FooterContext as $8e847109a6ab556d$export$5630640b68817ed6, HeaderContext as $8e847109a6ab556d$export$e0e4026c12a8bdbb, HeadingContext as $8e847109a6ab556d$export$d688439359537581, ImageContext as $8e847109a6ab556d$export$8151eb379fcf2442} from "./Content.mjs";
4
+ import {ContentContext as $8e847109a6ab556d$export$1cbdd774077931b4, FooterContext as $8e847109a6ab556d$export$5630640b68817ed6, HeaderContext as $8e847109a6ab556d$export$e0e4026c12a8bdbb, HeadingContext as $8e847109a6ab556d$export$d688439359537581} from "./Content.mjs";
5
+ import {ImageContext as $dbd6f0b2503b938c$export$8151eb379fcf2442} from "./Image.mjs";
5
6
  import $9Rtwv$intlStringsmjs from "./intlStrings.mjs";
6
7
  import {Modal as $c46d159bd615e407$export$2b77a92f1a5ad772} from "./Modal.mjs";
7
8
  import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
@@ -36,6 +37,7 @@ function $parcel$interopDefault(a) {
36
37
 
37
38
 
38
39
 
40
+
39
41
  const $9bbc115952dac5a6$var$image = " . l4 k-37m3s2 __Nb";
40
42
  const $9bbc115952dac5a6$var$heading = " . _9-3t1y Aa Ba _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _dj _dbm _ed _e-1x99dloe _fa _f-1x99dlob ao";
41
43
  const $9bbc115952dac5a6$var$header = " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _eb _fb _f-1x99dloc an";
@@ -148,9 +150,9 @@ function $9bbc115952dac5a6$var$DialogInner(props1) {
148
150
  /*#__PURE__*/ (0, $9Rtwv$jsx)((0, $9Rtwv$Provider), {
149
151
  values: [
150
152
  [
151
- (0, $8e847109a6ab556d$export$8151eb379fcf2442),
153
+ (0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
152
154
  {
153
- className: $9bbc115952dac5a6$var$image
155
+ styles: $9bbc115952dac5a6$var$image
154
156
  }
155
157
  ],
156
158
  [
@@ -207,7 +209,7 @@ function $9bbc115952dac5a6$var$DialogInner(props1) {
207
209
  children: /*#__PURE__*/ (0, $9Rtwv$jsx)((0, $9Rtwv$Provider), {
208
210
  values: [
209
211
  [
210
- (0, $8e847109a6ab556d$export$8151eb379fcf2442),
212
+ (0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
211
213
  {
212
214
  hidden: true
213
215
  }
@@ -256,7 +258,7 @@ function $9bbc115952dac5a6$var$DialogInner(props1) {
256
258
  /*#__PURE__*/ (0, $9Rtwv$jsx)((0, $9Rtwv$Provider), {
257
259
  values: [
258
260
  [
259
- (0, $8e847109a6ab556d$export$8151eb379fcf2442),
261
+ (0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
260
262
  {
261
263
  hidden: true
262
264
  }
@@ -301,7 +303,7 @@ function $9bbc115952dac5a6$var$DialogInner(props1) {
301
303
  children: /*#__PURE__*/ (0, $9Rtwv$jsx)((0, $9Rtwv$Provider), {
302
304
  values: [
303
305
  [
304
- (0, $8e847109a6ab556d$export$8151eb379fcf2442),
306
+ (0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
305
307
  {
306
308
  hidden: true
307
309
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+BD,MAAM;AAMN,MAAM;AAMN,MAAM;AAIN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBN,MAAM;AAKN,MAAM;AAwBC,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAsB;IAC7D,MAAM;IACN,eAAe;IACf,WAAW;IACX,YAAY;IACZ,2BAA2B;AAC7B;AAEA,SAAS,6BAAO,KAAkB,EAAE,GAAW;IAC7C,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,aAAa;IAC5D,IAAI,4BAA4B,IAAI,yBAAyB;IAC7D,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,OAAQ,IAAI,IAAI;QACd,KAAK;QACL,KAAK;QACL,KAAK;YAAsB;gBACzB,IAAI,OAAO,IAAI,IAAI,KAAK,UAAU,MAAM,IAAI,GAAG,IAAI,IAAI;gBACvD,qBACE,gBAAC,CAAA,GAAA,yCAAI;oBAAE,MAAM;oBAAM,eAAe;oBAAe,2BAA2B;8BAC1E,cAAA,gBAAC;wBAAa,GAAG,KAAK;wBAAG,GAAG,GAAG;wBAAE,WAAW;wBAAQ,eAAe;;;YAGzE;QACA,KAAK;YACH,qCAAqC;YACrC,qBACE,gBAAC,CAAA,GAAA,yCAAM;gBAAE,MAAM,MAAM,IAAI,IAAI;gBAAK,WAAW,IAAI,SAAS;gBAAE,WAAW,IAAI,SAAS;gBAAE,YAAY,IAAI,UAAU;gBAAE,kBAAkB,IAAI,gBAAgB;gBAAE,QAAQ,IAAI,MAAM;gBAAE,aAAa,IAA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AAM,OAAM,IAAI;oCAAA;gCAAE;6BAAE;4BACvD;gCAAC,CAAA,GAAA,yCAAY;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;4BACjC;gCAAC,CAAA,GAAA,yCAAiB;gCAAG;oCAAC,UAAU;gCAAI;6BAAE;yBACvC;kCACA;;kCAGH,gBAAC;wBACC,SAAS;kCAgBT,cAAA,gBAAC,CAAA,GAAA,eAAO;4BACN,QAAQ;gCACN;oCAAC,CAAA,GAAA,yCAAW;oCAAG;wCAAC,QAAQ;oCAAI;iCAAE;gCAC9B;oCAAC,CAAA,GAAA,yCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,yCAAY;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,yCAAY;oCAAG;wCAAC,QAAQ;oCAAM;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAiB;oCAAG;wCAAC,UAAU,yBAAyB;wCAAU,QAAQ;wCAAa,OAAO;oCAAK;iCAAE;6BACvG;sCACA;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAgCD,MAAM;AAMN,MAAM;AAM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N,QAAQ;gCACN;oCAAC,CAAA,GAAA,yCAAW;oCAAG;wCAAC,QAAQ;oCAAI;iCAAE;gCAC9B;oCAAC,CAAA,GAAA,yCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,yCAAY;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,yCAAY;oCAAG;wCAAC,QAAQ;oCAAM;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAiB;oCAAG;wCAAC,UAAU,yBAAyB;wCAAU,QAAQ;wCAAa,OAAO;oCAAK;iCAAE;6BACvG;sCACA;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {ImageContext} from './Image';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {styles: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA8BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,iCAAW,KAAsB,EAAE,GAA2B;IACrE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,G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CAAK;YAAE,WAAW,CAAC,cAAgB,mCAAa;oBAAC,GAAG,WAAW;0BAAE;6BAAM;6BAAS;gBAAO;YAAI,MAAK;;8BAC/F,gCAAC,CAAA,GAAA,wCAAa;8BACZ,cAAA,gCAAC,CAAA,GAAA,iCAAM;wBAAE,MAAM;wBAAM,WAAW,oCAAc;wCAAC;mCAAY;wBAAK;wBAAI,eAAY;;;gBAEjF,MAAM,QAAQ;;;;AAIvB;AAEA;;CAEC,GACD,IAAI,0DAAoB,CAAA,GAAA,uBAAS,EAAE;AAOnC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,sCAAgB,KAA2B,EAAE,GAA2B;IAC/E,IAAI,gBACF,YAAY,oBACZ,mBAAmB,IACnB,GAAG,YACJ,GAAG;IACJ,MAAM,WAAW,CAAA,GAAA,oCAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,mCAAQ,EAAE;IACzB,qBACE,gCAAC,CAAA,GAAA,mDAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, focusRing, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {lightDark, size as sizeValue, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA8BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,iCAAW,KAAsB,EAAE,GAA2B;IACrE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmB;0BAAC;6BAAM;6BAAS;gBAAO;aAAE;SAC9C;kBACD,cAAA,gCAAC,CAAA,GAAA,8CAAY;YACV,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,iCAAW;yBAAC;YAAO,GAAG,MAAM,MAAM;sB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AAS,EAAE;AAOnC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,sCAAgB,KAA2B,EAAE,GAA2B;IAC/E,IAAI,gBACF,YAAY,oBACZ,mBAAmB,IACnB,GAAG,YACJ,GAAG;IACJ,MAAM,WAAW,CAAA,GAAA,oCAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,mCAAQ,EAAE;IACzB,qBACE,gCAAC,CAAA,GAAA,mDAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, size as sizeValue, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":"AC0CmB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+DE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2EC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqDF;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnMD;EAAA;;;;EAAA;;;;EAmEE;;;;EAgID;;;;EAAA;;;;;AAnMD;;AAAA;EAAA;IAAA;;;;IAmEE;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAgID;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAhIC;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;;;AA2EC","sources":["af82a6f8008c749b","packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["@import \"02b9b02b69a441b2\";\n@import \"80d1cf6aba9342e9\";\n@import \"d47c144c912b2c65\";\n@import \"54c3947845455457\";\n@import \"47e48706d70658de\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, focusRing, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {lightDark, size as sizeValue, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.css.map"}
1
+ {"mappings":"AC0CmB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+DE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2EC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqDF;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnMD;EAAA;;;;EAAA;;;;EAmEE;;;;EAgID;;;;EAAA;;;;;AAnMD;;AAAA;EAAA;IAAA;;;;IAmEE;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAgID;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAhIC;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;;;AA2EC","sources":["af82a6f8008c749b","packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["@import \"02b9b02b69a441b2\";\n@import \"80d1cf6aba9342e9\";\n@import \"d47c144c912b2c65\";\n@import \"54c3947845455457\";\n@import \"47e48706d70658de\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, size as sizeValue, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.css.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA8BM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,iCAAW,KAAsB,EAAE,GAA2B;IACrE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC;gBAAmB;0BAAC;6BAAM;6BAAS;gBAAO;aAAE;SAC9C;kBACD,cAAA,gBAAC,CAAA,GAA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WAAW,oCAAc;wCAAC;mCAAY;wBAAK;wBAAI,eAAY;;;gBAEjF,MAAM,QAAQ;;;;AAIvB;AAEA;;CAEC,GACD,IAAI,0DAAoB,CAAA,GAAA,iBAAS,EAAE;AAOnC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,sCAAgB,KAA2B,EAAE,GAA2B;IAC/E,IAAI,gBACF,YAAY,oBACZ,mBAAmB,IACnB,GAAG,YACJ,GAAG;IACJ,MAAM,WAAW,CAAA,GAAA,qBAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6BAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,gBAAQ,EAAE;IACzB,qBACE,gBAAC,CAAA,GAAA,+BAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, focusRing, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {lightDark, size as sizeValue, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.mjs.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA8BM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,iCAAW,KAAsB,EAAE,GAA2B;IACrE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC;gBAAmB;0BAAC;6BAAM;6BAAS;gBAAO;aAAE;SAC9C;kBACD,cAAA,gBAAC,CAAA,GAAA,0BAAY;YACV,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,iCAAW;yBAAC;YAAO,GAAG,MAAM,MAAM;sBACvE,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,IAAI,0DAAc,CAAA,GAAA,iBAAS,EAAE;AAa7B,MAAM;AAIN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6BAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,gBAAQ,EAAE;IACzB,qBACE,gBAAC,CAAA,GAAA,+BAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, UNSTABLE_Disclosure as RACDisclosure, UNSTABLE_DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, size as sizeValue, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAgCM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA2C;AAE9E,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDb,SAAS,8BAAQ,KAAmB,EAAE,GAAW;IAC/C,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,oCAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0CAAQ;YAClD,MAAM,MAAM,IAAI,IAAI;YACpB,aAAa,MAAM,WAAW,IAAI;YAClC,aAAa,MAAM,WAAW;QAChC,GAAG,MAAM,MAAM;;AAErB;AAEA;;;CAGC,GACD,IAAI,4CAAW,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Divider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n/*\n * Adding as it's own type to deal with size being a part of the theme so we\n * can type style() and it's parameters.\n */\ninterface DividerSpectrumProps {\n /**\n * How thick the Divider should be.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /**\n * How thick the Divider should be.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** The static color style to apply. Useful when the Divider appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\n// TODO: allow overriding height (only when orientation is vertical)??\nexport interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}\n\nexport const DividerContext = createContext<ContextValue<DividerProps, DOMRefValue>>(null);\n\nexport const divider = style<DividerSpectrumProps>({\n alignSelf: 'stretch',\n backgroundColor: {\n default: 'gray-200',\n size: {\n L: 'gray-800'\n },\n staticColor: {\n white: {\n default: 'transparent-white-200',\n size: {\n L: 'transparent-white-800'\n }\n },\n black: {\n default: 'transparent-black-200',\n size: {\n L: 'transparent-black-800'\n }\n }\n },\n forcedColors: 'ButtonBorder'\n },\n borderStyle: 'none',\n borderRadius: 'full',\n margin: 0,\n height: {\n orientation: {\n horizontal: {\n // These should be px not rems, because we're emulating a border.\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n },\n width: {\n orientation: {\n vertical: {\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction Divider(props: DividerProps, ref: DOMRef) {\n [props, ref] = useSpectrumContextProps(props, ref, DividerContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACSeparator\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + divider({\n size: props.size || 'M',\n orientation: props.orientation || 'horizontal',\n staticColor: props.staticColor\n }, props.styles)} />\n );\n}\n\n/**\n * Dividers bring clarity to a layout by grouping and dividing content in close proximity.\n * They can also be used to establish rhythm and hierarchy.\n */\nlet _Divider = /*#__PURE__*/ forwardRef(Divider);\nexport {_Divider as Divider};\n"],"names":[],"version":3,"file":"Divider.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAgCM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA2C;AAE9E,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDb,SAAS,8BAAQ,KAAmB,EAAE,GAAW;IAC/C,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,oCAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0CAAQ;YAClD,MAAM,MAAM,IAAI,IAAI;YACpB,aAAa,MAAM,WAAW,IAAI;YAClC,aAAa,MAAM,WAAW;QAChC,GAAG,MAAM,MAAM;;AAErB;AAEA;;;CAGC,GACD,IAAI,4CAAW,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Divider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n/*\n * Adding as it's own type to deal with size being a part of the theme so we\n * can type style() and it's parameters.\n */\ninterface DividerSpectrumProps {\n /**\n * How thick the Divider should be.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /**\n * How thick the Divider should be.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** The static color style to apply. Useful when the Divider appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\n// TODO: allow overriding height (only when orientation is vertical)??\nexport interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}\n\nexport const DividerContext = createContext<ContextValue<DividerProps, DOMRefValue>>(null);\n\nexport const divider = style<DividerSpectrumProps>({\n alignSelf: 'stretch',\n backgroundColor: {\n default: 'gray-200',\n size: {\n L: 'gray-800'\n },\n staticColor: {\n white: {\n default: 'transparent-white-200',\n size: {\n L: 'transparent-white-800'\n }\n },\n black: {\n default: 'transparent-black-200',\n size: {\n L: 'transparent-black-800'\n }\n }\n },\n forcedColors: 'ButtonBorder'\n },\n borderStyle: 'none',\n borderRadius: 'full',\n margin: 0,\n height: {\n orientation: {\n horizontal: {\n // These should be px not rems, because we're emulating a border.\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n },\n width: {\n orientation: {\n vertical: {\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction Divider(props: DividerProps, ref: DOMRef) {\n [props, ref] = useSpectrumContextProps(props, ref, DividerContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACSeparator\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + divider({\n size: props.size || 'M',\n orientation: props.orientation || 'horizontal',\n staticColor: props.staticColor\n }, props.styles)} />\n );\n}\n\n/**\n * Dividers bring clarity to a layout by grouping and dividing content in close proximity.\n * They can also be used to establish rhythm and hierarchy.\n */\nlet _Divider = /*#__PURE__*/ forwardRef(Divider);\nexport {_Divider as Divider};\n"],"names":[],"version":3,"file":"Divider.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":"AA4CuB;;;;AAAA;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA","sources":["packages/@react-spectrum/s2/src/Divider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n/*\n * Adding as it's own type to deal with size being a part of the theme so we\n * can type style() and it's parameters.\n */\ninterface DividerSpectrumProps {\n /**\n * How thick the Divider should be.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /**\n * How thick the Divider should be.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** The static color style to apply. Useful when the Divider appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\n// TODO: allow overriding height (only when orientation is vertical)??\nexport interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}\n\nexport const DividerContext = createContext<ContextValue<DividerProps, DOMRefValue>>(null);\n\nexport const divider = style<DividerSpectrumProps>({\n alignSelf: 'stretch',\n backgroundColor: {\n default: 'gray-200',\n size: {\n L: 'gray-800'\n },\n staticColor: {\n white: {\n default: 'transparent-white-200',\n size: {\n L: 'transparent-white-800'\n }\n },\n black: {\n default: 'transparent-black-200',\n size: {\n L: 'transparent-black-800'\n }\n }\n },\n forcedColors: 'ButtonBorder'\n },\n borderStyle: 'none',\n borderRadius: 'full',\n margin: 0,\n height: {\n orientation: {\n horizontal: {\n // These should be px not rems, because we're emulating a border.\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n },\n width: {\n orientation: {\n vertical: {\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction Divider(props: DividerProps, ref: DOMRef) {\n [props, ref] = useSpectrumContextProps(props, ref, DividerContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACSeparator\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + divider({\n size: props.size || 'M',\n orientation: props.orientation || 'horizontal',\n staticColor: props.staticColor\n }, props.styles)} />\n );\n}\n\n/**\n * Dividers bring clarity to a layout by grouping and dividing content in close proximity.\n * They can also be used to establish rhythm and hierarchy.\n */\nlet _Divider = /*#__PURE__*/ forwardRef(Divider);\nexport {_Divider as Divider};\n"],"names":[],"version":3,"file":"Divider.css.map"}
1
+ {"mappings":"AA4CuB;;;;AAAA;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA","sources":["packages/@react-spectrum/s2/src/Divider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n/*\n * Adding as it's own type to deal with size being a part of the theme so we\n * can type style() and it's parameters.\n */\ninterface DividerSpectrumProps {\n /**\n * How thick the Divider should be.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /**\n * How thick the Divider should be.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** The static color style to apply. Useful when the Divider appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\n// TODO: allow overriding height (only when orientation is vertical)??\nexport interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}\n\nexport const DividerContext = createContext<ContextValue<DividerProps, DOMRefValue>>(null);\n\nexport const divider = style<DividerSpectrumProps>({\n alignSelf: 'stretch',\n backgroundColor: {\n default: 'gray-200',\n size: {\n L: 'gray-800'\n },\n staticColor: {\n white: {\n default: 'transparent-white-200',\n size: {\n L: 'transparent-white-800'\n }\n },\n black: {\n default: 'transparent-black-200',\n size: {\n L: 'transparent-black-800'\n }\n }\n },\n forcedColors: 'ButtonBorder'\n },\n borderStyle: 'none',\n borderRadius: 'full',\n margin: 0,\n height: {\n orientation: {\n horizontal: {\n // These should be px not rems, because we're emulating a border.\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n },\n width: {\n orientation: {\n vertical: {\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction Divider(props: DividerProps, ref: DOMRef) {\n [props, ref] = useSpectrumContextProps(props, ref, DividerContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACSeparator\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + divider({\n size: props.size || 'M',\n orientation: props.orientation || 'horizontal',\n staticColor: props.staticColor\n }, props.styles)} />\n );\n}\n\n/**\n * Dividers bring clarity to a layout by grouping and dividing content in close proximity.\n * They can also be used to establish rhythm and hierarchy.\n */\nlet _Divider = /*#__PURE__*/ forwardRef(Divider);\nexport {_Divider as Divider};\n"],"names":[],"version":3,"file":"Divider.css.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAgCM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA2C;AAE9E,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDb,SAAS,8BAAQ,KAAmB,EAAE,GAAW;IAC/C,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,gBAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0CAAQ;YAClD,MAAM,MAAM,IAAI,IAAI;YACpB,aAAa,MAAM,WAAW,IAAI;YAClC,aAAa,MAAM,WAAW;QAChC,GAAG,MAAM,MAAM;;AAErB;AAEA;;;CAGC,GACD,IAAI,4CAAW,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Divider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n/*\n * Adding as it's own type to deal with size being a part of the theme so we\n * can type style() and it's parameters.\n */\ninterface DividerSpectrumProps {\n /**\n * How thick the Divider should be.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /**\n * How thick the Divider should be.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** The static color style to apply. Useful when the Divider appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\n// TODO: allow overriding height (only when orientation is vertical)??\nexport interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}\n\nexport const DividerContext = createContext<ContextValue<DividerProps, DOMRefValue>>(null);\n\nexport const divider = style<DividerSpectrumProps>({\n alignSelf: 'stretch',\n backgroundColor: {\n default: 'gray-200',\n size: {\n L: 'gray-800'\n },\n staticColor: {\n white: {\n default: 'transparent-white-200',\n size: {\n L: 'transparent-white-800'\n }\n },\n black: {\n default: 'transparent-black-200',\n size: {\n L: 'transparent-black-800'\n }\n }\n },\n forcedColors: 'ButtonBorder'\n },\n borderStyle: 'none',\n borderRadius: 'full',\n margin: 0,\n height: {\n orientation: {\n horizontal: {\n // These should be px not rems, because we're emulating a border.\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n },\n width: {\n orientation: {\n vertical: {\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction Divider(props: DividerProps, ref: DOMRef) {\n [props, ref] = useSpectrumContextProps(props, ref, DividerContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACSeparator\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + divider({\n size: props.size || 'M',\n orientation: props.orientation || 'horizontal',\n staticColor: props.staticColor\n }, props.styles)} />\n );\n}\n\n/**\n * Dividers bring clarity to a layout by grouping and dividing content in close proximity.\n * They can also be used to establish rhythm and hierarchy.\n */\nlet _Divider = /*#__PURE__*/ forwardRef(Divider);\nexport {_Divider as Divider};\n"],"names":[],"version":3,"file":"Divider.mjs.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAgCM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA2C;AAE9E,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDb,SAAS,8BAAQ,KAAmB,EAAE,GAAW;IAC/C,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,gBAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0CAAQ;YAClD,MAAM,MAAM,IAAI,IAAI;YACpB,aAAa,MAAM,WAAW,IAAI;YAClC,aAAa,MAAM,WAAW;QAChC,GAAG,MAAM,MAAM;;AAErB;AAEA;;;CAGC,GACD,IAAI,4CAAW,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Divider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n/*\n * Adding as it's own type to deal with size being a part of the theme so we\n * can type style() and it's parameters.\n */\ninterface DividerSpectrumProps {\n /**\n * How thick the Divider should be.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /**\n * How thick the Divider should be.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** The static color style to apply. Useful when the Divider appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\n// TODO: allow overriding height (only when orientation is vertical)??\nexport interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}\n\nexport const DividerContext = createContext<ContextValue<DividerProps, DOMRefValue>>(null);\n\nexport const divider = style<DividerSpectrumProps>({\n alignSelf: 'stretch',\n backgroundColor: {\n default: 'gray-200',\n size: {\n L: 'gray-800'\n },\n staticColor: {\n white: {\n default: 'transparent-white-200',\n size: {\n L: 'transparent-white-800'\n }\n },\n black: {\n default: 'transparent-black-200',\n size: {\n L: 'transparent-black-800'\n }\n }\n },\n forcedColors: 'ButtonBorder'\n },\n borderStyle: 'none',\n borderRadius: 'full',\n margin: 0,\n height: {\n orientation: {\n horizontal: {\n // These should be px not rems, because we're emulating a border.\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n },\n width: {\n orientation: {\n vertical: {\n default: '[2px]',\n size: {\n S: '[1px]',\n L: '[4px]'\n }\n }\n }\n }\n}, getAllowedOverrides());\n\nfunction Divider(props: DividerProps, ref: DOMRef) {\n [props, ref] = useSpectrumContextProps(props, ref, DividerContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACSeparator\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + divider({\n size: props.size || 'M',\n orientation: props.orientation || 'horizontal',\n staticColor: props.staticColor\n }, props.styles)} />\n );\n}\n\n/**\n * Dividers bring clarity to a layout by grouping and dividing content in close proximity.\n * They can also be used to establish rhythm and hierarchy.\n */\nlet _Divider = /*#__PURE__*/ forwardRef(Divider);\nexport {_Divider as Divider};\n"],"names":[],"version":3,"file":"Divider.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAyBM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA4D;AAEvG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBN,SAAS,+BAAS,KAAoB,EAAE,GAA2B;IACjE,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,mCAAU;QACR,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,+BAAS,aAAa,MAAM,MAAM;kBAC5F,CAAA,4BACC;;kCACE,gCAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;wBAAC,OAAO;4BAAC,cAAc;4BAAM,cAAc,YAAY,YAAY;wBAAA;kCACnG,MAAM,QAAQ;;oBAEf,YAAY,YAAY,IAAI,MAAM,QAAQ,kBAC1C,gCAAC;wBAAI,WAAW,6BAAO;kCACrB,cAAA,gCAAC;sCACE,MAAM,cAAc,GAAG,MAAM,cAAc,GAAG,gBAAgB,MAAM,CAAC;;;;;;AAQtF;AAEA;;CAEC,GACD,IAAI,2CAAY,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, DropZoneRenderProps, DropZone as RACDropZone, DropZoneProps as RACDropZoneProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IllustratedMessageContext} from './IllustratedMessage';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DropZoneProps extends Omit<RACDropZoneProps, 'className' | 'style' | 'children' | 'isDisabled' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, UnsafeStyles, DOMProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the drop zone. */\n children?: ReactNode,\n /** Whether the drop zone has been filled. */\n isFilled?: boolean,\n /** The message to replace the default banner message that is shown when the drop zone is filled. */\n replaceMessage?: string\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst dropzone = style<DropZoneRenderProps>({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n position: 'relative',\n fontFamily: 'sans',\n color: 'gray-900',\n borderStyle: {\n default: 'dashed',\n isDropTarget: 'solid'\n },\n backgroundColor: {\n isDropTarget: 'blue-200'\n },\n borderWidth: 2,\n borderColor: {\n default: 'gray-300',\n isDropTarget: 'blue-800',\n isFocusVisible: 'blue-800'\n },\n borderRadius: 'lg',\n padding: 24\n}, getAllowedOverrides({height: true}));\n\nconst banner = style<DropZoneRenderProps>({\n position: 'absolute',\n left: 0,\n right: 0,\n marginX: 'auto',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: 20,\n maxWidth: 208,\n backgroundColor: 'accent',\n borderRadius: 'default',\n color: 'white',\n fontWeight: 'bold',\n padding: '[calc((self(minHeight))/1.5)]'\n});\n\nfunction DropZone(props: DropZoneProps, ref: DOMRef<HTMLDivElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, DropZoneContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACDropZone\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + dropzone(renderProps, props.styles)}>\n {renderProps => (\n <>\n <IllustratedMessageContext.Provider value={{isInDropZone: true, isDropTarget: renderProps.isDropTarget}}>\n {props.children}\n </IllustratedMessageContext.Provider>\n {(renderProps.isDropTarget && props.isFilled) &&\n <div className={banner(renderProps)}>\n <span>\n {props.replaceMessage ? props.replaceMessage : stringFormatter.format('dropzone.replaceMessage')}\n </span>\n </div>\n }\n </>\n )}\n </RACDropZone>\n );\n}\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nlet _DropZone = /*#__PURE__*/ forwardRef(DropZone);\nexport {_DropZone as DropZone};\n"],"names":[],"version":3,"file":"DropZone.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAyBM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA4D;AAEvG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBN,SAAS,+BAAS,KAAoB,EAAE,GAA2B;IACjE,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,mCAAU;QACR,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,+BAAS,aAAa,MAAM,MAAM;kBAC5F,CAAA,4BACC;;kCACE,gCAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;wBAAC,OAAO;4BAAC,cAAc;4BAAM,cAAc,YAAY,YAAY;wBAAA;kCACnG,MAAM,QAAQ;;oBAEf,YAAY,YAAY,IAAI,MAAM,QAAQ,kBAC1C,gCAAC;wBAAI,WAAW,6BAAO;kCACrB,cAAA,gCAAC;sCACE,MAAM,cAAc,GAAG,MAAM,cAAc,GAAG,gBAAgB,MAAM,CAAC;;;;;;AAQtF;AAEA;;CAEC,GACD,IAAI,2CAAY,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, DropZoneRenderProps, DropZone as RACDropZone, DropZoneProps as RACDropZoneProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IllustratedMessageContext} from './IllustratedMessage';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DropZoneProps extends Omit<RACDropZoneProps, 'className' | 'style' | 'children' | 'isDisabled' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, UnsafeStyles, DOMProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the drop zone. */\n children?: ReactNode,\n /** Whether the drop zone has been filled. */\n isFilled?: boolean,\n /** The message to replace the default banner message that is shown when the drop zone is filled. */\n replaceMessage?: string\n}\n\nexport const DropZoneContext = createContext<ContextValue<DropZoneProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst dropzone = style<DropZoneRenderProps>({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n position: 'relative',\n fontFamily: 'sans',\n color: 'gray-900',\n borderStyle: {\n default: 'dashed',\n isDropTarget: 'solid'\n },\n backgroundColor: {\n isDropTarget: 'blue-200'\n },\n borderWidth: 2,\n borderColor: {\n default: 'gray-300',\n isDropTarget: 'blue-800',\n isFocusVisible: 'blue-800'\n },\n borderRadius: 'lg',\n padding: 24\n}, getAllowedOverrides({height: true}));\n\nconst banner = style<DropZoneRenderProps>({\n position: 'absolute',\n left: 0,\n right: 0,\n marginX: 'auto',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: 20,\n maxWidth: 208,\n backgroundColor: 'accent',\n borderRadius: 'default',\n color: 'white',\n fontWeight: 'bold',\n padding: '[calc((self(minHeight))/1.5)]'\n});\n\nfunction DropZone(props: DropZoneProps, ref: DOMRef<HTMLDivElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, DropZoneContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACDropZone\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + dropzone(renderProps, props.styles)}>\n {renderProps => (\n <>\n <IllustratedMessageContext.Provider value={{isInDropZone: true, isDropTarget: renderProps.isDropTarget}}>\n {props.children}\n </IllustratedMessageContext.Provider>\n {(renderProps.isDropTarget && props.isFilled) &&\n <div className={banner(renderProps)}>\n <span>\n {props.replaceMessage ? props.replaceMessage : stringFormatter.format('dropzone.replaceMessage')}\n </span>\n </div>\n }\n </>\n )}\n </RACDropZone>\n );\n}\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nlet _DropZone = /*#__PURE__*/ forwardRef(DropZone);\nexport {_DropZone as DropZone};\n"],"names":[],"version":3,"file":"DropZone.cjs.map"}