@react-spectrum/s2 0.6.0 → 0.7.1

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 (767) hide show
  1. package/dist/Accordion.cjs.map +1 -1
  2. package/dist/Accordion.css +1 -5
  3. package/dist/Accordion.css.map +1 -1
  4. package/dist/Accordion.mjs.map +1 -1
  5. package/dist/ActionBar.cjs +2 -2
  6. package/dist/ActionBar.css +0 -6
  7. package/dist/ActionBar.css.map +1 -1
  8. package/dist/ActionBar.mjs +2 -2
  9. package/dist/ActionButton.cjs +4 -4
  10. package/dist/ActionButton.cjs.map +1 -1
  11. package/dist/ActionButton.css +0 -6
  12. package/dist/ActionButton.css.map +1 -1
  13. package/dist/ActionButton.mjs +4 -4
  14. package/dist/ActionButton.mjs.map +1 -1
  15. package/dist/ActionButtonGroup.css +1 -5
  16. package/dist/ActionButtonGroup.css.map +1 -1
  17. package/dist/ActionMenu.cjs.map +1 -1
  18. package/dist/ActionMenu.mjs.map +1 -1
  19. package/dist/AlertDialog.css +1 -5
  20. package/dist/AlertDialog.css.map +1 -1
  21. package/dist/Avatar.cjs.map +1 -1
  22. package/dist/Avatar.css +1 -5
  23. package/dist/Avatar.css.map +1 -1
  24. package/dist/Avatar.mjs.map +1 -1
  25. package/dist/AvatarGroup.cjs +1 -1
  26. package/dist/AvatarGroup.cjs.map +1 -1
  27. package/dist/AvatarGroup.css +0 -6
  28. package/dist/AvatarGroup.css.map +1 -1
  29. package/dist/AvatarGroup.mjs +1 -1
  30. package/dist/AvatarGroup.mjs.map +1 -1
  31. package/dist/Badge.cjs +32 -14
  32. package/dist/Badge.cjs.map +1 -1
  33. package/dist/Badge.css +26 -8
  34. package/dist/Badge.css.map +1 -1
  35. package/dist/Badge.mjs +33 -15
  36. package/dist/Badge.mjs.map +1 -1
  37. package/dist/Breadcrumbs.cjs +7 -7
  38. package/dist/Breadcrumbs.cjs.map +1 -1
  39. package/dist/Breadcrumbs.css +0 -6
  40. package/dist/Breadcrumbs.css.map +1 -1
  41. package/dist/Breadcrumbs.mjs +8 -8
  42. package/dist/Breadcrumbs.mjs.map +1 -1
  43. package/dist/Button.cjs +4 -4
  44. package/dist/Button.cjs.map +1 -1
  45. package/dist/Button.css +0 -6
  46. package/dist/Button.css.map +1 -1
  47. package/dist/Button.mjs +4 -4
  48. package/dist/Button.mjs.map +1 -1
  49. package/dist/ButtonGroup.cjs +1 -1
  50. package/dist/ButtonGroup.cjs.map +1 -1
  51. package/dist/ButtonGroup.css +1 -5
  52. package/dist/ButtonGroup.css.map +1 -1
  53. package/dist/ButtonGroup.mjs +1 -1
  54. package/dist/ButtonGroup.mjs.map +1 -1
  55. package/dist/Card.cjs +15 -15
  56. package/dist/Card.cjs.map +1 -1
  57. package/dist/Card.css +0 -6
  58. package/dist/Card.css.map +1 -1
  59. package/dist/Card.mjs +16 -16
  60. package/dist/Card.mjs.map +1 -1
  61. package/dist/CardView.cjs +71 -309
  62. package/dist/CardView.cjs.map +1 -1
  63. package/dist/CardView.css +1 -5
  64. package/dist/CardView.css.map +1 -1
  65. package/dist/CardView.mjs +28 -266
  66. package/dist/CardView.mjs.map +1 -1
  67. package/dist/CenterBaseline.cjs +1 -1
  68. package/dist/CenterBaseline.css +1 -5
  69. package/dist/CenterBaseline.css.map +1 -1
  70. package/dist/CenterBaseline.mjs +1 -1
  71. package/dist/Checkbox.cjs +1 -1
  72. package/dist/Checkbox.cjs.map +1 -1
  73. package/dist/Checkbox.css +0 -6
  74. package/dist/Checkbox.css.map +1 -1
  75. package/dist/Checkbox.mjs +1 -1
  76. package/dist/Checkbox.mjs.map +1 -1
  77. package/dist/CheckboxGroup.cjs.map +1 -1
  78. package/dist/CheckboxGroup.css +0 -6
  79. package/dist/CheckboxGroup.css.map +1 -1
  80. package/dist/CheckboxGroup.mjs.map +1 -1
  81. package/dist/ClearButton.css +1 -5
  82. package/dist/ClearButton.css.map +1 -1
  83. package/dist/CloseButton.cjs.map +1 -1
  84. package/dist/CloseButton.css +1 -5
  85. package/dist/CloseButton.css.map +1 -1
  86. package/dist/CloseButton.mjs.map +1 -1
  87. package/dist/ColorArea.cjs.map +1 -1
  88. package/dist/ColorArea.css +1 -5
  89. package/dist/ColorArea.css.map +1 -1
  90. package/dist/ColorArea.mjs.map +1 -1
  91. package/dist/ColorField.cjs.map +1 -1
  92. package/dist/ColorField.css +0 -6
  93. package/dist/ColorField.css.map +1 -1
  94. package/dist/ColorField.mjs.map +1 -1
  95. package/dist/ColorHandle.cjs +3 -3
  96. package/dist/ColorHandle.css +1 -5
  97. package/dist/ColorHandle.css.map +1 -1
  98. package/dist/ColorHandle.mjs +3 -3
  99. package/dist/ColorSlider.cjs.map +1 -1
  100. package/dist/ColorSlider.css +0 -6
  101. package/dist/ColorSlider.css.map +1 -1
  102. package/dist/ColorSlider.mjs.map +1 -1
  103. package/dist/ColorSwatch.cjs.map +1 -1
  104. package/dist/ColorSwatch.css +1 -5
  105. package/dist/ColorSwatch.css.map +1 -1
  106. package/dist/ColorSwatch.mjs.map +1 -1
  107. package/dist/ColorSwatchPicker.cjs +1 -1
  108. package/dist/ColorSwatchPicker.cjs.map +1 -1
  109. package/dist/ColorSwatchPicker.css +1 -5
  110. package/dist/ColorSwatchPicker.css.map +1 -1
  111. package/dist/ColorSwatchPicker.mjs +1 -1
  112. package/dist/ColorSwatchPicker.mjs.map +1 -1
  113. package/dist/ColorWheel.cjs.map +1 -1
  114. package/dist/ColorWheel.css +1 -5
  115. package/dist/ColorWheel.css.map +1 -1
  116. package/dist/ColorWheel.mjs.map +1 -1
  117. package/dist/ComboBox.cjs +2 -2
  118. package/dist/ComboBox.css +0 -6
  119. package/dist/ComboBox.css.map +1 -1
  120. package/dist/ComboBox.mjs +2 -2
  121. package/dist/Content.cjs +3 -1
  122. package/dist/Content.cjs.map +1 -1
  123. package/dist/Content.mjs +3 -1
  124. package/dist/Content.mjs.map +1 -1
  125. package/dist/ContextualHelp.cjs +5 -5
  126. package/dist/ContextualHelp.cjs.map +1 -1
  127. package/dist/ContextualHelp.css +0 -6
  128. package/dist/ContextualHelp.css.map +1 -1
  129. package/dist/ContextualHelp.mjs +5 -5
  130. package/dist/ContextualHelp.mjs.map +1 -1
  131. package/dist/CustomDialog.css +1 -5
  132. package/dist/CustomDialog.css.map +1 -1
  133. package/dist/Dialog.cjs +10 -10
  134. package/dist/Dialog.css +0 -6
  135. package/dist/Dialog.css.map +1 -1
  136. package/dist/Dialog.mjs +10 -10
  137. package/dist/Disclosure.cjs +2 -2
  138. package/dist/Disclosure.cjs.map +1 -1
  139. package/dist/Disclosure.css +0 -6
  140. package/dist/Disclosure.css.map +1 -1
  141. package/dist/Disclosure.mjs +2 -2
  142. package/dist/Disclosure.mjs.map +1 -1
  143. package/dist/Divider.cjs.map +1 -1
  144. package/dist/Divider.css +1 -5
  145. package/dist/Divider.css.map +1 -1
  146. package/dist/Divider.mjs.map +1 -1
  147. package/dist/DropZone.cjs.map +1 -1
  148. package/dist/DropZone.css +0 -6
  149. package/dist/DropZone.css.map +1 -1
  150. package/dist/DropZone.mjs.map +1 -1
  151. package/dist/Field.cjs +7 -7
  152. package/dist/Field.cjs.map +1 -1
  153. package/dist/Field.css +0 -6
  154. package/dist/Field.css.map +1 -1
  155. package/dist/Field.mjs +7 -7
  156. package/dist/Field.mjs.map +1 -1
  157. package/dist/Form.cjs.map +1 -1
  158. package/dist/Form.css +1 -5
  159. package/dist/Form.css.map +1 -1
  160. package/dist/Form.mjs.map +1 -1
  161. package/dist/FullscreenDialog.cjs +5 -5
  162. package/dist/FullscreenDialog.css +0 -6
  163. package/dist/FullscreenDialog.css.map +1 -1
  164. package/dist/FullscreenDialog.mjs +5 -5
  165. package/dist/IllustratedMessage.cjs +1 -1
  166. package/dist/IllustratedMessage.cjs.map +1 -1
  167. package/dist/IllustratedMessage.css +0 -6
  168. package/dist/IllustratedMessage.css.map +1 -1
  169. package/dist/IllustratedMessage.mjs +1 -1
  170. package/dist/IllustratedMessage.mjs.map +1 -1
  171. package/dist/Image.cjs +14 -2
  172. package/dist/Image.cjs.map +1 -1
  173. package/dist/Image.css +1 -5
  174. package/dist/Image.css.map +1 -1
  175. package/dist/Image.mjs +15 -3
  176. package/dist/Image.mjs.map +1 -1
  177. package/dist/InlineAlert.cjs +1 -1
  178. package/dist/InlineAlert.css +0 -6
  179. package/dist/InlineAlert.css.map +1 -1
  180. package/dist/InlineAlert.mjs +1 -1
  181. package/dist/Link.cjs.map +1 -1
  182. package/dist/Link.css +0 -6
  183. package/dist/Link.css.map +1 -1
  184. package/dist/Link.mjs.map +1 -1
  185. package/dist/Menu.cjs +20 -8
  186. package/dist/Menu.cjs.map +1 -1
  187. package/dist/Menu.css +12 -6
  188. package/dist/Menu.css.map +1 -1
  189. package/dist/Menu.mjs +21 -9
  190. package/dist/Menu.mjs.map +1 -1
  191. package/dist/Meter.cjs.map +1 -1
  192. package/dist/Meter.css +0 -6
  193. package/dist/Meter.css.map +1 -1
  194. package/dist/Meter.mjs.map +1 -1
  195. package/dist/Modal.css +1 -5
  196. package/dist/Modal.css.map +1 -1
  197. package/dist/NumberField.cjs.map +1 -1
  198. package/dist/NumberField.css +0 -6
  199. package/dist/NumberField.css.map +1 -1
  200. package/dist/NumberField.mjs.map +1 -1
  201. package/dist/Picker.cjs +95 -70
  202. package/dist/Picker.cjs.map +1 -1
  203. package/dist/Picker.css +8 -10
  204. package/dist/Picker.css.map +1 -1
  205. package/dist/Picker.mjs +96 -71
  206. package/dist/Picker.mjs.map +1 -1
  207. package/dist/Popover.cjs +1 -3
  208. package/dist/Popover.cjs.map +1 -1
  209. package/dist/Popover.css +5 -9
  210. package/dist/Popover.css.map +1 -1
  211. package/dist/Popover.mjs +1 -3
  212. package/dist/Popover.mjs.map +1 -1
  213. package/dist/ProgressBar.cjs.map +1 -1
  214. package/dist/ProgressBar.css +0 -6
  215. package/dist/ProgressBar.css.map +1 -1
  216. package/dist/ProgressBar.mjs.map +1 -1
  217. package/dist/ProgressCircle.cjs.map +1 -1
  218. package/dist/ProgressCircle.css +1 -5
  219. package/dist/ProgressCircle.css.map +1 -1
  220. package/dist/ProgressCircle.mjs.map +1 -1
  221. package/dist/Provider.css +1 -5
  222. package/dist/Provider.css.map +1 -1
  223. package/dist/Radio.css +0 -6
  224. package/dist/Radio.css.map +1 -1
  225. package/dist/RadioGroup.cjs.map +1 -1
  226. package/dist/RadioGroup.css +0 -6
  227. package/dist/RadioGroup.css.map +1 -1
  228. package/dist/RadioGroup.mjs.map +1 -1
  229. package/dist/RangeSlider.cjs.map +1 -1
  230. package/dist/RangeSlider.mjs.map +1 -1
  231. package/dist/SearchField.cjs +3 -3
  232. package/dist/SearchField.cjs.map +1 -1
  233. package/dist/SearchField.css +0 -6
  234. package/dist/SearchField.css.map +1 -1
  235. package/dist/SearchField.mjs +3 -3
  236. package/dist/SearchField.mjs.map +1 -1
  237. package/dist/SegmentedControl.cjs +7 -7
  238. package/dist/SegmentedControl.cjs.map +1 -1
  239. package/dist/SegmentedControl.css +0 -6
  240. package/dist/SegmentedControl.css.map +1 -1
  241. package/dist/SegmentedControl.mjs +8 -8
  242. package/dist/SegmentedControl.mjs.map +1 -1
  243. package/dist/Slider.cjs.map +1 -1
  244. package/dist/Slider.css +0 -6
  245. package/dist/Slider.css.map +1 -1
  246. package/dist/Slider.mjs.map +1 -1
  247. package/dist/StatusLight.cjs.map +1 -1
  248. package/dist/StatusLight.css +0 -6
  249. package/dist/StatusLight.css.map +1 -1
  250. package/dist/StatusLight.mjs.map +1 -1
  251. package/dist/Switch.cjs.map +1 -1
  252. package/dist/Switch.css +0 -6
  253. package/dist/Switch.css.map +1 -1
  254. package/dist/Switch.mjs.map +1 -1
  255. package/dist/TableView.cjs +75 -92
  256. package/dist/TableView.cjs.map +1 -1
  257. package/dist/TableView.css +10 -8
  258. package/dist/TableView.css.map +1 -1
  259. package/dist/TableView.mjs +76 -93
  260. package/dist/TableView.mjs.map +1 -1
  261. package/dist/Tabs.cjs +451 -167
  262. package/dist/Tabs.cjs.map +1 -1
  263. package/dist/Tabs.css +208 -122
  264. package/dist/Tabs.css.map +1 -1
  265. package/dist/Tabs.mjs +451 -167
  266. package/dist/Tabs.mjs.map +1 -1
  267. package/dist/TabsPicker.cjs +415 -0
  268. package/dist/TabsPicker.cjs.map +1 -0
  269. package/dist/TabsPicker.css +482 -0
  270. package/dist/TabsPicker.css.map +1 -0
  271. package/dist/TabsPicker.mjs +409 -0
  272. package/dist/TabsPicker.mjs.map +1 -0
  273. package/dist/TagGroup.cjs +13 -13
  274. package/dist/TagGroup.cjs.map +1 -1
  275. package/dist/TagGroup.css +0 -6
  276. package/dist/TagGroup.css.map +1 -1
  277. package/dist/TagGroup.mjs +13 -13
  278. package/dist/TagGroup.mjs.map +1 -1
  279. package/dist/TextField.cjs +1 -1
  280. package/dist/TextField.cjs.map +1 -1
  281. package/dist/TextField.css +0 -6
  282. package/dist/TextField.css.map +1 -1
  283. package/dist/TextField.mjs +1 -1
  284. package/dist/TextField.mjs.map +1 -1
  285. package/dist/ToggleButton.cjs +3 -3
  286. package/dist/ToggleButton.cjs.map +1 -1
  287. package/dist/ToggleButton.css +1 -5
  288. package/dist/ToggleButton.css.map +1 -1
  289. package/dist/ToggleButton.mjs +3 -3
  290. package/dist/ToggleButton.mjs.map +1 -1
  291. package/dist/ToggleButtonGroup.cjs.map +1 -1
  292. package/dist/ToggleButtonGroup.mjs.map +1 -1
  293. package/dist/Tooltip.cjs +1 -1
  294. package/dist/Tooltip.cjs.map +1 -1
  295. package/dist/Tooltip.css +0 -6
  296. package/dist/Tooltip.css.map +1 -1
  297. package/dist/Tooltip.mjs +1 -1
  298. package/dist/Tooltip.mjs.map +1 -1
  299. package/dist/TreeView.cjs +439 -0
  300. package/dist/TreeView.cjs.map +1 -0
  301. package/dist/TreeView.css +608 -0
  302. package/dist/TreeView.css.map +1 -0
  303. package/dist/TreeView.mjs +432 -0
  304. package/dist/TreeView.mjs.map +1 -0
  305. package/dist/main.cjs +5 -0
  306. package/dist/main.cjs.map +1 -1
  307. package/dist/module.mjs +3 -1
  308. package/dist/module.mjs.map +1 -1
  309. package/dist/types.d.ts +120 -81
  310. package/dist/types.d.ts.map +1 -1
  311. package/icons/3DMaterial.cjs.map +1 -1
  312. package/icons/3DMaterial.mjs.map +1 -1
  313. package/icons/ABC.cjs +36 -0
  314. package/icons/ABC.cjs.map +1 -0
  315. package/icons/ABC.mjs +25 -0
  316. package/icons/ABC.mjs.map +1 -0
  317. package/icons/AlertDiamond.cjs.map +1 -1
  318. package/icons/AlertDiamond.mjs.map +1 -1
  319. package/icons/Animation.cjs.map +1 -1
  320. package/icons/Animation.mjs.map +1 -1
  321. package/icons/AnimationNo.cjs.map +1 -1
  322. package/icons/AnimationNo.mjs.map +1 -1
  323. package/icons/App.cjs +42 -0
  324. package/icons/App.cjs.map +1 -0
  325. package/icons/App.mjs +31 -0
  326. package/icons/App.mjs.map +1 -0
  327. package/icons/AspectRatio.cjs.map +1 -1
  328. package/icons/AspectRatio.mjs.map +1 -1
  329. package/icons/Asset.cjs +1 -5
  330. package/icons/Asset.cjs.map +1 -1
  331. package/icons/Asset.mjs +1 -5
  332. package/icons/Asset.mjs.map +1 -1
  333. package/icons/AudioWave.cjs.map +1 -1
  334. package/icons/AudioWave.mjs.map +1 -1
  335. package/icons/BadgeVerified.cjs.map +1 -1
  336. package/icons/BadgeVerified.mjs.map +1 -1
  337. package/icons/Bell.cjs.map +1 -1
  338. package/icons/Bell.mjs.map +1 -1
  339. package/icons/Bookmark.cjs +36 -0
  340. package/icons/Bookmark.cjs.map +1 -0
  341. package/icons/Bookmark.mjs +25 -0
  342. package/icons/Bookmark.mjs.map +1 -0
  343. package/icons/Brand.cjs.map +1 -1
  344. package/icons/Brand.mjs.map +1 -1
  345. package/icons/Building.cjs +62 -0
  346. package/icons/Building.cjs.map +1 -0
  347. package/icons/Building.mjs +51 -0
  348. package/icons/Building.mjs.map +1 -0
  349. package/icons/CalendarEdit.cjs.map +1 -1
  350. package/icons/CalendarEdit.mjs.map +1 -1
  351. package/icons/CallCenter.cjs +36 -0
  352. package/icons/CallCenter.cjs.map +1 -0
  353. package/icons/CallCenter.mjs +25 -0
  354. package/icons/CallCenter.mjs.map +1 -0
  355. package/icons/CameraProperties.cjs.map +1 -1
  356. package/icons/CameraProperties.mjs.map +1 -1
  357. package/icons/Channel.cjs.map +1 -1
  358. package/icons/Channel.mjs.map +1 -1
  359. package/icons/ChartBarVert.cjs +36 -0
  360. package/icons/ChartBarVert.cjs.map +1 -0
  361. package/icons/ChartBarVert.mjs +25 -0
  362. package/icons/ChartBarVert.mjs.map +1 -0
  363. package/icons/ChartPie.cjs +36 -0
  364. package/icons/ChartPie.cjs.map +1 -0
  365. package/icons/ChartPie.mjs +25 -0
  366. package/icons/ChartPie.mjs.map +1 -0
  367. package/icons/ChartTrend.cjs +36 -0
  368. package/icons/ChartTrend.cjs.map +1 -0
  369. package/icons/ChartTrend.mjs +25 -0
  370. package/icons/ChartTrend.mjs.map +1 -0
  371. package/icons/Chat.cjs +36 -0
  372. package/icons/Chat.cjs.map +1 -0
  373. package/icons/Chat.mjs +25 -0
  374. package/icons/Chat.mjs.map +1 -0
  375. package/icons/CheckBox.cjs.map +1 -1
  376. package/icons/CheckBox.mjs.map +1 -1
  377. package/icons/Checkmark.cjs +8 -8
  378. package/icons/Checkmark.cjs.map +1 -1
  379. package/icons/Checkmark.mjs +8 -8
  380. package/icons/Checkmark.mjs.map +1 -1
  381. package/icons/ChevronDoubleLeft.cjs +42 -0
  382. package/icons/ChevronDoubleLeft.cjs.map +1 -0
  383. package/icons/ChevronDoubleLeft.d.ts +5 -0
  384. package/icons/ChevronDoubleLeft.mjs +31 -0
  385. package/icons/ChevronDoubleLeft.mjs.map +1 -0
  386. package/icons/ChevronDoubleRight.cjs +42 -0
  387. package/icons/ChevronDoubleRight.cjs.map +1 -0
  388. package/icons/ChevronDoubleRight.d.ts +5 -0
  389. package/icons/ChevronDoubleRight.mjs +31 -0
  390. package/icons/ChevronDoubleRight.mjs.map +1 -0
  391. package/icons/ChevronDown.cjs +8 -8
  392. package/icons/ChevronDown.cjs.map +1 -1
  393. package/icons/ChevronDown.mjs +8 -8
  394. package/icons/ChevronDown.mjs.map +1 -1
  395. package/icons/ChevronLeft.cjs.map +1 -1
  396. package/icons/ChevronLeft.mjs.map +1 -1
  397. package/icons/ChevronRight.cjs.map +1 -1
  398. package/icons/ChevronRight.mjs.map +1 -1
  399. package/icons/ChevronUp.cjs +36 -0
  400. package/icons/ChevronUp.cjs.map +1 -0
  401. package/icons/ChevronUp.d.ts +5 -0
  402. package/icons/ChevronUp.mjs +25 -0
  403. package/icons/ChevronUp.mjs.map +1 -0
  404. package/icons/Circle.cjs.map +1 -1
  405. package/icons/Circle.mjs.map +1 -1
  406. package/icons/Close.cjs.map +1 -1
  407. package/icons/Close.mjs.map +1 -1
  408. package/icons/CloseCaptions.cjs.map +1 -1
  409. package/icons/CloseCaptions.mjs.map +1 -1
  410. package/icons/Code.cjs +36 -0
  411. package/icons/Code.cjs.map +1 -0
  412. package/icons/Code.d.ts +5 -0
  413. package/icons/Code.mjs +25 -0
  414. package/icons/Code.mjs.map +1 -0
  415. package/icons/Collection.cjs.map +1 -1
  416. package/icons/Collection.mjs.map +1 -1
  417. package/icons/ColorHarmony.cjs.map +1 -1
  418. package/icons/ColorHarmony.mjs.map +1 -1
  419. package/icons/CommentCheckmark.cjs.map +1 -1
  420. package/icons/CommentCheckmark.mjs.map +1 -1
  421. package/icons/CommentHide.cjs.map +1 -1
  422. package/icons/CommentHide.mjs.map +1 -1
  423. package/icons/CommentRemove.cjs.map +1 -1
  424. package/icons/CommentRemove.mjs.map +1 -1
  425. package/icons/Compare.cjs +42 -0
  426. package/icons/Compare.cjs.map +1 -0
  427. package/icons/Compare.d.ts +5 -0
  428. package/icons/Compare.mjs +31 -0
  429. package/icons/Compare.mjs.map +1 -0
  430. package/icons/ContextualTaskBar.cjs.map +1 -1
  431. package/icons/ContextualTaskBar.mjs.map +1 -1
  432. package/icons/CornerRadiusBottomLeft.cjs.map +1 -1
  433. package/icons/CornerRadiusBottomLeft.mjs.map +1 -1
  434. package/icons/CornerRadiusBottomRight.cjs.map +1 -1
  435. package/icons/CornerRadiusBottomRight.mjs.map +1 -1
  436. package/icons/CornerRadiusTopLeft.cjs.map +1 -1
  437. package/icons/CornerRadiusTopLeft.mjs.map +1 -1
  438. package/icons/CornerRadiusTopRight.cjs.map +1 -1
  439. package/icons/CornerRadiusTopRight.mjs.map +1 -1
  440. package/icons/CursorClick.cjs.map +1 -1
  441. package/icons/CursorClick.mjs.map +1 -1
  442. package/icons/Data.cjs +1 -1
  443. package/icons/Data.cjs.map +1 -1
  444. package/icons/Data.mjs +1 -1
  445. package/icons/Data.mjs.map +1 -1
  446. package/icons/DataAdd.cjs.map +1 -1
  447. package/icons/DataAdd.mjs.map +1 -1
  448. package/icons/DataRefresh.cjs +42 -0
  449. package/icons/DataRefresh.cjs.map +1 -0
  450. package/icons/DataRefresh.d.ts +5 -0
  451. package/icons/DataRefresh.mjs +31 -0
  452. package/icons/DataRefresh.mjs.map +1 -0
  453. package/icons/DataSettings.cjs +2 -2
  454. package/icons/DataSettings.cjs.map +1 -1
  455. package/icons/DataSettings.mjs +2 -2
  456. package/icons/DataSettings.mjs.map +1 -1
  457. package/icons/DataUpload.cjs +2 -2
  458. package/icons/DataUpload.cjs.map +1 -1
  459. package/icons/DataUpload.mjs +2 -2
  460. package/icons/DataUpload.mjs.map +1 -1
  461. package/icons/DeviceTablet.cjs.map +1 -1
  462. package/icons/DeviceTablet.mjs.map +1 -1
  463. package/icons/Draw.cjs.map +1 -1
  464. package/icons/Draw.mjs.map +1 -1
  465. package/icons/Edit.cjs.map +1 -1
  466. package/icons/Edit.mjs.map +1 -1
  467. package/icons/EditNo.cjs.map +1 -1
  468. package/icons/EditNo.mjs.map +1 -1
  469. package/icons/Email.cjs.map +1 -1
  470. package/icons/Email.mjs.map +1 -1
  471. package/icons/Enterprise.cjs +46 -0
  472. package/icons/Enterprise.cjs.map +1 -0
  473. package/icons/Enterprise.d.ts +5 -0
  474. package/icons/Enterprise.mjs +35 -0
  475. package/icons/Enterprise.mjs.map +1 -0
  476. package/icons/Export.cjs +42 -0
  477. package/icons/Export.cjs.map +1 -0
  478. package/icons/Export.d.ts +5 -0
  479. package/icons/Export.mjs +31 -0
  480. package/icons/Export.mjs.map +1 -0
  481. package/icons/Filter.cjs.map +1 -1
  482. package/icons/Filter.mjs.map +1 -1
  483. package/icons/FlipHorizontal.cjs +1 -21
  484. package/icons/FlipHorizontal.cjs.map +1 -1
  485. package/icons/FlipHorizontal.mjs +1 -21
  486. package/icons/FlipHorizontal.mjs.map +1 -1
  487. package/icons/FlipVertical.cjs +1 -21
  488. package/icons/FlipVertical.cjs.map +1 -1
  489. package/icons/FlipVertical.mjs +1 -21
  490. package/icons/FlipVertical.mjs.map +1 -1
  491. package/icons/FolderMoveTo.cjs.map +1 -1
  492. package/icons/FolderMoveTo.mjs.map +1 -1
  493. package/icons/FolderSearch.cjs +42 -0
  494. package/icons/FolderSearch.cjs.map +1 -0
  495. package/icons/FolderSearch.d.ts +5 -0
  496. package/icons/FolderSearch.mjs +31 -0
  497. package/icons/FolderSearch.mjs.map +1 -0
  498. package/icons/FontPicker.cjs.map +1 -1
  499. package/icons/FontPicker.mjs.map +1 -1
  500. package/icons/GlobeGrid.cjs.map +1 -1
  501. package/icons/GlobeGrid.mjs.map +1 -1
  502. package/icons/GradientHorizontal.cjs.map +1 -1
  503. package/icons/GradientHorizontal.mjs.map +1 -1
  504. package/icons/GridsAndRulers.cjs.map +1 -1
  505. package/icons/GridsAndRulers.mjs.map +1 -1
  506. package/icons/Icon.cjs.map +1 -1
  507. package/icons/Icon.mjs.map +1 -1
  508. package/icons/Image.cjs.map +1 -1
  509. package/icons/Image.mjs.map +1 -1
  510. package/icons/ImageAdd.cjs +1 -5
  511. package/icons/ImageAdd.cjs.map +1 -1
  512. package/icons/ImageAdd.mjs +1 -5
  513. package/icons/ImageAdd.mjs.map +1 -1
  514. package/icons/ImageBackgroundRemove.cjs.map +1 -1
  515. package/icons/ImageBackgroundRemove.mjs.map +1 -1
  516. package/icons/Images.cjs.map +1 -1
  517. package/icons/Images.mjs.map +1 -1
  518. package/icons/Import.cjs +42 -0
  519. package/icons/Import.cjs.map +1 -0
  520. package/icons/Import.d.ts +5 -0
  521. package/icons/Import.mjs +31 -0
  522. package/icons/Import.mjs.map +1 -0
  523. package/icons/Key.cjs +36 -0
  524. package/icons/Key.cjs.map +1 -0
  525. package/icons/Key.d.ts +5 -0
  526. package/icons/Key.mjs +25 -0
  527. package/icons/Key.mjs.map +1 -0
  528. package/icons/ListMultiSelect.cjs.map +1 -1
  529. package/icons/ListMultiSelect.mjs.map +1 -1
  530. package/icons/ListNumbered.cjs.map +1 -1
  531. package/icons/ListNumbered.mjs.map +1 -1
  532. package/icons/Logo.cjs.map +1 -1
  533. package/icons/Logo.mjs.map +1 -1
  534. package/icons/Market.cjs.map +1 -1
  535. package/icons/Market.mjs.map +1 -1
  536. package/icons/Microphone.cjs.map +1 -1
  537. package/icons/Microphone.mjs.map +1 -1
  538. package/icons/MicrophoneOff.cjs.map +1 -1
  539. package/icons/MicrophoneOff.mjs.map +1 -1
  540. package/icons/MusicNote.cjs.map +1 -1
  541. package/icons/MusicNote.mjs.map +1 -1
  542. package/icons/OrientationPortrait.cjs.map +1 -1
  543. package/icons/OrientationPortrait.mjs.map +1 -1
  544. package/icons/Pause.cjs.map +1 -1
  545. package/icons/Pause.mjs.map +1 -1
  546. package/icons/PauseCircle.cjs.map +1 -1
  547. package/icons/PauseCircle.mjs.map +1 -1
  548. package/icons/PeopleGroup.cjs +36 -0
  549. package/icons/PeopleGroup.cjs.map +1 -0
  550. package/icons/PeopleGroup.d.ts +5 -0
  551. package/icons/PeopleGroup.mjs +25 -0
  552. package/icons/PeopleGroup.mjs.map +1 -0
  553. package/icons/Percentage.cjs.map +1 -1
  554. package/icons/Percentage.mjs.map +1 -1
  555. package/icons/PinOff.cjs.map +1 -1
  556. package/icons/PinOff.mjs.map +1 -1
  557. package/icons/PinOn.cjs.map +1 -1
  558. package/icons/PinOn.mjs.map +1 -1
  559. package/icons/Play.cjs.map +1 -1
  560. package/icons/Play.mjs.map +1 -1
  561. package/icons/PluginGear.cjs.map +1 -1
  562. package/icons/PluginGear.mjs.map +1 -1
  563. package/icons/Polygon6.cjs.map +1 -1
  564. package/icons/Polygon6.mjs.map +1 -1
  565. package/icons/Publish.cjs.map +1 -1
  566. package/icons/Publish.mjs.map +1 -1
  567. package/icons/PublishNo.cjs.map +1 -1
  568. package/icons/PublishNo.mjs.map +1 -1
  569. package/icons/RadioButton.cjs.map +1 -1
  570. package/icons/RadioButton.mjs.map +1 -1
  571. package/icons/RectangleHoriz.cjs.map +1 -1
  572. package/icons/RectangleHoriz.mjs.map +1 -1
  573. package/icons/RocketQuickActions.cjs.map +1 -1
  574. package/icons/RocketQuickActions.mjs.map +1 -1
  575. package/icons/RotateCW.cjs.map +1 -1
  576. package/icons/RotateCW.mjs.map +1 -1
  577. package/icons/Ruler.cjs.map +1 -1
  578. package/icons/Ruler.mjs.map +1 -1
  579. package/icons/SaveFloppy.cjs +36 -0
  580. package/icons/SaveFloppy.cjs.map +1 -0
  581. package/icons/SaveFloppy.d.ts +5 -0
  582. package/icons/SaveFloppy.mjs +25 -0
  583. package/icons/SaveFloppy.mjs.map +1 -0
  584. package/icons/Select.cjs.map +1 -1
  585. package/icons/Select.mjs.map +1 -1
  586. package/icons/Send.cjs.map +1 -1
  587. package/icons/Send.mjs.map +1 -1
  588. package/icons/Shuffle.cjs.map +1 -1
  589. package/icons/Shuffle.mjs.map +1 -1
  590. package/icons/Skeleton.cjs +8 -6
  591. package/icons/Skeleton.cjs.map +1 -1
  592. package/icons/Skeleton.css +3 -5
  593. package/icons/Skeleton.css.map +1 -1
  594. package/icons/Skeleton.mjs +9 -7
  595. package/icons/Skeleton.mjs.map +1 -1
  596. package/icons/SlowConnectionCircle.cjs.map +1 -1
  597. package/icons/SlowConnectionCircle.mjs.map +1 -1
  598. package/icons/SpeedFast.cjs +36 -0
  599. package/icons/SpeedFast.cjs.map +1 -0
  600. package/icons/SpeedFast.d.ts +5 -0
  601. package/icons/SpeedFast.mjs +25 -0
  602. package/icons/SpeedFast.mjs.map +1 -0
  603. package/icons/StepBackward.cjs.map +1 -1
  604. package/icons/StepBackward.mjs.map +1 -1
  605. package/icons/StepForward.cjs.map +1 -1
  606. package/icons/StepForward.mjs.map +1 -1
  607. package/icons/Table.cjs.map +1 -1
  608. package/icons/Table.mjs.map +1 -1
  609. package/icons/Tag.cjs.map +1 -1
  610. package/icons/Tag.mjs.map +1 -1
  611. package/icons/Target.cjs.map +1 -1
  612. package/icons/Target.mjs.map +1 -1
  613. package/icons/TextBold.cjs.map +1 -1
  614. package/icons/TextBold.mjs.map +1 -1
  615. package/icons/TextHighlight.cjs.map +1 -1
  616. package/icons/TextHighlight.mjs.map +1 -1
  617. package/icons/TextIncrease.cjs.map +1 -1
  618. package/icons/TextIncrease.mjs.map +1 -1
  619. package/icons/TextNumbers.cjs.map +1 -1
  620. package/icons/TextNumbers.mjs.map +1 -1
  621. package/icons/TextParagraph.cjs.map +1 -1
  622. package/icons/TextParagraph.mjs.map +1 -1
  623. package/icons/TextReplaceComment.cjs.map +1 -1
  624. package/icons/TextReplaceComment.mjs.map +1 -1
  625. package/icons/Tools.cjs.map +1 -1
  626. package/icons/Tools.mjs.map +1 -1
  627. package/icons/TouchOneFingerSwipeLeftRight.cjs.map +1 -1
  628. package/icons/TouchOneFingerSwipeLeftRight.mjs.map +1 -1
  629. package/icons/Transcript.cjs.map +1 -1
  630. package/icons/Transcript.mjs.map +1 -1
  631. package/icons/Translate.cjs.map +1 -1
  632. package/icons/Translate.mjs.map +1 -1
  633. package/icons/UserAvatarCursor.cjs.map +1 -1
  634. package/icons/UserAvatarCursor.mjs.map +1 -1
  635. package/icons/UserEdit.cjs.map +1 -1
  636. package/icons/UserEdit.mjs.map +1 -1
  637. package/icons/UserGroup.cjs.map +1 -1
  638. package/icons/UserGroup.mjs.map +1 -1
  639. package/icons/UserSettings.cjs +44 -0
  640. package/icons/UserSettings.cjs.map +1 -0
  641. package/icons/UserSettings.d.ts +5 -0
  642. package/icons/UserSettings.mjs +33 -0
  643. package/icons/UserSettings.mjs.map +1 -0
  644. package/icons/VectorDraw.cjs.map +1 -1
  645. package/icons/VectorDraw.mjs.map +1 -1
  646. package/icons/ViewGridFluid.cjs +36 -0
  647. package/icons/ViewGridFluid.cjs.map +1 -0
  648. package/icons/ViewGridFluid.d.ts +5 -0
  649. package/icons/ViewGridFluid.mjs +25 -0
  650. package/icons/ViewGridFluid.mjs.map +1 -0
  651. package/icons/ZoomIn.cjs.map +1 -1
  652. package/icons/ZoomIn.mjs.map +1 -1
  653. package/icons/ZoomOut.cjs.map +1 -1
  654. package/icons/ZoomOut.mjs.map +1 -1
  655. package/package.json +17 -18
  656. package/src/Accordion.tsx +1 -1
  657. package/src/ActionButton.tsx +2 -2
  658. package/src/ActionMenu.tsx +1 -1
  659. package/src/Avatar.tsx +1 -1
  660. package/src/AvatarGroup.tsx +1 -1
  661. package/src/Badge.tsx +27 -8
  662. package/src/Breadcrumbs.tsx +13 -13
  663. package/src/Button.tsx +4 -4
  664. package/src/ButtonGroup.tsx +1 -1
  665. package/src/Card.tsx +2 -2
  666. package/src/CardView.tsx +18 -366
  667. package/src/Checkbox.tsx +1 -1
  668. package/src/CheckboxGroup.tsx +2 -2
  669. package/src/CloseButton.tsx +1 -1
  670. package/src/ColorArea.tsx +1 -1
  671. package/src/ColorField.tsx +1 -1
  672. package/src/ColorSlider.tsx +1 -1
  673. package/src/ColorSwatch.tsx +2 -2
  674. package/src/ColorSwatchPicker.tsx +1 -2
  675. package/src/ColorWheel.tsx +1 -1
  676. package/src/Content.tsx +11 -9
  677. package/src/ContextualHelp.tsx +2 -2
  678. package/src/Disclosure.tsx +1 -1
  679. package/src/Divider.tsx +1 -1
  680. package/src/DropZone.tsx +2 -2
  681. package/src/Field.tsx +1 -1
  682. package/src/Form.tsx +2 -2
  683. package/src/Icon.tsx +2 -2
  684. package/src/IllustratedMessage.tsx +1 -1
  685. package/src/Image.tsx +19 -5
  686. package/src/Link.tsx +2 -2
  687. package/src/Menu.tsx +9 -4
  688. package/src/Meter.tsx +1 -1
  689. package/src/NumberField.tsx +1 -1
  690. package/src/Picker.tsx +81 -60
  691. package/src/Popover.tsx +2 -1
  692. package/src/ProgressBar.tsx +1 -1
  693. package/src/ProgressCircle.tsx +1 -1
  694. package/src/RadioGroup.tsx +2 -2
  695. package/src/RangeSlider.tsx +1 -1
  696. package/src/SearchField.tsx +1 -1
  697. package/src/SegmentedControl.tsx +6 -9
  698. package/src/Skeleton.tsx +6 -8
  699. package/src/Slider.tsx +1 -1
  700. package/src/StatusLight.tsx +1 -1
  701. package/src/Switch.tsx +1 -1
  702. package/src/TableView.tsx +67 -71
  703. package/src/Tabs.tsx +451 -145
  704. package/src/TabsPicker.tsx +350 -0
  705. package/src/TagGroup.tsx +4 -4
  706. package/src/TextField.tsx +2 -2
  707. package/src/ToggleButton.tsx +2 -2
  708. package/src/ToggleButtonGroup.tsx +1 -1
  709. package/src/Tooltip.tsx +4 -4
  710. package/src/TreeView.tsx +450 -0
  711. package/src/index.ts +2 -0
  712. package/src/style-utils.ts +0 -1
  713. package/style/__tests__/style-macro.test.js +3 -7
  714. package/style/dist/spectrum-theme.cjs.map +1 -1
  715. package/style/dist/spectrum-theme.mjs.map +1 -1
  716. package/style/dist/style-macro.cjs +5 -3
  717. package/style/dist/style-macro.cjs.map +1 -1
  718. package/style/dist/style-macro.mjs +5 -3
  719. package/style/dist/style-macro.mjs.map +1 -1
  720. package/style/dist/types.d.ts.map +1 -1
  721. package/style/spectrum-theme.ts +0 -1
  722. package/style/style-macro.ts +9 -3
  723. package/icons/CloudStateDefault.cjs +0 -36
  724. package/icons/CloudStateDefault.cjs.map +0 -1
  725. package/icons/CloudStateDefault.mjs +0 -25
  726. package/icons/CloudStateDefault.mjs.map +0 -1
  727. package/icons/CloudStateDisconnected.cjs +0 -36
  728. package/icons/CloudStateDisconnected.cjs.map +0 -1
  729. package/icons/CloudStateDisconnected.mjs +0 -25
  730. package/icons/CloudStateDisconnected.mjs.map +0 -1
  731. package/icons/CloudStateError.cjs +0 -36
  732. package/icons/CloudStateError.cjs.map +0 -1
  733. package/icons/CloudStateError.mjs +0 -25
  734. package/icons/CloudStateError.mjs.map +0 -1
  735. package/icons/CloudStateErrorRed.cjs +0 -46
  736. package/icons/CloudStateErrorRed.cjs.map +0 -1
  737. package/icons/CloudStateErrorRed.mjs +0 -35
  738. package/icons/CloudStateErrorRed.mjs.map +0 -1
  739. package/icons/CloudStateInProgress.cjs +0 -36
  740. package/icons/CloudStateInProgress.cjs.map +0 -1
  741. package/icons/CloudStateInProgress.mjs +0 -25
  742. package/icons/CloudStateInProgress.mjs.map +0 -1
  743. package/icons/CloudStateOnline.cjs +0 -50
  744. package/icons/CloudStateOnline.cjs.map +0 -1
  745. package/icons/CloudStateOnline.mjs +0 -39
  746. package/icons/CloudStateOnline.mjs.map +0 -1
  747. package/icons/CloudStatePaused.cjs +0 -36
  748. package/icons/CloudStatePaused.cjs.map +0 -1
  749. package/icons/CloudStatePaused.mjs +0 -25
  750. package/icons/CloudStatePaused.mjs.map +0 -1
  751. package/icons/CloudStatePending.cjs +0 -42
  752. package/icons/CloudStatePending.cjs.map +0 -1
  753. package/icons/CloudStatePending.mjs +0 -31
  754. package/icons/CloudStatePending.mjs.map +0 -1
  755. package/icons/CloudStateSlowConnection.cjs +0 -36
  756. package/icons/CloudStateSlowConnection.cjs.map +0 -1
  757. package/icons/CloudStateSlowConnection.mjs +0 -25
  758. package/icons/CloudStateSlowConnection.mjs.map +0 -1
  759. /package/icons/{CloudStateDefault.d.ts → ABC.d.ts} +0 -0
  760. /package/icons/{CloudStateDisconnected.d.ts → App.d.ts} +0 -0
  761. /package/icons/{CloudStateError.d.ts → Bookmark.d.ts} +0 -0
  762. /package/icons/{CloudStateErrorRed.d.ts → Building.d.ts} +0 -0
  763. /package/icons/{CloudStateInProgress.d.ts → CallCenter.d.ts} +0 -0
  764. /package/icons/{CloudStateOnline.d.ts → ChartBarVert.d.ts} +0 -0
  765. /package/icons/{CloudStatePaused.d.ts → ChartPie.d.ts} +0 -0
  766. /package/icons/{CloudStatePending.d.ts → ChartTrend.d.ts} +0 -0
  767. /package/icons/{CloudStateSlowConnection.d.ts → Chat.d.ts} +0 -0
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0DD,MAAM,iDAA6C,CAAA,GAAA,qCAAK;IAItD,OAAO,mBAA2D,EAAQ;QACxE,IAAI,eACF,cAAc,IAAI,CAAA,GAAA,mCAAG,EAAE,KAAK,mBAC5B,cAAc,IAAI,CAAA,GAAA,mCAAG,EAAE,UAAU,qBACjC,WAAW,IAAI,CAAA,GAAA,mCAAG,EAAE,IAAI,iBACxB,aAAa,UACd,GAAG,oBAAoB,aAAa,IAAI,CAAC;QAC1C,IAAI,eAAe,IAAI,CAAC,WAAW,CAAE,WAAW,CAAC,KAAK;QAEtD,oDAAoD;QACpD,4EAA4E;QAC5E,IAAI,eAAe,KAAK,GAAG,CAAC,YAAY,KAAK,EAAE;QAC/C,IAAI,gBAAgB,OAAO,QAAQ,CAAC,YAAY,MAAM,IAClD,YAAY,MAAM,GAClB,KAAK,KAAK,CAAC,AAAC,YAAY,MAAM,GAAG,YAAY,KAAK,GAAI;QAE1D,uEAAuE;QACvE,IAAI,UAAU,KAAK,KAAK,CAAC,eAAgB,CAAA,YAAY,KAAK,GAAG,SAAS,KAAK,AAAD;QAC1E,IAAI,aAAa,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,YAAY;QAElD,8DAA8D;QAC9D,IAAI,QAAQ,eAAgB,SAAS,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG;QAEzD,sDAAsD;QACtD,IAAI,YAAY,KAAK,KAAK,CAAC,QAAQ;QACnC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E;QAAC,GAAG,KAAK;mBAAE;IAAS;IAE9G,IAAI,yBACF,gCAAC,CAAA,GAAA,+CAAmB;QAAE,QAAQ;QAAQ,eAAe;kBACnD,cAAA,gCAAC,CAAA,GAAA,iDAAsB,EAAE,QAAQ;YAAC,OAAO,CAAA,GAAA,uCAAW;sBAClD,cAAA,gCAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;gBAAC,OAAO;0BAC3B,cAAA,gCAAC,CAAA,GAAA,0CAAe;8BACd,cAAA,gCAAC,CAAA,GAAA,mCAAW;wBACV,KAAK;wBACJ,GAAG,UAAU;wBACd,QAAO;wBACP,mBAAmB,mBAAmB,cAAc,YAAY;wBAChE,cAAc;wBACd,qBAAqB;wBACrB,mBAAmB;wBACnB,OAAO;4BACL,GAAG,YAAY;4BACf,kGAAkG;4BAClG,wEAAwE;4BACxE,eAAe,kBAAkB,IAAI,kBAAkB,QAAQ,QAAQ,CAAC,MAAM,GAAG;4BACjF,eAAe,QAAQ,QAAQ,CAAC,MAAM;4BACtC,qBAAqB,kBAAkB,QAAQ,QAAQ,CAAC,MAAM;wBAChE;wBACA,WAAW,CAAA,cAAe,mBAAmB,qCAAe;gCAAC,GAAG,WAAW;gCAAE,WAAW,MAAM,YAAY,KAAK;4BAAS,GAAG;kCAC1H;;;;;;IAQb,iFAAiF;IACjF,yFAAyF;IACzF,IAAI,MAAM,eAAe,EACvB,qBACE,iCAAC;QAAI,KAAK;QAAQ,SAAS;;YACxB;YACA;;;IAKP,OAAO;AACT","sources":["packages/@react-spectrum/s2/src/CardView.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 {\n GridList as AriaGridList,\n ContextValue,\n GridLayoutOptions,\n GridListItem,\n GridListProps,\n UNSTABLE_Virtualizer\n} from 'react-aria-components';\nimport {CardContext, InternalCardViewContext} from './Card';\nimport {createContext, forwardRef, ReactElement, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, forwardRefType, Key, LayoutDelegate, LoadingState, Node} from '@react-types/shared';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ImageCoordinator} from './ImageCoordinator';\nimport {InvalidationContext, Layout, LayoutInfo, Rect, Size} from '@react-stately/virtualizer';\nimport {useActionBarContainer} from './ActionBar';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useLayoutEffect, useLoadMore, useResizeObserver} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style'>, UnsafeStyles {\n /**\n * The layout of the cards.\n * @default 'grid'\n */\n layout?: 'grid' | 'waterfall',\n /**\n * The size of the cards.\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the cards.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /**\n * The visual style of the cards.\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet',\n /**\n * How selection should be displayed.\n * @default 'checkbox'\n */\n selectionStyle?: 'checkbox' | 'highlight',\n /** The loading state of the CardView. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => void,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** Provides the ActionBar to render when cards are selected in the CardView. */\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement\n}\n\nclass FlexibleGridLayout<T extends object> extends Layout<Node<T>, GridLayoutOptions> {\n protected contentSize: Size = new Size();\n protected layoutInfos: Map<Key, LayoutInfo> = new Map();\n\n update(invalidationContext: InvalidationContext<GridLayoutOptions>): void {\n let {\n minItemSize = new Size(200, 200),\n maxItemSize = new Size(Infinity, Infinity),\n minSpace = new Size(18, 18),\n maxColumns = Infinity\n } = invalidationContext.layoutOptions || {};\n let visibleWidth = this.virtualizer!.visibleRect.width;\n\n // The max item width is always the entire viewport.\n // If the max item height is infinity, scale in proportion to the max width.\n let maxItemWidth = Math.min(maxItemSize.width, visibleWidth);\n let maxItemHeight = Number.isFinite(maxItemSize.height)\n ? maxItemSize.height\n : Math.floor((minItemSize.height / minItemSize.width) * maxItemWidth);\n\n // Compute the number of rows and columns needed to display the content\n let columns = Math.floor(visibleWidth / (minItemSize.width + minSpace.width));\n let numColumns = Math.max(1, Math.min(maxColumns, columns));\n\n // Compute the available width (minus the space between items)\n let width = visibleWidth - (minSpace.width * Math.max(0, numColumns));\n\n // Compute the item width based on the space available\n let itemWidth = Math.floor(width / numColumns);\n itemWidth = Math.max(minItemSize.width, Math.min(maxItemWidth, itemWidth));\n\n // Compute the item height, which is proportional to the item width\n let t = ((itemWidth - minItemSize.width) / Math.max(1, maxItemWidth - minItemSize.width));\n let itemHeight = minItemSize.height + Math.floor((maxItemHeight - minItemSize.height) * t);\n itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));\n\n // Compute the horizontal spacing and content height\n let horizontalSpacing = Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1));\n\n let rows = Math.ceil(this.virtualizer!.collection.size / numColumns);\n let iterator = this.virtualizer!.collection[Symbol.iterator]();\n let y = rows > 0 ? minSpace.height : 0;\n let newLayoutInfos = new Map();\n let skeleton: Node<T> | null = null;\n let skeletonCount = 0;\n for (let row = 0; row < rows; row++) {\n let maxHeight = 0;\n let rowLayoutInfos: LayoutInfo[] = [];\n for (let col = 0; col < numColumns; col++) {\n // Repeat skeleton until the end of the current row.\n let node = skeleton || iterator.next().value;\n if (!node) {\n break;\n }\n\n if (node.type === 'skeleton') {\n skeleton = node;\n }\n\n let key = skeleton ? `${skeleton.key}-${skeletonCount++}` : node.key;\n let content = skeleton ? {...skeleton} : node;\n let x = horizontalSpacing + col * (itemWidth + horizontalSpacing);\n let oldLayoutInfo = this.layoutInfos.get(key);\n let height = itemHeight;\n let estimatedSize = true;\n if (oldLayoutInfo) {\n height = oldLayoutInfo.rect.height;\n estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize || (oldLayoutInfo.content !== content);\n }\n\n let rect = new Rect(x, y, itemWidth, height);\n let layoutInfo = new LayoutInfo(node.type, key, rect);\n layoutInfo.estimatedSize = estimatedSize;\n layoutInfo.allowOverflow = true;\n layoutInfo.content = content;\n newLayoutInfos.set(key, layoutInfo);\n rowLayoutInfos.push(layoutInfo);\n\n maxHeight = Math.max(maxHeight, rect.height);\n }\n\n for (let layoutInfo of rowLayoutInfos) {\n layoutInfo.rect.height = maxHeight;\n }\n\n y += maxHeight + minSpace.height;\n\n // Keep adding skeleton rows until we fill the viewport\n if (skeleton && row === rows - 1 && y < this.virtualizer!.visibleRect.height) {\n rows++;\n }\n }\n\n this.layoutInfos = newLayoutInfos;\n this.contentSize = new Size(this.virtualizer!.visibleRect.width, y);\n }\n\n getLayoutInfo(key: Key): LayoutInfo {\n return this.layoutInfos.get(key)!;\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let layoutInfos: LayoutInfo[] = [];\n for (let layoutInfo of this.layoutInfos.values()) {\n if (layoutInfo.rect.intersects(rect) || this.virtualizer!.isPersistedKey(layoutInfo.key)) {\n layoutInfos.push(layoutInfo);\n }\n }\n return layoutInfos;\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n if (!size || !layoutInfo) {\n return false;\n }\n\n if (size.height !== layoutInfo.rect.height) {\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n newLayoutInfo.estimatedSize = false;\n this.layoutInfos.set(key, newLayoutInfo);\n return true;\n }\n\n return false;\n }\n}\n\nclass WaterfallLayoutInfo extends LayoutInfo {\n column = 0;\n\n copy(): WaterfallLayoutInfo {\n let res = super.copy() as WaterfallLayoutInfo;\n res.column = this.column;\n return res;\n }\n}\n\nclass WaterfallLayout<T extends object> extends Layout<Node<T>, GridLayoutOptions> implements LayoutDelegate {\n protected contentSize: Size = new Size();\n protected layoutInfos: Map<Key, WaterfallLayoutInfo> = new Map();\n protected numColumns = 0;\n\n update(invalidationContext: InvalidationContext<GridLayoutOptions>): void {\n let {\n minItemSize = new Size(200, 200),\n maxItemSize = new Size(Infinity, Infinity),\n minSpace = new Size(18, 18),\n maxColumns = Infinity\n } = invalidationContext.layoutOptions || {};\n let visibleWidth = this.virtualizer!.visibleRect.width;\n\n // The max item width is always the entire viewport.\n // If the max item height is infinity, scale in proportion to the max width.\n let maxItemWidth = Math.min(maxItemSize.width, visibleWidth);\n let maxItemHeight = Number.isFinite(maxItemSize.height)\n ? maxItemSize.height\n : Math.floor((minItemSize.height / minItemSize.width) * maxItemWidth);\n\n // Compute the number of rows and columns needed to display the content\n let columns = Math.floor(visibleWidth / (minItemSize.width + minSpace.width));\n let numColumns = Math.max(1, Math.min(maxColumns, columns));\n\n // Compute the available width (minus the space between items)\n let width = visibleWidth - (minSpace.width * Math.max(0, numColumns));\n\n // Compute the item width based on the space available\n let itemWidth = Math.floor(width / numColumns);\n itemWidth = Math.max(minItemSize.width, Math.min(maxItemWidth, itemWidth));\n\n // Compute the item height, which is proportional to the item width\n let t = ((itemWidth - minItemSize.width) / Math.max(1, maxItemWidth - minItemSize.width));\n let itemHeight = minItemSize.height + Math.floor((maxItemHeight - minItemSize.height) * t);\n itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));\n\n // Compute the horizontal spacing and content height\n let horizontalSpacing = Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1));\n\n // Setup an array of column heights\n let columnHeights = Array(numColumns).fill(minSpace.height);\n let newLayoutInfos = new Map();\n let addNode = (key: Key, node: Node<T>) => {\n let oldLayoutInfo = this.layoutInfos.get(key);\n let height = itemHeight;\n let estimatedSize = true;\n if (oldLayoutInfo) {\n height = oldLayoutInfo.rect.height;\n estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize || oldLayoutInfo.content !== node;\n }\n\n // Figure out which column to place the item in, and compute its position.\n // Preserve the previous column index so items don't jump around during resizing unless the number of columns changed.\n let prevColumn = numColumns === this.numColumns ? oldLayoutInfo?.column : undefined;\n let column = prevColumn ?? columnHeights.reduce((minIndex, h, i) => h < columnHeights[minIndex] ? i : minIndex, 0);\n let x = horizontalSpacing + column * (itemWidth + horizontalSpacing);\n let y = columnHeights[column];\n\n let rect = new Rect(x, y, itemWidth, height);\n let layoutInfo = new WaterfallLayoutInfo(node.type, key, rect);\n layoutInfo.estimatedSize = estimatedSize;\n layoutInfo.allowOverflow = true;\n layoutInfo.content = node;\n layoutInfo.column = column;\n newLayoutInfos.set(key, layoutInfo);\n\n columnHeights[column] += layoutInfo.rect.height + minSpace.height;\n };\n\n let skeletonCount = 0;\n for (let node of this.virtualizer!.collection) {\n if (node.type === 'skeleton') {\n // Add skeleton cards until every column has at least one, and we fill the viewport.\n let startingHeights = [...columnHeights];\n while (\n !columnHeights.every((h, i) => h !== startingHeights[i]) ||\n Math.min(...columnHeights) < this.virtualizer!.visibleRect.height\n ) {\n let key = `${node.key}-${skeletonCount++}`;\n let content = this.layoutInfos.get(key)?.content || {...node};\n addNode(key, content);\n }\n break;\n } else {\n addNode(node.key, node);\n }\n }\n\n // Reset all columns to the maximum for the next section\n let maxHeight = Math.max(...columnHeights);\n this.contentSize = new Size(this.virtualizer!.visibleRect.width, maxHeight);\n this.layoutInfos = newLayoutInfos;\n this.numColumns = numColumns;\n }\n\n getLayoutInfo(key: Key): LayoutInfo {\n return this.layoutInfos.get(key)!;\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let layoutInfos: LayoutInfo[] = [];\n for (let layoutInfo of this.layoutInfos.values()) {\n if (layoutInfo.rect.intersects(rect) || this.virtualizer!.isPersistedKey(layoutInfo.key)) {\n layoutInfos.push(layoutInfo);\n }\n }\n return layoutInfos;\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n if (!size || !layoutInfo) {\n return false;\n }\n\n if (size.height !== layoutInfo.rect.height) {\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n newLayoutInfo.estimatedSize = false;\n this.layoutInfos.set(key, newLayoutInfo);\n return true;\n }\n\n return false;\n }\n\n // Override keyboard navigation to work spacially.\n getKeyRightOf(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = new Rect(layoutInfo.rect.maxX, layoutInfo.rect.y, this.virtualizer!.visibleRect.maxX - layoutInfo.rect.maxX, layoutInfo.rect.height);\n let layoutInfos = this.getVisibleLayoutInfos(rect);\n let bestKey: Key | null = null;\n let bestDistance = Infinity;\n for (let candidate of layoutInfos) {\n if (candidate.key === key) {\n continue;\n }\n\n // Find the closest item in the x direction with the most overlap in the y direction.\n let deltaX = candidate.rect.x - rect.x;\n let overlapY = Math.min(candidate.rect.maxY, rect.maxY) - Math.max(candidate.rect.y, rect.y);\n let distance = deltaX - overlapY;\n if (distance < bestDistance) {\n bestDistance = distance;\n bestKey = candidate.key;\n }\n }\n\n return bestKey;\n }\n\n getKeyLeftOf(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = new Rect(0, layoutInfo.rect.y, layoutInfo.rect.x, layoutInfo.rect.height);\n let layoutInfos = this.getVisibleLayoutInfos(rect);\n let bestKey: Key | null = null;\n let bestDistance = Infinity;\n for (let candidate of layoutInfos) {\n if (candidate.key === key) {\n continue;\n }\n\n // Find the closest item in the x direction with the most overlap in the y direction.\n let deltaX = rect.maxX - candidate.rect.maxX;\n let overlapY = Math.min(candidate.rect.maxY, rect.maxY) - Math.max(candidate.rect.y, rect.y);\n let distance = deltaX - overlapY;\n if (distance < bestDistance) {\n bestDistance = distance;\n bestKey = candidate.key;\n }\n }\n\n return bestKey;\n }\n\n // This overrides the default behavior of shift selection to work spacially\n // rather than following the order of the items in the collection (which may appear unpredictable).\n getKeyRange(from: Key, to: Key): Key[] {\n let fromLayoutInfo = this.getLayoutInfo(from);\n let toLayoutInfo = this.getLayoutInfo(to);\n if (!fromLayoutInfo || !toLayoutInfo) {\n return [];\n }\n\n // Find items where half of the area intersects the rectangle\n // formed from the first item to the last item in the range.\n let rect = fromLayoutInfo.rect.union(toLayoutInfo.rect);\n let keys: Key[] = [];\n for (let layoutInfo of this.layoutInfos.values()) {\n if (rect.intersection(layoutInfo.rect).area > layoutInfo.rect.area / 2) {\n keys.push(layoutInfo.key);\n }\n }\n return keys;\n }\n}\n\nconst layoutOptions = {\n XS: {\n compact: {\n minSpace: new Size(6, 6),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n regular: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n spacious: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n }\n },\n S: {\n compact: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n regular: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n spacious: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n }\n },\n M: {\n compact: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n regular: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n spacious: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n }\n },\n L: {\n compact: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n regular: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n spacious: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n }\n },\n XL: {\n compact: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n regular: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n spacious: {\n minSpace: new Size(28, 28),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n }\n }\n};\n\nconst SIZES = ['XS', 'S', 'M', 'L', 'XL'] as const;\n\nconst cardViewStyles = style({\n overflowY: {\n default: 'auto',\n isLoading: 'hidden'\n },\n display: {\n isEmpty: 'flex'\n },\n boxSizing: 'border-box',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n ...focusRing(),\n outlineStyle: {\n default: 'none',\n isEmpty: {\n isFocusVisible: 'solid'\n }\n },\n outlineOffset: -2\n}, getAllowedOverrides({height: true}));\n\nexport const CardViewContext = createContext<ContextValue<CardViewProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nexport const CardView = /*#__PURE__*/ (forwardRef as forwardRefType)(function CardView<T extends object>(props: CardViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CardViewContext);\n let {children, layout: layoutName = 'grid', size: sizeProp = 'M', density = 'regular', variant = 'primary', selectionStyle = 'checkbox', UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let innerRef = useRef(null);\n let scrollRef = props.renderActionBar ? innerRef : domRef;\n let layout = useMemo(() => {\n return layoutName === 'waterfall' ? new WaterfallLayout() : new FlexibleGridLayout();\n }, [layoutName]);\n\n // This calculates the maximum t-shirt size where at least two columns fit in the available width.\n let [maxSizeIndex, setMaxSizeIndex] = useState(SIZES.length - 1);\n let updateSize = useEffectEvent(() => {\n let w = scrollRef.current?.clientWidth ?? 0;\n let i = SIZES.length - 1;\n while (i > 0) {\n let opts = layoutOptions[SIZES[i]][density];\n if (w >= opts.minItemSize.width * 2 + opts.minSpace.width * 3) {\n break;\n }\n i--;\n }\n setMaxSizeIndex(i);\n });\n\n useResizeObserver({\n ref: scrollRef,\n box: 'border-box',\n onResize: updateSize\n });\n\n useLayoutEffect(() => {\n updateSize();\n }, [updateSize]);\n\n // The actual rendered t-shirt size is the minimum between the size prop and the maximum possible size.\n let size = SIZES[Math.min(maxSizeIndex, SIZES.indexOf(sizeProp))];\n let options = layoutOptions[size][density];\n\n useLoadMore({\n isLoading: props.loadingState !== 'idle' && props.loadingState !== 'error',\n items: props.items, // TODO: ideally this would be the collection. items won't exist for static collections, or those using <Collection>\n onLoadMore: props.onLoadMore\n }, scrollRef);\n\n let ctx = useMemo(() => ({size, variant}), [size, variant]);\n\n let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});\n\n let cardView = (\n <UNSTABLE_Virtualizer layout={layout} layoutOptions={options}>\n <InternalCardViewContext.Provider value={GridListItem}>\n <CardContext.Provider value={ctx}>\n <ImageCoordinator>\n <AriaGridList\n ref={scrollRef}\n {...otherProps}\n layout=\"grid\"\n selectionBehavior={selectionStyle === 'highlight' ? 'replace' : 'toggle'}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={undefined}\n onSelectionChange={onSelectionChange}\n style={{\n ...UNSAFE_style,\n // Add padding at the bottom when the action bar is visible so users can scroll to the last items.\n // Also add scroll padding so keyboard navigating preserves the padding.\n paddingBottom: actionBarHeight > 0 ? actionBarHeight + options.minSpace.height : 0,\n scrollPadding: options.minSpace.height,\n scrollPaddingBottom: actionBarHeight + options.minSpace.height\n }}\n className={renderProps => UNSAFE_className + cardViewStyles({...renderProps, isLoading: props.loadingState === 'loading'}, styles)}>\n {children}\n </AriaGridList>\n </ImageCoordinator>\n </CardContext.Provider>\n </InternalCardViewContext.Provider>\n </UNSTABLE_Virtualizer>\n );\n\n // Add extra wrapper if there is an action bar so we can position relative to it.\n // ActionBar cannot be inside the GridList due to ARIA and focus management requirements.\n if (props.renderActionBar) {\n return (\n <div ref={domRef} className={style({position: 'relative', overflow: 'clip', size: 'fit'})}>\n {cardView}\n {actionBar}\n </div>\n );\n }\n\n return cardView;\n});\n"],"names":[],"version":3,"file":"CardView.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA2DD,MAAM,sCAAgB;IACpB,IAAI;QACF,SAAS;YACP,UAAU,IAAI,CAAA,GAAA,+BAAG,EAAE,GAAG;YACtB,aAAa,IAAI,CAAA,GAAA,+BAAG,EAAE,KAAK;YAC3B,aAAa,IAAI,CAAA,GAAA,+BAAG,EAAE,KAAK;QAC7B;QACA,SAAS;YACP,UAAU,IAAI,CAAA,GAAA,+BAAG,EAAE,GAAG;YACtB,aAAa,IAAI,CAAA,GAAA,+BAAG,EAAE,KAAK;YAC3B,aAAa,IAAI,CAAA,GAAA,+BAAG,EAAE,KAAK;QAC7B;QACA,UAAU;YACR,UAAU,IAAI,CAAA,GAAA,+BAAG,EAAE,IAAI;YACvB,aAAa,IAAI,CAAA,GAAA,+BAAG,EAAE,KAAK;YAC3B,aAAa,IAAI,CAAA,GAAA,+BAAG,EAAE,KAAK;QAC7B;IACF;IACA,GAAG;QACD,SAAS;YACP,UAAU,IAAI,CAAA,GAAA,+BAAG,EAAE,GAAG;YACtB,aAAa,IAAI,CAAA,GAAA,+BAA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licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n GridList as AriaGridList,\n ContextValue,\n GridLayout,\n GridListItem,\n GridListProps,\n Size,\n Virtualizer,\n WaterfallLayout\n} from 'react-aria-components';\nimport {CardContext, InternalCardViewContext} from './Card';\nimport {createContext, forwardRef, ReactElement, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, forwardRefType, Key, LoadingState} from '@react-types/shared';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ImageCoordinator} from './ImageCoordinator';\nimport {useActionBarContainer} from './ActionBar';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useLayoutEffect, useLoadMore, useResizeObserver} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style'>, UnsafeStyles {\n /**\n * The layout of the cards.\n * @default 'grid'\n */\n layout?: 'grid' | 'waterfall',\n /**\n * The size of the cards.\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the cards.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /**\n * The visual style of the cards.\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet',\n /**\n * How selection should be displayed.\n * @default 'checkbox'\n */\n selectionStyle?: 'checkbox' | 'highlight',\n /** The loading state of the CardView. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => void,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** Provides the ActionBar to render when cards are selected in the CardView. */\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement\n}\n\nconst layoutOptions = {\n XS: {\n compact: {\n minSpace: new Size(6, 6),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n regular: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n spacious: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n }\n },\n S: {\n compact: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n regular: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n spacious: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n }\n },\n M: {\n compact: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n regular: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n spacious: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n }\n },\n L: {\n compact: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n regular: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n spacious: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n }\n },\n XL: {\n compact: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n regular: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n spacious: {\n minSpace: new Size(28, 28),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n }\n }\n};\n\nconst SIZES = ['XS', 'S', 'M', 'L', 'XL'] as const;\n\nconst cardViewStyles = style({\n overflowY: {\n default: 'auto',\n isLoading: 'hidden'\n },\n display: {\n isEmpty: 'flex'\n },\n boxSizing: 'border-box',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n ...focusRing(),\n outlineStyle: {\n default: 'none',\n isEmpty: {\n isFocusVisible: 'solid'\n }\n },\n outlineOffset: -2\n}, getAllowedOverrides({height: true}));\n\nconst wrapperStyles = style({\n position: 'relative', \n overflow: 'clip', \n size: 'fit'\n}, getAllowedOverrides({height: true}));\n\nexport const CardViewContext = createContext<ContextValue<Partial<CardViewProps<any>>, DOMRefValue<HTMLDivElement>>>(null);\n\nexport const CardView = /*#__PURE__*/ (forwardRef as forwardRefType)(function CardView<T extends object>(props: CardViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CardViewContext);\n let {children, layout: layoutName = 'grid', size: sizeProp = 'M', density = 'regular', variant = 'primary', selectionStyle = 'checkbox', UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let innerRef = useRef(null);\n let scrollRef = props.renderActionBar ? innerRef : domRef;\n\n // This calculates the maximum t-shirt size where at least two columns fit in the available width.\n let [maxSizeIndex, setMaxSizeIndex] = useState(SIZES.length - 1);\n let updateSize = useEffectEvent(() => {\n let w = scrollRef.current?.clientWidth ?? 0;\n let i = SIZES.length - 1;\n while (i > 0) {\n let opts = layoutOptions[SIZES[i]][density];\n if (w >= opts.minItemSize.width * 2 + opts.minSpace.width * 3) {\n break;\n }\n i--;\n }\n setMaxSizeIndex(i);\n });\n\n useResizeObserver({\n ref: scrollRef,\n box: 'border-box',\n onResize: updateSize\n });\n\n useLayoutEffect(() => {\n updateSize();\n }, [updateSize]);\n\n // The actual rendered t-shirt size is the minimum between the size prop and the maximum possible size.\n let size = SIZES[Math.min(maxSizeIndex, SIZES.indexOf(sizeProp))];\n let layout = layoutName === 'waterfall' ? WaterfallLayout : GridLayout;\n let options = layoutOptions[size][density];\n\n useLoadMore({\n isLoading: props.loadingState !== 'idle' && props.loadingState !== 'error',\n items: props.items, // TODO: ideally this would be the collection. items won't exist for static collections, or those using <Collection>\n onLoadMore: props.onLoadMore\n }, scrollRef);\n\n let ctx = useMemo(() => ({size, variant}), [size, variant]);\n\n let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});\n\n let cardView = (\n <Virtualizer layout={layout} layoutOptions={options}>\n <InternalCardViewContext.Provider value={GridListItem}>\n <CardContext.Provider value={ctx}>\n <ImageCoordinator>\n <AriaGridList\n ref={scrollRef}\n {...otherProps}\n layout=\"grid\"\n selectionBehavior={selectionStyle === 'highlight' ? 'replace' : 'toggle'}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={undefined}\n onSelectionChange={onSelectionChange}\n style={{\n ...(!props.renderActionBar ? UNSAFE_style : {}),\n // Add padding at the bottom when the action bar is visible so users can scroll to the last items.\n // Also add scroll padding so keyboard navigating preserves the padding.\n paddingBottom: actionBarHeight > 0 ? actionBarHeight + options.minSpace.height : 0,\n scrollPadding: options.minSpace.height,\n scrollPaddingBottom: actionBarHeight + options.minSpace.height\n }}\n className={renderProps => (!props.renderActionBar ? UNSAFE_className : '') + cardViewStyles({...renderProps, isLoading: props.loadingState === 'loading'}, !props.renderActionBar ? styles : undefined)}>\n {children}\n </AriaGridList>\n </ImageCoordinator>\n </CardContext.Provider>\n </InternalCardViewContext.Provider>\n </Virtualizer>\n );\n\n // Add extra wrapper if there is an action bar so we can position relative to it.\n // ActionBar cannot be inside the GridList due to ARIA and focus management requirements.\n if (props.renderActionBar) {\n return (\n <div ref={domRef} className={UNSAFE_className + wrapperStyles(null, styles)} style={UNSAFE_style}>\n {cardView}\n {actionBar}\n </div>\n );\n }\n\n return cardView;\n});\n"],"names":[],"version":3,"file":"CardView.cjs.map"}
package/dist/CardView.css CHANGED
@@ -68,7 +68,7 @@
68
68
  }
69
69
  }
70
70
 
71
- @layer _.b, UNSAFE_overrides;
71
+ @layer _.b;
72
72
 
73
73
  @layer _.b.a {
74
74
  @media (forced-colors: active) {
@@ -77,8 +77,4 @@
77
77
  }
78
78
  }
79
79
  }
80
-
81
- .\.:not(#a#b) {
82
- all: revert-layer;
83
- }
84
80
  /*# sourceMappingURL=CardView.css.map */
@@ -1 +1 @@
1
- {"mappings":"AC+fuB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2GY;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA3GZ;;AAAA;EAAA;IAAA;;;;;;AA2GY","sources":["bcfa03266ec99ed3","packages/@react-spectrum/s2/src/CardView.tsx"],"sourcesContent":["@import \"b9a56ec855293cb6\";\n@import \"879fd470e85635cf\";\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 {\n GridList as AriaGridList,\n ContextValue,\n GridLayoutOptions,\n GridListItem,\n GridListProps,\n UNSTABLE_Virtualizer\n} from 'react-aria-components';\nimport {CardContext, InternalCardViewContext} from './Card';\nimport {createContext, forwardRef, ReactElement, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, forwardRefType, Key, LayoutDelegate, LoadingState, Node} from '@react-types/shared';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ImageCoordinator} from './ImageCoordinator';\nimport {InvalidationContext, Layout, LayoutInfo, Rect, Size} from '@react-stately/virtualizer';\nimport {useActionBarContainer} from './ActionBar';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useLayoutEffect, useLoadMore, useResizeObserver} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style'>, UnsafeStyles {\n /**\n * The layout of the cards.\n * @default 'grid'\n */\n layout?: 'grid' | 'waterfall',\n /**\n * The size of the cards.\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the cards.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /**\n * The visual style of the cards.\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet',\n /**\n * How selection should be displayed.\n * @default 'checkbox'\n */\n selectionStyle?: 'checkbox' | 'highlight',\n /** The loading state of the CardView. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => void,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** Provides the ActionBar to render when cards are selected in the CardView. */\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement\n}\n\nclass FlexibleGridLayout<T extends object> extends Layout<Node<T>, GridLayoutOptions> {\n protected contentSize: Size = new Size();\n protected layoutInfos: Map<Key, LayoutInfo> = new Map();\n\n update(invalidationContext: InvalidationContext<GridLayoutOptions>): void {\n let {\n minItemSize = new Size(200, 200),\n maxItemSize = new Size(Infinity, Infinity),\n minSpace = new Size(18, 18),\n maxColumns = Infinity\n } = invalidationContext.layoutOptions || {};\n let visibleWidth = this.virtualizer!.visibleRect.width;\n\n // The max item width is always the entire viewport.\n // If the max item height is infinity, scale in proportion to the max width.\n let maxItemWidth = Math.min(maxItemSize.width, visibleWidth);\n let maxItemHeight = Number.isFinite(maxItemSize.height)\n ? maxItemSize.height\n : Math.floor((minItemSize.height / minItemSize.width) * maxItemWidth);\n\n // Compute the number of rows and columns needed to display the content\n let columns = Math.floor(visibleWidth / (minItemSize.width + minSpace.width));\n let numColumns = Math.max(1, Math.min(maxColumns, columns));\n\n // Compute the available width (minus the space between items)\n let width = visibleWidth - (minSpace.width * Math.max(0, numColumns));\n\n // Compute the item width based on the space available\n let itemWidth = Math.floor(width / numColumns);\n itemWidth = Math.max(minItemSize.width, Math.min(maxItemWidth, itemWidth));\n\n // Compute the item height, which is proportional to the item width\n let t = ((itemWidth - minItemSize.width) / Math.max(1, maxItemWidth - minItemSize.width));\n let itemHeight = minItemSize.height + Math.floor((maxItemHeight - minItemSize.height) * t);\n itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));\n\n // Compute the horizontal spacing and content height\n let horizontalSpacing = Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1));\n\n let rows = Math.ceil(this.virtualizer!.collection.size / numColumns);\n let iterator = this.virtualizer!.collection[Symbol.iterator]();\n let y = rows > 0 ? minSpace.height : 0;\n let newLayoutInfos = new Map();\n let skeleton: Node<T> | null = null;\n let skeletonCount = 0;\n for (let row = 0; row < rows; row++) {\n let maxHeight = 0;\n let rowLayoutInfos: LayoutInfo[] = [];\n for (let col = 0; col < numColumns; col++) {\n // Repeat skeleton until the end of the current row.\n let node = skeleton || iterator.next().value;\n if (!node) {\n break;\n }\n\n if (node.type === 'skeleton') {\n skeleton = node;\n }\n\n let key = skeleton ? `${skeleton.key}-${skeletonCount++}` : node.key;\n let content = skeleton ? {...skeleton} : node;\n let x = horizontalSpacing + col * (itemWidth + horizontalSpacing);\n let oldLayoutInfo = this.layoutInfos.get(key);\n let height = itemHeight;\n let estimatedSize = true;\n if (oldLayoutInfo) {\n height = oldLayoutInfo.rect.height;\n estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize || (oldLayoutInfo.content !== content);\n }\n\n let rect = new Rect(x, y, itemWidth, height);\n let layoutInfo = new LayoutInfo(node.type, key, rect);\n layoutInfo.estimatedSize = estimatedSize;\n layoutInfo.allowOverflow = true;\n layoutInfo.content = content;\n newLayoutInfos.set(key, layoutInfo);\n rowLayoutInfos.push(layoutInfo);\n\n maxHeight = Math.max(maxHeight, rect.height);\n }\n\n for (let layoutInfo of rowLayoutInfos) {\n layoutInfo.rect.height = maxHeight;\n }\n\n y += maxHeight + minSpace.height;\n\n // Keep adding skeleton rows until we fill the viewport\n if (skeleton && row === rows - 1 && y < this.virtualizer!.visibleRect.height) {\n rows++;\n }\n }\n\n this.layoutInfos = newLayoutInfos;\n this.contentSize = new Size(this.virtualizer!.visibleRect.width, y);\n }\n\n getLayoutInfo(key: Key): LayoutInfo {\n return this.layoutInfos.get(key)!;\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let layoutInfos: LayoutInfo[] = [];\n for (let layoutInfo of this.layoutInfos.values()) {\n if (layoutInfo.rect.intersects(rect) || this.virtualizer!.isPersistedKey(layoutInfo.key)) {\n layoutInfos.push(layoutInfo);\n }\n }\n return layoutInfos;\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n if (!size || !layoutInfo) {\n return false;\n }\n\n if (size.height !== layoutInfo.rect.height) {\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n newLayoutInfo.estimatedSize = false;\n this.layoutInfos.set(key, newLayoutInfo);\n return true;\n }\n\n return false;\n }\n}\n\nclass WaterfallLayoutInfo extends LayoutInfo {\n column = 0;\n\n copy(): WaterfallLayoutInfo {\n let res = super.copy() as WaterfallLayoutInfo;\n res.column = this.column;\n return res;\n }\n}\n\nclass WaterfallLayout<T extends object> extends Layout<Node<T>, GridLayoutOptions> implements LayoutDelegate {\n protected contentSize: Size = new Size();\n protected layoutInfos: Map<Key, WaterfallLayoutInfo> = new Map();\n protected numColumns = 0;\n\n update(invalidationContext: InvalidationContext<GridLayoutOptions>): void {\n let {\n minItemSize = new Size(200, 200),\n maxItemSize = new Size(Infinity, Infinity),\n minSpace = new Size(18, 18),\n maxColumns = Infinity\n } = invalidationContext.layoutOptions || {};\n let visibleWidth = this.virtualizer!.visibleRect.width;\n\n // The max item width is always the entire viewport.\n // If the max item height is infinity, scale in proportion to the max width.\n let maxItemWidth = Math.min(maxItemSize.width, visibleWidth);\n let maxItemHeight = Number.isFinite(maxItemSize.height)\n ? maxItemSize.height\n : Math.floor((minItemSize.height / minItemSize.width) * maxItemWidth);\n\n // Compute the number of rows and columns needed to display the content\n let columns = Math.floor(visibleWidth / (minItemSize.width + minSpace.width));\n let numColumns = Math.max(1, Math.min(maxColumns, columns));\n\n // Compute the available width (minus the space between items)\n let width = visibleWidth - (minSpace.width * Math.max(0, numColumns));\n\n // Compute the item width based on the space available\n let itemWidth = Math.floor(width / numColumns);\n itemWidth = Math.max(minItemSize.width, Math.min(maxItemWidth, itemWidth));\n\n // Compute the item height, which is proportional to the item width\n let t = ((itemWidth - minItemSize.width) / Math.max(1, maxItemWidth - minItemSize.width));\n let itemHeight = minItemSize.height + Math.floor((maxItemHeight - minItemSize.height) * t);\n itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));\n\n // Compute the horizontal spacing and content height\n let horizontalSpacing = Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1));\n\n // Setup an array of column heights\n let columnHeights = Array(numColumns).fill(minSpace.height);\n let newLayoutInfos = new Map();\n let addNode = (key: Key, node: Node<T>) => {\n let oldLayoutInfo = this.layoutInfos.get(key);\n let height = itemHeight;\n let estimatedSize = true;\n if (oldLayoutInfo) {\n height = oldLayoutInfo.rect.height;\n estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize || oldLayoutInfo.content !== node;\n }\n\n // Figure out which column to place the item in, and compute its position.\n // Preserve the previous column index so items don't jump around during resizing unless the number of columns changed.\n let prevColumn = numColumns === this.numColumns ? oldLayoutInfo?.column : undefined;\n let column = prevColumn ?? columnHeights.reduce((minIndex, h, i) => h < columnHeights[minIndex] ? i : minIndex, 0);\n let x = horizontalSpacing + column * (itemWidth + horizontalSpacing);\n let y = columnHeights[column];\n\n let rect = new Rect(x, y, itemWidth, height);\n let layoutInfo = new WaterfallLayoutInfo(node.type, key, rect);\n layoutInfo.estimatedSize = estimatedSize;\n layoutInfo.allowOverflow = true;\n layoutInfo.content = node;\n layoutInfo.column = column;\n newLayoutInfos.set(key, layoutInfo);\n\n columnHeights[column] += layoutInfo.rect.height + minSpace.height;\n };\n\n let skeletonCount = 0;\n for (let node of this.virtualizer!.collection) {\n if (node.type === 'skeleton') {\n // Add skeleton cards until every column has at least one, and we fill the viewport.\n let startingHeights = [...columnHeights];\n while (\n !columnHeights.every((h, i) => h !== startingHeights[i]) ||\n Math.min(...columnHeights) < this.virtualizer!.visibleRect.height\n ) {\n let key = `${node.key}-${skeletonCount++}`;\n let content = this.layoutInfos.get(key)?.content || {...node};\n addNode(key, content);\n }\n break;\n } else {\n addNode(node.key, node);\n }\n }\n\n // Reset all columns to the maximum for the next section\n let maxHeight = Math.max(...columnHeights);\n this.contentSize = new Size(this.virtualizer!.visibleRect.width, maxHeight);\n this.layoutInfos = newLayoutInfos;\n this.numColumns = numColumns;\n }\n\n getLayoutInfo(key: Key): LayoutInfo {\n return this.layoutInfos.get(key)!;\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let layoutInfos: LayoutInfo[] = [];\n for (let layoutInfo of this.layoutInfos.values()) {\n if (layoutInfo.rect.intersects(rect) || this.virtualizer!.isPersistedKey(layoutInfo.key)) {\n layoutInfos.push(layoutInfo);\n }\n }\n return layoutInfos;\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n if (!size || !layoutInfo) {\n return false;\n }\n\n if (size.height !== layoutInfo.rect.height) {\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n newLayoutInfo.estimatedSize = false;\n this.layoutInfos.set(key, newLayoutInfo);\n return true;\n }\n\n return false;\n }\n\n // Override keyboard navigation to work spacially.\n getKeyRightOf(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = new Rect(layoutInfo.rect.maxX, layoutInfo.rect.y, this.virtualizer!.visibleRect.maxX - layoutInfo.rect.maxX, layoutInfo.rect.height);\n let layoutInfos = this.getVisibleLayoutInfos(rect);\n let bestKey: Key | null = null;\n let bestDistance = Infinity;\n for (let candidate of layoutInfos) {\n if (candidate.key === key) {\n continue;\n }\n\n // Find the closest item in the x direction with the most overlap in the y direction.\n let deltaX = candidate.rect.x - rect.x;\n let overlapY = Math.min(candidate.rect.maxY, rect.maxY) - Math.max(candidate.rect.y, rect.y);\n let distance = deltaX - overlapY;\n if (distance < bestDistance) {\n bestDistance = distance;\n bestKey = candidate.key;\n }\n }\n\n return bestKey;\n }\n\n getKeyLeftOf(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = new Rect(0, layoutInfo.rect.y, layoutInfo.rect.x, layoutInfo.rect.height);\n let layoutInfos = this.getVisibleLayoutInfos(rect);\n let bestKey: Key | null = null;\n let bestDistance = Infinity;\n for (let candidate of layoutInfos) {\n if (candidate.key === key) {\n continue;\n }\n\n // Find the closest item in the x direction with the most overlap in the y direction.\n let deltaX = rect.maxX - candidate.rect.maxX;\n let overlapY = Math.min(candidate.rect.maxY, rect.maxY) - Math.max(candidate.rect.y, rect.y);\n let distance = deltaX - overlapY;\n if (distance < bestDistance) {\n bestDistance = distance;\n bestKey = candidate.key;\n }\n }\n\n return bestKey;\n }\n\n // This overrides the default behavior of shift selection to work spacially\n // rather than following the order of the items in the collection (which may appear unpredictable).\n getKeyRange(from: Key, to: Key): Key[] {\n let fromLayoutInfo = this.getLayoutInfo(from);\n let toLayoutInfo = this.getLayoutInfo(to);\n if (!fromLayoutInfo || !toLayoutInfo) {\n return [];\n }\n\n // Find items where half of the area intersects the rectangle\n // formed from the first item to the last item in the range.\n let rect = fromLayoutInfo.rect.union(toLayoutInfo.rect);\n let keys: Key[] = [];\n for (let layoutInfo of this.layoutInfos.values()) {\n if (rect.intersection(layoutInfo.rect).area > layoutInfo.rect.area / 2) {\n keys.push(layoutInfo.key);\n }\n }\n return keys;\n }\n}\n\nconst layoutOptions = {\n XS: {\n compact: {\n minSpace: new Size(6, 6),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n regular: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n spacious: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n }\n },\n S: {\n compact: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n regular: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n spacious: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n }\n },\n M: {\n compact: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n regular: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n spacious: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n }\n },\n L: {\n compact: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n regular: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n spacious: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n }\n },\n XL: {\n compact: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n regular: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n spacious: {\n minSpace: new Size(28, 28),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n }\n }\n};\n\nconst SIZES = ['XS', 'S', 'M', 'L', 'XL'] as const;\n\nconst cardViewStyles = style({\n overflowY: {\n default: 'auto',\n isLoading: 'hidden'\n },\n display: {\n isEmpty: 'flex'\n },\n boxSizing: 'border-box',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n ...focusRing(),\n outlineStyle: {\n default: 'none',\n isEmpty: {\n isFocusVisible: 'solid'\n }\n },\n outlineOffset: -2\n}, getAllowedOverrides({height: true}));\n\nexport const CardViewContext = createContext<ContextValue<CardViewProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nexport const CardView = /*#__PURE__*/ (forwardRef as forwardRefType)(function CardView<T extends object>(props: CardViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CardViewContext);\n let {children, layout: layoutName = 'grid', size: sizeProp = 'M', density = 'regular', variant = 'primary', selectionStyle = 'checkbox', UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let innerRef = useRef(null);\n let scrollRef = props.renderActionBar ? innerRef : domRef;\n let layout = useMemo(() => {\n return layoutName === 'waterfall' ? new WaterfallLayout() : new FlexibleGridLayout();\n }, [layoutName]);\n\n // This calculates the maximum t-shirt size where at least two columns fit in the available width.\n let [maxSizeIndex, setMaxSizeIndex] = useState(SIZES.length - 1);\n let updateSize = useEffectEvent(() => {\n let w = scrollRef.current?.clientWidth ?? 0;\n let i = SIZES.length - 1;\n while (i > 0) {\n let opts = layoutOptions[SIZES[i]][density];\n if (w >= opts.minItemSize.width * 2 + opts.minSpace.width * 3) {\n break;\n }\n i--;\n }\n setMaxSizeIndex(i);\n });\n\n useResizeObserver({\n ref: scrollRef,\n box: 'border-box',\n onResize: updateSize\n });\n\n useLayoutEffect(() => {\n updateSize();\n }, [updateSize]);\n\n // The actual rendered t-shirt size is the minimum between the size prop and the maximum possible size.\n let size = SIZES[Math.min(maxSizeIndex, SIZES.indexOf(sizeProp))];\n let options = layoutOptions[size][density];\n\n useLoadMore({\n isLoading: props.loadingState !== 'idle' && props.loadingState !== 'error',\n items: props.items, // TODO: ideally this would be the collection. items won't exist for static collections, or those using <Collection>\n onLoadMore: props.onLoadMore\n }, scrollRef);\n\n let ctx = useMemo(() => ({size, variant}), [size, variant]);\n\n let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});\n\n let cardView = (\n <UNSTABLE_Virtualizer layout={layout} layoutOptions={options}>\n <InternalCardViewContext.Provider value={GridListItem}>\n <CardContext.Provider value={ctx}>\n <ImageCoordinator>\n <AriaGridList\n ref={scrollRef}\n {...otherProps}\n layout=\"grid\"\n selectionBehavior={selectionStyle === 'highlight' ? 'replace' : 'toggle'}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={undefined}\n onSelectionChange={onSelectionChange}\n style={{\n ...UNSAFE_style,\n // Add padding at the bottom when the action bar is visible so users can scroll to the last items.\n // Also add scroll padding so keyboard navigating preserves the padding.\n paddingBottom: actionBarHeight > 0 ? actionBarHeight + options.minSpace.height : 0,\n scrollPadding: options.minSpace.height,\n scrollPaddingBottom: actionBarHeight + options.minSpace.height\n }}\n className={renderProps => UNSAFE_className + cardViewStyles({...renderProps, isLoading: props.loadingState === 'loading'}, styles)}>\n {children}\n </AriaGridList>\n </ImageCoordinator>\n </CardContext.Provider>\n </InternalCardViewContext.Provider>\n </UNSTABLE_Virtualizer>\n );\n\n // Add extra wrapper if there is an action bar so we can position relative to it.\n // ActionBar cannot be inside the GridList due to ARIA and focus management requirements.\n if (props.renderActionBar) {\n return (\n <div ref={domRef} className={style({position: 'relative', overflow: 'clip', size: 'fit'})}>\n {cardView}\n {actionBar}\n </div>\n );\n }\n\n return cardView;\n});\n"],"names":[],"version":3,"file":"CardView.css.map"}
1
+ {"mappings":"AC+JuB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAsBD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAtBC;;AAAA;EAAA;IAAA","sources":["bcfa03266ec99ed3","packages/@react-spectrum/s2/src/CardView.tsx"],"sourcesContent":["@import \"b9a56ec855293cb6\";\n@import \"879fd470e85635cf\";\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 {\n GridList as AriaGridList,\n ContextValue,\n GridLayout,\n GridListItem,\n GridListProps,\n Size,\n Virtualizer,\n WaterfallLayout\n} from 'react-aria-components';\nimport {CardContext, InternalCardViewContext} from './Card';\nimport {createContext, forwardRef, ReactElement, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, forwardRefType, Key, LoadingState} from '@react-types/shared';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ImageCoordinator} from './ImageCoordinator';\nimport {useActionBarContainer} from './ActionBar';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useLayoutEffect, useLoadMore, useResizeObserver} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style'>, UnsafeStyles {\n /**\n * The layout of the cards.\n * @default 'grid'\n */\n layout?: 'grid' | 'waterfall',\n /**\n * The size of the cards.\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the cards.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /**\n * The visual style of the cards.\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet',\n /**\n * How selection should be displayed.\n * @default 'checkbox'\n */\n selectionStyle?: 'checkbox' | 'highlight',\n /** The loading state of the CardView. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => void,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** Provides the ActionBar to render when cards are selected in the CardView. */\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement\n}\n\nconst layoutOptions = {\n XS: {\n compact: {\n minSpace: new Size(6, 6),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n regular: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n },\n spacious: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(100, 100),\n maxItemSize: new Size(140, 140)\n }\n },\n S: {\n compact: {\n minSpace: new Size(8, 8),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n regular: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n },\n spacious: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(150, 150),\n maxItemSize: new Size(210, 210)\n }\n },\n M: {\n compact: {\n minSpace: new Size(12, 12),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n regular: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n },\n spacious: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(200, 200),\n maxItemSize: new Size(280, 280)\n }\n },\n L: {\n compact: {\n minSpace: new Size(16, 16),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n regular: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n },\n spacious: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(270, 270),\n maxItemSize: new Size(370, 370)\n }\n },\n XL: {\n compact: {\n minSpace: new Size(20, 20),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n regular: {\n minSpace: new Size(24, 24),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n },\n spacious: {\n minSpace: new Size(28, 28),\n minItemSize: new Size(340, 340),\n maxItemSize: new Size(460, 460)\n }\n }\n};\n\nconst SIZES = ['XS', 'S', 'M', 'L', 'XL'] as const;\n\nconst cardViewStyles = style({\n overflowY: {\n default: 'auto',\n isLoading: 'hidden'\n },\n display: {\n isEmpty: 'flex'\n },\n boxSizing: 'border-box',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n ...focusRing(),\n outlineStyle: {\n default: 'none',\n isEmpty: {\n isFocusVisible: 'solid'\n }\n },\n outlineOffset: -2\n}, getAllowedOverrides({height: true}));\n\nconst wrapperStyles = style({\n position: 'relative', \n overflow: 'clip', \n size: 'fit'\n}, getAllowedOverrides({height: true}));\n\nexport const CardViewContext = createContext<ContextValue<Partial<CardViewProps<any>>, DOMRefValue<HTMLDivElement>>>(null);\n\nexport const CardView = /*#__PURE__*/ (forwardRef as forwardRefType)(function CardView<T extends object>(props: CardViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CardViewContext);\n let {children, layout: layoutName = 'grid', size: sizeProp = 'M', density = 'regular', variant = 'primary', selectionStyle = 'checkbox', UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let innerRef = useRef(null);\n let scrollRef = props.renderActionBar ? innerRef : domRef;\n\n // This calculates the maximum t-shirt size where at least two columns fit in the available width.\n let [maxSizeIndex, setMaxSizeIndex] = useState(SIZES.length - 1);\n let updateSize = useEffectEvent(() => {\n let w = scrollRef.current?.clientWidth ?? 0;\n let i = SIZES.length - 1;\n while (i > 0) {\n let opts = layoutOptions[SIZES[i]][density];\n if (w >= opts.minItemSize.width * 2 + opts.minSpace.width * 3) {\n break;\n }\n i--;\n }\n setMaxSizeIndex(i);\n });\n\n useResizeObserver({\n ref: scrollRef,\n box: 'border-box',\n onResize: updateSize\n });\n\n useLayoutEffect(() => {\n updateSize();\n }, [updateSize]);\n\n // The actual rendered t-shirt size is the minimum between the size prop and the maximum possible size.\n let size = SIZES[Math.min(maxSizeIndex, SIZES.indexOf(sizeProp))];\n let layout = layoutName === 'waterfall' ? WaterfallLayout : GridLayout;\n let options = layoutOptions[size][density];\n\n useLoadMore({\n isLoading: props.loadingState !== 'idle' && props.loadingState !== 'error',\n items: props.items, // TODO: ideally this would be the collection. items won't exist for static collections, or those using <Collection>\n onLoadMore: props.onLoadMore\n }, scrollRef);\n\n let ctx = useMemo(() => ({size, variant}), [size, variant]);\n\n let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});\n\n let cardView = (\n <Virtualizer layout={layout} layoutOptions={options}>\n <InternalCardViewContext.Provider value={GridListItem}>\n <CardContext.Provider value={ctx}>\n <ImageCoordinator>\n <AriaGridList\n ref={scrollRef}\n {...otherProps}\n layout=\"grid\"\n selectionBehavior={selectionStyle === 'highlight' ? 'replace' : 'toggle'}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={undefined}\n onSelectionChange={onSelectionChange}\n style={{\n ...(!props.renderActionBar ? UNSAFE_style : {}),\n // Add padding at the bottom when the action bar is visible so users can scroll to the last items.\n // Also add scroll padding so keyboard navigating preserves the padding.\n paddingBottom: actionBarHeight > 0 ? actionBarHeight + options.minSpace.height : 0,\n scrollPadding: options.minSpace.height,\n scrollPaddingBottom: actionBarHeight + options.minSpace.height\n }}\n className={renderProps => (!props.renderActionBar ? UNSAFE_className : '') + cardViewStyles({...renderProps, isLoading: props.loadingState === 'loading'}, !props.renderActionBar ? styles : undefined)}>\n {children}\n </AriaGridList>\n </ImageCoordinator>\n </CardContext.Provider>\n </InternalCardViewContext.Provider>\n </Virtualizer>\n );\n\n // Add extra wrapper if there is an action bar so we can position relative to it.\n // ActionBar cannot be inside the GridList due to ARIA and focus management requirements.\n if (props.renderActionBar) {\n return (\n <div ref={domRef} className={UNSAFE_className + wrapperStyles(null, styles)} style={UNSAFE_style}>\n {cardView}\n {actionBar}\n </div>\n );\n }\n\n return cardView;\n});\n"],"names":[],"version":3,"file":"CardView.css.map"}
package/dist/CardView.mjs CHANGED
@@ -4,9 +4,8 @@ import {ImageCoordinator as $4b5e069e9e001e8b$export$1b926c015f09611d} from "./I
4
4
  import {useActionBarContainer as $f21f2186348fbc5b$export$13f32e21845e01d0} from "./ActionBar.mjs";
5
5
  import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
6
6
  import {jsx as $aG2ym$jsx, jsxs as $aG2ym$jsxs} from "react/jsx-runtime";
7
- import {UNSTABLE_Virtualizer as $aG2ym$UNSTABLE_Virtualizer, GridListItem as $aG2ym$GridListItem, GridList as $aG2ym$GridList} from "react-aria-components";
8
- import {createContext as $aG2ym$createContext, forwardRef as $aG2ym$forwardRef, useRef as $aG2ym$useRef, useMemo as $aG2ym$useMemo, useState as $aG2ym$useState} from "react";
9
- import {Size as $aG2ym$Size, Rect as $aG2ym$Rect, LayoutInfo as $aG2ym$LayoutInfo, Layout as $aG2ym$Layout} from "@react-stately/virtualizer";
7
+ import {Size as $aG2ym$Size, WaterfallLayout as $aG2ym$WaterfallLayout, GridLayout as $aG2ym$GridLayout, Virtualizer as $aG2ym$Virtualizer, GridListItem as $aG2ym$GridListItem, GridList as $aG2ym$GridList} from "react-aria-components";
8
+ import {createContext as $aG2ym$createContext, forwardRef as $aG2ym$forwardRef, useRef as $aG2ym$useRef, useState as $aG2ym$useState, useMemo as $aG2ym$useMemo} from "react";
10
9
  import {useDOMRef as $aG2ym$useDOMRef} from "@react-spectrum/utils";
11
10
  import {useEffectEvent as $aG2ym$useEffectEvent, useResizeObserver as $aG2ym$useResizeObserver, useLayoutEffect as $aG2ym$useLayoutEffect, useLoadMore as $aG2ym$useLoadMore} from "@react-aria/utils";
12
11
 
@@ -29,259 +28,6 @@ import {useEffectEvent as $aG2ym$useEffectEvent, useResizeObserver as $aG2ym$use
29
28
 
30
29
 
31
30
 
32
-
33
- class $bbcff092fe610ff3$var$FlexibleGridLayout extends (0, $aG2ym$Layout) {
34
- update(invalidationContext) {
35
- let { minItemSize: minItemSize = new (0, $aG2ym$Size)(200, 200), maxItemSize: maxItemSize = new (0, $aG2ym$Size)(Infinity, Infinity), minSpace: minSpace = new (0, $aG2ym$Size)(18, 18), maxColumns: maxColumns = Infinity } = invalidationContext.layoutOptions || {};
36
- let visibleWidth = this.virtualizer.visibleRect.width;
37
- // The max item width is always the entire viewport.
38
- // If the max item height is infinity, scale in proportion to the max width.
39
- let maxItemWidth = Math.min(maxItemSize.width, visibleWidth);
40
- let maxItemHeight = Number.isFinite(maxItemSize.height) ? maxItemSize.height : Math.floor(minItemSize.height / minItemSize.width * maxItemWidth);
41
- // Compute the number of rows and columns needed to display the content
42
- let columns = Math.floor(visibleWidth / (minItemSize.width + minSpace.width));
43
- let numColumns = Math.max(1, Math.min(maxColumns, columns));
44
- // Compute the available width (minus the space between items)
45
- let width = visibleWidth - minSpace.width * Math.max(0, numColumns);
46
- // Compute the item width based on the space available
47
- let itemWidth = Math.floor(width / numColumns);
48
- itemWidth = Math.max(minItemSize.width, Math.min(maxItemWidth, itemWidth));
49
- // Compute the item height, which is proportional to the item width
50
- let t = (itemWidth - minItemSize.width) / Math.max(1, maxItemWidth - minItemSize.width);
51
- let itemHeight = minItemSize.height + Math.floor((maxItemHeight - minItemSize.height) * t);
52
- itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));
53
- // Compute the horizontal spacing and content height
54
- let horizontalSpacing = Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1));
55
- let rows = Math.ceil(this.virtualizer.collection.size / numColumns);
56
- let iterator = this.virtualizer.collection[Symbol.iterator]();
57
- let y = rows > 0 ? minSpace.height : 0;
58
- let newLayoutInfos = new Map();
59
- let skeleton = null;
60
- let skeletonCount = 0;
61
- for(let row = 0; row < rows; row++){
62
- let maxHeight = 0;
63
- let rowLayoutInfos = [];
64
- for(let col = 0; col < numColumns; col++){
65
- // Repeat skeleton until the end of the current row.
66
- let node = skeleton || iterator.next().value;
67
- if (!node) break;
68
- if (node.type === 'skeleton') skeleton = node;
69
- let key = skeleton ? `${skeleton.key}-${skeletonCount++}` : node.key;
70
- let content = skeleton ? {
71
- ...skeleton
72
- } : node;
73
- let x = horizontalSpacing + col * (itemWidth + horizontalSpacing);
74
- let oldLayoutInfo = this.layoutInfos.get(key);
75
- let height = itemHeight;
76
- let estimatedSize = true;
77
- if (oldLayoutInfo) {
78
- height = oldLayoutInfo.rect.height;
79
- estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize || oldLayoutInfo.content !== content;
80
- }
81
- let rect = new (0, $aG2ym$Rect)(x, y, itemWidth, height);
82
- let layoutInfo = new (0, $aG2ym$LayoutInfo)(node.type, key, rect);
83
- layoutInfo.estimatedSize = estimatedSize;
84
- layoutInfo.allowOverflow = true;
85
- layoutInfo.content = content;
86
- newLayoutInfos.set(key, layoutInfo);
87
- rowLayoutInfos.push(layoutInfo);
88
- maxHeight = Math.max(maxHeight, rect.height);
89
- }
90
- for (let layoutInfo of rowLayoutInfos)layoutInfo.rect.height = maxHeight;
91
- y += maxHeight + minSpace.height;
92
- // Keep adding skeleton rows until we fill the viewport
93
- if (skeleton && row === rows - 1 && y < this.virtualizer.visibleRect.height) rows++;
94
- }
95
- this.layoutInfos = newLayoutInfos;
96
- this.contentSize = new (0, $aG2ym$Size)(this.virtualizer.visibleRect.width, y);
97
- }
98
- getLayoutInfo(key) {
99
- return this.layoutInfos.get(key);
100
- }
101
- getContentSize() {
102
- return this.contentSize;
103
- }
104
- getVisibleLayoutInfos(rect) {
105
- let layoutInfos = [];
106
- for (let layoutInfo of this.layoutInfos.values())if (layoutInfo.rect.intersects(rect) || this.virtualizer.isPersistedKey(layoutInfo.key)) layoutInfos.push(layoutInfo);
107
- return layoutInfos;
108
- }
109
- updateItemSize(key, size) {
110
- let layoutInfo = this.layoutInfos.get(key);
111
- if (!size || !layoutInfo) return false;
112
- if (size.height !== layoutInfo.rect.height) {
113
- let newLayoutInfo = layoutInfo.copy();
114
- newLayoutInfo.rect.height = size.height;
115
- newLayoutInfo.estimatedSize = false;
116
- this.layoutInfos.set(key, newLayoutInfo);
117
- return true;
118
- }
119
- return false;
120
- }
121
- constructor(...args){
122
- super(...args), this.contentSize = new (0, $aG2ym$Size)(), this.layoutInfos = new Map();
123
- }
124
- }
125
- class $bbcff092fe610ff3$var$WaterfallLayoutInfo extends (0, $aG2ym$LayoutInfo) {
126
- copy() {
127
- let res = super.copy();
128
- res.column = this.column;
129
- return res;
130
- }
131
- constructor(...args){
132
- super(...args), this.column = 0;
133
- }
134
- }
135
- class $bbcff092fe610ff3$var$WaterfallLayout extends (0, $aG2ym$Layout) {
136
- update(invalidationContext) {
137
- let { minItemSize: minItemSize = new (0, $aG2ym$Size)(200, 200), maxItemSize: maxItemSize = new (0, $aG2ym$Size)(Infinity, Infinity), minSpace: minSpace = new (0, $aG2ym$Size)(18, 18), maxColumns: maxColumns = Infinity } = invalidationContext.layoutOptions || {};
138
- let visibleWidth = this.virtualizer.visibleRect.width;
139
- // The max item width is always the entire viewport.
140
- // If the max item height is infinity, scale in proportion to the max width.
141
- let maxItemWidth = Math.min(maxItemSize.width, visibleWidth);
142
- let maxItemHeight = Number.isFinite(maxItemSize.height) ? maxItemSize.height : Math.floor(minItemSize.height / minItemSize.width * maxItemWidth);
143
- // Compute the number of rows and columns needed to display the content
144
- let columns = Math.floor(visibleWidth / (minItemSize.width + minSpace.width));
145
- let numColumns = Math.max(1, Math.min(maxColumns, columns));
146
- // Compute the available width (minus the space between items)
147
- let width = visibleWidth - minSpace.width * Math.max(0, numColumns);
148
- // Compute the item width based on the space available
149
- let itemWidth = Math.floor(width / numColumns);
150
- itemWidth = Math.max(minItemSize.width, Math.min(maxItemWidth, itemWidth));
151
- // Compute the item height, which is proportional to the item width
152
- let t = (itemWidth - minItemSize.width) / Math.max(1, maxItemWidth - minItemSize.width);
153
- let itemHeight = minItemSize.height + Math.floor((maxItemHeight - minItemSize.height) * t);
154
- itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));
155
- // Compute the horizontal spacing and content height
156
- let horizontalSpacing = Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1));
157
- // Setup an array of column heights
158
- let columnHeights = Array(numColumns).fill(minSpace.height);
159
- let newLayoutInfos = new Map();
160
- let addNode = (key, node)=>{
161
- let oldLayoutInfo = this.layoutInfos.get(key);
162
- let height = itemHeight;
163
- let estimatedSize = true;
164
- if (oldLayoutInfo) {
165
- height = oldLayoutInfo.rect.height;
166
- estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize || oldLayoutInfo.content !== node;
167
- }
168
- // Figure out which column to place the item in, and compute its position.
169
- // Preserve the previous column index so items don't jump around during resizing unless the number of columns changed.
170
- let prevColumn = numColumns === this.numColumns ? oldLayoutInfo?.column : undefined;
171
- let column = prevColumn ?? columnHeights.reduce((minIndex, h, i)=>h < columnHeights[minIndex] ? i : minIndex, 0);
172
- let x = horizontalSpacing + column * (itemWidth + horizontalSpacing);
173
- let y = columnHeights[column];
174
- let rect = new (0, $aG2ym$Rect)(x, y, itemWidth, height);
175
- let layoutInfo = new $bbcff092fe610ff3$var$WaterfallLayoutInfo(node.type, key, rect);
176
- layoutInfo.estimatedSize = estimatedSize;
177
- layoutInfo.allowOverflow = true;
178
- layoutInfo.content = node;
179
- layoutInfo.column = column;
180
- newLayoutInfos.set(key, layoutInfo);
181
- columnHeights[column] += layoutInfo.rect.height + minSpace.height;
182
- };
183
- let skeletonCount = 0;
184
- for (let node of this.virtualizer.collection)if (node.type === 'skeleton') {
185
- // Add skeleton cards until every column has at least one, and we fill the viewport.
186
- let startingHeights = [
187
- ...columnHeights
188
- ];
189
- while(!columnHeights.every((h, i)=>h !== startingHeights[i]) || Math.min(...columnHeights) < this.virtualizer.visibleRect.height){
190
- let key = `${node.key}-${skeletonCount++}`;
191
- let content = this.layoutInfos.get(key)?.content || {
192
- ...node
193
- };
194
- addNode(key, content);
195
- }
196
- break;
197
- } else addNode(node.key, node);
198
- // Reset all columns to the maximum for the next section
199
- let maxHeight = Math.max(...columnHeights);
200
- this.contentSize = new (0, $aG2ym$Size)(this.virtualizer.visibleRect.width, maxHeight);
201
- this.layoutInfos = newLayoutInfos;
202
- this.numColumns = numColumns;
203
- }
204
- getLayoutInfo(key) {
205
- return this.layoutInfos.get(key);
206
- }
207
- getContentSize() {
208
- return this.contentSize;
209
- }
210
- getVisibleLayoutInfos(rect) {
211
- let layoutInfos = [];
212
- for (let layoutInfo of this.layoutInfos.values())if (layoutInfo.rect.intersects(rect) || this.virtualizer.isPersistedKey(layoutInfo.key)) layoutInfos.push(layoutInfo);
213
- return layoutInfos;
214
- }
215
- updateItemSize(key, size) {
216
- let layoutInfo = this.layoutInfos.get(key);
217
- if (!size || !layoutInfo) return false;
218
- if (size.height !== layoutInfo.rect.height) {
219
- let newLayoutInfo = layoutInfo.copy();
220
- newLayoutInfo.rect.height = size.height;
221
- newLayoutInfo.estimatedSize = false;
222
- this.layoutInfos.set(key, newLayoutInfo);
223
- return true;
224
- }
225
- return false;
226
- }
227
- // Override keyboard navigation to work spacially.
228
- getKeyRightOf(key) {
229
- let layoutInfo = this.getLayoutInfo(key);
230
- if (!layoutInfo) return null;
231
- let rect = new (0, $aG2ym$Rect)(layoutInfo.rect.maxX, layoutInfo.rect.y, this.virtualizer.visibleRect.maxX - layoutInfo.rect.maxX, layoutInfo.rect.height);
232
- let layoutInfos = this.getVisibleLayoutInfos(rect);
233
- let bestKey = null;
234
- let bestDistance = Infinity;
235
- for (let candidate of layoutInfos){
236
- if (candidate.key === key) continue;
237
- // Find the closest item in the x direction with the most overlap in the y direction.
238
- let deltaX = candidate.rect.x - rect.x;
239
- let overlapY = Math.min(candidate.rect.maxY, rect.maxY) - Math.max(candidate.rect.y, rect.y);
240
- let distance = deltaX - overlapY;
241
- if (distance < bestDistance) {
242
- bestDistance = distance;
243
- bestKey = candidate.key;
244
- }
245
- }
246
- return bestKey;
247
- }
248
- getKeyLeftOf(key) {
249
- let layoutInfo = this.getLayoutInfo(key);
250
- if (!layoutInfo) return null;
251
- let rect = new (0, $aG2ym$Rect)(0, layoutInfo.rect.y, layoutInfo.rect.x, layoutInfo.rect.height);
252
- let layoutInfos = this.getVisibleLayoutInfos(rect);
253
- let bestKey = null;
254
- let bestDistance = Infinity;
255
- for (let candidate of layoutInfos){
256
- if (candidate.key === key) continue;
257
- // Find the closest item in the x direction with the most overlap in the y direction.
258
- let deltaX = rect.maxX - candidate.rect.maxX;
259
- let overlapY = Math.min(candidate.rect.maxY, rect.maxY) - Math.max(candidate.rect.y, rect.y);
260
- let distance = deltaX - overlapY;
261
- if (distance < bestDistance) {
262
- bestDistance = distance;
263
- bestKey = candidate.key;
264
- }
265
- }
266
- return bestKey;
267
- }
268
- // This overrides the default behavior of shift selection to work spacially
269
- // rather than following the order of the items in the collection (which may appear unpredictable).
270
- getKeyRange(from, to) {
271
- let fromLayoutInfo = this.getLayoutInfo(from);
272
- let toLayoutInfo = this.getLayoutInfo(to);
273
- if (!fromLayoutInfo || !toLayoutInfo) return [];
274
- // Find items where half of the area intersects the rectangle
275
- // formed from the first item to the last item in the range.
276
- let rect = fromLayoutInfo.rect.union(toLayoutInfo.rect);
277
- let keys = [];
278
- for (let layoutInfo of this.layoutInfos.values())if (rect.intersection(layoutInfo.rect).area > layoutInfo.rect.area / 2) keys.push(layoutInfo.key);
279
- return keys;
280
- }
281
- constructor(...args){
282
- super(...args), this.contentSize = new (0, $aG2ym$Size)(), this.layoutInfos = new Map(), this.numColumns = 0;
283
- }
284
- }
285
31
  const $bbcff092fe610ff3$var$layoutOptions = {
286
32
  XS: {
287
33
  compact: {
@@ -396,6 +142,25 @@ const $bbcff092fe610ff3$var$cardViewStyles = function anonymous(props, overrides
396
142
  rules += ' _N-3hmpw';
397
143
  return rules;
398
144
  };
145
+ const $bbcff092fe610ff3$var$wrapperStyles = function anonymous(props, overrides) {
146
+ let rules = " .";
147
+ let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r|k|o|p)[^\s]+/g) || [];
148
+ rules += matches.join('');
149
+ let $V = false;
150
+ let $l = false;
151
+ let $k = false;
152
+ for (let p of matches){
153
+ if (/^\s*V/.test(p)) $V = true;
154
+ if (/^\s*l/.test(p)) $l = true;
155
+ if (/^\s*k/.test(p)) $k = true;
156
+ }
157
+ if (!$V) rules += ' Vc';
158
+ rules += ' __wc';
159
+ rules += ' __xc';
160
+ if (!$l) rules += ' le';
161
+ if (!$k) rules += ' ke';
162
+ return rules;
163
+ };
399
164
  const $bbcff092fe610ff3$export$64992ac69f286e5c = /*#__PURE__*/ (0, $aG2ym$createContext)(null);
400
165
  const $bbcff092fe610ff3$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $aG2ym$forwardRef)(function CardView(props, ref) {
401
166
  [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $bbcff092fe610ff3$export$64992ac69f286e5c);
@@ -403,11 +168,6 @@ const $bbcff092fe610ff3$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $aG2ym$forwa
403
168
  let domRef = (0, $aG2ym$useDOMRef)(ref);
404
169
  let innerRef = (0, $aG2ym$useRef)(null);
405
170
  let scrollRef = props.renderActionBar ? innerRef : domRef;
406
- let layout = (0, $aG2ym$useMemo)(()=>{
407
- return layoutName === 'waterfall' ? new $bbcff092fe610ff3$var$WaterfallLayout() : new $bbcff092fe610ff3$var$FlexibleGridLayout();
408
- }, [
409
- layoutName
410
- ]);
411
171
  // This calculates the maximum t-shirt size where at least two columns fit in the available width.
412
172
  let [maxSizeIndex, setMaxSizeIndex] = (0, $aG2ym$useState)($bbcff092fe610ff3$var$SIZES.length - 1);
413
173
  let updateSize = (0, $aG2ym$useEffectEvent)(()=>{
@@ -432,6 +192,7 @@ const $bbcff092fe610ff3$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $aG2ym$forwa
432
192
  ]);
433
193
  // The actual rendered t-shirt size is the minimum between the size prop and the maximum possible size.
434
194
  let size = $bbcff092fe610ff3$var$SIZES[Math.min(maxSizeIndex, $bbcff092fe610ff3$var$SIZES.indexOf(sizeProp))];
195
+ let layout = layoutName === 'waterfall' ? (0, $aG2ym$WaterfallLayout) : (0, $aG2ym$GridLayout);
435
196
  let options = $bbcff092fe610ff3$var$layoutOptions[size][density];
436
197
  (0, $aG2ym$useLoadMore)({
437
198
  isLoading: props.loadingState !== 'idle' && props.loadingState !== 'error',
@@ -449,7 +210,7 @@ const $bbcff092fe610ff3$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $aG2ym$forwa
449
210
  ...props,
450
211
  scrollRef: scrollRef
451
212
  });
452
- let cardView = /*#__PURE__*/ (0, $aG2ym$jsx)((0, $aG2ym$UNSTABLE_Virtualizer), {
213
+ let cardView = /*#__PURE__*/ (0, $aG2ym$jsx)((0, $aG2ym$Virtualizer), {
453
214
  layout: layout,
454
215
  layoutOptions: options,
455
216
  children: /*#__PURE__*/ (0, $aG2ym$jsx)((0, $68e4e6fe083e22fd$export$cb658fed5fefe1d).Provider, {
@@ -466,17 +227,17 @@ const $bbcff092fe610ff3$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $aG2ym$forwa
466
227
  defaultSelectedKeys: undefined,
467
228
  onSelectionChange: onSelectionChange,
468
229
  style: {
469
- ...UNSAFE_style,
230
+ ...!props.renderActionBar ? UNSAFE_style : {},
470
231
  // Add padding at the bottom when the action bar is visible so users can scroll to the last items.
471
232
  // Also add scroll padding so keyboard navigating preserves the padding.
472
233
  paddingBottom: actionBarHeight > 0 ? actionBarHeight + options.minSpace.height : 0,
473
234
  scrollPadding: options.minSpace.height,
474
235
  scrollPaddingBottom: actionBarHeight + options.minSpace.height
475
236
  },
476
- className: (renderProps)=>UNSAFE_className + $bbcff092fe610ff3$var$cardViewStyles({
237
+ className: (renderProps)=>(!props.renderActionBar ? UNSAFE_className : '') + $bbcff092fe610ff3$var$cardViewStyles({
477
238
  ...renderProps,
478
239
  isLoading: props.loadingState === 'loading'
479
- }, styles),
240
+ }, !props.renderActionBar ? styles : undefined),
480
241
  children: children
481
242
  })
482
243
  })
@@ -487,7 +248,8 @@ const $bbcff092fe610ff3$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $aG2ym$forwa
487
248
  // ActionBar cannot be inside the GridList due to ARIA and focus management requirements.
488
249
  if (props.renderActionBar) return /*#__PURE__*/ (0, $aG2ym$jsxs)("div", {
489
250
  ref: domRef,
490
- className: " . Vc __wc __xc le ke",
251
+ className: UNSAFE_className + $bbcff092fe610ff3$var$wrapperStyles(null, styles),
252
+ style: UNSAFE_style,
491
253
  children: [
492
254
  cardView,
493
255
  actionBar