@atlaskit/media-card 73.7.0 → 74.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/cjs/errors.js +4 -0
  3. package/dist/cjs/files/cardImageView/cardImageViewWrapper.js +60 -0
  4. package/dist/cjs/files/cardImageView/cardOverlay/cardOverlayComponents.js +63 -0
  5. package/dist/cjs/files/cardImageView/cardOverlay/index.js +31 -19
  6. package/dist/cjs/files/cardImageView/cardOverlay/styles.js +75 -0
  7. package/dist/cjs/files/cardImageView/index.js +39 -28
  8. package/dist/cjs/files/cardImageView/styles.js +60 -0
  9. package/dist/cjs/index.js +2 -2
  10. package/dist/cjs/root/card/cardAnalytics.js +6 -2
  11. package/dist/cjs/root/card/getCardPreview/cache.js +9 -10
  12. package/dist/cjs/root/card/getCardPreview/index.js +65 -28
  13. package/dist/cjs/root/card/imageRefetchingAnalytics.js +45 -0
  14. package/dist/cjs/root/card/index.js +31 -31
  15. package/dist/cjs/root/cardView.js +48 -46
  16. package/dist/cjs/root/cardViewWrapper.js +35 -0
  17. package/dist/cjs/root/inlinePlayer.js +12 -14
  18. package/dist/cjs/root/inlinePlayerWrapper.js +32 -0
  19. package/dist/cjs/root/styles.js +57 -0
  20. package/dist/cjs/root/types.js +5 -0
  21. package/dist/cjs/root/ui/actionsBar/actionsBar.js +2 -2
  22. package/dist/cjs/root/ui/actionsBar/actionsBarWrapper.js +21 -0
  23. package/dist/cjs/root/ui/actionsBar/styles.js +28 -0
  24. package/dist/cjs/root/ui/actionsBar/types.js +5 -0
  25. package/dist/cjs/root/ui/blanket/blanket.js +21 -0
  26. package/dist/cjs/root/ui/blanket/styles.js +30 -0
  27. package/dist/cjs/root/ui/iconMessage/iconMessageWrapper.js +25 -0
  28. package/dist/cjs/root/ui/iconMessage/index.js +3 -5
  29. package/dist/cjs/root/ui/iconMessage/styles.js +32 -0
  30. package/dist/cjs/root/ui/iconMessage/types.js +5 -0
  31. package/dist/cjs/root/ui/iconWrapper/iconWrapper.js +25 -0
  32. package/dist/cjs/root/ui/iconWrapper/{styled.js → styles.js} +7 -7
  33. package/dist/cjs/root/ui/iconWrapper/types.js +5 -0
  34. package/dist/cjs/root/ui/loadingRateLimited/styles.js +36 -0
  35. package/dist/cjs/root/ui/newFileExperience/newFileExperienceWrapper.js +52 -0
  36. package/dist/cjs/root/ui/newFileExperience/styles.js +47 -0
  37. package/dist/cjs/root/ui/newFileExperience/types.js +5 -0
  38. package/dist/cjs/root/ui/playButton/playButton.js +4 -2
  39. package/dist/cjs/root/ui/playButton/playButtonBackground.js +20 -0
  40. package/dist/cjs/root/ui/playButton/playButtonWrapper.js +20 -0
  41. package/dist/cjs/root/ui/playButton/styles.js +29 -0
  42. package/dist/cjs/root/ui/progressBar/progressBar.js +10 -5
  43. package/dist/cjs/root/ui/progressBar/styledBar.js +29 -0
  44. package/dist/cjs/root/ui/progressBar/{styled.js → styles.js} +11 -7
  45. package/dist/cjs/root/ui/progressBar/types.js +5 -0
  46. package/dist/cjs/root/ui/{styled.js → styles.js} +22 -39
  47. package/dist/cjs/root/ui/tickBox/styles.js +36 -0
  48. package/dist/cjs/root/ui/tickBox/tickBox.js +3 -3
  49. package/dist/cjs/root/ui/tickBox/tickBoxWrapper.js +21 -0
  50. package/dist/cjs/root/ui/tickBox/types.js +5 -0
  51. package/dist/cjs/root/ui/titleBox/failedTitleBox.js +5 -7
  52. package/dist/cjs/root/ui/titleBox/styles.js +62 -0
  53. package/dist/cjs/root/ui/titleBox/titleBox.js +7 -7
  54. package/dist/cjs/root/ui/titleBox/titleBoxComponents.js +66 -0
  55. package/dist/cjs/root/ui/titleBox/types.js +5 -0
  56. package/dist/cjs/styles/animations.js +2 -2
  57. package/dist/cjs/styles/index.js +12 -7
  58. package/dist/cjs/utils/analytics.js +29 -2
  59. package/dist/cjs/utils/cardActions/cardActionButton.js +24 -0
  60. package/dist/cjs/utils/cardActions/cardActionIconButton.js +2 -3
  61. package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +3 -3
  62. package/dist/cjs/utils/cardActions/cardActionsView.js +11 -13
  63. package/dist/cjs/utils/cardActions/index.js +2 -2
  64. package/dist/cjs/utils/cardActions/{styled.js → styles.js} +8 -8
  65. package/dist/cjs/utils/document.js +9 -1
  66. package/dist/cjs/utils/errorIcon/index.js +8 -10
  67. package/dist/cjs/utils/errorIcon/styles.js +17 -0
  68. package/dist/cjs/utils/fileIcon/index.js +9 -14
  69. package/dist/cjs/utils/fileIcon/styles.js +19 -0
  70. package/dist/cjs/utils/lightCards/cardError.js +2 -2
  71. package/dist/cjs/utils/lightCards/cardLoading.js +3 -3
  72. package/dist/cjs/utils/lightCards/lightCardWrappers.js +41 -0
  73. package/dist/cjs/utils/lightCards/styles.js +47 -0
  74. package/dist/cjs/utils/mediaTypeIcon/iconWrapper.js +20 -0
  75. package/dist/cjs/utils/mediaTypeIcon/index.js +2 -2
  76. package/dist/cjs/utils/mediaTypeIcon/{styled.js → styles.js} +9 -5
  77. package/dist/cjs/utils/mediaTypeIcon/types.js +5 -0
  78. package/dist/cjs/utils/progressBar/index.js +7 -9
  79. package/dist/cjs/utils/progressBar/styles.js +19 -0
  80. package/dist/cjs/utils/ufoExperiences.js +12 -8
  81. package/dist/cjs/utils/viewportDetector.js +11 -36
  82. package/dist/cjs/version.json +1 -1
  83. package/dist/es2019/errors.js +4 -0
  84. package/dist/es2019/files/cardImageView/cardImageViewWrapper.js +43 -0
  85. package/dist/es2019/files/cardImageView/cardOverlay/cardOverlayComponents.js +41 -0
  86. package/dist/es2019/files/cardImageView/cardOverlay/index.js +29 -15
  87. package/dist/es2019/files/cardImageView/cardOverlay/{styled.js → styles.js} +34 -25
  88. package/dist/es2019/files/cardImageView/index.js +38 -26
  89. package/dist/es2019/files/cardImageView/{styled.js → styles.js} +15 -14
  90. package/dist/es2019/index.js +1 -1
  91. package/dist/es2019/root/card/cardAnalytics.js +3 -2
  92. package/dist/es2019/root/card/getCardPreview/cache.js +9 -10
  93. package/dist/es2019/root/card/getCardPreview/index.js +43 -10
  94. package/dist/es2019/root/card/imageRefetchingAnalytics.js +30 -0
  95. package/dist/es2019/root/card/index.js +28 -28
  96. package/dist/es2019/root/cardView.js +39 -36
  97. package/dist/es2019/root/cardViewWrapper.js +26 -0
  98. package/dist/es2019/root/inlinePlayer.js +6 -6
  99. package/dist/es2019/root/inlinePlayerWrapper.js +23 -0
  100. package/dist/es2019/root/{styled.js → styles.js} +18 -19
  101. package/dist/es2019/root/types.js +1 -0
  102. package/dist/es2019/root/ui/actionsBar/actionsBar.js +2 -2
  103. package/dist/es2019/root/ui/actionsBar/actionsBarWrapper.js +10 -0
  104. package/dist/es2019/root/ui/actionsBar/styles.js +15 -0
  105. package/dist/es2019/root/ui/actionsBar/types.js +1 -0
  106. package/dist/es2019/root/ui/blanket/blanket.js +12 -0
  107. package/dist/es2019/root/ui/blanket/styles.js +17 -0
  108. package/dist/es2019/root/ui/iconMessage/iconMessageWrapper.js +16 -0
  109. package/dist/es2019/root/ui/iconMessage/index.js +2 -3
  110. package/dist/es2019/root/ui/iconMessage/styles.js +32 -0
  111. package/dist/es2019/root/ui/iconMessage/types.js +1 -0
  112. package/dist/es2019/root/ui/iconWrapper/iconWrapper.js +16 -0
  113. package/dist/es2019/root/ui/iconWrapper/styles.js +25 -0
  114. package/dist/es2019/root/ui/iconWrapper/types.js +1 -0
  115. package/dist/es2019/root/ui/loadingRateLimited/styles.js +41 -0
  116. package/dist/es2019/root/ui/newFileExperience/newFileExperienceWrapper.js +42 -0
  117. package/dist/es2019/root/ui/newFileExperience/styles.js +50 -0
  118. package/dist/es2019/root/ui/newFileExperience/types.js +1 -0
  119. package/dist/es2019/root/ui/playButton/playButton.js +3 -2
  120. package/dist/es2019/root/ui/playButton/playButtonBackground.js +9 -0
  121. package/dist/es2019/root/ui/playButton/playButtonWrapper.js +9 -0
  122. package/dist/es2019/root/ui/playButton/{styled.js → styles.js} +5 -11
  123. package/dist/es2019/root/ui/progressBar/progressBar.js +5 -3
  124. package/dist/es2019/root/ui/progressBar/styledBar.js +20 -0
  125. package/dist/es2019/root/ui/progressBar/{styled.js → styles.js} +28 -24
  126. package/dist/es2019/root/ui/progressBar/types.js +1 -0
  127. package/dist/es2019/root/ui/styles.js +78 -0
  128. package/dist/es2019/root/ui/tickBox/styles.js +30 -0
  129. package/dist/es2019/root/ui/tickBox/tickBox.js +2 -2
  130. package/dist/es2019/root/ui/tickBox/tickBoxWrapper.js +10 -0
  131. package/dist/es2019/root/ui/tickBox/types.js +1 -0
  132. package/dist/es2019/root/ui/titleBox/failedTitleBox.js +3 -4
  133. package/dist/es2019/root/ui/titleBox/styles.js +68 -0
  134. package/dist/es2019/root/ui/titleBox/titleBox.js +2 -2
  135. package/dist/es2019/root/ui/titleBox/titleBoxComponents.js +49 -0
  136. package/dist/es2019/root/ui/titleBox/types.js +1 -0
  137. package/dist/es2019/styles/animations.js +1 -1
  138. package/dist/es2019/styles/index.js +4 -4
  139. package/dist/es2019/utils/analytics.js +18 -1
  140. package/dist/es2019/utils/cardActions/cardActionButton.js +13 -0
  141. package/dist/es2019/utils/cardActions/cardActionIconButton.js +1 -2
  142. package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +1 -1
  143. package/dist/es2019/utils/cardActions/cardActionsView.js +9 -6
  144. package/dist/es2019/utils/cardActions/index.js +1 -1
  145. package/dist/es2019/utils/cardActions/{styled.js → styles.js} +14 -12
  146. package/dist/es2019/utils/document.js +11 -1
  147. package/dist/es2019/utils/errorIcon/index.js +7 -3
  148. package/dist/es2019/utils/errorIcon/styles.js +5 -0
  149. package/dist/es2019/utils/fileIcon/index.js +7 -5
  150. package/dist/es2019/utils/fileIcon/{styled.js → styles.js} +2 -2
  151. package/dist/es2019/utils/lightCards/cardError.js +1 -1
  152. package/dist/es2019/utils/lightCards/cardLoading.js +1 -1
  153. package/dist/es2019/utils/lightCards/lightCardWrappers.js +24 -0
  154. package/dist/es2019/utils/lightCards/{styled.js → styles.js} +16 -9
  155. package/dist/es2019/utils/mediaTypeIcon/iconWrapper.js +9 -0
  156. package/dist/es2019/utils/mediaTypeIcon/index.js +1 -1
  157. package/dist/es2019/utils/mediaTypeIcon/{styled.js → styles.js} +10 -5
  158. package/dist/es2019/utils/mediaTypeIcon/types.js +1 -0
  159. package/dist/es2019/utils/progressBar/index.js +6 -3
  160. package/dist/es2019/utils/progressBar/{styled.js → styles.js} +2 -2
  161. package/dist/es2019/utils/ufoExperiences.js +5 -3
  162. package/dist/es2019/utils/viewportDetector.js +9 -36
  163. package/dist/es2019/version.json +1 -1
  164. package/dist/esm/errors.js +4 -0
  165. package/dist/esm/files/cardImageView/cardImageViewWrapper.js +41 -0
  166. package/dist/esm/files/cardImageView/cardOverlay/cardOverlayComponents.js +39 -0
  167. package/dist/esm/files/cardImageView/cardOverlay/index.js +28 -15
  168. package/dist/esm/files/cardImageView/cardOverlay/styles.js +46 -0
  169. package/dist/esm/files/cardImageView/index.js +37 -26
  170. package/dist/esm/files/cardImageView/styles.js +36 -0
  171. package/dist/esm/index.js +1 -1
  172. package/dist/esm/root/card/cardAnalytics.js +5 -2
  173. package/dist/esm/root/card/getCardPreview/cache.js +9 -10
  174. package/dist/esm/root/card/getCardPreview/helpers.js +1 -1
  175. package/dist/esm/root/card/getCardPreview/index.js +64 -29
  176. package/dist/esm/root/card/imageRefetchingAnalytics.js +32 -0
  177. package/dist/esm/root/card/index.js +29 -31
  178. package/dist/esm/root/cardView.js +38 -36
  179. package/dist/esm/root/cardViewWrapper.js +24 -0
  180. package/dist/esm/root/inline/loader.js +1 -1
  181. package/dist/esm/root/inlinePlayer.js +7 -7
  182. package/dist/esm/root/inlinePlayerWrapper.js +21 -0
  183. package/dist/esm/root/styles.js +36 -0
  184. package/dist/esm/root/types.js +1 -0
  185. package/dist/esm/root/ui/actionsBar/actionsBar.js +2 -2
  186. package/dist/esm/root/ui/actionsBar/actionsBarWrapper.js +10 -0
  187. package/dist/esm/root/ui/actionsBar/styles.js +12 -0
  188. package/dist/esm/root/ui/actionsBar/types.js +1 -0
  189. package/dist/esm/root/ui/blanket/blanket.js +10 -0
  190. package/dist/esm/root/ui/blanket/styles.js +13 -0
  191. package/dist/esm/root/ui/iconMessage/iconMessageWrapper.js +14 -0
  192. package/dist/esm/root/ui/iconMessage/index.js +2 -3
  193. package/dist/esm/root/ui/iconMessage/styles.js +19 -0
  194. package/dist/esm/root/ui/iconMessage/types.js +1 -0
  195. package/dist/esm/root/ui/iconWrapper/iconWrapper.js +14 -0
  196. package/dist/esm/root/ui/iconWrapper/{styled.js → styles.js} +5 -5
  197. package/dist/esm/root/ui/iconWrapper/types.js +1 -0
  198. package/dist/esm/root/ui/loadingRateLimited/styles.js +17 -0
  199. package/dist/esm/root/ui/newFileExperience/newFileExperienceWrapper.js +40 -0
  200. package/dist/esm/root/ui/newFileExperience/styles.js +27 -0
  201. package/dist/esm/root/ui/newFileExperience/types.js +1 -0
  202. package/dist/esm/root/ui/playButton/playButton.js +3 -2
  203. package/dist/esm/root/ui/playButton/playButtonBackground.js +9 -0
  204. package/dist/esm/root/ui/playButton/playButtonWrapper.js +9 -0
  205. package/dist/esm/root/ui/playButton/styles.js +13 -0
  206. package/dist/esm/root/ui/progressBar/progressBar.js +5 -3
  207. package/dist/esm/root/ui/progressBar/styledBar.js +18 -0
  208. package/dist/esm/root/ui/progressBar/{styled.js → styles.js} +10 -5
  209. package/dist/esm/root/ui/progressBar/types.js +1 -0
  210. package/dist/esm/root/ui/styles.js +72 -0
  211. package/dist/esm/root/ui/tickBox/styles.js +16 -0
  212. package/dist/esm/root/ui/tickBox/tickBox.js +2 -2
  213. package/dist/esm/root/ui/tickBox/tickBoxWrapper.js +10 -0
  214. package/dist/esm/root/ui/tickBox/types.js +1 -0
  215. package/dist/esm/root/ui/titleBox/failedTitleBox.js +3 -4
  216. package/dist/esm/root/ui/titleBox/styles.js +39 -0
  217. package/dist/esm/root/ui/titleBox/titleBox.js +2 -2
  218. package/dist/esm/root/ui/titleBox/titleBoxComponents.js +43 -0
  219. package/dist/esm/root/ui/titleBox/types.js +1 -0
  220. package/dist/esm/styles/animations.js +1 -1
  221. package/dist/esm/styles/index.js +8 -4
  222. package/dist/esm/utils/analytics.js +22 -1
  223. package/dist/esm/utils/cardActions/cardActionButton.js +13 -0
  224. package/dist/esm/utils/cardActions/cardActionIconButton.js +1 -2
  225. package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +1 -1
  226. package/dist/esm/utils/cardActions/cardActionsView.js +9 -6
  227. package/dist/esm/utils/cardActions/index.js +1 -1
  228. package/dist/esm/utils/cardActions/{styled.js → styles.js} +6 -6
  229. package/dist/esm/utils/document.js +9 -1
  230. package/dist/esm/utils/errorIcon/index.js +6 -3
  231. package/dist/esm/utils/errorIcon/styles.js +6 -0
  232. package/dist/esm/utils/fileIcon/index.js +7 -5
  233. package/dist/esm/utils/fileIcon/styles.js +7 -0
  234. package/dist/esm/utils/lightCards/cardError.js +1 -1
  235. package/dist/esm/utils/lightCards/cardLoading.js +1 -1
  236. package/dist/esm/utils/lightCards/lightCardWrappers.js +24 -0
  237. package/dist/esm/utils/lightCards/styles.js +28 -0
  238. package/dist/esm/utils/mediaTypeIcon/iconWrapper.js +9 -0
  239. package/dist/esm/utils/mediaTypeIcon/index.js +1 -1
  240. package/dist/esm/utils/mediaTypeIcon/{styled.js → styles.js} +8 -3
  241. package/dist/esm/utils/mediaTypeIcon/types.js +1 -0
  242. package/dist/esm/utils/progressBar/index.js +6 -3
  243. package/dist/esm/utils/progressBar/styles.js +7 -0
  244. package/dist/esm/utils/ufoExperiences.js +7 -3
  245. package/dist/esm/utils/videoSnapshot.js +1 -1
  246. package/dist/esm/utils/viewportDetector.js +9 -36
  247. package/dist/esm/version.json +1 -1
  248. package/dist/types/errors.d.ts +5 -1
  249. package/dist/types/files/cardImageView/cardImageViewWrapper.d.ts +6 -0
  250. package/dist/types/files/cardImageView/cardOverlay/cardOverlayComponents.d.ts +8 -0
  251. package/dist/types/files/cardImageView/cardOverlay/index.d.ts +6 -4
  252. package/dist/types/files/cardImageView/cardOverlay/styles.d.ts +26 -0
  253. package/dist/types/files/cardImageView/index.d.ts +3 -1
  254. package/dist/types/files/cardImageView/styles.d.ts +24 -0
  255. package/dist/types/index.d.ts +1 -1
  256. package/dist/types/root/card/cardAnalytics.d.ts +1 -1
  257. package/dist/types/root/card/getCardPreview/cache.d.ts +9 -8
  258. package/dist/types/root/card/getCardPreview/index.d.ts +11 -6
  259. package/dist/types/root/card/imageRefetchingAnalytics.d.ts +10 -0
  260. package/dist/types/root/card/index.d.ts +0 -2
  261. package/dist/types/root/cardView.d.ts +4 -2
  262. package/dist/types/root/cardViewWrapper.d.ts +4 -0
  263. package/dist/types/root/inlinePlayer.d.ts +0 -1
  264. package/dist/types/root/inlinePlayerWrapper.d.ts +4 -0
  265. package/dist/types/root/styles.d.ts +10 -0
  266. package/dist/types/root/types.d.ts +24 -0
  267. package/dist/types/root/ui/actionsBar/actionsBar.d.ts +1 -5
  268. package/dist/types/root/ui/actionsBar/actionsBarWrapper.d.ts +4 -0
  269. package/dist/types/root/ui/actionsBar/styles.d.ts +6 -0
  270. package/dist/types/root/ui/actionsBar/types.d.ts +10 -0
  271. package/dist/types/root/ui/blanket/blanket.d.ts +6 -0
  272. package/dist/types/root/ui/blanket/styles.d.ts +6 -0
  273. package/dist/types/root/ui/iconMessage/iconMessageWrapper.d.ts +4 -0
  274. package/dist/types/root/ui/iconMessage/index.d.ts +1 -10
  275. package/dist/types/root/ui/iconMessage/styles.d.ts +5 -0
  276. package/dist/types/root/ui/iconMessage/types.d.ts +19 -0
  277. package/dist/types/root/ui/iconWrapper/iconWrapper.d.ts +4 -0
  278. package/dist/types/root/ui/iconWrapper/styles.d.ts +7 -0
  279. package/dist/types/root/ui/iconWrapper/types.d.ts +6 -0
  280. package/dist/types/root/ui/loadingRateLimited/styles.d.ts +13 -0
  281. package/dist/types/root/ui/newFileExperience/newFileExperienceWrapper.d.ts +4 -0
  282. package/dist/types/root/ui/newFileExperience/styles.d.ts +5 -0
  283. package/dist/types/root/ui/newFileExperience/types.d.ts +23 -0
  284. package/dist/types/root/ui/playButton/playButtonBackground.d.ts +3 -0
  285. package/dist/types/root/ui/playButton/playButtonWrapper.d.ts +3 -0
  286. package/dist/types/root/ui/playButton/styles.d.ts +5 -0
  287. package/dist/types/root/ui/progressBar/progressBar.d.ts +1 -0
  288. package/dist/types/root/ui/progressBar/styledBar.d.ts +4 -0
  289. package/dist/types/root/ui/progressBar/styles.d.ts +7 -0
  290. package/dist/types/root/ui/progressBar/types.d.ts +7 -0
  291. package/dist/types/root/ui/styles.d.ts +11 -0
  292. package/dist/types/root/ui/tickBox/styles.d.ts +7 -0
  293. package/dist/types/root/ui/tickBox/tickBox.d.ts +1 -3
  294. package/dist/types/root/ui/tickBox/tickBoxWrapper.d.ts +4 -0
  295. package/dist/types/root/ui/tickBox/types.d.ts +4 -0
  296. package/dist/types/root/ui/titleBox/failedTitleBox.d.ts +1 -7
  297. package/dist/types/root/ui/titleBox/styles.d.ts +15 -0
  298. package/dist/types/root/ui/titleBox/titleBox.d.ts +1 -13
  299. package/dist/types/root/ui/titleBox/titleBoxComponents.d.ts +8 -0
  300. package/dist/types/root/ui/titleBox/types.d.ts +32 -0
  301. package/dist/types/styles/animations.d.ts +1 -1
  302. package/dist/types/styles/index.d.ts +3 -4
  303. package/dist/types/styles/mixins.d.ts +2 -2
  304. package/dist/types/types.d.ts +2 -0
  305. package/dist/types/utils/analytics.d.ts +17 -1
  306. package/dist/types/utils/cardActions/cardActionButton.d.ts +4 -0
  307. package/dist/types/utils/cardActions/cardActionIconButton.d.ts +1 -1
  308. package/dist/types/utils/cardActions/cardActionsDropdownMenu.d.ts +1 -1
  309. package/dist/types/utils/cardActions/cardActionsView.d.ts +1 -1
  310. package/dist/types/utils/cardActions/index.d.ts +1 -1
  311. package/dist/types/utils/cardActions/styles.d.ts +18 -0
  312. package/dist/types/utils/document.d.ts +1 -1
  313. package/dist/types/utils/errorIcon/index.d.ts +3 -1
  314. package/dist/types/utils/errorIcon/styles.d.ts +1 -0
  315. package/dist/types/utils/fileIcon/index.d.ts +3 -1
  316. package/dist/types/utils/fileIcon/styles.d.ts +1 -0
  317. package/dist/types/utils/lightCards/lightCardWrappers.d.ts +5 -0
  318. package/dist/types/utils/lightCards/styles.d.ts +4 -0
  319. package/dist/types/utils/lightCards/types.d.ts +8 -0
  320. package/dist/types/utils/mediaTypeIcon/iconWrapper.d.ts +4 -0
  321. package/dist/types/utils/mediaTypeIcon/styles.d.ts +2 -0
  322. package/dist/types/utils/mediaTypeIcon/types.d.ts +6 -0
  323. package/dist/types/utils/progressBar/index.d.ts +3 -1
  324. package/dist/types/utils/progressBar/styles.d.ts +1 -0
  325. package/dist/types/utils/ufoExperiences.d.ts +1 -1
  326. package/dist/types/utils/viewportDetector.d.ts +0 -10
  327. package/example-helpers/cardViewWrapper.tsx +26 -0
  328. package/example-helpers/cards.tsx +417 -0
  329. package/example-helpers/styles.ts +115 -0
  330. package/package.json +12 -11
  331. package/report.api.md +269 -0
  332. package/dist/cjs/files/cardImageView/cardOverlay/styled.js +0 -86
  333. package/dist/cjs/files/cardImageView/styled.js +0 -73
  334. package/dist/cjs/root/styled.js +0 -58
  335. package/dist/cjs/root/ui/actionsBar/styled.js +0 -31
  336. package/dist/cjs/root/ui/blanket/styled.js +0 -33
  337. package/dist/cjs/root/ui/iconMessage/styled.js +0 -34
  338. package/dist/cjs/root/ui/loadingRateLimited/loadingRateLimited.js +0 -35
  339. package/dist/cjs/root/ui/loadingRateLimited/styled.js +0 -43
  340. package/dist/cjs/root/ui/playButton/styled.js +0 -38
  341. package/dist/cjs/root/ui/tickBox/styled.js +0 -37
  342. package/dist/cjs/root/ui/titleBox/styled.js +0 -67
  343. package/dist/cjs/utils/errorIcon/styled.js +0 -18
  344. package/dist/cjs/utils/fileIcon/styled.js +0 -20
  345. package/dist/cjs/utils/lightCards/styled.js +0 -43
  346. package/dist/cjs/utils/progressBar/styled.js +0 -20
  347. package/dist/es2019/root/ui/actionsBar/styled.js +0 -23
  348. package/dist/es2019/root/ui/blanket/styled.js +0 -25
  349. package/dist/es2019/root/ui/iconMessage/styled.js +0 -30
  350. package/dist/es2019/root/ui/iconWrapper/styled.js +0 -27
  351. package/dist/es2019/root/ui/loadingRateLimited/loadingRateLimited.js +0 -16
  352. package/dist/es2019/root/ui/loadingRateLimited/styled.js +0 -43
  353. package/dist/es2019/root/ui/styled.js +0 -134
  354. package/dist/es2019/root/ui/tickBox/styled.js +0 -41
  355. package/dist/es2019/root/ui/titleBox/styled.js +0 -81
  356. package/dist/es2019/utils/errorIcon/styled.js +0 -5
  357. package/dist/esm/files/cardImageView/cardOverlay/styled.js +0 -39
  358. package/dist/esm/files/cardImageView/styled.js +0 -34
  359. package/dist/esm/root/styled.js +0 -36
  360. package/dist/esm/root/ui/actionsBar/styled.js +0 -15
  361. package/dist/esm/root/ui/blanket/styled.js +0 -16
  362. package/dist/esm/root/ui/iconMessage/styled.js +0 -15
  363. package/dist/esm/root/ui/loadingRateLimited/loadingRateLimited.js +0 -17
  364. package/dist/esm/root/ui/loadingRateLimited/styled.js +0 -17
  365. package/dist/esm/root/ui/playButton/styled.js +0 -19
  366. package/dist/esm/root/ui/styled.js +0 -98
  367. package/dist/esm/root/ui/tickBox/styled.js +0 -21
  368. package/dist/esm/root/ui/titleBox/styled.js +0 -40
  369. package/dist/esm/utils/errorIcon/styled.js +0 -6
  370. package/dist/esm/utils/fileIcon/styled.js +0 -7
  371. package/dist/esm/utils/lightCards/styled.js +0 -19
  372. package/dist/esm/utils/progressBar/styled.js +0 -7
  373. package/dist/types/files/cardImageView/cardOverlay/styled.d.ts +0 -23
  374. package/dist/types/files/cardImageView/styled.d.ts +0 -276
  375. package/dist/types/root/styled.d.ts +0 -16
  376. package/dist/types/root/ui/actionsBar/styled.d.ts +0 -10
  377. package/dist/types/root/ui/blanket/styled.d.ts +0 -10
  378. package/dist/types/root/ui/iconMessage/styled.d.ts +0 -6
  379. package/dist/types/root/ui/iconWrapper/styled.d.ts +0 -8
  380. package/dist/types/root/ui/loadingRateLimited/loadingRateLimited.d.ts +0 -6
  381. package/dist/types/root/ui/loadingRateLimited/styled.d.ts +0 -11
  382. package/dist/types/root/ui/playButton/styled.d.ts +0 -9
  383. package/dist/types/root/ui/progressBar/styled.d.ts +0 -10
  384. package/dist/types/root/ui/styled.d.ts +0 -20
  385. package/dist/types/root/ui/tickBox/styled.d.ts +0 -10
  386. package/dist/types/root/ui/titleBox/styled.d.ts +0 -18
  387. package/dist/types/utils/cardActions/styled.d.ts +0 -12
  388. package/dist/types/utils/errorIcon/styled.d.ts +0 -2
  389. package/dist/types/utils/fileIcon/styled.d.ts +0 -2
  390. package/dist/types/utils/lightCards/styled.d.ts +0 -8
  391. package/dist/types/utils/mediaTypeIcon/styled.d.ts +0 -6
  392. package/dist/types/utils/progressBar/styled.d.ts +0 -2
  393. package/example-helpers/styled.ts +0 -137
@@ -1,4 +1,5 @@
1
- import styled, { keyframes } from 'styled-components';
1
+ import { css } from '@emotion/react';
2
+ import { keyframes } from '@emotion/react';
2
3
  import { center, borderRadius } from '@atlaskit/media-ui';
3
4
  import { themed } from '@atlaskit/theme/components';
4
5
  import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
@@ -15,25 +16,31 @@ export const blinkLoadingAnimation = keyframes`
15
16
  opacity: 1;
16
17
  }
17
18
  `;
18
- export const Wrapper = styled.div`
19
- ${center} background: ${themed({
19
+ export const wrapperStyles = ({
20
+ dimensions,
21
+ theme
22
+ }) => css`
23
+ ${center}
24
+ background: ${themed({
20
25
  light: N20,
21
26
  dark: DN50
27
+ })({
28
+ theme
22
29
  })};
23
30
  color: ${themed({
24
31
  light: N50,
25
32
  dark: DN100
33
+ })({
34
+ theme
26
35
  })};
27
36
  ${borderRadius}
28
37
  max-height: 100%;
29
38
  max-width: 100%;
30
-
31
- ${props => `
32
- width: ${props.dimensions.width};
33
- height: ${props.dimensions.height};
34
- `}
39
+ width: ${dimensions.width};
40
+ height: ${dimensions.height};
35
41
  `;
36
- export const AnimatedWrapper = styled(Wrapper)`
42
+ export const animatedWrapperStyles = props => css`
43
+ ${wrapperStyles(props)}
37
44
  > span {
38
45
  animation: ${blinkLoadingAnimation} 0.8s infinite;
39
46
  }
@@ -0,0 +1,9 @@
1
+ /**@jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { iconWrapperStyles } from './styles';
4
+ export const IconWrapper = props => {
5
+ return jsx("div", {
6
+ id: "iconWrapper",
7
+ css: iconWrapperStyles(props)
8
+ }, props.children);
9
+ };
@@ -5,7 +5,7 @@ import ArchiveIcon from '@atlaskit/icon/glyph/media-services/zip';
5
5
  import VideoIcon from '@atlaskit/icon/glyph/media-services/video';
6
6
  import DocIcon from '@atlaskit/icon/glyph/document';
7
7
  import UnknownIcon from '@atlaskit/icon/glyph/page';
8
- import { IconWrapper } from './styled';
8
+ import { IconWrapper } from './iconWrapper';
9
9
  const icons = {
10
10
  image: ImageIcon,
11
11
  audio: AudioIcon,
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  import { Y200, P200, B300 } from '@atlaskit/theme/colors';
3
3
  const typeToColorMap = {
4
4
  image: Y200,
@@ -9,9 +9,14 @@ const typeToColorMap = {
9
9
  archive: '' // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
10
10
 
11
11
  };
12
- export const IconWrapper = styled.div`
13
- display: inline-flex;
14
- color: ${({
12
+
13
+ const getWrapperColor = ({
15
14
  type
16
- }) => typeToColorMap[type] || typeToColorMap.unknown};
15
+ }) => {
16
+ return typeToColorMap[type] || typeToColorMap.unknown;
17
+ };
18
+
19
+ export const iconWrapperStyles = props => css`
20
+ display: inline-flex;
21
+ color: ${getWrapperColor(props)};
17
22
  `;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,7 @@
1
- import React from 'react';
1
+ /**@jsx jsx */
2
+ import { jsx } from '@emotion/react';
2
3
  import { Component } from 'react';
3
- import { ProgressWrapper } from './styled';
4
+ import { progressWrapperStyles } from './styles';
4
5
  export class ProgressBar extends Component {
5
6
  render() {
6
7
  if (typeof this.props.progress !== 'number') {
@@ -11,7 +12,9 @@ export class ProgressBar extends Component {
11
12
  const progressBarStyle = {
12
13
  width: `${progress * 100}%`
13
14
  };
14
- return /*#__PURE__*/React.createElement(ProgressWrapper, null, /*#__PURE__*/React.createElement("div", {
15
+ return jsx("div", {
16
+ css: progressWrapperStyles
17
+ }, jsx("div", {
15
18
  className: 'progressBar',
16
19
  style: progressBarStyle
17
20
  }));
@@ -1,6 +1,6 @@
1
- import styled from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  import { borderRadius } from '@atlaskit/media-ui';
3
- export const ProgressWrapper = styled.div`
3
+ export const progressWrapperStyles = css`
4
4
  ${borderRadius} z-index: 30;
5
5
  overflow: hidden;
6
6
  background-color: rgba(255, 255, 255, 0.3);
@@ -1,7 +1,9 @@
1
1
  import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo';
2
- import { name as packageName, version as packageVersion } from '../version.json';
3
2
  import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KEYS } from './analytics';
3
+ import { MediaCardError } from '../errors';
4
4
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
5
+ const packageName = "@atlaskit/media-card";
6
+ const packageVersion = "74.1.0";
5
7
  let concurrentExperience;
6
8
 
7
9
  const getExperience = id => {
@@ -23,7 +25,7 @@ const getExperience = id => {
23
25
  export const startUfoExperience = id => {
24
26
  getExperience(id).start();
25
27
  };
26
- export const completeUfoExperience = (id, status, fileAttributes, fileStateFlags, ssrReliability, error) => {
28
+ export const completeUfoExperience = (id, status, fileAttributes, fileStateFlags, ssrReliability, error = new MediaCardError('missing-error-data')) => {
27
29
  switch (status) {
28
30
  case 'complete':
29
31
  succeedUfoExperience(id, {
@@ -43,7 +45,7 @@ export const completeUfoExperience = (id, status, fileAttributes, fileStateFlags
43
45
  break;
44
46
 
45
47
  case 'error':
46
- error && failUfoExperience(id, {
48
+ failUfoExperience(id, {
47
49
  fileAttributes,
48
50
  ...extractErrorInfo(error),
49
51
  request: getRenderErrorRequestMetadata(error),
@@ -1,27 +1,6 @@
1
- import React, { useEffect, forwardRef } from 'react';
2
- /**
3
- * As IntersectionObserver::rootMargin doesn't work within IFrames, we use an empty div + dynamic offsetTop to eagerly detect cards entering viewport.
4
- * Using this approach, we can lazy load cards ABS_VIEWPORT_ANCHOR_OFFSET_TOP px before they enter viewport.
5
- */
6
-
7
- export const ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
8
-
9
- export const ViewportAnchor = /*#__PURE__*/forwardRef((props, ref) => {
10
- if (typeof IntersectionObserver === 'undefined') {
11
- return null;
12
- }
13
-
14
- return /*#__PURE__*/React.createElement("div", {
15
- ref: ref,
16
- className: "media-card-viewport-anchor",
17
- style: {
18
- position: 'absolute',
19
- top: `${props.offsetTop}px`,
20
- maxHeight: 0,
21
- pointerEvents: 'none'
22
- }
23
- });
24
- });
1
+ import React, { useEffect } from 'react';
2
+ import getDocument from './document';
3
+ const ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
25
4
 
26
5
  const createIntersectionObserverCallback = onVisible => (entries, observer) => {
27
6
  for (let entry of entries) {
@@ -36,27 +15,23 @@ const createIntersectionObserverCallback = onVisible => (entries, observer) => {
36
15
  const ViewportObserver = ({
37
16
  onVisible,
38
17
  cardEl,
39
- children,
40
- preAnchorRef,
41
- postAnchorRef
18
+ children
42
19
  }) => {
43
20
  useEffect(() => {
44
- // IntersectionObserver uses root and target elements to detect intersections, defaulting root to the viewport
45
- const intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisible));
46
- (preAnchorRef === null || preAnchorRef === void 0 ? void 0 : preAnchorRef.current) && intersectionObserver.observe(preAnchorRef.current);
47
- (postAnchorRef === null || postAnchorRef === void 0 ? void 0 : postAnchorRef.current) && intersectionObserver.observe(postAnchorRef.current);
21
+ const intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisible), {
22
+ root: getDocument(),
23
+ rootMargin: `${ABS_VIEWPORT_ANCHOR_OFFSET_TOP}px`
24
+ });
48
25
  cardEl && intersectionObserver.observe(cardEl);
49
26
  return () => {
50
27
  intersectionObserver.disconnect();
51
28
  };
52
- }, [cardEl, preAnchorRef, postAnchorRef, onVisible]);
29
+ }, [cardEl, onVisible]);
53
30
  return /*#__PURE__*/React.createElement(React.Fragment, null, children);
54
31
  };
55
32
 
56
33
  export const ViewportDetector = ({
57
34
  cardEl,
58
- preAnchorRef,
59
- postAnchorRef,
60
35
  onVisible,
61
36
  children
62
37
  }) => {
@@ -66,8 +41,6 @@ export const ViewportDetector = ({
66
41
 
67
42
  return /*#__PURE__*/React.createElement(ViewportObserver, {
68
43
  cardEl: cardEl,
69
- preAnchorRef: preAnchorRef,
70
- postAnchorRef: postAnchorRef,
71
44
  onVisible: onVisible
72
45
  }, children);
73
46
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "73.7.0",
3
+ "version": "74.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -10,6 +10,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
+ /**
14
+ * Primary reason is logged through Data Portal.
15
+ * Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
16
+ */
13
17
  export var MediaCardError = /*#__PURE__*/function (_Error) {
14
18
  _inherits(MediaCardError, _Error);
15
19
 
@@ -0,0 +1,41 @@
1
+ /**@jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { useGlobalTheme } from '@atlaskit/theme/components';
4
+ import { fileCardImageViewSelectedSelector, fileCardImageViewSelector } from './classnames';
5
+ import { playIconWrapperStyles, progressBarWrapperStyles, wrapperStyles } from './styles';
6
+ export var CardImageViewWrapper = function CardImageViewWrapper(props) {
7
+ var disableOverlay = props.disableOverlay,
8
+ selectable = props.selectable,
9
+ selected = props.selected,
10
+ mediaType = props.mediaType,
11
+ mediaName = props.mediaName,
12
+ status = props.status,
13
+ progress = props.progress;
14
+ var theme = useGlobalTheme();
15
+ return jsx("div", {
16
+ id: "cardImageViewWrapper",
17
+ "data-testid": "media-file-card-view",
18
+ "data-test-media-name": mediaName,
19
+ "data-test-status": status,
20
+ "data-test-progress": progress,
21
+ "data-test-selected": selected ? true : undefined,
22
+ css: wrapperStyles({
23
+ theme: theme,
24
+ disableOverlay: disableOverlay,
25
+ selectable: selectable,
26
+ selected: selected,
27
+ mediaType: mediaType
28
+ }),
29
+ className: "".concat(fileCardImageViewSelector, " ").concat(selected ? fileCardImageViewSelectedSelector : '')
30
+ }, props.children);
31
+ };
32
+ export var PlayIconWrapper = function PlayIconWrapper(props) {
33
+ return jsx("div", {
34
+ css: playIconWrapperStyles
35
+ }, props.children);
36
+ };
37
+ export var ProgressBarWrapper = function ProgressBarWrapper(props) {
38
+ return jsx("div", {
39
+ css: progressBarWrapperStyles
40
+ }, props.children);
41
+ };
@@ -0,0 +1,39 @@
1
+ /**@jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { useGlobalTheme } from '@atlaskit/theme/components';
4
+ import { altWrapperStyles, errorMessageStyles, metadataStyles, overlayStyles, titleWrapperStyles } from './styles';
5
+ export var Overlay = function Overlay(props) {
6
+ var hasError = props.hasError,
7
+ noHover = props.noHover,
8
+ className = props.className;
9
+ return jsx("div", {
10
+ css: overlayStyles({
11
+ hasError: hasError,
12
+ noHover: noHover
13
+ }),
14
+ className: className
15
+ }, props.children);
16
+ };
17
+ export var ErrorMessage = function ErrorMessage(props) {
18
+ return jsx("div", {
19
+ css: errorMessageStyles
20
+ }, props.children);
21
+ };
22
+ export var AltWrapper = function AltWrapper(props) {
23
+ return jsx("div", {
24
+ css: altWrapperStyles
25
+ }, props.children);
26
+ };
27
+ export var TitleWrapper = function TitleWrapper(props) {
28
+ var theme = useGlobalTheme();
29
+ return jsx("div", {
30
+ css: titleWrapperStyles(theme),
31
+ className: 'title'
32
+ }, props.children);
33
+ };
34
+ export var Metadata = function Metadata(props) {
35
+ return jsx("div", {
36
+ css: metadataStyles,
37
+ className: props.className
38
+ }, props.children);
39
+ };
@@ -10,6 +10,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
+ /**@jsx jsx */
14
+ import { jsx } from '@emotion/react';
13
15
  import React from 'react';
14
16
  import { Component } from 'react';
15
17
  import cx from 'classnames';
@@ -19,7 +21,8 @@ import { Ellipsify } from '@atlaskit/media-ui'; // We dont require things direct
19
21
  import { FileIcon } from '../../../utils/fileIcon';
20
22
  import { ErrorIcon } from '../../../utils/errorIcon';
21
23
  import CardActions from '../../../utils/cardActions';
22
- import { TickBox, Overlay, ErrorLine, LeftColumn, TopRow, BottomRow, RightColumn, ErrorMessage, TitleWrapper, Subtitle, Metadata, AltWrapper } from './styled';
24
+ import { tickBoxStyles, errorLineStyles, leftColumnStyles, topRowStyles, bottomRowStyles, rightColumnStyles, subtitleStyles } from './styles';
25
+ import { Metadata, AltWrapper, ErrorMessage, TitleWrapper, Overlay } from './cardOverlayComponents';
23
26
 
24
27
  var resolveTitleText = function resolveTitleText(cardStatus, mediaName, error, selected) {
25
28
  // don't show title if error
@@ -91,21 +94,25 @@ export var CardOverlay = /*#__PURE__*/function (_Component) {
91
94
  actions = _this$props2.actions;
92
95
  var titleText = resolveTitleText(cardStatus, mediaName, error, selected);
93
96
  var menuTriggerColor = !persistent ? 'white' : undefined;
94
- return /*#__PURE__*/React.createElement(Overlay, {
97
+ return jsx(Overlay, {
95
98
  hasError: !!error,
96
99
  noHover: noHover,
97
100
  className: this.wrapperClassNames
98
- }, /*#__PURE__*/React.createElement(TopRow, {
101
+ }, jsx("div", {
102
+ css: topRowStyles,
99
103
  className: 'top-row'
100
- }, this.errorLine(), /*#__PURE__*/React.createElement(TitleWrapper, {
101
- className: 'title'
102
- }, titleText ? /*#__PURE__*/React.createElement(Ellipsify, {
104
+ }, this.errorLine(), jsx(TitleWrapper, null, titleText ? jsx(Ellipsify, {
103
105
  testId: "media-card-file-name",
104
106
  text: titleText,
105
107
  lines: 2
106
- }) : null), this.tickBox()), /*#__PURE__*/React.createElement(BottomRow, {
108
+ }) : null), this.tickBox()), jsx("div", {
109
+ css: bottomRowStyles,
107
110
  className: 'bottom-row'
108
- }, /*#__PURE__*/React.createElement(LeftColumn, null, this.bottomLeftColumn()), /*#__PURE__*/React.createElement(RightColumn, null, actions ? /*#__PURE__*/React.createElement(CardActions, {
111
+ }, jsx("div", {
112
+ css: leftColumnStyles
113
+ }, this.bottomLeftColumn()), jsx("div", {
114
+ css: rightColumnStyles
115
+ }, actions ? jsx(CardActions, {
109
116
  actions: actions,
110
117
  onToggle: this.onMenuToggle,
111
118
  triggerColor: menuTriggerColor
@@ -117,7 +124,11 @@ export var CardOverlay = /*#__PURE__*/function (_Component) {
117
124
  var _this$props3 = this.props,
118
125
  error = _this$props3.error,
119
126
  alt = _this$props3.alt;
120
- return error && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ErrorLine, null, /*#__PURE__*/React.createElement(ErrorIcon, null), /*#__PURE__*/React.createElement(ErrorMessage, null, error)), alt && /*#__PURE__*/React.createElement(ErrorLine, null, /*#__PURE__*/React.createElement(AltWrapper, null, alt)));
127
+ return error && jsx(React.Fragment, null, jsx("div", {
128
+ css: errorLineStyles
129
+ }, jsx(ErrorIcon, null), jsx(ErrorMessage, null, error)), alt && jsx("div", {
130
+ css: errorLineStyles
131
+ }, jsx(AltWrapper, null, alt)));
121
132
  }
122
133
  }, {
123
134
  key: "tickBox",
@@ -125,15 +136,16 @@ export var CardOverlay = /*#__PURE__*/function (_Component) {
125
136
  var _this$props4 = this.props,
126
137
  selected = _this$props4.selected,
127
138
  selectable = _this$props4.selectable;
128
- var tick = /*#__PURE__*/React.createElement(TickIcon, {
139
+ var tick = jsx(TickIcon, {
129
140
  label: "tick"
130
141
  });
131
142
  var className = cx('tickbox', {
132
143
  selected: selected
133
144
  });
134
- return selectable && /*#__PURE__*/React.createElement(TickBox, {
145
+ return selectable && jsx("div", {
146
+ css: tickBoxStyles,
135
147
  className: className
136
- }, " ", tick, " ");
148
+ }, tick);
137
149
  }
138
150
  }, {
139
151
  key: "bottomLeftColumn",
@@ -146,14 +158,15 @@ export var CardOverlay = /*#__PURE__*/function (_Component) {
146
158
  subtitle = _this$props5.subtitle,
147
159
  icon = _this$props5.icon;
148
160
  var classNames = cx('metadata');
149
- var fileIcon = mediaType || icon ? /*#__PURE__*/React.createElement(FileIcon, {
161
+ var fileIcon = mediaType || icon ? jsx(FileIcon, {
150
162
  mediaType: mediaType,
151
163
  iconUrl: icon
152
164
  }) : null;
153
- var subtitleEl = subtitle ? /*#__PURE__*/React.createElement(Subtitle, {
165
+ var subtitleEl = subtitle ? jsx("div", {
166
+ css: subtitleStyles,
154
167
  className: "file-size"
155
168
  }, subtitle) : null;
156
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Metadata, {
169
+ return jsx("div", null, jsx(Metadata, {
157
170
  className: classNames
158
171
  }, fileIcon, subtitleEl));
159
172
  }
@@ -0,0 +1,46 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
4
+
5
+ /**
6
+ * Everything about this file change is just wrong.
7
+ * Mostly because we do bad things with classes.
8
+ * This is all wrong and hopefully will be removed from existence with card v3,
9
+ * so please don’t be too sad about all this!
10
+ */
11
+ import { css } from '@emotion/react';
12
+ import { borderRadius, size, ellipsis, absolute } from '@atlaskit/media-ui';
13
+ import { themed } from '@atlaskit/theme/components';
14
+ import * as colors from '@atlaskit/theme/colors';
15
+ import { rgba, centerX, easeOutCubic, transition, antialiased } from '../../../styles';
16
+ export var tickBoxStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color: ", ";\n position: absolute;\n top: 8px;\n right: 8px;\n border-radius: 20px;\n color: #798599; /* TODO FIL-3884: Align color with new design */\n display: flex;\n opacity: 0;\n\n &.selected {\n opacity: 1;\n color: white;\n background-color: #0052cc; /* TODO FIL-3884: Align with tickbox icons */\n }\n\n /* Enforce dimensions of \"tick\" icon */\n svg {\n position: absolute;\n width: 14px;\n }\n"])), size(14), transition(), rgba('#ffffff', 0.5));
17
+
18
+ var getOverlayStyles = function getOverlayStyles(_ref) {
19
+ var hasError = _ref.hasError,
20
+ noHover = _ref.noHover;
21
+
22
+ if (hasError || noHover) {
23
+ return "\n cursor: default;\n\n &:hover {\n background: transparent;\n }\n ";
24
+ }
25
+ };
26
+
27
+ export var overlayStyles = function overlayStyles(props) {
28
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", " display: flex;\n justify-content: space-between;\n flex-direction: column;\n background: transparent;\n transition: 0.3s background ", ", 0.3s border-color;\n padding: 16px;\n\n ", "\n &:not(.persistent):hover, &.active {\n .top-row {\n .title {\n color: ", ";\n }\n }\n\n .bottom-row {\n .delete-btn {\n display: flex;\n }\n }\n }\n\n &.noHover:hover {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n\n .file-type-icon {\n display: block;\n }\n\n &:not(.persistent) {\n &:not(.error, .noHover):hover {\n background-color: ", ";\n }\n\n &.selectable {\n &.selected {\n background-color: ", ";\n\n &:hover {\n /* TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */\n }\n\n .title,\n .bottom-row,\n .file-size,\n .more-btn {\n color: ", ";\n }\n }\n }\n }\n\n &.persistent {\n &:not(.active) {\n overflow: hidden;\n }\n\n .top-row {\n .title {\n transition: opacity 0.3s;\n opacity: 0;\n color: white;\n visibility: hidden;\n }\n }\n\n .bottom-row {\n opacity: 0;\n transition: transform 0.2s, opacity 0.5s;\n /* This is the height of the overlay footer, needs to be present now since the parent uses flex and 100% doesn't look right anymore */\n transform: translateY(35px);\n\n .file-type-icon {\n display: none;\n }\n\n .file-size {\n color: white;\n display: none;\n }\n\n .more-btn {\n color: ", ";\n display: none;\n\n &:hover {\n background-color: rgba(9, 30, 66, 0.2);\n }\n }\n\n .delete-btn {\n display: none;\n\n &:hover {\n background-color: rgba(9, 30, 66, 0.2);\n }\n }\n }\n\n &:hover,\n &.active {\n background-color: ", ";\n\n .title {\n opacity: 1;\n visibility: visible;\n }\n\n .file-type-icon,\n .file-size {\n display: block;\n }\n\n .more-btn {\n ", " color: ", ";\n }\n\n .delete-btn {\n display: flex;\n }\n\n .bottom-row {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n /* Selectable */\n &.selectable {\n &:hover {\n .tickbox {\n opacity: 1;\n }\n }\n\n &.selected {\n .tickbox {\n background-color: ", " !important;\n border-color: ", " !important;\n color: white;\n }\n }\n }\n }\n\n &.error {\n .top-row {\n overflow: visible;\n }\n &:hover,\n &.active {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n }\n"])), size(), absolute(), borderRadius, easeOutCubic, getOverlayStyles(props), colors.B400, colors.N800, rgba(colors.N900, 0.06), colors.B200, colors.N0, colors.N0, rgba(colors.N900, 0.5), centerX, colors.N0, colors.B200, colors.B200, colors.N800);
29
+ };
30
+ export var errorLineStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 24px;\n display: flex;\n align-items: center;\n"])));
31
+ export var leftColumnStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n vertical-align: middle;\n"])));
32
+ export var topRowStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral([""])));
33
+ export var bottomRowStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: 16px;\n"])));
34
+ export var rightColumnStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral([""])));
35
+ export var errorMessageStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", " display: inline-block;\n vertical-align: middle;\n font-weight: bold;\n color: ", ";\n font-size: 12px;\n line-height: 15px;\n overflow: hidden;\n max-width: 'calc(100% - 24px)';\n text-overflow: ellipsis;\n white-space: nowrap;\n margin: auto 3px;\n"])), antialiased, colors.N70);
36
+ export var altWrapperStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", "\n font-weight: normal;\n"])), errorMessageStyles);
37
+ export var titleWrapperStyles = function titleWrapperStyles(theme) {
38
+ return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n word-wrap: break-word;\n color: ", ";\n font-size: 12px;\n line-height: 18px;\n"])), themed({
39
+ light: colors.N800,
40
+ dark: colors.DN900
41
+ })({
42
+ theme: theme
43
+ }));
44
+ };
45
+ export var subtitleStyles = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", " font-size: 12px;\n color: #5e6c84;\n"])), ellipsis('100px'));
46
+ export var metadataStyles = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
@@ -10,17 +10,19 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
+ /**@jsx jsx */
14
+ import { jsx } from '@emotion/react';
13
15
  import React from 'react';
14
16
  import { Component } from 'react';
15
17
  import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
16
18
  import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
17
19
  import { CardOverlay } from './cardOverlay';
18
- import { PlayIconWrapper, Wrapper, ProgressBarWrapper, Body, CardActionsWrapper, Overlay, ProgressWrapper, Title, PlayIconBackground } from './styled';
20
+ import { bodyStyles, cardActionsWrapperStyles, overlayStyles, progressWrapperStyles, titleStyles, playIconBackgroundStyles } from './styles';
19
21
  import { CardLoading } from '../../utils/lightCards/cardLoading';
20
22
  import { shouldDisplayImageThumbnail } from '../../utils/shouldDisplayImageThumbnail';
21
23
  import { ProgressBar } from '../../utils/progressBar';
22
24
  import CardActions from '../../utils/cardActions';
23
- import { fileCardImageViewSelectedSelector, fileCardImageViewSelector } from './classnames';
25
+ import { CardImageViewWrapper, PlayIconWrapper, ProgressBarWrapper } from './cardImageViewWrapper';
24
26
  export var FileCardImageView = /*#__PURE__*/function (_Component) {
25
27
  _inherits(FileCardImageView, _Component);
26
28
 
@@ -63,11 +65,11 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
63
65
  });
64
66
 
65
67
  _defineProperty(_assertThisInitialized(_this), "renderLoadingContents", function () {
66
- return /*#__PURE__*/React.createElement("div", {
68
+ return jsx("div", {
67
69
  className: "wrapper"
68
- }, /*#__PURE__*/React.createElement("div", {
70
+ }, jsx("div", {
69
71
  className: "img-wrapper"
70
- }, /*#__PURE__*/React.createElement(CardLoading, null)));
72
+ }, jsx(CardLoading, null)));
71
73
  });
72
74
 
73
75
  _defineProperty(_assertThisInitialized(_this), "renderErrorContents", function () {
@@ -79,9 +81,9 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
79
81
  mediaType = _this$props2.mediaType,
80
82
  actions = _this$props2.actions,
81
83
  fileSize = _this$props2.fileSize;
82
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
84
+ return jsx(React.Fragment, null, jsx("div", {
83
85
  className: "wrapper"
84
- }), /*#__PURE__*/React.createElement(CardOverlay, {
86
+ }), jsx(CardOverlay, {
85
87
  cardStatus: status,
86
88
  error: error,
87
89
  persistent: true,
@@ -100,9 +102,9 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
100
102
  mediaType = _this$props3.mediaType,
101
103
  actions = _this$props3.actions,
102
104
  fileSize = _this$props3.fileSize;
103
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
105
+ return jsx(React.Fragment, null, jsx("div", {
104
106
  className: "wrapper"
105
- }), /*#__PURE__*/React.createElement(CardOverlay, {
107
+ }), jsx(CardOverlay, {
106
108
  cardStatus: status,
107
109
  noHover: true,
108
110
  persistent: true,
@@ -122,7 +124,7 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
122
124
  selectable = _this$props4.selectable,
123
125
  selected = _this$props4.selected;
124
126
  var isPersistent = mediaType === 'doc' || !dataURI;
125
- return /*#__PURE__*/React.createElement(CardOverlay, {
127
+ return jsx(CardOverlay, {
126
128
  cardStatus: status,
127
129
  persistent: isPersistent,
128
130
  mediaName: mediaName,
@@ -148,7 +150,9 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
148
150
  return null;
149
151
  }
150
152
 
151
- return /*#__PURE__*/React.createElement(PlayIconWrapper, null, /*#__PURE__*/React.createElement(PlayIconBackground, null, /*#__PURE__*/React.createElement(VidPlayIcon, {
153
+ return jsx(PlayIconWrapper, null, jsx("div", {
154
+ css: playIconBackgroundStyles
155
+ }, jsx(VidPlayIcon, {
152
156
  testId: "media-card-play-button",
153
157
  label: "play",
154
158
  size: "large"
@@ -189,7 +193,7 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
189
193
  _this.wasThumbnailDisplayed = true;
190
194
  }
191
195
 
192
- return /*#__PURE__*/React.createElement(MediaImage, {
196
+ return jsx(MediaImage, {
193
197
  dataURI: dataURI,
194
198
  alt: alt,
195
199
  crop: _this.isCropped,
@@ -211,13 +215,23 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
211
215
  return null;
212
216
  }
213
217
 
214
- return /*#__PURE__*/React.createElement(ProgressBarWrapper, null, /*#__PURE__*/React.createElement(Overlay, null, /*#__PURE__*/React.createElement(Title, null, /*#__PURE__*/React.createElement(Ellipsify, {
218
+ return jsx(ProgressBarWrapper, null, jsx("div", {
219
+ css: overlayStyles
220
+ }, jsx("div", {
221
+ css: titleStyles
222
+ }, jsx(Ellipsify, {
215
223
  testId: "media-card-file-name",
216
224
  text: mediaName || '',
217
225
  lines: 2
218
- })), /*#__PURE__*/React.createElement(Body, null, /*#__PURE__*/React.createElement(ProgressWrapper, null, /*#__PURE__*/React.createElement(ProgressBar, {
226
+ })), jsx("div", {
227
+ css: bodyStyles
228
+ }, jsx("div", {
229
+ css: progressWrapperStyles
230
+ }, jsx(ProgressBar, {
219
231
  progress: progress
220
- })), /*#__PURE__*/React.createElement(CardActionsWrapper, null, actions ? /*#__PURE__*/React.createElement(CardActions, {
232
+ })), jsx("div", {
233
+ css: cardActionsWrapperStyles
234
+ }, actions ? jsx(CardActions, {
221
235
  actions: actions,
222
236
  triggerColor: "white"
223
237
  }) : null))));
@@ -240,9 +254,9 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
240
254
  }
241
255
  }
242
256
 
243
- return /*#__PURE__*/React.createElement("div", {
257
+ return jsx("div", {
244
258
  className: "wrapper"
245
- }, /*#__PURE__*/React.createElement("div", {
259
+ }, jsx("div", {
246
260
  className: "img-wrapper"
247
261
  }, _this.renderMediaImage(), _this.renderProgressBar(), _this.renderPlayButton()), overlay);
248
262
  });
@@ -258,7 +272,7 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
258
272
  selected = _this$props11.selected,
259
273
  actions = _this$props11.actions;
260
274
  var isPersistent = mediaType === 'doc' || !dataURI;
261
- return /*#__PURE__*/React.createElement(CardOverlay, {
275
+ return jsx(CardOverlay, {
262
276
  cardStatus: status,
263
277
  persistent: isPersistent,
264
278
  mediaName: mediaName,
@@ -284,17 +298,14 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
284
298
  progress = _this$props12.progress,
285
299
  status = _this$props12.status,
286
300
  mediaName = _this$props12.mediaName;
287
- return /*#__PURE__*/React.createElement(Wrapper, {
288
- "data-testid": "media-file-card-view",
289
- "data-test-media-name": mediaName,
290
- "data-test-status": status,
291
- "data-test-progress": progress,
292
- "data-test-selected": selected ? true : undefined,
301
+ return jsx(CardImageViewWrapper, {
302
+ mediaName: mediaName,
303
+ status: status,
304
+ progress: progress,
293
305
  disableOverlay: disableOverlay,
294
306
  selectable: selectable,
295
307
  selected: selected,
296
- mediaType: mediaType,
297
- className: "".concat(fileCardImageViewSelector, " ").concat(selected ? fileCardImageViewSelectedSelector : '')
308
+ mediaType: mediaType
298
309
  }, this.renderCardContents());
299
310
  }
300
311
  }, {