@react-spectrum/card 3.0.0-alpha.4 → 3.0.0-alpha.41

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 (240) hide show
  1. package/dist/BaseLayout.main.js +213 -0
  2. package/dist/BaseLayout.main.js.map +1 -0
  3. package/dist/BaseLayout.mjs +208 -0
  4. package/dist/BaseLayout.module.js +208 -0
  5. package/dist/BaseLayout.module.js.map +1 -0
  6. package/dist/Card.main.js +52 -0
  7. package/dist/Card.main.js.map +1 -0
  8. package/dist/Card.mjs +43 -0
  9. package/dist/Card.module.js +43 -0
  10. package/dist/Card.module.js.map +1 -0
  11. package/dist/CardBase.main.js +203 -0
  12. package/dist/CardBase.main.js.map +1 -0
  13. package/dist/CardBase.mjs +198 -0
  14. package/dist/CardBase.module.js +198 -0
  15. package/dist/CardBase.module.js.map +1 -0
  16. package/dist/CardView.main.js +238 -0
  17. package/dist/CardView.main.js.map +1 -0
  18. package/dist/CardView.mjs +233 -0
  19. package/dist/CardView.module.js +233 -0
  20. package/dist/CardView.module.js.map +1 -0
  21. package/dist/CardViewContext.main.js +32 -0
  22. package/dist/CardViewContext.main.js.map +1 -0
  23. package/dist/CardViewContext.mjs +22 -0
  24. package/dist/CardViewContext.module.js +22 -0
  25. package/dist/CardViewContext.module.js.map +1 -0
  26. package/dist/GalleryLayout.main.js +230 -0
  27. package/dist/GalleryLayout.main.js.map +1 -0
  28. package/dist/GalleryLayout.mjs +225 -0
  29. package/dist/GalleryLayout.module.js +225 -0
  30. package/dist/GalleryLayout.module.js.map +1 -0
  31. package/dist/GridLayout.main.js +175 -0
  32. package/dist/GridLayout.main.js.map +1 -0
  33. package/dist/GridLayout.mjs +170 -0
  34. package/dist/GridLayout.module.js +170 -0
  35. package/dist/GridLayout.module.js.map +1 -0
  36. package/dist/WaterfallLayout.main.js +182 -0
  37. package/dist/WaterfallLayout.main.js.map +1 -0
  38. package/dist/WaterfallLayout.mjs +177 -0
  39. package/dist/WaterfallLayout.module.js +177 -0
  40. package/dist/WaterfallLayout.module.js.map +1 -0
  41. package/dist/ar-AE.main.js +7 -0
  42. package/dist/ar-AE.main.js.map +1 -0
  43. package/dist/ar-AE.mjs +9 -0
  44. package/dist/ar-AE.module.js +9 -0
  45. package/dist/ar-AE.module.js.map +1 -0
  46. package/dist/bg-BG.main.js +7 -0
  47. package/dist/bg-BG.main.js.map +1 -0
  48. package/dist/bg-BG.mjs +9 -0
  49. package/dist/bg-BG.module.js +9 -0
  50. package/dist/bg-BG.module.js.map +1 -0
  51. package/dist/card_vars_css.main.js +116 -0
  52. package/dist/card_vars_css.main.js.map +1 -0
  53. package/dist/card_vars_css.mjs +118 -0
  54. package/dist/card_vars_css.module.js +118 -0
  55. package/dist/card_vars_css.module.js.map +1 -0
  56. package/dist/cs-CZ.main.js +7 -0
  57. package/dist/cs-CZ.main.js.map +1 -0
  58. package/dist/cs-CZ.mjs +9 -0
  59. package/dist/cs-CZ.module.js +9 -0
  60. package/dist/cs-CZ.module.js.map +1 -0
  61. package/dist/da-DK.main.js +7 -0
  62. package/dist/da-DK.main.js.map +1 -0
  63. package/dist/da-DK.mjs +9 -0
  64. package/dist/da-DK.module.js +9 -0
  65. package/dist/da-DK.module.js.map +1 -0
  66. package/dist/de-DE.main.js +7 -0
  67. package/dist/de-DE.main.js.map +1 -0
  68. package/dist/de-DE.mjs +9 -0
  69. package/dist/de-DE.module.js +9 -0
  70. package/dist/de-DE.module.js.map +1 -0
  71. package/dist/el-GR.main.js +7 -0
  72. package/dist/el-GR.main.js.map +1 -0
  73. package/dist/el-GR.mjs +9 -0
  74. package/dist/el-GR.module.js +9 -0
  75. package/dist/el-GR.module.js.map +1 -0
  76. package/dist/en-US.main.js +7 -0
  77. package/dist/en-US.main.js.map +1 -0
  78. package/dist/en-US.mjs +9 -0
  79. package/dist/en-US.module.js +9 -0
  80. package/dist/en-US.module.js.map +1 -0
  81. package/dist/es-ES.main.js +7 -0
  82. package/dist/es-ES.main.js.map +1 -0
  83. package/dist/es-ES.mjs +9 -0
  84. package/dist/es-ES.module.js +9 -0
  85. package/dist/es-ES.module.js.map +1 -0
  86. package/dist/et-EE.main.js +7 -0
  87. package/dist/et-EE.main.js.map +1 -0
  88. package/dist/et-EE.mjs +9 -0
  89. package/dist/et-EE.module.js +9 -0
  90. package/dist/et-EE.module.js.map +1 -0
  91. package/dist/fi-FI.main.js +7 -0
  92. package/dist/fi-FI.main.js.map +1 -0
  93. package/dist/fi-FI.mjs +9 -0
  94. package/dist/fi-FI.module.js +9 -0
  95. package/dist/fi-FI.module.js.map +1 -0
  96. package/dist/fr-FR.main.js +7 -0
  97. package/dist/fr-FR.main.js.map +1 -0
  98. package/dist/fr-FR.mjs +9 -0
  99. package/dist/fr-FR.module.js +9 -0
  100. package/dist/fr-FR.module.js.map +1 -0
  101. package/dist/he-IL.main.js +7 -0
  102. package/dist/he-IL.main.js.map +1 -0
  103. package/dist/he-IL.mjs +9 -0
  104. package/dist/he-IL.module.js +9 -0
  105. package/dist/he-IL.module.js.map +1 -0
  106. package/dist/hr-HR.main.js +7 -0
  107. package/dist/hr-HR.main.js.map +1 -0
  108. package/dist/hr-HR.mjs +9 -0
  109. package/dist/hr-HR.module.js +9 -0
  110. package/dist/hr-HR.module.js.map +1 -0
  111. package/dist/hu-HU.main.js +7 -0
  112. package/dist/hu-HU.main.js.map +1 -0
  113. package/dist/hu-HU.mjs +9 -0
  114. package/dist/hu-HU.module.js +9 -0
  115. package/dist/hu-HU.module.js.map +1 -0
  116. package/dist/import.mjs +26 -0
  117. package/dist/intlStrings.main.js +108 -0
  118. package/dist/intlStrings.main.js.map +1 -0
  119. package/dist/intlStrings.mjs +110 -0
  120. package/dist/intlStrings.module.js +110 -0
  121. package/dist/intlStrings.module.js.map +1 -0
  122. package/dist/it-IT.main.js +7 -0
  123. package/dist/it-IT.main.js.map +1 -0
  124. package/dist/it-IT.mjs +9 -0
  125. package/dist/it-IT.module.js +9 -0
  126. package/dist/it-IT.module.js.map +1 -0
  127. package/dist/ja-JP.main.js +7 -0
  128. package/dist/ja-JP.main.js.map +1 -0
  129. package/dist/ja-JP.mjs +9 -0
  130. package/dist/ja-JP.module.js +9 -0
  131. package/dist/ja-JP.module.js.map +1 -0
  132. package/dist/ko-KR.main.js +7 -0
  133. package/dist/ko-KR.main.js.map +1 -0
  134. package/dist/ko-KR.mjs +9 -0
  135. package/dist/ko-KR.module.js +9 -0
  136. package/dist/ko-KR.module.js.map +1 -0
  137. package/dist/lt-LT.main.js +7 -0
  138. package/dist/lt-LT.main.js.map +1 -0
  139. package/dist/lt-LT.mjs +9 -0
  140. package/dist/lt-LT.module.js +9 -0
  141. package/dist/lt-LT.module.js.map +1 -0
  142. package/dist/lv-LV.main.js +7 -0
  143. package/dist/lv-LV.main.js.map +1 -0
  144. package/dist/lv-LV.mjs +9 -0
  145. package/dist/lv-LV.module.js +9 -0
  146. package/dist/lv-LV.module.js.map +1 -0
  147. package/dist/main.js +21 -1447
  148. package/dist/main.js.map +1 -1
  149. package/dist/module.js +17 -1432
  150. package/dist/module.js.map +1 -1
  151. package/dist/nb-NO.main.js +7 -0
  152. package/dist/nb-NO.main.js.map +1 -0
  153. package/dist/nb-NO.mjs +9 -0
  154. package/dist/nb-NO.module.js +9 -0
  155. package/dist/nb-NO.module.js.map +1 -0
  156. package/dist/nl-NL.main.js +7 -0
  157. package/dist/nl-NL.main.js.map +1 -0
  158. package/dist/nl-NL.mjs +9 -0
  159. package/dist/nl-NL.module.js +9 -0
  160. package/dist/nl-NL.module.js.map +1 -0
  161. package/dist/pl-PL.main.js +7 -0
  162. package/dist/pl-PL.main.js.map +1 -0
  163. package/dist/pl-PL.mjs +9 -0
  164. package/dist/pl-PL.module.js +9 -0
  165. package/dist/pl-PL.module.js.map +1 -0
  166. package/dist/pt-BR.main.js +7 -0
  167. package/dist/pt-BR.main.js.map +1 -0
  168. package/dist/pt-BR.mjs +9 -0
  169. package/dist/pt-BR.module.js +9 -0
  170. package/dist/pt-BR.module.js.map +1 -0
  171. package/dist/pt-PT.main.js +7 -0
  172. package/dist/pt-PT.main.js.map +1 -0
  173. package/dist/pt-PT.mjs +9 -0
  174. package/dist/pt-PT.module.js +9 -0
  175. package/dist/pt-PT.module.js.map +1 -0
  176. package/dist/ro-RO.main.js +7 -0
  177. package/dist/ro-RO.main.js.map +1 -0
  178. package/dist/ro-RO.mjs +9 -0
  179. package/dist/ro-RO.module.js +9 -0
  180. package/dist/ro-RO.module.js.map +1 -0
  181. package/dist/ru-RU.main.js +7 -0
  182. package/dist/ru-RU.main.js.map +1 -0
  183. package/dist/ru-RU.mjs +9 -0
  184. package/dist/ru-RU.module.js +9 -0
  185. package/dist/ru-RU.module.js.map +1 -0
  186. package/dist/sk-SK.main.js +7 -0
  187. package/dist/sk-SK.main.js.map +1 -0
  188. package/dist/sk-SK.mjs +9 -0
  189. package/dist/sk-SK.module.js +9 -0
  190. package/dist/sk-SK.module.js.map +1 -0
  191. package/dist/sl-SI.main.js +7 -0
  192. package/dist/sl-SI.main.js.map +1 -0
  193. package/dist/sl-SI.mjs +9 -0
  194. package/dist/sl-SI.module.js +9 -0
  195. package/dist/sl-SI.module.js.map +1 -0
  196. package/dist/sr-SP.main.js +7 -0
  197. package/dist/sr-SP.main.js.map +1 -0
  198. package/dist/sr-SP.mjs +9 -0
  199. package/dist/sr-SP.module.js +9 -0
  200. package/dist/sr-SP.module.js.map +1 -0
  201. package/dist/sv-SE.main.js +7 -0
  202. package/dist/sv-SE.main.js.map +1 -0
  203. package/dist/sv-SE.mjs +9 -0
  204. package/dist/sv-SE.module.js +9 -0
  205. package/dist/sv-SE.module.js.map +1 -0
  206. package/dist/tr-TR.main.js +7 -0
  207. package/dist/tr-TR.main.js.map +1 -0
  208. package/dist/tr-TR.mjs +9 -0
  209. package/dist/tr-TR.module.js +9 -0
  210. package/dist/tr-TR.module.js.map +1 -0
  211. package/dist/types.d.ts +38 -36
  212. package/dist/types.d.ts.map +1 -1
  213. package/dist/uk-UA.main.js +7 -0
  214. package/dist/uk-UA.main.js.map +1 -0
  215. package/dist/uk-UA.mjs +9 -0
  216. package/dist/uk-UA.module.js +9 -0
  217. package/dist/uk-UA.module.js.map +1 -0
  218. package/dist/vars.02438011.css +1671 -0
  219. package/dist/vars.02438011.css.map +1 -0
  220. package/dist/zh-CN.main.js +7 -0
  221. package/dist/zh-CN.main.js.map +1 -0
  222. package/dist/zh-CN.mjs +9 -0
  223. package/dist/zh-CN.module.js +9 -0
  224. package/dist/zh-CN.module.js.map +1 -0
  225. package/dist/zh-TW.main.js +7 -0
  226. package/dist/zh-TW.main.js.map +1 -0
  227. package/dist/zh-TW.mjs +9 -0
  228. package/dist/zh-TW.module.js +9 -0
  229. package/dist/zh-TW.module.js.map +1 -0
  230. package/package.json +26 -23
  231. package/src/BaseLayout.tsx +36 -32
  232. package/src/Card.tsx +1 -0
  233. package/src/CardBase.tsx +9 -11
  234. package/src/CardView.tsx +71 -51
  235. package/src/CardViewContext.tsx +1 -0
  236. package/src/GalleryLayout.tsx +4 -2
  237. package/src/GridLayout.tsx +7 -39
  238. package/src/WaterfallLayout.tsx +8 -5
  239. package/src/index.ts +10 -5
  240. package/dist/main.css +0 -1
@@ -0,0 +1 @@
1
+ {"mappings":"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","sources":["packages/@adobe/spectrum-css-temp/components/card/vars.css"],"sourcesContent":["/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.02438011.css.map"}
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ "loading": `\u{6B63}\u{5728}\u{52A0}\u{8F7D}...`,
3
+ "loadingMore": `\u{6B63}\u{5728}\u{52A0}\u{8F7D}\u{66F4}\u{591A}...`
4
+ };
5
+
6
+
7
+ //# sourceMappingURL=zh-CN.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,mCAAO,CAAC;IACtC,eAAe,CAAC,mDAAS,CAAC;AAC5B","sources":["packages/@react-spectrum/card/intl/zh-CN.json"],"sourcesContent":["{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
package/dist/zh-CN.mjs ADDED
@@ -0,0 +1,9 @@
1
+ var $88c83d794a7a062b$exports = {};
2
+ $88c83d794a7a062b$exports = {
3
+ "loading": `\u{6B63}\u{5728}\u{52A0}\u{8F7D}...`,
4
+ "loadingMore": `\u{6B63}\u{5728}\u{52A0}\u{8F7D}\u{66F4}\u{591A}...`
5
+ };
6
+
7
+
8
+ export {$88c83d794a7a062b$exports as default};
9
+ //# sourceMappingURL=zh-CN.module.js.map
@@ -0,0 +1,9 @@
1
+ var $88c83d794a7a062b$exports = {};
2
+ $88c83d794a7a062b$exports = {
3
+ "loading": `\u{6B63}\u{5728}\u{52A0}\u{8F7D}...`,
4
+ "loadingMore": `\u{6B63}\u{5728}\u{52A0}\u{8F7D}\u{66F4}\u{591A}...`
5
+ };
6
+
7
+
8
+ export {$88c83d794a7a062b$exports as default};
9
+ //# sourceMappingURL=zh-CN.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,mCAAO,CAAC;IACtC,eAAe,CAAC,mDAAS,CAAC;AAC5B","sources":["packages/@react-spectrum/card/intl/zh-CN.json"],"sourcesContent":["{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ "loading": `\u{8F09}\u{5165}\u{4E2D}\u{2026}`,
3
+ "loadingMore": `\u{6B63}\u{5728}\u{8F09}\u{5165}\u{66F4}\u{591A}\u{2026}`
4
+ };
5
+
6
+
7
+ //# sourceMappingURL=zh-TW.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,gCAAI,CAAC;IACnC,eAAe,CAAC,wDAAO,CAAC;AAC1B","sources":["packages/@react-spectrum/card/intl/zh-TW.json"],"sourcesContent":["{\n \"loading\": \"載入中…\",\n \"loadingMore\": \"正在載入更多…\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
package/dist/zh-TW.mjs ADDED
@@ -0,0 +1,9 @@
1
+ var $b7e2865acb74a940$exports = {};
2
+ $b7e2865acb74a940$exports = {
3
+ "loading": `\u{8F09}\u{5165}\u{4E2D}\u{2026}`,
4
+ "loadingMore": `\u{6B63}\u{5728}\u{8F09}\u{5165}\u{66F4}\u{591A}\u{2026}`
5
+ };
6
+
7
+
8
+ export {$b7e2865acb74a940$exports as default};
9
+ //# sourceMappingURL=zh-TW.module.js.map
@@ -0,0 +1,9 @@
1
+ var $b7e2865acb74a940$exports = {};
2
+ $b7e2865acb74a940$exports = {
3
+ "loading": `\u{8F09}\u{5165}\u{4E2D}\u{2026}`,
4
+ "loadingMore": `\u{6B63}\u{5728}\u{8F09}\u{5165}\u{66F4}\u{591A}\u{2026}`
5
+ };
6
+
7
+
8
+ export {$b7e2865acb74a940$exports as default};
9
+ //# sourceMappingURL=zh-TW.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,gCAAI,CAAC;IACnC,eAAe,CAAC,wDAAO,CAAC;AAC1B","sources":["packages/@react-spectrum/card/intl/zh-TW.json"],"sourcesContent":["{\n \"loading\": \"載入中…\",\n \"loadingMore\": \"正在載入更多…\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-spectrum/card",
3
- "version": "3.0.0-alpha.4",
3
+ "version": "3.0.0-alpha.41",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -31,36 +36,34 @@
31
36
  "url": "https://github.com/adobe/react-spectrum"
32
37
  },
33
38
  "dependencies": {
34
- "@babel/runtime": "^7.6.2",
35
- "@react-aria/focus": "^3.5.2",
36
- "@react-aria/grid": "^3.2.3",
37
- "@react-aria/i18n": "^3.3.6",
38
- "@react-aria/interactions": "^3.8.1",
39
- "@react-aria/utils": "^3.11.2",
40
- "@react-aria/virtualizer": "^3.3.7",
41
- "@react-spectrum/checkbox": "^3.3.1",
42
- "@react-spectrum/divider": "^3.2.1",
43
- "@react-spectrum/layout": "^3.2.3",
44
- "@react-spectrum/progress": "^3.1.5",
45
- "@react-spectrum/utils": "^3.6.5",
46
- "@react-stately/collections": "^3.3.6",
47
- "@react-stately/grid": "^3.1.2",
48
- "@react-stately/list": "^3.4.3",
49
- "@react-stately/utils": "^3.4.1",
50
- "@react-stately/virtualizer": "^3.1.7",
51
- "@react-types/card": "3.0.0-alpha.3",
52
- "@react-types/provider": "^3.4.1",
53
- "@react-types/shared": "^3.11.1"
39
+ "@react-aria/focus": "^3.20.1",
40
+ "@react-aria/grid": "^3.12.1",
41
+ "@react-aria/i18n": "^3.12.7",
42
+ "@react-aria/interactions": "^3.24.1",
43
+ "@react-aria/utils": "^3.28.1",
44
+ "@react-aria/virtualizer": "^4.1.3",
45
+ "@react-spectrum/checkbox": "^3.9.14",
46
+ "@react-spectrum/progress": "^3.7.14",
47
+ "@react-spectrum/utils": "^3.12.3",
48
+ "@react-stately/collections": "^3.12.2",
49
+ "@react-stately/grid": "^3.11.0",
50
+ "@react-stately/list": "^3.12.0",
51
+ "@react-stately/virtualizer": "^4.3.1",
52
+ "@react-types/card": "3.0.0-alpha.34",
53
+ "@react-types/provider": "^3.8.7",
54
+ "@react-types/shared": "^3.28.0",
55
+ "@swc/helpers": "^0.5.0"
54
56
  },
55
57
  "devDependencies": {
56
58
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
57
59
  },
58
60
  "peerDependencies": {
59
61
  "@react-spectrum/provider": "^3.0.0",
60
- "react": "^16.8.0 || ^17.0.0-rc.1"
62
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
63
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
61
64
  },
62
65
  "publishConfig": {
63
66
  "access": "public"
64
67
  },
65
- "gitHead": "b98f0e60590d784afd54140916576021d4c1bfd7"
68
+ "gitHead": "9c4ebbc0c1972cc880febc29de995ca58caa3ba4"
66
69
  }
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /*
2
3
  * Copyright 2021 Adobe. All rights reserved.
3
4
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -10,10 +11,10 @@
10
11
  * governing permissions and limitations under the License.
11
12
  */
12
13
 
13
- import {Direction, KeyboardDelegate, Node} from '@react-types/shared';
14
+ import {Direction, Key, KeyboardDelegate, Node} from '@react-types/shared';
15
+ import {getChildNodes, getFirstItem} from '@react-stately/collections';
14
16
  import {GridCollection} from '@react-stately/grid';
15
17
  import {InvalidationContext, Layout, LayoutInfo, Rect, Size} from '@react-stately/virtualizer';
16
- import {Key} from 'react';
17
18
  import {Scale} from '@react-types/provider';
18
19
 
19
20
  export interface BaseLayoutOptions {
@@ -27,7 +28,12 @@ export interface BaseLayoutOptions {
27
28
  margin?: number
28
29
  }
29
30
 
30
- export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
31
+ interface CardViewLayoutOptions {
32
+ isLoading: boolean,
33
+ direction: Direction
34
+ }
35
+
36
+ export class BaseLayout<T> extends Layout<Node<T>, CardViewLayoutOptions> implements KeyboardDelegate {
31
37
  protected contentSize: Size;
32
38
  protected layoutInfos: Map<Key, LayoutInfo>;
33
39
  protected collator: Intl.Collator;
@@ -48,8 +54,10 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
48
54
  this.margin = options.margin || 24;
49
55
  }
50
56
 
51
- validate(invalidationContext: InvalidationContext<Node<T>, unknown>) {
57
+ update(invalidationContext: InvalidationContext<CardViewLayoutOptions>) {
52
58
  this.collection = this.virtualizer.collection as GridCollection<T>;
59
+ this.isLoading = invalidationContext.layoutOptions?.isLoading || false;
60
+ this.direction = invalidationContext.layoutOptions?.direction || 'ltr';
53
61
  this.buildCollection(invalidationContext);
54
62
 
55
63
  // Remove layout info that doesn't exist in new collection
@@ -73,21 +81,21 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
73
81
  }
74
82
 
75
83
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
76
- buildCollection(invalidationContext?: InvalidationContext<Node<T>, unknown>) {}
84
+ buildCollection(invalidationContext?: InvalidationContext) {}
77
85
 
78
86
  getContentSize() {
79
87
  return this.contentSize;
80
88
  }
81
89
 
82
90
  getLayoutInfo(key: Key) {
83
- return this.layoutInfos.get(key);
91
+ return this.layoutInfos.get(key)!;
84
92
  }
85
93
 
86
- getVisibleLayoutInfos(rect) {
94
+ getVisibleLayoutInfos(rect: Rect, excludePersistedKeys = false) {
87
95
  let res: LayoutInfo[] = [];
88
96
 
89
97
  for (let layoutInfo of this.layoutInfos.values()) {
90
- if (this.isVisible(layoutInfo, rect)) {
98
+ if (this.isVisible(layoutInfo, rect, excludePersistedKeys)) {
91
99
  res.push(layoutInfo);
92
100
  }
93
101
  }
@@ -95,24 +103,20 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
95
103
  return res;
96
104
  }
97
105
 
98
- isVisible(layoutInfo: LayoutInfo, rect: Rect) {
99
- return layoutInfo.rect.intersects(rect);
100
- }
106
+ isVisible(layoutInfo: LayoutInfo, rect: Rect, excludePersistedKeys: boolean) {
107
+ if (layoutInfo.rect.intersects(rect)) {
108
+ return true;
109
+ }
101
110
 
102
- getInitialLayoutInfo(layoutInfo: LayoutInfo) {
103
- layoutInfo.opacity = 0;
104
- layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
105
- return layoutInfo;
106
- }
111
+ if (!excludePersistedKeys) {
112
+ return this.virtualizer.isPersistedKey(layoutInfo.key);
113
+ }
107
114
 
108
- getFinalLayoutInfo(layoutInfo: LayoutInfo) {
109
- layoutInfo.opacity = 0;
110
- layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
111
- return layoutInfo;
115
+ return false;
112
116
  }
113
117
 
114
118
  _findClosestLayoutInfo(target: Rect, rect: Rect) {
115
- let layoutInfos = this.getVisibleLayoutInfos(rect);
119
+ let layoutInfos = this.getVisibleLayoutInfos(rect, true);
116
120
  let best = null;
117
121
  let bestDistance = Infinity;
118
122
 
@@ -146,7 +150,7 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
146
150
  let layoutInfo = this.getLayoutInfo(parentRowKey);
147
151
  let rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);
148
152
  let closestRow = this.collection.getItem(this._findClosest(layoutInfo.rect, rect)?.key);
149
- return closestRow?.childNodes[0]?.key;
153
+ return getFirstItem(getChildNodes(closestRow, this.collection))?.key;
150
154
  }
151
155
 
152
156
  getKeyAbove(key: Key) {
@@ -155,7 +159,7 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
155
159
  let layoutInfo = this.getLayoutInfo(parentRowKey);
156
160
  let rect = new Rect(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);
157
161
  let closestRow = this.collection.getItem(this._findClosest(layoutInfo.rect, rect)?.key);
158
- return closestRow?.childNodes[0]?.key;
162
+ return getFirstItem(getChildNodes(closestRow, this.collection))?.key;
159
163
  }
160
164
 
161
165
  getKeyRightOf(key: Key) {
@@ -167,7 +171,7 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
167
171
  let item = this.collection.getItem(key);
168
172
  // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
169
173
  if (item.type === 'item') {
170
- return item.childNodes[0].key;
174
+ return getFirstItem(getChildNodes(item, this.collection))?.key;
171
175
  }
172
176
  key = this.direction === 'rtl' ? this.collection.getKeyBefore(key) : this.collection.getKeyAfter(key);
173
177
  }
@@ -181,7 +185,7 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
181
185
  let item = this.collection.getItem(key);
182
186
  // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
183
187
  if (item.type === 'item') {
184
- return item.childNodes[0].key;
188
+ return getFirstItem(getChildNodes(item, this.collection))?.key;
185
189
  }
186
190
 
187
191
  key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);
@@ -190,12 +194,12 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
190
194
 
191
195
  getFirstKey() {
192
196
  let firstRow = this.collection.getItem(this.collection.getFirstKey());
193
- return firstRow.childNodes[0].key;
197
+ return getFirstItem(getChildNodes(firstRow, this.collection))?.key;
194
198
  }
195
199
 
196
200
  getLastKey() {
197
201
  let lastRow = this.collection.getItem(this.collection.getLastKey());
198
- return lastRow.childNodes[0].key;
202
+ return getFirstItem(getChildNodes(lastRow, this.collection))?.key;
199
203
  }
200
204
 
201
205
  // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
@@ -214,14 +218,14 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
214
218
 
215
219
  if (layoutInfo && layoutInfo.rect.y > pageY) {
216
220
  while (layoutInfo && layoutInfo.rect.y > pageY) {
217
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
221
+ let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;
218
222
  let keyAbove = this.collection.getItem(this.getKeyAbove(childKey))?.parentKey;
219
223
  layoutInfo = this.getLayoutInfo(keyAbove);
220
224
  }
221
225
  }
222
226
 
223
227
  if (layoutInfo) {
224
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
228
+ let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;
225
229
  return childKey;
226
230
  }
227
231
  }
@@ -243,14 +247,14 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
243
247
  layoutInfo = this.getLayoutInfo(keyBelow);
244
248
  if (layoutInfo && layoutInfo.rect.y < pageY) {
245
249
  while (layoutInfo && layoutInfo.rect.y < pageY) {
246
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
250
+ let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;
247
251
  let keyBelow = this.collection.getItem(this.getKeyBelow(childKey))?.parentKey;
248
252
  layoutInfo = this.getLayoutInfo(keyBelow);
249
253
  }
250
254
  }
251
255
 
252
256
  if (layoutInfo) {
253
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
257
+ let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;
254
258
  return childKey;
255
259
  }
256
260
  }
@@ -274,7 +278,7 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
274
278
  if (item.textValue) {
275
279
  let substring = item.textValue.slice(0, search.length);
276
280
  if (this.collator.compare(substring, search) === 0) {
277
- return [...item.childNodes][0].key;
281
+ return getFirstItem(getChildNodes(item, this.collection))?.key;
278
282
  }
279
283
  }
280
284
 
package/src/Card.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /*
2
3
  * Copyright 2021 Adobe. All rights reserved.
3
4
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/src/CardBase.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /*
2
3
  * Copyright 2021 Adobe. All rights reserved.
3
4
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -15,8 +16,7 @@ import {Checkbox} from '@react-spectrum/checkbox';
15
16
  import {classNames, SlotProvider, useDOMRef, useHasChild, useStyleProps} from '@react-spectrum/utils';
16
17
  import {DOMRef, Node} from '@react-types/shared';
17
18
  import {filterDOMProps, mergeProps, useLayoutEffect, useResizeObserver, useSlotId} from '@react-aria/utils';
18
- import {FocusRing} from '@react-aria/focus';
19
- import {getFocusableTreeWalker} from '@react-aria/focus';
19
+ import {FocusRing, getFocusableTreeWalker} from '@react-aria/focus';
20
20
  import React, {HTMLAttributes, useCallback, useMemo, useRef, useState} from 'react';
21
21
  import styles from '@adobe/spectrum-css-temp/components/card/vars.css';
22
22
  import {useCardViewContext} from './CardViewContext';
@@ -28,7 +28,10 @@ interface CardBaseProps<T> extends SpectrumCardProps {
28
28
  item?: Node<T>
29
29
  }
30
30
 
31
- function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDivElement>) {
31
+ /**
32
+ * TODO: Add description of component here.
33
+ */
34
+ export const CardBase = React.forwardRef(function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDivElement>) {
32
35
  props = useProviderProps(props);
33
36
  let context = useCardViewContext() || {}; // we can call again here, won't change from Card.tsx
34
37
  let {state} = context;
@@ -50,7 +53,7 @@ function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDiv
50
53
  let {styleProps} = useStyleProps(props);
51
54
  let {cardProps, titleProps, contentProps} = useCard(props);
52
55
  let domRef = useDOMRef(ref);
53
- let gridRef = useRef<HTMLDivElement>();
56
+ let gridRef = useRef<HTMLDivElement>(undefined);
54
57
  let checkboxRef = useRef(null);
55
58
 
56
59
  // cards are only interactive if there is a selection manager and it allows selection
@@ -93,6 +96,7 @@ function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDiv
93
96
  heading: {UNSAFE_className: classNames(styles, 'spectrum-Card-heading'), ...titleProps},
94
97
  content: {UNSAFE_className: classNames(styles, 'spectrum-Card-content'), ...contentProps},
95
98
  detail: {UNSAFE_className: classNames(styles, 'spectrum-Card-detail')}
99
+ // eslint-disable-next-line react-hooks/exhaustive-deps
96
100
  }), [titleProps, contentProps, height, isQuiet, orientation]);
97
101
 
98
102
  useLayoutEffect(() => {
@@ -150,7 +154,7 @@ function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDiv
150
154
  </article>
151
155
  </FocusRing>
152
156
  );
153
- }
157
+ });
154
158
 
155
159
  interface AriaCardOptions extends AriaCardProps {
156
160
  }
@@ -182,9 +186,3 @@ function useCard(props: AriaCardOptions): CardAria {
182
186
  contentProps
183
187
  };
184
188
  }
185
-
186
- /**
187
- * TODO: Add description of component here.
188
- */
189
- const _CardBase = React.forwardRef(CardBase);
190
- export {_CardBase as CardBase};
package/src/CardView.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /*
2
3
  * Copyright 2021 Adobe. All rights reserved.
3
4
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -17,18 +18,22 @@ import {DOMRef, DOMRefValue, Node} from '@react-types/shared';
17
18
  import {GridCollection, useGridState} from '@react-stately/grid';
18
19
  // @ts-ignore
19
20
  import intlMessages from '../intl/*.json';
21
+ import {mergeProps} from '@react-aria/utils';
20
22
  import {ProgressCircle} from '@react-spectrum/progress';
21
- import React, {ReactElement, useCallback, useMemo, useRef} from 'react';
23
+ import React, {ReactElement, ReactNode, useCallback, useMemo, useRef} from 'react';
22
24
  import {ReusableView} from '@react-stately/virtualizer';
23
25
  import {SpectrumCardViewProps} from '@react-types/card';
24
26
  import styles from '@adobe/spectrum-css-temp/components/card/vars.css';
25
- import {useCollator, useLocale, useMessageFormatter} from '@react-aria/i18n';
27
+ import {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';
26
28
  import {useGrid, useGridCell, useGridRow} from '@react-aria/grid';
27
29
  import {useListState} from '@react-stately/list';
28
30
  import {useProvider} from '@react-spectrum/provider';
29
31
  import {Virtualizer, VirtualizerItem} from '@react-aria/virtualizer';
30
32
 
31
- function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef<HTMLDivElement>) {
33
+ /**
34
+ * TODO: Add description of component here.
35
+ */
36
+ export const CardView = React.forwardRef(function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef<HTMLDivElement>) {
32
37
  let {scale} = useProvider();
33
38
  let {styleProps} = useStyleProps(props);
34
39
  let domRef = useDOMRef(ref);
@@ -46,7 +51,6 @@ function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef
46
51
  let cardViewLayout = useMemo(() => typeof layout === 'function' ? new layout({collator, cardOrientation, scale}) : layout, [layout, collator, cardOrientation, scale]);
47
52
  let layoutType = cardViewLayout.layoutType;
48
53
 
49
- let formatMessage = useMessageFormatter(intlMessages);
50
54
  let {direction} = useLocale();
51
55
  let {collection} = useListState(props);
52
56
 
@@ -78,8 +82,6 @@ function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef
78
82
 
79
83
  cardViewLayout.collection = gridCollection;
80
84
  cardViewLayout.disabledKeys = state.disabledKeys;
81
- cardViewLayout.isLoading = isLoading;
82
- cardViewLayout.direction = direction;
83
85
 
84
86
  let {gridProps} = useGrid({
85
87
  ...props,
@@ -87,13 +89,16 @@ function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef
87
89
  keyboardDelegate: cardViewLayout
88
90
  }, state, domRef);
89
91
 
90
- type View = ReusableView<Node<T>, unknown>;
91
- let renderWrapper = (parent: View, reusableView: View) => (
92
+ type View = ReusableView<Node<T>, ReactNode>;
93
+ let renderWrapper = useCallback((parent: View, reusableView: View) => (
92
94
  <VirtualizerItem
93
95
  key={reusableView.key}
94
- reusableView={reusableView}
95
- parent={parent} />
96
- );
96
+ layoutInfo={reusableView.layoutInfo}
97
+ virtualizer={reusableView.virtualizer}
98
+ parent={parent?.layoutInfo}>
99
+ {reusableView.rendered}
100
+ </VirtualizerItem>
101
+ ), []);
97
102
 
98
103
  let focusedKey = state.selectionManager.focusedKey;
99
104
  let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
@@ -101,62 +106,69 @@ function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef
101
106
  focusedKey = focusedItem.parentKey;
102
107
  }
103
108
 
104
- let margin = cardViewLayout.margin || 0;
105
- let virtualizer = cardViewLayout.virtualizer;
106
- let scrollToItem = useCallback((key) => {
107
- virtualizer && virtualizer.scrollToItem(key, {
108
- duration: 0,
109
- offsetY: margin
110
- });
111
- }, [margin, virtualizer]);
109
+ let persistedKeys = useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);
112
110
 
113
111
  // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
114
112
  return (
115
- <CardViewContext.Provider value={{state, isQuiet, layout: cardViewLayout, cardOrientation}}>
113
+ <CardViewContext.Provider value={{state, isQuiet, layout: cardViewLayout, cardOrientation, renderEmptyState}}>
116
114
  <Virtualizer
117
115
  {...gridProps}
118
116
  {...styleProps}
119
117
  className={classNames(styles, 'spectrum-CardView')}
120
118
  ref={domRef}
121
- focusedKey={focusedKey}
119
+ persistedKeys={persistedKeys}
122
120
  scrollDirection="vertical"
123
121
  layout={cardViewLayout}
124
122
  collection={gridCollection}
125
123
  isLoading={isLoading}
126
124
  onLoadMore={onLoadMore}
125
+ layoutOptions={useMemo(() => ({isLoading, direction}), [isLoading, direction])}
127
126
  renderWrapper={renderWrapper}
128
- transitionDuration={isLoading ? 160 : 220}
129
- scrollToItem={scrollToItem}>
130
- {(type, item) => {
127
+ style={{
128
+ ...styleProps.style,
129
+ scrollPaddingTop: cardViewLayout.margin || 0
130
+ }}>
131
+ {useCallback((type, item) => {
131
132
  if (type === 'item') {
132
133
  return (
133
134
  <InternalCard item={item} />
134
135
  );
135
136
  } else if (type === 'loader') {
136
- return (
137
- <CenteredWrapper>
138
- <ProgressCircle
139
- isIndeterminate
140
- aria-label={state.collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')} />
141
- </CenteredWrapper>
142
- );
137
+ return <LoadingState />;
143
138
  } else if (type === 'placeholder') {
144
- let emptyState = renderEmptyState ? renderEmptyState() : null;
145
- if (emptyState == null) {
146
- return null;
147
- }
148
-
149
- return (
150
- <CenteredWrapper>
151
- {emptyState}
152
- </CenteredWrapper>
153
- );
139
+ return <EmptyState />;
154
140
  }
155
- }}
141
+ }, [])}
156
142
  </Virtualizer>
157
143
  </CardViewContext.Provider>
158
144
 
159
145
  );
146
+ }) as <T>(props: SpectrumCardViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;
147
+
148
+ function LoadingState() {
149
+ let {state} = useCardViewContext();
150
+ let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/card');
151
+ return (
152
+ <CenteredWrapper>
153
+ <ProgressCircle
154
+ isIndeterminate
155
+ aria-label={state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')} />
156
+ </CenteredWrapper>
157
+ );
158
+ }
159
+
160
+ function EmptyState() {
161
+ let {renderEmptyState} = useCardViewContext();
162
+ let emptyState = renderEmptyState ? renderEmptyState() : null;
163
+ if (emptyState == null) {
164
+ return null;
165
+ }
166
+
167
+ return (
168
+ <CenteredWrapper>
169
+ {emptyState}
170
+ </CenteredWrapper>
171
+ );
160
172
  }
161
173
 
162
174
  function CenteredWrapper({children}) {
@@ -181,11 +193,11 @@ function InternalCard(props) {
181
193
  let {state, cardOrientation, isQuiet, layout} = useCardViewContext();
182
194
 
183
195
  let layoutType = layout.layoutType;
184
- let rowRef = useRef();
185
- let cellRef = useRef<DOMRefValue<HTMLDivElement>>();
196
+ let rowRef = useRef(undefined);
197
+ let cellRef = useRef<DOMRefValue<HTMLDivElement>>(undefined);
186
198
  let unwrappedRef = useUnwrapDOMRef(cellRef);
187
199
 
188
- let {rowProps} = useGridRow({
200
+ let {rowProps: gridRowProps} = useGridRow({
189
201
  node: item,
190
202
  isVirtualized: true
191
203
  }, state, rowRef);
@@ -195,6 +207,20 @@ function InternalCard(props) {
195
207
  focusMode: 'cell'
196
208
  }, state, unwrappedRef);
197
209
 
210
+ // Prevent space key from scrolling the CardView if triggered on a disabled item or on a Card in a selectionMode="none" CardView.
211
+ let allowsInteraction = state.selectionManager.selectionMode !== 'none';
212
+ let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
213
+
214
+ let onKeyDown = (e) => {
215
+ if (e.key === ' ' && isDisabled) {
216
+ e.preventDefault();
217
+ }
218
+ };
219
+
220
+ let rowProps = mergeProps(
221
+ gridRowProps,
222
+ {onKeyDown}
223
+ );
198
224
 
199
225
  if (layoutType === 'grid' || layoutType === 'gallery') {
200
226
  isQuiet = true;
@@ -222,9 +248,3 @@ function InternalCard(props) {
222
248
  </div>
223
249
  );
224
250
  }
225
-
226
- /**
227
- * TODO: Add description of component here.
228
- */
229
- const _CardView = React.forwardRef(CardView) as <T>(props: SpectrumCardViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;
230
- export {_CardView as CardView};
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /*
2
3
  * Copyright 2020 Adobe. All rights reserved.
3
4
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");