@atlaskit/smart-card 18.0.15 → 18.0.16

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 (83) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/extractors/common/context/extractProvider.js +14 -4
  3. package/dist/cjs/extractors/common/detail/extractCommentCount.js +3 -1
  4. package/dist/cjs/extractors/common/detail/extractProgrammingLanguage.js +3 -1
  5. package/dist/cjs/extractors/common/detail/extractSubscriberCount.js +3 -1
  6. package/dist/cjs/extractors/common/primitives/extractTitleTextColor.js +3 -1
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/cjs/view/BlockCard/components/Frame.js +10 -7
  9. package/dist/cjs/view/BlockCard/components/Link.js +3 -1
  10. package/dist/cjs/view/BlockCard/components/Provider.js +3 -1
  11. package/dist/cjs/view/BlockCard/views/ErroredView.js +3 -1
  12. package/dist/cjs/view/BlockCard/views/ForbiddenView.js +3 -1
  13. package/dist/cjs/view/BlockCard/views/NotFoundView.js +3 -1
  14. package/dist/cjs/view/BlockCard/views/ResolvingView.js +4 -2
  15. package/dist/cjs/view/EmbedCard/components/styled.js +15 -13
  16. package/dist/cjs/view/EmbedCard/views/ErroredView.js +3 -1
  17. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -2
  18. package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +3 -1
  19. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +1 -0
  20. package/dist/cjs/view/InlineCard/ErroredView/index.js +3 -1
  21. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +4 -2
  22. package/dist/cjs/view/InlineCard/Frame/styled.js +16 -13
  23. package/dist/cjs/view/InlineCard/Icon.js +3 -1
  24. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +4 -2
  25. package/dist/cjs/view/InlineCard/styled.js +6 -4
  26. package/dist/cjs/view/common/Byline.js +3 -1
  27. package/dist/cjs/view/common/Metadata.js +3 -1
  28. package/dist/cjs/view/common/ModalHeader.js +4 -2
  29. package/dist/es2019/extractors/common/context/extractProvider.js +13 -4
  30. package/dist/es2019/extractors/common/detail/extractCommentCount.js +2 -1
  31. package/dist/es2019/extractors/common/detail/extractProgrammingLanguage.js +2 -1
  32. package/dist/es2019/extractors/common/detail/extractSubscriberCount.js +2 -1
  33. package/dist/es2019/extractors/common/primitives/extractTitleTextColor.js +2 -1
  34. package/dist/es2019/version.json +1 -1
  35. package/dist/es2019/view/BlockCard/components/Frame.js +9 -7
  36. package/dist/es2019/view/BlockCard/components/Link.js +2 -1
  37. package/dist/es2019/view/BlockCard/components/Provider.js +2 -1
  38. package/dist/es2019/view/BlockCard/views/ErroredView.js +2 -1
  39. package/dist/es2019/view/BlockCard/views/ForbiddenView.js +2 -1
  40. package/dist/es2019/view/BlockCard/views/NotFoundView.js +2 -1
  41. package/dist/es2019/view/BlockCard/views/ResolvingView.js +3 -2
  42. package/dist/es2019/view/EmbedCard/components/styled.js +15 -15
  43. package/dist/es2019/view/EmbedCard/views/ErroredView.js +2 -1
  44. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -3
  45. package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +7 -6
  46. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +1 -0
  47. package/dist/es2019/view/InlineCard/ErroredView/index.js +2 -1
  48. package/dist/es2019/view/InlineCard/ForbiddenView/index.js +3 -2
  49. package/dist/es2019/view/InlineCard/Frame/styled.js +15 -12
  50. package/dist/es2019/view/InlineCard/Icon.js +7 -6
  51. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +3 -2
  52. package/dist/es2019/view/InlineCard/styled.js +5 -4
  53. package/dist/es2019/view/common/Byline.js +2 -1
  54. package/dist/es2019/view/common/Metadata.js +2 -1
  55. package/dist/es2019/view/common/ModalHeader.js +3 -2
  56. package/dist/esm/extractors/common/context/extractProvider.js +13 -4
  57. package/dist/esm/extractors/common/detail/extractCommentCount.js +2 -1
  58. package/dist/esm/extractors/common/detail/extractProgrammingLanguage.js +2 -1
  59. package/dist/esm/extractors/common/detail/extractSubscriberCount.js +2 -1
  60. package/dist/esm/extractors/common/primitives/extractTitleTextColor.js +2 -1
  61. package/dist/esm/version.json +1 -1
  62. package/dist/esm/view/BlockCard/components/Frame.js +9 -7
  63. package/dist/esm/view/BlockCard/components/Link.js +2 -1
  64. package/dist/esm/view/BlockCard/components/Provider.js +2 -1
  65. package/dist/esm/view/BlockCard/views/ErroredView.js +2 -1
  66. package/dist/esm/view/BlockCard/views/ForbiddenView.js +2 -1
  67. package/dist/esm/view/BlockCard/views/NotFoundView.js +2 -1
  68. package/dist/esm/view/BlockCard/views/ResolvingView.js +3 -2
  69. package/dist/esm/view/EmbedCard/components/styled.js +14 -13
  70. package/dist/esm/view/EmbedCard/views/ErroredView.js +2 -1
  71. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -3
  72. package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +2 -1
  73. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +1 -0
  74. package/dist/esm/view/InlineCard/ErroredView/index.js +2 -1
  75. package/dist/esm/view/InlineCard/ForbiddenView/index.js +3 -2
  76. package/dist/esm/view/InlineCard/Frame/styled.js +16 -13
  77. package/dist/esm/view/InlineCard/Icon.js +2 -1
  78. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +3 -2
  79. package/dist/esm/view/InlineCard/styled.js +5 -4
  80. package/dist/esm/view/common/Byline.js +2 -1
  81. package/dist/esm/view/common/Metadata.js +2 -1
  82. package/dist/esm/view/common/ModalHeader.js +3 -2
  83. package/package.json +7 -2
@@ -13,6 +13,8 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
13
13
 
14
14
  var _core = require("@emotion/core");
15
15
 
16
+ var _tokens = require("@atlaskit/tokens");
17
+
16
18
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
17
19
 
18
20
  var placeholderShimmer = (0, _core.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n background-position: -20px 0;\n }\n\n 100% {\n background-position: 20px 0;\n }\n"]))); // TODO: Figure out a more scalable/responsive solution
@@ -32,6 +34,6 @@ var AKIconWrapper = _styled.default.span(_templateObject3 || (_templateObject3 =
32
34
 
33
35
  exports.AKIconWrapper = AKIconWrapper;
34
36
 
35
- var Shimmer = _styled.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: 14px;\n width: 14px;\n margin-right: 4px;\n border-radius: 2px;\n user-select: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n background: #f6f7f8;\n background-image: linear-gradient(\n to right,\n #f6f7f8 0%,\n #edeef1 20%,\n #f6f7f8 40%,\n #f6f7f8 100%\n );\n background-repeat: no-repeat;\n background-size: 40px 14px;\n display: inline-block;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: ", ";\n animation-timing-function: linear;\n"])), placeholderShimmer);
37
+ var Shimmer = _styled.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: 14px;\n width: 14px;\n margin-right: 4px;\n border-radius: 2px;\n user-select: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: ", ";\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4236\n background-image: linear-gradient(\n to right,\n ", " 0%,\n ", " 20%,\n ", " 40%,\n ", "100%\n );\n background-repeat: no-repeat;\n background-size: 40px 14px;\n display: inline-block;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: ", ";\n animation-timing-function: linear;\n"])), (0, _tokens.token)('color.skeleton.subtle', '#f6f7f8'), (0, _tokens.token)('color.skeleton.subtle', '#f6f7f8'), (0, _tokens.token)('color.skeleton', '#edeef1'), (0, _tokens.token)('color.skeleton.subtle', '#f6f7f8'), (0, _tokens.token)('color.skeleton.subtle', '#f6f7f8'), placeholderShimmer);
36
38
 
37
39
  exports.Shimmer = Shimmer;
@@ -27,6 +27,8 @@ var _lockFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/lock-fill
27
27
 
28
28
  var _colors = require("@atlaskit/theme/colors");
29
29
 
30
+ var _tokens = require("@atlaskit/tokens");
31
+
30
32
  var _react = _interopRequireDefault(require("react"));
31
33
 
32
34
  var _reactIntlNext = require("react-intl-next");
@@ -48,7 +50,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
48
50
  var FallbackUnauthorizedIcon = /*#__PURE__*/_react.default.createElement(_Icon.AKIconWrapper, null, /*#__PURE__*/_react.default.createElement(_lockFilled.default, {
49
51
  label: "error",
50
52
  size: "small",
51
- primaryColor: _colors.R400
53
+ primaryColor: (0, _tokens.token)('color.icon.danger', _colors.R400)
52
54
  }));
53
55
 
54
56
  var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component) {
@@ -108,7 +110,7 @@ var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component) {
108
110
  }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
109
111
  icon: icon ? icon : FallbackUnauthorizedIcon,
110
112
  title: this.renderMessage(),
111
- titleColor: _colors.N500
113
+ titleColor: (0, _tokens.token)('color.text.subtle', _colors.N500)
112
114
  }));
113
115
  }
114
116
  }]);
@@ -15,6 +15,8 @@ var _colors = require("@atlaskit/theme/colors");
15
15
 
16
16
  var _components = require("@atlaskit/theme/components");
17
17
 
18
+ var _tokens = require("@atlaskit/tokens");
19
+
18
20
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
19
21
 
20
22
  var LINK_COLOR_DARK = '#4794FF'; // By default buttons will hide overflow and ellipsis content instead of wrapping.
@@ -25,8 +27,8 @@ var IconStyledButton = _styled.default.span(_templateObject || (_templateObject
25
27
  exports.IconStyledButton = IconStyledButton;
26
28
 
27
29
  var NoLinkAppearance = _styled.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _components.themed)({
28
- light: _colors.N200,
29
- dark: LINK_COLOR_DARK
30
+ light: (0, _tokens.token)('color.text.subtlest', _colors.N200),
31
+ dark: (0, _tokens.token)('color.text.subtlest', LINK_COLOR_DARK)
30
32
  }));
31
33
 
32
34
  exports.NoLinkAppearance = NoLinkAppearance;
@@ -36,8 +38,8 @@ var LowercaseAppearance = _styled.default.span(_templateObject3 || (_templateObj
36
38
  exports.LowercaseAppearance = LowercaseAppearance;
37
39
 
38
40
  var LinkAppearance = _styled.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _components.themed)({
39
- light: _colors.B400,
40
- dark: LINK_COLOR_DARK
41
+ light: (0, _tokens.token)('color.link', _colors.B400),
42
+ dark: (0, _tokens.token)('color.link', LINK_COLOR_DARK)
41
43
  }));
42
44
 
43
45
  exports.LinkAppearance = LinkAppearance;
@@ -9,6 +9,8 @@ var _core = require("@emotion/core");
9
9
 
10
10
  var _colors = require("@atlaskit/theme/colors");
11
11
 
12
+ var _tokens = require("@atlaskit/tokens");
13
+
12
14
  var _utils = require("./utils");
13
15
 
14
16
  /** @jsx jsx */
@@ -21,7 +23,7 @@ var Byline = function Byline(_ref) {
21
23
  css: (0, _utils.mq)({
22
24
  fontSize: (0, _utils.gs)(1.5),
23
25
  lineHeight: (0, _utils.gs)(2.5),
24
- color: "".concat(_colors.N300),
26
+ color: "".concat((0, _tokens.token)('color.text.subtlest', _colors.N300)),
25
27
  fontWeight: 'normal',
26
28
  marginTop: (0, _utils.gs)(0.5),
27
29
  // Spec: only allow two lines MAX to be shown.
@@ -15,6 +15,8 @@ var _utils = require("./utils");
15
15
 
16
16
  var _colors = require("@atlaskit/theme/colors");
17
17
 
18
+ var _tokens = require("@atlaskit/tokens");
19
+
18
20
  /** @jsx jsx */
19
21
  var Metadata = function Metadata(_ref) {
20
22
  var text = _ref.text,
@@ -42,7 +44,7 @@ var Metadata = function Metadata(_ref) {
42
44
  }, metadataIcon, (0, _core.jsx)("span", {
43
45
  css: {
44
46
  fontSize: (0, _utils.gs)(1.5),
45
- color: "".concat(_colors.N300),
47
+ color: "".concat((0, _tokens.token)('color.text.subtlest', _colors.N300)),
46
48
  marginRight: (0, _utils.gs)(0.5),
47
49
  marginLeft: '2px'
48
50
  }
@@ -21,6 +21,8 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
21
21
 
22
22
  var _colors = require("@atlaskit/theme/colors");
23
23
 
24
+ var _tokens = require("@atlaskit/tokens");
25
+
24
26
  var _reactIntlNext = require("react-intl-next");
25
27
 
26
28
  var _utils = require("./utils");
@@ -64,7 +66,7 @@ var Header = function Header(_ref) {
64
66
  display: 'flex',
65
67
  justifyContent: 'space-between',
66
68
  alignItems: 'baseline',
67
- borderBottom: "1px solid ".concat(_colors.N30A)
69
+ borderBottom: "1px solid ".concat((0, _tokens.token)('color.border', _colors.N30A))
68
70
  }
69
71
  }, (0, _core.jsx)("div", {
70
72
  css: {
@@ -81,7 +83,7 @@ var Header = function Header(_ref) {
81
83
  }
82
84
  }, (0, _core.jsx)("h3", null, title), (0, _core.jsx)("div", {
83
85
  css: {
84
- color: _colors.N100
86
+ color: (0, _tokens.token)('color.text.subtlest', _colors.N100)
85
87
  }
86
88
  }, metadata.items.length && (0, _core.jsx)(_MetadataList.MetadataList, {
87
89
  items: metadata.items
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { N700, B200, B400 } from '@atlaskit/theme/colors';
3
+ import { token } from '@atlaskit/tokens';
3
4
  import { ConfluenceIcon } from '@atlaskit/logo/confluence-icon';
4
5
  import { JiraIcon } from '@atlaskit/logo/jira-icon';
5
6
  import { extractUrlFromIconJsonLd } from '../utils';
@@ -33,18 +34,26 @@ const extractProviderIcon = (icon, id) => {
33
34
  if (id) {
34
35
  if (id === CONFLUENCE_GENERATOR_ID) {
35
36
  return /*#__PURE__*/React.createElement(ConfluenceIcon, {
36
- textColor: N700,
37
+ textColor: token('color.text.subtle', N700)
38
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
39
+ ,
37
40
  iconColor: B200,
38
41
  iconGradientStart: B400,
39
- iconGradientStop: B200,
42
+ iconGradientStop: B200
43
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
44
+ ,
40
45
  size: "xsmall"
41
46
  });
42
47
  } else if (id === JIRA_GENERATOR_ID) {
43
48
  return /*#__PURE__*/React.createElement(JiraIcon, {
44
- textColor: N700,
49
+ textColor: token('color.text.subtle', N700)
50
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
51
+ ,
45
52
  iconColor: B200,
46
53
  iconGradientStart: B400,
47
- iconGradientStop: B200,
54
+ iconGradientStop: B200
55
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
56
+ ,
48
57
  size: "xsmall"
49
58
  });
50
59
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { N600 } from '@atlaskit/theme/colors';
3
+ import { token } from '@atlaskit/tokens';
3
4
  import ChatIcon from '@atlaskit/icon/glyph/comment';
4
5
  export const extractCommentCount = jsonLd => {
5
6
  const commentCount = jsonLd['schema:commentCount'];
@@ -11,7 +12,7 @@ export const extractCommentCount = jsonLd => {
11
12
  label: "comment-count",
12
13
  key: "comments-count-icon",
13
14
  size: "small",
14
- primaryColor: N600
15
+ primaryColor: token('color.icon.subtle', N600)
15
16
  })
16
17
  };
17
18
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { N600 } from '@atlaskit/theme/colors';
3
3
  import CodeIcon from '@atlaskit/icon/glyph/code';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const extractProgrammingLanguage = jsonLd => {
5
6
  const programmingLanguage = jsonLd['schema:programmingLanguage'];
6
7
 
@@ -10,7 +11,7 @@ export const extractProgrammingLanguage = jsonLd => {
10
11
  icon: /*#__PURE__*/React.createElement(CodeIcon, {
11
12
  size: "small",
12
13
  label: "code",
13
- primaryColor: N600
14
+ primaryColor: token('color.icon.subtle', N600)
14
15
  })
15
16
  };
16
17
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { N600 } from '@atlaskit/theme/colors';
3
3
  import PeopleIcon from '@atlaskit/icon/glyph/people';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const extractSubscriberCount = jsonLd => {
5
6
  const subscriberCount = jsonLd['atlassian:subscriberCount'];
6
7
 
@@ -10,7 +11,7 @@ export const extractSubscriberCount = jsonLd => {
10
11
  icon: /*#__PURE__*/React.createElement(PeopleIcon, {
11
12
  size: "small",
12
13
  label: "subscribers",
13
- primaryColor: N600
14
+ primaryColor: token('color.icon.subtle', N600)
14
15
  })
15
16
  };
16
17
  }
@@ -1,5 +1,6 @@
1
1
  import { extractorPriorityMap } from '../icon/priority';
2
2
  import { R500 } from '@atlaskit/theme/colors';
3
+ import { token } from '@atlaskit/tokens';
3
4
  export const extractTitleTextColor = jsonLd => {
4
5
  const type = jsonLd['@type'];
5
6
 
@@ -8,7 +9,7 @@ export const extractTitleTextColor = jsonLd => {
8
9
 
9
10
  switch (highestPriorityType) {
10
11
  case 'atlassian:UndefinedLink':
11
- return R500;
12
+ return token('color.text.danger', R500);
12
13
 
13
14
  default:
14
15
  return undefined;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "18.0.15",
3
+ "version": "18.0.16",
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: {
@@ -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:
@@ -2,6 +2,7 @@
2
2
  import React from 'react';
3
3
  import { css, jsx, keyframes } from '@emotion/core';
4
4
  import ImageLoader from 'react-render-image';
5
+ import { token } from '@atlaskit/tokens';
5
6
  const placeholderShimmer = keyframes`
6
7
  0% { background-position: -20px 0; }
7
8
  100% { background-position: 20px 0; }
@@ -9,14 +10,14 @@ const placeholderShimmer = keyframes`
9
10
  const shimmer = css`
10
11
  border-radius: 2px;
11
12
  user-select: none;
12
-
13
- background: #f6f7f8;
13
+ background: ${token('color.skeleton.subtle', '#f6f7f8')};
14
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4236
14
15
  background-image: linear-gradient(
15
16
  to right,
16
- #f6f7f8 0%,
17
- #edeef1 20%,
18
- #f6f7f8 40%,
19
- #f6f7f8 100%
17
+ ${token('color.skeleton.subtle', '#f6f7f8')} 0%,
18
+ ${token('color.skeleton', '#edeef1')} 20%,
19
+ ${token('color.skeleton.subtle', '#f6f7f8')} 40%,
20
+ ${token('color.skeleton.subtle', '#f6f7f8')}100%
20
21
  );
21
22
  background-repeat: no-repeat;
22
23
  background-size: 280% 100%;
@@ -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};
@@ -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
  }));