@atlaskit/smart-card 18.0.15 → 18.0.18

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 (221) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client/package.json +1 -0
  3. package/dist/cjs/extractors/common/context/extractProvider.js +14 -4
  4. package/dist/cjs/extractors/common/detail/extractCommentCount.js +3 -1
  5. package/dist/cjs/extractors/common/detail/extractProgrammingLanguage.js +3 -1
  6. package/dist/cjs/extractors/common/detail/extractSubscriberCount.js +3 -1
  7. package/dist/cjs/extractors/common/primitives/extractTitleTextColor.js +3 -1
  8. package/dist/cjs/i18n/cs.js +43 -0
  9. package/dist/cjs/i18n/da.js +43 -0
  10. package/dist/cjs/i18n/de.js +43 -0
  11. package/dist/cjs/i18n/en.js +43 -0
  12. package/dist/cjs/i18n/en_GB.js +43 -0
  13. package/dist/cjs/i18n/en_ZZ.js +43 -0
  14. package/dist/cjs/i18n/es.js +43 -0
  15. package/dist/cjs/i18n/et.js +16 -0
  16. package/dist/cjs/i18n/fi.js +43 -0
  17. package/dist/cjs/i18n/fr.js +43 -0
  18. package/dist/cjs/i18n/hu.js +43 -0
  19. package/dist/cjs/i18n/it.js +43 -0
  20. package/dist/cjs/i18n/ja.js +43 -0
  21. package/dist/cjs/i18n/ko.js +43 -0
  22. package/dist/cjs/i18n/nb.js +43 -0
  23. package/dist/cjs/i18n/nl.js +43 -0
  24. package/dist/cjs/i18n/pl.js +43 -0
  25. package/dist/cjs/i18n/pt_BR.js +43 -0
  26. package/dist/cjs/i18n/pt_PT.js +16 -0
  27. package/dist/cjs/i18n/ru.js +43 -0
  28. package/dist/cjs/i18n/sk.js +16 -0
  29. package/dist/cjs/i18n/sv.js +43 -0
  30. package/dist/cjs/i18n/th.js +43 -0
  31. package/dist/cjs/i18n/tr.js +43 -0
  32. package/dist/cjs/i18n/uk.js +43 -0
  33. package/dist/cjs/i18n/vi.js +43 -0
  34. package/dist/cjs/i18n/zh.js +43 -0
  35. package/dist/cjs/i18n/zh_TW.js +43 -0
  36. package/dist/cjs/state/actions/index.js +1 -1
  37. package/dist/cjs/version.json +1 -1
  38. package/dist/cjs/view/BlockCard/components/Frame.js +10 -7
  39. package/dist/cjs/view/BlockCard/components/Link.js +3 -1
  40. package/dist/cjs/view/BlockCard/components/Provider.js +3 -1
  41. package/dist/cjs/view/BlockCard/views/ErroredView.js +3 -1
  42. package/dist/cjs/view/BlockCard/views/ForbiddenView.js +3 -1
  43. package/dist/cjs/view/BlockCard/views/NotFoundView.js +3 -1
  44. package/dist/cjs/view/BlockCard/views/ResolvingView.js +4 -2
  45. package/dist/cjs/view/EmbedCard/components/styled.js +15 -13
  46. package/dist/cjs/view/EmbedCard/views/ErroredView.js +3 -1
  47. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +11 -25
  48. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -2
  49. package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -9
  50. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +32 -0
  51. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/types.js +5 -0
  52. package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +1 -18
  53. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +1 -0
  54. package/dist/cjs/view/FlexibleCard/components/utils.js +20 -1
  55. package/dist/cjs/view/InlineCard/ErroredView/index.js +3 -1
  56. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +4 -2
  57. package/dist/cjs/view/InlineCard/Frame/styled.js +16 -13
  58. package/dist/cjs/view/InlineCard/Icon.js +3 -1
  59. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +4 -2
  60. package/dist/cjs/view/InlineCard/styled.js +6 -4
  61. package/dist/cjs/view/common/Byline.js +3 -1
  62. package/dist/cjs/view/common/Metadata.js +3 -1
  63. package/dist/cjs/view/common/ModalHeader.js +4 -2
  64. package/dist/es2019/extractors/common/context/extractProvider.js +13 -4
  65. package/dist/es2019/extractors/common/detail/extractCommentCount.js +2 -1
  66. package/dist/es2019/extractors/common/detail/extractProgrammingLanguage.js +2 -1
  67. package/dist/es2019/extractors/common/detail/extractSubscriberCount.js +2 -1
  68. package/dist/es2019/extractors/common/primitives/extractTitleTextColor.js +2 -1
  69. package/dist/es2019/i18n/cs.js +35 -0
  70. package/dist/es2019/i18n/da.js +35 -0
  71. package/dist/es2019/i18n/de.js +35 -0
  72. package/dist/es2019/i18n/en.js +35 -0
  73. package/dist/es2019/i18n/en_GB.js +35 -0
  74. package/dist/es2019/i18n/en_ZZ.js +35 -0
  75. package/dist/es2019/i18n/es.js +35 -0
  76. package/dist/es2019/i18n/et.js +8 -0
  77. package/dist/es2019/i18n/fi.js +35 -0
  78. package/dist/es2019/i18n/fr.js +35 -0
  79. package/dist/es2019/i18n/hu.js +35 -0
  80. package/dist/es2019/i18n/it.js +35 -0
  81. package/dist/es2019/i18n/ja.js +35 -0
  82. package/dist/es2019/i18n/ko.js +35 -0
  83. package/dist/es2019/i18n/nb.js +35 -0
  84. package/dist/es2019/i18n/nl.js +35 -0
  85. package/dist/es2019/i18n/pl.js +35 -0
  86. package/dist/es2019/i18n/pt_BR.js +35 -0
  87. package/dist/es2019/i18n/pt_PT.js +8 -0
  88. package/dist/es2019/i18n/ru.js +35 -0
  89. package/dist/es2019/i18n/sk.js +8 -0
  90. package/dist/es2019/i18n/sv.js +35 -0
  91. package/dist/es2019/i18n/th.js +35 -0
  92. package/dist/es2019/i18n/tr.js +35 -0
  93. package/dist/es2019/i18n/uk.js +35 -0
  94. package/dist/es2019/i18n/vi.js +35 -0
  95. package/dist/es2019/i18n/zh.js +35 -0
  96. package/dist/es2019/i18n/zh_TW.js +35 -0
  97. package/dist/es2019/state/actions/index.js +1 -1
  98. package/dist/es2019/version.json +1 -1
  99. package/dist/es2019/view/BlockCard/components/Frame.js +9 -7
  100. package/dist/es2019/view/BlockCard/components/Link.js +2 -1
  101. package/dist/es2019/view/BlockCard/components/Provider.js +2 -1
  102. package/dist/es2019/view/BlockCard/views/ErroredView.js +2 -1
  103. package/dist/es2019/view/BlockCard/views/ForbiddenView.js +2 -1
  104. package/dist/es2019/view/BlockCard/views/NotFoundView.js +2 -1
  105. package/dist/es2019/view/BlockCard/views/ResolvingView.js +3 -2
  106. package/dist/es2019/view/EmbedCard/components/styled.js +15 -15
  107. package/dist/es2019/view/EmbedCard/views/ErroredView.js +2 -1
  108. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +10 -25
  109. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -3
  110. package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +4 -30
  111. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +39 -0
  112. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/types.js +1 -0
  113. package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +2 -19
  114. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +1 -0
  115. package/dist/es2019/view/FlexibleCard/components/utils.js +16 -0
  116. package/dist/es2019/view/InlineCard/ErroredView/index.js +2 -1
  117. package/dist/es2019/view/InlineCard/ForbiddenView/index.js +3 -2
  118. package/dist/es2019/view/InlineCard/Frame/styled.js +15 -12
  119. package/dist/es2019/view/InlineCard/Icon.js +7 -6
  120. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +3 -2
  121. package/dist/es2019/view/InlineCard/styled.js +5 -4
  122. package/dist/es2019/view/common/Byline.js +2 -1
  123. package/dist/es2019/view/common/Metadata.js +2 -1
  124. package/dist/es2019/view/common/ModalHeader.js +3 -2
  125. package/dist/esm/extractors/common/context/extractProvider.js +13 -4
  126. package/dist/esm/extractors/common/detail/extractCommentCount.js +2 -1
  127. package/dist/esm/extractors/common/detail/extractProgrammingLanguage.js +2 -1
  128. package/dist/esm/extractors/common/detail/extractSubscriberCount.js +2 -1
  129. package/dist/esm/extractors/common/primitives/extractTitleTextColor.js +2 -1
  130. package/dist/esm/i18n/cs.js +35 -0
  131. package/dist/esm/i18n/da.js +35 -0
  132. package/dist/esm/i18n/de.js +35 -0
  133. package/dist/esm/i18n/en.js +35 -0
  134. package/dist/esm/i18n/en_GB.js +35 -0
  135. package/dist/esm/i18n/en_ZZ.js +35 -0
  136. package/dist/esm/i18n/es.js +35 -0
  137. package/dist/esm/i18n/et.js +8 -0
  138. package/dist/esm/i18n/fi.js +35 -0
  139. package/dist/esm/i18n/fr.js +35 -0
  140. package/dist/esm/i18n/hu.js +35 -0
  141. package/dist/esm/i18n/it.js +35 -0
  142. package/dist/esm/i18n/ja.js +35 -0
  143. package/dist/esm/i18n/ko.js +35 -0
  144. package/dist/esm/i18n/nb.js +35 -0
  145. package/dist/esm/i18n/nl.js +35 -0
  146. package/dist/esm/i18n/pl.js +35 -0
  147. package/dist/esm/i18n/pt_BR.js +35 -0
  148. package/dist/esm/i18n/pt_PT.js +8 -0
  149. package/dist/esm/i18n/ru.js +35 -0
  150. package/dist/esm/i18n/sk.js +8 -0
  151. package/dist/esm/i18n/sv.js +35 -0
  152. package/dist/esm/i18n/th.js +35 -0
  153. package/dist/esm/i18n/tr.js +35 -0
  154. package/dist/esm/i18n/uk.js +35 -0
  155. package/dist/esm/i18n/vi.js +35 -0
  156. package/dist/esm/i18n/zh.js +35 -0
  157. package/dist/esm/i18n/zh_TW.js +35 -0
  158. package/dist/esm/state/actions/index.js +1 -1
  159. package/dist/esm/version.json +1 -1
  160. package/dist/esm/view/BlockCard/components/Frame.js +9 -7
  161. package/dist/esm/view/BlockCard/components/Link.js +2 -1
  162. package/dist/esm/view/BlockCard/components/Provider.js +2 -1
  163. package/dist/esm/view/BlockCard/views/ErroredView.js +2 -1
  164. package/dist/esm/view/BlockCard/views/ForbiddenView.js +2 -1
  165. package/dist/esm/view/BlockCard/views/NotFoundView.js +2 -1
  166. package/dist/esm/view/BlockCard/views/ResolvingView.js +3 -2
  167. package/dist/esm/view/EmbedCard/components/styled.js +14 -13
  168. package/dist/esm/view/EmbedCard/views/ErroredView.js +2 -1
  169. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +10 -25
  170. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -3
  171. package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +4 -10
  172. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +20 -0
  173. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/types.js +1 -0
  174. package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +2 -19
  175. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +1 -0
  176. package/dist/esm/view/FlexibleCard/components/utils.js +16 -0
  177. package/dist/esm/view/InlineCard/ErroredView/index.js +2 -1
  178. package/dist/esm/view/InlineCard/ForbiddenView/index.js +3 -2
  179. package/dist/esm/view/InlineCard/Frame/styled.js +16 -13
  180. package/dist/esm/view/InlineCard/Icon.js +2 -1
  181. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +3 -2
  182. package/dist/esm/view/InlineCard/styled.js +5 -4
  183. package/dist/esm/view/common/Byline.js +2 -1
  184. package/dist/esm/view/common/Metadata.js +2 -1
  185. package/dist/esm/view/common/ModalHeader.js +3 -2
  186. package/dist/types/i18n/cs.d.ts +35 -0
  187. package/dist/types/i18n/da.d.ts +35 -0
  188. package/dist/types/i18n/de.d.ts +35 -0
  189. package/dist/types/i18n/en.d.ts +35 -0
  190. package/dist/types/i18n/en_GB.d.ts +35 -0
  191. package/dist/types/i18n/en_ZZ.d.ts +35 -0
  192. package/dist/types/i18n/es.d.ts +35 -0
  193. package/dist/types/i18n/et.d.ts +8 -0
  194. package/dist/types/i18n/fi.d.ts +35 -0
  195. package/dist/types/i18n/fr.d.ts +35 -0
  196. package/dist/types/i18n/hu.d.ts +35 -0
  197. package/dist/types/i18n/it.d.ts +35 -0
  198. package/dist/types/i18n/ja.d.ts +35 -0
  199. package/dist/types/i18n/ko.d.ts +35 -0
  200. package/dist/types/i18n/nb.d.ts +35 -0
  201. package/dist/types/i18n/nl.d.ts +35 -0
  202. package/dist/types/i18n/pl.d.ts +35 -0
  203. package/dist/types/i18n/pt_BR.d.ts +35 -0
  204. package/dist/types/i18n/pt_PT.d.ts +8 -0
  205. package/dist/types/i18n/ru.d.ts +35 -0
  206. package/dist/types/i18n/sk.d.ts +8 -0
  207. package/dist/types/i18n/sv.d.ts +35 -0
  208. package/dist/types/i18n/th.d.ts +35 -0
  209. package/dist/types/i18n/tr.d.ts +35 -0
  210. package/dist/types/i18n/uk.d.ts +35 -0
  211. package/dist/types/i18n/vi.d.ts +35 -0
  212. package/dist/types/i18n/zh.d.ts +35 -0
  213. package/dist/types/i18n/zh_TW.d.ts +35 -0
  214. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +5 -0
  215. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +3 -0
  216. package/dist/types/view/FlexibleCard/components/utils.d.ts +1 -0
  217. package/hooks/package.json +1 -0
  218. package/in-product/package.json +1 -0
  219. package/package.json +7 -2
  220. package/ssr/package.json +1 -0
  221. package/types/package.json +1 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * NOTE:
3
+ *
4
+ * This file is automatically generated by Traduki 2.0.
5
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
+ */
7
+ //Chinese (Traditional)
8
+ export default {
9
+ 'fabric.linking.cannot_connect': '無法連結,請再試一次',
10
+ 'fabric.linking.cannot_find_link': '找不到連結',
11
+ 'fabric.linking.click_to_join': '加入 {context} 以查看此議題',
12
+ 'fabric.linking.connect_link_account': '連線以預覽',
13
+ 'fabric.linking.create_on': '建立時間:{context}',
14
+ 'fabric.linking.created_by': '建立者:{context}',
15
+ 'fabric.linking.delete': '刪除',
16
+ 'fabric.linking.edit': '編輯',
17
+ 'fabric.linking.forbidden_access': '您的存取遭拒',
18
+ 'fabric.linking.invalid_permissions': '連結受到限制,請嘗試其他帳戶',
19
+ 'fabric.linking.modified_on': '更新時間:{context}',
20
+ 'fabric.linking.pending_request': '您的存取要求擱置中',
21
+ 'fabric.linking.priority_blocker': '封鎖程式',
22
+ 'fabric.linking.priority_critical': '重要',
23
+ 'fabric.linking.priority_high': '高',
24
+ 'fabric.linking.priority_highest': '最高',
25
+ 'fabric.linking.priority_low': '低',
26
+ 'fabric.linking.priority_lowest': '最低',
27
+ 'fabric.linking.priority_major': '主要',
28
+ 'fabric.linking.priority_medium': '中',
29
+ 'fabric.linking.priority_minor': '次要',
30
+ 'fabric.linking.priority_trivial': '不太重要',
31
+ 'fabric.linking.priority_undefined': '未定義',
32
+ 'fabric.linking.request_access': '要求存取 {context} 以檢視此議題',
33
+ 'fabric.linking.request_denied': '您的存取要求遭拒',
34
+ 'fabric.linking.updated_by': '修改者:{context}'
35
+ };
@@ -70,7 +70,7 @@ export const useSmartCardActions = (id, url, analytics) => {
70
70
  const nextStatus = response ? getStatus(response) : 'fatal'; // If we require authorization & do not have an authFlow available,
71
71
  // throw an error and render as a normal blue link.
72
72
 
73
- if (nextStatus === 'unauthorized' && !hasAuthFlowSupported) {
73
+ if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
74
74
  handleResolvedLinkError(resourceUrl, new APIError('fallback', hostname, ERROR_MESSAGE_OAUTH));
75
75
  return;
76
76
  } // Handle any other errors
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "18.0.15",
3
+ "version": "18.0.18",
4
4
  "sideEffects": false
5
5
  }
@@ -2,6 +2,7 @@
2
2
  import { jsx } from '@emotion/core';
3
3
  import React from 'react';
4
4
  import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { gs, br, mq } from '../../common/utils';
6
7
  export const Frame = (props = {
7
8
  isSelected: false,
@@ -12,7 +13,7 @@ const sharedFrameStyles = {
12
13
  maxWidth: gs(95),
13
14
  width: '100%',
14
15
  display: 'flex',
15
- backgroundColor: 'white'
16
+ backgroundColor: token('elevation.surface', 'white')
16
17
  };
17
18
  export const ExpandedFrame = ({
18
19
  children,
@@ -25,15 +26,16 @@ export const ExpandedFrame = ({
25
26
  return jsx("div", {
26
27
  css: mq({ ...sharedFrameStyles,
27
28
  '&:hover': isHoverable ? {
28
- backgroundColor: N20A,
29
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4064
30
+ backgroundColor: token('color.background.neutral.subtle.hovered', N20A),
29
31
  cursor: 'pointer'
30
32
  } : undefined,
31
33
  minHeight: isFluidHeight ? 0 : [gs(21), gs(15)],
32
34
  borderRadius: isSelected ? br() : br(0.5),
33
- border: `2px solid ${isSelected ? B200 : 'transparent'}`,
35
+ border: `2px solid ${isSelected ? token('color.border.selected', B200) : 'transparent'}`,
34
36
  justifyContent: 'space-between',
35
37
  overflow: 'hidden',
36
- boxShadow: `0 1px 1px ${N50A}, 0 0 1px 1px ${N40A};`
38
+ boxShadow: token('elevation.shadow.raised', `0 1px 1px ${N50A}, 0 0 1px 1px ${N40A}`)
37
39
  }),
38
40
  "data-testid": testId,
39
41
  className: className,
@@ -51,14 +53,14 @@ export const CompactFrame = ({
51
53
  return jsx("div", {
52
54
  css: mq({ ...sharedFrameStyles,
53
55
  '&:hover': isHoverable ? {
54
- backgroundColor: N30A
56
+ backgroundColor: token('color.background.neutral.hovered', N30A)
55
57
  } : undefined,
56
58
  borderRadius: isSelected ? br() : br(0.5),
57
- border: isSelected ? `2px solid ${B200}` : '',
59
+ border: isSelected ? `2px solid ${token('color.border.selected', B200)}` : '',
58
60
  justifyContent: 'center',
59
61
  alignItems: 'center',
60
62
  height: inheritDimensions ? '100%' : gs(5),
61
- backgroundColor: N20A,
63
+ backgroundColor: token('color.background.neutral', N20A),
62
64
  width: ['calc(100% - 16px)', '100%'],
63
65
  padding: [`0px ${gs(1)}`, '0']
64
66
  }),
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import { B400 } from '@atlaskit/theme/colors';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const Link = ({
5
6
  url,
6
7
  testId = 'block-card',
@@ -10,7 +11,7 @@ export const Link = ({
10
11
  "data-testid": `${testId}-link`,
11
12
  className: className,
12
13
  css: {
13
- color: B400,
14
+ color: token('color.link', B400),
14
15
  wordBreak: 'break-all'
15
16
  }
16
17
  }, url);
@@ -2,6 +2,7 @@
2
2
  import { jsx } from '@emotion/core';
3
3
  import { N300 } from '@atlaskit/theme/colors';
4
4
  import { gs } from '../../common/utils';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const Provider = ({
6
7
  name,
7
8
  icon
@@ -27,7 +28,7 @@ export const Provider = ({
27
28
  }, iconToRender, jsx("span", {
28
29
  css: {
29
30
  fontSize: gs(1.5),
30
- color: N300,
31
+ color: token('color.text.subtlest', N300),
31
32
  margin: 0,
32
33
  marginLeft: gs(0.5),
33
34
  // EDM-713: fixes copy-paste from renderer to editor for Firefox
@@ -15,6 +15,7 @@ import { handleClickCommon } from '../utils/handlers';
15
15
  import { Link } from '../components/Link';
16
16
  import { UnresolvedText } from '../components/UnresolvedText';
17
17
  import { RetryAction } from '../actions/RetryAction';
18
+ import { token } from '@atlaskit/tokens';
18
19
  const textDescriptionProps = { ...messages.could_not_load_link
19
20
  };
20
21
  export const blockCardErroredViewClassName = 'block-card-errored-view';
@@ -47,7 +48,7 @@ export const ErroredView = ({
47
48
  icon: jsx(WarningIcon, {
48
49
  label: "errored-warning-icon",
49
50
  size: "small",
50
- primaryColor: R300,
51
+ primaryColor: token('color.icon.warning', R300),
51
52
  testId: `${testId}-warning-icon`
52
53
  }),
53
54
  text: jsx(FormattedMessage, textDescriptionProps)
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  import { jsx } from '@emotion/core';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import { R300 } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
7
8
  import LockIcon from '@atlaskit/icon/glyph/lock-filled';
8
9
  import { Frame } from '../components/Frame';
9
10
  import { Provider } from '../components/Provider';
@@ -55,7 +56,7 @@ export const ForbiddenView = ({
55
56
  icon: jsx(LockIcon, {
56
57
  label: "forbidden-lock-icon",
57
58
  size: "small",
58
- primaryColor: R300,
59
+ primaryColor: token('color.icon.danger', R300),
59
60
  testId: `${testId}-lock-icon`
60
61
  }),
61
62
  text: jsx(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
@@ -14,6 +14,7 @@ import { ContentHeader } from '../components/ContentHeader';
14
14
  import { Link } from '../components/Link';
15
15
  import { UnresolvedText } from '../components/UnresolvedText';
16
16
  import { handleClickCommon } from '../utils/handlers';
17
+ import { token } from '@atlaskit/tokens';
17
18
  const textDescriptionProps = { ...messages.not_found_description
18
19
  };
19
20
  export const blockCardNotFoundViewClassName = 'block-card-not-found-view';
@@ -45,7 +46,7 @@ export const NotFoundView = ({
45
46
  icon: jsx(WarningIcon, {
46
47
  label: "not-found-warning-icon",
47
48
  size: "small",
48
- primaryColor: R300,
49
+ primaryColor: token('color.icon.warning', R300),
49
50
  testId: `${testId}-warning-icon`
50
51
  }),
51
52
  text: jsx(FormattedMessage, textDescriptionProps)
@@ -3,6 +3,7 @@ import { jsx } from '@emotion/core';
3
3
  import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
4
4
  import { N50, N90 } from '@atlaskit/theme/colors';
5
5
  import { fontSize } from '@atlaskit/theme/constants';
6
+ import { token } from '@atlaskit/tokens';
6
7
  import { Frame } from '../components/Frame';
7
8
  import { gs } from '../../common/utils';
8
9
  import { FormattedMessage } from 'react-intl-next';
@@ -20,12 +21,12 @@ export const ResolvingView = ({
20
21
  className: blockCardResolvingViewClassName
21
22
  }, jsx(DocumentFilledIcon, {
22
23
  size: "small",
23
- primaryColor: N50,
24
+ primaryColor: token('color.icon.subtle', N50),
24
25
  label: "document-icon"
25
26
  }), jsx("span", {
26
27
  css: {
27
28
  fontSize: `${fontSize()}px`,
28
- color: N90,
29
+ color: token('color.text.subtlest', N90),
29
30
  marginLeft: gs(0.5)
30
31
  }
31
32
  }, jsx(FormattedMessage, messages.loading)));
@@ -2,6 +2,7 @@ import styled from '@emotion/styled';
2
2
  import { size as csssize, borderRadius, size, ellipsis } from '@atlaskit/media-ui';
3
3
  import { fontFamily } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { gs as gridSize } from '../../common/utils';
6
7
  export const className = 'media-card-frame';
7
8
  export const cardShadow = ``;
@@ -36,7 +37,7 @@ function getinteractiveStyles({
36
37
  ${visibleStyles}
37
38
  }
38
39
  &:active {
39
- background-color: ${colors.B50};
40
+ background-color: ${token('color.background.selected', colors.B50)};
40
41
  }
41
42
  ` : '';
42
43
  return `${visibleFrameStyles}${interactiveFrameStyles}`;
@@ -49,7 +50,7 @@ function selected({
49
50
  ${visibleStyles}
50
51
  &::after {
51
52
  cursor: pointer;
52
- box-shadow: 0 0 0 3px ${colors.B100};
53
+ box-shadow: 0 0 0 3px ${token('color.border.selected', colors.B100)};
53
54
  content: '';
54
55
  outline: none;
55
56
  position: absolute;
@@ -96,10 +97,10 @@ const wrapperStyles = props => `
96
97
  `;
97
98
 
98
99
  const visibleStyles = `
99
- background-color: ${colors.N30};
100
+ background-color: ${token('color.background.neutral.subtle', colors.N30)};
100
101
 
101
102
  &:after {
102
- background: ${colors.N30} !important;
103
+ background: ${token('color.background.neutral', colors.N30)} !important;
103
104
  }
104
105
  .embed-header {
105
106
  opacity: 1;
@@ -128,7 +129,7 @@ export const Header = styled.div`
128
129
  width: 100%;
129
130
  display: flex;
130
131
  align-items: center;
131
- color: ${colors.N300};
132
+ color: ${token('color.icon', colors.N300)};
132
133
  opacity: 0;
133
134
  transition: 300ms opacity cubic-bezier(0.15, 1, 0.3, 1);
134
135
  `;
@@ -140,7 +141,7 @@ export const IconWrapper = styled.div`
140
141
  }) => {
141
142
  if (isPlaceholder) {
142
143
  return `
143
- background-color: ${colors.N30};
144
+ background-color: ${token('color.skeleton', colors.N30)};
144
145
  `;
145
146
  } else {
146
147
  return '';
@@ -156,12 +157,12 @@ export const TextWrapper = styled.div`
156
157
  ${borderRadius}
157
158
  width: 125px;
158
159
  height: 12px;
159
- background-color: ${colors.N30};
160
+ background-color: ${token('color.skeleton', colors.N30)};
160
161
  `;
161
162
  } else {
162
163
  return '';
163
164
  }
164
- }} color: ${colors.N300};
165
+ }} color: ${token('color.text.subtlest', colors.N300)};
165
166
  font-size: 12px;
166
167
  line-height: 16px;
167
168
  ${ellipsis('none')};
@@ -172,7 +173,7 @@ export const TextWrapper = styled.div`
172
173
  export const Content = styled.div`
173
174
  ${borderRadius}
174
175
  ${cardShadow}
175
- background-color: white;
176
+ background-color: ${token('elevation.surface', 'white')};
176
177
  position: absolute;
177
178
  z-index: 1;
178
179
  width: 100%;
@@ -198,8 +199,7 @@ export const Content = styled.div`
198
199
  if (isInteractive) {
199
200
  return `
200
201
  .${className}:hover & {
201
- box-shadow: 0 4px 8px -2px rgba(23, 43, 77, 0.32),
202
- 0 0 1px rgba(23, 43, 77, 0.25);
202
+ box-shadow: ${token('elevation.shadow.overlay', '0 4px 8px -2px rgba(23, 43, 77, 0.32), 0 0 1px rgba(23, 43, 77, 0.25)')};
203
203
  }
204
204
  `;
205
205
  } else {
@@ -224,7 +224,7 @@ export const ContentWrapper = styled.div`
224
224
  padding: 8px 12px 12px 12px;
225
225
  `;
226
226
  export const Title = styled.div`
227
- color: ${colors.N900};
227
+ color: ${token('color.text', colors.N900)};
228
228
  font-size: 16px;
229
229
  font-weight: 500;
230
230
  line-height: ${20 / 16};
@@ -233,7 +233,7 @@ export const Title = styled.div`
233
233
  `;
234
234
  export const Byline = styled.div`
235
235
  margin-top: 4px;
236
- color: ${colors.N300};
236
+ color: ${token('color.text.subtlest', colors.N300)};
237
237
  font-size: 12px;
238
238
  font-weight: normal;
239
239
  line-height: ${16 / 12};
@@ -241,7 +241,7 @@ export const Byline = styled.div`
241
241
  `;
242
242
  export const Description = styled.div`
243
243
  margin-top: 7px;
244
- color: ${colors.N800};
244
+ color: ${token('color.text', colors.N800)};
245
245
  font-size: 12px;
246
246
  font-weight: normal;
247
247
  line-height: ${18 / 12};
@@ -256,7 +256,7 @@ export const Thumbnail = styled.div`
256
256
  ${size(48)}
257
257
  float: right;
258
258
  margin: 4px 0 12px 12px;
259
- background-color: ${colors.N30};
259
+ background-color: ${token('color.skeleton', colors.N30)};
260
260
  background-image: url(${({
261
261
  src
262
262
  }) => src});
@@ -4,6 +4,7 @@ import Button from '@atlaskit/button/custom-theme-button';
4
4
  import ErrorIcon from '@atlaskit/icon/glyph/error';
5
5
  import { fontSize } from '@atlaskit/theme/constants';
6
6
  import { R300 } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
7
8
  import { Frame } from '../../BlockCard/components/Frame';
8
9
  import { FormattedMessage } from 'react-intl-next';
9
10
  import { messages } from '@atlaskit/media-ui/messages';
@@ -20,7 +21,7 @@ export const EmbedCardErroredView = ({
20
21
  testId: testId
21
22
  }, jsx(ErrorIcon, {
22
23
  size: "small",
23
- primaryColor: R300,
24
+ primaryColor: token('color.icon.danger', R300),
24
25
  label: "error-icon"
25
26
  }), jsx("span", {
26
27
  css: {
@@ -3,28 +3,10 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  /** @jsx jsx */
4
4
  import React from 'react';
5
5
  import { jsx } from '@emotion/core';
6
- import Spinner from '@atlaskit/spinner';
7
6
  import Block from '../../block';
8
7
  import { SmartLinkSize } from '../../../../../../constants';
9
-
10
- const getSpinnerSize = size => {
11
- // Spinner sizes should be equivalent or smaller than Icon size
12
- // to avoid the jumping.
13
- switch (size) {
14
- case SmartLinkSize.XLarge:
15
- return 28;
16
-
17
- case SmartLinkSize.Large:
18
- return 24;
19
-
20
- case SmartLinkSize.Medium:
21
- return 16;
22
-
23
- case SmartLinkSize.Small:
24
- default:
25
- return 12;
26
- }
27
- };
8
+ import LoadingSkeleton from '../../../common/loading-skeleton';
9
+ import { getIconSizeStyles, getIconWidth } from '../../../utils';
28
10
  /**
29
11
  * This represents a TitleBlock for a Smart Link that is currently waiting
30
12
  * for a request to finish.
@@ -32,7 +14,6 @@ const getSpinnerSize = size => {
32
14
  * @see TitleBlock
33
15
  */
34
16
 
35
-
36
17
  const TitleBlockResolvingView = ({
37
18
  actionGroup,
38
19
  testId,
@@ -42,12 +23,16 @@ const TitleBlockResolvingView = ({
42
23
  const {
43
24
  size = SmartLinkSize.Medium
44
25
  } = blockProps;
26
+ const iconWidth = getIconWidth(size);
27
+ const iconStyles = getIconSizeStyles(iconWidth);
45
28
  return jsx(Block, _extends({}, blockProps, {
46
29
  testId: `${testId}-resolving-view`
47
- }), jsx(Spinner, {
48
- size: getSpinnerSize(size),
49
- testId: `${testId}-resolving-spinner`
50
- }), title, actionGroup);
30
+ }), jsx("span", {
31
+ css: iconStyles,
32
+ "data-testid": `${testId}-icon`
33
+ }, jsx(LoadingSkeleton, {
34
+ testId: `${testId}-icon-loading`
35
+ })), title, actionGroup);
51
36
  };
52
37
 
53
38
  export default TitleBlockResolvingView;
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import Loadable from 'react-loadable';
3
3
  import { B200, B400, N700, R400 } from '@atlaskit/theme/colors';
4
4
  import { IconType } from '../../../../../constants';
5
- // prettier-ignore
5
+ import { token } from '@atlaskit/tokens'; // prettier-ignore
6
+
6
7
  const importIconMapper = {
7
8
  [IconType.Archive]: () => import(
8
9
  /* webpackChunkName: "glyphArchive" */
@@ -228,10 +229,14 @@ const AtlaskitIcon = ({
228
229
  return /*#__PURE__*/React.createElement(ImportedIcon, {
229
230
  "data-testid": testId // Confluence and Jira imports don't have native testId prop
230
231
  ,
231
- textColor: N700,
232
+ textColor: token('color.text.subtle', N700)
233
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
234
+ ,
232
235
  iconColor: B200,
233
236
  iconGradientStart: B400,
234
237
  iconGradientStop: B200
238
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
239
+
235
240
  });
236
241
 
237
242
  case IconType.Error:
@@ -239,7 +244,7 @@ const AtlaskitIcon = ({
239
244
  return /*#__PURE__*/React.createElement(ImportedIcon, {
240
245
  label: label,
241
246
  testId: testId,
242
- primaryColor: R400
247
+ primaryColor: token('color.icon.danger', R400)
243
248
  });
244
249
 
245
250
  default:
@@ -1,33 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { css, jsx, keyframes } from '@emotion/core';
3
+ import { jsx } from '@emotion/core';
4
4
  import ImageLoader from 'react-render-image';
5
- const placeholderShimmer = keyframes`
6
- 0% { background-position: -20px 0; }
7
- 100% { background-position: 20px 0; }
8
- `;
9
- const shimmer = css`
10
- border-radius: 2px;
11
- user-select: none;
12
-
13
- background: #f6f7f8;
14
- background-image: linear-gradient(
15
- to right,
16
- #f6f7f8 0%,
17
- #edeef1 20%,
18
- #f6f7f8 40%,
19
- #f6f7f8 100%
20
- );
21
- background-repeat: no-repeat;
22
- background-size: 280% 100%;
23
- display: inline-block;
24
-
25
- animation-duration: 1s;
26
- animation-fill-mode: forwards;
27
- animation-iteration-count: infinite;
28
- animation-name: ${placeholderShimmer};
29
- animation-timing-function: linear;
30
- `;
5
+ import LoadingSkeleton from '../loading-skeleton';
31
6
 
32
7
  const ImageIcon = ({
33
8
  defaultIcon,
@@ -35,9 +10,8 @@ const ImageIcon = ({
35
10
  url
36
11
  }) => jsx(ImageLoader, {
37
12
  src: url,
38
- loading: jsx("span", {
39
- css: shimmer,
40
- "data-testid": `${testId}-loading`
13
+ loading: jsx(LoadingSkeleton, {
14
+ testId: `${testId}-loading`
41
15
  }),
42
16
  loaded: jsx("img", {
43
17
  src: url,
@@ -0,0 +1,39 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { css, jsx, keyframes } from '@emotion/core';
4
+ import { token } from '@atlaskit/tokens';
5
+ const animationNameStyles = keyframes`
6
+ 0% { background-position: -20px 0; }
7
+ 100% { background-position: 20px 0; }
8
+ `;
9
+ const styles = css`
10
+ border-radius: 2px;
11
+ user-select: none;
12
+ background: ${token('color.skeleton.subtle', '#f6f7f8')};
13
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4236
14
+ background-image: linear-gradient(
15
+ to right,
16
+ ${token('color.skeleton.subtle', '#f6f7f8')} 0%,
17
+ ${token('color.skeleton', '#edeef1')} 20%,
18
+ ${token('color.skeleton.subtle', '#f6f7f8')} 40%,
19
+ ${token('color.skeleton.subtle', '#f6f7f8')}100%
20
+ );
21
+ background-repeat: no-repeat;
22
+ background-size: 280% 100%;
23
+ display: inline-block;
24
+
25
+ animation-duration: 1s;
26
+ animation-fill-mode: forwards;
27
+ animation-iteration-count: infinite;
28
+ animation-name: ${animationNameStyles};
29
+ animation-timing-function: linear;
30
+ `;
31
+
32
+ const LoadingSkeleton = ({
33
+ testId
34
+ }) => jsx("span", {
35
+ css: styles,
36
+ "data-testid": testId
37
+ });
38
+
39
+ export default LoadingSkeleton;
@@ -5,7 +5,7 @@ import { css, jsx } from '@emotion/core';
5
5
  import { SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
6
6
  import AtlaskitIcon from '../../common/atlaskit-icon';
7
7
  import ImageIcon from '../../common/image-icon';
8
- import { getIconSizeStyles, getTruncateStyles } from '../../utils';
8
+ import { getIconSizeStyles, getIconWidth, getTruncateStyles } from '../../utils';
9
9
 
10
10
  const getPositionStyles = (size, position) => {
11
11
  switch (position) {
@@ -23,23 +23,6 @@ const getPositionStyles = (size, position) => {
23
23
  }
24
24
  };
25
25
 
26
- const getWidth = size => {
27
- switch (size) {
28
- case SmartLinkSize.XLarge:
29
- return '2rem';
30
-
31
- case SmartLinkSize.Large:
32
- return '1.5rem';
33
-
34
- case SmartLinkSize.Medium:
35
- return '1rem';
36
-
37
- case SmartLinkSize.Small:
38
- default:
39
- return '.75rem';
40
- }
41
- };
42
-
43
26
  const getIconStyles = (size, position, width) => css`
44
27
  ${getPositionStyles(size, position)}
45
28
  ${getIconSizeStyles(width)}
@@ -105,7 +88,7 @@ const Icon = ({
105
88
  const defaultIcon = renderDefaultIcon(label, testId);
106
89
  return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, icon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
107
90
  }, [icon, label, render, testId, url]);
108
- const width = getWidth(size);
91
+ const width = getIconWidth(size);
109
92
  const styles = getIconStyles(size, position, width);
110
93
  const renderStyles = render ? getCustomRenderStyles(width) : undefined;
111
94
  return jsx("div", {
@@ -14,6 +14,7 @@ const containerStyles = css`
14
14
 
15
15
  const getThemeStyles = theme => {
16
16
  switch (theme) {
17
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
17
18
  case SmartLinkTheme.Black:
18
19
  return css`
19
20
  color: ${tokens.blackLink};
@@ -39,6 +39,22 @@ export const getIconSizeStyles = width => {
39
39
  }
40
40
  `;
41
41
  };
42
+ export const getIconWidth = size => {
43
+ switch (size) {
44
+ case SmartLinkSize.XLarge:
45
+ return '2rem';
46
+
47
+ case SmartLinkSize.Large:
48
+ return '1.5rem';
49
+
50
+ case SmartLinkSize.Medium:
51
+ return '1rem';
52
+
53
+ case SmartLinkSize.Small:
54
+ default:
55
+ return '.75rem';
56
+ }
57
+ };
42
58
  export const getLinkLineHeight = size => {
43
59
  switch (size) {
44
60
  case SmartLinkSize.XLarge:
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React from 'react';
3
3
  import { R300 } from '@atlaskit/theme/colors';
4
+ import { token } from '@atlaskit/tokens';
4
5
  import ErrorIcon from '@atlaskit/icon/glyph/error';
5
6
  import Button from '@atlaskit/button/custom-theme-button';
6
7
  import { Frame } from '../Frame';
@@ -61,7 +62,7 @@ export class InlineCardErroredView extends React.Component {
61
62
  icon: icon || /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
62
63
  label: "error",
63
64
  size: "small",
64
- primaryColor: R300
65
+ primaryColor: token('color.icon.danger', R300)
65
66
  })),
66
67
  title: this.renderMessage()
67
68
  }));
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React from 'react';
4
4
  import { R400, N500 } from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  import LockIcon from '@atlaskit/icon/glyph/lock-filled';
6
7
  import Button from '@atlaskit/button/custom-theme-button';
7
8
  import { Frame } from '../Frame';
@@ -13,7 +14,7 @@ import { IconStyledButton, LowercaseAppearance, LinkAppearance } from '../styled
13
14
  const FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
14
15
  label: "error",
15
16
  size: "small",
16
- primaryColor: R400
17
+ primaryColor: token('color.icon.danger', R400)
17
18
  }));
18
19
  export class InlineCardForbiddenView extends React.Component {
19
20
  constructor(...args) {
@@ -91,7 +92,7 @@ export class InlineCardForbiddenView extends React.Component {
91
92
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
92
93
  icon: icon ? icon : FallbackForbiddenIcon,
93
94
  title: this.renderMessage(),
94
- titleColor: N500
95
+ titleColor: token('color.text.subtle', N500)
95
96
  }));
96
97
  }
97
98