@atlaskit/media-card 74.4.0 → 74.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/card/card.js +1 -1
  3. package/dist/cjs/card/cardImageView/cardOverlay/index.js +1 -3
  4. package/dist/cjs/card/cardImageView/cardOverlay/styles.js +6 -8
  5. package/dist/cjs/card/cardImageView/fileCardImageView.js +1 -3
  6. package/dist/cjs/card/cardImageView/styles.js +7 -9
  7. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  8. package/dist/cjs/card/styles/index.js +1 -3
  9. package/dist/cjs/card/ui/blanket/styles.js +1 -3
  10. package/dist/cjs/card/ui/iconMessage/styles.js +1 -3
  11. package/dist/cjs/card/ui/loadingRateLimited/styles.js +1 -3
  12. package/dist/cjs/card/ui/newFileExperience/newFileExperienceWrapper.js +5 -1
  13. package/dist/cjs/card/ui/newFileExperience/styles.js +12 -4
  14. package/dist/cjs/card/ui/playButton/styles.js +2 -4
  15. package/dist/cjs/card/ui/styles.js +1 -3
  16. package/dist/cjs/card/ui/tickBox/styles.js +2 -4
  17. package/dist/cjs/card/ui/titleBox/failedTitleBox.js +1 -3
  18. package/dist/cjs/card/ui/titleBox/styles.js +19 -5
  19. package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +5 -1
  20. package/dist/cjs/card/ui/unhandledErrorCard/index.js +2 -4
  21. package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  22. package/dist/cjs/utils/cardActions/styles.js +2 -4
  23. package/dist/cjs/utils/errorIcon/styles.js +1 -3
  24. package/dist/cjs/utils/lightCards/styles.js +4 -6
  25. package/dist/cjs/utils/ufoExperiences.js +1 -1
  26. package/dist/cjs/version.json +1 -1
  27. package/dist/es2019/card/card.js +1 -1
  28. package/dist/es2019/card/cardImageView/cardOverlay/index.js +1 -2
  29. package/dist/es2019/card/cardImageView/cardOverlay/styles.js +20 -21
  30. package/dist/es2019/card/cardImageView/fileCardImageView.js +1 -2
  31. package/dist/es2019/card/cardImageView/styles.js +7 -8
  32. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  33. package/dist/es2019/card/styles/index.js +1 -2
  34. package/dist/es2019/card/ui/blanket/styles.js +1 -2
  35. package/dist/es2019/card/ui/iconMessage/styles.js +1 -2
  36. package/dist/es2019/card/ui/loadingRateLimited/styles.js +1 -2
  37. package/dist/es2019/card/ui/newFileExperience/newFileExperienceWrapper.js +4 -1
  38. package/dist/es2019/card/ui/newFileExperience/styles.js +10 -3
  39. package/dist/es2019/card/ui/playButton/styles.js +2 -3
  40. package/dist/es2019/card/ui/styles.js +1 -2
  41. package/dist/es2019/card/ui/tickBox/styles.js +4 -5
  42. package/dist/es2019/card/ui/titleBox/failedTitleBox.js +1 -2
  43. package/dist/es2019/card/ui/titleBox/styles.js +20 -7
  44. package/dist/es2019/card/ui/titleBox/titleBoxComponents.js +4 -1
  45. package/dist/es2019/card/ui/unhandledErrorCard/index.js +3 -4
  46. package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  47. package/dist/es2019/utils/cardActions/styles.js +4 -5
  48. package/dist/es2019/utils/errorIcon/styles.js +1 -2
  49. package/dist/es2019/utils/lightCards/styles.js +4 -5
  50. package/dist/es2019/utils/ufoExperiences.js +1 -1
  51. package/dist/es2019/version.json +1 -1
  52. package/dist/esm/card/card.js +1 -1
  53. package/dist/esm/card/cardImageView/cardOverlay/index.js +1 -2
  54. package/dist/esm/card/cardImageView/cardOverlay/styles.js +6 -7
  55. package/dist/esm/card/cardImageView/fileCardImageView.js +1 -2
  56. package/dist/esm/card/cardImageView/styles.js +7 -8
  57. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  58. package/dist/esm/card/styles/index.js +1 -2
  59. package/dist/esm/card/ui/blanket/styles.js +1 -2
  60. package/dist/esm/card/ui/iconMessage/styles.js +1 -2
  61. package/dist/esm/card/ui/loadingRateLimited/styles.js +1 -2
  62. package/dist/esm/card/ui/newFileExperience/newFileExperienceWrapper.js +4 -1
  63. package/dist/esm/card/ui/newFileExperience/styles.js +10 -3
  64. package/dist/esm/card/ui/playButton/styles.js +2 -3
  65. package/dist/esm/card/ui/styles.js +1 -2
  66. package/dist/esm/card/ui/tickBox/styles.js +2 -3
  67. package/dist/esm/card/ui/titleBox/failedTitleBox.js +1 -2
  68. package/dist/esm/card/ui/titleBox/styles.js +19 -5
  69. package/dist/esm/card/ui/titleBox/titleBoxComponents.js +4 -1
  70. package/dist/esm/card/ui/unhandledErrorCard/index.js +2 -3
  71. package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
  72. package/dist/esm/utils/cardActions/styles.js +2 -3
  73. package/dist/esm/utils/errorIcon/styles.js +1 -2
  74. package/dist/esm/utils/lightCards/styles.js +4 -5
  75. package/dist/esm/utils/ufoExperiences.js +1 -1
  76. package/dist/esm/version.json +1 -1
  77. package/dist/types/card/ui/newFileExperience/styles.d.ts +1 -1
  78. package/dist/types/card/ui/newFileExperience/types.d.ts +2 -0
  79. package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
  80. package/dist/types/card/ui/titleBox/types.d.ts +2 -0
  81. package/package.json +2 -2
  82. package/report.api.md +16 -0
@@ -22,7 +22,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
22
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
23
 
24
24
  var packageName = "@atlaskit/media-card";
25
- var packageVersion = "74.4.0";
25
+ var packageVersion = "74.4.1";
26
26
  var concurrentExperience;
27
27
 
28
28
  var getExperience = function getExperience(id) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.4.0",
3
+ "version": "74.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -26,7 +26,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
26
26
  import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
27
27
  import { generateUniqueId } from '../utils/generateUniqueId';
28
28
  const packageName = "@atlaskit/media-card";
29
- const packageVersion = "74.4.0";
29
+ const packageVersion = "74.4.1";
30
30
  export class CardBase extends Component {
31
31
  // An internalOccurrenceKey is a randomly generated value to differentiate various instances
32
32
  // of Cards regardless of whether it shares the same file (either internal or external)
@@ -5,7 +5,6 @@ import { jsx } from '@emotion/react';
5
5
  import React from 'react';
6
6
  import { Component } from 'react';
7
7
  import cx from 'classnames';
8
- import { token } from '@atlaskit/tokens';
9
8
  import TickIcon from '@atlaskit/icon/glyph/check';
10
9
  import { Ellipsify } from '@atlaskit/media-ui'; // We dont require things directly from "utils" to avoid circular dependencies
11
10
 
@@ -76,7 +75,7 @@ export class CardOverlay extends Component {
76
75
  actions
77
76
  } = this.props;
78
77
  const titleText = resolveTitleText(cardStatus, mediaName, error, selected);
79
- const menuTriggerColor = !persistent ? token('color.icon.inverse', 'white') : undefined;
78
+ const menuTriggerColor = !persistent ? "var(--ds-icon-inverse, white)" : undefined;
80
79
  return jsx(Overlay, {
81
80
  hasError: !!error,
82
81
  noHover: noHover,
@@ -8,24 +8,23 @@ import { css } from '@emotion/react';
8
8
  import { borderRadius, size, ellipsis, absolute } from '@atlaskit/media-ui';
9
9
  import { themed } from '@atlaskit/theme/components';
10
10
  import * as colors from '@atlaskit/theme/colors';
11
- import { token } from '@atlaskit/tokens';
12
11
  import { rgba, easeOutCubic, transition, antialiased } from '../../styles';
13
12
  export const tickBoxStyles = css`
14
13
  ${size(14)}
15
14
  ${transition()}
16
- background-color: ${token('elevation.surface.overlay', rgba('#ffffff', 0.5))};
15
+ background-color: ${`var(--ds-surface-overlay, ${rgba('#ffffff', 0.5)})`};
17
16
  position: absolute;
18
17
  top: 8px;
19
18
  right: 8px;
20
19
  border-radius: 20px;
21
- color: ${token('color.icon.subtle', '#798599')}; /* CLEANUP - TODO FIL-3884: Align color with new design */
20
+ color: ${"var(--ds-icon-subtle, #798599)"}; /* CLEANUP - TODO FIL-3884: Align color with new design */
22
21
  display: flex;
23
22
  opacity: 0;
24
23
 
25
24
  &.selected {
26
25
  opacity: 1;
27
- color: ${token('color.icon.inverse', 'white')};
28
- background-color: ${token('color.icon.selected', '#0052cc')}; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */
26
+ color: ${"var(--ds-icon-inverse, white)"};
27
+ background-color: ${"var(--ds-icon-selected, #0052cc)"}; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */
29
28
  }
30
29
 
31
30
  /* Enforce dimensions of "tick" icon */
@@ -64,7 +63,7 @@ export const overlayStyles = props => css`
64
63
  &:not(.persistent):hover, &.active {
65
64
  .top-row {
66
65
  .title {
67
- color: ${token('color.text.information', colors.B400)};
66
+ color: ${`var(--ds-text-information, ${colors.B400})`};
68
67
  }
69
68
  }
70
69
  }
@@ -72,7 +71,7 @@ export const overlayStyles = props => css`
72
71
  &.noHover:hover {
73
72
  .top-row {
74
73
  .title {
75
- color: ${token('color.text', colors.N800)};
74
+ color: ${`var(--ds-text, ${colors.N800})`};
76
75
  }
77
76
  }
78
77
  }
@@ -83,22 +82,22 @@ export const overlayStyles = props => css`
83
82
 
84
83
  &:not(.persistent) {
85
84
  &:not(.error, .noHover):hover {
86
- background-color: ${token('color.background.neutral.hovered', rgba(colors.N900, 0.06))};
85
+ background-color: ${`var(--ds-background-neutral-hovered, ${rgba(colors.N900, 0.06)})`};
87
86
  }
88
87
 
89
88
  &.selectable {
90
89
  &.selected {
91
- background-color: ${token('color.background.selected', colors.B200)};
90
+ background-color: ${`var(--ds-background-selected, ${colors.B200})`};
92
91
 
93
92
  &:hover {
94
93
  /* CLEANUP - TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */
95
- background-color: ${token('color.background.selected.hovered', rgba(colors.N900, 0.16))};
94
+ background-color: ${`var(--ds-background-selected-hovered, ${rgba(colors.N900, 0.16)})`};
96
95
  }
97
96
 
98
97
  .title,
99
98
  .bottom-row,
100
99
  .file-size {
101
- color: ${token('color.text', colors.N900)};
100
+ color: ${`var(--ds-text, ${colors.N900})`};
102
101
  }
103
102
  }
104
103
  }
@@ -113,7 +112,7 @@ export const overlayStyles = props => css`
113
112
  .title {
114
113
  transition: opacity 0.3s;
115
114
  opacity: 0;
116
- color: ${token('color.text', 'white')};
115
+ color: ${"var(--ds-text, white)"};
117
116
  visibility: hidden;
118
117
  }
119
118
  }
@@ -129,14 +128,14 @@ export const overlayStyles = props => css`
129
128
  }
130
129
 
131
130
  .file-size {
132
- color: ${token('color.text', 'white')};
131
+ color: ${"var(--ds-text, white)"};
133
132
  display: none;
134
133
  }
135
134
  }
136
135
 
137
136
  &:hover,
138
137
  &.active {
139
- background-color: ${token('color.interaction.hovered', rgba(colors.N900, 0.5))};
138
+ background-color: ${`var(--ds-interaction-hovered, ${rgba(colors.N900, 0.5)})`};
140
139
 
141
140
  .title {
142
141
  opacity: 1;
@@ -164,8 +163,8 @@ export const overlayStyles = props => css`
164
163
 
165
164
  &.selected {
166
165
  .tickbox {
167
- background-color: ${token('color.background.selected.bold', colors.B200)} !important;
168
- color: ${token('color.icon.inverse', 'white')};
166
+ background-color: ${`var(--ds-background-selected-bold, ${colors.B200})`} !important;
167
+ color: ${"var(--ds-icon-inverse, white)"};
169
168
  }
170
169
  }
171
170
  }
@@ -179,7 +178,7 @@ export const overlayStyles = props => css`
179
178
  &.active {
180
179
  .top-row {
181
180
  .title {
182
- color: ${token('color.text', colors.N800)};
181
+ color: ${`var(--ds-text, ${colors.N800})`};
183
182
  }
184
183
  }
185
184
  }
@@ -207,7 +206,7 @@ export const errorMessageStyles = css`
207
206
  ${antialiased} display: inline-block;
208
207
  vertical-align: middle;
209
208
  font-weight: bold;
210
- color: ${token('color.text.subtlest', colors.N70)};
209
+ color: ${`var(--ds-text-subtlest, ${colors.N70})`};
211
210
  font-size: 12px;
212
211
  line-height: 15px;
213
212
  overflow: hidden;
@@ -224,8 +223,8 @@ export const titleWrapperStyles = theme => css`
224
223
  box-sizing: border-box;
225
224
  word-wrap: break-word;
226
225
  color: ${themed({
227
- light: token('color.text', colors.N800),
228
- dark: token('color.text', colors.DN900)
226
+ light: `var(--ds-text, ${colors.N800})`,
227
+ dark: `var(--ds-text, ${colors.DN900})`
229
228
  })({
230
229
  theme
231
230
  })};
@@ -234,7 +233,7 @@ export const titleWrapperStyles = theme => css`
234
233
  `;
235
234
  export const subtitleStyles = css`
236
235
  ${ellipsis('100px')} font-size: 12px;
237
- color: ${token('color.text.subtlest', '#5e6c84')};
236
+ color: ${"var(--ds-text-subtlest, #5e6c84)"};
238
237
  `;
239
238
  export const metadataStyles = css`
240
239
  display: flex;
@@ -3,7 +3,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  /**@jsx jsx */
4
4
  import { jsx } from '@emotion/react';
5
5
  import React, { Component } from 'react';
6
- import { token } from '@atlaskit/tokens';
7
6
  import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
8
7
  import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
9
8
  import { CardOverlay } from './cardOverlay';
@@ -220,7 +219,7 @@ export class FileCardImageView extends Component {
220
219
  css: cardActionsWrapperStyles
221
220
  }, actions ? jsx(CardActions, {
222
221
  actions: actions,
223
- triggerColor: token('color.icon.inverse', 'white')
222
+ triggerColor: "var(--ds-icon-inverse, white)"
224
223
  }) : null))));
225
224
  });
226
225
 
@@ -1,5 +1,4 @@
1
1
  import { css } from '@emotion/react';
2
- import { token } from '@atlaskit/tokens';
3
2
  import { absolute, borderRadius, size } from '@atlaskit/media-ui';
4
3
  import { themed } from '@atlaskit/theme/components';
5
4
  import { N20, DN50, N0 } from '@atlaskit/theme/colors';
@@ -18,8 +17,8 @@ const getBackgroundColor = props => {
18
17
  mediaType
19
18
  } = props;
20
19
  return `background: ${mediaType === 'image' ? 'transparent' : themed({
21
- light: token('color.background.neutral', N20),
22
- dark: token('color.background.neutral', DN50)
20
+ light: `var(--ds-background-neutral, ${N20})`,
21
+ dark: `var(--ds-background-neutral, ${DN50})`
23
22
  })(props)};`;
24
23
  };
25
24
 
@@ -59,7 +58,7 @@ export const playIconWrapperStyles = css`
59
58
  display: flex;
60
59
  align-items: center;
61
60
  justify-content: center;
62
- color: ${token('color.icon.inverse', 'white')};
61
+ color: ${"var(--ds-icon-inverse, white)"};
63
62
 
64
63
  /* we want to override default icon size and hover state */
65
64
  &:hover > * {
@@ -68,7 +67,7 @@ export const playIconWrapperStyles = css`
68
67
  }
69
68
  `;
70
69
  export const playIconBackgroundStyles = css`
71
- background: ${token('color.background.neutral.bold', 'rgba(23, 43, 77, 0.7)')};
70
+ background: ${"var(--ds-background-neutral-bold, rgba(23, 43, 77, 0.7))"};
72
71
  border-radius: 100%;
73
72
  padding: 10px;
74
73
  display: flex;
@@ -89,12 +88,12 @@ export const overlayStyles = css`
89
88
  ${absolute()}
90
89
  ${size()}
91
90
  border-radius: inherit;
92
- background-color: ${token('color.blanket', 'rgba(9, 30, 66, 0.5)')};
91
+ background-color: ${"var(--ds-blanket, rgba(9, 30, 66, 0.5))"};
93
92
  `;
94
93
  export const titleStyles = css`
95
94
  ${absolute()} width: 100%;
96
95
  padding: 8px;
97
- color: ${token('color.text.inverse', N0)};
96
+ color: ${`var(--ds-text-inverse, ${N0})`};
98
97
  font-size: 12px;
99
98
  line-height: 18px;
100
99
  word-wrap: break-word;
@@ -105,7 +104,7 @@ export const bodyStyles = css`
105
104
  bottom: 0;
106
105
  width: 100%;
107
106
  padding: 8px;
108
- color: ${token('color.text.inverse', N0)};
107
+ color: ${`var(--ds-text-inverse, ${N0})`};
109
108
  `;
110
109
  /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
111
110
 
@@ -80,7 +80,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
80
80
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
81
81
 
82
82
  const packageName = "@atlaskit/media-card";
83
- const packageVersion = "74.4.0";
83
+ const packageVersion = "74.4.1";
84
84
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
85
85
  packageVersion,
86
86
  packageName,
@@ -1,7 +1,6 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { fontFamily } from '@atlaskit/theme/constants';
3
3
  import { fadeIn } from '@atlaskit/media-ui';
4
- import { token } from '@atlaskit/tokens';
5
4
  export { defaultTransitionDuration } from './config';
6
5
  export { antialiased, borderRadiusLeft, capitalize, centerSelf, centerSelfX, centerSelfY, centerX, hexToRgb, rgba, spaceAround, transition, withAppearance } from './mixins';
7
6
  export { easeOutCubic, easeOutExpo } from './easing';
@@ -15,7 +14,7 @@ export const rootStyles = () => css`
15
14
  }
16
15
  `;
17
16
  export const cardShadow = `
18
- box-shadow: ${token('elevation.shadow.raised', '0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24)')};
17
+ box-shadow: ${"var(--ds-shadow-raised, 0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24))"};
19
18
  `;
20
19
  export const fadeinImageStyles = () => css`
21
20
  ${fadeIn};
@@ -1,9 +1,8 @@
1
- import { token } from '@atlaskit/tokens';
2
1
  import { css } from '@emotion/react';
3
2
  import { transition } from '../../styles';
4
3
  import { N90A } from '@atlaskit/theme/colors';
5
4
  export const blanketClassName = 'media-card-blanket';
6
- export const fixedBlanketStyles = `background-color: ${token('color.blanket', N90A)};`;
5
+ export const fixedBlanketStyles = `background-color: ${`var(--ds-blanket, ${N90A})`};`;
7
6
  export const blanketStyles = isFixed => css`
8
7
  ${transition()}
9
8
  position: absolute;
@@ -1,4 +1,3 @@
1
- import { token } from '@atlaskit/tokens';
2
1
  import { css, keyframes } from '@emotion/react';
3
2
  import { N300 } from '@atlaskit/theme/colors';
4
3
  const breatheAnimation = keyframes`
@@ -20,7 +19,7 @@ const getStylesBasedOnProps = ({
20
19
  opacity: 1;
21
20
  font-weight: 450;
22
21
  ${reducedFont ? 'font-size: 0.7em;' : ''}
23
- color: ${token('color.text.subtlest', N300)};
22
+ color: ${`var(--ds-text-subtlest, ${N300})`};
24
23
  text-align: center;
25
24
  ${animated ? animatedStyles : ''}
26
25
  margin-bottom: -1em;
@@ -1,4 +1,3 @@
1
- import { token } from '@atlaskit/tokens';
2
1
  import { css } from '@emotion/react';
3
2
  import { generateResponsiveStyles } from '../progressBar/styles';
4
3
  import { N300 } from '@atlaskit/theme/colors';
@@ -27,7 +26,7 @@ export const loadingRateLimitedTextWrapperStyles = ({
27
26
  }) => css`
28
27
  margin-top: 10px;
29
28
  overflow: hidden;
30
- color: ${token('color.text.subtlest', N300)};
29
+ color: ${`var(--ds-text-subtlest, ${N300})`};
31
30
  display: block;
32
31
  width: 100%;
33
32
  text-align: center;
@@ -2,6 +2,7 @@
2
2
  import { jsx } from '@emotion/react';
3
3
  import { newFileExperienceClassName } from '../../cardConstants';
4
4
  import { newFileExperienceWrapperStyles } from './styles';
5
+ import { useGlobalTheme } from '@atlaskit/theme/components';
5
6
  export const NewFileExperienceWrapper = props => {
6
7
  const {
7
8
  testId,
@@ -19,6 +20,7 @@ export const NewFileExperienceWrapper = props => {
19
20
  isTickBoxSelectable,
20
21
  shouldDisplayTooltip
21
22
  } = props;
23
+ const theme = useGlobalTheme();
22
24
  return jsx("div", {
23
25
  id: "newFileExperienceWrapper",
24
26
  className: newFileExperienceClassName,
@@ -33,7 +35,8 @@ export const NewFileExperienceWrapper = props => {
33
35
  isPlayButtonClickable,
34
36
  isTickBoxSelectable,
35
37
  shouldDisplayTooltip,
36
- mediaCardCursor
38
+ mediaCardCursor,
39
+ theme
37
40
  }),
38
41
  ref: innerRef,
39
42
  onClick: onClick,
@@ -2,12 +2,13 @@ import { css } from '@emotion/react';
2
2
  import { fontFamily } from '@atlaskit/theme/constants';
3
3
  import { borderRadius } from '@atlaskit/media-ui';
4
4
  import { N20 } from '@atlaskit/theme/colors';
5
- import { token } from '@atlaskit/tokens';
6
5
  import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
6
+ import { themed } from '@atlaskit/theme/components';
7
7
  import { transition } from '../../styles';
8
8
  import { fixedBlanketStyles, blanketClassName } from '../blanket/styles';
9
9
  import { fixedActionBarStyles, actionsBarClassName } from '../actionsBar/styles';
10
10
  import { generateResponsiveStyles, getClickablePlayButtonStyles, getCursorStyle, getSelectableTickBoxStyles, getWrapperDimensions, getWrapperShadow } from '../styles';
11
+ const BACKGROUND_COLOR_DARK = '#22272C';
11
12
  export const newFileExperienceWrapperStyles = ({
12
13
  breakpoint,
13
14
  dimensions,
@@ -18,7 +19,8 @@ export const newFileExperienceWrapperStyles = ({
18
19
  isPlayButtonClickable,
19
20
  isTickBoxSelectable,
20
21
  shouldDisplayTooltip,
21
- mediaCardCursor
22
+ mediaCardCursor,
23
+ theme
22
24
  }) => css`
23
25
  ${transition()}
24
26
  box-sizing: border-box;
@@ -28,7 +30,12 @@ export const newFileExperienceWrapperStyles = ({
28
30
  position: relative;
29
31
  font-family: ${fontFamily()};
30
32
  ${getWrapperDimensions(dimensions, appearance)}
31
- ${displayBackground && `background-color: ${token('color.background.neutral', N20)};`}
33
+ ${displayBackground && `background: ${themed({
34
+ light: `var(--ds-background-neutral, ${N20})`,
35
+ dark: `var(--ds-background-neutral, ${BACKGROUND_COLOR_DARK})`
36
+ })({
37
+ theme
38
+ })};`}
32
39
  ${borderRadius}
33
40
  ${getCursorStyle(mediaCardCursor)}
34
41
  ${getWrapperShadow(disableOverlay, selected)}
@@ -1,6 +1,5 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N0, N90A } from '@atlaskit/theme/colors';
3
- import { token } from '@atlaskit/tokens';
4
3
  export const playButtonClassName = 'media-card-play-button';
5
4
  export const bkgClassName = 'play-icon-background';
6
5
  const discSize = 48;
@@ -20,7 +19,7 @@ export const playButtonWrapperStyles = css`
20
19
  display: flex;
21
20
  align-items: center;
22
21
  justify-content: center;
23
- color: ${token('color.icon.inverse', N0)};
22
+ color: ${`var(--ds-icon-inverse, ${N0})`};
24
23
  span {
25
24
  position: absolute;
26
25
  }
@@ -31,6 +30,6 @@ export const backgroundStyles = css`
31
30
  position: absolute;
32
31
  width: ${discSize}px;
33
32
  height: ${discSize}px;
34
- background: ${token('color.background.neutral.bold', N90A)};
33
+ background: ${`var(--ds-background-neutral-bold, ${N90A})`};
35
34
  border-radius: 100%;
36
35
  `;
@@ -1,7 +1,6 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { borderRadius } from '@atlaskit/media-ui';
3
3
  import { N60A } from '@atlaskit/theme/colors';
4
- import { token } from '@atlaskit/tokens';
5
4
  import { akEditorSelectedBoxShadow } from '@atlaskit/editor-shared-styles/consts';
6
5
  import { getCSSUnitValue } from '../../utils/getCSSUnitValue';
7
6
  import { getDefaultCardDimensions } from '../../utils/cardDimensions';
@@ -39,7 +38,7 @@ export const getWrapperDimensions = (dimensions, appearance) => {
39
38
  // CSS outline has no 'radius', therefore we can't achieve the same effect with it
40
39
 
41
40
  export const getWrapperShadow = (disableOverlay, selected) => {
42
- const withOverlayShadow = !disableOverlay ? `${token('elevation.shadow.raised', `0 1px 1px ${N60A}, 0 0 1px 0 ${N60A}`)}` : '';
41
+ const withOverlayShadow = !disableOverlay ? `${`var(--ds-shadow-raised, ${`0 1px 1px ${N60A}, 0 0 1px 0 ${N60A}`})`}` : '';
43
42
  const selectedShadow = selected ? akEditorSelectedBoxShadow : '';
44
43
  const shadow = [selectedShadow, withOverlayShadow].filter(Boolean).join(', ');
45
44
  return shadow ? `box-shadow: ${shadow};` : '';
@@ -1,14 +1,13 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { transition } from '../../styles';
3
3
  import { B200, N0, N100 } from '@atlaskit/theme/colors';
4
- import { token } from '@atlaskit/tokens';
5
4
  export const tickBoxClassName = 'media-card-tickbox';
6
5
  export const tickboxFixedStyles = `
7
- background-color: ${token('color.background.input', N0)};
8
- color: ${token('color.icon.subtle', N100)};
6
+ background-color: ${`var(--ds-background-input, ${N0})`};
7
+ color: ${`var(--ds-icon-subtle, ${N100})`};
9
8
  `;
10
- export const getSelectedStyles = selected => selected ? `background-color: ${token('color.icon.information', B200)};
11
- color: ${token('color.icon.inverse', 'white')};` : ``;
9
+ export const getSelectedStyles = selected => selected ? `background-color: ${`var(--ds-icon-information, ${B200})`};
10
+ color: ${"var(--ds-icon-inverse, white)"};` : ``;
12
11
  export const wrapperStyles = selected => css`
13
12
  ${transition()}
14
13
  font-size: 14px;
@@ -3,7 +3,6 @@ import { FormattedMessage } from 'react-intl-next';
3
3
  import EditorWarningIcon from '@atlaskit/icon/glyph/editor/warning';
4
4
  import { messages } from '@atlaskit/media-ui';
5
5
  import { R300 } from '@atlaskit/theme/colors';
6
- import { token } from '@atlaskit/tokens';
7
6
  import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
8
7
  export const FailedTitleBox = ({
9
8
  breakpoint,
@@ -14,6 +13,6 @@ export const FailedTitleBox = ({
14
13
  }, /*#__PURE__*/React.createElement(ErrorMessageWrapper, null, /*#__PURE__*/React.createElement(EditorWarningIcon, {
15
14
  label: 'Warning',
16
15
  size: 'small',
17
- primaryColor: token('color.text.danger', R300)
16
+ primaryColor: `var(--ds-text-danger, ${R300})`
18
17
  }), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, customMessage))));
19
18
  };
@@ -1,8 +1,8 @@
1
1
  import { css } from '@emotion/react';
2
- import { token } from '@atlaskit/tokens';
3
2
  import { responsiveSettings, getTitleBoxHeight, Breakpoint } from '../common';
4
- import { N0 } from '@atlaskit/theme/colors';
3
+ import { N0, N800 } from '@atlaskit/theme/colors';
5
4
  import { rgba } from '../../styles/mixins';
5
+ import { themed } from '@atlaskit/theme/components';
6
6
 
7
7
  const generateResponsiveStyles = (breakpoint = Breakpoint.SMALL) => {
8
8
  const setting = responsiveSettings[breakpoint];
@@ -14,15 +14,29 @@ const generateResponsiveStyles = (breakpoint = Breakpoint.SMALL) => {
14
14
  };
15
15
 
16
16
  const HEX_REGEX = /^#[0-9A-F]{6}$/i;
17
+ const BACKGROUND_COLOR_DARK = '#161a1d';
18
+ const TEXT_COLOR_DARK = '#C7D1DB';
17
19
  export const titleBoxWrapperStyles = ({
18
20
  breakpoint,
19
- titleBoxBgColor
21
+ titleBoxBgColor,
22
+ theme
20
23
  }) => css`
21
24
  position: absolute;
22
25
  bottom: 0;
23
26
  width: 100%;
24
- background-color: ${token('elevation.surface', rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 0.8))};
25
- color: inherit;
27
+ background-color: ${themed({
28
+ light: `var(--ds-surface, ${rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 1)})`,
29
+ dark: `var(--ds-surface, ${rgba( // theme does not contain this color, use constant instead
30
+ titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : BACKGROUND_COLOR_DARK, 1)})`
31
+ })({
32
+ theme
33
+ })};
34
+ color: ${themed({
35
+ light: `var(--ds-text, ${N800})`,
36
+ dark: `var(--ds-text, ${TEXT_COLOR_DARK})`
37
+ })({
38
+ theme
39
+ })};
26
40
  cursor: inherit;
27
41
  pointer-events: none;
28
42
  display: flex;
@@ -31,8 +45,7 @@ export const titleBoxWrapperStyles = ({
31
45
  ${generateResponsiveStyles(breakpoint)}
32
46
  `;
33
47
  titleBoxWrapperStyles.displayName = 'TitleBoxWrapper';
34
- const infoStyles = `white-space: nowrap;
35
- overflow: hidden;`;
48
+ const infoStyles = `white-space: nowrap;overflow: hidden;`;
36
49
  const iconOverlapStyles = `padding-right: 10px;`;
37
50
  export const titleBoxHeaderStyles = ({
38
51
  hasIconOverlap
@@ -1,16 +1,19 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import { errorMessageWrapperStyles, titleBoxFooterStyles, titleBoxHeaderStyles, titleBoxIconStyles, titleBoxWrapperStyles } from './styles';
4
+ import { useGlobalTheme } from '@atlaskit/theme/components';
4
5
  export const TitleBoxWrapper = props => {
5
6
  const {
6
7
  breakpoint,
7
8
  titleBoxBgColor
8
9
  } = props;
10
+ const theme = useGlobalTheme();
9
11
  return jsx("div", {
10
12
  id: "titleBoxWrapper",
11
13
  css: titleBoxWrapperStyles({
12
14
  breakpoint: breakpoint,
13
- titleBoxBgColor: titleBoxBgColor
15
+ titleBoxBgColor: titleBoxBgColor,
16
+ theme
14
17
  })
15
18
  }, props.children);
16
19
  };
@@ -1,7 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
- import { token } from '@atlaskit/tokens';
5
4
  import WarningIcon from '@atlaskit/icon/glyph/editor/warning';
6
5
  import { N20, N800, Y500 } from '@atlaskit/theme/colors';
7
6
  import { fontSize } from '@atlaskit/theme/constants';
@@ -42,8 +41,8 @@ const wrapperStyles = (dimensions = defaultImageCardDimensions) => {
42
41
  return css`
43
42
  ${center};
44
43
  ${borderRadius};
45
- background: ${token('color.background.neutral', N20)};
46
- color: ${token('color.text.subtle', N800)};
44
+ background: ${`var(--ds-background-neutral, ${N20})`};
45
+ color: ${`var(--ds-text-subtle, ${N800})`};
47
46
  max-height: 100%;
48
47
  max-width: 100%;
49
48
  ${getConvertedDimension(dimensions)};
@@ -72,7 +71,7 @@ export class UnhandledErrorCard extends Component {
72
71
  onClick: onClick
73
72
  }, jsx(WarningIcon, {
74
73
  label: "Error",
75
- primaryColor: token('color.icon.warning', Y500),
74
+ primaryColor: `var(--ds-icon-warning, ${Y500})`,
76
75
  size: "medium"
77
76
  }), jsx("p", null, "We couldn't load this content"));
78
77
  }
@@ -65,7 +65,7 @@ class WrappedMediaInlineAnalyticsErrorBoundary extends React.Component {
65
65
  _defineProperty(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
66
66
 
67
67
  const packageName = "@atlaskit/media-card";
68
- const packageVersion = "74.4.0";
68
+ const packageVersion = "74.4.1";
69
69
  const MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
70
70
  packageVersion,
71
71
  packageName,
@@ -1,6 +1,5 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N500, N0 } from '@atlaskit/theme/colors';
3
- import { token } from '@atlaskit/tokens';
4
3
  import { borderRadius, size, center } from '@atlaskit/media-ui';
5
4
  import { rootStyles } from '../../card/styles';
6
5
  import { rgba } from '../../card/styles/mixins';
@@ -19,7 +18,7 @@ export let CardActionIconButtonVariant;
19
18
 
20
19
  const getVariantStyles = variant => {
21
20
  return variant === 'filled' ? `
22
- background-color: ${token('elevation.surface.overlay', rgba(N0, 0.8))};
21
+ background-color: ${`var(--ds-surface-overlay, ${rgba(N0, 0.8)})`};
23
22
  margin-right: 8px;
24
23
 
25
24
  &:last-child {
@@ -27,11 +26,11 @@ const getVariantStyles = variant => {
27
26
  }
28
27
 
29
28
  &:hover {
30
- background-color: ${token('elevation.surface.overlay.hovered', rgba(N0, 0.6))}
29
+ background-color: ${`var(--ds-surface-overlay-hovered, ${rgba(N0, 0.6)})`}
31
30
  }
32
31
  ` : `
33
32
  &:hover {
34
- background-color: ${token('color.background.neutral.subtle.hovered', 'rgba(9, 30, 66, 0.06)')};
33
+ background-color: ${"var(--ds-background-neutral-subtle-hovered, rgba(9, 30, 66, 0.06))"};
35
34
  }
36
35
  `;
37
36
  };
@@ -42,7 +41,7 @@ export const cardActionButtonStyles = ({
42
41
  ${center}
43
42
  ${borderRadius}
44
43
  ${size(26)}
45
- color: ${token('color.icon', N500)};
44
+ color: ${`var(--ds-icon, ${N500})`};
46
45
 
47
46
  &:hover {
48
47
  cursor: pointer;
@@ -1,6 +1,5 @@
1
- import { token } from '@atlaskit/tokens';
2
1
  import { css } from '@emotion/react';
3
2
  export const errorIconWrapperStyles = css`
4
3
  display: flex;
5
- color: ${token('color.icon.warning', '#ff991f')};
4
+ color: ${"var(--ds-icon-warning, #ff991f)"};
6
5
  `;