@atlaskit/smart-card 34.1.1 → 34.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/EmbedCard/components/IFrame.js +6 -3
  4. package/dist/cjs/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
  5. package/dist/cjs/view/EmbedModal/components/embed-content/index.js +23 -14
  6. package/dist/cjs/view/EmbedModal/components/embed-content/indexOld.js +37 -0
  7. package/dist/cjs/view/EmbedModal/components/link-info/index.compiled.css +35 -0
  8. package/dist/cjs/view/EmbedModal/components/link-info/index.js +58 -49
  9. package/dist/cjs/view/EmbedModal/components/link-info/indexOld.js +131 -0
  10. package/dist/cjs/view/FlexibleCard/components/container/index.compiled.css +38 -0
  11. package/dist/cjs/view/FlexibleCard/components/container/index.js +94 -87
  12. package/dist/cjs/view/FlexibleCard/components/container/indexOld.js +226 -0
  13. package/dist/cjs/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +75 -0
  14. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
  15. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +20 -46
  16. package/dist/cjs/view/LinkUrl/index.js +1 -1
  17. package/dist/es2019/utils/analytics/analytics.js +1 -1
  18. package/dist/es2019/view/EmbedCard/components/IFrame.js +5 -2
  19. package/dist/es2019/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
  20. package/dist/es2019/view/EmbedModal/components/embed-content/index.js +19 -13
  21. package/dist/es2019/view/EmbedModal/components/embed-content/indexOld.js +31 -0
  22. package/dist/es2019/view/EmbedModal/components/link-info/index.compiled.css +35 -0
  23. package/dist/es2019/view/EmbedModal/components/link-info/index.js +59 -49
  24. package/dist/es2019/view/EmbedModal/components/link-info/indexOld.js +122 -0
  25. package/dist/es2019/view/FlexibleCard/components/container/index.compiled.css +38 -0
  26. package/dist/es2019/view/FlexibleCard/components/container/index.js +88 -105
  27. package/dist/es2019/view/FlexibleCard/components/container/indexOld.js +229 -0
  28. package/dist/es2019/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +69 -0
  29. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
  30. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +16 -45
  31. package/dist/es2019/view/LinkUrl/index.js +1 -1
  32. package/dist/esm/utils/analytics/analytics.js +1 -1
  33. package/dist/esm/view/EmbedCard/components/IFrame.js +6 -3
  34. package/dist/esm/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
  35. package/dist/esm/view/EmbedModal/components/embed-content/index.js +19 -13
  36. package/dist/esm/view/EmbedModal/components/embed-content/indexOld.js +30 -0
  37. package/dist/esm/view/EmbedModal/components/link-info/index.compiled.css +35 -0
  38. package/dist/esm/view/EmbedModal/components/link-info/index.js +59 -49
  39. package/dist/esm/view/EmbedModal/components/link-info/indexOld.js +120 -0
  40. package/dist/esm/view/FlexibleCard/components/container/index.compiled.css +38 -0
  41. package/dist/esm/view/FlexibleCard/components/container/index.js +88 -87
  42. package/dist/esm/view/FlexibleCard/components/container/indexOld.js +217 -0
  43. package/dist/esm/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +68 -0
  44. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
  45. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +16 -45
  46. package/dist/esm/view/LinkUrl/index.js +1 -1
  47. package/dist/types/view/EmbedCard/components/IFrame.d.ts +2 -1
  48. package/dist/types/view/EmbedModal/components/embed-content/index.d.ts +3 -7
  49. package/dist/types/view/EmbedModal/components/embed-content/indexOld.d.ts +8 -0
  50. package/dist/types/view/EmbedModal/components/link-info/index.d.ts +3 -3
  51. package/dist/types/view/EmbedModal/components/link-info/indexOld.d.ts +4 -0
  52. package/dist/types/view/FlexibleCard/components/container/index.d.ts +10 -10
  53. package/dist/types/view/FlexibleCard/components/container/indexOld.d.ts +24 -0
  54. package/dist/types/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.d.ts +13 -0
  55. package/dist/types/view/FlexibleCard/components/container/layered-link/index.d.ts +2 -11
  56. package/dist/types-ts4.5/view/EmbedCard/components/IFrame.d.ts +2 -1
  57. package/dist/types-ts4.5/view/EmbedModal/components/embed-content/index.d.ts +3 -7
  58. package/dist/types-ts4.5/view/EmbedModal/components/embed-content/indexOld.d.ts +8 -0
  59. package/dist/types-ts4.5/view/EmbedModal/components/link-info/index.d.ts +3 -3
  60. package/dist/types-ts4.5/view/EmbedModal/components/link-info/indexOld.d.ts +4 -0
  61. package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +10 -10
  62. package/dist/types-ts4.5/view/FlexibleCard/components/container/indexOld.d.ts +24 -0
  63. package/dist/types-ts4.5/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.d.ts +13 -0
  64. package/dist/types-ts4.5/view/FlexibleCard/components/container/layered-link/index.d.ts +2 -11
  65. package/package.json +1 -1
  66. /package/dist/cjs/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
  67. /package/dist/es2019/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
  68. /package/dist/esm/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
  69. /package/dist/types/view/EmbedModal/components/link-info/{styled.d.ts → styledOld.d.ts} +0 -0
  70. /package/dist/types-ts4.5/view/EmbedModal/components/link-info/{styled.d.ts → styledOld.d.ts} +0 -0
@@ -1,15 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["childRef"];
3
+ var _excluded = ["childRef", "className"];
4
4
  import React from 'react';
5
5
  /**
6
6
  * Iframe element isolated for DI purposes
7
7
  */
8
8
  export var IFrame = function IFrame(_ref) {
9
9
  var childRef = _ref.childRef,
10
+ className = _ref.className,
10
11
  props = _objectWithoutProperties(_ref, _excluded);
11
- // eslint-disable-next-line jsx-a11y/iframe-has-title
12
- return /*#__PURE__*/React.createElement("iframe", _extends({}, props, {
12
+ // eslint-disable-next-line jsx-a11y/iframe-has-title,@atlaskit/ui-styling-standard/no-classname-prop
13
+ return /*#__PURE__*/React.createElement("iframe", _extends({
14
+ className: className
15
+ }, props, {
13
16
  ref: childRef
14
17
  }));
15
18
  };
@@ -0,0 +1,2 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._4t3i815d{height:calc(100vh - 13pc)}
@@ -1,16 +1,14 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { css, jsx } from '@emotion/react';
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./index.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
7
6
  import { di } from 'react-magnetic-di';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { getIframeSandboxAttribute } from '../../../../utils';
9
9
  import { IFrame } from '../../../EmbedCard/components/IFrame';
10
- var iframeCss = css({
11
- width: '100%',
12
- height: 'calc(100vh - 208px)'
13
- });
10
+ import EmbedContentOld from './indexOld';
11
+ var iframeCss = null;
14
12
  var EmbedContent = function EmbedContent(_ref) {
15
13
  var isTrusted = _ref.isTrusted,
16
14
  name = _ref.name,
@@ -18,13 +16,21 @@ var EmbedContent = function EmbedContent(_ref) {
18
16
  testId = _ref.testId;
19
17
  var sandbox = getIframeSandboxAttribute(isTrusted);
20
18
  var props = {
21
- css: iframeCss,
22
19
  frameBorder: 0,
23
20
  name: name,
24
21
  sandbox: sandbox,
25
22
  src: src,
26
23
  'data-testid': "".concat(testId, "-embed")
27
24
  };
28
- return jsx(IFrame, props);
25
+ return /*#__PURE__*/React.createElement(IFrame, _extends({}, props, {
26
+ className: ax(["_1bsb1osq _4t3i815d"])
27
+ }));
29
28
  };
30
- export default EmbedContent;
29
+ var Exported = function Exported(props) {
30
+ if (fg('bandicoots-compiled-migration-smartcard')) {
31
+ return /*#__PURE__*/React.createElement(EmbedContent, props);
32
+ } else {
33
+ return /*#__PURE__*/React.createElement(EmbedContentOld, props);
34
+ }
35
+ };
36
+ export default Exported;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { css, jsx } from '@emotion/react';
7
+ import { di } from 'react-magnetic-di';
8
+ import { getIframeSandboxAttribute } from '../../../../utils';
9
+ import { IFrame } from '../../../EmbedCard/components/IFrame';
10
+ var iframeCss = css({
11
+ width: '100%',
12
+ height: 'calc(100vh - 208px)'
13
+ });
14
+ var EmbedContent = function EmbedContent(_ref) {
15
+ var isTrusted = _ref.isTrusted,
16
+ name = _ref.name,
17
+ src = _ref.src,
18
+ testId = _ref.testId;
19
+ var sandbox = getIframeSandboxAttribute(isTrusted);
20
+ var props = {
21
+ css: iframeCss,
22
+ frameBorder: 0,
23
+ name: name,
24
+ sandbox: sandbox,
25
+ src: src,
26
+ 'data-testid': "".concat(testId, "-embed")
27
+ };
28
+ return jsx(IFrame, props);
29
+ };
30
+ export default EmbedContent;
@@ -0,0 +1,35 @@
1
+
2
+ ._1umo1bk4 h3{font:var(--ds-font-heading-small,normal 600 1pc/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
4
+ ._zulpu2gc{gap:var(--ds-space-100,8px)}._101p15vq h3{overflow-x:hidden}
5
+ ._12bo15vq h3{overflow-y:hidden}
6
+ ._16jlidpf{flex-grow:0}
7
+ ._16jlkb7n{flex-grow:1}
8
+ ._19bv1ejb{padding-left:var(--ds-space-300,24px)}
9
+ ._1bah1yb4{justify-content:space-between}
10
+ ._1bsb1tcg, ._1xyl1tcg [data-smart-element-icon] img, ._1h1b1tcg [data-smart-element-icon] span, ._prfw1tcg [data-smart-element-icon] svg, ._mezj1tcg img, ._e2oo1tcg span, ._w8l51tcg svg{width:24px}
11
+ ._1e0c1txw{display:flex}
12
+ ._1flvcj1k h3{display:-webkit-box}
13
+ ._1o9zidpf{flex-shrink:0}
14
+ ._1o9zkb7n{flex-shrink:1}
15
+ ._1r7d1hna h3{word-break:break-word}
16
+ ._1tke1tcg, ._x9xj1tcg [data-smart-element-icon] img, ._v5981tcg [data-smart-element-icon] span, ._z15s1tcg [data-smart-element-icon] svg, ._qci81tcg img, ._15iz1tcg span, ._erub1tcg svg{min-height:24px}
17
+ ._1ul91tcg, ._1ekg1tcg [data-smart-element-icon] img, ._jbhf1tcg [data-smart-element-icon] span, ._11hh1tcg [data-smart-element-icon] svg, ._1rg21tcg img, ._q7cv1tcg span, ._xwbj1tcg svg{min-width:24px}
18
+ ._1wkfkb7n h3{flex-shrink:1}
19
+ ._4cvr1h6o{align-items:center}
20
+ ._4t3i1tcg, ._gire1tcg [data-smart-element-icon] img, ._yrry1tcg [data-smart-element-icon] span, ._1bnm1tcg [data-smart-element-icon] svg, ._bna71tcg img, ._1xjx1tcg span, ._17521tcg svg{height:24px}
21
+ ._4wztidpf h3{margin-bottom:0}
22
+ ._923e1wug h3{flex-basis:auto}
23
+ ._c71l1tcg, ._1q121tcg [data-smart-element-icon] img, ._2s1x1tcg [data-smart-element-icon] span, ._1rh41tcg [data-smart-element-icon] svg, ._19l31tcg img, ._1pr21tcg span, ._1u5t1tcg svg{max-height:24px}
24
+ ._c7bk1l2s h3{text-overflow:ellipsis}
25
+ ._ca0q1ejb{padding-top:var(--ds-space-300,24px)}
26
+ ._i0dl1wug{flex-basis:auto}
27
+ ._n3tddlk8{padding-bottom:14px}
28
+ ._p12f1tcg, ._1mj01tcg [data-smart-element-icon] img, ._1r9c1tcg [data-smart-element-icon] span, ._1xch1tcg [data-smart-element-icon] svg, ._rtys1tcg img, ._b8nk1tcg span, ._4x201tcg svg{max-width:24px}
29
+ ._r8nti7a9 h3{font-weight:var(--ds-font-weight-regular,400)}
30
+ ._shpw1e54 h3{-webkit-box-orient:vertical}
31
+ ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
32
+ ._uepwkb7n h3{-webkit-line-clamp:1}
33
+ ._yrj2kb7n h3{flex-grow:1}
34
+ @media only screen and (max-width:980px){._3kllglyw .smart-link-resize-button{display:none}}
35
+ @supports not (-webkit-line-clamp:1){._130wgktf h3{max-height:20px}}
@@ -1,11 +1,7 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
5
4
  import React, { useMemo } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { jsx } from '@emotion/react';
9
5
  import { FormattedMessage } from 'react-intl-next';
10
6
  import Heading from '@atlaskit/heading';
11
7
  import DownloadIcon from '@atlaskit/icon/core/download';
@@ -16,11 +12,22 @@ import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut'
16
12
  import DownloadIconLegacy from '@atlaskit/icon/glyph/download';
17
13
  import VidFullScreenOffIcon from '@atlaskit/icon/glyph/vid-full-screen-off';
18
14
  import { useModal } from '@atlaskit/modal-dialog';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
19
16
  import { messages } from '../../../../messages';
20
17
  import { Icon } from '../../../common/Icon';
21
18
  import { MAX_MODAL_SIZE } from '../../constants';
19
+ import LinkInfoOld from './indexOld';
22
20
  import LinkInfoButton from './link-info-button';
23
- import { actionCss, containerStyles, iconCss, titleCss } from './styled';
21
+ var containerStyles = null;
22
+ var iconSize = '24px';
23
+
24
+ // EDM-7328: CSS Specificity
25
+ // An embed modal icon css for img, span, svg has specificity weight of 0-1-1.
26
+ // Specify flex ui icon selector to increase specificity weight to 0-2-1.
27
+ var iconCss = null;
28
+ var height = '20px';
29
+ var titleCss = null;
30
+ var actionCss = null;
24
31
  var LinkInfo = function LinkInfo(_ref) {
25
32
  var icon = _ref.icon,
26
33
  providerName = _ref.providerName,
@@ -34,9 +41,9 @@ var LinkInfo = function LinkInfo(_ref) {
34
41
  onClose = _useModal.onClose;
35
42
  var downloadButton = useMemo(function () {
36
43
  if (onDownloadButtonClick) {
37
- return jsx(LinkInfoButton, {
38
- content: jsx(FormattedMessage, messages.download),
39
- icon: jsx(DownloadIcon, {
44
+ return /*#__PURE__*/React.createElement(LinkInfoButton, {
45
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
46
+ icon: /*#__PURE__*/React.createElement(DownloadIcon, {
40
47
  label: messages.download.defaultMessage,
41
48
  LEGACY_fallbackIcon: DownloadIconLegacy,
42
49
  spacing: "spacious",
@@ -49,10 +56,10 @@ var LinkInfo = function LinkInfo(_ref) {
49
56
  }, [onDownloadButtonClick, testId]);
50
57
  var urlButton = useMemo(function () {
51
58
  if (onViewButtonClick) {
52
- var content = providerName ? jsx(React.Fragment, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal);
53
- return jsx(LinkInfoButton, {
59
+ var content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
60
+ return /*#__PURE__*/React.createElement(LinkInfoButton, {
54
61
  content: content,
55
- icon: jsx(ShortcutIcon, {
62
+ icon: /*#__PURE__*/React.createElement(ShortcutIcon, {
56
63
  label: messages.viewOriginal.defaultMessage,
57
64
  spacing: "spacious",
58
65
  color: "currentColor"
@@ -65,56 +72,59 @@ var LinkInfo = function LinkInfo(_ref) {
65
72
  var sizeButton = useMemo(function () {
66
73
  var isFullScreen = size === MAX_MODAL_SIZE;
67
74
  var message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
68
- var icon = isFullScreen ? jsx(FullscreenExitIcon, {
75
+ var icon = isFullScreen ? /*#__PURE__*/React.createElement(FullscreenExitIcon, {
69
76
  LEGACY_fallbackIcon: VidFullScreenOffIcon,
70
77
  label: message.defaultMessage,
71
78
  spacing: "spacious",
72
79
  color: "currentColor"
73
- }) : jsx(VidFullScreenOnIcon, {
80
+ }) : /*#__PURE__*/React.createElement(VidFullScreenOnIcon, {
74
81
  label: message.defaultMessage,
75
82
  spacing: "spacious",
76
83
  color: "currentColor"
77
84
  });
78
85
  return (
86
+ /*#__PURE__*/
79
87
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
80
- jsx("span", {
88
+ React.createElement("span", {
81
89
  className: "smart-link-resize-button"
82
- }, jsx(LinkInfoButton, {
83
- content: jsx(FormattedMessage, message),
90
+ }, /*#__PURE__*/React.createElement(LinkInfoButton, {
91
+ content: /*#__PURE__*/React.createElement(FormattedMessage, message),
84
92
  icon: icon,
85
93
  onClick: onResizeButtonClick,
86
94
  testId: "".concat(testId, "-resize")
87
95
  }))
88
96
  );
89
97
  }, [onResizeButtonClick, size, testId]);
90
- return (
91
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
92
- jsx("div", {
93
- css: containerStyles
94
- }, icon &&
95
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
96
- jsx("div", {
97
- css: iconCss,
98
- "data-testid": "".concat(testId, "-icon")
99
- }, jsx(Icon, icon)), jsx("div", {
100
- css: titleCss
101
- }, jsx(Heading, {
102
- size: "medium",
103
- testId: "".concat(testId, "-title")
104
- }, title), jsx("span", {
105
- tabIndex: 0
106
- })), jsx("div", {
107
- css: actionCss
108
- }, downloadButton, urlButton, sizeButton, jsx(LinkInfoButton, {
109
- content: jsx(FormattedMessage, messages.preview_close),
110
- icon: jsx(CrossIcon, {
111
- label: messages.preview_close.defaultMessage,
112
- color: "currentColor",
113
- spacing: "spacious"
114
- }),
115
- onClick: onClose,
116
- testId: "".concat(testId, "-close")
117
- })))
118
- );
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ className: ax(["_zulpu2gc _4cvr1h6o _1e0c1txw _1bah1yb4 _ca0q1ejb _u5f31ejb _n3tddlk8 _19bv1ejb"])
100
+ }, icon && /*#__PURE__*/React.createElement("div", {
101
+ "data-testid": "".concat(testId, "-icon"),
102
+ className: ax(["_4t3i1tcg _gire1tcg _yrry1tcg _1bnm1tcg _bna71tcg _1xjx1tcg _17521tcg _1tke1tcg _x9xj1tcg _v5981tcg _z15s1tcg _qci81tcg _15iz1tcg _erub1tcg _c71l1tcg _1q121tcg _2s1x1tcg _1rh41tcg _19l31tcg _1pr21tcg _1u5t1tcg _1bsb1tcg _1xyl1tcg _1h1b1tcg _prfw1tcg _mezj1tcg _e2oo1tcg _w8l51tcg _1ul91tcg _1ekg1tcg _jbhf1tcg _11hh1tcg _1rg21tcg _q7cv1tcg _xwbj1tcg _p12f1tcg _1mj01tcg _1r9c1tcg _1xch1tcg _rtys1tcg _b8nk1tcg _4x201tcg"])
103
+ }, /*#__PURE__*/React.createElement(Icon, icon)), /*#__PURE__*/React.createElement("div", {
104
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dl1wug _yrj2kb7n _1wkfkb7n _923e1wug _1umo1bk4 _101p15vq _12bo15vq _r8nti7a9 _1flvcj1k _4wztidpf _c7bk1l2s _1r7d1hna _uepwkb7n _shpw1e54 _130wgktf"])
105
+ }, /*#__PURE__*/React.createElement(Heading, {
106
+ size: "medium",
107
+ testId: "".concat(testId, "-title")
108
+ }, title), /*#__PURE__*/React.createElement("span", {
109
+ tabIndex: 0
110
+ })), /*#__PURE__*/React.createElement("div", {
111
+ className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
112
+ }, downloadButton, urlButton, sizeButton, /*#__PURE__*/React.createElement(LinkInfoButton, {
113
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
114
+ icon: /*#__PURE__*/React.createElement(CrossIcon, {
115
+ label: messages.preview_close.defaultMessage,
116
+ color: "currentColor",
117
+ spacing: "spacious"
118
+ }),
119
+ onClick: onClose,
120
+ testId: "".concat(testId, "-close")
121
+ })));
122
+ };
123
+ var Exported = function Exported(props) {
124
+ if (fg('bandicoots-compiled-migration-smartcard')) {
125
+ return /*#__PURE__*/React.createElement(LinkInfo, props);
126
+ } else {
127
+ return /*#__PURE__*/React.createElement(LinkInfoOld, props);
128
+ }
119
129
  };
120
- export default LinkInfo;
130
+ export default Exported;
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React, { useMemo } from 'react';
6
+
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
+ import { jsx } from '@emotion/react';
9
+ import { FormattedMessage } from 'react-intl-next';
10
+ import Heading from '@atlaskit/heading';
11
+ import DownloadIcon from '@atlaskit/icon/core/download';
12
+ import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
13
+ import CrossIcon from '@atlaskit/icon/core/migration/close--cross';
14
+ import VidFullScreenOnIcon from '@atlaskit/icon/core/migration/fullscreen-enter--vid-full-screen-on';
15
+ import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
16
+ import DownloadIconLegacy from '@atlaskit/icon/glyph/download';
17
+ import VidFullScreenOffIcon from '@atlaskit/icon/glyph/vid-full-screen-off';
18
+ import { useModal } from '@atlaskit/modal-dialog';
19
+ import { messages } from '../../../../messages';
20
+ import { Icon } from '../../../common/Icon';
21
+ import { MAX_MODAL_SIZE } from '../../constants';
22
+ import LinkInfoButton from './link-info-button';
23
+ import { actionCss, containerStyles, iconCss, titleCss } from './styledOld';
24
+ var LinkInfo = function LinkInfo(_ref) {
25
+ var icon = _ref.icon,
26
+ providerName = _ref.providerName,
27
+ onDownloadButtonClick = _ref.onDownloadButtonClick,
28
+ onResizeButtonClick = _ref.onResizeButtonClick,
29
+ onViewButtonClick = _ref.onViewButtonClick,
30
+ size = _ref.size,
31
+ testId = _ref.testId,
32
+ title = _ref.title;
33
+ var _useModal = useModal(),
34
+ onClose = _useModal.onClose;
35
+ var downloadButton = useMemo(function () {
36
+ if (onDownloadButtonClick) {
37
+ return jsx(LinkInfoButton, {
38
+ content: jsx(FormattedMessage, messages.download),
39
+ icon: jsx(DownloadIcon, {
40
+ label: messages.download.defaultMessage,
41
+ LEGACY_fallbackIcon: DownloadIconLegacy,
42
+ spacing: "spacious",
43
+ color: "currentColor"
44
+ }),
45
+ onClick: onDownloadButtonClick,
46
+ testId: "".concat(testId, "-download")
47
+ });
48
+ }
49
+ }, [onDownloadButtonClick, testId]);
50
+ var urlButton = useMemo(function () {
51
+ if (onViewButtonClick) {
52
+ var content = providerName ? jsx(React.Fragment, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal);
53
+ return jsx(LinkInfoButton, {
54
+ content: content,
55
+ icon: jsx(ShortcutIcon, {
56
+ label: messages.viewOriginal.defaultMessage,
57
+ spacing: "spacious",
58
+ color: "currentColor"
59
+ }),
60
+ onClick: onViewButtonClick,
61
+ testId: "".concat(testId, "-url")
62
+ });
63
+ }
64
+ }, [onViewButtonClick, providerName, testId]);
65
+ var sizeButton = useMemo(function () {
66
+ var isFullScreen = size === MAX_MODAL_SIZE;
67
+ var message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
68
+ var icon = isFullScreen ? jsx(FullscreenExitIcon, {
69
+ LEGACY_fallbackIcon: VidFullScreenOffIcon,
70
+ label: message.defaultMessage,
71
+ spacing: "spacious",
72
+ color: "currentColor"
73
+ }) : jsx(VidFullScreenOnIcon, {
74
+ label: message.defaultMessage,
75
+ spacing: "spacious",
76
+ color: "currentColor"
77
+ });
78
+ return (
79
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
80
+ jsx("span", {
81
+ className: "smart-link-resize-button"
82
+ }, jsx(LinkInfoButton, {
83
+ content: jsx(FormattedMessage, message),
84
+ icon: icon,
85
+ onClick: onResizeButtonClick,
86
+ testId: "".concat(testId, "-resize")
87
+ }))
88
+ );
89
+ }, [onResizeButtonClick, size, testId]);
90
+ return (
91
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
92
+ jsx("div", {
93
+ css: containerStyles
94
+ }, icon &&
95
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
96
+ jsx("div", {
97
+ css: iconCss,
98
+ "data-testid": "".concat(testId, "-icon")
99
+ }, jsx(Icon, icon)), jsx("div", {
100
+ css: titleCss
101
+ }, jsx(Heading, {
102
+ size: "medium",
103
+ testId: "".concat(testId, "-title")
104
+ }, title), jsx("span", {
105
+ tabIndex: 0
106
+ })), jsx("div", {
107
+ css: actionCss
108
+ }, downloadButton, urlButton, sizeButton, jsx(LinkInfoButton, {
109
+ content: jsx(FormattedMessage, messages.preview_close),
110
+ icon: jsx(CrossIcon, {
111
+ label: messages.preview_close.defaultMessage,
112
+ color: "currentColor",
113
+ spacing: "spacious"
114
+ }),
115
+ onClick: onClose,
116
+ testId: "".concat(testId, "-close")
117
+ })))
118
+ );
119
+ };
120
+ export default LinkInfo;
@@ -0,0 +1,38 @@
1
+ ._18s8v77o{margin:var(--ds-space-025,2px)}
2
+ ._19itn8v0{border:var(--_vzvmm2)}
3
+ ._1yt418y6{padding:var(--_1xumd0e)}
4
+ ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
5
+ ._zulp1jvo{gap:1.25rem 0}
6
+ ._zulp1qos{gap:.5rem 0}
7
+ ._zulpfzsm{gap:.25rem 0}
8
+ ._zulph3jc{gap:1rem 0}
9
+ ._19bv15sf{padding-left:calc(var(--preview-block-width) + 1.25rem)}
10
+ ._19bv1ltm{padding-left:calc(var(--preview-block-width) + .25rem)}
11
+ ._19bvf557{padding-left:calc(var(--preview-block-width) + 1rem)}
12
+ ._19bvqox2{padding-left:calc(var(--preview-block-width) + .5rem)}
13
+ ._1e0c1txw{display:flex}
14
+ ._1pcmkb7n:hover~.actions-button-group{opacity:1}
15
+ ._1reo15vq{overflow-x:hidden}
16
+ ._1t4ckb7n .has-action, ._1nxdkb7n a, ._xnbykb7n button{z-index:1}
17
+ ._1ul9idpf{min-width:0}
18
+ ._1yob1j6v{--container-gap-right:1rem}
19
+ ._1yob1k92{--container-gap-right:1.25rem}
20
+ ._1yob1kwk{--container-gap-right:.5rem}
21
+ ._1yob1wow{--container-gap-right:var(--_12k13bg)}
22
+ ._1yob6mu8{--container-gap-right:.25rem}
23
+ ._2lx21bp4{flex-direction:column}
24
+ ._bfhkhp5a{background-color:var(--ds-surface-raised,#fff)}
25
+ ._jb7v18y6{--container-padding:var(--_1xumd0e)}
26
+ ._kqswh2mm{position:relative}
27
+ ._nqwih2mm .has-action, ._18ywh2mm a, ._1nq3h2mm button{position:relative}
28
+ ._r37x1r5k{--preview-block-width:30%}
29
+ ._u5f315sf{padding-right:calc(var(--preview-block-width) + 1.25rem)}
30
+ ._u5f31ltm{padding-right:calc(var(--preview-block-width) + .25rem)}
31
+ ._u5f3f557{padding-right:calc(var(--preview-block-width) + 1rem)}
32
+ ._u5f3qox2{padding-right:calc(var(--preview-block-width) + .5rem)}
33
+ ._y5vk167t{--container-gap-left:var(--_73mooq)}
34
+ ._y5vk1j6v{--container-gap-left:1rem}
35
+ ._y5vk1k92{--container-gap-left:1.25rem}
36
+ ._y5vk1kwk{--container-gap-left:.5rem}
37
+ ._y5vk6mu8{--container-gap-left:.25rem}
38
+ ._1v7y1i6y .has-action:focus, ._ufn21i6y a:focus{outline-offset:var(--ds-space-negative-025,-2px)}